@anuragpal02/zcl-contracts 0.14.0 → 0.15.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/client.d.ts +16 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +33 -2
- package/dist/workspaces.d.ts +141 -0
- package/dist/workspaces.d.ts.map +1 -1
- package/dist/workspaces.js +40 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
import { type AuthSessionResponse, type ConfirmPasswordResetRequest, type LoginRequest, type LogoutResponse, type PasswordResetResponse, type RequestPasswordResetRequest, type SessionResponse, type SignupRequest } from './auth.js';
|
|
2
3
|
import { type ApiErrorCode } from './common.js';
|
|
3
4
|
import { type CreditBalanceResponse } from './credits.js';
|
|
4
|
-
import { type CreateWorkspaceRequest, type Workspace, type WorkspaceMembership } from './workspaces.js';
|
|
5
|
+
import { workspaceMemberSchema, type CreateWorkspaceRequest, type InviteMemberRequest, type InviteMemberResponse, type ListMembersResponse, type UpdateMemberRoleRequest, type UpdateWorkspaceRequest, type Workspace, type WorkspaceMembership } from './workspaces.js';
|
|
5
6
|
import { type Asset, type AssetUpload, type CreateAssetUploadRequest, type CreateAssetUploadResponse, type FinalizeAssetUploadRequest, type ListAssetsResponse } from './assets.js';
|
|
6
7
|
import { type CreateProjectRequest, type LedMapResponse, type Project, type UpdateLedMapRequest, type UpdateProjectRequest } from './projects.js';
|
|
7
8
|
import { type CreateGenerationJobRequest, type CreatePanelSetRequest, type CreatePanelSetResponse, type CreateVideoLoopRequest, type CreateVideoUpscaleRequest, type EditGenerationJobRequest, type GenerationJobResponse, type GenerationJobStatus, type ListGenerationJobsResponse } from './generation.js';
|
|
@@ -42,6 +43,20 @@ export declare function createZclApiClient(options: ZclApiClientOptions): {
|
|
|
42
43
|
create(input: CreateWorkspaceRequest): Promise<{
|
|
43
44
|
data: Workspace;
|
|
44
45
|
}>;
|
|
46
|
+
update(workspaceId: string, input: UpdateWorkspaceRequest): Promise<{
|
|
47
|
+
data: Workspace;
|
|
48
|
+
}>;
|
|
49
|
+
listMembers(workspaceId: string): Promise<ListMembersResponse>;
|
|
50
|
+
inviteMember(workspaceId: string, input: InviteMemberRequest): Promise<InviteMemberResponse>;
|
|
51
|
+
updateMemberRole(workspaceId: string, userId: string, input: UpdateMemberRoleRequest): Promise<{
|
|
52
|
+
data: z.infer<typeof workspaceMemberSchema>;
|
|
53
|
+
}>;
|
|
54
|
+
removeMember(workspaceId: string, userId: string): Promise<{
|
|
55
|
+
data: Record<string, never>;
|
|
56
|
+
}>;
|
|
57
|
+
revokeInvite(workspaceId: string, inviteId: string): Promise<{
|
|
58
|
+
data: Record<string, never>;
|
|
59
|
+
}>;
|
|
45
60
|
};
|
|
46
61
|
projects: {
|
|
47
62
|
list(workspaceId: string, options?: {
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"
|
|
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,KA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AAqB,CAAC;yBAQhB,MAAM,aAAa,MAAM,SAAS,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;0BAO3E,MAAM,aACR,MAAM,YACR;YAAE,MAAM,CAAC,EAAE,mBAAmB,CAAC;YAAC,cAAc,CAAC,EAAE,MAAM,CAAA;SAAE,GACjE,OAAO,CAAC,0BAA0B,CAAC;;;mCAiBvB,MAAM,aACR,MAAM,SACV,oBAAoB,GAC1B,OAAO,CAAC,qBAAqB,CAAC;;EAYtC;AAED,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAA"}
|
package/dist/client.js
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { authSessionResponseSchema, confirmPasswordResetSchema, loginRequestSchema, logoutResponseSchema, passwordResetResponseSchema, requestPasswordResetSchema, sessionResponseSchema, signupRequestSchema } from './auth.js';
|
|
3
3
|
import { errorResponseSchema, listResponseSchema } from './common.js';
|
|
4
4
|
import { creditBalanceResponseSchema } from './credits.js';
|
|
5
|
-
import { createWorkspaceRequestSchema, workspaceMembershipSchema, workspaceSchema } from './workspaces.js';
|
|
5
|
+
import { createWorkspaceRequestSchema, inviteMemberRequestSchema, inviteMemberResponseSchema, listMembersResponseSchema, updateMemberRoleRequestSchema, updateWorkspaceRequestSchema, workspaceMemberSchema, workspaceMembershipSchema, workspaceResponseSchema, workspaceSchema } from './workspaces.js';
|
|
6
6
|
import { assetSchema, createAssetUploadRequestSchema, createAssetUploadResponseSchema, finalizeAssetUploadRequestSchema, listAssetsResponseSchema } from './assets.js';
|
|
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';
|
|
@@ -117,10 +117,41 @@ export function createZclApiClient(options) {
|
|
|
117
117
|
return request('/workspaces', workspaceListResponseSchema);
|
|
118
118
|
},
|
|
119
119
|
create(input) {
|
|
120
|
-
return request('/workspaces',
|
|
120
|
+
return request('/workspaces', workspaceResponseSchema, {
|
|
121
121
|
method: 'POST',
|
|
122
122
|
body: createWorkspaceRequestSchema.parse(input)
|
|
123
123
|
});
|
|
124
|
+
},
|
|
125
|
+
update(workspaceId, input) {
|
|
126
|
+
return request(`/workspaces/${workspaceId}`, workspaceResponseSchema, {
|
|
127
|
+
method: 'PATCH',
|
|
128
|
+
body: updateWorkspaceRequestSchema.parse(input)
|
|
129
|
+
});
|
|
130
|
+
},
|
|
131
|
+
listMembers(workspaceId) {
|
|
132
|
+
return request(`/workspaces/${workspaceId}/members`, listMembersResponseSchema);
|
|
133
|
+
},
|
|
134
|
+
inviteMember(workspaceId, input) {
|
|
135
|
+
return request(`/workspaces/${workspaceId}/members`, inviteMemberResponseSchema, {
|
|
136
|
+
method: 'POST',
|
|
137
|
+
body: inviteMemberRequestSchema.parse(input)
|
|
138
|
+
});
|
|
139
|
+
},
|
|
140
|
+
updateMemberRole(workspaceId, userId, input) {
|
|
141
|
+
return request(`/workspaces/${workspaceId}/members/${userId}`, z.object({ data: workspaceMemberSchema }), {
|
|
142
|
+
method: 'PATCH',
|
|
143
|
+
body: updateMemberRoleRequestSchema.parse(input)
|
|
144
|
+
});
|
|
145
|
+
},
|
|
146
|
+
removeMember(workspaceId, userId) {
|
|
147
|
+
return request(`/workspaces/${workspaceId}/members/${userId}`, z.object({ data: z.object({}) }), {
|
|
148
|
+
method: 'DELETE'
|
|
149
|
+
});
|
|
150
|
+
},
|
|
151
|
+
revokeInvite(workspaceId, inviteId) {
|
|
152
|
+
return request(`/workspaces/${workspaceId}/invites/${inviteId}`, z.object({ data: z.object({}) }), {
|
|
153
|
+
method: 'DELETE'
|
|
154
|
+
});
|
|
124
155
|
}
|
|
125
156
|
},
|
|
126
157
|
projects: {
|
package/dist/workspaces.d.ts
CHANGED
|
@@ -44,10 +44,151 @@ export declare const workspaceMembershipSchema: z.ZodObject<{
|
|
|
44
44
|
disabled: "disabled";
|
|
45
45
|
}>;
|
|
46
46
|
}, z.core.$strip>;
|
|
47
|
+
export declare const updateWorkspaceRequestSchema: z.ZodObject<{
|
|
48
|
+
name: z.ZodString;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
export declare const workspaceResponseSchema: z.ZodObject<{
|
|
51
|
+
data: z.ZodObject<{
|
|
52
|
+
id: z.ZodString;
|
|
53
|
+
type: z.ZodEnum<{
|
|
54
|
+
personal: "personal";
|
|
55
|
+
organization: "organization";
|
|
56
|
+
}>;
|
|
57
|
+
name: z.ZodString;
|
|
58
|
+
slug: z.ZodString;
|
|
59
|
+
createdAt: z.ZodString;
|
|
60
|
+
updatedAt: z.ZodString;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
export declare const workspaceMemberSchema: z.ZodObject<{
|
|
64
|
+
userId: z.ZodString;
|
|
65
|
+
email: z.ZodString;
|
|
66
|
+
name: z.ZodString;
|
|
67
|
+
avatarUrl: z.ZodNullable<z.ZodString>;
|
|
68
|
+
role: z.ZodEnum<{
|
|
69
|
+
owner: "owner";
|
|
70
|
+
admin: "admin";
|
|
71
|
+
artist: "artist";
|
|
72
|
+
viewer: "viewer";
|
|
73
|
+
}>;
|
|
74
|
+
status: z.ZodEnum<{
|
|
75
|
+
active: "active";
|
|
76
|
+
invited: "invited";
|
|
77
|
+
disabled: "disabled";
|
|
78
|
+
}>;
|
|
79
|
+
createdAt: z.ZodString;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
export declare const workspaceInviteSchema: z.ZodObject<{
|
|
82
|
+
id: z.ZodString;
|
|
83
|
+
email: z.ZodString;
|
|
84
|
+
role: z.ZodEnum<{
|
|
85
|
+
owner: "owner";
|
|
86
|
+
admin: "admin";
|
|
87
|
+
artist: "artist";
|
|
88
|
+
viewer: "viewer";
|
|
89
|
+
}>;
|
|
90
|
+
invitedByUserId: z.ZodString;
|
|
91
|
+
createdAt: z.ZodString;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
export declare const listMembersResponseSchema: z.ZodObject<{
|
|
94
|
+
data: z.ZodObject<{
|
|
95
|
+
members: z.ZodArray<z.ZodObject<{
|
|
96
|
+
userId: z.ZodString;
|
|
97
|
+
email: z.ZodString;
|
|
98
|
+
name: z.ZodString;
|
|
99
|
+
avatarUrl: z.ZodNullable<z.ZodString>;
|
|
100
|
+
role: z.ZodEnum<{
|
|
101
|
+
owner: "owner";
|
|
102
|
+
admin: "admin";
|
|
103
|
+
artist: "artist";
|
|
104
|
+
viewer: "viewer";
|
|
105
|
+
}>;
|
|
106
|
+
status: z.ZodEnum<{
|
|
107
|
+
active: "active";
|
|
108
|
+
invited: "invited";
|
|
109
|
+
disabled: "disabled";
|
|
110
|
+
}>;
|
|
111
|
+
createdAt: z.ZodString;
|
|
112
|
+
}, z.core.$strip>>;
|
|
113
|
+
invites: z.ZodArray<z.ZodObject<{
|
|
114
|
+
id: z.ZodString;
|
|
115
|
+
email: z.ZodString;
|
|
116
|
+
role: z.ZodEnum<{
|
|
117
|
+
owner: "owner";
|
|
118
|
+
admin: "admin";
|
|
119
|
+
artist: "artist";
|
|
120
|
+
viewer: "viewer";
|
|
121
|
+
}>;
|
|
122
|
+
invitedByUserId: z.ZodString;
|
|
123
|
+
createdAt: z.ZodString;
|
|
124
|
+
}, z.core.$strip>>;
|
|
125
|
+
}, z.core.$strip>;
|
|
126
|
+
}, z.core.$strip>;
|
|
127
|
+
export declare const inviteMemberRequestSchema: z.ZodObject<{
|
|
128
|
+
email: z.ZodString;
|
|
129
|
+
role: z.ZodEnum<{
|
|
130
|
+
owner: "owner";
|
|
131
|
+
admin: "admin";
|
|
132
|
+
artist: "artist";
|
|
133
|
+
viewer: "viewer";
|
|
134
|
+
}>;
|
|
135
|
+
}, z.core.$strip>;
|
|
136
|
+
export declare const inviteMemberResponseSchema: z.ZodObject<{
|
|
137
|
+
data: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
138
|
+
kind: z.ZodLiteral<"member">;
|
|
139
|
+
member: z.ZodObject<{
|
|
140
|
+
userId: z.ZodString;
|
|
141
|
+
email: z.ZodString;
|
|
142
|
+
name: z.ZodString;
|
|
143
|
+
avatarUrl: z.ZodNullable<z.ZodString>;
|
|
144
|
+
role: z.ZodEnum<{
|
|
145
|
+
owner: "owner";
|
|
146
|
+
admin: "admin";
|
|
147
|
+
artist: "artist";
|
|
148
|
+
viewer: "viewer";
|
|
149
|
+
}>;
|
|
150
|
+
status: z.ZodEnum<{
|
|
151
|
+
active: "active";
|
|
152
|
+
invited: "invited";
|
|
153
|
+
disabled: "disabled";
|
|
154
|
+
}>;
|
|
155
|
+
createdAt: z.ZodString;
|
|
156
|
+
}, z.core.$strip>;
|
|
157
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
158
|
+
kind: z.ZodLiteral<"invite">;
|
|
159
|
+
invite: z.ZodObject<{
|
|
160
|
+
id: z.ZodString;
|
|
161
|
+
email: z.ZodString;
|
|
162
|
+
role: z.ZodEnum<{
|
|
163
|
+
owner: "owner";
|
|
164
|
+
admin: "admin";
|
|
165
|
+
artist: "artist";
|
|
166
|
+
viewer: "viewer";
|
|
167
|
+
}>;
|
|
168
|
+
invitedByUserId: z.ZodString;
|
|
169
|
+
createdAt: z.ZodString;
|
|
170
|
+
}, z.core.$strip>;
|
|
171
|
+
}, z.core.$strip>], "kind">;
|
|
172
|
+
}, z.core.$strip>;
|
|
173
|
+
export declare const updateMemberRoleRequestSchema: z.ZodObject<{
|
|
174
|
+
role: z.ZodEnum<{
|
|
175
|
+
owner: "owner";
|
|
176
|
+
admin: "admin";
|
|
177
|
+
artist: "artist";
|
|
178
|
+
viewer: "viewer";
|
|
179
|
+
}>;
|
|
180
|
+
}, z.core.$strip>;
|
|
47
181
|
export type CreateWorkspaceRequest = z.input<typeof createWorkspaceRequestSchema>;
|
|
182
|
+
export type UpdateWorkspaceRequest = z.input<typeof updateWorkspaceRequestSchema>;
|
|
48
183
|
export type Workspace = z.infer<typeof workspaceSchema>;
|
|
49
184
|
export type WorkspaceMembership = z.infer<typeof workspaceMembershipSchema>;
|
|
50
185
|
export type WorkspaceMembershipStatus = z.infer<typeof workspaceMembershipStatusSchema>;
|
|
186
|
+
export type WorkspaceMember = z.infer<typeof workspaceMemberSchema>;
|
|
187
|
+
export type WorkspaceInvite = z.infer<typeof workspaceInviteSchema>;
|
|
188
|
+
export type ListMembersResponse = z.infer<typeof listMembersResponseSchema>;
|
|
189
|
+
export type InviteMemberRequest = z.input<typeof inviteMemberRequestSchema>;
|
|
190
|
+
export type InviteMemberResponse = z.infer<typeof inviteMemberResponseSchema>;
|
|
191
|
+
export type UpdateMemberRoleRequest = z.input<typeof updateMemberRoleRequestSchema>;
|
|
51
192
|
export type WorkspaceRole = z.infer<typeof workspaceRoleSchema>;
|
|
52
193
|
export type WorkspaceType = z.infer<typeof workspaceTypeSchema>;
|
|
53
194
|
//# sourceMappingURL=workspaces.d.ts.map
|
package/dist/workspaces.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspaces.d.ts","sourceRoot":"","sources":["../src/workspaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,mBAAmB;;;EAAuC,CAAA;AACvE,eAAO,MAAM,mBAAmB;;;;;EAAiD,CAAA;AACjF,eAAO,MAAM,+BAA+B;;;;EAA4C,CAAA;AAExF,eAAO,MAAM,eAAe;;;;;;;;;;iBAO1B,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;iBAGvC,CAAA;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;iBAKpC,CAAA;AAEF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,C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oDateSchema } from './common.js';
|
|
2
|
+
import { apiSuccessSchema, idSchema, isoDateSchema } from './common.js';
|
|
3
3
|
export const workspaceTypeSchema = z.enum(['personal', 'organization']);
|
|
4
4
|
export const workspaceRoleSchema = z.enum(['owner', 'admin', 'artist', 'viewer']);
|
|
5
5
|
export const workspaceMembershipStatusSchema = z.enum(['active', 'invited', 'disabled']);
|
|
@@ -21,3 +21,42 @@ export const workspaceMembershipSchema = z.object({
|
|
|
21
21
|
role: workspaceRoleSchema,
|
|
22
22
|
status: workspaceMembershipStatusSchema
|
|
23
23
|
});
|
|
24
|
+
export const updateWorkspaceRequestSchema = z.object({
|
|
25
|
+
name: z.string().trim().min(1).max(120)
|
|
26
|
+
});
|
|
27
|
+
// Single-workspace response wrapper, reused by `create` and `update`.
|
|
28
|
+
export const workspaceResponseSchema = apiSuccessSchema(workspaceSchema);
|
|
29
|
+
// A member row enriched with the user's identity for display in Settings.
|
|
30
|
+
export const workspaceMemberSchema = z.object({
|
|
31
|
+
userId: idSchema,
|
|
32
|
+
email: z.string().email(),
|
|
33
|
+
name: z.string(),
|
|
34
|
+
avatarUrl: z.string().nullable(),
|
|
35
|
+
role: workspaceRoleSchema,
|
|
36
|
+
status: workspaceMembershipStatusSchema,
|
|
37
|
+
createdAt: isoDateSchema
|
|
38
|
+
});
|
|
39
|
+
// A pending invite (no user row yet) — materialized into a membership on first SSO login.
|
|
40
|
+
export const workspaceInviteSchema = z.object({
|
|
41
|
+
id: idSchema,
|
|
42
|
+
email: z.string().email(),
|
|
43
|
+
role: workspaceRoleSchema,
|
|
44
|
+
invitedByUserId: idSchema,
|
|
45
|
+
createdAt: isoDateSchema
|
|
46
|
+
});
|
|
47
|
+
export const listMembersResponseSchema = apiSuccessSchema(z.object({
|
|
48
|
+
members: z.array(workspaceMemberSchema),
|
|
49
|
+
invites: z.array(workspaceInviteSchema)
|
|
50
|
+
}));
|
|
51
|
+
export const inviteMemberRequestSchema = z.object({
|
|
52
|
+
email: z.string().email(),
|
|
53
|
+
role: workspaceRoleSchema
|
|
54
|
+
});
|
|
55
|
+
// Inviting an existing+known user adds them immediately; a new email becomes a pending invite.
|
|
56
|
+
export const inviteMemberResponseSchema = apiSuccessSchema(z.discriminatedUnion('kind', [
|
|
57
|
+
z.object({ kind: z.literal('member'), member: workspaceMemberSchema }),
|
|
58
|
+
z.object({ kind: z.literal('invite'), invite: workspaceInviteSchema })
|
|
59
|
+
]));
|
|
60
|
+
export const updateMemberRoleRequestSchema = z.object({
|
|
61
|
+
role: workspaceRoleSchema
|
|
62
|
+
});
|