signify-ts 0.2.0 → 0.2.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.
@@ -58,6 +58,11 @@ export interface IssueCredentialResult {
58
58
  iss: Serder;
59
59
  op: Operation;
60
60
  }
61
+ export interface RevokeCredentialResult {
62
+ anc: Serder;
63
+ rev: Serder;
64
+ op: Operation;
65
+ }
61
66
  export interface IpexGrantArgs {
62
67
  /**
63
68
  * Alias for the IPEX sender AID
@@ -117,9 +122,10 @@ export declare class Credentials {
117
122
  * @async
118
123
  * @param {string} name Name or alias of the identifier
119
124
  * @param {string} said SAID of the credential
125
+ * @param {string} datetime date time of revocation
120
126
  * @returns {Promise<any>} A promise to the long-running operation
121
127
  */
122
- revoke(name: string, said: string): Promise<any>;
128
+ revoke(name: string, said: string, datetime?: string): Promise<RevokeCredentialResult>;
123
129
  /**
124
130
  * Present a credential
125
131
  * @async
@@ -6598,13 +6598,14 @@ var Credentials = class {
6598
6598
  * @async
6599
6599
  * @param {string} name Name or alias of the identifier
6600
6600
  * @param {string} said SAID of the credential
6601
+ * @param {string} datetime date time of revocation
6601
6602
  * @returns {Promise<any>} A promise to the long-running operation
6602
6603
  */
6603
- async revoke(name, said) {
6604
+ async revoke(name, said, datetime) {
6604
6605
  const hab = await this.client.identifiers().get(name);
6605
6606
  const pre = hab.prefix;
6606
6607
  const vs = versify("KERI" /* KERI */, void 0, "JSON" /* JSON */, 0);
6607
- const dt = (/* @__PURE__ */ new Date()).toISOString().replace("Z", "000+00:00");
6608
+ const dt = datetime ?? (/* @__PURE__ */ new Date()).toISOString().replace("Z", "000+00:00");
6608
6609
  const cred = await this.get(said);
6609
6610
  const _rev = {
6610
6611
  v: vs,
@@ -6634,6 +6635,7 @@ var Credentials = class {
6634
6635
  d: rev.d
6635
6636
  }
6636
6637
  ];
6638
+ const keeper = this.client.manager.get(hab);
6637
6639
  if (estOnly) {
6638
6640
  throw new Error("Establishment only not implemented");
6639
6641
  } else {
@@ -6645,14 +6647,14 @@ var Credentials = class {
6645
6647
  version: void 0,
6646
6648
  kind: void 0
6647
6649
  });
6648
- const keeper = this.client.manager.get(hab);
6649
6650
  sigs = await keeper.sign(b(serder.raw));
6650
6651
  ixn = serder.ked;
6651
6652
  }
6652
6653
  const body = {
6653
6654
  rev,
6654
6655
  ixn,
6655
- sigs
6656
+ sigs,
6657
+ [keeper.algo]: keeper.params()
6656
6658
  };
6657
6659
  const path = `/identifiers/${name}/credentials/${said}`;
6658
6660
  const method = "DELETE";
@@ -6660,7 +6662,12 @@ var Credentials = class {
6660
6662
  Accept: "application/json+cesr"
6661
6663
  });
6662
6664
  const res = await this.client.fetch(path, method, body, headers);
6663
- return await res.json();
6665
+ const op = await res.json();
6666
+ return {
6667
+ rev: new Serder(rev),
6668
+ anc: new Serder(ixn),
6669
+ op
6670
+ };
6664
6671
  }
6665
6672
  /**
6666
6673
  * Present a credential