@warp-drive/schema-record 0.0.0-alpha.101
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-main.cjs +5 -0
- package/dist/hooks.js +19 -0
- package/dist/hooks.js.map +1 -0
- package/dist/record.js +1159 -0
- package/dist/record.js.map +1 -0
- package/dist/schema.js +278 -0
- package/dist/schema.js.map +1 -0
- package/dist/symbols-DqoS4ybV.js +47 -0
- package/dist/symbols-DqoS4ybV.js.map +1 -0
- package/package.json +111 -0
- package/unstable-preview-types/-private/compute.d.ts +41 -0
- package/unstable-preview-types/-private/compute.d.ts.map +1 -0
- package/unstable-preview-types/-private/managed-array.d.ts +25 -0
- package/unstable-preview-types/-private/managed-array.d.ts.map +1 -0
- package/unstable-preview-types/-private/managed-object.d.ts +23 -0
- package/unstable-preview-types/-private/managed-object.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 +7 -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 +85 -0
- package/unstable-preview-types/schema.d.ts.map +1 -0
- package/unstable-preview-types/symbols.d.ts +16 -0
- package/unstable-preview-types/symbols.d.ts.map +1 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { getOrSetGlobal } from '@warp-drive/core-types/-private';
|
|
2
|
+
|
|
3
|
+
///////////////////
|
|
4
|
+
///// WARNING /////
|
|
5
|
+
///////////////////
|
|
6
|
+
|
|
7
|
+
// Great, got your attention with that warning didn't we?
|
|
8
|
+
// Good. Here's the deal: typescript treats symbols as unique types.
|
|
9
|
+
// If by accident a module creating a symbol is processed more than
|
|
10
|
+
// once, the symbol will be different in each processing. This will
|
|
11
|
+
// cause a type error.
|
|
12
|
+
// It could also cause a runtime error if the symbol is used innapropriately.
|
|
13
|
+
// However, this case is extremely hard to hit and would require other things
|
|
14
|
+
// to go wrong first.
|
|
15
|
+
//
|
|
16
|
+
// So, why do the warning? And why do we lie about the types of the symbols?
|
|
17
|
+
//
|
|
18
|
+
// Because we intentionally create multiple copies of them within the types
|
|
19
|
+
// at build time. This is because we rollup our d.ts files in order to give
|
|
20
|
+
// our consumers a better experience.
|
|
21
|
+
//
|
|
22
|
+
// However, no tool today supports rolling up d.ts files with multiple entry
|
|
23
|
+
// points correctly. The tool we use currently (vite-plugin-dts) uses @microsoft/api-extractor
|
|
24
|
+
// which creates a fully unique stand-alone types file per-entry-point. Thus
|
|
25
|
+
// every entry point that uses one of these symbols somewhere will have accidentally
|
|
26
|
+
// created a new symbol type.
|
|
27
|
+
//
|
|
28
|
+
// This cast allows us to rollup these types using this tool while not encountering
|
|
29
|
+
// the unique symbol type issue.
|
|
30
|
+
//
|
|
31
|
+
// Note that none of these symbols are part of the public API, these are used for
|
|
32
|
+
// debugging DX and as a safe way to provide an intimate contract on public objects.
|
|
33
|
+
|
|
34
|
+
const SOURCE = getOrSetGlobal('SOURCE', Symbol('#source'));
|
|
35
|
+
getOrSetGlobal('MUTATE', Symbol('#update'));
|
|
36
|
+
const ARRAY_SIGNAL = getOrSetGlobal('ARRAY_SIGNAL', Symbol('#array-signal'));
|
|
37
|
+
const OBJECT_SIGNAL = getOrSetGlobal('OBJECT_SIGNAL', Symbol('#object-signal'));
|
|
38
|
+
getOrSetGlobal('NOTIFY', Symbol('#notify'));
|
|
39
|
+
const Destroy = getOrSetGlobal('Destroy', Symbol('Destroy'));
|
|
40
|
+
const Identifier = getOrSetGlobal('Identifier', Symbol('Identifier'));
|
|
41
|
+
const Editable = getOrSetGlobal('Editable', Symbol('Editable'));
|
|
42
|
+
const Parent = getOrSetGlobal('Parent', Symbol('Parent'));
|
|
43
|
+
const Checkout = getOrSetGlobal('Checkout', Symbol('Checkout'));
|
|
44
|
+
const Legacy = getOrSetGlobal('Legacy', Symbol('Legacy'));
|
|
45
|
+
const EmbeddedPath = getOrSetGlobal('EmbeddedPath', Symbol('EmbeddedPath'));
|
|
46
|
+
const EmbeddedType = getOrSetGlobal('EmbeddedType', Symbol('EmbeddedType'));
|
|
47
|
+
export { ARRAY_SIGNAL as A, Checkout as C, Destroy as D, Editable as E, Identifier as I, Legacy as L, OBJECT_SIGNAL as O, Parent as P, SOURCE as S, EmbeddedPath as a, EmbeddedType as b };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbols-DqoS4ybV.js","sources":["../src/symbols.ts"],"sourcesContent":["///////////////////\n///// WARNING /////\n///////////////////\n\nimport { getOrSetGlobal } from '@warp-drive/core-types/-private';\n\n// Great, got your attention with that warning didn't we?\n// Good. Here's the deal: typescript treats symbols as unique types.\n// If by accident a module creating a symbol is processed more than\n// once, the symbol will be different in each processing. This will\n// cause a type error.\n// It could also cause a runtime error if the symbol is used innapropriately.\n// However, this case is extremely hard to hit and would require other things\n// to go wrong first.\n//\n// So, why do the warning? And why do we lie about the types of the symbols?\n//\n// Because we intentionally create multiple copies of them within the types\n// at build time. This is because we rollup our d.ts files in order to give\n// our consumers a better experience.\n//\n// However, no tool today supports rolling up d.ts files with multiple entry\n// points correctly. The tool we use currently (vite-plugin-dts) uses @microsoft/api-extractor\n// which creates a fully unique stand-alone types file per-entry-point. Thus\n// every entry point that uses one of these symbols somewhere will have accidentally\n// created a new symbol type.\n//\n// This cast allows us to rollup these types using this tool while not encountering\n// the unique symbol type issue.\n//\n// Note that none of these symbols are part of the public API, these are used for\n// debugging DX and as a safe way to provide an intimate contract on public objects.\n\nexport const SOURCE = getOrSetGlobal('SOURCE', Symbol('#source'));\nexport const MUTATE = getOrSetGlobal('MUTATE', Symbol('#update'));\nexport const ARRAY_SIGNAL = getOrSetGlobal('ARRAY_SIGNAL', Symbol('#array-signal'));\nexport const OBJECT_SIGNAL = getOrSetGlobal('OBJECT_SIGNAL', Symbol('#object-signal'));\nexport const NOTIFY = getOrSetGlobal('NOTIFY', Symbol('#notify'));\n\nexport const Destroy = getOrSetGlobal('Destroy', Symbol('Destroy'));\nexport const Identifier = getOrSetGlobal('Identifier', Symbol('Identifier'));\nexport const Editable = getOrSetGlobal('Editable', Symbol('Editable'));\nexport const Parent = getOrSetGlobal('Parent', Symbol('Parent'));\nexport const Checkout = getOrSetGlobal('Checkout', Symbol('Checkout'));\nexport const Legacy = getOrSetGlobal('Legacy', Symbol('Legacy'));\n\nexport const EmbeddedPath = getOrSetGlobal('EmbeddedPath', Symbol('EmbeddedPath'));\nexport const EmbeddedType = getOrSetGlobal('EmbeddedType', Symbol('EmbeddedType'));\n"],"names":["SOURCE","getOrSetGlobal","Symbol","ARRAY_SIGNAL","OBJECT_SIGNAL","Destroy","Identifier","Editable","Parent","Checkout","Legacy","EmbeddedPath","EmbeddedType"],"mappings":";;AAAA;AACA;AACA;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,MAAMA,MAAM,GAAGC,cAAc,CAAC,QAAQ,EAAEC,MAAM,CAAC,SAAS,CAAC,EAAC;AAC3CD,cAAc,CAAC,QAAQ,EAAEC,MAAM,CAAC,SAAS,CAAC,EAAC;AAC1D,MAAMC,YAAY,GAAGF,cAAc,CAAC,cAAc,EAAEC,MAAM,CAAC,eAAe,CAAC,EAAC;AAC5E,MAAME,aAAa,GAAGH,cAAc,CAAC,eAAe,EAAEC,MAAM,CAAC,gBAAgB,CAAC,EAAC;AAChED,cAAc,CAAC,QAAQ,EAAEC,MAAM,CAAC,SAAS,CAAC,EAAC;AAE1D,MAAMG,OAAO,GAAGJ,cAAc,CAAC,SAAS,EAAEC,MAAM,CAAC,SAAS,CAAC,EAAC;AAC5D,MAAMI,UAAU,GAAGL,cAAc,CAAC,YAAY,EAAEC,MAAM,CAAC,YAAY,CAAC,EAAC;AACrE,MAAMK,QAAQ,GAAGN,cAAc,CAAC,UAAU,EAAEC,MAAM,CAAC,UAAU,CAAC,EAAC;AAC/D,MAAMM,MAAM,GAAGP,cAAc,CAAC,QAAQ,EAAEC,MAAM,CAAC,QAAQ,CAAC,EAAC;AACzD,MAAMO,QAAQ,GAAGR,cAAc,CAAC,UAAU,EAAEC,MAAM,CAAC,UAAU,CAAC,EAAC;AAC/D,MAAMQ,MAAM,GAAGT,cAAc,CAAC,QAAQ,EAAEC,MAAM,CAAC,QAAQ,CAAC,EAAC;AAEzD,MAAMS,YAAY,GAAGV,cAAc,CAAC,cAAc,EAAEC,MAAM,CAAC,cAAc,CAAC,EAAC;AAC3E,MAAMU,YAAY,GAAGX,cAAc,CAAC,cAAc,EAAEC,MAAM,CAAC,cAAc,CAAC;;;;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@warp-drive/schema-record",
|
|
3
|
+
"version": "0.0.0-alpha.101",
|
|
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 --report-unused-disable-directives",
|
|
17
|
+
"build:pkg": "vite build;",
|
|
18
|
+
"sync-hardlinks": "bun run sync-dependencies-meta-injected"
|
|
19
|
+
},
|
|
20
|
+
"ember-addon": {
|
|
21
|
+
"main": "addon-main.cjs",
|
|
22
|
+
"type": "addon",
|
|
23
|
+
"version": 2
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"addon-main.cjs",
|
|
27
|
+
"dist",
|
|
28
|
+
"README.md",
|
|
29
|
+
"LICENSE.md",
|
|
30
|
+
"NCC-1701-a.svg",
|
|
31
|
+
"NCC-1701-a-blue.svg",
|
|
32
|
+
"unstable-preview-types"
|
|
33
|
+
],
|
|
34
|
+
"exports": {
|
|
35
|
+
"./*": {
|
|
36
|
+
"default": "./dist/*.js"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"@ember-data/request": "5.4.0-alpha.115",
|
|
41
|
+
"@ember-data/model": "5.4.0-alpha.115",
|
|
42
|
+
"@ember-data/store": "5.4.0-alpha.115",
|
|
43
|
+
"@ember-data/tracking": "5.4.0-alpha.115",
|
|
44
|
+
"@warp-drive/core-types": "0.0.0-alpha.101"
|
|
45
|
+
},
|
|
46
|
+
"peerDependenciesMeta": {
|
|
47
|
+
"@ember-data/model": {
|
|
48
|
+
"optional": true
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"dependenciesMeta": {
|
|
52
|
+
"@ember-data/request": {
|
|
53
|
+
"injected": true
|
|
54
|
+
},
|
|
55
|
+
"@ember-data/store": {
|
|
56
|
+
"injected": true
|
|
57
|
+
},
|
|
58
|
+
"@ember-data/model": {
|
|
59
|
+
"injected": true
|
|
60
|
+
},
|
|
61
|
+
"@ember-data/tracking": {
|
|
62
|
+
"injected": true
|
|
63
|
+
},
|
|
64
|
+
"@warp-drive/core-types": {
|
|
65
|
+
"injected": true
|
|
66
|
+
},
|
|
67
|
+
"@warp-drive/build-config": {
|
|
68
|
+
"injected": true
|
|
69
|
+
},
|
|
70
|
+
"@ember-data/legacy-compat": {
|
|
71
|
+
"injected": true
|
|
72
|
+
},
|
|
73
|
+
"@ember-data/request-utils": {
|
|
74
|
+
"injected": true
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"dependencies": {
|
|
78
|
+
"@embroider/macros": "^1.16.6",
|
|
79
|
+
"@warp-drive/build-config": "0.0.0-alpha.52"
|
|
80
|
+
},
|
|
81
|
+
"devDependencies": {
|
|
82
|
+
"@babel/core": "^7.24.5",
|
|
83
|
+
"@babel/plugin-transform-typescript": "^7.24.5",
|
|
84
|
+
"@babel/preset-env": "^7.24.5",
|
|
85
|
+
"@babel/preset-typescript": "^7.24.1",
|
|
86
|
+
"@ember-data/request": "5.4.0-alpha.115",
|
|
87
|
+
"@ember-data/model": "5.4.0-alpha.115",
|
|
88
|
+
"@ember-data/store": "5.4.0-alpha.115",
|
|
89
|
+
"@ember-data/legacy-compat": "5.4.0-alpha.115",
|
|
90
|
+
"@ember-data/tracking": "5.4.0-alpha.115",
|
|
91
|
+
"@ember-data/request-utils": "5.4.0-alpha.115",
|
|
92
|
+
"@ember/test-waiters": "^3.1.0",
|
|
93
|
+
"@glimmer/component": "^1.1.2",
|
|
94
|
+
"@warp-drive/core-types": "0.0.0-alpha.101",
|
|
95
|
+
"@warp-drive/internal-config": "5.4.0-alpha.115",
|
|
96
|
+
"ember-source": "~5.12.0",
|
|
97
|
+
"pnpm-sync-dependencies-meta-injected": "0.0.14",
|
|
98
|
+
"typescript": "^5.4.5",
|
|
99
|
+
"vite": "^5.2.11"
|
|
100
|
+
},
|
|
101
|
+
"ember": {
|
|
102
|
+
"edition": "octane"
|
|
103
|
+
},
|
|
104
|
+
"engines": {
|
|
105
|
+
"node": ">= 18.20.4"
|
|
106
|
+
},
|
|
107
|
+
"volta": {
|
|
108
|
+
"extends": "../../package.json"
|
|
109
|
+
},
|
|
110
|
+
"packageManager": "pnpm@8.15.9"
|
|
111
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
declare module '@warp-drive/schema-record/-private/compute' {
|
|
2
|
+
import type { Future } from '@ember-data/request';
|
|
3
|
+
import type Store from '@ember-data/store';
|
|
4
|
+
import type { StoreRequestInput } from '@ember-data/store';
|
|
5
|
+
import type { StableRecordIdentifier } from '@warp-drive/core-types';
|
|
6
|
+
import type { Cache } from '@warp-drive/core-types/cache';
|
|
7
|
+
import type { ArrayField, DerivedField, FieldSchema, GenericField, LocalField, ObjectField, SchemaArrayField, SchemaObjectField } from '@warp-drive/core-types/schema/fields';
|
|
8
|
+
import type { Links } from '@warp-drive/core-types/spec/json-api-raw';
|
|
9
|
+
import { RecordStore } from '@warp-drive/core-types/symbols';
|
|
10
|
+
import { SchemaRecord } from '@warp-drive/schema-record/record';
|
|
11
|
+
import type { SchemaService } from '@warp-drive/schema-record/schema';
|
|
12
|
+
import { Parent } from '@warp-drive/schema-record/symbols';
|
|
13
|
+
import { ManagedArray } from '@warp-drive/schema-record/-private/managed-array';
|
|
14
|
+
import { ManagedObject } from '@warp-drive/schema-record/-private/managed-object';
|
|
15
|
+
export const ManagedArrayMap: Map<SchemaRecord, Map<FieldSchema, ManagedArray>>;
|
|
16
|
+
export const ManagedObjectMap: Map<SchemaRecord, Map<FieldSchema, SchemaRecord | ManagedObject>>;
|
|
17
|
+
export function computeLocal(record: typeof Proxy<SchemaRecord>, field: LocalField, prop: string): unknown;
|
|
18
|
+
export function peekManagedArray(record: SchemaRecord, field: FieldSchema): ManagedArray | undefined;
|
|
19
|
+
export function peekManagedObject(record: SchemaRecord, field: ObjectField): ManagedObject | undefined;
|
|
20
|
+
export function peekManagedObject(record: SchemaRecord, field: SchemaObjectField): SchemaRecord | undefined;
|
|
21
|
+
export function computeField(schema: SchemaService, cache: Cache, record: SchemaRecord, identifier: StableRecordIdentifier, field: GenericField, prop: string | string[]): unknown;
|
|
22
|
+
export function computeArray(store: Store, schema: SchemaService, cache: Cache, record: SchemaRecord, identifier: StableRecordIdentifier, field: ArrayField | SchemaArrayField, path: string[], isSchemaArray: boolean, editable: boolean, legacy: boolean): ManagedArray | null;
|
|
23
|
+
export function computeObject(schema: SchemaService, cache: Cache, record: SchemaRecord, identifier: StableRecordIdentifier, field: ObjectField, path: string[], editable: boolean, legacy: boolean): SchemaRecord | ManagedObject | null;
|
|
24
|
+
export function computeSchemaObject(store: Store, cache: Cache, record: SchemaRecord, identifier: StableRecordIdentifier, field: SchemaObjectField, path: string[], legacy: boolean, editable: boolean): SchemaRecord | ManagedObject | null;
|
|
25
|
+
export function computeAttribute(cache: Cache, identifier: StableRecordIdentifier, prop: string): unknown;
|
|
26
|
+
export function computeDerivation(schema: SchemaService, record: SchemaRecord, identifier: StableRecordIdentifier, field: DerivedField, prop: string): unknown;
|
|
27
|
+
class ResourceRelationship<T extends SchemaRecord = SchemaRecord> {
|
|
28
|
+
lid: string;
|
|
29
|
+
[Parent]: SchemaRecord;
|
|
30
|
+
[RecordStore]: Store;
|
|
31
|
+
name: string;
|
|
32
|
+
data: T | null;
|
|
33
|
+
links: Links;
|
|
34
|
+
meta: Record<string, unknown>;
|
|
35
|
+
constructor(store: Store, cache: Cache, parent: SchemaRecord, identifier: StableRecordIdentifier, field: FieldSchema, name: string);
|
|
36
|
+
fetch(options?: StoreRequestInput<T, T>): Future<T>;
|
|
37
|
+
}
|
|
38
|
+
export function computeResource<T extends SchemaRecord>(store: Store, cache: Cache, parent: SchemaRecord, identifier: StableRecordIdentifier, field: FieldSchema, prop: string): ResourceRelationship<T>;
|
|
39
|
+
export {};
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=compute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compute.d.ts","sourceRoot":"","sources":["../../src/-private/compute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAG3D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAG1D,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,UAAU,EACV,W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AAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAGpC,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,sBAAsB,EAClC,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,MAAM;IAuBd,KAAK,CAAC,OAAO,CAAC,EAAE,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;CAoBpD;AAgBD,wBAAgB,eAAe,CAAC,CAAC,SAAS,YAAY,EACpD,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,sBAAsB,EAClC,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,MAAM,GACX,oBAAoB,CAAC,CAAC,CAAC,CAMzB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare module '@warp-drive/schema-record/-private/managed-array' {
|
|
2
|
+
import type Store from '@ember-data/store';
|
|
3
|
+
import type { Signal } from '@ember-data/tracking/-private';
|
|
4
|
+
import type { StableRecordIdentifier } from '@warp-drive/core-types';
|
|
5
|
+
import type { Cache } from '@warp-drive/core-types/cache';
|
|
6
|
+
import type { ArrayField, SchemaArrayField } from '@warp-drive/core-types/schema/fields';
|
|
7
|
+
import { SchemaRecord } from '@warp-drive/schema-record/record';
|
|
8
|
+
import type { SchemaService } from '@warp-drive/schema-record/schema';
|
|
9
|
+
import { ARRAY_SIGNAL, Editable, Legacy, MUTATE, SOURCE } from '@warp-drive/schema-record/symbols';
|
|
10
|
+
export function notifyArray(arr: ManagedArray): void;
|
|
11
|
+
export interface ManagedArray extends Omit<Array<unknown>, '[]'> {
|
|
12
|
+
[MUTATE]?(target: unknown[], receiver: typeof Proxy<unknown[]>, prop: string, args: unknown[], _SIGNAL: Signal): unknown;
|
|
13
|
+
}
|
|
14
|
+
export class ManagedArray {
|
|
15
|
+
[SOURCE]: unknown[];
|
|
16
|
+
identifier: StableRecordIdentifier;
|
|
17
|
+
path: string[];
|
|
18
|
+
owner: SchemaRecord;
|
|
19
|
+
[ARRAY_SIGNAL]: Signal;
|
|
20
|
+
[Editable]: boolean;
|
|
21
|
+
[Legacy]: boolean;
|
|
22
|
+
constructor(store: Store, schema: SchemaService, cache: Cache, field: ArrayField | SchemaArrayField, data: unknown[], identifier: StableRecordIdentifier, path: string[], owner: SchemaRecord, isSchemaArray: boolean, editable: boolean, legacy: boolean);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=managed-array.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"managed-array.d.ts","sourceRoot":"","sources":["../../src/-private/managed-array.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAG5D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAG1D,OAAO,KAAK,EAAE,UAAU,EAAa,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAEpG,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAc,MAAM,EAAE,MAAM,EAAU,MAAM,EAAE,MAAM,YAAY,CAAC;AAEhG,wBAAgB,WAAW,CAAC,GAAG,EAAE,YAAY,QAE5C;AAkFD,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,UAAU,EAAE,sBAAsB,CAAC;IACnC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,EAAE,YAAY,CAAC;IACpB,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IACvB,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACpB,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;gBAGxB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,UAAU,GAAG,gBAAgB,EACpC,IAAI,EAAE,OAAO,EAAE,EACf,UAAU,EAAE,sBAAsB,EAClC,IAAI,EAAE,MAAM,EAAE,EACd,KAAK,EAAE,YAAY,EACnB,aAAa,EAAE,OAAO,EACtB,QAAQ,EAAE,OAAO,EACjB,MAAM,EAAE,OAAO;CAwOlB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare module '@warp-drive/schema-record/-private/managed-object' {
|
|
2
|
+
import type { Signal } from '@ember-data/tracking/-private';
|
|
3
|
+
import type { StableRecordIdentifier } from '@warp-drive/core-types';
|
|
4
|
+
import type { Cache } from '@warp-drive/core-types/cache';
|
|
5
|
+
import type { ObjectField, SchemaObjectField } from '@warp-drive/core-types/schema/fields';
|
|
6
|
+
import type { SchemaRecord } from '@warp-drive/schema-record/record';
|
|
7
|
+
import type { SchemaService } from '@warp-drive/schema-record/schema';
|
|
8
|
+
import { Editable, EmbeddedPath, Legacy, MUTATE, OBJECT_SIGNAL, Parent, SOURCE } from '@warp-drive/schema-record/symbols';
|
|
9
|
+
export function notifyObject(obj: ManagedObject): void;
|
|
10
|
+
export interface ManagedObject {
|
|
11
|
+
[MUTATE]?(target: unknown[], receiver: typeof Proxy<unknown[]>, prop: string, args: unknown[], _SIGNAL: Signal): unknown;
|
|
12
|
+
}
|
|
13
|
+
export class ManagedObject {
|
|
14
|
+
[SOURCE]: object;
|
|
15
|
+
[Parent]: StableRecordIdentifier;
|
|
16
|
+
[EmbeddedPath]: string[];
|
|
17
|
+
[OBJECT_SIGNAL]: Signal;
|
|
18
|
+
[Editable]: boolean;
|
|
19
|
+
[Legacy]: boolean;
|
|
20
|
+
constructor(schema: SchemaService, cache: Cache, field: ObjectField | SchemaObjectField, data: object, identifier: StableRecordIdentifier, path: string[], owner: SchemaRecord, editable: boolean, legacy: boolean);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=managed-object.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"managed-object.d.ts","sourceRoot":"","sources":["../../src/-private/managed-object.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAG5D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAG1D,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAE3F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEnG,wBAAgB,YAAY,CAAC,GAAG,EAAE,aAAa,QAE9C;AAQD,MAAM,WAAW,aAAa;IAC5B,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,aAAa;IAChB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACjB,CAAC,MAAM,CAAC,EAAE,sBAAsB,CAAC;IACjC,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IACxB,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACpB,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;gBAGxB,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,WAAW,GAAG,iBAAiB,EACtC,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,sBAAsB,EAClC,IAAI,EAAE,MAAM,EAAE,EACd,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,OAAO,EACjB,MAAM,EAAE,OAAO;CAiGlB"}
|
|
@@ -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,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAIxC,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,7 @@
|
|
|
1
|
+
/// <reference path="./schema.d.ts" />
|
|
2
|
+
/// <reference path="./hooks.d.ts" />
|
|
3
|
+
/// <reference path="./symbols.d.ts" />
|
|
4
|
+
/// <reference path="./record.d.ts" />
|
|
5
|
+
/// <reference path="./-private/managed-array.d.ts" />
|
|
6
|
+
/// <reference path="./-private/managed-object.d.ts" />
|
|
7
|
+
/// <reference path="./-private/compute.d.ts" />
|
|
@@ -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
|
+
import { Checkout, Destroy, Editable, EmbeddedPath, EmbeddedType, Identifier, Legacy, Parent } from '@warp-drive/schema-record/symbols';
|
|
7
|
+
export { Editable, Legacy, Checkout } from '@warp-drive/schema-record/symbols';
|
|
8
|
+
export class SchemaRecord {
|
|
9
|
+
[RecordStore]: Store;
|
|
10
|
+
[Identifier]: StableRecordIdentifier;
|
|
11
|
+
[Parent]: StableRecordIdentifier;
|
|
12
|
+
[EmbeddedType]: string | null;
|
|
13
|
+
[EmbeddedPath]: string[] | null;
|
|
14
|
+
[Editable]: boolean;
|
|
15
|
+
[Legacy]: boolean;
|
|
16
|
+
[Signals]: Map<string, Signal>;
|
|
17
|
+
[Symbol.toStringTag]: `SchemaRecord<${string}>`;
|
|
18
|
+
___notifications: object;
|
|
19
|
+
constructor(store: Store, identifier: StableRecordIdentifier, Mode: {
|
|
20
|
+
[Editable]: boolean;
|
|
21
|
+
[Legacy]: boolean;
|
|
22
|
+
}, isEmbedded?: boolean, embeddedType?: string | null, embeddedPath?: string[] | null);
|
|
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":"AAGA,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAG3C,OAAO,EAA+C,KAAK,MAAM,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAElH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAIrE,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAiB7D,OAAO,EAEL,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,MAAM,EAEN,MAAM,EACP,MAAM,WAAW,CAAC;AAOnB,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAuBvD,qBAAa,YAAY;IACf,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC;IACrB,CAAC,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACrC,CAAC,MAAM,CAAC,EAAE,sBAAsB,CAAC;IACjC,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAChC,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,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,gBAAgB,MAAM,GAAG,CAAC;IAChD,gBAAgB,EAAE,MAAM,CAAC;gBAG/B,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,sBAAsB,EAClC,IAAI,EAAE;QAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,CAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,EAChD,UAAU,UAAQ,EAClB,YAAY,GAAE,MAAM,GAAG,IAAW,EAClC,YAAY,GAAE,MAAM,EAAE,GAAG,IAAW;IAkjBtC,CAAC,OAAO,CAAC,IAAI,IAAI;IASjB,CAAC,QAAQ,CAAC,IAAI,OAAO,CAAC,YAAY,CAAC;CA4BpC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
declare module '@warp-drive/schema-record/schema' {
|
|
2
|
+
import type { SchemaService as SchemaServiceInterface } from '@ember-data/store/types';
|
|
3
|
+
import type { StableRecordIdentifier } from '@warp-drive/core-types';
|
|
4
|
+
import type { ObjectValue, Value } from '@warp-drive/core-types/json/raw';
|
|
5
|
+
import type { Derivation, HashFn } from '@warp-drive/core-types/schema/concepts';
|
|
6
|
+
import type { ArrayField, DerivedField, FieldSchema, GenericField, HashField, LegacyAttributeField, LegacyRelationshipSchema, ObjectField, ResourceSchema } from '@warp-drive/core-types/schema/fields';
|
|
7
|
+
import { Type } from '@warp-drive/core-types/symbols';
|
|
8
|
+
import type { WithPartial } from '@warp-drive/core-types/utils';
|
|
9
|
+
import type { SchemaRecord } from '@warp-drive/schema-record/record';
|
|
10
|
+
export const SchemaRecordFields: FieldSchema[];
|
|
11
|
+
export function withDefaults(schema: WithPartial<ResourceSchema, 'identity'>): ResourceSchema;
|
|
12
|
+
export function fromIdentity(record: SchemaRecord, options: {
|
|
13
|
+
key: 'lid';
|
|
14
|
+
} | {
|
|
15
|
+
key: 'type';
|
|
16
|
+
}, key: string): string;
|
|
17
|
+
export function fromIdentity(record: SchemaRecord, options: {
|
|
18
|
+
key: 'id';
|
|
19
|
+
}, key: string): string | null;
|
|
20
|
+
export function fromIdentity(record: SchemaRecord, options: {
|
|
21
|
+
key: '^';
|
|
22
|
+
}, key: string): StableRecordIdentifier;
|
|
23
|
+
export function fromIdentity(record: SchemaRecord, options: null, key: string): asserts options;
|
|
24
|
+
export namespace fromIdentity { }
|
|
25
|
+
export function registerDerivations(schema: SchemaServiceInterface): void;
|
|
26
|
+
type InternalSchema = {
|
|
27
|
+
original: ResourceSchema;
|
|
28
|
+
traits: Set<string>;
|
|
29
|
+
fields: Map<string, FieldSchema>;
|
|
30
|
+
attributes: Record<string, LegacyAttributeField>;
|
|
31
|
+
relationships: Record<string, LegacyRelationshipSchema>;
|
|
32
|
+
};
|
|
33
|
+
export type Transformation<T extends Value = Value, PT = unknown> = {
|
|
34
|
+
serialize(value: PT, options: Record<string, unknown> | null, record: SchemaRecord): T;
|
|
35
|
+
hydrate(value: T | undefined, options: Record<string, unknown> | null, record: SchemaRecord): PT;
|
|
36
|
+
defaultValue?(options: Record<string, unknown> | null, identifier: StableRecordIdentifier): T;
|
|
37
|
+
[Type]: string;
|
|
38
|
+
};
|
|
39
|
+
export interface SchemaService {
|
|
40
|
+
doesTypeExist(type: string): boolean;
|
|
41
|
+
attributesDefinitionFor(identifier: {
|
|
42
|
+
type: string;
|
|
43
|
+
}): InternalSchema['attributes'];
|
|
44
|
+
relationshipsDefinitionFor(identifier: {
|
|
45
|
+
type: string;
|
|
46
|
+
}): InternalSchema['relationships'];
|
|
47
|
+
}
|
|
48
|
+
export class SchemaService implements SchemaServiceInterface {
|
|
49
|
+
_schemas: Map<string, InternalSchema>;
|
|
50
|
+
_transforms: Map<string, Transformation>;
|
|
51
|
+
_hashFns: Map<string, HashFn>;
|
|
52
|
+
_derivations: Map<string, Derivation<any, any, any>>;
|
|
53
|
+
_traits: Set<string>;
|
|
54
|
+
constructor();
|
|
55
|
+
hasTrait(type: string): boolean;
|
|
56
|
+
resourceHasTrait(resource: StableRecordIdentifier | {
|
|
57
|
+
type: string;
|
|
58
|
+
}, trait: string): boolean;
|
|
59
|
+
transformation(field: GenericField | ObjectField | ArrayField | {
|
|
60
|
+
type: string;
|
|
61
|
+
}): Transformation;
|
|
62
|
+
derivation(field: DerivedField | {
|
|
63
|
+
type: string;
|
|
64
|
+
}): Derivation;
|
|
65
|
+
hashFn(field: HashField | {
|
|
66
|
+
type: string;
|
|
67
|
+
}): HashFn;
|
|
68
|
+
resource(resource: StableRecordIdentifier | {
|
|
69
|
+
type: string;
|
|
70
|
+
}): ResourceSchema;
|
|
71
|
+
registerResources(schemas: ResourceSchema[]): void;
|
|
72
|
+
registerResource(schema: ResourceSchema): void;
|
|
73
|
+
registerTransformation<T extends Value = string, PT = unknown>(transformation: Transformation<T, PT>): void;
|
|
74
|
+
registerDerivation<R, T, FM extends ObjectValue | null>(derivation: Derivation<R, T, FM>): void;
|
|
75
|
+
registerHashFn<T extends object>(hashFn: HashFn<T>): void;
|
|
76
|
+
fields({ type }: {
|
|
77
|
+
type: string;
|
|
78
|
+
}): InternalSchema['fields'];
|
|
79
|
+
hasResource(resource: {
|
|
80
|
+
type: string;
|
|
81
|
+
}): boolean;
|
|
82
|
+
}
|
|
83
|
+
export {};
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,IAAI,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAMvF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,KAAK,EACV,UAAU,EACV,YAAY,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AAG,IAAI;IAIzD,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,cAAc,CAAC,QAAQ,CAAC;IAU5D,WAAW,CAAC,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO;CAGjD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare module '@warp-drive/schema-record/symbols' {
|
|
2
|
+
export const SOURCE: "___(unique) Symbol(SOURCE)";
|
|
3
|
+
export const MUTATE: "___(unique) Symbol(MUTATE)";
|
|
4
|
+
export const ARRAY_SIGNAL: "___(unique) Symbol(ARRAY_SIGNAL)";
|
|
5
|
+
export const OBJECT_SIGNAL: "___(unique) Symbol(OBJECT_SIGNAL)";
|
|
6
|
+
export const NOTIFY: "___(unique) Symbol(NOTIFY)";
|
|
7
|
+
export const Destroy: "___(unique) Symbol(Destroy)";
|
|
8
|
+
export const Identifier: "___(unique) Symbol(Identifier)";
|
|
9
|
+
export const Editable: "___(unique) Symbol(Editable)";
|
|
10
|
+
export const Parent: "___(unique) Symbol(Parent)";
|
|
11
|
+
export const Checkout: "___(unique) Symbol(Checkout)";
|
|
12
|
+
export const Legacy: "___(unique) Symbol(Legacy)";
|
|
13
|
+
export const EmbeddedPath: "___(unique) Symbol(EmbeddedPath)";
|
|
14
|
+
export const EmbeddedType: "___(unique) Symbol(EmbeddedType)";
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=symbols.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbols.d.ts","sourceRoot":"","sources":["../src/symbols.ts"],"names":[],"mappings":"AAiCA,eAAO,MAAM,MAAM,8BAA8C,CAAC;AAClE,eAAO,MAAM,MAAM,8BAA8C,CAAC;AAClE,eAAO,MAAM,YAAY,oCAA0D,CAAC;AACpF,eAAO,MAAM,aAAa,qCAA4D,CAAC;AACvF,eAAO,MAAM,MAAM,8BAA8C,CAAC;AAElE,eAAO,MAAM,OAAO,+BAA+C,CAAC;AACpE,eAAO,MAAM,UAAU,kCAAqD,CAAC;AAC7E,eAAO,MAAM,QAAQ,gCAAiD,CAAC;AACvE,eAAO,MAAM,MAAM,8BAA6C,CAAC;AACjE,eAAO,MAAM,QAAQ,gCAAiD,CAAC;AACvE,eAAO,MAAM,MAAM,8BAA6C,CAAC;AAEjE,eAAO,MAAM,YAAY,oCAAyD,CAAC;AACnF,eAAO,MAAM,YAAY,oCAAyD,CAAC"}
|