@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.
Files changed (122) hide show
  1. package/BaseApiClient.d.ts +16 -0
  2. package/BaseApiClient.js +39 -0
  3. package/ContextHolder/index.d.ts +108 -27
  4. package/ContextHolder/index.js +155 -50
  5. package/FetchClient.d.ts +42 -0
  6. package/FetchClient.js +308 -0
  7. package/account-settings/index.d.ts +19 -7
  8. package/account-settings/index.js +23 -13
  9. package/applications/index.d.ts +49 -44
  10. package/applications/index.js +51 -37
  11. package/audits/index.d.ts +27 -15
  12. package/audits/index.js +27 -17
  13. package/auth/index.d.ts +817 -768
  14. package/auth/index.js +902 -721
  15. package/auth/secutiry-poilicy/index.d.ts +58 -102
  16. package/auth/secutiry-poilicy/index.js +122 -90
  17. package/auth/utils.d.ts +2 -2
  18. package/auth/utils.js +9 -8
  19. package/connectivity/index.d.ts +126 -27
  20. package/connectivity/index.js +147 -114
  21. package/directory/index.d.ts +31 -22
  22. package/directory/index.js +27 -15
  23. package/entitlements/index.d.ts +14 -8
  24. package/entitlements/index.js +12 -4
  25. package/feature-flags/index.d.ts +8 -2
  26. package/feature-flags/index.js +16 -8
  27. package/groups/index.d.ts +73 -49
  28. package/groups/index.js +64 -45
  29. package/impersonate/index.d.ts +15 -6
  30. package/impersonate/index.js +13 -5
  31. package/index.d.ts +154 -108
  32. package/index.js +109 -78
  33. package/interfaces.d.ts +10 -0
  34. package/metadata/index.d.ts +67 -7
  35. package/metadata/index.js +52 -32
  36. package/node/BaseApiClient.js +49 -0
  37. package/node/ContextHolder/index.js +155 -50
  38. package/node/FetchClient.js +326 -0
  39. package/node/account-settings/index.js +27 -16
  40. package/node/applications/index.js +51 -44
  41. package/node/audits/index.js +31 -20
  42. package/node/auth/index.js +768 -1035
  43. package/node/auth/secutiry-poilicy/index.js +125 -136
  44. package/node/auth/utils.js +9 -7
  45. package/node/connectivity/index.js +148 -187
  46. package/node/directory/index.js +29 -20
  47. package/node/entitlements/index.js +18 -5
  48. package/node/feature-flags/index.js +21 -9
  49. package/node/groups/index.js +65 -63
  50. package/node/impersonate/index.js +18 -5
  51. package/node/index.js +116 -71
  52. package/node/metadata/index.js +61 -52
  53. package/node/notifications/index.js +37 -27
  54. package/node/reports/index.js +78 -70
  55. package/node/roles/index.js +56 -51
  56. package/node/security-center/index.js +21 -9
  57. package/node/sub-tenants/index.js +90 -89
  58. package/node/subscriptions/index.js +69 -107
  59. package/node/subscriptions/invoices.js +25 -17
  60. package/node/subscriptions/managedSubscriptions.js +32 -27
  61. package/node/subscriptions/paymentMethods.js +27 -20
  62. package/node/subscriptions/paymentProviders.js +15 -6
  63. package/node/subscriptions/plans.js +17 -9
  64. package/node/subscriptions/providers/stripe/index.js +26 -21
  65. package/node/subscriptions/subscriptions.js +32 -27
  66. package/node/subscriptions/summaries.js +15 -6
  67. package/node/subscriptions/tenantConfiguration.js +17 -9
  68. package/node/subscriptions/vendorPublicConfigurations.js +15 -6
  69. package/node/teams/index.js +130 -138
  70. package/node/tenants/index.js +65 -60
  71. package/node/user-phone-numbers/index.js +32 -24
  72. package/node/users/index.js +58 -53
  73. package/node/vendor/index.js +17 -6
  74. package/notifications/index.d.ts +22 -16
  75. package/notifications/index.js +33 -22
  76. package/package.json +1 -1
  77. package/reports/index.d.ts +50 -44
  78. package/reports/index.js +75 -62
  79. package/roles/index.d.ts +44 -38
  80. package/roles/index.js +57 -41
  81. package/security-center/index.d.ts +14 -2
  82. package/security-center/index.js +15 -6
  83. package/sub-tenants/index.d.ts +57 -15
  84. package/sub-tenants/index.js +88 -68
  85. package/subscriptions/index.d.ts +56 -11
  86. package/subscriptions/index.js +58 -11
  87. package/subscriptions/invoices.d.ts +16 -13
  88. package/subscriptions/invoices.js +24 -14
  89. package/subscriptions/managedSubscriptions.d.ts +18 -15
  90. package/subscriptions/managedSubscriptions.js +33 -22
  91. package/subscriptions/paymentMethods.d.ts +16 -13
  92. package/subscriptions/paymentMethods.js +26 -17
  93. package/subscriptions/paymentProviders.d.ts +8 -5
  94. package/subscriptions/paymentProviders.js +11 -4
  95. package/subscriptions/plans.d.ts +11 -8
  96. package/subscriptions/plans.js +14 -6
  97. package/subscriptions/providers/stripe/index.d.ts +24 -21
  98. package/subscriptions/providers/stripe/index.js +27 -16
  99. package/subscriptions/subscriptions.d.ts +24 -21
  100. package/subscriptions/subscriptions.js +33 -22
  101. package/subscriptions/summaries.d.ts +7 -4
  102. package/subscriptions/summaries.js +10 -3
  103. package/subscriptions/tenantConfiguration.d.ts +6 -3
  104. package/subscriptions/tenantConfiguration.js +15 -7
  105. package/subscriptions/vendorPublicConfigurations.d.ts +5 -2
  106. package/subscriptions/vendorPublicConfigurations.js +11 -4
  107. package/teams/index.d.ts +35 -131
  108. package/teams/index.js +122 -93
  109. package/tenants/index.d.ts +25 -37
  110. package/tenants/index.js +62 -46
  111. package/user-phone-numbers/index.d.ts +32 -26
  112. package/user-phone-numbers/index.js +32 -19
  113. package/users/index.d.ts +21 -15
  114. package/users/index.js +60 -44
  115. package/vendor/index.d.ts +12 -6
  116. package/vendor/index.js +11 -4
  117. package/fetch.d.ts +0 -24
  118. package/fetch.js +0 -265
  119. package/node/fetch.js +0 -306
  120. package/node/subscriptions/providers/index.js +0 -18
  121. package/subscriptions/providers/index.d.ts +0 -1
  122. 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.addUserRolesForSubTenants = addUserRolesForSubTenants;
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
- async function loadAllUsers(params) {
25
- return (0, _fetch.Get)(_constants.urls.identity.subTenants.v1, params);
26
- }
27
-
28
- async function addUserToTenantAndSubTenants(body) {
29
- return (0, _fetch.Post)(_constants.urls.identity.subTenants.v1, body);
30
- }
31
-
32
- async function removeUserFromTenantAndSubTenants(body, options) {
33
- return (0, _fetch.Delete)(_constants.urls.identity.subTenants.v1, body, {
34
- headers: (0, _fetch.extractHeadersFromOptions)(options)
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
- async function removeUserRolesFromSubTenants(userId, body, options) {
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
- async function deleteSubTenant(tenantId, options) {
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
- async function addUsersToSubTenant(body, options) {
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 _subscriptions = require("./subscriptions");
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
- Object.keys(_invoices).forEach(function (key) {
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
- Object.keys(_paymentMethods).forEach(function (key) {
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 _providers = require("./providers");
21
+ var _plans = require("./plans");
73
22
 
74
- Object.keys(_providers).forEach(function (key) {
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
- Object.keys(_tenantConfiguration).forEach(function (key) {
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
- Object.keys(_paymentProviders).forEach(function (key) {
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 _vendorPublicConfigurations = require("./vendorPublicConfigurations");
33
+ var _interfaces = require("./interfaces");
125
34
 
126
- Object.keys(_vendorPublicConfigurations).forEach(function (key) {
35
+ Object.keys(_interfaces).forEach(function (key) {
127
36
  if (key === "default" || key === "__esModule") return;
128
- if (key in exports && exports[key] === _vendorPublicConfigurations[key]) return;
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 _vendorPublicConfigurations[key];
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.getSubscriptionInvoice = getSubscriptionInvoice;
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
- async function getSubscriptionInvoices() {
15
- return (0, _fetch.Get)(_constants.urls.subscriptions.billing.invoices.v1);
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
- async function getSubscriptionInvoicePdf(invoiceId, outputFileName) {
23
- return (0, _fetch.Get)(`${_constants.urls.subscriptions.billing.invoices.v1}/${invoiceId}/pdf`, {
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.cancelManagedSubscription = cancelManagedSubscription;
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
- async function getManagedSubscription(subscriptionId) {
17
- return (0, _fetch.Get)(`${_constants.urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}`);
18
- }
10
+ var _BaseApiClient = require("../BaseApiClient");
19
11
 
20
- async function getManagedSubscriptions() {
21
- return (0, _fetch.Get)(`${_constants.urls.subscriptions.managedSubscriptions.v1}`);
22
- }
12
+ class ManagedSubscriptionApi extends _BaseApiClient.BaseApiClient {
13
+ constructor(...args) {
14
+ super(...args);
23
15
 
24
- async function cancelManagedSubscription(subscriptionId) {
25
- return (0, _fetch.Put)(`${_constants.urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}/cancellations/`, {});
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
- async function updateManagedSubscription(subscriptionId, {
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.getPaymentMethod = getPaymentMethod;
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
- async function getPaymentMethods() {
21
- return (0, _fetch.Get)(_constants.urls.subscriptions.billing.paymentMethods.v1);
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
- async function updatePaymentMethodBillingDetails(paymentMethodId, _ref) {
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.getPaymentProviders = getPaymentProviders;
7
-
8
- var _fetch = require("../fetch");
6
+ exports.PaymentProvidersApi = void 0;
9
7
 
10
8
  var _constants = require("../constants");
11
9
 
12
- async function getPaymentProviders() {
13
- return (0, _fetch.Get)(_constants.urls.subscriptions.paymentProviders.v1);
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.getSubscriptionPlan = getSubscriptionPlan;
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
- async function getSubscriptionPlans() {
14
- return (0, _fetch.Get)(_constants.urls.subscriptions.billing.plans.v1);
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
- async function getSubscriptionPlan(planId) {
18
- return (0, _fetch.Get)(`${_constants.urls.subscriptions.billing.plans.v1}/${planId}`);
19
- }
27
+ exports.PlansApi = PlansApi;