@frontegg/rest-api 3.1.75 → 3.1.76-alpha.9502349697
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/BaseApiClient.d.ts +16 -0
- package/BaseApiClient.js +39 -0
- package/ContextHolder/index.d.ts +108 -27
- package/ContextHolder/index.js +155 -50
- package/FetchClient.d.ts +42 -0
- package/FetchClient.js +308 -0
- package/account-settings/index.d.ts +19 -7
- package/account-settings/index.js +23 -13
- package/applications/index.d.ts +49 -44
- package/applications/index.js +51 -37
- package/audits/index.d.ts +27 -15
- package/audits/index.js +27 -17
- package/auth/index.d.ts +817 -768
- package/auth/index.js +902 -721
- package/auth/secutiry-poilicy/index.d.ts +58 -102
- package/auth/secutiry-poilicy/index.js +122 -90
- package/auth/utils.d.ts +2 -2
- package/auth/utils.js +9 -8
- package/connectivity/index.d.ts +126 -27
- package/connectivity/index.js +147 -114
- package/directory/index.d.ts +31 -22
- package/directory/index.js +27 -15
- package/entitlements/index.d.ts +14 -8
- package/entitlements/index.js +12 -4
- package/feature-flags/index.d.ts +8 -2
- package/feature-flags/index.js +16 -8
- package/groups/index.d.ts +73 -49
- package/groups/index.js +64 -45
- package/impersonate/index.d.ts +15 -6
- package/impersonate/index.js +13 -5
- package/index.d.ts +154 -108
- package/index.js +109 -78
- package/interfaces.d.ts +10 -0
- package/metadata/index.d.ts +67 -7
- package/metadata/index.js +52 -32
- package/node/BaseApiClient.js +49 -0
- package/node/ContextHolder/index.js +155 -50
- package/node/FetchClient.js +326 -0
- package/node/account-settings/index.js +27 -16
- package/node/applications/index.js +51 -44
- package/node/audits/index.js +31 -20
- package/node/auth/index.js +768 -1035
- package/node/auth/secutiry-poilicy/index.js +125 -136
- package/node/auth/utils.js +9 -7
- package/node/connectivity/index.js +148 -187
- package/node/directory/index.js +29 -20
- package/node/entitlements/index.js +18 -5
- package/node/feature-flags/index.js +21 -9
- package/node/groups/index.js +65 -63
- package/node/impersonate/index.js +18 -5
- package/node/index.js +116 -71
- package/node/metadata/index.js +61 -52
- package/node/notifications/index.js +37 -27
- package/node/reports/index.js +78 -70
- package/node/roles/index.js +56 -51
- package/node/security-center/index.js +21 -9
- package/node/sub-tenants/index.js +90 -89
- package/node/subscriptions/index.js +69 -107
- package/node/subscriptions/invoices.js +25 -17
- package/node/subscriptions/managedSubscriptions.js +32 -27
- package/node/subscriptions/paymentMethods.js +27 -20
- package/node/subscriptions/paymentProviders.js +15 -6
- package/node/subscriptions/plans.js +17 -9
- package/node/subscriptions/providers/stripe/index.js +26 -21
- package/node/subscriptions/subscriptions.js +32 -27
- package/node/subscriptions/summaries.js +15 -6
- package/node/subscriptions/tenantConfiguration.js +17 -9
- package/node/subscriptions/vendorPublicConfigurations.js +15 -6
- package/node/teams/index.js +130 -138
- package/node/tenants/index.js +65 -60
- package/node/user-phone-numbers/index.js +32 -24
- package/node/users/index.js +58 -53
- package/node/vendor/index.js +17 -6
- package/notifications/index.d.ts +22 -16
- package/notifications/index.js +33 -22
- package/package.json +1 -1
- package/reports/index.d.ts +50 -44
- package/reports/index.js +75 -62
- package/roles/index.d.ts +44 -38
- package/roles/index.js +57 -41
- package/security-center/index.d.ts +14 -2
- package/security-center/index.js +15 -6
- package/sub-tenants/index.d.ts +57 -15
- package/sub-tenants/index.js +88 -68
- package/subscriptions/index.d.ts +56 -11
- package/subscriptions/index.js +58 -11
- package/subscriptions/invoices.d.ts +16 -13
- package/subscriptions/invoices.js +24 -14
- package/subscriptions/managedSubscriptions.d.ts +18 -15
- package/subscriptions/managedSubscriptions.js +33 -22
- package/subscriptions/paymentMethods.d.ts +16 -13
- package/subscriptions/paymentMethods.js +26 -17
- package/subscriptions/paymentProviders.d.ts +8 -5
- package/subscriptions/paymentProviders.js +11 -4
- package/subscriptions/plans.d.ts +11 -8
- package/subscriptions/plans.js +14 -6
- package/subscriptions/providers/stripe/index.d.ts +24 -21
- package/subscriptions/providers/stripe/index.js +27 -16
- package/subscriptions/subscriptions.d.ts +24 -21
- package/subscriptions/subscriptions.js +33 -22
- package/subscriptions/summaries.d.ts +7 -4
- package/subscriptions/summaries.js +10 -3
- package/subscriptions/tenantConfiguration.d.ts +6 -3
- package/subscriptions/tenantConfiguration.js +15 -7
- package/subscriptions/vendorPublicConfigurations.d.ts +5 -2
- package/subscriptions/vendorPublicConfigurations.js +11 -4
- package/teams/index.d.ts +35 -131
- package/teams/index.js +122 -93
- package/tenants/index.d.ts +25 -37
- package/tenants/index.js +62 -46
- package/user-phone-numbers/index.d.ts +32 -26
- package/user-phone-numbers/index.js +32 -19
- package/users/index.d.ts +21 -15
- package/users/index.js +60 -44
- package/vendor/index.d.ts +12 -6
- package/vendor/index.js +11 -4
- package/fetch.d.ts +0 -24
- package/fetch.js +0 -265
- package/node/fetch.js +0 -306
- package/node/subscriptions/providers/index.js +0 -18
- package/subscriptions/providers/index.d.ts +0 -1
- package/subscriptions/providers/index.js +0 -1
|
@@ -3,100 +3,101 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
exports.addUserToTenantAndSubTenants = addUserToTenantAndSubTenants;
|
|
8
|
-
exports.addUsersToSubTenant = addUsersToSubTenant;
|
|
9
|
-
exports.createSubTenant = createSubTenant;
|
|
10
|
-
exports.deleteSubTenant = deleteSubTenant;
|
|
11
|
-
exports.loadAllUsers = loadAllUsers;
|
|
12
|
-
exports.removeUserFromTenantAndSubTenants = removeUserFromTenantAndSubTenants;
|
|
13
|
-
exports.removeUserRolesFromSubTenants = removeUserRolesFromSubTenants;
|
|
14
|
-
exports.setUserRolesForSubTenants = setUserRolesForSubTenants;
|
|
15
|
-
exports.updateSubAccountAccess = updateSubAccountAccess;
|
|
16
|
-
exports.updateSubTenant = updateSubTenant;
|
|
17
|
-
exports.updateSubTenantHierarchySettings = updateSubTenantHierarchySettings;
|
|
18
|
-
exports.updateSubTenantManagement = updateSubTenantManagement;
|
|
19
|
-
|
|
20
|
-
var _fetch = require("../fetch");
|
|
6
|
+
exports.default = exports.SubTenantsApi = void 0;
|
|
21
7
|
|
|
22
8
|
var _constants = require("../constants");
|
|
23
9
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
10
|
+
var _BaseApiClient = require("../BaseApiClient");
|
|
11
|
+
|
|
12
|
+
class SubTenantsApi extends _BaseApiClient.BaseApiClient {
|
|
13
|
+
constructor(appName) {
|
|
14
|
+
super(appName);
|
|
15
|
+
|
|
16
|
+
this.loadAllUsers = async params => {
|
|
17
|
+
return this.get(_constants.urls.identity.subTenants.v1, params);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
this.addUserToTenantAndSubTenants = async body => {
|
|
21
|
+
return this.post(_constants.urls.identity.subTenants.v1, body);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
this.removeUserFromTenantAndSubTenants = async (body, options) => {
|
|
25
|
+
return this.delete(_constants.urls.identity.subTenants.v1, body, {
|
|
26
|
+
headers: this.extractHeadersFromOptions(options)
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
this.addUserRolesForSubTenants = async (userId, body, options) => {
|
|
31
|
+
return this.post(`${_constants.urls.identity.subTenants.v1}/${userId}/roles`, body, {
|
|
32
|
+
headers: this.extractHeadersFromOptions(options)
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
this.removeUserRolesFromSubTenants = async (userId, body, options) => {
|
|
37
|
+
return this.delete(`${_constants.urls.identity.subTenants.v1}/${userId}/roles`, body, {
|
|
38
|
+
headers: this.extractHeadersFromOptions(options)
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
this.setUserRolesForSubTenants = async (userId, body, options) => {
|
|
43
|
+
return this.patch(`${_constants.urls.identity.subTenants.v1}/${userId}/roles`, body, {
|
|
44
|
+
headers: this.extractHeadersFromOptions(options)
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
this.createSubTenant = async (body, options) => {
|
|
49
|
+
return this.post(_constants.urls.tenants.subTenants.v1, body, {
|
|
50
|
+
headers: this.extractHeadersFromOptions(options)
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
this.deleteSubTenant = async (tenantId, options) => {
|
|
55
|
+
return this.delete(`${_constants.urls.tenants.subTenants.v1}/${tenantId}`, undefined, {
|
|
56
|
+
headers: this.extractHeadersFromOptions(options)
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
this.updateSubTenant = async ({
|
|
61
|
+
tenantId
|
|
62
|
+
}, body, options) => {
|
|
63
|
+
return this.patch(`${_constants.urls.tenants.subTenants.v1}/${tenantId}`, body, {
|
|
64
|
+
headers: this.extractHeadersFromOptions(options)
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
this.updateSubTenantManagement = async ({
|
|
69
|
+
tenantId
|
|
70
|
+
}, body, options) => {
|
|
71
|
+
return this.put(`${_constants.urls.tenants.subTenants.v1}/${tenantId}/management`, body, {
|
|
72
|
+
headers: this.extractHeadersFromOptions(options)
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
this.updateSubAccountAccess = async (userId, body, options) => {
|
|
77
|
+
return this.put(`${_constants.urls.identity.subTenants.v1}/${userId}/access`, body, {
|
|
78
|
+
headers: this.extractHeadersFromOptions(options)
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
this.addUsersToSubTenant = async (body, options) => {
|
|
83
|
+
return this.post(`${_constants.urls.identity.subTenants.v2}/`, body, {
|
|
84
|
+
headers: this.extractHeadersFromOptions(options)
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
updateSubTenantHierarchySettings({
|
|
90
|
+
tenantId
|
|
91
|
+
}, body, options) {
|
|
92
|
+
return this.put(`${_constants.urls.tenants.subTenants.v1}/${tenantId}/hierarchy-settings`, body, {
|
|
93
|
+
headers: this.extractHeadersFromOptions(options)
|
|
94
|
+
});
|
|
95
|
+
}
|
|
37
96
|
|
|
38
|
-
async function addUserRolesForSubTenants(userId, body, options) {
|
|
39
|
-
return (0, _fetch.Post)(`${_constants.urls.identity.subTenants.v1}/${userId}/roles`, body, {
|
|
40
|
-
headers: (0, _fetch.extractHeadersFromOptions)(options)
|
|
41
|
-
});
|
|
42
97
|
}
|
|
43
98
|
|
|
44
|
-
|
|
45
|
-
return (0, _fetch.Delete)(`${_constants.urls.identity.subTenants.v1}/${userId}/roles`, body, {
|
|
46
|
-
headers: (0, _fetch.extractHeadersFromOptions)(options)
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
async function setUserRolesForSubTenants(userId, body, options) {
|
|
51
|
-
return (0, _fetch.Patch)(`${_constants.urls.identity.subTenants.v1}/${userId}/roles`, body, {
|
|
52
|
-
headers: (0, _fetch.extractHeadersFromOptions)(options)
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
async function createSubTenant(body, options) {
|
|
57
|
-
return (0, _fetch.Post)(_constants.urls.tenants.subTenants.v1, body, {
|
|
58
|
-
headers: (0, _fetch.extractHeadersFromOptions)(options)
|
|
59
|
-
});
|
|
60
|
-
}
|
|
99
|
+
exports.SubTenantsApi = SubTenantsApi;
|
|
61
100
|
|
|
62
|
-
|
|
63
|
-
return (0, _fetch.Delete)(`${_constants.urls.tenants.subTenants.v1}/${tenantId}`, undefined, {
|
|
64
|
-
headers: (0, _fetch.extractHeadersFromOptions)(options)
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
async function updateSubTenant({
|
|
69
|
-
tenantId
|
|
70
|
-
}, body, options) {
|
|
71
|
-
return (0, _fetch.Patch)(`${_constants.urls.tenants.subTenants.v1}/${tenantId}`, body, {
|
|
72
|
-
headers: (0, _fetch.extractHeadersFromOptions)(options)
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
async function updateSubTenantManagement({
|
|
77
|
-
tenantId
|
|
78
|
-
}, body, options) {
|
|
79
|
-
return (0, _fetch.Put)(`${_constants.urls.tenants.subTenants.v1}/${tenantId}/management`, body, {
|
|
80
|
-
headers: (0, _fetch.extractHeadersFromOptions)(options)
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
async function updateSubTenantHierarchySettings({
|
|
85
|
-
tenantId
|
|
86
|
-
}, body, options) {
|
|
87
|
-
return (0, _fetch.Put)(`${_constants.urls.tenants.subTenants.v1}/${tenantId}/hierarchy-settings`, body, {
|
|
88
|
-
headers: (0, _fetch.extractHeadersFromOptions)(options)
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
async function updateSubAccountAccess(userId, body, options) {
|
|
93
|
-
return (0, _fetch.Put)(`${_constants.urls.identity.subTenants.v1}/${userId}/access`, body, {
|
|
94
|
-
headers: (0, _fetch.extractHeadersFromOptions)(options)
|
|
95
|
-
});
|
|
96
|
-
}
|
|
101
|
+
var _default = new SubTenantsApi('default');
|
|
97
102
|
|
|
98
|
-
|
|
99
|
-
return (0, _fetch.Post)(`${_constants.urls.identity.subTenants.v2}/`, body, {
|
|
100
|
-
headers: (0, _fetch.extractHeadersFromOptions)(options)
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
+
exports.default = _default;
|
|
@@ -3,133 +3,43 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
SubscriptionsApi: true
|
|
8
|
+
};
|
|
9
|
+
exports.default = exports.SubscriptionsApi = void 0;
|
|
6
10
|
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
Object.keys(_subscriptions).forEach(function (key) {
|
|
10
|
-
if (key === "default" || key === "__esModule") return;
|
|
11
|
-
if (key in exports && exports[key] === _subscriptions[key]) return;
|
|
12
|
-
Object.defineProperty(exports, key, {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _subscriptions[key];
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
var _managedSubscriptions = require("./managedSubscriptions");
|
|
21
|
-
|
|
22
|
-
Object.keys(_managedSubscriptions).forEach(function (key) {
|
|
23
|
-
if (key === "default" || key === "__esModule") return;
|
|
24
|
-
if (key in exports && exports[key] === _managedSubscriptions[key]) return;
|
|
25
|
-
Object.defineProperty(exports, key, {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function () {
|
|
28
|
-
return _managedSubscriptions[key];
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
var _plans = require("./plans");
|
|
34
|
-
|
|
35
|
-
Object.keys(_plans).forEach(function (key) {
|
|
36
|
-
if (key === "default" || key === "__esModule") return;
|
|
37
|
-
if (key in exports && exports[key] === _plans[key]) return;
|
|
38
|
-
Object.defineProperty(exports, key, {
|
|
39
|
-
enumerable: true,
|
|
40
|
-
get: function () {
|
|
41
|
-
return _plans[key];
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
});
|
|
11
|
+
var _BaseApiClient = require("../BaseApiClient");
|
|
45
12
|
|
|
46
13
|
var _invoices = require("./invoices");
|
|
47
14
|
|
|
48
|
-
|
|
49
|
-
if (key === "default" || key === "__esModule") return;
|
|
50
|
-
if (key in exports && exports[key] === _invoices[key]) return;
|
|
51
|
-
Object.defineProperty(exports, key, {
|
|
52
|
-
enumerable: true,
|
|
53
|
-
get: function () {
|
|
54
|
-
return _invoices[key];
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
});
|
|
15
|
+
var _managedSubscriptions = require("./managedSubscriptions");
|
|
58
16
|
|
|
59
17
|
var _paymentMethods = require("./paymentMethods");
|
|
60
18
|
|
|
61
|
-
|
|
62
|
-
if (key === "default" || key === "__esModule") return;
|
|
63
|
-
if (key in exports && exports[key] === _paymentMethods[key]) return;
|
|
64
|
-
Object.defineProperty(exports, key, {
|
|
65
|
-
enumerable: true,
|
|
66
|
-
get: function () {
|
|
67
|
-
return _paymentMethods[key];
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
});
|
|
19
|
+
var _paymentProviders = require("./paymentProviders");
|
|
71
20
|
|
|
72
|
-
var
|
|
21
|
+
var _plans = require("./plans");
|
|
73
22
|
|
|
74
|
-
|
|
75
|
-
if (key === "default" || key === "__esModule") return;
|
|
76
|
-
if (key in exports && exports[key] === _providers[key]) return;
|
|
77
|
-
Object.defineProperty(exports, key, {
|
|
78
|
-
enumerable: true,
|
|
79
|
-
get: function () {
|
|
80
|
-
return _providers[key];
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
});
|
|
23
|
+
var _subscriptions = require("./subscriptions");
|
|
84
24
|
|
|
85
25
|
var _summaries = require("./summaries");
|
|
86
26
|
|
|
87
|
-
Object.keys(_summaries).forEach(function (key) {
|
|
88
|
-
if (key === "default" || key === "__esModule") return;
|
|
89
|
-
if (key in exports && exports[key] === _summaries[key]) return;
|
|
90
|
-
Object.defineProperty(exports, key, {
|
|
91
|
-
enumerable: true,
|
|
92
|
-
get: function () {
|
|
93
|
-
return _summaries[key];
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
|
|
98
27
|
var _tenantConfiguration = require("./tenantConfiguration");
|
|
99
28
|
|
|
100
|
-
|
|
101
|
-
if (key === "default" || key === "__esModule") return;
|
|
102
|
-
if (key in exports && exports[key] === _tenantConfiguration[key]) return;
|
|
103
|
-
Object.defineProperty(exports, key, {
|
|
104
|
-
enumerable: true,
|
|
105
|
-
get: function () {
|
|
106
|
-
return _tenantConfiguration[key];
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
var _paymentProviders = require("./paymentProviders");
|
|
29
|
+
var _vendorPublicConfigurations = require("./vendorPublicConfigurations");
|
|
112
30
|
|
|
113
|
-
|
|
114
|
-
if (key === "default" || key === "__esModule") return;
|
|
115
|
-
if (key in exports && exports[key] === _paymentProviders[key]) return;
|
|
116
|
-
Object.defineProperty(exports, key, {
|
|
117
|
-
enumerable: true,
|
|
118
|
-
get: function () {
|
|
119
|
-
return _paymentProviders[key];
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
});
|
|
31
|
+
var _stripe = require("./providers/stripe");
|
|
123
32
|
|
|
124
|
-
var
|
|
33
|
+
var _interfaces = require("./interfaces");
|
|
125
34
|
|
|
126
|
-
Object.keys(
|
|
35
|
+
Object.keys(_interfaces).forEach(function (key) {
|
|
127
36
|
if (key === "default" || key === "__esModule") return;
|
|
128
|
-
if (
|
|
37
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
38
|
+
if (key in exports && exports[key] === _interfaces[key]) return;
|
|
129
39
|
Object.defineProperty(exports, key, {
|
|
130
40
|
enumerable: true,
|
|
131
41
|
get: function () {
|
|
132
|
-
return
|
|
42
|
+
return _interfaces[key];
|
|
133
43
|
}
|
|
134
44
|
});
|
|
135
45
|
});
|
|
@@ -138,6 +48,7 @@ var _enums = require("./enums");
|
|
|
138
48
|
|
|
139
49
|
Object.keys(_enums).forEach(function (key) {
|
|
140
50
|
if (key === "default" || key === "__esModule") return;
|
|
51
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
141
52
|
if (key in exports && exports[key] === _enums[key]) return;
|
|
142
53
|
Object.defineProperty(exports, key, {
|
|
143
54
|
enumerable: true,
|
|
@@ -145,4 +56,55 @@ Object.keys(_enums).forEach(function (key) {
|
|
|
145
56
|
return _enums[key];
|
|
146
57
|
}
|
|
147
58
|
});
|
|
148
|
-
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
class SubscriptionsApi extends _BaseApiClient.BaseApiClient {
|
|
62
|
+
constructor(appName) {
|
|
63
|
+
super(appName);
|
|
64
|
+
this.invoicesApi = new _invoices.InvoicesApi(this.appName);
|
|
65
|
+
this.managedSubscriptionApi = new _managedSubscriptions.ManagedSubscriptionApi(this.appName);
|
|
66
|
+
this.paymentMethodsApi = new _paymentMethods.PaymentMethodsApi(this.appName);
|
|
67
|
+
this.paymentProvidersApi = new _paymentProviders.PaymentProvidersApi(this.appName);
|
|
68
|
+
this.plansApi = new _plans.PlansApi(this.appName);
|
|
69
|
+
this.subscriptionApi = new _subscriptions.SubscriptionApi(this.appName);
|
|
70
|
+
this.summariesApi = new _summaries.SummariesApi(this.appName);
|
|
71
|
+
this.subscriptionTenantConfigApi = new _tenantConfiguration.SubscriptionTenantConfigApi(this.appName);
|
|
72
|
+
this.vendorPublicConfigApi = new _vendorPublicConfigurations.VendorPublicConfigApi(this.appName);
|
|
73
|
+
this.stripeProviderApi = new _stripe.StripeProviderApi(this.appName);
|
|
74
|
+
this.getSubscriptionInvoices = this.invoicesApi.getSubscriptionInvoices.bind(this.invoicesApi);
|
|
75
|
+
this.getSubscriptionInvoice = this.invoicesApi.getSubscriptionInvoice.bind(this.invoicesApi);
|
|
76
|
+
this.getSubscriptionInvoicePdf = this.invoicesApi.getSubscriptionInvoicePdf.bind(this.invoicesApi);
|
|
77
|
+
this.getManagedSubscription = this.managedSubscriptionApi.getManagedSubscription.bind(this.managedSubscriptionApi);
|
|
78
|
+
this.getManagedSubscriptions = this.managedSubscriptionApi.getManagedSubscriptions.bind(this.managedSubscriptionApi);
|
|
79
|
+
this.cancelManagedSubscription = this.managedSubscriptionApi.cancelManagedSubscription.bind(this.managedSubscriptionApi);
|
|
80
|
+
this.renewManagedSubscription = this.managedSubscriptionApi.renewManagedSubscription.bind(this.managedSubscriptionApi);
|
|
81
|
+
this.updateManagedSubscription = this.managedSubscriptionApi.updateManagedSubscription.bind(this.managedSubscriptionApi);
|
|
82
|
+
this.getPaymentMethods = this.paymentMethodsApi.getPaymentMethods.bind(this.paymentMethodsApi);
|
|
83
|
+
this.getPaymentMethod = this.paymentMethodsApi.getPaymentMethod.bind(this.paymentMethodsApi);
|
|
84
|
+
this.updatePaymentMethodBillingDetails = this.paymentMethodsApi.updatePaymentMethodBillingDetails.bind(this.paymentMethodsApi);
|
|
85
|
+
this.getPaymentProviders = this.paymentProvidersApi.getPaymentProviders.bind(this.paymentProvidersApi);
|
|
86
|
+
this.getSubscriptionPlans = this.plansApi.getSubscriptionPlans.bind(this.plansApi);
|
|
87
|
+
this.getSubscriptionPlan = this.plansApi.getSubscriptionPlan.bind(this.plansApi);
|
|
88
|
+
this.getSubscriptions = this.subscriptionApi.getSubscriptions.bind(this.subscriptionApi);
|
|
89
|
+
this.getSubscription = this.subscriptionApi.getSubscription.bind(this.subscriptionApi);
|
|
90
|
+
this.cancelSubscription = this.subscriptionApi.cancelSubscription.bind(this.subscriptionApi);
|
|
91
|
+
this.renewSubscription = this.subscriptionApi.renewSubscription.bind(this.subscriptionApi);
|
|
92
|
+
this.updateSubscription = this.subscriptionApi.updateSubscription.bind(this.subscriptionApi);
|
|
93
|
+
this.getSubscriptionSummaries = this.summariesApi.getSubscriptionSummaries.bind(this.summariesApi);
|
|
94
|
+
this.getTenantConfiguration = this.subscriptionTenantConfigApi.getTenantConfiguration.bind(this.subscriptionTenantConfigApi);
|
|
95
|
+
this.createTenantConfiguration = this.subscriptionTenantConfigApi.createTenantConfiguration.bind(this.subscriptionTenantConfigApi);
|
|
96
|
+
this.getVendorPublicConfigurations = this.vendorPublicConfigApi.getVendorPublicConfigurations.bind(this.vendorPublicConfigApi);
|
|
97
|
+
this.createSubscription = this.stripeProviderApi.createSubscription.bind(this.stripeProviderApi);
|
|
98
|
+
this.getStripeCustomer = this.stripeProviderApi.getStripeCustomer.bind(this.stripeProviderApi);
|
|
99
|
+
this.createStripeCustomer = this.stripeProviderApi.createStripeCustomer.bind(this.stripeProviderApi);
|
|
100
|
+
this.getStripePaymentProviderConfiguration = this.stripeProviderApi.getStripePaymentProviderConfiguration.bind(this.stripeProviderApi);
|
|
101
|
+
this.createStripePaymentMethodSetupIntentSecret = this.stripeProviderApi.createStripePaymentMethodSetupIntentSecret.bind(this.stripeProviderApi);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
exports.SubscriptionsApi = SubscriptionsApi;
|
|
107
|
+
|
|
108
|
+
var _default = new SubscriptionsApi('default');
|
|
109
|
+
|
|
110
|
+
exports.default = _default;
|
|
@@ -3,26 +3,34 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
exports.getSubscriptionInvoicePdf = getSubscriptionInvoicePdf;
|
|
8
|
-
exports.getSubscriptionInvoices = getSubscriptionInvoices;
|
|
9
|
-
|
|
10
|
-
var _fetch = require("../fetch");
|
|
6
|
+
exports.InvoicesApi = void 0;
|
|
11
7
|
|
|
12
8
|
var _constants = require("../constants");
|
|
13
9
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
var _BaseApiClient = require("../BaseApiClient");
|
|
11
|
+
|
|
12
|
+
class InvoicesApi extends _BaseApiClient.BaseApiClient {
|
|
13
|
+
constructor(...args) {
|
|
14
|
+
super(...args);
|
|
15
|
+
|
|
16
|
+
this.getSubscriptionInvoices = async () => {
|
|
17
|
+
return this.get(_constants.urls.subscriptions.billing.invoices.v1);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
this.getSubscriptionInvoice = async invoiceId => {
|
|
21
|
+
return this.get(`${_constants.urls.subscriptions.billing.invoices.v1}/${invoiceId}`);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
this.getSubscriptionInvoicePdf = async (invoiceId, outputFileName) => {
|
|
25
|
+
return this.get(`${_constants.urls.subscriptions.billing.invoices.v1}/${invoiceId}/pdf`, {
|
|
26
|
+
outputFileName
|
|
27
|
+
}, {
|
|
28
|
+
responseType: 'blob'
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
}
|
|
17
32
|
|
|
18
|
-
async function getSubscriptionInvoice(invoiceId) {
|
|
19
|
-
return (0, _fetch.Get)(`${_constants.urls.subscriptions.billing.invoices.v1}/${invoiceId}`);
|
|
20
33
|
}
|
|
21
34
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
outputFileName
|
|
25
|
-
}, {
|
|
26
|
-
responseType: "blob"
|
|
27
|
-
});
|
|
28
|
-
}
|
|
35
|
+
exports.InvoicesApi = InvoicesApi;
|
|
36
|
+
;
|
|
@@ -3,38 +3,43 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
exports.getManagedSubscription = getManagedSubscription;
|
|
8
|
-
exports.getManagedSubscriptions = getManagedSubscriptions;
|
|
9
|
-
exports.renewManagedSubscription = renewManagedSubscription;
|
|
10
|
-
exports.updateManagedSubscription = updateManagedSubscription;
|
|
11
|
-
|
|
12
|
-
var _fetch = require("../fetch");
|
|
6
|
+
exports.ManagedSubscriptionApi = void 0;
|
|
13
7
|
|
|
14
8
|
var _constants = require("../constants");
|
|
15
9
|
|
|
16
|
-
|
|
17
|
-
return (0, _fetch.Get)(`${_constants.urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}`);
|
|
18
|
-
}
|
|
10
|
+
var _BaseApiClient = require("../BaseApiClient");
|
|
19
11
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
class ManagedSubscriptionApi extends _BaseApiClient.BaseApiClient {
|
|
13
|
+
constructor(...args) {
|
|
14
|
+
super(...args);
|
|
23
15
|
|
|
24
|
-
async
|
|
25
|
-
|
|
26
|
-
}
|
|
16
|
+
this.getManagedSubscription = async subscriptionId => {
|
|
17
|
+
return this.get(`${_constants.urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}`);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
this.getManagedSubscriptions = async () => {
|
|
21
|
+
return this.get(_constants.urls.subscriptions.managedSubscriptions.v1);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
this.cancelManagedSubscription = async subscriptionId => {
|
|
25
|
+
return this.put(`${_constants.urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}/cancellations/`, {});
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
this.renewManagedSubscription = async subscriptionId => {
|
|
29
|
+
return this.put(`${_constants.urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}/renewals/`, {});
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
this.updateManagedSubscription = async (subscriptionId, {
|
|
33
|
+
paymentMethodId,
|
|
34
|
+
planId
|
|
35
|
+
}) => {
|
|
36
|
+
return this.put(`${_constants.urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}`, {
|
|
37
|
+
paymentMethodId,
|
|
38
|
+
planId
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
}
|
|
27
42
|
|
|
28
|
-
async function renewManagedSubscription(subscriptionId) {
|
|
29
|
-
return (0, _fetch.Put)(`${_constants.urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}/renewals/`, {});
|
|
30
43
|
}
|
|
31
44
|
|
|
32
|
-
|
|
33
|
-
paymentMethodId,
|
|
34
|
-
planId
|
|
35
|
-
}) {
|
|
36
|
-
return (0, _fetch.Put)(`${_constants.urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}`, {
|
|
37
|
-
paymentMethodId,
|
|
38
|
-
planId
|
|
39
|
-
});
|
|
40
|
-
}
|
|
45
|
+
exports.ManagedSubscriptionApi = ManagedSubscriptionApi;
|
|
@@ -5,33 +5,40 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
9
|
-
exports.getPaymentMethods = getPaymentMethods;
|
|
10
|
-
exports.updatePaymentMethodBillingDetails = updatePaymentMethodBillingDetails;
|
|
8
|
+
exports.PaymentMethodsApi = void 0;
|
|
11
9
|
|
|
12
10
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
13
11
|
|
|
14
|
-
var _fetch = require("../fetch");
|
|
15
|
-
|
|
16
12
|
var _constants = require("../constants");
|
|
17
13
|
|
|
14
|
+
var _BaseApiClient = require("../BaseApiClient");
|
|
15
|
+
|
|
18
16
|
const _excluded = ["email"];
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
class PaymentMethodsApi extends _BaseApiClient.BaseApiClient {
|
|
19
|
+
constructor(...args) {
|
|
20
|
+
super(...args);
|
|
21
|
+
|
|
22
|
+
this.getPaymentMethods = async () => {
|
|
23
|
+
return this.get(_constants.urls.subscriptions.billing.paymentMethods.v1);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
this.getPaymentMethod = async paymentMethodId => {
|
|
27
|
+
return this.get(`${_constants.urls.subscriptions.billing.paymentMethods.v1}/${paymentMethodId}`);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
this.updatePaymentMethodBillingDetails = async (paymentMethodId, _ref) => {
|
|
31
|
+
let {
|
|
32
|
+
email
|
|
33
|
+
} = _ref,
|
|
34
|
+
address = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
35
|
+
return this.patch(`${_constants.urls.subscriptions.billing.paymentMethods.v1}/${paymentMethodId}/billing-details`, {
|
|
36
|
+
email,
|
|
37
|
+
address
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
}
|
|
23
41
|
|
|
24
|
-
async function getPaymentMethod(paymentMethodId) {
|
|
25
|
-
return (0, _fetch.Get)(`${_constants.urls.subscriptions.billing.paymentMethods.v1}/${paymentMethodId}`);
|
|
26
42
|
}
|
|
27
43
|
|
|
28
|
-
|
|
29
|
-
let {
|
|
30
|
-
email
|
|
31
|
-
} = _ref,
|
|
32
|
-
address = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
33
|
-
return (0, _fetch.Patch)(`${_constants.urls.subscriptions.billing.paymentMethods.v1}/${paymentMethodId}/billing-details`, {
|
|
34
|
-
email,
|
|
35
|
-
address
|
|
36
|
-
});
|
|
37
|
-
}
|
|
44
|
+
exports.PaymentMethodsApi = PaymentMethodsApi;
|
|
@@ -3,12 +3,21 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
|
|
8
|
-
var _fetch = require("../fetch");
|
|
6
|
+
exports.PaymentProvidersApi = void 0;
|
|
9
7
|
|
|
10
8
|
var _constants = require("../constants");
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
var _BaseApiClient = require("../BaseApiClient");
|
|
11
|
+
|
|
12
|
+
class PaymentProvidersApi extends _BaseApiClient.BaseApiClient {
|
|
13
|
+
constructor(...args) {
|
|
14
|
+
super(...args);
|
|
15
|
+
|
|
16
|
+
this.getPaymentProviders = async () => {
|
|
17
|
+
return this.get(_constants.urls.subscriptions.paymentProviders.v1);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
exports.PaymentProvidersApi = PaymentProvidersApi;
|
|
@@ -3,17 +3,25 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
exports.getSubscriptionPlans = getSubscriptionPlans;
|
|
8
|
-
|
|
9
|
-
var _fetch = require("../fetch");
|
|
6
|
+
exports.PlansApi = void 0;
|
|
10
7
|
|
|
11
8
|
var _constants = require("../constants");
|
|
12
9
|
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
var _BaseApiClient = require("../BaseApiClient");
|
|
11
|
+
|
|
12
|
+
class PlansApi extends _BaseApiClient.BaseApiClient {
|
|
13
|
+
constructor(...args) {
|
|
14
|
+
super(...args);
|
|
15
|
+
|
|
16
|
+
this.getSubscriptionPlans = async () => {
|
|
17
|
+
return this.get(_constants.urls.subscriptions.billing.plans.v1);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
this.getSubscriptionPlan = async planId => {
|
|
21
|
+
return this.get(`${_constants.urls.subscriptions.billing.plans.v1}/${planId}`);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
15
25
|
}
|
|
16
26
|
|
|
17
|
-
|
|
18
|
-
return (0, _fetch.Get)(`${_constants.urls.subscriptions.billing.plans.v1}/${planId}`);
|
|
19
|
-
}
|
|
27
|
+
exports.PlansApi = PlansApi;
|