@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.
- package/LICENSE +25 -0
- package/README.md +76 -2
- package/dist/index.d.ts +3040 -0
- package/dist/index.js +2096 -0
- package/package.json +82 -3
- package/schemas/2026-10-28/address.json +53 -0
- package/schemas/2026-10-28/attachment.json +31 -0
- package/schemas/2026-10-28/bbox.json +22 -0
- package/schemas/2026-10-28/bundle-content-item.json +122 -0
- package/schemas/2026-10-28/bundle.json +267 -0
- package/schemas/2026-10-28/checklist-item.json +113 -0
- package/schemas/2026-10-28/checklist.json +300 -0
- package/schemas/2026-10-28/cond-expr.json +18 -0
- package/schemas/2026-10-28/content-ref.json +76 -0
- package/schemas/2026-10-28/coordinate.json +26 -0
- package/schemas/2026-10-28/defs-section.json +862 -0
- package/schemas/2026-10-28/document.json +292 -0
- package/schemas/2026-10-28/duration.json +8 -0
- package/schemas/2026-10-28/fieldset-field.json +49 -0
- package/schemas/2026-10-28/form-annex.json +33 -0
- package/schemas/2026-10-28/form-field.json +1037 -0
- package/schemas/2026-10-28/form-party.json +150 -0
- package/schemas/2026-10-28/form.json +369 -0
- package/schemas/2026-10-28/identification.json +44 -0
- package/schemas/2026-10-28/layer.json +556 -0
- package/schemas/2026-10-28/list-field.json +51 -0
- package/schemas/2026-10-28/metadata.json +35 -0
- package/schemas/2026-10-28/money.json +25 -0
- package/schemas/2026-10-28/organization.json +49 -0
- package/schemas/2026-10-28/person.json +49 -0
- package/schemas/2026-10-28/phone.json +32 -0
- package/schemas/2026-10-28/rule-severity.json +11 -0
- package/schemas/2026-10-28/rules-section.json +46 -0
- package/schemas/2026-10-28/signature.json +68 -0
- package/schemas/2026-10-28/validation-rule.json +34 -0
- package/schemas/2026-10-28.json +4636 -0
- package/schemas/config.json +174 -0
- package/schemas/lock.json +151 -0
- package/schemas/manifest.json +184 -0
- package/schemas/registry-item.json +488 -0
- package/schemas/registry.json +281 -0
- package/schemas/schema.json +4636 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Paradoc AI, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
**Trademark Notice**: This license does not grant permission to use the trade names, trademarks, service marks, logos, taglines, or product names of Asterdoc, except as required for reasonable and customary use in describing the origin of the Software.
|
package/README.md
CHANGED
|
@@ -1,3 +1,77 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://asterdoc.com?utm_source=github&utm_medium=schemas" target="_blank" rel="noopener noreferrer">
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://assets.asterdoc.com/asterdoc-logo-400x400-dark.png" type="image/png">
|
|
5
|
+
<img src="https://assets.asterdoc.com/asterdoc-logo-400x400-dark.png" height="64" alt="Asterdoc logo">
|
|
6
|
+
</picture>
|
|
7
|
+
</a>
|
|
8
|
+
<br />
|
|
9
|
+
</p>
|
|
2
10
|
|
|
3
|
-
|
|
11
|
+
<h1 align="center">@asterdoc/schemas</h1>
|
|
12
|
+
|
|
13
|
+
<div align="center">
|
|
14
|
+
|
|
15
|
+
[](https://docs.asterdoc.com?utm_source=github&utm_medium=schemas)
|
|
16
|
+
[](https://x.com/intent/follow?screen_name=asterdoc)
|
|
17
|
+
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
[Asterdoc](https://asterdoc.com?utm_source=github&utm_medium=schemas) is **documents as code**. It lets developers and AI agents define, validate, and render business documents using typed, composable schemas. This eliminates template drift, broken mappings, and brittle glue code — while giving AI systems a reliable document layer they can safely read, reason over, and generate against in production workflows.
|
|
21
|
+
|
|
22
|
+
## Package overview
|
|
23
|
+
|
|
24
|
+
Zod schemas for Asterdoc artifacts, forms, documents, and primitives.
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install @asterdoc/schemas
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
import { FormSchema, DocumentSchema, BundleSchema, ListFieldSchema } from "@asterdoc/schemas";
|
|
36
|
+
|
|
37
|
+
// Validate a form definition
|
|
38
|
+
const result = FormSchema.safeParse(myFormDefinition);
|
|
39
|
+
if (!result.success) {
|
|
40
|
+
console.log(result.error.issues);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Parse and validate (throws on error)
|
|
44
|
+
const form = FormSchema.parse(myFormDefinition);
|
|
45
|
+
|
|
46
|
+
// Lists are recursive, so their item may be any field, including another list.
|
|
47
|
+
const list = ListFieldSchema.parse({
|
|
48
|
+
type: "list",
|
|
49
|
+
label: "Contacts",
|
|
50
|
+
item: { type: "email", label: "Email", required: true },
|
|
51
|
+
minItems: 1,
|
|
52
|
+
});
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Changelog
|
|
56
|
+
|
|
57
|
+
View the [Changelog](https://github.com/asterdoc/asterdoc/blob/main/CHANGELOG.md) for updates.
|
|
58
|
+
|
|
59
|
+
## Related packages
|
|
60
|
+
|
|
61
|
+
- [`@asterdoc/sdk`](../sdk) - Asterdoc framework SDK
|
|
62
|
+
|
|
63
|
+
## Contributing
|
|
64
|
+
|
|
65
|
+
We're open to all community contributions! If you'd like to contribute in any way, please read our [contribution guidelines](https://github.com/asterdoc/asterdoc/blob/main/CONTRIBUTING.md) and [code of conduct](https://github.com/asterdoc/asterdoc/blob/main/CODE_OF_CONDUCT.md).
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
This project is licensed under the MIT license.
|
|
70
|
+
|
|
71
|
+
See [LICENSE](https://github.com/asterdoc/asterdoc/blob/main/LICENSE) for more information.
|
|
72
|
+
|
|
73
|
+
## Acknowledgments
|
|
74
|
+
|
|
75
|
+
Built with these excellent libraries:
|
|
76
|
+
|
|
77
|
+
- [Zod](https://github.com/colinhacks/zod) - TypeScript-first schema validation
|