@frontegg/rest-api 3.1.74-alpha.9437937621 → 3.1.74

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/ContextHolder/index.d.ts +27 -108
  2. package/ContextHolder/index.js +50 -155
  3. package/account-settings/index.d.ts +7 -19
  4. package/account-settings/index.js +13 -23
  5. package/applications/index.d.ts +44 -49
  6. package/applications/index.js +37 -51
  7. package/audits/index.d.ts +15 -27
  8. package/audits/index.js +17 -27
  9. package/auth/index.d.ts +768 -817
  10. package/auth/index.js +721 -902
  11. package/auth/secutiry-poilicy/index.d.ts +102 -58
  12. package/auth/secutiry-poilicy/index.js +90 -122
  13. package/auth/utils.d.ts +2 -2
  14. package/auth/utils.js +8 -9
  15. package/connectivity/index.d.ts +26 -125
  16. package/connectivity/index.js +114 -147
  17. package/directory/index.d.ts +22 -31
  18. package/directory/index.js +15 -27
  19. package/entitlements/index.d.ts +8 -14
  20. package/entitlements/index.js +4 -12
  21. package/feature-flags/index.d.ts +2 -8
  22. package/feature-flags/index.js +8 -16
  23. package/fetch.d.ts +24 -0
  24. package/fetch.js +265 -0
  25. package/groups/index.d.ts +49 -73
  26. package/groups/index.js +45 -64
  27. package/impersonate/index.d.ts +6 -15
  28. package/impersonate/index.js +5 -13
  29. package/index.d.ts +108 -154
  30. package/index.js +78 -109
  31. package/interfaces.d.ts +0 -10
  32. package/metadata/index.d.ts +7 -67
  33. package/metadata/index.js +32 -52
  34. package/node/ContextHolder/index.js +50 -155
  35. package/node/account-settings/index.js +16 -27
  36. package/node/applications/index.js +44 -51
  37. package/node/audits/index.js +20 -31
  38. package/node/auth/index.js +1035 -768
  39. package/node/auth/secutiry-poilicy/index.js +136 -125
  40. package/node/auth/utils.js +7 -9
  41. package/node/connectivity/index.js +187 -148
  42. package/node/directory/index.js +20 -29
  43. package/node/entitlements/index.js +5 -18
  44. package/node/feature-flags/index.js +9 -21
  45. package/node/fetch.js +306 -0
  46. package/node/groups/index.js +63 -65
  47. package/node/impersonate/index.js +5 -18
  48. package/node/index.js +71 -116
  49. package/node/metadata/index.js +52 -61
  50. package/node/notifications/index.js +27 -37
  51. package/node/reports/index.js +70 -78
  52. package/node/roles/index.js +51 -56
  53. package/node/security-center/index.js +9 -21
  54. package/node/sub-tenants/index.js +89 -90
  55. package/node/subscriptions/index.js +107 -79
  56. package/node/subscriptions/invoices.js +17 -25
  57. package/node/subscriptions/managedSubscriptions.js +27 -32
  58. package/node/subscriptions/paymentMethods.js +20 -27
  59. package/node/subscriptions/paymentProviders.js +6 -15
  60. package/node/subscriptions/plans.js +9 -17
  61. package/node/subscriptions/providers/index.js +18 -0
  62. package/node/subscriptions/providers/stripe/index.js +21 -26
  63. package/node/subscriptions/subscriptions.js +27 -32
  64. package/node/subscriptions/summaries.js +6 -15
  65. package/node/subscriptions/tenantConfiguration.js +9 -17
  66. package/node/subscriptions/vendorPublicConfigurations.js +6 -15
  67. package/node/teams/index.js +138 -130
  68. package/node/tenants/index.js +60 -65
  69. package/node/user-phone-numbers/index.js +24 -32
  70. package/node/users/index.js +53 -58
  71. package/node/vendor/index.js +6 -17
  72. package/notifications/index.d.ts +16 -22
  73. package/notifications/index.js +22 -33
  74. package/package.json +1 -1
  75. package/reports/index.d.ts +44 -50
  76. package/reports/index.js +62 -75
  77. package/roles/index.d.ts +38 -44
  78. package/roles/index.js +41 -57
  79. package/security-center/index.d.ts +2 -14
  80. package/security-center/index.js +6 -15
  81. package/sub-tenants/index.d.ts +15 -57
  82. package/sub-tenants/index.js +68 -88
  83. package/subscriptions/index.d.ts +11 -56
  84. package/subscriptions/index.js +11 -68
  85. package/subscriptions/invoices.d.ts +13 -16
  86. package/subscriptions/invoices.js +14 -24
  87. package/subscriptions/managedSubscriptions.d.ts +15 -18
  88. package/subscriptions/managedSubscriptions.js +22 -33
  89. package/subscriptions/paymentMethods.d.ts +13 -16
  90. package/subscriptions/paymentMethods.js +17 -26
  91. package/subscriptions/paymentProviders.d.ts +5 -8
  92. package/subscriptions/paymentProviders.js +4 -11
  93. package/subscriptions/plans.d.ts +8 -11
  94. package/subscriptions/plans.js +6 -14
  95. package/subscriptions/providers/index.d.ts +1 -0
  96. package/subscriptions/providers/index.js +1 -0
  97. package/subscriptions/providers/stripe/index.d.ts +21 -24
  98. package/subscriptions/providers/stripe/index.js +16 -27
  99. package/subscriptions/subscriptions.d.ts +21 -24
  100. package/subscriptions/subscriptions.js +22 -33
  101. package/subscriptions/summaries.d.ts +4 -7
  102. package/subscriptions/summaries.js +3 -10
  103. package/subscriptions/tenantConfiguration.d.ts +3 -6
  104. package/subscriptions/tenantConfiguration.js +7 -15
  105. package/subscriptions/vendorPublicConfigurations.d.ts +2 -5
  106. package/subscriptions/vendorPublicConfigurations.js +4 -11
  107. package/teams/index.d.ts +131 -35
  108. package/teams/index.js +93 -122
  109. package/tenants/index.d.ts +37 -25
  110. package/tenants/index.js +46 -62
  111. package/user-phone-numbers/index.d.ts +26 -32
  112. package/user-phone-numbers/index.js +19 -32
  113. package/users/index.d.ts +15 -21
  114. package/users/index.js +44 -60
  115. package/vendor/index.d.ts +6 -12
  116. package/vendor/index.js +4 -11
  117. package/BaseApiClient.d.ts +0 -16
  118. package/BaseApiClient.js +0 -39
  119. package/FetchClient.d.ts +0 -42
  120. package/FetchClient.js +0 -308
  121. package/node/BaseApiClient.js +0 -49
  122. package/node/FetchClient.js +0 -326
