@anuragpal02/zcl-contracts 0.15.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin.d.ts +173 -0
- package/dist/admin.d.ts.map +1 -0
- package/dist/admin.js +81 -0
- package/dist/client.d.ts +12 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +35 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/projects.d.ts +3 -3
- package/package.json +1 -1
package/dist/admin.d.ts
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const creditLedgerTypeSchema: z.ZodEnum<{
|
|
3
|
+
grant: "grant";
|
|
4
|
+
reserve: "reserve";
|
|
5
|
+
capture: "capture";
|
|
6
|
+
release: "release";
|
|
7
|
+
refund: "refund";
|
|
8
|
+
adjustment: "adjustment";
|
|
9
|
+
}>;
|
|
10
|
+
export declare const adminMeResponseSchema: z.ZodObject<{
|
|
11
|
+
data: z.ZodObject<{
|
|
12
|
+
userId: z.ZodString;
|
|
13
|
+
email: z.ZodString;
|
|
14
|
+
name: z.ZodString;
|
|
15
|
+
isPlatformAdmin: z.ZodLiteral<true>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export declare const adminUserSummarySchema: z.ZodObject<{
|
|
19
|
+
id: z.ZodString;
|
|
20
|
+
email: z.ZodString;
|
|
21
|
+
name: z.ZodString;
|
|
22
|
+
disabledAt: z.ZodNullable<z.ZodString>;
|
|
23
|
+
createdAt: z.ZodString;
|
|
24
|
+
workspaceCount: z.ZodNumber;
|
|
25
|
+
isPlatformAdmin: z.ZodBoolean;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export declare const listAdminUsersResponseSchema: z.ZodObject<{
|
|
28
|
+
data: z.ZodObject<{
|
|
29
|
+
users: z.ZodArray<z.ZodObject<{
|
|
30
|
+
id: z.ZodString;
|
|
31
|
+
email: z.ZodString;
|
|
32
|
+
name: z.ZodString;
|
|
33
|
+
disabledAt: z.ZodNullable<z.ZodString>;
|
|
34
|
+
createdAt: z.ZodString;
|
|
35
|
+
workspaceCount: z.ZodNumber;
|
|
36
|
+
isPlatformAdmin: z.ZodBoolean;
|
|
37
|
+
}, z.core.$strip>>;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
export declare const adminWorkspaceCreditSchema: z.ZodObject<{
|
|
41
|
+
workspaceId: z.ZodString;
|
|
42
|
+
name: z.ZodString;
|
|
43
|
+
role: z.ZodEnum<{
|
|
44
|
+
owner: "owner";
|
|
45
|
+
admin: "admin";
|
|
46
|
+
artist: "artist";
|
|
47
|
+
viewer: "viewer";
|
|
48
|
+
}>;
|
|
49
|
+
balance: z.ZodNumber;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
export declare const adminUserDetailResponseSchema: z.ZodObject<{
|
|
52
|
+
data: z.ZodObject<{
|
|
53
|
+
id: z.ZodString;
|
|
54
|
+
email: z.ZodString;
|
|
55
|
+
name: z.ZodString;
|
|
56
|
+
disabledAt: z.ZodNullable<z.ZodString>;
|
|
57
|
+
createdAt: z.ZodString;
|
|
58
|
+
isPlatformAdmin: z.ZodBoolean;
|
|
59
|
+
workspaces: z.ZodArray<z.ZodObject<{
|
|
60
|
+
workspaceId: z.ZodString;
|
|
61
|
+
name: z.ZodString;
|
|
62
|
+
role: z.ZodEnum<{
|
|
63
|
+
owner: "owner";
|
|
64
|
+
admin: "admin";
|
|
65
|
+
artist: "artist";
|
|
66
|
+
viewer: "viewer";
|
|
67
|
+
}>;
|
|
68
|
+
balance: z.ZodNumber;
|
|
69
|
+
}, z.core.$strip>>;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
export declare const adminLedgerEntrySchema: z.ZodObject<{
|
|
73
|
+
type: z.ZodEnum<{
|
|
74
|
+
grant: "grant";
|
|
75
|
+
reserve: "reserve";
|
|
76
|
+
capture: "capture";
|
|
77
|
+
release: "release";
|
|
78
|
+
refund: "refund";
|
|
79
|
+
adjustment: "adjustment";
|
|
80
|
+
}>;
|
|
81
|
+
amount: z.ZodNumber;
|
|
82
|
+
balanceAfter: z.ZodNumber;
|
|
83
|
+
createdAt: z.ZodString;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
export declare const adminWorkspaceDetailResponseSchema: z.ZodObject<{
|
|
86
|
+
data: z.ZodObject<{
|
|
87
|
+
id: z.ZodString;
|
|
88
|
+
name: z.ZodString;
|
|
89
|
+
type: z.ZodEnum<{
|
|
90
|
+
personal: "personal";
|
|
91
|
+
organization: "organization";
|
|
92
|
+
}>;
|
|
93
|
+
balance: z.ZodNumber;
|
|
94
|
+
members: z.ZodArray<z.ZodObject<{
|
|
95
|
+
userId: z.ZodString;
|
|
96
|
+
email: z.ZodString;
|
|
97
|
+
name: z.ZodString;
|
|
98
|
+
role: z.ZodEnum<{
|
|
99
|
+
owner: "owner";
|
|
100
|
+
admin: "admin";
|
|
101
|
+
artist: "artist";
|
|
102
|
+
viewer: "viewer";
|
|
103
|
+
}>;
|
|
104
|
+
status: z.ZodEnum<{
|
|
105
|
+
active: "active";
|
|
106
|
+
invited: "invited";
|
|
107
|
+
disabled: "disabled";
|
|
108
|
+
}>;
|
|
109
|
+
}, z.core.$strip>>;
|
|
110
|
+
recentLedger: z.ZodArray<z.ZodObject<{
|
|
111
|
+
type: z.ZodEnum<{
|
|
112
|
+
grant: "grant";
|
|
113
|
+
reserve: "reserve";
|
|
114
|
+
capture: "capture";
|
|
115
|
+
release: "release";
|
|
116
|
+
refund: "refund";
|
|
117
|
+
adjustment: "adjustment";
|
|
118
|
+
}>;
|
|
119
|
+
amount: z.ZodNumber;
|
|
120
|
+
balanceAfter: z.ZodNumber;
|
|
121
|
+
createdAt: z.ZodString;
|
|
122
|
+
}, z.core.$strip>>;
|
|
123
|
+
}, z.core.$strip>;
|
|
124
|
+
}, z.core.$strip>;
|
|
125
|
+
export declare const adminAdjustCreditsRequestSchema: z.ZodObject<{
|
|
126
|
+
amount: z.ZodNumber;
|
|
127
|
+
reason: z.ZodString;
|
|
128
|
+
}, z.core.$strip>;
|
|
129
|
+
export declare const adminAdjustCreditsResponseSchema: z.ZodObject<{
|
|
130
|
+
data: z.ZodObject<{
|
|
131
|
+
balance: z.ZodNumber;
|
|
132
|
+
ledgerEntry: z.ZodObject<{
|
|
133
|
+
type: z.ZodEnum<{
|
|
134
|
+
grant: "grant";
|
|
135
|
+
reserve: "reserve";
|
|
136
|
+
capture: "capture";
|
|
137
|
+
release: "release";
|
|
138
|
+
refund: "refund";
|
|
139
|
+
adjustment: "adjustment";
|
|
140
|
+
}>;
|
|
141
|
+
amount: z.ZodNumber;
|
|
142
|
+
balanceAfter: z.ZodNumber;
|
|
143
|
+
createdAt: z.ZodString;
|
|
144
|
+
}, z.core.$strip>;
|
|
145
|
+
}, z.core.$strip>;
|
|
146
|
+
}, z.core.$strip>;
|
|
147
|
+
export declare const setPlatformAdminRequestSchema: z.ZodObject<{
|
|
148
|
+
isPlatformAdmin: z.ZodBoolean;
|
|
149
|
+
}, z.core.$strip>;
|
|
150
|
+
export declare const setPlatformAdminResponseSchema: z.ZodObject<{
|
|
151
|
+
data: z.ZodObject<{
|
|
152
|
+
id: z.ZodString;
|
|
153
|
+
email: z.ZodString;
|
|
154
|
+
name: z.ZodString;
|
|
155
|
+
disabledAt: z.ZodNullable<z.ZodString>;
|
|
156
|
+
createdAt: z.ZodString;
|
|
157
|
+
workspaceCount: z.ZodNumber;
|
|
158
|
+
isPlatformAdmin: z.ZodBoolean;
|
|
159
|
+
}, z.core.$strip>;
|
|
160
|
+
}, z.core.$strip>;
|
|
161
|
+
export type CreditLedgerType = z.infer<typeof creditLedgerTypeSchema>;
|
|
162
|
+
export type AdminMeResponse = z.infer<typeof adminMeResponseSchema>;
|
|
163
|
+
export type AdminUserSummary = z.infer<typeof adminUserSummarySchema>;
|
|
164
|
+
export type ListAdminUsersResponse = z.infer<typeof listAdminUsersResponseSchema>;
|
|
165
|
+
export type AdminWorkspaceCredit = z.infer<typeof adminWorkspaceCreditSchema>;
|
|
166
|
+
export type AdminUserDetailResponse = z.infer<typeof adminUserDetailResponseSchema>;
|
|
167
|
+
export type AdminLedgerEntry = z.infer<typeof adminLedgerEntrySchema>;
|
|
168
|
+
export type AdminWorkspaceDetailResponse = z.infer<typeof adminWorkspaceDetailResponseSchema>;
|
|
169
|
+
export type AdminAdjustCreditsRequest = z.input<typeof adminAdjustCreditsRequestSchema>;
|
|
170
|
+
export type AdminAdjustCreditsResponse = z.infer<typeof adminAdjustCreditsResponseSchema>;
|
|
171
|
+
export type SetPlatformAdminRequest = z.input<typeof setPlatformAdminRequestSchema>;
|
|
172
|
+
export type SetPlatformAdminResponse = z.infer<typeof setPlatformAdminResponseSchema>;
|
|
173
|
+
//# sourceMappingURL=admin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../src/admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,eAAO,MAAM,sBAAsB;;;;;;;EAOjC,CAAA;AAGF,eAAO,MAAM,qBAAqB;;;;;;;iBAOjC,CAAA;AAED,eAAO,MAAM,sBAAsB;;;;;;;;iBAQjC,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;iBAIxC,CAAA;AAGD,eAAO,MAAM,0BAA0B;;;;;;;;;;iBAKrC,CAAA;AAEF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;iBAUzC,CAAA;AAED,eAAO,MAAM,sBAAsB;;;;;;;;;;;;iBAKjC,CAAA;AAEF,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiB9C,CAAA;AAGD,e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|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { apiSuccessSchema, idSchema, isoDateSchema } from './common.js';
|
|
3
|
+
import { workspaceMembershipStatusSchema, workspaceRoleSchema, workspaceTypeSchema } from './workspaces.js';
|
|
4
|
+
// The credit-ledger entry kinds: lifecycle of a workspace's credits.
|
|
5
|
+
// `adjustment` is the type recorded by an admin manual grant/deduct.
|
|
6
|
+
export const creditLedgerTypeSchema = z.enum([
|
|
7
|
+
'grant',
|
|
8
|
+
'reserve',
|
|
9
|
+
'capture',
|
|
10
|
+
'release',
|
|
11
|
+
'refund',
|
|
12
|
+
'adjustment'
|
|
13
|
+
]);
|
|
14
|
+
// `/admin/me` — confirms the caller is a platform admin (literal `true`, never `false`).
|
|
15
|
+
export const adminMeResponseSchema = apiSuccessSchema(z.object({
|
|
16
|
+
userId: idSchema,
|
|
17
|
+
email: z.string().email(),
|
|
18
|
+
name: z.string(),
|
|
19
|
+
isPlatformAdmin: z.literal(true)
|
|
20
|
+
}));
|
|
21
|
+
export const adminUserSummarySchema = z.object({
|
|
22
|
+
id: idSchema,
|
|
23
|
+
email: z.string().email(),
|
|
24
|
+
name: z.string(),
|
|
25
|
+
disabledAt: isoDateSchema.nullable(),
|
|
26
|
+
createdAt: isoDateSchema,
|
|
27
|
+
workspaceCount: z.number().int(),
|
|
28
|
+
isPlatformAdmin: z.boolean()
|
|
29
|
+
});
|
|
30
|
+
export const listAdminUsersResponseSchema = apiSuccessSchema(z.object({
|
|
31
|
+
users: z.array(adminUserSummarySchema)
|
|
32
|
+
}));
|
|
33
|
+
// A workspace the user belongs to, enriched with their role + the workspace's balance.
|
|
34
|
+
export const adminWorkspaceCreditSchema = z.object({
|
|
35
|
+
workspaceId: idSchema,
|
|
36
|
+
name: z.string(),
|
|
37
|
+
role: workspaceRoleSchema,
|
|
38
|
+
balance: z.number().int()
|
|
39
|
+
});
|
|
40
|
+
export const adminUserDetailResponseSchema = apiSuccessSchema(z.object({
|
|
41
|
+
id: idSchema,
|
|
42
|
+
email: z.string().email(),
|
|
43
|
+
name: z.string(),
|
|
44
|
+
disabledAt: isoDateSchema.nullable(),
|
|
45
|
+
createdAt: isoDateSchema,
|
|
46
|
+
isPlatformAdmin: z.boolean(),
|
|
47
|
+
workspaces: z.array(adminWorkspaceCreditSchema)
|
|
48
|
+
}));
|
|
49
|
+
export const adminLedgerEntrySchema = z.object({
|
|
50
|
+
type: creditLedgerTypeSchema,
|
|
51
|
+
amount: z.number().int(),
|
|
52
|
+
balanceAfter: z.number().int(),
|
|
53
|
+
createdAt: isoDateSchema
|
|
54
|
+
});
|
|
55
|
+
export const adminWorkspaceDetailResponseSchema = apiSuccessSchema(z.object({
|
|
56
|
+
id: idSchema,
|
|
57
|
+
name: z.string(),
|
|
58
|
+
type: workspaceTypeSchema,
|
|
59
|
+
balance: z.number().int(),
|
|
60
|
+
members: z.array(z.object({
|
|
61
|
+
userId: idSchema,
|
|
62
|
+
email: z.string().email(),
|
|
63
|
+
name: z.string(),
|
|
64
|
+
role: workspaceRoleSchema,
|
|
65
|
+
status: workspaceMembershipStatusSchema
|
|
66
|
+
})),
|
|
67
|
+
recentLedger: z.array(adminLedgerEntrySchema)
|
|
68
|
+
}));
|
|
69
|
+
// Manual credit adjustment: positive = grant, negative = deduct; never zero.
|
|
70
|
+
export const adminAdjustCreditsRequestSchema = z.object({
|
|
71
|
+
amount: z.number().int().refine((n) => n !== 0, 'amount must be non-zero'),
|
|
72
|
+
reason: z.string().min(1).max(500)
|
|
73
|
+
});
|
|
74
|
+
export const adminAdjustCreditsResponseSchema = apiSuccessSchema(z.object({
|
|
75
|
+
balance: z.number().int(),
|
|
76
|
+
ledgerEntry: adminLedgerEntrySchema
|
|
77
|
+
}));
|
|
78
|
+
export const setPlatformAdminRequestSchema = z.object({
|
|
79
|
+
isPlatformAdmin: z.boolean()
|
|
80
|
+
});
|
|
81
|
+
export const setPlatformAdminResponseSchema = apiSuccessSchema(adminUserSummarySchema);
|
package/dist/client.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { type Asset, type AssetUpload, type CreateAssetUploadRequest, type Creat
|
|
|
7
7
|
import { type CreateProjectRequest, type LedMapResponse, type Project, type UpdateLedMapRequest, type UpdateProjectRequest } from './projects.js';
|
|
8
8
|
import { type CreateGenerationJobRequest, type CreatePanelSetRequest, type CreatePanelSetResponse, type CreateVideoLoopRequest, type CreateVideoUpscaleRequest, type EditGenerationJobRequest, type GenerationJobResponse, type GenerationJobStatus, type ListGenerationJobsResponse } from './generation.js';
|
|
9
9
|
import { type DescribeImageRequest, type DescribeImageResponse } from './assistant.js';
|
|
10
|
+
import { type AdminAdjustCreditsRequest, type AdminAdjustCreditsResponse, type AdminMeResponse, type AdminUserDetailResponse, type AdminWorkspaceDetailResponse, type ListAdminUsersResponse, type SetPlatformAdminRequest, type SetPlatformAdminResponse } from './admin.js';
|
|
10
11
|
type FetchLike = (request: Request) => Promise<Response>;
|
|
11
12
|
export type ZclApiClientOptions = {
|
|
12
13
|
baseUrl: string;
|
|
@@ -106,6 +107,17 @@ export declare function createZclApiClient(options: ZclApiClientOptions): {
|
|
|
106
107
|
assistant: {
|
|
107
108
|
describeImage(workspaceId: string, projectId: string, input: DescribeImageRequest): Promise<DescribeImageResponse>;
|
|
108
109
|
};
|
|
110
|
+
admin: {
|
|
111
|
+
me(): Promise<AdminMeResponse>;
|
|
112
|
+
listUsers(options?: {
|
|
113
|
+
q?: string;
|
|
114
|
+
limit?: number;
|
|
115
|
+
}): Promise<ListAdminUsersResponse>;
|
|
116
|
+
getUser(userId: string): Promise<AdminUserDetailResponse>;
|
|
117
|
+
getWorkspace(workspaceId: string): Promise<AdminWorkspaceDetailResponse>;
|
|
118
|
+
adjustCredits(workspaceId: string, input: AdminAdjustCreditsRequest): Promise<AdminAdjustCreditsResponse>;
|
|
119
|
+
setPlatformAdmin(userId: string, input: SetPlatformAdminRequest): Promise<SetPlatformAdminResponse>;
|
|
120
|
+
};
|
|
109
121
|
};
|
|
110
122
|
export type ZclApiClient = ReturnType<typeof createZclApiClient>;
|
|
111
123
|
export {};
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EASL,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,eAAe,EACpB,KAAK,aAAa,EACnB,MAAM,WAAW,CAAA;AAClB,OAAO,EAA2C,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AACxF,OAAO,EAA+B,KAAK,qBAAqB,EAAE,MAAM,cAAc,CAAA;AACtF,OAAO,EAOL,qBAAqB,EAIrB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,SAAS,EACd,KAAK,mBAAmB,EACzB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAML,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,kBAAkB,EACxB,MAAM,aAAa,CAAA;AACpB,OAAO,EAML,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EAC1B,MAAM,eAAe,CAAA;AACtB,OAAO,EASL,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAChC,MAAM,i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CAAC,EAAE,MAAM,CAAA;SAAE,GAAQ,OAAO,CAAC,sBAAsB,CAAC;wBAWxE,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC;kCAG/B,MAAM,GAAG,OAAO,CAAC,4BAA4B,CAAC;mCAIzD,MAAM,SACZ,yBAAyB,GAC/B,OAAO,CAAC,0BAA0B,CAAC;iCAO5B,MAAM,SACP,uBAAuB,GAC7B,OAAO,CAAC,wBAAwB,CAAC;;EAQzC;AAED,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAA"}
|
package/dist/client.js
CHANGED
|
@@ -7,6 +7,7 @@ import { assetSchema, createAssetUploadRequestSchema, createAssetUploadResponseS
|
|
|
7
7
|
import { createProjectRequestSchema, ledMapResponseSchema, projectSchema, updateLedMapRequestSchema, updateProjectRequestSchema } from './projects.js';
|
|
8
8
|
import { createGenerationJobRequestSchema, createPanelSetRequestSchema, createPanelSetResponseSchema, createVideoLoopRequestSchema, createVideoUpscaleRequestSchema, editGenerationJobRequestSchema, generationJobResponseSchema, listGenerationJobsResponseSchema } from './generation.js';
|
|
9
9
|
import { describeImageRequestSchema, describeImageResponseSchema } from './assistant.js';
|
|
10
|
+
import { adminAdjustCreditsRequestSchema, adminAdjustCreditsResponseSchema, adminMeResponseSchema, adminUserDetailResponseSchema, adminWorkspaceDetailResponseSchema, listAdminUsersResponseSchema, setPlatformAdminRequestSchema, setPlatformAdminResponseSchema } from './admin.js';
|
|
10
11
|
const workspaceListResponseSchema = listResponseSchema(workspaceSchema.extend({
|
|
11
12
|
membership: workspaceMembershipSchema
|
|
12
13
|
}));
|
|
@@ -272,6 +273,40 @@ export function createZclApiClient(options) {
|
|
|
272
273
|
body: describeImageRequestSchema.parse(input)
|
|
273
274
|
});
|
|
274
275
|
}
|
|
276
|
+
},
|
|
277
|
+
admin: {
|
|
278
|
+
me() {
|
|
279
|
+
return request('/admin/me', adminMeResponseSchema);
|
|
280
|
+
},
|
|
281
|
+
listUsers(options = {}) {
|
|
282
|
+
const params = new URLSearchParams();
|
|
283
|
+
if (options.q !== undefined) {
|
|
284
|
+
params.set('q', options.q);
|
|
285
|
+
}
|
|
286
|
+
if (options.limit !== undefined) {
|
|
287
|
+
params.set('limit', String(options.limit));
|
|
288
|
+
}
|
|
289
|
+
const query = params.toString() ? `?${params.toString()}` : '';
|
|
290
|
+
return request(`/admin/users${query}`, listAdminUsersResponseSchema);
|
|
291
|
+
},
|
|
292
|
+
getUser(userId) {
|
|
293
|
+
return request(`/admin/users/${userId}`, adminUserDetailResponseSchema);
|
|
294
|
+
},
|
|
295
|
+
getWorkspace(workspaceId) {
|
|
296
|
+
return request(`/admin/workspaces/${workspaceId}`, adminWorkspaceDetailResponseSchema);
|
|
297
|
+
},
|
|
298
|
+
adjustCredits(workspaceId, input) {
|
|
299
|
+
return request(`/admin/workspaces/${workspaceId}/credits`, adminAdjustCreditsResponseSchema, {
|
|
300
|
+
method: 'POST',
|
|
301
|
+
body: adminAdjustCreditsRequestSchema.parse(input)
|
|
302
|
+
});
|
|
303
|
+
},
|
|
304
|
+
setPlatformAdmin(userId, input) {
|
|
305
|
+
return request(`/admin/users/${userId}/platform-admin`, setPlatformAdminResponseSchema, {
|
|
306
|
+
method: 'POST',
|
|
307
|
+
body: setPlatformAdminRequestSchema.parse(input)
|
|
308
|
+
});
|
|
309
|
+
}
|
|
275
310
|
}
|
|
276
311
|
};
|
|
277
312
|
}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA"}
|
package/dist/index.js
CHANGED
package/dist/projects.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ export declare const projectVisibilitySchema: z.ZodEnum<{
|
|
|
4
4
|
workspace: "workspace";
|
|
5
5
|
}>;
|
|
6
6
|
export declare const projectStatusSchema: z.ZodEnum<{
|
|
7
|
-
deleted: "deleted";
|
|
8
7
|
active: "active";
|
|
8
|
+
deleted: "deleted";
|
|
9
9
|
archived: "archived";
|
|
10
10
|
}>;
|
|
11
11
|
export declare const ledPanelIdSchema: z.ZodString;
|
|
@@ -113,8 +113,8 @@ export declare const projectSchema: z.ZodObject<{
|
|
|
113
113
|
workspace: "workspace";
|
|
114
114
|
}>;
|
|
115
115
|
status: z.ZodEnum<{
|
|
116
|
-
deleted: "deleted";
|
|
117
116
|
active: "active";
|
|
117
|
+
deleted: "deleted";
|
|
118
118
|
archived: "archived";
|
|
119
119
|
}>;
|
|
120
120
|
createdAt: z.ZodString;
|
|
@@ -134,8 +134,8 @@ export declare const updateProjectRequestSchema: z.ZodObject<{
|
|
|
134
134
|
workspace: "workspace";
|
|
135
135
|
}>>;
|
|
136
136
|
status: z.ZodOptional<z.ZodEnum<{
|
|
137
|
-
deleted: "deleted";
|
|
138
137
|
active: "active";
|
|
138
|
+
deleted: "deleted";
|
|
139
139
|
archived: "archived";
|
|
140
140
|
}>>;
|
|
141
141
|
}, z.core.$strip>;
|