@checkfirst/nestjs-outlook 3.0.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +82 -102
  2. package/dist/controllers/microsoft-auth.controller.d.ts +2 -1
  3. package/dist/controllers/microsoft-auth.controller.js +14 -12
  4. package/dist/controllers/microsoft-auth.controller.js.map +1 -1
  5. package/dist/entities/microsoft-user.entity.d.ts +11 -0
  6. package/dist/entities/microsoft-user.entity.js +67 -0
  7. package/dist/entities/microsoft-user.entity.js.map +1 -0
  8. package/dist/entities/outlook-webhook-subscription.entity.d.ts +0 -2
  9. package/dist/entities/outlook-webhook-subscription.entity.js +0 -10
  10. package/dist/entities/outlook-webhook-subscription.entity.js.map +1 -1
  11. package/dist/{event-types.enum.d.ts → enums/event-types.enum.d.ts} +1 -2
  12. package/dist/{event-types.enum.js → enums/event-types.enum.js} +1 -2
  13. package/dist/enums/event-types.enum.js.map +1 -0
  14. package/dist/enums/permission-scope.enum.d.ts +7 -0
  15. package/dist/enums/permission-scope.enum.js +12 -0
  16. package/dist/enums/permission-scope.enum.js.map +1 -0
  17. package/dist/index.d.ts +8 -5
  18. package/dist/index.js +8 -5
  19. package/dist/index.js.map +1 -1
  20. package/dist/interfaces/config/outlook-config.interface.d.ts +1 -1
  21. package/dist/interfaces/microsoft-auth/state-object.interface.d.ts +4 -2
  22. package/dist/microsoft-outlook.module.js +6 -1
  23. package/dist/microsoft-outlook.module.js.map +1 -1
  24. package/dist/migrations/1699000000000-AddMicrosoftUserTable.d.ts +5 -0
  25. package/dist/migrations/1699000000000-AddMicrosoftUserTable.js +104 -0
  26. package/dist/migrations/1699000000000-AddMicrosoftUserTable.js.map +1 -0
  27. package/dist/repositories/outlook-webhook-subscription.repository.d.ts +1 -1
  28. package/dist/repositories/outlook-webhook-subscription.repository.js +1 -4
  29. package/dist/repositories/outlook-webhook-subscription.repository.js.map +1 -1
  30. package/dist/services/auth/microsoft-auth.service.d.ts +17 -6
  31. package/dist/services/auth/microsoft-auth.service.js +197 -69
  32. package/dist/services/auth/microsoft-auth.service.js.map +1 -1
  33. package/dist/services/calendar/calendar.service.d.ts +6 -8
  34. package/dist/services/calendar/calendar.service.js +49 -58
  35. package/dist/services/calendar/calendar.service.js.map +1 -1
  36. package/dist/services/email/email.service.d.ts +2 -5
  37. package/dist/services/email/email.service.js +17 -37
  38. package/dist/services/email/email.service.js.map +1 -1
  39. package/dist/tsconfig.tsbuildinfo +1 -1
  40. package/package.json +6 -5
  41. package/dist/event-types.enum.js.map +0 -1
package/README.md CHANGED
@@ -16,11 +16,11 @@ An opinionated NestJS module for Microsoft Outlook integration that provides eas
16
16
 
17
17
  ## Features
18
18
 
19
- - 🔄 Simplified Microsoft OAuth flow
20
- - 📅 Calendar events management
21
- - 📧 Email sending capabilities
22
- - 🔔 Real-time webhooks for changes
23
- - 🔐 Secure token storage and refresh
19
+ - 🔗 Simple Microsoft authentication integration
20
+ - 📅 Calendar management (create/update/delete events)
21
+ - 📧 Email sending with rich content
22
+ - 🔔 Real-time notifications via webhooks
23
+ - 🔍 Event-driven architecture for easy integration
24
24
 
25
25
  ## Installation
26
26
 
@@ -32,66 +32,42 @@ npm install @checkfirst/nestjs-outlook
32
32
 
33
33
  ### 1. Database Setup
34
34
 
35
- This library requires two database tables in your application's database. Create these tables using a migration:
35
+ This library requires database tables to store authentication and subscription data. You can use the built-in migrations to set up these tables automatically.
36
+
37
+ For details, see the [Migration Guide](src/migrations/README.md).
38
+
39
+ Alternatively, you can create the tables manually based on your database dialect (PostgreSQL, MySQL, etc.):
36
40
 
