@frontegg/rest-api 2.10.60 → 2.10.61

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [2.10.61](https://github.com/frontegg/typescript-rest-api/compare/v2.10.60...v2.10.61) (2022-02-27)
6
+
5
7
  ### [2.10.60](https://github.com/frontegg/typescript-rest-api/compare/v2.10.59...v2.10.60) (2022-02-24)
6
8
 
7
9
  ### [2.10.59](https://github.com/frontegg/typescript-rest-api/compare/v2.10.58...v2.10.59) (2022-02-24)
@@ -127,5 +127,4 @@ export interface IUpdateSubscriptionItemRequest {
127
127
  export interface IUpdateManagedSubscriptionRequest {
128
128
  paymentMethodId: string;
129
129
  planId: string;
130
- items: IUpdateSubscriptionItemRequest[];
131
130
  }
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/subscriptions/interfaces.ts"],"names":[],"mappings":"AAEA,cAAc,+BAA+B,CAAC"}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/subscriptions/interfaces.ts"],"names":[],"mappings":"AAOA,cAAc,+BAA+B,CAAC"}
@@ -1,6 +1,14 @@
1
1
  import { ISubscriptionResponse, IUpdateManagedSubscriptionRequest } from "./interfaces";
2
2
  export declare function getManagedSubscription(subscriptionId: string): Promise<ISubscriptionResponse>;
3
3
  export declare function getManagedSubscriptions(): Promise<ISubscriptionResponse[]>;
4
+ /**
5
+ * Cancel tenant subscription
6
+ */
7
+ export declare function cancelManagedSubscription(subscriptionId: string): Promise<void>;
8
+ /**
9
+ * Renew tenant subscription
10
+ */
11
+ export declare function renewManagedSubscription(subscriptionId: string): Promise<void>;
4
12
  /**
5
13
  * Upgrade/Downgrade tenant subscription plan
6
14
  */
@@ -21,6 +21,24 @@ export function getManagedSubscriptions() {
21
21
  return Get(`${urls.subscriptions.managedSubscriptions.v1}`);
22
22
  });
23
23
  }
24
+ /**
25
+ * Cancel tenant subscription
26
+ */
27
+ export function cancelManagedSubscription(subscriptionId) {
28
+ return __awaiter(this, void 0, void 0, function* () {
29
+ console.debug("cancelManagedSubscription()", { subscriptionId });
30
+ return Put(`${urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}/cancellations/`, {});
31
+ });
32
+ }
33
+ /**
34
+ * Renew tenant subscription
35
+ */
36
+ export function renewManagedSubscription(subscriptionId) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ console.debug("renewManagedSubscription()", { subscriptionId });
39
+ return Put(`${urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}/renewals/`, {});
40
+ });
41
+ }
24
42
  /**
25
43
  * Upgrade/Downgrade tenant subscription plan
26
44
  */
@@ -1 +1 @@
1
- {"version":3,"file":"managedSubscriptions.js","sourceRoot":"","sources":["../../../src/subscriptions/managedSubscriptions.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,MAAM,UAAgB,sBAAsB,CAAC,cAAsB;;QAC/D,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,EAAC,cAAc,EAAC,CAAC,CAAC;QAC5D,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,oBAAoB,CAAC,EAAE,IAAI,cAAc,EAAE,CAAC,CAAA;IACjF,CAAC;CAAA;AAED,MAAM,UAAgB,uBAAuB;;QACzC,OAAO,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAC3C,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,oBAAoB,CAAC,EAAE,EAAE,CAAC,CAAA;IAC/D,CAAC;CAAA;AAED;;GAEG;AACH,MAAM,UAAgB,yBAAyB,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C5C,cAAsB;;QAEpB,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC;QAChE,OAAO,GAAG,CACR,GAAG,IAAI,CAAC,aAAa,CAAC,oBAAoB,CAAC,EAAE,IAAI,cAAc,YAAY,EAC3E,EAAE,CACH,CAAC;IACN,CAAC;CAAA;AAED;;GAEG;AACH,MAAM,UAAgB,yBAAyB,CAC7C,cAAsB,EACtB,EAAE,eAAe,EAAE,MAAM,EAAqC;;QAE5D,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC;QACjE,OAAO,GAAG,CACR,GAAG,IAAI,CAAC,aAAa,CAAC,oBAAoB,CAAC,EAAE,IAAI,cAAc,EAAE,EACjE,EAAE,eAAe,EAAE,MAAM,EAAE,CAC5B,CAAC;IACN,CAAC;CAAA"}
@@ -127,5 +127,4 @@ export interface IUpdateSubscriptionItemRequest {
127
127
  export interface IUpdateManagedSubscriptionRequest {
128
128
  paymentMethodId: string;
129
129
  planId: string;
130
- items: IUpdateSubscriptionItemRequest[];
131
130
  }
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/subscriptions/interfaces.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,gEAA8C"}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/subscriptions/interfaces.ts"],"names":[],"mappings":";;;;;;;;;;;;AAOA,gEAA8C"}
@@ -1,6 +1,14 @@
1
1
  import { ISubscriptionResponse, IUpdateManagedSubscriptionRequest } from "./interfaces";
