@warp-drive/core-types 0.0.0-alpha.13 → 0.0.0-alpha.15
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/addon/identifier.js.map +1 -1
- package/addon/symbols.js +20 -1
- package/addon/symbols.js.map +1 -1
- package/package.json +3 -3
package/addon/identifier.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identifier.js","sources":["../src/identifier.ts"],"sourcesContent":["/**\n @module @ember-data/store\n*/\n\n// provided for additional debuggability\nexport const DEBUG_CLIENT_ORIGINATED: unique symbol = Symbol('record-originated-on-client');\nexport const DEBUG_IDENTIFIER_BUCKET: unique symbol = Symbol('identifier-bucket');\nexport const DEBUG_STALE_CACHE_OWNER: unique symbol = Symbol('warpDriveStaleCache');\n\n// also present in production\nexport const CACHE_OWNER: unique symbol = Symbol('warpDriveCache');\n\nexport type IdentifierBucket = 'record' | 'document';\n\nexport interface Identifier {\n lid: string;\n clientId?: string;\n}\n\nexport interface ExistingRecordIdentifier extends Identifier {\n id: string;\n type:
|
|
1
|
+
{"version":3,"file":"identifier.js","sources":["../src/identifier.ts"],"sourcesContent":["/**\n @module @ember-data/store\n*/\n\n// provided for additional debuggability\nexport const DEBUG_CLIENT_ORIGINATED: unique symbol = Symbol('record-originated-on-client');\nexport const DEBUG_IDENTIFIER_BUCKET: unique symbol = Symbol('identifier-bucket');\nexport const DEBUG_STALE_CACHE_OWNER: unique symbol = Symbol('warpDriveStaleCache');\n\n// also present in production\nexport const CACHE_OWNER: unique symbol = Symbol('warpDriveCache');\n\nexport type IdentifierBucket = 'record' | 'document';\n\nexport interface Identifier {\n lid: string;\n clientId?: string;\n}\n\nexport interface ExistingRecordIdentifier<T extends string = string> extends Identifier {\n id: string;\n type: T;\n}\n\nexport interface NewRecordIdentifier<T extends string = string> extends Identifier {\n id: string | null;\n type: T;\n}\n\nexport type StableDocumentIdentifier = {\n lid: string;\n};\n\n/**\n * An Identifier specific to a record which may or may not\n * be present in the cache.\n *\n * The absence of an `id` DOES NOT indicate that this\n * Identifier is for a new client-created record as it\n * may also indicate that it was generated for a secondary\n * index and the primary `id` index is not yet known.\n *\n * @internal\n */\nexport type RecordIdentifier<T extends string = string> = ExistingRecordIdentifier<T> | NewRecordIdentifier<T>;\n\n/**\n * Used when an Identifier is known to be the stable version\n *\n * @internal\n */\nexport interface StableIdentifier extends Identifier {\n [DEBUG_IDENTIFIER_BUCKET]?: string;\n}\n\n/**\n * Used when a StableRecordIdentifier was not created locally as part\n * of a call to store.createRecord\n *\n * Distinguishing between this Identifier and one for a client created\n * record that was created with an ID is generally speaking not possible\n * at runtime, so anything with an ID typically narrows to this.\n *\n * @internal\n */\nexport interface StableExistingRecordIdentifier<T extends string = string> extends StableIdentifier {\n id: string;\n type: T;\n [DEBUG_CLIENT_ORIGINATED]?: boolean;\n [CACHE_OWNER]: number | undefined;\n [DEBUG_STALE_CACHE_OWNER]?: number | undefined;\n}\n\n/**\n * Used when a StableRecordIdentifier was created locally\n * (by a call to store.createRecord).\n *\n * It is possible in rare circumstances to have a StableRecordIdentifier\n * that is not for a new record but does not have an ID. This would\n * happen if a user intentionally created one for use with a secondary-index\n * prior to the record having been fully loaded.\n *\n * @internal\n */\nexport interface StableNewRecordIdentifier<T extends string = string> extends StableIdentifier {\n id: string | null;\n type: T;\n [DEBUG_CLIENT_ORIGINATED]?: boolean;\n [CACHE_OWNER]: number | undefined;\n [DEBUG_STALE_CACHE_OWNER]?: number | undefined;\n}\n\n/**\n * A referentially stable object with a unique string (lid) that can be used\n * as a reference to data in the cache.\n *\n * Every record instance has a unique identifier, and identifiers may refer\n * to data that has never been loaded (for instance, in an async relationship).\n *\n * @class StableRecordIdentifier\n * @public\n */\n\n/**\n * A string representing a unique identity.\n *\n * @property {string} lid\n * @public\n */\n/**\n * the primary resource `type` or `modelName` this identity belongs to.\n *\n * @property {string} type\n * @public\n */\n/**\n * the primary id for the record this identity belongs to. `null`\n * if not yet assigned an id.\n *\n * @property {string | null} id\n * @public\n */\nexport type StableRecordIdentifier<T extends string = string> =\n | StableExistingRecordIdentifier<T>\n | StableNewRecordIdentifier<T>;\n"],"names":["DEBUG_CLIENT_ORIGINATED","Symbol","DEBUG_IDENTIFIER_BUCKET","DEBUG_STALE_CACHE_OWNER","CACHE_OWNER"],"mappings":"AAAA;AACA;AACA;;AAEA;MACaA,uBAAsC,GAAGC,MAAM,CAAC,6BAA6B,EAAC;MAC9EC,uBAAsC,GAAGD,MAAM,CAAC,mBAAmB,EAAC;MACpEE,uBAAsC,GAAGF,MAAM,CAAC,qBAAqB,EAAC;;AAEnF;MACaG,WAA0B,GAAGH,MAAM,CAAC,gBAAgB,EAAC;;AAuBlE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
|
package/addon/symbols.js
CHANGED
|
@@ -1,2 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @module @warp-drive/core-types
|
|
3
|
+
*/
|
|
1
4
|
const RecordStore = Symbol('Store');
|
|
2
|
-
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Symbol for the type of a resource.
|
|
8
|
+
*
|
|
9
|
+
* This is an optional feature that can be used by
|
|
10
|
+
* record implementations to provide a typescript
|
|
11
|
+
* hint for the type of the resource.
|
|
12
|
+
*
|
|
13
|
+
* When used, EmberData and WarpDrive APIs can
|
|
14
|
+
* take advantage of this to provide better type
|
|
15
|
+
* safety and intellisense.
|
|
16
|
+
*
|
|
17
|
+
* @type {Symbol}
|
|
18
|
+
* @typedoc
|
|
19
|
+
*/
|
|
20
|
+
const ResourceType = Symbol('$type');
|
|
21
|
+
export { RecordStore, ResourceType };
|
package/addon/symbols.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"symbols.js","sources":["../src/symbols.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"symbols.js","sources":["../src/symbols.ts"],"sourcesContent":["/*\n * @module @warp-drive/core-types\n */\nexport const RecordStore = Symbol('Store');\n\n/**\n * Symbol for the type of a resource.\n *\n * This is an optional feature that can be used by\n * record implementations to provide a typescript\n * hint for the type of the resource.\n *\n * When used, EmberData and WarpDrive APIs can\n * take advantage of this to provide better type\n * safety and intellisense.\n *\n * @type {Symbol}\n * @typedoc\n */\nexport const ResourceType = Symbol('$type');\n"],"names":["RecordStore","Symbol","ResourceType"],"mappings":"AAAA;AACA;AACA;MACaA,WAAW,GAAGC,MAAM,CAAC,OAAO,EAAC;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACaC,YAAY,GAAGD,MAAM,CAAC,OAAO;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warp-drive/core-types",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.15",
|
|
4
4
|
"description": "Provides core logic, utils and types for WarpDrive and EmberData",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"NCC-1701-a-blue.svg"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@ember-data/private-build-infra": "5.4.0-alpha.
|
|
24
|
+
"@ember-data/private-build-infra": "5.4.0-alpha.29",
|
|
25
25
|
"ember-cli-babel": "^8.2.0",
|
|
26
26
|
"pnpm-sync-dependencies-meta-injected": "0.0.10"
|
|
27
27
|
},
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@glimmer/component": "^1.1.2",
|
|
46
46
|
"@rollup/plugin-babel": "^6.0.4",
|
|
47
47
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
48
|
-
"@warp-drive/internal-config": "5.4.0-alpha.
|
|
48
|
+
"@warp-drive/internal-config": "5.4.0-alpha.29",
|
|
49
49
|
"ember-source": "~5.6.0",
|
|
50
50
|
"rollup": "^4.9.6",
|
|
51
51
|
"typescript": "^5.3.3",
|