@blimu/backend 0.7.0 → 1.1.0

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/README.md +129 -134
  2. package/dist/client.d.mts +24 -0
  3. package/dist/client.d.ts +15 -57
  4. package/dist/client.js +67 -157
  5. package/dist/client.js.map +1 -1
  6. package/dist/client.mjs +48 -0
  7. package/dist/client.mjs.map +1 -0
  8. package/dist/index.d.mts +36 -0
  9. package/dist/index.d.ts +25 -26
  10. package/dist/index.js +1037 -83
  11. package/dist/index.js.map +1 -1
  12. package/dist/index.mjs +1005 -0
  13. package/dist/index.mjs.map +1 -0
  14. package/dist/main.d.mts +19 -0
  15. package/dist/main.d.ts +19 -0
  16. package/dist/main.js +1273 -0
  17. package/dist/main.js.map +1 -0
  18. package/dist/main.mjs +1264 -0
  19. package/dist/main.mjs.map +1 -0
  20. package/dist/schema-B1usIXCr.d.mts +424 -0
  21. package/dist/schema-B1usIXCr.d.ts +424 -0
  22. package/dist/schema.d.mts +2 -0
  23. package/dist/schema.d.ts +2 -381
  24. package/dist/schema.js +17 -2
  25. package/dist/schema.js.map +1 -1
  26. package/dist/schema.mjs +1 -0
  27. package/dist/schema.mjs.map +1 -0
  28. package/dist/schema.zod-CRNAHxbc.d.mts +444 -0
  29. package/dist/schema.zod-CRNAHxbc.d.ts +444 -0
  30. package/dist/schema.zod.d.mts +2 -0
  31. package/dist/schema.zod.d.ts +2 -0
  32. package/dist/schema.zod.js +562 -0
  33. package/dist/schema.zod.js.map +1 -0
  34. package/dist/schema.zod.mjs +496 -0
  35. package/dist/schema.zod.mjs.map +1 -0
  36. package/dist/services/bulk_resources.d.mts +12 -0
  37. package/dist/services/bulk_resources.d.ts +9 -4
  38. package/dist/services/bulk_resources.js +45 -18
  39. package/dist/services/bulk_resources.js.map +1 -1
  40. package/dist/services/bulk_resources.mjs +22 -0
  41. package/dist/services/bulk_resources.mjs.map +1 -0
  42. package/dist/services/bulk_roles.d.mts +12 -0
  43. package/dist/services/bulk_roles.d.ts +9 -4
  44. package/dist/services/bulk_roles.js +45 -18
  45. package/dist/services/bulk_roles.js.map +1 -1
  46. package/dist/services/bulk_roles.mjs +22 -0
  47. package/dist/services/bulk_roles.mjs.map +1 -0
  48. package/dist/services/entitlements.d.mts +14 -0
  49. package/dist/services/entitlements.d.ts +11 -6
  50. package/dist/services/entitlements.js +69 -34
  51. package/dist/services/entitlements.js.map +1 -1
  52. package/dist/services/entitlements.mjs +46 -0
  53. package/dist/services/entitlements.mjs.map +1 -0
  54. package/dist/services/plans.d.mts +14 -0
  55. package/dist/services/plans.d.ts +11 -6
  56. package/dist/services/plans.js +67 -32
  57. package/dist/services/plans.js.map +1 -1
  58. package/dist/services/plans.mjs +44 -0
  59. package/dist/services/plans.mjs.map +1 -0
  60. package/dist/services/resource_members.d.mts +12 -0
  61. package/dist/services/resource_members.d.ts +9 -4
  62. package/dist/services/resource_members.js +45 -17
  63. package/dist/services/resource_members.js.map +1 -1
  64. package/dist/services/resource_members.mjs +22 -0
  65. package/dist/services/resource_members.mjs.map +1 -0
  66. package/dist/services/resources.d.mts +16 -0
  67. package/dist/services/resources.d.ts +13 -8
  68. package/dist/services/resources.js +91 -49
  69. package/dist/services/resources.js.map +1 -1
  70. package/dist/services/resources.mjs +68 -0
  71. package/dist/services/resources.mjs.map +1 -0
  72. package/dist/services/roles.d.mts +14 -0
  73. package/dist/services/roles.d.ts +11 -6
  74. package/dist/services/roles.js +68 -33
  75. package/dist/services/roles.js.map +1 -1
  76. package/dist/services/roles.mjs +45 -0
  77. package/dist/services/roles.mjs.map +1 -0
  78. package/dist/services/usage.d.mts +16 -0
  79. package/dist/services/usage.d.ts +13 -8
  80. package/dist/services/usage.js +93 -52
  81. package/dist/services/usage.js.map +1 -1
  82. package/dist/services/usage.mjs +70 -0
  83. package/dist/services/usage.mjs.map +1 -0
  84. package/dist/services/users.d.mts +17 -0
  85. package/dist/services/users.d.ts +13 -8
  86. package/dist/services/users.js +102 -56
  87. package/dist/services/users.js.map +1 -1
  88. package/dist/services/users.mjs +79 -0
  89. package/dist/services/users.mjs.map +1 -0
  90. package/dist/token-verifier.d.mts +35 -0
  91. package/dist/token-verifier.d.ts +8 -6
  92. package/dist/token-verifier.js +225 -172
  93. package/dist/token-verifier.js.map +1 -1
  94. package/dist/token-verifier.mjs +201 -0
  95. package/dist/token-verifier.mjs.map +1 -0
  96. package/dist/tsconfig.tsbuildinfo +1 -1
  97. package/dist/utils.d.mts +20 -0
  98. package/dist/utils.d.ts +7 -3
  99. package/dist/utils.js +50 -20
  100. package/dist/utils.js.map +1 -1
  101. package/dist/utils.mjs +29 -0
  102. package/dist/utils.mjs.map +1 -0
  103. package/package.json +37 -62
  104. package/src/client.ts +74 -0
  105. package/src/index.ts +55 -0
  106. package/src/main.ts +3 -0
  107. package/src/schema.ts +430 -0
  108. package/src/schema.zod.ts +558 -0
  109. package/src/services/bulk_resources.ts +24 -0
  110. package/src/services/bulk_roles.ts +22 -0
  111. package/src/services/entitlements.ts +58 -0
  112. package/src/services/plans.ts +57 -0
  113. package/src/services/resource_members.ts +25 -0
  114. package/src/services/resources.ts +91 -0
  115. package/src/services/roles.ts +58 -0
  116. package/src/services/usage.ts +93 -0
  117. package/src/services/users.ts +100 -0
  118. package/src/token-verifier.ts +280 -0
  119. package/src/utils.ts +56 -0
  120. package/bin/blimu +0 -0
  121. package/scripts/download-binary.js +0 -243
  122. package/scripts/postinstall.js +0 -24
