@kl1/contracts 1.0.12 → 1.0.14

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/index.mjs CHANGED
@@ -696,15 +696,27 @@ var UploadSchema = DefaultEntitySchema.extend({
696
696
  });
697
697
 
698
698
  // src/contact/schema.ts
699
- var ContactPhonesSchema = DefaultEntitySchema.extend({
699
+ var ContactPhonesSchema = z20.object({
700
+ id: z20.string().uuid(),
701
+ createdAt: z20.date(),
702
+ updatedAt: z20.date(),
703
+ deletedAt: z20.date().nullable(),
700
704
  phone: z20.string(),
701
705
  isPrimary: z20.boolean()
702
706
  });
703
- var ContactEmailsSchema = DefaultEntitySchema.extend({
707
+ var ContactEmailsSchema = z20.object({
708
+ id: z20.string().uuid(),
709
+ createdAt: z20.date(),
710
+ updatedAt: z20.date(),
711
+ deletedAt: z20.date().nullable(),
704
712
  email: z20.string(),
705
713
  isPrimary: z20.boolean()
706
714
  });
707
- var ContactCustomFieldSchema = DefaultEntitySchema.extend({
715
+ var ContactCustomFieldSchema = z20.object({
716
+ id: z20.string().uuid(),
717
+ createdAt: z20.date(),
718
+ updatedAt: z20.date(),
719
+ deletedAt: z20.date().nullable(),
708
720
  textValue: z20.string().nullable(),
709
721
  booleanValue: z20.boolean().nullable(),
710
722
  numberValue: z20.number().nullable(),
@@ -717,16 +729,28 @@ var ContactCustomFieldSchema = DefaultEntitySchema.extend({
717
729
  })
718
730
  )
719
731
  });
720
- var ContactEntityTypesSchema = DefaultEntitySchema.extend({
732
+ var ContactEntityTypesSchema = z20.object({
733
+ id: z20.string().uuid(),
734
+ createdAt: z20.date(),
735
+ updatedAt: z20.date(),
736
+ deletedAt: z20.date().nullable(),
721
737
  entity: z20.string(),
722
738
  description: z20.string().nullable()
723
739
  });
724
- var ContactActivitySchema = DefaultEntitySchema.extend({
740
+ var ContactActivitySchema = z20.object({
741
+ id: z20.string().uuid(),
742
+ createdAt: z20.date(),
743
+ updatedAt: z20.date(),
744
+ deletedAt: z20.date().nullable(),
725
745
  entityId: z20.string(),
726
746
  description: z20.string(),
727
747
  entityType: ContactEntityTypesSchema
728
748
  });
729
- var ContactSchema = DefaultEntitySchema.extend({
749
+ var ContactSchema = z20.object({
750
+ id: z20.string().uuid(),
751
+ createdAt: z20.date(),
752
+ updatedAt: z20.date(),
753
+ deletedAt: z20.date().nullable(),
730
754
  name: z20.string(),
731
755
  address: z20.string().nullable(),
732
756
  channel: z20.string().nullable(),
@@ -1124,6 +1148,41 @@ var ContactContractValidationSchema = {
1124
1148
  id: z25.string().uuid()
1125
1149
  }),
1126
1150
  response: ContactSchema
1151
+ },
1152
+ delete: {
1153
+ request: z25.object({
1154
+ id: z25.string().uuid()
1155
+ }),
1156
+ response: z25.string()
1157
+ },
1158
+ getAll: {
1159
+ request: z25.object({
1160
+ page: z25.coerce.number().default(1),
1161
+ pageSize: z25.coerce.number().default(10),
1162
+ keyword: z25.string().optional(),
1163
+ company: z25.array(z25.string().uuid()),
1164
+ name: z25.string(),
1165
+ address: z25.string(),
1166
+ channel: z25.array(z25.string()),
1167
+ selectedDate: z25.string(),
1168
+ customFields: z25.array(
1169
+ z25.object({
1170
+ attributeId: z25.string().uuid(),
1171
+ type: z25.string(),
1172
+ value: z25.union([z25.string(), z25.array(z25.string())])
1173
+ })
1174
+ ),
1175
+ tags: z25.array(z25.string().uuid()),
1176
+ phone: z25.string(),
1177
+ email: z25.string(),
1178
+ notes: z25.string()
1179
+ }).partial(),
1180
+ response: {
1181
+ page: z25.number(),
1182
+ pageSize: z25.number(),
1183
+ total: z25.number(),
1184
+ data: z25.array(ContactSchema)
1185
+ }
1127
1186
  }
1128
1187
  };
1129
1188
 
@@ -1176,6 +1235,29 @@ var contactContract = initContract7().router(
1176
1235
  },
1177
1236
  summary: "Get a contact by id"
1178
1237
  },
1238
+ getAll: {
1239
+ method: "GET",
1240
+ path: "",
1241
+ query: ContactContractValidationSchema.getAll.request,
1242
+ responses: {
1243
+ 200: DefaultSuccessResponseSchema.extend(
1244
+ ContactContractValidationSchema.getAll.response
1245
+ ),
1246
+ 400: z26.object({
1247
+ message: z26.string()
1248
+ }),
1249
+ 409: z26.object({
1250
+ message: z26.string()
1251
+ }),
1252
+ 500: z26.object({
1253
+ message: z26.string()
1254
+ }),
1255
+ 401: DefaultUnauthorizedSchema,
1256
+ 404: DefaultNotFoundSchema,
1257
+ 422: DefaultUnprocessibleSchema
1258
+ },
1259
+ summary: "Get all contacts"
1260
+ },
1179
1261
  update: {
1180
1262
  method: "PATCH",
1181
1263
  path: "/:id",
@@ -1199,6 +1281,30 @@ var contactContract = initContract7().router(
1199
1281
  },
1200
1282
  body: ContactContractValidationSchema.create.request.partial(),
1201
1283
  summary: "Update a contact"
1284
+ },
1285
+ delete: {
1286
+ method: "DELETE",
1287
+ path: "/:id",
1288
+ pathParams: ContactContractValidationSchema.delete.request,
1289
+ responses: {
1290
+ 200: DefaultSuccessResponseSchema.extend({
1291
+ message: ContactContractValidationSchema.delete.response
1292
+ }),
1293
+ 400: z26.object({
1294
+ message: z26.string()
1295
+ }),
1296
+ 409: z26.object({
1297
+ message: z26.string()
1298
+ }),
1299
+ 500: z26.object({
1300
+ message: z26.string()
1301
+ }),
1302
+ 401: DefaultUnauthorizedSchema,
1303
+ 404: DefaultNotFoundSchema,
1304
+ 422: DefaultUnprocessibleSchema
1305
+ },
1306
+ body: null,
1307
+ summary: "Delete a contact"
1202
1308
  }
1203
1309
  },
1204
1310
  {