@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.
- 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 +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4059,6 +4059,9 @@ async function renewPolicyRootStatusV3(input) {
|
|
|
4059
4059
|
if (!response.ok) throw new Error(`policy root renewal rejected (${response.status})`);
|
|
4060
4060
|
return object2(await response.json(), "policy root renewal");
|
|
4061
4061
|
}
|
|
4062
|
+
function rfc3339Seconds(value) {
|
|
4063
|
+
return new Date(Math.floor(value.getTime() / 1e3) * 1e3).toISOString().replace(/\.000Z$/, "Z");
|
|
4064
|
+
}
|
|
4062
4065
|
async function revokePolicyRootV3(input) {
|
|
4063
4066
|
if (input.reason.length === 0) throw new Error("policy root revocation reason is required");
|
|
4064
4067
|
const unsigned = {
|
|
@@ -4067,7 +4070,7 @@ async function revokePolicyRootV3(input) {
|
|
|
4067
4070
|
targetRole: input.targetRole,
|
|
4068
4071
|
ownerDid: input.ownerDid,
|
|
4069
4072
|
nodeAudience: input.nodeAudience,
|
|
4070
|
-
revokedAt: (input.now ?? /* @__PURE__ */ new Date())
|
|
4073
|
+
revokedAt: rfc3339Seconds(input.now ?? /* @__PURE__ */ new Date()),
|
|
4071
4074
|
reason: input.reason,
|
|
4072
4075
|
issuerDid: input.issuerDid
|
|
4073
4076
|
};
|
|
@@ -4818,7 +4821,7 @@ function date(value, label) {
|
|
|
4818
4821
|
if (!Number.isFinite(Date.parse(text2))) throw new Error(`${label} is invalid`);
|
|
4819
4822
|
return text2;
|
|
4820
4823
|
}
|
|
4821
|
-
function
|
|
4824
|
+
function rfc3339Seconds2(value) {
|
|
4822
4825
|
return new Date(Math.floor(value.getTime() / 1e3) * 1e3).toISOString().replace(/\.000Z$/, "Z");
|
|
4823
4826
|
}
|
|
4824
4827
|
function validateUnifiedPolicyV2(value, expectedPolicyCid) {
|
|
@@ -4983,8 +4986,8 @@ async function buildPolicyCredentialPresentationV4(input) {
|
|
|
4983
4986
|
requirementDigest,
|
|
4984
4987
|
descriptorDigest: input.credential.descriptorDigest,
|
|
4985
4988
|
requestedCapabilities: Object.freeze(requestedCapabilities),
|
|
4986
|
-
issuedAt:
|
|
4987
|
-
expiresAt:
|
|
4989
|
+
issuedAt: rfc3339Seconds2(now),
|
|
4990
|
+
expiresAt: rfc3339Seconds2(new Date(expiresAtMs))
|
|
4988
4991
|
}), input.sign);
|
|
4989
4992
|
}
|
|
4990
4993
|
async function buildPolicyCredentialPresentationV3(input) {
|
|
@@ -5038,8 +5041,8 @@ async function buildPolicyCredentialPresentationV3(input) {
|
|
|
5038
5041
|
requirementDigest,
|
|
5039
5042
|
descriptorDigest: input.credential.descriptorDigest,
|
|
5040
5043
|
requestedCapabilities: Object.freeze(requestedCapabilities),
|
|
5041
|
-
issuedAt:
|
|
5042
|
-
expiresAt:
|
|
5044
|
+
issuedAt: rfc3339Seconds2(now),
|
|
5045
|
+
expiresAt: rfc3339Seconds2(new Date(expiresAtMs))
|
|
5043
5046
|
});
|
|
5044
5047
|
const digest4 = (0, import_sha2562.sha256)(
|
|
5045
5048
|
new TextEncoder().encode(
|