@tinycloud/sdk-core 3.1.0-beta.2 → 3.1.0-beta.4
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/delegations/index.cjs.map +1 -1
- package/dist/delegations/index.js.map +1 -1
- package/dist/index.cjs +9 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -6
- package/dist/index.js.map +1 -1
- package/dist/policy/index.cjs +9 -6
- package/dist/policy/index.cjs.map +1 -1
- package/dist/policy/index.js +9 -6
- package/dist/policy/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -3590,6 +3590,9 @@ async function renewPolicyRootStatusV3(input) {
|
|
|
3590
3590
|
if (!response.ok) throw new Error(`policy root renewal rejected (${response.status})`);
|
|
3591
3591
|
return object2(await response.json(), "policy root renewal");
|
|
3592
3592
|
}
|
|
3593
|
+
function rfc3339Seconds(value) {
|
|
3594
|
+
return new Date(Math.floor(value.getTime() / 1e3) * 1e3).toISOString().replace(/\.000Z$/, "Z");
|
|
3595
|
+
}
|
|
3593
3596
|
async function revokePolicyRootV3(input) {
|
|
3594
3597
|
if (input.reason.length === 0) throw new Error("policy root revocation reason is required");
|
|
3595
3598
|
const unsigned = {
|
|
@@ -3598,7 +3601,7 @@ async function revokePolicyRootV3(input) {
|
|
|
3598
3601
|
targetRole: input.targetRole,
|
|
3599
3602
|
ownerDid: input.ownerDid,
|
|
3600
3603
|
nodeAudience: input.nodeAudience,
|
|
3601
|
-
revokedAt: (input.now ?? /* @__PURE__ */ new Date())
|
|
3604
|
+
revokedAt: rfc3339Seconds(input.now ?? /* @__PURE__ */ new Date()),
|
|
3602
3605
|
reason: input.reason,
|
|
3603
3606
|
issuerDid: input.issuerDid
|
|
3604
3607
|
};
|
|
@@ -4349,7 +4352,7 @@ function date(value, label) {
|
|
|
4349
4352
|
if (!Number.isFinite(Date.parse(text2))) throw new Error(`${label} is invalid`);
|
|
4350
4353
|
return text2;
|
|
4351
4354
|
}
|
|
4352
|
-
function
|
|
4355
|
+
function rfc3339Seconds2(value) {
|
|
4353
4356
|
return new Date(Math.floor(value.getTime() / 1e3) * 1e3).toISOString().replace(/\.000Z$/, "Z");
|
|
4354
4357
|
}
|
|
4355
4358
|
function validateUnifiedPolicyV2(value, expectedPolicyCid) {
|
|
@@ -4514,8 +4517,8 @@ async function buildPolicyCredentialPresentationV4(input) {
|
|
|
4514
4517
|
requirementDigest,
|
|
4515
4518
|
descriptorDigest: input.credential.descriptorDigest,
|
|
4516
4519
|
requestedCapabilities: Object.freeze(requestedCapabilities),
|
|
4517
|
-
issuedAt:
|
|
4518
|
-
expiresAt:
|
|
4520
|
+
issuedAt: rfc3339Seconds2(now),
|
|
4521
|
+
expiresAt: rfc3339Seconds2(new Date(expiresAtMs))
|
|
4519
4522
|
}), input.sign);
|
|
4520
4523
|
}
|
|
4521
4524
|
async function buildPolicyCredentialPresentationV3(input) {
|
|
@@ -4569,8 +4572,8 @@ async function buildPolicyCredentialPresentationV3(input) {
|
|
|
4569
4572
|
requirementDigest,
|
|
4570
4573
|
descriptorDigest: input.credential.descriptorDigest,
|
|
4571
4574
|
requestedCapabilities: Object.freeze(requestedCapabilities),
|
|
4572
|
-
issuedAt:
|
|
4573
|
-
expiresAt:
|
|
4575
|
+
issuedAt: rfc3339Seconds2(now),
|
|
4576
|
+
expiresAt: rfc3339Seconds2(new Date(expiresAtMs))
|
|
4574
4577
|
});
|
|
4575
4578
|
const digest4 = sha2565(
|
|
4576
4579
|
new TextEncoder().encode(
|