@@ -0,0 +1,22 @@
1
+ // src/services/bulk_resources.ts
2
+ var BulkResourcesService = class {
3
+ constructor(core) {
4
+ this.core = core;
5
+ }
6
+ /**
7
+ * POST /v1/resources/{resourceType}/bulk*
8
+ * @summary Bulk create resources*
9
+ * @description Creates multiple resources of the specified type in a single request. This operation supports partial success - some resources may be created while others fail. The response includes details about successful creations and any errors encountered. Resources can have parent relationships and initial role assignments.*/
10
+ create(resourceType, body, init) {
11
+ return this.core.request({
12
+ method: "POST",
13
+ path: `/v1/resources/${encodeURIComponent(resourceType)}/bulk`,
14
+ body,
15
+ ...init || {}
16
+ });
17
+ }
18
+ };
19
+ export {
20
+ BulkResourcesService
21
+ };
22
+ //# sourceMappingURL=bulk_resources.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/services/bulk_resources.ts"],"sourcesContent":["import { CoreClient } from '../client';\nimport * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class BulkResourcesService {\n constructor(private core: CoreClient) {}\n\n /**\n * POST /v1/resources/{resourceType}/bulk*\n * @summary Bulk create resources*\n * @description Creates multiple resources of the specified type in a single request. This operation supports partial success - some resources may be created while others fail. The response includes details about successful creations and any errors encountered. Resources can have parent relationships and initial role assignments.*/\n create(\n resourceType: ResourceType,\n body: Schema.ResourceBulkCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.ResourceBulkResult> {\n return this.core.request({\n method: 'POST',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/bulk`,\n body: body as any,\n ...(init || {}),\n });\n }\n}\n"],"mappings":";AAIO,IAAM,uBAAN,MAA2B;AAAA,EAChC,YAAoB,MAAkB;AAAlB;AAAA,EAAmB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMvC,OACE,cACA,MACA,MACoC;AACpC,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,iBAAiB,mBAAmB,YAAY,CAAC;AAAA,MACvD;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AACF;","names":[]}
@@ -0,0 +1,12 @@
1
+ import { CoreClient } from '../client.mjs';
2
+ import { b as RoleBulkCreateBody, c as RoleBulkResult } from '../schema-B1usIXCr.mjs';
3
+ import '@blimu/fetch';
4
+ import '@blimu/types';
5
+
6
+ declare class BulkRolesService {
7
+ private core;
8
+ constructor(core: CoreClient);
9
+ create(body: RoleBulkCreateBody, init?: Omit<RequestInit, 'method' | 'body'>): Promise<RoleBulkResult>;
10
+ }
11
+
12
+ export { BulkRolesService };
@@ -1,7 +1,12 @@
1
- import { CoreClient } from '../client';
2
- import * as Schema from '../schema';
3
- export declare class BulkRolesService {
1
+ import { CoreClient } from '../client.js';
2
+ import { b as RoleBulkCreateBody, c as RoleBulkResult } from '../schema-B1usIXCr.js';
3
+ import '@blimu/fetch';
4
+ import '@blimu/types';
5
+
6
+ declare class BulkRolesService {
4
7
  private core;
5
8
  constructor(core: CoreClient);
6
- create(body: Schema.RoleBulkCreateBody, init?: Omit<RequestInit, 'method' | 'body'>): Promise<Schema.RoleBulkResult>;
9
+ create(body: RoleBulkCreateBody, init?: Omit<RequestInit, 'method' | 'body'>): Promise<RoleBulkResult>;
7
10
  }
11
+
12
+ export { BulkRolesService };
@@ -1,19 +1,46 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BulkRolesService = void 0;
4
- class BulkRolesService {
5
- constructor(core) {
6
- this.core = core;
7
- }
8
- create(body, init) {
9
- return this.core.request({
10
- method: 'POST',
11
- path: `/v1/users/roles/bulk`,
12
- headers: { ...(init?.headers || {}), 'content-type': 'application/json' },
13
- body: JSON.stringify(body),
14
- ...(init || {}),
15
- });
16
- }
17
- }
18
- exports.BulkRolesService = BulkRolesService;
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/services/bulk_roles.ts
20
+ var bulk_roles_exports = {};
21
+ __export(bulk_roles_exports, {
22
+ BulkRolesService: () => BulkRolesService
23
+ });
24
+ module.exports = __toCommonJS(bulk_roles_exports);
25
+ var BulkRolesService = class {
26
+ constructor(core) {
27
+ this.core = core;
28
+ }
29
+ /**
30
+ * POST /v1/users/roles/bulk*
31
+ * @summary Bulk create roles*
32
+ * @description Assigns multiple roles to users on resources in a single request. This operation supports partial success - some role assignments may succeed while others fail. The response includes details about successful assignments and any errors encountered. All roles must be valid according to your resource definitions.*/
33
+ create(body, init) {
34
+ return this.core.request({
35
+ method: "POST",
36
+ path: `/v1/users/roles/bulk`,
37
+ body,
38
+ ...init || {}
39
+ });
40
+ }
41
+ };
42
+ // Annotate the CommonJS export names for ESM import in node:
43
+ 0 && (module.exports = {
44
+ BulkRolesService
45
+ });
19
46
  //# sourceMappingURL=bulk_roles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bulk_roles.js","sourceRoot":"","sources":["../../src/services/bulk_roles.ts"],"names":[],"mappings":";;;AAGA,MAAa,gBAAgB;IAC3B,YAAoB,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAQxC,MAAM,CACJ,IAA+B,EAC/B,IAA2C;QAE3C,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;YACvB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,sBAAsB;YAC5B,OAAO,EAAE,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO,IAAI,EAAE,CAAC,EAAE,cAAc,EAAE,kBAAkB,EAAE;YACzE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;YAC1B,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;SAChB,CAAC,CAAC;IACL,CAAC;CACF;AArBD,4CAqBC"}
1
+ {"version":3,"sources":["../../src/services/bulk_roles.ts"],"sourcesContent":["import { CoreClient } from '../client';\nimport * as Schema from '../schema';\n\nexport class BulkRolesService {\n constructor(private core: CoreClient) {}\n\n /**\n * POST /v1/users/roles/bulk*\n * @summary Bulk create roles*\n * @description Assigns multiple roles to users on resources in a single request. This operation supports partial success - some role assignments may succeed while others fail. The response includes details about successful assignments and any errors encountered. All roles must be valid according to your resource definitions.*/\n create(\n body: Schema.RoleBulkCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.RoleBulkResult> {\n return this.core.request({\n method: 'POST',\n path: `/v1/users/roles/bulk`,\n body: body as any,\n ...(init || {}),\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,IAAM,mBAAN,MAAuB;AAAA,EAC5B,YAAoB,MAAkB;AAAlB;AAAA,EAAmB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMvC,OACE,MACA,MACgC;AAChC,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM;AAAA,MACN;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AACF;","names":[]}
@@ -0,0 +1,22 @@
1
+ // src/services/bulk_roles.ts
2
+ var BulkRolesService = class {
3
+ constructor(core) {
4
+ this.core = core;
5
+ }
6
+ /**
7
+ * POST /v1/users/roles/bulk*
8
+ * @summary Bulk create roles*
9
+ * @description Assigns multiple roles to users on resources in a single request. This operation supports partial success - some role assignments may succeed while others fail. The response includes details about successful assignments and any errors encountered. All roles must be valid according to your resource definitions.*/
10
+ create(body, init) {
11
+ return this.core.request({
12
+ method: "POST",
13
+ path: `/v1/users/roles/bulk`,
14
+ body,
15
+ ...init || {}
16
+ });
17
+ }
18
+ };
19
+ export {
20
+ BulkRolesService
21
+ };
22
+ //# sourceMappingURL=bulk_roles.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/services/bulk_roles.ts"],"sourcesContent":["import { CoreClient } from '../client';\nimport * as Schema from '../schema';\n\nexport class BulkRolesService {\n constructor(private core: CoreClient) {}\n\n /**\n * POST /v1/users/roles/bulk*\n * @summary Bulk create roles*\n * @description Assigns multiple roles to users on resources in a single request. This operation supports partial success - some role assignments may succeed while others fail. The response includes details about successful assignments and any errors encountered. All roles must be valid according to your resource definitions.*/\n create(\n body: Schema.RoleBulkCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.RoleBulkResult> {\n return this.core.request({\n method: 'POST',\n path: `/v1/users/roles/bulk`,\n body: body as any,\n ...(init || {}),\n });\n }\n}\n"],"mappings":";AAGO,IAAM,mBAAN,MAAuB;AAAA,EAC5B,YAAoB,MAAkB;AAAlB;AAAA,EAAmB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMvC,OACE,MACA,MACgC;AAChC,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM;AAAA,MACN;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AACF;","names":[]}
@@ -0,0 +1,14 @@
1
+ import { CoreClient } from '../client.mjs';
2
+ import { E as EntitlementCheckBody, d as EntitlementCheckResult, e as EntitlementsListForResourceQuery, f as EntitlementsListResult, g as EntitlementsListForTenantQuery } from '../schema-B1usIXCr.mjs';
3
+ import { ResourceType } from '@blimu/types';
4
+ import '@blimu/fetch';
5
+
6
+ declare class EntitlementsService {
7
+ private core;
8
+ constructor(core: CoreClient);
9
+ checkEntitlement(body: EntitlementCheckBody, init?: Omit<RequestInit, 'method' | 'body'>): Promise<EntitlementCheckResult>;
10
+ listForResource(resourceType: ResourceType, resourceId: string, query?: EntitlementsListForResourceQuery, init?: Omit<RequestInit, 'method' | 'body'>): Promise<EntitlementsListResult>;
11
+ listForTenant(tenantResourceId: string, query?: EntitlementsListForTenantQuery, init?: Omit<RequestInit, 'method' | 'body'>): Promise<EntitlementsListResult>;
12
+ }
13
+
14
+ export { EntitlementsService };
@@ -1,9 +1,14 @@
1
- import { CoreClient } from '../client';
2
- import * as Schema from '../schema';
3
- export declare class EntitlementsService {
1
+ import { CoreClient } from '../client.js';
2
+ import { E as EntitlementCheckBody, d as EntitlementCheckResult, e as EntitlementsListForResourceQuery, f as EntitlementsListResult, g as EntitlementsListForTenantQuery } from '../schema-B1usIXCr.js';
3
+ import { ResourceType } from '@blimu/types';
4
+ import '@blimu/fetch';
5
+
6
+ declare class EntitlementsService {
4
7
  private core;
5
8
  constructor(core: CoreClient);
6
- checkEntitlement(body: Schema.EntitlementCheckBody, init?: Omit<RequestInit, 'method' | 'body'>): Promise<Schema.EntitlementCheckResult>;
7
- listForResource(resourceType: Schema.ResourceType, resourceId: string, query?: Schema.EntitlementsListForResourceQuery, init?: Omit<RequestInit, 'method' | 'body'>): Promise<Schema.EntitlementsListResult>;
8
- listForTenant(tenantResourceId: string, query?: Schema.EntitlementsListForTenantQuery, init?: Omit<RequestInit, 'method' | 'body'>): Promise<Schema.EntitlementsListResult>;
9
+ checkEntitlement(body: EntitlementCheckBody, init?: Omit<RequestInit, 'method' | 'body'>): Promise<EntitlementCheckResult>;
10
+ listForResource(resourceType: ResourceType, resourceId: string, query?: EntitlementsListForResourceQuery, init?: Omit<RequestInit, 'method' | 'body'>): Promise<EntitlementsListResult>;
11
+ listForTenant(tenantResourceId: string, query?: EntitlementsListForTenantQuery, init?: Omit<RequestInit, 'method' | 'body'>): Promise<EntitlementsListResult>;
9
12
  }
13
+
14
+ export { EntitlementsService };
@@ -1,35 +1,70 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EntitlementsService = void 0;
4
- class EntitlementsService {
5
- constructor(core) {
6
- this.core = core;
7
- }
8
- checkEntitlement(body, init) {
9
- return this.core.request({
10
- method: 'POST',
11
- path: `/v1/entitlements/check`,
12
- headers: { ...(init?.headers || {}), 'content-type': 'application/json' },
13
- body: JSON.stringify(body),
14
- ...(init || {}),
15
- });
16
- }
17
- listForResource(resourceType, resourceId, query, init) {
18
- return this.core.request({
19
- method: 'GET',
20
- path: `/v1/entitlements/list-for-resource/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,
21
- query,
22
- ...(init || {}),
23
- });
24
- }
25
- listForTenant(tenantResourceId, query, init) {
26
- return this.core.request({
27
- method: 'GET',
28
- path: `/v1/entitlements/list-for-tenant/${encodeURIComponent(tenantResourceId)}`,
29
- query,
30
- ...(init || {}),
31
- });
32
- }
33
- }
34
- exports.EntitlementsService = EntitlementsService;
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/services/entitlements.ts
20
+ var entitlements_exports = {};
21
+ __export(entitlements_exports, {
22
+ EntitlementsService: () => EntitlementsService
23
+ });
24
+ module.exports = __toCommonJS(entitlements_exports);
25
+ var EntitlementsService = class {
26
+ constructor(core) {
27
+ this.core = core;
28
+ }
29
+ /**
30
+ * POST /v1/entitlements/check*
31
+ * @summary Check if a user has a specific entitlement on a resource*
32
+ * @description Checks whether a user has permission to perform a specific action (entitlement) on a resource. This endpoint evaluates role-based access, plan gating, and usage limits. The response includes detailed information about why access was granted or denied, including which roles were checked, plan requirements, and usage limit status.*/
33
+ checkEntitlement(body, init) {
34
+ return this.core.request({
35
+ method: "POST",
36
+ path: `/v1/entitlements/check`,
37
+ body,
38
+ ...init || {}
39
+ });
40
+ }
41
+ /**
42
+ * GET /v1/entitlements/list-for-resource/{resourceType}/{resourceId}*
43
+ * @summary List entitlements for a specific resource*
44
+ * @description Returns entitlements for a specific resource and user. Only evaluates roles and plans (excludes limits). Provides detailed information about why entitlements are allowed or denied, including current roles, allowed roles, current plan, and allowed plans. Results are cached per resource for performance.*/
45
+ listForResource(resourceType, resourceId, query, init) {
46
+ return this.core.request({
47
+ method: "GET",
48
+ path: `/v1/entitlements/list-for-resource/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,
49
+ query,
50
+ ...init || {}
51
+ });
52
+ }
53
+ /**
54
+ * GET /v1/entitlements/list-for-tenant/{tenantResourceId}*
55
+ * @summary List entitlements for a tenant and all its sub-resources*
56
+ * @description Returns entitlements for a tenant resource and all its descendant resources. This endpoint scopes queries to a single tenant, preventing cross-tenant data access. Only evaluates roles and plans (excludes limits). Results are cached per resource for performance. The tenant resource type is automatically determined from the environment definition (resource marked as `is_tenant: true`).*/
57
+ listForTenant(tenantResourceId, query, init) {
58
+ return this.core.request({
59
+ method: "GET",
60
+ path: `/v1/entitlements/list-for-tenant/${encodeURIComponent(tenantResourceId)}`,
61
+ query,
62
+ ...init || {}
63
+ });
64
+ }
65
+ };
66
+ // Annotate the CommonJS export names for ESM import in node:
67
+ 0 && (module.exports = {
68
+ EntitlementsService
69
+ });
35
70
  //# sourceMappingURL=entitlements.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"entitlements.js","sourceRoot":"","sources":["../../src/services/entitlements.ts"],"names":[],"mappings":";;;AAGA,MAAa,mBAAmB;IAC9B,YAAoB,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAQxC,gBAAgB,CACd,IAAiC,EACjC,IAA2C;QAE3C,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;YACvB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,wBAAwB;YAC9B,OAAO,EAAE,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO,IAAI,EAAE,CAAC,EAAE,cAAc,EAAE,kBAAkB,EAAE;YACzE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;YAC1B,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;SAChB,CAAC,CAAC;IACL,CAAC;IAQD,eAAe,CACb,YAAiC,EACjC,UAAkB,EAClB,KAA+C,EAC/C,IAA2C;QAE3C,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;YACvB,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,sCAAsC,kBAAkB,CAAC,YAAY,CAAC,IAAI,kBAAkB,CAAC,UAAU,CAAC,EAAE;YAChH,KAAK;YACL,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;SAChB,CAAC,CAAC;IACL,CAAC;IAQD,aAAa,CACX,gBAAwB,EACxB,KAA6C,EAC7C,IAA2C;QAE3C,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;YACvB,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,oCAAoC,kBAAkB,CAAC,gBAAgB,CAAC,EAAE;YAChF,KAAK;YACL,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;SAChB,CAAC,CAAC;IACL,CAAC;CACF;AA5DD,kDA4DC"}
1
+ {"version":3,"sources":["../../src/services/entitlements.ts"],"sourcesContent":["import { CoreClient } from '../client';\nimport * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class EntitlementsService {\n constructor(private core: CoreClient) {}\n\n /**\n * POST /v1/entitlements/check*\n * @summary Check if a user has a specific entitlement on a resource*\n * @description Checks whether a user has permission to perform a specific action (entitlement) on a resource. This endpoint evaluates role-based access, plan gating, and usage limits. The response includes detailed information about why access was granted or denied, including which roles were checked, plan requirements, and usage limit status.*/\n checkEntitlement(\n body: Schema.EntitlementCheckBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.EntitlementCheckResult> {\n return this.core.request({\n method: 'POST',\n path: `/v1/entitlements/check`,\n body: body as any,\n ...(init || {}),\n });\n }\n\n /**\n * GET /v1/entitlements/list-for-resource/{resourceType}/{resourceId}*\n * @summary List entitlements for a specific resource*\n * @description Returns entitlements for a specific resource and user. Only evaluates roles and plans (excludes limits). Provides detailed information about why entitlements are allowed or denied, including current roles, allowed roles, current plan, and allowed plans. Results are cached per resource for performance.*/\n listForResource(\n resourceType: ResourceType,\n resourceId: string,\n query?: Schema.EntitlementsListForResourceQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.EntitlementsListResult> {\n return this.core.request({\n method: 'GET',\n path: `/v1/entitlements/list-for-resource/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n query,\n ...(init || {}),\n });\n }\n\n /**\n * GET /v1/entitlements/list-for-tenant/{tenantResourceId}*\n * @summary List entitlements for a tenant and all its sub-resources*\n * @description Returns entitlements for a tenant resource and all its descendant resources. This endpoint scopes queries to a single tenant, preventing cross-tenant data access. Only evaluates roles and plans (excludes limits). Results are cached per resource for performance. The tenant resource type is automatically determined from the environment definition (resource marked as `is_tenant: true`).*/\n listForTenant(\n tenantResourceId: string,\n query?: Schema.EntitlementsListForTenantQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.EntitlementsListResult> {\n return this.core.request({\n method: 'GET',\n path: `/v1/entitlements/list-for-tenant/${encodeURIComponent(tenantResourceId)}`,\n query,\n ...(init || {}),\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,IAAM,sBAAN,MAA0B;AAAA,EAC/B,YAAoB,MAAkB;AAAlB;AAAA,EAAmB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMvC,iBACE,MACA,MACwC;AACxC,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM;AAAA,MACN;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,gBACE,cACA,YACA,OACA,MACwC;AACxC,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,sCAAsC,mBAAmB,YAAY,CAAC,IAAI,mBAAmB,UAAU,CAAC;AAAA,MAC9G;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,cACE,kBACA,OACA,MACwC;AACxC,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,oCAAoC,mBAAmB,gBAAgB,CAAC;AAAA,MAC9E;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AACF;","names":[]}
@@ -0,0 +1,46 @@
1
+ // src/services/entitlements.ts
2
+ var EntitlementsService = class {
3
+ constructor(core) {
4
+ this.core = core;
5
+ }
6
+ /**
7
+ * POST /v1/entitlements/check*
8
+ * @summary Check if a user has a specific entitlement on a resource*
9
+ * @description Checks whether a user has permission to perform a specific action (entitlement) on a resource. This endpoint evaluates role-based access, plan gating, and usage limits. The response includes detailed information about why access was granted or denied, including which roles were checked, plan requirements, and usage limit status.*/
10
+ checkEntitlement(body, init) {
11
+ return this.core.request({
12
+ method: "POST",
13
+ path: `/v1/entitlements/check`,
14
+ body,
15
+ ...init || {}
16
+ });
17
+ }
18
+ /**
19
+ * GET /v1/entitlements/list-for-resource/{resourceType}/{resourceId}*
20
+ * @summary List entitlements for a specific resource*
21
+ * @description Returns entitlements for a specific resource and user. Only evaluates roles and plans (excludes limits). Provides detailed information about why entitlements are allowed or denied, including current roles, allowed roles, current plan, and allowed plans. Results are cached per resource for performance.*/
22
+ listForResource(resourceType, resourceId, query, init) {
23
+ return this.core.request({
24
+ method: "GET",
25
+ path: `/v1/entitlements/list-for-resource/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,
26
+ query,
27
+ ...init || {}
28
+ });
29
+ }
30
+ /**
31
+ * GET /v1/entitlements/list-for-tenant/{tenantResourceId}*
32
+ * @summary List entitlements for a tenant and all its sub-resources*
33
+ * @description Returns entitlements for a tenant resource and all its descendant resources. This endpoint scopes queries to a single tenant, preventing cross-tenant data access. Only evaluates roles and plans (excludes limits). Results are cached per resource for performance. The tenant resource type is automatically determined from the environment definition (resource marked as `is_tenant: true`).*/
34
+ listForTenant(tenantResourceId, query, init) {
35
+ return this.core.request({
36
+ method: "GET",
37
+ path: `/v1/entitlements/list-for-tenant/${encodeURIComponent(tenantResourceId)}`,
38
+ query,
39
+ ...init || {}
40
+ });
41
+ }
42
+ };
43
+ export {
44
+ EntitlementsService
45
+ };
46
+ //# sourceMappingURL=entitlements.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/services/entitlements.ts"],"sourcesContent":["import { CoreClient } from '../client';\nimport * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class EntitlementsService {\n constructor(private core: CoreClient) {}\n\n /**\n * POST /v1/entitlements/check*\n * @summary Check if a user has a specific entitlement on a resource*\n * @description Checks whether a user has permission to perform a specific action (entitlement) on a resource. This endpoint evaluates role-based access, plan gating, and usage limits. The response includes detailed information about why access was granted or denied, including which roles were checked, plan requirements, and usage limit status.*/\n checkEntitlement(\n body: Schema.EntitlementCheckBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.EntitlementCheckResult> {\n return this.core.request({\n method: 'POST',\n path: `/v1/entitlements/check`,\n body: body as any,\n ...(init || {}),\n });\n }\n\n /**\n * GET /v1/entitlements/list-for-resource/{resourceType}/{resourceId}*\n * @summary List entitlements for a specific resource*\n * @description Returns entitlements for a specific resource and user. Only evaluates roles and plans (excludes limits). Provides detailed information about why entitlements are allowed or denied, including current roles, allowed roles, current plan, and allowed plans. Results are cached per resource for performance.*/\n listForResource(\n resourceType: ResourceType,\n resourceId: string,\n query?: Schema.EntitlementsListForResourceQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.EntitlementsListResult> {\n return this.core.request({\n method: 'GET',\n path: `/v1/entitlements/list-for-resource/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n query,\n ...(init || {}),\n });\n }\n\n /**\n * GET /v1/entitlements/list-for-tenant/{tenantResourceId}*\n * @summary List entitlements for a tenant and all its sub-resources*\n * @description Returns entitlements for a tenant resource and all its descendant resources. This endpoint scopes queries to a single tenant, preventing cross-tenant data access. Only evaluates roles and plans (excludes limits). Results are cached per resource for performance. The tenant resource type is automatically determined from the environment definition (resource marked as `is_tenant: true`).*/\n listForTenant(\n tenantResourceId: string,\n query?: Schema.EntitlementsListForTenantQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.EntitlementsListResult> {\n return this.core.request({\n method: 'GET',\n path: `/v1/entitlements/list-for-tenant/${encodeURIComponent(tenantResourceId)}`,\n query,\n ...(init || {}),\n });\n }\n}\n"],"mappings":";AAIO,IAAM,sBAAN,MAA0B;AAAA,EAC/B,YAAoB,MAAkB;AAAlB;AAAA,EAAmB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMvC,iBACE,MACA,MACwC;AACxC,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM;AAAA,MACN;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,gBACE,cACA,YACA,OACA,MACwC;AACxC,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,sCAAsC,mBAAmB,YAAY,CAAC,IAAI,mBAAmB,UAAU,CAAC;AAAA,MAC9G;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,cACE,kBACA,OACA,MACwC;AACxC,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,oCAAoC,mBAAmB,gBAAgB,CAAC;AAAA,MAC9E;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AACF;","names":[]}
@@ -0,0 +1,14 @@
1
+ import { CoreClient } from '../client.mjs';
2
+ import { P as PlanDeleteResponse, h as PlanResponse, i as PlanAssignBody } from '../schema-B1usIXCr.mjs';
3
+ import { ResourceType } from '@blimu/types';
4
+ import '@blimu/fetch';
5
+
6
+ declare class PlansService {
7
+ private core;
8
+ constructor(core: CoreClient);
9
+ delete(resourceType: ResourceType, resourceId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<PlanDeleteResponse>;
10
+ read(resourceType: ResourceType, resourceId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<PlanResponse>;
11
+ assign(resourceType: ResourceType, resourceId: string, body: PlanAssignBody, init?: Omit<RequestInit, 'method' | 'body'>): Promise<unknown>;
12
+ }
13
+
14
+ export { PlansService };
@@ -1,9 +1,14 @@
1
- import { CoreClient } from '../client';
2
- import * as Schema from '../schema';
3
- export declare class PlansService {
1
+ import { CoreClient } from '../client.js';
2
+ import { P as PlanDeleteResponse, h as PlanResponse, i as PlanAssignBody } from '../schema-B1usIXCr.js';
3
+ import { ResourceType } from '@blimu/types';
4
+ import '@blimu/fetch';
5
+
6
+ declare class PlansService {
4
7
  private core;
5
8
  constructor(core: CoreClient);
6
- delete(resourceType: Schema.ResourceType, resourceId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<Schema.PlanDeleteResponse>;
7
- read(resourceType: Schema.ResourceType, resourceId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<Schema.PlanResponse>;
8
- assign(resourceType: Schema.ResourceType, resourceId: string, body: Schema.PlanAssignBody, init?: Omit<RequestInit, 'method' | 'body'>): Promise<unknown>;
9
+ delete(resourceType: ResourceType, resourceId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<PlanDeleteResponse>;
10
+ read(resourceType: ResourceType, resourceId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<PlanResponse>;
11
+ assign(resourceType: ResourceType, resourceId: string, body: PlanAssignBody, init?: Omit<RequestInit, 'method' | 'body'>): Promise<unknown>;
9
12
  }
13
+
14
+ export { PlansService };
@@ -1,33 +1,68 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PlansService = void 0;
4
- class PlansService {
5
- constructor(core) {
6
- this.core = core;
7
- }
8
- delete(resourceType, resourceId, init) {
9
- return this.core.request({
10
- method: 'DELETE',
11
- path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,
12
- ...(init || {}),
13
- });
14
- }
15
- read(resourceType, resourceId, init) {
16
- return this.core.request({
17
- method: 'GET',
18
- path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,
19
- ...(init || {}),
20
- });
21
- }
22
- assign(resourceType, resourceId, body, init) {
23
- return this.core.request({
24
- method: 'POST',
25
- path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,
26
- headers: { ...(init?.headers || {}), 'content-type': 'application/json' },
27
- body: JSON.stringify(body),
28
- ...(init || {}),
29
- });
30
- }
31
- }
32
- exports.PlansService = PlansService;
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/services/plans.ts
20
+ var plans_exports = {};
21
+ __export(plans_exports, {
22
+ PlansService: () => PlansService
23
+ });
24
+ module.exports = __toCommonJS(plans_exports);
25
+ var PlansService = class {
26
+ constructor(core) {
27
+ this.core = core;
28
+ }
29
+ /**
30
+ * DELETE /v1/resources/{resourceType}/{resourceId}/plan*
31
+ * @summary Remove plan assignment from a tenant resource*
32
+ * @description Removes the billing plan assignment from a tenant resource. After removal, the resource will have no plan and will be subject to default limits.*/
33
+ delete(resourceType, resourceId, init) {
34
+ return this.core.request({
35
+ method: "DELETE",
36
+ path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,
37
+ ...init || {}
38
+ });
39
+ }
40
+ /**
41
+ * GET /v1/resources/{resourceType}/{resourceId}/plan*
42
+ * @summary Get the plan assigned to a tenant resource*
43
+ * @description Retrieves the billing plan currently assigned to a tenant resource, if any.*/
44
+ read(resourceType, resourceId, init) {
45
+ return this.core.request({
46
+ method: "GET",
47
+ path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,
48
+ ...init || {}
49
+ });
50
+ }
51
+ /**
52
+ * POST /v1/resources/{resourceType}/{resourceId}/plan*
53
+ * @summary Assign a plan to a tenant resource*
54
+ * @description Assigns a billing plan to a tenant resource. Plans control feature access and usage limits based on your plan definitions. The resource must be marked as a tenant in your resource definitions.*/
55
+ assign(resourceType, resourceId, body, init) {
56
+ return this.core.request({
57
+ method: "POST",
58
+ path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,
59
+ body,
60
+ ...init || {}
61
+ });
62
+ }
63
+ };
64
+ // Annotate the CommonJS export names for ESM import in node:
65
+ 0 && (module.exports = {
66
+ PlansService
67
+ });
33
68
  //# sourceMappingURL=plans.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plans.js","sourceRoot":"","sources":["../../src/services/plans.ts"],"names":[],"mappings":";;;AAGA,MAAa,YAAY;IACvB,YAAoB,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAQxC,MAAM,CACJ,YAAiC,EACjC,UAAkB,EAClB,IAA2C;QAE3C,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;YACvB,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,iBAAiB,kBAAkB,CAAC,YAAY,CAAC,IAAI,kBAAkB,CAAC,UAAU,CAAC,OAAO;YAChG,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;SAChB,CAAC,CAAC;IACL,CAAC;IAQD,IAAI,CACF,YAAiC,EACjC,UAAkB,EAClB,IAA2C;QAE3C,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;YACvB,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,iBAAiB,kBAAkB,CAAC,YAAY,CAAC,IAAI,kBAAkB,CAAC,UAAU,CAAC,OAAO;YAChG,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;SAChB,CAAC,CAAC;IACL,CAAC;IAQD,MAAM,CACJ,YAAiC,EACjC,UAAkB,EAClB,IAA2B,EAC3B,IAA2C;QAE3C,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;YACvB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,iBAAiB,kBAAkB,CAAC,YAAY,CAAC,IAAI,kBAAkB,CAAC,UAAU,CAAC,OAAO;YAChG,OAAO,EAAE,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO,IAAI,EAAE,CAAC,EAAE,cAAc,EAAE,kBAAkB,EAAE;YACzE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;YAC1B,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;SAChB,CAAC,CAAC;IACL,CAAC;CACF;AA3DD,oCA2DC"}
1
+ {"version":3,"sources":["../../src/services/plans.ts"],"sourcesContent":["import { CoreClient } from '../client';\nimport * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class PlansService {\n constructor(private core: CoreClient) {}\n\n /**\n * DELETE /v1/resources/{resourceType}/{resourceId}/plan*\n * @summary Remove plan assignment from a tenant resource*\n * @description Removes the billing plan assignment from a tenant resource. After removal, the resource will have no plan and will be subject to default limits.*/\n delete(\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.PlanDeleteResponse> {\n return this.core.request({\n method: 'DELETE',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,\n ...(init || {}),\n });\n }\n\n /**\n * GET /v1/resources/{resourceType}/{resourceId}/plan*\n * @summary Get the plan assigned to a tenant resource*\n * @description Retrieves the billing plan currently assigned to a tenant resource, if any.*/\n read(\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.PlanResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,\n ...(init || {}),\n });\n }\n\n /**\n * POST /v1/resources/{resourceType}/{resourceId}/plan*\n * @summary Assign a plan to a tenant resource*\n * @description Assigns a billing plan to a tenant resource. Plans control feature access and usage limits based on your plan definitions. The resource must be marked as a tenant in your resource definitions.*/\n assign(\n resourceType: ResourceType,\n resourceId: string,\n body: Schema.PlanAssignBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'POST',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,\n body: body as any,\n ...(init || {}),\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,IAAM,eAAN,MAAmB;AAAA,EACxB,YAAoB,MAAkB;AAAlB;AAAA,EAAmB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMvC,OACE,cACA,YACA,MACoC;AACpC,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,iBAAiB,mBAAmB,YAAY,CAAC,IAAI,mBAAmB,UAAU,CAAC;AAAA,MACzF,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,KACE,cACA,YACA,MAC8B;AAC9B,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,iBAAiB,mBAAmB,YAAY,CAAC,IAAI,mBAAmB,UAAU,CAAC;AAAA,MACzF,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OACE,cACA,YACA,MACA,MACkB;AAClB,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,iBAAiB,mBAAmB,YAAY,CAAC,IAAI,mBAAmB,UAAU,CAAC;AAAA,MACzF;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AACF;","names":[]}
@@ -0,0 +1,44 @@
1
+ // src/services/plans.ts
2
+ var PlansService = class {
3
+ constructor(core) {
4
+ this.core = core;
5
+ }
6
+ /**
7
+ * DELETE /v1/resources/{resourceType}/{resourceId}/plan*
8
+ * @summary Remove plan assignment from a tenant resource*
9
+ * @description Removes the billing plan assignment from a tenant resource. After removal, the resource will have no plan and will be subject to default limits.*/
10
+ delete(resourceType, resourceId, init) {
11
+ return this.core.request({
12
+ method: "DELETE",
13
+ path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,
14
+ ...init || {}
15
+ });
16
+ }
17
+ /**
18
+ * GET /v1/resources/{resourceType}/{resourceId}/plan*
19
+ * @summary Get the plan assigned to a tenant resource*
20
+ * @description Retrieves the billing plan currently assigned to a tenant resource, if any.*/
21
+ read(resourceType, resourceId, init) {
22
+ return this.core.request({
23
+ method: "GET",
24
+ path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,
25
+ ...init || {}
26
+ });
27
+ }
28
+ /**
29
+ * POST /v1/resources/{resourceType}/{resourceId}/plan*
30
+ * @summary Assign a plan to a tenant resource*
31
+ * @description Assigns a billing plan to a tenant resource. Plans control feature access and usage limits based on your plan definitions. The resource must be marked as a tenant in your resource definitions.*/
32
+ assign(resourceType, resourceId, body, init) {
33
+ return this.core.request({
34
+ method: "POST",
35
+ path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,
36
+ body,
37
+ ...init || {}
38
+ });
39
+ }
40
+ };
41
+ export {
42
+ PlansService
43
+ };
44
+ //# sourceMappingURL=plans.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/services/plans.ts"],"sourcesContent":["import { CoreClient } from '../client';\nimport * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class PlansService {\n constructor(private core: CoreClient) {}\n\n /**\n * DELETE /v1/resources/{resourceType}/{resourceId}/plan*\n * @summary Remove plan assignment from a tenant resource*\n * @description Removes the billing plan assignment from a tenant resource. After removal, the resource will have no plan and will be subject to default limits.*/\n delete(\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.PlanDeleteResponse> {\n return this.core.request({\n method: 'DELETE',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,\n ...(init || {}),\n });\n }\n\n /**\n * GET /v1/resources/{resourceType}/{resourceId}/plan*\n * @summary Get the plan assigned to a tenant resource*\n * @description Retrieves the billing plan currently assigned to a tenant resource, if any.*/\n read(\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.PlanResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,\n ...(init || {}),\n });\n }\n\n /**\n * POST /v1/resources/{resourceType}/{resourceId}/plan*\n * @summary Assign a plan to a tenant resource*\n * @description Assigns a billing plan to a tenant resource. Plans control feature access and usage limits based on your plan definitions. The resource must be marked as a tenant in your resource definitions.*/\n assign(\n resourceType: ResourceType,\n resourceId: string,\n body: Schema.PlanAssignBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'POST',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,\n body: body as any,\n ...(init || {}),\n });\n }\n}\n"],"mappings":";AAIO,IAAM,eAAN,MAAmB;AAAA,EACxB,YAAoB,MAAkB;AAAlB;AAAA,EAAmB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMvC,OACE,cACA,YACA,MACoC;AACpC,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,iBAAiB,mBAAmB,YAAY,CAAC,IAAI,mBAAmB,UAAU,CAAC;AAAA,MACzF,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,KACE,cACA,YACA,MAC8B;AAC9B,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,iBAAiB,mBAAmB,YAAY,CAAC,IAAI,mBAAmB,UAAU,CAAC;AAAA,MACzF,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OACE,cACA,YACA,MACA,MACkB;AAClB,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,iBAAiB,mBAAmB,YAAY,CAAC,IAAI,mBAAmB,UAAU,CAAC;AAAA,MACzF;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AACF;","names":[]}
@@ -0,0 +1,12 @@
1
+ import { CoreClient } from '../client.mjs';
2
+ import { j as ResourceMembersListQuery, k as ResourceMemberList } from '../schema-B1usIXCr.mjs';
3
+ import { ResourceType } from '@blimu/types';
4
+ import '@blimu/fetch';
5
+
6
+ declare class ResourceMembersService {
7
+ private core;
8
+ constructor(core: CoreClient);
9
+ list(resourceType: ResourceType, resourceId: string, query?: ResourceMembersListQuery, init?: Omit<RequestInit, 'method' | 'body'>): Promise<ResourceMemberList>;
10
+ }
11
+
12
+ export { ResourceMembersService };