@kl1/contracts 1.0.14 → 1.0.15

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
@@ -1183,6 +1183,20 @@ var ContactContractValidationSchema = {
1183
1183
  total: z25.number(),
1184
1184
  data: z25.array(ContactSchema)
1185
1185
  }
1186
+ },
1187
+ createContactByPhone: {
1188
+ request: z25.object({
1189
+ phoneNumber: z25.string().refine(
1190
+ (value) => {
1191
+ const numericValue = value.replace(/\s/g, "");
1192
+ return /^\d+$/.test(numericValue);
1193
+ },
1194
+ {
1195
+ message: "Phone number must contain only numeric characters"
1196
+ }
1197
+ )
1198
+ }),
1199
+ response: ContactSchema
1186
1200
  }
1187
1201
  };
1188
1202
 
@@ -1305,6 +1319,29 @@ var contactContract = initContract7().router(
1305
1319
  },
1306
1320
  body: null,
1307
1321
  summary: "Delete a contact"
1322
+ },
1323
+ createContactByPhone: {
1324
+ method: "POST",
1325
+ path: "/phone",
1326
+ responses: {
1327
+ 201: DefaultSuccessResponseSchema.extend({
1328
+ data: ContactContractValidationSchema.createContactByPhone.response
1329
+ }),
1330
+ 400: z26.object({
1331
+ message: z26.string()
1332
+ }),
1333
+ 409: z26.object({
1334
+ message: z26.string()
1335
+ }),
1336
+ 500: z26.object({
1337
+ message: z26.string()
1338
+ }),
1339
+ 401: DefaultUnauthorizedSchema,
1340
+ 404: DefaultNotFoundSchema,
1341
+ 422: DefaultUnprocessibleSchema
1342
+ },
1343
+ body: ContactContractValidationSchema.createContactByPhone.request,
1344
+ summary: "Create a new contact using phone number"
1308
1345
  }
1309
1346
  },
1310
1347
  {