@checkfirst/nestjs-outlook 4.2.1 → 4.4.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.
@@ -0,0 +1,6 @@
1
+ export declare function delay(ms: number): Promise<void>;
2
+ export declare function retryWithBackoff<T>(operation: () => Promise<T>, options?: {
3
+ maxRetries?: number;
4
+ retryDelayMs?: number;
5
+ retryCount?: number;
6
+ }): Promise<T>;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.delay = delay;
4
+ exports.retryWithBackoff = retryWithBackoff;
5
+ async function delay(ms) {
6
+ return new Promise((resolve) => setTimeout(resolve, ms));
7
+ }
8
+ async function retryWithBackoff(operation, options) {
9
+ var _a, _b, _c;
10
+ const maxRetries = (_a = options === null || options === void 0 ? void 0 : options.maxRetries) !== null && _a !== void 0 ? _a : 3;
11
+ const retryDelayMs = (_b = options === null || options === void 0 ? void 0 : options.retryDelayMs) !== null && _b !== void 0 ? _b : 1000;
12
+ const retryCount = (_c = options === null || options === void 0 ? void 0 : options.retryCount) !== null && _c !== void 0 ? _c : 0;
13
+ try {
14
+ return await operation();
15
+ }
16
+ catch (error) {
17
+ if (retryCount >= maxRetries) {
18
+ throw error;
19
+ }
20
+ const delayMs = retryDelayMs * Math.pow(2, retryCount);
21
+ await delay(delayMs);
22
+ return retryWithBackoff(operation, {
23
+ maxRetries,
24
+ retryDelayMs,
25
+ retryCount: retryCount + 1,
26
+ });
27
+ }
28
+ }
29
+ //# sourceMappingURL=retry.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retry.util.js","sourceRoot":"","sources":["../../src/utils/retry.util.ts"],"names":[],"mappings":";;AAKA,sBAEC;AAYD,4CA6BC;AA3CM,KAAK,UAAU,KAAK,CAAC,EAAU;IACpC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC;AAYM,KAAK,UAAU,gBAAgB,CACpC,SAA2B,EAC3B,OAIC;;IAED,MAAM,UAAU,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,mCAAI,CAAC,CAAC;IAC5C,MAAM,YAAY,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,mCAAI,IAAI,CAAC;IACnD,MAAM,UAAU,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,mCAAI,CAAC,CAAC;IAE5C,IAAI,CAAC;QACH,OAAO,MAAM,SAAS,EAAE,CAAC;IAC3B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,UAAU,IAAI,UAAU,EAAE,CAAC;YAC7B,MAAM,KAAK,CAAC;QACd,CAAC;QAGD,MAAM,OAAO,GAAG,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;QACvD,MAAM,KAAK,CAAC,OAAO,CAAC,CAAC;QAErB,OAAO,gBAAgB,CAAC,SAAS,EAAE;YACjC,UAAU;YACV,YAAY;YACZ,UAAU,EAAE,UAAU,GAAG,CAAC;SAC3B,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkfirst/nestjs-outlook",
3
- "version": "4.2.1",
3
+ "version": "4.4.0",
4
4
  "description": "An opinionated NestJS module for Microsoft Outlook integration that provides easy access to Microsoft Graph API for emails, calendars, and more.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",