@twin.org/engine-types 0.0.2-next.13 → 0.0.2-next.14
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/cjs/index.cjs +201 -110
- package/dist/esm/index.mjs +189 -100
- package/dist/types/components/rightsManagementDap.d.ts +13 -0
- package/dist/types/components/{rightsManagementPnrp.d.ts → rightsManagementDarp.d.ts} +3 -3
- package/dist/types/index.d.ts +7 -4
- package/dist/types/models/IEngineConfig.d.ts +8 -3
- package/dist/types/models/config/rightsManagementDapComponentConfig.d.ts +16 -0
- package/dist/types/models/config/rightsManagementDarpComponentConfig.d.ts +12 -0
- package/dist/types/models/config/rightsManagementPdpComponentConfig.d.ts +4 -1
- package/dist/types/models/config/rightsManagementPnpComponentConfig.d.ts +2 -1
- package/dist/types/models/types/rightsManagementDapComponentType.d.ts +17 -0
- package/dist/types/models/types/rightsManagementDarpComponentType.d.ts +13 -0
- package/docs/changelog.md +15 -0
- package/docs/reference/functions/initialiseRightsManagementDapComponent.md +41 -0
- package/docs/reference/functions/{initialiseRightsManagementPnrpComponent.md → initialiseRightsManagementDarpComponent.md} +4 -4
- package/docs/reference/index.md +8 -4
- package/docs/reference/interfaces/IEngineConfig.md +9 -3
- package/docs/reference/type-aliases/RightsManagementDapComponentConfig.md +5 -0
- package/docs/reference/type-aliases/RightsManagementDapComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementDarpComponentConfig.md +23 -0
- package/docs/reference/type-aliases/RightsManagementDarpComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPdpComponentConfig.md +7 -1
- package/docs/reference/type-aliases/RightsManagementPnpComponentConfig.md +1 -1
- package/docs/reference/variables/RightsManagementDapComponentType.md +19 -0
- package/docs/reference/variables/RightsManagementDarpComponentType.md +13 -0
- package/package.json +4 -3
- package/dist/types/models/config/rightsManagementPnrpComponentConfig.d.ts +0 -9
- package/dist/types/models/types/rightsManagementPnrpComponentType.d.ts +0 -13
- package/docs/reference/type-aliases/RightsManagementPnrpComponentConfig.md +0 -17
- package/docs/reference/type-aliases/RightsManagementPnrpComponentType.md +0 -5
- package/docs/reference/variables/RightsManagementPnrpComponentType.md +0 -13
package/dist/cjs/index.cjs
CHANGED
|
@@ -75,10 +75,11 @@ var nftConnectorIota = require('@twin.org/nft-connector-iota');
|
|
|
75
75
|
var nftModels = require('@twin.org/nft-models');
|
|
76
76
|
var nftRestClient = require('@twin.org/nft-rest-client');
|
|
77
77
|
var nftService = require('@twin.org/nft-service');
|
|
78
|
-
var
|
|
78
|
+
var rightsManagementDapService = require('@twin.org/rights-management-dap-service');
|
|
79
79
|
var rightsManagementRestClient = require('@twin.org/rights-management-rest-client');
|
|
80
|
-
var
|
|
80
|
+
var rightsManagementPapService = require('@twin.org/rights-management-pap-service');
|
|
81
81
|
var engineCore = require('@twin.org/engine-core');
|
|
82
|
+
var rightsManagementPdpService = require('@twin.org/rights-management-pdp-service');
|
|
82
83
|
var rightsManagementPepService = require('@twin.org/rights-management-pep-service');
|
|
83
84
|
var rightsManagementPipService = require('@twin.org/rights-management-pip-service');
|
|
84
85
|
var rightsManagementPmpService = require('@twin.org/rights-management-pmp-service');
|
|
@@ -2292,6 +2293,126 @@ async function initialiseNftComponent(engineCore, context, instanceConfig, overr
|
|
|
2292
2293
|
return finalInstanceType;
|
|
2293
2294
|
}
|
|
2294
2295
|
|
|
2296
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2297
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2298
|
+
/**
|
|
2299
|
+
* Rights management DAP component types.
|
|
2300
|
+
*/
|
|
2301
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2302
|
+
const RightsManagementDapComponentType = {
|
|
2303
|
+
/**
|
|
2304
|
+
* Service.
|
|
2305
|
+
*/
|
|
2306
|
+
Service: "service",
|
|
2307
|
+
/**
|
|
2308
|
+
* REST client.
|
|
2309
|
+
*/
|
|
2310
|
+
RestClient: "rest-client"
|
|
2311
|
+
};
|
|
2312
|
+
|
|
2313
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2314
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2315
|
+
/**
|
|
2316
|
+
* Initialise the rights management DAP component.
|
|
2317
|
+
* @param engineCore The engine core.
|
|
2318
|
+
* @param context The context for the engine.
|
|
2319
|
+
* @param instanceConfig The instance config.
|
|
2320
|
+
* @param overrideInstanceType The instance type to override the default.
|
|
2321
|
+
* @returns The name of the instance created.
|
|
2322
|
+
* @throws GeneralError if the component type is unknown.
|
|
2323
|
+
*/
|
|
2324
|
+
async function initialiseRightsManagementDapComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2325
|
+
engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
|
|
2326
|
+
element: `Rights Management DAP Component: ${instanceConfig.type}`
|
|
2327
|
+
}));
|
|
2328
|
+
const type = instanceConfig.type;
|
|
2329
|
+
let component;
|
|
2330
|
+
let instanceType;
|
|
2331
|
+
if (type === RightsManagementDapComponentType.Service) {
|
|
2332
|
+
component = new rightsManagementDapService.DataAccessPointService({
|
|
2333
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2334
|
+
identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
|
|
2335
|
+
policyEnforcementPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPepComponent"),
|
|
2336
|
+
...instanceConfig.options,
|
|
2337
|
+
config: {
|
|
2338
|
+
...instanceConfig.options?.config
|
|
2339
|
+
}
|
|
2340
|
+
});
|
|
2341
|
+
instanceType = core.StringHelper.kebabCase("DataAccessPointService");
|
|
2342
|
+
}
|
|
2343
|
+
else if (type === RightsManagementDapComponentType.RestClient) {
|
|
2344
|
+
component = new rightsManagementRestClient.DataAccessPointClient(instanceConfig.options);
|
|
2345
|
+
instanceType = core.StringHelper.kebabCase("DataAccessPointClient");
|
|
2346
|
+
}
|
|
2347
|
+
else {
|
|
2348
|
+
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
2349
|
+
type,
|
|
2350
|
+
componentType: "RightsManagementDapComponent"
|
|
2351
|
+
});
|
|
2352
|
+
}
|
|
2353
|
+
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2354
|
+
context.componentInstances.push({
|
|
2355
|
+
instanceType: finalInstanceType,
|
|
2356
|
+
component
|
|
2357
|
+
});
|
|
2358
|
+
core.ComponentFactory.register(finalInstanceType, () => component);
|
|
2359
|
+
return finalInstanceType;
|
|
2360
|
+
}
|
|
2361
|
+
|
|
2362
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2363
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2364
|
+
/**
|
|
2365
|
+
* Rights management DARP component types.
|
|
2366
|
+
*/
|
|
2367
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2368
|
+
const RightsManagementDarpComponentType = {
|
|
2369
|
+
/**
|
|
2370
|
+
* Service.
|
|
2371
|
+
*/
|
|
2372
|
+
Service: "service"
|
|
2373
|
+
};
|
|
2374
|
+
|
|
2375
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2376
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2377
|
+
/**
|
|
2378
|
+
* Initialise the rights management DARP component.
|
|
2379
|
+
* @param engineCore The engine core.
|
|
2380
|
+
* @param context The context for the engine.
|
|
2381
|
+
* @param instanceConfig The instance config.
|
|
2382
|
+
* @param overrideInstanceType The instance type to override the default.
|
|
2383
|
+
* @returns The name of the instance created.
|
|
2384
|
+
* @throws GeneralError if the component type is unknown.
|
|
2385
|
+
*/
|
|
2386
|
+
async function initialiseRightsManagementDarpComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2387
|
+
engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
|
|
2388
|
+
element: `Rights Management DARP Component: ${instanceConfig.type}`
|
|
2389
|
+
}));
|
|
2390
|
+
const type = instanceConfig.type;
|
|
2391
|
+
let component;
|
|
2392
|
+
let instanceType;
|
|
2393
|
+
if (type === RightsManagementDarpComponentType.Service) {
|
|
2394
|
+
component = new rightsManagementDapService.DataAccessRequestPointService({
|
|
2395
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2396
|
+
identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
|
|
2397
|
+
...instanceConfig.options
|
|
2398
|
+
});
|
|
2399
|
+
instanceType = core.StringHelper.kebabCase("DataAccessRequestPointService");
|
|
2400
|
+
}
|
|
2401
|
+
else {
|
|
2402
|
+
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
2403
|
+
type,
|
|
2404
|
+
componentType: "RightsManagementDarpComponent"
|
|
2405
|
+
});
|
|
2406
|
+
}
|
|
2407
|
+
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2408
|
+
context.componentInstances.push({
|
|
2409
|
+
instanceType: finalInstanceType,
|
|
2410
|
+
component
|
|
2411
|
+
});
|
|
2412
|
+
core.ComponentFactory.register(finalInstanceType, () => component);
|
|
2413
|
+
return finalInstanceType;
|
|
2414
|
+
}
|
|
2415
|
+
|
|
2295
2416
|
// Copyright 2024 IOTA Stiftung.
|
|
2296
2417
|
// SPDX-License-Identifier: Apache-2.0.
|
|
2297
2418
|
/**
|
|
@@ -2379,20 +2500,33 @@ const RightsManagementPdpComponentType = {
|
|
|
2379
2500
|
* @returns The name of the instance created.
|
|
2380
2501
|
* @throws GeneralError if the component type is unknown.
|
|
2381
2502
|
*/
|
|
2382
|
-
async function initialiseRightsManagementPdpComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2383
|
-
engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
|
|
2503
|
+
async function initialiseRightsManagementPdpComponent(engineCore$1, context, instanceConfig, overrideInstanceType) {
|
|
2504
|
+
engineCore$1.logInfo(core.I18n.formatMessage("engineCore.configuring", {
|
|
2384
2505
|
element: `Rights Management PDP Component: ${instanceConfig.type}`
|
|
2385
2506
|
}));
|
|
2386
2507
|
const type = instanceConfig.type;
|
|
2387
2508
|
let component;
|
|
2388
2509
|
let instanceType;
|
|
2389
2510
|
if (type === RightsManagementPdpComponentType.Service) {
|
|
2511
|
+
const arbiterModules = [];
|
|
2512
|
+
if (core.Is.arrayValue(instanceConfig.options?.arbiterModulesConfig)) {
|
|
2513
|
+
for (const moduleConfig of instanceConfig.options.arbiterModulesConfig) {
|
|
2514
|
+
arbiterModules.push({
|
|
2515
|
+
arbiterId: moduleConfig.id,
|
|
2516
|
+
arbiter: await engineCore.EngineModuleHelper.loadComponent(engineCore$1, moduleConfig)
|
|
2517
|
+
});
|
|
2518
|
+
}
|
|
2519
|
+
}
|
|
2390
2520
|
component = new rightsManagementPdpService.PolicyDecisionPointService({
|
|
2391
|
-
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2392
|
-
policyInformationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPipComponent"),
|
|
2393
|
-
policyManagementPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPmpComponent"),
|
|
2394
|
-
policyExecutionPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPxpComponent"),
|
|
2395
|
-
...instanceConfig.options
|
|
2521
|
+
loggingComponentType: engineCore$1.getRegisteredInstanceType("loggingComponent"),
|
|
2522
|
+
policyInformationPointComponentType: engineCore$1.getRegisteredInstanceType("rightsManagementPipComponent"),
|
|
2523
|
+
policyManagementPointComponentType: engineCore$1.getRegisteredInstanceType("rightsManagementPmpComponent"),
|
|
2524
|
+
policyExecutionPointComponentType: engineCore$1.getRegisteredInstanceType("rightsManagementPxpComponent"),
|
|
2525
|
+
...instanceConfig.options,
|
|
2526
|
+
config: {
|
|
2527
|
+
...instanceConfig.options?.config,
|
|
2528
|
+
arbiters: instanceConfig.options?.config?.arbiters ?? arbiterModules
|
|
2529
|
+
}
|
|
2396
2530
|
});
|
|
2397
2531
|
instanceType = core.StringHelper.kebabCase("PolicyDecisionPointService");
|
|
2398
2532
|
}
|
|
@@ -2447,10 +2581,10 @@ async function initialiseRightsManagementPepComponent(engineCore$1, context, ins
|
|
|
2447
2581
|
let component;
|
|
2448
2582
|
let instanceType;
|
|
2449
2583
|
if (type === RightsManagementPepComponentType.Service) {
|
|
2450
|
-
const
|
|
2584
|
+
const processorModules = [];
|
|
2451
2585
|
if (core.Is.arrayValue(instanceConfig.options?.processorModulesConfig)) {
|
|
2452
2586
|
for (const moduleConfig of instanceConfig.options.processorModulesConfig) {
|
|
2453
|
-
|
|
2587
|
+
processorModules.push({
|
|
2454
2588
|
processorId: moduleConfig.id,
|
|
2455
2589
|
processor: await engineCore.EngineModuleHelper.loadComponent(engineCore$1, moduleConfig)
|
|
2456
2590
|
});
|
|
@@ -2462,7 +2596,7 @@ async function initialiseRightsManagementPepComponent(engineCore$1, context, ins
|
|
|
2462
2596
|
...instanceConfig.options,
|
|
2463
2597
|
config: {
|
|
2464
2598
|
...instanceConfig.options?.config,
|
|
2465
|
-
processors: instanceConfig.options?.config?.processors ??
|
|
2599
|
+
processors: instanceConfig.options?.config?.processors ?? processorModules
|
|
2466
2600
|
}
|
|
2467
2601
|
});
|
|
2468
2602
|
instanceType = core.StringHelper.kebabCase("PolicyEnforcementPointService");
|
|
@@ -2514,10 +2648,10 @@ async function initialiseRightsManagementPipComponent(engineCore$1, context, ins
|
|
|
2514
2648
|
let component;
|
|
2515
2649
|
let instanceType;
|
|
2516
2650
|
if (type === RightsManagementPipComponentType.Service) {
|
|
2517
|
-
const
|
|
2651
|
+
const informationSourceModules = [];
|
|
2518
2652
|
if (core.Is.arrayValue(instanceConfig.options?.informationModulesConfig)) {
|
|
2519
2653
|
for (const moduleConfig of instanceConfig.options.informationModulesConfig) {
|
|
2520
|
-
|
|
2654
|
+
informationSourceModules.push({
|
|
2521
2655
|
sourceId: moduleConfig.id,
|
|
2522
2656
|
source: await engineCore.EngineModuleHelper.loadComponent(engineCore$1, moduleConfig)
|
|
2523
2657
|
});
|
|
@@ -2528,7 +2662,7 @@ async function initialiseRightsManagementPipComponent(engineCore$1, context, ins
|
|
|
2528
2662
|
...instanceConfig.options,
|
|
2529
2663
|
config: {
|
|
2530
2664
|
...instanceConfig.options?.config,
|
|
2531
|
-
sources: instanceConfig.options?.config?.sources ??
|
|
2665
|
+
sources: instanceConfig.options?.config?.sources ?? informationSourceModules
|
|
2532
2666
|
}
|
|
2533
2667
|
});
|
|
2534
2668
|
instanceType = core.StringHelper.kebabCase("PolicyInformationPointService");
|
|
@@ -2602,84 +2736,6 @@ async function initialiseRightsManagementPmpComponent(engineCore, context, insta
|
|
|
2602
2736
|
return finalInstanceType;
|
|
2603
2737
|
}
|
|
2604
2738
|
|
|
2605
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2606
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2607
|
-
/**
|
|
2608
|
-
* Rights management PNP component types.
|
|
2609
|
-
*/
|
|
2610
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2611
|
-
const RightsManagementPnpComponentType = {
|
|
2612
|
-
/**
|
|
2613
|
-
* Service.
|
|
2614
|
-
*/
|
|
2615
|
-
Service: "service",
|
|
2616
|
-
/**
|
|
2617
|
-
* REST client.
|
|
2618
|
-
*/
|
|
2619
|
-
RestClient: "rest-client"
|
|
2620
|
-
};
|
|
2621
|
-
|
|
2622
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2623
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2624
|
-
/**
|
|
2625
|
-
* Initialise the rights management PNP component.
|
|
2626
|
-
* @param engineCore The engine core.
|
|
2627
|
-
* @param context The context for the engine.
|
|
2628
|
-
* @param instanceConfig The instance config.
|
|
2629
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
2630
|
-
* @returns The name of the instance created.
|
|
2631
|
-
* @throws GeneralError if the component type is unknown.
|
|
2632
|
-
*/
|
|
2633
|
-
async function initialiseRightsManagementPnpComponent(engineCore$1, context, instanceConfig, overrideInstanceType) {
|
|
2634
|
-
engineCore$1.logInfo(core.I18n.formatMessage("engineCore.configuring", {
|
|
2635
|
-
element: `Rights Management PNP Component: ${instanceConfig.type}`
|
|
2636
|
-
}));
|
|
2637
|
-
const type = instanceConfig.type;
|
|
2638
|
-
let component;
|
|
2639
|
-
let instanceType;
|
|
2640
|
-
if (type === RightsManagementPnpComponentType.Service) {
|
|
2641
|
-
const modules = [];
|
|
2642
|
-
if (core.Is.arrayValue(instanceConfig.options?.negotiatorModulesConfig)) {
|
|
2643
|
-
for (const moduleConfig of instanceConfig.options.negotiatorModulesConfig) {
|
|
2644
|
-
modules.push({
|
|
2645
|
-
negotiatorId: moduleConfig.id,
|
|
2646
|
-
negotiator: await engineCore.EngineModuleHelper.loadComponent(engineCore$1, moduleConfig)
|
|
2647
|
-
});
|
|
2648
|
-
}
|
|
2649
|
-
}
|
|
2650
|
-
component = new rightsManagementPnpService.PolicyNegotiationPointService({
|
|
2651
|
-
loggingComponentType: engineCore$1.getRegisteredInstanceType("loggingComponent"),
|
|
2652
|
-
identityConnectorType: engineCore$1.getRegisteredInstanceType("identityConnector"),
|
|
2653
|
-
policyNegotiationAdministrationPointComponentType: engineCore$1.getRegisteredInstanceType("rightsManagementPnapComponent"),
|
|
2654
|
-
policyAdministrationPointComponentType: engineCore$1.getRegisteredInstanceType("rightsManagementPapComponent"),
|
|
2655
|
-
policyInformationPointComponentType: engineCore$1.getRegisteredInstanceType("rightsManagementPipComponent"),
|
|
2656
|
-
...instanceConfig.options,
|
|
2657
|
-
config: {
|
|
2658
|
-
...instanceConfig.options?.config,
|
|
2659
|
-
negotiators: instanceConfig.options?.config?.negotiators ?? modules
|
|
2660
|
-
}
|
|
2661
|
-
});
|
|
2662
|
-
instanceType = core.StringHelper.kebabCase("PolicyNegotiationPointService");
|
|
2663
|
-
}
|
|
2664
|
-
else if (type === RightsManagementPnpComponentType.RestClient) {
|
|
2665
|
-
component = new rightsManagementRestClient.PolicyNegotiationPointClient(instanceConfig.options);
|
|
2666
|
-
instanceType = core.StringHelper.kebabCase("PolicyNegotiationPointClient");
|
|
2667
|
-
}
|
|
2668
|
-
else {
|
|
2669
|
-
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
2670
|
-
type,
|
|
2671
|
-
componentType: "RightsManagementPnpComponent"
|
|
2672
|
-
});
|
|
2673
|
-
}
|
|
2674
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2675
|
-
context.componentInstances.push({
|
|
2676
|
-
instanceType: finalInstanceType,
|
|
2677
|
-
component
|
|
2678
|
-
});
|
|
2679
|
-
core.ComponentFactory.register(finalInstanceType, () => component);
|
|
2680
|
-
return finalInstanceType;
|
|
2681
|
-
}
|
|
2682
|
-
|
|
2683
2739
|
// Copyright 2024 IOTA Stiftung.
|
|
2684
2740
|
// SPDX-License-Identifier: Apache-2.0.
|
|
2685
2741
|
/**
|
|
@@ -2748,20 +2804,24 @@ async function initialiseRightsManagementPnapComponent(engineCore, context, inst
|
|
|
2748
2804
|
// Copyright 2024 IOTA Stiftung.
|
|
2749
2805
|
// SPDX-License-Identifier: Apache-2.0.
|
|
2750
2806
|
/**
|
|
2751
|
-
* Rights management
|
|
2807
|
+
* Rights management PNP component types.
|
|
2752
2808
|
*/
|
|
2753
2809
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2754
|
-
const
|
|
2810
|
+
const RightsManagementPnpComponentType = {
|
|
2755
2811
|
/**
|
|
2756
2812
|
* Service.
|
|
2757
2813
|
*/
|
|
2758
|
-
Service: "service"
|
|
2814
|
+
Service: "service",
|
|
2815
|
+
/**
|
|
2816
|
+
* REST client.
|
|
2817
|
+
*/
|
|
2818
|
+
RestClient: "rest-client"
|
|
2759
2819
|
};
|
|
2760
2820
|
|
|
2761
2821
|
// Copyright 2024 IOTA Stiftung.
|
|
2762
2822
|
// SPDX-License-Identifier: Apache-2.0.
|
|
2763
2823
|
/**
|
|
2764
|
-
* Initialise the rights management
|
|
2824
|
+
* Initialise the rights management PNP component.
|
|
2765
2825
|
* @param engineCore The engine core.
|
|
2766
2826
|
* @param context The context for the engine.
|
|
2767
2827
|
* @param instanceConfig The instance config.
|
|
@@ -2769,26 +2829,55 @@ const RightsManagementPnrpComponentType = {
|
|
|
2769
2829
|
* @returns The name of the instance created.
|
|
2770
2830
|
* @throws GeneralError if the component type is unknown.
|
|
2771
2831
|
*/
|
|
2772
|
-
async function
|
|
2773
|
-
engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
|
|
2774
|
-
element: `Rights Management
|
|
2832
|
+
async function initialiseRightsManagementPnpComponent(engineCore$1, context, instanceConfig, overrideInstanceType) {
|
|
2833
|
+
engineCore$1.logInfo(core.I18n.formatMessage("engineCore.configuring", {
|
|
2834
|
+
element: `Rights Management PNP Component: ${instanceConfig.type}`
|
|
2775
2835
|
}));
|
|
2776
2836
|
const type = instanceConfig.type;
|
|
2777
2837
|
let component;
|
|
2778
2838
|
let instanceType;
|
|
2779
|
-
if (type ===
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2839
|
+
if (type === RightsManagementPnpComponentType.Service) {
|
|
2840
|
+
const negotiatorModules = [];
|
|
2841
|
+
if (core.Is.arrayValue(instanceConfig.options?.negotiatorModulesConfig)) {
|
|
2842
|
+
for (const moduleConfig of instanceConfig.options.negotiatorModulesConfig) {
|
|
2843
|
+
negotiatorModules.push({
|
|
2844
|
+
negotiatorId: moduleConfig.id,
|
|
2845
|
+
negotiator: await engineCore.EngineModuleHelper.loadComponent(engineCore$1, moduleConfig)
|
|
2846
|
+
});
|
|
2847
|
+
}
|
|
2848
|
+
}
|
|
2849
|
+
const requesterModules = [];
|
|
2850
|
+
if (core.Is.arrayValue(instanceConfig.options?.requesterModulesConfig)) {
|
|
2851
|
+
for (const moduleConfig of instanceConfig.options.requesterModulesConfig) {
|
|
2852
|
+
requesterModules.push({
|
|
2853
|
+
requesterId: moduleConfig.id,
|
|
2854
|
+
requester: await engineCore.EngineModuleHelper.loadComponent(engineCore$1, moduleConfig)
|
|
2855
|
+
});
|
|
2856
|
+
}
|
|
2857
|
+
}
|
|
2858
|
+
component = new rightsManagementPnpService.PolicyNegotiationPointService({
|
|
2859
|
+
loggingComponentType: engineCore$1.getRegisteredInstanceType("loggingComponent"),
|
|
2860
|
+
identityConnectorType: engineCore$1.getRegisteredInstanceType("identityConnector"),
|
|
2861
|
+
policyNegotiationAdministrationPointComponentType: engineCore$1.getRegisteredInstanceType("rightsManagementPnapComponent"),
|
|
2862
|
+
policyAdministrationPointComponentType: engineCore$1.getRegisteredInstanceType("rightsManagementPapComponent"),
|
|
2863
|
+
policyInformationPointComponentType: engineCore$1.getRegisteredInstanceType("rightsManagementPipComponent"),
|
|
2864
|
+
...instanceConfig.options,
|
|
2865
|
+
config: {
|
|
2866
|
+
...instanceConfig.options?.config,
|
|
2867
|
+
negotiators: instanceConfig.options?.config?.negotiators ?? negotiatorModules,
|
|
2868
|
+
requesters: instanceConfig.options?.config?.requesters ?? requesterModules
|
|
2869
|
+
}
|
|
2785
2870
|
});
|
|
2786
|
-
instanceType = core.StringHelper.kebabCase("
|
|
2871
|
+
instanceType = core.StringHelper.kebabCase("PolicyNegotiationPointService");
|
|
2872
|
+
}
|
|
2873
|
+
else if (type === RightsManagementPnpComponentType.RestClient) {
|
|
2874
|
+
component = new rightsManagementRestClient.PolicyNegotiationPointClient(instanceConfig.options);
|
|
2875
|
+
instanceType = core.StringHelper.kebabCase("PolicyNegotiationPointClient");
|
|
2787
2876
|
}
|
|
2788
2877
|
else {
|
|
2789
2878
|
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
2790
2879
|
type,
|
|
2791
|
-
componentType: "
|
|
2880
|
+
componentType: "RightsManagementPnpComponent"
|
|
2792
2881
|
});
|
|
2793
2882
|
}
|
|
2794
2883
|
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
@@ -3424,6 +3513,8 @@ exports.MessagingPushNotificationConnectorType = MessagingPushNotificationConnec
|
|
|
3424
3513
|
exports.MessagingSmsConnectorType = MessagingSmsConnectorType;
|
|
3425
3514
|
exports.NftComponentType = NftComponentType;
|
|
3426
3515
|
exports.NftConnectorType = NftConnectorType;
|
|
3516
|
+
exports.RightsManagementDapComponentType = RightsManagementDapComponentType;
|
|
3517
|
+
exports.RightsManagementDarpComponentType = RightsManagementDarpComponentType;
|
|
3427
3518
|
exports.RightsManagementPapComponentType = RightsManagementPapComponentType;
|
|
3428
3519
|
exports.RightsManagementPdpComponentType = RightsManagementPdpComponentType;
|
|
3429
3520
|
exports.RightsManagementPepComponentType = RightsManagementPepComponentType;
|
|
@@ -3431,7 +3522,6 @@ exports.RightsManagementPipComponentType = RightsManagementPipComponentType;
|
|
|
3431
3522
|
exports.RightsManagementPmpComponentType = RightsManagementPmpComponentType;
|
|
3432
3523
|
exports.RightsManagementPnapComponentType = RightsManagementPnapComponentType;
|
|
3433
3524
|
exports.RightsManagementPnpComponentType = RightsManagementPnpComponentType;
|
|
3434
|
-
exports.RightsManagementPnrpComponentType = RightsManagementPnrpComponentType;
|
|
3435
3525
|
exports.RightsManagementPxpComponentType = RightsManagementPxpComponentType;
|
|
3436
3526
|
exports.SynchronisedStorageComponentType = SynchronisedStorageComponentType;
|
|
3437
3527
|
exports.TaskSchedulerComponentType = TaskSchedulerComponentType;
|
|
@@ -3474,6 +3564,8 @@ exports.initialiseMessagingPushNotificationConnector = initialiseMessagingPushNo
|
|
|
3474
3564
|
exports.initialiseMessagingSmsConnector = initialiseMessagingSmsConnector;
|
|
3475
3565
|
exports.initialiseNftComponent = initialiseNftComponent;
|
|
3476
3566
|
exports.initialiseNftConnector = initialiseNftConnector;
|
|
3567
|
+
exports.initialiseRightsManagementDapComponent = initialiseRightsManagementDapComponent;
|
|
3568
|
+
exports.initialiseRightsManagementDarpComponent = initialiseRightsManagementDarpComponent;
|
|
3477
3569
|
exports.initialiseRightsManagementPapComponent = initialiseRightsManagementPapComponent;
|
|
3478
3570
|
exports.initialiseRightsManagementPdpComponent = initialiseRightsManagementPdpComponent;
|
|
3479
3571
|
exports.initialiseRightsManagementPepComponent = initialiseRightsManagementPepComponent;
|
|
@@ -3481,7 +3573,6 @@ exports.initialiseRightsManagementPipComponent = initialiseRightsManagementPipCo
|
|
|
3481
3573
|
exports.initialiseRightsManagementPmpComponent = initialiseRightsManagementPmpComponent;
|
|
3482
3574
|
exports.initialiseRightsManagementPnapComponent = initialiseRightsManagementPnapComponent;
|
|
3483
3575
|
exports.initialiseRightsManagementPnpComponent = initialiseRightsManagementPnpComponent;
|
|
3484
|
-
exports.initialiseRightsManagementPnrpComponent = initialiseRightsManagementPnrpComponent;
|
|
3485
3576
|
exports.initialiseRightsManagementPxpComponent = initialiseRightsManagementPxpComponent;
|
|
3486
3577
|
exports.initialiseSynchronisedStorageComponent = initialiseSynchronisedStorageComponent;
|
|
3487
3578
|
exports.initialiseTaskSchedulerComponent = initialiseTaskSchedulerComponent;
|