@sphereon/ssi-sdk.linked-vp-rest-api 0.34.1-feature.SSISDK.82.linkedVP.325 → 0.34.1-feature.SSISDK.82.linkedVP.326
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/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
- package/src/linked-vp-api-server.ts +1 -1
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/linked-vp-api-server.ts","../src/api-functions.ts"],"sourcesContent":["export * from './types'\nexport * from './linked-vp-api-server'\nexport * from './api-functions'\n\nexport type {\n PublishCredentialArgs,\n UnpublishCredentialArgs,\n HasLinkedVPEntryArgs,\n GetServiceEntriesArgs,\n GeneratePresentationArgs,\n LinkedVPEntry,\n LinkedVPServiceEntry,\n LinkedVPPresentation,\n} from '@sphereon/ssi-sdk.linked-vp'\n","import { agentContext } from '@sphereon/ssi-sdk.core'\nimport { TAgent } from '@veramo/core'\n\nimport express, { Express, Router } from 'express'\nimport { ILinkedVPManagerAPIEndpointOpts, IRequiredPlugins } from './types'\nimport {\n publishCredentialEndpoint,\n unpublishCredentialEndpoint,\n hasEntryEndpoint,\n getServiceEntriesEndpoint,\n generatePresentationEndpoint,\n} from './api-functions'\nimport { copyGlobalAuthToEndpoints, ExpressSupport } from '@sphereon/ssi-express-support'\n\ntype LinkedVPManagerApiServerArgs = {\n agent: TAgent<IRequiredPlugins>\n expressSupport: ExpressSupport\n opts?: ILinkedVPManagerAPIEndpointOpts\n}\n\nexport class LinkedVpApiServer {\n private readonly _express: Express\n private readonly _agent: TAgent<IRequiredPlugins>\n private readonly _opts?: ILinkedVPManagerAPIEndpointOpts\n private readonly _router: Router\n\n constructor(args: LinkedVPManagerApiServerArgs) {\n const { agent, opts } = args\n this._agent = agent\n\n if (opts?.endpointOpts?.globalAuth?.secureLinkedVPManagerEndpoints) {\n copyGlobalAuthToEndpoints({\n opts,\n keys: ['publishManagement', 'serviceEntries', 'generatePresentation'],\n })\n }\n\n this._opts = opts\n this._express = args.expressSupport.express\n this._router = express.Router()\n const context = agentContext(agent)\n const features = opts?.enableFeatures ?? ['publish-management', 'service-entries', 'generate-presentation']\n console.log(`Linked VP API enabled, with features: ${JSON.stringify(features)}`)\n\n // Publish Management Endpoints\n if (features.includes('publish-management')) {\n publishCredentialEndpoint(this.router, context, this._opts?.endpointOpts?.publishManagement)\n unpublishCredentialEndpoint(this.router, context, this._opts?.endpointOpts?.publishManagement)\n hasEntryEndpoint(this.router, context, this._opts?.endpointOpts?.publishManagement)\n }\n\n // Service Entries Endpoint\n if (features.includes('service-entries')) {\n getServiceEntriesEndpoint(this.router, context, this._opts?.endpointOpts?.serviceEntries)\n }\n\n // Generate Presentation Endpoint\n if (features.includes('generate-presentation')) {\n generatePresentationEndpoint(this.router, context, this._opts?.endpointOpts?.generatePresentation)\n }\n\n this._express.use(opts?.endpointOpts?.basePath ?? '', this.router)\n }\n\n get express(): Express {\n return this._express\n }\n\n get router(): Router {\n return this._router\n }\n\n get agent(): TAgent<IRequiredPlugins> {\n return this._agent\n }\n\n get opts(): ILinkedVPManagerAPIEndpointOpts | undefined {\n return this._opts\n }\n}\n","import { checkAuth, ISingleEndpointOpts, sendErrorResponse } from '@sphereon/ssi-express-support'\nimport {\n GeneratePresentationArgs,\n GetServiceEntriesArgs,\n HasLinkedVPEntryArgs,\n PublishCredentialArgs,\n UnpublishCredentialArgs,\n} from '@sphereon/ssi-sdk.linked-vp'\nimport { Request, Response, Router } from 'express'\nimport { IRequiredContext } from './types'\n\nconst operation = '/linked-vp'\n\n// Publish Management Endpoints\nexport function publishCredentialEndpoint(router: Router, context: IRequiredContext, opts?: ISingleEndpointOpts) {\n if (opts?.enabled === false) {\n console.log(`\"publishCredentialEndpoint\" Endpoint is disabled`)\n return\n }\n const path = opts?.path ?? operation\n router.post(path, checkAuth(opts?.endpoint), async (request: Request, response: Response) => {\n try {\n const args = request.body as PublishCredentialArgs\n const entry = await context.agent.lvpPublishCredential(args)\n response.statusCode = 201\n return response.json(entry)\n } catch (error) {\n console.error(error)\n return sendErrorResponse(response, 500, error.message, error)\n }\n })\n}\n\nexport function unpublishCredentialEndpoint(router: Router, context: IRequiredContext, opts?: ISingleEndpointOpts) {\n if (opts?.enabled === false) {\n console.log(`\"unpublishCredentialEndpoint\" Endpoint is disabled`)\n return\n }\n const path = opts?.path ?? operation\n router.delete(`${path}/:linkedVpId`, checkAuth(opts?.endpoint), async (request: Request, response: Response) => {\n try {\n const linkedVpId = request.params.linkedVpId\n const result = await context.agent.lvpUnpublishCredential({ linkedVpId } as UnpublishCredentialArgs)\n response.statusCode = 200\n return response.json({ success: result })\n } catch (error) {\n return sendErrorResponse(response, 500, error.message, error)\n }\n })\n}\n\nexport function hasEntryEndpoint(router: Router, context: IRequiredContext, opts?: ISingleEndpointOpts) {\n if (opts?.enabled === false) {\n console.log(`\"hasEntryEndpoint\" Endpoint is disabled`)\n return\n }\n const path = opts?.path ?? operation\n router.get(`${path}/:linkedVpId/exists`, checkAuth(opts?.endpoint), async (request: Request, response: Response) => {\n try {\n const linkedVpId = request.params.linkedVpId\n const result = await context.agent.lvpHasEntry({ linkedVpId } as HasLinkedVPEntryArgs)\n response.statusCode = 200\n return response.json({ exists: result })\n } catch (error) {\n return sendErrorResponse(response, 500, error.message as string, error)\n }\n })\n}\n\n// Service Entries Endpoint\nexport function getServiceEntriesEndpoint(router: Router, context: IRequiredContext, opts?: ISingleEndpointOpts) {\n if (opts?.enabled === false) {\n console.log(`\"getServiceEntriesEndpoint\" Endpoint is disabled`)\n return\n }\n const path = opts?.path ?? `${operation}/service-entries`\n router.get(path, checkAuth(opts?.endpoint), async (request: Request, response: Response) => {\n try {\n const tenantId = request.query.tenantId as string | undefined\n const entries = await context.agent.lvpGetServiceEntries({ tenantId } as GetServiceEntriesArgs)\n response.statusCode = 200\n return response.json(entries)\n } catch (error) {\n return sendErrorResponse(response, 500, error.message as string, error)\n }\n })\n}\n\n// Generate Presentation Endpoint\nexport function generatePresentationEndpoint(router: Router, context: IRequiredContext, opts?: ISingleEndpointOpts) {\n if (opts?.enabled === false) {\n console.log(`\"generatePresentationEndpoint\" Endpoint is disabled`)\n return\n }\n const path = opts?.path ?? operation\n router.get(`${path}/:linkedVpId`, checkAuth(opts?.endpoint), async (request: Request, response: Response) => {\n try {\n const linkedVpId = request.params.linkedVpId\n const presentation = await context.agent.lvpGeneratePresentation({ linkedVpId } as GeneratePresentationArgs)\n response.statusCode = 200\n return response.json(presentation)\n } catch (error) {\n return sendErrorResponse(response, 500, error.message as string, error)\n }\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;ACAA,qBAA6B;AAG7B,qBAAyC;;;ACHzC,iCAAkE;AAWlE,IAAMA,YAAY;AAGX,SAASC,0BAA0BC,QAAgBC,SAA2BC,MAA0B;AAC7G,MAAIA,MAAMC,YAAY,OAAO;AAC3BC,YAAQC,IAAI,kDAAkD;AAC9D;EACF;AACA,QAAMC,OAAOJ,MAAMI,QAAQR;AAC3BE,SAAOO,KAAKD,UAAME,sCAAUN,MAAMO,QAAAA,GAAW,OAAOC,SAAkBC,aAAAA;AACpE,QAAI;AACF,YAAMC,OAAOF,QAAQG;AACrB,YAAMC,QAAQ,MAAMb,QAAQc,MAAMC,qBAAqBJ,IAAAA;AACvDD,eAASM,aAAa;AACtB,aAAON,SAASO,KAAKJ,KAAAA;IACvB,SAASK,OAAO;AACdf,cAAQe,MAAMA,KAAAA;AACd,iBAAOC,8CAAkBT,UAAU,KAAKQ,MAAME,SAASF,KAAAA;IACzD;EACF,CAAA;AACF;AAjBgBpB;AAmBT,SAASuB,4BAA4BtB,QAAgBC,SAA2BC,MAA0B;AAC/G,MAAIA,MAAMC,YAAY,OAAO;AAC3BC,YAAQC,IAAI,oDAAoD;AAChE;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AUC,6BAAaX,KAAAA;AAC7B,UAAMY,WAAWX,MAAMY,kBAAkB;MAAC;MAAsB;MAAmB;;AACnFC,YAAQC,IAAI,yCAAyCC,KAAKC,UAAUL,QAAAA,CAAAA,EAAW;AAG/E,QAAIA,SAASM,SAAS,oBAAA,GAAuB;AAC3CC,gCAA0B,KAAKC,QAAQV,SAAS,KAAKb,OAAOK,cAAcmB,iBAAAA;AAC1EC,kCAA4B,KAAKF,QAAQV,SAAS,KAAKb,OAAOK,cAAcmB,iBAAAA;AAC5EE,uBAAiB,KAAKH,QAAQV,SAAS,KAAKb,OAAOK,cAAcmB,iBAAAA;IACnE;AAGA,QAAIT,SAASM,SAAS,iBAAA,GAAoB;AACxCM,gCAA0B,KAAKJ,QAAQV,SAAS,KAAKb,OAAOK,cAAcuB,cAAAA;IAC5E;AAGA,QAAIb,SAASM,SAAS,uBAAA,GAA0B;AAC9CQ,mCAA6B,KAAKN,QAAQV,SAAS,KAAKb,OAAOK,cAAcyB,oBAAAA;IAC/E;AAEA,SAAKhC,SAASiC,IAAI3B,MAAMC,cAAc2B,YAAY,IAAI,KAAKT,MAAM;EACnE;EAEA,IAAIZ,UAAmB;AACrB,WAAO,KAAKb;EACd;EAEA,IAAIyB,SAAiB;AACnB,WAAO,KAAKtB;EACd;EAEA,IAAIE,QAAkC;AACpC,WAAO,KAAKJ;EACd;EAEA,IAAIK,OAAoD;AACtD,WAAO,KAAKJ;EACd;AACF;","names":["operation","publishCredentialEndpoint","router","context","opts","enabled","console","log","path","post","checkAuth","endpoint","request","response","args","body","entry","agent","lvpPublishCredential","statusCode","json","error","sendErrorResponse","message","unpublishCredentialEndpoint","delete","linkedVpId","params","result","lvpUnpublishCredential","success","hasEntryEndpoint","get","lvpHasEntry","exists","getServiceEntriesEndpoint","tenantId","query","entries","lvpGetServiceEntries","generatePresentationEndpoint","presentation","lvpGeneratePresentation","import_ssi_express_support","LinkedVpApiServer","_express","_agent","_opts","_router","args","agent","opts","endpointOpts","globalAuth","secureLinkedVPManagerEndpoints","copyGlobalAuthToEndpoints","keys","expressSupport","express","Router","context","agentContext","features","enableFeatures","console","log","JSON","stringify","includes","publishCredentialEndpoint","router","publishManagement","unpublishCredentialEndpoint","hasEntryEndpoint","getServiceEntriesEndpoint","serviceEntries","generatePresentationEndpoint","generatePresentation","use","basePath"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/linked-vp-api-server.ts","../src/api-functions.ts"],"sourcesContent":["export * from './types'\nexport * from './linked-vp-api-server'\nexport * from './api-functions'\n\nexport type {\n PublishCredentialArgs,\n UnpublishCredentialArgs,\n HasLinkedVPEntryArgs,\n GetServiceEntriesArgs,\n GeneratePresentationArgs,\n LinkedVPEntry,\n LinkedVPServiceEntry,\n LinkedVPPresentation,\n} from '@sphereon/ssi-sdk.linked-vp'\n","import { agentContext } from '@sphereon/ssi-sdk.core'\nimport { TAgent } from '@veramo/core'\n\nimport express, { Express, Router } from 'express'\nimport { ILinkedVPManagerAPIEndpointOpts, IRequiredPlugins } from './types'\nimport {\n publishCredentialEndpoint,\n unpublishCredentialEndpoint,\n hasEntryEndpoint,\n getServiceEntriesEndpoint,\n generatePresentationEndpoint,\n} from './api-functions'\nimport { copyGlobalAuthToEndpoints, ExpressSupport } from '@sphereon/ssi-express-support'\n\nexport type LinkedVPManagerApiServerArgs = {\n agent: TAgent<IRequiredPlugins>\n expressSupport: ExpressSupport\n opts?: ILinkedVPManagerAPIEndpointOpts\n}\n\nexport class LinkedVpApiServer {\n private readonly _express: Express\n private readonly _agent: TAgent<IRequiredPlugins>\n private readonly _opts?: ILinkedVPManagerAPIEndpointOpts\n private readonly _router: Router\n\n constructor(args: LinkedVPManagerApiServerArgs) {\n const { agent, opts } = args\n this._agent = agent\n\n if (opts?.endpointOpts?.globalAuth?.secureLinkedVPManagerEndpoints) {\n copyGlobalAuthToEndpoints({\n opts,\n keys: ['publishManagement', 'serviceEntries', 'generatePresentation'],\n })\n }\n\n this._opts = opts\n this._express = args.expressSupport.express\n this._router = express.Router()\n const context = agentContext(agent)\n const features = opts?.enableFeatures ?? ['publish-management', 'service-entries', 'generate-presentation']\n console.log(`Linked VP API enabled, with features: ${JSON.stringify(features)}`)\n\n // Publish Management Endpoints\n if (features.includes('publish-management')) {\n publishCredentialEndpoint(this.router, context, this._opts?.endpointOpts?.publishManagement)\n unpublishCredentialEndpoint(this.router, context, this._opts?.endpointOpts?.publishManagement)\n hasEntryEndpoint(this.router, context, this._opts?.endpointOpts?.publishManagement)\n }\n\n // Service Entries Endpoint\n if (features.includes('service-entries')) {\n getServiceEntriesEndpoint(this.router, context, this._opts?.endpointOpts?.serviceEntries)\n }\n\n // Generate Presentation Endpoint\n if (features.includes('generate-presentation')) {\n generatePresentationEndpoint(this.router, context, this._opts?.endpointOpts?.generatePresentation)\n }\n\n this._express.use(opts?.endpointOpts?.basePath ?? '', this.router)\n }\n\n get express(): Express {\n return this._express\n }\n\n get router(): Router {\n return this._router\n }\n\n get agent(): TAgent<IRequiredPlugins> {\n return this._agent\n }\n\n get opts(): ILinkedVPManagerAPIEndpointOpts | undefined {\n return this._opts\n }\n}\n","import { checkAuth, ISingleEndpointOpts, sendErrorResponse } from '@sphereon/ssi-express-support'\nimport {\n GeneratePresentationArgs,\n GetServiceEntriesArgs,\n HasLinkedVPEntryArgs,\n PublishCredentialArgs,\n UnpublishCredentialArgs,\n} from '@sphereon/ssi-sdk.linked-vp'\nimport { Request, Response, Router } from 'express'\nimport { IRequiredContext } from './types'\n\nconst operation = '/linked-vp'\n\n// Publish Management Endpoints\nexport function publishCredentialEndpoint(router: Router, context: IRequiredContext, opts?: ISingleEndpointOpts) {\n if (opts?.enabled === false) {\n console.log(`\"publishCredentialEndpoint\" Endpoint is disabled`)\n return\n }\n const path = opts?.path ?? operation\n router.post(path, checkAuth(opts?.endpoint), async (request: Request, response: Response) => {\n try {\n const args = request.body as PublishCredentialArgs\n const entry = await context.agent.lvpPublishCredential(args)\n response.statusCode = 201\n return response.json(entry)\n } catch (error) {\n console.error(error)\n return sendErrorResponse(response, 500, error.message, error)\n }\n })\n}\n\nexport function unpublishCredentialEndpoint(router: Router, context: IRequiredContext, opts?: ISingleEndpointOpts) {\n if (opts?.enabled === false) {\n console.log(`\"unpublishCredentialEndpoint\" Endpoint is disabled`)\n return\n }\n const path = opts?.path ?? operation\n router.delete(`${path}/:linkedVpId`, checkAuth(opts?.endpoint), async (request: Request, response: Response) => {\n try {\n const linkedVpId = request.params.linkedVpId\n const result = await context.agent.lvpUnpublishCredential({ linkedVpId } as UnpublishCredentialArgs)\n response.statusCode = 200\n return response.json({ success: result })\n } catch (error) {\n return sendErrorResponse(response, 500, error.message, error)\n }\n })\n}\n\nexport function hasEntryEndpoint(router: Router, context: IRequiredContext, opts?: ISingleEndpointOpts) {\n if (opts?.enabled === false) {\n console.log(`\"hasEntryEndpoint\" Endpoint is disabled`)\n return\n }\n const path = opts?.path ?? operation\n router.get(`${path}/:linkedVpId/exists`, checkAuth(opts?.endpoint), async (request: Request, response: Response) => {\n try {\n const linkedVpId = request.params.linkedVpId\n const result = await context.agent.lvpHasEntry({ linkedVpId } as HasLinkedVPEntryArgs)\n response.statusCode = 200\n return response.json({ exists: result })\n } catch (error) {\n return sendErrorResponse(response, 500, error.message as string, error)\n }\n })\n}\n\n// Service Entries Endpoint\nexport function getServiceEntriesEndpoint(router: Router, context: IRequiredContext, opts?: ISingleEndpointOpts) {\n if (opts?.enabled === false) {\n console.log(`\"getServiceEntriesEndpoint\" Endpoint is disabled`)\n return\n }\n const path = opts?.path ?? `${operation}/service-entries`\n router.get(path, checkAuth(opts?.endpoint), async (request: Request, response: Response) => {\n try {\n const tenantId = request.query.tenantId as string | undefined\n const entries = await context.agent.lvpGetServiceEntries({ tenantId } as GetServiceEntriesArgs)\n response.statusCode = 200\n return response.json(entries)\n } catch (error) {\n return sendErrorResponse(response, 500, error.message as string, error)\n }\n })\n}\n\n// Generate Presentation Endpoint\nexport function generatePresentationEndpoint(router: Router, context: IRequiredContext, opts?: ISingleEndpointOpts) {\n if (opts?.enabled === false) {\n console.log(`\"generatePresentationEndpoint\" Endpoint is disabled`)\n return\n }\n const path = opts?.path ?? operation\n router.get(`${path}/:linkedVpId`, checkAuth(opts?.endpoint), async (request: Request, response: Response) => {\n try {\n const linkedVpId = request.params.linkedVpId\n const presentation = await context.agent.lvpGeneratePresentation({ linkedVpId } as GeneratePresentationArgs)\n response.statusCode = 200\n return response.json(presentation)\n } catch (error) {\n return sendErrorResponse(response, 500, error.message as string, error)\n }\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;ACAA,qBAA6B;AAG7B,qBAAyC;;;ACHzC,iCAAkE;AAWlE,IAAMA,YAAY;AAGX,SAASC,0BAA0BC,QAAgBC,SAA2BC,MAA0B;AAC7G,MAAIA,MAAMC,YAAY,OAAO;AAC3BC,YAAQC,IAAI,kDAAkD;AAC9D;EACF;AACA,QAAMC,OAAOJ,MAAMI,QAAQR;AAC3BE,SAAOO,KAAKD,UAAME,sCAAUN,MAAMO,QAAAA,GAAW,OAAOC,SAAkBC,aAAAA;AACpE,QAAI;AACF,YAAMC,OAAOF,QAAQG;AACrB,YAAMC,QAAQ,MAAMb,QAAQc,MAAMC,qBAAqBJ,IAAAA;AACvDD,eAASM,aAAa;AACtB,aAAON,SAASO,KAAKJ,KAAAA;IACvB,SAASK,OAAO;AACdf,cAAQe,MAAMA,KAAAA;AACd,iBAAOC,8CAAkBT,UAAU,KAAKQ,MAAME,SAASF,KAAAA;IACzD;EACF,CAAA;AACF;AAjBgBpB;AAmBT,SAASuB,4BAA4BtB,QAAgBC,SAA2BC,MAA0B;AAC/G,MAAIA,MAAMC,YAAY,OAAO;AAC3BC,YAAQC,IAAI,oDAAoD;AAChE;EACF;AACA,QAAMC,OAAOJ,MAAMI,QAAQR;AAC3BE,SAAOuB,OAAO,GAAGjB,IAAAA,oBAAoBE,sCAAUN,MAAMO,QAAAA,GAAW,OAAOC,SAAkBC,aAAAA;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AAW;AAG/E,QAAIA,SAASM,SAAS,oBAAA,GAAuB;AAC3CC,gCAA0B,KAAKC,QAAQV,SAAS,KAAKb,OAAOK,cAAcmB,iBAAAA;AAC1EC,kCAA4B,KAAKF,QAAQV,SAAS,KAAKb,OAAOK,cAAcmB,iBAAAA;AAC5EE,uBAAiB,KAAKH,QAAQV,SAAS,KAAKb,OAAOK,cAAcmB,iBAAAA;IACnE;AAGA,QAAIT,SAASM,SAAS,iBAAA,GAAoB;AACxCM,gCAA0B,KAAKJ,QAAQV,SAAS,KAAKb,OAAOK,cAAcuB,cAAAA;IAC5E;AAGA,QAAIb,SAASM,SAAS,uBAAA,GAA0B;AAC9CQ,mCAA6B,KAAKN,QAAQV,SAAS,KAAKb,OAAOK,cAAcyB,oBAAAA;IAC/E;AAEA,SAAKhC,SAASiC,IAAI3B,MAAMC,cAAc2B,YAAY,IAAI,KAAKT,MAAM;EACnE;EAEA,IAAIZ,UAAmB;AACrB,WAAO,KAAKb;EACd;EAEA,IAAIyB,SAAiB;AACnB,WAAO,KAAKtB;EACd;EAEA,IAAIE,QAAkC;AACpC,WAAO,KAAKJ;EACd;EAEA,IAAIK,OAAoD;AACtD,WAAO,KAAKJ;EACd;AACF;","names":["operation","publishCredentialEndpoint","router","context","opts","enabled","console","log","path","post","checkAuth","endpoint","request","response","args","body","entry","agent","lvpPublishCredential","statusCode","json","error","sendErrorResponse","message","unpublishCredentialEndpoint","delete","linkedVpId","params","result","lvpUnpublishCredential","success","hasEntryEndpoint","get","lvpHasEntry","exists","getServiceEntriesEndpoint","tenantId","query","entries","lvpGetServiceEntries","generatePresentationEndpoint","presentation","lvpGeneratePresentation","import_ssi_express_support","LinkedVpApiServer","_express","_agent","_opts","_router","args","agent","opts","endpointOpts","globalAuth","secureLinkedVPManagerEndpoints","copyGlobalAuthToEndpoints","keys","expressSupport","express","Router","context","agentContext","features","enableFeatures","console","log","JSON","stringify","includes","publishCredentialEndpoint","router","publishManagement","unpublishCredentialEndpoint","hasEntryEndpoint","getServiceEntriesEndpoint","serviceEntries","generatePresentationEndpoint","generatePresentation","use","basePath"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -43,4 +43,4 @@ declare function hasEntryEndpoint(router: Router, context: IRequiredContext, opt
|
|
|
43
43
|
declare function getServiceEntriesEndpoint(router: Router, context: IRequiredContext, opts?: ISingleEndpointOpts): void;
|
|
44
44
|
declare function generatePresentationEndpoint(router: Router, context: IRequiredContext, opts?: ISingleEndpointOpts): void;
|
|
45
45
|
|
|
46
|
-
export { type ILinkedVPManagerAPIEndpointOpts, type IRequiredContext, type IRequiredPlugins, type LinkedVPManagerRestApiFeatures, LinkedVpApiServer, generatePresentationEndpoint, getServiceEntriesEndpoint, hasEntryEndpoint, publishCredentialEndpoint, unpublishCredentialEndpoint };
|
|
46
|
+
export { type ILinkedVPManagerAPIEndpointOpts, type IRequiredContext, type IRequiredPlugins, type LinkedVPManagerApiServerArgs, type LinkedVPManagerRestApiFeatures, LinkedVpApiServer, generatePresentationEndpoint, getServiceEntriesEndpoint, hasEntryEndpoint, publishCredentialEndpoint, unpublishCredentialEndpoint };
|
package/dist/index.d.ts
CHANGED
|
@@ -43,4 +43,4 @@ declare function hasEntryEndpoint(router: Router, context: IRequiredContext, opt
|
|
|
43
43
|
declare function getServiceEntriesEndpoint(router: Router, context: IRequiredContext, opts?: ISingleEndpointOpts): void;
|
|
44
44
|
declare function generatePresentationEndpoint(router: Router, context: IRequiredContext, opts?: ISingleEndpointOpts): void;
|
|
45
45
|
|
|
46
|
-
export { type ILinkedVPManagerAPIEndpointOpts, type IRequiredContext, type IRequiredPlugins, type LinkedVPManagerRestApiFeatures, LinkedVpApiServer, generatePresentationEndpoint, getServiceEntriesEndpoint, hasEntryEndpoint, publishCredentialEndpoint, unpublishCredentialEndpoint };
|
|
46
|
+
export { type ILinkedVPManagerAPIEndpointOpts, type IRequiredContext, type IRequiredPlugins, type LinkedVPManagerApiServerArgs, type LinkedVPManagerRestApiFeatures, LinkedVpApiServer, generatePresentationEndpoint, getServiceEntriesEndpoint, hasEntryEndpoint, publishCredentialEndpoint, unpublishCredentialEndpoint };
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/linked-vp-api-server.ts","../src/api-functions.ts"],"sourcesContent":["import { agentContext } from '@sphereon/ssi-sdk.core'\nimport { TAgent } from '@veramo/core'\n\nimport express, { Express, Router } from 'express'\nimport { ILinkedVPManagerAPIEndpointOpts, IRequiredPlugins } from './types'\nimport {\n publishCredentialEndpoint,\n unpublishCredentialEndpoint,\n hasEntryEndpoint,\n getServiceEntriesEndpoint,\n generatePresentationEndpoint,\n} from './api-functions'\nimport { copyGlobalAuthToEndpoints, ExpressSupport } from '@sphereon/ssi-express-support'\n\ntype LinkedVPManagerApiServerArgs = {\n agent: TAgent<IRequiredPlugins>\n expressSupport: ExpressSupport\n opts?: ILinkedVPManagerAPIEndpointOpts\n}\n\nexport class LinkedVpApiServer {\n private readonly _express: Express\n private readonly _agent: TAgent<IRequiredPlugins>\n private readonly _opts?: ILinkedVPManagerAPIEndpointOpts\n private readonly _router: Router\n\n constructor(args: LinkedVPManagerApiServerArgs) {\n const { agent, opts } = args\n this._agent = agent\n\n if (opts?.endpointOpts?.globalAuth?.secureLinkedVPManagerEndpoints) {\n copyGlobalAuthToEndpoints({\n opts,\n keys: ['publishManagement', 'serviceEntries', 'generatePresentation'],\n })\n }\n\n this._opts = opts\n this._express = args.expressSupport.express\n this._router = express.Router()\n const context = agentContext(agent)\n const features = opts?.enableFeatures ?? ['publish-management', 'service-entries', 'generate-presentation']\n console.log(`Linked VP API enabled, with features: ${JSON.stringify(features)}`)\n\n // Publish Management Endpoints\n if (features.includes('publish-management')) {\n publishCredentialEndpoint(this.router, context, this._opts?.endpointOpts?.publishManagement)\n unpublishCredentialEndpoint(this.router, context, this._opts?.endpointOpts?.publishManagement)\n hasEntryEndpoint(this.router, context, this._opts?.endpointOpts?.publishManagement)\n }\n\n // Service Entries Endpoint\n if (features.includes('service-entries')) {\n getServiceEntriesEndpoint(this.router, context, this._opts?.endpointOpts?.serviceEntries)\n }\n\n // Generate Presentation Endpoint\n if (features.includes('generate-presentation')) {\n generatePresentationEndpoint(this.router, context, this._opts?.endpointOpts?.generatePresentation)\n }\n\n this._express.use(opts?.endpointOpts?.basePath ?? '', this.router)\n }\n\n get express(): Express {\n return this._express\n }\n\n get router(): Router {\n return this._router\n }\n\n get agent(): TAgent<IRequiredPlugins> {\n return this._agent\n }\n\n get opts(): ILinkedVPManagerAPIEndpointOpts | undefined {\n return this._opts\n }\n}\n","import { checkAuth, ISingleEndpointOpts, sendErrorResponse } from '@sphereon/ssi-express-support'\nimport {\n GeneratePresentationArgs,\n GetServiceEntriesArgs,\n HasLinkedVPEntryArgs,\n PublishCredentialArgs,\n UnpublishCredentialArgs,\n} from '@sphereon/ssi-sdk.linked-vp'\nimport { Request, Response, Router } from 'express'\nimport { IRequiredContext } from './types'\n\nconst operation = '/linked-vp'\n\n// Publish Management Endpoints\nexport function publishCredentialEndpoint(router: Router, context: IRequiredContext, opts?: ISingleEndpointOpts) {\n if (opts?.enabled === false) {\n console.log(`\"publishCredentialEndpoint\" Endpoint is disabled`)\n return\n }\n const path = opts?.path ?? operation\n router.post(path, checkAuth(opts?.endpoint), async (request: Request, response: Response) => {\n try {\n const args = request.body as PublishCredentialArgs\n const entry = await context.agent.lvpPublishCredential(args)\n response.statusCode = 201\n return response.json(entry)\n } catch (error) {\n console.error(error)\n return sendErrorResponse(response, 500, error.message, error)\n }\n })\n}\n\nexport function unpublishCredentialEndpoint(router: Router, context: IRequiredContext, opts?: ISingleEndpointOpts) {\n if (opts?.enabled === false) {\n console.log(`\"unpublishCredentialEndpoint\" Endpoint is disabled`)\n return\n }\n const path = opts?.path ?? operation\n router.delete(`${path}/:linkedVpId`, checkAuth(opts?.endpoint), async (request: Request, response: Response) => {\n try {\n const linkedVpId = request.params.linkedVpId\n const result = await context.agent.lvpUnpublishCredential({ linkedVpId } as UnpublishCredentialArgs)\n response.statusCode = 200\n return response.json({ success: result })\n } catch (error) {\n return sendErrorResponse(response, 500, error.message, error)\n }\n })\n}\n\nexport function hasEntryEndpoint(router: Router, context: IRequiredContext, opts?: ISingleEndpointOpts) {\n if (opts?.enabled === false) {\n console.log(`\"hasEntryEndpoint\" Endpoint is disabled`)\n return\n }\n const path = opts?.path ?? operation\n router.get(`${path}/:linkedVpId/exists`, checkAuth(opts?.endpoint), async (request: Request, response: Response) => {\n try {\n const linkedVpId = request.params.linkedVpId\n const result = await context.agent.lvpHasEntry({ linkedVpId } as HasLinkedVPEntryArgs)\n response.statusCode = 200\n return response.json({ exists: result })\n } catch (error) {\n return sendErrorResponse(response, 500, error.message as string, error)\n }\n })\n}\n\n// Service Entries Endpoint\nexport function getServiceEntriesEndpoint(router: Router, context: IRequiredContext, opts?: ISingleEndpointOpts) {\n if (opts?.enabled === false) {\n console.log(`\"getServiceEntriesEndpoint\" Endpoint is disabled`)\n return\n }\n const path = opts?.path ?? `${operation}/service-entries`\n router.get(path, checkAuth(opts?.endpoint), async (request: Request, response: Response) => {\n try {\n const tenantId = request.query.tenantId as string | undefined\n const entries = await context.agent.lvpGetServiceEntries({ tenantId } as GetServiceEntriesArgs)\n response.statusCode = 200\n return response.json(entries)\n } catch (error) {\n return sendErrorResponse(response, 500, error.message as string, error)\n }\n })\n}\n\n// Generate Presentation Endpoint\nexport function generatePresentationEndpoint(router: Router, context: IRequiredContext, opts?: ISingleEndpointOpts) {\n if (opts?.enabled === false) {\n console.log(`\"generatePresentationEndpoint\" Endpoint is disabled`)\n return\n }\n const path = opts?.path ?? operation\n router.get(`${path}/:linkedVpId`, checkAuth(opts?.endpoint), async (request: Request, response: Response) => {\n try {\n const linkedVpId = request.params.linkedVpId\n const presentation = await context.agent.lvpGeneratePresentation({ linkedVpId } as GeneratePresentationArgs)\n response.statusCode = 200\n return response.json(presentation)\n } catch (error) {\n return sendErrorResponse(response, 500, error.message as string, error)\n }\n })\n}\n"],"m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5E;AAGA,QAAIb,SAASM,SAAS,uBAAA,GAA0B;AAC9CQ,mCAA6B,KAAKN,QAAQV,SAAS,KAAKb,OAAOK,cAAcyB,oBAAAA;IAC/E;AAEA,SAAKhC,SAASiC,IAAI3B,MAAMC,cAAc2B,YAAY,IAAI,KAAKT,MAAM;EACnE;EAEA,IAAIZ,UAAmB;AACrB,WAAO,KAAKb;EACd;EAEA,IAAIyB,SAAiB;AACnB,WAAO,KAAKtB;EACd;EAEA,IAAIE,QAAkC;AACpC,WAAO,KAAKJ;EACd;EAEA,IAAIK,OAAoD;AACtD,WAAO,KAAKJ;EACd;AACF;","names":["agentContext","express","checkAuth","sendErrorResponse","operation","publishCredentialEndpoint","router","context","opts","enabled","console","log","path","post","checkAuth","endpoint","request","response","args","body","entry","agent","lvpPublishCredential","statusCode","json","error","sendErrorResponse","message","unpublishCredentialEndpoint","delete","linkedVpId","params","result","lvpUnpublishCredential","success","hasEntryEndpoint","get","lvpHasEntry","exists","getServiceEntriesEndpoint","tenantId","query","entries","lvpGetServiceEntries","generatePresentationEndpoint","presentation","lvpGeneratePresentation","copyGlobalAuthToEndpoints","LinkedVpApiServer","_express","_agent","_opts","_router","args","agent","opts","endpointOpts","globalAuth","secureLinkedVPManagerEndpoints","copyGlobalAuthToEndpoints","keys","expressSupport","express","Router","context","agentContext","features","enableFeatures","console","log","JSON","stringify","includes","publishCredentialEndpoint","router","publishManagement","unpublishCredentialEndpoint","hasEntryEndpoint","getServiceEntriesEndpoint","serviceEntries","generatePresentationEndpoint","generatePresentation","use","basePath"]}
|
|
1
|
+
{"version":3,"sources":["../src/linked-vp-api-server.ts","../src/api-functions.ts"],"sourcesContent":["import { agentContext } from '@sphereon/ssi-sdk.core'\nimport { TAgent } from '@veramo/core'\n\nimport express, { Express, Router } from 'express'\nimport { ILinkedVPManagerAPIEndpointOpts, IRequiredPlugins } from './types'\nimport {\n publishCredentialEndpoint,\n unpublishCredentialEndpoint,\n hasEntryEndpoint,\n getServiceEntriesEndpoint,\n generatePresentationEndpoint,\n} from './api-functions'\nimport { copyGlobalAuthToEndpoints, ExpressSupport } from '@sphereon/ssi-express-support'\n\nexport type LinkedVPManagerApiServerArgs = {\n agent: TAgent<IRequiredPlugins>\n expressSupport: ExpressSupport\n opts?: ILinkedVPManagerAPIEndpointOpts\n}\n\nexport class LinkedVpApiServer {\n private readonly _express: Express\n private readonly _agent: TAgent<IRequiredPlugins>\n private readonly _opts?: ILinkedVPManagerAPIEndpointOpts\n private readonly _router: Router\n\n constructor(args: LinkedVPManagerApiServerArgs) {\n const { agent, opts } = args\n this._agent = agent\n\n if (opts?.endpointOpts?.globalAuth?.secureLinkedVPManagerEndpoints) {\n copyGlobalAuthToEndpoints({\n opts,\n keys: ['publishManagement', 'serviceEntries', 'generatePresentation'],\n })\n }\n\n this._opts = opts\n this._express = args.expressSupport.express\n this._router = express.Router()\n const context = agentContext(agent)\n const features = opts?.enableFeatures ?? ['publish-management', 'service-entries', 'generate-presentation']\n console.log(`Linked VP API enabled, with features: ${JSON.stringify(features)}`)\n\n // Publish Management Endpoints\n if (features.includes('publish-management')) {\n publishCredentialEndpoint(this.router, context, this._opts?.endpointOpts?.publishManagement)\n unpublishCredentialEndpoint(this.router, context, this._opts?.endpointOpts?.publishManagement)\n hasEntryEndpoint(this.router, context, this._opts?.endpointOpts?.publishManagement)\n }\n\n // Service Entries Endpoint\n if (features.includes('service-entries')) {\n getServiceEntriesEndpoint(this.router, context, this._opts?.endpointOpts?.serviceEntries)\n }\n\n // Generate Presentation Endpoint\n if (features.includes('generate-presentation')) {\n generatePresentationEndpoint(this.router, context, this._opts?.endpointOpts?.generatePresentation)\n }\n\n this._express.use(opts?.endpointOpts?.basePath ?? '', this.router)\n }\n\n get express(): Express {\n return this._express\n }\n\n get router(): Router {\n return this._router\n }\n\n get agent(): TAgent<IRequiredPlugins> {\n return this._agent\n }\n\n get opts(): ILinkedVPManagerAPIEndpointOpts | undefined {\n return this._opts\n }\n}\n","import { checkAuth, ISingleEndpointOpts, sendErrorResponse } from '@sphereon/ssi-express-support'\nimport {\n GeneratePresentationArgs,\n GetServiceEntriesArgs,\n HasLinkedVPEntryArgs,\n PublishCredentialArgs,\n UnpublishCredentialArgs,\n} from '@sphereon/ssi-sdk.linked-vp'\nimport { Request, Response, Router } from 'express'\nimport { IRequiredContext } from './types'\n\nconst operation = '/linked-vp'\n\n// Publish Management Endpoints\nexport function publishCredentialEndpoint(router: Router, context: IRequiredContext, opts?: ISingleEndpointOpts) {\n if (opts?.enabled === false) {\n console.log(`\"publishCredentialEndpoint\" Endpoint is disabled`)\n return\n }\n const path = opts?.path ?? operation\n router.post(path, checkAuth(opts?.endpoint), async (request: Request, response: Response) => {\n try {\n const args = request.body as PublishCredentialArgs\n const entry = await context.agent.lvpPublishCredential(args)\n response.statusCode = 201\n return response.json(entry)\n } catch (error) {\n console.error(error)\n return sendErrorResponse(response, 500, error.message, error)\n }\n })\n}\n\nexport function unpublishCredentialEndpoint(router: Router, context: IRequiredContext, opts?: ISingleEndpointOpts) {\n if (opts?.enabled === false) {\n console.log(`\"unpublishCredentialEndpoint\" Endpoint is disabled`)\n return\n }\n const path = opts?.path ?? operation\n router.delete(`${path}/:linkedVpId`, checkAuth(opts?.endpoint), async (request: Request, response: Response) => {\n try {\n const linkedVpId = request.params.linkedVpId\n const result = await context.agent.lvpUnpublishCredential({ linkedVpId } as UnpublishCredentialArgs)\n response.statusCode = 200\n return response.json({ success: result })\n } catch (error) {\n return sendErrorResponse(response, 500, error.message, error)\n }\n })\n}\n\nexport function hasEntryEndpoint(router: Router, context: IRequiredContext, opts?: ISingleEndpointOpts) {\n if (opts?.enabled === false) {\n console.log(`\"hasEntryEndpoint\" Endpoint is disabled`)\n return\n }\n const path = opts?.path ?? operation\n router.get(`${path}/:linkedVpId/exists`, checkAuth(opts?.endpoint), async (request: Request, response: Response) => {\n try {\n const linkedVpId = request.params.linkedVpId\n const result = await context.agent.lvpHasEntry({ linkedVpId } as HasLinkedVPEntryArgs)\n response.statusCode = 200\n return response.json({ exists: result })\n } catch (error) {\n return sendErrorResponse(response, 500, error.message as string, error)\n }\n })\n}\n\n// Service Entries Endpoint\nexport function getServiceEntriesEndpoint(router: Router, context: IRequiredContext, opts?: ISingleEndpointOpts) {\n if (opts?.enabled === false) {\n console.log(`\"getServiceEntriesEndpoint\" Endpoint is disabled`)\n return\n }\n const path = opts?.path ?? `${operation}/service-entries`\n router.get(path, checkAuth(opts?.endpoint), async (request: Request, response: Response) => {\n try {\n const tenantId = request.query.tenantId as string | undefined\n const entries = await context.agent.lvpGetServiceEntries({ tenantId } as GetServiceEntriesArgs)\n response.statusCode = 200\n return response.json(entries)\n } catch (error) {\n return sendErrorResponse(response, 500, error.message as string, error)\n }\n })\n}\n\n// Generate Presentation Endpoint\nexport function generatePresentationEndpoint(router: Router, context: IRequiredContext, opts?: ISingleEndpointOpts) {\n if (opts?.enabled === false) {\n console.log(`\"generatePresentationEndpoint\" Endpoint is disabled`)\n return\n }\n const path = opts?.path ?? operation\n router.get(`${path}/:linkedVpId`, checkAuth(opts?.endpoint), async (request: Request, response: Response) => {\n try {\n const linkedVpId = request.params.linkedVpId\n const presentation = await context.agent.lvpGeneratePresentation({ linkedVpId } as GeneratePresentationArgs)\n response.statusCode = 200\n return response.json(presentation)\n } catch (error) {\n return sendErrorResponse(response, 500, error.message as string, error)\n }\n })\n}\n"],"mappings":";;;;AAAA,SAASA,oBAAoB;AAG7B,OAAOC,aAAkC;;;ACHzC,SAASC,WAAgCC,yBAAyB;AAWlE,IAAMC,YAAY;AAGX,SAASC,0BAA0BC,QAAgBC,SAA2BC,MAA0B;AAC7G,MAAIA,MAAMC,YAAY,OAAO;AAC3BC,YAAQC,IAAI,kDAAkD;AAC9D;EACF;AACA,QAAMC,OAAOJ,MAAMI,QAAQR;AAC3BE,SAAOO,KAAKD,MAAME,UAAUN,MAAMO,QAAAA,GAAW,OAAOC,SAAkBC,aAAAA;AACpE,QAAI;AACF,YAAMC,OAAOF,QAAQG;AACrB,Y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;","names":["agentContext","express","checkAuth","sendErrorResponse","operation","publishCredentialEndpoint","router","context","opts","enabled","console","log","path","post","checkAuth","endpoint","request","response","args","body","entry","agent","lvpPublishCredential","statusCode","json","error","sendErrorResponse","message","unpublishCredentialEndpoint","delete","linkedVpId","params","result","lvpUnpublishCredential","success","hasEntryEndpoint","get","lvpHasEntry","exists","getServiceEntriesEndpoint","tenantId","query","entries","lvpGetServiceEntries","generatePresentationEndpoint","presentation","lvpGeneratePresentation","copyGlobalAuthToEndpoints","LinkedVpApiServer","_express","_agent","_opts","_router","args","agent","opts","endpointOpts","globalAuth","secureLinkedVPManagerEndpoints","copyGlobalAuthToEndpoints","keys","expressSupport","express","Router","context","agentContext","features","enableFeatures","console","log","JSON","stringify","includes","publishCredentialEndpoint","router","publishManagement","unpublishCredentialEndpoint","hasEntryEndpoint","getServiceEntriesEndpoint","serviceEntries","generatePresentationEndpoint","generatePresentation","use","basePath"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ssi-sdk.linked-vp-rest-api",
|
|
3
|
-
"version": "0.34.1-feature.SSISDK.82.linkedVP.
|
|
3
|
+
"version": "0.34.1-feature.SSISDK.82.linkedVP.326+2b4ebda9",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"build": "tsup --config ../../tsup.config.ts --tsconfig ../../tsconfig.tsup.json"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@sphereon/ssi-express-support": "0.34.1-feature.SSISDK.82.linkedVP.
|
|
25
|
-
"@sphereon/ssi-sdk.core": "0.34.1-feature.SSISDK.82.linkedVP.
|
|
26
|
-
"@sphereon/ssi-sdk.data-store": "0.34.1-feature.SSISDK.82.linkedVP.
|
|
27
|
-
"@sphereon/ssi-sdk.data-store-types": "0.34.1-feature.SSISDK.82.linkedVP.
|
|
28
|
-
"@sphereon/ssi-sdk.linked-vp": "0.34.1-feature.SSISDK.82.linkedVP.
|
|
29
|
-
"@sphereon/ssi-types": "0.34.1-feature.SSISDK.82.linkedVP.
|
|
24
|
+
"@sphereon/ssi-express-support": "0.34.1-feature.SSISDK.82.linkedVP.326+2b4ebda9",
|
|
25
|
+
"@sphereon/ssi-sdk.core": "0.34.1-feature.SSISDK.82.linkedVP.326+2b4ebda9",
|
|
26
|
+
"@sphereon/ssi-sdk.data-store": "0.34.1-feature.SSISDK.82.linkedVP.326+2b4ebda9",
|
|
27
|
+
"@sphereon/ssi-sdk.data-store-types": "0.34.1-feature.SSISDK.82.linkedVP.326+2b4ebda9",
|
|
28
|
+
"@sphereon/ssi-sdk.linked-vp": "0.34.1-feature.SSISDK.82.linkedVP.326+2b4ebda9",
|
|
29
|
+
"@sphereon/ssi-types": "0.34.1-feature.SSISDK.82.linkedVP.326+2b4ebda9",
|
|
30
30
|
"@veramo/core": "4.2.0",
|
|
31
31
|
"body-parser": "^1.20.2",
|
|
32
32
|
"casbin": "^5.30.0",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@decentralized-identity/ion-sdk": "^0.6.0",
|
|
43
|
-
"@sphereon/ssi-sdk.agent-config": "0.34.1-feature.SSISDK.82.linkedVP.
|
|
43
|
+
"@sphereon/ssi-sdk.agent-config": "0.34.1-feature.SSISDK.82.linkedVP.326+2b4ebda9",
|
|
44
44
|
"@types/body-parser": "^1.19.5",
|
|
45
45
|
"@types/cookie-parser": "^1.4.7",
|
|
46
46
|
"@types/cors": "^2.8.17",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"pd-management",
|
|
89
89
|
"presentation-definition-management"
|
|
90
90
|
],
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "2b4ebda97cd73ad5b73555cb8bb9d087f0d98395"
|
|
92
92
|
}
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from './api-functions'
|
|
13
13
|
import { copyGlobalAuthToEndpoints, ExpressSupport } from '@sphereon/ssi-express-support'
|
|
14
14
|
|
|
15
|
-
type LinkedVPManagerApiServerArgs = {
|
|
15
|
+
export type LinkedVPManagerApiServerArgs = {
|
|
16
16
|
agent: TAgent<IRequiredPlugins>
|
|
17
17
|
expressSupport: ExpressSupport
|
|
18
18
|
opts?: ILinkedVPManagerAPIEndpointOpts
|