@twin.org/rights-management-service 0.9.1 → 0.9.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.
@@ -409,9 +409,7 @@ export async function papCreate(httpRequestContext, componentName, request, base
409
409
  HttpHeaderHelper.buildId(headers, uid, HttpUrlHelper.combineOriginPath(publicOrigin, `${baseRouteName}/policy/admin/:id`));
410
410
  return {
411
411
  statusCode: HttpStatusCode.created,
412
- headers: {
413
- location: uid
414
- }
412
+ headers
415
413
  };
416
414
  }
417
415
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"policyAdministrationPointRoutes.js","sourceRoot":"","sources":["../../src/policyAdministrationPointRoutes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EACN,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EAMb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAElE,OAAO,EACN,uBAAuB,EAevB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AAClG,OAAO,EAAE,cAAc,EAAqB,MAAM,eAAe,CAAC;AAElE;;GAEG;AACH,MAAM,aAAa,GAAG,iCAAiC,CAAC;AAExD;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAW;IAC9B;QACC,IAAI,EAAE,6BAA6B;QACnC,WAAW,EAAE,yEAAyE;KACtF;CACD,CAAC;AAEF;;;GAGG;AACH,MAAM,2BAA2B,GAAoB;IACpD,YAAY,CAAC,OAAO;IACpB,uBAAuB;CACvB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,2CAA2C,CAC1D,aAAqB,EACrB,aAAqB;IAErB,MAAM,yBAAyB,GAA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0.\nimport {\n\tHttpContextIdKeys,\n\tHttpHeaderHelper,\n\tHttpParameterHelper,\n\tHttpUrlHelper,\n\ttype ICreatedResponse,\n\ttype IHttpRequestContext,\n\ttype INoContentResponse,\n\ttype IRestRoute,\n\ttype ITag\n} from \"@twin.org/api-models\";\nimport { ContextIdStore } from \"@twin.org/context\";\nimport { Coerce, ComponentFactory, Guards } from \"@twin.org/core\";\nimport { nameof } from \"@twin.org/nameof\";\nimport {\n\tPOLICY_METADATA_CONTEXT,\n\ttype IPapCreateRequest,\n\ttype IPapGetAgreementRequest,\n\ttype IPapGetAgreementResponse,\n\ttype IPapGetOfferRequest,\n\ttype IPapGetOfferResponse,\n\ttype IPapGetRequest,\n\ttype IPapGetResponse,\n\ttype IPapGetSetRequest,\n\ttype IPapGetSetResponse,\n\ttype IPapQueryRequest,\n\ttype IPapQueryResponse,\n\ttype IPapRemoveRequest,\n\ttype IPapUpdateRequest,\n\ttype IPolicyAdministrationPointComponent\n} from \"@twin.org/rights-management-models\";\nimport { OdrlContexts, OdrlPolicyType, type OdrlContextType } from \"@twin.org/standards-w3c-odrl\";\nimport { HttpStatusCode, type IHttpHeaders } from \"@twin.org/web\";\n\n/**\n * The source used when communicating about these routes.\n */\nconst ROUTES_SOURCE = \"policyAdministrationPointRoutes\";\n\n/**\n * The tag to associate with the routes.\n */\nexport const papTags: ITag[] = [\n\t{\n\t\tname: \"Policy Administration Point\",\n\t\tdescription: \"Endpoints for managing ODRL policies in the Policy Administration Point\"\n\t}\n];\n\n/**\n * Example JSON-LD context returned by PAP read endpoints for policies with metadata timestamps.\n * Uses `POLICY_METADATA_CONTEXT` from rights-management-models merged with ODRL context.\n */\nconst PAP_POLICY_RESPONSE_CONTEXT: OdrlContextType = [\n\tOdrlContexts.Context,\n\tPOLICY_METADATA_CONTEXT\n];\n\n/**\n * The REST routes for the Policy Administration Point.\n * @param baseRouteName Prefix to prepend to the paths.\n * @param componentName The name of the component to use in the routes stored in the ComponentFactory.\n * @returns The generated routes.\n */\nexport function generateRestRoutesPolicyAdministrationPoint(\n\tbaseRouteName: string,\n\tcomponentName: string\n): IRestRoute[] {\n\tconst papPolicyExampleLifecycle = {\n\t\tdateCreated: \"2025-09-03T00:00:00.000Z\",\n\t\tdateModified: \"2025-09-03T00:00:00.000Z\"\n\t};\n\n\tconst papCreateRoute: IRestRoute<IPapCreateRequest, ICreatedResponse> = {\n\t\toperationId: \"papCreate\",\n\t\tsummary: \"Create a policy\",\n\t\ttag: papTags[0].name,\n\t\tmethod: \"POST\",\n\t\tpath: `${baseRouteName}/policy/admin`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tpapCreate(httpRequestContext, componentName, request, baseRouteName),\n\t\trequestType: {\n\t\t\ttype: nameof<IPapCreateRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"papCreateRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\"@context\": OdrlContexts.Context,\n\t\t\t\t\t\t\t\"@type\": OdrlPolicyType.Set,\n\t\t\t\t\t\t\tpermission: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttarget: \"http://example.com/asset/1\",\n\t\t\t\t\t\t\t\t\taction: \"use\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\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},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<ICreatedResponse>(),\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"papCreateResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tstatusCode: 201,\n\t\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t\tlocation: \"urn:rights-management:abc123def456\"\n\t\t\t\t\t\t\t}\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]\n\t};\n\n\tconst papUpdateRoute: IRestRoute<IPapUpdateRequest, INoContentResponse> = {\n\t\toperationId: \"papUpdate\",\n\t\tsummary: \"Update a policy\",\n\t\ttag: papTags[0].name,\n\t\tmethod: \"PUT\",\n\t\tpath: `${baseRouteName}/policy/admin/:id`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tpapUpdate(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<IPapUpdateRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"papUpdateRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tid: \"urn:rights-management:abc123def456\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\"@context\": OdrlContexts.Context,\n\t\t\t\t\t\t\t\"@type\": OdrlPolicyType.Set,\n\t\t\t\t\t\t\t\"@id\": \"urn:rights-management:abc123def456\",\n\t\t\t\t\t\t\tpermission: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttarget: \"http://example.com/asset/2\",\n\t\t\t\t\t\t\t\t\taction: \"read\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\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},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<INoContentResponse>()\n\t\t\t}\n\t\t]\n\t};\n\n\tconst papGetRoute: IRestRoute<IPapGetRequest, IPapGetResponse> = {\n\t\toperationId: \"papGet\",\n\t\tsummary: \"Get a policy\",\n\t\ttag: papTags[0].name,\n\t\tmethod: \"GET\",\n\t\tpath: `${baseRouteName}/policy/admin/:id`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tpapGet(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<IPapGetRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"papGetRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tid: \"urn:rights-management:abc123def456\"\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},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<IPapGetResponse>(),\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"papGetResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\t\"@context\": PAP_POLICY_RESPONSE_CONTEXT,\n\t\t\t\t\t\t\t\t\"@type\": OdrlPolicyType.Set,\n\t\t\t\t\t\t\t\t\"@id\": \"urn:rights-management:abc123def456\",\n\t\t\t\t\t\t\t\t...papPolicyExampleLifecycle,\n\t\t\t\t\t\t\t\tpermission: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttarget: \"http://example.com/asset/1\",\n\t\t\t\t\t\t\t\t\t\taction: \"use\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t}\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]\n\t};\n\n\tconst papGetAgreementRoute: IRestRoute<IPapGetAgreementRequest, IPapGetAgreementResponse> = {\n\t\toperationId: \"papGetAgreement\",\n\t\tsummary: \"Get a policy agreement\",\n\t\ttag: papTags[0].name,\n\t\tmethod: \"GET\",\n\t\tpath: `${baseRouteName}/policy/admin/agreement/:id`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tpapGetAgreement(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<IPapGetAgreementRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"papGetAgreementRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tid: \"urn:rights-management:abc123def456\"\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},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<IPapGetAgreementResponse>(),\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"papGetResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\t\"@context\": PAP_POLICY_RESPONSE_CONTEXT,\n\t\t\t\t\t\t\t\t\"@type\": OdrlPolicyType.Agreement,\n\t\t\t\t\t\t\t\t\"@id\": \"urn:rights-management:abc123def456\",\n\t\t\t\t\t\t\t\t...papPolicyExampleLifecycle,\n\t\t\t\t\t\t\t\tpermission: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttarget: \"http://example.com/asset/1\",\n\t\t\t\t\t\t\t\t\t\taction: \"use\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\tassignee: \"did:example:receiver\",\n\t\t\t\t\t\t\t\tassigner: \"did:example:sender\"\n\t\t\t\t\t\t\t}\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]\n\t};\n\n\tconst papGetOfferRoute: IRestRoute<IPapGetOfferRequest, IPapGetOfferResponse> = {\n\t\toperationId: \"papGetOffer\",\n\t\tsummary: \"Get a policy offer\",\n\t\ttag: papTags[0].name,\n\t\tmethod: \"GET\",\n\t\tpath: `${baseRouteName}/policy/admin/offer/:id`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tpapGetOffer(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<IPapGetOfferRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"papGetOfferRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tid: \"urn:rights-management:abc123def456\"\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},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<IPapGetOfferResponse>(),\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"papGetResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\t\"@context\": PAP_POLICY_RESPONSE_CONTEXT,\n\t\t\t\t\t\t\t\t\"@type\": OdrlPolicyType.Offer,\n\t\t\t\t\t\t\t\t\"@id\": \"urn:rights-management:abc123def456\",\n\t\t\t\t\t\t\t\t...papPolicyExampleLifecycle,\n\t\t\t\t\t\t\t\tpermission: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttarget: \"http://example.com/asset/1\",\n\t\t\t\t\t\t\t\t\t\taction: \"use\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\tassignee: \"did:example:receiver\",\n\t\t\t\t\t\t\t\tassigner: \"did:example:sender\"\n\t\t\t\t\t\t\t}\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]\n\t};\n\n\tconst papGetSetRoute: IRestRoute<IPapGetSetRequest, IPapGetSetResponse> = {\n\t\toperationId: \"papGetSet\",\n\t\tsummary: \"Get a policy set\",\n\t\ttag: papTags[0].name,\n\t\tmethod: \"GET\",\n\t\tpath: `${baseRouteName}/policy/admin/set/:id`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tpapGetSet(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<IPapGetSetRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"papGetSetRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tid: \"urn:rights-management:abc123def456\"\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},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<IPapGetSetResponse>(),\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"papGetResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\t\"@context\": PAP_POLICY_RESPONSE_CONTEXT,\n\t\t\t\t\t\t\t\t\"@type\": OdrlPolicyType.Set,\n\t\t\t\t\t\t\t\t\"@id\": \"urn:rights-management:abc123def456\",\n\t\t\t\t\t\t\t\t...papPolicyExampleLifecycle,\n\t\t\t\t\t\t\t\tpermission: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttarget: \"http://example.com/asset/1\",\n\t\t\t\t\t\t\t\t\t\taction: \"use\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\tassignee: \"did:example:receiver\",\n\t\t\t\t\t\t\t\tassigner: \"did:example:sender\"\n\t\t\t\t\t\t\t}\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]\n\t};\n\n\tconst papRemoveRoute: IRestRoute<IPapRemoveRequest, INoContentResponse> = {\n\t\toperationId: \"papRemove\",\n\t\tsummary: \"Remove a policy\",\n\t\ttag: papTags[0].name,\n\t\tmethod: \"DELETE\",\n\t\tpath: `${baseRouteName}/policy/admin/:id`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tpapRemove(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<IPapRemoveRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"papRemoveRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tid: \"urn:rights-management:abc123def456\"\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},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<INoContentResponse>()\n\t\t\t}\n\t\t]\n\t};\n\n\tconst papQueryRoute: IRestRoute<IPapQueryRequest, IPapQueryResponse> = {\n\t\toperationId: \"papQuery\",\n\t\tsummary: \"Query policies\",\n\t\ttag: papTags[0].name,\n\t\tmethod: \"GET\",\n\t\tpath: `${baseRouteName}/policy/admin`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tpapQuery(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<IPapQueryRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"papQueryRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tquery: {\n\t\t\t\t\t\t\tcursor: \"optional-pagination-cursor\"\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},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<IPapQueryResponse>(),\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"papQueryResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tbody: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"@context\": PAP_POLICY_RESPONSE_CONTEXT,\n\t\t\t\t\t\t\t\t\t\"@type\": OdrlPolicyType.Set,\n\t\t\t\t\t\t\t\t\t\"@id\": \"urn:rights-management:abc123def456\",\n\t\t\t\t\t\t\t\t\t...papPolicyExampleLifecycle,\n\t\t\t\t\t\t\t\t\tpermission: [\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\ttarget: \"http://example.com/asset/1\",\n\t\t\t\t\t\t\t\t\t\t\taction: \"use\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\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]\n\t};\n\n\treturn [\n\t\tpapCreateRoute,\n\t\tpapUpdateRoute,\n\t\tpapGetRoute,\n\t\tpapGetAgreementRoute,\n\t\tpapGetOfferRoute,\n\t\tpapGetSetRoute,\n\t\tpapRemoveRoute,\n\t\tpapQueryRoute\n\t];\n}\n\n/**\n * PAP: Create a policy.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @param baseRouteName The base route name to use for generating the location header.\n * @returns The response object with additional http response properties.\n */\nexport async function papCreate(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: IPapCreateRequest,\n\tbaseRouteName: string\n): Promise<ICreatedResponse> {\n\tGuards.object<IPapCreateRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object<IPapCreateRequest[\"body\"]>(ROUTES_SOURCE, nameof(request.body), request.body);\n\n\tconst component = ComponentFactory.get<IPolicyAdministrationPointComponent>(componentName);\n\n\tconst policy = request.body;\n\tconst uid = await component.create(policy);\n\n\tconst contextIds = await ContextIdStore.getContextIds();\n\tconst publicOrigin = contextIds?.[HttpContextIdKeys.PublicOrigin];\n\n\tconst headers: IHttpHeaders = {};\n\tHttpHeaderHelper.buildId(\n\t\theaders,\n\t\tuid,\n\t\tHttpUrlHelper.combineOriginPath(publicOrigin, `${baseRouteName}/policy/admin/:id`)\n\t);\n\n\treturn {\n\t\tstatusCode: HttpStatusCode.created,\n\t\theaders: {\n\t\t\tlocation: uid\n\t\t}\n\t};\n}\n\n/**\n * PAP: Update a policy.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function papUpdate(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: IPapUpdateRequest\n): Promise<INoContentResponse> {\n\tGuards.object(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object(ROUTES_SOURCE, nameof(request.pathParams), request.pathParams);\n\tGuards.stringValue(ROUTES_SOURCE, nameof(request.pathParams.id), request.pathParams.id);\n\tGuards.object(ROUTES_SOURCE, nameof(request.body), request.body);\n\n\tconst component = ComponentFactory.get<IPolicyAdministrationPointComponent>(componentName);\n\tawait component.update(request.body);\n\n\treturn {\n\t\tstatusCode: HttpStatusCode.noContent\n\t};\n}\n\n/**\n * PAP: Get a policy.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function papGet(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: IPapGetRequest\n): Promise<IPapGetResponse> {\n\tGuards.object<IPapGetRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object<IPapGetRequest[\"pathParams\"]>(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.pathParams),\n\t\trequest.pathParams\n\t);\n\tGuards.stringValue(ROUTES_SOURCE, nameof(request.pathParams.id), request.pathParams.id);\n\n\tconst component = ComponentFactory.get<IPolicyAdministrationPointComponent>(componentName);\n\tconst policy = await component.get(request.pathParams.id);\n\n\treturn {\n\t\tbody: policy\n\t};\n}\n\n/**\n * PAP: Get a agreement.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function papGetAgreement(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: IPapGetAgreementRequest\n): Promise<IPapGetAgreementResponse> {\n\tGuards.object<IPapGetAgreementRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object<IPapGetAgreementRequest[\"pathParams\"]>(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.pathParams),\n\t\trequest.pathParams\n\t);\n\tGuards.stringValue(ROUTES_SOURCE, nameof(request.pathParams.id), request.pathParams.id);\n\n\tconst component = ComponentFactory.get<IPolicyAdministrationPointComponent>(componentName);\n\tconst policy = await component.getAgreement(request.pathParams.id);\n\n\treturn {\n\t\tbody: policy\n\t};\n}\n\n/**\n * PAP: Get an offer.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function papGetOffer(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: IPapGetOfferRequest\n): Promise<IPapGetOfferResponse> {\n\tGuards.object<IPapGetOfferRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object<IPapGetOfferRequest[\"pathParams\"]>(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.pathParams),\n\t\trequest.pathParams\n\t);\n\tGuards.stringValue(ROUTES_SOURCE, nameof(request.pathParams.id), request.pathParams.id);\n\n\tconst component = ComponentFactory.get<IPolicyAdministrationPointComponent>(componentName);\n\tconst policy = await component.getOffer(request.pathParams.id);\n\n\treturn {\n\t\tbody: policy\n\t};\n}\n\n/**\n * PAP: Get a set.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function papGetSet(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: IPapGetSetRequest\n): Promise<IPapGetSetResponse> {\n\tGuards.object<IPapGetSetRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object<IPapGetSetRequest[\"pathParams\"]>(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.pathParams),\n\t\trequest.pathParams\n\t);\n\tGuards.stringValue(ROUTES_SOURCE, nameof(request.pathParams.id), request.pathParams.id);\n\n\tconst component = ComponentFactory.get<IPolicyAdministrationPointComponent>(componentName);\n\tconst policy = await component.getSet(request.pathParams.id);\n\n\treturn {\n\t\tbody: policy\n\t};\n}\n\n/**\n * PAP: Remove a policy.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function papRemove(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: IPapRemoveRequest\n): Promise<INoContentResponse> {\n\tGuards.object<IPapRemoveRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object<IPapRemoveRequest[\"pathParams\"]>(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.pathParams),\n\t\trequest.pathParams\n\t);\n\tGuards.stringValue(ROUTES_SOURCE, nameof(request.pathParams.id), request.pathParams.id);\n\n\tconst component = ComponentFactory.get<IPolicyAdministrationPointComponent>(componentName);\n\tawait component.remove(request.pathParams.id);\n\n\treturn {\n\t\tstatusCode: HttpStatusCode.noContent\n\t};\n}\n\n/**\n * PAP: Query policies.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function papQuery(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: IPapQueryRequest\n): Promise<IPapQueryResponse> {\n\tGuards.object<IPapQueryRequest>(ROUTES_SOURCE, nameof(request), request);\n\n\tconst component = ComponentFactory.get<IPolicyAdministrationPointComponent>(componentName);\n\tconst result = await component.query(\n\t\t{\n\t\t\ttype: request.query?.type as OdrlPolicyType,\n\t\t\tassigner: request.query?.assigner,\n\t\t\tassignee: request.query?.assignee,\n\t\t\ttarget: request.query?.target,\n\t\t\taction: request.query?.action\n\t\t},\n\t\tHttpParameterHelper.objectFromString(request.query?.conditions),\n\t\trequest.query?.cursor,\n\t\tCoerce.integer(request.query?.limit)\n\t);\n\n\tconst headers: IPapQueryResponse[\"headers\"] = {};\n\n\tconst contextIds = await ContextIdStore.getContextIds();\n\tHttpHeaderHelper.buildCursor(\n\t\theaders,\n\t\thttpRequestContext.serverRequest.url,\n\t\tcontextIds?.[HttpContextIdKeys.PublicOrigin],\n\t\tresult.cursor\n\t);\n\n\treturn {\n\t\theaders,\n\t\tbody: result.policies\n\t};\n}\n"]}
1
+ {"version":3,"file":"policyAdministrationPointRoutes.js","sourceRoot":"","sources":["../../src/policyAdministrationPointRoutes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EACN,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EAMb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAElE,OAAO,EACN,uBAAuB,EAevB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AAClG,OAAO,EAAE,cAAc,EAAqB,MAAM,eAAe,CAAC;AAElE;;GAEG;AACH,MAAM,aAAa,GAAG,iCAAiC,CAAC;AAExD;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAW;IAC9B;QACC,IAAI,EAAE,6BAA6B;QACnC,WAAW,EAAE,yEAAyE;KACtF;CACD,CAAC;AAEF;;;GAGG;AACH,MAAM,2BAA2B,GAAoB;IACpD,YAAY,CAAC,OAAO;IACpB,uBAAuB;CACvB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,2CAA2C,CAC1D,aAAqB,EACrB,aAAqB;IAErB,MAAM,yBAAyB,GAAG;QACjC,WAAW,EAAE,0BAA0B;QACvC,YAAY,EAAE,0BAA0B;KACxC,CAAC;IAEF,MAAM,cAAc,GAAoD;QACvE,WAAW,EAAE,WAAW;QACxB,OAAO,EAAE,iBAAiB;QAC1B,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI;QACpB,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,GAAG,aAAa,eAAe;QACrC,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,OAAO,EA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M,MAAM,GAAG,MAAM,SAAS,CAAC,KAAK,CACnC;QACC,IAAI,EAAE,OAAO,CAAC,KAAK,EAAE,IAAsB;QAC3C,QAAQ,EAAE,OAAO,CAAC,KAAK,EAAE,QAAQ;QACjC,QAAQ,EAAE,OAAO,CAAC,KAAK,EAAE,QAAQ;QACjC,MAAM,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM;QAC7B,MAAM,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM;KAC7B,EACD,mBAAmB,CAAC,gBAAgB,CAAC,OAAO,CAAC,KAAK,EAAE,UAAU,CAAC,EAC/D,OAAO,CAAC,KAAK,EAAE,MAAM,EACrB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CACpC,CAAC;IAEF,MAAM,OAAO,GAAiC,EAAE,CAAC;IAEjD,MAAM,UAAU,GAAG,MAAM,cAAc,CAAC,aAAa,EAAE,CAAC;IACxD,gBAAgB,CAAC,WAAW,CAC3B,OAAO,EACP,kBAAkB,CAAC,aAAa,CAAC,GAAG,EACpC,UAAU,EAAE,CAAC,iBAAiB,CAAC,YAAY,CAAC,EAC5C,MAAM,CAAC,MAAM,CACb,CAAC;IAEF,OAAO;QACN,OAAO;QACP,IAAI,EAAE,MAAM,CAAC,QAAQ;KACrB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport {\n\tHttpContextIdKeys,\n\tHttpHeaderHelper,\n\tHttpParameterHelper,\n\tHttpUrlHelper,\n\ttype ICreatedResponse,\n\ttype IHttpRequestContext,\n\ttype INoContentResponse,\n\ttype IRestRoute,\n\ttype ITag\n} from \"@twin.org/api-models\";\nimport { ContextIdStore } from \"@twin.org/context\";\nimport { Coerce, ComponentFactory, Guards } from \"@twin.org/core\";\nimport { nameof } from \"@twin.org/nameof\";\nimport {\n\tPOLICY_METADATA_CONTEXT,\n\ttype IPapCreateRequest,\n\ttype IPapGetAgreementRequest,\n\ttype IPapGetAgreementResponse,\n\ttype IPapGetOfferRequest,\n\ttype IPapGetOfferResponse,\n\ttype IPapGetRequest,\n\ttype IPapGetResponse,\n\ttype IPapGetSetRequest,\n\ttype IPapGetSetResponse,\n\ttype IPapQueryRequest,\n\ttype IPapQueryResponse,\n\ttype IPapRemoveRequest,\n\ttype IPapUpdateRequest,\n\ttype IPolicyAdministrationPointComponent\n} from \"@twin.org/rights-management-models\";\nimport { OdrlContexts, OdrlPolicyType, type OdrlContextType } from \"@twin.org/standards-w3c-odrl\";\nimport { HttpStatusCode, type IHttpHeaders } from \"@twin.org/web\";\n\n/**\n * The source used when communicating about these routes.\n */\nconst ROUTES_SOURCE = \"policyAdministrationPointRoutes\";\n\n/**\n * The tag to associate with the routes.\n */\nexport const papTags: ITag[] = [\n\t{\n\t\tname: \"Policy Administration Point\",\n\t\tdescription: \"Endpoints for managing ODRL policies in the Policy Administration Point\"\n\t}\n];\n\n/**\n * Example JSON-LD context returned by PAP read endpoints for policies with metadata timestamps.\n * Uses `POLICY_METADATA_CONTEXT` from rights-management-models merged with ODRL context.\n */\nconst PAP_POLICY_RESPONSE_CONTEXT: OdrlContextType = [\n\tOdrlContexts.Context,\n\tPOLICY_METADATA_CONTEXT\n];\n\n/**\n * The REST routes for the Policy Administration Point.\n * @param baseRouteName Prefix to prepend to the paths.\n * @param componentName The name of the component to use in the routes stored in the ComponentFactory.\n * @returns The generated routes.\n */\nexport function generateRestRoutesPolicyAdministrationPoint(\n\tbaseRouteName: string,\n\tcomponentName: string\n): IRestRoute[] {\n\tconst papPolicyExampleLifecycle = {\n\t\tdateCreated: \"2025-09-03T00:00:00.000Z\",\n\t\tdateModified: \"2025-09-03T00:00:00.000Z\"\n\t};\n\n\tconst papCreateRoute: IRestRoute<IPapCreateRequest, ICreatedResponse> = {\n\t\toperationId: \"papCreate\",\n\t\tsummary: \"Create a policy\",\n\t\ttag: papTags[0].name,\n\t\tmethod: \"POST\",\n\t\tpath: `${baseRouteName}/policy/admin`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tpapCreate(httpRequestContext, componentName, request, baseRouteName),\n\t\trequestType: {\n\t\t\ttype: nameof<IPapCreateRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"papCreateRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\"@context\": OdrlContexts.Context,\n\t\t\t\t\t\t\t\"@type\": OdrlPolicyType.Set,\n\t\t\t\t\t\t\tpermission: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttarget: \"http://example.com/asset/1\",\n\t\t\t\t\t\t\t\t\taction: \"use\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\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},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<ICreatedResponse>(),\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"papCreateResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tstatusCode: 201,\n\t\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t\tlocation: \"urn:rights-management:abc123def456\"\n\t\t\t\t\t\t\t}\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]\n\t};\n\n\tconst papUpdateRoute: IRestRoute<IPapUpdateRequest, INoContentResponse> = {\n\t\toperationId: \"papUpdate\",\n\t\tsummary: \"Update a policy\",\n\t\ttag: papTags[0].name,\n\t\tmethod: \"PUT\",\n\t\tpath: `${baseRouteName}/policy/admin/:id`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tpapUpdate(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<IPapUpdateRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"papUpdateRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tid: \"urn:rights-management:abc123def456\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\"@context\": OdrlContexts.Context,\n\t\t\t\t\t\t\t\"@type\": OdrlPolicyType.Set,\n\t\t\t\t\t\t\t\"@id\": \"urn:rights-management:abc123def456\",\n\t\t\t\t\t\t\tpermission: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttarget: \"http://example.com/asset/2\",\n\t\t\t\t\t\t\t\t\taction: \"read\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\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},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<INoContentResponse>()\n\t\t\t}\n\t\t]\n\t};\n\n\tconst papGetRoute: IRestRoute<IPapGetRequest, IPapGetResponse> = {\n\t\toperationId: \"papGet\",\n\t\tsummary: \"Get a policy\",\n\t\ttag: papTags[0].name,\n\t\tmethod: \"GET\",\n\t\tpath: `${baseRouteName}/policy/admin/:id`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tpapGet(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<IPapGetRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"papGetRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tid: \"urn:rights-management:abc123def456\"\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},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<IPapGetResponse>(),\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"papGetResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\t\"@context\": PAP_POLICY_RESPONSE_CONTEXT,\n\t\t\t\t\t\t\t\t\"@type\": OdrlPolicyType.Set,\n\t\t\t\t\t\t\t\t\"@id\": \"urn:rights-management:abc123def456\",\n\t\t\t\t\t\t\t\t...papPolicyExampleLifecycle,\n\t\t\t\t\t\t\t\tpermission: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttarget: \"http://example.com/asset/1\",\n\t\t\t\t\t\t\t\t\t\taction: \"use\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t}\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]\n\t};\n\n\tconst papGetAgreementRoute: IRestRoute<IPapGetAgreementRequest, IPapGetAgreementResponse> = {\n\t\toperationId: \"papGetAgreement\",\n\t\tsummary: \"Get a policy agreement\",\n\t\ttag: papTags[0].name,\n\t\tmethod: \"GET\",\n\t\tpath: `${baseRouteName}/policy/admin/agreement/:id`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tpapGetAgreement(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<IPapGetAgreementRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"papGetAgreementRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tid: \"urn:rights-management:abc123def456\"\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},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<IPapGetAgreementResponse>(),\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"papGetResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\t\"@context\": PAP_POLICY_RESPONSE_CONTEXT,\n\t\t\t\t\t\t\t\t\"@type\": OdrlPolicyType.Agreement,\n\t\t\t\t\t\t\t\t\"@id\": \"urn:rights-management:abc123def456\",\n\t\t\t\t\t\t\t\t...papPolicyExampleLifecycle,\n\t\t\t\t\t\t\t\tpermission: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttarget: \"http://example.com/asset/1\",\n\t\t\t\t\t\t\t\t\t\taction: \"use\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\tassignee: \"did:example:receiver\",\n\t\t\t\t\t\t\t\tassigner: \"did:example:sender\"\n\t\t\t\t\t\t\t}\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]\n\t};\n\n\tconst papGetOfferRoute: IRestRoute<IPapGetOfferRequest, IPapGetOfferResponse> = {\n\t\toperationId: \"papGetOffer\",\n\t\tsummary: \"Get a policy offer\",\n\t\ttag: papTags[0].name,\n\t\tmethod: \"GET\",\n\t\tpath: `${baseRouteName}/policy/admin/offer/:id`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tpapGetOffer(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<IPapGetOfferRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"papGetOfferRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tid: \"urn:rights-management:abc123def456\"\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},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<IPapGetOfferResponse>(),\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"papGetResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\t\"@context\": PAP_POLICY_RESPONSE_CONTEXT,\n\t\t\t\t\t\t\t\t\"@type\": OdrlPolicyType.Offer,\n\t\t\t\t\t\t\t\t\"@id\": \"urn:rights-management:abc123def456\",\n\t\t\t\t\t\t\t\t...papPolicyExampleLifecycle,\n\t\t\t\t\t\t\t\tpermission: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttarget: \"http://example.com/asset/1\",\n\t\t\t\t\t\t\t\t\t\taction: \"use\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\tassignee: \"did:example:receiver\",\n\t\t\t\t\t\t\t\tassigner: \"did:example:sender\"\n\t\t\t\t\t\t\t}\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]\n\t};\n\n\tconst papGetSetRoute: IRestRoute<IPapGetSetRequest, IPapGetSetResponse> = {\n\t\toperationId: \"papGetSet\",\n\t\tsummary: \"Get a policy set\",\n\t\ttag: papTags[0].name,\n\t\tmethod: \"GET\",\n\t\tpath: `${baseRouteName}/policy/admin/set/:id`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tpapGetSet(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<IPapGetSetRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"papGetSetRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tid: \"urn:rights-management:abc123def456\"\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},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<IPapGetSetResponse>(),\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"papGetResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\t\"@context\": PAP_POLICY_RESPONSE_CONTEXT,\n\t\t\t\t\t\t\t\t\"@type\": OdrlPolicyType.Set,\n\t\t\t\t\t\t\t\t\"@id\": \"urn:rights-management:abc123def456\",\n\t\t\t\t\t\t\t\t...papPolicyExampleLifecycle,\n\t\t\t\t\t\t\t\tpermission: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttarget: \"http://example.com/asset/1\",\n\t\t\t\t\t\t\t\t\t\taction: \"use\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\tassignee: \"did:example:receiver\",\n\t\t\t\t\t\t\t\tassigner: \"did:example:sender\"\n\t\t\t\t\t\t\t}\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]\n\t};\n\n\tconst papRemoveRoute: IRestRoute<IPapRemoveRequest, INoContentResponse> = {\n\t\toperationId: \"papRemove\",\n\t\tsummary: \"Remove a policy\",\n\t\ttag: papTags[0].name,\n\t\tmethod: \"DELETE\",\n\t\tpath: `${baseRouteName}/policy/admin/:id`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tpapRemove(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<IPapRemoveRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"papRemoveRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tid: \"urn:rights-management:abc123def456\"\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},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<INoContentResponse>()\n\t\t\t}\n\t\t]\n\t};\n\n\tconst papQueryRoute: IRestRoute<IPapQueryRequest, IPapQueryResponse> = {\n\t\toperationId: \"papQuery\",\n\t\tsummary: \"Query policies\",\n\t\ttag: papTags[0].name,\n\t\tmethod: \"GET\",\n\t\tpath: `${baseRouteName}/policy/admin`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tpapQuery(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<IPapQueryRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"papQueryRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tquery: {\n\t\t\t\t\t\t\tcursor: \"optional-pagination-cursor\"\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},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<IPapQueryResponse>(),\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"papQueryResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tbody: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"@context\": PAP_POLICY_RESPONSE_CONTEXT,\n\t\t\t\t\t\t\t\t\t\"@type\": OdrlPolicyType.Set,\n\t\t\t\t\t\t\t\t\t\"@id\": \"urn:rights-management:abc123def456\",\n\t\t\t\t\t\t\t\t\t...papPolicyExampleLifecycle,\n\t\t\t\t\t\t\t\t\tpermission: [\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\ttarget: \"http://example.com/asset/1\",\n\t\t\t\t\t\t\t\t\t\t\taction: \"use\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\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]\n\t};\n\n\treturn [\n\t\tpapCreateRoute,\n\t\tpapUpdateRoute,\n\t\tpapGetRoute,\n\t\tpapGetAgreementRoute,\n\t\tpapGetOfferRoute,\n\t\tpapGetSetRoute,\n\t\tpapRemoveRoute,\n\t\tpapQueryRoute\n\t];\n}\n\n/**\n * PAP: Create a policy.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @param baseRouteName The base route name to use for generating the location header.\n * @returns The response object with additional http response properties.\n */\nexport async function papCreate(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: IPapCreateRequest,\n\tbaseRouteName: string\n): Promise<ICreatedResponse> {\n\tGuards.object<IPapCreateRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object<IPapCreateRequest[\"body\"]>(ROUTES_SOURCE, nameof(request.body), request.body);\n\n\tconst component = ComponentFactory.get<IPolicyAdministrationPointComponent>(componentName);\n\n\tconst policy = request.body;\n\tconst uid = await component.create(policy);\n\n\tconst contextIds = await ContextIdStore.getContextIds();\n\tconst publicOrigin = contextIds?.[HttpContextIdKeys.PublicOrigin];\n\n\tconst headers: IHttpHeaders = {};\n\tHttpHeaderHelper.buildId(\n\t\theaders,\n\t\tuid,\n\t\tHttpUrlHelper.combineOriginPath(publicOrigin, `${baseRouteName}/policy/admin/:id`)\n\t);\n\n\treturn {\n\t\tstatusCode: HttpStatusCode.created,\n\t\theaders\n\t};\n}\n\n/**\n * PAP: Update a policy.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function papUpdate(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: IPapUpdateRequest\n): Promise<INoContentResponse> {\n\tGuards.object(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object(ROUTES_SOURCE, nameof(request.pathParams), request.pathParams);\n\tGuards.stringValue(ROUTES_SOURCE, nameof(request.pathParams.id), request.pathParams.id);\n\tGuards.object(ROUTES_SOURCE, nameof(request.body), request.body);\n\n\tconst component = ComponentFactory.get<IPolicyAdministrationPointComponent>(componentName);\n\tawait component.update(request.body);\n\n\treturn {\n\t\tstatusCode: HttpStatusCode.noContent\n\t};\n}\n\n/**\n * PAP: Get a policy.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function papGet(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: IPapGetRequest\n): Promise<IPapGetResponse> {\n\tGuards.object<IPapGetRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object<IPapGetRequest[\"pathParams\"]>(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.pathParams),\n\t\trequest.pathParams\n\t);\n\tGuards.stringValue(ROUTES_SOURCE, nameof(request.pathParams.id), request.pathParams.id);\n\n\tconst component = ComponentFactory.get<IPolicyAdministrationPointComponent>(componentName);\n\tconst policy = await component.get(request.pathParams.id);\n\n\treturn {\n\t\tbody: policy\n\t};\n}\n\n/**\n * PAP: Get a agreement.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function papGetAgreement(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: IPapGetAgreementRequest\n): Promise<IPapGetAgreementResponse> {\n\tGuards.object<IPapGetAgreementRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object<IPapGetAgreementRequest[\"pathParams\"]>(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.pathParams),\n\t\trequest.pathParams\n\t);\n\tGuards.stringValue(ROUTES_SOURCE, nameof(request.pathParams.id), request.pathParams.id);\n\n\tconst component = ComponentFactory.get<IPolicyAdministrationPointComponent>(componentName);\n\tconst policy = await component.getAgreement(request.pathParams.id);\n\n\treturn {\n\t\tbody: policy\n\t};\n}\n\n/**\n * PAP: Get an offer.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function papGetOffer(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: IPapGetOfferRequest\n): Promise<IPapGetOfferResponse> {\n\tGuards.object<IPapGetOfferRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object<IPapGetOfferRequest[\"pathParams\"]>(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.pathParams),\n\t\trequest.pathParams\n\t);\n\tGuards.stringValue(ROUTES_SOURCE, nameof(request.pathParams.id), request.pathParams.id);\n\n\tconst component = ComponentFactory.get<IPolicyAdministrationPointComponent>(componentName);\n\tconst policy = await component.getOffer(request.pathParams.id);\n\n\treturn {\n\t\tbody: policy\n\t};\n}\n\n/**\n * PAP: Get a set.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function papGetSet(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: IPapGetSetRequest\n): Promise<IPapGetSetResponse> {\n\tGuards.object<IPapGetSetRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object<IPapGetSetRequest[\"pathParams\"]>(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.pathParams),\n\t\trequest.pathParams\n\t);\n\tGuards.stringValue(ROUTES_SOURCE, nameof(request.pathParams.id), request.pathParams.id);\n\n\tconst component = ComponentFactory.get<IPolicyAdministrationPointComponent>(componentName);\n\tconst policy = await component.getSet(request.pathParams.id);\n\n\treturn {\n\t\tbody: policy\n\t};\n}\n\n/**\n * PAP: Remove a policy.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function papRemove(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: IPapRemoveRequest\n): Promise<INoContentResponse> {\n\tGuards.object<IPapRemoveRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object<IPapRemoveRequest[\"pathParams\"]>(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.pathParams),\n\t\trequest.pathParams\n\t);\n\tGuards.stringValue(ROUTES_SOURCE, nameof(request.pathParams.id), request.pathParams.id);\n\n\tconst component = ComponentFactory.get<IPolicyAdministrationPointComponent>(componentName);\n\tawait component.remove(request.pathParams.id);\n\n\treturn {\n\t\tstatusCode: HttpStatusCode.noContent\n\t};\n}\n\n/**\n * PAP: Query policies.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function papQuery(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: IPapQueryRequest\n): Promise<IPapQueryResponse> {\n\tGuards.object<IPapQueryRequest>(ROUTES_SOURCE, nameof(request), request);\n\n\tconst component = ComponentFactory.get<IPolicyAdministrationPointComponent>(componentName);\n\tconst result = await component.query(\n\t\t{\n\t\t\ttype: request.query?.type as OdrlPolicyType,\n\t\t\tassigner: request.query?.assigner,\n\t\t\tassignee: request.query?.assignee,\n\t\t\ttarget: request.query?.target,\n\t\t\taction: request.query?.action\n\t\t},\n\t\tHttpParameterHelper.objectFromString(request.query?.conditions),\n\t\trequest.query?.cursor,\n\t\tCoerce.integer(request.query?.limit)\n\t);\n\n\tconst headers: IPapQueryResponse[\"headers\"] = {};\n\n\tconst contextIds = await ContextIdStore.getContextIds();\n\tHttpHeaderHelper.buildCursor(\n\t\theaders,\n\t\thttpRequestContext.serverRequest.url,\n\t\tcontextIds?.[HttpContextIdKeys.PublicOrigin],\n\t\tresult.cursor\n\t);\n\n\treturn {\n\t\theaders,\n\t\tbody: result.policies\n\t};\n}\n"]}
package/docs/changelog.md CHANGED
@@ -6,6 +6,122 @@
6
6
 
7
7
  * remove EcosystemPolicy support from PAP/REST routes and generated API surface for v2.
8
8
 
9
+ ## [0.9.2-next.2](https://github.com/iotaledger/twin-rights-management/compare/rights-management-service-v0.9.2-next.1...rights-management-service-v0.9.2-next.2) (2026-08-04)
10
+
11
+
12
+ ### Miscellaneous Chores
13
+
14
+ * **rights-management-service:** Synchronize repo versions
15
+
16
+
17
+ ### Dependencies
18
+
19
+ * The following workspace dependencies were updated
20
+ * dependencies
21
+ * @twin.org/rights-management-models bumped from 0.9.2-next.1 to 0.9.2-next.2
22
+ * devDependencies
23
+ * @twin.org/rights-management-pap-service bumped from 0.9.2-next.1 to 0.9.2-next.2
24
+ * @twin.org/rights-management-pdp-service bumped from 0.9.2-next.1 to 0.9.2-next.2
25
+ * @twin.org/rights-management-pep-service bumped from 0.9.2-next.1 to 0.9.2-next.2
26
+ * @twin.org/rights-management-pip-service bumped from 0.9.2-next.1 to 0.9.2-next.2
27
+ * @twin.org/rights-management-pmp-service bumped from 0.9.2-next.1 to 0.9.2-next.2
28
+ * @twin.org/rights-management-pnp-service bumped from 0.9.2-next.1 to 0.9.2-next.2
29
+ * @twin.org/rights-management-pxp-service bumped from 0.9.2-next.1 to 0.9.2-next.2
30
+
31
+ ## [0.9.2-next.1](https://github.com/iotaledger/twin-rights-management/compare/rights-management-service-v0.9.2-next.0...rights-management-service-v0.9.2-next.1) (2026-07-30)
32
+
33
+
34
+ ### Features
35
+
36
+ * add context id features ([#51](https://github.com/iotaledger/twin-rights-management/issues/51)) ([239922c](https://github.com/iotaledger/twin-rights-management/commit/239922c82a7fa94b66c8ee0e924bc58ddaaba395))
37
+ * add create() to pre-register consumer-side contract negotiations ([#187](https://github.com/iotaledger/twin-rights-management/issues/187)) ([6007f83](https://github.com/iotaledger/twin-rights-management/commit/6007f83579cc8d4dbc4c2243fed0cbe948371f82))
38
+ * add DAP (Data Access Point) ([#40](https://github.com/iotaledger/twin-rights-management/issues/40)) ([f3e684b](https://github.com/iotaledger/twin-rights-management/commit/f3e684ba1f9a934394c64635f393fbb6709ff480))
39
+ * add default enforcement processor ([#73](https://github.com/iotaledger/twin-rights-management/issues/73)) ([0c64d49](https://github.com/iotaledger/twin-rights-management/commit/0c64d49bab363b3da6d197536a605f7929a7c584))
40
+ * add default policy arbiter ([#76](https://github.com/iotaledger/twin-rights-management/issues/76)) ([b62ff9c](https://github.com/iotaledger/twin-rights-management/commit/b62ff9ce1b3400c4a95909da01863af47f430dbf))
41
+ * add EcosystemPolicy typed getter across PAP stack ([#114](https://github.com/iotaledger/twin-rights-management/issues/114)) ([2a8e941](https://github.com/iotaledger/twin-rights-management/commit/2a8e941bbea229fb74f81dc869ce1f85c66c300d))
42
+ * add factory pattern ([d26b4c0](https://github.com/iotaledger/twin-rights-management/commit/d26b4c08a2f3ba5758df66a1c48203b8d8e3638e))
43
+ * add includeErrorDetails config ([73af46f](https://github.com/iotaledger/twin-rights-management/commit/73af46fa92fb7661334dc4674219705724967d79))
44
+ * add JSON-LD types for negotiation ([6be61f8](https://github.com/iotaledger/twin-rights-management/commit/6be61f890537cb9d22d4fad90092b858de2c9c2d))
45
+ * add PAP-managed schema.org lifecycle timestamps to policies ([#176](https://github.com/iotaledger/twin-rights-management/issues/176)) ([8d53036](https://github.com/iotaledger/twin-rights-management/commit/8d5303674b93a59532c0f16864b8484378ebe16c))
46
+ * add policy negotiation point PNP, PNAP and PNRP ([#32](https://github.com/iotaledger/twin-rights-management/issues/32)) ([90f0659](https://github.com/iotaledger/twin-rights-management/commit/90f06593a1126df3c2f4ca23cf95a08260fd6415))
47
+ * add scaffold for other services ([de25f34](https://github.com/iotaledger/twin-rights-management/commit/de25f34c40fb65b6d73df98965ea4e368019da84))
48
+ * add skipTenant to PNP route definitions ([#110](https://github.com/iotaledger/twin-rights-management/issues/110)) ([5a8e925](https://github.com/iotaledger/twin-rights-management/commit/5a8e925868c94d12e382e184c5a16ee8135194b1))
49
+ * 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))
50
+ * add validate-locales ([78f30cf](https://github.com/iotaledger/twin-rights-management/commit/78f30cf61054655c815e5fc42972ee39502e3687))
51
+ * additional pap features ([#69](https://github.com/iotaledger/twin-rights-management/issues/69)) ([a80d511](https://github.com/iotaledger/twin-rights-management/commit/a80d511ace8fad9fbf4c02cb82ead261a5944b34))
52
+ * adopt node/tenant identifier model in PNP + IPolicyNegotiation ([#145](https://github.com/iotaledger/twin-rights-management/issues/145)) ([0911bfc](https://github.com/iotaledger/twin-rights-management/commit/0911bfc6b59d1067958cb3a70d2fae823c9f2359))
53
+ * capture organization identity ([#88](https://github.com/iotaledger/twin-rights-management/issues/88)) ([8fcee6e](https://github.com/iotaledger/twin-rights-management/commit/8fcee6e676bb5a9a344d83c50567066e447aca76))
54
+ * change callback url to callback path ([#65](https://github.com/iotaledger/twin-rights-management/issues/65)) ([f02ceaf](https://github.com/iotaledger/twin-rights-management/commit/f02ceaf0a53083f088690c7d3a384045b1061821))
55
+ * consistent uid usage ([#83](https://github.com/iotaledger/twin-rights-management/issues/83)) ([bdfb9f9](https://github.com/iotaledger/twin-rights-management/commit/bdfb9f92777cbfdb65b5b7df5660b70d869ed19d))
56
+ * engine compatibility updates ([490e015](https://github.com/iotaledger/twin-rights-management/commit/490e015901d6a5ac6563da484a18fc5f285556b1))
57
+ * enhanced rest testing ([#227](https://github.com/iotaledger/twin-rights-management/issues/227)) ([f76c137](https://github.com/iotaledger/twin-rights-management/commit/f76c13781c987e0fd153aa316abfd27113317fad))
58
+ * eslint migration to flat config ([5313718](https://github.com/iotaledger/twin-rights-management/commit/5313718f15efb4f6b1f257bf9807770baef7eed3))
59
+ * eslint migration to flat config ([23a0c08](https://github.com/iotaledger/twin-rights-management/commit/23a0c085e7fc2e522c8d85d325dc5844b9c3fd8e))
60
+ * improve json path handling ([#133](https://github.com/iotaledger/twin-rights-management/issues/133)) ([0a3c0c4](https://github.com/iotaledger/twin-rights-management/commit/0a3c0c41f15f74a6e2463ed9802c7b662d3e95f6))
61
+ * international dataspaces contract negotiation ([#41](https://github.com/iotaledger/twin-rights-management/issues/41)) ([41ed515](https://github.com/iotaledger/twin-rights-management/commit/41ed5154d6cef48bc99db3158dbde6ec88523a0b))
62
+ * introduce context for additional environment input ([e1d0392](https://github.com/iotaledger/twin-rights-management/commit/e1d0392622e5a018b695644f423c5b23cc40d3b7))
63
+ * move create and verify proofs to helper ([a4e1f4a](https://github.com/iotaledger/twin-rights-management/commit/a4e1f4afe01ea12c36f29672197128e65819c875))
64
+ * organization identifiers ([#177](https://github.com/iotaledger/twin-rights-management/issues/177)) ([98d2484](https://github.com/iotaledger/twin-rights-management/commit/98d24841e3ecbb9a5225c151d171f8a9c08ccfbc))
65
+ * pap create, update methods ([#13](https://github.com/iotaledger/twin-rights-management/issues/13)) ([edb6c9e](https://github.com/iotaledger/twin-rights-management/commit/edb6c9efcfda55ac96f7594253bf831b4f0e5993))
66
+ * pdp add ([#39](https://github.com/iotaledger/twin-rights-management/issues/39)) ([68b9a8a](https://github.com/iotaledger/twin-rights-management/commit/68b9a8a7a3cf2902f9eecb590ca3316c6b1671f0))
67
+ * pnp callback encryption, getDatasetTargets helper, engine-driven callbackPath ([#132](https://github.com/iotaledger/twin-rights-management/issues/132)) ([e642154](https://github.com/iotaledger/twin-rights-management/commit/e6421546336bfa73a7c0a9fe102beeaa518249dd))
68
+ * remove data access point ([#67](https://github.com/iotaledger/twin-rights-management/issues/67)) ([8573676](https://github.com/iotaledger/twin-rights-management/commit/8573676862c9f1634a66a0677b225b4de16a89cd))
69
+ * remove element factories ([8cb4af8](https://github.com/iotaledger/twin-rights-management/commit/8cb4af85a5c9c01e3b68ecc7109cf701b914ea9a))
70
+ * remove hosting component ([#207](https://github.com/iotaledger/twin-rights-management/issues/207)) ([2a51690](https://github.com/iotaledger/twin-rights-management/commit/2a5169085b7df2245a474580e88b5b4e501006fe))
71
+ * remove unnecessary config options from service ([31ef3a2](https://github.com/iotaledger/twin-rights-management/commit/31ef3a2eb2293efdad7e6b8b55f105cc62bba3ed))
72
+ * remove unused namespace ([e8aa679](https://github.com/iotaledger/twin-rights-management/commit/e8aa679479231a49f86dd8dec5f9b811bd3f595f))
73
+ * rename pap entity storage to pap service ([38a2c14](https://github.com/iotaledger/twin-rights-management/commit/38a2c14d8f63a86e398820166c83437be5aca1b8))
74
+ * rest enhancements ([#229](https://github.com/iotaledger/twin-rights-management/issues/229)) ([b48de25](https://github.com/iotaledger/twin-rights-management/commit/b48de25820eddb4cc53020bb2afbd91497d22de5))
75
+ * rights management pap ([#4](https://github.com/iotaledger/twin-rights-management/issues/4)) ([d1165a9](https://github.com/iotaledger/twin-rights-management/commit/d1165a92f57128731cfb308d977832e28cf33493))
76
+ * separate rest routes ([538b86b](https://github.com/iotaledger/twin-rights-management/commit/538b86be26b46711279101aa01fec119419d8149))
77
+ * simplify pnap create request ([be4dfe7](https://github.com/iotaledger/twin-rights-management/commit/be4dfe726a0bc7af11eb05cfd0525e7bff8a7d98))
78
+ * typescript 6 update ([18f6f1e](https://github.com/iotaledger/twin-rights-management/commit/18f6f1edba890462c068ba0b76ae6dd005e798be))
79
+ * update contexts ([#63](https://github.com/iotaledger/twin-rights-management/issues/63)) ([e55200f](https://github.com/iotaledger/twin-rights-management/commit/e55200f9929eaced6c446be25969dbe0f95ee909))
80
+ * update dataspace protocol dependencies ([9dcc477](https://github.com/iotaledger/twin-rights-management/commit/9dcc47755c2f5a7fd3ef30e656f1988944cd4b54))
81
+ * update dataspace standards packages ([dbd5bf6](https://github.com/iotaledger/twin-rights-management/commit/dbd5bf62403a97c758ee2320d9cac378c568165b))
82
+ * update dependencies ([5bfbb30](https://github.com/iotaledger/twin-rights-management/commit/5bfbb302bb245c8cd8015ff497db3793077d43cd))
83
+ * update dependencies ([dd0a553](https://github.com/iotaledger/twin-rights-management/commit/dd0a553020b0dc5c41fb6865a2e36bd26045b0b9))
84
+ * update dspace dependencies ([072917b](https://github.com/iotaledger/twin-rights-management/commit/072917bcfa052a6d61e6cd3676e275ba7fc4ec25))
85
+ * update framework core ([d0ffcba](https://github.com/iotaledger/twin-rights-management/commit/d0ffcba9cf1dc2b562193ee298f099612d100ce8))
86
+ * update namespaces and contexts ([#61](https://github.com/iotaledger/twin-rights-management/issues/61)) ([033446b](https://github.com/iotaledger/twin-rights-management/commit/033446b91ccf0c7664061afda9a1ad49d3c671ec))
87
+ * update naming ([e75ae80](https://github.com/iotaledger/twin-rights-management/commit/e75ae80dcf3d8099a1dea32ef498efb640de52ef))
88
+ * update processors ([#71](https://github.com/iotaledger/twin-rights-management/issues/71)) ([d6e8c1e](https://github.com/iotaledger/twin-rights-management/commit/d6e8c1e593acb28556674d5180123f220766eb6b))
89
+ * update standards packages ([db0740b](https://github.com/iotaledger/twin-rights-management/commit/db0740b1d8925fcb3bf4204641e0dc573af40f2b))
90
+ * update to more specific ds odrl types ([c56dc49](https://github.com/iotaledger/twin-rights-management/commit/c56dc4991d4e1e8ca3beb737d2a70dddf6f5cd44))
91
+ * update to use built in vc authentication ([f982b86](https://github.com/iotaledger/twin-rights-management/commit/f982b8676a7d21add85195c73558ef4f0fd9be29))
92
+ * update twindev schemas ([5d4edc1](https://github.com/iotaledger/twin-rights-management/commit/5d4edc1326fef611619d4b371a5d05a75ada719a))
93
+ * use Bearer format for token headers ([74d7d7c](https://github.com/iotaledger/twin-rights-management/commit/74d7d7cc59906c78798f78c5ed9211a3ee8dcd10))
94
+ * use per request http headers ([#59](https://github.com/iotaledger/twin-rights-management/issues/59)) ([8806642](https://github.com/iotaledger/twin-rights-management/commit/88066429c362ac98fb870727a4fc55c9b533f1a4))
95
+ * use url transformer ([79b3b91](https://github.com/iotaledger/twin-rights-management/commit/79b3b918e622a11621548c5fe80ed77c335e947b))
96
+
97
+
98
+ ### Bug Fixes
99
+
100
+ * adding missing dependency ([#15](https://github.com/iotaledger/twin-rights-management/issues/15)) ([c7e6267](https://github.com/iotaledger/twin-rights-management/commit/c7e62678b296ef8d28c31921cb78aeabe674cd84))
101
+ * comment ([6ddc741](https://github.com/iotaledger/twin-rights-management/commit/6ddc7410088865de7bd68c814221f747de43a13f))
102
+ * make logging tests deterministic and complete hosting mock ([#173](https://github.com/iotaledger/twin-rights-management/issues/173)) ([80fa587](https://github.com/iotaledger/twin-rights-management/commit/80fa587a83cb73ab0cfc14b40fa7b878ccf64da5))
103
+ * modifying the function name for the rest routes ([#6](https://github.com/iotaledger/twin-rights-management/issues/6)) ([7915111](https://github.com/iotaledger/twin-rights-management/commit/7915111ac608c9d69bcaa819c85b553fc9bace6a))
104
+ * query params force coercion ([8590a0d](https://github.com/iotaledger/twin-rights-management/commit/8590a0da92584c04b67e73c448319f96f70c34a5))
105
+ * resolve 5 bugs preventing PNP contract negotiation callbacks ([#98](https://github.com/iotaledger/twin-rights-management/issues/98)) ([4a065d6](https://github.com/iotaledger/twin-rights-management/commit/4a065d669440f47dc44c3602abe7efa1ea9d45ff))
106
+ * return built location header in papCreate ([#279](https://github.com/iotaledger/twin-rights-management/issues/279)) ([8ccd460](https://github.com/iotaledger/twin-rights-management/commit/8ccd460a7aa395090e110122acb8fadabec8df0b))
107
+ * slimline openapi spec ([aacb9d5](https://github.com/iotaledger/twin-rights-management/commit/aacb9d50f80d3652ef7419ca3777f53e542773f1))
108
+ * use async getStore in tests ([61b9951](https://github.com/iotaledger/twin-rights-management/commit/61b99512f90faa26d22d57b6fbd3186a5cb53672))
109
+
110
+
111
+ ### Dependencies
112
+
113
+ * The following workspace dependencies were updated
114
+ * dependencies
115
+ * @twin.org/rights-management-models bumped from 0.9.2-next.0 to 0.9.2-next.1
116
+ * devDependencies
117
+ * @twin.org/rights-management-pap-service bumped from 0.9.2-next.0 to 0.9.2-next.1
118
+ * @twin.org/rights-management-pdp-service bumped from 0.9.2-next.0 to 0.9.2-next.1
119
+ * @twin.org/rights-management-pep-service bumped from 0.9.2-next.0 to 0.9.2-next.1
120
+ * @twin.org/rights-management-pip-service bumped from 0.9.2-next.0 to 0.9.2-next.1
121
+ * @twin.org/rights-management-pmp-service bumped from 0.9.2-next.0 to 0.9.2-next.1
122
+ * @twin.org/rights-management-pnp-service bumped from 0.9.2-next.0 to 0.9.2-next.1
123
+ * @twin.org/rights-management-pxp-service bumped from 0.9.2-next.0 to 0.9.2-next.1
124
+
9
125
  ## [0.9.1](https://github.com/iotaledger/twin-rights-management/compare/rights-management-service-v0.9.1...rights-management-service-v0.9.1) (2026-07-27)
10
126
 
11
127
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/rights-management-service",
3
- "version": "0.9.1",
3
+ "version": "0.9.2-next.2",
4
4
  "description": "Unified rights management service exposing policy and negotiation capabilities.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,17 +18,17 @@
18
18
  "node": ">=24.0.0"
19
19
  },
20
20
  "dependencies": {
21
- "@twin.org/api-models": "^0.9.1",
22
- "@twin.org/context": "^0.9.1",
23
- "@twin.org/core": "^0.9.1",
24
- "@twin.org/data-json-ld": "^0.9.1",
25
- "@twin.org/entity": "^0.9.1",
26
- "@twin.org/nameof": "^0.9.1",
27
- "@twin.org/rights-management-models": "^0.9.1",
28
- "@twin.org/standards-dataspace-protocol": "^0.9.1",
29
- "@twin.org/standards-w3c-did": "^0.9.1",
30
- "@twin.org/standards-w3c-odrl": "^0.9.1",
31
- "@twin.org/web": "^0.9.1"
21
+ "@twin.org/api-models": "next",
22
+ "@twin.org/context": "next",
23
+ "@twin.org/core": "next",
24
+ "@twin.org/data-json-ld": "next",
25
+ "@twin.org/entity": "next",
26
+ "@twin.org/nameof": "next",
27
+ "@twin.org/rights-management-models": "0.9.2-next.2",
28
+ "@twin.org/standards-dataspace-protocol": "next",
29
+ "@twin.org/standards-w3c-did": "next",
30
+ "@twin.org/standards-w3c-odrl": "next",
31
+ "@twin.org/web": "next"
32
32
  },
33
33
  "main": "./dist/es/index.js",
34
34
  "types": "./dist/types/index.d.ts",