@asterdoc/schemas 0.0.0-stage → 0.9.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.
Files changed (42) hide show
  1. package/LICENSE +25 -0
  2. package/README.md +76 -2
  3. package/dist/index.d.ts +3040 -0
  4. package/dist/index.js +2096 -0
  5. package/package.json +82 -3
  6. package/schemas/2026-10-28/address.json +53 -0
  7. package/schemas/2026-10-28/attachment.json +31 -0
  8. package/schemas/2026-10-28/bbox.json +22 -0
  9. package/schemas/2026-10-28/bundle-content-item.json +122 -0
  10. package/schemas/2026-10-28/bundle.json +267 -0
  11. package/schemas/2026-10-28/checklist-item.json +113 -0
  12. package/schemas/2026-10-28/checklist.json +300 -0
  13. package/schemas/2026-10-28/cond-expr.json +18 -0
  14. package/schemas/2026-10-28/content-ref.json +76 -0
  15. package/schemas/2026-10-28/coordinate.json +26 -0
  16. package/schemas/2026-10-28/defs-section.json +862 -0
  17. package/schemas/2026-10-28/document.json +292 -0
  18. package/schemas/2026-10-28/duration.json +8 -0
  19. package/schemas/2026-10-28/fieldset-field.json +49 -0
  20. package/schemas/2026-10-28/form-annex.json +33 -0
  21. package/schemas/2026-10-28/form-field.json +1037 -0
  22. package/schemas/2026-10-28/form-party.json +150 -0
  23. package/schemas/2026-10-28/form.json +369 -0
  24. package/schemas/2026-10-28/identification.json +44 -0
  25. package/schemas/2026-10-28/layer.json +556 -0
  26. package/schemas/2026-10-28/list-field.json +51 -0
  27. package/schemas/2026-10-28/metadata.json +35 -0
  28. package/schemas/2026-10-28/money.json +25 -0
  29. package/schemas/2026-10-28/organization.json +49 -0
  30. package/schemas/2026-10-28/person.json +49 -0
  31. package/schemas/2026-10-28/phone.json +32 -0
  32. package/schemas/2026-10-28/rule-severity.json +11 -0
  33. package/schemas/2026-10-28/rules-section.json +46 -0
  34. package/schemas/2026-10-28/signature.json +68 -0
  35. package/schemas/2026-10-28/validation-rule.json +34 -0
  36. package/schemas/2026-10-28.json +4636 -0
  37. package/schemas/config.json +174 -0
  38. package/schemas/lock.json +151 -0
  39. package/schemas/manifest.json +184 -0
  40. package/schemas/registry-item.json +488 -0
  41. package/schemas/registry.json +281 -0
  42. package/schemas/schema.json +4636 -0
