@frontegg/rest-api 3.1.72 → 3.1.74-alpha.9436511986

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 (127) hide show
  1. package/BaseApiClient.d.ts +16 -0
  2. package/BaseApiClient.js +39 -0
  3. package/ContextHolder/index.d.ts +81 -24
  4. package/ContextHolder/index.js +55 -43
  5. package/FetchClient.d.ts +35 -0
  6. package/FetchClient.js +286 -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 +764 -768
  14. package/auth/index.js +875 -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 +10 -9
  19. package/connectivity/index.d.ts +125 -26
  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 +174 -108
  32. package/index.js +108 -79
  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 +59 -44
  38. package/node/FetchClient.js +311 -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 +746 -1036
  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 +127 -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/routers.js +1 -1
  57. package/node/security-center/index.js +21 -9
  58. package/node/sub-tenants/index.js +83 -73
  59. package/node/sub-tenants/interfaces.js +10 -1
  60. package/node/subscriptions/index.js +79 -107
  61. package/node/subscriptions/invoices.js +25 -17
  62. package/node/subscriptions/managedSubscriptions.js +32 -27
  63. package/node/subscriptions/paymentMethods.js +27 -20
  64. package/node/subscriptions/paymentProviders.js +15 -6
  65. package/node/subscriptions/plans.js +17 -9
  66. package/node/subscriptions/providers/stripe/index.js +26 -21
  67. package/node/subscriptions/subscriptions.js +32 -27
  68. package/node/subscriptions/summaries.js +15 -6
  69. package/node/subscriptions/tenantConfiguration.js +17 -9
  70. package/node/subscriptions/vendorPublicConfigurations.js +15 -6
  71. package/node/teams/index.js +130 -138
  72. package/node/tenants/index.js +65 -60
  73. package/node/user-phone-numbers/index.js +32 -24
  74. package/node/users/index.js +58 -53
  75. package/node/vendor/index.js +17 -6
  76. package/notifications/index.d.ts +22 -16
  77. package/notifications/index.js +33 -22
  78. package/package.json +1 -1
  79. package/reports/index.d.ts +50 -44
  80. package/reports/index.js +75 -62
  81. package/roles/index.d.ts +44 -38
  82. package/roles/index.js +57 -41
  83. package/routers.js +1 -1
  84. package/security-center/index.d.ts +14 -2
  85. package/security-center/index.js +15 -6
  86. package/sub-tenants/index.d.ts +57 -14
  87. package/sub-tenants/index.js +88 -61
  88. package/sub-tenants/interfaces.d.ts +8 -0
  89. package/sub-tenants/interfaces.js +7 -1
  90. package/subscriptions/index.d.ts +56 -11
  91. package/subscriptions/index.js +68 -11
  92. package/subscriptions/invoices.d.ts +16 -13
  93. package/subscriptions/invoices.js +24 -14
  94. package/subscriptions/managedSubscriptions.d.ts +18 -15
  95. package/subscriptions/managedSubscriptions.js +33 -22
  96. package/subscriptions/paymentMethods.d.ts +16 -13
  97. package/subscriptions/paymentMethods.js +26 -17
  98. package/subscriptions/paymentProviders.d.ts +8 -5
  99. package/subscriptions/paymentProviders.js +11 -4
  100. package/subscriptions/plans.d.ts +11 -8
  101. package/subscriptions/plans.js +14 -6
  102. package/subscriptions/providers/stripe/index.d.ts +24 -21
  103. package/subscriptions/providers/stripe/index.js +27 -16
  104. package/subscriptions/subscriptions.d.ts +24 -21
  105. package/subscriptions/subscriptions.js +33 -22
  106. package/subscriptions/summaries.d.ts +7 -4
  107. package/subscriptions/summaries.js +10 -3
  108. package/subscriptions/tenantConfiguration.d.ts +6 -3
  109. package/subscriptions/tenantConfiguration.js +15 -7
  110. package/subscriptions/vendorPublicConfigurations.d.ts +5 -2
  111. package/subscriptions/vendorPublicConfigurations.js +11 -4
  112. package/teams/index.d.ts +35 -131
  113. package/teams/index.js +122 -93
  114. package/tenants/index.d.ts +25 -37
  115. package/tenants/index.js +63 -47
  116. package/user-phone-numbers/index.d.ts +32 -26
  117. package/user-phone-numbers/index.js +32 -19
  118. package/users/index.d.ts +21 -15
  119. package/users/index.js +60 -44
  120. package/vendor/index.d.ts +12 -6
  121. package/vendor/index.js +11 -4
  122. package/fetch.d.ts +0 -24
  123. package/fetch.js +0 -265
  124. package/node/fetch.js +0 -306
  125. package/node/subscriptions/providers/index.js +0 -18
  126. package/subscriptions/providers/index.d.ts +0 -1
  127. package/subscriptions/providers/index.js +0 -1
