mobx-tanstack-query-api 0.24.0 → 0.26.0
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/builtin.cjs +27 -0
- package/builtin.cjs.map +1 -0
- package/builtin.d.ts +6 -0
- package/builtin.js +27 -0
- package/builtin.js.map +1 -0
- package/cli.cjs +1279 -0
- package/cli.cjs.map +1 -0
- package/{codegen/types/generate-query-api-params.d.cts → cli.d.ts} +55 -10
- package/cli.js +1278 -0
- package/cli.js.map +1 -0
- package/index.cjs +771 -16
- package/index.cjs.map +1 -0
- package/index.d.ts +322 -2
- package/index.js +768 -2
- package/index.js.map +1 -0
- package/package.json +21 -64
- package/builtin/index.cjs +0 -25
- package/builtin/index.d.cts +0 -4
- package/builtin/index.d.cts.map +0 -1
- package/builtin/index.d.ts +0 -4
- package/builtin/index.d.ts.map +0 -1
- package/builtin/index.js +0 -22
- package/cli/bin.cjs +0 -17
- package/cli/bin.d.cts +0 -2
- package/cli/bin.d.cts.map +0 -1
- package/cli/bin.d.ts +0 -2
- package/cli/bin.d.ts.map +0 -1
- package/cli/bin.js +0 -15
- package/cli/index.cjs +0 -18
- package/cli/index.d.cts +0 -3
- package/cli/index.d.cts.map +0 -1
- package/cli/index.d.ts +0 -3
- package/cli/index.d.ts.map +0 -1
- package/cli/index.js +0 -2
- package/cli/utils/define-config.cjs +0 -9
- package/cli/utils/define-config.d.cts +0 -4
- package/cli/utils/define-config.d.cts.map +0 -1
- package/cli/utils/define-config.d.ts +0 -4
- package/cli/utils/define-config.d.ts.map +0 -1
- package/cli/utils/define-config.js +0 -5
- package/cli/utils/exec-config-path.cjs +0 -16
- package/cli/utils/exec-config-path.d.cts +0 -2
- package/cli/utils/exec-config-path.d.cts.map +0 -1
- package/cli/utils/exec-config-path.d.ts +0 -2
- package/cli/utils/exec-config-path.d.ts.map +0 -1
- package/cli/utils/exec-config-path.js +0 -12
- package/cli/utils/resolve-config-path.cjs +0 -65
- package/cli/utils/resolve-config-path.d.cts +0 -3
- package/cli/utils/resolve-config-path.d.cts.map +0 -1
- package/cli/utils/resolve-config-path.d.ts +0 -3
- package/cli/utils/resolve-config-path.d.ts.map +0 -1
- package/cli/utils/resolve-config-path.js +0 -25
- package/codegen/index.cjs +0 -545
- package/codegen/index.d.cts +0 -4
- package/codegen/index.d.cts.map +0 -1
- package/codegen/index.d.ts +0 -4
- package/codegen/index.d.ts.map +0 -1
- package/codegen/index.js +0 -524
- package/codegen/templates/all-endpoints-per-file.tmpl.cjs +0 -94
- package/codegen/templates/all-endpoints-per-file.tmpl.d.cts +0 -14
- package/codegen/templates/all-endpoints-per-file.tmpl.d.cts.map +0 -1
- package/codegen/templates/all-endpoints-per-file.tmpl.d.ts +0 -14
- package/codegen/templates/all-endpoints-per-file.tmpl.d.ts.map +0 -1
- package/codegen/templates/all-endpoints-per-file.tmpl.js +0 -90
- package/codegen/templates/all-exports.tmpl.cjs +0 -14
- package/codegen/templates/all-exports.tmpl.d.cts +0 -9
- package/codegen/templates/all-exports.tmpl.d.cts.map +0 -1
- package/codegen/templates/all-exports.tmpl.d.ts +0 -9
- package/codegen/templates/all-exports.tmpl.d.ts.map +0 -1
- package/codegen/templates/all-exports.tmpl.js +0 -9
- package/codegen/templates/constants.cjs +0 -5
- package/codegen/templates/constants.d.cts +0 -2
- package/codegen/templates/constants.d.cts.map +0 -1
- package/codegen/templates/constants.d.ts +0 -2
- package/codegen/templates/constants.d.ts.map +0 -1
- package/codegen/templates/constants.js +0 -2
- package/codegen/templates/data-contract.tmpl.cjs +0 -49
- package/codegen/templates/data-contract.tmpl.d.cts +0 -8
- package/codegen/templates/data-contract.tmpl.d.cts.map +0 -1
- package/codegen/templates/data-contract.tmpl.d.ts +0 -8
- package/codegen/templates/data-contract.tmpl.d.ts.map +0 -1
- package/codegen/templates/data-contract.tmpl.js +0 -45
- package/codegen/templates/data-contracts-file.tmpl.cjs +0 -27
- package/codegen/templates/data-contracts-file.tmpl.d.cts +0 -6
- package/codegen/templates/data-contracts-file.tmpl.d.cts.map +0 -1
- package/codegen/templates/data-contracts-file.tmpl.d.ts +0 -6
- package/codegen/templates/data-contracts-file.tmpl.d.ts.map +0 -1
- package/codegen/templates/data-contracts-file.tmpl.js +0 -23
- package/codegen/templates/endpoint-jsdoc.tmpl.cjs +0 -111
- package/codegen/templates/endpoint-jsdoc.tmpl.d.cts +0 -8
- package/codegen/templates/endpoint-jsdoc.tmpl.d.cts.map +0 -1
- package/codegen/templates/endpoint-jsdoc.tmpl.d.ts +0 -8
- package/codegen/templates/endpoint-jsdoc.tmpl.d.ts.map +0 -1
- package/codegen/templates/endpoint-jsdoc.tmpl.js +0 -107
- package/codegen/templates/endpoint-per-file.tmpl.cjs +0 -87
- package/codegen/templates/endpoint-per-file.tmpl.d.cts +0 -14
- package/codegen/templates/endpoint-per-file.tmpl.d.cts.map +0 -1
- package/codegen/templates/endpoint-per-file.tmpl.d.ts +0 -14
- package/codegen/templates/endpoint-per-file.tmpl.d.ts.map +0 -1
- package/codegen/templates/endpoint-per-file.tmpl.js +0 -83
- package/codegen/templates/index-ts-for-endpoint-per-file.tmpl.cjs +0 -10
- package/codegen/templates/index-ts-for-endpoint-per-file.tmpl.d.cts +0 -6
- package/codegen/templates/index-ts-for-endpoint-per-file.tmpl.d.cts.map +0 -1
- package/codegen/templates/index-ts-for-endpoint-per-file.tmpl.d.ts +0 -6
- package/codegen/templates/index-ts-for-endpoint-per-file.tmpl.d.ts.map +0 -1
- package/codegen/templates/index-ts-for-endpoint-per-file.tmpl.js +0 -6
- package/codegen/templates/meta-info.tmpl.cjs +0 -48
- package/codegen/templates/meta-info.tmpl.d.cts +0 -9
- package/codegen/templates/meta-info.tmpl.d.cts.map +0 -1
- package/codegen/templates/meta-info.tmpl.d.ts +0 -9
- package/codegen/templates/meta-info.tmpl.d.ts.map +0 -1
- package/codegen/templates/meta-info.tmpl.js +0 -42
- package/codegen/templates/new-endpoint.tmpl.cjs +0 -188
- package/codegen/templates/new-endpoint.tmpl.d.cts +0 -15
- package/codegen/templates/new-endpoint.tmpl.d.cts.map +0 -1
- package/codegen/templates/new-endpoint.tmpl.d.ts +0 -15
- package/codegen/templates/new-endpoint.tmpl.d.ts.map +0 -1
- package/codegen/templates/new-endpoint.tmpl.js +0 -184
- package/codegen/types/all-import-file-params.cjs +0 -2
- package/codegen/types/all-import-file-params.d.cts +0 -5
- package/codegen/types/all-import-file-params.d.cts.map +0 -1
- package/codegen/types/all-import-file-params.d.ts +0 -5
- package/codegen/types/all-import-file-params.d.ts.map +0 -1
- package/codegen/types/all-import-file-params.js +0 -1
- package/codegen/types/base-tmpl-params.cjs +0 -2
- package/codegen/types/base-tmpl-params.d.cts +0 -16
- package/codegen/types/base-tmpl-params.d.cts.map +0 -1
- package/codegen/types/base-tmpl-params.d.ts +0 -16
- package/codegen/types/base-tmpl-params.d.ts.map +0 -1
- package/codegen/types/base-tmpl-params.js +0 -1
- package/codegen/types/codegen-data-utils.cjs +0 -2
- package/codegen/types/codegen-data-utils.d.cts +0 -8
- package/codegen/types/codegen-data-utils.d.cts.map +0 -1
- package/codegen/types/codegen-data-utils.d.ts +0 -8
- package/codegen/types/codegen-data-utils.d.ts.map +0 -1
- package/codegen/types/codegen-data-utils.js +0 -1
- package/codegen/types/endpoint-data.cjs +0 -2
- package/codegen/types/endpoint-data.d.cts +0 -3
- package/codegen/types/endpoint-data.d.cts.map +0 -1
- package/codegen/types/endpoint-data.d.ts +0 -3
- package/codegen/types/endpoint-data.d.ts.map +0 -1
- package/codegen/types/endpoint-data.js +0 -1
- package/codegen/types/generate-query-api-params.cjs +0 -2
- package/codegen/types/generate-query-api-params.d.cts.map +0 -1
- package/codegen/types/generate-query-api-params.d.ts +0 -162
- package/codegen/types/generate-query-api-params.d.ts.map +0 -1
- package/codegen/types/generate-query-api-params.js +0 -1
- package/codegen/types/import-file-params.cjs +0 -2
- package/codegen/types/import-file-params.d.cts +0 -5
- package/codegen/types/import-file-params.d.cts.map +0 -1
- package/codegen/types/import-file-params.d.ts +0 -5
- package/codegen/types/import-file-params.d.ts.map +0 -1
- package/codegen/types/import-file-params.js +0 -1
- package/codegen/types/index.cjs +0 -23
- package/codegen/types/index.d.cts +0 -8
- package/codegen/types/index.d.cts.map +0 -1
- package/codegen/types/index.d.ts +0 -8
- package/codegen/types/index.d.ts.map +0 -1
- package/codegen/types/index.js +0 -7
- package/codegen/types/meta-info.cjs +0 -2
- package/codegen/types/meta-info.d.cts +0 -6
- package/codegen/types/meta-info.d.cts.map +0 -1
- package/codegen/types/meta-info.d.ts +0 -6
- package/codegen/types/meta-info.d.ts.map +0 -1
- package/codegen/types/meta-info.js +0 -1
- package/codegen/types/type-info.cjs +0 -2
- package/codegen/types/type-info.d.cts +0 -4
- package/codegen/types/type-info.d.cts.map +0 -1
- package/codegen/types/type-info.d.ts +0 -4
- package/codegen/types/type-info.d.ts.map +0 -1
- package/codegen/types/type-info.js +0 -1
- package/codegen/utils/create-short-model-type.cjs +0 -12
- package/codegen/utils/create-short-model-type.d.cts +0 -5
- package/codegen/utils/create-short-model-type.d.cts.map +0 -1
- package/codegen/utils/create-short-model-type.d.ts +0 -5
- package/codegen/utils/create-short-model-type.d.ts.map +0 -1
- package/codegen/utils/create-short-model-type.js +0 -8
- package/codegen/utils/remove-unused-types.cjs +0 -117
- package/codegen/utils/remove-unused-types.d.cts +0 -7
- package/codegen/utils/remove-unused-types.d.cts.map +0 -1
- package/codegen/utils/remove-unused-types.d.ts +0 -7
- package/codegen/utils/remove-unused-types.d.ts.map +0 -1
- package/codegen/utils/remove-unused-types.js +0 -110
- package/codegen/utils/unpack-filter-option.cjs +0 -23
- package/codegen/utils/unpack-filter-option.d.cts +0 -7
- package/codegen/utils/unpack-filter-option.d.cts.map +0 -1
- package/codegen/utils/unpack-filter-option.d.ts +0 -7
- package/codegen/utils/unpack-filter-option.d.ts.map +0 -1
- package/codegen/utils/unpack-filter-option.js +0 -19
- package/index.d.cts +0 -3
- package/index.d.cts.map +0 -1
- package/index.d.ts.map +0 -1
- package/runtime/endpoint-infinite-query.cjs +0 -101
- package/runtime/endpoint-infinite-query.d.cts +0 -17
- package/runtime/endpoint-infinite-query.d.cts.map +0 -1
- package/runtime/endpoint-infinite-query.d.ts +0 -17
- package/runtime/endpoint-infinite-query.d.ts.map +0 -1
- package/runtime/endpoint-infinite-query.js +0 -97
- package/runtime/endpoint-infinite-query.types.cjs +0 -2
- package/runtime/endpoint-infinite-query.types.d.cts +0 -30
- package/runtime/endpoint-infinite-query.types.d.cts.map +0 -1
- package/runtime/endpoint-infinite-query.types.d.ts +0 -30
- package/runtime/endpoint-infinite-query.types.d.ts.map +0 -1
- package/runtime/endpoint-infinite-query.types.js +0 -1
- package/runtime/endpoint-mutation.cjs +0 -74
- package/runtime/endpoint-mutation.d.cts +0 -13
- package/runtime/endpoint-mutation.d.cts.map +0 -1
- package/runtime/endpoint-mutation.d.ts +0 -13
- package/runtime/endpoint-mutation.d.ts.map +0 -1
- package/runtime/endpoint-mutation.js +0 -70
- package/runtime/endpoint-mutation.types.cjs +0 -2
- package/runtime/endpoint-mutation.types.d.cts +0 -36
- package/runtime/endpoint-mutation.types.d.cts.map +0 -1
- package/runtime/endpoint-mutation.types.d.ts +0 -36
- package/runtime/endpoint-mutation.types.d.ts.map +0 -1
- package/runtime/endpoint-mutation.types.js +0 -1
- package/runtime/endpoint-query-client.cjs +0 -79
- package/runtime/endpoint-query-client.d.cts +0 -13
- package/runtime/endpoint-query-client.d.cts.map +0 -1
- package/runtime/endpoint-query-client.d.ts +0 -13
- package/runtime/endpoint-query-client.d.ts.map +0 -1
- package/runtime/endpoint-query-client.js +0 -75
- package/runtime/endpoint-query-client.types.cjs +0 -2
- package/runtime/endpoint-query-client.types.d.cts +0 -16
- package/runtime/endpoint-query-client.types.d.cts.map +0 -1
- package/runtime/endpoint-query-client.types.d.ts +0 -16
- package/runtime/endpoint-query-client.types.d.ts.map +0 -1
- package/runtime/endpoint-query-client.types.js +0 -1
- package/runtime/endpoint-query.cjs +0 -214
- package/runtime/endpoint-query.d.cts +0 -29
- package/runtime/endpoint-query.d.cts.map +0 -1
- package/runtime/endpoint-query.d.ts +0 -29
- package/runtime/endpoint-query.d.ts.map +0 -1
- package/runtime/endpoint-query.js +0 -208
- package/runtime/endpoint-query.types.cjs +0 -2
- package/runtime/endpoint-query.types.d.cts +0 -42
- package/runtime/endpoint-query.types.d.cts.map +0 -1
- package/runtime/endpoint-query.types.d.ts +0 -42
- package/runtime/endpoint-query.types.d.ts.map +0 -1
- package/runtime/endpoint-query.types.js +0 -1
- package/runtime/endpoint.cjs +0 -131
- package/runtime/endpoint.d.cts +0 -73
- package/runtime/endpoint.d.cts.map +0 -1
- package/runtime/endpoint.d.ts +0 -73
- package/runtime/endpoint.d.ts.map +0 -1
- package/runtime/endpoint.js +0 -127
- package/runtime/endpoint.types.cjs +0 -2
- package/runtime/endpoint.types.d.cts +0 -24
- package/runtime/endpoint.types.d.cts.map +0 -1
- package/runtime/endpoint.types.d.ts +0 -24
- package/runtime/endpoint.types.d.ts.map +0 -1
- package/runtime/endpoint.types.js +0 -1
- package/runtime/http-client.cjs +0 -190
- package/runtime/http-client.d.cts +0 -85
- package/runtime/http-client.d.cts.map +0 -1
- package/runtime/http-client.d.ts +0 -85
- package/runtime/http-client.d.ts.map +0 -1
- package/runtime/http-client.js +0 -184
- package/runtime/index.cjs +0 -25
- package/runtime/index.d.cts +0 -10
- package/runtime/index.d.cts.map +0 -1
- package/runtime/index.d.ts +0 -10
- package/runtime/index.d.ts.map +0 -1
- package/runtime/index.js +0 -9
package/runtime/http-client.cjs
DELETED
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HttpClient = exports.isHttpBadResponse = exports.isHttpResponse = void 0;
|
|
4
|
-
const mobx_1 = require("mobx");
|
|
5
|
-
const qs_1 = require("qs");
|
|
6
|
-
const isHttpResponse = (response, status) => !!response &&
|
|
7
|
-
typeof response === 'object' &&
|
|
8
|
-
response instanceof Response &&
|
|
9
|
-
'data' in response &&
|
|
10
|
-
(!status || response.status === status);
|
|
11
|
-
exports.isHttpResponse = isHttpResponse;
|
|
12
|
-
const isHttpBadResponse = (response) => {
|
|
13
|
-
return (0, exports.isHttpResponse)(response) && (!response.ok || !!response.error);
|
|
14
|
-
};
|
|
15
|
-
exports.isHttpBadResponse = isHttpBadResponse;
|
|
16
|
-
class HttpClient {
|
|
17
|
-
config;
|
|
18
|
-
fetch;
|
|
19
|
-
meta;
|
|
20
|
-
baseApiParams;
|
|
21
|
-
badResponse;
|
|
22
|
-
toQueryString;
|
|
23
|
-
constructor(config) {
|
|
24
|
-
this.config = config ?? {};
|
|
25
|
-
this.badResponse = null;
|
|
26
|
-
this.meta = config?.meta ?? null;
|
|
27
|
-
this.fetch =
|
|
28
|
-
config?.fetch ??
|
|
29
|
-
((...fetchParams) => globalThis.fetch(...fetchParams));
|
|
30
|
-
this.toQueryString =
|
|
31
|
-
config?.toQueryString ??
|
|
32
|
-
((query) => (0, qs_1.stringify)(query, config?.queryStringifyOptions));
|
|
33
|
-
this.baseApiParams = {
|
|
34
|
-
credentials: 'same-origin',
|
|
35
|
-
headers: {},
|
|
36
|
-
redirect: 'follow',
|
|
37
|
-
referrerPolicy: 'no-referrer',
|
|
38
|
-
};
|
|
39
|
-
this.updateConfig(this.config);
|
|
40
|
-
mobx_1.observable.ref(this, 'badResponse');
|
|
41
|
-
mobx_1.observable.ref(this, 'meta');
|
|
42
|
-
(0, mobx_1.action)(this, 'setMeta');
|
|
43
|
-
(0, mobx_1.action)(this, 'setBadResponse');
|
|
44
|
-
(0, mobx_1.makeObservable)(this);
|
|
45
|
-
}
|
|
46
|
-
get baseUrl() {
|
|
47
|
-
return this.config.baseUrl ?? '';
|
|
48
|
-
}
|
|
49
|
-
updateConfig(update) {
|
|
50
|
-
Object.assign(this.config, update);
|
|
51
|
-
if (update.baseApiParams) {
|
|
52
|
-
Object.assign(this.baseApiParams, update.baseApiParams);
|
|
53
|
-
}
|
|
54
|
-
if (update.contentFormatters) {
|
|
55
|
-
Object.assign(this.contentFormatters, update.contentFormatters);
|
|
56
|
-
}
|
|
57
|
-
if (update.fetch) {
|
|
58
|
-
this.fetch = update.fetch;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
setMeta = (data) => {
|
|
62
|
-
this.meta = data;
|
|
63
|
-
};
|
|
64
|
-
setBadResponse = (response) => {
|
|
65
|
-
this.badResponse = response;
|
|
66
|
-
};
|
|
67
|
-
contentFormatters = {
|
|
68
|
-
'application/json': (input) => input !== null && (typeof input === 'object' || typeof input === 'string')
|
|
69
|
-
? JSON.stringify(input)
|
|
70
|
-
: input,
|
|
71
|
-
'text/plain': (input) => input !== null && typeof input !== 'string'
|
|
72
|
-
? JSON.stringify(input)
|
|
73
|
-
: input,
|
|
74
|
-
'multipart/form-data': (input) => Object.keys(input || {}).reduce((formData, key) => {
|
|
75
|
-
const property = input[key];
|
|
76
|
-
if (property instanceof Blob) {
|
|
77
|
-
formData.append(key, property);
|
|
78
|
-
}
|
|
79
|
-
else if (typeof property === 'object' && property !== null) {
|
|
80
|
-
formData.append(key, JSON.stringify(property));
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
formData.append(key, `${property}`);
|
|
84
|
-
}
|
|
85
|
-
return formData;
|
|
86
|
-
}, new FormData()),
|
|
87
|
-
'application/x-www-form-urlencoded': (input) => this.toQueryString(input),
|
|
88
|
-
'application/octet-stream': (input) => input,
|
|
89
|
-
};
|
|
90
|
-
mergeRequestParams(params1, params2) {
|
|
91
|
-
return {
|
|
92
|
-
...this.baseApiParams,
|
|
93
|
-
...params1,
|
|
94
|
-
...params2,
|
|
95
|
-
headers: {
|
|
96
|
-
...this.baseApiParams.headers,
|
|
97
|
-
...params1.headers,
|
|
98
|
-
...params2?.headers,
|
|
99
|
-
},
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
async createResponse(responseFormat, raw, url, params) {
|
|
103
|
-
const response = raw;
|
|
104
|
-
response.request = {
|
|
105
|
-
url,
|
|
106
|
-
params,
|
|
107
|
-
};
|
|
108
|
-
response.data = null;
|
|
109
|
-
response.error = null;
|
|
110
|
-
if (responseFormat) {
|
|
111
|
-
try {
|
|
112
|
-
const formatted = await response[responseFormat]();
|
|
113
|
-
if (response.ok) {
|
|
114
|
-
response.data = formatted;
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
response.error = formatted;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
catch (error) {
|
|
121
|
-
if (response.ok) {
|
|
122
|
-
response.error = error;
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
response.error = null;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
if (!response.ok || response.error) {
|
|
130
|
-
this.setBadResponse(response);
|
|
131
|
-
}
|
|
132
|
-
return response;
|
|
133
|
-
}
|
|
134
|
-
buildUrl = (params) => {
|
|
135
|
-
const baseUrl = params.baseUrl ?? this.baseUrl ?? '';
|
|
136
|
-
const path = params.path;
|
|
137
|
-
const queryString = params.query && this.toQueryString(params.query);
|
|
138
|
-
const query = queryString ? `?${queryString}` : '';
|
|
139
|
-
if (this.config.buildUrl) {
|
|
140
|
-
return this.config.buildUrl(params, { baseUrl, path, query }, this.meta);
|
|
141
|
-
}
|
|
142
|
-
const url = baseUrl + path + query;
|
|
143
|
-
return url;
|
|
144
|
-
};
|
|
145
|
-
async request(fullParams, endpoint) {
|
|
146
|
-
this.setBadResponse(null);
|
|
147
|
-
const { body, contentType = 'application/json', format = 'json', ...params } = fullParams;
|
|
148
|
-
let requestParams = this.mergeRequestParams(params);
|
|
149
|
-
if (this.config.interceptor) {
|
|
150
|
-
requestParams =
|
|
151
|
-
(await this.config.interceptor(requestParams, this.meta, endpoint)) ??
|
|
152
|
-
requestParams;
|
|
153
|
-
}
|
|
154
|
-
const payloadFormatter = this.contentFormatters[contentType];
|
|
155
|
-
const responseFormat = format || requestParams.format;
|
|
156
|
-
const url = this.buildUrl(fullParams);
|
|
157
|
-
let headers;
|
|
158
|
-
if (requestParams.headers instanceof Headers) {
|
|
159
|
-
headers = requestParams.headers;
|
|
160
|
-
}
|
|
161
|
-
else if (Array.isArray(requestParams.headers)) {
|
|
162
|
-
headers = new Headers(requestParams.headers);
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
headers = new Headers(requestParams.headers);
|
|
166
|
-
}
|
|
167
|
-
if (!headers.has('Content-Type')) {
|
|
168
|
-
headers.set('Content-Type', contentType);
|
|
169
|
-
}
|
|
170
|
-
const fetchUrl = url;
|
|
171
|
-
const fetchParams = {
|
|
172
|
-
...requestParams,
|
|
173
|
-
headers,
|
|
174
|
-
body: body == null ? null : payloadFormatter(body),
|
|
175
|
-
};
|
|
176
|
-
let response;
|
|
177
|
-
try {
|
|
178
|
-
response = await this.fetch(fetchUrl, fetchParams);
|
|
179
|
-
}
|
|
180
|
-
catch (error) {
|
|
181
|
-
response = error;
|
|
182
|
-
}
|
|
183
|
-
const httpResponse = await this.createResponse(responseFormat, response, fetchUrl, fetchParams);
|
|
184
|
-
if (!httpResponse.ok || httpResponse.error) {
|
|
185
|
-
throw httpResponse;
|
|
186
|
-
}
|
|
187
|
-
return httpResponse;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
exports.HttpClient = HttpClient;
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import type { HttpStatusCode, HttpSuccessStatusCode } from 'http-status-code-types';
|
|
2
|
-
import { type BooleanOptional, type IStringifyOptions } from 'qs';
|
|
3
|
-
import type { AnyObject, Defined, Maybe, ValueOf } from 'yummies/utils/types';
|
|
4
|
-
import type { AnyEndpoint } from "./endpoint.types.cjs";
|
|
5
|
-
export type QueryParamsType = Record<string | number, any>;
|
|
6
|
-
export type ResponseFormat = keyof Omit<Body, 'body' | 'bodyUsed'>;
|
|
7
|
-
export interface FullRequestParams extends Omit<RequestInit, 'body'> {
|
|
8
|
-
/** set parameter to `true` for call `securityWorker` for this request */
|
|
9
|
-
secure?: boolean;
|
|
10
|
-
/** request path */
|
|
11
|
-
path: string;
|
|
12
|
-
/** content type of request body */
|
|
13
|
-
contentType?: string;
|
|
14
|
-
/** query params */
|
|
15
|
-
query?: QueryParamsType;
|
|
16
|
-
/** format of response (i.e. response.json() -> format: "json") */
|
|
17
|
-
format?: ResponseFormat;
|
|
18
|
-
/** request body */
|
|
19
|
-
body?: unknown;
|
|
20
|
-
/** base url */
|
|
21
|
-
baseUrl?: string;
|
|
22
|
-
/** meta data */
|
|
23
|
-
meta?: Record<string, any>;
|
|
24
|
-
}
|
|
25
|
-
export type RequestParams = Omit<FullRequestParams, 'body' | 'method' | 'query' | 'path' | 'serviceName'>;
|
|
26
|
-
export interface HttpClientConfig<TMeta = unknown> {
|
|
27
|
-
baseUrl?: string;
|
|
28
|
-
meta?: TMeta;
|
|
29
|
-
fetch?: typeof globalThis.fetch;
|
|
30
|
-
baseApiParams?: Omit<RequestParams, 'baseUrl' | 'cancelToken' | 'signal'>;
|
|
31
|
-
contentFormatters?: Record<string, (input: any) => any>;
|
|
32
|
-
queryStringifyOptions?: IStringifyOptions<BooleanOptional>;
|
|
33
|
-
toQueryString?: (query?: AnyObject) => string;
|
|
34
|
-
buildUrl?: (fullParams: FullRequestParams, formattedParts: {
|
|
35
|
-
baseUrl: string;
|
|
36
|
-
path: string;
|
|
37
|
-
query: string;
|
|
38
|
-
}, metadata: TMeta | null) => string;
|
|
39
|
-
interceptor?: (requestParams: RequestParams, metadata: TMeta | null, endpoint?: Maybe<AnyEndpoint>) => Promise<RequestParams | void> | RequestParams | void;
|
|
40
|
-
}
|
|
41
|
-
export interface HttpResponse<TData, TError = null, TStatus = number> extends Omit<Response, 'status'> {
|
|
42
|
-
data: TData;
|
|
43
|
-
error: TError;
|
|
44
|
-
status: TStatus;
|
|
45
|
-
request: {
|
|
46
|
-
url: string;
|
|
47
|
-
params: globalThis.RequestInit;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
export type HttpMultistatusResponse<TResponsesByStatusMap extends Partial<Record<HttpStatusCode, any>>, TDefaultOkResponse, TDefaultBadResponse = unknown> = Omit<Response, 'status'> & (ValueOf<{
|
|
51
|
-
[K in keyof TResponsesByStatusMap]: {
|
|
52
|
-
status: K;
|
|
53
|
-
data: K extends HttpSuccessStatusCode ? TResponsesByStatusMap[K] : TDefaultOkResponse;
|
|
54
|
-
error: K extends HttpSuccessStatusCode ? TDefaultBadResponse : TResponsesByStatusMap[K];
|
|
55
|
-
};
|
|
56
|
-
}> | {
|
|
57
|
-
status: Exclude<HttpStatusCode, keyof TResponsesByStatusMap>;
|
|
58
|
-
data: TDefaultOkResponse;
|
|
59
|
-
error: TDefaultBadResponse;
|
|
60
|
-
});
|
|
61
|
-
export type GetHttpResponse<T> = T extends (...args: any[]) => infer R ? R extends Promise<HttpResponse<any, any>> ? Awaited<R> : R extends Promise<HttpMultistatusResponse<any, any, any>> ? Awaited<R> : HttpResponse<any, any> : HttpResponse<any, any>;
|
|
62
|
-
export type HttpBadResponse<T = any> = HttpResponse<null, T>;
|
|
63
|
-
export type AnyHttpResponse = HttpResponse<any, any>;
|
|
64
|
-
export declare const isHttpResponse: (response: unknown, status?: number) => response is AnyHttpResponse;
|
|
65
|
-
export declare const isHttpBadResponse: (response: unknown) => response is HttpResponse<null, any>;
|
|
66
|
-
export declare class HttpClient<TMeta = unknown> {
|
|
67
|
-
private config;
|
|
68
|
-
private fetch;
|
|
69
|
-
meta: TMeta | null;
|
|
70
|
-
baseApiParams: RequestParams;
|
|
71
|
-
badResponse: unknown;
|
|
72
|
-
protected toQueryString: Defined<HttpClientConfig<TMeta>['toQueryString']>;
|
|
73
|
-
constructor(config?: HttpClientConfig<TMeta>);
|
|
74
|
-
get baseUrl(): string;
|
|
75
|
-
updateConfig(update: Partial<HttpClientConfig<TMeta>>): void;
|
|
76
|
-
setMeta: (data: TMeta | null) => void;
|
|
77
|
-
setBadResponse: (response: unknown) => void;
|
|
78
|
-
private contentFormatters;
|
|
79
|
-
protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams;
|
|
80
|
-
protected createResponse(responseFormat: FullRequestParams['format'], raw: Response, url: string, params: RequestInit): Promise<AnyHttpResponse>;
|
|
81
|
-
buildUrl: (params: FullRequestParams) => string;
|
|
82
|
-
request<T, E>(fullParams: FullRequestParams, endpoint?: Maybe<AnyEndpoint>): Promise<HttpResponse<T, E>>;
|
|
83
|
-
request<THttpResponse extends HttpResponse<any, any>>(fullParams: FullRequestParams, endpoint?: Maybe<AnyEndpoint>): Promise<THttpResponse>;
|
|
84
|
-
}
|
|
85
|
-
//# sourceMappingURL=http-client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"http-client.d.ts","sourceRoot":"","sources":["../../src/runtime/http-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,iBAAiB,EAAa,MAAM,IAAI,CAAC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,KAAK,EAAE,WAAW,EAAE,6BAA4B;AAEvD,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,CAAC;AAC3D,MAAM,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC;AAEnE,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC;IAClE,yEAAyE;IACzE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAA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BAAkB,CAC1B,OAAO,EAAE,aAAa,EACtB,OAAO,CAAC,EAAE,aAAa,GACtB,aAAa;cAaA,cAAc,CAC5B,cAAc,EAAE,iBAAiB,CAAC,QAAQ,CAAC,EAC3C,GAAG,EAAE,QAAQ,EACb,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,eAAe,CAAC;IAkCpB,QAAQ,GAAI,QAAQ,iBAAiB,YAgB1C;IAEK,OAAO,CAAC,CAAC,EAAE,CAAC,EACjB,UAAU,EAAE,iBAAiB,EAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,GAC5B,OAAO,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACvB,OAAO,CAAC,aAAa,SAAS,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,EACzD,UAAU,EAAE,iBAAiB,EAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,GAC5B,OAAO,CAAC,aAAa,CAAC;CAsE1B"}
|
package/runtime/http-client.d.ts
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import type { HttpStatusCode, HttpSuccessStatusCode } from 'http-status-code-types';
|
|
2
|
-
import { type BooleanOptional, type IStringifyOptions } from 'qs';
|
|
3
|
-
import type { AnyObject, Defined, Maybe, ValueOf } from 'yummies/utils/types';
|
|
4
|
-
import type { AnyEndpoint } from "./endpoint.types.js";
|
|
5
|
-
export type QueryParamsType = Record<string | number, any>;
|
|
6
|
-
export type ResponseFormat = keyof Omit<Body, 'body' | 'bodyUsed'>;
|
|
7
|
-
export interface FullRequestParams extends Omit<RequestInit, 'body'> {
|
|
8
|
-
/** set parameter to `true` for call `securityWorker` for this request */
|
|
9
|
-
secure?: boolean;
|
|
10
|
-
/** request path */
|
|
11
|
-
path: string;
|
|
12
|
-
/** content type of request body */
|
|
13
|
-
contentType?: string;
|
|
14
|
-
/** query params */
|
|
15
|
-
query?: QueryParamsType;
|
|
16
|
-
/** format of response (i.e. response.json() -> format: "json") */
|
|
17
|
-
format?: ResponseFormat;
|
|
18
|
-
/** request body */
|
|
19
|
-
body?: unknown;
|
|
20
|
-
/** base url */
|
|
21
|
-
baseUrl?: string;
|
|
22
|
-
/** meta data */
|
|
23
|
-
meta?: Record<string, any>;
|
|
24
|
-
}
|
|
25
|
-
export type RequestParams = Omit<FullRequestParams, 'body' | 'method' | 'query' | 'path' | 'serviceName'>;
|
|
26
|
-
export interface HttpClientConfig<TMeta = unknown> {
|
|
27
|
-
baseUrl?: string;
|
|
28
|
-
meta?: TMeta;
|
|
29
|
-
fetch?: typeof globalThis.fetch;
|
|
30
|
-
baseApiParams?: Omit<RequestParams, 'baseUrl' | 'cancelToken' | 'signal'>;
|
|
31
|
-
contentFormatters?: Record<string, (input: any) => any>;
|
|
32
|
-
queryStringifyOptions?: IStringifyOptions<BooleanOptional>;
|
|
33
|
-
toQueryString?: (query?: AnyObject) => string;
|
|
34
|
-
buildUrl?: (fullParams: FullRequestParams, formattedParts: {
|
|
35
|
-
baseUrl: string;
|
|
36
|
-
path: string;
|
|
37
|
-
query: string;
|
|
38
|
-
}, metadata: TMeta | null) => string;
|
|
39
|
-
interceptor?: (requestParams: RequestParams, metadata: TMeta | null, endpoint?: Maybe<AnyEndpoint>) => Promise<RequestParams | void> | RequestParams | void;
|
|
40
|
-
}
|
|
41
|
-
export interface HttpResponse<TData, TError = null, TStatus = number> extends Omit<Response, 'status'> {
|
|
42
|
-
data: TData;
|
|
43
|
-
error: TError;
|
|
44
|
-
status: TStatus;
|
|
45
|
-
request: {
|
|
46
|
-
url: string;
|
|
47
|
-
params: globalThis.RequestInit;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
export type HttpMultistatusResponse<TResponsesByStatusMap extends Partial<Record<HttpStatusCode, any>>, TDefaultOkResponse, TDefaultBadResponse = unknown> = Omit<Response, 'status'> & (ValueOf<{
|
|
51
|
-
[K in keyof TResponsesByStatusMap]: {
|
|
52
|
-
status: K;
|
|
53
|
-
data: K extends HttpSuccessStatusCode ? TResponsesByStatusMap[K] : TDefaultOkResponse;
|
|
54
|
-
error: K extends HttpSuccessStatusCode ? TDefaultBadResponse : TResponsesByStatusMap[K];
|
|
55
|
-
};
|
|
56
|
-
}> | {
|
|
57
|
-
status: Exclude<HttpStatusCode, keyof TResponsesByStatusMap>;
|
|
58
|
-
data: TDefaultOkResponse;
|
|
59
|
-
error: TDefaultBadResponse;
|
|
60
|
-
});
|
|
61
|
-
export type GetHttpResponse<T> = T extends (...args: any[]) => infer R ? R extends Promise<HttpResponse<any, any>> ? Awaited<R> : R extends Promise<HttpMultistatusResponse<any, any, any>> ? Awaited<R> : HttpResponse<any, any> : HttpResponse<any, any>;
|
|
62
|
-
export type HttpBadResponse<T = any> = HttpResponse<null, T>;
|
|
63
|
-
export type AnyHttpResponse = HttpResponse<any, any>;
|
|
64
|
-
export declare const isHttpResponse: (response: unknown, status?: number) => response is AnyHttpResponse;
|
|
65
|
-
export declare const isHttpBadResponse: (response: unknown) => response is HttpResponse<null, any>;
|
|
66
|
-
export declare class HttpClient<TMeta = unknown> {
|
|
67
|
-
private config;
|
|
68
|
-
private fetch;
|
|
69
|
-
meta: TMeta | null;
|
|
70
|
-
baseApiParams: RequestParams;
|
|
71
|
-
badResponse: unknown;
|
|
72
|
-
protected toQueryString: Defined<HttpClientConfig<TMeta>['toQueryString']>;
|
|
73
|
-
constructor(config?: HttpClientConfig<TMeta>);
|
|
74
|
-
get baseUrl(): string;
|
|
75
|
-
updateConfig(update: Partial<HttpClientConfig<TMeta>>): void;
|
|
76
|
-
setMeta: (data: TMeta | null) => void;
|
|
77
|
-
setBadResponse: (response: unknown) => void;
|
|
78
|
-
private contentFormatters;
|
|
79
|
-
protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams;
|
|
80
|
-
protected createResponse(responseFormat: FullRequestParams['format'], raw: Response, url: string, params: RequestInit): Promise<AnyHttpResponse>;
|
|
81
|
-
buildUrl: (params: FullRequestParams) => string;
|
|
82
|
-
request<T, E>(fullParams: FullRequestParams, endpoint?: Maybe<AnyEndpoint>): Promise<HttpResponse<T, E>>;
|
|
83
|
-
request<THttpResponse extends HttpResponse<any, any>>(fullParams: FullRequestParams, endpoint?: Maybe<AnyEndpoint>): Promise<THttpResponse>;
|
|
84
|
-
}
|
|
85
|
-
//# sourceMappingURL=http-client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"http-client.d.ts","sourceRoot":"","sources":["../../src/runtime/http-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,iBAAiB,EAAa,MAAM,IAAI,CAAC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,KAAK,EAAE,WAAW,EAAE,4BAA4B;AAEvD,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,CAAC;AAC3D,MAAM,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC;AAEnE,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC;IAClE,yEAAyE;IACzE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB;IACnB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,kEAAkE;IAClE,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,mBAAmB;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,eAAe;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB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M,EAAE,WAAW,GAClB,OAAO,CAAC,eAAe,CAAC;IAkCpB,QAAQ,GAAI,QAAQ,iBAAiB,YAgB1C;IAEK,OAAO,CAAC,CAAC,EAAE,CAAC,EACjB,UAAU,EAAE,iBAAiB,EAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,GAC5B,OAAO,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACvB,OAAO,CAAC,aAAa,SAAS,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,EACzD,UAAU,EAAE,iBAAiB,EAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,GAC5B,OAAO,CAAC,aAAa,CAAC;CAsE1B"}
|
package/runtime/http-client.js
DELETED
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import { action, makeObservable, observable } from 'mobx';
|
|
2
|
-
import { stringify } from 'qs';
|
|
3
|
-
export const isHttpResponse = (response, status) => !!response &&
|
|
4
|
-
typeof response === 'object' &&
|
|
5
|
-
response instanceof Response &&
|
|
6
|
-
'data' in response &&
|
|
7
|
-
(!status || response.status === status);
|
|
8
|
-
export const isHttpBadResponse = (response) => {
|
|
9
|
-
return isHttpResponse(response) && (!response.ok || !!response.error);
|
|
10
|
-
};
|
|
11
|
-
export class HttpClient {
|
|
12
|
-
config;
|
|
13
|
-
fetch;
|
|
14
|
-
meta;
|
|
15
|
-
baseApiParams;
|
|
16
|
-
badResponse;
|
|
17
|
-
toQueryString;
|
|
18
|
-
constructor(config) {
|
|
19
|
-
this.config = config ?? {};
|
|
20
|
-
this.badResponse = null;
|
|
21
|
-
this.meta = config?.meta ?? null;
|
|
22
|
-
this.fetch =
|
|
23
|
-
config?.fetch ??
|
|
24
|
-
((...fetchParams) => globalThis.fetch(...fetchParams));
|
|
25
|
-
this.toQueryString =
|
|
26
|
-
config?.toQueryString ??
|
|
27
|
-
((query) => stringify(query, config?.queryStringifyOptions));
|
|
28
|
-
this.baseApiParams = {
|
|
29
|
-
credentials: 'same-origin',
|
|
30
|
-
headers: {},
|
|
31
|
-
redirect: 'follow',
|
|
32
|
-
referrerPolicy: 'no-referrer',
|
|
33
|
-
};
|
|
34
|
-
this.updateConfig(this.config);
|
|
35
|
-
observable.ref(this, 'badResponse');
|
|
36
|
-
observable.ref(this, 'meta');
|
|
37
|
-
action(this, 'setMeta');
|
|
38
|
-
action(this, 'setBadResponse');
|
|
39
|
-
makeObservable(this);
|
|
40
|
-
}
|
|
41
|
-
get baseUrl() {
|
|
42
|
-
return this.config.baseUrl ?? '';
|
|
43
|
-
}
|
|
44
|
-
updateConfig(update) {
|
|
45
|
-
Object.assign(this.config, update);
|
|
46
|
-
if (update.baseApiParams) {
|
|
47
|
-
Object.assign(this.baseApiParams, update.baseApiParams);
|
|
48
|
-
}
|
|
49
|
-
if (update.contentFormatters) {
|
|
50
|
-
Object.assign(this.contentFormatters, update.contentFormatters);
|
|
51
|
-
}
|
|
52
|
-
if (update.fetch) {
|
|
53
|
-
this.fetch = update.fetch;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
setMeta = (data) => {
|
|
57
|
-
this.meta = data;
|
|
58
|
-
};
|
|
59
|
-
setBadResponse = (response) => {
|
|
60
|
-
this.badResponse = response;
|
|
61
|
-
};
|
|
62
|
-
contentFormatters = {
|
|
63
|
-
'application/json': (input) => input !== null && (typeof input === 'object' || typeof input === 'string')
|
|
64
|
-
? JSON.stringify(input)
|
|
65
|
-
: input,
|
|
66
|
-
'text/plain': (input) => input !== null && typeof input !== 'string'
|
|
67
|
-
? JSON.stringify(input)
|
|
68
|
-
: input,
|
|
69
|
-
'multipart/form-data': (input) => Object.keys(input || {}).reduce((formData, key) => {
|
|
70
|
-
const property = input[key];
|
|
71
|
-
if (property instanceof Blob) {
|
|
72
|
-
formData.append(key, property);
|
|
73
|
-
}
|
|
74
|
-
else if (typeof property === 'object' && property !== null) {
|
|
75
|
-
formData.append(key, JSON.stringify(property));
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
formData.append(key, `${property}`);
|
|
79
|
-
}
|
|
80
|
-
return formData;
|
|
81
|
-
}, new FormData()),
|
|
82
|
-
'application/x-www-form-urlencoded': (input) => this.toQueryString(input),
|
|
83
|
-
'application/octet-stream': (input) => input,
|
|
84
|
-
};
|
|
85
|
-
mergeRequestParams(params1, params2) {
|
|
86
|
-
return {
|
|
87
|
-
...this.baseApiParams,
|
|
88
|
-
...params1,
|
|
89
|
-
...params2,
|
|
90
|
-
headers: {
|
|
91
|
-
...this.baseApiParams.headers,
|
|
92
|
-
...params1.headers,
|
|
93
|
-
...params2?.headers,
|
|
94
|
-
},
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
async createResponse(responseFormat, raw, url, params) {
|
|
98
|
-
const response = raw;
|
|
99
|
-
response.request = {
|
|
100
|
-
url,
|
|
101
|
-
params,
|
|
102
|
-
};
|
|
103
|
-
response.data = null;
|
|
104
|
-
response.error = null;
|
|
105
|
-
if (responseFormat) {
|
|
106
|
-
try {
|
|
107
|
-
const formatted = await response[responseFormat]();
|
|
108
|
-
if (response.ok) {
|
|
109
|
-
response.data = formatted;
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
response.error = formatted;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
catch (error) {
|
|
116
|
-
if (response.ok) {
|
|
117
|
-
response.error = error;
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
response.error = null;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
if (!response.ok || response.error) {
|
|
125
|
-
this.setBadResponse(response);
|
|
126
|
-
}
|
|
127
|
-
return response;
|
|
128
|
-
}
|
|
129
|
-
buildUrl = (params) => {
|
|
130
|
-
const baseUrl = params.baseUrl ?? this.baseUrl ?? '';
|
|
131
|
-
const path = params.path;
|
|
132
|
-
const queryString = params.query && this.toQueryString(params.query);
|
|
133
|
-
const query = queryString ? `?${queryString}` : '';
|
|
134
|
-
if (this.config.buildUrl) {
|
|
135
|
-
return this.config.buildUrl(params, { baseUrl, path, query }, this.meta);
|
|
136
|
-
}
|
|
137
|
-
const url = baseUrl + path + query;
|
|
138
|
-
return url;
|
|
139
|
-
};
|
|
140
|
-
async request(fullParams, endpoint) {
|
|
141
|
-
this.setBadResponse(null);
|
|
142
|
-
const { body, contentType = 'application/json', format = 'json', ...params } = fullParams;
|
|
143
|
-
let requestParams = this.mergeRequestParams(params);
|
|
144
|
-
if (this.config.interceptor) {
|
|
145
|
-
requestParams =
|
|
146
|
-
(await this.config.interceptor(requestParams, this.meta, endpoint)) ??
|
|
147
|
-
requestParams;
|
|
148
|
-
}
|
|
149
|
-
const payloadFormatter = this.contentFormatters[contentType];
|
|
150
|
-
const responseFormat = format || requestParams.format;
|
|
151
|
-
const url = this.buildUrl(fullParams);
|
|
152
|
-
let headers;
|
|
153
|
-
if (requestParams.headers instanceof Headers) {
|
|
154
|
-
headers = requestParams.headers;
|
|
155
|
-
}
|
|
156
|
-
else if (Array.isArray(requestParams.headers)) {
|
|
157
|
-
headers = new Headers(requestParams.headers);
|
|
158
|
-
}
|
|
159
|
-
else {
|
|
160
|
-
headers = new Headers(requestParams.headers);
|
|
161
|
-
}
|
|
162
|
-
if (!headers.has('Content-Type')) {
|
|
163
|
-
headers.set('Content-Type', contentType);
|
|
164
|
-
}
|
|
165
|
-
const fetchUrl = url;
|
|
166
|
-
const fetchParams = {
|
|
167
|
-
...requestParams,
|
|
168
|
-
headers,
|
|
169
|
-
body: body == null ? null : payloadFormatter(body),
|
|
170
|
-
};
|
|
171
|
-
let response;
|
|
172
|
-
try {
|
|
173
|
-
response = await this.fetch(fetchUrl, fetchParams);
|
|
174
|
-
}
|
|
175
|
-
catch (error) {
|
|
176
|
-
response = error;
|
|
177
|
-
}
|
|
178
|
-
const httpResponse = await this.createResponse(responseFormat, response, fetchUrl, fetchParams);
|
|
179
|
-
if (!httpResponse.ok || httpResponse.error) {
|
|
180
|
-
throw httpResponse;
|
|
181
|
-
}
|
|
182
|
-
return httpResponse;
|
|
183
|
-
}
|
|
184
|
-
}
|
package/runtime/index.cjs
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./endpoint.cjs"), exports);
|
|
18
|
-
__exportStar(require("./endpoint.types.cjs"), exports);
|
|
19
|
-
__exportStar(require("./endpoint-mutation.cjs"), exports);
|
|
20
|
-
__exportStar(require("./endpoint-mutation.types.cjs"), exports);
|
|
21
|
-
__exportStar(require("./endpoint-query.cjs"), exports);
|
|
22
|
-
__exportStar(require("./endpoint-query.types.cjs"), exports);
|
|
23
|
-
__exportStar(require("./endpoint-query-client.cjs"), exports);
|
|
24
|
-
__exportStar(require("./endpoint-query-client.types.cjs"), exports);
|
|
25
|
-
__exportStar(require("./http-client.cjs"), exports);
|
package/runtime/index.d.cts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * from "./endpoint.cjs";
|
|
2
|
-
export * from "./endpoint.types.cjs";
|
|
3
|
-
export * from "./endpoint-mutation.cjs";
|
|
4
|
-
export * from "./endpoint-mutation.types.cjs";
|
|
5
|
-
export * from "./endpoint-query.cjs";
|
|
6
|
-
export * from "./endpoint-query.types.cjs";
|
|
7
|
-
export * from "./endpoint-query-client.cjs";
|
|
8
|
-
export * from "./endpoint-query-client.types.cjs";
|
|
9
|
-
export * from "./http-client.cjs";
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
package/runtime/index.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,+BAA8B;AAC9B,qCAAoC;AACpC,wCAAuC;AACvC,8CAA6C;AAC7C,qCAAoC;AACpC,2CAA0C;AAC1C,4CAA2C;AAC3C,kDAAiD;AACjD,kCAAiC"}
|
package/runtime/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * from "./endpoint.js";
|
|
2
|
-
export * from "./endpoint.types.js";
|
|
3
|
-
export * from "./endpoint-mutation.js";
|
|
4
|
-
export * from "./endpoint-mutation.types.js";
|
|
5
|
-
export * from "./endpoint-query.js";
|
|
6
|
-
export * from "./endpoint-query.types.js";
|
|
7
|
-
export * from "./endpoint-query-client.js";
|
|
8
|
-
export * from "./endpoint-query-client.types.js";
|
|
9
|
-
export * from "./http-client.js";
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
package/runtime/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,oCAAoC;AACpC,uCAAuC;AACvC,6CAA6C;AAC7C,oCAAoC;AACpC,0CAA0C;AAC1C,2CAA2C;AAC3C,iDAAiD;AACjD,iCAAiC"}
|
package/runtime/index.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from "./endpoint.js";
|
|
2
|
-
export * from "./endpoint.types.js";
|
|
3
|
-
export * from "./endpoint-mutation.js";
|
|
4
|
-
export * from "./endpoint-mutation.types.js";
|
|
5
|
-
export * from "./endpoint-query.js";
|
|
6
|
-
export * from "./endpoint-query.types.js";
|
|
7
|
-
export * from "./endpoint-query-client.js";
|
|
8
|
-
export * from "./endpoint-query-client.types.js";
|
|
9
|
-
export * from "./http-client.js";
|