@@ -5,77 +5,72 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = exports.RolesApi = void 0;
8
+ exports.addRole = addRole;
9
+ exports.addRoleV2 = addRoleV2;
10
+ exports.attachPermissionToRoles = attachPermissionToRoles;
11
+ exports.attachPermissionsToRole = attachPermissionsToRole;
12
+ exports.deleteRole = deleteRole;
13
+ exports.getPermissionCategories = getPermissionCategories;
14
+ exports.getPermissions = getPermissions;
15
+ exports.getRoles = getRoles;
16
+ exports.updateRole = updateRole;
9
17
 
10
18
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
11
19
 
12
- var _constants = require("../constants");
20
+ var _fetch = require("../fetch");
13
21
 
14
- var _BaseApiClient = require("../BaseApiClient");
22
+ var _constants = require("../constants");
15
23
 
16
24
  const _excluded = ["roleId"],
17
25
  _excluded2 = ["roleId"],
18
26
  _excluded3 = ["permissionId"];
19
27
 
20
- class RolesApi extends _BaseApiClient.BaseApiClient {
21
- constructor(appName) {
22
- super(appName);
23
-
24
- this.getRoles = async () => {
25
- return this.get(_constants.urls.identity.roles.v1);
26
- };
27
-
28
- this.addRole = async body => {
29
- return this.post(_constants.urls.identity.roles.v1, body);
30
- };
31
-
32
- this.deleteRole = async ({
33
- roleId
34
- }) => {
35
- return this.delete(`${_constants.urls.identity.roles.v1}/${roleId}`);
36
- };
37
-
38
- this.updateRole = async _ref => {
39
- let {
40
- roleId
41
- } = _ref,
42
- body = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
43
- return this.patch(`${_constants.urls.identity.roles.v1}/${roleId}`, body);
44
- };
45
-
46
- this.attachPermissionsToRole = async _ref2 => {
47
- let {
48
- roleId
49
- } = _ref2,
50
- body = (0, _objectWithoutPropertiesLoose2.default)(_ref2, _excluded2);
51
- return this.put(`${_constants.urls.identity.roles.v1}/${roleId}/permissions`, body);
52
- };
28
+ async function getRoles() {
29
+ return (0, _fetch.Get)(_constants.urls.identity.roles.v1);
30
+ }
53
31
 
54
- this.getPermissions = async () => {
55
- return this.get(_constants.urls.identity.permissions.v1);
56
- };
32
+ async function addRole(body) {
33
+ return (0, _fetch.Post)(_constants.urls.identity.roles.v1, body);
34
+ }
57
35
 
58
- this.attachPermissionToRoles = async _ref3 => {
59
- let {
60
- permissionId
61
- } = _ref3,
62
- body = (0, _objectWithoutPropertiesLoose2.default)(_ref3, _excluded3);
63
- return this.put(`${_constants.urls.identity.permissions.v1}/${permissionId}/roles`, body);
64
- };
36
+ async function deleteRole({
37
+ roleId
38
+ }) {
39
+ return (0, _fetch.Delete)(`${_constants.urls.identity.roles.v1}/${roleId}`);
40
+ }
65
41
 
66
- this.getPermissionCategories = async () => {
67
- return this.get(`${_constants.urls.identity.permissions.v1}/categories`);
68
- };
42
+ async function updateRole(_ref) {
43
+ let {
44
+ roleId
45
+ } = _ref,
46
+ body = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
47
+ return (0, _fetch.Patch)(`${_constants.urls.identity.roles.v1}/${roleId}`, body);
48
+ }
69
49
 
70
- this.addRoleV2 = async body => {
71
- return this.post(_constants.urls.identity.roles.v2, body);
72
- };
73
- }
50
+ async function attachPermissionsToRole(_ref2) {
51
+ let {
52
+ roleId
53
+ } = _ref2,
54
+ body = (0, _objectWithoutPropertiesLoose2.default)(_ref2, _excluded2);
55
+ return (0, _fetch.Put)(`${_constants.urls.identity.roles.v1}/${roleId}/permissions`, body);
56
+ }
74
57
 
58
+ async function getPermissions() {
59
+ return (0, _fetch.Get)(_constants.urls.identity.permissions.v1);
75
60
  }
76
61
 
77
- exports.RolesApi = RolesApi;
62
+ async function attachPermissionToRoles(_ref3) {
63
+ let {
64
+ permissionId
65
+ } = _ref3,
66
+ body = (0, _objectWithoutPropertiesLoose2.default)(_ref3, _excluded3);
67
+ return (0, _fetch.Put)(`${_constants.urls.identity.permissions.v1}/${permissionId}/roles`, body);
68
+ }
78
69
 
79
- var _default = new RolesApi('default');
70
+ async function getPermissionCategories() {
71
+ return (0, _fetch.Get)(`${_constants.urls.identity.permissions.v1}/categories`);
72
+ }
80
73
 
81
- exports.default = _default;
74
+ async function addRoleV2(body) {
75
+ return (0, _fetch.Post)(_constants.urls.identity.roles.v2, body);
76
+ }
@@ -3,29 +3,17 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = exports.SecurityCenterApi = void 0;
6
+ exports.getInsights = getInsights;
7
+ exports.getRecommendations = getRecommendations;
7
8
 
8
- var _constants = require("../constants");
9
-
10
- var _BaseApiClient = require("../BaseApiClient");
11
-
12
- class SecurityCenterApi extends _BaseApiClient.BaseApiClient {
13
- constructor(appName) {
14
- super(appName);
15
-
16
- this.getRecommendations = async () => {
17
- return this.get(_constants.urls.securityCenter.recommendations.v1);
18
- };
9
+ var _fetch = require("../fetch");
19
10
 
20
- this.getInsights = async () => {
21
- return this.get(_constants.urls.securityCenter.insights.v1);
22
- };
23
- }
11
+ var _constants = require("../constants");
24
12
 
13
+ async function getRecommendations() {
14
+ return (0, _fetch.Get)(_constants.urls.securityCenter.recommendations.v1);
25
15
  }
26
16
 
27
- exports.SecurityCenterApi = SecurityCenterApi;
28
-
29
- var _default = new SecurityCenterApi('default');
30
-
31
- exports.default = _default;
17
+ async function getInsights() {
18
+ return (0, _fetch.Get)(_constants.urls.securityCenter.insights.v1);
19
+ }
@@ -3,101 +3,100 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = exports.SubTenantsApi = void 0;
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");
7
21
 
8
22
  var _constants = require("../constants");
9
23
 
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
- }
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
+ }
96
37
 
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
+ });
97
42
  }