@@ -3,91 +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.updateSubTenantManagement = updateSubTenantManagement;
18
-
19
- var _fetch = require("../fetch");
6
+ exports.default = exports.SubTenantsApi = void 0;
20
7
 
21
8
  var _constants = require("../constants");
22
9
 
23
- async function loadAllUsers(params) {
24
- return (0, _fetch.Get)(_constants.urls.identity.subTenants.v1, params);
25
- }
10
+ var _BaseApiClient = require("../BaseApiClient");
26
11
 
27
- async function addUserToTenantAndSubTenants(body) {
28
- return (0, _fetch.Post)(_constants.urls.identity.subTenants.v1, body);
29
- }
12
+ class SubTenantsApi extends _BaseApiClient.BaseApiClient {
13
+ constructor(appName) {
14
+ super(appName);
30
15
 
31
- async function removeUserFromTenantAndSubTenants(body, options) {
32
- return (0, _fetch.Delete)(_constants.urls.identity.subTenants.v1, body, {
33
- headers: (0, _fetch.extractHeadersFromOptions)(options)
34
- });
35
- }
16
+ this.loadAllUsers = async params => {
17
+ return this.get(_constants.urls.identity.subTenants.v1, params);
18
+ };
36
19
 
37
- async function addUserRolesForSubTenants(userId, body, options) {
38
- return (0, _fetch.Post)(`${_constants.urls.identity.subTenants.v1}/${userId}/roles`, body, {
39
- headers: (0, _fetch.extractHeadersFromOptions)(options)
40
- });
41
- }
20
+ this.addUserToTenantAndSubTenants = async body => {
21
+ return this.post(_constants.urls.identity.subTenants.v1, body);
22
+ };
42
23
 
43
- async function removeUserRolesFromSubTenants(userId, body, options) {
44
- return (0, _fetch.Delete)(`${_constants.urls.identity.subTenants.v1}/${userId}/roles`, body, {
45
- headers: (0, _fetch.extractHeadersFromOptions)(options)
46
- });
47
- }
24
+ this.removeUserFromTenantAndSubTenants = async (body, options) => {
25
+ return this.delete(_constants.urls.identity.subTenants.v1, body, {
26
+ headers: this.extractHeadersFromOptions(options)
27
+ });
28
+ };
48
29
 
49
- async function setUserRolesForSubTenants(userId, body, options) {
50
- return (0, _fetch.Patch)(`${_constants.urls.identity.subTenants.v1}/${userId}/roles`, body, {
51
- headers: (0, _fetch.extractHeadersFromOptions)(options)
52
- });
53
- }
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
+ };
54
35
 
55
- async function createSubTenant(body, options) {
56
- return (0, _fetch.Post)(_constants.urls.tenants.subTenants.v1, body, {
57
- headers: (0, _fetch.extractHeadersFromOptions)(options)
58
- });
59
- }
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
+ };
60
41
 
61
- async function deleteSubTenant(tenantId, options) {
62
- return (0, _fetch.Delete)(`${_constants.urls.tenants.subTenants.v1}/${tenantId}`, undefined, {
63
- headers: (0, _fetch.extractHeadersFromOptions)(options)
64
- });
65
- }
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
+ };
66
47
 
67
- async function updateSubTenant({
68
- tenantId
69
- }, body, options) {
70
- return (0, _fetch.Patch)(`${_constants.urls.tenants.subTenants.v1}/${tenantId}`, body, {
71
- headers: (0, _fetch.extractHeadersFromOptions)(options)
72
- });
73
- }
48
+ this.createSubTenant = async (body, options) => {
49
+ return this.post(_constants.urls.tenants.subTenants.v1, body, {
50
+ headers: this.extractHeadersFromOptions(options)
51
+ });
52
+ };
74
53
 
