@ember-data/request-utils 5.6.0-alpha.2 → 5.6.0-alpha.4
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/dist/deprecation-support.js +2 -2
- package/dist/handlers.js +0 -6
- package/dist/handlers.js.map +1 -1
- package/dist/index.js +9 -35
- package/dist/index.js.map +1 -1
- package/dist/{inflect-CwI_k2it.js → inflect-SV-gOUrZ.js} +1 -39
- package/dist/inflect-SV-gOUrZ.js.map +1 -0
- package/dist/string.js +2 -2
- package/dist/{transform-1PDozfHr.js → transform-BixPrO0I.js} +0 -19
- package/dist/transform-BixPrO0I.js.map +1 -0
- package/package.json +7 -10
- package/unstable-preview-types/-private/handlers/auto-compress.d.ts +0 -14
- package/unstable-preview-types/-private/handlers/auto-compress.d.ts.map +1 -1
- package/unstable-preview-types/-private/string/inflect.d.ts +0 -33
- package/unstable-preview-types/-private/string/inflect.d.ts.map +1 -1
- package/unstable-preview-types/-private/string/transform.d.ts +0 -15
- package/unstable-preview-types/-private/string/transform.d.ts.map +1 -1
- package/unstable-preview-types/handlers.d.ts +1 -2
- package/unstable-preview-types/handlers.d.ts.map +1 -1
- package/unstable-preview-types/index.d.ts +10 -45
- package/unstable-preview-types/index.d.ts.map +1 -1
- package/unstable-preview-types/string.d.ts +1 -2
- package/unstable-preview-types/string.d.ts.map +1 -1
- package/dist/inflect-CwI_k2it.js.map +0 -1
- package/dist/transform-1PDozfHr.js.map +0 -1
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { macroCondition, getGlobalConfig } from '@embroider/macros';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @module @ember-data/request-utils/string
|
|
5
|
-
*/
|
|
6
2
|
const DEFAULT_MAX_CACHE_SIZE = 10_000;
|
|
7
3
|
class LRUCache {
|
|
8
4
|
// debug stats
|
|
@@ -83,10 +79,7 @@ const CAPITALIZE_CACHE = new LRUCache(str => str.replace(STRING_CAPITALIZE_REGEX
|
|
|
83
79
|
* dasherize('privateDocs/ownerInvoice'; // 'private-docs/owner-invoice'
|
|
84
80
|
* ```
|
|
85
81
|
*
|
|
86
|
-
* @method dasherize
|
|
87
82
|
* @public
|
|
88
|
-
* @static
|
|
89
|
-
* @for @ember-data/request-utils/string
|
|
90
83
|
* @param {String} str
|
|
91
84
|
* @return {String}
|
|
92
85
|
* @since 4.13.0
|
|
@@ -109,10 +102,7 @@ function dasherize(str) {
|
|
|
109
102
|
* camelize('private-docs/owner-invoice'); // 'privateDocs/ownerInvoice'
|
|
110
103
|
* ```
|
|
111
104
|
*
|
|
112
|
-
* @method camelize
|
|
113
105
|
* @public
|
|
114
|
-
* @static
|
|
115
|
-
* @for @ember-data/request-utils/string
|
|
116
106
|
* @param {String} str
|
|
117
107
|
* @return {String}
|
|
118
108
|
* @since 4.13.0
|
|
@@ -134,10 +124,7 @@ function camelize(str) {
|
|
|
134
124
|
* underscore('privateDocs/ownerInvoice'); // 'private_docs/owner_invoice'
|
|
135
125
|
* ```
|
|
136
126
|
*
|
|
137
|
-
* @method underscore
|
|
138
127
|
* @public
|
|
139
|
-
* @static
|
|
140
|
-
* @for @ember-data/request-utils/string
|
|
141
128
|
* @param {String} str
|
|
142
129
|
* @return {String}
|
|
143
130
|
* @since 4.13.0
|
|
@@ -159,10 +146,7 @@ function underscore(str) {
|
|
|
159
146
|
* capitalize('privateDocs/ownerInvoice'); // 'PrivateDocs/ownerInvoice'
|
|
160
147
|
* ```
|
|
161
148
|
*
|
|
162
|
-
* @method capitalize
|
|
163
|
-
* @static
|
|
164
149
|
* @public
|
|
165
|
-
* @for @ember-data/request-utils/string
|
|
166
150
|
* @param {String} str
|
|
167
151
|
* @return {String}
|
|
168
152
|
* @since 4.13.0
|
|
@@ -175,10 +159,7 @@ function capitalize(str) {
|
|
|
175
159
|
* Sets the maximum size of the LRUCache for all string transformation functions.
|
|
176
160
|
* The default size is 10,000.
|
|
177
161
|
*
|
|
178
|
-
* @method setMaxLRUCacheSize
|
|
179
162
|
* @public
|
|
180
|
-
* @static
|
|
181
|
-
* @for @ember-data/request-utils/string
|
|
182
163
|
* @param {Number} size
|
|
183
164
|
* @return {void}
|
|
184
165
|
* @since 4.13.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform-BixPrO0I.js","sources":["../src/-private/string/transform.ts"],"sourcesContent":["import { DEBUG } from '@warp-drive/build-config/env';\n\nconst DEFAULT_MAX_CACHE_SIZE = 10_000;\nexport class LRUCache<T, V> {\n declare size: number;\n declare state: Map<T, V>;\n declare doWork: (k: T) => V;\n\n // debug stats\n declare _hits: number;\n declare _misses: number;\n declare _ejected: number;\n\n constructor(doWork: (k: T) => V, size?: number) {\n this.size = size || DEFAULT_MAX_CACHE_SIZE;\n this.state = new Map();\n this.doWork = doWork;\n\n if (DEBUG) {\n this._hits = 0;\n this._misses = 0;\n this._ejected = 0;\n }\n }\n get(key: T) {\n const value = this.state.get(key);\n if (value) {\n if (DEBUG) {\n this._hits++;\n }\n this.state.delete(key);\n this.state.set(key, value);\n return value;\n }\n if (DEBUG) {\n this._misses++;\n }\n\n const newValue = this.doWork(key);\n this.set(key, newValue);\n return newValue;\n }\n\n set(key: T, value: V) {\n if (this.state.size === this.size) {\n for (const [k] of this.state) {\n if (DEBUG) {\n this._ejected++;\n }\n this.state.delete(k);\n break;\n }\n }\n this.state.set(key, value);\n }\n\n clear() {\n this.state.clear();\n if (DEBUG) {\n this._hits = 0;\n this._misses = 0;\n this._ejected = 0;\n }\n }\n}\n\nconst STRING_DASHERIZE_REGEXP = /[ _]/g;\nconst STRING_DECAMELIZE_REGEXP = /([a-z\\d])([A-Z])/g;\nconst STRING_DASHERIZE_CACHE = new LRUCache<string, string>((key: string) =>\n key.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase().replace(STRING_DASHERIZE_REGEXP, '-')\n);\n\n// eslint-disable-next-line no-useless-escape\nconst STRING_CAMELIZE_REGEXP_1 = /(\\-|\\_|\\.|\\s)+(.)?/g;\nconst STRING_CAMELIZE_REGEXP_2 = /(^|\\/)([A-Z])/g;\nconst CAMELIZE_CACHE = new LRUCache<string, string>((key: string) =>\n key\n .replace(STRING_CAMELIZE_REGEXP_1, (_match, _separator, chr: string | null) => (chr ? chr.toUpperCase() : ''))\n .replace(STRING_CAMELIZE_REGEXP_2, (match /*, separator, chr */) => match.toLowerCase())\n);\n\nconst STRING_UNDERSCORE_REGEXP_1 = /([a-z\\d])([A-Z]+)/g;\n// eslint-disable-next-line no-useless-escape\nconst STRING_UNDERSCORE_REGEXP_2 = /\\-|\\s+/g;\nconst UNDERSCORE_CACHE = new LRUCache<string, string>((str: string) =>\n str.replace(STRING_UNDERSCORE_REGEXP_1, '$1_$2').replace(STRING_UNDERSCORE_REGEXP_2, '_').toLowerCase()\n);\n\nconst STRING_CAPITALIZE_REGEXP = /(^|\\/)([a-z\\u00C0-\\u024F])/g;\nconst CAPITALIZE_CACHE = new LRUCache<string, string>((str: string) =>\n str.replace(STRING_CAPITALIZE_REGEXP, (match /*, separator, chr */) => match.toUpperCase())\n);\n\n/**\n * Replaces underscores, spaces, or camelCase with dashes.\n *\n * ```js\n * import { dasherize } from '@ember-data/request-utils/string';\n *\n * dasherize('innerHTML'); // 'inner-html'\n * dasherize('action_name'); // 'action-name'\n * dasherize('css-class-name'); // 'css-class-name'\n * dasherize('my favorite items'); // 'my-favorite-items'\n * dasherize('privateDocs/ownerInvoice'; // 'private-docs/owner-invoice'\n * ```\n *\n * @public\n * @param {String} str\n * @return {String}\n * @since 4.13.0\n */\nexport function dasherize(str: string): string {\n return STRING_DASHERIZE_CACHE.get(str);\n}\n\n/**\n * Returns the lowerCamelCase form of a string.\n *\n * ```js\n * import { camelize } from '@ember-data/request-utils/string';\n *\n * camelize('innerHTML'); // 'innerHTML'\n * camelize('action_name'); // 'actionName'\n * camelize('css-class-name'); // 'cssClassName'\n * camelize('my favorite items'); // 'myFavoriteItems'\n * camelize('My Favorite Items'); // 'myFavoriteItems'\n * camelize('private-docs/owner-invoice'); // 'privateDocs/ownerInvoice'\n * ```\n *\n * @public\n * @param {String} str\n * @return {String}\n * @since 4.13.0\n */\nexport function camelize(str: string): string {\n return CAMELIZE_CACHE.get(str);\n}\n\n/**\n * Returns the lower\\_case\\_and\\_underscored form of a string.\n *\n * ```js\n * import { underscore } from '@ember-data/request-utils/string';\n *\n * underscore('innerHTML'); // 'inner_html'\n * underscore('action_name'); // 'action_name'\n * underscore('css-class-name'); // 'css_class_name'\n * underscore('my favorite items'); // 'my_favorite_items'\n * underscore('privateDocs/ownerInvoice'); // 'private_docs/owner_invoice'\n * ```\n *\n * @public\n * @param {String} str\n * @return {String}\n * @since 4.13.0\n */\nexport function underscore(str: string): string {\n return UNDERSCORE_CACHE.get(str);\n}\n\n/**\n * Returns the Capitalized form of a string\n *\n * ```js\n * import { capitalize } from '@ember-data/request-utils/string';\n *\n * capitalize('innerHTML') // 'InnerHTML'\n * capitalize('action_name') // 'Action_name'\n * capitalize('css-class-name') // 'Css-class-name'\n * capitalize('my favorite items') // 'My favorite items'\n * capitalize('privateDocs/ownerInvoice'); // 'PrivateDocs/ownerInvoice'\n * ```\n *\n * @public\n * @param {String} str\n * @return {String}\n * @since 4.13.0\n */\nexport function capitalize(str: string): string {\n return CAPITALIZE_CACHE.get(str);\n}\n\n/**\n * Sets the maximum size of the LRUCache for all string transformation functions.\n * The default size is 10,000.\n *\n * @public\n * @param {Number} size\n * @return {void}\n * @since 4.13.0\n */\nexport function setMaxLRUCacheSize(size: number) {\n CAMELIZE_CACHE.size = size;\n UNDERSCORE_CACHE.size = size;\n CAPITALIZE_CACHE.size = size;\n STRING_DASHERIZE_CACHE.size = size;\n}\n"],"names":["DEFAULT_MAX_CACHE_SIZE","LRUCache","constructor","doWork","size","state","Map","macroCondition","getGlobalConfig","WarpDrive","env","DEBUG","_hits","_misses","_ejected","get","key","value","delete","set","newValue","k","clear","STRING_DASHERIZE_REGEXP","STRING_DECAMELIZE_REGEXP","STRING_DASHERIZE_CACHE","replace","toLowerCase","STRING_CAMELIZE_REGEXP_1","STRING_CAMELIZE_REGEXP_2","CAMELIZE_CACHE","_match","_separator","chr","toUpperCase","match","STRING_UNDERSCORE_REGEXP_1","STRING_UNDERSCORE_REGEXP_2","UNDERSCORE_CACHE","str","STRING_CAPITALIZE_REGEXP","CAPITALIZE_CACHE","dasherize","camelize","underscore","capitalize","setMaxLRUCacheSize"],"mappings":"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,CAAC,CAACV,OAAO,CAACW,0BAA0B,EAAE,GAAG,CAAC,CAACV,WAAW,EACvG,CAAC;AAED,MAAMa,wBAAwB,GAAG,6BAA6B;AAC9D,MAAMC,gBAAgB,GAAG,IAAIxC,QAAQ,CAAkBsC,GAAW,IAChEA,GAAG,CAACb,OAAO,CAACc,wBAAwB,EAAE,CAACL,KAAK,2BAA2BA,KAAK,CAACD,WAAW,EAAE,CAC5F,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASQ,SAASA,CAACH,GAAW,EAAU;AAC7C,EAAA,OAAOd,sBAAsB,CAACV,GAAG,CAACwB,GAAG,CAAC;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASI,QAAQA,CAACJ,GAAW,EAAU;AAC5C,EAAA,OAAOT,cAAc,CAACf,GAAG,CAACwB,GAAG,CAAC;AAChC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASK,UAAUA,CAACL,GAAW,EAAU;AAC9C,EAAA,OAAOD,gBAAgB,CAACvB,GAAG,CAACwB,GAAG,CAAC;AAClC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASM,UAAUA,CAACN,GAAW,EAAU;AAC9C,EAAA,OAAOE,gBAAgB,CAAC1B,GAAG,CAACwB,GAAG,CAAC;AAClC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASO,kBAAkBA,CAAC1C,IAAY,EAAE;EAC/C0B,cAAc,CAAC1B,IAAI,GAAGA,IAAI;EAC1BkC,gBAAgB,CAAClC,IAAI,GAAGA,IAAI;EAC5BqC,gBAAgB,CAACrC,IAAI,GAAGA,IAAI;EAC5BqB,sBAAsB,CAACrB,IAAI,GAAGA,IAAI;AACpC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ember-data/request-utils",
|
|
3
3
|
"description": "Request Building Utilities for use with EmberData",
|
|
4
|
-
"version": "5.6.0-alpha.
|
|
4
|
+
"version": "5.6.0-alpha.4",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Chris Thoburn <runspired@users.noreply.github.com>",
|
|
@@ -12,9 +12,6 @@
|
|
|
12
12
|
},
|
|
13
13
|
"homepage": "https://github.com/emberjs/data",
|
|
14
14
|
"bugs": "https://github.com/emberjs/data/issues",
|
|
15
|
-
"engines": {
|
|
16
|
-
"node": ">= 18.20.8"
|
|
17
|
-
},
|
|
18
15
|
"keywords": [
|
|
19
16
|
"ember-addon"
|
|
20
17
|
],
|
|
@@ -47,8 +44,8 @@
|
|
|
47
44
|
},
|
|
48
45
|
"peerDependencies": {
|
|
49
46
|
"@ember/string": "^3.1.1 || ^4.0.0",
|
|
50
|
-
"@warp-drive/core-types": "5.6.0-alpha.
|
|
51
|
-
"@ember-data/request": "5.6.0-alpha.
|
|
47
|
+
"@warp-drive/core-types": "5.6.0-alpha.4",
|
|
48
|
+
"@ember-data/request": "5.6.0-alpha.4",
|
|
52
49
|
"ember-inflector": "^4.0.2 || ^5.0.0 || ^6.0.0"
|
|
53
50
|
},
|
|
54
51
|
"peerDependenciesMeta": {
|
|
@@ -61,7 +58,7 @@
|
|
|
61
58
|
},
|
|
62
59
|
"dependencies": {
|
|
63
60
|
"@embroider/macros": "^1.16.12",
|
|
64
|
-
"@warp-drive/build-config": "5.6.0-alpha.
|
|
61
|
+
"@warp-drive/build-config": "5.6.0-alpha.4"
|
|
65
62
|
},
|
|
66
63
|
"devDependencies": {
|
|
67
64
|
"@babel/core": "^7.26.10",
|
|
@@ -70,9 +67,9 @@
|
|
|
70
67
|
"@babel/preset-typescript": "^7.27.0",
|
|
71
68
|
"@glimmer/component": "^2.0.0",
|
|
72
69
|
"@ember/string": "4.0.1",
|
|
73
|
-
"@warp-drive/core-types": "5.6.0-alpha.
|
|
74
|
-
"@ember-data/request": "5.6.0-alpha.
|
|
75
|
-
"@warp-drive/internal-config": "5.6.0-alpha.
|
|
70
|
+
"@warp-drive/core-types": "5.6.0-alpha.4",
|
|
71
|
+
"@ember-data/request": "5.6.0-alpha.4",
|
|
72
|
+
"@warp-drive/internal-config": "5.6.0-alpha.4",
|
|
76
73
|
"ember-source": "~6.3.0",
|
|
77
74
|
"ember-inflector": "6.0.0",
|
|
78
75
|
"typescript": "^5.8.3",
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
declare module '@ember-data/request-utils/-private/handlers/auto-compress' {
|
|
2
|
-
/**
|
|
3
|
-
* @module @ember-data/request-utils/handlers
|
|
4
|
-
*/
|
|
5
2
|
import type { Future, Handler, NextFn, RequestContext } from '@ember-data/request';
|
|
6
3
|
export const SupportsRequestStreams: boolean;
|
|
7
4
|
interface Constraints {
|
|
@@ -9,42 +6,36 @@ declare module '@ember-data/request-utils/-private/handlers/auto-compress' {
|
|
|
9
6
|
* The minimum size at which to compress blobs
|
|
10
7
|
*
|
|
11
8
|
* @default 1000
|
|
12
|
-
* @typedoc
|
|
13
9
|
*/
|
|
14
10
|
Blob?: number;
|
|
15
11
|
/**
|
|
16
12
|
* The minimum size at which to compress array buffers
|
|
17
13
|
*
|
|
18
14
|
* @default 1000
|
|
19
|
-
* @typedoc
|
|
20
15
|
*/
|
|
21
16
|
ArrayBuffer?: number;
|
|
22
17
|
/**
|
|
23
18
|
* The minimum size at which to compress typed arrays
|
|
24
19
|
*
|
|
25
20
|
* @default 1000
|
|
26
|
-
* @typedoc
|
|
27
21
|
*/
|
|
28
22
|
TypedArray?: number;
|
|
29
23
|
/**
|
|
30
24
|
* The minimum size at which to compress data views
|
|
31
25
|
*
|
|
32
26
|
* @default 1000
|
|
33
|
-
* @typedoc
|
|
34
27
|
*/
|
|
35
28
|
DataView?: number;
|
|
36
29
|
/**
|
|
37
30
|
* The minimum size at which to compress strings
|
|
38
31
|
*
|
|
39
32
|
* @default 1000
|
|
40
|
-
* @typedoc
|
|
41
33
|
*/
|
|
42
34
|
String?: number;
|
|
43
35
|
}
|
|
44
36
|
/**
|
|
45
37
|
* Options for configuring the AutoCompress handler.
|
|
46
38
|
*
|
|
47
|
-
* @typedoc
|
|
48
39
|
*/
|
|
49
40
|
interface CompressionOptions {
|
|
50
41
|
/**
|
|
@@ -53,7 +44,6 @@ declare module '@ember-data/request-utils/-private/handlers/auto-compress' {
|
|
|
53
44
|
*
|
|
54
45
|
* The default is `gzip`.
|
|
55
46
|
*
|
|
56
|
-
* @typedoc
|
|
57
47
|
*/
|
|
58
48
|
format?: CompressionFormat;
|
|
59
49
|
/**
|
|
@@ -81,7 +71,6 @@ declare module '@ember-data/request-utils/-private/handlers/auto-compress' {
|
|
|
81
71
|
* in the chain can handle the request body as a stream.
|
|
82
72
|
*
|
|
83
73
|
* @default false
|
|
84
|
-
* @typedoc
|
|
85
74
|
*/
|
|
86
75
|
allowStreaming?: boolean;
|
|
87
76
|
/**
|
|
@@ -90,7 +79,6 @@ declare module '@ember-data/request-utils/-private/handlers/auto-compress' {
|
|
|
90
79
|
* in the chain can handle the request body as a stream.
|
|
91
80
|
*
|
|
92
81
|
* @default false
|
|
93
|
-
* @typedoc
|
|
94
82
|
*/
|
|
95
83
|
forceStreaming?: boolean;
|
|
96
84
|
/**
|
|
@@ -123,7 +111,6 @@ declare module '@ember-data/request-utils/-private/handlers/auto-compress' {
|
|
|
123
111
|
* enable compression for all values, and a value of `-1` will
|
|
124
112
|
* disable compression.
|
|
125
113
|
*
|
|
126
|
-
* @typedoc
|
|
127
114
|
*/
|
|
128
115
|
constraints?: Constraints;
|
|
129
116
|
}
|
|
@@ -152,7 +139,6 @@ declare module '@ember-data/request-utils/-private/handlers/auto-compress' {
|
|
|
152
139
|
* ```
|
|
153
140
|
*
|
|
154
141
|
* @class AutoCompress
|
|
155
|
-
* @extends Handler
|
|
156
142
|
* @public
|
|
157
143
|
* @since 5.5.0
|
|
158
144
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-compress.d.ts","sourceRoot":"","sources":["../../../src/-private/handlers/auto-compress.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"auto-compress.d.ts","sourceRoot":"","sources":["../../../src/-private/handlers/auto-compress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAOnF,eAAO,MAAM,sBAAsB,SAc/B,CAAC;AAEL,UAAU,WAAW;IACnB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,UAAU,kBAAkB;IAC1B;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAE3B;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAWD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,YAAa,YAAW,OAAO;IAClC,OAAO,EAAE,QAAQ,CAAC,kBAAkB,CAAC,GAAG;QAAE,WAAW,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAA;KAAE,CAAC;gBAE3E,OAAO,GAAE,kBAAuB;IAU5C,OAAO,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;CA2DjF"}
|
|
@@ -3,10 +3,7 @@ declare module '@ember-data/request-utils/-private/string/inflect' {
|
|
|
3
3
|
* Marks a word as uncountable. Uncountable words are not pluralized
|
|
4
4
|
* or singularized.
|
|
5
5
|
*
|
|
6
|
-
* @method uncountable
|
|
7
6
|
* @public
|
|
8
|
-
* @static
|
|
9
|
-
* @for @ember-data/request-utils/string
|
|
10
7
|
* @param {String} word
|
|
11
8
|
* @return {void}
|
|
12
9
|
* @since 4.13.0
|
|
@@ -16,10 +13,7 @@ declare module '@ember-data/request-utils/-private/string/inflect' {
|
|
|
16
13
|
* Marks a list of words as uncountable. Uncountable words are not pluralized
|
|
17
14
|
* or singularized.
|
|
18
15
|
*
|
|
19
|
-
* @method loadUncountable
|
|
20
16
|
* @public
|
|
21
|
-
* @static
|
|
22
|
-
* @for @ember-data/request-utils/string
|
|
23
17
|
* @param {Array<String>} uncountables
|
|
24
18
|
* @return {void}
|
|
25
19
|
* @since 4.13.0
|
|
@@ -29,10 +23,7 @@ declare module '@ember-data/request-utils/-private/string/inflect' {
|
|
|
29
23
|
* Marks a word as irregular. Irregular words have unique
|
|
30
24
|
* pluralization and singularization rules.
|
|
31
25
|
*
|
|
32
|
-
* @method irregular
|
|
33
26
|
* @public
|
|
34
|
-
* @static
|
|
35
|
-
* @for @ember-data/request-utils/string
|
|
36
27
|
* @param {String} single
|
|
37
28
|
* @param {String} plur
|
|
38
29
|
* @return {void}
|
|
@@ -43,10 +34,7 @@ declare module '@ember-data/request-utils/-private/string/inflect' {
|
|
|
43
34
|
* Marks a list of word pairs as irregular. Irregular words have unique
|
|
44
35
|
* pluralization and singularization rules.
|
|
45
36
|
*
|
|
46
|
-
* @method loadIrregular
|
|
47
37
|
* @public
|
|
48
|
-
* @static
|
|
49
|
-
* @for @ember-data/request-utils/string
|
|
50
38
|
* @param {Array<Array<String>>} irregularPairs
|
|
51
39
|
* @return {void}
|
|
52
40
|
* @since 4.13.0
|
|
@@ -55,10 +43,7 @@ declare module '@ember-data/request-utils/-private/string/inflect' {
|
|
|
55
43
|
/**
|
|
56
44
|
* Clears the caches for singularize and pluralize.
|
|
57
45
|
*
|
|
58
|
-
* @method clear
|
|
59
46
|
* @public
|
|
60
|
-
* @static
|
|
61
|
-
* @for @ember-data/request-utils/string
|
|
62
47
|
* @return {void}
|
|
63
48
|
* @since 4.13.0
|
|
64
49
|
*/
|
|
@@ -66,10 +51,7 @@ declare module '@ember-data/request-utils/-private/string/inflect' {
|
|
|
66
51
|
/**
|
|
67
52
|
* Resets the inflection rules to the defaults.
|
|
68
53
|
*
|
|
69
|
-
* @method resetToDefaults
|
|
70
54
|
* @public
|
|
71
|
-
* @static
|
|
72
|
-
* @for @ember-data/request-utils/string
|
|
73
55
|
* @return {void}
|
|
74
56
|
* @since 4.13.0
|
|
75
57
|
*/
|
|
@@ -78,10 +60,7 @@ declare module '@ember-data/request-utils/-private/string/inflect' {
|
|
|
78
60
|
* Clears all inflection rules
|
|
79
61
|
* and resets the caches for singularize and pluralize.
|
|
80
62
|
*
|
|
81
|
-
* @method clearRules
|
|
82
63
|
* @public
|
|
83
|
-
* @static
|
|
84
|
-
* @for @ember-data/request-utils/string
|
|
85
64
|
* @return {void}
|
|
86
65
|
* @since 4.13.0
|
|
87
66
|
*/
|
|
@@ -89,10 +68,7 @@ declare module '@ember-data/request-utils/-private/string/inflect' {
|
|
|
89
68
|
/**
|
|
90
69
|
* Singularizes a word.
|
|
91
70
|
*
|
|
92
|
-
* @method singularize
|
|
93
71
|
* @public
|
|
94
|
-
* @static
|
|
95
|
-
* @for @ember-data/request-utils/string
|
|
96
72
|
* @param {String} word
|
|
97
73
|
* @return {String}
|
|
98
74
|
* @since 4.13.0
|
|
@@ -101,10 +77,7 @@ declare module '@ember-data/request-utils/-private/string/inflect' {
|
|
|
101
77
|
/**
|
|
102
78
|
* Pluralizes a word.
|
|
103
79
|
*
|
|
104
|
-
* @method pluralize
|
|
105
80
|
* @public
|
|
106
|
-
* @static
|
|
107
|
-
* @for @ember-data/request-utils/string
|
|
108
81
|
* @param {String} word
|
|
109
82
|
* @return {String}
|
|
110
83
|
* @since 4.13.0
|
|
@@ -113,10 +86,7 @@ declare module '@ember-data/request-utils/-private/string/inflect' {
|
|
|
113
86
|
/**
|
|
114
87
|
* Adds a pluralization rule.
|
|
115
88
|
*
|
|
116
|
-
* @method plural
|
|
117
89
|
* @public
|
|
118
|
-
* @static
|
|
119
|
-
* @for @ember-data/request-utils/string
|
|
120
90
|
* @param {RegExp} regex
|
|
121
91
|
* @param {String} string
|
|
122
92
|
* @return {void}
|
|
@@ -126,10 +96,7 @@ declare module '@ember-data/request-utils/-private/string/inflect' {
|
|
|
126
96
|
/**
|
|
127
97
|
* Adds a singularization rule.
|
|
128
98
|
*
|
|
129
|
-
* @method singular
|
|
130
99
|
* @public
|
|
131
|
-
* @static
|
|
132
|
-
* @for @ember-data/request-utils/string
|
|
133
100
|
* @param {RegExp} regex
|
|
134
101
|
* @param {String} string
|
|
135
102
|
* @return {void}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inflect.d.ts","sourceRoot":"","sources":["../../../src/-private/string/inflect.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"inflect.d.ts","sourceRoot":"","sources":["../../../src/-private/string/inflect.ts"],"names":[],"mappings":"AAsBA;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,QAEvC;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,QAIrD;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAQrD;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,QAUpE;AAGD;;;;;;GAMG;AACH,wBAAgB,KAAK,SAGpB;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,SAM9B;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,SAQzB;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,UAIvC;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,UAIrC;AAWD;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAQnD;AAED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAQrD"}
|
|
@@ -24,10 +24,7 @@ declare module '@ember-data/request-utils/-private/string/transform' {
|
|
|
24
24
|
* dasherize('privateDocs/ownerInvoice'; // 'private-docs/owner-invoice'
|
|
25
25
|
* ```
|
|
26
26
|
*
|
|
27
|
-
* @method dasherize
|
|
28
27
|
* @public
|
|
29
|
-
* @static
|
|
30
|
-
* @for @ember-data/request-utils/string
|
|
31
28
|
* @param {String} str
|
|
32
29
|
* @return {String}
|
|
33
30
|
* @since 4.13.0
|
|
@@ -47,10 +44,7 @@ declare module '@ember-data/request-utils/-private/string/transform' {
|
|
|
47
44
|
* camelize('private-docs/owner-invoice'); // 'privateDocs/ownerInvoice'
|
|
48
45
|
* ```
|
|
49
46
|
*
|
|
50
|
-
* @method camelize
|
|
51
47
|
* @public
|
|
52
|
-
* @static
|
|
53
|
-
* @for @ember-data/request-utils/string
|
|
54
48
|
* @param {String} str
|
|
55
49
|
* @return {String}
|
|
56
50
|
* @since 4.13.0
|
|
@@ -69,10 +63,7 @@ declare module '@ember-data/request-utils/-private/string/transform' {
|
|
|
69
63
|
* underscore('privateDocs/ownerInvoice'); // 'private_docs/owner_invoice'
|
|
70
64
|
* ```
|
|
71
65
|
*
|
|
72
|
-
* @method underscore
|
|
73
66
|
* @public
|
|
74
|
-
* @static
|
|
75
|
-
* @for @ember-data/request-utils/string
|
|
76
67
|
* @param {String} str
|
|
77
68
|
* @return {String}
|
|
78
69
|
* @since 4.13.0
|
|
@@ -91,10 +82,7 @@ declare module '@ember-data/request-utils/-private/string/transform' {
|
|
|
91
82
|
* capitalize('privateDocs/ownerInvoice'); // 'PrivateDocs/ownerInvoice'
|
|
92
83
|
* ```
|
|
93
84
|
*
|
|
94
|
-
* @method capitalize
|
|
95
|
-
* @static
|
|
96
85
|
* @public
|
|
97
|
-
* @for @ember-data/request-utils/string
|
|
98
86
|
* @param {String} str
|
|
99
87
|
* @return {String}
|
|
100
88
|
* @since 4.13.0
|
|
@@ -104,10 +92,7 @@ declare module '@ember-data/request-utils/-private/string/transform' {
|
|
|
104
92
|
* Sets the maximum size of the LRUCache for all string transformation functions.
|
|
105
93
|
* The default size is 10,000.
|
|
106
94
|
*
|
|
107
|
-
* @method setMaxLRUCacheSize
|
|
108
95
|
* @public
|
|
109
|
-
* @static
|
|
110
|
-
* @for @ember-data/request-utils/string
|
|
111
96
|
* @param {Number} size
|
|
112
97
|
* @return {void}
|
|
113
98
|
* @since 4.13.0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../src/-private/string/transform.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../src/-private/string/transform.ts"],"names":[],"mappings":"AAGA,qBAAa,QAAQ,CAAC,CAAC,EAAE,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACjB,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IAGpB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;gBAEb,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM;IAW9C,GAAG,CAAC,GAAG,EAAE,CAAC;IAmBV,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC;IAapB,KAAK;CAQN;AA6BD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,QAK9C"}
|
|
@@ -3,8 +3,7 @@ declare module '@ember-data/request-utils/handlers' {
|
|
|
3
3
|
* A selection of pre-built request handlers for handling common
|
|
4
4
|
* request scenarios.
|
|
5
5
|
*
|
|
6
|
-
* @module
|
|
7
|
-
* @main @ember-data/request-utils/handlers
|
|
6
|
+
* @module
|
|
8
7
|
*/
|
|
9
8
|
export { AutoCompress, SupportsRequestStreams } from '@ember-data/request-utils/-private/handlers/auto-compress';
|
|
10
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../src/handlers.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../src/handlers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference path="./handlers.d.ts" />
|
|
2
|
-
/// <reference path="./deprecation-support.d.ts" />
|
|
3
2
|
/// <reference path="./string.d.ts" />
|
|
3
|
+
/// <reference path="./deprecation-support.d.ts" />
|
|
4
4
|
/// <reference path="./-private/handlers/auto-compress.d.ts" />
|
|
5
|
-
/// <reference path="./-private/string/transform.d.ts" />
|
|
6
5
|
/// <reference path="./-private/string/inflect.d.ts" />
|
|
7
6
|
/// <reference path="./-private/string/inflections.d.ts" />
|
|
7
|
+
/// <reference path="./-private/string/transform.d.ts" />
|
|
8
8
|
declare module '@ember-data/request-utils' {
|
|
9
9
|
import type { StableRecordIdentifier } from '@warp-drive/core-types';
|
|
10
10
|
import type { Cache } from '@warp-drive/core-types/cache';
|
|
@@ -73,8 +73,7 @@ declare module '@ember-data/request-utils' {
|
|
|
73
73
|
* // Note: options will also include other request options like headers, method, etc.
|
|
74
74
|
* ```
|
|
75
75
|
*
|
|
76
|
-
* @module
|
|
77
|
-
* @main @ember-data/request-utils
|
|
76
|
+
* @module
|
|
78
77
|
* @public
|
|
79
78
|
*/
|
|
80
79
|
export interface BuildURLConfig {
|
|
@@ -114,12 +113,9 @@ declare module '@ember-data/request-utils' {
|
|
|
114
113
|
* });
|
|
115
114
|
* ```
|
|
116
115
|
*
|
|
117
|
-
* @method setBuildURLConfig
|
|
118
|
-
* @static
|
|
119
116
|
* @public
|
|
120
|
-
* @for @ember-data/request-utils
|
|
121
117
|
* @param {BuildURLConfig} config
|
|
122
|
-
* @return void
|
|
118
|
+
* @return {void}
|
|
123
119
|
*/
|
|
124
120
|
export function setBuildURLConfig(config: BuildURLConfig): void;
|
|
125
121
|
export interface FindRecordUrlOptions {
|
|
@@ -242,22 +238,16 @@ declare module '@ember-data/request-utils' {
|
|
|
242
238
|
* - 'findRecord' 'query' 'findMany' 'findRelatedCollection' 'findRelatedRecord'` 'createRecord' 'updateRecord' 'deleteRecord'
|
|
243
239
|
* - Depending on the value of `op`, `identifier` or `identifiers` will be required.
|
|
244
240
|
*
|
|
245
|
-
* @method buildBaseURL
|
|
246
|
-
* @static
|
|
247
241
|
* @public
|
|
248
|
-
* @for @ember-data/request-utils
|
|
249
242
|
* @param urlOptions
|
|
250
|
-
* @return
|
|
243
|
+
* @return {String}
|
|
251
244
|
*/
|
|
252
245
|
export function buildBaseURL(urlOptions: UrlOptions): string;
|
|
253
246
|
/**
|
|
254
247
|
* filter out keys of an object that have falsy values or point to empty arrays
|
|
255
248
|
* returning a new object with only those keys that have truthy values / non-empty arrays
|
|
256
249
|
*
|
|
257
|
-
* @method filterEmpty
|
|
258
|
-
* @static
|
|
259
250
|
* @public
|
|
260
|
-
* @for @ember-data/request-utils
|
|
261
251
|
* @param {Record<string, Serializable>} source object to filter keys with empty values from
|
|
262
252
|
* @return {Record<string, Serializable>} A new object with the keys that contained empty values removed
|
|
263
253
|
*/
|
|
@@ -276,10 +266,7 @@ declare module '@ember-data/request-utils' {
|
|
|
276
266
|
* 'repeat': appends the key for every value e.g. `&ids=1&ids=2`
|
|
277
267
|
* 'comma' (default): appends the key once with a comma separated list of values e.g. `&ids=1,2`
|
|
278
268
|
*
|
|
279
|
-
* @method sortQueryParams
|
|
280
|
-
* @static
|
|
281
269
|
* @public
|
|
282
|
-
* @for @ember-data/request-utils
|
|
283
270
|
* @param {URLSearchParams | object} params
|
|
284
271
|
* @param {Object} options
|
|
285
272
|
* @return {URLSearchParams} A URLSearchParams with keys inserted in sorted order
|
|
@@ -298,10 +285,7 @@ declare module '@ember-data/request-utils' {
|
|
|
298
285
|
* 'repeat': appends the key for every value e.g. `ids=1&ids=2`
|
|
299
286
|
* 'comma' (default): appends the key once with a comma separated list of values e.g. `ids=1,2`
|
|
300
287
|
*
|
|
301
|
-
* @method buildQueryParams
|
|
302
|
-
* @static
|
|
303
288
|
* @public
|
|
304
|
-
* @for @ember-data/request-utils
|
|
305
289
|
* @param {URLSearchParams | Object} params
|
|
306
290
|
* @param {Object} [options]
|
|
307
291
|
* @return {String} A sorted query params string without the leading `?`
|
|
@@ -344,10 +328,7 @@ declare module '@ember-data/request-utils' {
|
|
|
344
328
|
* 'stale-while-revalidate'?: number;
|
|
345
329
|
* }
|
|
346
330
|
* ```
|
|
347
|
-
* @method parseCacheControl
|
|
348
|
-
* @static
|
|
349
331
|
* @public
|
|
350
|
-
* @for @ember-data/request-utils
|
|
351
332
|
* @param {String} header
|
|
352
333
|
* @return {CacheControlValue}
|
|
353
334
|
*/
|
|
@@ -364,7 +345,6 @@ declare module '@ember-data/request-utils' {
|
|
|
364
345
|
* });
|
|
365
346
|
* ```
|
|
366
347
|
*
|
|
367
|
-
* @typedoc
|
|
368
348
|
*/
|
|
369
349
|
export type PolicyConfig = {
|
|
370
350
|
/**
|
|
@@ -380,7 +360,6 @@ declare module '@ember-data/request-utils' {
|
|
|
380
360
|
* it to responses if it is not present. Responses without a `date`
|
|
381
361
|
* header will be considered stale immediately.
|
|
382
362
|
*
|
|
383
|
-
* @typedoc
|
|
384
363
|
*/
|
|
385
364
|
apiCacheSoftExpires: number;
|
|
386
365
|
/**
|
|
@@ -396,7 +375,6 @@ declare module '@ember-data/request-utils' {
|
|
|
396
375
|
* it to responses if it is not present. Responses without a `date`
|
|
397
376
|
* header will be considered hard expired immediately.
|
|
398
377
|
*
|
|
399
|
-
* @typedoc
|
|
400
378
|
*/
|
|
401
379
|
apiCacheHardExpires: number;
|
|
402
380
|
/**
|
|
@@ -410,7 +388,6 @@ declare module '@ember-data/request-utils' {
|
|
|
410
388
|
*
|
|
411
389
|
* This behavior can be opted out of by setting this value to `true`.
|
|
412
390
|
*
|
|
413
|
-
* @typedoc
|
|
414
391
|
*/
|
|
415
392
|
disableTestOptimization?: boolean;
|
|
416
393
|
/**
|
|
@@ -443,13 +420,11 @@ declare module '@ember-data/request-utils' {
|
|
|
443
420
|
* - ↳ (if null) Cache-Control header
|
|
444
421
|
* - ↳ (if null) Expires header
|
|
445
422
|
*
|
|
446
|
-
* @typedoc
|
|
447
423
|
*/
|
|
448
424
|
constraints?: {
|
|
449
425
|
/**
|
|
450
426
|
* Headers that should be checked for expiration.
|
|
451
427
|
*
|
|
452
|
-
* @typedoc
|
|
453
428
|
*/
|
|
454
429
|
headers?: {
|
|
455
430
|
/**
|
|
@@ -462,7 +437,6 @@ declare module '@ember-data/request-utils' {
|
|
|
462
437
|
* 'Cache-Control' will take precedence over 'Expires' if both are present
|
|
463
438
|
* and both configured to be checked.
|
|
464
439
|
*
|
|
465
|
-
* @typedoc
|
|
466
440
|
*/
|
|
467
441
|
'Cache-Control'?: boolean;
|
|
468
442
|
/**
|
|
@@ -473,7 +447,6 @@ declare module '@ember-data/request-utils' {
|
|
|
473
447
|
*
|
|
474
448
|
* 'Cache-Control' will take precedence over 'Expires' if both are present.
|
|
475
449
|
*
|
|
476
|
-
* @typedoc
|
|
477
450
|
*/
|
|
478
451
|
Expires?: boolean;
|
|
479
452
|
/**
|
|
@@ -486,7 +459,6 @@ declare module '@ember-data/request-utils' {
|
|
|
486
459
|
*
|
|
487
460
|
* The header's value should be a [UTC date string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString).
|
|
488
461
|
*
|
|
489
|
-
* @typedoc
|
|
490
462
|
*/
|
|
491
463
|
'X-WarpDrive-Expires'?: boolean;
|
|
492
464
|
};
|
|
@@ -499,7 +471,6 @@ declare module '@ember-data/request-utils' {
|
|
|
499
471
|
*
|
|
500
472
|
* If the function does not return `null`,
|
|
501
473
|
*
|
|
502
|
-
* @typedoc
|
|
503
474
|
*/
|
|
504
475
|
isExpired?: (request: StructuredDocument<ResourceDocument>) => boolean | null;
|
|
505
476
|
};
|
|
@@ -516,11 +487,11 @@ declare module '@ember-data/request-utils' {
|
|
|
516
487
|
* In order expiration is determined by:
|
|
517
488
|
*
|
|
518
489
|
* - Is explicitly invalidated
|
|
519
|
-
* - ↳ (if null) isExpired function
|
|
520
|
-
* - ↳ (if null) X-WarpDrive-Expires header
|
|
521
|
-
* - ↳ (if null) Cache-Control header
|
|
522
|
-
* - ↳ (if null) Expires header
|
|
523
|
-
* - ↳ (if null) Date header + apiCacheHardExpires
|
|
490
|
+
* - ↳ (if null) isExpired function \<IF Constraint Active>
|
|
491
|
+
* - ↳ (if null) X-WarpDrive-Expires header \<IF Constraint Active>
|
|
492
|
+
* - ↳ (if null) Cache-Control header \<IF Constraint Active>
|
|
493
|
+
* - ↳ (if null) Expires header \<IF Constraint Active>
|
|
494
|
+
* - ↳ (if null) Date header + apiCacheHardExpires \< current time
|
|
524
495
|
*
|
|
525
496
|
* Invalidates any request for which `cacheOptions.types` was provided when a createRecord
|
|
526
497
|
* request for that type is successful.
|
|
@@ -574,7 +545,6 @@ declare module '@ember-data/request-utils' {
|
|
|
574
545
|
*
|
|
575
546
|
* @class CachePolicy
|
|
576
547
|
* @public
|
|
577
|
-
* @module @ember-data/request-utils
|
|
578
548
|
*/
|
|
579
549
|
export class CachePolicy {
|
|
580
550
|
config: PolicyConfig;
|
|
@@ -598,7 +568,6 @@ declare module '@ember-data/request-utils' {
|
|
|
598
568
|
* store.lifetimes.invalidateRequest(store, identifier);
|
|
599
569
|
* ```
|
|
600
570
|
*
|
|
601
|
-
* @method invalidateRequest
|
|
602
571
|
* @public
|
|
603
572
|
* @param {StableDocumentIdentifier} identifier
|
|
604
573
|
* @param {Store} store
|
|
@@ -619,7 +588,6 @@ declare module '@ember-data/request-utils' {
|
|
|
619
588
|
* store.lifetimes.invalidateRequestsForType(store, 'person');
|
|
620
589
|
* ```
|
|
621
590
|
*
|
|
622
|
-
* @method invalidateRequestsForType
|
|
623
591
|
* @public
|
|
624
592
|
* @param {String} type
|
|
625
593
|
* @param {Store} store
|
|
@@ -635,7 +603,6 @@ declare module '@ember-data/request-utils' {
|
|
|
635
603
|
*
|
|
636
604
|
* This method should not be invoked directly by consumers.
|
|
637
605
|
*
|
|
638
|
-
* @method didRequest
|
|
639
606
|
* @public
|
|
640
607
|
* @param {ImmutableRequestInfo} request
|
|
641
608
|
* @param {ImmutableResponse} response
|
|
@@ -655,7 +622,6 @@ declare module '@ember-data/request-utils' {
|
|
|
655
622
|
* the request will be fulfilled from the configured request handlers
|
|
656
623
|
* and the cache will be updated before returning the response.
|
|
657
624
|
*
|
|
658
|
-
* @method isHardExpired
|
|
659
625
|
* @public
|
|
660
626
|
* @param {StableDocumentIdentifier} identifier
|
|
661
627
|
* @param {Store} store
|
|
@@ -672,7 +638,6 @@ declare module '@ember-data/request-utils' {
|
|
|
672
638
|
* If true, the request will be fulfilled from cache while a backgrounded
|
|
673
639
|
* request is made to update the cache via the configured request handlers.
|
|
674
640
|
*
|
|
675
|
-
* @method isSoftExpired
|
|
676
641
|
* @public
|
|
677
642
|
* @param {StableDocumentIdentifier} identifier
|
|
678
643
|
* @param {Store} store
|