@tinycloud/sdk-core 3.1.0-beta.2 → 3.1.0-beta.3

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.
@@ -3366,6 +3366,9 @@ async function renewPolicyRootStatusV3(input) {
3366
3366
  if (!response.ok) throw new Error(`policy root renewal rejected (${response.status})`);
3367
3367
  return object(await response.json(), "policy root renewal");
3368
3368
  }
3369
+ function rfc3339Seconds(value) {
3370
+ return new Date(Math.floor(value.getTime() / 1e3) * 1e3).toISOString().replace(/\.000Z$/, "Z");
3371
+ }
3369
3372
  async function revokePolicyRootV3(input) {
3370
3373
  if (input.reason.length === 0) throw new Error("policy root revocation reason is required");
3371
3374
  const unsigned = {
@@ -3374,7 +3377,7 @@ async function revokePolicyRootV3(input) {
3374
3377
  targetRole: input.targetRole,
3375
3378
  ownerDid: input.ownerDid,
3376
3379
  nodeAudience: input.nodeAudience,
3377
- revokedAt: (input.now ?? /* @__PURE__ */ new Date()).toISOString(),
3380
+ revokedAt: rfc3339Seconds(input.now ?? /* @__PURE__ */ new Date()),
3378
3381
  reason: input.reason,
3379
3382
  issuerDid: input.issuerDid
3380
3383
  };
@@ -4196,7 +4199,7 @@ function date(value, label) {
4196
4199
  if (!Number.isFinite(Date.parse(text))) throw new Error(`${label} is invalid`);
4197
4200
  return text;
4198
4201
  }
4199
- function rfc3339Seconds(value) {
4202
+ function rfc3339Seconds2(value) {
4200
4203
  return new Date(Math.floor(value.getTime() / 1e3) * 1e3).toISOString().replace(/\.000Z$/, "Z");
4201
4204
  }
4202
4205
  function validateUnifiedPolicyV2(value, expectedPolicyCid) {
@@ -4361,8 +4364,8 @@ async function buildPolicyCredentialPresentationV4(input) {
4361
4364
  requirementDigest,
4362
4365
  descriptorDigest: input.credential.descriptorDigest,
4363
4366
  requestedCapabilities: Object.freeze(requestedCapabilities),
4364
- issuedAt: rfc3339Seconds(now),
4365
- expiresAt: rfc3339Seconds(new Date(expiresAtMs))
4367
+ issuedAt: rfc3339Seconds2(now),
4368
+ expiresAt: rfc3339Seconds2(new Date(expiresAtMs))
4366
4369
  }), input.sign);
4367
4370
  }
4368
4371
  async function buildPolicyCredentialPresentationV3(input) {
@@ -4416,8 +4419,8 @@ async function buildPolicyCredentialPresentationV3(input) {
4416
4419
  requirementDigest,
4417
4420
  descriptorDigest: input.credential.descriptorDigest,
4418
4421
  requestedCapabilities: Object.freeze(requestedCapabilities),
4419
- issuedAt: rfc3339Seconds(now),
4420
- expiresAt: rfc3339Seconds(new Date(expiresAtMs))
4422
+ issuedAt: rfc3339Seconds2(now),
4423
+ expiresAt: rfc3339Seconds2(new Date(expiresAtMs))
4421
4424
  });
4422
4425
  const digest2 = sha2565(
4423
4426
  new TextEncoder().encode(