@twin.org/rights-management-models 0.0.1 → 0.0.2-next.2

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.
@@ -5,6 +5,8 @@ export * from "./models/api/policyAdministrationPoint/IPapRemoveRequest";
5
5
  export * from "./models/api/policyAdministrationPoint/IPapRetrieveRequest";
6
6
  export * from "./models/api/policyAdministrationPoint/IPapRetrieveResponse";
7
7
  export * from "./models/api/policyAdministrationPoint/IPapUpdateRequest";
8
+ export * from "./models/api/policyAdministrationPoint/IPepInterceptRequest";
9
+ export * from "./models/api/policyAdministrationPoint/IPepInterceptResponse";
8
10
  export * from "./models/IPolicyAdministrationPointComponent";
9
11
  export * from "./models/IPolicyDecisionPointComponent";
10
12
  export * from "./models/IPolicyEnforcementPointComponent";
@@ -15,5 +15,5 @@ export interface IPolicyEnforcementPointComponent extends IComponent {
15
15
  * @param nodeIdentity The node identity to use in the decision making.
16
16
  * @returns The manipulated data with any policies applied.
17
17
  */
18
- intercept<T = unknown>(assetType: string, action: string, data: T | undefined, userIdentity: string, nodeIdentity: string): Promise<T | undefined>;
18
+ intercept<T = unknown>(assetType: string, action: string, data: T | undefined, userIdentity: string | undefined, nodeIdentity: string | undefined): Promise<T | undefined>;
19
19
  }
@@ -41,4 +41,14 @@ export interface IRightsManagementComponent extends IComponent {
41
41
  cursor?: string;
42
42
  policies: IOdrlPolicy[];
43
43
  }>;
44
+ /**
45
+ * PEP: Process the data using Policy Decision Point (PDP) and return the manipulated data.
46
+ * @param assetType The type of asset being processed.
47
+ * @param action The action being performed on the asset.
48
+ * @param data The data to process.
49
+ * @param userIdentity The user identity to use in the decision making.
50
+ * @param nodeIdentity The node identity to use in the decision making.
51
+ * @returns The manipulated data with any policies applied.
52
+ */
53
+ pepIntercept<T = unknown>(assetType: string, action: string, data: T | undefined, userIdentity: string | undefined, nodeIdentity: string | undefined): Promise<T | undefined>;
44
54
  }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The request structure for intercepting a request and enforcing a policy.
