@agentfield/sdk 0.1.71 → 0.1.72-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -496,6 +496,9 @@ declare class DidClient {
|
|
|
496
496
|
registerAgent(request: DIDRegistrationRequest): Promise<DIDRegistrationResponse>;
|
|
497
497
|
private parseIdentityPackage;
|
|
498
498
|
generateCredential(params: GenerateCredentialParams): Promise<ExecutionCredential>;
|
|
499
|
+
verifyCredential(vcDocument: any): Promise<any>;
|
|
500
|
+
getWorkflowVcChain(workflowId: string): Promise<any>;
|
|
501
|
+
createWorkflowVc(workflowId: string, sessionId: string, executionVcIds: string[]): Promise<WorkflowCredential | null>;
|
|
499
502
|
exportAuditTrail(filters?: AuditTrailFilters): Promise<AuditTrailExport>;
|
|
500
503
|
private serializeDataForJson;
|
|
501
504
|
private mapExecutionCredential;
|
package/dist/index.js
CHANGED
|
@@ -2869,6 +2869,49 @@ var DidClient = class {
|
|
|
2869
2869
|
});
|
|
2870
2870
|
return this.mapExecutionCredential(res.data);
|
|
2871
2871
|
}
|
|
2872
|
+
async verifyCredential(vcDocument) {
|
|
2873
|
+
const res = await this.http.post(
|
|
2874
|
+
"/api/v1/did/verify",
|
|
2875
|
+
{ vc_document: vcDocument },
|
|
2876
|
+
{ headers: this.mergeHeaders() }
|
|
2877
|
+
);
|
|
2878
|
+
return res.data ?? null;
|
|
2879
|
+
}
|
|
2880
|
+
async getWorkflowVcChain(workflowId) {
|
|
2881
|
+
const res = await this.http.get(
|
|
2882
|
+
`/api/v1/did/workflow/${workflowId}/vc-chain`,
|
|
2883
|
+
{
|
|
2884
|
+
headers: this.mergeHeaders()
|
|
2885
|
+
}
|
|
2886
|
+
);
|
|
2887
|
+
return res.data ?? null;
|
|
2888
|
+
}
|
|
2889
|
+
async createWorkflowVc(workflowId, sessionId, executionVcIds) {
|
|
2890
|
+
const payload = {
|
|
2891
|
+
session_id: sessionId,
|
|
2892
|
+
execution_vc_ids: executionVcIds
|
|
2893
|
+
};
|
|
2894
|
+
const res = await this.http.post(
|
|
2895
|
+
`/api/v1/did/workflow/${workflowId}/vc`,
|
|
2896
|
+
payload,
|
|
2897
|
+
{
|
|
2898
|
+
headers: this.mergeHeaders()
|
|
2899
|
+
}
|
|
2900
|
+
);
|
|
2901
|
+
const vc = res.data ?? null;
|
|
2902
|
+
if (!vc) return null;
|
|
2903
|
+
return {
|
|
2904
|
+
workflowId: vc.workflow_id,
|
|
2905
|
+
sessionId: vc.session_id,
|
|
2906
|
+
componentVcs: vc.component_vcs ?? [],
|
|
2907
|
+
workflowVcId: vc.workflow_vc_id,
|
|
2908
|
+
status: vc.status,
|
|
2909
|
+
startTime: vc.start_time,
|
|
2910
|
+
endTime: vc.end_time,
|
|
2911
|
+
totalSteps: vc.total_steps ?? 0,
|
|
2912
|
+
completedSteps: vc.completed_steps ?? 0
|
|
2913
|
+
};
|
|
2914
|
+
}
|
|
2872
2915
|
async exportAuditTrail(filters = {}) {
|
|
2873
2916
|
const res = await this.http.get("/api/v1/did/export/vcs", {
|
|
2874
2917
|
params: this.cleanFilters(filters),
|