@checkfirst/nestjs-outlook
Version:
An opinionated NestJS module for Microsoft Outlook integration that provides easy access to Microsoft Graph API for emails, calendars, and more.
41 lines • 1.68 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CreateOutlookTables1697025846000 = void 0;
class CreateOutlookTables1697025846000 {
async up(queryRunner) {
await queryRunner.query(`
CREATE TABLE outlook_webhook_subscriptions (
id INTEGER PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
subscription_id VARCHAR(255) NOT NULL,
user_id INTEGER NOT NULL,
resource VARCHAR(255) NOT NULL,
change_type VARCHAR(255) NOT NULL,
client_state VARCHAR(255) NOT NULL,
notification_url VARCHAR(255) NOT NULL,
expiration_date_time TIMESTAMP NOT NULL,
is_active BOOLEAN DEFAULT true,
access_token TEXT,
refresh_token TEXT,
created_at TIMESTAMP DEFAULT NOW() NOT NULL,
updated_at TIMESTAMP DEFAULT NOW() NOT NULL,
CONSTRAINT "UQ_outlook_webhook_subscriptions_id" UNIQUE (subscription_id)
);
`);
await queryRunner.query(`
CREATE TABLE microsoft_csrf_tokens (
id INTEGER PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
token VARCHAR(64) NOT NULL,
user_id VARCHAR(255) NOT NULL,
expires TIMESTAMP NOT NULL,
created_at TIMESTAMP DEFAULT NOW() NOT NULL,
CONSTRAINT "UQ_microsoft_csrf_tokens_token" UNIQUE (token)
);
`);
}
async down(queryRunner) {
await queryRunner.query(`DROP TABLE IF EXISTS outlook_webhook_subscriptions`);
await queryRunner.query(`DROP TABLE IF EXISTS microsoft_csrf_tokens`);
}
}
exports.CreateOutlookTables1697025846000 = CreateOutlookTables1697025846000;
//# sourceMappingURL=1697025846000-CreateOutlookTables.js.map