@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
@@ -1,4 +1,18 @@
1
+ import { ResourceType, EntitlementType, PlanType, UsageLimitType } from '@blimu/types';
2
+
1
3
  type Enum<T> = T[keyof T];
4
+ interface AuthorizeRequest {
5
+ action: 'allow' | 'deny';
6
+ auto_approved?: boolean;
7
+ client_id: string;
8
+ code_challenge?: string;
9
+ code_challenge_method?: string;
10
+ redirect_uri: string;
11
+ response_type: string;
12
+ scope?: string;
13
+ state?: string;
14
+ user_action?: boolean;
15
+ }
2
16
  interface BalanceResponse {
3
17
  balance: number;
4
18
  }
@@ -8,9 +22,48 @@ interface CheckLimitResponse {
8
22
  remaining?: number;
9
23
  requested: number;
10
24
  }
25
+ interface ConsentCheckResponse {
26
+ consent_required: boolean;
27
+ previously_granted: boolean;
28
+ }
29
+ interface DeviceAuthorizeRequest {
30
+ action: 'allow' | 'deny';
31
+ auto_approved?: boolean;
32
+ user_action?: boolean;
33
+ user_code: string;
34
+ }
35
+ interface DeviceAuthorizeResponse {
36
+ success: boolean;
37
+ }
38
+ interface DeviceCodeInfoResponse {
39
+ appName: string;
40
+ previouslyGranted: boolean;
41
+ requireConsent: boolean;
42
+ scopes: string[];
43
+ }
44
+ interface DeviceCodeRequest {
45
+ client_id: string;
46
+ code_challenge?: string;
47
+ code_challenge_method?: 'S256' | 'plain';
48
+ scope?: string;
49
+ }
50
+ interface DeviceCodeResponse {
51
+ device_code: string;
52
+ expires_in: number;
53
+ interval: number;
54
+ user_code: string;
55
+ verification_uri: string;
56
+ verification_uri_complete: string;
57
+ }
58
+ interface DeviceTokenRequest {
59
+ client_id: string;
60
+ code_verifier?: string;
61
+ device_code: string;
62
+ grant_type: 'urn:ietf:params:oauth:grant-type:device_code';
63
+ }
11
64
  interface EntitlementCheckBody {
12
65
  amount?: number;
13
- entitlement: string;
66
+ entitlement: EntitlementType;
14
67
  resourceId: string;
15
68
  userId: string;
16
69
  }
@@ -20,15 +73,15 @@ interface EntitlementCheckResult {
20
73
  allowed: boolean;
21
74
  current?: number;
22
75
  limit?: number;
23
- plan?: string | null;
76
+ plan?: PlanType;
24
77
  reason?: string;
25
78
  remaining?: number;
26
79
  scope?: string;
27
80
  } | null;
28
81
  plans?: {
29
82
  allowed: boolean;
30
- allowedPlans?: string[];
31
- plan?: string | null;
83
+ allowedPlans?: PlanType[];
84
+ plan?: PlanType;
32
85
  reason?: string;
33
86
  } | null;
34
87
  roles?: {
@@ -44,18 +97,43 @@ interface EntitlementsListResult {
44
97
  allowed: boolean;
45
98
  allowedByPlan: boolean;
46
99
  allowedByRole: boolean;
47
- allowedPlans?: string[];
100
+ allowedPlans?: PlanType[];
48
101
  allowedRoles: string[];
49
- currentPlan?: string;
102
+ currentPlan?: PlanType;
50
103
  currentRole?: string;
51
- entitlement: string;
104
+ entitlement: EntitlementType;
52
105
  }[];
53
106
  resourceId: string;
54
- resourceType: string;
107
+ resourceType: ResourceType;
108
+ }[];
109
+ }
110
+ interface IntrospectionRequest {
111
+ token: string;
112
+ token_type_hint?: 'access_token' | 'refresh_token';
113
+ }
114
+ interface IntrospectionResponse {
115
+ active: boolean;
116
+ client_id?: string;
117
+ environment_id?: string;
118
+ exp?: number;
119
+ iat?: number;
120
+ scope?: string;
121
+ sub?: string;
122
+ token_type?: string;
123
+ username?: string;
124
+ }
125
+ interface JWK {
126
+ keys: {
127
+ alg: string;
128
+ e: string;
129
+ kid: string;
130
+ kty: string;
131
+ n: string;
132
+ use: string;
55
133
  }[];
56
134
  }
57
135
  interface PlanAssignBody {
58
- planKey: string;
136
+ planKey: PlanType;
59
137
  }
