@eudiplo/sdk-core 5.0.0 → 5.1.0-main.0f9e336
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/index.d.mts +3 -3
- package/dist/api/client/index.d.ts +3 -3
- package/dist/api/client/index.js +19 -11
- package/dist/api/client/index.mjs +19 -11
- 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/index.d.mts +158 -114
- package/dist/api/index.d.ts +158 -114
- package/dist/api/index.js +43 -0
- package/dist/api/index.mjs +36 -1
- package/dist/index.d.mts +10 -6
- package/dist/index.d.ts +10 -6
- package/dist/index.js +113 -12
- package/dist/index.mjs +105 -13
- package/dist/{types.gen-z3We9JHj.d.mts → types.gen-BTQX6LCX.d.mts} +821 -147
- package/dist/{types.gen-z3We9JHj.d.ts → types.gen-BTQX6LCX.d.ts} +821 -147
- package/dist/{types.gen-Cc6DtXw9.d.mts → types.gen-DZ4ax15r.d.mts} +13 -1
- package/dist/{types.gen-Cc6DtXw9.d.ts → types.gen-DZ4ax15r.d.ts} +13 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1113,6 +1113,11 @@ var schemaMetadataControllerFindAll = (options) => (options?.client ?? client).g
|
|
|
1113
1113
|
url: "/api/schema-metadata",
|
|
1114
1114
|
...options
|
|
1115
1115
|
});
|
|
1116
|
+
var schemaMetadataControllerGetMine = (options) => (options?.client ?? client).get({
|
|
1117
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1118
|
+
url: "/api/schema-metadata/mine",
|
|
1119
|
+
...options
|
|
1120
|
+
});
|
|
1116
1121
|
var schemaMetadataControllerFindOne = (options) => (options.client ?? client).get({
|
|
1117
1122
|
security: [{ scheme: "bearer", type: "http" }],
|
|
1118
1123
|
url: "/api/schema-metadata/{id}",
|
|
@@ -1425,6 +1430,17 @@ var deferredControllerFailDeferred = (options) => (options.client ?? client).pos
|
|
|
1425
1430
|
...options.headers
|
|
1426
1431
|
}
|
|
1427
1432
|
});
|
|
1433
|
+
var chainedAsVpControllerPar = (options) => (options.client ?? client).post({ url: "/api/issuers/{tenantId}/chained-as-vp/par", ...options });
|
|
1434
|
+
var chainedAsVpControllerAuthorize = (options) => (options.client ?? client).get({ url: "/api/issuers/{tenantId}/chained-as-vp/authorize", ...options });
|
|
1435
|
+
var chainedAsVpControllerVpCallback = (options) => (options.client ?? client).get({ url: "/api/issuers/{tenantId}/chained-as-vp/vp-callback", ...options });
|
|
1436
|
+
var chainedAsVpControllerToken = (options) => (options.client ?? client).post({
|
|
1437
|
+
url: "/api/issuers/{tenantId}/chained-as-vp/token",
|
|
1438
|
+
...options,
|
|
1439
|
+
headers: {
|
|
1440
|
+
"Content-Type": "application/json",
|
|
1441
|
+
...options.headers
|
|
1442
|
+
}
|
|
1443
|
+
});
|
|
1428
1444
|
var keyChainControllerGetProviders = (options) => (options?.client ?? client).get({
|
|
1429
1445
|
security: [{ scheme: "bearer", type: "http" }],
|
|
1430
1446
|
url: "/api/key-chain/providers",
|
|
@@ -1435,6 +1451,25 @@ var keyChainControllerGetProvidersHealth = (options) => (options?.client ?? clie
|
|
|
1435
1451
|
url: "/api/key-chain/providers/health",
|
|
1436
1452
|
...options
|
|
1437
1453
|
});
|
|
1454
|
+
var keyChainControllerDeleteTenantKmsConfig = (options) => (options?.client ?? client).delete({
|
|
1455
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1456
|
+
url: "/api/key-chain/providers/config",
|
|
1457
|
+
...options
|
|
1458
|
+
});
|
|
1459
|
+
var keyChainControllerGetTenantKmsConfig = (options) => (options?.client ?? client).get({
|
|
1460
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1461
|
+
url: "/api/key-chain/providers/config",
|
|
1462
|
+
...options
|
|
1463
|
+
});
|
|
1464
|
+
var keyChainControllerUpdateTenantKmsConfig = (options) => (options.client ?? client).put({
|
|
1465
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1466
|
+
url: "/api/key-chain/providers/config",
|
|
1467
|
+
...options,
|
|
1468
|
+
headers: {
|
|
1469
|
+
"Content-Type": "application/json",
|
|
1470
|
+
...options.headers
|
|
1471
|
+
}
|
|
1472
|
+
});
|
|
1438
1473
|
var keyChainControllerGetAll = (options) => (options?.client ?? client).get({
|
|
1439
1474
|
security: [{ scheme: "bearer", type: "http" }],
|
|
1440
1475
|
url: "/api/key-chain",
|
|
@@ -1629,7 +1664,8 @@ var EudiploClient = class {
|
|
|
1629
1664
|
response_type: options.responseType ?? "uri",
|
|
1630
1665
|
credentialConfigurationIds: options.credentialConfigurationIds,
|
|
1631
1666
|
flow: options.flow ?? "pre_authorized_code",
|
|
1632
|
-
tx_code: options.txCode
|
|
1667
|
+
tx_code: options.txCode,
|
|
1668
|
+
authorization_server: options.authorizationServer
|
|
1633
1669
|
};
|
|
1634
1670
|
if (options.claims) {
|
|
1635
1671
|
const credentialClaims = {};
|
|
@@ -2051,6 +2087,40 @@ async function submitDcApiResponse(options) {
|
|
|
2051
2087
|
|
|
2052
2088
|
// src/config/derive.ts
|
|
2053
2089
|
var JSON_SCHEMA_DRAFT_2020_12 = "https://json-schema.org/draft/2020-12/schema";
|
|
2090
|
+
function resolveChildPath(parentPath, parentType, childPath) {
|
|
2091
|
+
if (childPath.length >= parentPath.length) {
|
|
2092
|
+
const startsWithParent = parentPath.every((seg, i) => seg === childPath[i]);
|
|
2093
|
+
if (startsWithParent) {
|
|
2094
|
+
return childPath;
|
|
2095
|
+
}
|
|
2096
|
+
}
|
|
2097
|
+
if (parentType === "array" && childPath.length > 0) {
|
|
2098
|
+
if (childPath[0] === null) {
|
|
2099
|
+
throw new Error(
|
|
2100
|
+
"Relative child paths under array parents must not start with null. Use ['field'] instead of [null, 'field']."
|
|
2101
|
+
);
|
|
2102
|
+
}
|
|
2103
|
+
if (typeof childPath[0] !== "number") {
|
|
2104
|
+
return [...parentPath, null, ...childPath];
|
|
2105
|
+
}
|
|
2106
|
+
}
|
|
2107
|
+
return [...parentPath, ...childPath];
|
|
2108
|
+
}
|
|
2109
|
+
function flattenFields(fields) {
|
|
2110
|
+
const result = [];
|
|
2111
|
+
for (const field of fields) {
|
|
2112
|
+
const { children, ...fieldWithoutChildren } = field;
|
|
2113
|
+
result.push(fieldWithoutChildren);
|
|
2114
|
+
if (children && children.length > 0) {
|
|
2115
|
+
const resolvedChildren = children.map((child) => ({
|
|
2116
|
+
...child,
|
|
2117
|
+
path: resolveChildPath(field.path, field.type, child.path)
|
|
2118
|
+
}));
|
|
2119
|
+
result.push(...flattenFields(resolvedChildren));
|
|
2120
|
+
}
|
|
2121
|
+
}
|
|
2122
|
+
return result;
|
|
2123
|
+
}
|
|
2054
2124
|
function segmentToKey(segment) {
|
|
2055
2125
|
if (segment === null) {
|
|
2056
2126
|
return "*";
|
|
@@ -2121,9 +2191,25 @@ function mergeLeafSchema(existing, next) {
|
|
|
2121
2191
|
}
|
|
2122
2192
|
return merged;
|
|
2123
2193
|
}
|
|
2194
|
+
function isArrayPathSegment(segment) {
|
|
2195
|
+
return typeof segment === "number" || segment === null;
|
|
2196
|
+
}
|
|
2124
2197
|
function ensureSchemaNode(root, path) {
|
|
2125
2198
|
let cursor = root;
|
|
2126
2199
|
for (const segment of path) {
|
|
2200
|
+
if (isArrayPathSegment(segment)) {
|
|
2201
|
+
if (cursor.type !== "array") {
|
|
2202
|
+
cursor.type = "array";
|
|
2203
|
+
}
|
|
2204
|
+
if (!cursor.items || typeof cursor.items !== "object" || Array.isArray(cursor.items)) {
|
|
2205
|
+
cursor.items = {
|
|
2206
|
+
type: "object",
|
|
2207
|
+
properties: {}
|
|
2208
|
+
};
|
|
2209
|
+
}
|
|
2210
|
+
cursor = cursor.items;
|
|
2211
|
+
continue;
|
|
2212
|
+
}
|
|
2127
2213
|
const key = segmentToKey(segment);
|
|
2128
2214
|
cursor.properties ??= {};
|
|
2129
2215
|
if (!cursor.properties[key]) {
|
|
@@ -2150,7 +2236,7 @@ function ensureFrameNode(root, path) {
|
|
|
2150
2236
|
}
|
|
2151
2237
|
function buildClaims(fields) {
|
|
2152
2238
|
const claims = {};
|
|
2153
|
-
for (const field of fields) {
|
|
2239
|
+
for (const field of flattenFields(fields)) {
|
|
2154
2240
|
if (!Object.prototype.hasOwnProperty.call(field, "defaultValue")) {
|
|
2155
2241
|
continue;
|
|
2156
2242
|
}
|
|
@@ -2161,7 +2247,7 @@ function buildClaims(fields) {
|
|
|
2161
2247
|
function buildDisclosureFrame(fields) {
|
|
2162
2248
|
const frame = {};
|
|
2163
2249
|
let hasDisclosure = false;
|
|
2164
|
-
for (const field of fields) {
|
|
2250
|
+
for (const field of flattenFields(fields)) {
|
|
2165
2251
|
if (!field.disclosable || field.path.length === 0) {
|
|
2166
2252
|
continue;
|
|
2167
2253
|
}
|
|
@@ -2178,7 +2264,7 @@ function buildDisclosureFrame(fields) {
|
|
|
2178
2264
|
return hasDisclosure ? frame : void 0;
|
|
2179
2265
|
}
|
|
2180
2266
|
function buildClaimsMetadata(fields) {
|
|
2181
|
-
return fields.filter((field) => field.path.length > 0).map((field) => {
|
|
2267
|
+
return flattenFields(fields).filter((field) => field.path.length > 0).map((field) => {
|
|
2182
2268
|
const metadata = {
|
|
2183
2269
|
path: field.path
|
|
2184
2270
|
};
|
|
@@ -2194,11 +2280,8 @@ function buildClaimsMetadata(fields) {
|
|
|
2194
2280
|
function buildLeafSchema(field) {
|
|
2195
2281
|
const schema = {
|
|
2196
2282
|
...field.constraints,
|
|
2197
|
-
type: field.type
|
|
2283
|
+
type: field.type
|
|
2198
2284
|
};
|
|
2199
|
-
if (field.type === "date" && !schema.format) {
|
|
2200
|
-
schema.format = "date";
|
|
2201
|
-
}
|
|
2202
2285
|
const title = getDisplayTitle(field.display);
|
|
2203
2286
|
if (title) {
|
|
2204
2287
|
schema.title = title;
|
|
@@ -2219,14 +2302,23 @@ function buildJsonSchema(fields) {
|
|
|
2219
2302
|
type: "object",
|
|
2220
2303
|
properties: {}
|
|
2221
2304
|
};
|
|
2222
|
-
for (const field of fields) {
|
|
2305
|
+
for (const field of flattenFields(fields)) {
|
|
2223
2306
|
if (field.path.length === 0) {
|
|
2224
2307
|
continue;
|
|
2225
2308
|
}
|
|
2226
2309
|
const parent = ensureSchemaNode(root, field.path.slice(0, -1));
|
|
2227
|
-
const
|
|
2228
|
-
parent.properties ??= {};
|
|
2310
|
+
const leafSegment = field.path.at(-1);
|
|
2229
2311
|
const leafSchema = buildLeafSchema(field);
|
|
2312
|
+
if (isArrayPathSegment(leafSegment ?? null)) {
|
|
2313
|
+
if (parent.type !== "array") {
|
|
2314
|
+
parent.type = "array";
|
|
2315
|
+
}
|
|
2316
|
+
const existingItems = parent.items && typeof parent.items === "object" && !Array.isArray(parent.items) ? parent.items : void 0;
|
|
2317
|
+
parent.items = existingItems ? mergeLeafSchema(existingItems, leafSchema) : leafSchema;
|
|
2318
|
+
continue;
|
|
2319
|
+
}
|
|
2320
|
+
const leafKey = segmentToKey(leafSegment ?? "");
|
|
2321
|
+
parent.properties ??= {};
|
|
2230
2322
|
const existing = parent.properties[leafKey];
|
|
2231
2323
|
parent.properties[leafKey] = existing && typeof existing === "object" && !Array.isArray(existing) ? mergeLeafSchema(existing, leafSchema) : leafSchema;
|
|
2232
2324
|
if (field.mandatory) {
|
|
@@ -2237,7 +2329,7 @@ function buildJsonSchema(fields) {
|
|
|
2237
2329
|
}
|
|
2238
2330
|
function buildClaimsByNamespace(fields) {
|
|
2239
2331
|
const byNamespace = {};
|
|
2240
|
-
for (const field of fields) {
|
|
2332
|
+
for (const field of flattenFields(fields)) {
|
|
2241
2333
|
if (!field.namespace || !Object.prototype.hasOwnProperty.call(field, "defaultValue")) {
|
|
2242
2334
|
continue;
|
|
2243
2335
|
}
|
|
@@ -2279,6 +2371,10 @@ exports.cacheControllerClearAllCaches = cacheControllerClearAllCaches;
|
|
|
2279
2371
|
exports.cacheControllerClearStatusListCache = cacheControllerClearStatusListCache;
|
|
2280
2372
|
exports.cacheControllerClearTrustListCache = cacheControllerClearTrustListCache;
|
|
2281
2373
|
exports.cacheControllerGetStats = cacheControllerGetStats;
|
|
2374
|
+
exports.chainedAsVpControllerAuthorize = chainedAsVpControllerAuthorize;
|
|
2375
|
+
exports.chainedAsVpControllerPar = chainedAsVpControllerPar;
|
|
2376
|
+
exports.chainedAsVpControllerToken = chainedAsVpControllerToken;
|
|
2377
|
+
exports.chainedAsVpControllerVpCallback = chainedAsVpControllerVpCallback;
|
|
2282
2378
|
exports.client = client;
|
|
2283
2379
|
exports.clientControllerCreateClient = clientControllerCreateClient;
|
|
2284
2380
|
exports.clientControllerDeleteClient = clientControllerDeleteClient;
|
|
@@ -2296,19 +2392,23 @@ exports.credentialOfferControllerGetOffer = credentialOfferControllerGetOffer;
|
|
|
2296
2392
|
exports.deferredControllerCompleteDeferred = deferredControllerCompleteDeferred;
|
|
2297
2393
|
exports.deferredControllerFailDeferred = deferredControllerFailDeferred;
|
|
2298
2394
|
exports.deriveRuntimeArtifacts = deriveRuntimeArtifacts;
|
|
2395
|
+
exports.flattenFields = flattenFields;
|
|
2299
2396
|
exports.isDcApiAvailable = isDcApiAvailable;
|
|
2300
2397
|
exports.issuanceConfigControllerGetIssuanceConfigurations = issuanceConfigControllerGetIssuanceConfigurations;
|
|
2301
2398
|
exports.issuanceConfigControllerStoreIssuanceConfiguration = issuanceConfigControllerStoreIssuanceConfiguration;
|
|
2302
2399
|
exports.keyChainControllerCreate = keyChainControllerCreate;
|
|
2303
2400
|
exports.keyChainControllerDelete = keyChainControllerDelete;
|
|
2401
|
+
exports.keyChainControllerDeleteTenantKmsConfig = keyChainControllerDeleteTenantKmsConfig;
|
|
2304
2402
|
exports.keyChainControllerExport = keyChainControllerExport;
|
|
2305
2403
|
exports.keyChainControllerGetAll = keyChainControllerGetAll;
|
|
2306
2404
|
exports.keyChainControllerGetById = keyChainControllerGetById;
|
|
2307
2405
|
exports.keyChainControllerGetProviders = keyChainControllerGetProviders;
|
|
2308
2406
|
exports.keyChainControllerGetProvidersHealth = keyChainControllerGetProvidersHealth;
|
|
2407
|
+
exports.keyChainControllerGetTenantKmsConfig = keyChainControllerGetTenantKmsConfig;
|
|
2309
2408
|
exports.keyChainControllerImport = keyChainControllerImport;
|
|
2310
2409
|
exports.keyChainControllerRotate = keyChainControllerRotate;
|
|
2311
2410
|
exports.keyChainControllerUpdate = keyChainControllerUpdate;
|
|
2411
|
+
exports.keyChainControllerUpdateTenantKmsConfig = keyChainControllerUpdateTenantKmsConfig;
|
|
2312
2412
|
exports.presentationManagementControllerConfiguration = presentationManagementControllerConfiguration;
|
|
2313
2413
|
exports.presentationManagementControllerDeleteConfiguration = presentationManagementControllerDeleteConfiguration;
|
|
2314
2414
|
exports.presentationManagementControllerGetConfiguration = presentationManagementControllerGetConfiguration;
|
|
@@ -2329,6 +2429,7 @@ exports.schemaMetadataControllerFindAll = schemaMetadataControllerFindAll;
|
|
|
2329
2429
|
exports.schemaMetadataControllerFindOne = schemaMetadataControllerFindOne;
|
|
2330
2430
|
exports.schemaMetadataControllerGetJwt = schemaMetadataControllerGetJwt;
|
|
2331
2431
|
exports.schemaMetadataControllerGetLatest = schemaMetadataControllerGetLatest;
|
|
2432
|
+
exports.schemaMetadataControllerGetMine = schemaMetadataControllerGetMine;
|
|
2332
2433
|
exports.schemaMetadataControllerGetSchema = schemaMetadataControllerGetSchema;
|
|
2333
2434
|
exports.schemaMetadataControllerGetVersions = schemaMetadataControllerGetVersions;
|
|
2334
2435
|
exports.schemaMetadataControllerGetVocabularies = schemaMetadataControllerGetVocabularies;
|
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",
|
|
@@ -1433,6 +1449,25 @@ var keyChainControllerGetProvidersHealth = (options) => (options?.client ?? clie
|
|
|
1433
1449
|
url: "/api/key-chain/providers/health",
|
|
1434
1450
|
...options
|
|
1435
1451
|
});
|
|
1452
|
+
var keyChainControllerDeleteTenantKmsConfig = (options) => (options?.client ?? client).delete({
|
|
1453
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1454
|
+
url: "/api/key-chain/providers/config",
|
|
1455
|
+
...options
|
|
1456
|
+
});
|
|
1457
|
+
var keyChainControllerGetTenantKmsConfig = (options) => (options?.client ?? client).get({
|
|
1458
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1459
|
+
url: "/api/key-chain/providers/config",
|
|
1460
|
+
...options
|
|
1461
|
+
});
|
|
1462
|
+
var keyChainControllerUpdateTenantKmsConfig = (options) => (options.client ?? client).put({
|
|
1463
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1464
|
+
url: "/api/key-chain/providers/config",
|
|
1465
|
+
...options,
|
|
1466
|
+
headers: {
|
|
1467
|
+
"Content-Type": "application/json",
|
|
1468
|
+
...options.headers
|
|
1469
|
+
}
|
|
1470
|
+
});
|
|
1436
1471
|
var keyChainControllerGetAll = (options) => (options?.client ?? client).get({
|
|
1437
1472
|
security: [{ scheme: "bearer", type: "http" }],
|
|
1438
1473
|
url: "/api/key-chain",
|
|
@@ -1627,7 +1662,8 @@ var EudiploClient = class {
|
|
|
1627
1662
|
response_type: options.responseType ?? "uri",
|
|
1628
1663
|
credentialConfigurationIds: options.credentialConfigurationIds,
|
|
1629
1664
|
flow: options.flow ?? "pre_authorized_code",
|
|
1630
|
-
tx_code: options.txCode
|
|
1665
|
+
tx_code: options.txCode,
|
|
1666
|
+
authorization_server: options.authorizationServer
|
|
1631
1667
|
};
|
|
1632
1668
|
if (options.claims) {
|
|
1633
1669
|
const credentialClaims = {};
|
|
@@ -2049,6 +2085,40 @@ async function submitDcApiResponse(options) {
|
|
|
2049
2085
|
|
|
2050
2086
|
// src/config/derive.ts
|
|
2051
2087
|
var JSON_SCHEMA_DRAFT_2020_12 = "https://json-schema.org/draft/2020-12/schema";
|
|
2088
|
+
function resolveChildPath(parentPath, parentType, childPath) {
|
|
2089
|
+
if (childPath.length >= parentPath.length) {
|
|
2090
|
+
const startsWithParent = parentPath.every((seg, i) => seg === childPath[i]);
|
|
2091
|
+
if (startsWithParent) {
|
|
2092
|
+
return childPath;
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
if (parentType === "array" && childPath.length > 0) {
|
|
2096
|
+
if (childPath[0] === null) {
|
|
2097
|
+
throw new Error(
|
|
2098
|
+
"Relative child paths under array parents must not start with null. Use ['field'] instead of [null, 'field']."
|
|
2099
|
+
);
|
|
2100
|
+
}
|
|
2101
|
+
if (typeof childPath[0] !== "number") {
|
|
2102
|
+
return [...parentPath, null, ...childPath];
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
return [...parentPath, ...childPath];
|
|
2106
|
+
}
|
|
2107
|
+
function flattenFields(fields) {
|
|
2108
|
+
const result = [];
|
|
2109
|
+
for (const field of fields) {
|
|
2110
|
+
const { children, ...fieldWithoutChildren } = field;
|
|
2111
|
+
result.push(fieldWithoutChildren);
|
|
2112
|
+
if (children && children.length > 0) {
|
|
2113
|
+
const resolvedChildren = children.map((child) => ({
|
|
2114
|
+
...child,
|
|
2115
|
+
path: resolveChildPath(field.path, field.type, child.path)
|
|
2116
|
+
}));
|
|
2117
|
+
result.push(...flattenFields(resolvedChildren));
|
|
2118
|
+
}
|
|
2119
|
+
}
|
|
2120
|
+
return result;
|
|
2121
|
+
}
|
|
2052
2122
|
function segmentToKey(segment) {
|
|
2053
2123
|
if (segment === null) {
|
|
2054
2124
|
return "*";
|
|
@@ -2119,9 +2189,25 @@ function mergeLeafSchema(existing, next) {
|
|
|
2119
2189
|
}
|
|
2120
2190
|
return merged;
|
|
2121
2191
|
}
|
|
2192
|
+
function isArrayPathSegment(segment) {
|
|
2193
|
+
return typeof segment === "number" || segment === null;
|
|
2194
|
+
}
|
|
2122
2195
|
function ensureSchemaNode(root, path) {
|
|
2123
2196
|
let cursor = root;
|
|
2124
2197
|
for (const segment of path) {
|
|
2198
|
+
if (isArrayPathSegment(segment)) {
|
|
2199
|
+
if (cursor.type !== "array") {
|
|
2200
|
+
cursor.type = "array";
|
|
2201
|
+
}
|
|
2202
|
+
if (!cursor.items || typeof cursor.items !== "object" || Array.isArray(cursor.items)) {
|
|
2203
|
+
cursor.items = {
|
|
2204
|
+
type: "object",
|
|
2205
|
+
properties: {}
|
|
2206
|
+
};
|
|
2207
|
+
}
|
|
2208
|
+
cursor = cursor.items;
|
|
2209
|
+
continue;
|
|
2210
|
+
}
|
|
2125
2211
|
const key = segmentToKey(segment);
|
|
2126
2212
|
cursor.properties ??= {};
|
|
2127
2213
|
if (!cursor.properties[key]) {
|
|
@@ -2148,7 +2234,7 @@ function ensureFrameNode(root, path) {
|
|
|
2148
2234
|
}
|
|
2149
2235
|
function buildClaims(fields) {
|
|
2150
2236
|
const claims = {};
|
|
2151
|
-
for (const field of fields) {
|
|
2237
|
+
for (const field of flattenFields(fields)) {
|
|
2152
2238
|
if (!Object.prototype.hasOwnProperty.call(field, "defaultValue")) {
|
|
2153
2239
|
continue;
|
|
2154
2240
|
}
|
|
@@ -2159,7 +2245,7 @@ function buildClaims(fields) {
|
|
|
2159
2245
|
function buildDisclosureFrame(fields) {
|
|
2160
2246
|
const frame = {};
|
|
2161
2247
|
let hasDisclosure = false;
|
|
2162
|
-
for (const field of fields) {
|
|
2248
|
+
for (const field of flattenFields(fields)) {
|
|
2163
2249
|
if (!field.disclosable || field.path.length === 0) {
|
|
2164
2250
|
continue;
|
|
2165
2251
|
}
|
|
@@ -2176,7 +2262,7 @@ function buildDisclosureFrame(fields) {
|
|
|
2176
2262
|
return hasDisclosure ? frame : void 0;
|
|
2177
2263
|
}
|
|
2178
2264
|
function buildClaimsMetadata(fields) {
|
|
2179
|
-
return fields.filter((field) => field.path.length > 0).map((field) => {
|
|
2265
|
+
return flattenFields(fields).filter((field) => field.path.length > 0).map((field) => {
|
|
2180
2266
|
const metadata = {
|
|
2181
2267
|
path: field.path
|
|
2182
2268
|
};
|
|
@@ -2192,11 +2278,8 @@ function buildClaimsMetadata(fields) {
|
|
|
2192
2278
|
function buildLeafSchema(field) {
|
|
2193
2279
|
const schema = {
|
|
2194
2280
|
...field.constraints,
|
|
2195
|
-
type: field.type
|
|
2281
|
+
type: field.type
|
|
2196
2282
|
};
|
|
2197
|
-
if (field.type === "date" && !schema.format) {
|
|
2198
|
-
schema.format = "date";
|
|
2199
|
-
}
|
|
2200
2283
|
const title = getDisplayTitle(field.display);
|
|
2201
2284
|
if (title) {
|
|
2202
2285
|
schema.title = title;
|
|
@@ -2217,14 +2300,23 @@ function buildJsonSchema(fields) {
|
|
|
2217
2300
|
type: "object",
|
|
2218
2301
|
properties: {}
|
|
2219
2302
|
};
|
|
2220
|
-
for (const field of fields) {
|
|
2303
|
+
for (const field of flattenFields(fields)) {
|
|
2221
2304
|
if (field.path.length === 0) {
|
|
2222
2305
|
continue;
|
|
2223
2306
|
}
|
|
2224
2307
|
const parent = ensureSchemaNode(root, field.path.slice(0, -1));
|
|
2225
|
-
const
|
|
2226
|
-
parent.properties ??= {};
|
|
2308
|
+
const leafSegment = field.path.at(-1);
|
|
2227
2309
|
const leafSchema = buildLeafSchema(field);
|
|
2310
|
+
if (isArrayPathSegment(leafSegment ?? null)) {
|
|
2311
|
+
if (parent.type !== "array") {
|
|
2312
|
+
parent.type = "array";
|
|
2313
|
+
}
|
|
2314
|
+
const existingItems = parent.items && typeof parent.items === "object" && !Array.isArray(parent.items) ? parent.items : void 0;
|
|
2315
|
+
parent.items = existingItems ? mergeLeafSchema(existingItems, leafSchema) : leafSchema;
|
|
2316
|
+
continue;
|
|
2317
|
+
}
|
|
2318
|
+
const leafKey = segmentToKey(leafSegment ?? "");
|
|
2319
|
+
parent.properties ??= {};
|
|
2228
2320
|
const existing = parent.properties[leafKey];
|
|
2229
2321
|
parent.properties[leafKey] = existing && typeof existing === "object" && !Array.isArray(existing) ? mergeLeafSchema(existing, leafSchema) : leafSchema;
|
|
2230
2322
|
if (field.mandatory) {
|
|
@@ -2235,7 +2327,7 @@ function buildJsonSchema(fields) {
|
|
|
2235
2327
|
}
|
|
2236
2328
|
function buildClaimsByNamespace(fields) {
|
|
2237
2329
|
const byNamespace = {};
|
|
2238
|
-
for (const field of fields) {
|
|
2330
|
+
for (const field of flattenFields(fields)) {
|
|
2239
2331
|
if (!field.namespace || !Object.prototype.hasOwnProperty.call(field, "defaultValue")) {
|
|
2240
2332
|
continue;
|
|
2241
2333
|
}
|
|
@@ -2258,6 +2350,6 @@ function deriveRuntimeArtifacts(fields) {
|
|
|
2258
2350
|
};
|
|
2259
2351
|
}
|
|
2260
2352
|
|
|
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 };
|
|
2353
|
+
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, keyChainControllerDeleteTenantKmsConfig, keyChainControllerExport, keyChainControllerGetAll, keyChainControllerGetById, keyChainControllerGetProviders, keyChainControllerGetProvidersHealth, keyChainControllerGetTenantKmsConfig, keyChainControllerImport, keyChainControllerRotate, keyChainControllerUpdate, keyChainControllerUpdateTenantKmsConfig, 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
2354
|
//# sourceMappingURL=index.mjs.map
|
|
2263
2355
|
//# sourceMappingURL=index.mjs.map
|