98
43
 
99
- exports.SubTenantsApi = SubTenantsApi;
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
+ }
100
61
 
101
- var _default = new SubTenantsApi('default');
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
+ }
102
97
 
103
- exports.default = _default;
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
+ }
@@ -3,43 +3,133 @@
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;
10
6
 
11
- var _BaseApiClient = require("../BaseApiClient");
7
+ var _subscriptions = require("./subscriptions");
12
8
 
13
- var _invoices = require("./invoices");
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
+ });
14
19
 
15
20
  var _managedSubscriptions = require("./managedSubscriptions");
16
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
+ });
45
+
46
+ var _invoices = require("./invoices");
47
+
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
+ });
58
+
17
59
  var _paymentMethods = require("./paymentMethods");
18
60
 
19
- var _paymentProviders = require("./paymentProviders");
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
+ });
20
71
 
21
- var _plans = require("./plans");
72
+ var _providers = require("./providers");
22
73
 
23
- var _subscriptions = require("./subscriptions");
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
+ });
24
84
 
25
85
  var _summaries = require("./summaries");
26
86
 
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
+
27
98
  var _tenantConfiguration = require("./tenantConfiguration");
28
99
 
29
- var _vendorPublicConfigurations = require("./vendorPublicConfigurations");
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");
30
112
 
