@hackfed/schemas 0.4.0 → 0.5.0
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.
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const TelephonyDirectoryPhonebookSchema: z.ZodObject<{
|
|
3
|
+
format: z.ZodEnum<{
|
|
4
|
+
hackfed: "hackfed";
|
|
5
|
+
}>;
|
|
6
|
+
url: z.ZodURL;
|
|
7
|
+
}, z.core.$strict>;
|
|
8
|
+
export declare const TelephonyDirectoryExchangeSchema: z.ZodObject<{
|
|
3
9
|
codecs: z.ZodArray<z.ZodEnum<{
|
|
4
10
|
opus: "opus";
|
|
5
11
|
g722: "g722";
|
|
@@ -12,7 +18,7 @@ export declare const DirectoryExchangeSchema: z.ZodObject<{
|
|
|
12
18
|
iax2: "iax2";
|
|
13
19
|
}>;
|
|
14
20
|
}, z.core.$strict>;
|
|
15
|
-
export declare const
|
|
21
|
+
export declare const TelephonyDirectoryOrgSchema: z.ZodObject<{
|
|
16
22
|
exchanges: z.ZodArray<z.ZodObject<{
|
|
17
23
|
codecs: z.ZodArray<z.ZodEnum<{
|
|
18
24
|
opus: "opus";
|
|
@@ -61,9 +67,49 @@ export declare const TelephonyDirectorySchema: z.ZodObject<{
|
|
|
61
67
|
}, z.core.$strict>>;
|
|
62
68
|
}, z.core.$strip>;
|
|
63
69
|
export type TelephonyDirectory = z.infer<typeof TelephonyDirectorySchema>;
|
|
64
|
-
export type
|
|
65
|
-
export type
|
|
66
|
-
export
|
|
70
|
+
export type TelephonyDirectoryOrg = z.infer<typeof TelephonyDirectoryOrgSchema>;
|
|
71
|
+
export type TelephonyDirectoryExchange = z.infer<typeof TelephonyDirectoryExchangeSchema>;
|
|
72
|
+
export type TelephonyDirectoryPhonebook = z.infer<typeof TelephonyDirectoryPhonebookSchema>;
|
|
73
|
+
export declare const __schemas: (z.ZodObject<{
|
|
74
|
+
format: z.ZodEnum<{
|
|
75
|
+
hackfed: "hackfed";
|
|
76
|
+
}>;
|
|
77
|
+
url: z.ZodURL;
|
|
78
|
+
}, z.core.$strict> | z.ZodObject<{
|
|
79
|
+
codecs: z.ZodArray<z.ZodEnum<{
|
|
80
|
+
opus: "opus";
|
|
81
|
+
g722: "g722";
|
|
82
|
+
ulaw: "ulaw";
|
|
83
|
+
}>>;
|
|
84
|
+
endpoint: z.ZodString;
|
|
85
|
+
id: z.ZodString;
|
|
86
|
+
prefixes: z.ZodArray<z.ZodE164>;
|
|
87
|
+
protocol: z.ZodEnum<{
|
|
88
|
+
iax2: "iax2";
|
|
89
|
+
}>;
|
|
90
|
+
}, z.core.$strict> | z.ZodObject<{
|
|
91
|
+
exchanges: z.ZodArray<z.ZodObject<{
|
|
92
|
+
codecs: z.ZodArray<z.ZodEnum<{
|
|
93
|
+
opus: "opus";
|
|
94
|
+
g722: "g722";
|
|
95
|
+
ulaw: "ulaw";
|
|
96
|
+
}>>;
|
|
97
|
+
endpoint: z.ZodString;
|
|
98
|
+
id: z.ZodString;
|
|
99
|
+
prefixes: z.ZodArray<z.ZodE164>;
|
|
100
|
+
protocol: z.ZodEnum<{
|
|
101
|
+
iax2: "iax2";
|
|
102
|
+
}>;
|
|
103
|
+
}, z.core.$strict>>;
|
|
104
|
+
name: z.ZodString;
|
|
105
|
+
orgId: z.ZodString;
|
|
106
|
+
phonebooks: z.ZodArray<z.ZodObject<{
|
|
107
|
+
format: z.ZodEnum<{
|
|
108
|
+
hackfed: "hackfed";
|
|
109
|
+
}>;
|
|
110
|
+
url: z.ZodURL;
|
|
111
|
+
}, z.core.$strict>>;
|
|
112
|
+
}, z.core.$strict> | z.ZodObject<{
|
|
67
113
|
orgs: z.ZodArray<z.ZodObject<{
|
|
68
114
|
exchanges: z.ZodArray<z.ZodObject<{
|
|
69
115
|
codecs: z.ZodArray<z.ZodEnum<{
|
|
@@ -87,4 +133,4 @@ export declare const __schemas: z.ZodObject<{
|
|
|
87
133
|
url: z.ZodURL;
|
|
88
134
|
}, z.core.$strict>>;
|
|
89
135
|
}, z.core.$strict>>;
|
|
90
|
-
}, z.core.$strip>[];
|
|
136
|
+
}, z.core.$strip>)[];
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { OrganizationIdSchema } from '../base/organization-id';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
export const TelephonyDirectoryPhonebookSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
format: z.enum(['hackfed']).describe('Format of the phonebook data'),
|
|
6
|
+
url: z.url().describe('URL to the phonebook resource'),
|
|
7
|
+
})
|
|
8
|
+
.strict();
|
|
9
|
+
export const TelephonyDirectoryExchangeSchema = z
|
|
5
10
|
.object({
|
|
6
11
|
codecs: z
|
|
7
12
|
.array(z.enum(['opus', 'g722', 'ulaw']))
|
|
@@ -17,20 +22,20 @@ export const DirectoryExchangeSchema = z
|
|
|
17
22
|
protocol: z.enum(['iax2']).describe('Telephony protocol used by the exchange'),
|
|
18
23
|
})
|
|
19
24
|
.strict();
|
|
20
|
-
export const
|
|
25
|
+
export const TelephonyDirectoryOrgSchema = z
|
|
21
26
|
.object({
|
|
22
|
-
exchanges:
|
|
27
|
+
exchanges: TelephonyDirectoryExchangeSchema
|
|
23
28
|
.array()
|
|
24
29
|
.describe('List of telephony exchanges for the organization'),
|
|
25
30
|
name: z.string().describe('Name of the organization'),
|
|
26
31
|
orgId: OrganizationIdSchema.describe('Unique identifier for the organization'),
|
|
27
|
-
phonebooks:
|
|
32
|
+
phonebooks: TelephonyDirectoryPhonebookSchema.array().describe('Public phonebook URLs for the organization'),
|
|
28
33
|
})
|
|
29
34
|
.strict();
|
|
30
35
|
export const TelephonyDirectorySchema = z
|
|
31
36
|
.object({
|
|
32
37
|
orgs: z
|
|
33
|
-
.array(
|
|
38
|
+
.array(TelephonyDirectoryOrgSchema)
|
|
34
39
|
.describe('List of organizations participating in Hackfed Telephony Network.'),
|
|
35
40
|
})
|
|
36
41
|
.meta({
|
|
@@ -38,4 +43,9 @@ export const TelephonyDirectorySchema = z
|
|
|
38
43
|
id: 'TelephonyDirectory',
|
|
39
44
|
title: 'Hackfed Telephony Directory',
|
|
40
45
|
});
|
|
41
|
-
export const __schemas = [
|
|
46
|
+
export const __schemas = [
|
|
47
|
+
TelephonyDirectorySchema,
|
|
48
|
+
TelephonyDirectoryOrgSchema,
|
|
49
|
+
TelephonyDirectoryExchangeSchema,
|
|
50
|
+
TelephonyDirectoryPhonebookSchema
|
|
51
|
+
];
|