@frontegg/rest-api 3.0.6 → 3.0.9
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/auth/index.js +3 -1
- package/constants.d.ts +5 -0
- package/constants.js +5 -0
- package/index.js +1 -1
- package/node/auth/index.js +3 -1
- package/node/constants.js +5 -0
- package/node/index.js +1 -1
- package/node/subscriptions/enums.js +17 -2
- package/node/subscriptions/index.js +13 -0
- package/node/subscriptions/vendorPublicConfigurations.js +14 -0
- package/package.json +1 -1
- package/subscriptions/enums.d.ts +7 -0
- package/subscriptions/enums.js +14 -1
- package/subscriptions/index.d.ts +11 -10
- package/subscriptions/index.js +11 -10
- package/subscriptions/interfaces.d.ts +4 -0
- package/subscriptions/vendorPublicConfigurations.d.ts +2 -0
- package/subscriptions/vendorPublicConfigurations.js +5 -0
package/auth/index.js
CHANGED
|
@@ -51,7 +51,9 @@ export async function generateLoginResponseFromOAuthResponse(oauthResponse) {
|
|
|
51
51
|
mfaRequired: false,
|
|
52
52
|
accessToken: oauthResponse.id_token,
|
|
53
53
|
refreshToken: oauthResponse.refresh_token
|
|
54
|
-
}, decodedContent, me
|
|
54
|
+
}, decodedContent, me, {
|
|
55
|
+
expiresIn: decodedContent.exp ? decodedContent.exp - new Date().getTime() / 1000 : 300
|
|
56
|
+
});
|
|
55
57
|
|
|
56
58
|
ContextHolder.setUser(user);
|
|
57
59
|
return user;
|
package/constants.d.ts
CHANGED
package/constants.js
CHANGED
|
@@ -118,6 +118,11 @@ export const urls = {
|
|
|
118
118
|
tenantConfiguration: {
|
|
119
119
|
v1: '/subscriptions/resources/billing/tenant-configurations/v1'
|
|
120
120
|
},
|
|
121
|
+
configurations: {
|
|
122
|
+
vendorPublicConfigurations: {
|
|
123
|
+
v1: '/subscriptions/resources/billing/configurations/vendor-public-configurations/v1'
|
|
124
|
+
}
|
|
125
|
+
},
|
|
121
126
|
paymentProviders: {
|
|
122
127
|
stripe: {
|
|
123
128
|
customers: {
|
package/index.js
CHANGED
package/node/auth/index.js
CHANGED
|
@@ -273,7 +273,9 @@ async function generateLoginResponseFromOAuthResponse(oauthResponse) {
|
|
|
273
273
|
mfaRequired: false,
|
|
274
274
|
accessToken: oauthResponse.id_token,
|
|
275
275
|
refreshToken: oauthResponse.refresh_token
|
|
276
|
-
}, decodedContent, me
|
|
276
|
+
}, decodedContent, me, {
|
|
277
|
+
expiresIn: decodedContent.exp ? decodedContent.exp - new Date().getTime() / 1000 : 300
|
|
278
|
+
});
|
|
277
279
|
|
|
278
280
|
_ContextHolder.ContextHolder.setUser(user);
|
|
279
281
|
|
package/node/constants.js
CHANGED
|
@@ -124,6 +124,11 @@ const urls = {
|
|
|
124
124
|
tenantConfiguration: {
|
|
125
125
|
v1: '/subscriptions/resources/billing/tenant-configurations/v1'
|
|
126
126
|
},
|
|
127
|
+
configurations: {
|
|
128
|
+
vendorPublicConfigurations: {
|
|
129
|
+
v1: '/subscriptions/resources/billing/configurations/vendor-public-configurations/v1'
|
|
130
|
+
}
|
|
131
|
+
},
|
|
127
132
|
paymentProviders: {
|
|
128
133
|
stripe: {
|
|
129
134
|
customers: {
|
package/node/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.ProviderType = exports.PaymentMethodType = exports.ISubscriptionStatus = exports.ISubscriptionCancellationPolicy = void 0;
|
|
6
|
+
exports.TrialEndAction = exports.TenantCreatedAction = exports.ProviderType = exports.PaymentMethodType = exports.ISubscriptionStatus = exports.ISubscriptionCancellationPolicy = void 0;
|
|
7
7
|
let ISubscriptionStatus;
|
|
8
8
|
exports.ISubscriptionStatus = ISubscriptionStatus;
|
|
9
9
|
|
|
@@ -36,4 +36,19 @@ exports.ProviderType = ProviderType;
|
|
|
36
36
|
|
|
37
37
|
(function (ProviderType) {
|
|
38
38
|
ProviderType["Stripe"] = "Stripe";
|
|
39
|
-
})(ProviderType || (exports.ProviderType = ProviderType = {}));
|
|
39
|
+
})(ProviderType || (exports.ProviderType = ProviderType = {}));
|
|
40
|
+
|
|
41
|
+
let TrialEndAction;
|
|
42
|
+
exports.TrialEndAction = TrialEndAction;
|
|
43
|
+
|
|
44
|
+
(function (TrialEndAction) {
|
|
45
|
+
TrialEndAction["CHANGE_TO_DEFAULT"] = "change_to_default";
|
|
46
|
+
TrialEndAction["RETAIN_TRIAL"] = "retain_trial";
|
|
47
|
+
})(TrialEndAction || (exports.TrialEndAction = TrialEndAction = {}));
|
|
48
|
+
|
|
49
|
+
let TenantCreatedAction;
|
|
50
|
+
exports.TenantCreatedAction = TenantCreatedAction;
|
|
51
|
+
|
|
52
|
+
(function (TenantCreatedAction) {
|
|
53
|
+
TenantCreatedAction["CREATE"] = "create_customer";
|
|
54
|
+
})(TenantCreatedAction || (exports.TenantCreatedAction = TenantCreatedAction = {}));
|
|
@@ -121,6 +121,19 @@ Object.keys(_paymentProviders).forEach(function (key) {
|
|
|
121
121
|
});
|
|
122
122
|
});
|
|
123
123
|
|
|
124
|
+
var _vendorPublicConfigurations = require("./vendorPublicConfigurations");
|
|
125
|
+
|
|
126
|
+
Object.keys(_vendorPublicConfigurations).forEach(function (key) {
|
|
127
|
+
if (key === "default" || key === "__esModule") return;
|
|
128
|
+
if (key in exports && exports[key] === _vendorPublicConfigurations[key]) return;
|
|
129
|
+
Object.defineProperty(exports, key, {
|
|
130
|
+
enumerable: true,
|
|
131
|
+
get: function () {
|
|
132
|
+
return _vendorPublicConfigurations[key];
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
|
|
124
137
|
var _enums = require("./enums");
|
|
125
138
|
|
|
126
139
|
Object.keys(_enums).forEach(function (key) {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getVendorPublicConfigurations = getVendorPublicConfigurations;
|
|
7
|
+
|
|
8
|
+
var _fetch = require("../fetch");
|
|
9
|
+
|
|
10
|
+
var _constants = require("../constants");
|
|
11
|
+
|
|
12
|
+
async function getVendorPublicConfigurations() {
|
|
13
|
+
return (0, _fetch.Get)(`${_constants.urls.subscriptions.billing.configurations.vendorPublicConfigurations.v1}`);
|
|
14
|
+
}
|
package/package.json
CHANGED
package/subscriptions/enums.d.ts
CHANGED
|
@@ -16,3 +16,10 @@ export declare enum ISubscriptionCancellationPolicy {
|
|
|
16
16
|
export declare enum ProviderType {
|
|
17
17
|
Stripe = "Stripe"
|
|
18
18
|
}
|
|
19
|
+
export declare enum TrialEndAction {
|
|
20
|
+
CHANGE_TO_DEFAULT = "change_to_default",
|
|
21
|
+
RETAIN_TRIAL = "retain_trial"
|
|
22
|
+
}
|
|
23
|
+
export declare enum TenantCreatedAction {
|
|
24
|
+
CREATE = "create_customer"
|
|
25
|
+
}
|
package/subscriptions/enums.js
CHANGED
|
@@ -26,4 +26,17 @@ export let ProviderType;
|
|
|
26
26
|
|
|
27
27
|
(function (ProviderType) {
|
|
28
28
|
ProviderType["Stripe"] = "Stripe";
|
|
29
|
-
})(ProviderType || (ProviderType = {}));
|
|
29
|
+
})(ProviderType || (ProviderType = {}));
|
|
30
|
+
|
|
31
|
+
export let TrialEndAction;
|
|
32
|
+
|
|
33
|
+
(function (TrialEndAction) {
|
|
34
|
+
TrialEndAction["CHANGE_TO_DEFAULT"] = "change_to_default";
|
|
35
|
+
TrialEndAction["RETAIN_TRIAL"] = "retain_trial";
|
|
36
|
+
})(TrialEndAction || (TrialEndAction = {}));
|
|
37
|
+
|
|
38
|
+
export let TenantCreatedAction;
|
|
39
|
+
|
|
40
|
+
(function (TenantCreatedAction) {
|
|
41
|
+
TenantCreatedAction["CREATE"] = "create_customer";
|
|
42
|
+
})(TenantCreatedAction || (TenantCreatedAction = {}));
|
package/subscriptions/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
1
|
+
export * from "./subscriptions";
|
|
2
|
+
export * from "./managedSubscriptions";
|
|
3
|
+
export * from "./plans";
|
|
4
|
+
export * from "./invoices";
|
|
5
|
+
export * from "./paymentMethods";
|
|
6
|
+
export * from "./providers";
|
|
7
|
+
export * from "./summaries";
|
|
8
|
+
export * from "./tenantConfiguration";
|
|
9
|
+
export * from "./paymentProviders";
|
|
10
|
+
export * from "./vendorPublicConfigurations";
|
|
11
|
+
export * from "./enums";
|
package/subscriptions/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
1
|
+
export * from "./subscriptions";
|
|
2
|
+
export * from "./managedSubscriptions";
|
|
3
|
+
export * from "./plans";
|
|
4
|
+
export * from "./invoices";
|
|
5
|
+
export * from "./paymentMethods";
|
|
6
|
+
export * from "./providers";
|
|
7
|
+
export * from "./summaries";
|
|
8
|
+
export * from "./tenantConfiguration";
|
|
9
|
+
export * from "./paymentProviders";
|
|
10
|
+
export * from "./vendorPublicConfigurations";
|
|
11
|
+
export * from "./enums";
|