37
41
  ```typescript
38
42
  import { MigrationInterface, QueryRunner } from 'typeorm';
39
43
 
40
44
  export class CreateOutlookTables1697025846000 implements MigrationInterface {
41
45
  public async up(queryRunner: QueryRunner): Promise<void> {
42
- // Create outlook_webhook_subscriptions table
43
- await queryRunner.query(`
44
- CREATE TABLE outlook_webhook_subscriptions (
45
- id INTEGER PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
46
- subscription_id VARCHAR(255) NOT NULL,
47
- user_id INTEGER NOT NULL,
48
- resource VARCHAR(255) NOT NULL,
49
- change_type VARCHAR(255) NOT NULL,
50
- client_state VARCHAR(255) NOT NULL,
51
- notification_url VARCHAR(255) NOT NULL,
52
- expiration_date_time TIMESTAMP NOT NULL,
53
- is_active BOOLEAN DEFAULT true,
54
- access_token TEXT,
55
- refresh_token TEXT,
56
- created_at TIMESTAMP DEFAULT NOW() NOT NULL,
57
- updated_at TIMESTAMP DEFAULT NOW() NOT NULL
58
- );
59
- `);
60
-
61
- // Create microsoft_csrf_tokens table
62
- await queryRunner.query(`
63
- CREATE TABLE microsoft_csrf_tokens (
64
- id INTEGER PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
65
- token VARCHAR(64) NOT NULL,
66
- user_id VARCHAR(255) NOT NULL,
67
- expires TIMESTAMP NOT NULL,
68
- created_at TIMESTAMP DEFAULT NOW() NOT NULL,
69
- CONSTRAINT "UQ_microsoft_csrf_tokens_token" UNIQUE (token)
70
- );
71
- `);
46
+ // Create required tables for webhooks, authentication, and user data
47
+ // See the Migration Guide for details
72
48
  }
73
49
 
74
50
  public async down(queryRunner: QueryRunner): Promise<void> {
51
+ // Drop tables in reverse order
75
52
  await queryRunner.query(`DROP TABLE IF EXISTS outlook_webhook_subscriptions`);
76
53
  await queryRunner.query(`DROP TABLE IF EXISTS microsoft_csrf_tokens`);
54
+ await queryRunner.query(`DROP TABLE IF EXISTS microsoft_users`);
77
55
  }
78
56
  }
79
57
  ```
80
58
 
81
- You can customize this migration to match your database dialect (PostgreSQL, MySQL, etc.) if needed.
82
-
83
59
  ### 2. Microsoft App Registration
84
60
 
85
- Register your application in the Azure Portal to get a client ID and secret:
61
+ Register your application with Microsoft to get the necessary credentials:
86
62
 
