@warp-drive-types/core-types 0.0.0-alpha.41 → 0.0.0-alpha.43
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/package.json +1 -1
- package/unstable-preview-types/index.d.ts +1 -0
- package/unstable-preview-types/params.d.ts +4 -1
- package/unstable-preview-types/params.d.ts.map +1 -1
- package/unstable-preview-types/record.d.ts +47 -0
- package/unstable-preview-types/record.d.ts.map +1 -1
- package/unstable-preview-types/record.type-test.d.ts +4 -0
- package/unstable-preview-types/record.type-test.d.ts.map +1 -0
- package/unstable-preview-types/request.d.ts +35 -26
- package/unstable-preview-types/request.d.ts.map +1 -1
- package/unstable-preview-types/symbols.d.ts +8 -0
- package/unstable-preview-types/symbols.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/// <reference path="./identifier.d.ts" />
|
|
3
3
|
/// <reference path="./symbols.d.ts" />
|
|
4
4
|
/// <reference path="./graph.d.ts" />
|
|
5
|
+
/// <reference path="./record.type-test.d.ts" />
|
|
5
6
|
/// <reference path="./request.d.ts" />
|
|
6
7
|
/// <reference path="./params.d.ts" />
|
|
7
8
|
/// <reference path="./schema.d.ts" />
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
declare module '@warp-drive/core-types/params' {
|
|
2
|
+
import type { Includes, TypedRecordInstance } from '@warp-drive/core-types/record';
|
|
2
3
|
export type SerializablePrimitive = string | number | boolean | null;
|
|
3
4
|
export type Serializable = SerializablePrimitive | SerializablePrimitive[];
|
|
4
5
|
export type QueryParamsSerializationOptions = {
|
|
5
6
|
arrayFormat?: 'bracket' | 'indices' | 'repeat' | 'comma';
|
|
6
7
|
};
|
|
7
|
-
export type QueryParamsSource =
|
|
8
|
+
export type QueryParamsSource<T = unknown> = ({
|
|
9
|
+
include?: T extends TypedRecordInstance ? Includes<T>[] : string | string[];
|
|
10
|
+
} & Record<Exclude<string, 'include'>, Serializable>) | URLSearchParams;
|
|
8
11
|
}
|
|
9
12
|
//# sourceMappingURL=params.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"params.d.ts","sourceRoot":"","sources":["../src/params.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AACrE,MAAM,MAAM,YAAY,GAAG,qBAAqB,GAAG,qBAAqB,EAAE,CAAC;AAC3E,MAAM,MAAM,+BAA+B,GAAG;IAC5C,WAAW,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;CAC1D,CAAC;AACF,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"params.d.ts","sourceRoot":"","sources":["../src/params.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE9D,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AACrE,MAAM,MAAM,YAAY,GAAG,qBAAqB,GAAG,qBAAqB,EAAE,CAAC;AAC3E,MAAM,MAAM,+BAA+B,GAAG;IAC5C,WAAW,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;CAC1D,CAAC;AACF,MAAM,MAAM,iBAAiB,CAAC,CAAC,GAAG,OAAO,IACrC,CAAC;IAAE,OAAO,CAAC,EAAE,CAAC,SAAS,mBAAmB,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,GAAG,MAAM,EAAE,CAAA;CAAE,GAAG,MAAM,CACvF,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC,EAC1B,YAAY,CACb,CAAC,GACF,eAAe,CAAC"}
|
|
@@ -44,5 +44,52 @@ declare module '@warp-drive/core-types/record' {
|
|
|
44
44
|
* @typedoc
|
|
45
45
|
*/
|
|
46
46
|
export type TypeFromInstanceOrString<T> = T extends TypedRecordInstance ? T[typeof ResourceType] : string;
|
|
47
|
+
type Unpacked<T> = T extends (infer U)[] ? U : T;
|
|
48
|
+
type NONE = {
|
|
49
|
+
__NONE: never;
|
|
50
|
+
};
|
|
51
|
+
type __InternalExtract<T extends TypedRecordInstance, V extends TypedRecordInstance, IncludePrefix extends boolean, Ignore, Pre extends string> = V extends T ? IncludePrefix extends false ? V[typeof ResourceType] : Pre : V extends Ignore ? IncludePrefix extends false ? V[typeof ResourceType] : Pre : ExtractUnion<V, IncludePrefix, Ignore | T, Pre>;
|
|
52
|
+
type __ExtractIfRecord<T extends TypedRecordInstance, V, IncludePrefix extends boolean, Ignore, Pre extends string> = V extends TypedRecordInstance ? __InternalExtract<T, V, IncludePrefix, Ignore, Pre> : never;
|
|
53
|
+
type _ExtractUnion<T extends TypedRecordInstance, IncludePrefix extends boolean, Ignore, Pre> = {
|
|
54
|
+
[K in keyof T]: K extends string ? __ExtractIfRecord<T, Unpacked<Awaited<T[K]>>, IncludePrefix, Ignore, Pre extends string ? `${Pre}.${K}` : K> : never;
|
|
55
|
+
}[keyof T];
|
|
56
|
+
/**
|
|
57
|
+
* A Utility that extracts either resource types or resource paths from a TypedRecordInstance.
|
|
58
|
+
*
|
|
59
|
+
* Its limitations are mostly around its intentional non-recursiveness. It presumes that APIs which
|
|
60
|
+
* implement includes will not allow cyclical include paths, and will collapse includes by type.
|
|
61
|
+
*
|
|
62
|
+
* This follows closer to the JSON:API fields spec than to the includes spec in nature, but in
|
|
63
|
+
* practice it is so impracticle for an API to allow z-algo include paths that this is probably
|
|
64
|
+
* reasonable.
|
|
65
|
+
*
|
|
66
|
+
* We may need to revisit this in the future, opting to either make this restriction optional or
|
|
67
|
+
* to allow for other strategies.
|
|
68
|
+
*
|
|
69
|
+
* There's a 90% chance this particular implementation belongs being in the JSON:API package instead
|
|
70
|
+
* of core-types, but it's here for now.
|
|
71
|
+
*
|
|
72
|
+
* @typedoc
|
|
73
|
+
*/
|
|
74
|
+
type ExtractUnion<T extends TypedRecordInstance, IncludePrefix extends boolean = false, Ignore = NONE, Pre = NONE> = Exclude<IncludePrefix extends true ? // if we want to include prefix, we union with the prefix. Outer Exclude will filter any "NONE" types
|
|
75
|
+
_ExtractUnion<T, IncludePrefix, Ignore, Pre> | Pre : // Else we just union the types.
|
|
76
|
+
_ExtractUnion<T, IncludePrefix, Ignore, Pre> | T[typeof ResourceType], NONE>;
|
|
77
|
+
/**
|
|
78
|
+
* A utility that provides the union of all ResourceName for all potential
|
|
79
|
+
* includes for the given TypedRecordInstance.
|
|
80
|
+
*
|
|
81
|
+
* @typedoc
|
|
82
|
+
*/
|
|
83
|
+
export type ExtractSuggestedCacheTypes<T extends TypedRecordInstance> = ExtractUnion<T>;
|
|
84
|
+
/**
|
|
85
|
+
* A utility that provides the union type of all valid include paths for the given
|
|
86
|
+
* TypedRecordInstance.
|
|
87
|
+
*
|
|
88
|
+
* Cyclical paths are filtered out.
|
|
89
|
+
*
|
|
90
|
+
* @typedoc
|
|
91
|
+
*/
|
|
92
|
+
export type Includes<T extends TypedRecordInstance> = ExtractUnion<T, true>;
|
|
93
|
+
export {};
|
|
47
94
|
}
|
|
48
95
|
//# sourceMappingURL=record.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../src/record.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE9C;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;;;;;;;;;;;OAcG;IACH,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,SAAS,mBAAmB,GAAG,CAAC,CAAC,OAAO,YAAY,CAAC,GAAG,KAAK,CAAC;AAEjG;;;;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Q,CAAC,CAAC,SAAS,mBAAmB,IAAI,YAAY,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record.type-test.d.ts","sourceRoot":"","sources":["../src/record.type-test.ts"],"names":[],"mappings":""}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
declare module '@warp-drive/core-types/request' {
|
|
2
2
|
import type { StableRecordIdentifier } from '@warp-drive/core-types/identifier';
|
|
3
3
|
import type { QueryParamsSerializationOptions } from '@warp-drive/core-types/params';
|
|
4
|
+
import type { ExtractSuggestedCacheTypes, Includes, TypedRecordInstance, TypeFromInstanceOrString } from '@warp-drive/core-types/record';
|
|
4
5
|
import type { ResourceIdentifierObject } from '@warp-drive/core-types/spec/raw';
|
|
6
|
+
import type { RequestSignature } from '@warp-drive/core-types/symbols';
|
|
5
7
|
type Store = unknown;
|
|
6
8
|
export const SkipCache: unique symbol;
|
|
7
9
|
export const EnableHydration: unique symbol;
|
|
@@ -13,7 +15,7 @@ declare module '@warp-drive/core-types/request' {
|
|
|
13
15
|
*
|
|
14
16
|
* @typedoc
|
|
15
17
|
*/
|
|
16
|
-
export type CacheOptions = {
|
|
18
|
+
export type CacheOptions<T = unknown> = {
|
|
17
19
|
/**
|
|
18
20
|
* A key that uniquely identifies this request. If not present, the url wil be used
|
|
19
21
|
* as the key for any GET request, while all other requests will not be cached.
|
|
@@ -51,7 +53,7 @@ declare module '@warp-drive/core-types/request' {
|
|
|
51
53
|
*
|
|
52
54
|
* @typedoc
|
|
53
55
|
*/
|
|
54
|
-
types?: string[];
|
|
56
|
+
types?: T extends TypedRecordInstance ? ExtractSuggestedCacheTypes<T>[] : string[];
|
|
55
57
|
/**
|
|
56
58
|
* If true, the request will never be handled by the cache-manager and thus
|
|
57
59
|
* will never resolve from cache nor update the cache.
|
|
@@ -63,71 +65,77 @@ declare module '@warp-drive/core-types/request' {
|
|
|
63
65
|
*/
|
|
64
66
|
[SkipCache]?: true;
|
|
65
67
|
};
|
|
66
|
-
export type FindRecordRequestOptions = {
|
|
68
|
+
export type FindRecordRequestOptions<T = unknown, RT = unknown> = {
|
|
67
69
|
url: string;
|
|
68
70
|
method: 'GET';
|
|
69
71
|
headers: Headers;
|
|
70
|
-
cacheOptions
|
|
72
|
+
cacheOptions?: CacheOptions<T>;
|
|
71
73
|
op: 'findRecord';
|
|
72
|
-
records: [ResourceIdentifierObject];
|
|
74
|
+
records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];
|
|
75
|
+
[RequestSignature]?: RT;
|
|
73
76
|
};
|
|
74
|
-
export type QueryRequestOptions = {
|
|
77
|
+
export type QueryRequestOptions<T = unknown, RT = unknown> = {
|
|
75
78
|
url: string;
|
|
76
79
|
method: 'GET';
|
|
77
80
|
headers: Headers;
|
|
78
|
-
cacheOptions
|
|
81
|
+
cacheOptions?: CacheOptions<T>;
|
|
79
82
|
op: 'query';
|
|
83
|
+
[RequestSignature]?: RT;
|
|
80
84
|
};
|
|
81
|
-
export type PostQueryRequestOptions = {
|
|
85
|
+
export type PostQueryRequestOptions<T = unknown, RT = unknown> = {
|
|
82
86
|
url: string;
|
|
83
87
|
method: 'POST' | 'QUERY';
|
|
84
88
|
headers: Headers;
|
|
85
89
|
body: string;
|
|
86
|
-
cacheOptions: CacheOptions & {
|
|
90
|
+
cacheOptions: CacheOptions<T> & {
|
|
87
91
|
key: string;
|
|
88
92
|
};
|
|
89
93
|
op: 'query';
|
|
94
|
+
[RequestSignature]?: RT;
|
|
90
95
|
};
|
|
91
|
-
export type DeleteRequestOptions = {
|
|
96
|
+
export type DeleteRequestOptions<T = unknown, RT = unknown> = {
|
|
92
97
|
url: string;
|
|
93
98
|
method: 'DELETE';
|
|
94
99
|
headers: Headers;
|
|
95
100
|
op: 'deleteRecord';
|
|
96
101
|
data: {
|
|
97
|
-
record: StableRecordIdentifier
|
|
102
|
+
record: StableRecordIdentifier<TypeFromInstanceOrString<T>>;
|
|
98
103
|
};
|
|
99
|
-
records: [ResourceIdentifierObject];
|
|
104
|
+
records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];
|
|
105
|
+
[RequestSignature]?: RT;
|
|
100
106
|
};
|
|
101
107
|
type ImmutableRequest<T> = Readonly<T> & {
|
|
102
108
|
readonly headers: ImmutableHeaders;
|
|
103
109
|
readonly records: [StableRecordIdentifier];
|
|
104
110
|
};
|
|
105
|
-
export type UpdateRequestOptions = {
|
|
111
|
+
export type UpdateRequestOptions<T = unknown, RT = unknown> = {
|
|
106
112
|
url: string;
|
|
107
113
|
method: 'PATCH' | 'PUT';
|
|
108
114
|
headers: Headers;
|
|
109
115
|
op: 'updateRecord';
|
|
110
116
|
data: {
|
|
111
|
-
record: StableRecordIdentifier
|
|
117
|
+
record: StableRecordIdentifier<TypeFromInstanceOrString<T>>;
|
|
112
118
|
};
|
|
113
|
-
records: [ResourceIdentifierObject];
|
|
119
|
+
records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];
|
|
120
|
+
[RequestSignature]?: RT;
|
|
114
121
|
};
|
|
115
|
-
export type CreateRequestOptions = {
|
|
122
|
+
export type CreateRequestOptions<T = unknown, RT = unknown> = {
|
|
116
123
|
url: string;
|
|
117
124
|
method: 'POST';
|
|
118
125
|
headers: Headers;
|
|
119
126
|
op: 'createRecord';
|
|
120
127
|
data: {
|
|
121
|
-
record: StableRecordIdentifier
|
|
128
|
+
record: StableRecordIdentifier<TypeFromInstanceOrString<T>>;
|
|
122
129
|
};
|
|
123
|
-
records: [ResourceIdentifierObject];
|
|
130
|
+
records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];
|
|
131
|
+
[RequestSignature]?: RT;
|
|
124
132
|
};
|
|
125
133
|
export type ImmutableDeleteRequestOptions = ImmutableRequest<DeleteRequestOptions>;
|
|
126
134
|
export type ImmutableUpdateRequestOptions = ImmutableRequest<UpdateRequestOptions>;
|
|
127
135
|
export type ImmutableCreateRequestOptions = ImmutableRequest<CreateRequestOptions>;
|
|
128
|
-
export type RemotelyAccessibleIdentifier = {
|
|
136
|
+
export type RemotelyAccessibleIdentifier<T extends string = string> = {
|
|
129
137
|
id: string;
|
|
130
|
-
type:
|
|
138
|
+
type: T;
|
|
131
139
|
lid?: string;
|
|
132
140
|
};
|
|
133
141
|
export type ConstrainedRequestOptions = {
|
|
@@ -138,8 +146,8 @@ declare module '@warp-drive/core-types/request' {
|
|
|
138
146
|
resourcePath?: string;
|
|
139
147
|
urlParamsSettings?: QueryParamsSerializationOptions;
|
|
140
148
|
};
|
|
141
|
-
export type FindRecordOptions = ConstrainedRequestOptions & {
|
|
142
|
-
include?: string | string[];
|
|
149
|
+
export type FindRecordOptions<T = unknown> = ConstrainedRequestOptions & {
|
|
150
|
+
include?: T extends TypedRecordInstance ? Includes<T>[] : string | string[];
|
|
143
151
|
};
|
|
144
152
|
export interface StructuredDataDocument<T> {
|
|
145
153
|
[STRUCTURED]?: true;
|
|
@@ -234,7 +242,7 @@ declare module '@warp-drive/core-types/request' {
|
|
|
234
242
|
*
|
|
235
243
|
* @typedoc
|
|
236
244
|
*/
|
|
237
|
-
export type RequestInfo = Request & {
|
|
245
|
+
export type RequestInfo<T = unknown> = Request & {
|
|
238
246
|
/**
|
|
239
247
|
* If provided, used instead of the AbortController auto-configured for each request by the RequestManager
|
|
240
248
|
*
|
|
@@ -245,7 +253,7 @@ declare module '@warp-drive/core-types/request' {
|
|
|
245
253
|
* @see {@link CacheOptions}
|
|
246
254
|
* @typedoc
|
|
247
255
|
*/
|
|
248
|
-
cacheOptions?: CacheOptions
|
|
256
|
+
cacheOptions?: CacheOptions<T>;
|
|
249
257
|
store?: Store;
|
|
250
258
|
op?: string;
|
|
251
259
|
/**
|
|
@@ -280,8 +288,8 @@ declare module '@warp-drive/core-types/request' {
|
|
|
280
288
|
*
|
|
281
289
|
* @typedoc
|
|
282
290
|
*/
|
|
283
|
-
export type ImmutableRequestInfo = Readonly<Omit<RequestInfo
|
|
284
|
-
readonly cacheOptions?: Readonly<CacheOptions
|
|
291
|
+
export type ImmutableRequestInfo<T = unknown, RT = unknown> = Readonly<Omit<RequestInfo<T>, 'controller'>> & {
|
|
292
|
+
readonly cacheOptions?: Readonly<CacheOptions<T>>;
|
|
285
293
|
readonly headers?: ImmutableHeaders;
|
|
286
294
|
readonly data?: Readonly<Record<string, unknown>>;
|
|
287
295
|
readonly options?: Readonly<Record<string, unknown>>;
|
|
@@ -289,6 +297,7 @@ declare module '@warp-drive/core-types/request' {
|
|
|
289
297
|
* @typedoc
|
|
290
298
|
*/
|
|
291
299
|
readonly bodyUsed?: boolean;
|
|
300
|
+
[RequestSignature]?: RT;
|
|
292
301
|
};
|
|
293
302
|
export interface ResponseInfo {
|
|
294
303
|
readonly headers: ImmutableHeaders;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../src/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../src/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,KAAK,EAAE,0BAA0B,EAAE,QAAQ,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AACpH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAElD,KAAK,KAAK,GAAG,OAAO,CAAC;AAErB,eAAO,MAAM,SAAS,eAA8B,CAAC;AACrD,eAAO,MAAM,eAAe,eAAoC,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,IAAI,CAAC;IACzE,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,YAAY,GAAG,IAAI,CAAC;CACtD"}
|
|
@@ -33,5 +33,13 @@ declare module '@warp-drive/core-types/symbols' {
|
|
|
33
33
|
* @typedoc
|
|
34
34
|
*/
|
|
35
35
|
export const TransformName: unique symbol;
|
|
36
|
+
/**
|
|
37
|
+
* Symbol for use by builders to indicate the return type
|
|
38
|
+
* generic to use for store.request()
|
|
39
|
+
*
|
|
40
|
+
* @type {Symbol}
|
|
41
|
+
* @typedoc
|
|
42
|
+
*/
|
|
43
|
+
export const RequestSignature: unique symbol;
|
|
36
44
|
}
|
|
37
45
|
//# sourceMappingURL=symbols.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"symbols.d.ts","sourceRoot":"","sources":["../src/symbols.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,eAAkB,CAAC;AAE3C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,eAAkB,CAAC;AAE5C;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,aAAa,eAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"symbols.d.ts","sourceRoot":"","sources":["../src/symbols.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,eAAkB,CAAC;AAE3C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,eAAkB,CAAC;AAE5C;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,aAAa,eAA2B,CAAC;AAEtD;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,eAA6B,CAAC"}
|