@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/index.js CHANGED
@@ -34,7 +34,7 @@ var jsonBodySerializer = {
34
34
  };
35
35
 
36
36
  // src/api/core/serverSentEvents.gen.ts
37
- var createSseClient = ({
37
+ function createSseClient({
38
38
  onRequest,
39
39
  onSseError,
40
40
  onSseEvent,
@@ -46,7 +46,7 @@ var createSseClient = ({
46
46
  sseSleepFn,
47
47
  url,
48
48
  ...options
49
- }) => {
49
+ }) {
50
50
  let lastEventId;
51
51
  const sleep = sseSleepFn ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
52
52
  const createStream = async function* () {
@@ -93,7 +93,7 @@ var createSseClient = ({
93
93
  const { done, value } = await reader.read();
94
94
  if (done) break;
95
95
  buffer += value;
96
- buffer = buffer.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
96
+ buffer = buffer.replace(/\r\n?/g, "\n");
97
97
  const chunks = buffer.split("\n\n");
98
98
  buffer = chunks.pop() ?? "";
99
99
  for (const chunk of chunks) {
@@ -167,7 +167,7 @@ var createSseClient = ({
167
167
  };
168
168
  const stream = createStream();
169
169
  return { stream };
170
- };
170
+ }
171
171
 
172
172
  // src/api/core/pathSerializer.gen.ts
173
173
  var separatorArrayExplode = (style) => {
@@ -662,136 +662,126 @@ var createClient = (config = {}) => {
662
662
  if (opts.body === void 0 || opts.serializedBody === "") {
663
663
  opts.headers.delete("Content-Type");
664
664
  }
665
- const url = buildUrl(opts);
666
- return { opts, url };
665
+ const resolvedOpts = opts;
666
+ const url = buildUrl(resolvedOpts);
667
+ return { opts: resolvedOpts, url };
667
668
  };
668
669
  const request = async (options) => {
669
- const { opts, url } = await beforeRequest(options);
670
- const requestInit = {
671
- redirect: "follow",
672
- ...opts,
673
- body: getValidRequestBody(opts)
674
- };
675
- let request2 = new Request(url, requestInit);
676
- for (const fn of interceptors.request.fns) {
677
- if (fn) {
678
- request2 = await fn(request2, opts);
679
- }
680
- }
681
- const _fetch = opts.fetch;
670
+ const throwOnError = options.throwOnError ?? _config.throwOnError;
671
+ const responseStyle = options.responseStyle ?? _config.responseStyle;
672
+ let request2;
682
673
  let response;
683
674
  try {
684
- response = await _fetch(request2);
685
- } catch (error2) {
686
- let finalError2 = error2;
687
- for (const fn of interceptors.error.fns) {
675
+ const { opts, url } = await beforeRequest(options);
676
+ const requestInit = {
677
+ redirect: "follow",
678
+ ...opts,
679
+ body: getValidRequestBody(opts)
680
+ };
681
+ request2 = new Request(url, requestInit);
682
+ for (const fn of interceptors.request.fns) {
688
683
  if (fn) {
689
- finalError2 = await fn(
690
- error2,
691
- void 0,
692
- request2,
693
- opts
694
- );
684
+ request2 = await fn(request2, opts);
695
685
  }
696
686
  }
697
- finalError2 = finalError2 || {};
698
- if (opts.throwOnError) {
699
- throw finalError2;
687
+ const _fetch = opts.fetch;
688
+ response = await _fetch(request2);
689
+ for (const fn of interceptors.response.fns) {
690
+ if (fn) {
691
+ response = await fn(response, request2, opts);
692
+ }
700
693
  }
701
- return opts.responseStyle === "data" ? void 0 : {
702
- error: finalError2,
694
+ const result = {
703
695
  request: request2,
704
- response: void 0
696
+ response
705
697
  };
706
- }
707
- for (const fn of interceptors.response.fns) {
708
- if (fn) {
709
- response = await fn(response, request2, opts);
710
- }
711
- }
712
- const result = {
713
- request: request2,
714
- response
715
- };
716
- if (response.ok) {
717
- const parseAs = (opts.parseAs === "auto" ? getParseAs(response.headers.get("Content-Type")) : opts.parseAs) ?? "json";
718
- if (response.status === 204 || response.headers.get("Content-Length") === "0") {
719
- let emptyData;
698
+ if (response.ok) {
699
+ const parseAs = (opts.parseAs === "auto" ? getParseAs(response.headers.get("Content-Type")) : opts.parseAs) ?? "json";
700
+ if (response.status === 204 || response.headers.get("Content-Length") === "0") {
701
+ let emptyData;
702
+ switch (parseAs) {
703
+ case "arrayBuffer":
704
+ case "blob":
705
+ case "text":
706
+ emptyData = await response[parseAs]();
707
+ break;
708
+ case "formData":
709
+ emptyData = new FormData();
710
+ break;
711
+ case "stream":
712
+ emptyData = response.body;
713
+ break;
714
+ case "json":
715
+ default:
716
+ emptyData = {};
717
+ break;
718
+ }
719
+ return opts.responseStyle === "data" ? emptyData : {
720
+ data: emptyData,
721
+ ...result
722
+ };
723
+ }
724
+ let data;
720
725
  switch (parseAs) {
721
726
  case "arrayBuffer":
722
727
  case "blob":
728
+ case "formData":
723
729
  case "text":
724
- emptyData = await response[parseAs]();
730
+ data = await response[parseAs]();
725
731
  break;
726
- case "formData":
727
- emptyData = new FormData();
732
+ case "json": {
733
+ const text = await response.text();
734
+ data = text ? JSON.parse(text) : {};
728
735
  break;
736
+ }
729
737
  case "stream":
730
- emptyData = response.body;
731
- break;
732
- case "json":
733
- default:
734
- emptyData = {};
735
- break;
738
+ return opts.responseStyle === "data" ? response.body : {
739
+ data: response.body,
740
+ ...result
741
+ };
742
+ }
743
+ if (parseAs === "json") {
744
+ if (opts.responseValidator) {
745
+ await opts.responseValidator(data);
746
+ }
747
+ if (opts.responseTransformer) {
748
+ data = await opts.responseTransformer(data);
749
+ }
736
750
  }
737
- return opts.responseStyle === "data" ? emptyData : {
738
- data: emptyData,
751
+ return opts.responseStyle === "data" ? data : {
752
+ data,
739
753
  ...result
740
754
  };
741
755
  }
742
- let data;
743
- switch (parseAs) {
744
- case "arrayBuffer":
745
- case "blob":
746
- case "formData":
747
- case "text":
748
- data = await response[parseAs]();
749
- break;
750
- case "json": {
751
- const text = await response.text();
752
- data = text ? JSON.parse(text) : {};
753
- break;
754
- }
755
- case "stream":
756
- return opts.responseStyle === "data" ? response.body : {
757
- data: response.body,
758
- ...result
759
- };
756
+ const textError = await response.text();
757
+ let jsonError;
758
+ try {
759
+ jsonError = JSON.parse(textError);
760
+ } catch {
760
761
  }
761
- if (parseAs === "json") {
762
- if (opts.responseValidator) {
763
- await opts.responseValidator(data);
764
- }
765
- if (opts.responseTransformer) {
766
- data = await opts.responseTransformer(data);
762
+ throw jsonError ?? textError;
763
+ } catch (error) {
764
+ let finalError = error;
765
+ for (const fn of interceptors.error.fns) {
766
+ if (fn) {
767
+ finalError = await fn(
768
+ finalError,
769
+ response,
770
+ request2,
771
+ options
772
+ );
767
773
  }
768
774
  }
769
- return opts.responseStyle === "data" ? data : {
770
- data,
771
- ...result
772
- };
773
- }
774
- const textError = await response.text();
775
- let jsonError;
776
- try {
777
- jsonError = JSON.parse(textError);
778
- } catch {
779
- }
780
- const error = jsonError ?? textError;
781
- let finalError = error;
782
- for (const fn of interceptors.error.fns) {
783
- if (fn) {
784
- finalError = await fn(error, response, request2, opts);
775
+ finalError = finalError || {};
776
+ if (throwOnError) {
777
+ throw finalError;
785
778
  }
779
+ return responseStyle === "data" ? void 0 : {
780
+ error: finalError,
781
+ request: request2,
782
+ response
783
+ };
786
784
  }
787
- finalError = finalError || {};
788
- if (opts.throwOnError) {
789
- throw finalError;
790
- }
791
- return opts.responseStyle === "data" ? void 0 : {
792
- error: finalError,
793
- ...result
794
- };
795
785
  };
796
786
  const makeMethodFn = (method) => (options) => request({ ...options, method });
797
787
  const makeSseFn = (method) => async (options) => {
@@ -799,7 +789,6 @@ var createClient = (config = {}) => {
799
789
  return createSseClient({
800
790
  ...opts,
801
791
  body: opts.body,
802
- headers: opts.headers,
803
792
  method,
804
793
  onRequest: async (url2, init) => {
805
794
  let request2 = new Request(url2, init);
@@ -814,8 +803,9 @@ var createClient = (config = {}) => {
814
803
  url
815
804
  });
816
805
  };
806
+ const _buildUrl = (options) => buildUrl({ ..._config, ...options });
817
807
  return {
818
- buildUrl,
808
+ buildUrl: _buildUrl,
819
809
  connect: makeMethodFn("CONNECT"),
820
810
  delete: makeMethodFn("DELETE"),
821
811
  get: makeMethodFn("GET"),
@@ -854,6 +844,11 @@ var appControllerGetVersion = (options) => (options?.client ?? client).get({
854
844
  url: "/api/version",
855
845
  ...options
856
846
  });
847
+ var appControllerGetFrontendConfig = (options) => (options?.client ?? client).get({
848
+ security: [{ scheme: "bearer", type: "http" }],
849
+ url: "/api/frontend-config",
850
+ ...options
851
+ });
857
852
  var tenantControllerGetTenants = (options) => (options?.client ?? client).get({
858
853
  security: [{ scheme: "bearer", type: "http" }],
859
854
  url: "/api/tenant",
@@ -1031,6 +1026,39 @@ var sessionConfigControllerUpdateConfig = (options) => (options.client ?? client
1031
1026
  }
1032
1027
  });
1033
1028
  var sessionEventsControllerSubscribeToSessionEvents = (options) => (options.client ?? client).get({ url: "/api/session/{id}/events", ...options });
1029
+ var userControllerGetUsers = (options) => (options?.client ?? client).get({
1030
+ security: [{ scheme: "bearer", type: "http" }],
1031
+ url: "/api/user",
1032
+ ...options
1033
+ });
1034
+ var userControllerCreateUser = (options) => (options.client ?? client).post({
1035
+ security: [{ scheme: "bearer", type: "http" }],
1036
+ url: "/api/user",
1037
+ ...options,
1038
+ headers: {
1039
+ "Content-Type": "application/json",
1040
+ ...options.headers
1041
+ }
1042
+ });
1043
+ var userControllerDeleteUser = (options) => (options.client ?? client).delete({
1044
+ security: [{ scheme: "bearer", type: "http" }],
1045
+ url: "/api/user/{id}",
1046
+ ...options
1047
+ });
1048
+ var userControllerGetUser = (options) => (options.client ?? client).get({
1049
+ security: [{ scheme: "bearer", type: "http" }],
1050
+ url: "/api/user/{id}",
1051
+ ...options
1052
+ });
1053
+ var userControllerUpdateUser = (options) => (options.client ?? client).patch({
1054
+ security: [{ scheme: "bearer", type: "http" }],
1055
+ url: "/api/user/{id}",
1056
+ ...options,
1057
+ headers: {
1058
+ "Content-Type": "application/json",
1059
+ ...options.headers
1060
+ }
1061
+ });
1034
1062
  var issuanceConfigControllerGetIssuanceConfigurations = (options) => (options?.client ?? client).get({
1035
1063
  security: [{ scheme: "bearer", type: "http" }],
1036
1064
  url: "/api/issuer/config",
@@ -1158,6 +1186,15 @@ var presentationManagementControllerStorePresentationConfig = (options) => (opti
1158
1186
  ...options.headers
1159
1187
  }
1160
1188
  });
1189
+ var presentationManagementControllerResolveIssuerMetadata = (options) => (options.client ?? client).post({
1190
+ security: [{ scheme: "bearer", type: "http" }],
1191
+ url: "/api/verifier/config/issuer-metadata/resolve",
1192
+ ...options,
1193
+ headers: {
1194
+ "Content-Type": "application/json",
1195
+ ...options.headers
1196
+ }
1197
+ });
1161
1198
  var presentationManagementControllerDeleteConfiguration = (options) => (options.client ?? client).delete({
1162
1199
  security: [{ scheme: "bearer", type: "http" }],
1163
1200
  url: "/api/verifier/config/{id}",
@@ -1177,6 +1214,11 @@ var presentationManagementControllerUpdateConfiguration = (options) => (options.
1177
1214
  ...options.headers
1178
1215
  }
1179
1216
  });
1217
+ var presentationManagementControllerReissueRegistrationCertificate = (options) => (options.client ?? client).post({
1218
+ security: [{ scheme: "bearer", type: "http" }],
1219
+ url: "/api/verifier/config/{id}/registration-cert/reissue",
1220
+ ...options
1221
+ });
1180
1222
  var cacheControllerGetStats = (options) => (options?.client ?? client).get({
1181
1223
  security: [{ scheme: "bearer", type: "http" }],
1182
1224
  url: "/api/cache/stats",
@@ -1197,64 +1239,64 @@ var cacheControllerClearStatusListCache = (options) => (options?.client ?? clien
1197
1239
  url: "/api/cache/status-list",
1198
1240
  ...options
1199
1241
  });
1200
- var credentialOfferControllerGetOffer = (options) => (options.client ?? client).post({
1242
+ var registrarControllerDeleteConfig = (options) => (options?.client ?? client).delete({
1201
1243
  security: [{ scheme: "bearer", type: "http" }],
1202
- url: "/api/issuer/offer",
1244
+ url: "/api/registrar/config",
1245
+ ...options
1246
+ });
1247
+ var registrarControllerGetConfig = (options) => (options?.client ?? client).get({
1248
+ security: [{ scheme: "bearer", type: "http" }],
1249
+ url: "/api/registrar/config",
1250
+ ...options
1251
+ });
1252
+ var registrarControllerUpdateConfig = (options) => (options.client ?? client).patch({
1253
+ security: [{ scheme: "bearer", type: "http" }],
1254
+ url: "/api/registrar/config",
1203
1255
  ...options,
1204
1256
  headers: {
1205
1257
  "Content-Type": "application/json",
1206
1258
  ...options.headers
1207
1259
  }
1208
1260
  });
1209
- var deferredControllerCompleteDeferred = (options) => (options.client ?? client).post({
1261
+ var registrarControllerCreateConfig = (options) => (options.client ?? client).post({
1210
1262
  security: [{ scheme: "bearer", type: "http" }],
1211
- url: "/api/issuer/deferred/{transactionId}/complete",
1263
+ url: "/api/registrar/config",
1212
1264
  ...options,
1213
1265
  headers: {
1214
1266
  "Content-Type": "application/json",
1215
1267
  ...options.headers
1216
1268
  }
1217
1269
  });
1218
- var deferredControllerFailDeferred = (options) => (options.client ?? client).post({
1270
+ var registrarControllerCreateAccessCertificate = (options) => (options.client ?? client).post({
1219
1271
  security: [{ scheme: "bearer", type: "http" }],
1220
- url: "/api/issuer/deferred/{transactionId}/fail",
1272
+ url: "/api/registrar/access-certificate",
1221
1273
  ...options,
1222
1274
  headers: {
1223
1275
  "Content-Type": "application/json",
1224
1276
  ...options.headers
1225
1277
  }
1226
1278
  });
1227
- var registrarControllerDeleteConfig = (options) => (options?.client ?? client).delete({
1228
- security: [{ scheme: "bearer", type: "http" }],
1229
- url: "/api/registrar/config",
1230
- ...options
1231
- });
1232
- var registrarControllerGetConfig = (options) => (options?.client ?? client).get({
1233
- security: [{ scheme: "bearer", type: "http" }],
1234
- url: "/api/registrar/config",
1235
- ...options
1236
- });
1237
- var registrarControllerUpdateConfig = (options) => (options.client ?? client).patch({
1279
+ var credentialOfferControllerGetOffer = (options) => (options.client ?? client).post({
1238
1280
  security: [{ scheme: "bearer", type: "http" }],
1239
- url: "/api/registrar/config",
1281
+ url: "/api/issuer/offer",
1240
1282
  ...options,
1241
1283
  headers: {
1242
1284
  "Content-Type": "application/json",
1243
1285
  ...options.headers
1244
1286
  }
1245
1287
  });
1246
- var registrarControllerCreateConfig = (options) => (options.client ?? client).post({
1288
+ var deferredControllerCompleteDeferred = (options) => (options.client ?? client).post({
1247
1289
  security: [{ scheme: "bearer", type: "http" }],
1248
- url: "/api/registrar/config",
1290
+ url: "/api/issuer/deferred/{transactionId}/complete",
1249
1291
  ...options,
1250
1292
  headers: {
1251
1293
  "Content-Type": "application/json",
1252
1294
  ...options.headers
1253
1295
  }
1254
1296
  });
1255
- var registrarControllerCreateAccessCertificate = (options) => (options.client ?? client).post({
1297
+ var deferredControllerFailDeferred = (options) => (options.client ?? client).post({
1256
1298
  security: [{ scheme: "bearer", type: "http" }],
1257
- url: "/api/registrar/access-certificate",
1299
+ url: "/api/issuer/deferred/{transactionId}/fail",
1258
1300
  ...options,
1259
1301
  headers: {
1260
1302
  "Content-Type": "application/json",
@@ -1386,6 +1428,7 @@ var storageControllerUpload = (options) => (options.client ?? client).post({
1386
1428
  }
1387
1429
  });
1388
1430
 
1431
+ exports.appControllerGetFrontendConfig = appControllerGetFrontendConfig;
1389
1432
  exports.appControllerGetVersion = appControllerGetVersion;
1390
1433
  exports.attributeProviderControllerCreate = attributeProviderControllerCreate;
1391
1434
  exports.attributeProviderControllerDelete = attributeProviderControllerDelete;
@@ -1425,6 +1468,8 @@ exports.keyChainControllerUpdate = keyChainControllerUpdate;
1425
1468
  exports.presentationManagementControllerConfiguration = presentationManagementControllerConfiguration;
1426
1469
  exports.presentationManagementControllerDeleteConfiguration = presentationManagementControllerDeleteConfiguration;
1427
1470
  exports.presentationManagementControllerGetConfiguration = presentationManagementControllerGetConfiguration;
1471
+ exports.presentationManagementControllerReissueRegistrationCertificate = presentationManagementControllerReissueRegistrationCertificate;
1472
+ exports.presentationManagementControllerResolveIssuerMetadata = presentationManagementControllerResolveIssuerMetadata;
1428
1473
  exports.presentationManagementControllerStorePresentationConfig = presentationManagementControllerStorePresentationConfig;
1429
1474
  exports.presentationManagementControllerUpdateConfiguration = presentationManagementControllerUpdateConfiguration;
1430
1475
  exports.registrarControllerCreateAccessCertificate = registrarControllerCreateAccessCertificate;
@@ -1463,6 +1508,11 @@ exports.trustListControllerGetTrustList = trustListControllerGetTrustList;
1463
1508
  exports.trustListControllerGetTrustListVersion = trustListControllerGetTrustListVersion;
1464
1509
  exports.trustListControllerGetTrustListVersions = trustListControllerGetTrustListVersions;
1465
1510
  exports.trustListControllerUpdateTrustList = trustListControllerUpdateTrustList;
1511
+ exports.userControllerCreateUser = userControllerCreateUser;
1512
+ exports.userControllerDeleteUser = userControllerDeleteUser;
1513
+ exports.userControllerGetUser = userControllerGetUser;
1514
+ exports.userControllerGetUsers = userControllerGetUsers;
1515
+ exports.userControllerUpdateUser = userControllerUpdateUser;
1466
1516
  exports.verifierOfferControllerGetOffer = verifierOfferControllerGetOffer;
1467
1517
  exports.webhookEndpointControllerCreate = webhookEndpointControllerCreate;
1468
1518
  exports.webhookEndpointControllerDelete = webhookEndpointControllerDelete;