60
138
  interface PlanDeleteResponse {
61
139
  success: boolean;
@@ -63,9 +141,9 @@ interface PlanDeleteResponse {
63
141
  interface PlanResponse {
64
142
  createdAt: string;
65
143
  environmentId: string;
66
- planKey: string;
144
+ planKey: PlanType;
67
145
  resourceId: string;
68
- resourceType: string;
146
+ resourceType: ResourceType;
69
147
  updatedAt: string;
70
148
  }
71
149
  interface Resource {
@@ -74,9 +152,9 @@ interface Resource {
74
152
  name: string | null;
75
153
  parents?: {
76
154
  id: string;
77
- type: string;
155
+ type: ResourceType;
78
156
  }[];
79
- type: string;
157
+ type: ResourceType;
80
158
  }
81
159
  interface ResourceBulkCreateBody {
82
160
  resources: {
@@ -84,7 +162,7 @@ interface ResourceBulkCreateBody {
84
162
  name?: string;
85
163
  parents?: {
86
164
  id: string;
87
- type: string;
165
+ type: ResourceType;
88
166
  }[];
89
167
  roles?: {
90
168
  role: string;
@@ -96,7 +174,7 @@ interface ResourceBulkResult {
96
174
  created: {
97
175
  environmentId: string;
98
176
  id: string;
99
- type: string;
177
+ type: ResourceType;
100
178
  }[];
101
179
  errors: {
102
180
  error: string;
@@ -106,7 +184,7 @@ interface ResourceBulkResult {
106
184
  name?: string;
107
185
  parents?: {
108
186
  id: string;
109
- type: string;
187
+ type: ResourceType;
110
188
  }[];
111
189
  roles?: {
112
190
  role: string;
@@ -126,7 +204,7 @@ interface ResourceCreateBody {
126
204
  name?: string;
127
205
  parents?: {
128
206
  id: string;
129
- type: string;
207
+ type: ResourceType;
130
208
  }[];
131
209
  roles?: {
132
210
  role: string;
@@ -165,21 +243,25 @@ interface ResourceUpdateBody {
165
243
  name?: string;
166
244
  parents?: {
167
245
  id: string;
168
- type: string;
246
+ type: ResourceType;
169
247
  }[];
170
248
  }
249
+ interface RevocationRequest {
250
+ token: string;
251
+ token_type_hint?: 'access_token' | 'refresh_token';
252
+ }
171
253
  interface Role {
172
254
  createdAt: string;
173
255
  environmentId: string;
174
256
  resourceId: string;
175
- resourceType: string;
257
+ resourceType: ResourceType;
176
258
  role: string;
177
259
  userId: string;
178
260
  }
179
261
  interface RoleBulkCreateBody {
180
262
  roles: {
181
263
  resourceId: string;
182
- resourceType: string;
264
+ resourceType: ResourceType;
183
265
  role: string;
184
266
  userId: string;
185
267
  }[];
@@ -189,7 +271,7 @@ interface RoleBulkResult {
189
271
  createdAt: string;
190
272
  environmentId: string;
191
273
  resourceId: string;
192
- resourceType: string;
274
+ resourceType: ResourceType;
193
275
  role: string;
194
276
  userId: string;
195
277
  }[];
@@ -198,7 +280,7 @@ interface RoleBulkResult {
198
280
  index: number;
199
281
  role: {
200
282
  resourceId: string;
201
- resourceType: string;
283
+ resourceType: ResourceType;
202
284
  role: string;
203
285
  userId: string;
204
286
  };
@@ -212,7 +294,7 @@ interface RoleBulkResult {
212
294
  }
213
295
  interface RoleCreateBody {
214
296
  resourceId: string;
215
- resourceType: string;
297
+ resourceType: ResourceType;
216
298
  role: string;
217
299
  }
218
300
  interface RoleList {
@@ -222,43 +304,60 @@ interface RoleList {
222
304
  createdAt: string;
223
305
  environmentId: string;
224
306
  resourceId: string;
225
- resourceType: string;
307
+ resourceType: ResourceType;
226
308
  role: string;
227
309
  userId: string;
228
310
  }[];
229
311
  total: number;
230
312
  }
313
+ interface TokenRequest {
314
+ client_id: string;
315
+ client_secret?: string;
316
+ code?: string;
317
+ code_verifier?: string;
318
+ grant_type: 'authorization_code' | 'refresh_token';
319
+ redirect_uri?: string;
320
+ refresh_token?: string;
321
+ scope?: string;
322
+ }
323
+ interface TokenResponse {
324
+ access_token: string;
325
+ expires_in: number;
326
+ refresh_token: string;
327
+ scope?: string;
328
+ token_type: string;
329
+ }
231
330
  interface TransactionHistoryResponse {
232
331
  items: {
233
332
  amount: number;
234
333
  createdAt: string;
235
334
  environmentId: string;
236
335
  id: string;
237
- limitType: string;
336
+ limitType: UsageLimitType;
238
337
  resourceId: string;
239
- resourceType: string;
338
+ resourceType: ResourceType;
240
339
  tags: Record<string, unknown> | null;
241
340
  }[];
242
341
  }
243
342
  interface UsageCheckBody {
244
343
  amount: number;
245
- limitType: string;
344
+ limitType: UsageLimitType;
246
345
  period: 'monthly' | 'yearly' | 'lifetime';
247
346
  resourceId: string;
248
- resourceType: string;
347
+ resourceType: ResourceType;
249
348
  }
250
349
  interface UsageConsumeBody {
251
350
  amount: number;
252
- limitType: string;
351
+ limitType: UsageLimitType;
253
352
  resourceId: string;
254
- resourceType: string;
353
+ resourceType: ResourceType;
255
354
  tags?: Record<string, unknown>;
256
355
  }
257
356
  interface UsageCreditBody {
258
357
  amount: number;
259
- limitType: string;
358
+ limitType: UsageLimitType;
260
359
  resourceId: string;
261
- resourceType: string;
360
+ resourceType: ResourceType;
262
361
  tags?: Record<string, unknown>;
263
362
  }
264
363
  interface UsageWalletResponse {
@@ -266,9 +365,9 @@ interface UsageWalletResponse {
266
365
  createdAt: string;
267
366
  environmentId: string;
268
367
  id: string;
269
- limitType: string;
368
+ limitType: UsageLimitType;
270
369
  resourceId: string;
271
- resourceType: string;
370
+ resourceType: ResourceType;
272
371
  tags: Record<string, unknown> | null;
273
372
  }
274
373
  interface User {
@@ -316,9 +415,9 @@ type UserResourceList = {
316
415
  name: string;
317
416
  parents: {
318
417
  id: string;
319
- type: string;
418
+ type: ResourceType;
320
419
  }[];
321
- type: string;
420
+ type: ResourceType;
322
421
  };
323
422
  role: string;
324
423
  }[];
@@ -330,12 +429,20 @@ interface UserUpdateBody {
330
429
  lookupKey?: string;
331
430
  password?: string;
332
431
  }
432
+ interface AuthJwksGetOAuthAppJwksQuery {
433
+ client_id?: string;
434
+ }
333
435
  interface EntitlementsListForResourceQuery {
334
436
  userId: string;
335
437
  }
336
438
  interface EntitlementsListForTenantQuery {
337
439
  userId: string;
338
440
  }
441
+ interface OauthCheckConsentRequiredQuery {
442
+ client_id: string;
443
+ redirect_uri?: string;
444
+ scope?: string;
445
+ }
339
446
  interface ResourceMembersListQuery {
340
447
  limit?: number;
341
448
  page?: number;
@@ -350,7 +457,7 @@ interface RolesListQuery {
350
457
  limit?: number;
351
458
  page?: number;
352
459
  resourceId?: string;
353
- resourceType?: string;
460
+ resourceType?: ResourceType;
354
461
  role?: string;
355
462
  }
356
463
  interface UsageGetBalanceQuery {
@@ -367,14 +474,27 @@ interface UsersListQuery {
367
474
  search?: string;
368
475
  }
369
476
 
477
+ type schema_AuthJwksGetOAuthAppJwksQuery = AuthJwksGetOAuthAppJwksQuery;
478
+ type schema_AuthorizeRequest = AuthorizeRequest;
370
479
  type schema_BalanceResponse = BalanceResponse;
371
480
  type schema_CheckLimitResponse = CheckLimitResponse;
481
+ type schema_ConsentCheckResponse = ConsentCheckResponse;
482
+ type schema_DeviceAuthorizeRequest = DeviceAuthorizeRequest;
483
+ type schema_DeviceAuthorizeResponse = DeviceAuthorizeResponse;
484
+ type schema_DeviceCodeInfoResponse = DeviceCodeInfoResponse;
485
+ type schema_DeviceCodeRequest = DeviceCodeRequest;
486
+ type schema_DeviceCodeResponse = DeviceCodeResponse;
487
+ type schema_DeviceTokenRequest = DeviceTokenRequest;
372
488
  type schema_EntitlementCheckBody = EntitlementCheckBody;
373
489
  type schema_EntitlementCheckResult = EntitlementCheckResult;
374
490
  type schema_EntitlementsListForResourceQuery = EntitlementsListForResourceQuery;
375
491
  type schema_EntitlementsListForTenantQuery = EntitlementsListForTenantQuery;
376
492
  type schema_EntitlementsListResult = EntitlementsListResult;
377
493
  type schema_Enum<T> = Enum<T>;
494
+ type schema_IntrospectionRequest = IntrospectionRequest;
495
+ type schema_IntrospectionResponse = IntrospectionResponse;
496
+ type schema_JWK = JWK;
497
+ type schema_OauthCheckConsentRequiredQuery = OauthCheckConsentRequiredQuery;
378
498
  type schema_PlanAssignBody = PlanAssignBody;
379
499
  type schema_PlanDeleteResponse = PlanDeleteResponse;
380
500
  type schema_PlanResponse = PlanResponse;
@@ -387,12 +507,15 @@ type schema_ResourceMemberList = ResourceMemberList;
387
507
  type schema_ResourceMembersListQuery = ResourceMembersListQuery;
388
508
  type schema_ResourceUpdateBody = ResourceUpdateBody;
389
509
  type schema_ResourcesListQuery = ResourcesListQuery;
510
+ type schema_RevocationRequest = RevocationRequest;
390
511
  type schema_Role = Role;
391
512
  type schema_RoleBulkCreateBody = RoleBulkCreateBody;
392
513
  type schema_RoleBulkResult = RoleBulkResult;
393
514
  type schema_RoleCreateBody = RoleCreateBody;
394
515
  type schema_RoleList = RoleList;
395
516
  type schema_RolesListQuery = RolesListQuery;
517
+ type schema_TokenRequest = TokenRequest;
518
+ type schema_TokenResponse = TokenResponse;
396
519
  type schema_TransactionHistoryResponse = TransactionHistoryResponse;
397
520
  type schema_UsageCheckBody = UsageCheckBody;
398
521
  type schema_UsageConsumeBody = UsageConsumeBody;
@@ -407,7 +530,7 @@ type schema_UserResourceList = UserResourceList;
407
530
  type schema_UserUpdateBody = UserUpdateBody;
408
531
  type schema_UsersListQuery = UsersListQuery;
409
532
  declare namespace schema {
410
- export type { schema_BalanceResponse as BalanceResponse, schema_CheckLimitResponse as CheckLimitResponse, schema_EntitlementCheckBody as EntitlementCheckBody, schema_EntitlementCheckResult as EntitlementCheckResult, schema_EntitlementsListForResourceQuery as EntitlementsListForResourceQuery, schema_EntitlementsListForTenantQuery as EntitlementsListForTenantQuery, schema_EntitlementsListResult as EntitlementsListResult, schema_Enum as Enum, schema_PlanAssignBody as PlanAssignBody, schema_PlanDeleteResponse as PlanDeleteResponse, schema_PlanResponse as PlanResponse, schema_Resource as Resource, schema_ResourceBulkCreateBody as ResourceBulkCreateBody, schema_ResourceBulkResult as ResourceBulkResult, schema_ResourceCreateBody as ResourceCreateBody, schema_ResourceList as ResourceList, schema_ResourceMemberList as ResourceMemberList, schema_ResourceMembersListQuery as ResourceMembersListQuery, schema_ResourceUpdateBody as ResourceUpdateBody, schema_ResourcesListQuery as ResourcesListQuery, schema_Role as Role, schema_RoleBulkCreateBody as RoleBulkCreateBody, schema_RoleBulkResult as RoleBulkResult, schema_RoleCreateBody as RoleCreateBody, schema_RoleList as RoleList, schema_RolesListQuery as RolesListQuery, schema_TransactionHistoryResponse as TransactionHistoryResponse, schema_UsageCheckBody as UsageCheckBody, schema_UsageConsumeBody as UsageConsumeBody, schema_UsageCreditBody as UsageCreditBody, schema_UsageGetBalanceQuery as UsageGetBalanceQuery, schema_UsageGetTransactionHistoryQuery as UsageGetTransactionHistoryQuery, schema_UsageWalletResponse as UsageWalletResponse, schema_User as User, schema_UserCreateBody as UserCreateBody, schema_UserList as UserList, schema_UserResourceList as UserResourceList, schema_UserUpdateBody as UserUpdateBody, schema_UsersListQuery as UsersListQuery };
533
+ export type { schema_AuthJwksGetOAuthAppJwksQuery as AuthJwksGetOAuthAppJwksQuery, schema_AuthorizeRequest as AuthorizeRequest, schema_BalanceResponse as BalanceResponse, schema_CheckLimitResponse as CheckLimitResponse, schema_ConsentCheckResponse as ConsentCheckResponse, schema_DeviceAuthorizeRequest as DeviceAuthorizeRequest, schema_DeviceAuthorizeResponse as DeviceAuthorizeResponse, schema_DeviceCodeInfoResponse as DeviceCodeInfoResponse, schema_DeviceCodeRequest as DeviceCodeRequest, schema_DeviceCodeResponse as DeviceCodeResponse, schema_DeviceTokenRequest as DeviceTokenRequest, schema_EntitlementCheckBody as EntitlementCheckBody, schema_EntitlementCheckResult as EntitlementCheckResult, schema_EntitlementsListForResourceQuery as EntitlementsListForResourceQuery, schema_EntitlementsListForTenantQuery as EntitlementsListForTenantQuery, schema_EntitlementsListResult as EntitlementsListResult, schema_Enum as Enum, schema_IntrospectionRequest as IntrospectionRequest, schema_IntrospectionResponse as IntrospectionResponse, schema_JWK as JWK, schema_OauthCheckConsentRequiredQuery as OauthCheckConsentRequiredQuery, schema_PlanAssignBody as PlanAssignBody, schema_PlanDeleteResponse as PlanDeleteResponse, schema_PlanResponse as PlanResponse, schema_Resource as Resource, schema_ResourceBulkCreateBody as ResourceBulkCreateBody, schema_ResourceBulkResult as ResourceBulkResult, schema_ResourceCreateBody as ResourceCreateBody, schema_ResourceList as ResourceList, schema_ResourceMemberList as ResourceMemberList, schema_ResourceMembersListQuery as ResourceMembersListQuery, schema_ResourceUpdateBody as ResourceUpdateBody, schema_ResourcesListQuery as ResourcesListQuery, schema_RevocationRequest as RevocationRequest, schema_Role as Role, schema_RoleBulkCreateBody as RoleBulkCreateBody, schema_RoleBulkResult as RoleBulkResult, schema_RoleCreateBody as RoleCreateBody, schema_RoleList as RoleList, schema_RolesListQuery as RolesListQuery, schema_TokenRequest as TokenRequest, schema_TokenResponse as TokenResponse, schema_TransactionHistoryResponse as TransactionHistoryResponse, schema_UsageCheckBody as UsageCheckBody, schema_UsageConsumeBody as UsageConsumeBody, schema_UsageCreditBody as UsageCreditBody, schema_UsageGetBalanceQuery as UsageGetBalanceQuery, schema_UsageGetTransactionHistoryQuery as UsageGetTransactionHistoryQuery, schema_UsageWalletResponse as UsageWalletResponse, schema_User as User, schema_UserCreateBody as UserCreateBody, schema_UserList as UserList, schema_UserResourceList as UserResourceList, schema_UserUpdateBody as UserUpdateBody, schema_UsersListQuery as UsersListQuery };
411
534
  }
412
535
 
413
- export { type UsersListQuery as A, type BalanceResponse as B, type CheckLimitResponse as C, type UserList as D, type EntitlementCheckBody as E, type UserCreateBody as F, type User as G, type UserUpdateBody as H, type UserResourceList as I, type Enum as J, type PlanDeleteResponse as P, type ResourceBulkCreateBody as R, type TransactionHistoryResponse as T, type UsageGetBalanceQuery as U, type ResourceBulkResult as a, type RoleBulkCreateBody as b, type RoleBulkResult as c, type EntitlementCheckResult as d, type EntitlementsListForResourceQuery as e, type EntitlementsListResult as f, type EntitlementsListForTenantQuery as g, type PlanResponse as h, type PlanAssignBody as i, type ResourceMembersListQuery as j, type ResourceMemberList as k, type ResourcesListQuery as l, type ResourceList as m, type ResourceCreateBody as n, type Resource as o, type ResourceUpdateBody as p, type RolesListQuery as q, type RoleList as r, schema as s, type RoleCreateBody as t, type Role as u, type UsageCheckBody as v, type UsageConsumeBody as w, type UsageWalletResponse as x, type UsageCreditBody as y, type UsageGetTransactionHistoryQuery as z };
536
+ export { type UserUpdateBody as $, type AuthJwksGetOAuthAppJwksQuery as A, type RolesListQuery as B, type ConsentCheckResponse as C, type DeviceAuthorizeRequest as D, type EntitlementCheckBody as E, type RoleList as F, type RoleCreateBody as G, type Role as H, type IntrospectionRequest as I, type JWK as J, type BalanceResponse as K, type UsageCheckBody as L, type CheckLimitResponse as M, type UsageConsumeBody as N, type OauthCheckConsentRequiredQuery as O, type PlanDeleteResponse as P, type UsageWalletResponse as Q, type ResourceBulkCreateBody as R, type UsageCreditBody as S, type TokenResponse as T, type UsageGetBalanceQuery as U, type UsageGetTransactionHistoryQuery as V, type TransactionHistoryResponse as W, type UsersListQuery as X, type UserList as Y, type UserCreateBody as Z, type User as _, type ResourceBulkResult as a, type UserResourceList as a0, type Enum as a1, type RoleBulkCreateBody as b, type RoleBulkResult as c, type EntitlementCheckResult as d, type EntitlementsListForResourceQuery as e, type EntitlementsListResult as f, type EntitlementsListForTenantQuery as g, type AuthorizeRequest as h, type DeviceAuthorizeResponse as i, type DeviceCodeRequest as j, type DeviceCodeResponse as k, type DeviceCodeInfoResponse as l, type DeviceTokenRequest as m, type IntrospectionResponse as n, type RevocationRequest as o, type TokenRequest as p, type PlanResponse as q, type PlanAssignBody as r, schema as s, type ResourceMembersListQuery as t, type ResourceMemberList as u, type ResourcesListQuery as v, type ResourceList as w, type ResourceCreateBody as x, type Resource as y, type ResourceUpdateBody as z };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/schema.ts"],"sourcesContent":["// Generated types from OpenAPI components.schemas\n\nexport type Enum<T> = T[keyof T];\n\nexport interface BalanceResponse {\n balance: number;\n}\n\nexport interface CheckLimitResponse {\n allowed: boolean;\n current: number;\n remaining?: number;\n requested: number;\n}\n\nexport interface EntitlementCheckBody {\n amount?: number;\n entitlement: string;\n resourceId: string;\n userId: string;\n}\n\nexport interface EntitlementCheckResult {\n allowed: boolean;\n limit?: {\n allowed: boolean;\n current?: number;\n limit?: number;\n plan?: string | null;\n reason?: string;\n remaining?: number;\n scope?: string;\n } | null;\n plans?: {\n allowed: boolean;\n allowedPlans?: string[];\n plan?: string | null;\n reason?: string;\n } | null;\n roles?: {\n allowed: boolean;\n allowedRoles?: string[];\n reason?: string;\n userRoles?: string[];\n } | null;\n}\n\nexport interface EntitlementsListResult {\n results: {\n entitlements: {\n allowed: boolean;\n allowedByPlan: boolean;\n allowedByRole: boolean;\n allowedPlans?: string[];\n allowedRoles: string[];\n currentPlan?: string;\n currentRole?: string;\n entitlement: string;\n }[];\n resourceId: string;\n resourceType: string;\n }[];\n}\n\nexport interface PlanAssignBody {\n planKey: string;\n}\n\nexport interface PlanDeleteResponse {\n success: boolean;\n}\n\nexport interface PlanResponse {\n createdAt: string;\n environmentId: string;\n planKey: string;\n resourceId: string;\n resourceType: string;\n updatedAt: string;\n}\n\nexport interface Resource {\n createdAt: string;\n id: string;\n name: string | null;\n parents?: { id: string; type: string }[];\n type: string;\n}\n\nexport interface ResourceBulkCreateBody {\n resources: {\n id?: string;\n name?: string;\n parents?: { id: string; type: string }[];\n roles?: { role: string; userId: string }[];\n }[];\n}\n\nexport interface ResourceBulkResult {\n created: { environmentId: string; id: string; type: string }[];\n errors: {\n error: string;\n index: number;\n resource: {\n id?: string;\n name?: string;\n parents?: { id: string; type: string }[];\n roles?: { role: string; userId: string }[];\n };\n }[];\n success: boolean;\n summary: { failed: number; successful: number; total: number };\n}\n\nexport interface ResourceCreateBody {\n id?: string;\n name?: string;\n parents?: { id: string; type: string }[];\n roles?: { role: string; userId: string }[];\n}\n\nexport interface ResourceList {\n items: Resource[];\n limit: number;\n page: number;\n total: number;\n}\n\nexport interface ResourceMemberList {\n items: {\n inherited: boolean;\n role: string;\n user: {\n avatarUrl: string | null;\n createdAt: string;\n email: string;\n emailVerified: boolean;\n firstName: string | null;\n id: string;\n lastLoginAt: string | null;\n lastName: string | null;\n lookupKey: string | null;\n updatedAt: string;\n };\n userId: string;\n }[];\n limit: number;\n page: number;\n total: number;\n}\n\nexport interface ResourceUpdateBody {\n name?: string;\n /** Creates relationships with other resources. Parent resources must already exist. */\n parents?: { id: string; type: string }[];\n}\n\nexport interface Role {\n createdAt: string;\n environmentId: string;\n resourceId: string;\n resourceType: string;\n role: string;\n userId: string;\n}\n\nexport interface RoleBulkCreateBody {\n roles: { resourceId: string; resourceType: string; role: string; userId: string }[];\n}\n\nexport interface RoleBulkResult {\n created: {\n createdAt: string;\n environmentId: string;\n resourceId: string;\n resourceType: string;\n role: string;\n userId: string;\n }[];\n errors: {\n error: string;\n index: number;\n role: { resourceId: string; resourceType: string; role: string; userId: string };\n }[];\n success: boolean;\n summary: { failed: number; successful: number; total: number };\n}\n\nexport interface RoleCreateBody {\n resourceId: string;\n resourceType: string;\n role: string;\n}\n\nexport interface RoleList {\n limit: number;\n page: number;\n roles: {\n createdAt: string;\n environmentId: string;\n resourceId: string;\n resourceType: string;\n role: string;\n userId: string;\n }[];\n total: number;\n}\n\nexport interface TransactionHistoryResponse {\n items: {\n amount: number;\n createdAt: string;\n environmentId: string;\n id: string;\n limitType: string;\n resourceId: string;\n resourceType: string;\n tags: Record<string, unknown> | null;\n }[];\n}\n\nexport interface UsageCheckBody {\n amount: number;\n limitType: string;\n period: 'monthly' | 'yearly' | 'lifetime';\n resourceId: string;\n resourceType: string;\n}\n\nexport interface UsageConsumeBody {\n amount: number;\n limitType: string;\n resourceId: string;\n resourceType: string;\n tags?: Record<string, unknown>;\n}\n\nexport interface UsageCreditBody {\n amount: number;\n limitType: string;\n resourceId: string;\n resourceType: string;\n tags?: Record<string, unknown>;\n}\n\nexport interface UsageWalletResponse {\n amount: number;\n createdAt: string;\n environmentId: string;\n id: string;\n limitType: string;\n resourceId: string;\n resourceType: string;\n tags: Record<string, unknown> | null;\n}\n\nexport interface User {\n avatarUrl: string | null;\n createdAt: string;\n email: string;\n emailVerified: boolean;\n firstName: string | null;\n id: string;\n lastLoginAt: string | null;\n lastName: string | null;\n lookupKey: string | null;\n updatedAt: string;\n}\n\nexport interface UserCreateBody {\n avatarUrl?: string;\n email: string;\n firstName?: string | null;\n lastName?: string | null;\n lookupKey: string;\n newUser?: boolean | null;\n password?: string | null;\n}\n\nexport interface UserList {\n items: {\n avatarUrl: string | null;\n createdAt: string;\n email: string;\n emailVerified: boolean;\n firstName: string | null;\n id: string;\n lastLoginAt: string | null;\n lastName: string | null;\n lookupKey: string | null;\n updatedAt: string;\n }[];\n limit: number;\n page: number;\n total: number;\n}\n\nexport type UserResourceList = {\n inherited: boolean;\n resource: { id: string; name: string; parents: { id: string; type: string }[]; type: string };\n role: string;\n}[];\n\nexport interface UserUpdateBody {\n avatarUrl?: string | null;\n email?: string;\n firstName?: string | null;\n lastName?: string | null;\n lookupKey?: string;\n password?: string;\n}\n\n// Operation query parameter interfaces\n\n/**\n * Query params for Entitlements.ListForResource*\n * 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.*/\nexport interface EntitlementsListForResourceQuery {\n /** The unique identifier of the user */\n userId: string;\n}\n\n/**\n * Query params for Entitlements.ListForTenant*\n * 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`).*/\nexport interface EntitlementsListForTenantQuery {\n /** The unique identifier of the user */\n userId: string;\n}\n\n/**\n * Query params for Resource Members.List*\n * Retrieves a paginated list of users who have roles (direct or inherited) on the specified resource. Supports search functionality to filter users by email or name.*/\nexport interface ResourceMembersListQuery {\n /** Number of items per page (minimum: 1, maximum: 100) */\n limit?: number;\n /** Page number for pagination */\n page?: number;\n /** Search query to filter members by email or name */\n search?: string;\n}\n\n/**\n * Query params for Resources.List*\n * Retrieves a paginated list of resources of the specified type. Supports search and filtering. Resources are returned with their parent relationships and metadata.*/\nexport interface ResourcesListQuery {\n /** Number of items per page (minimum: 1, maximum: 100) */\n limit?: number;\n /** Page number for pagination */\n page?: number;\n /** Search query to filter resources by name */\n search?: string;\n}\n\n/**\n * Query params for Roles.List*\n * 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.*/\nexport interface RolesListQuery {\n /** Number of items per page (minimum: 1, maximum: 100) */\n limit?: number;\n /** Page number for pagination */\n page?: number;\n /** Filter roles by specific resource ID */\n resourceId?: string;\n /** Filter roles by resource type */\n resourceType?: string;\n /** Filter by role name */\n role?: string;\n}\n\n/**\n * Query params for Usage.GetBalance*\n * 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.*/\nexport interface UsageGetBalanceQuery {\n /** Time period for the balance calculation */\n period: 'monthly' | 'yearly' | 'lifetime';\n}\n\n/**\n * Query params for Usage.GetTransactionHistory*\n * Retrieves the transaction history for a usage wallet, including all credits and consumption records. Supports filtering by time period and date range.*/\nexport interface UsageGetTransactionHistoryQuery {\n /** End date for filtering transactions (ISO 8601 format) */\n endDate?: string;\n /** Time period for filtering transactions */\n period?: 'monthly' | 'yearly' | 'lifetime';\n /** Start date for filtering transactions (ISO 8601 format) */\n startDate?: string;\n}\n\n/**\n * Query params for Users.List*\n * Retrieves a paginated list of users in your environment. Supports search functionality to filter users by email, name, or lookup key.*/\nexport interface UsersListQuery {\n /** Number of items per page (minimum: 1, maximum: 100) */\n limit?: number;\n /** Page number for pagination */\n page?: number;\n /** Search query to filter users by email, name, or lookup key */\n search?: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../src/schema.ts"],"sourcesContent":["// Generated types from OpenAPI components.schemas\n\nimport type { ResourceType, EntitlementType, PlanType, UsageLimitType } from '@blimu/types';\n\nexport type Enum<T> = T[keyof T];\n\nexport interface AuthorizeRequest {\n /** Action to take: allow or deny */\n action: 'allow' | 'deny';\n /** True if consent was auto-approved (not required or previously granted) */\n auto_approved?: boolean;\n /** OAuth2 client ID */\n client_id: string;\n /** PKCE code challenge */\n code_challenge?: string;\n /** PKCE code challenge method */\n code_challenge_method?: string;\n /** Redirect URI */\n redirect_uri: string;\n /** Response type (typically \"code\") */\n response_type: string;\n /** Space-separated list of scopes */\n scope?: string;\n /** State parameter for CSRF protection */\n state?: string;\n /** True if user explicitly clicked Allow, false if auto-approved */\n user_action?: boolean;\n}\n\nexport interface BalanceResponse {\n balance: number;\n}\n\nexport interface CheckLimitResponse {\n allowed: boolean;\n current: number;\n remaining?: number;\n requested: number;\n}\n\nexport interface ConsentCheckResponse {\n /** Whether user consent is required */\n consent_required: boolean;\n /** Whether consent was previously granted for this app and scopes */\n previously_granted: boolean;\n}\n\nexport interface DeviceAuthorizeRequest {\n /** Action to take: allow or deny */\n action: 'allow' | 'deny';\n /** True if consent was auto-approved (not required or previously granted) */\n auto_approved?: boolean;\n /** True if user explicitly clicked Allow, false if auto-approved */\n user_action?: boolean;\n /** The user code displayed to the user */\n user_code: string;\n}\n\nexport interface DeviceAuthorizeResponse {\n /** Whether the authorization was successful */\n success: boolean;\n}\n\nexport interface DeviceCodeInfoResponse {\n /** The name of the OAuth2 application */\n appName: string;\n /** Whether the user has already granted consent for this app and scopes */\n previouslyGranted: boolean;\n /** Whether the app requires user consent */\n requireConsent: boolean;\n /** The scopes requested by the device code */\n scopes: string[];\n}\n\nexport interface DeviceCodeRequest {\n /** OAuth2 client ID */\n client_id: string;\n /** PKCE code challenge (base64url encoded SHA256 hash) */\n code_challenge?: string;\n /** PKCE code challenge method */\n code_challenge_method?: 'S256' | 'plain';\n /** Space-separated list of scopes */\n scope?: string;\n}\n\nexport interface DeviceCodeResponse {\n /** Device verification code (for polling) */\n device_code: string;\n /** Device code expiration time in seconds */\n expires_in: number;\n /** Minimum polling interval in seconds */\n interval: number;\n /** User verification code (short, human-readable) */\n user_code: string;\n /** Verification URI for user */\n verification_uri: string;\n /** Complete verification URI with user code */\n verification_uri_complete: string;\n}\n\nexport interface DeviceTokenRequest {\n /** OAuth2 client ID */\n client_id: string;\n /** PKCE code verifier (if challenge was provided) */\n code_verifier?: string;\n /** Device code from authorization response */\n device_code: string;\n /** Grant type (must be device_code) */\n grant_type: 'urn:ietf:params:oauth:grant-type:device_code';\n}\n\nexport interface EntitlementCheckBody {\n amount?: number;\n entitlement: EntitlementType;\n resourceId: string;\n userId: string;\n}\n\nexport interface EntitlementCheckResult {\n allowed: boolean;\n limit?: {\n allowed: boolean;\n current?: number;\n limit?: number;\n plan?: PlanType;\n reason?: string;\n remaining?: number;\n scope?: string;\n } | null;\n plans?: { allowed: boolean; allowedPlans?: PlanType[]; plan?: PlanType; reason?: string } | null;\n roles?: {\n allowed: boolean;\n allowedRoles?: string[];\n reason?: string;\n userRoles?: string[];\n } | null;\n}\n\nexport interface EntitlementsListResult {\n results: {\n entitlements: {\n allowed: boolean;\n allowedByPlan: boolean;\n allowedByRole: boolean;\n allowedPlans?: PlanType[];\n allowedRoles: string[];\n currentPlan?: PlanType;\n currentRole?: string;\n entitlement: EntitlementType;\n }[];\n resourceId: string;\n resourceType: ResourceType;\n }[];\n}\n\nexport interface IntrospectionRequest {\n /** The token to introspect */\n token: string;\n /** Hint about token type */\n token_type_hint?: 'access_token' | 'refresh_token';\n}\n\nexport interface IntrospectionResponse {\n /** Whether the token is active */\n active: boolean;\n /** Client ID */\n client_id?: string;\n /** Environment ID */\n environment_id?: string;\n /** Token expiration timestamp */\n exp?: number;\n /** Token issued at timestamp */\n iat?: number;\n /** Space-separated list of scopes */\n scope?: string;\n /** Subject (user ID) */\n sub?: string;\n /** Token type */\n token_type?: string;\n /** Username or user ID */\n username?: string;\n}\n\nexport interface JWK {\n keys: { alg: string; e: string; kid: string; kty: string; n: string; use: string }[];\n}\n\nexport interface PlanAssignBody {\n planKey: PlanType;\n}\n\nexport interface PlanDeleteResponse {\n success: boolean;\n}\n\nexport interface PlanResponse {\n createdAt: string;\n environmentId: string;\n planKey: PlanType;\n resourceId: string;\n resourceType: ResourceType;\n updatedAt: string;\n}\n\nexport interface Resource {\n createdAt: string;\n id: string;\n name: string | null;\n parents?: { id: string; type: ResourceType }[];\n type: ResourceType;\n}\n\nexport interface ResourceBulkCreateBody {\n resources: {\n id?: string;\n name?: string;\n parents?: { id: string; type: ResourceType }[];\n roles?: { role: string; userId: string }[];\n }[];\n}\n\nexport interface ResourceBulkResult {\n created: { environmentId: string; id: string; type: ResourceType }[];\n errors: {\n error: string;\n index: number;\n resource: {\n id?: string;\n name?: string;\n parents?: { id: string; type: ResourceType }[];\n roles?: { role: string; userId: string }[];\n };\n }[];\n success: boolean;\n summary: { failed: number; successful: number; total: number };\n}\n\nexport interface ResourceCreateBody {\n id?: string;\n name?: string;\n parents?: { id: string; type: ResourceType }[];\n roles?: { role: string; userId: string }[];\n}\n\nexport interface ResourceList {\n items: Resource[];\n limit: number;\n page: number;\n total: number;\n}\n\nexport interface ResourceMemberList {\n items: {\n inherited: boolean;\n role: string;\n user: {\n avatarUrl: string | null;\n createdAt: string;\n email: string;\n emailVerified: boolean;\n firstName: string | null;\n id: string;\n lastLoginAt: string | null;\n lastName: string | null;\n lookupKey: string | null;\n updatedAt: string;\n };\n userId: string;\n }[];\n limit: number;\n page: number;\n total: number;\n}\n\nexport interface ResourceUpdateBody {\n name?: string;\n /** Creates relationships with other resources. Parent resources must already exist. */\n parents?: { id: string; type: ResourceType }[];\n}\n\nexport interface RevocationRequest {\n /** The token to revoke */\n token: string;\n /** Hint about token type */\n token_type_hint?: 'access_token' | 'refresh_token';\n}\n\nexport interface Role {\n createdAt: string;\n environmentId: string;\n resourceId: string;\n resourceType: ResourceType;\n role: string;\n userId: string;\n}\n\nexport interface RoleBulkCreateBody {\n roles: { resourceId: string; resourceType: ResourceType; role: string; userId: string }[];\n}\n\nexport interface RoleBulkResult {\n created: {\n createdAt: string;\n environmentId: string;\n resourceId: string;\n resourceType: ResourceType;\n role: string;\n userId: string;\n }[];\n errors: {\n error: string;\n index: number;\n role: { resourceId: string; resourceType: ResourceType; role: string; userId: string };\n }[];\n success: boolean;\n summary: { failed: number; successful: number; total: number };\n}\n\nexport interface RoleCreateBody {\n resourceId: string;\n resourceType: ResourceType;\n role: string;\n}\n\nexport interface RoleList {\n limit: number;\n page: number;\n roles: {\n createdAt: string;\n environmentId: string;\n resourceId: string;\n resourceType: ResourceType;\n role: string;\n userId: string;\n }[];\n total: number;\n}\n\nexport interface TokenRequest {\n /** OAuth2 client ID */\n client_id: string;\n /** OAuth2 client secret (required for confidential clients) */\n client_secret?: string;\n /** Authorization code (required for authorization_code grant) */\n code?: string;\n /** PKCE code verifier (if challenge was provided) */\n code_verifier?: string;\n /** OAuth2 grant type */\n grant_type: 'authorization_code' | 'refresh_token';\n /** Redirect URI (required for authorization_code grant) */\n redirect_uri?: string;\n /** Refresh token (required for refresh_token grant) */\n refresh_token?: string;\n /** Space-separated list of scopes (optional for refresh) */\n scope?: string;\n}\n\nexport interface TokenResponse {\n /** Access token (JWT) */\n access_token: string;\n /** Access token expiration time in seconds */\n expires_in: number;\n /** Refresh token (for obtaining new access tokens) */\n refresh_token: string;\n /** Space-separated list of granted scopes */\n scope?: string;\n /** Token type */\n token_type: string;\n}\n\nexport interface TransactionHistoryResponse {\n items: {\n amount: number;\n createdAt: string;\n environmentId: string;\n id: string;\n limitType: UsageLimitType;\n resourceId: string;\n resourceType: ResourceType;\n tags: Record<string, unknown> | null;\n }[];\n}\n\nexport interface UsageCheckBody {\n amount: number;\n limitType: UsageLimitType;\n period: 'monthly' | 'yearly' | 'lifetime';\n resourceId: string;\n resourceType: ResourceType;\n}\n\nexport interface UsageConsumeBody {\n amount: number;\n limitType: UsageLimitType;\n resourceId: string;\n resourceType: ResourceType;\n tags?: Record<string, unknown>;\n}\n\nexport interface UsageCreditBody {\n amount: number;\n limitType: UsageLimitType;\n resourceId: string;\n resourceType: ResourceType;\n tags?: Record<string, unknown>;\n}\n\nexport interface UsageWalletResponse {\n amount: number;\n createdAt: string;\n environmentId: string;\n id: string;\n limitType: UsageLimitType;\n resourceId: string;\n resourceType: ResourceType;\n tags: Record<string, unknown> | null;\n}\n\nexport interface User {\n avatarUrl: string | null;\n createdAt: string;\n email: string;\n emailVerified: boolean;\n firstName: string | null;\n id: string;\n lastLoginAt: string | null;\n lastName: string | null;\n lookupKey: string | null;\n updatedAt: string;\n}\n\nexport interface UserCreateBody {\n avatarUrl?: string;\n email: string;\n firstName?: string | null;\n lastName?: string | null;\n lookupKey: string;\n newUser?: boolean | null;\n password?: string | null;\n}\n\nexport interface UserList {\n items: {\n avatarUrl: string | null;\n createdAt: string;\n email: string;\n emailVerified: boolean;\n firstName: string | null;\n id: string;\n lastLoginAt: string | null;\n lastName: string | null;\n lookupKey: string | null;\n updatedAt: string;\n }[];\n limit: number;\n page: number;\n total: number;\n}\n\nexport type UserResourceList = {\n inherited: boolean;\n resource: {\n id: string;\n name: string;\n parents: { id: string; type: ResourceType }[];\n type: ResourceType;\n };\n role: string;\n}[];\n\nexport interface UserUpdateBody {\n avatarUrl?: string | null;\n email?: string;\n firstName?: string | null;\n lastName?: string | null;\n lookupKey?: string;\n password?: string;\n}\n\n// Operation query parameter interfaces\n\n/**\n * Query params for AuthJwks.GetOAuthAppJwks*\n * Returns the public key for a specific OAuth app to verify JWT tokens. This is a public endpoint following OAuth2/OIDC standards. Provide client_id to get keys for a specific OAuth app, or use authenticated endpoint for environment keys.*/\nexport interface AuthJwksGetOAuthAppJwksQuery {\n /** OAuth app client ID to get public keys for */\n client_id?: string;\n}\n\n/**\n * Query params for Entitlements.ListForResource*\n * 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.*/\nexport interface EntitlementsListForResourceQuery {\n /** The unique identifier of the user */\n userId: string;\n}\n\n/**\n * Query params for Entitlements.ListForTenant*\n * 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`).*/\nexport interface EntitlementsListForTenantQuery {\n /** The unique identifier of the user */\n userId: string;\n}\n\n/**\n * Query params for Oauth.CheckConsentRequired*\n * Checks if user consent is required for the OAuth2 app and requested scopes.*/\nexport interface OauthCheckConsentRequiredQuery {\n /** OAuth2 client ID */\n client_id: string;\n /** Redirect URI */\n redirect_uri?: string;\n /** Space-separated list of scopes */\n scope?: string;\n}\n\n/**\n * Query params for Resource Members.List*\n * Retrieves a paginated list of users who have roles (direct or inherited) on the specified resource. Supports search functionality to filter users by email or name.*/\nexport interface ResourceMembersListQuery {\n /** Number of items per page (minimum: 1, maximum: 100) */\n limit?: number;\n /** Page number for pagination */\n page?: number;\n /** Search query to filter members by email or name */\n search?: string;\n}\n\n/**\n * Query params for Resources.List*\n * Retrieves a paginated list of resources of the specified type. Supports search and filtering. Resources are returned with their parent relationships and metadata.*/\nexport interface ResourcesListQuery {\n /** Number of items per page (minimum: 1, maximum: 100) */\n limit?: number;\n /** Page number for pagination */\n page?: number;\n /** Search query to filter resources by name */\n search?: string;\n}\n\n/**\n * Query params for Roles.List*\n * 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.*/\nexport interface RolesListQuery {\n /** Number of items per page (minimum: 1, maximum: 100) */\n limit?: number;\n /** Page number for pagination */\n page?: number;\n /** Filter roles by specific resource ID */\n resourceId?: string;\n /** Filter roles by resource type */\n resourceType?: ResourceType;\n /** Filter by role name */\n role?: string;\n}\n\n/**\n * Query params for Usage.GetBalance*\n * 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.*/\nexport interface UsageGetBalanceQuery {\n /** Time period for the balance calculation */\n period: 'monthly' | 'yearly' | 'lifetime';\n}\n\n/**\n * Query params for Usage.GetTransactionHistory*\n * Retrieves the transaction history for a usage wallet, including all credits and consumption records. Supports filtering by time period and date range.*/\nexport interface UsageGetTransactionHistoryQuery {\n /** End date for filtering transactions (ISO 8601 format) */\n endDate?: string;\n /** Time period for filtering transactions */\n period?: 'monthly' | 'yearly' | 'lifetime';\n /** Start date for filtering transactions (ISO 8601 format) */\n startDate?: string;\n}\n\n/**\n * Query params for Users.List*\n * Retrieves a paginated list of users in your environment. Supports search functionality to filter users by email, name, or lookup key.*/\nexport interface UsersListQuery {\n /** Number of items per page (minimum: 1, maximum: 100) */\n limit?: number;\n /** Page number for pagination */\n page?: number;\n /** Search query to filter users by email, name, or lookup key */\n search?: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
package/dist/schema.d.mts CHANGED
@@ -1 +1,2 @@
1
- export { B as BalanceResponse, C as CheckLimitResponse, E as EntitlementCheckBody, d as EntitlementCheckResult, e as EntitlementsListForResourceQuery, g as EntitlementsListForTenantQuery, f as EntitlementsListResult, J as Enum, i as PlanAssignBody, P as PlanDeleteResponse, h as PlanResponse, o as Resource, R as ResourceBulkCreateBody, a as ResourceBulkResult, n as ResourceCreateBody, m as ResourceList, k as ResourceMemberList, j as ResourceMembersListQuery, p as ResourceUpdateBody, l as ResourcesListQuery, u as Role, b as RoleBulkCreateBody, c as RoleBulkResult, t as RoleCreateBody, r as RoleList, q as RolesListQuery, T as TransactionHistoryResponse, v as UsageCheckBody, w as UsageConsumeBody, y as UsageCreditBody, U as UsageGetBalanceQuery, z as UsageGetTransactionHistoryQuery, x as UsageWalletResponse, G as User, F as UserCreateBody, D as UserList, I as UserResourceList, H as UserUpdateBody, A as UsersListQuery } from './schema-BbKn_i-U.mjs';
1
+ import '@blimu/types';
2
+ export { A as AuthJwksGetOAuthAppJwksQuery, h as AuthorizeRequest, K as BalanceResponse, M as CheckLimitResponse, C as ConsentCheckResponse, D as DeviceAuthorizeRequest, i as DeviceAuthorizeResponse, l as DeviceCodeInfoResponse, j as DeviceCodeRequest, k as DeviceCodeResponse, m as DeviceTokenRequest, E as EntitlementCheckBody, d as EntitlementCheckResult, e as EntitlementsListForResourceQuery, g as EntitlementsListForTenantQuery, f as EntitlementsListResult, a1 as Enum, I as IntrospectionRequest, n as IntrospectionResponse, J as JWK, O as OauthCheckConsentRequiredQuery, r as PlanAssignBody, P as PlanDeleteResponse, q as PlanResponse, y as Resource, R as ResourceBulkCreateBody, a as ResourceBulkResult, x as ResourceCreateBody, w as ResourceList, u as ResourceMemberList, t as ResourceMembersListQuery, z as ResourceUpdateBody, v as ResourcesListQuery, o as RevocationRequest, H as Role, b as RoleBulkCreateBody, c as RoleBulkResult, G as RoleCreateBody, F as RoleList, B as RolesListQuery, p as TokenRequest, T as TokenResponse, W as TransactionHistoryResponse, L as UsageCheckBody, N as UsageConsumeBody, S as UsageCreditBody, U as UsageGetBalanceQuery, V as UsageGetTransactionHistoryQuery, Q as UsageWalletResponse, _ as User, Z as UserCreateBody, Y as UserList, a0 as UserResourceList, $ as UserUpdateBody, X as UsersListQuery } from './schema-CdEZKE7E.mjs';
package/dist/schema.d.ts CHANGED
@@ -1 +1,2 @@
1
- export { B as BalanceResponse, C as CheckLimitResponse, E as EntitlementCheckBody, d as EntitlementCheckResult, e as EntitlementsListForResourceQuery, g as EntitlementsListForTenantQuery, f as EntitlementsListResult, J as Enum, i as PlanAssignBody, P as PlanDeleteResponse, h as PlanResponse, o as Resource, R as ResourceBulkCreateBody, a as ResourceBulkResult, n as ResourceCreateBody, m as ResourceList, k as ResourceMemberList, j as ResourceMembersListQuery, p as ResourceUpdateBody, l as ResourcesListQuery, u as Role, b as RoleBulkCreateBody, c as RoleBulkResult, t as RoleCreateBody, r as RoleList, q as RolesListQuery, T as TransactionHistoryResponse, v as UsageCheckBody, w as UsageConsumeBody, y as UsageCreditBody, U as UsageGetBalanceQuery, z as UsageGetTransactionHistoryQuery, x as UsageWalletResponse, G as User, F as UserCreateBody, D as UserList, I as UserResourceList, H as UserUpdateBody, A as UsersListQuery } from './schema-BbKn_i-U.js';
1
+ import '@blimu/types';
2
+ export { A as AuthJwksGetOAuthAppJwksQuery, h as AuthorizeRequest, K as BalanceResponse, M as CheckLimitResponse, C as ConsentCheckResponse, D as DeviceAuthorizeRequest, i as DeviceAuthorizeResponse, l as DeviceCodeInfoResponse, j as DeviceCodeRequest, k as DeviceCodeResponse, m as DeviceTokenRequest, E as EntitlementCheckBody, d as EntitlementCheckResult, e as EntitlementsListForResourceQuery, g as EntitlementsListForTenantQuery, f as EntitlementsListResult, a1 as Enum, I as IntrospectionRequest, n as IntrospectionResponse, J as JWK, O as OauthCheckConsentRequiredQuery, r as PlanAssignBody, P as PlanDeleteResponse, q as PlanResponse, y as Resource, R as ResourceBulkCreateBody, a as ResourceBulkResult, x as ResourceCreateBody, w as ResourceList, u as ResourceMemberList, t as ResourceMembersListQuery, z as ResourceUpdateBody, v as ResourcesListQuery, o as RevocationRequest, H as Role, b as RoleBulkCreateBody, c as RoleBulkResult, G as RoleCreateBody, F as RoleList, B as RolesListQuery, p as TokenRequest, T as TokenResponse, W as TransactionHistoryResponse, L as UsageCheckBody, N as UsageConsumeBody, S as UsageCreditBody, U as UsageGetBalanceQuery, V as UsageGetTransactionHistoryQuery, Q as UsageWalletResponse, _ as User, Z as UserCreateBody, Y as UserList, a0 as UserResourceList, $ as UserUpdateBody, X as UsersListQuery } from './schema-CdEZKE7E.js';
@@ -0,0 +1,69 @@
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/auth_jwks.ts
21
+ var auth_jwks_exports = {};
22
+ __export(auth_jwks_exports, {
23
+ AuthJwksService: () => AuthJwksService
24
+ });
25
+ module.exports = __toCommonJS(auth_jwks_exports);
26
+ var AuthJwksService = class {
27
+ constructor(core) {
28
+ this.core = core;
29
+ }
30
+ /**
31
+ * GET /v1/auth/.well-known/jwks.json*
32
+ * @summary Get JSON Web Key Set for environment (Public)*
33
+ * @description Returns the public keys used to verify JWT tokens issued by this environment. Authenticate using either x-api-key header (secretKey) or x-blimu-publishable-key header (publishableKey).*/
34
+ getJwks(init) {
35
+ return this.core.request({
36
+ method: "GET",
37
+ path: `/v1/auth/.well-known/jwks.json`,
38
+ ...init ?? {}
39
+ });
40
+ }
41
+ /**
42
+ * GET /v1/auth/.well-known/public-key.pem*
43
+ * @summary Get environment public key (PEM)*
44
+ * @description Returns the public key in PEM format for verifying JWT tokens. Authenticate with x-api-key or x-blimu-publishable-key.*/
45
+ getPublicKeyPem(init) {
46
+ return this.core.request({
47
+ method: "GET",
48
+ path: `/v1/auth/.well-known/public-key.pem`,
49
+ ...init ?? {}
50
+ });
51
+ }
52
+ /**
53
+ * GET /v1/auth/oauth/.well-known/jwks.json*
54
+ * @summary Get JSON Web Key Set for OAuth app (Public)*
55
+ * @description Returns the public key for a specific OAuth app to verify JWT tokens. This is a public endpoint following OAuth2/OIDC standards. Provide client_id to get keys for a specific OAuth app, or use authenticated endpoint for environment keys.*/
56
+ getOAuthAppJwks(query, init) {
57
+ return this.core.request({
58
+ method: "GET",
59
+ path: `/v1/auth/oauth/.well-known/jwks.json`,
60
+ query,
61
+ ...init ?? {}
62
+ });
63
+ }
64
+ };
65
+ // Annotate the CommonJS export names for ESM import in node:
66
+ 0 && (module.exports = {
67
+ AuthJwksService
68
+ });
69
+ //# sourceMappingURL=auth_jwks.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/services/auth_jwks.ts"],"sourcesContent":["import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\n\nexport class AuthJwksService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/auth/.well-known/jwks.json*\n * @summary Get JSON Web Key Set for environment (Public)*\n * @description Returns the public keys used to verify JWT tokens issued by this environment. Authenticate using either x-api-key header (secretKey) or x-blimu-publishable-key header (publishableKey).*/\n getJwks(init?: Omit<RequestInit, 'method' | 'body'>): Promise<Schema.JWK> {\n return this.core.request({\n method: 'GET',\n path: `/v1/auth/.well-known/jwks.json`,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/auth/.well-known/public-key.pem*\n * @summary Get environment public key (PEM)*\n * @description Returns the public key in PEM format for verifying JWT tokens. Authenticate with x-api-key or x-blimu-publishable-key.*/\n getPublicKeyPem(init?: Omit<RequestInit, 'method' | 'body'>): Promise<unknown> {\n return this.core.request({\n method: 'GET',\n path: `/v1/auth/.well-known/public-key.pem`,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/auth/oauth/.well-known/jwks.json*\n * @summary Get JSON Web Key Set for OAuth app (Public)*\n * @description Returns the public key for a specific OAuth app to verify JWT tokens. This is a public endpoint following OAuth2/OIDC standards. Provide client_id to get keys for a specific OAuth app, or use authenticated endpoint for environment keys.*/\n getOAuthAppJwks(\n query?: Schema.AuthJwksGetOAuthAppJwksQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.JWK> {\n return this.core.request({\n method: 'GET',\n path: `/v1/auth/oauth/.well-known/jwks.json`,\n query,\n ...(init ?? {}),\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,IAAM,kBAAN,MAAsB;AAAA,EAC3B,YAAoB,MAAmB;AAAnB;AAAA,EAAoB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMxC,QAAQ,MAAkE;AACxE,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,gBAAgB,MAA+D;AAC7E,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,gBACE,OACA,MACqB;AACrB,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,13 @@
1
+ import { FetchClient } from '@blimu/fetch';
2
+ import { J as JWK, A as AuthJwksGetOAuthAppJwksQuery } from '../schema-CdEZKE7E.mjs';
3
+ import '@blimu/types';
4
+
5
+ declare class AuthJwksService {
6
+ private core;
7
+ constructor(core: FetchClient);
8
+ getJwks(init?: Omit<RequestInit, 'method' | 'body'>): Promise<JWK>;
9
+ getPublicKeyPem(init?: Omit<RequestInit, 'method' | 'body'>): Promise<unknown>;
10
+ getOAuthAppJwks(query?: AuthJwksGetOAuthAppJwksQuery, init?: Omit<RequestInit, 'method' | 'body'>): Promise<JWK>;
11
+ }
12
+
13
+ export { AuthJwksService };
@@ -0,0 +1,13 @@
1
+ import { FetchClient } from '@blimu/fetch';
2
+ import { J as JWK, A as AuthJwksGetOAuthAppJwksQuery } from '../schema-CdEZKE7E.js';
3
+ import '@blimu/types';
4
+
5
+ declare class AuthJwksService {
6
+ private core;
7
+ constructor(core: FetchClient);
8
+ getJwks(init?: Omit<RequestInit, 'method' | 'body'>): Promise<JWK>;
9
+ getPublicKeyPem(init?: Omit<RequestInit, 'method' | 'body'>): Promise<unknown>;
10
+ getOAuthAppJwks(query?: AuthJwksGetOAuthAppJwksQuery, init?: Omit<RequestInit, 'method' | 'body'>): Promise<JWK>;
11
+ }
12
+
13
+ export { AuthJwksService };