@fougere/schema 0.17.3-alpha.0 → 0.18.0-alpha.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/SchemaConstraints.d.ts +4 -4
- package/dist/SchemaConstraints.d.ts.map +1 -1
- package/dist/SchemaConstraints.js +1 -7
- package/dist/SchemaConstraints.js.map +1 -1
- package/dist/SchemaConstructor.d.ts +0 -5
- package/dist/SchemaConstructor.d.ts.map +1 -1
- package/dist/SchemaDefinition.d.ts.map +1 -1
- package/dist/SchemaDefinition.js.map +1 -1
- package/dist/axis/Resolver.d.ts +2 -1
- package/dist/axis/Resolver.d.ts.map +1 -1
- package/dist/axis/role/Relation.d.ts +5 -8
- package/dist/axis/role/Relation.d.ts.map +1 -1
- package/dist/axis/role/Relation.js.map +1 -1
- package/dist/axis/role/Role.d.ts +3 -3
- package/dist/axis/role/Role.d.ts.map +1 -1
- package/dist/axis/role/Role.js.map +1 -1
- package/dist/axis/shape/Shape.d.ts +6 -11
- package/dist/axis/shape/Shape.d.ts.map +1 -1
- package/dist/axis/shape/Shape.js.map +1 -1
- package/dist/entity/Entity.d.ts +4 -0
- package/dist/entity/Entity.d.ts.map +1 -0
- package/dist/entity/Entity.js +2 -0
- package/dist/entity/Entity.js.map +1 -0
- package/dist/field/FieldSet.d.ts +4 -7
- package/dist/field/FieldSet.d.ts.map +1 -1
- package/dist/field/FieldSet.js +2 -1
- package/dist/field/FieldSet.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/projection/card/Bundle.d.ts.map +1 -1
- package/dist/projection/card/Bundle.js +2 -2
- package/dist/projection/card/Bundle.js.map +1 -1
- package/dist/projection/card/Card.d.ts.map +1 -1
- package/dist/projection/card/Card.js +4 -4
- package/dist/projection/card/Card.js.map +1 -1
- package/dist/projection/card/Change.d.ts +10 -21
- package/dist/projection/card/Change.d.ts.map +1 -1
- package/dist/projection/card/Envelope.d.ts +7 -0
- package/dist/projection/card/Envelope.d.ts.map +1 -0
- package/dist/projection/card/Envelope.js +3 -0
- package/dist/projection/card/Envelope.js.map +1 -0
- package/dist/projection/card/FieldDescriptor.d.ts +0 -1
- package/dist/projection/card/FieldDescriptor.d.ts.map +1 -1
- package/dist/projection/card/FieldExtension.d.ts +9 -8
- package/dist/projection/card/FieldExtension.d.ts.map +1 -1
- package/dist/projection/card/RoleDescriptor.js.map +1 -1
- package/dist/projection/card/SchemaBundle.d.ts +2 -3
- package/dist/projection/card/SchemaBundle.d.ts.map +1 -1
- package/dist/projection/card/SchemaDescriptor.d.ts +2 -3
- package/dist/projection/card/SchemaDescriptor.d.ts.map +1 -1
- package/dist/vocabulary/primitive/json.d.ts +2 -2
- package/dist/vocabulary/primitive/json.d.ts.map +1 -1
- package/dist/vocabulary/primitive/json.js.map +1 -1
- package/dist/vocabulary/primitive/many.d.ts +2 -2
- package/dist/vocabulary/primitive/many.d.ts.map +1 -1
- package/dist/vocabulary/primitive/ref.d.ts +2 -2
- package/dist/vocabulary/primitive/ref.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/SchemaConstraints.ts +6 -1
- package/src/SchemaConstructor.ts +0 -5
- package/src/SchemaDefinition.ts +6 -11
- package/src/axis/Resolver.ts +3 -1
- package/src/axis/role/Relation.ts +6 -9
- package/src/axis/role/Role.ts +3 -3
- package/src/axis/shape/Shape.ts +5 -6
- package/src/entity/Entity.ts +5 -0
- package/src/field/FieldSet.ts +6 -4
- package/src/index.ts +1 -1
- package/src/projection/card/Bundle.ts +5 -5
- package/src/projection/card/Card.ts +6 -5
- package/src/projection/card/Change.ts +9 -6
- package/src/projection/card/Envelope.ts +4 -0
- package/src/projection/card/FieldDescriptor.ts +0 -1
- package/src/projection/card/FieldExtension.ts +8 -10
- package/src/projection/card/RoleDescriptor.ts +2 -2
- package/src/projection/card/SchemaBundle.ts +2 -3
- package/src/projection/card/SchemaDescriptor.ts +2 -3
- package/src/vocabulary/primitive/json.ts +2 -2
- package/src/vocabulary/primitive/many.ts +2 -2
- package/src/vocabulary/primitive/ref.ts +2 -2
- package/dist/axis/role/EntityConstructor.d.ts +0 -2
- package/dist/axis/role/EntityConstructor.d.ts.map +0 -1
- package/dist/axis/role/EntityConstructor.js +0 -2
- package/dist/axis/role/EntityConstructor.js.map +0 -1
- package/src/axis/role/EntityConstructor.ts +0 -1
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { FieldDescriptor } from './FieldDescriptor.js';
|
|
2
2
|
import type { DerivedFrom } from './DerivedFrom.js';
|
|
3
|
+
import type { Envelope } from './Envelope.js';
|
|
3
4
|
|
|
4
|
-
export interface SchemaDescriptor {
|
|
5
|
+
export interface SchemaDescriptor extends Envelope {
|
|
5
6
|
title?: string;
|
|
6
7
|
type: 'object';
|
|
7
8
|
properties: Record<string, FieldDescriptor>;
|
|
8
9
|
required?: string[];
|
|
9
10
|
'x-fougere-derived'?: DerivedFrom;
|
|
10
|
-
'x-fougere-version': 1;
|
|
11
|
-
'x-fougere-vendor': 'fougere';
|
|
12
11
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Field, type Shared } from '../../field/Field.js';
|
|
2
2
|
import type { SchemaView } from '../../SchemaView.js';
|
|
3
|
+
import type { Entity } from '../../entity/Entity.js';
|
|
3
4
|
import { InputValidator } from '../../validator/InputValidator.js';
|
|
4
5
|
import { SchemaError } from '../../SchemaError.js';
|
|
5
6
|
|
|
6
|
-
type Entity = SchemaView & (new (...args: never[]) => unknown);
|
|
7
7
|
|
|
8
8
|
export function json<T = unknown>(opts?: Shared<T>): Field<T>;
|
|
9
|
-
export function json<E extends
|
|
9
|
+
export function json<E extends Entity>(
|
|
10
10
|
of: E,
|
|
11
11
|
opts?: Shared<InstanceType<E>>,
|
|
12
12
|
): Field<InstanceType<E>>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Entity } from '../../entity/Entity.js';
|
|
2
2
|
import { Relation } from '../../axis/role/Relation.js';
|
|
3
3
|
import { Field, type Described } from '../../field/Field.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* `many(() => Post)` → `{ type: 'array' }` with `role.relation.kind` `'many'`
|
|
7
7
|
*/
|
|
8
|
-
export function many<E extends
|
|
8
|
+
export function many<E extends Entity>(
|
|
9
9
|
target: E | (() => E),
|
|
10
10
|
opts?: Described,
|
|
11
11
|
): Field<InstanceType<E>[]> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Entity } from '../../entity/Entity.js';
|
|
2
2
|
import { Relation, type OnDelete } from '../../axis/role/Relation.js';
|
|
3
3
|
import { Field, type Shared } from '../../field/Field.js';
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ export interface RefOptions extends Shared<string> {
|
|
|
6
6
|
onDelete?: OnDelete;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export function ref<E extends
|
|
9
|
+
export function ref<E extends Entity>(
|
|
10
10
|
target: E | (() => E),
|
|
11
11
|
opts?: RefOptions,
|
|
12
12
|
): Field<string> {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EntityConstructor.d.ts","sourceRoot":"","sources":["../../../src/axis/role/EntityConstructor.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EntityConstructor.js","sourceRoot":"","sources":["../../../src/axis/role/EntityConstructor.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type EntityConstructor = abstract new (...args: any[]) => any;
|