@eudiplo/sdk-core 4.0.0 → 4.2.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/dist/api/client/client.gen.d.mts +1 -1
- package/dist/api/client/client.gen.d.ts +1 -1
- package/dist/api/client/client.gen.js +100 -110
- package/dist/api/client/client.gen.mjs +100 -110
- package/dist/api/client/index.d.mts +1 -1
- package/dist/api/client/index.d.ts +1 -1
- package/dist/api/client/index.js +100 -110
- package/dist/api/client/index.mjs +100 -110
- package/dist/api/client/types.gen.d.mts +1 -1
- package/dist/api/client/types.gen.d.ts +1 -1
- package/dist/api/client.gen.d.mts +3 -3
- package/dist/api/client.gen.d.ts +3 -3
- package/dist/api/client.gen.js +100 -110
- package/dist/api/client.gen.mjs +100 -110
- package/dist/api/index.d.mts +58 -22
- package/dist/api/index.d.ts +58 -22
- package/dist/api/index.js +182 -132
- package/dist/api/index.mjs +175 -133
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +182 -132
- package/dist/index.mjs +175 -133
- package/dist/{types.gen-sNmRQvUI.d.mts → types.gen-5zlqZUfP.d.mts} +632 -235
- package/dist/{types.gen-sNmRQvUI.d.ts → types.gen-5zlqZUfP.d.ts} +632 -235
- package/dist/{types.gen-D8LjzWc0.d.mts → types.gen-DKrNRB-E.d.mts} +17 -10
- package/dist/{types.gen-D8LjzWc0.d.ts → types.gen-DKrNRB-E.d.ts} +17 -10
- package/package.json +2 -2
package/dist/api/client/index.js
CHANGED
|
@@ -231,7 +231,7 @@ var serializeQueryKeyValue = (value) => {
|
|
|
231
231
|
};
|
|
232
232
|
|
|
233
233
|
// src/api/core/serverSentEvents.gen.ts
|
|
234
|
-
|
|
234
|
+
function createSseClient({
|
|
235
235
|
onRequest,
|
|
236
236
|
onSseError,
|
|
237
237
|
onSseEvent,
|
|
@@ -243,7 +243,7 @@ var createSseClient = ({
|
|
|
243
243
|
sseSleepFn,
|
|
244
244
|
url,
|
|
245
245
|
...options
|
|
246
|
-
})
|
|
246
|
+
}) {
|
|
247
247
|
let lastEventId;
|
|
248
248
|
const sleep = sseSleepFn ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
249
249
|
const createStream = async function* () {
|
|
@@ -290,7 +290,7 @@ var createSseClient = ({
|
|
|
290
290
|
const { done, value } = await reader.read();
|
|
291
291
|
if (done) break;
|
|
292
292
|
buffer += value;
|
|
293
|
-
buffer = buffer.replace(/\r\n
|
|
293
|
+
buffer = buffer.replace(/\r\n?/g, "\n");
|
|
294
294
|
const chunks = buffer.split("\n\n");
|
|
295
295
|
buffer = chunks.pop() ?? "";
|
|
296
296
|
for (const chunk of chunks) {
|
|
@@ -364,7 +364,7 @@ var createSseClient = ({
|
|
|
364
364
|
};
|
|
365
365
|
const stream = createStream();
|
|
366
366
|
return { stream };
|
|
367
|
-
}
|
|
367
|
+
}
|
|
368
368
|
|
|
369
369
|
// src/api/core/pathSerializer.gen.ts
|
|
370
370
|
var separatorArrayExplode = (style) => {
|
|
@@ -859,136 +859,126 @@ var createClient = (config = {}) => {
|
|
|
859
859
|
if (opts.body === void 0 || opts.serializedBody === "") {
|
|
860
860
|
opts.headers.delete("Content-Type");
|
|
861
861
|
}
|
|
862
|
-
const
|
|
863
|
-
|
|
862
|
+
const resolvedOpts = opts;
|
|
863
|
+
const url = buildUrl(resolvedOpts);
|
|
864
|
+
return { opts: resolvedOpts, url };
|
|
864
865
|
};
|
|
865
866
|
const request = async (options) => {
|
|
866
|
-
const
|
|
867
|
-
const
|
|
868
|
-
|
|
869
|
-
...opts,
|
|
870
|
-
body: getValidRequestBody(opts)
|
|
871
|
-
};
|
|
872
|
-
let request2 = new Request(url, requestInit);
|
|
873
|
-
for (const fn of interceptors.request.fns) {
|
|
874
|
-
if (fn) {
|
|
875
|
-
request2 = await fn(request2, opts);
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
const _fetch = opts.fetch;
|
|
867
|
+
const throwOnError = options.throwOnError ?? _config.throwOnError;
|
|
868
|
+
const responseStyle = options.responseStyle ?? _config.responseStyle;
|
|
869
|
+
let request2;
|
|
879
870
|
let response;
|
|
880
871
|
try {
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
872
|
+
const { opts, url } = await beforeRequest(options);
|
|
873
|
+
const requestInit = {
|
|
874
|
+
redirect: "follow",
|
|
875
|
+
...opts,
|
|
876
|
+
body: getValidRequestBody(opts)
|
|
877
|
+
};
|
|
878
|
+
request2 = new Request(url, requestInit);
|
|
879
|
+
for (const fn of interceptors.request.fns) {
|
|
885
880
|
if (fn) {
|
|
886
|
-
|
|
887
|
-
error2,
|
|
888
|
-
void 0,
|
|
889
|
-
request2,
|
|
890
|
-
opts
|
|
891
|
-
);
|
|
881
|
+
request2 = await fn(request2, opts);
|
|
892
882
|
}
|
|
893
883
|
}
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
884
|
+
const _fetch = opts.fetch;
|
|
885
|
+
response = await _fetch(request2);
|
|
886
|
+
for (const fn of interceptors.response.fns) {
|
|
887
|
+
if (fn) {
|
|
888
|
+
response = await fn(response, request2, opts);
|
|
889
|
+
}
|
|
897
890
|
}
|
|
898
|
-
|
|
899
|
-
error: finalError2,
|
|
891
|
+
const result = {
|
|
900
892
|
request: request2,
|
|
901
|
-
response
|
|
893
|
+
response
|
|
902
894
|
};
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
895
|
+
if (response.ok) {
|
|
896
|
+
const parseAs = (opts.parseAs === "auto" ? getParseAs(response.headers.get("Content-Type")) : opts.parseAs) ?? "json";
|
|
897
|
+
if (response.status === 204 || response.headers.get("Content-Length") === "0") {
|
|
898
|
+
let emptyData;
|
|
899
|
+
switch (parseAs) {
|
|
900
|
+
case "arrayBuffer":
|
|
901
|
+
case "blob":
|
|
902
|
+
case "text":
|
|
903
|
+
emptyData = await response[parseAs]();
|
|
904
|
+
break;
|
|
905
|
+
case "formData":
|
|
906
|
+
emptyData = new FormData();
|
|
907
|
+
break;
|
|
908
|
+
case "stream":
|
|
909
|
+
emptyData = response.body;
|
|
910
|
+
break;
|
|
911
|
+
case "json":
|
|
912
|
+
default:
|
|
913
|
+
emptyData = {};
|
|
914
|
+
break;
|
|
915
|
+
}
|
|
916
|
+
return opts.responseStyle === "data" ? emptyData : {
|
|
917
|
+
data: emptyData,
|
|
918
|
+
...result
|
|
919
|
+
};
|
|
920
|
+
}
|
|
921
|
+
let data;
|
|
917
922
|
switch (parseAs) {
|
|
918
923
|
case "arrayBuffer":
|
|
919
924
|
case "blob":
|
|
925
|
+
case "formData":
|
|
920
926
|
case "text":
|
|
921
|
-
|
|
927
|
+
data = await response[parseAs]();
|
|
922
928
|
break;
|
|
923
|
-
case "
|
|
924
|
-
|
|
929
|
+
case "json": {
|
|
930
|
+
const text = await response.text();
|
|
931
|
+
data = text ? JSON.parse(text) : {};
|
|
925
932
|
break;
|
|
933
|
+
}
|
|
926
934
|
case "stream":
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
935
|
+
return opts.responseStyle === "data" ? response.body : {
|
|
936
|
+
data: response.body,
|
|
937
|
+
...result
|
|
938
|
+
};
|
|
939
|
+
}
|
|
940
|
+
if (parseAs === "json") {
|
|
941
|
+
if (opts.responseValidator) {
|
|
942
|
+
await opts.responseValidator(data);
|
|
943
|
+
}
|
|
944
|
+
if (opts.responseTransformer) {
|
|
945
|
+
data = await opts.responseTransformer(data);
|
|
946
|
+
}
|
|
933
947
|
}
|
|
934
|
-
return opts.responseStyle === "data" ?
|
|
935
|
-
data
|
|
948
|
+
return opts.responseStyle === "data" ? data : {
|
|
949
|
+
data,
|
|
936
950
|
...result
|
|
937
951
|
};
|
|
938
952
|
}
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
case "text":
|
|
945
|
-
data = await response[parseAs]();
|
|
946
|
-
break;
|
|
947
|
-
case "json": {
|
|
948
|
-
const text = await response.text();
|
|
949
|
-
data = text ? JSON.parse(text) : {};
|
|
950
|
-
break;
|
|
951
|
-
}
|
|
952
|
-
case "stream":
|
|
953
|
-
return opts.responseStyle === "data" ? response.body : {
|
|
954
|
-
data: response.body,
|
|
955
|
-
...result
|
|
956
|
-
};
|
|
953
|
+
const textError = await response.text();
|
|
954
|
+
let jsonError;
|
|
955
|
+
try {
|
|
956
|
+
jsonError = JSON.parse(textError);
|
|
957
|
+
} catch {
|
|
957
958
|
}
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
if (
|
|
963
|
-
|
|
959
|
+
throw jsonError ?? textError;
|
|
960
|
+
} catch (error) {
|
|
961
|
+
let finalError = error;
|
|
962
|
+
for (const fn of interceptors.error.fns) {
|
|
963
|
+
if (fn) {
|
|
964
|
+
finalError = await fn(
|
|
965
|
+
finalError,
|
|
966
|
+
response,
|
|
967
|
+
request2,
|
|
968
|
+
options
|
|
969
|
+
);
|
|
964
970
|
}
|
|
965
971
|
}
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
};
|
|
970
|
-
}
|
|
971
|
-
const textError = await response.text();
|
|
972
|
-
let jsonError;
|
|
973
|
-
try {
|
|
974
|
-
jsonError = JSON.parse(textError);
|
|
975
|
-
} catch {
|
|
976
|
-
}
|
|
977
|
-
const error = jsonError ?? textError;
|
|
978
|
-
let finalError = error;
|
|
979
|
-
for (const fn of interceptors.error.fns) {
|
|
980
|
-
if (fn) {
|
|
981
|
-
finalError = await fn(error, response, request2, opts);
|
|
972
|
+
finalError = finalError || {};
|
|
973
|
+
if (throwOnError) {
|
|
974
|
+
throw finalError;
|
|
982
975
|
}
|
|
976
|
+
return responseStyle === "data" ? void 0 : {
|
|
977
|
+
error: finalError,
|
|
978
|
+
request: request2,
|
|
979
|
+
response
|
|
980
|
+
};
|
|
983
981
|
}
|
|
984
|
-
finalError = finalError || {};
|
|
985
|
-
if (opts.throwOnError) {
|
|
986
|
-
throw finalError;
|
|
987
|
-
}
|
|
988
|
-
return opts.responseStyle === "data" ? void 0 : {
|
|
989
|
-
error: finalError,
|
|
990
|
-
...result
|
|
991
|
-
};
|
|
992
982
|
};
|
|
993
983
|
const makeMethodFn = (method) => (options) => request({ ...options, method });
|
|
994
984
|
const makeSseFn = (method) => async (options) => {
|
|
@@ -996,7 +986,6 @@ var createClient = (config = {}) => {
|
|
|
996
986
|
return createSseClient({
|
|
997
987
|
...opts,
|
|
998
988
|
body: opts.body,
|
|
999
|
-
headers: opts.headers,
|
|
1000
989
|
method,
|
|
1001
990
|
onRequest: async (url2, init) => {
|
|
1002
991
|
let request2 = new Request(url2, init);
|
|
@@ -1011,8 +1000,9 @@ var createClient = (config = {}) => {
|
|
|
1011
1000
|
url
|
|
1012
1001
|
});
|
|
1013
1002
|
};
|
|
1003
|
+
const _buildUrl = (options) => buildUrl({ ..._config, ...options });
|
|
1014
1004
|
return {
|
|
1015
|
-
buildUrl,
|
|
1005
|
+
buildUrl: _buildUrl,
|
|
1016
1006
|
connect: makeMethodFn("CONNECT"),
|
|
1017
1007
|
delete: makeMethodFn("DELETE"),
|
|
1018
1008
|
get: makeMethodFn("GET"),
|
|
@@ -229,7 +229,7 @@ var serializeQueryKeyValue = (value) => {
|
|
|
229
229
|
};
|
|
230
230
|
|
|
231
231
|
// src/api/core/serverSentEvents.gen.ts
|
|
232
|
-
|
|
232
|
+
function createSseClient({
|
|
233
233
|
onRequest,
|
|
234
234
|
onSseError,
|
|
235
235
|
onSseEvent,
|
|
@@ -241,7 +241,7 @@ var createSseClient = ({
|
|
|
241
241
|
sseSleepFn,
|
|
242
242
|
url,
|
|
243
243
|
...options
|
|
244
|
-
})
|
|
244
|
+
}) {
|
|
245
245
|
let lastEventId;
|
|
246
246
|
const sleep = sseSleepFn ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
247
247
|
const createStream = async function* () {
|
|
@@ -288,7 +288,7 @@ var createSseClient = ({
|
|
|
288
288
|
const { done, value } = await reader.read();
|
|
289
289
|
if (done) break;
|
|
290
290
|
buffer += value;
|
|
291
|
-
buffer = buffer.replace(/\r\n
|
|
291
|
+
buffer = buffer.replace(/\r\n?/g, "\n");
|
|
292
292
|
const chunks = buffer.split("\n\n");
|
|
293
293
|
buffer = chunks.pop() ?? "";
|
|
294
294
|
for (const chunk of chunks) {
|
|
@@ -362,7 +362,7 @@ var createSseClient = ({
|
|
|
362
362
|
};
|
|
363
363
|
const stream = createStream();
|
|
364
364
|
return { stream };
|
|
365
|
-
}
|
|
365
|
+
}
|
|
366
366
|
|
|
367
367
|
// src/api/core/pathSerializer.gen.ts
|
|
368
368
|
var separatorArrayExplode = (style) => {
|
|
@@ -857,136 +857,126 @@ var createClient = (config = {}) => {
|
|
|
857
857
|
if (opts.body === void 0 || opts.serializedBody === "") {
|
|
858
858
|
opts.headers.delete("Content-Type");
|
|
859
859
|
}
|
|
860
|
-
const
|
|
861
|
-
|
|
860
|
+
const resolvedOpts = opts;
|
|
861
|
+
const url = buildUrl(resolvedOpts);
|
|
862
|
+
return { opts: resolvedOpts, url };
|
|
862
863
|
};
|
|
863
864
|
const request = async (options) => {
|
|
864
|
-
const
|
|
865
|
-
const
|
|
866
|
-
|
|
867
|
-
...opts,
|
|
868
|
-
body: getValidRequestBody(opts)
|
|
869
|
-
};
|
|
870
|
-
let request2 = new Request(url, requestInit);
|
|
871
|
-
for (const fn of interceptors.request.fns) {
|
|
872
|
-
if (fn) {
|
|
873
|
-
request2 = await fn(request2, opts);
|
|
874
|
-
}
|
|
875
|
-
}
|
|
876
|
-
const _fetch = opts.fetch;
|
|
865
|
+
const throwOnError = options.throwOnError ?? _config.throwOnError;
|
|
866
|
+
const responseStyle = options.responseStyle ?? _config.responseStyle;
|
|
867
|
+
let request2;
|
|
877
868
|
let response;
|
|
878
869
|
try {
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
870
|
+
const { opts, url } = await beforeRequest(options);
|
|
871
|
+
const requestInit = {
|
|
872
|
+
redirect: "follow",
|
|
873
|
+
...opts,
|
|
874
|
+
body: getValidRequestBody(opts)
|
|
875
|
+
};
|
|
876
|
+
request2 = new Request(url, requestInit);
|
|
877
|
+
for (const fn of interceptors.request.fns) {
|
|
883
878
|
if (fn) {
|
|
884
|
-
|
|
885
|
-
error2,
|
|
886
|
-
void 0,
|
|
887
|
-
request2,
|
|
888
|
-
opts
|
|
889
|
-
);
|
|
879
|
+
request2 = await fn(request2, opts);
|
|
890
880
|
}
|
|
891
881
|
}
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
882
|
+
const _fetch = opts.fetch;
|
|
883
|
+
response = await _fetch(request2);
|
|
884
|
+
for (const fn of interceptors.response.fns) {
|
|
885
|
+
if (fn) {
|
|
886
|
+
response = await fn(response, request2, opts);
|
|
887
|
+
}
|
|
895
888
|
}
|
|
896
|
-
|
|
897
|
-
error: finalError2,
|
|
889
|
+
const result = {
|
|
898
890
|
request: request2,
|
|
899
|
-
response
|
|
891
|
+
response
|
|
900
892
|
};
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
893
|
+
if (response.ok) {
|
|
894
|
+
const parseAs = (opts.parseAs === "auto" ? getParseAs(response.headers.get("Content-Type")) : opts.parseAs) ?? "json";
|
|
895
|
+
if (response.status === 204 || response.headers.get("Content-Length") === "0") {
|
|
896
|
+
let emptyData;
|
|
897
|
+
switch (parseAs) {
|
|
898
|
+
case "arrayBuffer":
|
|
899
|
+
case "blob":
|
|
900
|
+
case "text":
|
|
901
|
+
emptyData = await response[parseAs]();
|
|
902
|
+
break;
|
|
903
|
+
case "formData":
|
|
904
|
+
emptyData = new FormData();
|
|
905
|
+
break;
|
|
906
|
+
case "stream":
|
|
907
|
+
emptyData = response.body;
|
|
908
|
+
break;
|
|
909
|
+
case "json":
|
|
910
|
+
default:
|
|
911
|
+
emptyData = {};
|
|
912
|
+
break;
|
|
913
|
+
}
|
|
914
|
+
return opts.responseStyle === "data" ? emptyData : {
|
|
915
|
+
data: emptyData,
|
|
916
|
+
...result
|
|
917
|
+
};
|
|
918
|
+
}
|
|
919
|
+
let data;
|
|
915
920
|
switch (parseAs) {
|
|
916
921
|
case "arrayBuffer":
|
|
917
922
|
case "blob":
|
|
923
|
+
case "formData":
|
|
918
924
|
case "text":
|
|
919
|
-
|
|
925
|
+
data = await response[parseAs]();
|
|
920
926
|
break;
|
|
921
|
-
case "
|
|
922
|
-
|
|
927
|
+
case "json": {
|
|
928
|
+
const text = await response.text();
|
|
929
|
+
data = text ? JSON.parse(text) : {};
|
|
923
930
|
break;
|
|
931
|
+
}
|
|
924
932
|
case "stream":
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
933
|
+
return opts.responseStyle === "data" ? response.body : {
|
|
934
|
+
data: response.body,
|
|
935
|
+
...result
|
|
936
|
+
};
|
|
937
|
+
}
|
|
938
|
+
if (parseAs === "json") {
|
|
939
|
+
if (opts.responseValidator) {
|
|
940
|
+
await opts.responseValidator(data);
|
|
941
|
+
}
|
|
942
|
+
if (opts.responseTransformer) {
|
|
943
|
+
data = await opts.responseTransformer(data);
|
|
944
|
+
}
|
|
931
945
|
}
|
|
932
|
-
return opts.responseStyle === "data" ?
|
|
933
|
-
data
|
|
946
|
+
return opts.responseStyle === "data" ? data : {
|
|
947
|
+
data,
|
|
934
948
|
...result
|
|
935
949
|
};
|
|
936
950
|
}
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
case "text":
|
|
943
|
-
data = await response[parseAs]();
|
|
944
|
-
break;
|
|
945
|
-
case "json": {
|
|
946
|
-
const text = await response.text();
|
|
947
|
-
data = text ? JSON.parse(text) : {};
|
|
948
|
-
break;
|
|
949
|
-
}
|
|
950
|
-
case "stream":
|
|
951
|
-
return opts.responseStyle === "data" ? response.body : {
|
|
952
|
-
data: response.body,
|
|
953
|
-
...result
|
|
954
|
-
};
|
|
951
|
+
const textError = await response.text();
|
|
952
|
+
let jsonError;
|
|
953
|
+
try {
|
|
954
|
+
jsonError = JSON.parse(textError);
|
|
955
|
+
} catch {
|
|
955
956
|
}
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
if (
|
|
961
|
-
|
|
957
|
+
throw jsonError ?? textError;
|
|
958
|
+
} catch (error) {
|
|
959
|
+
let finalError = error;
|
|
960
|
+
for (const fn of interceptors.error.fns) {
|
|
961
|
+
if (fn) {
|
|
962
|
+
finalError = await fn(
|
|
963
|
+
finalError,
|
|
964
|
+
response,
|
|
965
|
+
request2,
|
|
966
|
+
options
|
|
967
|
+
);
|
|
962
968
|
}
|
|
963
969
|
}
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
};
|
|
968
|
-
}
|
|
969
|
-
const textError = await response.text();
|
|
970
|
-
let jsonError;
|
|
971
|
-
try {
|
|
972
|
-
jsonError = JSON.parse(textError);
|
|
973
|
-
} catch {
|
|
974
|
-
}
|
|
975
|
-
const error = jsonError ?? textError;
|
|
976
|
-
let finalError = error;
|
|
977
|
-
for (const fn of interceptors.error.fns) {
|
|
978
|
-
if (fn) {
|
|
979
|
-
finalError = await fn(error, response, request2, opts);
|
|
970
|
+
finalError = finalError || {};
|
|
971
|
+
if (throwOnError) {
|
|
972
|
+
throw finalError;
|
|
980
973
|
}
|
|
974
|
+
return responseStyle === "data" ? void 0 : {
|
|
975
|
+
error: finalError,
|
|
976
|
+
request: request2,
|
|
977
|
+
response
|
|
978
|
+
};
|
|
981
979
|
}
|
|
982
|
-
finalError = finalError || {};
|
|
983
|
-
if (opts.throwOnError) {
|
|
984
|
-
throw finalError;
|
|
985
|
-
}
|
|
986
|
-
return opts.responseStyle === "data" ? void 0 : {
|
|
987
|
-
error: finalError,
|
|
988
|
-
...result
|
|
989
|
-
};
|
|
990
980
|
};
|
|
991
981
|
const makeMethodFn = (method) => (options) => request({ ...options, method });
|
|
992
982
|
const makeSseFn = (method) => async (options) => {
|
|
@@ -994,7 +984,6 @@ var createClient = (config = {}) => {
|
|
|
994
984
|
return createSseClient({
|
|
995
985
|
...opts,
|
|
996
986
|
body: opts.body,
|
|
997
|
-
headers: opts.headers,
|
|
998
987
|
method,
|
|
999
988
|
onRequest: async (url2, init) => {
|
|
1000
989
|
let request2 = new Request(url2, init);
|
|
@@ -1009,8 +998,9 @@ var createClient = (config = {}) => {
|
|
|
1009
998
|
url
|
|
1010
999
|
});
|
|
1011
1000
|
};
|
|
1001
|
+
const _buildUrl = (options) => buildUrl({ ..._config, ...options });
|
|
1012
1002
|
return {
|
|
1013
|
-
buildUrl,
|
|
1003
|
+
buildUrl: _buildUrl,
|
|
1014
1004
|
connect: makeMethodFn("CONNECT"),
|
|
1015
1005
|
delete: makeMethodFn("DELETE"),
|
|
1016
1006
|
get: makeMethodFn("GET"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { C as Client, a as ClientOptions, b as Config, c as CreateClientConfig, O as Options, R as RequestOptions, d as RequestResult, e as ResolvedRequestOptions, f as ResponseStyle, T as TDataShape } from '../../types.gen-
|
|
1
|
+
export { C as Client, a as ClientOptions, b as Config, c as CreateClientConfig, O as Options, R as RequestOptions, d as RequestResult, e as ResolvedRequestOptions, f as ResponseStyle, T as TDataShape } from '../../types.gen-DKrNRB-E.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { C as Client, a as ClientOptions, b as Config, c as CreateClientConfig, O as Options, R as RequestOptions, d as RequestResult, e as ResolvedRequestOptions, f as ResponseStyle, T as TDataShape } from '../../types.gen-
|
|
1
|
+
export { C as Client, a as ClientOptions, b as Config, c as CreateClientConfig, O as Options, R as RequestOptions, d as RequestResult, e as ResolvedRequestOptions, f as ResponseStyle, T as TDataShape } from '../../types.gen-DKrNRB-E.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as Client, a as ClientOptions, b as Config } from '../types.gen-
|
|
2
|
-
import {
|
|
1
|
+
import { C as Client, a as ClientOptions, b as Config } from '../types.gen-DKrNRB-E.mjs';
|
|
2
|
+
import { ai as ClientOptions$1 } from '../types.gen-5zlqZUfP.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The `createClientConfig()` function will be called on client initialization
|
|
@@ -9,7 +9,7 @@ import { ae as ClientOptions$1 } from '../types.gen-sNmRQvUI.mjs';
|
|
|
9
9
|
* `setConfig()`. This is useful for example if you're using Next.js
|
|
10
10
|
* to ensure your client always has the correct values.
|
|
11
11
|
*/
|
|
12
|
-
type CreateClientConfig<T extends ClientOptions = ClientOptions$1> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T
|
|
12
|
+
type CreateClientConfig<T extends ClientOptions = ClientOptions$1> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
|
|
13
13
|
declare const client: Client;
|
|
14
14
|
|
|
15
15
|
export { type CreateClientConfig, client };
|
package/dist/api/client.gen.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as Client, a as ClientOptions, b as Config } from '../types.gen-
|
|
2
|
-
import {
|
|
1
|
+
import { C as Client, a as ClientOptions, b as Config } from '../types.gen-DKrNRB-E.js';
|
|
2
|
+
import { ai as ClientOptions$1 } from '../types.gen-5zlqZUfP.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The `createClientConfig()` function will be called on client initialization
|
|
@@ -9,7 +9,7 @@ import { ae as ClientOptions$1 } from '../types.gen-sNmRQvUI.js';
|
|
|
9
9
|
* `setConfig()`. This is useful for example if you're using Next.js
|
|
10
10
|
* to ensure your client always has the correct values.
|
|
11
11
|
*/
|
|
12
|
-
type CreateClientConfig<T extends ClientOptions = ClientOptions$1> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T
|
|
12
|
+
type CreateClientConfig<T extends ClientOptions = ClientOptions$1> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
|
|
13
13
|
declare const client: Client;
|
|
14
14
|
|
|
15
15
|
export { type CreateClientConfig, client };
|