@hackfed/schemas 0.4.0 → 0.6.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.$strip>;
8
+ export declare const TelephonyDirectoryExchangeSchema: z.ZodObject<{
3
9
  codecs: z.ZodArray<z.ZodEnum<{
4
10
  opus: "opus";
5
11
  g722: "g722";
@@ -11,8 +17,8 @@ export declare const DirectoryExchangeSchema: z.ZodObject<{
11
17
  protocol: z.ZodEnum<{
12
18
  iax2: "iax2";
13
19
  }>;
14
- }, z.core.$strict>;
15
- export declare const DirectoryOrgSchema: z.ZodObject<{
20
+ }, z.core.$strip>;
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";
@@ -25,7 +31,7 @@ export declare const DirectoryOrgSchema: z.ZodObject<{
25
31
  protocol: z.ZodEnum<{
26
32
  iax2: "iax2";
27
33
  }>;
28
- }, z.core.$strict>>;
34
+ }, z.core.$strip>>;
29
35
  name: z.ZodString;
30
36
  orgId: z.ZodString;
31
37
  phonebooks: z.ZodArray<z.ZodObject<{
@@ -33,8 +39,8 @@ export declare const DirectoryOrgSchema: z.ZodObject<{
33
39
  hackfed: "hackfed";
34
40
  }>;
35
41
  url: z.ZodURL;
36
- }, z.core.$strict>>;
37
- }, z.core.$strict>;
42
+ }, z.core.$strip>>;
43
+ }, z.core.$strip>;
38
44
  export declare const TelephonyDirectorySchema: z.ZodObject<{
39
45
  orgs: z.ZodArray<z.ZodObject<{
40
46
  exchanges: z.ZodArray<z.ZodObject<{
@@ -49,7 +55,7 @@ export declare const TelephonyDirectorySchema: z.ZodObject<{
49
55
  protocol: z.ZodEnum<{
50
56
  iax2: "iax2";
51
57
  }>;
52
- }, z.core.$strict>>;
58
+ }, z.core.$strip>>;
53
59
  name: z.ZodString;
54
60
  orgId: z.ZodString;
55
61
  phonebooks: z.ZodArray<z.ZodObject<{
@@ -57,13 +63,53 @@ export declare const TelephonyDirectorySchema: z.ZodObject<{
57
63
  hackfed: "hackfed";
58
64
  }>;
59
65
  url: z.ZodURL;
60
- }, z.core.$strict>>;
61
- }, z.core.$strict>>;
66
+ }, z.core.$strip>>;
67
+ }, z.core.$strip>>;
62
68
  }, z.core.$strip>;
63
69
  export type TelephonyDirectory = z.infer<typeof TelephonyDirectorySchema>;
64
- export type DirectoryOrg = z.infer<typeof DirectoryOrgSchema>;
65
- export type DirectoryExchange = z.infer<typeof DirectoryExchangeSchema>;
66
- 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.$strip> | 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.$strip> | 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.$strip>>;
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.$strip>>;
112
+ }, z.core.$strip> | z.ZodObject<{
67
113
  orgs: z.ZodArray<z.ZodObject<{
68
114
  exchanges: z.ZodArray<z.ZodObject<{
69
115
  codecs: z.ZodArray<z.ZodEnum<{
@@ -77,7 +123,7 @@ export declare const __schemas: z.ZodObject<{
77
123
  protocol: z.ZodEnum<{
78
124
  iax2: "iax2";
79
125
  }>;
80
- }, z.core.$strict>>;
126
+ }, z.core.$strip>>;
81
127
  name: z.ZodString;
82
128
  orgId: z.ZodString;
83
129
  phonebooks: z.ZodArray<z.ZodObject<{
@@ -85,6 +131,6 @@ export declare const __schemas: z.ZodObject<{
85
131
  hackfed: "hackfed";
86
132
  }>;
87
133
  url: z.ZodURL;
88
- }, z.core.$strict>>;
89
- }, z.core.$strict>>;
90
- }, z.core.$strip>[];
134
+ }, z.core.$strip>>;
135
+ }, z.core.$strip>>;
136
+ }, z.core.$strip>)[];
@@ -1,7 +1,16 @@
1
1
  import { z } from 'zod';
2
2
  import { OrganizationIdSchema } from '../base/organization-id';
3
- import { PhonebookSchema } from '../service/telephony';
4
- 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
+ .meta({
9
+ description: 'Information about a public phonebook for an organization.',
10
+ id: 'TelephonyDirectoryPhonebook',
11
+ title: 'Hackfed Telephony Directory Phonebook',
12
+ });
13
+ export const TelephonyDirectoryExchangeSchema = z
5
14
  .object({
6
15
  codecs: z
7
16
  .array(z.enum(['opus', 'g722', 'ulaw']))
@@ -16,21 +25,29 @@ export const DirectoryExchangeSchema = z
16
25
  .describe('Telephony number prefixes allocated to the organization for this exchange'),
17
26
  protocol: z.enum(['iax2']).describe('Telephony protocol used by the exchange'),
18
27
  })
19
- .strict();
20
- export const DirectoryOrgSchema = z
28
+ .meta({
29
+ description: 'Information about a telephony exchange for an organization.',
30
+ id: 'TelephonyDirectoryExchange',
31
+ title: 'Hackfed Telephony Directory Exchange',
32
+ });
33
+ export const TelephonyDirectoryOrgSchema = z
21
34
  .object({
22
- exchanges: DirectoryExchangeSchema
35
+ exchanges: TelephonyDirectoryExchangeSchema
23
36
  .array()
24
37
  .describe('List of telephony exchanges for the organization'),
25
38
  name: z.string().describe('Name of the organization'),
26
39
  orgId: OrganizationIdSchema.describe('Unique identifier for the organization'),
27
- phonebooks: PhonebookSchema.array().describe('Public phonebook URLs for the organization'),
40
+ phonebooks: TelephonyDirectoryPhonebookSchema.array().describe('Public phonebook URLs for the organization'),
28
41
  })
29
- .strict();
42
+ .meta({
43
+ description: 'Information about an organization participating in Hackfed Telephony Network.',
44
+ id: 'TelephonyDirectoryOrg',
45
+ title: 'Hackfed Telephony Directory Organization',
46
+ });
30
47
  export const TelephonyDirectorySchema = z
31
48
  .object({
32
49
  orgs: z
33
- .array(DirectoryOrgSchema)
50
+ .array(TelephonyDirectoryOrgSchema)
34
51
  .describe('List of organizations participating in Hackfed Telephony Network.'),
35
52
  })
36
53
  .meta({
@@ -38,4 +55,9 @@ export const TelephonyDirectorySchema = z
38
55
  id: 'TelephonyDirectory',
39
56
  title: 'Hackfed Telephony Directory',
40
57
  });
41
- export const __schemas = [TelephonyDirectorySchema];
58
+ export const __schemas = [
59
+ TelephonyDirectorySchema,
60
+ TelephonyDirectoryOrgSchema,
61
+ TelephonyDirectoryExchangeSchema,
62
+ TelephonyDirectoryPhonebookSchema
63
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hackfed/schemas",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {