@blimu/backend 1.2.0 → 1.2.1
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.
- package/README.md +58 -58
- package/dist/client.cjs +121 -14
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.mts +34 -2
- package/dist/client.d.ts +34 -2
- package/dist/client.mjs +118 -11
- package/dist/client.mjs.map +1 -1
- package/dist/index.cjs +431 -146
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +236 -92
- package/dist/index.d.ts +236 -92
- package/dist/index.mjs +420 -135
- package/dist/index.mjs.map +1 -1
- package/dist/{schema-BbKn_i-U.d.mts → schema-CGYqiv8k.d.mts} +147 -39
- package/dist/{schema-BbKn_i-U.d.ts → schema-CGYqiv8k.d.ts} +147 -39
- package/dist/schema.cjs.map +1 -1
- package/dist/schema.d.mts +2 -1
- package/dist/schema.d.ts +2 -1
- package/dist/services/bulk_resources.cjs +47 -0
- package/dist/services/bulk_resources.cjs.map +1 -0
- package/dist/services/bulk_resources.d.mts +11 -0
- package/dist/services/bulk_resources.d.ts +11 -0
- package/dist/services/bulk_resources.mjs +22 -0
- package/dist/services/bulk_resources.mjs.map +1 -0
- package/dist/services/bulk_roles.cjs +47 -0
- package/dist/services/bulk_roles.cjs.map +1 -0
- package/dist/services/bulk_roles.d.mts +11 -0
- package/dist/services/bulk_roles.d.ts +11 -0
- package/dist/services/bulk_roles.mjs +22 -0
- package/dist/services/bulk_roles.mjs.map +1 -0
- package/dist/services/entitlements.cjs +71 -0
- package/dist/services/entitlements.cjs.map +1 -0
- package/dist/services/entitlements.d.mts +13 -0
- package/dist/services/entitlements.d.ts +13 -0
- package/dist/services/entitlements.mjs +46 -0
- package/dist/services/entitlements.mjs.map +1 -0
- package/dist/services/oauth.cjs +142 -0
- package/dist/services/oauth.cjs.map +1 -0
- package/dist/services/oauth.d.mts +19 -0
- package/dist/services/oauth.d.ts +19 -0
- package/dist/services/oauth.mjs +117 -0
- package/dist/services/oauth.mjs.map +1 -0
- package/dist/services/plans.cjs +69 -0
- package/dist/services/plans.cjs.map +1 -0
- package/dist/services/plans.d.mts +13 -0
- package/dist/services/plans.d.ts +13 -0
- package/dist/services/plans.mjs +44 -0
- package/dist/services/plans.mjs.map +1 -0
- package/dist/services/resource_members.cjs +47 -0
- package/dist/services/resource_members.cjs.map +1 -0
- package/dist/services/resource_members.d.mts +11 -0
- package/dist/services/resource_members.d.ts +11 -0
- package/dist/services/resource_members.mjs +22 -0
- package/dist/services/resource_members.mjs.map +1 -0
- package/dist/services/resources.cjs +93 -0
- package/dist/services/resources.cjs.map +1 -0
- package/dist/services/resources.d.mts +15 -0
- package/dist/services/resources.d.ts +15 -0
- package/dist/services/resources.mjs +68 -0
- package/dist/services/resources.mjs.map +1 -0
- package/dist/services/roles.cjs +70 -0
- package/dist/services/roles.cjs.map +1 -0
- package/dist/services/roles.d.mts +13 -0
- package/dist/services/roles.d.ts +13 -0
- package/dist/services/roles.mjs +45 -0
- package/dist/services/roles.mjs.map +1 -0
- package/dist/services/usage.cjs +95 -0
- package/dist/services/usage.cjs.map +1 -0
- package/dist/services/usage.d.mts +15 -0
- package/dist/services/usage.d.ts +15 -0
- package/dist/services/usage.mjs +70 -0
- package/dist/services/usage.mjs.map +1 -0
- package/dist/services/users.cjs +104 -0
- package/dist/services/users.cjs.map +1 -0
- package/dist/services/users.d.mts +16 -0
- package/dist/services/users.d.ts +16 -0
- package/dist/services/users.mjs +79 -0
- package/dist/services/users.mjs.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -4
- package/dist/client-B-ZYoU15.d.mts +0 -95
- package/dist/client-GKBT3WCg.d.ts +0 -95
package/dist/index.cjs
CHANGED
|
@@ -29,14 +29,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
29
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
30
|
|
|
31
31
|
// src/index.ts
|
|
32
|
-
var
|
|
33
|
-
__export(
|
|
32
|
+
var index_exports = {};
|
|
33
|
+
__export(index_exports, {
|
|
34
34
|
Blimu: () => Blimu,
|
|
35
35
|
BlimuError: () => BlimuError,
|
|
36
36
|
BulkResourcesService: () => BulkResourcesService,
|
|
37
37
|
BulkRolesService: () => BulkRolesService,
|
|
38
38
|
EntitlementsService: () => EntitlementsService,
|
|
39
|
-
FetchError: () =>
|
|
39
|
+
FetchError: () => import_fetch.FetchError,
|
|
40
40
|
PlansService: () => PlansService,
|
|
41
41
|
ResourceMembersService: () => ResourceMembersService,
|
|
42
42
|
ResourcesService: () => ResourcesService,
|
|
@@ -49,15 +49,15 @@ __export(src_exports, {
|
|
|
49
49
|
isNotUndefined: () => isNotUndefined,
|
|
50
50
|
listAll: () => listAll,
|
|
51
51
|
paginate: () => paginate,
|
|
52
|
-
parseNDJSONStream: () =>
|
|
53
|
-
parseSSEStream: () =>
|
|
52
|
+
parseNDJSONStream: () => import_fetch3.parseNDJSONStream,
|
|
53
|
+
parseSSEStream: () => import_fetch3.parseSSEStream,
|
|
54
54
|
verifyToken: () => verifyToken
|
|
55
55
|
});
|
|
56
|
-
module.exports = __toCommonJS(
|
|
56
|
+
module.exports = __toCommonJS(index_exports);
|
|
57
57
|
|
|
58
58
|
// src/client.ts
|
|
59
|
-
var
|
|
60
|
-
var
|
|
59
|
+
var import_fetch = require("@blimu/fetch");
|
|
60
|
+
var import_fetch2 = require("@blimu/fetch");
|
|
61
61
|
|
|
62
62
|
// src/auth-strategies.ts
|
|
63
63
|
function buildAuthStrategies(cfg) {
|
|
@@ -73,12 +73,6 @@ function buildAuthStrategies(cfg) {
|
|
|
73
73
|
return authStrategies;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
// src/services/bulk_resources.ts
|
|
77
|
-
var import_fetch = require("@blimu/fetch");
|
|
78
|
-
|
|
79
|
-
// src/schema.ts
|
|
80
|
-
var schema_exports = {};
|
|
81
|
-
|
|
82
76
|
// src/services/bulk_resources.ts
|
|
83
77
|
var BulkResourcesService = class {
|
|
84
78
|
constructor(core) {
|
|
@@ -99,7 +93,6 @@ var BulkResourcesService = class {
|
|
|
99
93
|
};
|
|
100
94
|
|
|
101
95
|
// src/services/bulk_roles.ts
|
|
102
|
-
var import_fetch2 = require("@blimu/fetch");
|
|
103
96
|
var BulkRolesService = class {
|
|
104
97
|
constructor(core) {
|
|
105
98
|
this.core = core;
|
|
@@ -119,7 +112,6 @@ var BulkRolesService = class {
|
|
|
119
112
|
};
|
|
120
113
|
|
|
121
114
|
// src/services/entitlements.ts
|
|
122
|
-
var import_fetch3 = require("@blimu/fetch");
|
|
123
115
|
var EntitlementsService = class {
|
|
124
116
|
constructor(core) {
|
|
125
117
|
this.core = core;
|
|
@@ -162,8 +154,121 @@ var EntitlementsService = class {
|
|
|
162
154
|
}
|
|
163
155
|
};
|
|
164
156
|
|
|
157
|
+
// src/services/oauth.ts
|
|
158
|
+
var OauthService = class {
|
|
159
|
+
constructor(core) {
|
|
160
|
+
this.core = core;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* GET /v1/oauth/authorize*
|
|
164
|
+
* @summary Check consent requirement*
|
|
165
|
+
* @description Checks if user consent is required for the OAuth2 app and requested scopes.*/
|
|
166
|
+
checkConsentRequired(query, init) {
|
|
167
|
+
return this.core.request({
|
|
168
|
+
method: "GET",
|
|
169
|
+
path: `/v1/oauth/authorize`,
|
|
170
|
+
query,
|
|
171
|
+
...init ?? {}
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* POST /v1/oauth/authorize*
|
|
176
|
+
* @summary Authorize OAuth2 application*
|
|
177
|
+
* @description Handles user consent approval/denial. Validates auto_approved flag against consent requirements.*/
|
|
178
|
+
authorize(body, init) {
|
|
179
|
+
return this.core.request({
|
|
180
|
+
method: "POST",
|
|
181
|
+
path: `/v1/oauth/authorize`,
|
|
182
|
+
body,
|
|
183
|
+
...init ?? {}
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* POST /v1/oauth/device/authorize*
|
|
188
|
+
* @summary Authorize or deny device code*
|
|
189
|
+
* @description Allows an authenticated user to authorize or deny a device code request. Requires valid user session.*/
|
|
190
|
+
authorizeDeviceCode(body, init) {
|
|
191
|
+
return this.core.request({
|
|
192
|
+
method: "POST",
|
|
193
|
+
path: `/v1/oauth/device/authorize`,
|
|
194
|
+
body,
|
|
195
|
+
...init ?? {}
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* POST /v1/oauth/device/code*
|
|
200
|
+
* @summary Request device authorization codes*
|
|
201
|
+
* @description Initiates device authorization flow. Returns device_code (for polling) and user_code (for user entry).*/
|
|
202
|
+
requestDeviceCode(body, init) {
|
|
203
|
+
return this.core.request({
|
|
204
|
+
method: "POST",
|
|
205
|
+
path: `/v1/oauth/device/code`,
|
|
206
|
+
body,
|
|
207
|
+
...init ?? {}
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* GET /v1/oauth/device/code/{user_code}*
|
|
212
|
+
* @summary Get device code information*
|
|
213
|
+
* @description Returns device code information including app name, scopes, and consent requirement status.*/
|
|
214
|
+
getDeviceCodeInfo(user_code, init) {
|
|
215
|
+
return this.core.request({
|
|
216
|
+
method: "GET",
|
|
217
|
+
path: `/v1/oauth/device/code/${encodeURIComponent(user_code)}`,
|
|
218
|
+
...init ?? {}
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* POST /v1/oauth/device/token*
|
|
223
|
+
* @summary Poll for device authorization tokens*
|
|
224
|
+
* @description Client polls this endpoint to exchange device_code for tokens once user has authorized.*/
|
|
225
|
+
exchangeDeviceCode(body, init) {
|
|
226
|
+
return this.core.request({
|
|
227
|
+
method: "POST",
|
|
228
|
+
path: `/v1/oauth/device/token`,
|
|
229
|
+
body,
|
|
230
|
+
...init ?? {}
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* POST /v1/oauth/introspect*
|
|
235
|
+
* @summary Introspect token*
|
|
236
|
+
* @description Validates a token and returns metadata. Requires client authentication.*/
|
|
237
|
+
introspect(body, init) {
|
|
238
|
+
return this.core.request({
|
|
239
|
+
method: "POST",
|
|
240
|
+
path: `/v1/oauth/introspect`,
|
|
241
|
+
body,
|
|
242
|
+
...init ?? {}
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* POST /v1/oauth/revoke*
|
|
247
|
+
* @summary Revoke token*
|
|
248
|
+
* @description Revokes an access or refresh token. Requires client authentication.*/
|
|
249
|
+
revoke(body, init) {
|
|
250
|
+
return this.core.request({
|
|
251
|
+
method: "POST",
|
|
252
|
+
path: `/v1/oauth/revoke`,
|
|
253
|
+
body,
|
|
254
|
+
...init ?? {}
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* POST /v1/oauth/token*
|
|
259
|
+
* @summary Token endpoint*
|
|
260
|
+
* @description Issues access and refresh tokens. Supports authorization_code and refresh_token (always available per OAuth2 spec).*/
|
|
261
|
+
token(body, init) {
|
|
262
|
+
return this.core.request({
|
|
263
|
+
method: "POST",
|
|
264
|
+
path: `/v1/oauth/token`,
|
|
265
|
+
body,
|
|
266
|
+
...init ?? {}
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
|
|
165
271
|
// src/services/plans.ts
|
|
166
|
-
var import_fetch4 = require("@blimu/fetch");
|
|
167
272
|
var PlansService = class {
|
|
168
273
|
constructor(core) {
|
|
169
274
|
this.core = core;
|
|
@@ -205,7 +310,6 @@ var PlansService = class {
|
|
|
205
310
|
};
|
|
206
311
|
|
|
207
312
|
// src/services/resource_members.ts
|
|
208
|
-
var import_fetch5 = require("@blimu/fetch");
|
|
209
313
|
var ResourceMembersService = class {
|
|
210
314
|
constructor(core) {
|
|
211
315
|
this.core = core;
|
|
@@ -225,7 +329,6 @@ var ResourceMembersService = class {
|
|
|
225
329
|
};
|
|
226
330
|
|
|
227
331
|
// src/services/resources.ts
|
|
228
|
-
var import_fetch6 = require("@blimu/fetch");
|
|
229
332
|
var ResourcesService = class {
|
|
230
333
|
constructor(core) {
|
|
231
334
|
this.core = core;
|
|
@@ -291,7 +394,6 @@ var ResourcesService = class {
|
|
|
291
394
|
};
|
|
292
395
|
|
|
293
396
|
// src/services/roles.ts
|
|
294
|
-
var import_fetch7 = require("@blimu/fetch");
|
|
295
397
|
var RolesService = class {
|
|
296
398
|
constructor(core) {
|
|
297
399
|
this.core = core;
|
|
@@ -334,7 +436,6 @@ var RolesService = class {
|
|
|
334
436
|
};
|
|
335
437
|
|
|
336
438
|
// src/services/usage.ts
|
|
337
|
-
var import_fetch8 = require("@blimu/fetch");
|
|
338
439
|
var UsageService = class {
|
|
339
440
|
constructor(core) {
|
|
340
441
|
this.core = core;
|
|
@@ -402,7 +503,6 @@ var UsageService = class {
|
|
|
402
503
|
};
|
|
403
504
|
|
|
404
505
|
// src/services/users.ts
|
|
405
|
-
var import_fetch9 = require("@blimu/fetch");
|
|
406
506
|
var UsersService = class {
|
|
407
507
|
constructor(core) {
|
|
408
508
|
this.core = core;
|
|
@@ -483,6 +583,7 @@ var Blimu = class {
|
|
|
483
583
|
bulkResources;
|
|
484
584
|
bulkRoles;
|
|
485
585
|
entitlements;
|
|
586
|
+
oauth;
|
|
486
587
|
plans;
|
|
487
588
|
resourceMembers;
|
|
488
589
|
resources;
|
|
@@ -493,7 +594,7 @@ var Blimu = class {
|
|
|
493
594
|
const restCfg = { ...options ?? {} };
|
|
494
595
|
delete restCfg.apiKey;
|
|
495
596
|
const authStrategies = buildAuthStrategies(options ?? {});
|
|
496
|
-
const core = new
|
|
597
|
+
const core = new import_fetch.FetchClient({
|
|
497
598
|
...restCfg,
|
|
498
599
|
baseURL: options?.baseURL ?? "https://api.blimu.dev",
|
|
499
600
|
...authStrategies.length > 0 ? { authStrategies } : {}
|
|
@@ -501,6 +602,7 @@ var Blimu = class {
|
|
|
501
602
|
this.bulkResources = new BulkResourcesService(core);
|
|
502
603
|
this.bulkRoles = new BulkRolesService(core);
|
|
503
604
|
this.entitlements = new EntitlementsService(core);
|
|
605
|
+
this.oauth = new OauthService(core);
|
|
504
606
|
this.plans = new PlansService(core);
|
|
505
607
|
this.resourceMembers = new ResourceMembersService(core);
|
|
506
608
|
this.resources = new ResourcesService(core);
|
|
@@ -509,13 +611,13 @@ var Blimu = class {
|
|
|
509
611
|
this.users = new UsersService(core);
|
|
510
612
|
}
|
|
511
613
|
};
|
|
512
|
-
var BlimuError =
|
|
614
|
+
var BlimuError = import_fetch.FetchError;
|
|
513
615
|
|
|
514
616
|
// src/index.ts
|
|
515
|
-
__reExport(
|
|
617
|
+
__reExport(index_exports, require("@blimu/fetch"), module.exports);
|
|
516
618
|
|
|
517
619
|
// src/utils.ts
|
|
518
|
-
var
|
|
620
|
+
var import_fetch3 = require("@blimu/fetch");
|
|
519
621
|
async function* paginate(fetchPage, initialQuery = {}, pageSize = 100) {
|
|
520
622
|
let offset = Number(initialQuery.offset ?? 0);
|
|
521
623
|
const limit = Number(initialQuery.limit ?? pageSize);
|
|
@@ -541,19 +643,35 @@ function isNotUndefined(arr) {
|
|
|
541
643
|
);
|
|
542
644
|
}
|
|
543
645
|
|
|
646
|
+
// src/schema.ts
|
|
647
|
+
var schema_exports = {};
|
|
648
|
+
|
|
544
649
|
// src/schema.zod.ts
|
|
545
650
|
var schema_zod_exports = {};
|
|
546
651
|
__export(schema_zod_exports, {
|
|
652
|
+
AuthorizeRequestSchema: () => AuthorizeRequestSchema,
|
|
547
653
|
BalanceResponseSchema: () => BalanceResponseSchema,
|
|
548
654
|
CheckLimitResponseSchema: () => CheckLimitResponseSchema,
|
|
655
|
+
ConsentCheckResponseSchema: () => ConsentCheckResponseSchema,
|
|
656
|
+
DeviceAuthorizeRequestSchema: () => DeviceAuthorizeRequestSchema,
|
|
657
|
+
DeviceAuthorizeResponseSchema: () => DeviceAuthorizeResponseSchema,
|
|
658
|
+
DeviceCodeInfoResponseSchema: () => DeviceCodeInfoResponseSchema,
|
|
659
|
+
DeviceCodeRequestSchema: () => DeviceCodeRequestSchema,
|
|
660
|
+
DeviceCodeResponseSchema: () => DeviceCodeResponseSchema,
|
|
661
|
+
DeviceTokenRequestSchema: () => DeviceTokenRequestSchema,
|
|
549
662
|
EntitlementCheckBodySchema: () => EntitlementCheckBodySchema,
|
|
550
663
|
EntitlementCheckResultSchema: () => EntitlementCheckResultSchema,
|
|
664
|
+
EntitlementTypeSchema: () => EntitlementTypeSchema,
|
|
551
665
|
EntitlementsListForResourceQuerySchema: () => EntitlementsListForResourceQuerySchema,
|
|
552
666
|
EntitlementsListForTenantQuerySchema: () => EntitlementsListForTenantQuerySchema,
|
|
553
667
|
EntitlementsListResultSchema: () => EntitlementsListResultSchema,
|
|
668
|
+
IntrospectionRequestSchema: () => IntrospectionRequestSchema,
|
|
669
|
+
IntrospectionResponseSchema: () => IntrospectionResponseSchema,
|
|
670
|
+
OauthCheckConsentRequiredQuerySchema: () => OauthCheckConsentRequiredQuerySchema,
|
|
554
671
|
PlanAssignBodySchema: () => PlanAssignBodySchema,
|
|
555
672
|
PlanDeleteResponseSchema: () => PlanDeleteResponseSchema,
|
|
556
673
|
PlanResponseSchema: () => PlanResponseSchema,
|
|
674
|
+
PlanTypeSchema: () => PlanTypeSchema,
|
|
557
675
|
ResourceBulkCreateBodySchema: () => ResourceBulkCreateBodySchema,
|
|
558
676
|
ResourceBulkResultSchema: () => ResourceBulkResultSchema,
|
|
559
677
|
ResourceCreateBodySchema: () => ResourceCreateBodySchema,
|
|
@@ -561,20 +679,25 @@ __export(schema_zod_exports, {
|
|
|
561
679
|
ResourceMemberListSchema: () => ResourceMemberListSchema,
|
|
562
680
|
ResourceMembersListQuerySchema: () => ResourceMembersListQuerySchema,
|
|
563
681
|
ResourceSchema: () => ResourceSchema,
|
|
682
|
+
ResourceTypeSchema: () => ResourceTypeSchema,
|
|
564
683
|
ResourceUpdateBodySchema: () => ResourceUpdateBodySchema,
|
|
565
684
|
ResourcesListQuerySchema: () => ResourcesListQuerySchema,
|
|
685
|
+
RevocationRequestSchema: () => RevocationRequestSchema,
|
|
566
686
|
RoleBulkCreateBodySchema: () => RoleBulkCreateBodySchema,
|
|
567
687
|
RoleBulkResultSchema: () => RoleBulkResultSchema,
|
|
568
688
|
RoleCreateBodySchema: () => RoleCreateBodySchema,
|
|
569
689
|
RoleListSchema: () => RoleListSchema,
|
|
570
690
|
RoleSchema: () => RoleSchema,
|
|
571
691
|
RolesListQuerySchema: () => RolesListQuerySchema,
|
|
692
|
+
TokenRequestSchema: () => TokenRequestSchema,
|
|
693
|
+
TokenResponseSchema: () => TokenResponseSchema,
|
|
572
694
|
TransactionHistoryResponseSchema: () => TransactionHistoryResponseSchema,
|
|
573
695
|
UsageCheckBodySchema: () => UsageCheckBodySchema,
|
|
574
696
|
UsageConsumeBodySchema: () => UsageConsumeBodySchema,
|
|
575
697
|
UsageCreditBodySchema: () => UsageCreditBodySchema,
|
|
576
698
|
UsageGetBalanceQuerySchema: () => UsageGetBalanceQuerySchema,
|
|
577
699
|
UsageGetTransactionHistoryQuerySchema: () => UsageGetTransactionHistoryQuerySchema,
|
|
700
|
+
UsageLimitTypeSchema: () => UsageLimitTypeSchema,
|
|
578
701
|
UsageWalletResponseSchema: () => UsageWalletResponseSchema,
|
|
579
702
|
UserCreateBodySchema: () => UserCreateBodySchema,
|
|
580
703
|
UserListSchema: () => UserListSchema,
|
|
@@ -584,6 +707,32 @@ __export(schema_zod_exports, {
|
|
|
584
707
|
UsersListQuerySchema: () => UsersListQuerySchema
|
|
585
708
|
});
|
|
586
709
|
var import_zod = require("zod");
|
|
710
|
+
var EntitlementTypeSchema = import_zod.z.string();
|
|
711
|
+
var PlanTypeSchema = import_zod.z.string();
|
|
712
|
+
var ResourceTypeSchema = import_zod.z.string();
|
|
713
|
+
var UsageLimitTypeSchema = import_zod.z.string();
|
|
714
|
+
var AuthorizeRequestSchema = import_zod.z.object({
|
|
715
|
+
/** Action to take: allow or deny */
|
|
716
|
+
action: import_zod.z.enum(["allow", "deny"]),
|
|
717
|
+
/** True if consent was auto-approved (not required or previously granted) */
|
|
718
|
+
auto_approved: import_zod.z.boolean().optional(),
|
|
719
|
+
/** OAuth2 client ID */
|
|
720
|
+
client_id: import_zod.z.string(),
|
|
721
|
+
/** PKCE code challenge */
|
|
722
|
+
code_challenge: import_zod.z.string().optional(),
|
|
723
|
+
/** PKCE code challenge method */
|
|
724
|
+
code_challenge_method: import_zod.z.string().optional(),
|
|
725
|
+
/** Redirect URI */
|
|
726
|
+
redirect_uri: import_zod.z.string(),
|
|
727
|
+
/** Response type (typically "code") */
|
|
728
|
+
response_type: import_zod.z.string(),
|
|
729
|
+
/** Space-separated list of scopes */
|
|
730
|
+
scope: import_zod.z.string().optional(),
|
|
731
|
+
/** State parameter for CSRF protection */
|
|
732
|
+
state: import_zod.z.string().optional(),
|
|
733
|
+
/** True if user explicitly clicked Allow, false if auto-approved */
|
|
734
|
+
user_action: import_zod.z.boolean().optional()
|
|
735
|
+
});
|
|
587
736
|
var BalanceResponseSchema = import_zod.z.object({ balance: import_zod.z.number() });
|
|
588
737
|
var CheckLimitResponseSchema = import_zod.z.object({
|
|
589
738
|
allowed: import_zod.z.boolean(),
|
|
@@ -591,9 +740,206 @@ var CheckLimitResponseSchema = import_zod.z.object({
|
|
|
591
740
|
remaining: import_zod.z.number().optional(),
|
|
592
741
|
requested: import_zod.z.number()
|
|
593
742
|
});
|
|
743
|
+
var ConsentCheckResponseSchema = import_zod.z.object({
|
|
744
|
+
/** Whether user consent is required */
|
|
745
|
+
consent_required: import_zod.z.boolean(),
|
|
746
|
+
/** Whether consent was previously granted for this app and scopes */
|
|
747
|
+
previously_granted: import_zod.z.boolean()
|
|
748
|
+
});
|
|
749
|
+
var DeviceAuthorizeRequestSchema = import_zod.z.object({
|
|
750
|
+
/** Action to take: allow or deny */
|
|
751
|
+
action: import_zod.z.enum(["allow", "deny"]),
|
|
752
|
+
/** True if consent was auto-approved (not required or previously granted) */
|
|
753
|
+
auto_approved: import_zod.z.boolean().optional(),
|
|
754
|
+
/** True if user explicitly clicked Allow, false if auto-approved */
|
|
755
|
+
user_action: import_zod.z.boolean().optional(),
|
|
756
|
+
/** The user code displayed to the user */
|
|
757
|
+
user_code: import_zod.z.string()
|
|
758
|
+
});
|
|
759
|
+
var DeviceAuthorizeResponseSchema = import_zod.z.object({
|
|
760
|
+
/** Whether the authorization was successful */
|
|
761
|
+
success: import_zod.z.boolean()
|
|
762
|
+
});
|
|
763
|
+
var DeviceCodeInfoResponseSchema = import_zod.z.object({
|
|
764
|
+
/** The name of the OAuth2 application */
|
|
765
|
+
appName: import_zod.z.string(),
|
|
766
|
+
/** Whether the user has already granted consent for this app and scopes */
|
|
767
|
+
previouslyGranted: import_zod.z.boolean(),
|
|
768
|
+
/** Whether the app requires user consent */
|
|
769
|
+
requireConsent: import_zod.z.boolean(),
|
|
770
|
+
/** The scopes requested by the device code */
|
|
771
|
+
scopes: import_zod.z.string().array()
|
|
772
|
+
});
|
|
773
|
+
var DeviceCodeRequestSchema = import_zod.z.object({
|
|
774
|
+
/** OAuth2 client ID */
|
|
775
|
+
client_id: import_zod.z.string(),
|
|
776
|
+
/** PKCE code challenge (base64url encoded SHA256 hash) */
|
|
777
|
+
code_challenge: import_zod.z.string().optional(),
|
|
778
|
+
/** PKCE code challenge method */
|
|
779
|
+
code_challenge_method: import_zod.z.enum(["S256", "plain"]).optional(),
|
|
780
|
+
/** Space-separated list of scopes */
|
|
781
|
+
scope: import_zod.z.string().optional()
|
|
782
|
+
});
|
|
783
|
+
var DeviceCodeResponseSchema = import_zod.z.object({
|
|
784
|
+
/** Device verification code (for polling) */
|
|
785
|
+
device_code: import_zod.z.string(),
|
|
786
|
+
/** Device code expiration time in seconds */
|
|
787
|
+
expires_in: import_zod.z.number(),
|
|
788
|
+
/** Minimum polling interval in seconds */
|
|
789
|
+
interval: import_zod.z.number(),
|
|
790
|
+
/** User verification code (short, human-readable) */
|
|
791
|
+
user_code: import_zod.z.string(),
|
|
792
|
+
/** Verification URI for user */
|
|
793
|
+
verification_uri: import_zod.z.string(),
|
|
794
|
+
/** Complete verification URI with user code */
|
|
795
|
+
verification_uri_complete: import_zod.z.string()
|
|
796
|
+
});
|
|
797
|
+
var DeviceTokenRequestSchema = import_zod.z.object({
|
|
798
|
+
/** OAuth2 client ID */
|
|
799
|
+
client_id: import_zod.z.string(),
|
|
800
|
+
/** PKCE code verifier (if challenge was provided) */
|
|
801
|
+
code_verifier: import_zod.z.string().optional(),
|
|
802
|
+
/** Device code from authorization response */
|
|
803
|
+
device_code: import_zod.z.string(),
|
|
804
|
+
/** Grant type (must be device_code) */
|
|
805
|
+
grant_type: import_zod.z.enum([
|
|
806
|
+
"urn:ietf:params:oauth:grant-type:device_code"
|
|
807
|
+
])
|
|
808
|
+
});
|
|
809
|
+
var IntrospectionRequestSchema = import_zod.z.object({
|
|
810
|
+
/** The token to introspect */
|
|
811
|
+
token: import_zod.z.string(),
|
|
812
|
+
/** Hint about token type */
|
|
813
|
+
token_type_hint: import_zod.z.enum(["access_token", "refresh_token"]).optional()
|
|
814
|
+
});
|
|
815
|
+
var IntrospectionResponseSchema = import_zod.z.object({
|
|
816
|
+
/** Whether the token is active */
|
|
817
|
+
active: import_zod.z.boolean(),
|
|
818
|
+
/** Client ID */
|
|
819
|
+
client_id: import_zod.z.string().optional(),
|
|
820
|
+
/** Environment ID */
|
|
821
|
+
environment_id: import_zod.z.string().optional(),
|
|
822
|
+
/** Token expiration timestamp */
|
|
823
|
+
exp: import_zod.z.number().optional(),
|
|
824
|
+
/** Token issued at timestamp */
|
|
825
|
+
iat: import_zod.z.number().optional(),
|
|
826
|
+
/** Space-separated list of scopes */
|
|
827
|
+
scope: import_zod.z.string().optional(),
|
|
828
|
+
/** Subject (user ID) */
|
|
829
|
+
sub: import_zod.z.string().optional(),
|
|
830
|
+
/** Token type */
|
|
831
|
+
token_type: import_zod.z.string().optional(),
|
|
832
|
+
/** Username or user ID */
|
|
833
|
+
username: import_zod.z.string().optional()
|
|
834
|
+
});
|
|
835
|
+
var PlanDeleteResponseSchema = import_zod.z.object({ success: import_zod.z.boolean() });
|
|
836
|
+
var ResourceMemberListSchema = import_zod.z.object({
|
|
837
|
+
items: import_zod.z.object({
|
|
838
|
+
inherited: import_zod.z.boolean(),
|
|
839
|
+
role: import_zod.z.string(),
|
|
840
|
+
user: import_zod.z.object({
|
|
841
|
+
avatarUrl: import_zod.z.string().nullable(),
|
|
842
|
+
createdAt: import_zod.z.iso.datetime(),
|
|
843
|
+
email: import_zod.z.email(),
|
|
844
|
+
emailVerified: import_zod.z.boolean(),
|
|
845
|
+
firstName: import_zod.z.string().nullable(),
|
|
846
|
+
id: import_zod.z.string(),
|
|
847
|
+
lastLoginAt: import_zod.z.iso.datetime().nullable(),
|
|
848
|
+
lastName: import_zod.z.string().nullable(),
|
|
849
|
+
lookupKey: import_zod.z.string().nullable(),
|
|
850
|
+
updatedAt: import_zod.z.iso.datetime()
|
|
851
|
+
}),
|
|
852
|
+
userId: import_zod.z.string()
|
|
853
|
+
}).array(),
|
|
854
|
+
limit: import_zod.z.number(),
|
|
855
|
+
page: import_zod.z.number(),
|
|
856
|
+
total: import_zod.z.number()
|
|
857
|
+
});
|
|
858
|
+
var RevocationRequestSchema = import_zod.z.object({
|
|
859
|
+
/** The token to revoke */
|
|
860
|
+
token: import_zod.z.string(),
|
|
861
|
+
/** Hint about token type */
|
|
862
|
+
token_type_hint: import_zod.z.enum(["access_token", "refresh_token"]).optional()
|
|
863
|
+
});
|
|
864
|
+
var TokenRequestSchema = import_zod.z.object({
|
|
865
|
+
/** OAuth2 client ID */
|
|
866
|
+
client_id: import_zod.z.string(),
|
|
867
|
+
/** OAuth2 client secret (required for confidential clients) */
|
|
868
|
+
client_secret: import_zod.z.string().optional(),
|
|
869
|
+
/** Authorization code (required for authorization_code grant) */
|
|
870
|
+
code: import_zod.z.string().optional(),
|
|
871
|
+
/** PKCE code verifier (if challenge was provided) */
|
|
872
|
+
code_verifier: import_zod.z.string().optional(),
|
|
873
|
+
/** OAuth2 grant type */
|
|
874
|
+
grant_type: import_zod.z.enum(["authorization_code", "refresh_token"]),
|
|
875
|
+
/** Redirect URI (required for authorization_code grant) */
|
|
876
|
+
redirect_uri: import_zod.z.string().optional(),
|
|
877
|
+
/** Refresh token (required for refresh_token grant) */
|
|
878
|
+
refresh_token: import_zod.z.string().optional(),
|
|
879
|
+
/** Space-separated list of scopes (optional for refresh) */
|
|
880
|
+
scope: import_zod.z.string().optional()
|
|
881
|
+
});
|
|
882
|
+
var TokenResponseSchema = import_zod.z.object({
|
|
883
|
+
/** Access token (JWT) */
|
|
884
|
+
access_token: import_zod.z.string(),
|
|
885
|
+
/** Access token expiration time in seconds */
|
|
886
|
+
expires_in: import_zod.z.number(),
|
|
887
|
+
/** Refresh token (for obtaining new access tokens) */
|
|
888
|
+
refresh_token: import_zod.z.string(),
|
|
889
|
+
/** Space-separated list of granted scopes */
|
|
890
|
+
scope: import_zod.z.string().optional(),
|
|
891
|
+
/** Token type */
|
|
892
|
+
token_type: import_zod.z.string()
|
|
893
|
+
});
|
|
894
|
+
var UserSchema = import_zod.z.object({
|
|
895
|
+
avatarUrl: import_zod.z.string().nullable(),
|
|
896
|
+
createdAt: import_zod.z.iso.datetime(),
|
|
897
|
+
email: import_zod.z.email(),
|
|
898
|
+
emailVerified: import_zod.z.boolean(),
|
|
899
|
+
firstName: import_zod.z.string().nullable(),
|
|
900
|
+
id: import_zod.z.string(),
|
|
901
|
+
lastLoginAt: import_zod.z.iso.datetime().nullable(),
|
|
902
|
+
lastName: import_zod.z.string().nullable(),
|
|
903
|
+
lookupKey: import_zod.z.string().nullable(),
|
|
904
|
+
updatedAt: import_zod.z.iso.datetime()
|
|
905
|
+
});
|
|
906
|
+
var UserCreateBodySchema = import_zod.z.object({
|
|
907
|
+
avatarUrl: import_zod.z.url().optional(),
|
|
908
|
+
email: import_zod.z.email(),
|
|
909
|
+
firstName: import_zod.z.string().nullable().optional(),
|
|
910
|
+
lastName: import_zod.z.string().nullable().optional(),
|
|
911
|
+
lookupKey: import_zod.z.string(),
|
|
912
|
+
newUser: import_zod.z.boolean().nullable().optional(),
|
|
913
|
+
password: import_zod.z.string().nullable().optional()
|
|
914
|
+
});
|
|
915
|
+
var UserListSchema = import_zod.z.object({
|
|
916
|
+
items: import_zod.z.object({
|
|
917
|
+
avatarUrl: import_zod.z.string().nullable(),
|
|
918
|
+
createdAt: import_zod.z.iso.datetime(),
|
|
919
|
+
email: import_zod.z.email(),
|
|
920
|
+
emailVerified: import_zod.z.boolean(),
|
|
921
|
+
firstName: import_zod.z.string().nullable(),
|
|
922
|
+
id: import_zod.z.string(),
|
|
923
|
+
lastLoginAt: import_zod.z.iso.datetime().nullable(),
|
|
924
|
+
lastName: import_zod.z.string().nullable(),
|
|
925
|
+
lookupKey: import_zod.z.string().nullable(),
|
|
926
|
+
updatedAt: import_zod.z.iso.datetime()
|
|
927
|
+
}).array(),
|
|
928
|
+
limit: import_zod.z.number(),
|
|
929
|
+
page: import_zod.z.number(),
|
|
930
|
+
total: import_zod.z.number()
|
|
931
|
+
});
|
|
932
|
+
var UserUpdateBodySchema = import_zod.z.object({
|
|
933
|
+
avatarUrl: import_zod.z.url().nullable().optional(),
|
|
934
|
+
email: import_zod.z.email().optional(),
|
|
935
|
+
firstName: import_zod.z.string().nullable().optional(),
|
|
936
|
+
lastName: import_zod.z.string().nullable().optional(),
|
|
937
|
+
lookupKey: import_zod.z.string().optional(),
|
|
938
|
+
password: import_zod.z.string().optional()
|
|
939
|
+
});
|
|
594
940
|
var EntitlementCheckBodySchema = import_zod.z.object({
|
|
595
941
|
amount: import_zod.z.number().int().optional(),
|
|
596
|
-
entitlement:
|
|
942
|
+
entitlement: EntitlementTypeSchema,
|
|
597
943
|
resourceId: import_zod.z.string(),
|
|
598
944
|
userId: import_zod.z.string()
|
|
599
945
|
});
|
|
@@ -603,15 +949,15 @@ var EntitlementCheckResultSchema = import_zod.z.object({
|
|
|
603
949
|
allowed: import_zod.z.boolean(),
|
|
604
950
|
current: import_zod.z.number().optional(),
|
|
605
951
|
limit: import_zod.z.number().optional(),
|
|
606
|
-
plan:
|
|
952
|
+
plan: PlanTypeSchema.optional(),
|
|
607
953
|
reason: import_zod.z.string().optional(),
|
|
608
954
|
remaining: import_zod.z.number().optional(),
|
|
609
955
|
scope: import_zod.z.string().optional()
|
|
610
956
|
}).nullable().optional(),
|
|
611
957
|
plans: import_zod.z.object({
|
|
612
958
|
allowed: import_zod.z.boolean(),
|
|
613
|
-
allowedPlans:
|
|
614
|
-
plan:
|
|
959
|
+
allowedPlans: PlanTypeSchema.array().optional(),
|
|
960
|
+
plan: PlanTypeSchema.optional(),
|
|
615
961
|
reason: import_zod.z.string().optional()
|
|
616
962
|
}).nullable().optional(),
|
|
617
963
|
roles: import_zod.z.object({
|
|
@@ -621,30 +967,29 @@ var EntitlementCheckResultSchema = import_zod.z.object({
|
|
|
621
967
|
userRoles: import_zod.z.string().array().optional()
|
|
622
968
|
}).nullable().optional()
|
|
623
969
|
});
|
|
970
|
+
var PlanAssignBodySchema = import_zod.z.object({ planKey: PlanTypeSchema });
|
|
624
971
|
var EntitlementsListResultSchema = import_zod.z.object({
|
|
625
972
|
results: import_zod.z.object({
|
|
626
973
|
entitlements: import_zod.z.object({
|
|
627
974
|
allowed: import_zod.z.boolean(),
|
|
628
975
|
allowedByPlan: import_zod.z.boolean(),
|
|
629
976
|
allowedByRole: import_zod.z.boolean(),
|
|
630
|
-
allowedPlans:
|
|
977
|
+
allowedPlans: PlanTypeSchema.array().optional(),
|
|
631
978
|
allowedRoles: import_zod.z.string().array(),
|
|
632
|
-
currentPlan:
|
|
979
|
+
currentPlan: PlanTypeSchema.optional(),
|
|
633
980
|
currentRole: import_zod.z.string().optional(),
|
|
634
|
-
entitlement:
|
|
981
|
+
entitlement: EntitlementTypeSchema
|
|
635
982
|
}).array(),
|
|
636
983
|
resourceId: import_zod.z.string(),
|
|
637
|
-
resourceType:
|
|
984
|
+
resourceType: ResourceTypeSchema
|
|
638
985
|
}).array()
|
|
639
986
|
});
|
|
640
|
-
var PlanAssignBodySchema = import_zod.z.object({ planKey: import_zod.z.string() });
|
|
641
|
-
var PlanDeleteResponseSchema = import_zod.z.object({ success: import_zod.z.boolean() });
|
|
642
987
|
var PlanResponseSchema = import_zod.z.object({
|
|
643
988
|
createdAt: import_zod.z.iso.datetime(),
|
|
644
989
|
environmentId: import_zod.z.string(),
|
|
645
|
-
planKey:
|
|
990
|
+
planKey: PlanTypeSchema,
|
|
646
991
|
resourceId: import_zod.z.string(),
|
|
647
|
-
resourceType:
|
|
992
|
+
resourceType: ResourceTypeSchema,
|
|
648
993
|
updatedAt: import_zod.z.iso.datetime()
|
|
649
994
|
});
|
|
650
995
|
var ResourceSchema = import_zod.z.object({
|
|
@@ -653,9 +998,9 @@ var ResourceSchema = import_zod.z.object({
|
|
|
653
998
|
name: import_zod.z.string().nullable(),
|
|
654
999
|
parents: import_zod.z.object({
|
|
655
1000
|
id: import_zod.z.string(),
|
|
656
|
-
type:
|
|
1001
|
+
type: ResourceTypeSchema
|
|
657
1002
|
}).array().optional(),
|
|
658
|
-
type:
|
|
1003
|
+
type: ResourceTypeSchema
|
|
659
1004
|
});
|
|
660
1005
|
var ResourceBulkCreateBodySchema = import_zod.z.object({
|
|
661
1006
|
resources: import_zod.z.object({
|
|
@@ -663,7 +1008,7 @@ var ResourceBulkCreateBodySchema = import_zod.z.object({
|
|
|
663
1008
|
name: import_zod.z.string().optional(),
|
|
664
1009
|
parents: import_zod.z.object({
|
|
665
1010
|
id: import_zod.z.string(),
|
|
666
|
-
type:
|
|
1011
|
+
type: ResourceTypeSchema
|
|
667
1012
|
}).array().optional(),
|
|
668
1013
|
roles: import_zod.z.object({
|
|
669
1014
|
role: import_zod.z.string(),
|
|
@@ -675,7 +1020,7 @@ var ResourceBulkResultSchema = import_zod.z.object({
|
|
|
675
1020
|
created: import_zod.z.object({
|
|
676
1021
|
environmentId: import_zod.z.string(),
|
|
677
1022
|
id: import_zod.z.string(),
|
|
678
|
-
type:
|
|
1023
|
+
type: ResourceTypeSchema
|
|
679
1024
|
}).array(),
|
|
680
1025
|
errors: import_zod.z.object({
|
|
681
1026
|
error: import_zod.z.string(),
|
|
@@ -685,7 +1030,7 @@ var ResourceBulkResultSchema = import_zod.z.object({
|
|
|
685
1030
|
name: import_zod.z.string().optional(),
|
|
686
1031
|
parents: import_zod.z.object({
|
|
687
1032
|
id: import_zod.z.string(),
|
|
688
|
-
type:
|
|
1033
|
+
type: ResourceTypeSchema
|
|
689
1034
|
}).array().optional(),
|
|
690
1035
|
roles: import_zod.z.object({
|
|
691
1036
|
role: import_zod.z.string(),
|
|
@@ -705,55 +1050,33 @@ var ResourceCreateBodySchema = import_zod.z.object({
|
|
|
705
1050
|
name: import_zod.z.string().optional(),
|
|
706
1051
|
parents: import_zod.z.object({
|
|
707
1052
|
id: import_zod.z.string(),
|
|
708
|
-
type:
|
|
1053
|
+
type: ResourceTypeSchema
|
|
709
1054
|
}).array().optional(),
|
|
710
1055
|
roles: import_zod.z.object({
|
|
711
1056
|
role: import_zod.z.string(),
|
|
712
1057
|
userId: import_zod.z.string()
|
|
713
1058
|
}).array().optional()
|
|
714
1059
|
});
|
|
715
|
-
var ResourceMemberListSchema = import_zod.z.object({
|
|
716
|
-
items: import_zod.z.object({
|
|
717
|
-
inherited: import_zod.z.boolean(),
|
|
718
|
-
role: import_zod.z.string(),
|
|
719
|
-
user: import_zod.z.object({
|
|
720
|
-
avatarUrl: import_zod.z.string().nullable(),
|
|
721
|
-
createdAt: import_zod.z.iso.datetime(),
|
|
722
|
-
email: import_zod.z.email(),
|
|
723
|
-
emailVerified: import_zod.z.boolean(),
|
|
724
|
-
firstName: import_zod.z.string().nullable(),
|
|
725
|
-
id: import_zod.z.string(),
|
|
726
|
-
lastLoginAt: import_zod.z.iso.datetime().nullable(),
|
|
727
|
-
lastName: import_zod.z.string().nullable(),
|
|
728
|
-
lookupKey: import_zod.z.string().nullable(),
|
|
729
|
-
updatedAt: import_zod.z.iso.datetime()
|
|
730
|
-
}),
|
|
731
|
-
userId: import_zod.z.string()
|
|
732
|
-
}).array(),
|
|
733
|
-
limit: import_zod.z.number(),
|
|
734
|
-
page: import_zod.z.number(),
|
|
735
|
-
total: import_zod.z.number()
|
|
736
|
-
});
|
|
737
1060
|
var ResourceUpdateBodySchema = import_zod.z.object({
|
|
738
1061
|
name: import_zod.z.string().optional(),
|
|
739
1062
|
/** Creates relationships with other resources. Parent resources must already exist. */
|
|
740
1063
|
parents: import_zod.z.object({
|
|
741
1064
|
id: import_zod.z.string(),
|
|
742
|
-
type:
|
|
1065
|
+
type: ResourceTypeSchema
|
|
743
1066
|
}).array().optional()
|
|
744
1067
|
});
|
|
745
1068
|
var RoleSchema = import_zod.z.object({
|
|
746
1069
|
createdAt: import_zod.z.string(),
|
|
747
1070
|
environmentId: import_zod.z.string(),
|
|
748
1071
|
resourceId: import_zod.z.string(),
|
|
749
|
-
resourceType:
|
|
1072
|
+
resourceType: ResourceTypeSchema,
|
|
750
1073
|
role: import_zod.z.string(),
|
|
751
1074
|
userId: import_zod.z.string()
|
|
752
1075
|
});
|
|
753
1076
|
var RoleBulkCreateBodySchema = import_zod.z.object({
|
|
754
1077
|
roles: import_zod.z.object({
|
|
755
1078
|
resourceId: import_zod.z.string(),
|
|
756
|
-
resourceType:
|
|
1079
|
+
resourceType: ResourceTypeSchema,
|
|
757
1080
|
role: import_zod.z.string(),
|
|
758
1081
|
userId: import_zod.z.string()
|
|
759
1082
|
}).array()
|
|
@@ -763,7 +1086,7 @@ var RoleBulkResultSchema = import_zod.z.object({
|
|
|
763
1086
|
createdAt: import_zod.z.string(),
|
|
764
1087
|
environmentId: import_zod.z.string(),
|
|
765
1088
|
resourceId: import_zod.z.string(),
|
|
766
|
-
resourceType:
|
|
1089
|
+
resourceType: ResourceTypeSchema,
|
|
767
1090
|
role: import_zod.z.string(),
|
|
768
1091
|
userId: import_zod.z.string()
|
|
769
1092
|
}).array(),
|
|
@@ -772,7 +1095,7 @@ var RoleBulkResultSchema = import_zod.z.object({
|
|
|
772
1095
|
index: import_zod.z.number(),
|
|
773
1096
|
role: import_zod.z.object({
|
|
774
1097
|
resourceId: import_zod.z.string(),
|
|
775
|
-
resourceType:
|
|
1098
|
+
resourceType: ResourceTypeSchema,
|
|
776
1099
|
role: import_zod.z.string(),
|
|
777
1100
|
userId: import_zod.z.string()
|
|
778
1101
|
})
|
|
@@ -786,7 +1109,7 @@ var RoleBulkResultSchema = import_zod.z.object({
|
|
|
786
1109
|
});
|
|
787
1110
|
var RoleCreateBodySchema = import_zod.z.object({
|
|
788
1111
|
resourceId: import_zod.z.string(),
|
|
789
|
-
resourceType:
|
|
1112
|
+
resourceType: ResourceTypeSchema,
|
|
790
1113
|
role: import_zod.z.string()
|
|
791
1114
|
});
|
|
792
1115
|
var RoleListSchema = import_zod.z.object({
|
|
@@ -796,43 +1119,58 @@ var RoleListSchema = import_zod.z.object({
|
|
|
796
1119
|
createdAt: import_zod.z.string(),
|
|
797
1120
|
environmentId: import_zod.z.string(),
|
|
798
1121
|
resourceId: import_zod.z.string(),
|
|
799
|
-
resourceType:
|
|
1122
|
+
resourceType: ResourceTypeSchema,
|
|
800
1123
|
role: import_zod.z.string(),
|
|
801
1124
|
userId: import_zod.z.string()
|
|
802
1125
|
}).array(),
|
|
803
1126
|
total: import_zod.z.number()
|
|
804
1127
|
});
|
|
1128
|
+
var UserResourceListSchema = import_zod.z.array(
|
|
1129
|
+
import_zod.z.object({
|
|
1130
|
+
inherited: import_zod.z.boolean(),
|
|
1131
|
+
resource: import_zod.z.object({
|
|
1132
|
+
id: import_zod.z.string(),
|
|
1133
|
+
name: import_zod.z.string(),
|
|
1134
|
+
parents: import_zod.z.object({
|
|
1135
|
+
id: import_zod.z.string(),
|
|
1136
|
+
type: ResourceTypeSchema
|
|
1137
|
+
}).array(),
|
|
1138
|
+
type: ResourceTypeSchema
|
|
1139
|
+
}).catchall(import_zod.z.unknown()),
|
|
1140
|
+
role: import_zod.z.string()
|
|
1141
|
+
})
|
|
1142
|
+
);
|
|
805
1143
|
var TransactionHistoryResponseSchema = import_zod.z.object({
|
|
806
1144
|
items: import_zod.z.object({
|
|
807
1145
|
amount: import_zod.z.number().int(),
|
|
808
1146
|
createdAt: import_zod.z.iso.datetime(),
|
|
809
1147
|
environmentId: import_zod.z.string(),
|
|
810
1148
|
id: import_zod.z.string(),
|
|
811
|
-
limitType:
|
|
1149
|
+
limitType: UsageLimitTypeSchema,
|
|
812
1150
|
resourceId: import_zod.z.string(),
|
|
813
|
-
resourceType:
|
|
1151
|
+
resourceType: ResourceTypeSchema,
|
|
814
1152
|
tags: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).nullable()
|
|
815
1153
|
}).array()
|
|
816
1154
|
});
|
|
817
1155
|
var UsageCheckBodySchema = import_zod.z.object({
|
|
818
1156
|
amount: import_zod.z.number().int(),
|
|
819
|
-
limitType:
|
|
1157
|
+
limitType: UsageLimitTypeSchema,
|
|
820
1158
|
period: import_zod.z.enum(["monthly", "yearly", "lifetime"]),
|
|
821
1159
|
resourceId: import_zod.z.string(),
|
|
822
|
-
resourceType:
|
|
1160
|
+
resourceType: ResourceTypeSchema
|
|
823
1161
|
});
|
|
824
1162
|
var UsageConsumeBodySchema = import_zod.z.object({
|
|
825
1163
|
amount: import_zod.z.number().int(),
|
|
826
|
-
limitType:
|
|
1164
|
+
limitType: UsageLimitTypeSchema,
|
|
827
1165
|
resourceId: import_zod.z.string(),
|
|
828
|
-
resourceType:
|
|
1166
|
+
resourceType: ResourceTypeSchema,
|
|
829
1167
|
tags: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional()
|
|
830
1168
|
});
|
|
831
1169
|
var UsageCreditBodySchema = import_zod.z.object({
|
|
832
1170
|
amount: import_zod.z.number().int(),
|
|
833
|
-
limitType:
|
|
1171
|
+
limitType: UsageLimitTypeSchema,
|
|
834
1172
|
resourceId: import_zod.z.string(),
|
|
835
|
-
resourceType:
|
|
1173
|
+
resourceType: ResourceTypeSchema,
|
|
836
1174
|
tags: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional()
|
|
837
1175
|
});
|
|
838
1176
|
var UsageWalletResponseSchema = import_zod.z.object({
|
|
@@ -840,72 +1178,11 @@ var UsageWalletResponseSchema = import_zod.z.object({
|
|
|
840
1178
|
createdAt: import_zod.z.iso.datetime(),
|
|
841
1179
|
environmentId: import_zod.z.string(),
|
|
842
1180
|
id: import_zod.z.string(),
|
|
843
|
-
limitType:
|
|
1181
|
+
limitType: UsageLimitTypeSchema,
|
|
844
1182
|
resourceId: import_zod.z.string(),
|
|
845
|
-
resourceType:
|
|
1183
|
+
resourceType: ResourceTypeSchema,
|
|
846
1184
|
tags: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).nullable()
|
|
847
1185
|
});
|
|
848
|
-
var UserSchema = import_zod.z.object({
|
|
849
|
-
avatarUrl: import_zod.z.string().nullable(),
|
|
850
|
-
createdAt: import_zod.z.iso.datetime(),
|
|
851
|
-
email: import_zod.z.email(),
|
|
852
|
-
emailVerified: import_zod.z.boolean(),
|
|
853
|
-
firstName: import_zod.z.string().nullable(),
|
|
854
|
-
id: import_zod.z.string(),
|
|
855
|
-
lastLoginAt: import_zod.z.iso.datetime().nullable(),
|
|
856
|
-
lastName: import_zod.z.string().nullable(),
|
|
857
|
-
lookupKey: import_zod.z.string().nullable(),
|
|
858
|
-
updatedAt: import_zod.z.iso.datetime()
|
|
859
|
-
});
|
|
860
|
-
var UserCreateBodySchema = import_zod.z.object({
|
|
861
|
-
avatarUrl: import_zod.z.url().optional(),
|
|
862
|
-
email: import_zod.z.email(),
|
|
863
|
-
firstName: import_zod.z.string().nullable().optional(),
|
|
864
|
-
lastName: import_zod.z.string().nullable().optional(),
|
|
865
|
-
lookupKey: import_zod.z.string(),
|
|
866
|
-
newUser: import_zod.z.boolean().nullable().optional(),
|
|
867
|
-
password: import_zod.z.string().nullable().optional()
|
|
868
|
-
});
|
|
869
|
-
var UserListSchema = import_zod.z.object({
|
|
870
|
-
items: import_zod.z.object({
|
|
871
|
-
avatarUrl: import_zod.z.string().nullable(),
|
|
872
|
-
createdAt: import_zod.z.iso.datetime(),
|
|
873
|
-
email: import_zod.z.email(),
|
|
874
|
-
emailVerified: import_zod.z.boolean(),
|
|
875
|
-
firstName: import_zod.z.string().nullable(),
|
|
876
|
-
id: import_zod.z.string(),
|
|
877
|
-
lastLoginAt: import_zod.z.iso.datetime().nullable(),
|
|
878
|
-
lastName: import_zod.z.string().nullable(),
|
|
879
|
-
lookupKey: import_zod.z.string().nullable(),
|
|
880
|
-
updatedAt: import_zod.z.iso.datetime()
|
|
881
|
-
}).array(),
|
|
882
|
-
limit: import_zod.z.number(),
|
|
883
|
-
page: import_zod.z.number(),
|
|
884
|
-
total: import_zod.z.number()
|
|
885
|
-
});
|
|
886
|
-
var UserResourceListSchema = import_zod.z.array(
|
|
887
|
-
import_zod.z.object({
|
|
888
|
-
inherited: import_zod.z.boolean(),
|
|
889
|
-
resource: import_zod.z.object({
|
|
890
|
-
id: import_zod.z.string(),
|
|
891
|
-
name: import_zod.z.string(),
|
|
892
|
-
parents: import_zod.z.object({
|
|
893
|
-
id: import_zod.z.string(),
|
|
894
|
-
type: import_zod.z.string()
|
|
895
|
-
}).array(),
|
|
896
|
-
type: import_zod.z.string()
|
|
897
|
-
}).catchall(import_zod.z.unknown()),
|
|
898
|
-
role: import_zod.z.string()
|
|
899
|
-
})
|
|
900
|
-
);
|
|
901
|
-
var UserUpdateBodySchema = import_zod.z.object({
|
|
902
|
-
avatarUrl: import_zod.z.url().nullable().optional(),
|
|
903
|
-
email: import_zod.z.email().optional(),
|
|
904
|
-
firstName: import_zod.z.string().nullable().optional(),
|
|
905
|
-
lastName: import_zod.z.string().nullable().optional(),
|
|
906
|
-
lookupKey: import_zod.z.string().optional(),
|
|
907
|
-
password: import_zod.z.string().optional()
|
|
908
|
-
});
|
|
909
1186
|
var ResourceListSchema = import_zod.z.object({
|
|
910
1187
|
items: ResourceSchema.array(),
|
|
911
1188
|
limit: import_zod.z.number(),
|
|
@@ -920,6 +1197,14 @@ var EntitlementsListForTenantQuerySchema = import_zod.z.object({
|
|
|
920
1197
|
/** The unique identifier of the user */
|
|
921
1198
|
userId: import_zod.z.string()
|
|
922
1199
|
});
|
|
1200
|
+
var OauthCheckConsentRequiredQuerySchema = import_zod.z.object({
|
|
1201
|
+
/** OAuth2 client ID */
|
|
1202
|
+
client_id: import_zod.z.string(),
|
|
1203
|
+
/** Redirect URI */
|
|
1204
|
+
redirect_uri: import_zod.z.string().optional(),
|
|
1205
|
+
/** Space-separated list of scopes */
|
|
1206
|
+
scope: import_zod.z.string().optional()
|
|
1207
|
+
});
|
|
923
1208
|
var ResourceMembersListQuerySchema = import_zod.z.object({
|
|
924
1209
|
/** Number of items per page (minimum: 1, maximum: 100) */
|
|
925
1210
|
limit: import_zod.z.number().optional(),
|
|
@@ -944,7 +1229,7 @@ var RolesListQuerySchema = import_zod.z.object({
|
|
|
944
1229
|
/** Filter roles by specific resource ID */
|
|
945
1230
|
resourceId: import_zod.z.string().optional(),
|
|
946
1231
|
/** Filter roles by resource type */
|
|
947
|
-
resourceType:
|
|
1232
|
+
resourceType: ResourceTypeSchema.optional(),
|
|
948
1233
|
/** Filter by role name */
|
|
949
1234
|
role: import_zod.z.string().optional()
|
|
950
1235
|
});
|
|
@@ -1001,7 +1286,7 @@ var TokenVerifier = class {
|
|
|
1001
1286
|
if (!response.ok) {
|
|
1002
1287
|
const errorText = await response.text();
|
|
1003
1288
|
console.error(`[TokenVerifier] \u274C Failed to fetch JWKs: ${response.status} ${errorText}`);
|
|
1004
|
-
throw new
|
|
1289
|
+
throw new import_fetch.FetchError("Failed to fetch JWKs", response.status, errorText);
|
|
1005
1290
|
}
|
|
1006
1291
|
const jwkSet = await response.json();
|
|
1007
1292
|
console.log(`[TokenVerifier] \u2705 Successfully fetched JWK Set with ${jwkSet.keys.length} keys`);
|