@ember-data/request-utils 5.3.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/LICENSE.md +11 -0
- package/README.md +13 -0
- package/addon/index.js +120 -0
- package/addon/index.js.map +1 -0
- package/addon-main.js +19 -0
- package/package.json +65 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (C) 2017-2023 Ember.js contributors
|
|
4
|
+
Portions Copyright (C) 2011-2017 Tilde, Inc. and contributors.
|
|
5
|
+
Portions Copyright (C) 2011 LivingSocial Inc.
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
8
|
+
|
|
9
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
10
|
+
|
|
11
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@ember-data/tracking
|
|
2
|
+
============================================================================
|
|
3
|
+
|
|
4
|
+
Tracking Primitives for controlling change notification of Tracked properties when working with EmberData
|
|
5
|
+
|
|
6
|
+
> Note: This is a V2 Addon, but we have intentionally configured it to act and report as a V1 Addon due
|
|
7
|
+
to bugs with ember-auto-import.
|
|
8
|
+
>
|
|
9
|
+
> We can remove the V1 tag if ember-auto-import will no longer attempt
|
|
10
|
+
to load V2 addons or if it is fixed to work with V1 addons with custom addon trees and also dedupes modules for test apps.
|
|
11
|
+
>
|
|
12
|
+
> You can still consume this as a normal library.
|
|
13
|
+
> In other projects.
|
package/addon/index.js
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { assert } from '@ember/debug';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
@module @ember-data/request-utils
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// prevents the final constructed object from needing to add
|
|
8
|
+
// host and namespace which are provided by the final consuming
|
|
9
|
+
// class to the prototype which can result in overwrite errors
|
|
10
|
+
let CONFIG = {
|
|
11
|
+
host: '',
|
|
12
|
+
namespace: ''
|
|
13
|
+
};
|
|
14
|
+
function setBuildURLConfig(values) {
|
|
15
|
+
CONFIG = values;
|
|
16
|
+
}
|
|
17
|
+
const OPERATIONS_WITH_PRIMARY_RECORDS = new Set(['findRecord', 'findRelatedResource', 'findRelatedCollection', 'updateRecord', 'deleteRecord']);
|
|
18
|
+
function isOperationWithPrimaryRecord(options) {
|
|
19
|
+
return OPERATIONS_WITH_PRIMARY_RECORDS.has(options.op);
|
|
20
|
+
}
|
|
21
|
+
function resourcePathForType(options) {
|
|
22
|
+
return options.op === 'findMany' ? options.identifiers[0].type : options.identifier.type;
|
|
23
|
+
}
|
|
24
|
+
function buildBaseURL(urlOptions) {
|
|
25
|
+
const options = Object.assign({
|
|
26
|
+
host: CONFIG.host,
|
|
27
|
+
namespace: CONFIG.namespace
|
|
28
|
+
}, urlOptions);
|
|
29
|
+
assert(`buildBaseURL: You must pass \`op\` as part of options`, typeof options.op === 'string' && options.op.length > 0);
|
|
30
|
+
assert(`buildBaseURL: You must pass \`identifier\` as part of options`, options.op === 'findMany' || options.identifier && typeof options.identifier === 'object');
|
|
31
|
+
assert(`buildBaseURL: You must pass \`identifiers\` as part of options`, options.op !== 'findMany' || options.identifiers && Array.isArray(options.identifiers) && options.identifiers.length > 0 && options.identifiers.every(i => i && typeof i === 'object'));
|
|
32
|
+
assert(`buildBaseURL: You must pass valid \`identifier\` as part of options, expected 'id'`, !isOperationWithPrimaryRecord(options) || typeof options.identifier.id === 'string' && options.identifier.id.length > 0);
|
|
33
|
+
assert(`buildBaseURL: You must pass \`identifiers\` as part of options`, options.op !== 'findMany' || options.identifiers.every(i => typeof i.id === 'string' && i.id.length > 0));
|
|
34
|
+
assert(`buildBaseURL: You must pass valid \`identifier\` as part of options, expected 'type'`, options.op === 'findMany' || typeof options.identifier.type === 'string' && options.identifier.type.length > 0);
|
|
35
|
+
assert(`buildBaseURL: You must pass valid \`identifiers\` as part of options, expected 'type'`, options.op !== 'findMany' || typeof options.identifiers[0].type === 'string' && options.identifiers[0].type.length > 0);
|
|
36
|
+
|
|
37
|
+
// prettier-ignore
|
|
38
|
+
const idPath = isOperationWithPrimaryRecord(options) ? encodeURIComponent(options.identifier.id) : '';
|
|
39
|
+
const resourcePath = options.resourcePath || resourcePathForType(options);
|
|
40
|
+
const {
|
|
41
|
+
host,
|
|
42
|
+
namespace
|
|
43
|
+
} = options;
|
|
44
|
+
const fieldPath = 'fieldPath' in options ? options.fieldPath : '';
|
|
45
|
+
assert(`buildBaseURL: You tried to build a ${String(options.op)} request to ${resourcePath} but op must be one of "${['findRecord', 'findRelatedResource', 'findRelatedCollection', 'updateRecord', 'deleteRecord', 'createRecord', 'query', 'findMany'].join('","')}".`, ['findRecord', 'query', 'findMany', 'findRelatedCollection', 'findRelatedResource', 'createRecord', 'updateRecord', 'deleteRecord'].includes(options.op));
|
|
46
|
+
assert(`buildBaseURL: host must NOT end with '/', received '${host}'`, host === '/' || !host.endsWith('/'));
|
|
47
|
+
assert(`buildBaseURL: namespace must NOT start with '/', received '${namespace}'`, !namespace.startsWith('/'));
|
|
48
|
+
assert(`buildBaseURL: namespace must NOT end with '/', received '${namespace}'`, !namespace.endsWith('/'));
|
|
49
|
+
assert(`buildBaseURL: resourcePath must NOT start with '/', received '${resourcePath}'`, !resourcePath.startsWith('/'));
|
|
50
|
+
assert(`buildBaseURL: resourcePath must NOT end with '/', received '${resourcePath}'`, !resourcePath.endsWith('/'));
|
|
51
|
+
assert(`buildBaseURL: fieldPath must NOT start with '/', received '${fieldPath}'`, !fieldPath.startsWith('/'));
|
|
52
|
+
assert(`buildBaseURL: fieldPath must NOT end with '/', received '${fieldPath}'`, !fieldPath.endsWith('/'));
|
|
53
|
+
assert(`buildBaseURL: idPath must NOT start with '/', received '${idPath}'`, !idPath.startsWith('/'));
|
|
54
|
+
assert(`buildBaseURL: idPath must NOT end with '/', received '${idPath}'`, !idPath.endsWith('/'));
|
|
55
|
+
const url = [host === '/' ? '' : host, namespace, resourcePath, idPath, fieldPath].filter(Boolean).join('/');
|
|
56
|
+
return host ? url : `/${url}`;
|
|
57
|
+
}
|
|
58
|
+
const DEFAULT_QUERY_PARAMS_SERIALIZATION_OPTIONS = {
|
|
59
|
+
arrayFormat: 'comma'
|
|
60
|
+
};
|
|
61
|
+
function handleInclude(include) {
|
|
62
|
+
assert(`Expected include to be a string or array, got ${typeof include}`, typeof include === 'string' || Array.isArray(include));
|
|
63
|
+
return typeof include === 'string' ? include.split(',') : include;
|
|
64
|
+
}
|
|
65
|
+
function buildQueryParams(params, options) {
|
|
66
|
+
options = Object.assign({}, DEFAULT_QUERY_PARAMS_SERIALIZATION_OPTIONS, options);
|
|
67
|
+
const paramsIsObject = !(params instanceof URLSearchParams);
|
|
68
|
+
const urlParams = new URLSearchParams();
|
|
69
|
+
const dictionaryParams = paramsIsObject ? params : {};
|
|
70
|
+
if (!paramsIsObject) {
|
|
71
|
+
params.forEach((value, key) => {
|
|
72
|
+
const hasExisting = (key in dictionaryParams);
|
|
73
|
+
if (!hasExisting) {
|
|
74
|
+
dictionaryParams[key] = value;
|
|
75
|
+
} else {
|
|
76
|
+
const existingValue = dictionaryParams[key];
|
|
77
|
+
if (Array.isArray(existingValue)) {
|
|
78
|
+
existingValue.push(value);
|
|
79
|
+
} else {
|
|
80
|
+
dictionaryParams[key] = [existingValue, value];
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
if ('include' in dictionaryParams) {
|
|
86
|
+
dictionaryParams.include = handleInclude(dictionaryParams.include);
|
|
87
|
+
}
|
|
88
|
+
const sortedKeys = Object.keys(dictionaryParams).sort();
|
|
89
|
+
sortedKeys.forEach(key => {
|
|
90
|
+
const value = dictionaryParams[key];
|
|
91
|
+
if (Array.isArray(value)) {
|
|
92
|
+
value.sort();
|
|
93
|
+
switch (options.arrayFormat) {
|
|
94
|
+
case 'indices':
|
|
95
|
+
value.forEach((v, i) => {
|
|
96
|
+
urlParams.append(`${key}[${i}]`, String(v));
|
|
97
|
+
});
|
|
98
|
+
return;
|
|
99
|
+
case 'bracket':
|
|
100
|
+
value.forEach(v => {
|
|
101
|
+
urlParams.append(`${key}[]`, String(v));
|
|
102
|
+
});
|
|
103
|
+
return;
|
|
104
|
+
case 'repeat':
|
|
105
|
+
value.forEach(v => {
|
|
106
|
+
urlParams.append(key, String(v));
|
|
107
|
+
});
|
|
108
|
+
return;
|
|
109
|
+
case 'comma':
|
|
110
|
+
default:
|
|
111
|
+
urlParams.append(key, value.join(','));
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
} else {
|
|
115
|
+
urlParams.append(key, String(value));
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
return urlParams.toString();
|
|
119
|
+
}
|
|
120
|
+
export { buildBaseURL, buildQueryParams, setBuildURLConfig };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { assert } from '@ember/debug';\n\n/**\n @module @ember-data/request-utils\n*/\n\n// prevents the final constructed object from needing to add\n// host and namespace which are provided by the final consuming\n// class to the prototype which can result in overwrite errors\n\ninterface BuildURLConfig {\n host: string | null;\n namespace: string | null;\n}\n\nlet CONFIG: BuildURLConfig = {\n host: '',\n namespace: '',\n};\n\nexport function setBuildURLConfig(values: BuildURLConfig) {\n CONFIG = values;\n}\n\nexport interface FindRecordUrlOptions {\n op: 'findRecord';\n identifier: { type: string; id: string };\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface QueryUrlOptions {\n op: 'query';\n identifier: { type: string };\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface FindManyUrlOptions {\n op: 'findMany';\n identifiers: { type: string; id: string }[];\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\nexport interface FindRelatedCollectionUrlOptions {\n op: 'findRelatedCollection';\n identifier: { type: string; id: string };\n fieldPath: string;\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface FindRelatedResourceUrlOptions {\n op: 'findRelatedResource';\n identifier: { type: string; id: string };\n fieldPath: string;\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface CreateRecordUrlOptions {\n op: 'createRecord';\n identifier: { type: string };\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface UpdateRecordUrlOptions {\n op: 'updateRecord';\n identifier: { type: string; id: string };\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface DeleteRecordUrlOptions {\n op: 'deleteRecord';\n identifier: { type: string; id: string };\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport type UrlOptions =\n | FindRecordUrlOptions\n | QueryUrlOptions\n | FindManyUrlOptions\n | FindRelatedCollectionUrlOptions\n | FindRelatedResourceUrlOptions\n | CreateRecordUrlOptions\n | UpdateRecordUrlOptions\n | DeleteRecordUrlOptions;\n\nconst OPERATIONS_WITH_PRIMARY_RECORDS = new Set([\n 'findRecord',\n 'findRelatedResource',\n 'findRelatedCollection',\n 'updateRecord',\n 'deleteRecord',\n]);\n\nfunction isOperationWithPrimaryRecord(\n options: UrlOptions\n): options is\n | FindRecordUrlOptions\n | FindRelatedCollectionUrlOptions\n | FindRelatedResourceUrlOptions\n | UpdateRecordUrlOptions\n | DeleteRecordUrlOptions {\n return OPERATIONS_WITH_PRIMARY_RECORDS.has(options.op);\n}\n\nfunction resourcePathForType(options: UrlOptions): string {\n return options.op === 'findMany' ? options.identifiers[0].type : options.identifier.type;\n}\n\nexport function buildBaseURL(urlOptions: UrlOptions): string {\n const options = Object.assign(\n {\n host: CONFIG.host,\n namespace: CONFIG.namespace,\n },\n urlOptions\n );\n assert(\n `buildBaseURL: You must pass \\`op\\` as part of options`,\n typeof options.op === 'string' && options.op.length > 0\n );\n assert(\n `buildBaseURL: You must pass \\`identifier\\` as part of options`,\n options.op === 'findMany' || (options.identifier && typeof options.identifier === 'object')\n );\n assert(\n `buildBaseURL: You must pass \\`identifiers\\` as part of options`,\n options.op !== 'findMany' ||\n (options.identifiers &&\n Array.isArray(options.identifiers) &&\n options.identifiers.length > 0 &&\n options.identifiers.every((i) => i && typeof i === 'object'))\n );\n assert(\n `buildBaseURL: You must pass valid \\`identifier\\` as part of options, expected 'id'`,\n !isOperationWithPrimaryRecord(options) ||\n (typeof options.identifier.id === 'string' && options.identifier.id.length > 0)\n );\n assert(\n `buildBaseURL: You must pass \\`identifiers\\` as part of options`,\n options.op !== 'findMany' || options.identifiers.every((i) => typeof i.id === 'string' && i.id.length > 0)\n );\n assert(\n `buildBaseURL: You must pass valid \\`identifier\\` as part of options, expected 'type'`,\n options.op === 'findMany' || (typeof options.identifier.type === 'string' && options.identifier.type.length > 0)\n );\n assert(\n `buildBaseURL: You must pass valid \\`identifiers\\` as part of options, expected 'type'`,\n options.op !== 'findMany' ||\n (typeof options.identifiers[0].type === 'string' && options.identifiers[0].type.length > 0)\n );\n\n // prettier-ignore\n const idPath: string =\n isOperationWithPrimaryRecord(options) ? encodeURIComponent(options.identifier.id)\n : '';\n const resourcePath = options.resourcePath || resourcePathForType(options);\n const { host, namespace } = options;\n const fieldPath = 'fieldPath' in options ? options.fieldPath : '';\n\n assert(\n `buildBaseURL: You tried to build a ${String(\n (options as { op: string }).op\n )} request to ${resourcePath} but op must be one of \"${[\n 'findRecord',\n 'findRelatedResource',\n 'findRelatedCollection',\n 'updateRecord',\n 'deleteRecord',\n 'createRecord',\n 'query',\n 'findMany',\n ].join('\",\"')}\".`,\n [\n 'findRecord',\n 'query',\n 'findMany',\n 'findRelatedCollection',\n 'findRelatedResource',\n 'createRecord',\n 'updateRecord',\n 'deleteRecord',\n ].includes(options.op)\n );\n\n assert(`buildBaseURL: host must NOT end with '/', received '${host}'`, host === '/' || !host.endsWith('/'));\n assert(`buildBaseURL: namespace must NOT start with '/', received '${namespace}'`, !namespace.startsWith('/'));\n assert(`buildBaseURL: namespace must NOT end with '/', received '${namespace}'`, !namespace.endsWith('/'));\n assert(\n `buildBaseURL: resourcePath must NOT start with '/', received '${resourcePath}'`,\n !resourcePath.startsWith('/')\n );\n assert(`buildBaseURL: resourcePath must NOT end with '/', received '${resourcePath}'`, !resourcePath.endsWith('/'));\n assert(`buildBaseURL: fieldPath must NOT start with '/', received '${fieldPath}'`, !fieldPath.startsWith('/'));\n assert(`buildBaseURL: fieldPath must NOT end with '/', received '${fieldPath}'`, !fieldPath.endsWith('/'));\n assert(`buildBaseURL: idPath must NOT start with '/', received '${idPath}'`, !idPath.startsWith('/'));\n assert(`buildBaseURL: idPath must NOT end with '/', received '${idPath}'`, !idPath.endsWith('/'));\n\n const url = [host === '/' ? '' : host, namespace, resourcePath, idPath, fieldPath].filter(Boolean).join('/');\n return host ? url : `/${url}`;\n}\n\ntype SerializablePrimitive = string | number | boolean | null;\ntype Serializable = SerializablePrimitive | SerializablePrimitive[];\nexport type QueryParamsSerializationOptions = {\n arrayFormat?: 'bracket' | 'indices' | 'repeat' | 'comma';\n};\nexport type QueryParamsSource = Record<string, Serializable> | URLSearchParams;\n\nconst DEFAULT_QUERY_PARAMS_SERIALIZATION_OPTIONS: QueryParamsSerializationOptions = {\n arrayFormat: 'comma',\n};\n\nfunction handleInclude(include: string | string[]): string[] {\n assert(\n `Expected include to be a string or array, got ${typeof include}`,\n typeof include === 'string' || Array.isArray(include)\n );\n return typeof include === 'string' ? include.split(',') : include;\n}\n\nexport function buildQueryParams(params: QueryParamsSource, options?: QueryParamsSerializationOptions): string {\n options = Object.assign({}, DEFAULT_QUERY_PARAMS_SERIALIZATION_OPTIONS, options);\n const paramsIsObject = !(params instanceof URLSearchParams);\n const urlParams = new URLSearchParams();\n const dictionaryParams: Record<string, Serializable> = paramsIsObject ? params : {};\n\n if (!paramsIsObject) {\n params.forEach((value, key) => {\n const hasExisting = key in dictionaryParams;\n if (!hasExisting) {\n dictionaryParams[key] = value;\n } else {\n const existingValue = dictionaryParams[key];\n if (Array.isArray(existingValue)) {\n existingValue.push(value);\n } else {\n dictionaryParams[key] = [existingValue, value];\n }\n }\n });\n }\n\n if ('include' in dictionaryParams) {\n dictionaryParams.include = handleInclude(dictionaryParams.include as string | string[]);\n }\n\n const sortedKeys = Object.keys(dictionaryParams).sort();\n sortedKeys.forEach((key) => {\n const value = dictionaryParams[key];\n if (Array.isArray(value)) {\n value.sort();\n switch (options!.arrayFormat) {\n case 'indices':\n value.forEach((v, i) => {\n urlParams.append(`${key}[${i}]`, String(v));\n });\n return;\n case 'bracket':\n value.forEach((v) => {\n urlParams.append(`${key}[]`, String(v));\n });\n return;\n case 'repeat':\n value.forEach((v) => {\n urlParams.append(key, String(v));\n });\n return;\n case 'comma':\n default:\n urlParams.append(key, value.join(','));\n return;\n }\n } else {\n urlParams.append(key, String(value));\n }\n });\n\n return urlParams.toString();\n}\n"],"names":["CONFIG","host","namespace","setBuildURLConfig","values","OPERATIONS_WITH_PRIMARY_RECORDS","Set","isOperationWithPrimaryRecord","options","has","op","resourcePathForType","identifiers","type","identifier","buildBaseURL","urlOptions","Object","assign","assert","length","Array","isArray","every","i","id","idPath","encodeURIComponent","resourcePath","fieldPath","String","join","includes","endsWith","startsWith","url","filter","Boolean","DEFAULT_QUERY_PARAMS_SERIALIZATION_OPTIONS","arrayFormat","handleInclude","include","split","buildQueryParams","params","paramsIsObject","URLSearchParams","urlParams","dictionaryParams","forEach","value","key","hasExisting","existingValue","push","sortedKeys","keys","sort","v","append","toString"],"mappings":";;AAEA;AACA;AACA;;AAEA;AACA;AACA;AAOA,IAAIA,MAAsB,GAAG;AAC3BC,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,SAAS,EAAE,EAAA;AACb,CAAC,CAAA;AAEM,SAASC,iBAAiBA,CAACC,MAAsB,EAAE;AACxDJ,EAAAA,MAAM,GAAGI,MAAM,CAAA;AACjB,CAAA;AA6EA,MAAMC,+BAA+B,GAAG,IAAIC,GAAG,CAAC,CAC9C,YAAY,EACZ,qBAAqB,EACrB,uBAAuB,EACvB,cAAc,EACd,cAAc,CACf,CAAC,CAAA;AAEF,SAASC,4BAA4BA,CACnCC,OAAmB,EAMM;AACzB,EAAA,OAAOH,+BAA+B,CAACI,GAAG,CAACD,OAAO,CAACE,EAAE,CAAC,CAAA;AACxD,CAAA;AAEA,SAASC,mBAAmBA,CAACH,OAAmB,EAAU;AACxD,EAAA,OAAOA,OAAO,CAACE,EAAE,KAAK,UAAU,GAAGF,OAAO,CAACI,WAAW,CAAC,CAAC,CAAC,CAACC,IAAI,GAAGL,OAAO,CAACM,UAAU,CAACD,IAAI,CAAA;AAC1F,CAAA;AAEO,SAASE,YAAYA,CAACC,UAAsB,EAAU;AAC3D,EAAA,MAAMR,OAAO,GAAGS,MAAM,CAACC,MAAM,CAC3B;IACEjB,IAAI,EAAED,MAAM,CAACC,IAAI;IACjBC,SAAS,EAAEF,MAAM,CAACE,SAAAA;GACnB,EACDc,UACF,CAAC,CAAA;AACDG,EAAAA,MAAM,CACH,CAAsD,qDAAA,CAAA,EACvD,OAAOX,OAAO,CAACE,EAAE,KAAK,QAAQ,IAAIF,OAAO,CAACE,EAAE,CAACU,MAAM,GAAG,CACxD,CAAC,C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QAAQ;AACXR,UAAAA,KAAK,CAACD,OAAO,CAAES,CAAC,IAAK;YACnBX,SAAS,CAACY,MAAM,CAACR,GAAG,EAAErB,MAAM,CAAC4B,CAAC,CAAC,CAAC,CAAA;AAClC,WAAC,CAAC,CAAA;AACF,UAAA,OAAA;AACF,QAAA,KAAK,OAAO,CAAA;AACZ,QAAA;UACEX,SAAS,CAACY,MAAM,CAACR,GAAG,EAAED,KAAK,CAACnB,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;AACtC,UAAA,OAAA;AACJ,OAAA;AACF,KAAC,MAAM;MACLgB,SAAS,CAACY,MAAM,CAACR,GAAG,EAAErB,MAAM,CAACoB,KAAK,CAAC,CAAC,CAAA;AACtC,KAAA;AACF,GAAC,CAAC,CAAA;AAEF,EAAA,OAAOH,SAAS,CAACa,QAAQ,EAAE,CAAA;AAC7B;;;;"}
|
package/addon-main.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
name: require('./package.json').name,
|
|
3
|
+
|
|
4
|
+
treeForVendor() {
|
|
5
|
+
return;
|
|
6
|
+
},
|
|
7
|
+
treeForPublic() {
|
|
8
|
+
return;
|
|
9
|
+
},
|
|
10
|
+
treeForStyles() {
|
|
11
|
+
return;
|
|
12
|
+
},
|
|
13
|
+
treeForAddonStyles() {
|
|
14
|
+
return;
|
|
15
|
+
},
|
|
16
|
+
treeForApp() {
|
|
17
|
+
return;
|
|
18
|
+
},
|
|
19
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ember-data/request-utils",
|
|
3
|
+
"description": "Request Building Utilities for use with EmberData",
|
|
4
|
+
"version": "5.3.0-alpha.4",
|
|
5
|
+
"private": false,
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Chris Thoburn <runspired@users.noreply.github.com>",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+ssh://git@github.com:emberjs/data.git",
|
|
11
|
+
"directory": "packages/request-utils"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/emberjs/data",
|
|
14
|
+
"bugs": "https://github.com/emberjs/data/issues",
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": "16.* || >= 18"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"ember-addon"
|
|
20
|
+
],
|
|
21
|
+
"volta": {
|
|
22
|
+
"extends": "../../package.json"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"ember-cli-babel": "^7.26.11"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"addon-main.js",
|
|
29
|
+
"addon",
|
|
30
|
+
"README.md",
|
|
31
|
+
"LICENSE.md",
|
|
32
|
+
"ember-data-logo-dark.svg",
|
|
33
|
+
"ember-data-logo-light.svg"
|
|
34
|
+
],
|
|
35
|
+
"ember-addon": {
|
|
36
|
+
"main": "addon-main.js",
|
|
37
|
+
"type": "addon",
|
|
38
|
+
"version": 1
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@babel/cli": "^7.22.6",
|
|
42
|
+
"@babel/core": "^7.22.8",
|
|
43
|
+
"@babel/plugin-proposal-decorators": "^7.22.7",
|
|
44
|
+
"@babel/plugin-transform-class-properties": "^7.22.5",
|
|
45
|
+
"@babel/plugin-transform-runtime": "^7.22.7",
|
|
46
|
+
"@babel/plugin-transform-typescript": "^7.22.5",
|
|
47
|
+
"@babel/preset-env": "^7.22.7",
|
|
48
|
+
"@babel/preset-typescript": "^7.22.5",
|
|
49
|
+
"@babel/runtime": "^7.22.6",
|
|
50
|
+
"@embroider/addon-dev": "^3.1.1",
|
|
51
|
+
"@rollup/plugin-babel": "^6.0.3",
|
|
52
|
+
"@rollup/plugin-node-resolve": "^15.1.0",
|
|
53
|
+
"rollup": "^3.26.2",
|
|
54
|
+
"tslib": "^2.6.0",
|
|
55
|
+
"typescript": "^5.1.6",
|
|
56
|
+
"walk-sync": "^3.0.0"
|
|
57
|
+
},
|
|
58
|
+
"ember": {
|
|
59
|
+
"edition": "octane"
|
|
60
|
+
},
|
|
61
|
+
"scripts": {
|
|
62
|
+
"build": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js",
|
|
63
|
+
"start": "rollup --config --watch"
|
|
64
|
+
}
|
|
65
|
+
}
|