@blimu/backend 0.7.0 → 1.1.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 +129 -134
- package/dist/client.d.mts +24 -0
- package/dist/client.d.ts +15 -57
- package/dist/client.js +67 -156
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +48 -0
- package/dist/client.mjs.map +1 -0
- package/dist/index.d.mts +36 -0
- package/dist/index.d.ts +25 -26
- package/dist/index.js +1046 -82
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1014 -0
- package/dist/index.mjs.map +1 -0
- package/dist/main.d.mts +19 -0
- package/dist/main.d.ts +19 -0
- package/dist/main.js +1285 -0
- package/dist/main.js.map +1 -0
- package/dist/main.mjs +1275 -0
- package/dist/main.mjs.map +1 -0
- package/dist/schema-B1usIXCr.d.mts +424 -0
- package/dist/schema-B1usIXCr.d.ts +424 -0
- package/dist/schema.d.mts +2 -0
- package/dist/schema.d.ts +2 -381
- package/dist/schema.js +17 -1
- package/dist/schema.js.map +1 -1
- package/dist/schema.mjs +1 -0
- package/dist/schema.mjs.map +1 -0
- package/dist/schema.zod-CRNAHxbc.d.mts +444 -0
- package/dist/schema.zod-CRNAHxbc.d.ts +444 -0
- package/dist/schema.zod.d.mts +2 -0
- package/dist/schema.zod.d.ts +2 -0
- package/dist/schema.zod.js +563 -0
- package/dist/schema.zod.js.map +1 -0
- package/dist/schema.zod.mjs +496 -0
- package/dist/schema.zod.mjs.map +1 -0
- package/dist/services/bulk_resources.d.mts +12 -0
- package/dist/services/bulk_resources.d.ts +9 -4
- package/dist/services/bulk_resources.js +45 -17
- package/dist/services/bulk_resources.js.map +1 -1
- package/dist/services/bulk_resources.mjs +22 -0
- package/dist/services/bulk_resources.mjs.map +1 -0
- package/dist/services/bulk_roles.d.mts +12 -0
- package/dist/services/bulk_roles.d.ts +9 -4
- package/dist/services/bulk_roles.js +45 -17
- package/dist/services/bulk_roles.js.map +1 -1
- package/dist/services/bulk_roles.mjs +22 -0
- package/dist/services/bulk_roles.mjs.map +1 -0
- package/dist/services/entitlements.d.mts +14 -0
- package/dist/services/entitlements.d.ts +11 -6
- package/dist/services/entitlements.js +69 -33
- package/dist/services/entitlements.js.map +1 -1
- package/dist/services/entitlements.mjs +46 -0
- package/dist/services/entitlements.mjs.map +1 -0
- package/dist/services/plans.d.mts +14 -0
- package/dist/services/plans.d.ts +11 -6
- package/dist/services/plans.js +67 -31
- package/dist/services/plans.js.map +1 -1
- package/dist/services/plans.mjs +44 -0
- package/dist/services/plans.mjs.map +1 -0
- package/dist/services/resource_members.d.mts +12 -0
- package/dist/services/resource_members.d.ts +9 -4
- package/dist/services/resource_members.js +45 -16
- package/dist/services/resource_members.js.map +1 -1
- package/dist/services/resource_members.mjs +22 -0
- package/dist/services/resource_members.mjs.map +1 -0
- package/dist/services/resources.d.mts +16 -0
- package/dist/services/resources.d.ts +13 -8
- package/dist/services/resources.js +91 -48
- package/dist/services/resources.js.map +1 -1
- package/dist/services/resources.mjs +68 -0
- package/dist/services/resources.mjs.map +1 -0
- package/dist/services/roles.d.mts +14 -0
- package/dist/services/roles.d.ts +11 -6
- package/dist/services/roles.js +68 -32
- package/dist/services/roles.js.map +1 -1
- package/dist/services/roles.mjs +45 -0
- package/dist/services/roles.mjs.map +1 -0
- package/dist/services/usage.d.mts +16 -0
- package/dist/services/usage.d.ts +13 -8
- package/dist/services/usage.js +93 -51
- package/dist/services/usage.js.map +1 -1
- package/dist/services/usage.mjs +70 -0
- package/dist/services/usage.mjs.map +1 -0
- package/dist/services/users.d.mts +17 -0
- package/dist/services/users.d.ts +13 -8
- package/dist/services/users.js +102 -55
- package/dist/services/users.js.map +1 -1
- package/dist/services/users.mjs +79 -0
- package/dist/services/users.mjs.map +1 -0
- package/dist/token-verifier.d.mts +35 -0
- package/dist/token-verifier.d.ts +8 -6
- package/dist/token-verifier.js +227 -171
- package/dist/token-verifier.js.map +1 -1
- package/dist/token-verifier.mjs +203 -0
- package/dist/token-verifier.mjs.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils.d.mts +20 -0
- package/dist/utils.d.ts +7 -3
- package/dist/utils.js +50 -19
- package/dist/utils.js.map +1 -1
- package/dist/utils.mjs +29 -0
- package/dist/utils.mjs.map +1 -0
- package/package.json +37 -62
- package/src/client.ts +74 -0
- package/src/index.ts +55 -0
- package/src/main.ts +3 -0
- package/src/schema.ts +430 -0
- package/src/schema.zod.ts +558 -0
- package/src/services/bulk_resources.ts +24 -0
- package/src/services/bulk_roles.ts +22 -0
- package/src/services/entitlements.ts +58 -0
- package/src/services/plans.ts +57 -0
- package/src/services/resource_members.ts +25 -0
- package/src/services/resources.ts +91 -0
- package/src/services/roles.ts +58 -0
- package/src/services/usage.ts +93 -0
- package/src/services/users.ts +100 -0
- package/src/token-verifier.ts +280 -0
- package/src/utils.ts +56 -0
- package/bin/blimu +0 -0
- package/scripts/download-binary.js +0 -243
- package/scripts/postinstall.js +0 -24
package/dist/schema.d.ts
CHANGED
|
@@ -1,381 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
balance: number;
|
|
4
|
-
}
|
|
5
|
-
export interface CheckLimitResponse {
|
|
6
|
-
allowed: boolean;
|
|
7
|
-
current: number;
|
|
8
|
-
remaining?: number;
|
|
9
|
-
requested: number;
|
|
10
|
-
}
|
|
11
|
-
export interface EntitlementCheckBody {
|
|
12
|
-
amount?: number;
|
|
13
|
-
entitlement: EntitlementType;
|
|
14
|
-
resourceId: string;
|
|
15
|
-
userId: string;
|
|
16
|
-
}
|
|
17
|
-
export interface EntitlementCheckResult {
|
|
18
|
-
allowed: boolean;
|
|
19
|
-
limit?: {
|
|
20
|
-
allowed: boolean;
|
|
21
|
-
current?: number;
|
|
22
|
-
limit?: number;
|
|
23
|
-
plan?: string | null;
|
|
24
|
-
reason?: string;
|
|
25
|
-
remaining?: number;
|
|
26
|
-
scope?: string;
|
|
27
|
-
} | null;
|
|
28
|
-
plans?: {
|
|
29
|
-
allowed: boolean;
|
|
30
|
-
allowedPlans?: Array<string>;
|
|
31
|
-
plan?: string | null;
|
|
32
|
-
reason?: string;
|
|
33
|
-
} | null;
|
|
34
|
-
roles?: {
|
|
35
|
-
allowed: boolean;
|
|
36
|
-
allowedRoles?: Array<string>;
|
|
37
|
-
reason?: string;
|
|
38
|
-
userRoles?: Array<string>;
|
|
39
|
-
} | null;
|
|
40
|
-
}
|
|
41
|
-
export type EntitlementType = string;
|
|
42
|
-
export interface EntitlementsListResult {
|
|
43
|
-
results: Array<{
|
|
44
|
-
entitlements: Array<{
|
|
45
|
-
allowed: boolean;
|
|
46
|
-
allowedByPlan: boolean;
|
|
47
|
-
allowedByRole: boolean;
|
|
48
|
-
allowedPlans?: Array<string>;
|
|
49
|
-
allowedRoles: Array<string>;
|
|
50
|
-
currentPlan?: string;
|
|
51
|
-
currentRole?: string;
|
|
52
|
-
entitlement: EntitlementType;
|
|
53
|
-
}>;
|
|
54
|
-
resourceId: string;
|
|
55
|
-
resourceType: ResourceType;
|
|
56
|
-
}>;
|
|
57
|
-
}
|
|
58
|
-
export type LimitType = string;
|
|
59
|
-
export interface PlanAssignBody {
|
|
60
|
-
planKey: PlanType;
|
|
61
|
-
}
|
|
62
|
-
export interface PlanDeleteResponse {
|
|
63
|
-
success: boolean;
|
|
64
|
-
}
|
|
65
|
-
export interface PlanResponse {
|
|
66
|
-
createdAt: string;
|
|
67
|
-
environmentId: string;
|
|
68
|
-
planKey: PlanType;
|
|
69
|
-
resourceId: string;
|
|
70
|
-
resourceType: ResourceType;
|
|
71
|
-
updatedAt: string;
|
|
72
|
-
}
|
|
73
|
-
export type PlanType = string;
|
|
74
|
-
export interface Resource {
|
|
75
|
-
createdAt: string;
|
|
76
|
-
id: string;
|
|
77
|
-
name: string | null;
|
|
78
|
-
parents?: Array<{
|
|
79
|
-
id: string;
|
|
80
|
-
type: ResourceType;
|
|
81
|
-
}>;
|
|
82
|
-
type: ResourceType;
|
|
83
|
-
}
|
|
84
|
-
export interface ResourceBulkCreateBody {
|
|
85
|
-
resources: Array<{
|
|
86
|
-
id?: string;
|
|
87
|
-
name?: string;
|
|
88
|
-
parents?: Array<{
|
|
89
|
-
id: string;
|
|
90
|
-
type: ResourceType;
|
|
91
|
-
}>;
|
|
92
|
-
roles?: Array<{
|
|
93
|
-
role: string;
|
|
94
|
-
userId: string;
|
|
95
|
-
}>;
|
|
96
|
-
}>;
|
|
97
|
-
}
|
|
98
|
-
export interface ResourceBulkResult {
|
|
99
|
-
created: Array<{
|
|
100
|
-
environmentId: string;
|
|
101
|
-
id: string;
|
|
102
|
-
type: ResourceType;
|
|
103
|
-
}>;
|
|
104
|
-
errors: Array<{
|
|
105
|
-
error: string;
|
|
106
|
-
index: number;
|
|
107
|
-
resource: {
|
|
108
|
-
id?: string;
|
|
109
|
-
name?: string;
|
|
110
|
-
parents?: Array<{
|
|
111
|
-
id: string;
|
|
112
|
-
type: ResourceType;
|
|
113
|
-
}>;
|
|
114
|
-
roles?: Array<{
|
|
115
|
-
role: string;
|
|
116
|
-
userId: string;
|
|
117
|
-
}>;
|
|
118
|
-
};
|
|
119
|
-
}>;
|
|
120
|
-
success: boolean;
|
|
121
|
-
summary: {
|
|
122
|
-
failed: number;
|
|
123
|
-
successful: number;
|
|
124
|
-
total: number;
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
export interface ResourceCreateBody {
|
|
128
|
-
id?: string;
|
|
129
|
-
name?: string;
|
|
130
|
-
parents?: Array<{
|
|
131
|
-
id: string;
|
|
132
|
-
type: ResourceType;
|
|
133
|
-
}>;
|
|
134
|
-
roles?: Array<{
|
|
135
|
-
role: string;
|
|
136
|
-
userId: string;
|
|
137
|
-
}>;
|
|
138
|
-
}
|
|
139
|
-
export interface ResourceList {
|
|
140
|
-
items: Array<{
|
|
141
|
-
createdAt: string;
|
|
142
|
-
id: string;
|
|
143
|
-
name: string | null;
|
|
144
|
-
parents?: Array<{
|
|
145
|
-
id: string;
|
|
146
|
-
type: ResourceType;
|
|
147
|
-
}>;
|
|
148
|
-
type: ResourceType;
|
|
149
|
-
}>;
|
|
150
|
-
limit: number;
|
|
151
|
-
page: number;
|
|
152
|
-
total: number;
|
|
153
|
-
}
|
|
154
|
-
export interface ResourceMemberList {
|
|
155
|
-
items: Array<{
|
|
156
|
-
inherited: boolean;
|
|
157
|
-
role: string;
|
|
158
|
-
user: {
|
|
159
|
-
avatarUrl: string | null;
|
|
160
|
-
createdAt: string;
|
|
161
|
-
email: string;
|
|
162
|
-
emailVerified: boolean;
|
|
163
|
-
firstName: string | null;
|
|
164
|
-
id: string;
|
|
165
|
-
lastLoginAt: string | null;
|
|
166
|
-
lastName: string | null;
|
|
167
|
-
lookupKey: string | null;
|
|
168
|
-
updatedAt: string;
|
|
169
|
-
};
|
|
170
|
-
userId: string;
|
|
171
|
-
}>;
|
|
172
|
-
limit: number;
|
|
173
|
-
page: number;
|
|
174
|
-
total: number;
|
|
175
|
-
}
|
|
176
|
-
export type ResourceType = string;
|
|
177
|
-
export interface ResourceUpdateBody {
|
|
178
|
-
name?: string;
|
|
179
|
-
parents?: Array<{
|
|
180
|
-
id: string;
|
|
181
|
-
type: ResourceType;
|
|
182
|
-
}>;
|
|
183
|
-
}
|
|
184
|
-
export interface Role {
|
|
185
|
-
createdAt: string;
|
|
186
|
-
environmentId: string;
|
|
187
|
-
resourceId: string;
|
|
188
|
-
resourceType: ResourceType;
|
|
189
|
-
role: string;
|
|
190
|
-
userId: string;
|
|
191
|
-
}
|
|
192
|
-
export interface RoleBulkCreateBody {
|
|
193
|
-
roles: Array<{
|
|
194
|
-
resourceId: string;
|
|
195
|
-
resourceType: ResourceType;
|
|
196
|
-
role: string;
|
|
197
|
-
userId: string;
|
|
198
|
-
}>;
|
|
199
|
-
}
|
|
200
|
-
export interface RoleBulkResult {
|
|
201
|
-
created: Array<{
|
|
202
|
-
createdAt: string;
|
|
203
|
-
environmentId: string;
|
|
204
|
-
resourceId: string;
|
|
205
|
-
resourceType: ResourceType;
|
|
206
|
-
role: string;
|
|
207
|
-
userId: string;
|
|
208
|
-
}>;
|
|
209
|
-
errors: Array<{
|
|
210
|
-
error: string;
|
|
211
|
-
index: number;
|
|
212
|
-
role: {
|
|
213
|
-
resourceId: string;
|
|
214
|
-
resourceType: ResourceType;
|
|
215
|
-
role: string;
|
|
216
|
-
userId: string;
|
|
217
|
-
};
|
|
218
|
-
}>;
|
|
219
|
-
success: boolean;
|
|
220
|
-
summary: {
|
|
221
|
-
failed: number;
|
|
222
|
-
successful: number;
|
|
223
|
-
total: number;
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
export interface RoleCreateBody {
|
|
227
|
-
resourceId: string;
|
|
228
|
-
resourceType: ResourceType;
|
|
229
|
-
role: string;
|
|
230
|
-
}
|
|
231
|
-
export interface RoleList {
|
|
232
|
-
limit: number;
|
|
233
|
-
page: number;
|
|
234
|
-
roles: Array<{
|
|
235
|
-
createdAt: string;
|
|
236
|
-
environmentId: string;
|
|
237
|
-
resourceId: string;
|
|
238
|
-
resourceType: ResourceType;
|
|
239
|
-
role: string;
|
|
240
|
-
userId: string;
|
|
241
|
-
}>;
|
|
242
|
-
total: number;
|
|
243
|
-
}
|
|
244
|
-
export interface TransactionHistoryResponse {
|
|
245
|
-
items: Array<{
|
|
246
|
-
amount: number;
|
|
247
|
-
createdAt: string;
|
|
248
|
-
environmentId: string;
|
|
249
|
-
id: string;
|
|
250
|
-
limitType: LimitType;
|
|
251
|
-
resourceId: string;
|
|
252
|
-
resourceType: ResourceType;
|
|
253
|
-
tags: Record<string, unknown> | null;
|
|
254
|
-
}>;
|
|
255
|
-
}
|
|
256
|
-
export interface UsageCheckBody {
|
|
257
|
-
amount: number;
|
|
258
|
-
limitType: UsageLimitType;
|
|
259
|
-
period: 'monthly' | 'yearly' | 'lifetime';
|
|
260
|
-
resourceId: string;
|
|
261
|
-
resourceType: ResourceType;
|
|
262
|
-
}
|
|
263
|
-
export interface UsageConsumeBody {
|
|
264
|
-
amount: number;
|
|
265
|
-
limitType: UsageLimitType;
|
|
266
|
-
resourceId: string;
|
|
267
|
-
resourceType: ResourceType;
|
|
268
|
-
tags?: Record<string, unknown>;
|
|
269
|
-
}
|
|
270
|
-
export interface UsageCreditBody {
|
|
271
|
-
amount: number;
|
|
272
|
-
limitType: UsageLimitType;
|
|
273
|
-
resourceId: string;
|
|
274
|
-
resourceType: ResourceType;
|
|
275
|
-
tags?: Record<string, unknown>;
|
|
276
|
-
}
|
|
277
|
-
export type UsageLimitType = string;
|
|
278
|
-
export interface UsageWalletResponse {
|
|
279
|
-
amount: number;
|
|
280
|
-
createdAt: string;
|
|
281
|
-
environmentId: string;
|
|
282
|
-
id: string;
|
|
283
|
-
limitType: UsageLimitType;
|
|
284
|
-
resourceId: string;
|
|
285
|
-
resourceType: ResourceType;
|
|
286
|
-
tags: Record<string, unknown> | null;
|
|
287
|
-
}
|
|
288
|
-
export interface User {
|
|
289
|
-
avatarUrl: string | null;
|
|
290
|
-
createdAt: string;
|
|
291
|
-
email: string;
|
|
292
|
-
emailVerified: boolean;
|
|
293
|
-
firstName: string | null;
|
|
294
|
-
id: string;
|
|
295
|
-
lastLoginAt: string | null;
|
|
296
|
-
lastName: string | null;
|
|
297
|
-
lookupKey: string | null;
|
|
298
|
-
updatedAt: string;
|
|
299
|
-
}
|
|
300
|
-
export interface UserCreateBody {
|
|
301
|
-
avatarUrl?: string;
|
|
302
|
-
email: string;
|
|
303
|
-
firstName?: string | null;
|
|
304
|
-
lastName?: string | null;
|
|
305
|
-
lookupKey: string;
|
|
306
|
-
password?: string | null;
|
|
307
|
-
}
|
|
308
|
-
export interface UserList {
|
|
309
|
-
items: Array<{
|
|
310
|
-
avatarUrl: string | null;
|
|
311
|
-
createdAt: string;
|
|
312
|
-
email: string;
|
|
313
|
-
emailVerified: boolean;
|
|
314
|
-
firstName: string | null;
|
|
315
|
-
id: string;
|
|
316
|
-
lastLoginAt: string | null;
|
|
317
|
-
lastName: string | null;
|
|
318
|
-
lookupKey: string | null;
|
|
319
|
-
updatedAt: string;
|
|
320
|
-
}>;
|
|
321
|
-
limit: number;
|
|
322
|
-
page: number;
|
|
323
|
-
total: number;
|
|
324
|
-
}
|
|
325
|
-
export type UserResourceList = Array<{
|
|
326
|
-
inherited: boolean;
|
|
327
|
-
resource: {
|
|
328
|
-
id: string;
|
|
329
|
-
name: string;
|
|
330
|
-
parents: Array<{
|
|
331
|
-
id: string;
|
|
332
|
-
type: ResourceType;
|
|
333
|
-
}>;
|
|
334
|
-
type: ResourceType;
|
|
335
|
-
};
|
|
336
|
-
role: string;
|
|
337
|
-
}>;
|
|
338
|
-
export interface UserUpdateBody {
|
|
339
|
-
avatarUrl?: string | null;
|
|
340
|
-
email?: string;
|
|
341
|
-
firstName?: string | null;
|
|
342
|
-
lastName?: string | null;
|
|
343
|
-
lookupKey?: string;
|
|
344
|
-
password?: string;
|
|
345
|
-
}
|
|
346
|
-
export interface EntitlementsListForResourceQuery {
|
|
347
|
-
userId: string;
|
|
348
|
-
}
|
|
349
|
-
export interface EntitlementsListForTenantQuery {
|
|
350
|
-
userId: string;
|
|
351
|
-
}
|
|
352
|
-
export interface ResourceMembersListQuery {
|
|
353
|
-
limit?: number;
|
|
354
|
-
page?: number;
|
|
355
|
-
search?: string;
|
|
356
|
-
}
|
|
357
|
-
export interface ResourcesListQuery {
|
|
358
|
-
limit?: number;
|
|
359
|
-
page?: number;
|
|
360
|
-
search?: string;
|
|
361
|
-
}
|
|
362
|
-
export interface RolesListQuery {
|
|
363
|
-
limit?: number;
|
|
364
|
-
page?: number;
|
|
365
|
-
resourceId?: string;
|
|
366
|
-
resourceType?: ResourceType;
|
|
367
|
-
role?: string;
|
|
368
|
-
}
|
|
369
|
-
export interface UsageGetBalanceQuery {
|
|
370
|
-
period: 'monthly' | 'yearly' | 'lifetime';
|
|
371
|
-
}
|
|
372
|
-
export interface UsageGetTransactionHistoryQuery {
|
|
373
|
-
endDate?: string;
|
|
374
|
-
period?: 'monthly' | 'yearly' | 'lifetime';
|
|
375
|
-
startDate?: string;
|
|
376
|
-
}
|
|
377
|
-
export interface UsersListQuery {
|
|
378
|
-
limit?: number;
|
|
379
|
-
page?: number;
|
|
380
|
-
search?: string;
|
|
381
|
-
}
|
|
1
|
+
import '@blimu/types';
|
|
2
|
+
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-B1usIXCr.js';
|
package/dist/schema.js
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/schema.ts
|
|
17
|
+
var schema_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(schema_exports);
|
|
3
19
|
//# sourceMappingURL=schema.js.map
|
package/dist/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"sources":["../src/schema.ts"],"sourcesContent":["// Generated types from OpenAPI components.schemas\n\nimport type {\n ResourceType,\n EntitlementType,\n PlanType,\n LimitType,\n UsageLimitType,\n} from '@blimu/types';\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: 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?: string | null;\n reason?: string;\n remaining?: number;\n scope?: string;\n } | null;\n plans?: {\n allowed: boolean;\n allowedPlans?: Array<string>;\n plan?: string | null;\n reason?: string;\n } | null;\n roles?: {\n allowed: boolean;\n allowedRoles?: Array<string>;\n reason?: string;\n userRoles?: Array<string>;\n } | null;\n}\n\nexport interface EntitlementsListResult {\n results: Array<{\n entitlements: Array<{\n allowed: boolean;\n allowedByPlan: boolean;\n allowedByRole: boolean;\n allowedPlans?: Array<string>;\n allowedRoles: Array<string>;\n currentPlan?: string;\n currentRole?: string;\n entitlement: EntitlementType;\n }>;\n resourceId: string;\n resourceType: ResourceType;\n }>;\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?: Array<{ id: string; type: ResourceType }>;\n type: ResourceType;\n}\n\nexport interface ResourceBulkCreateBody {\n resources: Array<{\n id?: string;\n name?: string;\n parents?: Array<{ id: string; type: ResourceType }>;\n roles?: Array<{ role: string; userId: string }>;\n }>;\n}\n\nexport interface ResourceBulkResult {\n created: Array<{ environmentId: string; id: string; type: ResourceType }>;\n errors: Array<{\n error: string;\n index: number;\n resource: {\n id?: string;\n name?: string;\n parents?: Array<{ id: string; type: ResourceType }>;\n roles?: Array<{ 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?: Array<{ id: string; type: ResourceType }>;\n roles?: Array<{ role: string; userId: string }>;\n}\n\nexport interface ResourceList {\n items: Array<{\n createdAt: string;\n id: string;\n name: string | null;\n parents?: Array<{ id: string; type: ResourceType }>;\n type: ResourceType;\n }>;\n limit: number;\n page: number;\n total: number;\n}\n\nexport interface ResourceMemberList {\n items: Array<{\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?: Array<{ id: string; type: ResourceType }>;\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: Array<{\n resourceId: string;\n resourceType: ResourceType;\n role: string;\n userId: string;\n }>;\n}\n\nexport interface RoleBulkResult {\n created: Array<{\n createdAt: string;\n environmentId: string;\n resourceId: string;\n resourceType: ResourceType;\n role: string;\n userId: string;\n }>;\n errors: Array<{\n error: string;\n index: number;\n role: {\n resourceId: string;\n resourceType: ResourceType;\n role: string;\n userId: string;\n };\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: Array<{\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 TransactionHistoryResponse {\n items: Array<{\n amount: number;\n createdAt: string;\n environmentId: string;\n id: string;\n limitType: LimitType;\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: Array<{\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 = Array<{\n inherited: boolean;\n resource: {\n id: string;\n name: string;\n parents: Array<{ 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 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?: 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.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=schema.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|