@eudiplo/sdk-core 4.1.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 +91 -103
- package/dist/api/client/client.gen.mjs +91 -103
- package/dist/api/client/index.d.mts +1 -1
- package/dist/api/client/index.d.ts +1 -1
- package/dist/api/client/index.js +91 -103
- package/dist/api/client/index.mjs +91 -103
- 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 +2 -2
- package/dist/api/client.gen.d.ts +2 -2
- package/dist/api/client.gen.js +91 -103
- package/dist/api/client.gen.mjs +91 -103
- package/dist/api/index.d.mts +25 -5
- package/dist/api/index.d.ts +25 -5
- package/dist/api/index.js +129 -103
- package/dist/api/index.mjs +125 -104
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +129 -103
- package/dist/index.mjs +125 -104
- package/dist/{types.gen-CVLCgolx.d.mts → types.gen-5zlqZUfP.d.mts} +158 -34
- package/dist/{types.gen-CVLCgolx.d.ts → types.gen-5zlqZUfP.d.ts} +158 -34
- package/dist/{types.gen-CVkHMB8b.d.mts → types.gen-DKrNRB-E.d.mts} +9 -3
- package/dist/{types.gen-CVkHMB8b.d.ts → types.gen-DKrNRB-E.d.ts} +9 -3
- package/package.json +2 -2
package/dist/api/client/index.js
CHANGED
|
@@ -864,132 +864,121 @@ var createClient = (config = {}) => {
|
|
|
864
864
|
return { opts: resolvedOpts, url };
|
|
865
865
|
};
|
|
866
866
|
const request = async (options) => {
|
|
867
|
-
const
|
|
868
|
-
const
|
|
869
|
-
|
|
870
|
-
...opts,
|
|
871
|
-
body: getValidRequestBody(opts)
|
|
872
|
-
};
|
|
873
|
-
let request2 = new Request(url, requestInit);
|
|
874
|
-
for (const fn of interceptors.request.fns) {
|
|
875
|
-
if (fn) {
|
|
876
|
-
request2 = await fn(request2, opts);
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
const _fetch = opts.fetch;
|
|
867
|
+
const throwOnError = options.throwOnError ?? _config.throwOnError;
|
|
868
|
+
const responseStyle = options.responseStyle ?? _config.responseStyle;
|
|
869
|
+
let request2;
|
|
880
870
|
let response;
|
|
881
871
|
try {
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
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) {
|
|
886
880
|
if (fn) {
|
|
887
|
-
|
|
888
|
-
error2,
|
|
889
|
-
void 0,
|
|
890
|
-
request2,
|
|
891
|
-
opts
|
|
892
|
-
);
|
|
881
|
+
request2 = await fn(request2, opts);
|
|
893
882
|
}
|
|
894
883
|
}
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
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
|
+
}
|
|
898
890
|
}
|
|
899
|
-
|
|
900
|
-
error: finalError2,
|
|
891
|
+
const result = {
|
|
901
892
|
request: request2,
|
|
902
|
-
response
|
|
893
|
+
response
|
|
903
894
|
};
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
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;
|
|
918
922
|
switch (parseAs) {
|
|
919
923
|
case "arrayBuffer":
|
|
920
924
|
case "blob":
|
|
925
|
+
case "formData":
|
|
921
926
|
case "text":
|
|
922
|
-
|
|
927
|
+
data = await response[parseAs]();
|
|
923
928
|
break;
|
|
924
|
-
case "
|
|
925
|
-
|
|
929
|
+
case "json": {
|
|
930
|
+
const text = await response.text();
|
|
931
|
+
data = text ? JSON.parse(text) : {};
|
|
926
932
|
break;
|
|
933
|
+
}
|
|
927
934
|
case "stream":
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
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
|
+
}
|
|
934
947
|
}
|
|
935
|
-
return opts.responseStyle === "data" ?
|
|
936
|
-
data
|
|
948
|
+
return opts.responseStyle === "data" ? data : {
|
|
949
|
+
data,
|
|
937
950
|
...result
|
|
938
951
|
};
|
|
939
952
|
}
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
case "text":
|
|
946
|
-
data = await response[parseAs]();
|
|
947
|
-
break;
|
|
948
|
-
case "json": {
|
|
949
|
-
const text = await response.text();
|
|
950
|
-
data = text ? JSON.parse(text) : {};
|
|
951
|
-
break;
|
|
952
|
-
}
|
|
953
|
-
case "stream":
|
|
954
|
-
return opts.responseStyle === "data" ? response.body : {
|
|
955
|
-
data: response.body,
|
|
956
|
-
...result
|
|
957
|
-
};
|
|
953
|
+
const textError = await response.text();
|
|
954
|
+
let jsonError;
|
|
955
|
+
try {
|
|
956
|
+
jsonError = JSON.parse(textError);
|
|
957
|
+
} catch {
|
|
958
958
|
}
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
if (
|
|
964
|
-
|
|
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
|
+
);
|
|
965
970
|
}
|
|
966
971
|
}
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
};
|
|
971
|
-
}
|
|
972
|
-
const textError = await response.text();
|
|
973
|
-
let jsonError;
|
|
974
|
-
try {
|
|
975
|
-
jsonError = JSON.parse(textError);
|
|
976
|
-
} catch {
|
|
977
|
-
}
|
|
978
|
-
const error = jsonError ?? textError;
|
|
979
|
-
let finalError = error;
|
|
980
|
-
for (const fn of interceptors.error.fns) {
|
|
981
|
-
if (fn) {
|
|
982
|
-
finalError = await fn(error, response, request2, opts);
|
|
972
|
+
finalError = finalError || {};
|
|
973
|
+
if (throwOnError) {
|
|
974
|
+
throw finalError;
|
|
983
975
|
}
|
|
976
|
+
return responseStyle === "data" ? void 0 : {
|
|
977
|
+
error: finalError,
|
|
978
|
+
request: request2,
|
|
979
|
+
response
|
|
980
|
+
};
|
|
984
981
|
}
|
|
985
|
-
finalError = finalError || {};
|
|
986
|
-
if (opts.throwOnError) {
|
|
987
|
-
throw finalError;
|
|
988
|
-
}
|
|
989
|
-
return opts.responseStyle === "data" ? void 0 : {
|
|
990
|
-
error: finalError,
|
|
991
|
-
...result
|
|
992
|
-
};
|
|
993
982
|
};
|
|
994
983
|
const makeMethodFn = (method) => (options) => request({ ...options, method });
|
|
995
984
|
const makeSseFn = (method) => async (options) => {
|
|
@@ -997,7 +986,6 @@ var createClient = (config = {}) => {
|
|
|
997
986
|
return createSseClient({
|
|
998
987
|
...opts,
|
|
999
988
|
body: opts.body,
|
|
1000
|
-
headers: opts.headers,
|
|
1001
989
|
method,
|
|
1002
990
|
onRequest: async (url2, init) => {
|
|
1003
991
|
let request2 = new Request(url2, init);
|
|
@@ -862,132 +862,121 @@ var createClient = (config = {}) => {
|
|
|
862
862
|
return { opts: resolvedOpts, url };
|
|
863
863
|
};
|
|
864
864
|
const request = async (options) => {
|
|
865
|
-
const
|
|
866
|
-
const
|
|
867
|
-
|
|
868
|
-
...opts,
|
|
869
|
-
body: getValidRequestBody(opts)
|
|
870
|
-
};
|
|
871
|
-
let request2 = new Request(url, requestInit);
|
|
872
|
-
for (const fn of interceptors.request.fns) {
|
|
873
|
-
if (fn) {
|
|
874
|
-
request2 = await fn(request2, opts);
|
|
875
|
-
}
|
|
876
|
-
}
|
|
877
|
-
const _fetch = opts.fetch;
|
|
865
|
+
const throwOnError = options.throwOnError ?? _config.throwOnError;
|
|
866
|
+
const responseStyle = options.responseStyle ?? _config.responseStyle;
|
|
867
|
+
let request2;
|
|
878
868
|
let response;
|
|
879
869
|
try {
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
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) {
|
|
884
878
|
if (fn) {
|
|
885
|
-
|
|
886
|
-
error2,
|
|
887
|
-
void 0,
|
|
888
|
-
request2,
|
|
889
|
-
opts
|
|
890
|
-
);
|
|
879
|
+
request2 = await fn(request2, opts);
|
|
891
880
|
}
|
|
892
881
|
}
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
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
|
+
}
|
|
896
888
|
}
|
|
897
|
-
|
|
898
|
-
error: finalError2,
|
|
889
|
+
const result = {
|
|
899
890
|
request: request2,
|
|
900
|
-
response
|
|
891
|
+
response
|
|
901
892
|
};
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
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;
|
|
916
920
|
switch (parseAs) {
|
|
917
921
|
case "arrayBuffer":
|
|
918
922
|
case "blob":
|
|
923
|
+
case "formData":
|
|
919
924
|
case "text":
|
|
920
|
-
|
|
925
|
+
data = await response[parseAs]();
|
|
921
926
|
break;
|
|
922
|
-
case "
|
|
923
|
-
|
|
927
|
+
case "json": {
|
|
928
|
+
const text = await response.text();
|
|
929
|
+
data = text ? JSON.parse(text) : {};
|
|
924
930
|
break;
|
|
931
|
+
}
|
|
925
932
|
case "stream":
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
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
|
+
}
|
|
932
945
|
}
|
|
933
|
-
return opts.responseStyle === "data" ?
|
|
934
|
-
data
|
|
946
|
+
return opts.responseStyle === "data" ? data : {
|
|
947
|
+
data,
|
|
935
948
|
...result
|
|
936
949
|
};
|
|
937
950
|
}
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
case "text":
|
|
944
|
-
data = await response[parseAs]();
|
|
945
|
-
break;
|
|
946
|
-
case "json": {
|
|
947
|
-
const text = await response.text();
|
|
948
|
-
data = text ? JSON.parse(text) : {};
|
|
949
|
-
break;
|
|
950
|
-
}
|
|
951
|
-
case "stream":
|
|
952
|
-
return opts.responseStyle === "data" ? response.body : {
|
|
953
|
-
data: response.body,
|
|
954
|
-
...result
|
|
955
|
-
};
|
|
951
|
+
const textError = await response.text();
|
|
952
|
+
let jsonError;
|
|
953
|
+
try {
|
|
954
|
+
jsonError = JSON.parse(textError);
|
|
955
|
+
} catch {
|
|
956
956
|
}
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
if (
|
|
962
|
-
|
|
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
|
+
);
|
|
963
968
|
}
|
|
964
969
|
}
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
};
|
|
969
|
-
}
|
|
970
|
-
const textError = await response.text();
|
|
971
|
-
let jsonError;
|
|
972
|
-
try {
|
|
973
|
-
jsonError = JSON.parse(textError);
|
|
974
|
-
} catch {
|
|
975
|
-
}
|
|
976
|
-
const error = jsonError ?? textError;
|
|
977
|
-
let finalError = error;
|
|
978
|
-
for (const fn of interceptors.error.fns) {
|
|
979
|
-
if (fn) {
|
|
980
|
-
finalError = await fn(error, response, request2, opts);
|
|
970
|
+
finalError = finalError || {};
|
|
971
|
+
if (throwOnError) {
|
|
972
|
+
throw finalError;
|
|
981
973
|
}
|
|
974
|
+
return responseStyle === "data" ? void 0 : {
|
|
975
|
+
error: finalError,
|
|
976
|
+
request: request2,
|
|
977
|
+
response
|
|
978
|
+
};
|
|
982
979
|
}
|
|
983
|
-
finalError = finalError || {};
|
|
984
|
-
if (opts.throwOnError) {
|
|
985
|
-
throw finalError;
|
|
986
|
-
}
|
|
987
|
-
return opts.responseStyle === "data" ? void 0 : {
|
|
988
|
-
error: finalError,
|
|
989
|
-
...result
|
|
990
|
-
};
|
|
991
980
|
};
|
|
992
981
|
const makeMethodFn = (method) => (options) => request({ ...options, method });
|
|
993
982
|
const makeSseFn = (method) => async (options) => {
|
|
@@ -995,7 +984,6 @@ var createClient = (config = {}) => {
|
|
|
995
984
|
return createSseClient({
|
|
996
985
|
...opts,
|
|
997
986
|
body: opts.body,
|
|
998
|
-
headers: opts.headers,
|
|
999
987
|
method,
|
|
1000
988
|
onRequest: async (url2, init) => {
|
|
1001
989
|
let request2 = new Request(url2, init);
|
|
@@ -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 { ai as ClientOptions$1 } from '../types.gen-
|
|
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
|
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 { ai as ClientOptions$1 } from '../types.gen-
|
|
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
|