2
2
  export declare function getManagedSubscription(subscriptionId: string): Promise<ISubscriptionResponse>;
3
3
  export declare function getManagedSubscriptions(): Promise<ISubscriptionResponse[]>;
4
+ /**
5
+ * Cancel tenant subscription
6
+ */
7
+ export declare function cancelManagedSubscription(subscriptionId: string): Promise<void>;
8
+ /**
9
+ * Renew tenant subscription
10
+ */
11
+ export declare function renewManagedSubscription(subscriptionId: string): Promise<void>;
4
12
  /**
5
13
  * Upgrade/Downgrade tenant subscription plan
6
14
  */
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.updateManagedSubscription = exports.getManagedSubscriptions = exports.getManagedSubscription = void 0;
12
+ exports.updateManagedSubscription = exports.renewManagedSubscription = exports.cancelManagedSubscription = exports.getManagedSubscriptions = exports.getManagedSubscription = void 0;
13
13
  const fetch_1 = require("../fetch");
14
14
  const constants_1 = require("../constants");
15
15
  function getManagedSubscription(subscriptionId) {
@@ -26,6 +26,26 @@ function getManagedSubscriptions() {
26
26
  });
27
27
  }
28
28
  exports.getManagedSubscriptions = getManagedSubscriptions;
29
+ /**
30
+ * Cancel tenant subscription
31
+ */
32
+ function cancelManagedSubscription(subscriptionId) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ console.debug("cancelManagedSubscription()", { subscriptionId });
35
+ return fetch_1.Put(`${constants_1.urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}/cancellations/`, {});
36
+ });
37
+ }
38
+ exports.cancelManagedSubscription = cancelManagedSubscription;
39
+ /**
40
+ * Renew tenant subscription
41
+ */
42
+ function renewManagedSubscription(subscriptionId) {
43
+ return __awaiter(this, void 0, void 0, function* () {
44
+ console.debug("renewManagedSubscription()", { subscriptionId });
45
+ return fetch_1.Put(`${constants_1.urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}/renewals/`, {});
46
+ });
47
+ }
48
+ exports.renewManagedSubscription = renewManagedSubscription;
29
49
  /**
30
50
  * Upgrade/Downgrade tenant subscription plan
31
51
  */
@@ -1 +1 @@
1
- {"version":3,"file":"managedSubscriptions.js","sourceRoot":"","sources":["../../src/subscriptions/managedSubscriptions.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,oCAAoC;AACpC,4CAAoC;AAEpC,SAAsB,sBAAsB,CAAC,cAAsB;;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AAI,CAAC,aAAa,CAAC,oBAAoB,CAAC,EAAE,EAAE,CAAC,CAAA;IAC/D,CAAC;CAAA;AAHD,0DAGC;AAED;;GAEG;AACH,SAAsB,yBAAyB,CAC7C,cAAsB;;QAEpB,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC;QACjE,OAAO,WAAG,CACR,GAAG,gBAAI,CAAC,aAAa,CAAC,oBAAoB,CAAC,EAAE,IAAI,cAAc,iBAAiB,EAChF,EAAE,CACH,CAAC;IACN,CAAC;CAAA;AARD,8DAQC;AAED;;GAEG;AACH,SAAsB,wBAAwB,CAC5C,cAAsB;;QAEpB,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC;QAChE,OAAO,WAAG,CACR,GAAG,gBAAI,CAAC,aAAa,CAAC,oBAAoB,CAAC,EAAE,IAAI,cAAc,YAAY,EAC3E,EAAE,CACH,CAAC;IACN,CAAC;CAAA;AARD,4DAQC;AAED;;GAEG;AACH,SAAsB,yBAAyB,CAC7C,cAAsB,EACtB,EAAE,eAAe,EAAE,MAAM,EAAqC;;QAE5D,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC;QACjE,OAAO,WAAG,CACR,GAAG,gBAAI,CAAC,aAAa,CAAC,oBAAoB,CAAC,EAAE,IAAI,cAAc,EAAE,EACjE,EAAE,eAAe,EAAE,MAAM,EAAE,CAC5B,CAAC;IACN,CAAC;CAAA;AATD,8DASC"}
package/dist/umd/index.js CHANGED
@@ -2333,6 +2333,24 @@
2333
2333
  return Get(`${urls.subscriptions.managedSubscriptions.v1}`);
2334
2334
  });
