@kl1/contracts 1.0.51 → 1.0.52

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
@@ -4390,6 +4390,8 @@ var GetExportTelephonyCdrSchema = GetAllTelephonyCdrSchema.merge(
4390
4390
  pageSize: z72.coerce.number().positive().optional()
4391
4391
  })
4392
4392
  );
4393
+ var NullEmptyStringUndefined = ["", null, void 0];
4394
+ var EmtptyArrayUndefined = [[], void 0];
4393
4395
  var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
4394
4396
  reportType: z72.enum([
4395
4397
  "extcallstatistics",
@@ -4409,50 +4411,49 @@ var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
4409
4411
  trunkList: z72.array(z72.string()).optional(),
4410
4412
  extensionList: z72.array(z72.string()).optional()
4411
4413
  }).superRefine((input, ctx) => {
4412
- var _a, _b, _c;
4413
- if ((input.reportType === "extcallstatistics" || input.reportType === "queuesatisfaction" || input.reportType === "queueperformance") && (input.selectedDate === null || input.selectedDate === "")) {
4414
+ if ((input.reportType === "extcallstatistics" || input.reportType === "queuesatisfaction" || input.reportType === "queueperformance" || input.reportType === "queueagentmisscalls") && NullEmptyStringUndefined.includes(input.selectedDate)) {
4414
4415
  ctx.addIssue({
4415
4416
  code: z72.ZodIssueCode.custom,
4416
4417
  path: ["selectedDate"],
4417
4418
  message: "selectedDate is required."
4418
4419
  });
4419
4420
  }
4420
- if (input.reportType === "extcallstatistics" && (input.communicationType === null || input.selectedDate === "")) {
4421
+ if (input.reportType === "extcallstatistics" && NullEmptyStringUndefined.includes(input.communicationType)) {
4421
4422
  ctx.addIssue({
4422
4423
  code: z72.ZodIssueCode.custom,
4423
4424
  path: ["communicationType"],
4424
4425
  message: "communicationType is required."
4425
4426
  });
4426
4427
  }
4427
- if ((input.reportType === "extcallactivity" || input.reportType === "queueavgwaittalktime" || input.reportType === "trunkactivity") && (input.time === null || input.time === "")) {
4428
+ if ((input.reportType === "extcallactivity" || input.reportType === "queueavgwaittalktime" || input.reportType === "trunkactivity") && NullEmptyStringUndefined.includes(input.time)) {
4428
4429
  ctx.addIssue({
4429
4430
  code: z72.ZodIssueCode.custom,
4430
4431
  path: ["time"],
4431
4432
  message: "time is required."
4432
4433
  });
4433
4434
  }
4434
- if ((input.reportType === "queueavgwaittalktime" || input.reportType === "queueperformance") && (((_a = input.queueList) == null ? void 0 : _a.length) || 0) < 0) {
4435
+ if ((input.reportType === "queueavgwaittalktime" || input.reportType === "queueperformance") && EmtptyArrayUndefined.includes(input.queueList)) {
4435
4436
  ctx.addIssue({
4436
4437
  code: z72.ZodIssueCode.custom,
4437
4438
  path: ["queueList"],
4438
4439
  message: "queueList is required."
4439
4440
  });
4440
4441
  }
4441
- if ((input.reportType === "queuesatisfaction" || input.reportType === "queueagentmisscalls") && (input.queueId === null || input.queueId === "")) {
4442
+ if ((input.reportType === "queuesatisfaction" || input.reportType === "queueagentmisscalls") && NullEmptyStringUndefined.includes(input.queueId)) {
4442
4443
  ctx.addIssue({
4443
4444
  code: z72.ZodIssueCode.custom,
4444
4445
  path: ["queueId"],
4445
4446
  message: "queueId is required."
4446
4447
  });
4447
4448
  }
4448
- if (input.reportType === "trunkactivity" && (((_b = input.trunkList) == null ? void 0 : _b.length) || 0) < 0) {
4449
+ if (input.reportType === "trunkactivity" && EmtptyArrayUndefined.includes(input.trunkList)) {
4449
4450
  ctx.addIssue({
4450
4451
  code: z72.ZodIssueCode.custom,
4451
4452
  path: ["trunkList"],
4452
4453
  message: "trunkList is required."
4453
4454
  });
4454
4455
  }
4455
- if ((input.reportType === "extcallstatistics" || input.reportType === "extcallactivity") && (((_c = input.extensionList) == null ? void 0 : _c.length) || 0) < 0) {
4456
+ if ((input.reportType === "extcallstatistics" || input.reportType === "extcallactivity") && EmtptyArrayUndefined.includes(input.extensionList)) {
4456
4457
  ctx.addIssue({
4457
4458
  code: z72.ZodIssueCode.custom,
4458
4459
  path: ["extensionList"],
@@ -4696,6 +4697,17 @@ var telephonyCdrContract = initContract28().router(
4696
4697
  },
4697
4698
  summary: "Get yeastar call report."
4698
4699
  },
4700
+ yeastarCallReportExport: {
4701
+ method: "POST",
4702
+ path: "/yeastar_call_report/export",
4703
+ headers: DefaultHeaderSchema,
4704
+ body: GetYeastarCallReportSchema,
4705
+ responses: {
4706
+ 200: null,
4707
+ 401: DefaultUnauthorizedSchema
4708
+ },
4709
+ summary: "Export yeastar call report."
4710
+ },
4699
4711
  getTrunks: {
4700
4712
  method: "GET",
4701
4713
  path: "/trunks",