@blimu/backend 1.2.0 → 1.2.2

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 (88) hide show
  1. package/README.md +67 -58
  2. package/dist/client.cjs +164 -14
  3. package/dist/client.cjs.map +1 -1
  4. package/dist/client.d.mts +36 -2
  5. package/dist/client.d.ts +36 -2
  6. package/dist/client.mjs +161 -11
  7. package/dist/client.mjs.map +1 -1
  8. package/dist/index.cjs +530 -236
  9. package/dist/index.cjs.map +1 -1
  10. package/dist/index.d.mts +265 -108
  11. package/dist/index.d.ts +265 -108
  12. package/dist/index.mjs +518 -226
  13. package/dist/index.mjs.map +1 -1
  14. package/dist/{schema-BbKn_i-U.d.mts → schema-CdEZKE7E.d.mts} +162 -39
  15. package/dist/{schema-BbKn_i-U.d.ts → schema-CdEZKE7E.d.ts} +162 -39
  16. package/dist/schema.cjs.map +1 -1
  17. package/dist/schema.d.mts +2 -1
  18. package/dist/schema.d.ts +2 -1
  19. package/dist/services/auth_jwks.cjs +69 -0
  20. package/dist/services/auth_jwks.cjs.map +1 -0
  21. package/dist/services/auth_jwks.d.mts +13 -0
  22. package/dist/services/auth_jwks.d.ts +13 -0
  23. package/dist/services/auth_jwks.mjs +44 -0
  24. package/dist/services/auth_jwks.mjs.map +1 -0
  25. package/dist/services/bulk_resources.cjs +47 -0
  26. package/dist/services/bulk_resources.cjs.map +1 -0
  27. package/dist/services/bulk_resources.d.mts +11 -0
  28. package/dist/services/bulk_resources.d.ts +11 -0
  29. package/dist/services/bulk_resources.mjs +22 -0
  30. package/dist/services/bulk_resources.mjs.map +1 -0
  31. package/dist/services/bulk_roles.cjs +47 -0
  32. package/dist/services/bulk_roles.cjs.map +1 -0
  33. package/dist/services/bulk_roles.d.mts +11 -0
  34. package/dist/services/bulk_roles.d.ts +11 -0
  35. package/dist/services/bulk_roles.mjs +22 -0
  36. package/dist/services/bulk_roles.mjs.map +1 -0
  37. package/dist/services/entitlements.cjs +71 -0
  38. package/dist/services/entitlements.cjs.map +1 -0
  39. package/dist/services/entitlements.d.mts +13 -0
  40. package/dist/services/entitlements.d.ts +13 -0
  41. package/dist/services/entitlements.mjs +46 -0
  42. package/dist/services/entitlements.mjs.map +1 -0
  43. package/dist/services/oauth.cjs +142 -0
  44. package/dist/services/oauth.cjs.map +1 -0
  45. package/dist/services/oauth.d.mts +19 -0
  46. package/dist/services/oauth.d.ts +19 -0
  47. package/dist/services/oauth.mjs +117 -0
  48. package/dist/services/oauth.mjs.map +1 -0
  49. package/dist/services/plans.cjs +69 -0
  50. package/dist/services/plans.cjs.map +1 -0
  51. package/dist/services/plans.d.mts +13 -0
  52. package/dist/services/plans.d.ts +13 -0
  53. package/dist/services/plans.mjs +44 -0
  54. package/dist/services/plans.mjs.map +1 -0
  55. package/dist/services/resource_members.cjs +47 -0
  56. package/dist/services/resource_members.cjs.map +1 -0
  57. package/dist/services/resource_members.d.mts +11 -0
  58. package/dist/services/resource_members.d.ts +11 -0
  59. package/dist/services/resource_members.mjs +22 -0
  60. package/dist/services/resource_members.mjs.map +1 -0
  61. package/dist/services/resources.cjs +93 -0
  62. package/dist/services/resources.cjs.map +1 -0
  63. package/dist/services/resources.d.mts +15 -0
  64. package/dist/services/resources.d.ts +15 -0
  65. package/dist/services/resources.mjs +68 -0
  66. package/dist/services/resources.mjs.map +1 -0
  67. package/dist/services/roles.cjs +70 -0
  68. package/dist/services/roles.cjs.map +1 -0
  69. package/dist/services/roles.d.mts +13 -0
  70. package/dist/services/roles.d.ts +13 -0
  71. package/dist/services/roles.mjs +45 -0
  72. package/dist/services/roles.mjs.map +1 -0
  73. package/dist/services/usage.cjs +95 -0
  74. package/dist/services/usage.cjs.map +1 -0
  75. package/dist/services/usage.d.mts +15 -0
  76. package/dist/services/usage.d.ts +15 -0
  77. package/dist/services/usage.mjs +70 -0
  78. package/dist/services/usage.mjs.map +1 -0
  79. package/dist/services/users.cjs +104 -0
  80. package/dist/services/users.cjs.map +1 -0
  81. package/dist/services/users.d.mts +16 -0
  82. package/dist/services/users.d.ts +16 -0
  83. package/dist/services/users.mjs +79 -0
  84. package/dist/services/users.mjs.map +1 -0
  85. package/dist/tsconfig.tsbuildinfo +1 -1
  86. package/package.json +5 -4
  87. package/dist/client-B-ZYoU15.d.mts +0 -95
  88. package/dist/client-GKBT3WCg.d.ts +0 -95
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/services/roles.ts
21
+ var roles_exports = {};
22
+ __export(roles_exports, {
23
+ RolesService: () => RolesService
24
+ });
25
+ module.exports = __toCommonJS(roles_exports);
26
+ var RolesService = class {
27
+ constructor(core) {
28
+ this.core = core;
29
+ }
30
+ /**
31
+ * GET /v1/users/{userId}/roles*
32
+ * @summary List user roles*
33
+ * @description Retrieves a paginated list of roles assigned to a user. Supports filtering by resource type, resource ID, and role name. Returns both directly assigned roles and inherited roles.*/
34
+ list(userId, query, init) {
35
+ return this.core.request({
36
+ method: "GET",
37
+ path: `/v1/users/${encodeURIComponent(userId)}/roles`,
38
+ query,
39
+ ...init ?? {}
40
+ });
41
+ }
42
+ /**
43
+ * POST /v1/users/{userId}/roles*
44
+ * @summary Create a role (assign role to user on resource)*
45
+ * @description Assigns a role to a user on a specific resource. The role must be defined in your resource definitions for the specified resource type. Roles can be inherited from parent resources based on your resource configuration.*/
46
+ create(userId, body, init) {
47
+ return this.core.request({
48
+ method: "POST",
49
+ path: `/v1/users/${encodeURIComponent(userId)}/roles`,
50
+ body,
51
+ ...init ?? {}
52
+ });
53
+ }
54
+ /**
55
+ * DELETE /v1/users/{userId}/roles/{resourceType}/{resourceId}*
56
+ * @summary Delete a role*
57
+ * @description Removes a role assignment from a user on a specific resource. This only removes the direct role assignment and does not affect inherited roles from parent resources.*/
58
+ delete(userId, resourceType, resourceId, init) {
59
+ return this.core.request({
60
+ method: "DELETE",
61
+ path: `/v1/users/${encodeURIComponent(userId)}/roles/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,
62
+ ...init ?? {}
63
+ });
64
+ }
65
+ };
66
+ // Annotate the CommonJS export names for ESM import in node:
67
+ 0 && (module.exports = {
68
+ RolesService
69
+ });
70
+ //# sourceMappingURL=roles.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/services/roles.ts"],"sourcesContent":["import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class RolesService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/users/{userId}/roles*\n * @summary List user roles*\n * @description Retrieves a paginated list of roles assigned to a user. Supports filtering by resource type, resource ID, and role name. Returns both directly assigned roles and inherited roles.*/\n list(\n userId: string,\n query?: Schema.RolesListQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.RoleList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/users/${encodeURIComponent(userId)}/roles`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/users/{userId}/roles*\n * @summary Create a role (assign role to user on resource)*\n * @description Assigns a role to a user on a specific resource. The role must be defined in your resource definitions for the specified resource type. Roles can be inherited from parent resources based on your resource configuration.*/\n create(\n userId: string,\n body: Schema.RoleCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.Role> {\n return this.core.request({\n method: 'POST',\n path: `/v1/users/${encodeURIComponent(userId)}/roles`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * DELETE /v1/users/{userId}/roles/{resourceType}/{resourceId}*\n * @summary Delete a role*\n * @description Removes a role assignment from a user on a specific resource. This only removes the direct role assignment and does not affect inherited roles from parent resources.*/\n delete(\n userId: string,\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'DELETE',\n path: `/v1/users/${encodeURIComponent(userId)}/roles/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n ...(init ?? {}),\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,IAAM,eAAN,MAAmB;AAAA,EACxB,YAAoB,MAAmB;AAAnB;AAAA,EAAoB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMxC,KACE,QACA,OACA,MAC0B;AAC1B,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,aAAa,mBAAmB,MAAM,CAAC;AAAA,MAC7C;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OACE,QACA,MACA,MACsB;AACtB,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,aAAa,mBAAmB,MAAM,CAAC;AAAA,MAC7C;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OACE,QACA,cACA,YACA,MACkB;AAClB,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,aAAa,mBAAmB,MAAM,CAAC,UAAU,mBAAmB,YAAY,CAAC,IAAI,mBAAmB,UAAU,CAAC;AAAA,MACzH,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AACF;","names":[]}
@@ -0,0 +1,13 @@
1
+ import { FetchClient } from '@blimu/fetch';
2
+ import { B as RolesListQuery, F as RoleList, G as RoleCreateBody, H as Role } from '../schema-CdEZKE7E.mjs';
3
+ import { ResourceType } from '@blimu/types';
4
+
5
+ declare class RolesService {
6
+ private core;
7
+ constructor(core: FetchClient);
8
+ list(userId: string, query?: RolesListQuery, init?: Omit<RequestInit, 'method' | 'body'>): Promise<RoleList>;
9
+ create(userId: string, body: RoleCreateBody, init?: Omit<RequestInit, 'method' | 'body'>): Promise<Role>;
10
+ delete(userId: string, resourceType: ResourceType, resourceId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<unknown>;
11
+ }
12
+
13
+ export { RolesService };
@@ -0,0 +1,13 @@
1
+ import { FetchClient } from '@blimu/fetch';
2
+ import { B as RolesListQuery, F as RoleList, G as RoleCreateBody, H as Role } from '../schema-CdEZKE7E.js';
3
+ import { ResourceType } from '@blimu/types';
4
+
5
+ declare class RolesService {
6
+ private core;
7
+ constructor(core: FetchClient);
8
+ list(userId: string, query?: RolesListQuery, init?: Omit<RequestInit, 'method' | 'body'>): Promise<RoleList>;
9
+ create(userId: string, body: RoleCreateBody, init?: Omit<RequestInit, 'method' | 'body'>): Promise<Role>;
10
+ delete(userId: string, resourceType: ResourceType, resourceId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<unknown>;
11
+ }
12
+
13
+ export { RolesService };
@@ -0,0 +1,45 @@
1
+ // src/services/roles.ts
2
+ var RolesService = class {
3
+ constructor(core) {
4
+ this.core = core;
5
+ }
6
+ /**
7
+ * GET /v1/users/{userId}/roles*
8
+ * @summary List user roles*
9
+ * @description Retrieves a paginated list of roles assigned to a user. Supports filtering by resource type, resource ID, and role name. Returns both directly assigned roles and inherited roles.*/
10
+ list(userId, query, init) {
11
+ return this.core.request({
12
+ method: "GET",
13
+ path: `/v1/users/${encodeURIComponent(userId)}/roles`,
14
+ query,
15
+ ...init ?? {}
16
+ });
17
+ }
18
+ /**
19
+ * POST /v1/users/{userId}/roles*
20
+ * @summary Create a role (assign role to user on resource)*
21
+ * @description Assigns a role to a user on a specific resource. The role must be defined in your resource definitions for the specified resource type. Roles can be inherited from parent resources based on your resource configuration.*/
22
+ create(userId, body, init) {
23
+ return this.core.request({
24
+ method: "POST",
25
+ path: `/v1/users/${encodeURIComponent(userId)}/roles`,
26
+ body,
27
+ ...init ?? {}
28
+ });
29
+ }
30
+ /**
31
+ * DELETE /v1/users/{userId}/roles/{resourceType}/{resourceId}*
32
+ * @summary Delete a role*
33
+ * @description Removes a role assignment from a user on a specific resource. This only removes the direct role assignment and does not affect inherited roles from parent resources.*/
34
+ delete(userId, resourceType, resourceId, init) {
35
+ return this.core.request({
36
+ method: "DELETE",
37
+ path: `/v1/users/${encodeURIComponent(userId)}/roles/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,
38
+ ...init ?? {}
39
+ });
40
+ }
41
+ };
42
+ export {
43
+ RolesService
44
+ };
45
+ //# sourceMappingURL=roles.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/services/roles.ts"],"sourcesContent":["import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class RolesService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/users/{userId}/roles*\n * @summary List user roles*\n * @description Retrieves a paginated list of roles assigned to a user. Supports filtering by resource type, resource ID, and role name. Returns both directly assigned roles and inherited roles.*/\n list(\n userId: string,\n query?: Schema.RolesListQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.RoleList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/users/${encodeURIComponent(userId)}/roles`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/users/{userId}/roles*\n * @summary Create a role (assign role to user on resource)*\n * @description Assigns a role to a user on a specific resource. The role must be defined in your resource definitions for the specified resource type. Roles can be inherited from parent resources based on your resource configuration.*/\n create(\n userId: string,\n body: Schema.RoleCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.Role> {\n return this.core.request({\n method: 'POST',\n path: `/v1/users/${encodeURIComponent(userId)}/roles`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * DELETE /v1/users/{userId}/roles/{resourceType}/{resourceId}*\n * @summary Delete a role*\n * @description Removes a role assignment from a user on a specific resource. This only removes the direct role assignment and does not affect inherited roles from parent resources.*/\n delete(\n userId: string,\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'DELETE',\n path: `/v1/users/${encodeURIComponent(userId)}/roles/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n ...(init ?? {}),\n });\n }\n}\n"],"mappings":";AAIO,IAAM,eAAN,MAAmB;AAAA,EACxB,YAAoB,MAAmB;AAAnB;AAAA,EAAoB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMxC,KACE,QACA,OACA,MAC0B;AAC1B,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,aAAa,mBAAmB,MAAM,CAAC;AAAA,MAC7C;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OACE,QACA,MACA,MACsB;AACtB,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,aAAa,mBAAmB,MAAM,CAAC;AAAA,MAC7C;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OACE,QACA,cACA,YACA,MACkB;AAClB,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,aAAa,mBAAmB,MAAM,CAAC,UAAU,mBAAmB,YAAY,CAAC,IAAI,mBAAmB,UAAU,CAAC;AAAA,MACzH,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AACF;","names":[]}
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/services/usage.ts
21
+ var usage_exports = {};
22
+ __export(usage_exports, {
23
+ UsageService: () => UsageService
24
+ });
25
+ module.exports = __toCommonJS(usage_exports);
26
+ var UsageService = class {
27
+ constructor(core) {
28
+ this.core = core;
29
+ }
30
+ /**
31
+ * GET /v1/usage/balance/{resourceType}/{resourceId}/{limitType}*
32
+ * @summary Get wallet balance*
33
+ * @description Retrieves the current balance of a usage wallet for a specific resource and limit type within a given time period. The balance reflects all credits and consumption transactions.*/
34
+ getBalance(resourceType, resourceId, limitType, query, init) {
35
+ return this.core.request({
36
+ method: "GET",
37
+ path: `/v1/usage/balance/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/${encodeURIComponent(limitType)}`,
38
+ query,
39
+ ...init ?? {}
40
+ });
41
+ }
42
+ /**
43
+ * POST /v1/usage/check*
44
+ * @summary Check if consumption is allowed*
45
+ * @description Checks whether a specific amount of consumption is allowed for a resource and limit type within a given time period. Returns the current balance, requested amount, and remaining balance after the consumption.*/
46
+ checkLimit(body, init) {
47
+ return this.core.request({
48
+ method: "POST",
49
+ path: `/v1/usage/check`,
50
+ body,
51
+ ...init ?? {}
52
+ });
53
+ }
54
+ /**
55
+ * POST /v1/usage/consume*
56
+ * @summary Record consumption (inserts negative amount)*
57
+ * @description Records consumption from a usage wallet for a specific resource and limit type. This decreases the available balance. Consumption can be tagged for tracking purposes.*/
58
+ consume(body, init) {
59
+ return this.core.request({
60
+ method: "POST",
61
+ path: `/v1/usage/consume`,
62
+ body,
63
+ ...init ?? {}
64
+ });
65
+ }
66
+ /**
67
+ * POST /v1/usage/credit*
68
+ * @summary Add credits to wallet (inserts positive amount)*
69
+ * @description Adds credits to a usage wallet for a specific resource and limit type. This increases the available balance for usage-based limits. Credits can be tagged for tracking purposes.*/
70
+ credit(body, init) {
71
+ return this.core.request({
72
+ method: "POST",
73
+ path: `/v1/usage/credit`,
74
+ body,
75
+ ...init ?? {}
76
+ });
77
+ }
78
+ /**
79
+ * GET /v1/usage/transactions/{resourceType}/{resourceId}/{limitType}*
80
+ * @summary Get transaction history*
81
+ * @description Retrieves the transaction history for a usage wallet, including all credits and consumption records. Supports filtering by time period and date range.*/
82
+ getTransactionHistory(resourceType, resourceId, limitType, query, init) {
83
+ return this.core.request({
84
+ method: "GET",
85
+ path: `/v1/usage/transactions/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/${encodeURIComponent(limitType)}`,
86
+ query,
87
+ ...init ?? {}
88
+ });
89
+ }
90
+ };
91
+ // Annotate the CommonJS export names for ESM import in node:
92
+ 0 && (module.exports = {
93
+ UsageService
94
+ });
95
+ //# sourceMappingURL=usage.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/services/usage.ts"],"sourcesContent":["import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\n\nexport class UsageService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/usage/balance/{resourceType}/{resourceId}/{limitType}*\n * @summary Get wallet balance*\n * @description Retrieves the current balance of a usage wallet for a specific resource and limit type within a given time period. The balance reflects all credits and consumption transactions.*/\n getBalance(\n resourceType: string,\n resourceId: string,\n limitType: string,\n query?: Schema.UsageGetBalanceQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.BalanceResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/usage/balance/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/${encodeURIComponent(limitType)}`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/usage/check*\n * @summary Check if consumption is allowed*\n * @description Checks whether a specific amount of consumption is allowed for a resource and limit type within a given time period. Returns the current balance, requested amount, and remaining balance after the consumption.*/\n checkLimit(\n body: Schema.UsageCheckBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.CheckLimitResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/usage/check`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/usage/consume*\n * @summary Record consumption (inserts negative amount)*\n * @description Records consumption from a usage wallet for a specific resource and limit type. This decreases the available balance. Consumption can be tagged for tracking purposes.*/\n consume(\n body: Schema.UsageConsumeBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.UsageWalletResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/usage/consume`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/usage/credit*\n * @summary Add credits to wallet (inserts positive amount)*\n * @description Adds credits to a usage wallet for a specific resource and limit type. This increases the available balance for usage-based limits. Credits can be tagged for tracking purposes.*/\n credit(\n body: Schema.UsageCreditBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.UsageWalletResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/usage/credit`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/usage/transactions/{resourceType}/{resourceId}/{limitType}*\n * @summary Get transaction history*\n * @description Retrieves the transaction history for a usage wallet, including all credits and consumption records. Supports filtering by time period and date range.*/\n getTransactionHistory(\n resourceType: string,\n resourceId: string,\n limitType: string,\n query?: Schema.UsageGetTransactionHistoryQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.TransactionHistoryResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/usage/transactions/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/${encodeURIComponent(limitType)}`,\n query,\n ...(init ?? {}),\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,IAAM,eAAN,MAAmB;AAAA,EACxB,YAAoB,MAAmB;AAAnB;AAAA,EAAoB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMxC,WACE,cACA,YACA,WACA,OACA,MACiC;AACjC,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,qBAAqB,mBAAmB,YAAY,CAAC,IAAI,mBAAmB,UAAU,CAAC,IAAI,mBAAmB,SAAS,CAAC;AAAA,MAC9H;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,WACE,MACA,MACoC;AACpC,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,QACE,MACA,MACqC;AACrC,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,OACE,MACA,MACqC;AACrC,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,sBACE,cACA,YACA,WACA,OACA,MAC4C;AAC5C,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,0BAA0B,mBAAmB,YAAY,CAAC,IAAI,mBAAmB,UAAU,CAAC,IAAI,mBAAmB,SAAS,CAAC;AAAA,MACnI;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AACF;","names":[]}
@@ -0,0 +1,15 @@
1
+ import { FetchClient } from '@blimu/fetch';
2
+ import { U as UsageGetBalanceQuery, K as BalanceResponse, L as UsageCheckBody, M as CheckLimitResponse, N as UsageConsumeBody, Q as UsageWalletResponse, S as UsageCreditBody, V as UsageGetTransactionHistoryQuery, W as TransactionHistoryResponse } from '../schema-CdEZKE7E.mjs';
3
+ import '@blimu/types';
4
+
5
+ declare class UsageService {
6
+ private core;
7
+ constructor(core: FetchClient);
8
+ getBalance(resourceType: string, resourceId: string, limitType: string, query?: UsageGetBalanceQuery, init?: Omit<RequestInit, 'method' | 'body'>): Promise<BalanceResponse>;
9
+ checkLimit(body: UsageCheckBody, init?: Omit<RequestInit, 'method' | 'body'>): Promise<CheckLimitResponse>;
10
+ consume(body: UsageConsumeBody, init?: Omit<RequestInit, 'method' | 'body'>): Promise<UsageWalletResponse>;
11
+ credit(body: UsageCreditBody, init?: Omit<RequestInit, 'method' | 'body'>): Promise<UsageWalletResponse>;
12
+ getTransactionHistory(resourceType: string, resourceId: string, limitType: string, query?: UsageGetTransactionHistoryQuery, init?: Omit<RequestInit, 'method' | 'body'>): Promise<TransactionHistoryResponse>;
13
+ }
14
+
15
+ export { UsageService };
@@ -0,0 +1,15 @@
1
+ import { FetchClient } from '@blimu/fetch';
2
+ import { U as UsageGetBalanceQuery, K as BalanceResponse, L as UsageCheckBody, M as CheckLimitResponse, N as UsageConsumeBody, Q as UsageWalletResponse, S as UsageCreditBody, V as UsageGetTransactionHistoryQuery, W as TransactionHistoryResponse } from '../schema-CdEZKE7E.js';
3
+ import '@blimu/types';
4
+
5
+ declare class UsageService {
6
+ private core;
7
+ constructor(core: FetchClient);
8
+ getBalance(resourceType: string, resourceId: string, limitType: string, query?: UsageGetBalanceQuery, init?: Omit<RequestInit, 'method' | 'body'>): Promise<BalanceResponse>;
9
+ checkLimit(body: UsageCheckBody, init?: Omit<RequestInit, 'method' | 'body'>): Promise<CheckLimitResponse>;
10
+ consume(body: UsageConsumeBody, init?: Omit<RequestInit, 'method' | 'body'>): Promise<UsageWalletResponse>;
11
+ credit(body: UsageCreditBody, init?: Omit<RequestInit, 'method' | 'body'>): Promise<UsageWalletResponse>;
12
+ getTransactionHistory(resourceType: string, resourceId: string, limitType: string, query?: UsageGetTransactionHistoryQuery, init?: Omit<RequestInit, 'method' | 'body'>): Promise<TransactionHistoryResponse>;
13
+ }
14
+
15
+ export { UsageService };
@@ -0,0 +1,70 @@
1
+ // src/services/usage.ts
2
+ var UsageService = class {
3
+ constructor(core) {
4
+ this.core = core;
5
+ }
6
+ /**
7
+ * GET /v1/usage/balance/{resourceType}/{resourceId}/{limitType}*
8
+ * @summary Get wallet balance*
9
+ * @description Retrieves the current balance of a usage wallet for a specific resource and limit type within a given time period. The balance reflects all credits and consumption transactions.*/
10
+ getBalance(resourceType, resourceId, limitType, query, init) {
11
+ return this.core.request({
12
+ method: "GET",
13
+ path: `/v1/usage/balance/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/${encodeURIComponent(limitType)}`,
14
+ query,
15
+ ...init ?? {}
16
+ });
17
+ }
18
+ /**
19
+ * POST /v1/usage/check*
20
+ * @summary Check if consumption is allowed*
21
+ * @description Checks whether a specific amount of consumption is allowed for a resource and limit type within a given time period. Returns the current balance, requested amount, and remaining balance after the consumption.*/
22
+ checkLimit(body, init) {
23
+ return this.core.request({
24
+ method: "POST",
25
+ path: `/v1/usage/check`,
26
+ body,
27
+ ...init ?? {}
28
+ });
29
+ }
30
+ /**
31
+ * POST /v1/usage/consume*
32
+ * @summary Record consumption (inserts negative amount)*
33
+ * @description Records consumption from a usage wallet for a specific resource and limit type. This decreases the available balance. Consumption can be tagged for tracking purposes.*/
34
+ consume(body, init) {
35
+ return this.core.request({
36
+ method: "POST",
37
+ path: `/v1/usage/consume`,
38
+ body,
39
+ ...init ?? {}
40
+ });
41
+ }
42
+ /**
43
+ * POST /v1/usage/credit*
44
+ * @summary Add credits to wallet (inserts positive amount)*
45
+ * @description Adds credits to a usage wallet for a specific resource and limit type. This increases the available balance for usage-based limits. Credits can be tagged for tracking purposes.*/
46
+ credit(body, init) {
47
+ return this.core.request({
48
+ method: "POST",
49
+ path: `/v1/usage/credit`,
50
+ body,
51
+ ...init ?? {}
52
+ });
53
+ }
54
+ /**
55
+ * GET /v1/usage/transactions/{resourceType}/{resourceId}/{limitType}*
56
+ * @summary Get transaction history*
57
+ * @description Retrieves the transaction history for a usage wallet, including all credits and consumption records. Supports filtering by time period and date range.*/
58
+ getTransactionHistory(resourceType, resourceId, limitType, query, init) {
59
+ return this.core.request({
60
+ method: "GET",
61
+ path: `/v1/usage/transactions/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/${encodeURIComponent(limitType)}`,
62
+ query,
63
+ ...init ?? {}
64
+ });
65
+ }
66
+ };
67
+ export {
68
+ UsageService
69
+ };
70
+ //# sourceMappingURL=usage.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/services/usage.ts"],"sourcesContent":["import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\n\nexport class UsageService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/usage/balance/{resourceType}/{resourceId}/{limitType}*\n * @summary Get wallet balance*\n * @description Retrieves the current balance of a usage wallet for a specific resource and limit type within a given time period. The balance reflects all credits and consumption transactions.*/\n getBalance(\n resourceType: string,\n resourceId: string,\n limitType: string,\n query?: Schema.UsageGetBalanceQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.BalanceResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/usage/balance/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/${encodeURIComponent(limitType)}`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/usage/check*\n * @summary Check if consumption is allowed*\n * @description Checks whether a specific amount of consumption is allowed for a resource and limit type within a given time period. Returns the current balance, requested amount, and remaining balance after the consumption.*/\n checkLimit(\n body: Schema.UsageCheckBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.CheckLimitResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/usage/check`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/usage/consume*\n * @summary Record consumption (inserts negative amount)*\n * @description Records consumption from a usage wallet for a specific resource and limit type. This decreases the available balance. Consumption can be tagged for tracking purposes.*/\n consume(\n body: Schema.UsageConsumeBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.UsageWalletResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/usage/consume`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/usage/credit*\n * @summary Add credits to wallet (inserts positive amount)*\n * @description Adds credits to a usage wallet for a specific resource and limit type. This increases the available balance for usage-based limits. Credits can be tagged for tracking purposes.*/\n credit(\n body: Schema.UsageCreditBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.UsageWalletResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/usage/credit`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/usage/transactions/{resourceType}/{resourceId}/{limitType}*\n * @summary Get transaction history*\n * @description Retrieves the transaction history for a usage wallet, including all credits and consumption records. Supports filtering by time period and date range.*/\n getTransactionHistory(\n resourceType: string,\n resourceId: string,\n limitType: string,\n query?: Schema.UsageGetTransactionHistoryQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.TransactionHistoryResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/usage/transactions/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/${encodeURIComponent(limitType)}`,\n query,\n ...(init ?? {}),\n });\n }\n}\n"],"mappings":";AAGO,IAAM,eAAN,MAAmB;AAAA,EACxB,YAAoB,MAAmB;AAAnB;AAAA,EAAoB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMxC,WACE,cACA,YACA,WACA,OACA,MACiC;AACjC,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,qBAAqB,mBAAmB,YAAY,CAAC,IAAI,mBAAmB,UAAU,CAAC,IAAI,mBAAmB,SAAS,CAAC;AAAA,MAC9H;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,WACE,MACA,MACoC;AACpC,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,QACE,MACA,MACqC;AACrC,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,OACE,MACA,MACqC;AACrC,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,sBACE,cACA,YACA,WACA,OACA,MAC4C;AAC5C,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,0BAA0B,mBAAmB,YAAY,CAAC,IAAI,mBAAmB,UAAU,CAAC,IAAI,mBAAmB,SAAS,CAAC;AAAA,MACnI;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AACF;","names":[]}
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/services/users.ts
21
+ var users_exports = {};
22
+ __export(users_exports, {
23
+ UsersService: () => UsersService
24
+ });
25
+ module.exports = __toCommonJS(users_exports);
26
+ var UsersService = class {
27
+ constructor(core) {
28
+ this.core = core;
29
+ }
30
+ /**
31
+ * GET /v1/users*
32
+ * @summary List users*
33
+ * @description Retrieves a paginated list of users in your environment. Supports search functionality to filter users by email, name, or lookup key.*/
34
+ list(query, init) {
35
+ return this.core.request({
36
+ method: "GET",
37
+ path: `/v1/users`,
38
+ query,
39
+ ...init ?? {}
40
+ });
41
+ }
42
+ /**
43
+ * POST /v1/users*
44
+ * @summary Create a user*
45
+ * @description Creates a new user in your environment. The lookupKey is a unique identifier that you can use to reference the user in your system. It should be stable and not change over time.*/
46
+ create(body, init) {
47
+ return this.core.request({
48
+ method: "POST",
49
+ path: `/v1/users`,
50
+ body,
51
+ ...init ?? {}
52
+ });
53
+ }
54
+ /**
55
+ * DELETE /v1/users/{userId}*
56
+ * @summary Delete a user*
57
+ * @description Deletes a user by their ID or lookup key. This operation is permanent and cannot be undone. Deleting a user will also remove all role assignments for that user.*/
58
+ delete(userId, init) {
59
+ return this.core.request({
60
+ method: "DELETE",
61
+ path: `/v1/users/${encodeURIComponent(userId)}`,
62
+ ...init ?? {}
63
+ });
64
+ }
65
+ /**
66
+ * GET /v1/users/{userId}*
67
+ * @summary Get a user by ID*
68
+ * @description Retrieves a single user by their ID or lookup key. Returns user information including email, name, and metadata.*/
69
+ read(userId, init) {
70
+ return this.core.request({
71
+ method: "GET",
72
+ path: `/v1/users/${encodeURIComponent(userId)}`,
73
+ ...init ?? {}
74
+ });
75
+ }
76
+ /**
77
+ * PUT /v1/users/{userId}*
78
+ * @summary Update a user*
79
+ * @description Updates an existing user. You can modify email, name, and other user properties. The lookupKey can be updated but should remain stable.*/
80
+ update(userId, body, init) {
81
+ return this.core.request({
82
+ method: "PUT",
83
+ path: `/v1/users/${encodeURIComponent(userId)}`,
84
+ body,
85
+ ...init ?? {}
86
+ });
87
+ }
88
+ /**
89
+ * GET /v1/users/{userId}/effective-user-resources-roles*
90
+ * @summary List effective user resources roles*
91
+ * @description Retrieves all resources and roles for a user, including inherited roles from parent resources. The response indicates whether each role is directly assigned or inherited through resource hierarchies.*/
92
+ listEffectiveUserResourcesRoles(userId, init) {
93
+ return this.core.request({
94
+ method: "GET",
95
+ path: `/v1/users/${encodeURIComponent(userId)}/effective-user-resources-roles`,
96
+ ...init ?? {}
97
+ });
98
+ }
99
+ };
100
+ // Annotate the CommonJS export names for ESM import in node:
101
+ 0 && (module.exports = {
102
+ UsersService
103
+ });
104
+ //# sourceMappingURL=users.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/services/users.ts"],"sourcesContent":["import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\n\nexport class UsersService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/users*\n * @summary List users*\n * @description Retrieves a paginated list of users in your environment. Supports search functionality to filter users by email, name, or lookup key.*/\n list(\n query?: Schema.UsersListQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.UserList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/users`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/users*\n * @summary Create a user*\n * @description Creates a new user in your environment. The lookupKey is a unique identifier that you can use to reference the user in your system. It should be stable and not change over time.*/\n create(\n body: Schema.UserCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.User> {\n return this.core.request({\n method: 'POST',\n path: `/v1/users`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * DELETE /v1/users/{userId}*\n * @summary Delete a user*\n * @description Deletes a user by their ID or lookup key. This operation is permanent and cannot be undone. Deleting a user will also remove all role assignments for that user.*/\n delete(userId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<unknown> {\n return this.core.request({\n method: 'DELETE',\n path: `/v1/users/${encodeURIComponent(userId)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/users/{userId}*\n * @summary Get a user by ID*\n * @description Retrieves a single user by their ID or lookup key. Returns user information including email, name, and metadata.*/\n read(userId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<Schema.User> {\n return this.core.request({\n method: 'GET',\n path: `/v1/users/${encodeURIComponent(userId)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * PUT /v1/users/{userId}*\n * @summary Update a user*\n * @description Updates an existing user. You can modify email, name, and other user properties. The lookupKey can be updated but should remain stable.*/\n update(\n userId: string,\n body: Schema.UserUpdateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.User> {\n return this.core.request({\n method: 'PUT',\n path: `/v1/users/${encodeURIComponent(userId)}`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/users/{userId}/effective-user-resources-roles*\n * @summary List effective user resources roles*\n * @description Retrieves all resources and roles for a user, including inherited roles from parent resources. The response indicates whether each role is directly assigned or inherited through resource hierarchies.*/\n listEffectiveUserResourcesRoles(\n userId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.UserResourceList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/users/${encodeURIComponent(userId)}/effective-user-resources-roles`,\n ...(init ?? {}),\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,IAAM,eAAN,MAAmB;AAAA,EACxB,YAAoB,MAAmB;AAAnB;AAAA,EAAoB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMxC,KACE,OACA,MAC0B;AAC1B,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,OACE,MACA,MACsB;AACtB,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,OAAO,QAAgB,MAA+D;AACpF,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,aAAa,mBAAmB,MAAM,CAAC;AAAA,MAC7C,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,KAAK,QAAgB,MAAmE;AACtF,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,aAAa,mBAAmB,MAAM,CAAC;AAAA,MAC7C,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OACE,QACA,MACA,MACsB;AACtB,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,aAAa,mBAAmB,MAAM,CAAC;AAAA,MAC7C;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,gCACE,QACA,MACkC;AAClC,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,aAAa,mBAAmB,MAAM,CAAC;AAAA,MAC7C,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AACF;","names":[]}
@@ -0,0 +1,16 @@
1
+ import { FetchClient } from '@blimu/fetch';
2
+ import { X as UsersListQuery, Y as UserList, Z as UserCreateBody, _ as User, $ as UserUpdateBody, a0 as UserResourceList } from '../schema-CdEZKE7E.mjs';
3
+ import '@blimu/types';
4
+
5
+ declare class UsersService {
6
+ private core;
7
+ constructor(core: FetchClient);
8
+ list(query?: UsersListQuery, init?: Omit<RequestInit, 'method' | 'body'>): Promise<UserList>;
9
+ create(body: UserCreateBody, init?: Omit<RequestInit, 'method' | 'body'>): Promise<User>;
10
+ delete(userId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<unknown>;
11
+ read(userId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<User>;
12
+ update(userId: string, body: UserUpdateBody, init?: Omit<RequestInit, 'method' | 'body'>): Promise<User>;
13
+ listEffectiveUserResourcesRoles(userId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<UserResourceList>;
14
+ }
15
+
16
+ export { UsersService };
@@ -0,0 +1,16 @@
1
+ import { FetchClient } from '@blimu/fetch';
2
+ import { X as UsersListQuery, Y as UserList, Z as UserCreateBody, _ as User, $ as UserUpdateBody, a0 as UserResourceList } from '../schema-CdEZKE7E.js';
3
+ import '@blimu/types';
4
+
5
+ declare class UsersService {
6
+ private core;
7
+ constructor(core: FetchClient);
8
+ list(query?: UsersListQuery, init?: Omit<RequestInit, 'method' | 'body'>): Promise<UserList>;
9
+ create(body: UserCreateBody, init?: Omit<RequestInit, 'method' | 'body'>): Promise<User>;
10
+ delete(userId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<unknown>;
11
+ read(userId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<User>;
12
+ update(userId: string, body: UserUpdateBody, init?: Omit<RequestInit, 'method' | 'body'>): Promise<User>;
13
+ listEffectiveUserResourcesRoles(userId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<UserResourceList>;
14
+ }
15
+
16
+ export { UsersService };
@@ -0,0 +1,79 @@
1
+ // src/services/users.ts
2
+ var UsersService = class {
3
+ constructor(core) {
4
+ this.core = core;
5
+ }
6
+ /**
7
+ * GET /v1/users*
8
+ * @summary List users*
9
+ * @description Retrieves a paginated list of users in your environment. Supports search functionality to filter users by email, name, or lookup key.*/
10
+ list(query, init) {
11
+ return this.core.request({
12
+ method: "GET",
13
+ path: `/v1/users`,
14
+ query,
15
+ ...init ?? {}
16
+ });
17
+ }
18
+ /**
19
+ * POST /v1/users*
20
+ * @summary Create a user*
21
+ * @description Creates a new user in your environment. The lookupKey is a unique identifier that you can use to reference the user in your system. It should be stable and not change over time.*/
22
+ create(body, init) {
23
+ return this.core.request({
24
+ method: "POST",
25
+ path: `/v1/users`,
26
+ body,
27
+ ...init ?? {}
28
+ });
29
+ }
30
+ /**
31
+ * DELETE /v1/users/{userId}*
32
+ * @summary Delete a user*
33
+ * @description Deletes a user by their ID or lookup key. This operation is permanent and cannot be undone. Deleting a user will also remove all role assignments for that user.*/
34
+ delete(userId, init) {
35
+ return this.core.request({
36
+ method: "DELETE",
37
+ path: `/v1/users/${encodeURIComponent(userId)}`,
38
+ ...init ?? {}
39
+ });
40
+ }
41
+ /**
42
+ * GET /v1/users/{userId}*
43
+ * @summary Get a user by ID*
44
+ * @description Retrieves a single user by their ID or lookup key. Returns user information including email, name, and metadata.*/
45
+ read(userId, init) {
46
+ return this.core.request({
47
+ method: "GET",
48
+ path: `/v1/users/${encodeURIComponent(userId)}`,
49
+ ...init ?? {}
50
+ });
51
+ }
52
+ /**
53
+ * PUT /v1/users/{userId}*
54
+ * @summary Update a user*
55
+ * @description Updates an existing user. You can modify email, name, and other user properties. The lookupKey can be updated but should remain stable.*/
56
+ update(userId, body, init) {
57
+ return this.core.request({
58
+ method: "PUT",
59
+ path: `/v1/users/${encodeURIComponent(userId)}`,
60
+ body,
61
+ ...init ?? {}
62
+ });
63
+ }
64
+ /**
65
+ * GET /v1/users/{userId}/effective-user-resources-roles*
66
+ * @summary List effective user resources roles*
67
+ * @description Retrieves all resources and roles for a user, including inherited roles from parent resources. The response indicates whether each role is directly assigned or inherited through resource hierarchies.*/
68
+ listEffectiveUserResourcesRoles(userId, init) {
69
+ return this.core.request({
70
+ method: "GET",
71
+ path: `/v1/users/${encodeURIComponent(userId)}/effective-user-resources-roles`,
72
+ ...init ?? {}
73
+ });
74
+ }
75
+ };
76
+ export {
77
+ UsersService
78
+ };
79
+ //# sourceMappingURL=users.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/services/users.ts"],"sourcesContent":["import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\n\nexport class UsersService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/users*\n * @summary List users*\n * @description Retrieves a paginated list of users in your environment. Supports search functionality to filter users by email, name, or lookup key.*/\n list(\n query?: Schema.UsersListQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.UserList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/users`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/users*\n * @summary Create a user*\n * @description Creates a new user in your environment. The lookupKey is a unique identifier that you can use to reference the user in your system. It should be stable and not change over time.*/\n create(\n body: Schema.UserCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.User> {\n return this.core.request({\n method: 'POST',\n path: `/v1/users`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * DELETE /v1/users/{userId}*\n * @summary Delete a user*\n * @description Deletes a user by their ID or lookup key. This operation is permanent and cannot be undone. Deleting a user will also remove all role assignments for that user.*/\n delete(userId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<unknown> {\n return this.core.request({\n method: 'DELETE',\n path: `/v1/users/${encodeURIComponent(userId)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/users/{userId}*\n * @summary Get a user by ID*\n * @description Retrieves a single user by their ID or lookup key. Returns user information including email, name, and metadata.*/\n read(userId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<Schema.User> {\n return this.core.request({\n method: 'GET',\n path: `/v1/users/${encodeURIComponent(userId)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * PUT /v1/users/{userId}*\n * @summary Update a user*\n * @description Updates an existing user. You can modify email, name, and other user properties. The lookupKey can be updated but should remain stable.*/\n update(\n userId: string,\n body: Schema.UserUpdateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.User> {\n return this.core.request({\n method: 'PUT',\n path: `/v1/users/${encodeURIComponent(userId)}`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/users/{userId}/effective-user-resources-roles*\n * @summary List effective user resources roles*\n * @description Retrieves all resources and roles for a user, including inherited roles from parent resources. The response indicates whether each role is directly assigned or inherited through resource hierarchies.*/\n listEffectiveUserResourcesRoles(\n userId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.UserResourceList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/users/${encodeURIComponent(userId)}/effective-user-resources-roles`,\n ...(init ?? {}),\n });\n }\n}\n"],"mappings":";AAGO,IAAM,eAAN,MAAmB;AAAA,EACxB,YAAoB,MAAmB;AAAnB;AAAA,EAAoB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMxC,KACE,OACA,MAC0B;AAC1B,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,OACE,MACA,MACsB;AACtB,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,OAAO,QAAgB,MAA+D;AACpF,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,aAAa,mBAAmB,MAAM,CAAC;AAAA,MAC7C,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,KAAK,QAAgB,MAAmE;AACtF,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,aAAa,mBAAmB,MAAM,CAAC;AAAA,MAC7C,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OACE,QACA,MACA,MACsB;AACtB,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,aAAa,mBAAmB,MAAM,CAAC;AAAA,MAC7C;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,gCACE,QACA,MACkC;AAClC,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,aAAa,mBAAmB,MAAM,CAAC;AAAA,MAC7C,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AACF;","names":[]}