@eudiplo/sdk-core 4.5.0 → 5.1.0-main.02a1dd8

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/index.mjs CHANGED
@@ -1111,6 +1111,11 @@ var schemaMetadataControllerFindAll = (options) => (options?.client ?? client).g
1111
1111
  url: "/api/schema-metadata",
1112
1112
  ...options
1113
1113
  });
1114
+ var schemaMetadataControllerGetMine = (options) => (options?.client ?? client).get({
1115
+ security: [{ scheme: "bearer", type: "http" }],
1116
+ url: "/api/schema-metadata/mine",
1117
+ ...options
1118
+ });
1114
1119
  var schemaMetadataControllerFindOne = (options) => (options.client ?? client).get({
1115
1120
  security: [{ scheme: "bearer", type: "http" }],
1116
1121
  url: "/api/schema-metadata/{id}",
@@ -1423,6 +1428,17 @@ var deferredControllerFailDeferred = (options) => (options.client ?? client).pos
1423
1428
  ...options.headers
1424
1429
  }
1425
1430
  });
1431
+ var chainedAsVpControllerPar = (options) => (options.client ?? client).post({ url: "/api/issuers/{tenantId}/chained-as-vp/par", ...options });
1432
+ var chainedAsVpControllerAuthorize = (options) => (options.client ?? client).get({ url: "/api/issuers/{tenantId}/chained-as-vp/authorize", ...options });
1433
+ var chainedAsVpControllerVpCallback = (options) => (options.client ?? client).get({ url: "/api/issuers/{tenantId}/chained-as-vp/vp-callback", ...options });
1434
+ var chainedAsVpControllerToken = (options) => (options.client ?? client).post({
1435
+ url: "/api/issuers/{tenantId}/chained-as-vp/token",
1436
+ ...options,
1437
+ headers: {
1438
+ "Content-Type": "application/json",
1439
+ ...options.headers
1440
+ }
1441
+ });
1426
1442
  var keyChainControllerGetProviders = (options) => (options?.client ?? client).get({
1427
1443
  security: [{ scheme: "bearer", type: "http" }],
1428
1444
  url: "/api/key-chain/providers",
@@ -1627,7 +1643,8 @@ var EudiploClient = class {
1627
1643
  response_type: options.responseType ?? "uri",
1628
1644
  credentialConfigurationIds: options.credentialConfigurationIds,
1629
1645
  flow: options.flow ?? "pre_authorized_code",
1630
- tx_code: options.txCode
1646
+ tx_code: options.txCode,
1647
+ authorization_server: options.authorizationServer
1631
1648
  };
1632
1649
  if (options.claims) {
1633
1650
  const credentialClaims = {};
@@ -2049,6 +2066,30 @@ async function submitDcApiResponse(options) {
2049
2066
 
2050
2067
  // src/config/derive.ts
2051
2068
  var JSON_SCHEMA_DRAFT_2020_12 = "https://json-schema.org/draft/2020-12/schema";
2069
+ function resolveChildPath(parentPath, childPath) {
2070
+ if (childPath.length >= parentPath.length) {
2071
+ const startsWithParent = parentPath.every((seg, i) => seg === childPath[i]);
2072
+ if (startsWithParent) {
2073
+ return childPath;
2074
+ }
2075
+ }
2076
+ return [...parentPath, ...childPath];
2077
+ }
2078
+ function flattenFields(fields) {
2079
+ const result = [];
2080
+ for (const field of fields) {
2081
+ const { children, ...fieldWithoutChildren } = field;
2082
+ result.push(fieldWithoutChildren);
2083
+ if (children && children.length > 0) {
2084
+ const resolvedChildren = children.map((child) => ({
2085
+ ...child,
2086
+ path: resolveChildPath(field.path, child.path)
2087
+ }));
2088
+ result.push(...flattenFields(resolvedChildren));
2089
+ }
2090
+ }
2091
+ return result;
2092
+ }
2052
2093
  function segmentToKey(segment) {
2053
2094
  if (segment === null) {
2054
2095
  return "*";
@@ -2119,9 +2160,25 @@ function mergeLeafSchema(existing, next) {
2119
2160
  }
2120
2161
  return merged;
2121
2162
  }
2163
+ function isArrayPathSegment(segment) {
2164
+ return typeof segment === "number" || segment === null;
2165
+ }
2122
2166
  function ensureSchemaNode(root, path) {
2123
2167
  let cursor = root;
2124
2168
  for (const segment of path) {
2169
+ if (isArrayPathSegment(segment)) {
2170
+ if (cursor.type !== "array") {
2171
+ cursor.type = "array";
2172
+ }
2173
+ if (!cursor.items || typeof cursor.items !== "object" || Array.isArray(cursor.items)) {
2174
+ cursor.items = {
2175
+ type: "object",
2176
+ properties: {}
2177
+ };
2178
+ }
2179
+ cursor = cursor.items;
2180
+ continue;
2181
+ }
2125
2182
  const key = segmentToKey(segment);
2126
2183
  cursor.properties ??= {};
2127
2184
  if (!cursor.properties[key]) {
@@ -2148,7 +2205,7 @@ function ensureFrameNode(root, path) {
2148
2205
  }
2149
2206
  function buildClaims(fields) {
2150
2207
  const claims = {};
2151
- for (const field of fields) {
2208
+ for (const field of flattenFields(fields)) {
2152
2209
  if (!Object.prototype.hasOwnProperty.call(field, "defaultValue")) {
2153
2210
  continue;
2154
2211
  }
@@ -2159,7 +2216,7 @@ function buildClaims(fields) {
2159
2216
  function buildDisclosureFrame(fields) {
2160
2217
  const frame = {};
2161
2218
  let hasDisclosure = false;
2162
- for (const field of fields) {
2219
+ for (const field of flattenFields(fields)) {
2163
2220
  if (!field.disclosable || field.path.length === 0) {
2164
2221
  continue;
2165
2222
  }
@@ -2176,7 +2233,7 @@ function buildDisclosureFrame(fields) {
2176
2233
  return hasDisclosure ? frame : void 0;
2177
2234
  }
2178
2235
  function buildClaimsMetadata(fields) {
2179
- return fields.filter((field) => field.path.length > 0).map((field) => {
2236
+ return flattenFields(fields).filter((field) => field.path.length > 0).map((field) => {
2180
2237
  const metadata = {
2181
2238
  path: field.path
2182
2239
  };
@@ -2192,11 +2249,8 @@ function buildClaimsMetadata(fields) {
2192
2249
  function buildLeafSchema(field) {
2193
2250
  const schema = {
2194
2251
  ...field.constraints,
2195
- type: field.type === "date" ? "string" : field.type
2252
+ type: field.type
2196
2253
  };
2197
- if (field.type === "date" && !schema.format) {
2198
- schema.format = "date";
2199
- }
2200
2254
  const title = getDisplayTitle(field.display);
2201
2255
  if (title) {
2202
2256
  schema.title = title;
@@ -2217,14 +2271,23 @@ function buildJsonSchema(fields) {
2217
2271
  type: "object",
2218
2272
  properties: {}
2219
2273
  };
2220
- for (const field of fields) {
2274
+ for (const field of flattenFields(fields)) {
2221
2275
  if (field.path.length === 0) {
2222
2276
  continue;
2223
2277
  }
2224
2278
  const parent = ensureSchemaNode(root, field.path.slice(0, -1));
2225
- const leafKey = segmentToKey(field.path.at(-1) ?? "");
2226
- parent.properties ??= {};
2279
+ const leafSegment = field.path.at(-1);
2227
2280
  const leafSchema = buildLeafSchema(field);
2281
+ if (isArrayPathSegment(leafSegment ?? null)) {
2282
+ if (parent.type !== "array") {
2283
+ parent.type = "array";
2284
+ }
2285
+ const existingItems = parent.items && typeof parent.items === "object" && !Array.isArray(parent.items) ? parent.items : void 0;
2286
+ parent.items = existingItems ? mergeLeafSchema(existingItems, leafSchema) : leafSchema;
2287
+ continue;
2288
+ }
2289
+ const leafKey = segmentToKey(leafSegment ?? "");
2290
+ parent.properties ??= {};
2228
2291
  const existing = parent.properties[leafKey];
2229
2292
  parent.properties[leafKey] = existing && typeof existing === "object" && !Array.isArray(existing) ? mergeLeafSchema(existing, leafSchema) : leafSchema;
2230
2293
  if (field.mandatory) {
@@ -2235,7 +2298,7 @@ function buildJsonSchema(fields) {
2235
2298
  }
2236
2299
  function buildClaimsByNamespace(fields) {
2237
2300
  const byNamespace = {};
2238
- for (const field of fields) {
2301
+ for (const field of flattenFields(fields)) {
2239
2302
  if (!field.namespace || !Object.prototype.hasOwnProperty.call(field, "defaultValue")) {
2240
2303
  continue;
2241
2304
  }
@@ -2258,6 +2321,6 @@ function deriveRuntimeArtifacts(fields) {
2258
2321
  };
2259
2322
  }
2260
2323
 
2261
- export { EudiploClient, appControllerGetFrontendConfig, appControllerGetVersion, attributeProviderControllerCreate, attributeProviderControllerDelete, attributeProviderControllerGetAll, attributeProviderControllerGetById, attributeProviderControllerUpdate, auditLogControllerGetAuditLogs, authControllerGetOAuth2Token, buildClaims, buildClaimsByNamespace, buildClaimsMetadata, buildDisclosureFrame, buildJsonSchema, cacheControllerClearAllCaches, cacheControllerClearStatusListCache, cacheControllerClearTrustListCache, cacheControllerGetStats, client, clientControllerCreateClient, clientControllerDeleteClient, clientControllerGetClient, clientControllerGetClientSecret, clientControllerGetClients, clientControllerRotateClientSecret, clientControllerUpdateClient, credentialConfigControllerDeleteIssuanceConfiguration, credentialConfigControllerGetConfigById, credentialConfigControllerGetConfigs, credentialConfigControllerStoreCredentialConfiguration, credentialConfigControllerUpdateCredentialConfiguration, credentialOfferControllerGetOffer, deferredControllerCompleteDeferred, deferredControllerFailDeferred, deriveRuntimeArtifacts, isDcApiAvailable, issuanceConfigControllerGetIssuanceConfigurations, issuanceConfigControllerStoreIssuanceConfiguration, keyChainControllerCreate, keyChainControllerDelete, keyChainControllerExport, keyChainControllerGetAll, keyChainControllerGetById, keyChainControllerGetProviders, keyChainControllerGetProvidersHealth, keyChainControllerImport, keyChainControllerRotate, keyChainControllerUpdate, presentationManagementControllerConfiguration, presentationManagementControllerDeleteConfiguration, presentationManagementControllerGetConfiguration, presentationManagementControllerListSchemaMetadataCatalog, presentationManagementControllerReissueRegistrationCertificate, presentationManagementControllerResolveIssuerMetadata, presentationManagementControllerResolveSchemaMetadata, presentationManagementControllerStorePresentationConfig, presentationManagementControllerUpdateConfiguration, registrarControllerCreateAccessCertificate, registrarControllerCreateConfig, registrarControllerDeleteConfig, registrarControllerGetConfig, registrarControllerUpdateConfig, schemaMetadataControllerDeprecateVersion, schemaMetadataControllerExport, schemaMetadataControllerFindAll, schemaMetadataControllerFindOne, schemaMetadataControllerGetJwt, schemaMetadataControllerGetLatest, schemaMetadataControllerGetSchema, schemaMetadataControllerGetVersions, schemaMetadataControllerGetVocabularies, schemaMetadataControllerRemove, schemaMetadataControllerSignSchemaMetaConfig, schemaMetadataControllerSignVersionSchemaMetaConfig, schemaMetadataControllerUpdate, sessionConfigControllerGetConfig, sessionConfigControllerResetConfig, sessionConfigControllerUpdateConfig, sessionControllerDeleteSession, sessionControllerGetAllSessions, sessionControllerGetSession, sessionControllerGetSessionLogs, sessionControllerRevokeAll, sessionEventsControllerSubscribeToSessionEvents, statusListConfigControllerGetConfig, statusListConfigControllerResetConfig, statusListConfigControllerUpdateConfig, statusListManagementControllerCreateList, statusListManagementControllerDeleteList, statusListManagementControllerGetList, statusListManagementControllerGetLists, statusListManagementControllerUpdateList, storageControllerUpload, tenantControllerDeleteTenant, tenantControllerGetTenant, tenantControllerGetTenants, tenantControllerInitTenant, tenantControllerUpdateTenant, trustListControllerCreateTrustList, trustListControllerDeleteTrustList, trustListControllerExportTrustList, trustListControllerGetAllTrustLists, trustListControllerGetTrustList, trustListControllerGetTrustListVersion, trustListControllerGetTrustListVersions, trustListControllerUpdateTrustList, userControllerCreateUser, userControllerDeleteUser, userControllerGetUser, userControllerGetUsers, userControllerUpdateUser, verifierOfferControllerGetOffer, webhookEndpointControllerCreate, webhookEndpointControllerDelete, webhookEndpointControllerGetAll, webhookEndpointControllerGetById, webhookEndpointControllerUpdate };
2324
+ export { EudiploClient, appControllerGetFrontendConfig, appControllerGetVersion, attributeProviderControllerCreate, attributeProviderControllerDelete, attributeProviderControllerGetAll, attributeProviderControllerGetById, attributeProviderControllerUpdate, auditLogControllerGetAuditLogs, authControllerGetOAuth2Token, buildClaims, buildClaimsByNamespace, buildClaimsMetadata, buildDisclosureFrame, buildJsonSchema, cacheControllerClearAllCaches, cacheControllerClearStatusListCache, cacheControllerClearTrustListCache, cacheControllerGetStats, chainedAsVpControllerAuthorize, chainedAsVpControllerPar, chainedAsVpControllerToken, chainedAsVpControllerVpCallback, client, clientControllerCreateClient, clientControllerDeleteClient, clientControllerGetClient, clientControllerGetClientSecret, clientControllerGetClients, clientControllerRotateClientSecret, clientControllerUpdateClient, credentialConfigControllerDeleteIssuanceConfiguration, credentialConfigControllerGetConfigById, credentialConfigControllerGetConfigs, credentialConfigControllerStoreCredentialConfiguration, credentialConfigControllerUpdateCredentialConfiguration, credentialOfferControllerGetOffer, deferredControllerCompleteDeferred, deferredControllerFailDeferred, deriveRuntimeArtifacts, flattenFields, isDcApiAvailable, issuanceConfigControllerGetIssuanceConfigurations, issuanceConfigControllerStoreIssuanceConfiguration, keyChainControllerCreate, keyChainControllerDelete, keyChainControllerExport, keyChainControllerGetAll, keyChainControllerGetById, keyChainControllerGetProviders, keyChainControllerGetProvidersHealth, keyChainControllerImport, keyChainControllerRotate, keyChainControllerUpdate, presentationManagementControllerConfiguration, presentationManagementControllerDeleteConfiguration, presentationManagementControllerGetConfiguration, presentationManagementControllerListSchemaMetadataCatalog, presentationManagementControllerReissueRegistrationCertificate, presentationManagementControllerResolveIssuerMetadata, presentationManagementControllerResolveSchemaMetadata, presentationManagementControllerStorePresentationConfig, presentationManagementControllerUpdateConfiguration, registrarControllerCreateAccessCertificate, registrarControllerCreateConfig, registrarControllerDeleteConfig, registrarControllerGetConfig, registrarControllerUpdateConfig, schemaMetadataControllerDeprecateVersion, schemaMetadataControllerExport, schemaMetadataControllerFindAll, schemaMetadataControllerFindOne, schemaMetadataControllerGetJwt, schemaMetadataControllerGetLatest, schemaMetadataControllerGetMine, schemaMetadataControllerGetSchema, schemaMetadataControllerGetVersions, schemaMetadataControllerGetVocabularies, schemaMetadataControllerRemove, schemaMetadataControllerSignSchemaMetaConfig, schemaMetadataControllerSignVersionSchemaMetaConfig, schemaMetadataControllerUpdate, sessionConfigControllerGetConfig, sessionConfigControllerResetConfig, sessionConfigControllerUpdateConfig, sessionControllerDeleteSession, sessionControllerGetAllSessions, sessionControllerGetSession, sessionControllerGetSessionLogs, sessionControllerRevokeAll, sessionEventsControllerSubscribeToSessionEvents, statusListConfigControllerGetConfig, statusListConfigControllerResetConfig, statusListConfigControllerUpdateConfig, statusListManagementControllerCreateList, statusListManagementControllerDeleteList, statusListManagementControllerGetList, statusListManagementControllerGetLists, statusListManagementControllerUpdateList, storageControllerUpload, tenantControllerDeleteTenant, tenantControllerGetTenant, tenantControllerGetTenants, tenantControllerInitTenant, tenantControllerUpdateTenant, trustListControllerCreateTrustList, trustListControllerDeleteTrustList, trustListControllerExportTrustList, trustListControllerGetAllTrustLists, trustListControllerGetTrustList, trustListControllerGetTrustListVersion, trustListControllerGetTrustListVersions, trustListControllerUpdateTrustList, userControllerCreateUser, userControllerDeleteUser, userControllerGetUser, userControllerGetUsers, userControllerUpdateUser, verifierOfferControllerGetOffer, webhookEndpointControllerCreate, webhookEndpointControllerDelete, webhookEndpointControllerGetAll, webhookEndpointControllerGetById, webhookEndpointControllerUpdate };
2262
2325
  //# sourceMappingURL=index.mjs.map
2263
2326
  //# sourceMappingURL=index.mjs.map
@@ -6,6 +6,13 @@ interface Auth {
6
6
  * @default 'header'
7
7
  */
8
8
  in?: 'header' | 'query' | 'cookie';
9
+ /**
10
+ * A unique identifier for the security scheme.
11
+ *
12
+ * Defined only when there are multiple security schemes whose `Auth`
13
+ * shape would otherwise be identical.
14
+ */
15
+ key?: string;
9
16
  /**
10
17
  * Header or query parameter name.
11
18
  *
@@ -121,6 +128,11 @@ interface Config$1 {
121
128
  */
122
129
  responseValidator?: (data: unknown) => Promise<unknown>;
123
130
  }
131
+ /**
132
+ * Arbitrary metadata passed through the `meta` request option.
133
+ */
134
+ interface ClientMeta {
135
+ }
124
136
 
125
137
  type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, 'method'> & Pick<Config$1, 'method' | 'responseTransformer' | 'responseValidator'> & {
126
138
  /**
@@ -332,4 +344,4 @@ interface TDataShape {
332
344
  type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
333
345
  type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle = 'fields'> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 'body' | 'path' | 'query' | 'url'> & ([TData] extends [never] ? unknown : Omit<TData, 'url'>);
334
346
 
335
- export { type Auth as A, type Client as C, type Options as O, type QuerySerializerOptions as Q, type RequestOptions as R, type TDataShape as T, type ClientOptions as a, type Config as b, type CreateClientConfig as c, type RequestResult as d, type ResolvedRequestOptions as e, type ResponseStyle as f, createConfig as g, formDataBodySerializer as h, jsonBodySerializer as j, mergeHeaders as m, urlSearchParamsBodySerializer as u };
347
+ export { type Auth as A, type Config as C, type Options as O, type QuerySerializerOptions as Q, type RequestOptions as R, type ServerSentEventsResult as S, type TDataShape as T, type Client as a, type ClientOptions as b, type ClientMeta as c, type CreateClientConfig as d, type RequestResult as e, type ResolvedRequestOptions as f, type ResponseStyle as g, createConfig as h, formDataBodySerializer as i, jsonBodySerializer as j, mergeHeaders as m, urlSearchParamsBodySerializer as u };
@@ -6,6 +6,13 @@ interface Auth {
6
6
  * @default 'header'
7
7
  */
8
8
  in?: 'header' | 'query' | 'cookie';
9
+ /**
10
+ * A unique identifier for the security scheme.
11
+ *
12
+ * Defined only when there are multiple security schemes whose `Auth`
13
+ * shape would otherwise be identical.
14
+ */
15
+ key?: string;
9
16
  /**
10
17
  * Header or query parameter name.
11
18
  *
@@ -121,6 +128,11 @@ interface Config$1 {
121
128
  */
122
129
  responseValidator?: (data: unknown) => Promise<unknown>;
123
130
  }
131
+ /**
132
+ * Arbitrary metadata passed through the `meta` request option.
133
+ */
134
+ interface ClientMeta {
135
+ }
124
136
 
125
137
  type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, 'method'> & Pick<Config$1, 'method' | 'responseTransformer' | 'responseValidator'> & {
126
138
  /**
@@ -332,4 +344,4 @@ interface TDataShape {
332
344
  type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
333
345
  type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle = 'fields'> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 'body' | 'path' | 'query' | 'url'> & ([TData] extends [never] ? unknown : Omit<TData, 'url'>);
334
346
 
335
- export { type Auth as A, type Client as C, type Options as O, type QuerySerializerOptions as Q, type RequestOptions as R, type TDataShape as T, type ClientOptions as a, type Config as b, type CreateClientConfig as c, type RequestResult as d, type ResolvedRequestOptions as e, type ResponseStyle as f, createConfig as g, formDataBodySerializer as h, jsonBodySerializer as j, mergeHeaders as m, urlSearchParamsBodySerializer as u };
347
+ export { type Auth as A, type Config as C, type Options as O, type QuerySerializerOptions as Q, type RequestOptions as R, type ServerSentEventsResult as S, type TDataShape as T, type Client as a, type ClientOptions as b, type ClientMeta as c, type CreateClientConfig as d, type RequestResult as e, type ResolvedRequestOptions as f, type ResponseStyle as g, createConfig as h, formDataBodySerializer as i, jsonBodySerializer as j, mergeHeaders as m, urlSearchParamsBodySerializer as u };