2335
2335
  }
2336
+ /**
2337
+ * Cancel tenant subscription
2338
+ */
2339
+ function cancelManagedSubscription(subscriptionId) {
2340
+ return __awaiter(this, void 0, void 0, function* () {
2341
+ console.debug("cancelManagedSubscription()", { subscriptionId });
2342
+ return Put(`${urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}/cancellations/`, {});
2343
+ });
2344
+ }
2345
+ /**
2346
+ * Renew tenant subscription
2347
+ */
2348
+ function renewManagedSubscription(subscriptionId) {
2349
+ return __awaiter(this, void 0, void 0, function* () {
2350
+ console.debug("renewManagedSubscription()", { subscriptionId });
2351
+ return Put(`${urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}/renewals/`, {});
2352
+ });
2353
+ }
2336
2354
  /**
2337
2355
  * Upgrade/Downgrade tenant subscription plan
2338
2356
  */
@@ -2537,6 +2555,8 @@
2537
2555
  updateSubscription: updateSubscription,
2538
2556
  getManagedSubscription: getManagedSubscription,
2539
2557
  getManagedSubscriptions: getManagedSubscriptions,
2558
+ cancelManagedSubscription: cancelManagedSubscription,
2559
+ renewManagedSubscription: renewManagedSubscription,
2540
2560
  updateManagedSubscription: updateManagedSubscription,
2541
2561
  getSubscriptionPlans: getSubscriptionPlans,
2542
2562
  getSubscriptionPlan: getSubscriptionPlan,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@frontegg/rest-api",
3
3
  "libName": "FronteggRestApi",
4
- "version": "2.10.60",
4
+ "version": "2.10.61",
5
5
  "author": "Frontegg LTD",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -1,4 +1,9 @@
1
- import {ISubscriptionCancellationPolicy, ISubscriptionStatus, PaymentMethodType, ProviderType} from "./enums";
1
+ import {
2
+ ISubscriptionCancellationPolicy,
3
+ ISubscriptionStatus,
4
+ PaymentMethodType,
5
+ ProviderType,
6
+ } from "./enums";
2
7
 
3
8
  export * from "./providers/stripe/interfaces";
4
9
 
@@ -132,9 +137,9 @@ export interface ICreateTenantConfigurationResponse {
132
137
  }
133
138
 
134
139
  export interface IPaymentProviderResponse {
135
- providerType: ProviderType
136
- name: string
137
- status: string
140
+ providerType: ProviderType;
141
+ name: string;
142
+ status: string;
138
143
  }
139
144
 
140
145
  export interface IUpdateSubscriptionRequest {
@@ -151,5 +156,4 @@ export interface IUpdateSubscriptionItemRequest {
151
156
  export interface IUpdateManagedSubscriptionRequest {
152
157
  paymentMethodId: string;
153
158
  planId: string;
154
- items: IUpdateSubscriptionItemRequest[];
155
159
  }
@@ -12,6 +12,32 @@ export async function getManagedSubscriptions(): Promise<ISubscriptionResponse[]
12
12
  return Get(`${urls.subscriptions.managedSubscriptions.v1}`)
13
13
  }
14
14
 
15
+ /**
16
+ * Cancel tenant subscription
17
+ */
18
+ export async function cancelManagedSubscription(
19
+ subscriptionId: string
20
+ ): Promise<void> {
21
+ console.debug("cancelManagedSubscription()", { subscriptionId });
22
+ return Put(
23
+ `${urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}/cancellations/`,
24
+ {}
25
+ );
26
+ }
27
+
28
+ /**
29
+ * Renew tenant subscription
30
+ */
31
+ export async function renewManagedSubscription(
32
+ subscriptionId: string
33
+ ): Promise<void> {
34
+ console.debug("renewManagedSubscription()", { subscriptionId });
35
+ return Put(
36
+ `${urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}/renewals/`,
37
+ {}
38
+ );
39
+ }
40
+
15
41
  /**
16
42
  * Upgrade/Downgrade tenant subscription plan
17
43
  */
@@ -24,4 +50,4 @@ export async function updateManagedSubscription(
24
50
  `${urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}`,
25
51
  { paymentMethodId, planId }
26
52
  );
27
- }
53
+ }