@hackfed/schemas 0.5.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 CHANGED
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * @fileoverview Stub file to make TypeScript recognize this as a module.
3
3
  */
4
- /* eslint-disable-next-line unicorn/no-empty-file -- stub */
4
+ export {};
@@ -1,4 +1,3 @@
1
1
  import { z } from 'zod';
2
2
  export declare const Inet6NumberSchema: z.ZodString;
3
3
  export type Inet6Number = z.infer<typeof Inet6NumberSchema>;
4
- export declare const __schemas: z.ZodString[];
@@ -8,4 +8,3 @@ export const Inet6NumberSchema = z
8
8
  id: 'Inet6Number',
9
9
  title: 'IPv6 Address',
10
10
  });
11
- export const __schemas = [Inet6NumberSchema];
@@ -1,4 +1,3 @@
1
1
  import { z } from 'zod';
2
2
  export declare const OrganizationIdSchema: z.ZodString;
3
3
  export type OrganizationId = z.infer<typeof OrganizationIdSchema>;
4
- export declare const __schemas: z.ZodString[];
@@ -10,4 +10,3 @@ export const OrganizationIdSchema = z
10
10
  id: 'OrganizationId',
11
11
  title: 'Organization ID',
12
12
  });
13
- export const __schemas = [OrganizationIdSchema];
@@ -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>[];
@@ -17,4 +17,3 @@ export const ResourceDefinitionSchema = z
17
17
  id: 'ResourceDefinition',
18
18
  title: 'Resource Definition',
19
19
  });
20
- export const __schemas = [ResourceDefinitionSchema];
@@ -4,7 +4,7 @@ export declare const TelephonyDirectoryPhonebookSchema: z.ZodObject<{
4
4
  hackfed: "hackfed";
5
5
  }>;
6
6
  url: z.ZodURL;
7
- }, z.core.$strict>;
7
+ }, z.core.$strip>;
8
8
  export declare const TelephonyDirectoryExchangeSchema: z.ZodObject<{
9
9
  codecs: z.ZodArray<z.ZodEnum<{
10
10
  opus: "opus";
@@ -17,7 +17,7 @@ export declare const TelephonyDirectoryExchangeSchema: z.ZodObject<{
17
17
  protocol: z.ZodEnum<{
18
18
  iax2: "iax2";
19
19
  }>;
20
- }, z.core.$strict>;
20
+ }, z.core.$strip>;
21
21
  export declare const TelephonyDirectoryOrgSchema: z.ZodObject<{
22
22
  exchanges: z.ZodArray<z.ZodObject<{
23
23
  codecs: z.ZodArray<z.ZodEnum<{
@@ -31,7 +31,7 @@ export declare const TelephonyDirectoryOrgSchema: z.ZodObject<{
31
31
  protocol: z.ZodEnum<{
32
32
  iax2: "iax2";
33
33
  }>;
34
- }, z.core.$strict>>;
34
+ }, z.core.$strip>>;
35
35
  name: z.ZodString;
36
36
  orgId: z.ZodString;
37
37
  phonebooks: z.ZodArray<z.ZodObject<{
@@ -39,8 +39,8 @@ export declare const TelephonyDirectoryOrgSchema: z.ZodObject<{
39
39
  hackfed: "hackfed";
40
40
  }>;
41
41
  url: z.ZodURL;
42
- }, z.core.$strict>>;
43
- }, z.core.$strict>;
42
+ }, z.core.$strip>>;
43
+ }, z.core.$strip>;
44
44
  export declare const TelephonyDirectorySchema: z.ZodObject<{
45
45
  orgs: z.ZodArray<z.ZodObject<{
46
46
  exchanges: z.ZodArray<z.ZodObject<{
@@ -55,7 +55,7 @@ export declare const TelephonyDirectorySchema: z.ZodObject<{
55
55
  protocol: z.ZodEnum<{
56
56
  iax2: "iax2";
57
57
  }>;
58
- }, z.core.$strict>>;
58
+ }, z.core.$strip>>;
59
59
  name: z.ZodString;
60
60
  orgId: z.ZodString;
61
61
  phonebooks: z.ZodArray<z.ZodObject<{
@@ -63,74 +63,10 @@ export declare const TelephonyDirectorySchema: z.ZodObject<{
63
63
  hackfed: "hackfed";
64
64
  }>;
65
65
  url: z.ZodURL;
66
- }, z.core.$strict>>;
67
- }, z.core.$strict>>;
66
+ }, z.core.$strip>>;
67
+ }, z.core.$strip>>;
68
68
  }, z.core.$strip>;
69
69
  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.$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<{
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.$strict>>;
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.$strict>>;
135
- }, z.core.$strict>>;
136
- }, z.core.$strip>)[];
@@ -5,7 +5,11 @@ export const TelephonyDirectoryPhonebookSchema = z
5
5
  format: z.enum(['hackfed']).describe('Format of the phonebook data'),
6
6
  url: z.url().describe('URL to the phonebook resource'),
7
7
  })
8
- .strict();
8
+ .meta({
9
+ description: 'Information about a public phonebook for an organization.',
10
+ id: 'TelephonyDirectoryPhonebook',
11
+ title: 'Hackfed Telephony Directory Phonebook',
12
+ });
9
13
  export const TelephonyDirectoryExchangeSchema = z
10
14
  .object({
11
15
  codecs: z
@@ -21,7 +25,11 @@ export const TelephonyDirectoryExchangeSchema = z
21
25
  .describe('Telephony number prefixes allocated to the organization for this exchange'),
22
26
  protocol: z.enum(['iax2']).describe('Telephony protocol used by the exchange'),
23
27
  })