87
63
  1. Go to the [Azure Portal](https://portal.azure.com/)
88
64
  2. Navigate to Azure Active Directory > App registrations
89
65
  3. Create a new registration
90
- 4. Configure redirects to include your callback URL
91
- 5. Add the following Microsoft Graph API permissions:
92
- - `Calendars.ReadWrite` - For calendar operations
93
- - `Mail.Send` - For sending emails
94
- - `offline_access` - For refresh tokens
66
+ 4. Configure redirects to include your callback URL (e.g., `https://your-api.example.com/auth/microsoft/callback`)
67
+ 5. Add Microsoft Graph API permissions based on what features you need:
68
+ - `Calendars.ReadWrite` - For calendar features
69
+ - `Mail.Send` - For email features
70
+ - `offline_access` - Required for all applications
95
71
 
96
72
  ### 3. Import Required Modules
97
73
 
@@ -142,7 +118,7 @@ The library provides a MicrosoftAuthController for handling authentication, but
142
118
 
143
119
  ```typescript
144
120
  import { Controller, Get, Req } from '@nestjs/common';
145
- import { MicrosoftAuthService } from '@checkfirst/nestjs-outlook';
121
+ import { MicrosoftAuthService, PermissionScope } from '@checkfirst/nestjs-outlook';
146
122
 
147
123
  @Controller('auth')
148
124
  export class AuthController {
@@ -155,37 +131,63 @@ export class AuthController {
155
131
  // In a real application, get the user ID from your authentication system
156
132
  const userId = req.user?.id.toString() || '1';
157
133
 
158
- // Get the login URL from the Microsoft auth service
159
- return await this.microsoftAuthService.getLoginUrl(userId);
134
+ // Get the login URL with specific permission scopes
135
+ return await this.microsoftAuthService.getLoginUrl(userId, [
136
+ PermissionScope.CALENDAR_READ,
137
+ PermissionScope.EMAIL_READ,
138
+ PermissionScope.EMAIL_SEND
139
+ ]);
160
140
  }
161
141
  }
162
142
  ```
163
143
 
164
- ## Available Services and Controllers
144
+ ## Permission Scopes
165
145
 
166
- The library provides specialized services and controllers for Microsoft Graph API operations:
146
+ You can request specific Microsoft permissions based on what your application needs:
167
147
 
168
- ### 1. MicrosoftAuthService and MicrosoftAuthController
148
+ ```typescript
149
+ import { PermissionScope } from '@checkfirst/nestjs-outlook';
150
+
151
+ // Available permission scopes:
152
+ PermissionScope.CALENDAR_READ // Read-only access to calendars
153
+ PermissionScope.CALENDAR_WRITE // Read-write access to calendars
154
+ PermissionScope.EMAIL_READ // Read-only access to emails
155
+ PermissionScope.EMAIL_WRITE // Read-write access to emails
156
+ PermissionScope.EMAIL_SEND // Permission to send emails
157
+ ```
169
158
 
170
- Handle authentication, token management, and OAuth flow:
159
+ When getting a login URL, specify which permissions you need:
171
160
 
172
161
  ```typescript
173
- // Initiate the OAuth flow - redirects user to Microsoft login
174
- const loginUrl = await microsoftAuthService.getLoginUrl(userId);
162
+ // For a calendar-only app
163
+ const loginUrl = await microsoftAuthService.getLoginUrl(userId, [
164
+ PermissionScope.CALENDAR_READ
165
+ ]);
166
+
167
+ // For an email-only app
168
+ const loginUrl = await microsoftAuthService.getLoginUrl(userId, [
169
+ PermissionScope.EMAIL_SEND
170
+ ]);
171
+ ```
175
172
 
176
- // Exchange OAuth code for tokens (used in callback endpoint)
177
- const tokens = await microsoftAuthService.exchangeCodeForToken(code, state);
173
+ ## Available Services and Controllers
174
+
175
+ The library provides specialized services and controllers for Microsoft integration:
178
176
 
179
- // Refresh an expired access token
180
- const newTokens = await microsoftAuthService.refreshAccessToken(refreshToken, userId);
177
+ ### 1. MicrosoftAuthService and MicrosoftAuthController
181
178
 
182
- // Check if a token is expired
183
- const isExpired = microsoftAuthService.isTokenExpired(tokenExpiryDate);
179
+ Handles the authentication flow with Microsoft:
180
+
181
+ ```typescript
182
+ // Get a login URL to redirect your user to Microsoft's OAuth page
183
+ const loginUrl = await microsoftAuthService.getLoginUrl(userId);
184
184
  ```
185
185
 
186
+ After the user authenticates with Microsoft, they'll be redirected to your callback URL where you can complete the process.
187
+
186
188
  ### 2. CalendarService and CalendarController
187
189
 
188
- Manage calendar operations with Microsoft Graph API:
190
+ Manage calendar operations:
189
191
 
190
192
  ```typescript
191
193
  // Create a calendar event
@@ -201,27 +203,22 @@ const event = {
201
203
  },
202
204
  };
203
205
 
206
+ // Create the event
204
207
  const result = await calendarService.createEvent(
205
208
  event,
206
- accessToken,
207
- refreshToken,
208
- tokenExpiry,
209
- userId,
209
+ externalUserId,
210
210
  calendarId
211
211
  );
212
212
 
213
213
  // Get user's default calendar ID
214
- const calendarId = await calendarService.getDefaultCalendarId(accessToken);
215
-
216
- // Create webhook subscription for calendar events
217
- await calendarService.createWebhookSubscription(userId, accessToken, refreshToken);
214
+ const calendarId = await calendarService.getDefaultCalendarId(externalUserId);
218
215
  ```
219
216
 
220
217
  The CalendarController provides a webhook endpoint at `/calendar/webhook` for receiving notifications from Microsoft Graph about calendar changes.
221
218
 
222
219
  ### 3. EmailService
223
220
 
224
- Provides email sending capabilities via Microsoft Graph API:
221
+ Send emails:
225
222
 
226
223
  ```typescript
227
224
  // Create email message
@@ -243,63 +240,46 @@ const message = {
243
240
  // Send the email
244
241
  const result = await emailService.sendEmail(
245
242
  message,
246
- accessToken,
247
- refreshToken,
248
- tokenExpiry,
249
- userId
243
+ externalUserId
250
244
  );
251
245
  ```
252
246
 
253
247
  ## Events
254
248
 
255
- The library uses NestJS's EventEmitter to emit events for various Outlook activities. You can listen to these events in your application to react to changes.
249
+ The library emits events for various Microsoft activities that you can listen to in your application.
256
250
 
257
251
  ### Available Events
258
252
 
259
- The library exposes event types through the `OutlookEventTypes` enum:
260
-
261
- - `OutlookEventTypes.AUTH_TOKENS_SAVE` - Emitted when OAuth tokens are initially saved
262
- - `OutlookEventTypes.AUTH_TOKENS_UPDATE` - Emitted when OAuth tokens are refreshed
263
- - `OutlookEventTypes.EVENT_CREATED` - Emitted when a new Outlook calendar event is created via webhook
264
- - `OutlookEventTypes.EVENT_UPDATED` - Emitted when an Outlook calendar event is updated via webhook
265
- - `OutlookEventTypes.EVENT_DELETED` - Emitted when an Outlook calendar event is deleted via webhook
253
+ - `USER_AUTHENTICATED` - When a user completes authentication with Microsoft
254
+ - `EVENT_CREATED` - When a new calendar event is created
255
+ - `EVENT_UPDATED` - When a calendar event is updated
256
+ - `EVENT_DELETED` - When a calendar event is deleted
257
+ - `EMAIL_RECEIVED` - When a new email is received
258
+ - `EMAIL_UPDATED` - When an email is updated
259
+ - `EMAIL_DELETED` - When an email is deleted
266
260
 
267
261
  ### Listening to Events
268
262
 
269
- You can listen to these events in your application using the `@OnEvent` decorator from `@nestjs/event-emitter` and the `OutlookEventTypes` enum:
270
-
271
263
  ```typescript
272
264
  import { Injectable } from '@nestjs/common';
273
265
  import { OnEvent } from '@nestjs/event-emitter';
274
- import { OutlookEventTypes, OutlookResourceData, TokenResponse } from '@checkfirst/nestjs-outlook';
266
+ import { OutlookEventTypes, OutlookResourceData } from '@checkfirst/nestjs-outlook';
275
267
 
276
268
  @Injectable()
277
269
  export class YourService {
278
- // Handle token save event
279
- @OnEvent(OutlookEventTypes.AUTH_TOKENS_SAVE)
280
- async handleAuthTokensSave(userId: string, tokenData: TokenResponse) {
281
- console.log(`Saving new tokens for user ${userId}`);
282
- // Save tokens to your database
270
+ // Handle user authentication event
271
+ @OnEvent(OutlookEventTypes.USER_AUTHENTICATED)
272
+ async handleUserAuthenticated(externalUserId: string, data: { externalUserId: string, scopes: string[] }) {
273
+ console.log(`User ${externalUserId} authenticated with Microsoft`);
274
+ // Perform any custom logic needed when a user authenticates
283
275
  }
284
276
 
285
277
  // Handle calendar events
286
278
  @OnEvent(OutlookEventTypes.EVENT_CREATED)
287
279
  handleOutlookEventCreated(data: OutlookResourceData) {
288
- console.log('New Outlook event created:', data.id);
280
+ console.log('New calendar event created:', data.id);
289
281
  // Handle the new event
290
282
  }
291
-
292
- @OnEvent(OutlookEventTypes.EVENT_UPDATED)
293
- handleOutlookEventUpdated(data: OutlookResourceData) {
294
- console.log('Outlook event updated:', data.id);
295
- // Handle the updated event
296
- }
297
-
298
- @OnEvent(OutlookEventTypes.EVENT_DELETED)
299
- handleOutlookEventDeleted(data: OutlookResourceData) {
300
- console.log('Outlook event deleted:', data.id);
301
- // Handle the deleted event
302
- }
303
283
  }
304
284
  ```
305
285
 
@@ -2,6 +2,7 @@ import { Response } from 'express';
2
2
  import { MicrosoftAuthService } from '../services/auth/microsoft-auth.service';
3
3
  export declare class MicrosoftAuthController {
4
4
  private readonly microsoftAuthService;
5
+ private readonly logger;
5
6
  constructor(microsoftAuthService: MicrosoftAuthService);
6
- callback(code: string, state: string, res: Response): Promise<Response<any, Record<string, any>>>;
7
+ handleOauthCallback(code: string, state: string, res: Response): Promise<Response<any, Record<string, any>>>;
7
8
  }
@@ -11,23 +11,23 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  var __param = (this && this.__param) || function (paramIndex, decorator) {
12
12
  return function (target, key) { decorator(target, key, paramIndex); }
13
13
  };
14
+ var MicrosoftAuthController_1;
14
15
  Object.defineProperty(exports, "__esModule", { value: true });
15
16
  exports.MicrosoftAuthController = void 0;
16
17
  const common_1 = require("@nestjs/common");
17
18
  const swagger_1 = require("@nestjs/swagger");
18
19
  const microsoft_auth_service_1 = require("../services/auth/microsoft-auth.service");
19
- let MicrosoftAuthController = class MicrosoftAuthController {
20
+ let MicrosoftAuthController = MicrosoftAuthController_1 = class MicrosoftAuthController {
20
21
  constructor(microsoftAuthService) {
21
22
  this.microsoftAuthService = microsoftAuthService;
23
+ this.logger = new common_1.Logger(MicrosoftAuthController_1.name);
22
24
  }
23
- async callback(code, state, res) {
24
- if (!code) {
25
- throw new common_1.BadRequestException('No code provided');
26
- }
27
- if (!state) {
28
- throw new common_1.BadRequestException('No state parameter provided');
29
- }
25
+ async handleOauthCallback(code, state, res) {
30
26
  try {
27
+ if (!code || !state) {
28
+ this.logger.error('Missing required parameters for OAuth callback');
29
+ return res.status(common_1.HttpStatus.BAD_REQUEST).send('Missing required parameters');
30
+ }
31
31
  await this.microsoftAuthService.exchangeCodeForToken(code, state);
32
32
  return res.status(common_1.HttpStatus.OK).send(`
33
33
  <h1>Authorization successful!</h1>
@@ -42,8 +42,10 @@ let MicrosoftAuthController = class MicrosoftAuthController {
42
42
  `);
43
43
  }
44
44
  catch (error) {
45
- console.error('Authentication failed:', error);
46
- throw new common_1.InternalServerErrorException('Authentication failed. Please try again.');
45
+ this.logger.error('Error handling OAuth callback:', error);
46
+ return res
47
+ .status(common_1.HttpStatus.INTERNAL_SERVER_ERROR)
48
+ .send('An error occurred during authentication');
47
49
  }
48
50
  }
49
51
  };
@@ -92,8 +94,8 @@ __decorate([
92
94
  __metadata("design:type", Function),
93
95
  __metadata("design:paramtypes", [String, String, Object]),
94
96
  __metadata("design:returntype", Promise)
95
- ], MicrosoftAuthController.prototype, "callback", null);
96
- exports.MicrosoftAuthController = MicrosoftAuthController = __decorate([
97
+ ], MicrosoftAuthController.prototype, "handleOauthCallback", null);
98
+ exports.MicrosoftAuthController = MicrosoftAuthController = MicrosoftAuthController_1 = __decorate([
97
99
  (0, swagger_1.ApiTags)('Microsoft Auth'),
98
100
  (0, common_1.Controller)('auth/microsoft'),
99
101
  __metadata("design:paramtypes", [microsoft_auth_service_1.MicrosoftAuthService])
@@ -1 +1 @@
1
- {"version":3,"file":"microsoft-auth.controller.js","sourceRoot":"","sources":["../../src/controllers/microsoft-auth.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAQwB;AAExB,6CAA4F;AAC5F,oFAA+E;AAIxE,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAClC,YAA6B,oBAA0C;QAA1C,yBAAoB,GAApB,oBAAoB,CAAsB;IAAG,CAAC;IA4DrE,AAAN,KAAK,CAAC,QAAQ,CAAgB,IAAY,EAAkB,KAAa,EAAS,GAAa;QAC7F,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,4BAAmB,CAAC,kBAAkB,CAAC,CAAC;QACpD,CAAC;QAED,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,4BAAmB,CAAC,6BAA6B,CAAC,CAAC;QAC/D,CAAC;QAED,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YAGlE,OAAO,GAAG,CAAC,MAAM,CAAC,mBAAU,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC;;;;;;;;;;OAUrC,CAAC,CAAC;QACL,CAAC;QAAC,O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,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,kCAAkC;QAC3C,WAAW,EACT,2QAA2Q;KAC9Q,CAAC;IACD,IAAA,kBAAQ,EAAC;QACR,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,mCAAmC;QAChD,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,+CAA+C;KACzD,CAAC;IACD,IAAA,kBAAQ,EAAC;QACR,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,wDAAwD;QACrE,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,yCAAyC;KACnD,CAAC;IACD,IAAA,qBAAW,EAAC;QACX,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,8DAA8D;QAC3E,OAAO,EAAE;YACP,WAAW,EAAE;gBACX,OAAO,EACL,+FAA+F;aAClG;SACF;KACF,CAAC;IACD,IAAA,qBAAW,EAAC;QACX,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,0CAA0C;KACxD,CAAC;IACD,IAAA,qBAAW,EAAC;QACX,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,4CAA4C;KAC1D,CAAC;IACD,IAAA,qBAAW,EAAC,WAAW,CAAC;IAEtB,WAAA,IAAA,cAAK,EAAC,MAAM,CAAC,CAAA;IACb,WAAA,IAAA,cAAK,EAAC,OAAO,CAAC,CAAA;IACd,WAAA,IAAA,YAAG,GAAE,CAAA;;;;kEA6BP;kCA/FU,uBAAuB;IAFnC,IAAA,iBAAO,EAAC,gBAAgB,CAAC;IACzB,IAAA,mBAAU,EAAC,gBAAgB,CAAC;qCAIwB,6CAAoB;GAH5D,uBAAuB,CAgGnC"}
@@ -0,0 +1,11 @@
1
+ export declare class MicrosoftUser {
2
+ id: number;
3
+ externalUserId: string;
4
+ accessToken: string;
5
+ refreshToken: string;
6
+ tokenExpiry: Date;
7
+ scopes: string;
8
+ isActive: boolean;
9
+ createdAt: Date;
10
+ updatedAt: Date;
11
+ }
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.MicrosoftUser = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ let MicrosoftUser = class MicrosoftUser {
15
+ constructor() {
16
+ this.externalUserId = '';
17
+ this.accessToken = '';
18
+ this.refreshToken = '';
19
+ this.tokenExpiry = new Date();
20
+ this.scopes = '';
21
+ this.isActive = true;
22
+ this.createdAt = new Date();
23
+ this.updatedAt = new Date();
24
+ }
25
+ };
26
+ exports.MicrosoftUser = MicrosoftUser;
27
+ __decorate([
28
+ (0, typeorm_1.PrimaryGeneratedColumn)('increment'),
29
+ __metadata("design:type", Number)
30
+ ], MicrosoftUser.prototype, "id", void 0);
31
+ __decorate([
32
+ (0, typeorm_1.Column)({ name: 'external_user_id' }),
33
+ (0, typeorm_1.Index)(),
34
+ __metadata("design:type", String)
35
+ ], MicrosoftUser.prototype, "externalUserId", void 0);
36
+ __decorate([
37
+ (0, typeorm_1.Column)({ name: 'access_token', type: 'text' }),
38
+ __metadata("design:type", String)
39
+ ], MicrosoftUser.prototype, "accessToken", void 0);
40
+ __decorate([
41
+ (0, typeorm_1.Column)({ name: 'refresh_token', type: 'text' }),
42
+ __metadata("design:type", String)
43
+ ], MicrosoftUser.prototype, "refreshToken", void 0);
44
+ __decorate([
45
+ (0, typeorm_1.Column)({ name: 'token_expiry', type: 'datetime' }),
46
+ __metadata("design:type", Date)
47
+ ], MicrosoftUser.prototype, "tokenExpiry", void 0);
48
+ __decorate([
49
+ (0, typeorm_1.Column)({ name: 'scopes', type: 'text' }),
50
+ __metadata("design:type", String)
51
+ ], MicrosoftUser.prototype, "scopes", void 0);
52
+ __decorate([
53
+ (0, typeorm_1.Column)({ name: 'is_active', default: true }),
54
+ __metadata("design:type", Boolean)
55
+ ], MicrosoftUser.prototype, "isActive", void 0);
56
+ __decorate([
57
+ (0, typeorm_1.CreateDateColumn)({ name: 'created_at' }),
58
+ __metadata("design:type", Date)
59
+ ], MicrosoftUser.prototype, "createdAt", void 0);
60
+ __decorate([
61
+ (0, typeorm_1.UpdateDateColumn)({ name: 'updated_at' }),
62
+ __metadata("design:type", Date)
63
+ ], MicrosoftUser.prototype, "updatedAt", void 0);
64
+ exports.MicrosoftUser = MicrosoftUser = __decorate([
65
+ (0, typeorm_1.Entity)('microsoft_users')
66
+ ], MicrosoftUser);
67
+ //# sourceMappingURL=microsoft-user.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"microsoft-user.entity.js","sourceRoot":"","sources":["../../src/entities/microsoft-user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAOiB;AAQV,IAAM,aAAa,GAAnB,MAAM,aAAa;IAAnB;QAML,mBAAc,GAAW,EAAE,CAAC;QAG5B,gBAAW,GAAW,EAAE,CAAC;QAGzB,iBAAY,GAAW,EAAE,CAAC;QAG1B,gBAAW,GAAS,IAAI,IAAI,EAAE,CAAC;QAG/B,WAAM,GAAW,EAAE,CAAC;QAGpB,aAAQ,GAAY,IAAI,CAAC;QAGzB,cAAS,GAAS,IAAI,IAAI,EAAE,CAAC;QAG7B,cAAS,GAAS,IAAI,IAAI,EAAE,CAAC;IAC/B,CAAC;CAAA,CAAA;AA5BY,sCAAa;AAExB;IADC,IAAA,gCAAsB,EAAC,WAAW,CAAC;;yCACxB;AAIZ;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC;IACpC,IAAA,eAAK,GAAE;;qDACoB;AAG5B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kDACtB;AAGzB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;mDACtB;AAG1B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;8BACtC,IAAI;kDAAc;AAG/B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6CACrB;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;+CACpB;AAGzB;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;8BAC9B,IAAI;gDAAc;AAG7B;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;8BAC9B,IAAI;gDAAc;wBA3BlB,aAAa;IADzB,IAAA,gBAAM,EAAC,iBAAiB,CAAC;GACb,aAAa,CA4BzB"}
@@ -8,8 +8,6 @@ export declare class OutlookWebhookSubscription {
8
8
  notificationUrl: string;
9
9
  expirationDateTime: Date;
10
10
  isActive: boolean;
11
- accessToken: string;
12
- refreshToken: string;
13
11
  createdAt: Date;
14
12
  updatedAt: Date;
15
13
  }
@@ -21,8 +21,6 @@ let OutlookWebhookSubscription = class OutlookWebhookSubscription {
21
21
  this.notificationUrl = '';
22
22
  this.expirationDateTime = new Date();
23
23
  this.isActive = true;
24
- this.accessToken = '';
25
- this.refreshToken = '';
26
24
  this.createdAt = new Date();
27
25
  this.updatedAt = new Date();
28
26
  }
@@ -64,14 +62,6 @@ __decorate([
64
62
  (0, typeorm_1.Column)({ name: 'is_active', default: true }),
65
63
  __metadata("design:type", Boolean)
66
64
  ], OutlookWebhookSubscription.prototype, "isActive", void 0);
67
- __decorate([
68
- (0, typeorm_1.Column)({ name: 'access_token', type: 'text', nullable: true }),
69
- __metadata("design:type", String)
70
- ], OutlookWebhookSubscription.prototype, "accessToken", void 0);
71
- __decorate([
72
- (0, typeorm_1.Column)({ name: 'refresh_token', type: 'text', nullable: true }),
73
- __metadata("design:type", String)
74
- ], OutlookWebhookSubscription.prototype, "refreshToken", void 0);
75
65
  __decorate([
76
66
  (0, typeorm_1.CreateDateColumn)({ name: 'created_at' }),
77
67
  __metadata("design:type", Date)
@@ -1 +1 @@
1
- {"version":3,"file":"outlook-webhook-subscription.entity.js","sourceRoot":"","sources":["../../src/entities/outlook-webhook-subscription.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAMiB;AAGV,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAAhC;QAKL,mBAAc,GAAW,EAAE,CAAC;QAG5B,WAAM,GAAW,CAAC,CAAC;QAGnB,aAAQ,GAAW,EAAE,CAAC;QAGtB,eAAU,GAAW,EAAE,CAAC;QAGxB,gBAAW,GAAW,EAAE,CAAC;QAGzB,oBAAe,GAAW,EAAE,CAAC;QAG7B,uBAAkB,GAAS,IAAI,IAAI,EAAE,CAAC;QAGtC,aAAQ,GAAY,IAAI,CAAC;QAGzB,gBAAW,GAAW,EAAE,CAAC;QAGzB,iBAAY,GAAW,EAAE,CAAC;QAG1B,cAAS,GAAS,IAAI,IAAI,EAAE,CAAC;QAG7B,cAAS,GAAS,IAAI,IAAI,EAAE,CAAC;IAC/B,CAAC;CAAA,CAAA;AAvCY,gEAA0B;AAErC;IADC,IAAA,gCAAsB,EAAC,WAAW,CAAC;;sDACxB;AAGZ;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EA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;GAC3B,0BAA0B,CAuCtC"}
1
+ {"version":3,"file":"outlook-webhook-subscription.entity.js","sourceRoot":"","sources":["../../src/entities/outlook-webhook-subscription.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAMiB;AAGV,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAAhC;QAKL,mBAAc,GAAW,EAAE,CAAC;QAG5B,WAAM,GAAW,CAAC,CAAC;QAGnB,aAAQ,GAAW,EAAE,CAAC;QAGtB,eAAU,GAAW,EAAE,CAAC;QAGxB,gBAAW,GAAW,EAAE,CAAC;QAGzB,oBAAe,GAAW,EAAE,CAAC;QAG7B,uBAAkB,GAAS,IAAI,IAAI,EAAE,CAAC;QAGtC,aAAQ,GAAY,IAAI,CAAC;QAGzB,cAAS,GAAS,IAAI,IAAI,EAAE,CAAC;QAG7B,cAAS,GAAS,IAAI,IAAI,EAAE,CAAC;IAC/B,CAAC;CAAA,CAAA;AAjCY,gEAA0B;AAErC;IADC,IAAA,gCAAsB,EAAC,WAAW,CAAC;;sDACxB;AAGZ;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;kEACnC;AAG5B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;0DACT;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;4DACF;AAGtB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;8DACrB;AAGxB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;+DACrB;AAGzB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;mEACrB;AAG7B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,sBAAsB,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;8BACvC,IAAI;sEAAc;AAGtC;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;4DACpB;AAGzB;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;8BAC9B,IAAI;6DAAc;AAG7B;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;8BAC9B,IAAI;6DAAc;qCAhClB,0BAA0B;IADtC,IAAA,gBAAM,EAAC,+BAA+B,CAAC;GAC3B,0BAA0B,CAiCtC"}
@@ -1,6 +1,5 @@
1
1
  export declare enum OutlookEventTypes {
2
- AUTH_TOKENS_SAVE = "microsoft.auth.tokens.save",
3
- AUTH_TOKENS_UPDATE = "microsoft.auth.tokens.update",
2
+ USER_AUTHENTICATED = "microsoft.auth.user.authenticated",
4
3
  EVENT_DELETED = "outlook.event.deleted",
5
4
  EVENT_CREATED = "outlook.event.created",
6
5
  EVENT_UPDATED = "outlook.event.updated",
@@ -3,8 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OutlookEventTypes = void 0;
4
4
  var OutlookEventTypes;
5
5
  (function (OutlookEventTypes) {
6
- OutlookEventTypes["AUTH_TOKENS_SAVE"] = "microsoft.auth.tokens.save";
7
- OutlookEventTypes["AUTH_TOKENS_UPDATE"] = "microsoft.auth.tokens.update";
6
+ OutlookEventTypes["USER_AUTHENTICATED"] = "microsoft.auth.user.authenticated";
8
7
  OutlookEventTypes["EVENT_DELETED"] = "outlook.event.deleted";
9
8
  OutlookEventTypes["EVENT_CREATED"] = "outlook.event.created";
10
9
  OutlookEventTypes["EVENT_UPDATED"] = "outlook.event.updated";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-types.enum.js","sourceRoot":"","sources":["../../src/enums/event-types.enum.ts"],"names":[],"mappings":";;;AAGA,IAAY,iBAaX;AAbD,WAAY,iBAAiB;IAE3B,6EAAwD,CAAA;IAGxD,4DAAuC,CAAA;IACvC,4DAAuC,CAAA;IACvC,4DAAuC,CAAA;IAGvC,8DAAyC,CAAA;IACzC,4DAAuC,CAAA;IACvC,4DAAuC,CAAA;AACzC,CAAC,EAbW,iBAAiB,iCAAjB,iBAAiB,QAa5B"}
@@ -0,0 +1,7 @@
1
+ export declare enum PermissionScope {
2
+ CALENDAR_READ = "CALENDAR_READ",
3
+ CALENDAR_WRITE = "CALENDAR_WRITE",
4
+ EMAIL_READ = "EMAIL_READ",
5
+ EMAIL_WRITE = "EMAIL_WRITE",
6
+ EMAIL_SEND = "EMAIL_SEND"
7
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PermissionScope = void 0;
4
+ var PermissionScope;
5
+ (function (PermissionScope) {
6
+ PermissionScope["CALENDAR_READ"] = "CALENDAR_READ";
7
+ PermissionScope["CALENDAR_WRITE"] = "CALENDAR_WRITE";
8
+ PermissionScope["EMAIL_READ"] = "EMAIL_READ";
9
+ PermissionScope["EMAIL_WRITE"] = "EMAIL_WRITE";
10
+ PermissionScope["EMAIL_SEND"] = "EMAIL_SEND";
11
+ })(PermissionScope || (exports.PermissionScope = PermissionScope = {}));
12
+ //# sourceMappingURL=permission-scope.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permission-scope.enum.js","sourceRoot":"","sources":["../../src/enums/permission-scope.enum.ts"],"names":[],"mappings":";;;AAIA,IAAY,eAMX;AAND,WAAY,eAAe;IACzB,kDAA+B,CAAA;IAC/B,oDAAiC,CAAA;IACjC,4CAAyB,CAAA;IACzB,8CAA2B,CAAA;IAC3B,4CAAyB,CAAA;AAC3B,CAAC,EANW,eAAe,+BAAf,eAAe,QAM1B"}
package/dist/index.d.ts CHANGED
@@ -1,13 +1,16 @@
1
+ export * from './services/auth/microsoft-auth.service';
2
+ export * from './services/calendar/calendar.service';
3
+ export * from './services/email/email.service';
1
4
  export * from './microsoft-outlook.module';
5
+ export * from './interfaces/outlook/token-response.interface';
6
+ export * from './interfaces/config/outlook-config.interface';
7
+ export * from './enums/permission-scope.enum';
8
+ export * from './enums/event-types.enum';
9
+ export * from './constants';
2
10
  export * from './controllers/calendar.controller';
3
11
  export * from './controllers/microsoft-auth.controller';
4
12
  export * from './controllers/email.controller';
5
- export * from './services';
6
13
  export * from './dto/outlook-webhook-notification.dto';
7
- export * from './interfaces/outlook/token-response.interface';
8
- export * from './interfaces/config/outlook-config.interface';
9
- export * from './event-types.enum';
10
- export * from './constants';
11
14
  export * from './entities/outlook-webhook-subscription.entity';
12
15
  export * from './repositories/outlook-webhook-subscription.repository';
13
16
  export * from './types';
package/dist/index.js CHANGED
@@ -14,16 +14,19 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./services/auth/microsoft-auth.service"), exports);
18
+ __exportStar(require("./services/calendar/calendar.service"), exports);
19
+ __exportStar(require("./services/email/email.service"), exports);
17
20
  __exportStar(require("./microsoft-outlook.module"), exports);
21
+ __exportStar(require("./interfaces/outlook/token-response.interface"), exports);
22
+ __exportStar(require("./interfaces/config/outlook-config.interface"), exports);
23
+ __exportStar(require("./enums/permission-scope.enum"), exports);
24
+ __exportStar(require("./enums/event-types.enum"), exports);
25
+ __exportStar(require("./constants"), exports);
18
26
  __exportStar(require("./controllers/calendar.controller"), exports);
19
27
  __exportStar(require("./controllers/microsoft-auth.controller"), exports);
20
28
  __exportStar(require("./controllers/email.controller"), exports);
21
- __exportStar(require("./services"), exports);
22
29
  __exportStar(require("./dto/outlook-webhook-notification.dto"), exports);
23
- __exportStar(require("./interfaces/outlook/token-response.interface"), exports);
24
- __exportStar(require("./interfaces/config/outlook-config.interface"), exports);
25
- __exportStar(require("./event-types.enum"), exports);
26
- __exportStar(require("./constants"), exports);
27
30
  __exportStar(require("./entities/outlook-webhook-subscription.entity"), exports);
28
31
  __exportStar(require("./repositories/outlook-webhook-subscription.repository"), exports);
29
32
  __exportStar(require("./types"), exports);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAGA,6DAA2C;AAG3C,oEAAkD;AAClD,0EAAwD;AACxD,iEAA+C;AAG/C,6CAA2B;AAG3B,yEAAuD;AAGvD,gFAA8D;AAC9D,+EAA6D;AAG7D,qDAAmC;AAGnC,8CAA4B;AAG5B,iFAA+D;AAG/D,yFAAuE;AAGvE,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAGA,yEAAuD;AACvD,uEAAqD;AACrD,iEAA+C;AAG/C,6DAA2C;AAG3C,gFAA8D;AAC9D,+EAA6D;AAG7D,gEAA8C;AAC9C,2DAAyC;AAGzC,8CAA4B;AAG5B,oEAAkD;AAClD,0EAAwD;AACxD,iEAA+C;AAG/C,yEAAuD;AAGvD,iFAA+D;AAG/D,yFAAuE;AAGvE,0CAAwB"}
@@ -2,6 +2,6 @@ export interface MicrosoftOutlookConfig {
2
2
  clientId: string;
3
3
  clientSecret: string;
4
4
  redirectPath: string;
5
- backendBaseUrl?: string;
5
+ backendBaseUrl: string;
6
6
  basePath?: string;
7
7
  }
@@ -1,5 +1,7 @@
1
+ import { PermissionScope } from '../../enums/permission-scope.enum';
1
2
  export interface StateObject {
2
- userId: string | number;
3
+ userId: string;
3
4
  csrf: string;
4
- timestamp?: number;
5
+ timestamp: number;
6
+ requestedScopes?: PermissionScope[];
5
7
  }