@webitel/api-services 26.12.18 → 26.12.20
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 +1 -1
- package/src/api/clients/dialplans/__tests__/dialplans.spec.ts +139 -0
- package/src/api/clients/dialplans/dialplans.ts +38 -45
- package/src/api/clients/flows/__tests__/flow.spec.ts +148 -0
- package/src/api/clients/flows/flow.ts +82 -112
- package/src/validations/_shared/regExp.validations.ts +17 -0
- package/src/validations/dialplan/__tests__/dialplan.validations.spec.ts +58 -0
- package/src/validations/dialplan/dialplan.validations.ts +22 -0
- package/src/validations/flow/__tests__/flow.validations.spec.ts +46 -0
- package/src/validations/flow/flow.validations.ts +30 -0
- package/src/validations/index.ts +3 -0
- package/types/.tsbuildinfo +1 -1
- package/types/validations/_shared/regExp.validations.d.ts +3 -0
- package/types/validations/dialplan/dialplan.validations.d.ts +15 -0
- package/types/validations/flow/flow.validations.d.ts +24 -0
- package/types/validations/index.d.ts +3 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { EngineRoutingOutboundCall } from '@webitel/api-services/gen/models';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare const dialplanSchema: z.ZodObject<{
|
|
4
|
+
name: z.ZodDefault<z.ZodString>;
|
|
5
|
+
schema: z.ZodDefault<z.ZodObject<{
|
|
6
|
+
id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
7
|
+
name: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, z.core.$strip>>;
|
|
9
|
+
pattern: z.ZodDefault<z.ZodString>;
|
|
10
|
+
description: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
11
|
+
allowTransfer: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export type DialplanFormShape = z.input<typeof dialplanSchema>;
|
|
14
|
+
/** [Claude] the dialplan as a card holds it: the API entity with the form's fields */
|
|
15
|
+
export type DialplanCard = Omit<EngineRoutingOutboundCall, keyof DialplanFormShape> & DialplanFormShape;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type EngineRoutingSchema } from '@webitel/api-services/gen/models';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* [Claude] A code-editor flow: `schema` travels as JSON text (the API stringifies
|
|
5
|
+
* it on read and parses it back on write), so the form only needs it non-empty.
|
|
6
|
+
*/
|
|
7
|
+
export declare const flowSchema: z.ZodObject<{
|
|
8
|
+
name: z.ZodDefault<z.ZodString>;
|
|
9
|
+
schema: z.ZodDefault<z.ZodString>;
|
|
10
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
11
|
+
readonly Default: "default";
|
|
12
|
+
readonly Voice: "voice";
|
|
13
|
+
readonly Chat: "chat";
|
|
14
|
+
readonly Processing: "processing";
|
|
15
|
+
readonly Service: "service";
|
|
16
|
+
}>>;
|
|
17
|
+
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
18
|
+
name: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, z.core.$strip>>>>;
|
|
20
|
+
editor: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export type FlowFormShape = z.input<typeof flowSchema>;
|
|
23
|
+
/** [Claude] the flow as a card holds it: the API entity with the form's fields (`schema` as text) */
|
|
24
|
+
export type FlowCard = Omit<EngineRoutingSchema, keyof FlowFormShape> & FlowFormShape;
|
|
@@ -3,6 +3,7 @@ export * from './_shared/duration.validations';
|
|
|
3
3
|
export * from './_shared/i18nIssue';
|
|
4
4
|
export * from './_shared/lookup.validations';
|
|
5
5
|
export * from './_shared/phoneNumber.validations';
|
|
6
|
+
export * from './_shared/regExp.validations';
|
|
6
7
|
export * from './_shared/timeRange.validations';
|
|
7
8
|
export * from './_shared/variablePair.validations';
|
|
8
9
|
export * from './adjunctType/adjunctType.validations';
|
|
@@ -34,6 +35,8 @@ export * from './contactGroup/contactGroup.validations';
|
|
|
34
35
|
export * from './contactGroupCondition/contactGroupCondition.validations';
|
|
35
36
|
export * from './contactPhone/contactPhone.validations';
|
|
36
37
|
export * from './device/device.validations';
|
|
38
|
+
export * from './dialplan/dialplan.validations';
|
|
39
|
+
export * from './flow/flow.validations';
|
|
37
40
|
export * from './license/licenseImport.validations';
|
|
38
41
|
export * from './OAuth/OAuth.validations';
|
|
39
42
|
export * from './onlineSkill/onlineSkill.validations';
|