@warp-drive/core 5.8.0-alpha.8 → 5.8.0-alpha.9
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/request.d.ts +23 -1
- package/dist/{index-CKXq9_RZ.js → index-B1cSRj-N.js} +3 -3
- package/dist/index.js +1 -1
- package/dist/reactive.js +1 -1
- package/dist/{request-CN-dNlEY.js → request-oqoLC9rz.js} +28 -1
- package/dist/request.js +1 -1
- package/dist/store/-private.js +1 -1
- package/dist/types/-private.js +1 -1
- package/package.json +3 -3
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactiveDataDocument } from "./reactive.js";
|
|
1
2
|
import type { RequestInfo } from "./types/request.js";
|
|
2
3
|
import type { RequestSignature } from "./types/symbols.js";
|
|
3
4
|
export { createDeferred } from "./request/-private/future.js";
|
|
@@ -25,6 +26,27 @@ export declare function withResponseType<T>(obj: RequestInfo): RequestInfo<T> &
|
|
|
25
26
|
[RequestSignature]: T;
|
|
26
27
|
};
|
|
27
28
|
/**
|
|
29
|
+
* Brands the supplied object with the supplied response type
|
|
30
|
+
* wrapped in {@link ReactiveDataDocument}. This is a convenience for
|
|
31
|
+
* the common case of using {@link withResponseType} with `ReactiveDataDocument`.
|
|
32
|
+
*
|
|
33
|
+
* ```ts
|
|
34
|
+
* import { withReactiveResponse } from '@warp-drive/core/request';
|
|
35
|
+
* import type { User } from '#/data/user.ts'
|
|
36
|
+
*
|
|
37
|
+
* const result = await store.request(
|
|
38
|
+
* withReactiveResponse<User>({ url: '/users/1' })
|
|
39
|
+
* );
|
|
40
|
+
*
|
|
41
|
+
* result.content.data; // will have type User
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @public
|
|
45
|
+
*/
|
|
46
|
+
export declare function withReactiveResponse<T>(obj: RequestInfo): RequestInfo<ReactiveDataDocument<T>> & {
|
|
47
|
+
[RequestSignature]: ReactiveDataDocument<T>;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
28
50
|
* @deprecated use {@link withResponseType} instead
|
|
29
51
|
*/
|
|
30
|
-
export
|
|
52
|
+
export declare const withBrand: typeof withResponseType;
|
|
@@ -3,7 +3,7 @@ import { EnableHydration, SkipCache, STRUCTURED } from './types/request.js';
|
|
|
3
3
|
import { macroCondition, getGlobalConfig, dependencySatisfies, importSync } from '@embroider/macros';
|
|
4
4
|
import { D as Destroy, C as Context, S as SOURCE, a as Checkout, b as Commit } from "./symbols-sql1_mdx.js";
|
|
5
5
|
import { isResourceSchema } from './types/schema/fields.js';
|
|
6
|
-
import { w as
|
|
6
|
+
import { w as withBrand, g as getPromiseResult, s as setPromiseResult, c as cloneResponseProperties, I as IS_CACHE_HANDLER, a as assertValidRequest, e as executeNextHandler, b as getRequestResult, u as upgradePromise, d as clearRequestResult } from "./request-oqoLC9rz.js";
|
|
7
7
|
import { getOrSetGlobal, peekTransient, setTransient, peekUniversalTransient, setUniversalTransient } from './types/-private.js';
|
|
8
8
|
import { c as createSignal, a as consumeSignal, n as notifySignal, b as createMemo, d as willSyncFlushWatchers, A as ARRAY_SIGNAL, O as OBJECT_SIGNAL, w as waitFor } from "./configure-C3x8YXzL.js";
|
|
9
9
|
import { CACHE_OWNER, DEBUG_STALE_CACHE_OWNER, DEBUG_KEY_TYPE, DEBUG_CLIENT_ORIGINATED } from './types/identifier.js';
|
|
@@ -493,7 +493,7 @@ function urlFromLink(link) {
|
|
|
493
493
|
*/
|
|
494
494
|
|
|
495
495
|
const ReactiveDocumentProto = {
|
|
496
|
-
async _request(link, options =
|
|
496
|
+
async _request(link, options = withBrand({
|
|
497
497
|
url: '',
|
|
498
498
|
method: 'GET'
|
|
499
499
|
})) {
|
|
@@ -508,7 +508,7 @@ const ReactiveDocumentProto = {
|
|
|
508
508
|
const response = await this._store.request(options);
|
|
509
509
|
return response.content;
|
|
510
510
|
},
|
|
511
|
-
fetch(options =
|
|
511
|
+
fetch(options = withBrand({
|
|
512
512
|
url: '',
|
|
513
513
|
method: 'GET'
|
|
514
514
|
})) {
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { C as CacheHandler, V as Fetch, W as RequestManager, S as Store, r as recordIdentifierFor, $ as setIdentifierForgetMethod, Y as setIdentifierGenerationMethod, a0 as setIdentifierResetMethod, Z as setIdentifierUpdateMethod, a1 as setKeyInfoForResource, s as storeFor, X as useRecommendedStore } from "./index-
|
|
1
|
+
export { C as CacheHandler, V as Fetch, W as RequestManager, S as Store, r as recordIdentifierFor, $ as setIdentifierForgetMethod, Y as setIdentifierGenerationMethod, a0 as setIdentifierResetMethod, Z as setIdentifierUpdateMethod, a1 as setKeyInfoForResource, s as storeFor, X as useRecommendedStore } from "./index-B1cSRj-N.js";
|
|
2
2
|
import "./symbols-sql1_mdx.js";
|
|
3
3
|
import '@ember/debug';
|
|
4
4
|
import '@embroider/macros';
|
package/dist/reactive.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { O as SchemaService, L as checkout, U as commit, q as createRequestSubscription, Q as fromIdentity, p as getPromiseState, t as getRequestState, M as instantiateRecord, T as registerDerivations, N as teardownRecord, P as withDefaults } from "./index-
|
|
1
|
+
export { O as SchemaService, L as checkout, U as commit, q as createRequestSubscription, Q as fromIdentity, p as getPromiseState, t as getRequestState, M as instantiateRecord, T as registerDerivations, N as teardownRecord, P as withDefaults } from "./index-B1cSRj-N.js";
|
|
2
2
|
export { a as Checkout } from "./symbols-sql1_mdx.js";
|
|
3
3
|
import './types/request.js';
|
|
4
4
|
import '@embroider/macros';
|
|
@@ -695,4 +695,31 @@ function createFuture(owner) {
|
|
|
695
695
|
function withResponseType(obj) {
|
|
696
696
|
return obj;
|
|
697
697
|
}
|
|
698
|
-
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* Brands the supplied object with the supplied response type
|
|
701
|
+
* wrapped in {@link ReactiveDataDocument}. This is a convenience for
|
|
702
|
+
* the common case of using {@link withResponseType} with `ReactiveDataDocument`.
|
|
703
|
+
*
|
|
704
|
+
* ```ts
|
|
705
|
+
* import { withReactiveResponse } from '@warp-drive/core/request';
|
|
706
|
+
* import type { User } from '#/data/user.ts'
|
|
707
|
+
*
|
|
708
|
+
* const result = await store.request(
|
|
709
|
+
* withReactiveResponse<User>({ url: '/users/1' })
|
|
710
|
+
* );
|
|
711
|
+
*
|
|
712
|
+
* result.content.data; // will have type User
|
|
713
|
+
* ```
|
|
714
|
+
*
|
|
715
|
+
* @public
|
|
716
|
+
*/
|
|
717
|
+
function withReactiveResponse(obj) {
|
|
718
|
+
return obj;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
/**
|
|
722
|
+
* @deprecated use {@link withResponseType} instead
|
|
723
|
+
*/
|
|
724
|
+
const withBrand = withResponseType;
|
|
725
|
+
export { IS_CACHE_HANDLER as I, assertValidRequest as a, getRequestResult as b, cloneResponseProperties as c, clearRequestResult as d, executeNextHandler as e, withResponseType as f, getPromiseResult as g, withReactiveResponse as h, createDeferred as i, setPromiseResult as s, upgradePromise as u, withBrand as w };
|
package/dist/request.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { i as createDeferred, g as getPromiseResult, s as setPromiseResult, w as withBrand, h as withReactiveResponse, f as withResponseType } from "./request-oqoLC9rz.js";
|
package/dist/store/-private.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { C as CacheHandler, D as DISPOSE, R as RecordArrayManager, E as Signals, S as Store, k as StoreMap, _ as _clearCaches, n as _deprecatingNormalize, h as assertPrivateCapabilities, d as assertPrivateStore, b as coerceId, c as constructResource, J as consumeInternalSignal, G as createInternalMemo, l as createLegacyManyArray, q as createRequestSubscription, A as defineGate, B as defineNonEnumerableSignal, z as defineSignal, e as ensureStringId, y as entangleInitiallyStaleSignal, x as entangleSignal, f as fastPush, w as gate, K as getOrCreateInternalSignal, p as getPromiseState, t as getRequestState, g as isPrivateStore, a as isRequestKey, i as isResourceKey, m as log, o as logGroup, v as memoized, I as notifyInternalSignal, F as peekInternalSignal, r as recordIdentifierFor, j as setRecordIdentifier, u as signal, s as storeFor, H as withSignalStore } from "../index-
|
|
1
|
+
export { C as CacheHandler, D as DISPOSE, R as RecordArrayManager, E as Signals, S as Store, k as StoreMap, _ as _clearCaches, n as _deprecatingNormalize, h as assertPrivateCapabilities, d as assertPrivateStore, b as coerceId, c as constructResource, J as consumeInternalSignal, G as createInternalMemo, l as createLegacyManyArray, q as createRequestSubscription, A as defineGate, B as defineNonEnumerableSignal, z as defineSignal, e as ensureStringId, y as entangleInitiallyStaleSignal, x as entangleSignal, f as fastPush, w as gate, K as getOrCreateInternalSignal, p as getPromiseState, t as getRequestState, g as isPrivateStore, a as isRequestKey, i as isResourceKey, m as log, o as logGroup, v as memoized, I as notifyInternalSignal, F as peekInternalSignal, r as recordIdentifierFor, j as setRecordIdentifier, u as signal, s as storeFor, H as withSignalStore } from "../index-B1cSRj-N.js";
|
|
2
2
|
export { A as ARRAY_SIGNAL, O as OBJECT_SIGNAL, w as waitFor } from "../configure-C3x8YXzL.js";
|
package/dist/types/-private.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { macroCondition, getGlobalConfig } from '@embroider/macros';
|
|
2
2
|
const name = "@warp-drive/core";
|
|
3
|
-
const version = "5.8.0-alpha.
|
|
3
|
+
const version = "5.8.0-alpha.9";
|
|
4
4
|
|
|
5
5
|
// in testing mode, we utilize globals to ensure only one copy exists of
|
|
6
6
|
// these maps, due to bugs in ember-auto-import
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warp-drive/core",
|
|
3
|
-
"version": "5.8.0-alpha.
|
|
3
|
+
"version": "5.8.0-alpha.9",
|
|
4
4
|
"description": "Core package for WarpDrive | All the Universal Basics",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@embroider/macros": "^1.18.1",
|
|
40
|
-
"@warp-drive/build-config": "5.8.0-alpha.
|
|
40
|
+
"@warp-drive/build-config": "5.8.0-alpha.9"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@babel/core": "^7.28.3",
|
|
44
44
|
"@babel/plugin-transform-typescript": "^7.28.0",
|
|
45
45
|
"@babel/preset-typescript": "^7.27.1",
|
|
46
|
-
"@warp-drive/internal-config": "5.8.0-alpha.
|
|
46
|
+
"@warp-drive/internal-config": "5.8.0-alpha.9",
|
|
47
47
|
"decorator-transforms": "^2.3.0",
|
|
48
48
|
"ember-source": "~6.6.0",
|
|
49
49
|
"expect-type": "^1.2.2",
|