24
- .strict();
28
+ .meta({
29
+ description: 'Information about a telephony exchange for an organization.',
30
+ id: 'TelephonyDirectoryExchange',
31
+ title: 'Hackfed Telephony Directory Exchange',
32
+ });
25
33
  export const TelephonyDirectoryOrgSchema = z
26
34
  .object({
27
35
  exchanges: TelephonyDirectoryExchangeSchema
@@ -31,7 +39,11 @@ export const TelephonyDirectoryOrgSchema = z
31
39
  orgId: OrganizationIdSchema.describe('Unique identifier for the organization'),
32
40
  phonebooks: TelephonyDirectoryPhonebookSchema.array().describe('Public phonebook URLs for the organization'),
33
41
  })
34
- .strict();
42
+ .meta({
43
+ description: 'Information about an organization participating in Hackfed Telephony Network.',
44
+ id: 'TelephonyDirectoryOrg',
45
+ title: 'Hackfed Telephony Directory Organization',
46
+ });
35
47
  export const TelephonyDirectorySchema = z
36
48
  .object({
37
49
  orgs: z
@@ -43,9 +55,3 @@ export const TelephonyDirectorySchema = z
43
55
  id: 'TelephonyDirectory',
44
56
  title: 'Hackfed Telephony Directory',
45
57
  });
46
- export const __schemas = [
47
- TelephonyDirectorySchema,
48
- TelephonyDirectoryOrgSchema,
49
- TelephonyDirectoryExchangeSchema,
50
- TelephonyDirectoryPhonebookSchema
51
- ];
@@ -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>[];
@@ -33,4 +33,3 @@ export const OrganizationSchema = ResourceDefinitionSchema
33
33
  id: 'Organization',
34
34
  title: 'Hackfed Organization',
35
35
  });
36
- export const __schemas = [OrganizationSchema];
@@ -1,9 +1,9 @@
1
- export { type Inet6Number, Inet6NumberSchema } from './base/inet6-number';
2
- export { type OrganizationId, OrganizationIdSchema } from './base/organization-id';
3
- export { type ResourceDefinition, ResourceDefinitionSchema } from './base/resource-definition';
4
- export { type TelephonyDirectory, TelephonyDirectorySchema } from './directory/telephony';
5
- export { type Organization, OrganizationSchema } from './entity/organization';
6
- export { type AboutService, AboutServiceSchema } from './service/about';
7
- export { type AccessService, AccessServiceSchema } from './service/access';
8
- export { type NebulaService, NebulaServiceSchema } from './service/nebula';
9
- export { type TelephonyService, TelephonyServiceSchema } from './service/telephony';
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 { Inet6NumberSchema } from './base/inet6-number';
3
- export { OrganizationIdSchema } from './base/organization-id';
4
- export { ResourceDefinitionSchema } from './base/resource-definition';
2
+ export * from './base/inet6-number';
3
+ export * from './base/organization-id';
4
+ export * from './base/resource-definition';
5
5
  // Directories
6
- export { TelephonyDirectorySchema } from './directory/telephony';
6
+ export * from './directory/telephony';
7
7
  // Entities
8
- export { OrganizationSchema } from './entity/organization';
8
+ export * from './entity/organization';
9
9
  // Services
10
- export { AboutServiceSchema } from './service/about';
11
- export { AccessServiceSchema } from './service/access';
12
- export { NebulaServiceSchema } from './service/nebula';
13
- export { TelephonyServiceSchema } from './service/telephony';
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>[];
@@ -16,4 +16,3 @@ export const AboutServiceSchema = z
16
16
  id: 'AboutService',
17
17
  title: 'Organization About Service',
18
18
  });
19
- export const __schemas = [AboutServiceSchema];
@@ -1,13 +1,13 @@
1
1
  import { z } from 'zod';
2
- export declare const GithubMaintainerSchema: z.ZodObject<{
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 EmailMaintainerSchema: z.ZodObject<{
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 MaintainerSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
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 Maintainer = z.infer<typeof MaintainerSchema>;
28
- export type GithubMaintainer = z.infer<typeof GithubMaintainerSchema>;
29
- export type EmailMaintainer = z.infer<typeof EmailMaintainerSchema>;
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 GithubMaintainerSchema = z
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 EmailMaintainerSchema = z
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 MaintainerSchema = z.discriminatedUnion('type', [
15
- GithubMaintainerSchema,
16
- EmailMaintainerSchema,
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(MaintainerSchema)
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 NebulaNodeSchema: z.ZodObject<{
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 NebulaNode = z.infer<typeof NebulaNodeSchema>;
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 NebulaNodeSchema = z
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(NebulaNodeSchema).meta({
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 ExchangeSchema: z.ZodObject<{
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 PrefixSchema: z.ZodObject<{
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 PhonebookSchema: z.ZodObject<{
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 Exchange = z.infer<typeof ExchangeSchema>;
54
- export type Prefix = z.infer<typeof PrefixSchema>;
55
- export type Phonebook = z.infer<typeof PhonebookSchema>;
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 ExchangeSchema = z
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 PrefixSchema = z
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 PhonebookSchema = z
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(ExchangeSchema).describe('List of telephony exchanges').optional(),
32
- phonebook: z.array(PhonebookSchema).describe('Public phonebook URLs').optional(),
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(PrefixSchema)
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];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hackfed/schemas",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {