@twin.org/rights-management-models 0.9.1-next.8 → 0.9.1
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/es/index.js +1 -0
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/api/pap/IPapQueryRequest.js.map +1 -1
- package/dist/es/models/odrlTwinVocabulary.js +35 -0
- package/dist/es/models/odrlTwinVocabulary.js.map +1 -0
- package/dist/es/utils/odrlPolicyHelper.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/models/api/pap/IPapQueryRequest.d.ts +4 -0
- package/dist/types/models/odrlTwinVocabulary.d.ts +35 -0
- package/docs/changelog.md +51 -0
- package/docs/reference/index.md +2 -0
- package/docs/reference/interfaces/IPapQueryRequest.md +6 -0
- package/docs/reference/type-aliases/OdrlTwinVocabulary.md +5 -0
- package/docs/reference/variables/OdrlTwinVocabulary.md +43 -0
- package/package.json +13 -13
package/dist/es/index.js
CHANGED
|
@@ -44,6 +44,7 @@ export * from "./models/IRightsManagementPolicyMetadata.js";
|
|
|
44
44
|
export * from "./models/IRightsManagementPolicyTrust.js";
|
|
45
45
|
export * from "./models/IRightsManagementSet.js";
|
|
46
46
|
export * from "./models/odrlProfiles.js";
|
|
47
|
+
export * from "./models/odrlTwinVocabulary.js";
|
|
47
48
|
export * from "./models/pap/IPolicyAdministrationPointComponent.js";
|
|
48
49
|
export * from "./models/pap/IPolicyLocator.js";
|
|
49
50
|
export * from "./models/pdp/IPolicyArbiter.js";
|
package/dist/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,qCAAqC,CAAC;AACpD,cAAc,kDAAkD,CAAC;AACjE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,wCAAwC,CAAC;AACvD,cA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,qCAAqC,CAAC;AACpD,cAAc,kDAAkD,CAAC;AACjE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,kDAAkD,CAAC;AACjE,cAAc,0CAA0C,CAAC;AACzD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iDAAiD,CAAC;AAChE,cAAc,oCAAoC,CAAC;AACnD,cAAc,uDAAuD,CAAC;AACtE,cAAc,kDAAkD,CAAC;AACjE,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,wCAAwC,CAAC;AACvD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,sCAAsC,CAAC;AACrD,cAAc,wCAAwC,CAAC;AACvD,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./factories/policyArbiterFactory.js\";\nexport * from \"./factories/policyEnforcementProcessorFactory.js\";\nexport * from \"./factories/policyExecutionActionFactory.js\";\nexport * from \"./factories/policyInformationSourceFactory.js\";\nexport * from \"./factories/policyNegotiatorFactory.js\";\nexport * from \"./factories/policyObligationEnforcerFactory.js\";\nexport * from \"./factories/policyRequesterFactory.js\";\nexport * from \"./models/api/pap/IPapCreateRequest.js\";\nexport * from \"./models/api/pap/IPapGetAgreementRequest.js\";\nexport * from \"./models/api/pap/IPapGetAgreementResponse.js\";\nexport * from \"./models/api/pap/IPapGetOfferRequest.js\";\nexport * from \"./models/api/pap/IPapGetOfferResponse.js\";\nexport * from \"./models/api/pap/IPapGetRequest.js\";\nexport * from \"./models/api/pap/IPapGetResponse.js\";\nexport * from \"./models/api/pap/IPapGetSetRequest.js\";\nexport * from \"./models/api/pap/IPapGetSetResponse.js\";\nexport * from \"./models/api/pap/IPapQueryRequest.js\";\nexport * from \"./models/api/pap/IPapQueryResponse.js\";\nexport * from \"./models/api/pap/IPapRemoveRequest.js\";\nexport * from \"./models/api/pap/IPapUpdateRequest.js\";\nexport * from \"./models/api/pnap/IPnapCreateRequest.js\";\nexport * from \"./models/api/pnap/IPnapGetRequest.js\";\nexport * from \"./models/api/pnap/IPnapGetResponse.js\";\nexport * from \"./models/api/pnap/IPnapQueryRequest.js\";\nexport * from \"./models/api/pnap/IPnapQueryResponse.js\";\nexport * from \"./models/api/pnap/IPnapRemoveRequest.js\";\nexport * from \"./models/api/pnap/IPnapSetRequest.js\";\nexport * from \"./models/api/pnp/IPnpAgreementRequest.js\";\nexport * from \"./models/api/pnp/IPnpAgreementVerificationRequest.js\";\nexport * from \"./models/api/pnp/IPnpContractNegotiationResponse.js\";\nexport * from \"./models/api/pnp/IPnpContractResponse.js\";\nexport * from \"./models/api/pnp/IPnpEventRequest.js\";\nexport * from \"./models/api/pnp/IPnpNegotiateRequest.js\";\nexport * from \"./models/api/pnp/IPnpNegotiationGetRequest.js\";\nexport * from \"./models/api/pnp/IPnpOfferRequest.js\";\nexport * from \"./models/api/pnp/IPnpTerminateRequest.js\";\nexport * from \"./models/IRightsManagementAgreement.js\";\nexport * from \"./models/IRightsManagementInformation.js\";\nexport * from \"./models/IRightsManagementOffer.js\";\nexport * from \"./models/IRightsManagementPolicy.js\";\nexport * from \"./models/IRightsManagementPolicyMetadata.js\";\nexport * from \"./models/IRightsManagementPolicyTrust.js\";\nexport * from \"./models/IRightsManagementSet.js\";\nexport * from \"./models/odrlProfiles.js\";\nexport * from \"./models/pap/IPolicyAdministrationPointComponent.js\";\nexport * from \"./models/pap/IPolicyLocator.js\";\nexport * from \"./models/pdp/IPolicyArbiter.js\";\nexport * from \"./models/pdp/IPolicyDecision.js\";\nexport * from \"./models/pdp/IPolicyDecisionPointComponent.js\";\nexport * from \"./models/pdp/IPolicyObligationEnforcer.js\";\nexport * from \"./models/pdp/policyDecision.js\";\nexport * from \"./models/pdp/policyDecisionStage.js\";\nexport * from \"./models/pep/IPolicyEnforcementPointComponent.js\";\nexport * from \"./models/pep/IPolicyEnforcementProcessor.js\";\nexport * from \"./models/pip/IPolicyInformationPointComponent.js\";\nexport * from \"./models/pip/IPolicyInformationSource.js\";\nexport * from \"./models/pip/policyInformationAccessMode.js\";\nexport * from \"./models/pmp/IPolicyManagementPointComponent.js\";\nexport * from \"./models/pnp/IPolicyNegotiation.js\";\nexport * from \"./models/pnp/IPolicyNegotiationAdminPointComponent.js\";\nexport * from \"./models/pnp/IPolicyNegotiationPointComponent.js\";\nexport * from \"./models/pnp/IPolicyNegotiator.js\";\nexport * from \"./models/pnp/IPolicyRequester.js\";\nexport * from \"./models/policyMetadataContext.js\";\nexport * from \"./models/pxp/IPolicyExecutionAction.js\";\nexport * from \"./models/pxp/IPolicyExecutionPointComponent.js\";\nexport * from \"./models/rightsManagementContexts.js\";\nexport * from \"./models/rightsManagementNamespaces.js\";\nexport * from \"./models/rightsManagementTypes.js\";\nexport * from \"./utils/odrlPolicyHelper.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,qCAAqC,CAAC;AACpD,cAAc,kDAAkD,CAAC;AACjE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,wCAAwC,CAAC;AACvD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,yCAAyC,CAAC;AACxD,cAAc,0CAA0C,CAAC;AACzD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD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cAAc,sCAAsC,CAAC;AACrD,cAAc,wCAAwC,CAAC;AACvD,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./factories/policyArbiterFactory.js\";\nexport * from \"./factories/policyEnforcementProcessorFactory.js\";\nexport * from \"./factories/policyExecutionActionFactory.js\";\nexport * from \"./factories/policyInformationSourceFactory.js\";\nexport * from \"./factories/policyNegotiatorFactory.js\";\nexport * from \"./factories/policyObligationEnforcerFactory.js\";\nexport * from \"./factories/policyRequesterFactory.js\";\nexport * from \"./models/api/pap/IPapCreateRequest.js\";\nexport * from \"./models/api/pap/IPapGetAgreementRequest.js\";\nexport * from \"./models/api/pap/IPapGetAgreementResponse.js\";\nexport * from \"./models/api/pap/IPapGetOfferRequest.js\";\nexport * from \"./models/api/pap/IPapGetOfferResponse.js\";\nexport * from \"./models/api/pap/IPapGetRequest.js\";\nexport * from \"./models/api/pap/IPapGetResponse.js\";\nexport * from \"./models/api/pap/IPapGetSetRequest.js\";\nexport * from \"./models/api/pap/IPapGetSetResponse.js\";\nexport * from \"./models/api/pap/IPapQueryRequest.js\";\nexport * from \"./models/api/pap/IPapQueryResponse.js\";\nexport * from \"./models/api/pap/IPapRemoveRequest.js\";\nexport * from \"./models/api/pap/IPapUpdateRequest.js\";\nexport * from \"./models/api/pnap/IPnapCreateRequest.js\";\nexport * from \"./models/api/pnap/IPnapGetRequest.js\";\nexport * from \"./models/api/pnap/IPnapGetResponse.js\";\nexport * from \"./models/api/pnap/IPnapQueryRequest.js\";\nexport * from \"./models/api/pnap/IPnapQueryResponse.js\";\nexport * from \"./models/api/pnap/IPnapRemoveRequest.js\";\nexport * from \"./models/api/pnap/IPnapSetRequest.js\";\nexport * from \"./models/api/pnp/IPnpAgreementRequest.js\";\nexport * from \"./models/api/pnp/IPnpAgreementVerificationRequest.js\";\nexport * from \"./models/api/pnp/IPnpContractNegotiationResponse.js\";\nexport * from \"./models/api/pnp/IPnpContractResponse.js\";\nexport * from \"./models/api/pnp/IPnpEventRequest.js\";\nexport * from \"./models/api/pnp/IPnpNegotiateRequest.js\";\nexport * from \"./models/api/pnp/IPnpNegotiationGetRequest.js\";\nexport * from \"./models/api/pnp/IPnpOfferRequest.js\";\nexport * from \"./models/api/pnp/IPnpTerminateRequest.js\";\nexport * from \"./models/IRightsManagementAgreement.js\";\nexport * from \"./models/IRightsManagementInformation.js\";\nexport * from \"./models/IRightsManagementOffer.js\";\nexport * from \"./models/IRightsManagementPolicy.js\";\nexport * from \"./models/IRightsManagementPolicyMetadata.js\";\nexport * from \"./models/IRightsManagementPolicyTrust.js\";\nexport * from \"./models/IRightsManagementSet.js\";\nexport * from \"./models/odrlProfiles.js\";\nexport * from \"./models/odrlTwinVocabulary.js\";\nexport * from \"./models/pap/IPolicyAdministrationPointComponent.js\";\nexport * from \"./models/pap/IPolicyLocator.js\";\nexport * from \"./models/pdp/IPolicyArbiter.js\";\nexport * from \"./models/pdp/IPolicyDecision.js\";\nexport * from \"./models/pdp/IPolicyDecisionPointComponent.js\";\nexport * from \"./models/pdp/IPolicyObligationEnforcer.js\";\nexport * from \"./models/pdp/policyDecision.js\";\nexport * from \"./models/pdp/policyDecisionStage.js\";\nexport * from \"./models/pep/IPolicyEnforcementPointComponent.js\";\nexport * from \"./models/pep/IPolicyEnforcementProcessor.js\";\nexport * from \"./models/pip/IPolicyInformationPointComponent.js\";\nexport * from \"./models/pip/IPolicyInformationSource.js\";\nexport * from \"./models/pip/policyInformationAccessMode.js\";\nexport * from \"./models/pmp/IPolicyManagementPointComponent.js\";\nexport * from \"./models/pnp/IPolicyNegotiation.js\";\nexport * from \"./models/pnp/IPolicyNegotiationAdminPointComponent.js\";\nexport * from \"./models/pnp/IPolicyNegotiationPointComponent.js\";\nexport * from \"./models/pnp/IPolicyNegotiator.js\";\nexport * from \"./models/pnp/IPolicyRequester.js\";\nexport * from \"./models/policyMetadataContext.js\";\nexport * from \"./models/pxp/IPolicyExecutionAction.js\";\nexport * from \"./models/pxp/IPolicyExecutionPointComponent.js\";\nexport * from \"./models/rightsManagementContexts.js\";\nexport * from \"./models/rightsManagementNamespaces.js\";\nexport * from \"./models/rightsManagementTypes.js\";\nexport * from \"./utils/odrlPolicyHelper.js\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IPapQueryRequest.js","sourceRoot":"","sources":["../../../../../src/models/api/pap/IPapQueryRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The request structure for querying policies.\n */\nexport interface IPapQueryRequest {\n\t/**\n\t * The query parameters of the request.\n\t */\n\tquery?: {\n\t\t/**\n\t\t * The assigner to filter by.\n\t\t */\n\t\tassigner?: string;\n\n\t\t/**\n\t\t * The assignee to filter by.\n\t\t */\n\t\tassignee?: string;\n\n\t\t/**\n\t\t * The action to filter by.\n\t\t */\n\t\taction?: string;\n\n\t\t/**\n\t\t * The target to filter by.\n\t\t */\n\t\ttarget?: string;\n\n\t\t/**\n\t\t * The condition for the query.\n\t\t */\n\t\tconditions?: string;\n\n\t\t/**\n\t\t * Limit the number of entities to return.\n\t\t */\n\t\tlimit?: string;\n\n\t\t/**\n\t\t * The cursor to get next chunk of data, returned in previous response.\n\t\t */\n\t\tcursor?: string;\n\t};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IPapQueryRequest.js","sourceRoot":"","sources":["../../../../../src/models/api/pap/IPapQueryRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The request structure for querying policies.\n */\nexport interface IPapQueryRequest {\n\t/**\n\t * The query parameters of the request.\n\t */\n\tquery?: {\n\t\t/**\n\t\t * The type of policy to filter by.\n\t\t */\n\t\ttype?: string;\n\n\t\t/**\n\t\t * The assigner to filter by.\n\t\t */\n\t\tassigner?: string;\n\n\t\t/**\n\t\t * The assignee to filter by.\n\t\t */\n\t\tassignee?: string;\n\n\t\t/**\n\t\t * The action to filter by.\n\t\t */\n\t\taction?: string;\n\n\t\t/**\n\t\t * The target to filter by.\n\t\t */\n\t\ttarget?: string;\n\n\t\t/**\n\t\t * The condition for the query.\n\t\t */\n\t\tconditions?: string;\n\n\t\t/**\n\t\t * Limit the number of entities to return.\n\t\t */\n\t\tlimit?: string;\n\n\t\t/**\n\t\t * The cursor to get next chunk of data, returned in previous response.\n\t\t */\n\t\tcursor?: string;\n\t};\n}\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Copyright 2025 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
/**
|
|
4
|
+
* Canonical TWIN constraint vocabulary used in ODRL policies.
|
|
5
|
+
* Policy authors should reference these constants rather than hand-copying the strings.
|
|
6
|
+
*/
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
8
|
+
export const OdrlTwinVocabulary = {
|
|
9
|
+
/**
|
|
10
|
+
* The canonical TWIN JSONPath constraint source alias.
|
|
11
|
+
* Used as the `source` property of an AssetCollection or as a prefix in
|
|
12
|
+
* composed target identifiers (`twin:jsonPath:<dataSource>:<expression>`).
|
|
13
|
+
*/
|
|
14
|
+
JsonPath: "twin:jsonPath",
|
|
15
|
+
/**
|
|
16
|
+
* Constraint / context property carrying the JSONPath expression to evaluate.
|
|
17
|
+
*/
|
|
18
|
+
JsonPathExpression: "twin:jsonPathExpression",
|
|
19
|
+
/**
|
|
20
|
+
* Optional constraint / context property that selects the named data source.
|
|
21
|
+
* When absent, defaults to "data".
|
|
22
|
+
*/
|
|
23
|
+
JsonPathDataSource: "twin:jsonPathDataSource",
|
|
24
|
+
/**
|
|
25
|
+
* Key used to look up the primary data payload inside the data-sources map
|
|
26
|
+
* passed to the policy arbiter.
|
|
27
|
+
*/
|
|
28
|
+
DataSourceKey: "data",
|
|
29
|
+
/**
|
|
30
|
+
* Key used to look up the information payload inside the data-sources map
|
|
31
|
+
* passed to the policy arbiter.
|
|
32
|
+
*/
|
|
33
|
+
InformationSourceKey: "information"
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=odrlTwinVocabulary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"odrlTwinVocabulary.js","sourceRoot":"","sources":["../../../src/models/odrlTwinVocabulary.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;;GAGG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,kBAAkB,GAAG;IACjC;;;;OAIG;IACH,QAAQ,EAAE,eAAe;IAEzB;;OAEG;IACH,kBAAkB,EAAE,yBAAyB;IAE7C;;;OAGG;IACH,kBAAkB,EAAE,yBAAyB;IAE7C;;;OAGG;IACH,aAAa,EAAE,MAAM;IAErB;;;OAGG;IACH,oBAAoB,EAAE,aAAa;CAC1B,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Canonical TWIN constraint vocabulary used in ODRL policies.\n * Policy authors should reference these constants rather than hand-copying the strings.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const OdrlTwinVocabulary = {\n\t/**\n\t * The canonical TWIN JSONPath constraint source alias.\n\t * Used as the `source` property of an AssetCollection or as a prefix in\n\t * composed target identifiers (`twin:jsonPath:<dataSource>:<expression>`).\n\t */\n\tJsonPath: \"twin:jsonPath\",\n\n\t/**\n\t * Constraint / context property carrying the JSONPath expression to evaluate.\n\t */\n\tJsonPathExpression: \"twin:jsonPathExpression\",\n\n\t/**\n\t * Optional constraint / context property that selects the named data source.\n\t * When absent, defaults to \"data\".\n\t */\n\tJsonPathDataSource: \"twin:jsonPathDataSource\",\n\n\t/**\n\t * Key used to look up the primary data payload inside the data-sources map\n\t * passed to the policy arbiter.\n\t */\n\tDataSourceKey: \"data\",\n\n\t/**\n\t * Key used to look up the information payload inside the data-sources map\n\t * passed to the policy arbiter.\n\t */\n\tInformationSourceKey: \"information\"\n} as const;\n\n/**\n * The ODRL TWIN vocabulary values.\n */\nexport type OdrlTwinVocabulary = (typeof OdrlTwinVocabulary)[keyof typeof OdrlTwinVocabulary];\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odrlPolicyHelper.js","sourceRoot":"","sources":["../../../src/utils/odrlPolicyHelper.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAiBrF;;GAEG;AACH,MAAM,OAAO,gBAAgB;IAC5B;;OAEG;IACI,MAAM,CAAU,UAAU,sBAAsC;IAEvE;;;;OAIG;IACI,MAAM,CAAC,MAAM,CAAC,MAA0B;QAC9C,OAAO,YAAY,CAAC,eAAe,CAAS,MAAM,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;IAClF,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,OAAO,CAAC,MAA0B;QAC/C,OAAO,YAAY,CAAC,eAAe,CAAS,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,uBAAuB,CAAC,MAAgC;QACrE,IAAI,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC/B,MAAM,IAAI,YAAY,CAAC,gBAAgB,CAAC,UAAU,EAAE,uBAAuB,EAAE;gBAC5E,UAAU,EAAE,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE;gBAClD,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;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C3B,MAAkD,EAClD,WAAqB;QAErB,IAAI,EAAE,CAAC,MAAM,CAAa,MAAM,CAAC,EAAE,CAAC;YACnC,MAAM,GAAG,GAAG,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAC5C,IAAI,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;gBACzB,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACvB,CAAC;QACF,CAAC;aAAM,IAAI,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;YACnC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1B,CAAC;IACF,CAAC;IAED;;;;;OAKG;IACK,MAAM,CAAC,aAAa,CAC3B,MAA6C,EAC7C,WAAqB;QAErB,IAAI,EAAE,CAAC,MAAM,CAAc,MAAM,CAAC,EAAE,CAAC;YACpC,MAAM,GAAG,GAAG,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAC5C,IAAI,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;gBACzB,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACvB,CAAC;QACF,CAAC;aAAM,IAAI,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;YACnC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1B,CAAC;IACF,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ObjectOrArray } from \"@twin.org/core\";\nimport { ArrayHelper, GeneralError, Guards, Is, ObjectHelper } from \"@twin.org/core\";\nimport { nameof } from \"@twin.org/nameof\";\nimport type { IDataspaceProtocolPolicy } from \"@twin.org/standards-dataspace-protocol\";\nimport type {\n\tIOdrlAction,\n\tIOdrlAsset,\n\tIOdrlAssetCollection,\n\tIOdrlDuty,\n\tIOdrlParty,\n\tIOdrlPartyCollection,\n\tIOdrlPermission,\n\tIOdrlProhibition,\n\tIOdrlRule,\n\tOdrlActionType\n} from \"@twin.org/standards-w3c-odrl\";\nimport type { IRightsManagementPolicy } from \"../models/IRightsManagementPolicy.js\";\n\n/**\n * Helper methods for Odrl Policies.\n */\nexport class OdrlPolicyHelper {\n\t/**\n\t * The class name of the Policy Administration Point Service.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<OdrlPolicyHelper>();\n\n\t/**\n\t * Get the UID of an ODRL policy or related object if available.\n\t * @param object The ODRL policy or related object to get the UID from.\n\t * @returns The UID of the object if available, otherwise undefined.\n\t */\n\tpublic static getUid(object: object | undefined): string | undefined {\n\t\treturn ObjectHelper.extractProperty<string>(object, [\"@id\", \"id\", \"uid\"], false);\n\t}\n\n\t/**\n\t * Get the type of an ODRL policy or related object if available.\n\t * @param object The ODRL policy or related object to get the type from.\n\t * @returns The type of the object if available, otherwise undefined.\n\t */\n\tpublic static getType(object: object | undefined): string | undefined {\n\t\treturn ObjectHelper.extractProperty<string>(object, [\"@type\", \"type\"], false);\n\t}\n\n\t/**\n\t * Extract assignee identity from policy.\n\t * @param policy The policy to extract the assignee from.\n\t * @returns Assignee id.\n\t * @throws GeneralError if assignee is missing or invalid.\n\t */\n\tpublic static extractAssigneeIdentity(policy: IDataspaceProtocolPolicy): ObjectOrArray<string> {\n\t\tif (Is.empty(policy.assignee)) {\n\t\t\tthrow new GeneralError(OdrlPolicyHelper.CLASS_NAME, \"policyMissingAssignee\", {\n\t\t\t\tpolicyType: OdrlPolicyHelper.getType(policy) ?? \"\",\n\t\t\t\tpolicyId: OdrlPolicyHelper.getUid(policy) ?? \"\"\n\t\t\t});\n\t\t}\n\n\t\tconst assignees = ArrayHelper.fromObjectOrArray(policy.assignee);\n\t\tconst assigneeIds: string[] = [];\n\t\tfor (const assignee of assignees) {\n\t\t\tconst assigneeId = Is.string(assignee) ? assignee : OdrlPolicyHelper.getUid(assignee);\n\t\t\tGuards.stringValue(OdrlPolicyHelper.CLASS_NAME, nameof(assigneeId), assigneeId);\n\t\t\tassigneeIds.push(assigneeId);\n\t\t}\n\n\t\treturn assigneeIds.length <= 1 ? assigneeIds[0] : assigneeIds;\n\t}\n\n\t/**\n\t * Extract assigner identity from policy.\n\t * @param policy The policy to extract the assigner from.\n\t * @returns Assigner id.\n\t * @throws GeneralError if assigner is missing or invalid.\n\t */\n\tpublic static extractAssignerIdentity(policy: IDataspaceProtocolPolicy): ObjectOrArray<string> {\n\t\tif (Is.empty(policy.assigner)) {\n\t\t\tthrow new GeneralError(OdrlPolicyHelper.CLASS_NAME, \"policyMissingAssigner\", {\n\t\t\t\tpolicyType: OdrlPolicyHelper.getType(policy) ?? \"\",\n\t\t\t\tpolicyId: OdrlPolicyHelper.getUid(policy) ?? \"\"\n\t\t\t});\n\t\t}\n\n\t\tconst assigners = ArrayHelper.fromObjectOrArray(policy.assigner);\n\t\tconst assignerIds: string[] = [];\n\n\t\tfor (const assigner of assigners) {\n\t\t\tconst assignerId = Is.string(assigner) ? assigner : OdrlPolicyHelper.getUid(assigner);\n\t\t\tGuards.stringValue(OdrlPolicyHelper.CLASS_NAME, nameof(assignerId), assignerId);\n\t\t\tassignerIds.push(assignerId);\n\t\t}\n\n\t\treturn assignerIds.length <= 1 ? assignerIds[0] : assignerIds;\n\t}\n\n\t/**\n\t * Normalize party value(s) into identifier strings when possible.\n\t * Handles single parties or arrays of parties by returning all discovered identifiers.\n\t * @param party The party to normalize.\n\t * @returns The party identifiers, or undefined when not available.\n\t */\n\tpublic static getPartyIds(\n\t\tparty?:\n\t\t\t| string\n\t\t\t| IOdrlParty\n\t\t\t| IOdrlPartyCollection\n\t\t\t| (string | IOdrlParty | IOdrlPartyCollection)[]\n\t): string[] {\n\t\tconst ids: string[] = [];\n\n\t\tif (Is.empty(party)) {\n\t\t\treturn ids;\n\t\t}\n\n\t\tif (Is.stringValue(party)) {\n\t\t\tids.push(party);\n\t\t\treturn ids;\n\t\t}\n\n\t\tif (Is.arrayValue(party)) {\n\t\t\tfor (const item of party) {\n\t\t\t\tconst childIds = OdrlPolicyHelper.getPartyIds(item);\n\t\t\t\tif (!Is.empty(childIds)) {\n\t\t\t\t\tfor (const childId of childIds) {\n\t\t\t\t\t\tif (!ids.includes(childId)) {\n\t\t\t\t\t\t\tids.push(childId);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn ids;\n\t\t}\n\n\t\tif (Is.object<IOdrlParty>(party)) {\n\t\t\tconst uid = OdrlPolicyHelper.getUid(party);\n\t\t\tif (Is.stringValue(uid) && !ids.includes(uid)) {\n\t\t\t\tids.push(uid);\n\t\t\t}\n\t\t}\n\n\t\treturn ids;\n\t}\n\n\t/**\n\t * Get the dataset targets from policy.\n\t * @param policy The policy to extract the dataset targets from.\n\t * @returns Top-level targets (deduped).\n\t */\n\tpublic static getDatasetTargets(policy: IRightsManagementPolicy): string[] {\n\t\tconst targetIds: string[] = [];\n\n\t\tconst policyTargets = ArrayHelper.fromObjectOrArray<IOdrlAsset | IOdrlAssetCollection | string>(\n\t\t\tpolicy.target ?? []\n\t\t);\n\t\tfor (const target of policyTargets) {\n\t\t\tOdrlPolicyHelper.collectTarget(target, targetIds);\n\t\t}\n\n\t\treturn Array.from(new Set(targetIds));\n\t}\n\n\t/**\n\t * Get targets from policy.\n\t * Walks both the policy-level target field and the target field on every\n\t * permission, prohibition, and obligation rule so that policies that store\n\t * their target exclusively on a rule are correctly indexed for query().\n\t * @param policy The policy to extract the targets from.\n\t * @returns Targets.\n\t */\n\tpublic static getTargets(policy: IRightsManagementPolicy): string[] {\n\t\tconst targetIds: string[] = OdrlPolicyHelper.getDatasetTargets(policy);\n\n\t\tconst rules = OdrlPolicyHelper.collectRules(policy);\n\t\tfor (const rule of rules) {\n\t\t\tconst ruleTargets = ArrayHelper.fromObjectOrArray<IOdrlAsset | IOdrlAssetCollection | string>(\n\t\t\t\trule.target ?? []\n\t\t\t);\n\t\t\tfor (const target of ruleTargets) {\n\t\t\t\tOdrlPolicyHelper.collectTarget(target, targetIds);\n\t\t\t}\n\t\t}\n\n\t\treturn Array.from(new Set(targetIds));\n\t}\n\n\t/**\n\t * Get actions from policy.\n\t * Walks both the policy-level action field and the action field on every\n\t * permission, prohibition, and obligation rule so that policies that store\n\t * their action exclusively on a rule are correctly indexed for query().\n\t * @param policy The policy to extract the actions from.\n\t * @returns Actions.\n\t */\n\tpublic static getActions(policy: IRightsManagementPolicy): string[] {\n\t\tconst actions: string[] = [];\n\n\t\tconst policyActions = ArrayHelper.fromObjectOrArray<OdrlActionType | string | IOdrlAction>(\n\t\t\tpolicy.action ?? []\n\t\t);\n\t\tfor (const action of policyActions) {\n\t\t\tOdrlPolicyHelper.collectAction(action, actions);\n\t\t}\n\n\t\tconst rules = OdrlPolicyHelper.collectRules(policy);\n\t\tfor (const rule of rules) {\n\t\t\tconst ruleActions = ArrayHelper.fromObjectOrArray<OdrlActionType | string | IOdrlAction>(\n\t\t\t\trule.action ?? []\n\t\t\t);\n\t\t\tfor (const action of ruleActions) {\n\t\t\t\tOdrlPolicyHelper.collectAction(action, actions);\n\t\t\t}\n\t\t}\n\n\t\treturn Array.from(new Set(actions));\n\t}\n\n\t/**\n\t * Does the policy match.\n\t * @param policy The policy to try and match.\n\t * @param options The matching options.\n\t * @param options.assignee The assignee to match.\n\t * @param options.assigner The assigner to match.\n\t * @param options.target The target to match.\n\t * @param options.action The action to match.\n\t * @returns True if the policy matches.\n\t */\n\tpublic static matchPolicy(\n\t\tpolicy: IRightsManagementPolicy | undefined,\n\t\toptions: {\n\t\t\tassignee?: string;\n\t\t\tassigner?: string;\n\t\t\ttarget?: string;\n\t\t\taction?: string;\n\t\t}\n\t): boolean {\n\t\tif (Is.empty(policy)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (Is.stringValue(options.assignee)) {\n\t\t\tconst assigneeIds = OdrlPolicyHelper.getPartyIds(policy.assignee);\n\t\t\tif (!assigneeIds.includes(options.assignee)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif (Is.stringValue(options.assigner)) {\n\t\t\tconst assignerIds = OdrlPolicyHelper.getPartyIds(policy.assigner);\n\t\t\tif (!assignerIds.includes(options.assigner)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif (Is.stringValue(options.target)) {\n\t\t\tconst targets = OdrlPolicyHelper.getTargets(policy);\n\t\t\tif (!targets.includes(options.target)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif (Is.stringValue(options.action)) {\n\t\t\tconst actions = OdrlPolicyHelper.getActions(policy);\n\t\t\tif (!actions.includes(options.action)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Collect all rule objects (permission, prohibition, obligation) from a policy.\n\t * @param policy The policy to collect rules from.\n\t * @returns Flattened array of all rules.\n\t * @internal\n\t */\n\tprivate static collectRules(policy: IRightsManagementPolicy): IOdrlRule[] {\n\t\tconst rules: IOdrlRule[] = [];\n\t\trules.push(\n\t\t\t...ArrayHelper.fromObjectOrArray<IOdrlPermission>(policy.permission ?? []),\n\t\t\t...ArrayHelper.fromObjectOrArray<IOdrlProhibition>(policy.prohibition ?? []),\n\t\t\t...ArrayHelper.fromObjectOrArray<IOdrlDuty>(policy.obligation ?? [])\n\t\t);\n\t\treturn rules;\n\t}\n\n\t/**\n\t * Extract a target string from a target value and push it to the accumulator.\n\t * @param target The target value to extract from.\n\t * @param accumulator The array to push the target string into.\n\t * @internal\n\t */\n\tprivate static collectTarget(\n\t\ttarget: IOdrlAsset | IOdrlAssetCollection | string,\n\t\taccumulator: string[]\n\t): void {\n\t\tif (Is.object<IOdrlAsset>(target)) {\n\t\t\tconst uid = OdrlPolicyHelper.getUid(target);\n\t\t\tif (Is.stringValue(uid)) {\n\t\t\t\taccumulator.push(uid);\n\t\t\t}\n\t\t} else if (Is.stringValue(target)) {\n\t\t\taccumulator.push(target);\n\t\t}\n\t}\n\n\t/**\n\t * Extract an action string from an action value and push it to the accumulator.\n\t * @param action The action value to extract from.\n\t * @param accumulator The array to push the action string into.\n\t * @internal\n\t */\n\tprivate static collectAction(\n\t\taction: OdrlActionType | string | IOdrlAction,\n\t\taccumulator: string[]\n\t): void {\n\t\tif (Is.object<IOdrlAction>(action)) {\n\t\t\tconst uid = OdrlPolicyHelper.getUid(action);\n\t\t\tif (Is.stringValue(uid)) {\n\t\t\t\taccumulator.push(uid);\n\t\t\t}\n\t\t} else if (Is.stringValue(action)) {\n\t\t\taccumulator.push(action);\n\t\t}\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"odrlPolicyHelper.js","sourceRoot":"","sources":["../../../src/utils/odrlPolicyHelper.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAiBrF;;GAEG;AACH,MAAM,OAAO,gBAAgB;IAC5B;;OAEG;IACI,MAAM,CAAU,UAAU,sBAAsC;IAEvE;;;;OAIG;IACI,MAAM,CAAC,MAAM,CAAC,MAA0B;QAC9C,OAAO,YAAY,CAAC,eAAe,CAAS,MAAM,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;IAClF,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,OAAO,CAAC,MAA0B;QAC/C,OAAO,YAAY,CAAC,eAAe,CAAS,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,uBAAuB,CAAC,MAAgC;QACrE,IAAI,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC/B,MAAM,IAAI,YAAY,CAAC,gBAAgB,CAAC,UAAU,EAAE,uBAAuB,EAAE;gBAC5E,UAAU,EAAE,gBAAgB,CAAC,OAAO,CAAC,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E,CAAC,CACpE,CAAC;QACF,OAAO,KAAK,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACK,MAAM,CAAC,aAAa,CAC3B,MAAkD,EAClD,WAAqB;QAErB,IAAI,EAAE,CAAC,MAAM,CAAa,MAAM,CAAC,EAAE,CAAC;YACnC,MAAM,GAAG,GAAG,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAC5C,IAAI,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;gBACzB,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACvB,CAAC;QACF,CAAC;aAAM,IAAI,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;YACnC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1B,CAAC;IACF,CAAC;IAED;;;;;OAKG;IACK,MAAM,CAAC,aAAa,CAC3B,MAA6C,EAC7C,WAAqB;QAErB,IAAI,EAAE,CAAC,MAAM,CAAc,MAAM,CAAC,EAAE,CAAC;YACpC,MAAM,GAAG,GAAG,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAC5C,IAAI,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;gBACzB,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACvB,CAAC;QACF,CAAC;aAAM,IAAI,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;YACnC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1B,CAAC;IACF,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ObjectOrArray } from \"@twin.org/core\";\nimport { ArrayHelper, GeneralError, Guards, Is, ObjectHelper } from \"@twin.org/core\";\nimport { nameof } from \"@twin.org/nameof\";\nimport type { IDataspaceProtocolPolicy } from \"@twin.org/standards-dataspace-protocol\";\nimport type {\n\tIOdrlAction,\n\tIOdrlAsset,\n\tIOdrlAssetCollection,\n\tIOdrlDuty,\n\tIOdrlParty,\n\tIOdrlPartyCollection,\n\tIOdrlPermission,\n\tIOdrlProhibition,\n\tIOdrlRule,\n\tOdrlActionType\n} from \"@twin.org/standards-w3c-odrl\";\nimport type { IRightsManagementPolicy } from \"../models/IRightsManagementPolicy.js\";\n\n/**\n * Helper methods for Odrl Policies.\n */\nexport class OdrlPolicyHelper {\n\t/**\n\t * The class name of the Policy Administration Point Service.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<OdrlPolicyHelper>();\n\n\t/**\n\t * Get the UID of an ODRL policy or related object if available.\n\t * @param object The ODRL policy or related object to get the UID from.\n\t * @returns The UID of the object if available, otherwise undefined.\n\t */\n\tpublic static getUid(object: object | undefined): string | undefined {\n\t\treturn ObjectHelper.extractProperty<string>(object, [\"@id\", \"id\", \"uid\"], false);\n\t}\n\n\t/**\n\t * Get the type of an ODRL policy or related object if available.\n\t * @param object The ODRL policy or related object to get the type from.\n\t * @returns The type of the object if available, otherwise undefined.\n\t */\n\tpublic static getType(object: object | undefined): string | undefined {\n\t\treturn ObjectHelper.extractProperty<string>(object, [\"@type\", \"type\"], false);\n\t}\n\n\t/**\n\t * Extract assignee identity from policy.\n\t * @param policy The policy to extract the assignee from.\n\t * @returns Assignee id.\n\t * @throws GeneralError if assignee is missing or invalid.\n\t */\n\tpublic static extractAssigneeIdentity(policy: IDataspaceProtocolPolicy): ObjectOrArray<string> {\n\t\tif (Is.empty(policy.assignee)) {\n\t\t\tthrow new GeneralError(OdrlPolicyHelper.CLASS_NAME, \"policyMissingAssignee\", {\n\t\t\t\tpolicyType: OdrlPolicyHelper.getType(policy) ?? \"\",\n\t\t\t\tpolicyId: OdrlPolicyHelper.getUid(policy) ?? \"\"\n\t\t\t});\n\t\t}\n\n\t\tconst assignees = ArrayHelper.fromObjectOrArray(policy.assignee);\n\t\tconst assigneeIds: string[] = [];\n\t\tfor (const assignee of assignees) {\n\t\t\tconst assigneeId = Is.string(assignee) ? assignee : OdrlPolicyHelper.getUid(assignee);\n\t\t\tGuards.stringValue(OdrlPolicyHelper.CLASS_NAME, nameof(assigneeId), assigneeId);\n\t\t\tassigneeIds.push(assigneeId);\n\t\t}\n\n\t\treturn assigneeIds.length <= 1 ? assigneeIds[0] : assigneeIds;\n\t}\n\n\t/**\n\t * Extract assigner identity from policy.\n\t * @param policy The policy to extract the assigner from.\n\t * @returns Assigner id.\n\t * @throws GeneralError if assigner is missing or invalid.\n\t */\n\tpublic static extractAssignerIdentity(policy: IDataspaceProtocolPolicy): ObjectOrArray<string> {\n\t\tif (Is.empty(policy.assigner)) {\n\t\t\tthrow new GeneralError(OdrlPolicyHelper.CLASS_NAME, \"policyMissingAssigner\", {\n\t\t\t\tpolicyType: OdrlPolicyHelper.getType(policy) ?? \"\",\n\t\t\t\tpolicyId: OdrlPolicyHelper.getUid(policy) ?? \"\"\n\t\t\t});\n\t\t}\n\n\t\tconst assigners = ArrayHelper.fromObjectOrArray(policy.assigner);\n\t\tconst assignerIds: string[] = [];\n\n\t\tfor (const assigner of assigners) {\n\t\t\tconst assignerId = Is.string(assigner) ? assigner : OdrlPolicyHelper.getUid(assigner);\n\t\t\tGuards.stringValue(OdrlPolicyHelper.CLASS_NAME, nameof(assignerId), assignerId);\n\t\t\tassignerIds.push(assignerId);\n\t\t}\n\n\t\treturn assignerIds.length <= 1 ? assignerIds[0] : assignerIds;\n\t}\n\n\t/**\n\t * Normalize party value(s) into identifier strings when possible.\n\t * Handles single parties or arrays of parties by returning all discovered identifiers.\n\t * @param party The party to normalize.\n\t * @returns The party identifiers, or undefined when not available.\n\t */\n\tpublic static getPartyIds(\n\t\tparty?:\n\t\t\tstring | IOdrlParty | IOdrlPartyCollection | (string | IOdrlParty | IOdrlPartyCollection)[]\n\t): string[] {\n\t\tconst ids: string[] = [];\n\n\t\tif (Is.empty(party)) {\n\t\t\treturn ids;\n\t\t}\n\n\t\tif (Is.stringValue(party)) {\n\t\t\tids.push(party);\n\t\t\treturn ids;\n\t\t}\n\n\t\tif (Is.arrayValue(party)) {\n\t\t\tfor (const item of party) {\n\t\t\t\tconst childIds = OdrlPolicyHelper.getPartyIds(item);\n\t\t\t\tif (!Is.empty(childIds)) {\n\t\t\t\t\tfor (const childId of childIds) {\n\t\t\t\t\t\tif (!ids.includes(childId)) {\n\t\t\t\t\t\t\tids.push(childId);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn ids;\n\t\t}\n\n\t\tif (Is.object<IOdrlParty>(party)) {\n\t\t\tconst uid = OdrlPolicyHelper.getUid(party);\n\t\t\tif (Is.stringValue(uid) && !ids.includes(uid)) {\n\t\t\t\tids.push(uid);\n\t\t\t}\n\t\t}\n\n\t\treturn ids;\n\t}\n\n\t/**\n\t * Get the dataset targets from policy.\n\t * @param policy The policy to extract the dataset targets from.\n\t * @returns Top-level targets (deduped).\n\t */\n\tpublic static getDatasetTargets(policy: IRightsManagementPolicy): string[] {\n\t\tconst targetIds: string[] = [];\n\n\t\tconst policyTargets = ArrayHelper.fromObjectOrArray<IOdrlAsset | IOdrlAssetCollection | string>(\n\t\t\tpolicy.target ?? []\n\t\t);\n\t\tfor (const target of policyTargets) {\n\t\t\tOdrlPolicyHelper.collectTarget(target, targetIds);\n\t\t}\n\n\t\treturn Array.from(new Set(targetIds));\n\t}\n\n\t/**\n\t * Get targets from policy.\n\t * Walks both the policy-level target field and the target field on every\n\t * permission, prohibition, and obligation rule so that policies that store\n\t * their target exclusively on a rule are correctly indexed for query().\n\t * @param policy The policy to extract the targets from.\n\t * @returns Targets.\n\t */\n\tpublic static getTargets(policy: IRightsManagementPolicy): string[] {\n\t\tconst targetIds: string[] = OdrlPolicyHelper.getDatasetTargets(policy);\n\n\t\tconst rules = OdrlPolicyHelper.collectRules(policy);\n\t\tfor (const rule of rules) {\n\t\t\tconst ruleTargets = ArrayHelper.fromObjectOrArray<IOdrlAsset | IOdrlAssetCollection | string>(\n\t\t\t\trule.target ?? []\n\t\t\t);\n\t\t\tfor (const target of ruleTargets) {\n\t\t\t\tOdrlPolicyHelper.collectTarget(target, targetIds);\n\t\t\t}\n\t\t}\n\n\t\treturn Array.from(new Set(targetIds));\n\t}\n\n\t/**\n\t * Get actions from policy.\n\t * Walks both the policy-level action field and the action field on every\n\t * permission, prohibition, and obligation rule so that policies that store\n\t * their action exclusively on a rule are correctly indexed for query().\n\t * @param policy The policy to extract the actions from.\n\t * @returns Actions.\n\t */\n\tpublic static getActions(policy: IRightsManagementPolicy): string[] {\n\t\tconst actions: string[] = [];\n\n\t\tconst policyActions = ArrayHelper.fromObjectOrArray<OdrlActionType | string | IOdrlAction>(\n\t\t\tpolicy.action ?? []\n\t\t);\n\t\tfor (const action of policyActions) {\n\t\t\tOdrlPolicyHelper.collectAction(action, actions);\n\t\t}\n\n\t\tconst rules = OdrlPolicyHelper.collectRules(policy);\n\t\tfor (const rule of rules) {\n\t\t\tconst ruleActions = ArrayHelper.fromObjectOrArray<OdrlActionType | string | IOdrlAction>(\n\t\t\t\trule.action ?? []\n\t\t\t);\n\t\t\tfor (const action of ruleActions) {\n\t\t\t\tOdrlPolicyHelper.collectAction(action, actions);\n\t\t\t}\n\t\t}\n\n\t\treturn Array.from(new Set(actions));\n\t}\n\n\t/**\n\t * Does the policy match.\n\t * @param policy The policy to try and match.\n\t * @param options The matching options.\n\t * @param options.assignee The assignee to match.\n\t * @param options.assigner The assigner to match.\n\t * @param options.target The target to match.\n\t * @param options.action The action to match.\n\t * @returns True if the policy matches.\n\t */\n\tpublic static matchPolicy(\n\t\tpolicy: IRightsManagementPolicy | undefined,\n\t\toptions: {\n\t\t\tassignee?: string;\n\t\t\tassigner?: string;\n\t\t\ttarget?: string;\n\t\t\taction?: string;\n\t\t}\n\t): boolean {\n\t\tif (Is.empty(policy)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (Is.stringValue(options.assignee)) {\n\t\t\tconst assigneeIds = OdrlPolicyHelper.getPartyIds(policy.assignee);\n\t\t\tif (!assigneeIds.includes(options.assignee)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif (Is.stringValue(options.assigner)) {\n\t\t\tconst assignerIds = OdrlPolicyHelper.getPartyIds(policy.assigner);\n\t\t\tif (!assignerIds.includes(options.assigner)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif (Is.stringValue(options.target)) {\n\t\t\tconst targets = OdrlPolicyHelper.getTargets(policy);\n\t\t\tif (!targets.includes(options.target)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif (Is.stringValue(options.action)) {\n\t\t\tconst actions = OdrlPolicyHelper.getActions(policy);\n\t\t\tif (!actions.includes(options.action)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Collect all rule objects (permission, prohibition, obligation) from a policy.\n\t * @param policy The policy to collect rules from.\n\t * @returns Flattened array of all rules.\n\t * @internal\n\t */\n\tprivate static collectRules(policy: IRightsManagementPolicy): IOdrlRule[] {\n\t\tconst rules: IOdrlRule[] = [];\n\t\trules.push(\n\t\t\t...ArrayHelper.fromObjectOrArray<IOdrlPermission>(policy.permission ?? []),\n\t\t\t...ArrayHelper.fromObjectOrArray<IOdrlProhibition>(policy.prohibition ?? []),\n\t\t\t...ArrayHelper.fromObjectOrArray<IOdrlDuty>(policy.obligation ?? [])\n\t\t);\n\t\treturn rules;\n\t}\n\n\t/**\n\t * Extract a target string from a target value and push it to the accumulator.\n\t * @param target The target value to extract from.\n\t * @param accumulator The array to push the target string into.\n\t * @internal\n\t */\n\tprivate static collectTarget(\n\t\ttarget: IOdrlAsset | IOdrlAssetCollection | string,\n\t\taccumulator: string[]\n\t): void {\n\t\tif (Is.object<IOdrlAsset>(target)) {\n\t\t\tconst uid = OdrlPolicyHelper.getUid(target);\n\t\t\tif (Is.stringValue(uid)) {\n\t\t\t\taccumulator.push(uid);\n\t\t\t}\n\t\t} else if (Is.stringValue(target)) {\n\t\t\taccumulator.push(target);\n\t\t}\n\t}\n\n\t/**\n\t * Extract an action string from an action value and push it to the accumulator.\n\t * @param action The action value to extract from.\n\t * @param accumulator The array to push the action string into.\n\t * @internal\n\t */\n\tprivate static collectAction(\n\t\taction: OdrlActionType | string | IOdrlAction,\n\t\taccumulator: string[]\n\t): void {\n\t\tif (Is.object<IOdrlAction>(action)) {\n\t\t\tconst uid = OdrlPolicyHelper.getUid(action);\n\t\t\tif (Is.stringValue(uid)) {\n\t\t\t\taccumulator.push(uid);\n\t\t\t}\n\t\t} else if (Is.stringValue(action)) {\n\t\t\taccumulator.push(action);\n\t\t}\n\t}\n}\n"]}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ export * from "./models/IRightsManagementPolicyMetadata.js";
|
|
|
42
42
|
export * from "./models/IRightsManagementPolicyTrust.js";
|
|
43
43
|
export * from "./models/IRightsManagementSet.js";
|
|
44
44
|
export * from "./models/odrlProfiles.js";
|
|
45
|
+
export * from "./models/odrlTwinVocabulary.js";
|
|
45
46
|
export * from "./models/pap/IPolicyAdministrationPointComponent.js";
|
|
46
47
|
export * from "./models/pap/IPolicyLocator.js";
|
|
47
48
|
export * from "./models/pdp/IPolicyArbiter.js";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical TWIN constraint vocabulary used in ODRL policies.
|
|
3
|
+
* Policy authors should reference these constants rather than hand-copying the strings.
|
|
4
|
+
*/
|
|
5
|
+
export declare const OdrlTwinVocabulary: {
|
|
6
|
+
/**
|
|
7
|
+
* The canonical TWIN JSONPath constraint source alias.
|
|
8
|
+
* Used as the `source` property of an AssetCollection or as a prefix in
|
|
9
|
+
* composed target identifiers (`twin:jsonPath:<dataSource>:<expression>`).
|
|
10
|
+
*/
|
|
11
|
+
readonly JsonPath: "twin:jsonPath";
|
|
12
|
+
/**
|
|
13
|
+
* Constraint / context property carrying the JSONPath expression to evaluate.
|
|
14
|
+
*/
|
|
15
|
+
readonly JsonPathExpression: "twin:jsonPathExpression";
|
|
16
|
+
/**
|
|
17
|
+
* Optional constraint / context property that selects the named data source.
|
|
18
|
+
* When absent, defaults to "data".
|
|
19
|
+
*/
|
|
20
|
+
readonly JsonPathDataSource: "twin:jsonPathDataSource";
|
|
21
|
+
/**
|
|
22
|
+
* Key used to look up the primary data payload inside the data-sources map
|
|
23
|
+
* passed to the policy arbiter.
|
|
24
|
+
*/
|
|
25
|
+
readonly DataSourceKey: "data";
|
|
26
|
+
/**
|
|
27
|
+
* Key used to look up the information payload inside the data-sources map
|
|
28
|
+
* passed to the policy arbiter.
|
|
29
|
+
*/
|
|
30
|
+
readonly InformationSourceKey: "information";
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* The ODRL TWIN vocabulary values.
|
|
34
|
+
*/
|
|
35
|
+
export type OdrlTwinVocabulary = (typeof OdrlTwinVocabulary)[keyof typeof OdrlTwinVocabulary];
|
package/docs/changelog.md
CHANGED
|
@@ -6,6 +6,57 @@
|
|
|
6
6
|
|
|
7
7
|
* remove EcosystemPolicy models/DTOs and standardize policy typing on `OdrlPolicyType` for v2.
|
|
8
8
|
|
|
9
|
+
## [0.9.1](https://github.com/iotaledger/twin-rights-management/compare/rights-management-models-v0.9.1...rights-management-models-v0.9.1) (2026-07-27)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* release to production ([947f85a](https://github.com/iotaledger/twin-rights-management/commit/947f85ab9e23c117135dba7008a75c2d85435259))
|
|
15
|
+
* release to production ([#223](https://github.com/iotaledger/twin-rights-management/issues/223)) ([8188fe6](https://github.com/iotaledger/twin-rights-management/commit/8188fe643107e3d4989b45a313d3f451e51e4b52))
|
|
16
|
+
* release to production ([#275](https://github.com/iotaledger/twin-rights-management/issues/275)) ([a5dc94e](https://github.com/iotaledger/twin-rights-management/commit/a5dc94e7f207fce4c4806d8e8e124eeb180e7b15))
|
|
17
|
+
|
|
18
|
+
## [0.9.1-next.14](https://github.com/iotaledger/twin-rights-management/compare/rights-management-models-v0.9.1-next.13...rights-management-models-v0.9.1-next.14) (2026-07-22)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* add type to pap query request ([#270](https://github.com/iotaledger/twin-rights-management/issues/270)) ([a94779a](https://github.com/iotaledger/twin-rights-management/commit/a94779a0f1331811258801aa899b70b414886972))
|
|
24
|
+
|
|
25
|
+
## [0.9.1-next.13](https://github.com/iotaledger/twin-rights-management/compare/rights-management-models-v0.9.1-next.12...rights-management-models-v0.9.1-next.13) (2026-07-21)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Miscellaneous Chores
|
|
29
|
+
|
|
30
|
+
* **rights-management-models:** Synchronize repo versions
|
|
31
|
+
|
|
32
|
+
## [0.9.1-next.12](https://github.com/iotaledger/twin-rights-management/compare/rights-management-models-v0.9.1-next.11...rights-management-models-v0.9.1-next.12) (2026-07-21)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### Features
|
|
36
|
+
|
|
37
|
+
* vocab constants ([#265](https://github.com/iotaledger/twin-rights-management/issues/265)) ([fa1ff8a](https://github.com/iotaledger/twin-rights-management/commit/fa1ff8a0a557b83162cc961b867c443978d52f45))
|
|
38
|
+
|
|
39
|
+
## [0.9.1-next.11](https://github.com/iotaledger/twin-rights-management/compare/rights-management-models-v0.9.1-next.10...rights-management-models-v0.9.1-next.11) (2026-07-20)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### Miscellaneous Chores
|
|
43
|
+
|
|
44
|
+
* **rights-management-models:** Synchronize repo versions
|
|
45
|
+
|
|
46
|
+
## [0.9.1-next.10](https://github.com/iotaledger/twin-rights-management/compare/rights-management-models-v0.9.1-next.9...rights-management-models-v0.9.1-next.10) (2026-07-20)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
### Miscellaneous Chores
|
|
50
|
+
|
|
51
|
+
* **rights-management-models:** Synchronize repo versions
|
|
52
|
+
|
|
53
|
+
## [0.9.1-next.9](https://github.com/iotaledger/twin-rights-management/compare/rights-management-models-v0.9.1-next.8...rights-management-models-v0.9.1-next.9) (2026-07-20)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
### Miscellaneous Chores
|
|
57
|
+
|
|
58
|
+
* **rights-management-models:** Synchronize repo versions
|
|
59
|
+
|
|
9
60
|
## [0.9.1-next.8](https://github.com/iotaledger/twin-rights-management/compare/rights-management-models-v0.9.1-next.7...rights-management-models-v0.9.1-next.8) (2026-07-17)
|
|
10
61
|
|
|
11
62
|
|
package/docs/reference/index.md
CHANGED
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
## Type Aliases
|
|
65
65
|
|
|
66
66
|
- [OdrlProfiles](type-aliases/OdrlProfiles.md)
|
|
67
|
+
- [OdrlTwinVocabulary](type-aliases/OdrlTwinVocabulary.md)
|
|
67
68
|
- [PolicyDecision](type-aliases/PolicyDecision.md)
|
|
68
69
|
- [PolicyDecisionStage](type-aliases/PolicyDecisionStage.md)
|
|
69
70
|
- [PolicyInformationAccessMode](type-aliases/PolicyInformationAccessMode.md)
|
|
@@ -81,6 +82,7 @@
|
|
|
81
82
|
- [PolicyObligationEnforcerFactory](variables/PolicyObligationEnforcerFactory.md)
|
|
82
83
|
- [PolicyRequesterFactory](variables/PolicyRequesterFactory.md)
|
|
83
84
|
- [OdrlProfiles](variables/OdrlProfiles.md)
|
|
85
|
+
- [OdrlTwinVocabulary](variables/OdrlTwinVocabulary.md)
|
|
84
86
|
- [PolicyDecision](variables/PolicyDecision.md)
|
|
85
87
|
- [PolicyDecisionStage](variables/PolicyDecisionStage.md)
|
|
86
88
|
- [PolicyInformationAccessMode](variables/PolicyInformationAccessMode.md)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Variable: OdrlTwinVocabulary
|
|
2
|
+
|
|
3
|
+
> `const` **OdrlTwinVocabulary**: `object`
|
|
4
|
+
|
|
5
|
+
Canonical TWIN constraint vocabulary used in ODRL policies.
|
|
6
|
+
Policy authors should reference these constants rather than hand-copying the strings.
|
|
7
|
+
|
|
8
|
+
## Type Declaration
|
|
9
|
+
|
|
10
|
+
### JsonPath {#jsonpath}
|
|
11
|
+
|
|
12
|
+
> `readonly` **JsonPath**: `"twin:jsonPath"` = `"twin:jsonPath"`
|
|
13
|
+
|
|
14
|
+
The canonical TWIN JSONPath constraint source alias.
|
|
15
|
+
Used as the `source` property of an AssetCollection or as a prefix in
|
|
16
|
+
composed target identifiers (`twin:jsonPath:<dataSource>:<expression>`).
|
|
17
|
+
|
|
18
|
+
### JsonPathExpression {#jsonpathexpression}
|
|
19
|
+
|
|
20
|
+
> `readonly` **JsonPathExpression**: `"twin:jsonPathExpression"` = `"twin:jsonPathExpression"`
|
|
21
|
+
|
|
22
|
+
Constraint / context property carrying the JSONPath expression to evaluate.
|
|
23
|
+
|
|
24
|
+
### JsonPathDataSource {#jsonpathdatasource}
|
|
25
|
+
|
|
26
|
+
> `readonly` **JsonPathDataSource**: `"twin:jsonPathDataSource"` = `"twin:jsonPathDataSource"`
|
|
27
|
+
|
|
28
|
+
Optional constraint / context property that selects the named data source.
|
|
29
|
+
When absent, defaults to "data".
|
|
30
|
+
|
|
31
|
+
### DataSourceKey {#datasourcekey}
|
|
32
|
+
|
|
33
|
+
> `readonly` **DataSourceKey**: `"data"` = `"data"`
|
|
34
|
+
|
|
35
|
+
Key used to look up the primary data payload inside the data-sources map
|
|
36
|
+
passed to the policy arbiter.
|
|
37
|
+
|
|
38
|
+
### InformationSourceKey {#informationsourcekey}
|
|
39
|
+
|
|
40
|
+
> `readonly` **InformationSourceKey**: `"information"` = `"information"`
|
|
41
|
+
|
|
42
|
+
Key used to look up the information payload inside the data-sources map
|
|
43
|
+
passed to the policy arbiter.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/rights-management-models",
|
|
3
|
-
"version": "0.9.1
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "Data model definitions for rights management policies, negotiations, and service contracts.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,20 +11,20 @@
|
|
|
11
11
|
"license": "Apache-2.0",
|
|
12
12
|
"type": "module",
|
|
13
13
|
"engines": {
|
|
14
|
-
"node": ">=
|
|
14
|
+
"node": ">=24.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@twin.org/core": "
|
|
18
|
-
"@twin.org/data-json-ld": "
|
|
19
|
-
"@twin.org/engine-models": "
|
|
20
|
-
"@twin.org/entity": "
|
|
21
|
-
"@twin.org/identity-models": "
|
|
22
|
-
"@twin.org/nameof": "
|
|
23
|
-
"@twin.org/standards-dataspace-protocol": "
|
|
24
|
-
"@twin.org/standards-w3c-did": "
|
|
25
|
-
"@twin.org/standards-w3c-odrl": "
|
|
26
|
-
"@twin.org/trust-models": "
|
|
27
|
-
"@twin.org/web": "
|
|
17
|
+
"@twin.org/core": "^0.9.1",
|
|
18
|
+
"@twin.org/data-json-ld": "^0.9.1",
|
|
19
|
+
"@twin.org/engine-models": "^0.9.0",
|
|
20
|
+
"@twin.org/entity": "^0.9.1",
|
|
21
|
+
"@twin.org/identity-models": "^0.9.0",
|
|
22
|
+
"@twin.org/nameof": "^0.9.1",
|
|
23
|
+
"@twin.org/standards-dataspace-protocol": "^0.9.1",
|
|
24
|
+
"@twin.org/standards-w3c-did": "^0.9.1",
|
|
25
|
+
"@twin.org/standards-w3c-odrl": "^0.9.1",
|
|
26
|
+
"@twin.org/trust-models": "^0.9.1",
|
|
27
|
+
"@twin.org/web": "^0.9.1"
|
|
28
28
|
},
|
|
29
29
|
"main": "./dist/es/index.js",
|
|
30
30
|
"types": "./dist/types/index.d.ts",
|