@middlewr/contracts 0.0.4 → 0.0.6

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/cjs/index.d.ts CHANGED
@@ -7,14 +7,16 @@ export * from './users.schema';
7
7
  export * from './workspaces.schema';
8
8
  export declare const usersContract: {
9
9
  me: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, z.ZodObject<{
10
- id: z.ZodString;
11
- external_id: z.ZodString;
12
- email: z.ZodString;
13
- email_verified_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
14
- first_name: z.ZodNullable<z.ZodString>;
15
- last_name: z.ZodNullable<z.ZodString>;
16
- created_at: z.ZodCoercedDate<unknown>;
17
- updated_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
10
+ user: z.ZodObject<{
11
+ id: z.ZodString;
12
+ external_id: z.ZodString;
13
+ email: z.ZodString;
14
+ email_verified_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
15
+ first_name: z.ZodNullable<z.ZodString>;
16
+ last_name: z.ZodNullable<z.ZodString>;
17
+ created_at: z.ZodCoercedDate<unknown>;
18
+ updated_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
19
+ }, z.core.$strip>;
18
20
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
19
21
  signIn: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
20
22
  first_name: z.ZodOptional<z.ZodString>;
@@ -39,14 +41,16 @@ export declare const usersContract: {
39
41
  first_name: z.ZodOptional<z.ZodString>;
40
42
  last_name: z.ZodOptional<z.ZodString>;
41
43
  }, z.core.$strip>, z.ZodObject<{
42
- id: z.ZodString;
43
- external_id: z.ZodString;
44
- email: z.ZodString;
45
- email_verified_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
46
- first_name: z.ZodNullable<z.ZodString>;
47
- last_name: z.ZodNullable<z.ZodString>;
48
- created_at: z.ZodCoercedDate<unknown>;
49
- updated_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
44
+ user: z.ZodObject<{
45
+ id: z.ZodString;
46
+ external_id: z.ZodString;
47
+ email: z.ZodString;
48
+ email_verified_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
49
+ first_name: z.ZodNullable<z.ZodString>;
50
+ last_name: z.ZodNullable<z.ZodString>;
51
+ created_at: z.ZodCoercedDate<unknown>;
52
+ updated_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
53
+ }, z.core.$strip>;
50
54
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
51
55
  };
52
56
  export declare const workspacesContract: {
@@ -392,14 +396,16 @@ export declare const tagsContract: {
392
396
  export declare const contract: {
393
397
  users: {
394
398
  me: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, z.ZodObject<{
395
- id: z.ZodString;
396
- external_id: z.ZodString;
397
- email: z.ZodString;
398
- email_verified_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
399
- first_name: z.ZodNullable<z.ZodString>;
400
- last_name: z.ZodNullable<z.ZodString>;
401
- created_at: z.ZodCoercedDate<unknown>;
402
- updated_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
399
+ user: z.ZodObject<{
400
+ id: z.ZodString;
401
+ external_id: z.ZodString;
402
+ email: z.ZodString;
403
+ email_verified_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
404
+ first_name: z.ZodNullable<z.ZodString>;
405
+ last_name: z.ZodNullable<z.ZodString>;
406
+ created_at: z.ZodCoercedDate<unknown>;
407
+ updated_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
408
+ }, z.core.$strip>;
403
409
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
404
410
  signIn: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
405
411
  first_name: z.ZodOptional<z.ZodString>;
@@ -424,14 +430,16 @@ export declare const contract: {
424
430
  first_name: z.ZodOptional<z.ZodString>;
425
431
  last_name: z.ZodOptional<z.ZodString>;
426
432
  }, z.core.$strip>, z.ZodObject<{
427
- id: z.ZodString;
428
- external_id: z.ZodString;
429
- email: z.ZodString;
430
- email_verified_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
431
- first_name: z.ZodNullable<z.ZodString>;
432
- last_name: z.ZodNullable<z.ZodString>;
433
- created_at: z.ZodCoercedDate<unknown>;
434
- updated_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
433
+ user: z.ZodObject<{
434
+ id: z.ZodString;
435
+ external_id: z.ZodString;
436
+ email: z.ZodString;
437
+ email_verified_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
438
+ first_name: z.ZodNullable<z.ZodString>;
439
+ last_name: z.ZodNullable<z.ZodString>;
440
+ created_at: z.ZodCoercedDate<unknown>;
441
+ updated_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
442
+ }, z.core.$strip>;
435
443
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
436
444
  };
437
445
  workspaces: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE3D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAyBxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAE9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AAGpC,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CASzB,CAAC;AAGF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkD9B,CAAC;AAGF,eAAO,MAAM,m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C;AAEF,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC;AACvC,MAAM,MAAM,MAAM,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAC"}
package/cjs/index.js CHANGED
@@ -252,43 +252,43 @@ var CreateInvitationInputSchema = import_zod5.z.object({
252
252
 
253
253
  // src/contracts/index.ts
254
254
  var usersContract = {
255
- me: import_contract.oc.route({ method: "GET", path: "/api/users/me" }).output(UserSchema),
255
+ me: import_contract.oc.route({ method: "GET", path: "/api/users/me" }).output(import_zod6.z.object({ user: UserSchema })),
256
256
  signIn: import_contract.oc.route({ method: "POST", path: "/api/users" }).input(SignInInputSchema).output(import_zod6.z.object({ user: UserSchema, status: import_zod6.z.enum(["created", "existing"]) })),
257
- update: import_contract.oc.route({ method: "PATCH", path: "/api/users/me" }).input(UpdateUserInputSchema).output(UserSchema)
257
+ update: import_contract.oc.route({ method: "PATCH", path: "/api/users/me" }).input(UpdateUserInputSchema).output(import_zod6.z.object({ user: UserSchema }))
258
258
  };
259
259
  var workspacesContract = {
260
260
  create: import_contract.oc.route({ method: "POST", path: "/api/workspaces" }).input(CreateWorkspaceInputSchema).output(WorkspaceSchema),
261
261
  list: import_contract.oc.route({ method: "GET", path: "/api/workspaces" }).output(import_zod6.z.array(WorkspaceWithCountSchema)),
262
- get: import_contract.oc.route({ method: "GET", path: "/api/workspaces/{workspaceId}" }).input(WorkspaceIdParamSchema).output(WorkspaceWithCountSchema),
263
- update: import_contract.oc.route({ method: "PATCH", path: "/api/workspaces/{workspaceId}" }).input(WorkspaceIdParamSchema.merge(UpdateWorkspaceInputSchema)).output(WorkspaceSchema),
264
- delete: import_contract.oc.route({ method: "DELETE", path: "/api/workspaces/{workspaceId}" }).input(WorkspaceIdParamSchema).output(import_zod6.z.void()),
265
- transfer: import_contract.oc.route({ method: "POST", path: "/api/workspaces/{workspaceId}/transfer" }).input(WorkspaceIdParamSchema.merge(TransferOwnershipInputSchema)).output(import_zod6.z.void()),
262
+ get: import_contract.oc.route({ method: "GET", path: "/api/workspaces/{workspace_id}" }).input(WorkspaceIdParamSchema).output(WorkspaceWithCountSchema),
263
+ update: import_contract.oc.route({ method: "PATCH", path: "/api/workspaces/{workspace_id}" }).input(WorkspaceIdParamSchema.merge(UpdateWorkspaceInputSchema)).output(WorkspaceSchema),
264
+ delete: import_contract.oc.route({ method: "DELETE", path: "/api/workspaces/{workspace_id}" }).input(WorkspaceIdParamSchema).output(import_zod6.z.void()),
265
+ transfer: import_contract.oc.route({ method: "POST", path: "/api/workspaces/{workspace_id}/transfer" }).input(WorkspaceIdParamSchema.merge(TransferOwnershipInputSchema)).output(import_zod6.z.void()),
266
266
  // Members
267
- listMembers: import_contract.oc.route({ method: "GET", path: "/api/workspaces/{workspaceId}/members" }).input(WorkspaceIdParamSchema).output(import_zod6.z.array(WorkspaceMemberSchema)),
268
- updateMember: import_contract.oc.route({ method: "PATCH", path: "/api/workspaces/{workspaceId}/members/{userId}" }).input(MemberIdParamSchema.merge(UpdateMemberInputSchema)).output(WorkspaceMemberSchema),
269
- removeMember: import_contract.oc.route({ method: "DELETE", path: "/api/workspaces/{workspaceId}/members/{userId}" }).input(MemberIdParamSchema).output(import_zod6.z.void()),
267
+ listMembers: import_contract.oc.route({ method: "GET", path: "/api/workspaces/{workspace_id}/members" }).input(WorkspaceIdParamSchema).output(import_zod6.z.array(WorkspaceMemberSchema)),
268
+ updateMember: import_contract.oc.route({ method: "PATCH", path: "/api/workspaces/{workspace_id}/members/{user_id}" }).input(MemberIdParamSchema.merge(UpdateMemberInputSchema)).output(WorkspaceMemberSchema),
269
+ removeMember: import_contract.oc.route({ method: "DELETE", path: "/api/workspaces/{workspace_id}/members/{user_id}" }).input(MemberIdParamSchema).output(import_zod6.z.void()),
270
270
  // Invitations
271
- listInvitations: import_contract.oc.route({ method: "GET", path: "/api/workspaces/{workspaceId}/invitations" }).input(WorkspaceIdParamSchema).output(import_zod6.z.array(WorkspaceInvitationSchema)),
272
- createInvitation: import_contract.oc.route({ method: "POST", path: "/api/workspaces/{workspaceId}/invitations" }).input(WorkspaceIdParamSchema.merge(CreateInvitationInputSchema)).output(WorkspaceInvitationSchema),
273
- revokeInvitation: import_contract.oc.route({ method: "DELETE", path: "/api/workspaces/{workspaceId}/invitations/{invitationId}" }).input(InvitationIdParamSchema).output(import_zod6.z.void())
271
+ listInvitations: import_contract.oc.route({ method: "GET", path: "/api/workspaces/{workspace_id}/invitations" }).input(WorkspaceIdParamSchema).output(import_zod6.z.array(WorkspaceInvitationSchema)),
272
+ createInvitation: import_contract.oc.route({ method: "POST", path: "/api/workspaces/{workspace_id}/invitations" }).input(WorkspaceIdParamSchema.merge(CreateInvitationInputSchema)).output(WorkspaceInvitationSchema),
273
+ revokeInvitation: import_contract.oc.route({ method: "DELETE", path: "/api/workspaces/{workspace_id}/invitations/{invitation_id}" }).input(InvitationIdParamSchema).output(import_zod6.z.void())
274
274
  };
275
275
  var invitationsContract = {
276
276
  get: import_contract.oc.route({ method: "GET", path: "/api/invitations/{token}" }).input(TokenParamSchema).output(WorkspaceInvitationSchema),
277
277
  accept: import_contract.oc.route({ method: "POST", path: "/api/invitations/{token}/accept" }).input(TokenParamSchema).output(WorkspaceMemberSchema)
278
278
  };
279
279
  var linksContract = {
280
- create: import_contract.oc.route({ method: "POST", path: "/api/workspaces/{workspaceId}/links" }).input(WorkspaceIdParamSchema.merge(CreateLinkInputSchema)).output(LinkSchema),
281
- list: import_contract.oc.route({ method: "GET", path: "/api/workspaces/{workspaceId}/links" }).input(WorkspaceIdParamSchema.merge(LinkFiltersSchema)).output(PaginatedLinksSchema),
282
- get: import_contract.oc.route({ method: "GET", path: "/api/workspaces/{workspaceId}/links/{linkId}" }).input(LinkIdParamSchema).output(LinkSchema),
283
- update: import_contract.oc.route({ method: "PATCH", path: "/api/workspaces/{workspaceId}/links/{linkId}" }).input(LinkIdParamSchema.merge(UpdateLinkInputSchema)).output(LinkSchema),
284
- delete: import_contract.oc.route({ method: "DELETE", path: "/api/workspaces/{workspaceId}/links/{linkId}" }).input(LinkIdParamSchema).output(import_zod6.z.void())
280
+ create: import_contract.oc.route({ method: "POST", path: "/api/workspaces/{workspace_id}/links" }).input(WorkspaceIdParamSchema.merge(CreateLinkInputSchema)).output(LinkSchema),
281
+ list: import_contract.oc.route({ method: "GET", path: "/api/workspaces/{workspace_id}/links" }).input(WorkspaceIdParamSchema.merge(LinkFiltersSchema)).output(PaginatedLinksSchema),
282
+ get: import_contract.oc.route({ method: "GET", path: "/api/workspaces/{workspace_id}/links/{link_id}" }).input(LinkIdParamSchema).output(LinkSchema),
283
+ update: import_contract.oc.route({ method: "PATCH", path: "/api/workspaces/{workspace_id}/links/{link_id}" }).input(LinkIdParamSchema.merge(UpdateLinkInputSchema)).output(LinkSchema),
284
+ delete: import_contract.oc.route({ method: "DELETE", path: "/api/workspaces/{workspace_id}/links/{link_id}" }).input(LinkIdParamSchema).output(import_zod6.z.void())
285
285
  };
286
286
  var tagsContract = {
287
- create: import_contract.oc.route({ method: "POST", path: "/api/workspaces/{workspaceId}/tags" }).input(WorkspaceIdParamSchema.merge(CreateTagInputSchema)).output(TagSchema),
288
- list: import_contract.oc.route({ method: "GET", path: "/api/workspaces/{workspaceId}/tags" }).input(WorkspaceIdParamSchema).output(import_zod6.z.array(TagSchema)),
289
- get: import_contract.oc.route({ method: "GET", path: "/api/workspaces/{workspaceId}/tags/{tagId}" }).input(TagIdParamSchema).output(TagSchema),
290
- update: import_contract.oc.route({ method: "PATCH", path: "/api/workspaces/{workspaceId}/tags/{tagId}" }).input(TagIdParamSchema.merge(UpdateTagInputSchema)).output(TagSchema),
291
- delete: import_contract.oc.route({ method: "DELETE", path: "/api/workspaces/{workspaceId}/tags/{tagId}" }).input(TagIdParamSchema).output(import_zod6.z.void())
287
+ create: import_contract.oc.route({ method: "POST", path: "/api/workspaces/{workspace_id}/tags" }).input(WorkspaceIdParamSchema.merge(CreateTagInputSchema)).output(TagSchema),
288
+ list: import_contract.oc.route({ method: "GET", path: "/api/workspaces/{workspace_id}/tags" }).input(WorkspaceIdParamSchema).output(import_zod6.z.array(TagSchema)),
289
+ get: import_contract.oc.route({ method: "GET", path: "/api/workspaces/{workspace_id}/tags/{tag_id}" }).input(TagIdParamSchema).output(TagSchema),
290
+ update: import_contract.oc.route({ method: "PATCH", path: "/api/workspaces/{workspace_id}/tags/{tag_id}" }).input(TagIdParamSchema.merge(UpdateTagInputSchema)).output(TagSchema),
291
+ delete: import_contract.oc.route({ method: "DELETE", path: "/api/workspaces/{workspace_id}/tags/{tag_id}" }).input(TagIdParamSchema).output(import_zod6.z.void())
292
292
  };
293
293
  var contract = {
294
294
  users: usersContract,
package/esm/index.d.ts CHANGED
@@ -7,14 +7,16 @@ export * from './users.schema';
7
7
  export * from './workspaces.schema';
8
8
  export declare const usersContract: {
9
9
  me: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, z.ZodObject<{
10
- id: z.ZodString;
11
- external_id: z.ZodString;
12
- email: z.ZodString;
13
- email_verified_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
14
- first_name: z.ZodNullable<z.ZodString>;
15
- last_name: z.ZodNullable<z.ZodString>;
16
- created_at: z.ZodCoercedDate<unknown>;
17
- updated_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
10
+ user: z.ZodObject<{
11
+ id: z.ZodString;
12
+ external_id: z.ZodString;
13
+ email: z.ZodString;
14
+ email_verified_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
15
+ first_name: z.ZodNullable<z.ZodString>;
16
+ last_name: z.ZodNullable<z.ZodString>;
17
+ created_at: z.ZodCoercedDate<unknown>;
18
+ updated_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
19
+ }, z.core.$strip>;
18
20
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
19
21
  signIn: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
20
22
  first_name: z.ZodOptional<z.ZodString>;
@@ -39,14 +41,16 @@ export declare const usersContract: {
39
41
  first_name: z.ZodOptional<z.ZodString>;
40
42
  last_name: z.ZodOptional<z.ZodString>;
41
43
  }, z.core.$strip>, z.ZodObject<{
42
- id: z.ZodString;
43
- external_id: z.ZodString;
44
- email: z.ZodString;
45
- email_verified_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
46
- first_name: z.ZodNullable<z.ZodString>;
47
- last_name: z.ZodNullable<z.ZodString>;
48
- created_at: z.ZodCoercedDate<unknown>;
49
- updated_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
44
+ user: z.ZodObject<{
45
+ id: z.ZodString;
46
+ external_id: z.ZodString;
47
+ email: z.ZodString;
48
+ email_verified_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
49
+ first_name: z.ZodNullable<z.ZodString>;
50
+ last_name: z.ZodNullable<z.ZodString>;
51
+ created_at: z.ZodCoercedDate<unknown>;
52
+ updated_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
53
+ }, z.core.$strip>;
50
54
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
51
55
  };
52
56
  export declare const workspacesContract: {
@@ -392,14 +396,16 @@ export declare const tagsContract: {
392
396
  export declare const contract: {
393
397
  users: {
394
398
  me: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, z.ZodObject<{
395
- id: z.ZodString;
396
- external_id: z.ZodString;
397
- email: z.ZodString;
398
- email_verified_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
399
- first_name: z.ZodNullable<z.ZodString>;
400
- last_name: z.ZodNullable<z.ZodString>;
401
- created_at: z.ZodCoercedDate<unknown>;
402
- updated_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
399
+ user: z.ZodObject<{
400
+ id: z.ZodString;
401
+ external_id: z.ZodString;
402
+ email: z.ZodString;
403
+ email_verified_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
404
+ first_name: z.ZodNullable<z.ZodString>;
405
+ last_name: z.ZodNullable<z.ZodString>;
406
+ created_at: z.ZodCoercedDate<unknown>;
407
+ updated_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
408
+ }, z.core.$strip>;
403
409
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
404
410
  signIn: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
405
411
  first_name: z.ZodOptional<z.ZodString>;
@@ -424,14 +430,16 @@ export declare const contract: {
424
430
  first_name: z.ZodOptional<z.ZodString>;
425
431
  last_name: z.ZodOptional<z.ZodString>;
426
432
  }, z.core.$strip>, z.ZodObject<{
427
- id: z.ZodString;
428
- external_id: z.ZodString;
429
- email: z.ZodString;
430
- email_verified_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
431
- first_name: z.ZodNullable<z.ZodString>;
432
- last_name: z.ZodNullable<z.ZodString>;
433
- created_at: z.ZodCoercedDate<unknown>;
434
- updated_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
433
+ user: z.ZodObject<{
434
+ id: z.ZodString;
435
+ external_id: z.ZodString;
436
+ email: z.ZodString;
437
+ email_verified_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
438
+ first_name: z.ZodNullable<z.ZodString>;
439
+ last_name: z.ZodNullable<z.ZodString>;
440
+ created_at: z.ZodCoercedDate<unknown>;
441
+ updated_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
442
+ }, z.core.$strip>;
435
443
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
436
444
  };
437
445
  workspaces: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE3D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAyBxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAE9B,cAAc,gBAAgB,CAAC;AAC/B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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMpB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC;AACvC,MAAM,MAAM,MAAM,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAC"}
package/esm/index.js CHANGED
@@ -197,43 +197,43 @@ var CreateInvitationInputSchema = z5.object({
197
197
 
198
198
  // src/contracts/index.ts
199
199
  var usersContract = {
200
- me: oc.route({ method: "GET", path: "/api/users/me" }).output(UserSchema),
200
+ me: oc.route({ method: "GET", path: "/api/users/me" }).output(z6.object({ user: UserSchema })),
201
201
  signIn: oc.route({ method: "POST", path: "/api/users" }).input(SignInInputSchema).output(z6.object({ user: UserSchema, status: z6.enum(["created", "existing"]) })),
202
- update: oc.route({ method: "PATCH", path: "/api/users/me" }).input(UpdateUserInputSchema).output(UserSchema)
202
+ update: oc.route({ method: "PATCH", path: "/api/users/me" }).input(UpdateUserInputSchema).output(z6.object({ user: UserSchema }))
203
203
  };
204
204
  var workspacesContract = {
205
205
  create: oc.route({ method: "POST", path: "/api/workspaces" }).input(CreateWorkspaceInputSchema).output(WorkspaceSchema),
206
206
  list: oc.route({ method: "GET", path: "/api/workspaces" }).output(z6.array(WorkspaceWithCountSchema)),
207
- get: oc.route({ method: "GET", path: "/api/workspaces/{workspaceId}" }).input(WorkspaceIdParamSchema).output(WorkspaceWithCountSchema),
208
- update: oc.route({ method: "PATCH", path: "/api/workspaces/{workspaceId}" }).input(WorkspaceIdParamSchema.merge(UpdateWorkspaceInputSchema)).output(WorkspaceSchema),
209
- delete: oc.route({ method: "DELETE", path: "/api/workspaces/{workspaceId}" }).input(WorkspaceIdParamSchema).output(z6.void()),
210
- transfer: oc.route({ method: "POST", path: "/api/workspaces/{workspaceId}/transfer" }).input(WorkspaceIdParamSchema.merge(TransferOwnershipInputSchema)).output(z6.void()),
207
+ get: oc.route({ method: "GET", path: "/api/workspaces/{workspace_id}" }).input(WorkspaceIdParamSchema).output(WorkspaceWithCountSchema),
208
+ update: oc.route({ method: "PATCH", path: "/api/workspaces/{workspace_id}" }).input(WorkspaceIdParamSchema.merge(UpdateWorkspaceInputSchema)).output(WorkspaceSchema),
209
+ delete: oc.route({ method: "DELETE", path: "/api/workspaces/{workspace_id}" }).input(WorkspaceIdParamSchema).output(z6.void()),
210
+ transfer: oc.route({ method: "POST", path: "/api/workspaces/{workspace_id}/transfer" }).input(WorkspaceIdParamSchema.merge(TransferOwnershipInputSchema)).output(z6.void()),
211
211
  // Members
212
- listMembers: oc.route({ method: "GET", path: "/api/workspaces/{workspaceId}/members" }).input(WorkspaceIdParamSchema).output(z6.array(WorkspaceMemberSchema)),
213
- updateMember: oc.route({ method: "PATCH", path: "/api/workspaces/{workspaceId}/members/{userId}" }).input(MemberIdParamSchema.merge(UpdateMemberInputSchema)).output(WorkspaceMemberSchema),
214
- removeMember: oc.route({ method: "DELETE", path: "/api/workspaces/{workspaceId}/members/{userId}" }).input(MemberIdParamSchema).output(z6.void()),
212
+ listMembers: oc.route({ method: "GET", path: "/api/workspaces/{workspace_id}/members" }).input(WorkspaceIdParamSchema).output(z6.array(WorkspaceMemberSchema)),
213
+ updateMember: oc.route({ method: "PATCH", path: "/api/workspaces/{workspace_id}/members/{user_id}" }).input(MemberIdParamSchema.merge(UpdateMemberInputSchema)).output(WorkspaceMemberSchema),
214
+ removeMember: oc.route({ method: "DELETE", path: "/api/workspaces/{workspace_id}/members/{user_id}" }).input(MemberIdParamSchema).output(z6.void()),
215
215
  // Invitations
216
- listInvitations: oc.route({ method: "GET", path: "/api/workspaces/{workspaceId}/invitations" }).input(WorkspaceIdParamSchema).output(z6.array(WorkspaceInvitationSchema)),
217
- createInvitation: oc.route({ method: "POST", path: "/api/workspaces/{workspaceId}/invitations" }).input(WorkspaceIdParamSchema.merge(CreateInvitationInputSchema)).output(WorkspaceInvitationSchema),
218
- revokeInvitation: oc.route({ method: "DELETE", path: "/api/workspaces/{workspaceId}/invitations/{invitationId}" }).input(InvitationIdParamSchema).output(z6.void())
216
+ listInvitations: oc.route({ method: "GET", path: "/api/workspaces/{workspace_id}/invitations" }).input(WorkspaceIdParamSchema).output(z6.array(WorkspaceInvitationSchema)),
217
+ createInvitation: oc.route({ method: "POST", path: "/api/workspaces/{workspace_id}/invitations" }).input(WorkspaceIdParamSchema.merge(CreateInvitationInputSchema)).output(WorkspaceInvitationSchema),
218
+ revokeInvitation: oc.route({ method: "DELETE", path: "/api/workspaces/{workspace_id}/invitations/{invitation_id}" }).input(InvitationIdParamSchema).output(z6.void())
219
219
  };
220
220
  var invitationsContract = {
221
221
  get: oc.route({ method: "GET", path: "/api/invitations/{token}" }).input(TokenParamSchema).output(WorkspaceInvitationSchema),
222
222
  accept: oc.route({ method: "POST", path: "/api/invitations/{token}/accept" }).input(TokenParamSchema).output(WorkspaceMemberSchema)
223
223
  };
224
224
  var linksContract = {
225
- create: oc.route({ method: "POST", path: "/api/workspaces/{workspaceId}/links" }).input(WorkspaceIdParamSchema.merge(CreateLinkInputSchema)).output(LinkSchema),
226
- list: oc.route({ method: "GET", path: "/api/workspaces/{workspaceId}/links" }).input(WorkspaceIdParamSchema.merge(LinkFiltersSchema)).output(PaginatedLinksSchema),
227
- get: oc.route({ method: "GET", path: "/api/workspaces/{workspaceId}/links/{linkId}" }).input(LinkIdParamSchema).output(LinkSchema),
228
- update: oc.route({ method: "PATCH", path: "/api/workspaces/{workspaceId}/links/{linkId}" }).input(LinkIdParamSchema.merge(UpdateLinkInputSchema)).output(LinkSchema),
229
- delete: oc.route({ method: "DELETE", path: "/api/workspaces/{workspaceId}/links/{linkId}" }).input(LinkIdParamSchema).output(z6.void())
225
+ create: oc.route({ method: "POST", path: "/api/workspaces/{workspace_id}/links" }).input(WorkspaceIdParamSchema.merge(CreateLinkInputSchema)).output(LinkSchema),
226
+ list: oc.route({ method: "GET", path: "/api/workspaces/{workspace_id}/links" }).input(WorkspaceIdParamSchema.merge(LinkFiltersSchema)).output(PaginatedLinksSchema),
227
+ get: oc.route({ method: "GET", path: "/api/workspaces/{workspace_id}/links/{link_id}" }).input(LinkIdParamSchema).output(LinkSchema),
228
+ update: oc.route({ method: "PATCH", path: "/api/workspaces/{workspace_id}/links/{link_id}" }).input(LinkIdParamSchema.merge(UpdateLinkInputSchema)).output(LinkSchema),
229
+ delete: oc.route({ method: "DELETE", path: "/api/workspaces/{workspace_id}/links/{link_id}" }).input(LinkIdParamSchema).output(z6.void())
230
230
  };
231
231
  var tagsContract = {
232
- create: oc.route({ method: "POST", path: "/api/workspaces/{workspaceId}/tags" }).input(WorkspaceIdParamSchema.merge(CreateTagInputSchema)).output(TagSchema),
233
- list: oc.route({ method: "GET", path: "/api/workspaces/{workspaceId}/tags" }).input(WorkspaceIdParamSchema).output(z6.array(TagSchema)),
234
- get: oc.route({ method: "GET", path: "/api/workspaces/{workspaceId}/tags/{tagId}" }).input(TagIdParamSchema).output(TagSchema),
235
- update: oc.route({ method: "PATCH", path: "/api/workspaces/{workspaceId}/tags/{tagId}" }).input(TagIdParamSchema.merge(UpdateTagInputSchema)).output(TagSchema),
236
- delete: oc.route({ method: "DELETE", path: "/api/workspaces/{workspaceId}/tags/{tagId}" }).input(TagIdParamSchema).output(z6.void())
232
+ create: oc.route({ method: "POST", path: "/api/workspaces/{workspace_id}/tags" }).input(WorkspaceIdParamSchema.merge(CreateTagInputSchema)).output(TagSchema),
233
+ list: oc.route({ method: "GET", path: "/api/workspaces/{workspace_id}/tags" }).input(WorkspaceIdParamSchema).output(z6.array(TagSchema)),
234
+ get: oc.route({ method: "GET", path: "/api/workspaces/{workspace_id}/tags/{tag_id}" }).input(TagIdParamSchema).output(TagSchema),
235
+ update: oc.route({ method: "PATCH", path: "/api/workspaces/{workspace_id}/tags/{tag_id}" }).input(TagIdParamSchema.merge(UpdateTagInputSchema)).output(TagSchema),
236
+ delete: oc.route({ method: "DELETE", path: "/api/workspaces/{workspace_id}/tags/{tag_id}" }).input(TagIdParamSchema).output(z6.void())
237
237
  };
238
238
  var contract = {
239
239
  users: usersContract,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middlewr/contracts",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "main": "./cjs/index.js",
5
5
  "module": "./esm/index.js",
6
6
  "types": "./esm/index.d.ts",