@warp-drive/core 5.6.0-alpha.12 → 5.6.0-alpha.13
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/declarations/graph/-private/edges/implicit.d.ts +30 -0
- package/declarations/graph/-private/edges/implicit.d.ts.map +1 -1
- package/declarations/graph/-private/graph.d.ts.map +1 -1
- package/declarations/request/-private/fetch.d.ts +8 -16
- package/declarations/request/-private/fetch.d.ts.map +1 -1
- package/dist/graph/-private.js +32 -24
- package/dist/graph/-private.js.map +1 -1
- package/dist/index.js +8 -17
- package/dist/index.js.map +1 -1
- package/dist/types/-private.js +1 -1
- package/package.json +3 -3
|
@@ -4,6 +4,36 @@ export type ImplicitMeta = UpgradedMeta & {
|
|
|
4
4
|
kind: 'implicit';
|
|
5
5
|
isImplicit: true;
|
|
6
6
|
};
|
|
7
|
+
/**
|
|
8
|
+
Implicit relationships are relationships which have not been declared but the inverse side exists on
|
|
9
|
+
another record somewhere
|
|
10
|
+
|
|
11
|
+
For example consider the following two models
|
|
12
|
+
|
|
13
|
+
::: code-group
|
|
14
|
+
|
|
15
|
+
```js [./models/comment.js]
|
|
16
|
+
import { Model, attr } from '@warp-drive/legacy/model';
|
|
17
|
+
|
|
18
|
+
export default class Comment extends Model {
|
|
19
|
+
@attr text;
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```js [./models/post.js]
|
|
24
|
+
import { Model, attr, hasMany } from '@warp-drive/legacy/model';
|
|
25
|
+
|
|
26
|
+
export default class Post extends Model {
|
|
27
|
+
@attr title;
|
|
28
|
+
@hasMany('comment', { async: true, inverse: null }) comments;
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
:::
|
|
33
|
+
|
|
34
|
+
Then we would have a implicit 'post' relationship for the comment record in order
|
|
35
|
+
to be do things like remove the comment from the post if the comment were to be deleted.
|
|
36
|
+
*/
|
|
7
37
|
export interface ImplicitEdge {
|
|
8
38
|
definition: ImplicitMeta;
|
|
9
39
|
identifier: StableRecordIdentifier;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implicit.d.ts","sourceRoot":"","sources":["../../../../src/graph/-private/edges/implicit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,IAAI,CAAA;CAAE,CAAC;AAEjF,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,YAAY,CAAC;IACzB,UAAU,EAAE,sBAAsB,CAAC;IACnC,YAAY,EAAE,GAAG,CAAC,sBAAsB,CAAC,CAAC;IAC1C,aAAa,EAAE,GAAG,CAAC,sBAAsB,CAAC,CAAC;CAC5C;AAED,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,sBAAsB,GAAG,YAAY,CAO7G"}
|
|
1
|
+
{"version":3,"file":"implicit.d.ts","sourceRoot":"","sources":["../../../../src/graph/-private/edges/implicit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,IAAI,CAAA;CAAE,CAAC;AAEjF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BE;AACF,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,YAAY,CAAC;IACzB,UAAU,EAAE,sBAAsB,CAAC;IACnC,YAAY,EAAE,GAAG,CAAC,sBAAsB,CAAC,CAAC;IAC1C,aAAa,EAAE,GAAG,CAAC,sBA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;IA4C7E,UAAU,CAAC,UAAU,EAAE,sBAAsB,GAAG,OAAO;IAcvD,QAAQ,CAAC,UAAU,EAAE,sBAAsB,GAAG,MAAM,EAAE;IAuBtD,MAAM,CAAC,UAAU,EAAE,sBAAsB;IAezC,IAAI,CAAC,EAAE,EAAE,2BAA2B;IA0BpC,MAAM,CAAC,EAAE,EAAE,2BAA2B,GAAG,cAAc,EAAE,QAAQ,EAAE,IAAI,GAAG,IAAI;IAC9E,MAAM,CAAC,EAAE,EAAE,0BAA0B,EAAE,QAAQ,CAAC,EAAE,KAAK,GAAG,IAAI;IAqE9D,kBAAkB,CAAC,YAAY,EAAE,cAAc;IAQ/C,iBAAiB;IAsCjB,iBAAiB,CAAC,YAAY,EAAE,cAAc,GAAG,YAAY;IAS7D,gBAAgB;IAiBhB,OAAO;CAoBR"}
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A basic Fetch Handler which converts a request into a
|
|
3
|
-
* `fetch` call presuming the response to be `json`.
|
|
4
|
-
*
|
|
5
|
-
* ```ts
|
|
6
|
-
* import Fetch from '@ember-data/request/fetch';
|
|
7
|
-
*
|
|
8
|
-
* manager.use([Fetch]);
|
|
9
|
-
* ```
|
|
10
|
-
*
|
|
11
|
-
* @module
|
|
12
|
-
*/
|
|
13
1
|
import { type Context } from './context';
|
|
14
2
|
interface FastbootRequest extends Request {
|
|
15
3
|
protocol: string;
|
|
@@ -21,16 +9,20 @@ export interface FastBoot {
|
|
|
21
9
|
request: FastbootRequest;
|
|
22
10
|
}
|
|
23
11
|
/**
|
|
24
|
-
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { Fetch } from '@warp-drive/core';
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* A basic Fetch Handler which converts a request into a
|
|
25
17
|
* `fetch` call presuming the response to be `json`.
|
|
26
18
|
*
|
|
27
19
|
* ```ts
|
|
28
|
-
* import Fetch from '@
|
|
20
|
+
* import { RequestManager, Fetch } from '@warp-drive/core';
|
|
29
21
|
*
|
|
30
|
-
* manager
|
|
22
|
+
* const manager = new RequestManager()
|
|
23
|
+
* .use([Fetch]);
|
|
31
24
|
* ```
|
|
32
25
|
*
|
|
33
|
-
* @class Fetch
|
|
34
26
|
* @public
|
|
35
27
|
*/
|
|
36
28
|
declare const Fetch: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/request/-private/fetch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/request/-private/fetch.ts"],"names":[],"mappings":"AAGA,OAAO,EAA2B,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAGlE,UAAU,eAAgB,SAAQ,OAAO;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AACD,MAAM,WAAW,QAAQ;IACvB,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;IACrC,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,eAAe,CAAC;CAC1B;AA6ED;;;;;;;;;;;;;;;;GAgBG;AACH,QAAA,MAAM,KAAK;YACK,CAAC,WAAW,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;CAoJ/C,CAAC;AAMF,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
package/dist/graph/-private.js
CHANGED
|
@@ -2172,6 +2172,38 @@ function legacyGetCollectionRelationshipData(source, getRemoteState) {
|
|
|
2172
2172
|
}
|
|
2173
2173
|
return payload;
|
|
2174
2174
|
}
|
|
2175
|
+
|
|
2176
|
+
/**
|
|
2177
|
+
Implicit relationships are relationships which have not been declared but the inverse side exists on
|
|
2178
|
+
another record somewhere
|
|
2179
|
+
|
|
2180
|
+
For example consider the following two models
|
|
2181
|
+
|
|
2182
|
+
::: code-group
|
|
2183
|
+
|
|
2184
|
+
```js [./models/comment.js]
|
|
2185
|
+
import { Model, attr } from '@warp-drive/legacy/model';
|
|
2186
|
+
|
|
2187
|
+
export default class Comment extends Model {
|
|
2188
|
+
@attr text;
|
|
2189
|
+
}
|
|
2190
|
+
```
|
|
2191
|
+
|
|
2192
|
+
```js [./models/post.js]
|
|
2193
|
+
import { Model, attr, hasMany } from '@warp-drive/legacy/model';
|
|
2194
|
+
|
|
2195
|
+
export default class Post extends Model {
|
|
2196
|
+
@attr title;
|
|
2197
|
+
@hasMany('comment', { async: true, inverse: null }) comments;
|
|
2198
|
+
}
|
|
2199
|
+
```
|
|
2200
|
+
|
|
2201
|
+
:::
|
|
2202
|
+
|
|
2203
|
+
Then we would have a implicit 'post' relationship for the comment record in order
|
|
2204
|
+
to be do things like remove the comment from the post if the comment were to be deleted.
|
|
2205
|
+
*/
|
|
2206
|
+
|
|
2175
2207
|
function createImplicitEdge(definition, identifier) {
|
|
2176
2208
|
return {
|
|
2177
2209
|
definition,
|
|
@@ -2705,30 +2737,6 @@ class Graph {
|
|
|
2705
2737
|
}
|
|
2706
2738
|
t2[type1] = true;
|
|
2707
2739
|
}
|
|
2708
|
-
|
|
2709
|
-
/*
|
|
2710
|
-
TODO move this comment somewhere else
|
|
2711
|
-
implicit relationships are relationships which have not been declared but the inverse side exists on
|
|
2712
|
-
another record somewhere
|
|
2713
|
-
For example if there was:
|
|
2714
|
-
```js [app/models/comment.js]
|
|
2715
|
-
import { Model, attr } from '@warp-drive/legacy/model';
|
|
2716
|
-
export default class Comment extends Model {
|
|
2717
|
-
@attr text;
|
|
2718
|
-
}
|
|
2719
|
-
```
|
|
2720
|
-
and there is also:
|
|
2721
|
-
```js [app/models/post.js]
|
|
2722
|
-
import Model, { attr, hasMany } from '@ember-data/model';
|
|
2723
|
-
export default class Post extends Model {
|
|
2724
|
-
@attr title;
|
|
2725
|
-
@hasMany('comment', { async: true, inverse: null }) comments;
|
|
2726
|
-
}
|
|
2727
|
-
```
|
|
2728
|
-
Then we would have a implicit 'post' relationship for the comment record in order
|
|
2729
|
-
to be do things like remove the comment from the post if the comment were to be deleted.
|
|
2730
|
-
*/
|
|
2731
|
-
|
|
2732
2740
|
isReleasable(identifier) {
|
|
2733
2741
|
const relationships = this.identifiers.get(identifier);
|
|
2734
2742
|
if (!relationships) {
|