31
- var _stripe = require("./providers/stripe");
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
+ });
32
123
 
33
- var _interfaces = require("./interfaces");
124
+ var _vendorPublicConfigurations = require("./vendorPublicConfigurations");
34
125
 
35
- Object.keys(_interfaces).forEach(function (key) {
126
+ Object.keys(_vendorPublicConfigurations).forEach(function (key) {
36
127
  if (key === "default" || key === "__esModule") return;
37
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
38
- if (key in exports && exports[key] === _interfaces[key]) return;
128
+ if (key in exports && exports[key] === _vendorPublicConfigurations[key]) return;
39
129
  Object.defineProperty(exports, key, {
40
130
  enumerable: true,
41
131
  get: function () {
42
- return _interfaces[key];
132
+ return _vendorPublicConfigurations[key];
43
133
  }
44
134
  });
45
135
  });
@@ -48,7 +138,6 @@ var _enums = require("./enums");
48
138
 
49
139
  Object.keys(_enums).forEach(function (key) {
50
140
  if (key === "default" || key === "__esModule") return;
51
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
52
141
  if (key in exports && exports[key] === _enums[key]) return;
53
142
  Object.defineProperty(exports, key, {
54
143
  enumerable: true,
@@ -56,65 +145,4 @@ Object.keys(_enums).forEach(function (key) {
56
145
  return _enums[key];
57
146
  }
58
147
  });
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;
148
+ });
@@ -3,34 +3,26 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.InvoicesApi = void 0;
6
+ exports.getSubscriptionInvoice = getSubscriptionInvoice;
7
+ exports.getSubscriptionInvoicePdf = getSubscriptionInvoicePdf;
8
+ exports.getSubscriptionInvoices = getSubscriptionInvoices;
7
9
 
8
- var _constants = require("../constants");
9
-
10
- var _BaseApiClient = require("../BaseApiClient");
11
-
12
- class InvoicesApi extends _BaseApiClient.BaseApiClient {
13
- constructor(...args) {
14
- super(...args);
10
+ var _fetch = require("../fetch");
15
11
 
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
- };
12
+ var _constants = require("../constants");
23
13
 
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
- }
14
+ async function getSubscriptionInvoices() {
15
+ return (0, _fetch.Get)(_constants.urls.subscriptions.billing.invoices.v1);
16
+ }
32
17
 
18
+ async function getSubscriptionInvoice(invoiceId) {
19
+ return (0, _fetch.Get)(`${_constants.urls.subscriptions.billing.invoices.v1}/${invoiceId}`);
33
20
  }
34
21
 
35
- exports.InvoicesApi = InvoicesApi;
36
- ;
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
+ }