@webitel/api-services 1.0.8 → 1.0.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/api-services",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -456,6 +456,19 @@ describe('calendarSchema', () => {
456
456
  });
457
457
 
458
458
  describe('excepts', () => {
459
+ it('rejects an except with an empty name', () => {
460
+ const result = calendarSchema.safeParse({
461
+ ...minimalValidInput,
462
+ excepts: [
463
+ {
464
+ name: '',
465
+ },
466
+ ],
467
+ });
468
+
469
+ expect(result.success).toBe(false);
470
+ });
471
+
459
472
  it('accepts valid except objects', () => {
460
473
  const excepts = [
461
474
  {
@@ -155,8 +155,8 @@ export const getCalendarDayRangeIssues = (
155
155
  });
156
156
  };
157
157
 
158
- const exceptUiSchema = z.object({
159
- name: z.string().optional(),
158
+ export const calendarExceptSchema = z.object({
159
+ name: z.string().min(1),
160
160
  date: z
161
161
  .union([
162
162
  z.number(),
@@ -210,5 +210,5 @@ export const calendarSchema = z.object<
210
210
  expires: z.boolean().optional().default(false),
211
211
  accepts: acceptsOfDayUiArraySchema.default(defaultAccepts),
212
212
  specials: z.array(acceptOfDayUiSchema).default(defaultSpecials),
213
- excepts: z.array(exceptUiSchema).optional().default([]),
213
+ excepts: z.array(calendarExceptSchema).optional().default([]),
214
214
  });