3
+ */
4
+ export interface IPepInterceptRequest {
5
+ /**
6
+ * The body parameters of the request.
7
+ */
8
+ body: {
9
+ /**
10
+ * The type of the asset to enforce the policy on.
11
+ */
12
+ assetType: string;
13
+ /**
14
+ * The action to perform on the asset.
15
+ */
16
+ action: string;
17
+ /**
18
+ * The data to include in the request.
19
+ */
20
+ data: unknown;
21
+ };
22
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The response structure for intercepting a request and enforcing a policy.
3
+ */
4
+ export interface IPepInterceptResponse {
5
+ /**
6
+ * The manipulated data with any policies applied.
7
+ */
8
+ body: unknown;
9
+ }
package/docs/changelog.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @twin.org/rights-management-models - Changelog
2
2
 
3
+ ## [0.0.2-next.2](https://github.com/twinfoundation/rights-management/compare/rights-management-models-v0.0.2-next.1...rights-management-models-v0.0.2-next.2) (2025-08-22)
4
+
5
+
6
+ ### Features
7
+
8
+ * add scaffold for other services ([de25f34](https://github.com/twinfoundation/rights-management/commit/de25f34c40fb65b6d73df98965ea4e368019da84))
9
+
10
+ ## [0.0.2-next.1](https://github.com/twinfoundation/rights-management/compare/rights-management-models-v0.0.2-next.0...rights-management-models-v0.0.2-next.1) (2025-08-20)
11
+
12
+
13
+ ### Features
14
+
15
+ * add policy decision stage ([b3eb5a9](https://github.com/twinfoundation/rights-management/commit/b3eb5a96f6270247d198b57c07deca4eeb5cc0bb))
16
+ * add publish workflows ([9f4db27](https://github.com/twinfoundation/rights-management/commit/9f4db27cccc724a5061f944b29ed7ed5317c9bbf))
17
+ * pap create, update methods ([#13](https://github.com/twinfoundation/rights-management/issues/13)) ([edb6c9e](https://github.com/twinfoundation/rights-management/commit/edb6c9efcfda55ac96f7594253bf831b4f0e5993))
18
+ * rename pap entity storage to pap service ([38a2c14](https://github.com/twinfoundation/rights-management/commit/38a2c14d8f63a86e398820166c83437be5aca1b8))
19
+ * rights management pap ([#4](https://github.com/twinfoundation/rights-management/issues/4)) ([d1165a9](https://github.com/twinfoundation/rights-management/commit/d1165a92f57128731cfb308d977832e28cf33493))
20
+ * update dependencies ([dd0a553](https://github.com/twinfoundation/rights-management/commit/dd0a553020b0dc5c41fb6865a2e36bd26045b0b9))
21
+ * update framework core ([d0ffcba](https://github.com/twinfoundation/rights-management/commit/d0ffcba9cf1dc2b562193ee298f099612d100ce8))
22
+ * update models based on feedback ([1f11df3](https://github.com/twinfoundation/rights-management/commit/1f11df32bdae5e0a9119e3eee9346b970c5fd345))
23
+ * use shared store mechanism ([#2](https://github.com/twinfoundation/rights-management/issues/2)) ([21c086d](https://github.com/twinfoundation/rights-management/commit/21c086d7be3989858ee28bedb7a1e7b97d65b752))
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * correct PXP naming in comments ([1cd9053](https://github.com/twinfoundation/rights-management/commit/1cd9053eaa1c56a53d3cc52e75ea4d242bbe2654))
29
+ * query params force coercion ([8590a0d](https://github.com/twinfoundation/rights-management/commit/8590a0da92584c04b67e73c448319f96f70c34a5))
30
+
3
31
  ## 0.0.1 (2025-07-08)
4
32
 
5
33
 
@@ -16,6 +16,8 @@
16
16
  - [IPapRetrieveRequest](interfaces/IPapRetrieveRequest.md)
17
17
  - [IPapRetrieveResponse](interfaces/IPapRetrieveResponse.md)
18
18
  - [IPapUpdateRequest](interfaces/IPapUpdateRequest.md)
19
+ - [IPepInterceptRequest](interfaces/IPepInterceptRequest.md)
20
+ - [IPepInterceptResponse](interfaces/IPepInterceptResponse.md)
19
21
 
20
22
  ## Type Aliases
21
23
 
@@ -0,0 +1,29 @@
1
+ # Interface: IPepInterceptRequest
2
+
3
+ The request structure for intercepting a request and enforcing a policy.
4
+
5
+ ## Properties
6
+
7
+ ### body
8
+
9
+ > **body**: `object`
10
+
11
+ The body parameters of the request.
12
+
13
+ #### assetType
14
+
15
+ > **assetType**: `string`
16
+
17
+ The type of the asset to enforce the policy on.
18
+
19
+ #### action
20
+
21
+ > **action**: `string`
22
+
23
+ The action to perform on the asset.
24
+
25
+ #### data
26
+
27
+ > **data**: `unknown`
28
+
29
+ The data to include in the request.
@@ -0,0 +1,11 @@
1
+ # Interface: IPepInterceptResponse
2
+
3
+ The response structure for intercepting a request and enforcing a policy.
4
+
5
+ ## Properties
6
+
7
+ ### body
8
+
9
+ > **body**: `unknown`
10
+
11
+ The manipulated data with any policies applied.
@@ -45,16 +45,16 @@ The data to process.
45
45
 
46
46
  ##### userIdentity
47
47
 
48
- `string`
49
-
50
48
  The user identity to use in the decision making.
51
49
 
52
- ##### nodeIdentity
50
+ `undefined` | `string`
53
51
 
54
- `string`
52
+ ##### nodeIdentity
55
53
 
56
54
  The node identity to use in the decision making.
57
55
 
56
+ `undefined` | `string`
57
+
58
58
  #### Returns
59
59
 
60
60
  `Promise`\<`undefined` \| `T`\>
@@ -128,3 +128,55 @@ The number of results to return per page.
128
128
  `Promise`\<\{ `cursor?`: `string`; `policies`: `IOdrlPolicy`[]; \}\>
129
129
 
130
130
  Cursor for next page of results and the policies matching the query.
131
+
132
+ ***
133
+
134
+ ### pepIntercept()
135
+
136
+ > **pepIntercept**\<`T`\>(`assetType`, `action`, `data`, `userIdentity`, `nodeIdentity`): `Promise`\<`undefined` \| `T`\>
137
+
138
+ PEP: Process the data using Policy Decision Point (PDP) and return the manipulated data.
139
+
140
+ #### Type Parameters
141
+
142
+ ##### T
143
+
144
+ `T` = `unknown`
145
+
146
+ #### Parameters
147
+
148
+ ##### assetType
149
+
150
+ `string`
151
+
152
+ The type of asset being processed.
153
+
154
+ ##### action
155
+
156
+ `string`
157
+
158
+ The action being performed on the asset.
159
+
160
+ ##### data
161
+
162
+ The data to process.
163
+
164
+ `undefined` | `T`
165
+
166
+ ##### userIdentity
167
+
168
+ The user identity to use in the decision making.
169
+
170
+ `undefined` | `string`
171
+
172
+ ##### nodeIdentity
173
+
174
+ The node identity to use in the decision making.
175
+
176
+ `undefined` | `string`
177
+
178
+ #### Returns
179
+
180
+ `Promise`\<`undefined` \| `T`\>
181
+
182
+ The manipulated data with any policies applied.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/rights-management-models",
3
- "version": "0.0.1",
3
+ "version": "0.0.2-next.2",
4
4
  "description": "Models which define the structure of the rights management connectors and services",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,11 +14,11 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/core": "^0.0.1",
18
- "@twin.org/data-json-ld": "^0.0.1",
19
- "@twin.org/entity": "^0.0.1",
20
- "@twin.org/nameof": "^0.0.1",
21
- "@twin.org/standards-w3c-odrl": "^0.0.1"
17
+ "@twin.org/core": "next",
18
+ "@twin.org/data-json-ld": "next",
19
+ "@twin.org/entity": "next",
20
+ "@twin.org/nameof": "next",
21
+ "@twin.org/standards-w3c-odrl": "next"
22
22
  },
23
23
  "main": "./dist/cjs/index.cjs",
24
24
  "module": "./dist/esm/index.mjs",