75
- async function updateSubTenantManagement({
76
- tenantId
77
- }, body, options) {
78
- return (0, _fetch.Put)(`${_constants.urls.tenants.subTenants.v1}/${tenantId}/management`, body, {
79
- headers: (0, _fetch.extractHeadersFromOptions)(options)
80
- });
81
- }
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
+ }
82
96
 
83
- async function updateSubAccountAccess(userId, body, options) {
84
- return (0, _fetch.Put)(`${_constants.urls.identity.subTenants.v1}/${userId}/access`, body, {
85
- headers: (0, _fetch.extractHeadersFromOptions)(options)
86
- });
87
97
  }
88
98
 
89
- async function addUsersToSubTenant(body, options) {
90
- return (0, _fetch.Post)(`${_constants.urls.identity.subTenants.v2}/`, body, {
91
- headers: (0, _fetch.extractHeadersFromOptions)(options)
92
- });
93
- }
99
+ exports.SubTenantsApi = SubTenantsApi;
100
+
101
+ var _default = new SubTenantsApi('default');
102
+
103
+ exports.default = _default;
@@ -2,4 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
- });
5
+ });
6
+ exports.SubAccountAccessTypeEnum = void 0;
7
+ let SubAccountAccessTypeEnum;
8
+ exports.SubAccountAccessTypeEnum = SubAccountAccessTypeEnum;
9
+
10
+ (function (SubAccountAccessTypeEnum) {
11
+ SubAccountAccessTypeEnum["DEFAULT_OFF"] = "defaultOff";
12
+ SubAccountAccessTypeEnum["DEFAULT_ON"] = "defaultOn";
13
+ SubAccountAccessTypeEnum["ALWAYS_ON"] = "alwaysOn";
14
+ })(SubAccountAccessTypeEnum || (exports.SubAccountAccessTypeEnum = SubAccountAccessTypeEnum = {}));
@@ -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,65 @@ 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 = void 0;
65
+ this.managedSubscriptionApi = void 0;
66
+ this.paymentMethodsApi = void 0;
67
+ this.paymentProvidersApi = void 0;
68
+ this.plansApi = void 0;
69
+ this.subscriptionApi = void 0;
70
+ this.summaries = void 0;
71
+ this.subscriptionTenantConfigApi = void 0;
72
+ this.vendorPublicConfigApi = void 0;
73
+ this.stripeProviderApi = void 0;
74
+ this.getSubscriptionInvoices = this.invoicesApi.getSubscriptionInvoices.bind(this.plansApi);
75
+ this.getSubscriptionInvoice = this.invoicesApi.getSubscriptionInvoice.bind(this.plansApi);
76
+ this.getSubscriptionInvoicePdf = this.invoicesApi.getSubscriptionInvoicePdf.bind(this.plansApi);
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.summaries.getSubscriptionSummaries.bind(this.summaries);
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
+ this.invoicesApi = new _invoices.InvoicesApi(appName);
103
+ this.managedSubscriptionApi = new _managedSubscriptions.ManagedSubscriptionApi(appName);
104
+ this.paymentMethodsApi = new _paymentMethods.PaymentMethodsApi(appName);
105
+ this.paymentProvidersApi = new _paymentProviders.PaymentProvidersApi(appName);
106
+ this.plansApi = new _plans.PlansApi(appName);
107
+ this.subscriptionApi = new _subscriptions.SubscriptionApi(appName);
108
+ this.summaries = new _summaries.SummariesApi(appName);
109
+ this.subscriptionTenantConfigApi = new _tenantConfiguration.SubscriptionTenantConfigApi(appName);
110
+ this.vendorPublicConfigApi = new _vendorPublicConfigurations.VendorPublicConfigApi(appName);
111
+ this.stripeProviderApi = new _stripe.StripeProviderApi(appName);
112
+ }
113
+
114
+ }
115
+
116
+ exports.SubscriptionsApi = SubscriptionsApi;
117
+
118
+ var _default = new SubscriptionsApi('default');
119
+
120
+ 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;