@warp-drive/schema-record 0.0.0-alpha.38
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.md +12 -0
- package/NCC-1701-a-blue.svg +4 -0
- package/NCC-1701-a.svg +4 -0
- package/README.md +265 -0
- package/addon/hooks.js +18 -0
- package/addon/hooks.js.map +1 -0
- package/addon/managed-array.js +164 -0
- package/addon/managed-array.js.map +1 -0
- package/addon/record.js +307 -0
- package/addon/record.js.map +1 -0
- package/addon/schema.js +152 -0
- package/addon/schema.js.map +1 -0
- package/addon-main.js +94 -0
- package/package.json +105 -0
- package/unstable-preview-types/-base-fields.d.ts +23 -0
- package/unstable-preview-types/-base-fields.d.ts.map +1 -0
- package/unstable-preview-types/hooks.d.ts +8 -0
- package/unstable-preview-types/hooks.d.ts.map +1 -0
- package/unstable-preview-types/index.d.ts +5 -0
- package/unstable-preview-types/managed-array.d.ts +26 -0
- package/unstable-preview-types/managed-array.d.ts.map +1 -0
- package/unstable-preview-types/record.d.ts +27 -0
- package/unstable-preview-types/record.d.ts.map +1 -0
- package/unstable-preview-types/schema.d.ts +68 -0
- package/unstable-preview-types/schema.d.ts.map +1 -0
package/package.json
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@warp-drive/schema-record",
|
|
3
|
+
"version": "0.0.0-alpha.38",
|
|
4
|
+
"description": "Schema Driven Resource Presentation for WarpDrive and EmberData",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ember-addon"
|
|
7
|
+
],
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+ssh://git@github.com:emberjs/data.git",
|
|
11
|
+
"directory": "packages/schema-record"
|
|
12
|
+
},
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"author": "",
|
|
15
|
+
"scripts": {
|
|
16
|
+
"lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs --report-unused-disable-directives",
|
|
17
|
+
"build:runtime": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js",
|
|
18
|
+
"build:types": "tsc --build",
|
|
19
|
+
"_build": "bun run build:runtime && bun run build:types",
|
|
20
|
+
"_syncPnpm": "bun run sync-dependencies-meta-injected"
|
|
21
|
+
},
|
|
22
|
+
"ember-addon": {
|
|
23
|
+
"main": "addon-main.js",
|
|
24
|
+
"type": "addon",
|
|
25
|
+
"version": 1
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"addon-main.js",
|
|
29
|
+
"addon",
|
|
30
|
+
"README.md",
|
|
31
|
+
"LICENSE.md",
|
|
32
|
+
"NCC-1701-a.svg",
|
|
33
|
+
"NCC-1701-a-blue.svg",
|
|
34
|
+
"unstable-preview-types"
|
|
35
|
+
],
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"@ember-data/store": "5.4.0-alpha.52",
|
|
38
|
+
"@warp-drive/core-types": "0.0.0-alpha.38",
|
|
39
|
+
"@ember-data/tracking": "5.4.0-alpha.52"
|
|
40
|
+
},
|
|
41
|
+
"dependenciesMeta": {
|
|
42
|
+
"@ember-data/private-build-infra": {
|
|
43
|
+
"injected": true
|
|
44
|
+
},
|
|
45
|
+
"@ember-data/request": {
|
|
46
|
+
"injected": true
|
|
47
|
+
},
|
|
48
|
+
"@ember-data/store": {
|
|
49
|
+
"injected": true
|
|
50
|
+
},
|
|
51
|
+
"@ember-data/tracking": {
|
|
52
|
+
"injected": true
|
|
53
|
+
},
|
|
54
|
+
"@warp-drive/core-types": {
|
|
55
|
+
"injected": true
|
|
56
|
+
},
|
|
57
|
+
"@ember/string": {
|
|
58
|
+
"injected": true
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"dependencies": {
|
|
62
|
+
"@ember-data/private-build-infra": "5.4.0-alpha.52",
|
|
63
|
+
"@ember/edition-utils": "^1.2.0",
|
|
64
|
+
"@embroider/macros": "^1.15.0",
|
|
65
|
+
"ember-cli-babel": "^8.2.0"
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@babel/cli": "^7.24.1",
|
|
69
|
+
"@babel/core": "^7.24.3",
|
|
70
|
+
"@babel/plugin-proposal-decorators": "^7.24.1",
|
|
71
|
+
"@babel/plugin-transform-class-properties": "^7.24.1",
|
|
72
|
+
"@babel/plugin-transform-private-methods": "^7.24.1",
|
|
73
|
+
"@babel/plugin-transform-runtime": "^7.24.3",
|
|
74
|
+
"@babel/plugin-transform-typescript": "^7.24.1",
|
|
75
|
+
"@babel/preset-env": "^7.24.3",
|
|
76
|
+
"@babel/preset-typescript": "^7.24.1",
|
|
77
|
+
"@babel/runtime": "^7.24.1",
|
|
78
|
+
"@ember-data/request": "5.4.0-alpha.52",
|
|
79
|
+
"@ember-data/store": "5.4.0-alpha.52",
|
|
80
|
+
"@ember-data/tracking": "5.4.0-alpha.52",
|
|
81
|
+
"@embroider/addon-dev": "^4.2.1",
|
|
82
|
+
"@glimmer/component": "^1.1.2",
|
|
83
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
84
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
85
|
+
"@warp-drive/core-types": "0.0.0-alpha.38",
|
|
86
|
+
"@warp-drive/internal-config": "5.4.0-alpha.52",
|
|
87
|
+
"ember-source": "~5.7.0",
|
|
88
|
+
"pnpm-sync-dependencies-meta-injected": "0.0.10",
|
|
89
|
+
"rollup": "^4.13.2",
|
|
90
|
+
"typescript": "^5.4.3",
|
|
91
|
+
"walk-sync": "^3.0.0",
|
|
92
|
+
"webpack": "^5.91.0",
|
|
93
|
+
"@ember/string": "^3.1.1"
|
|
94
|
+
},
|
|
95
|
+
"ember": {
|
|
96
|
+
"edition": "octane"
|
|
97
|
+
},
|
|
98
|
+
"engines": {
|
|
99
|
+
"node": ">= 18.20.1"
|
|
100
|
+
},
|
|
101
|
+
"volta": {
|
|
102
|
+
"extends": "../../package.json"
|
|
103
|
+
},
|
|
104
|
+
"packageManager": "pnpm@8.15.6"
|
|
105
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare module '@warp-drive/schema-record/-base-fields' {
|
|
2
|
+
import type { FieldSchema } from '@ember-data/store/-types/q/schema-service';
|
|
3
|
+
import type { StableRecordIdentifier } from '@warp-drive/core-types';
|
|
4
|
+
import { type SchemaRecord } from '@warp-drive/schema-record/record';
|
|
5
|
+
import type { SchemaService } from '@warp-drive/schema-record/schema';
|
|
6
|
+
export const SchemaRecordFields: FieldSchema[];
|
|
7
|
+
export function withFields(fields: FieldSchema[]): FieldSchema[];
|
|
8
|
+
export function fromIdentity(record: SchemaRecord, options: null, key: string): asserts options;
|
|
9
|
+
export function fromIdentity(record: SchemaRecord, options: {
|
|
10
|
+
key: 'lid';
|
|
11
|
+
}, key: string): string;
|
|
12
|
+
export function fromIdentity(record: SchemaRecord, options: {
|
|
13
|
+
key: 'type';
|
|
14
|
+
}, key: string): string;
|
|
15
|
+
export function fromIdentity(record: SchemaRecord, options: {
|
|
16
|
+
key: 'id';
|
|
17
|
+
}, key: string): string | null;
|
|
18
|
+
export function fromIdentity(record: SchemaRecord, options: {
|
|
19
|
+
key: '^';
|
|
20
|
+
}, key: string): StableRecordIdentifier;
|
|
21
|
+
export function registerDerivations(schema: SchemaService): void;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=-base-fields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"-base-fields.d.ts","sourceRoot":"","sources":["../src/-base-fields.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,EAAc,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,KAAK,EAAc,aAAa,EAAE,MAAM,UAAU,CAAC;AAI1D,eAAO,MAAM,kBAAkB,EAAE,WAAW,EAiB3C,CAAC;AAiBF,wBAAgB,UAAU,CAAC,MAAM,EAAE,WAAW,EAAE,iBAG/C;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;AAChG,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE;IAAE,GAAG,EAAE,KAAK,CAAA;CAAE,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;AACjG,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;AAClG,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE;IAAE,GAAG,EAAE,IAAI,CAAA;CAAE,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;AACvG,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE;IAAE,GAAG,EAAE,GAAG,CAAA;CAAE,EAAE,GAAG,EAAE,MAAM,GAAG,sBAAsB,CAAC;AAgB/G,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,QAMxD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare module '@warp-drive/schema-record/hooks' {
|
|
2
|
+
import type Store from '@ember-data/store';
|
|
3
|
+
import type { StableRecordIdentifier } from '@warp-drive/core-types';
|
|
4
|
+
import { SchemaRecord } from '@warp-drive/schema-record/record';
|
|
5
|
+
export function instantiateRecord(store: Store, identifier: StableRecordIdentifier, createArgs?: Record<string, unknown>): SchemaRecord;
|
|
6
|
+
export function teardownRecord(record: SchemaRecord): void;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,EAA6B,YAAY,EAAE,MAAM,UAAU,CAAC;AAGnE,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,sBAAsB,EAClC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACnC,YAAY,CAcd;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAEzD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare module '@warp-drive/schema-record/managed-array' {
|
|
2
|
+
import type Store from '@ember-data/store';
|
|
3
|
+
import type { FieldSchema } from '@ember-data/store/-types/q/schema-service';
|
|
4
|
+
import type { Signal } from '@ember-data/tracking/-private';
|
|
5
|
+
import type { StableRecordIdentifier } from '@warp-drive/core-types';
|
|
6
|
+
import type { Cache } from '@warp-drive/core-types/cache';
|
|
7
|
+
import type { SchemaRecord } from '@warp-drive/schema-record/record';
|
|
8
|
+
import type { SchemaService } from '@warp-drive/schema-record/schema';
|
|
9
|
+
export const SOURCE: unique symbol;
|
|
10
|
+
export const MUTATE: unique symbol;
|
|
11
|
+
export const ARRAY_SIGNAL: unique symbol;
|
|
12
|
+
export const NOTIFY: unique symbol;
|
|
13
|
+
export function notifyArray(arr: ManagedArray): void;
|
|
14
|
+
export interface ManagedArray extends Omit<Array<unknown>, '[]'> {
|
|
15
|
+
[MUTATE]?(target: unknown[], receiver: typeof Proxy<unknown[]>, prop: string, args: unknown[], _SIGNAL: Signal): unknown;
|
|
16
|
+
}
|
|
17
|
+
export class ManagedArray {
|
|
18
|
+
[SOURCE]: unknown[];
|
|
19
|
+
address: StableRecordIdentifier;
|
|
20
|
+
key: string;
|
|
21
|
+
owner: SchemaRecord;
|
|
22
|
+
[ARRAY_SIGNAL]: Signal;
|
|
23
|
+
constructor(store: Store, schema: SchemaService, cache: Cache, field: FieldSchema, data: unknown[], address: StableRecordIdentifier, key: string, owner: SchemaRecord);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=managed-array.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"managed-array.d.ts","sourceRoot":"","sources":["../src/managed-array.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAE5D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAG1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,eAAO,MAAM,MAAM,eAAoB,CAAC;AACxC,eAAO,MAAM,MAAM,eAAoB,CAAC;AACxC,eAAO,MAAM,YAAY,eAAoB,CAAC;AAC9C,eAAO,MAAM,MAAM,eAAoB,CAAC;AAExC,wBAAgB,WAAW,CAAC,GAAG,EAAE,YAAY,QAE5C;AA+ED,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC;IAC9D,CAAC,MAAM,CAAC,CAAC,CACP,MAAM,EAAE,OAAO,EAAE,EACjB,QAAQ,EAAE,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC,EACjC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,EAAE,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAAC;CACZ;AAED,qBAAa,YAAY;IACvB,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC;IACZ,OAAO,EAAE,sBAAsB,CAAC;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,YAAY,CAAC;IACpB,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;gBAG7B,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,OAAO,EAAE,EACf,OAAO,EAAE,sBAAsB,EAC/B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,YAAY;CA6HtB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare module '@warp-drive/schema-record/record' {
|
|
2
|
+
import type Store from '@ember-data/store';
|
|
3
|
+
import { type Signal, Signals } from '@ember-data/tracking/-private';
|
|
4
|
+
import type { StableRecordIdentifier } from '@warp-drive/core-types';
|
|
5
|
+
import { RecordStore } from '@warp-drive/core-types/symbols';
|
|
6
|
+
export const Destroy: unique symbol;
|
|
7
|
+
export const Identifier: unique symbol;
|
|
8
|
+
export const Editable: unique symbol;
|
|
9
|
+
export const Parent: unique symbol;
|
|
10
|
+
export const Checkout: unique symbol;
|
|
11
|
+
export const Legacy: unique symbol;
|
|
12
|
+
export class SchemaRecord {
|
|
13
|
+
[RecordStore]: Store;
|
|
14
|
+
[Identifier]: StableRecordIdentifier;
|
|
15
|
+
[Editable]: boolean;
|
|
16
|
+
[Legacy]: boolean;
|
|
17
|
+
[Signals]: Map<string, Signal>;
|
|
18
|
+
___notifications: object;
|
|
19
|
+
constructor(store: Store, identifier: StableRecordIdentifier, Mode: {
|
|
20
|
+
[Editable]: boolean;
|
|
21
|
+
[Legacy]: boolean;
|
|
22
|
+
});
|
|
23
|
+
[Destroy](): void;
|
|
24
|
+
[Checkout](): Promise<SchemaRecord>;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=record.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../src/record.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAI3C,OAAO,EAML,KAAK,MAAM,EACX,OAAO,EACR,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAMrE,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAK7D,eAAO,MAAM,OAAO,eAAoB,CAAC;AACzC,eAAO,MAAM,UAAU,eAAuB,CAAC;AAC/C,eAAO,MAAM,QAAQ,eAAqB,CAAC;AAC3C,eAAO,MAAM,MAAM,eAAmB,CAAC;AACvC,eAAO,MAAM,QAAQ,eAAqB,CAAC;AAC3C,eAAO,MAAM,MAAM,eAAmB,CAAC;AAmMvC,qBAAa,YAAY;IACf,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC;IACrB,CAAC,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACrC,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACpB,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAClB,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,gBAAgB,EAAE,MAAM,CAAC;gBAErB,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,sBAAsB,EAAE,IAAI,EAAE;QAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,CAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE;IAkL9G,CAAC,OAAO,CAAC,IAAI,IAAI;IASjB,CAAC,QAAQ,CAAC,IAAI,OAAO,CAAC,YAAY,CAAC;CAGpC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
declare module '@warp-drive/schema-record/schema' {
|
|
2
|
+
import type { FieldSchema } from '@ember-data/store/-types/q/schema-service';
|
|
3
|
+
import type { StableRecordIdentifier } from '@warp-drive/core-types';
|
|
4
|
+
import type { Value } from '@warp-drive/core-types/json/raw';
|
|
5
|
+
import type { AttributeSchema, RelationshipSchema } from '@warp-drive/core-types/schema';
|
|
6
|
+
import type { SchemaRecord } from '@warp-drive/schema-record/record';
|
|
7
|
+
export { withFields, registerDerivations } from '@warp-drive/schema-record/-base-fields';
|
|
8
|
+
/**
|
|
9
|
+
* The full schema for a resource
|
|
10
|
+
*
|
|
11
|
+
* @class FieldSpec
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
type FieldSpec = {
|
|
15
|
+
'@id': FieldSchema | null;
|
|
16
|
+
/**
|
|
17
|
+
* legacy schema service separated attribute
|
|
18
|
+
* from relationship lookup
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
attributes: Record<string, AttributeSchema>;
|
|
22
|
+
/**
|
|
23
|
+
* legacy schema service separated attribute
|
|
24
|
+
* from relationship lookup
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
relationships: Record<string, RelationshipSchema>;
|
|
28
|
+
/**
|
|
29
|
+
* new schema service is fields based
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
fields: Map<string, FieldSchema>;
|
|
33
|
+
/**
|
|
34
|
+
* legacy model mode support
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
legacy?: boolean;
|
|
38
|
+
};
|
|
39
|
+
export type Transform<T extends Value = string, PT = unknown> = {
|
|
40
|
+
serialize(value: PT, options: Record<string, unknown> | null, record: SchemaRecord): T;
|
|
41
|
+
hydrate(value: T | undefined, options: Record<string, unknown> | null, record: SchemaRecord): PT;
|
|
42
|
+
defaultValue?(options: Record<string, unknown> | null, identifier: StableRecordIdentifier): T;
|
|
43
|
+
};
|
|
44
|
+
export type Derivation<R, T> = (record: R, options: Record<string, unknown> | null, prop: string) => T;
|
|
45
|
+
export class SchemaService {
|
|
46
|
+
schemas: Map<string, FieldSpec>;
|
|
47
|
+
transforms: Map<string, Transform<Value>>;
|
|
48
|
+
derivations: Map<string, Derivation<unknown, unknown>>;
|
|
49
|
+
constructor();
|
|
50
|
+
registerTransform<T extends Value = string, PT = unknown>(type: string, transform: Transform<T, PT>): void;
|
|
51
|
+
registerDerivation<R, T>(type: string, derivation: Derivation<R, T>): void;
|
|
52
|
+
defineSchema(name: string, schema: {
|
|
53
|
+
legacy?: boolean;
|
|
54
|
+
fields: FieldSchema[];
|
|
55
|
+
}): void;
|
|
56
|
+
fields({ type }: {
|
|
57
|
+
type: string;
|
|
58
|
+
}): FieldSpec['fields'];
|
|
59
|
+
attributesDefinitionFor({ type }: {
|
|
60
|
+
type: string;
|
|
61
|
+
}): FieldSpec['attributes'];
|
|
62
|
+
relationshipsDefinitionFor({ type }: {
|
|
63
|
+
type: string;
|
|
64
|
+
}): FieldSpec['relationships'];
|
|
65
|
+
doesTypeExist(type: string): boolean;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAG7E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEzF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAEjE;;;;;GAKG;AACH,KAAK,SAAS,GAAG;IACf,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1B;;;;OAIG;IACH,UAAU,EAAE,MAA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