@hackfed/schemas 0.6.0 → 0.7.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.
- package/dist/index.js +1 -1
- package/dist/v1/base/inet6-number.d.ts +0 -1
- package/dist/v1/base/inet6-number.js +0 -1
- package/dist/v1/base/organization-id.d.ts +0 -1
- package/dist/v1/base/organization-id.js +0 -1
- package/dist/v1/base/resource-definition.d.ts +0 -9
- package/dist/v1/base/resource-definition.js +0 -1
- package/dist/v1/directory/telephony.d.ts +0 -64
- package/dist/v1/directory/telephony.js +0 -6
- package/dist/v1/entity/organization.d.ts +0 -63
- package/dist/v1/entity/organization.js +0 -1
- package/dist/v1/index.d.ts +9 -9
- package/dist/v1/index.js +9 -9
- package/dist/v1/service/about.d.ts +0 -6
- package/dist/v1/service/about.js +0 -1
- package/dist/v1/service/access.d.ts +6 -15
- package/dist/v1/service/access.js +6 -7
- package/dist/v1/service/nebula.d.ts +2 -10
- package/dist/v1/service/nebula.js +2 -3
- package/dist/v1/service/telephony.d.ts +6 -32
- package/dist/v1/service/telephony.js +6 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9,12 +9,3 @@ export declare const ResourceDefinitionSchema: z.ZodObject<{
|
|
|
9
9
|
spec: z.ZodObject<{}, z.core.$strip>;
|
|
10
10
|
}, z.core.$strip>;
|
|
11
11
|
export type ResourceDefinition = z.infer<typeof ResourceDefinitionSchema>;
|
|
12
|
-
export declare const __schemas: z.ZodObject<{
|
|
13
|
-
$schema: z.ZodOptional<z.ZodURL>;
|
|
14
|
-
apiVersion: z.ZodLiteral<"hackfed/v1">;
|
|
15
|
-
kind: z.ZodLiteral<"Organization">;
|
|
16
|
-
metadata: z.ZodObject<{
|
|
17
|
-
orgId: z.ZodString;
|
|
18
|
-
}, z.core.$strip>;
|
|
19
|
-
spec: z.ZodObject<{}, z.core.$strip>;
|
|
20
|
-
}, z.core.$strip>[];
|
|
@@ -70,67 +70,3 @@ export type TelephonyDirectory = z.infer<typeof TelephonyDirectorySchema>;
|
|
|
70
70
|
export type TelephonyDirectoryOrg = z.infer<typeof TelephonyDirectoryOrgSchema>;
|
|
71
71
|
export type TelephonyDirectoryExchange = z.infer<typeof TelephonyDirectoryExchangeSchema>;
|
|
72
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<{
|
|
113
|
-
orgs: z.ZodArray<z.ZodObject<{
|
|
114
|
-
exchanges: z.ZodArray<z.ZodObject<{
|
|
115
|
-
codecs: z.ZodArray<z.ZodEnum<{
|
|
116
|
-
opus: "opus";
|
|
117
|
-
g722: "g722";
|
|
118
|
-
ulaw: "ulaw";
|
|
119
|
-
}>>;
|
|
120
|
-
endpoint: z.ZodString;
|
|
121
|
-
id: z.ZodString;
|
|
122
|
-
prefixes: z.ZodArray<z.ZodE164>;
|
|
123
|
-
protocol: z.ZodEnum<{
|
|
124
|
-
iax2: "iax2";
|
|
125
|
-
}>;
|
|
126
|
-
}, z.core.$strip>>;
|
|
127
|
-
name: z.ZodString;
|
|
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.$strip>>;
|
|
135
|
-
}, z.core.$strip>>;
|
|
136
|
-
}, z.core.$strip>)[];
|
|
@@ -55,9 +55,3 @@ export const TelephonyDirectorySchema = z
|
|
|
55
55
|
id: 'TelephonyDirectory',
|
|
56
56
|
title: 'Hackfed Telephony Directory',
|
|
57
57
|
});
|
|
58
|
-
export const __schemas = [
|
|
59
|
-
TelephonyDirectorySchema,
|
|
60
|
-
TelephonyDirectoryOrgSchema,
|
|
61
|
-
TelephonyDirectoryExchangeSchema,
|
|
62
|
-
TelephonyDirectoryPhonebookSchema
|
|
63
|
-
];
|
|
@@ -63,66 +63,3 @@ export declare const OrganizationSchema: z.ZodObject<{
|
|
|
63
63
|
}, z.core.$strict>;
|
|
64
64
|
}, z.core.$strip>;
|
|
65
65
|
export type Organization = z.infer<typeof OrganizationSchema>;
|
|
66
|
-
export declare const __schemas: z.ZodObject<{
|
|
67
|
-
$schema: z.ZodOptional<z.ZodURL>;
|
|
68
|
-
apiVersion: z.ZodLiteral<"hackfed/v1">;
|
|
69
|
-
kind: z.ZodLiteral<"Organization">;
|
|
70
|
-
metadata: z.ZodObject<{
|
|
71
|
-
orgId: z.ZodString;
|
|
72
|
-
}, z.core.$strip>;
|
|
73
|
-
spec: z.ZodObject<{
|
|
74
|
-
id: z.ZodString;
|
|
75
|
-
name: z.ZodString;
|
|
76
|
-
services: z.ZodOptional<z.ZodObject<{
|
|
77
|
-
about: z.ZodOptional<z.ZodObject<{
|
|
78
|
-
contact: z.ZodOptional<z.ZodObject<{
|
|
79
|
-
email: z.ZodOptional<z.ZodEmail>;
|
|
80
|
-
website: z.ZodOptional<z.ZodURL>;
|
|
81
|
-
}, z.core.$strict>>;
|
|
82
|
-
}, z.core.$strict>>;
|
|
83
|
-
access: z.ZodOptional<z.ZodObject<{
|
|
84
|
-
maintainers: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
85
|
-
type: z.ZodLiteral<"github">;
|
|
86
|
-
username: z.ZodString;
|
|
87
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
88
|
-
email: z.ZodEmail;
|
|
89
|
-
type: z.ZodLiteral<"email">;
|
|
90
|
-
}, z.core.$strip>], "type">>>;
|
|
91
|
-
}, z.core.$strict>>;
|
|
92
|
-
nebula: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
93
|
-
address: z.ZodString;
|
|
94
|
-
certificates: z.ZodArray<z.ZodString>;
|
|
95
|
-
lighthouse: z.ZodOptional<z.ZodObject<{
|
|
96
|
-
enabled: z.ZodBoolean;
|
|
97
|
-
endpoints: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
98
|
-
}, z.core.$strict>>;
|
|
99
|
-
}, z.core.$strict>>>;
|
|
100
|
-
telephony: z.ZodOptional<z.ZodObject<{
|
|
101
|
-
exchanges: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
102
|
-
address: z.ZodString;
|
|
103
|
-
codecs: z.ZodArray<z.ZodEnum<{
|
|
104
|
-
opus: "opus";
|
|
105
|
-
g722: "g722";
|
|
106
|
-
ulaw: "ulaw";
|
|
107
|
-
}>>;
|
|
108
|
-
id: z.ZodString;
|
|
109
|
-
protocol: z.ZodEnum<{
|
|
110
|
-
iax2: "iax2";
|
|
111
|
-
}>;
|
|
112
|
-
}, z.core.$strict>>>;
|
|
113
|
-
phonebook: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
114
|
-
format: z.ZodEnum<{
|
|
115
|
-
hackfed: "hackfed";
|
|
116
|
-
}>;
|
|
117
|
-
url: z.ZodURL;
|
|
118
|
-
}, z.core.$strict>>>;
|
|
119
|
-
prefixes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
120
|
-
description: z.ZodOptional<z.ZodString>;
|
|
121
|
-
exchange: z.ZodString;
|
|
122
|
-
id: z.ZodString;
|
|
123
|
-
prefix: z.ZodE164;
|
|
124
|
-
}, z.core.$strict>>>;
|
|
125
|
-
}, z.core.$strict>>;
|
|
126
|
-
}, z.core.$strip>>;
|
|
127
|
-
}, z.core.$strict>;
|
|
128
|
-
}, z.core.$strip>[];
|
package/dist/v1/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
1
|
+
export * from './base/inet6-number';
|
|
2
|
+
export * from './base/organization-id';
|
|
3
|
+
export * from './base/resource-definition';
|
|
4
|
+
export * from './directory/telephony';
|
|
5
|
+
export * from './entity/organization';
|
|
6
|
+
export * from './service/about';
|
|
7
|
+
export * from './service/access';
|
|
8
|
+
export * from './service/nebula';
|
|
9
|
+
export * from './service/telephony';
|
package/dist/v1/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// Base
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
2
|
+
export * from './base/inet6-number';
|
|
3
|
+
export * from './base/organization-id';
|
|
4
|
+
export * from './base/resource-definition';
|
|
5
5
|
// Directories
|
|
6
|
-
export
|
|
6
|
+
export * from './directory/telephony';
|
|
7
7
|
// Entities
|
|
8
|
-
export
|
|
8
|
+
export * from './entity/organization';
|
|
9
9
|
// Services
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
10
|
+
export * from './service/about';
|
|
11
|
+
export * from './service/access';
|
|
12
|
+
export * from './service/nebula';
|
|
13
|
+
export * from './service/telephony';
|
|
@@ -6,9 +6,3 @@ export declare const AboutServiceSchema: z.ZodObject<{
|
|
|
6
6
|
}, z.core.$strict>>;
|
|
7
7
|
}, z.core.$strict>;
|
|
8
8
|
export type AboutService = z.infer<typeof AboutServiceSchema>;
|
|
9
|
-
export declare const __schemas: z.ZodObject<{
|
|
10
|
-
contact: z.ZodOptional<z.ZodObject<{
|
|
11
|
-
email: z.ZodOptional<z.ZodEmail>;
|
|
12
|
-
website: z.ZodOptional<z.ZodURL>;
|
|
13
|
-
}, z.core.$strict>>;
|
|
14
|
-
}, z.core.$strict>[];
|
package/dist/v1/service/about.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const AccessServiceGitHubMaintainerSchema: z.ZodObject<{
|
|
3
3
|
type: z.ZodLiteral<"github">;
|
|
4
4
|
username: z.ZodString;
|
|
5
5
|
}, z.core.$strip>;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const AccessServiceEmailMaintainerSchema: z.ZodObject<{
|
|
7
7
|
email: z.ZodEmail;
|
|
8
8
|
type: z.ZodLiteral<"email">;
|
|
9
9
|
}, z.core.$strip>;
|
|
10
|
-
export declare const
|
|
10
|
+
export declare const AccessServiceMaintainerSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
11
11
|
type: z.ZodLiteral<"github">;
|
|
12
12
|
username: z.ZodString;
|
|
13
13
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -24,15 +24,6 @@ export declare const AccessServiceSchema: z.ZodObject<{
|
|
|
24
24
|
}, z.core.$strip>], "type">>>;
|
|
25
25
|
}, z.core.$strict>;
|
|
26
26
|
export type AccessService = z.infer<typeof AccessServiceSchema>;
|
|
27
|
-
export type
|
|
28
|
-
export type
|
|
29
|
-
export type
|
|
30
|
-
export declare const __schemas: z.ZodObject<{
|
|
31
|
-
maintainers: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
32
|
-
type: z.ZodLiteral<"github">;
|
|
33
|
-
username: z.ZodString;
|
|
34
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
35
|
-
email: z.ZodEmail;
|
|
36
|
-
type: z.ZodLiteral<"email">;
|
|
37
|
-
}, z.core.$strip>], "type">>>;
|
|
38
|
-
}, z.core.$strict>[];
|
|
27
|
+
export type AccessServiceMaintainer = z.infer<typeof AccessServiceMaintainerSchema>;
|
|
28
|
+
export type AccessServiceGitHubMaintainer = z.infer<typeof AccessServiceGitHubMaintainerSchema>;
|
|
29
|
+
export type AccessServiceEmailMaintainer = z.infer<typeof AccessServiceEmailMaintainerSchema>;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export const
|
|
2
|
+
export const AccessServiceGitHubMaintainerSchema = z
|
|
3
3
|
.object({
|
|
4
4
|
type: z.literal('github'),
|
|
5
5
|
username: z.string().describe('Username for GitHub type maintainers'),
|
|
6
6
|
})
|
|
7
7
|
.describe('Maintainer identified by GitHub username');
|
|
8
|
-
export const
|
|
8
|
+
export const AccessServiceEmailMaintainerSchema = z
|
|
9
9
|
.object({
|
|
10
10
|
email: z.email().describe('Email address for email type maintainers'),
|
|
11
11
|
type: z.literal('email'),
|
|
12
12
|
})
|
|
13
13
|
.describe('Maintainer identified by email address');
|
|
14
|
-
export const
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
export const AccessServiceMaintainerSchema = z.discriminatedUnion('type', [
|
|
15
|
+
AccessServiceGitHubMaintainerSchema,
|
|
16
|
+
AccessServiceEmailMaintainerSchema,
|
|
17
17
|
]);
|
|
18
18
|
export const AccessServiceSchema = z
|
|
19
19
|
.object({
|
|
20
20
|
maintainers: z
|
|
21
|
-
.array(
|
|
21
|
+
.array(AccessServiceMaintainerSchema)
|
|
22
22
|
.min(1)
|
|
23
23
|
.describe('List of organization maintainers')
|
|
24
24
|
.optional(),
|
|
@@ -29,4 +29,3 @@ export const AccessServiceSchema = z
|
|
|
29
29
|
id: 'AccessService',
|
|
30
30
|
title: 'Organization Access Service',
|
|
31
31
|
});
|
|
32
|
-
export const __schemas = [AccessServiceSchema];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const NebulaServiceNodeSchema: z.ZodObject<{
|
|
3
3
|
address: z.ZodString;
|
|
4
4
|
certificates: z.ZodArray<z.ZodString>;
|
|
5
5
|
lighthouse: z.ZodOptional<z.ZodObject<{
|
|
@@ -16,12 +16,4 @@ export declare const NebulaServiceSchema: z.ZodArray<z.ZodObject<{
|
|
|
16
16
|
}, z.core.$strict>>;
|
|
17
17
|
}, z.core.$strict>>;
|
|
18
18
|
export type NebulaService = z.infer<typeof NebulaServiceSchema>;
|
|
19
|
-
export type
|
|
20
|
-
export declare const __schemas: z.ZodArray<z.ZodObject<{
|
|
21
|
-
address: z.ZodString;
|
|
22
|
-
certificates: z.ZodArray<z.ZodString>;
|
|
23
|
-
lighthouse: z.ZodOptional<z.ZodObject<{
|
|
24
|
-
enabled: z.ZodBoolean;
|
|
25
|
-
endpoints: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
26
|
-
}, z.core.$strict>>;
|
|
27
|
-
}, z.core.$strict>>[];
|
|
19
|
+
export type NebulaServiceNode = z.infer<typeof NebulaServiceNodeSchema>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { Inet6NumberSchema } from '../base/inet6-number';
|
|
3
|
-
export const
|
|
3
|
+
export const NebulaServiceNodeSchema = z
|
|
4
4
|
.object({
|
|
5
5
|
address: Inet6NumberSchema.describe('IPv6 address of the Nebula node'),
|
|
6
6
|
certificates: z
|
|
@@ -24,9 +24,8 @@ export const NebulaNodeSchema = z
|
|
|
24
24
|
.optional(),
|
|
25
25
|
})
|
|
26
26
|
.strict();
|
|
27
|
-
export const NebulaServiceSchema = z.array(
|
|
27
|
+
export const NebulaServiceSchema = z.array(NebulaServiceNodeSchema).meta({
|
|
28
28
|
description: 'Nebula VPN network configuration for the organization',
|
|
29
29
|
id: 'NebulaService',
|
|
30
30
|
title: 'Organization Nebula Service',
|
|
31
31
|
});
|
|
32
|
-
export const __schemas = [NebulaServiceSchema];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const TelephonyServiceExchangeSchema: z.ZodObject<{
|
|
3
3
|
address: z.ZodString;
|
|
4
4
|
codecs: z.ZodArray<z.ZodEnum<{
|
|
5
5
|
opus: "opus";
|
|
@@ -11,13 +11,13 @@ export declare const ExchangeSchema: z.ZodObject<{
|
|
|
11
11
|
iax2: "iax2";
|
|
12
12
|
}>;
|
|
13
13
|
}, z.core.$strict>;
|
|
14
|
-
export declare const
|
|
14
|
+
export declare const TelephonyServicePrefixSchema: z.ZodObject<{
|
|
15
15
|
description: z.ZodOptional<z.ZodString>;
|
|
16
16
|
exchange: z.ZodString;
|
|
17
17
|
id: z.ZodString;
|
|
18
18
|
prefix: z.ZodE164;
|
|
19
19
|
}, z.core.$strict>;
|
|
20
|
-
export declare const
|
|
20
|
+
export declare const TelephonyServicePhonebookSchema: z.ZodObject<{
|
|
21
21
|
format: z.ZodEnum<{
|
|
22
22
|
hackfed: "hackfed";
|
|
23
23
|
}>;
|
|
@@ -50,32 +50,6 @@ export declare const TelephonyServiceSchema: z.ZodObject<{
|
|
|
50
50
|
}, z.core.$strict>>>;
|
|
51
51
|
}, z.core.$strict>;
|
|
52
52
|
export type TelephonyService = z.infer<typeof TelephonyServiceSchema>;
|
|
53
|
-
export type
|
|
54
|
-
export type
|
|
55
|
-
export type
|
|
56
|
-
export declare const __schemas: z.ZodObject<{
|
|
57
|
-
exchanges: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
58
|
-
address: z.ZodString;
|
|
59
|
-
codecs: z.ZodArray<z.ZodEnum<{
|
|
60
|
-
opus: "opus";
|
|
61
|
-
g722: "g722";
|
|
62
|
-
ulaw: "ulaw";
|
|
63
|
-
}>>;
|
|
64
|
-
id: z.ZodString;
|
|
65
|
-
protocol: z.ZodEnum<{
|
|
66
|
-
iax2: "iax2";
|
|
67
|
-
}>;
|
|
68
|
-
}, z.core.$strict>>>;
|
|
69
|
-
phonebook: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
70
|
-
format: z.ZodEnum<{
|
|
71
|
-
hackfed: "hackfed";
|
|
72
|
-
}>;
|
|
73
|
-
url: z.ZodURL;
|
|
74
|
-
}, z.core.$strict>>>;
|
|
75
|
-
prefixes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
76
|
-
description: z.ZodOptional<z.ZodString>;
|
|
77
|
-
exchange: z.ZodString;
|
|
78
|
-
id: z.ZodString;
|
|
79
|
-
prefix: z.ZodE164;
|
|
80
|
-
}, z.core.$strict>>>;
|
|
81
|
-
}, z.core.$strict>[];
|
|
53
|
+
export type TelephonyServiceExchange = z.infer<typeof TelephonyServiceExchangeSchema>;
|
|
54
|
+
export type TelephonyServicePrefix = z.infer<typeof TelephonyServicePrefixSchema>;
|
|
55
|
+
export type TelephonyServicePhonebook = z.infer<typeof TelephonyServicePhonebookSchema>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export const
|
|
2
|
+
export const TelephonyServiceExchangeSchema = z
|
|
3
3
|
.object({
|
|
4
4
|
address: z
|
|
5
5
|
.string()
|
|
@@ -12,7 +12,7 @@ export const ExchangeSchema = z
|
|
|
12
12
|
protocol: z.enum(['iax2']).describe('Telephony protocol used by the exchange'),
|
|
13
13
|
})
|
|
14
14
|
.strict();
|
|
15
|
-
export const
|
|
15
|
+
export const TelephonyServicePrefixSchema = z
|
|
16
16
|
.object({
|
|
17
17
|
description: z.string().describe('Human-readable description of the prefix').optional(),
|
|
18
18
|
exchange: z.string().describe('Reference to the exchange ID handling this prefix'),
|
|
@@ -20,7 +20,7 @@ export const PrefixSchema = z
|
|
|
20
20
|
prefix: z.e164().describe('Numeric prefix for phone numbers'),
|
|
21
21
|
})
|
|
22
22
|
.strict();
|
|
23
|
-
export const
|
|
23
|
+
export const TelephonyServicePhonebookSchema = z
|
|
24
24
|
.object({
|
|
25
25
|
format: z.enum(['hackfed']).describe('Format of the phonebook data'),
|
|
26
26
|
url: z.url().describe('URL to the phonebook resource'),
|
|
@@ -28,10 +28,10 @@ export const PhonebookSchema = z
|
|
|
28
28
|
.strict();
|
|
29
29
|
export const TelephonyServiceSchema = z
|
|
30
30
|
.object({
|
|
31
|
-
exchanges: z.array(
|
|
32
|
-
phonebook: z.array(
|
|
31
|
+
exchanges: z.array(TelephonyServiceExchangeSchema).describe('List of telephony exchanges').optional(),
|
|
32
|
+
phonebook: z.array(TelephonyServicePhonebookSchema).describe('Public phonebook URLs').optional(),
|
|
33
33
|
prefixes: z
|
|
34
|
-
.array(
|
|
34
|
+
.array(TelephonyServicePrefixSchema)
|
|
35
35
|
.describe('Telephony number prefixes allocated to the organization')
|
|
36
36
|
.optional(),
|
|
37
37
|
})
|
|
@@ -41,4 +41,3 @@ export const TelephonyServiceSchema = z
|
|
|
41
41
|
id: 'TelephonyService',
|
|
42
42
|
title: 'Organization Telephony Service',
|
|
43
43
|
});
|
|
44
|
-
export const __schemas = [TelephonyServiceSchema];
|