@dakkitor/api-contracts 1.1.1 → 1.1.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"client-contacts.contract.d.ts","sourceRoot":"","sources":["../../contracts/client-contacts/client-contacts.contract.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA4BxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAa9B,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;iBAOpC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;iBAExC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;iBAIb,CAAC;AAE1B,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;iBAapC,CAAC;AAIH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC9E,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,6BAA6B,CACrC,CAAC;AACF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC9E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE9E,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqGlC,CAAC"}
1
+ {"version":3,"file":"client-contacts.contract.d.ts","sourceRoot":"","sources":["../../contracts/client-contacts/client-contacts.contract.ts"],"names":[],"mappings":"AACA,OA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgGxB,CAAC;AAIX,eAAO,MAAM,sBAAsB,EACD,OAAO,4BAA4B,CAAC"}
@@ -17,27 +17,27 @@ const ClientContactSortableFieldsSchema = zod_1.z.enum([
17
17
  ]);
18
18
  // Shared Schemas
19
19
  const ResourceIdSchema = zod_1.z.object({
20
- id: zod_1.z.uuid(),
20
+ id: zod_1.z.string().uuid(),
21
21
  });
22
22
  // User Schema (duplicated from clients for now to avoid export issues, ideally should be in common)
23
23
  const UserSchema = zod_1.z.object({
24
- id: zod_1.z.uuid(),
24
+ id: zod_1.z.string().uuid(),
25
25
  firstName: zod_1.z.string(),
26
26
  lastName: zod_1.z.string(),
27
- email: zod_1.z.email(),
27
+ email: zod_1.z.string().email(),
28
28
  });
29
29
  exports.ClientContactSchema = zod_1.z.object({
30
- id: zod_1.z.uuid().describe('Contact ID'),
31
- clientId: zod_1.z.uuid().describe('Client ID'),
30
+ id: zod_1.z.string().uuid().describe('Contact ID'),
31
+ clientId: zod_1.z.string().uuid().describe('Client ID'),
32
32
  client: clients_contract_1.ClientSchema.describe('Client Details'),
33
33
  name: zod_1.z.string().describe('Contact Name'),
34
34
  position: zod_1.z.string().optional().describe('Job Position'),
35
35
  phone: zod_1.z.string().describe('Phone Number'),
36
- email: zod_1.z.email().describe('Email Address'),
36
+ email: zod_1.z.string().email().describe('Email Address'),
37
37
  source: zod_1.z.string().optional().describe('Source'),
38
38
  createdBy: UserSchema.describe('Created By'),
39
- createdAt: zod_1.z.coerce.date().describe('Creation Date'),
40
- updatedAt: zod_1.z.coerce.date().describe('Last Update Date'),
39
+ createdAt: zod_1.z.string().datetime().describe('Creation Date'),
40
+ updatedAt: zod_1.z.string().datetime().describe('Last Update Date'),
41
41
  version: zod_1.z.number().describe('Version Number'),
42
42
  });
43
43
  exports.CreateClientContactSchema = zod_1.z.object({
@@ -45,7 +45,7 @@ exports.CreateClientContactSchema = zod_1.z.object({
45
45
  name: zod_1.z.string().max(255).describe('Full Name'),
46
46
  position: zod_1.z.string().max(255).optional().describe('Job Position'),
47
47
  phone: zod_1.z.string().max(50).describe('Phone Number'),
48
- email: zod_1.z.email().max(255).describe('Email Address'),
48
+ email: zod_1.z.string().email().max(255).describe('Email Address'),
49
49
  source: zod_1.z.string().max(255).optional().describe('Source'),
50
50
  });
51
51
  exports.CreateClientContactBodySchema = exports.CreateClientContactSchema.omit({
@@ -62,16 +62,16 @@ exports.FilterClientContactSchema = zod_1.z.object({
62
62
  name: zod_1.z.string().optional().describe('Filter by name'),
63
63
  email: zod_1.z.string().optional().describe('Filter by email'),
64
64
  phone: zod_1.z.string().optional().describe('Filter by phone'),
65
- clientId: zod_1.z.uuid().optional().describe('Search client'),
66
- createdById: zod_1.z.uuid().optional().describe('Search by creator'),
65
+ clientId: zod_1.z.string().uuid().optional().describe('Search client'),
66
+ createdById: zod_1.z.string().uuid().optional().describe('Search by creator'),
67
67
  sortBy: ClientContactSortableFieldsSchema.default('createdAt').describe('Sort field'),
68
68
  sortOrder: SortOrderSchema.default('DESC').describe('Sort order'),
69
69
  });
70
70
  const c = (0, core_1.initContract)();
71
- exports.clientContactsContract = c.router({
71
+ const clientContactsContractConfig = {
72
72
  create: {
73
73
  method: 'POST',
74
- path: '/client-contacts',
74
+ path: '/v2/client-contacts',
75
75
  responses: {
76
76
  201: exports.ClientContactSchema,
77
77
  400: error_schemas_1.ErrorResponseSchema,
@@ -85,7 +85,7 @@ exports.clientContactsContract = c.router({
85
85
  },
86
86
  createByClientId: {
87
87
  method: 'POST',
88
- path: '/client-contacts/client/:clientId',
88
+ path: '/v2/client-contacts/client/:clientId',
89
89
  responses: {
90
90
  201: exports.ClientContactSchema,
91
91
  400: error_schemas_1.ErrorResponseSchema,
@@ -95,14 +95,14 @@ exports.clientContactsContract = c.router({
95
95
  500: error_schemas_1.ErrorResponseSchema,
96
96
  },
97
97
  pathParams: zod_1.z.object({
98
- clientId: zod_1.z.uuid(),
98
+ clientId: zod_1.z.string().uuid(),
99
99
  }),
100
100
  body: exports.CreateClientContactBodySchema,
101
101
  summary: 'Create a new contact for a specific client',
102
102
  },
103
103
  findAll: {
104
104
  method: 'GET',
105
- path: '/client-contacts',
105
+ path: '/v2/client-contacts',
106
106
  responses: {
107
107
  200: (0, pagination_schema_1.createPaginatedResponseSchema)(exports.ClientContactSchema),
108
108
  400: error_schemas_1.ErrorResponseSchema,
@@ -115,7 +115,7 @@ exports.clientContactsContract = c.router({
115
115
  },
116
116
  findOne: {
117
117
  method: 'GET',
118
- path: '/client-contacts/:contactId',
118
+ path: '/v2/client-contacts/:contactId',
119
119
  responses: {
120
120
  200: exports.ClientContactSchema,
121
121
  400: error_schemas_1.ErrorResponseSchema,
@@ -125,13 +125,13 @@ exports.clientContactsContract = c.router({
125
125
  500: error_schemas_1.ErrorResponseSchema,
126
126
  },
127
127
  pathParams: zod_1.z.object({
128
- contactId: zod_1.z.uuid(),
128
+ contactId: zod_1.z.string().uuid(),
129
129
  }),
130
130
  summary: 'Get a client contact by ID',
131
131
  },
132
132
  update: {
133
133
  method: 'PATCH',
134
- path: '/client-contacts/:contactId',
134
+ path: '/v2/client-contacts/:contactId',
135
135
  responses: {
136
136
  200: exports.ClientContactSchema,
137
137
  400: error_schemas_1.ErrorResponseSchema,
@@ -142,14 +142,14 @@ exports.clientContactsContract = c.router({
142
142
  500: error_schemas_1.ErrorResponseSchema,
143
143
  },
144
144
  pathParams: zod_1.z.object({
145
- contactId: zod_1.z.uuid(),
145
+ contactId: zod_1.z.string().uuid(),
146
146
  }),
147
147
  body: exports.UpdateClientContactSchema,
148
148
  summary: 'Update a client contact',
149
149
  },
150
150
  remove: {
151
151
  method: 'DELETE',
152
- path: '/client-contacts/:contactId',
152
+ path: '/v2/client-contacts/:contactId',
153
153
  responses: {
154
154
  204: c.noBody(),
155
155
  400: error_schemas_1.ErrorResponseSchema,
@@ -159,11 +159,11 @@ exports.clientContactsContract = c.router({
159
159
  500: error_schemas_1.ErrorResponseSchema,
160
160
  },
161
161
  pathParams: zod_1.z.object({
162
- contactId: zod_1.z.uuid(),
162
+ contactId: zod_1.z.string().uuid(),
163
163
  }),
164
164
  body: c.noBody(),
165
165
  summary: 'Delete a client contact',
166
166
  },
167
- }, {
168
- pathPrefix: '/v2',
169
- });
167
+ };
168
+ const clientContactsContractRouter = c.router(clientContactsContractConfig);
169
+ exports.clientContactsContract = clientContactsContractRouter;