@hackfed/schemas 0.3.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 DirectoryExchangeSchema: z.ZodObject<{
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 DirectoryOrgSchema: z.ZodObject<{
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";
@@ -28,6 +34,12 @@ export declare const DirectoryOrgSchema: z.ZodObject<{
28
34
  }, z.core.$strict>>;
29
35
  name: z.ZodString;
30
36
  orgId: z.ZodString;
37
+ phonebooks: z.ZodArray<z.ZodObject<{
38
+ format: z.ZodEnum<{
39
+ hackfed: "hackfed";
40
+ }>;
41
+ url: z.ZodURL;
42
+ }, z.core.$strict>>;
31
43
  }, z.core.$strict>;
32
44
  export declare const TelephonyDirectorySchema: z.ZodObject<{
33
45
  orgs: z.ZodArray<z.ZodObject<{
@@ -46,12 +58,58 @@ export declare const TelephonyDirectorySchema: z.ZodObject<{
46
58
  }, z.core.$strict>>;
47
59
  name: z.ZodString;
48
60
  orgId: z.ZodString;
61
+ phonebooks: z.ZodArray<z.ZodObject<{
62
+ format: z.ZodEnum<{
63
+ hackfed: "hackfed";
64
+ }>;
65
+ url: z.ZodURL;
66
+ }, z.core.$strict>>;
49
67
  }, z.core.$strict>>;
50
68
  }, z.core.$strip>;
51
69
  export type TelephonyDirectory = z.infer<typeof TelephonyDirectorySchema>;
52
- export type DirectoryOrg = z.infer<typeof DirectoryOrgSchema>;
53
- export type DirectoryExchange = z.infer<typeof DirectoryExchangeSchema>;
54
- export declare const __schemas: z.ZodObject<{
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<{
55
113
  orgs: z.ZodArray<z.ZodObject<{
56
114
  exchanges: z.ZodArray<z.ZodObject<{
57
115
  codecs: z.ZodArray<z.ZodEnum<{
@@ -68,5 +126,11 @@ export declare const __schemas: z.ZodObject<{
68
126
  }, z.core.$strict>>;
69
127
  name: z.ZodString;
70
128
  orgId: z.ZodString;
129
+ phonebooks: z.ZodArray<z.ZodObject<{
130
+ format: z.ZodEnum<{
131
+ hackfed: "hackfed";
132
+ }>;
133
+ url: z.ZodURL;
134
+ }, z.core.$strict>>;
71
135
  }, z.core.$strict>>;
72
- }, z.core.$strip>[];
136
+ }, z.core.$strip>)[];
@@ -1,6 +1,12 @@
1
1
  import { z } from 'zod';
2
2
  import { OrganizationIdSchema } from '../base/organization-id';
3
- export const DirectoryExchangeSchema = z
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
4
10
  .object({
5
11
  codecs: z
6
12
  .array(z.enum(['opus', 'g722', 'ulaw']))
@@ -16,19 +22,20 @@ export const DirectoryExchangeSchema = z
16
22
  protocol: z.enum(['iax2']).describe('Telephony protocol used by the exchange'),
17
23
  })
18
24
  .strict();
19
- export const DirectoryOrgSchema = z
25
+ export const TelephonyDirectoryOrgSchema = z
20
26
  .object({
21
- exchanges: z
22
- .array(DirectoryExchangeSchema)
27
+ exchanges: TelephonyDirectoryExchangeSchema
28
+ .array()
23
29
  .describe('List of telephony exchanges for the organization'),
24
30
  name: z.string().describe('Name of the organization'),
25
31
  orgId: OrganizationIdSchema.describe('Unique identifier for the organization'),
32
+ phonebooks: TelephonyDirectoryPhonebookSchema.array().describe('Public phonebook URLs for the organization'),
26
33
  })
27
34
  .strict();
28
35
  export const TelephonyDirectorySchema = z
29
36
  .object({
30
37
  orgs: z
31
- .array(DirectoryOrgSchema)
38
+ .array(TelephonyDirectoryOrgSchema)
32
39
  .describe('List of organizations participating in Hackfed Telephony Network.'),
33
40
  })
34
41
  .meta({
@@ -36,4 +43,9 @@ export const TelephonyDirectorySchema = z
36
43
  id: 'TelephonyDirectory',
37
44
  title: 'Hackfed Telephony Directory',
38
45
  });
39
- export const __schemas = [TelephonyDirectorySchema];
46
+ export const __schemas = [
47
+ TelephonyDirectorySchema,
48
+ TelephonyDirectoryOrgSchema,
49
+ TelephonyDirectoryExchangeSchema,
50
+ TelephonyDirectoryPhonebookSchema
51
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hackfed/schemas",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {