@webitel/api-services 26.8.80 → 26.8.81

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": "26.8.80",
3
+ "version": "26.8.81",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,8 +32,17 @@ export const flexibleLookupSchema = z.object({
32
32
  /**
33
33
  * The same, but required — reproducing Vuelidate's `required` on a lookup,
34
34
  * which treated an empty object as missing.
35
+ *
36
+ * [Claude] The issue is reported on `id`, not on the lookup itself: regle
37
+ * builds a nested status for an object field and drops issues pathed at the
38
+ * object, so a cleared (`{}`) lookup would pass as valid in the form.
35
39
  */
36
40
  export const filledLookupSchema = flexibleLookupSchema.refine(
37
41
  (value) => isFilled(value),
38
- i18nIssue('required'),
42
+ {
43
+ path: [
44
+ 'id',
45
+ ],
46
+ ...i18nIssue('required'),
47
+ },
39
48
  );
@@ -45,8 +45,8 @@ describe('agentSchema', () => {
45
45
  taskCount: 1,
46
46
  });
47
47
 
48
- expect(paths).toContain('user');
49
- expect(paths).toContain('team');
48
+ expect(paths).toContain('user.id');
49
+ expect(paths).toContain('team.id');
50
50
  });
51
51
 
52
52
  it('requires chat and task counts of at least 1', () => {
@@ -53,7 +53,7 @@ describe('resourceSchema', () => {
53
53
  expect(paths).toEqual(
54
54
  expect.arrayContaining([
55
55
  'name',
56
- 'gateway',
56
+ 'gateway.id',
57
57
  'rps',
58
58
  'limit',
59
59
  'maxSuccessivelyErrors',
@@ -52,7 +52,7 @@ describe('resourceGroupSchema', () => {
52
52
 
53
53
  const paths = result.error?.issues.map((issue) => issue.path.join('.'));
54
54
  expect(paths).toContain('name');
55
- expect(paths).toContain('communication');
55
+ expect(paths).toContain('communication.id');
56
56
  });
57
57
 
58
58
  it('requires at least one time range', () => {
@@ -22,7 +22,7 @@ describe('resourceInGroupSchema', () => {
22
22
  });
23
23
 
24
24
  expect(result.error?.issues.map((issue) => issue.path.join('.'))).toContain(
25
- 'resource',
25
+ 'resource.id',
26
26
  );
27
27
  });
28
28
 
@@ -15,7 +15,7 @@ describe('teamFlowSchema', () => {
15
15
  });
16
16
 
17
17
  expect(paths).toContain('name');
18
- expect(paths).toContain('schema');
18
+ expect(paths).toContain('schema.id');
19
19
  });
20
20
 
21
21
  it('accepts a filled flow', () => {
@@ -15,7 +15,7 @@ describe('teamHookSchema', () => {
15
15
  });
16
16
 
17
17
  expect(paths).toContain('event');
18
- expect(paths).toContain('schema');
18
+ expect(paths).toContain('schema.id');
19
19
  });
20
20
 
21
21
  it('accepts a filled hook', () => {