@@ -0,0 +1,174 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.asterdoc.com/config.json",
4
+ "type": "object",
5
+ "properties": {
6
+ "$schema": {
7
+ "type": "string",
8
+ "format": "uri",
9
+ "description": "JSON Schema URI for validation"
10
+ },
11
+ "registries": {
12
+ "type": "object",
13
+ "propertyNames": {
14
+ "type": "string",
15
+ "pattern": "^@[a-zA-Z0-9][a-zA-Z0-9-_]*$",
16
+ "description": "Registry namespace (must start with @)"
17
+ },
18
+ "additionalProperties": {
19
+ "$ref": "#/$defs/RegistryEntry"
20
+ },
21
+ "description": "Configured registries by namespace"
22
+ },
23
+ "defaults": {
24
+ "$ref": "#/$defs/GlobalDefaults"
25
+ },
26
+ "cache": {
27
+ "type": "object",
28
+ "properties": {
29
+ "ttl": {
30
+ "default": 3600,
31
+ "description": "Default cache TTL in seconds. 0 disables caching. Default: 3600 (1 hour)",
32
+ "type": "integer",
33
+ "minimum": 0,
34
+ "maximum": 9007199254740991
35
+ },
36
+ "directory": {
37
+ "type": "string",
38
+ "description": "Custom cache directory. A leading ~ uses the home directory; relative paths use the config file directory. Default: ~/.asterdoc/cache"
39
+ }
40
+ },
41
+ "additionalProperties": false,
42
+ "title": "CacheConfig",
43
+ "description": "Global cache configuration for registry data"
44
+ },
45
+ "security": {
46
+ "type": "object",
47
+ "properties": {
48
+ "allowedContentTypes": {
49
+ "type": "array",
50
+ "items": {
51
+ "type": "string"
52
+ },
53
+ "description": "Content types permitted for layer downloads, added to the built-in defaults. Blocked types are never allowed."
54
+ }
55
+ },
56
+ "additionalProperties": false,
57
+ "title": "SecurityConfig",
58
+ "description": "Security settings for layer downloads"
59
+ },
60
+ "telemetry": {
61
+ "type": "object",
62
+ "properties": {
63
+ "enabled": {
64
+ "type": "boolean",
65
+ "description": "Send anonymous CLI usage telemetry. Set to false to opt out. Default: true"
66
+ }
67
+ },
68
+ "additionalProperties": false,
69
+ "title": "TelemetryConfig",
70
+ "description": "Telemetry preferences"
71
+ },
72
+ "anonymousId": {
73
+ "type": "string",
74
+ "format": "uuid",
75
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
76
+ "description": "Anonymous telemetry identifier. The CLI generates it once and keeps it across resets."
77
+ }
78
+ },
79
+ "additionalProperties": false,
80
+ "title": "Asterdoc Global Config",
81
+ "description": "Schema for ~/.asterdoc/config.json global configuration file",
82
+ "$defs": {
83
+ "RegistryEntry": {
84
+ "anyOf": [
85
+ {
86
+ "type": "string",
87
+ "format": "uri",
88
+ "description": "Simple registry URL"
89
+ },
90
+ {
91
+ "$ref": "#/$defs/RegistryEntryObject"
92
+ }
93
+ ],
94
+ "title": "RegistryEntry",
95
+ "description": "Registry configuration - URL string or object with authentication"
96
+ },
97
+ "RegistryEntryObject": {
98
+ "type": "object",
99
+ "properties": {
100
+ "url": {
101
+ "type": "string",
102
+ "format": "uri",
103
+ "description": "Registry base URL"
104
+ },
105
+ "headers": {
106
+ "type": "object",
107
+ "propertyNames": {
108
+ "type": "string"
109
+ },
110
+ "additionalProperties": {
111
+ "type": "string"
112
+ },
113
+ "description": "HTTP headers for authentication (supports ${ENV_VAR} expansion)"
114
+ },
115
+ "cache": {
116
+ "type": "object",
117
+ "properties": {
118
+ "ttl": {
119
+ "type": "integer",
120
+ "minimum": 0,
121
+ "maximum": 9007199254740991,
122
+ "description": "Cache TTL in seconds. 0 disables caching for this registry."
123
+ }
124
+ },
125
+ "additionalProperties": false,
126
+ "title": "RegistryCacheConfig",
127
+ "description": "Per-registry cache settings"
128
+ }
129
+ },
130
+ "required": [
131
+ "url"
132
+ ],
133
+ "additionalProperties": false,
134
+ "title": "RegistryEntryObject",
135
+ "description": "Registry configuration with authentication options"
136
+ },
137
+ "GlobalDefaults": {
138
+ "type": "object",
139
+ "properties": {
140
+ "output": {
141
+ "default": "json",
142
+ "description": "Default output format for artifacts: json, yaml, typed (json + .d.ts), or ts (TypeScript module)",
143
+ "anyOf": [
144
+ {
145
+ "type": "string",
146
+ "const": "json"
147
+ },
148
+ {
149
+ "type": "string",
150
+ "const": "yaml"
151
+ },
152
+ {
153
+ "type": "string",
154
+ "const": "typed"
155
+ },
156
+ {
157
+ "type": "string",
158
+ "const": "ts"
159
+ }
160
+ ],
161
+ "title": "ArtifactOutputFormat"
162
+ },
163
+ "artifactsDir": {
164
+ "default": "artifacts",
165
+ "description": "Default directory for installed artifacts",
166
+ "type": "string"
167
+ }
168
+ },
169
+ "additionalProperties": false,
170
+ "title": "GlobalDefaults",
171
+ "description": "Default settings for CLI operations"
172
+ }
173
+ }
174
+ }
@@ -0,0 +1,151 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.asterdoc.com/lock.json",
4
+ "type": "object",
5
+ "properties": {
6
+ "$schema": {
7
+ "type": "string",
8
+ "format": "uri",
9
+ "description": "JSON Schema URI for validation"
10
+ },
11
+ "version": {
12
+ "default": 1,
13
+ "description": "Lock file format version",
14
+ "type": "number"
15
+ },
16
+ "artifacts": {
17
+ "type": "object",
18
+ "propertyNames": {
19
+ "type": "string",
20
+ "pattern": "^(?:@[a-zA-Z0-9][a-zA-Z0-9-_]*|@[a-z0-9-]+(?:\\.[a-z0-9-]+)+)\\/[A-Za-z0-9]([A-Za-z0-9]|-[A-Za-z0-9])*$",
21
+ "description": "Artifact reference (@namespace/name)"
22
+ },
23
+ "additionalProperties": {
24
+ "$ref": "#/$defs/LockedArtifact"
25
+ },
26
+ "description": "Installed artifacts by reference"
27
+ }
28
+ },
29
+ "required": [
30
+ "version",
31
+ "artifacts"
32
+ ],
33
+ "additionalProperties": false,
34
+ "title": "Asterdoc Lock File",
35
+ "description": "Schema for .asterdoc/lock.json lock file",
36
+ "$defs": {
37
+ "LockedArtifact": {
38
+ "type": "object",
39
+ "properties": {
40
+ "kind": {
41
+ "type": "string",
42
+ "enum": [
43
+ "form",
44
+ "document",
45
+ "checklist",
46
+ "bundle"
47
+ ],
48
+ "description": "Artifact kind"
49
+ },
50
+ "edition": {
51
+ "type": "string",
52
+ "minLength": 1,
53
+ "maxLength": 64,
54
+ "pattern": "^(?!(?:current|latest|editions|tags|diff)$)[a-z0-9]([a-z0-9]|-[a-z0-9])*$",
55
+ "description": "Key of the installed edition, as the registry manifest lists it. Omitted for an artifact that has no editions."
56
+ },
57
+ "version": {
58
+ "type": "string",
59
+ "description": "Installed artifact version"
60
+ },
61
+ "resolved": {
62
+ "type": "string",
63
+ "format": "uri",
64
+ "description": "Full URL used to fetch the artifact"
65
+ },
66
+ "integrity": {
67
+ "type": "string",
68
+ "pattern": "^sha256-[A-Za-z0-9+/]{43}=$",
69
+ "description": "SHA-256 integrity of the artifact file as written (sha256-<base64>)"
70
+ },
71
+ "installedAt": {
72
+ "type": "string",
73
+ "format": "date-time",
74
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
75
+ "description": "ISO 8601 timestamp when artifact was installed"
76
+ },
77
+ "output": {
78
+ "anyOf": [
79
+ {
80
+ "type": "string",
81
+ "const": "json"
82
+ },
83
+ {
84
+ "type": "string",
85
+ "const": "yaml"
86
+ },
87
+ {
88
+ "type": "string",
89
+ "const": "typed"
90
+ },
91
+ {
92
+ "type": "string",
93
+ "const": "ts"
94
+ }
95
+ ],
96
+ "title": "ArtifactOutputFormat",
97
+ "description": "Output format the artifact was written in"
98
+ },
99
+ "path": {
100
+ "type": "string",
101
+ "description": "Relative path to the artifact file from project root"
102
+ },
103
+ "layers": {
104
+ "type": "object",
105
+ "propertyNames": {
106
+ "type": "string",
107
+ "description": "Layer key"
108
+ },
109
+ "additionalProperties": {
110
+ "$ref": "#/$defs/LockedLayer"
111
+ },
112
+ "description": "Installed layers and their metadata"
113
+ }
114
+ },
115
+ "required": [
116
+ "kind",
117
+ "version",
118
+ "resolved",
119
+ "integrity",
120
+ "installedAt",
121
+ "output",
122
+ "path",
123
+ "layers"
124
+ ],
125
+ "additionalProperties": false,
126
+ "title": "LockedArtifact",
127
+ "description": "Information about an installed artifact"
128
+ },
129
+ "LockedLayer": {
130
+ "type": "object",
131
+ "properties": {
132
+ "integrity": {
133
+ "type": "string",
134
+ "pattern": "^sha256-[A-Za-z0-9+/]{43}=$",
135
+ "description": "SHA-256 integrity of the layer file (sha256-<base64>)"
136
+ },
137
+ "path": {
138
+ "type": "string",
139
+ "description": "Relative path to the layer file from project root"
140
+ }
141
+ },
142
+ "required": [
143
+ "integrity",
144
+ "path"
145
+ ],
146
+ "additionalProperties": false,
147
+ "title": "LockedLayer",
148
+ "description": "Information about an installed layer file"
149
+ }
150
+ }
151
+ }
@@ -0,0 +1,184 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.asterdoc.com/manifest.json",
4
+ "title": "Asterdoc Project Manifest",
5
+ "description": "Schema for asterdoc.json project manifest files",
6
+ "type": "object",
7
+ "properties": {
8
+ "$schema": {
9
+ "type": "string",
10
+ "format": "uri",
11
+ "description": "JSON Schema URI for validation"
12
+ },
13
+ "name": {
14
+ "type": "string",
15
+ "minLength": 3,
16
+ "maxLength": 214,
17
+ "pattern": "^@[a-z0-9-]+\\/[a-z0-9-]+$",
18
+ "description": "Scoped package name (@org/repo-name)"
19
+ },
20
+ "title": {
21
+ "type": "string",
22
+ "minLength": 1,
23
+ "maxLength": 200,
24
+ "description": "Human-readable project title"
25
+ },
26
+ "description": {
27
+ "type": "string",
28
+ "maxLength": 1000,
29
+ "description": "Project description"
30
+ },
31
+ "visibility": {
32
+ "default": "private",
33
+ "description": "Project visibility",
34
+ "anyOf": [
35
+ {
36
+ "type": "string",
37
+ "const": "public"
38
+ },
39
+ {
40
+ "type": "string",
41
+ "const": "private"
42
+ }
43
+ ]
44
+ },
45
+ "registries": {
46
+ "type": "object",
47
+ "propertyNames": {
48
+ "type": "string",
49
+ "pattern": "^@[a-zA-Z0-9][a-zA-Z0-9-_]*$",
50
+ "description": "Registry namespace (must start with @)"
51
+ },
52
+ "additionalProperties": {
53
+ "anyOf": [
54
+ {
55
+ "type": "string",
56
+ "format": "uri",
57
+ "description": "Simple registry URL"
58
+ },
59
+ {
60
+ "type": "object",
61
+ "properties": {
62
+ "url": {
63
+ "type": "string",
64
+ "format": "uri",
65
+ "description": "Registry base URL"
66
+ },
67
+ "headers": {
68
+ "type": "object",
69
+ "propertyNames": {
70
+ "type": "string"
71
+ },
72
+ "additionalProperties": {
73
+ "type": "string"
74
+ },
75
+ "description": "HTTP headers for authentication (supports ${ENV_VAR} expansion)"
76
+ },
77
+ "cache": {
78
+ "type": "object",
79
+ "properties": {
80
+ "ttl": {
81
+ "type": "integer",
82
+ "minimum": 0,
83
+ "maximum": 9007199254740991,
84
+ "description": "Cache TTL in seconds. 0 disables caching for this registry."
85
+ }
86
+ },
87
+ "additionalProperties": false,
88
+ "title": "RegistryCacheConfig",
89
+ "description": "Per-registry cache settings"
90
+ }
91
+ },
92
+ "required": [
93
+ "url"
94
+ ],
95
+ "additionalProperties": false,
96
+ "title": "RegistryEntryObject",
97
+ "description": "Registry configuration with authentication options"
98
+ }
99
+ ],
100
+ "title": "RegistryEntry",
101
+ "description": "Registry configuration - URL string or object with authentication"
102
+ },
103
+ "description": "Custom registries for this project (overrides global config)"
104
+ },
105
+ "artifacts": {
106
+ "type": "object",
107
+ "properties": {
108
+ "dir": {
109
+ "default": "artifacts",
110
+ "description": "Directory for installed artifacts (default: \"artifacts\")",
111
+ "type": "string",
112
+ "minLength": 1,
113
+ "maxLength": 256
114
+ },
115
+ "output": {
116
+ "default": "json",
117
+ "description": "Default output format for artifacts: json, yaml, typed (json + .d.ts), or ts (TypeScript module)",
118
+ "anyOf": [
119
+ {
120
+ "type": "string",
121
+ "const": "json"
122
+ },
123
+ {
124
+ "type": "string",
125
+ "const": "yaml"
126
+ },
127
+ {
128
+ "type": "string",
129
+ "const": "typed"
130
+ },
131
+ {
132
+ "type": "string",
133
+ "const": "ts"
134
+ }
135
+ ],
136
+ "title": "ArtifactOutputFormat"
137
+ }
138
+ },
139
+ "additionalProperties": false,
140
+ "title": "ManifestArtifactConfig",
141
+ "description": "Configuration for artifact management"
142
+ },
143
+ "cache": {
144
+ "type": "object",
145
+ "properties": {
146
+ "ttl": {
147
+ "default": 3600,
148
+ "description": "Default cache TTL in seconds. 0 disables caching. Default: 3600 (1 hour)",
149
+ "type": "integer",
150
+ "minimum": 0,
151
+ "maximum": 9007199254740991
152
+ },
153
+ "directory": {
154
+ "type": "string",
155
+ "description": "Custom cache directory. A leading ~ uses the home directory; relative paths use the project root"
156
+ }
157
+ },
158
+ "additionalProperties": false,
159
+ "title": "ManifestCacheConfig",
160
+ "description": "Project-level cache configuration (overrides global config)"
161
+ },
162
+ "security": {
163
+ "type": "object",
164
+ "properties": {
165
+ "allowedContentTypes": {
166
+ "type": "array",
167
+ "items": {
168
+ "type": "string"
169
+ },
170
+ "description": "Content types permitted for layer downloads, added to the built-in defaults. Blocked types are never allowed."
171
+ }
172
+ },
173
+ "additionalProperties": false,
174
+ "title": "SecurityConfig",
175
+ "description": "Security settings for layer downloads (overrides global config)"
176
+ }
177
+ },
178
+ "required": [
179
+ "name",
180
+ "title",
181
+ "visibility"
182
+ ],
183
+ "additionalProperties": false
184
+ }