@tinycloud/sdk-core 2.11.0-beta.1 → 2.11.0-beta.11
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/bootstrap/index.cjs +0 -4
- package/dist/delegations/index.cjs +702 -330
- package/dist/delegations/index.cjs.map +1 -1
- package/dist/delegations/index.d.cts +9 -8
- package/dist/delegations/index.d.ts +9 -8
- package/dist/delegations/index.js +722 -263
- package/dist/delegations/index.js.map +1 -1
- package/dist/index.cjs +2338 -1156
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +350 -24
- package/dist/index.d.ts +350 -24
- package/dist/index.js +2333 -810
- package/dist/index.js.map +1 -1
- package/dist/policy/index.cjs +878 -250
- package/dist/policy/index.cjs.map +1 -1
- package/dist/policy/index.d.cts +3 -2
- package/dist/policy/index.d.ts +3 -2
- package/dist/policy/index.js +877 -183
- package/dist/policy/index.js.map +1 -1
- package/dist/{recipient-types.schema-CWIt63Qp.d.cts → recipient-types.schema-CuDpskPd.d.cts} +236 -98
- package/dist/{recipient-types.schema-CWIt63Qp.d.ts → recipient-types.schema-CuDpskPd.d.ts} +236 -98
- package/dist/requester/index.cjs +10 -38
- package/dist/requester/index.cjs.map +1 -1
- package/dist/requester/index.js +10 -8
- package/dist/requester/index.js.map +1 -1
- package/dist/unified-BYPfXp5S.d.ts +429 -0
- package/dist/unified-BdfNHNrx.d.cts +429 -0
- package/package.json +6 -3
- package/dist/signed-object-C6mWbTbB.d.ts +0 -149
- package/dist/signed-object-IMAm5a32.d.cts +0 -149
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { a as JsonValue } from './capability-BjzXwtNw.cjs';
|
|
2
|
-
|
|
3
|
-
type SignedObjectErrorCode = "schema-invalid" | "canonicalization-mismatch" | "digest-mismatch" | "id-mismatch" | "signing-key-binding" | "signature-material-invalid" | "signature-suite-unsupported" | "signature-invalid";
|
|
4
|
-
declare class SignedObjectProfileError extends Error {
|
|
5
|
-
readonly code: SignedObjectErrorCode;
|
|
6
|
-
constructor(code: SignedObjectErrorCode, message: string);
|
|
7
|
-
}
|
|
8
|
-
declare class SignedObjectSchemaError extends SignedObjectProfileError {
|
|
9
|
-
constructor(message: string);
|
|
10
|
-
}
|
|
11
|
-
declare class SignedObjectCanonicalizationError extends SignedObjectProfileError {
|
|
12
|
-
constructor(message: string);
|
|
13
|
-
}
|
|
14
|
-
declare class SignedObjectDigestError extends SignedObjectProfileError {
|
|
15
|
-
constructor(message: string);
|
|
16
|
-
}
|
|
17
|
-
declare class SignedObjectIdError extends SignedObjectProfileError {
|
|
18
|
-
constructor(message: string);
|
|
19
|
-
}
|
|
20
|
-
declare class SigningKeyBindingError extends SignedObjectProfileError {
|
|
21
|
-
constructor(message: string);
|
|
22
|
-
}
|
|
23
|
-
declare class SignatureMaterialError extends SignedObjectProfileError {
|
|
24
|
-
constructor(message: string);
|
|
25
|
-
}
|
|
26
|
-
declare class UnsupportedSignatureSuiteError extends SignedObjectProfileError {
|
|
27
|
-
constructor(message: string);
|
|
28
|
-
}
|
|
29
|
-
declare class SignatureVerificationError extends SignedObjectProfileError {
|
|
30
|
-
constructor(message: string);
|
|
31
|
-
}
|
|
32
|
-
declare function toSignedObjectError(error: unknown): SignedObjectProfileError;
|
|
33
|
-
|
|
34
|
-
declare const POLICY_SCHEMA = "xyz.tinycloud.policy/policy/v0";
|
|
35
|
-
declare const POLICY_STATUS_SCHEMA = "xyz.tinycloud.policy/status/v0";
|
|
36
|
-
declare const POLICY_ENGINE_RECORD_SCHEMA = "xyz.tinycloud.policy/engine-record/v0";
|
|
37
|
-
declare const ED25519_JCS_SIGNATURE_SUITE = "eddsa-ed25519-sha256-jcs-v1";
|
|
38
|
-
declare const EIP191_JCS_SIGNATURE_SUITE = "eip191-secp256k1-sha256-jcs-v1";
|
|
39
|
-
type SignedObjectKind = "Policy" | "PolicyStatus" | "PolicyEngineRecord";
|
|
40
|
-
type SignatureSuite = typeof ED25519_JCS_SIGNATURE_SUITE | typeof EIP191_JCS_SIGNATURE_SUITE;
|
|
41
|
-
interface SignedObjectSignature {
|
|
42
|
-
suite: SignatureSuite;
|
|
43
|
-
signerDid: string;
|
|
44
|
-
value: string;
|
|
45
|
-
}
|
|
46
|
-
type JsonObject = {
|
|
47
|
-
readonly [key: string]: JsonValue;
|
|
48
|
-
};
|
|
49
|
-
interface Policy {
|
|
50
|
-
readonly schema: typeof POLICY_SCHEMA;
|
|
51
|
-
readonly policyId: string;
|
|
52
|
-
readonly ownerDid: string;
|
|
53
|
-
readonly signingKeyDid: string;
|
|
54
|
-
readonly createdAt: string;
|
|
55
|
-
readonly expiresAt?: string;
|
|
56
|
-
readonly resource: JsonObject;
|
|
57
|
-
readonly when: JsonObject;
|
|
58
|
-
readonly grant: JsonObject;
|
|
59
|
-
readonly disclosure?: JsonObject;
|
|
60
|
-
readonly audit?: JsonObject;
|
|
61
|
-
readonly signature: SignedObjectSignature;
|
|
62
|
-
}
|
|
63
|
-
type UnsignedPolicy = Omit<Policy, "policyId" | "signature">;
|
|
64
|
-
interface PolicyStatus {
|
|
65
|
-
readonly schema: typeof POLICY_STATUS_SCHEMA;
|
|
66
|
-
readonly statusId: string;
|
|
67
|
-
readonly policyId: string;
|
|
68
|
-
readonly ownerDid: string;
|
|
69
|
-
readonly sequence: number;
|
|
70
|
-
readonly disposition: "active" | "suspended" | "revoked";
|
|
71
|
-
readonly effectiveAt: string;
|
|
72
|
-
readonly reasonCode?: string;
|
|
73
|
-
readonly signingKeyDid: string;
|
|
74
|
-
readonly signature: SignedObjectSignature;
|
|
75
|
-
}
|
|
76
|
-
type UnsignedPolicyStatus = Omit<PolicyStatus, "statusId" | "signature">;
|
|
77
|
-
interface PolicyEngineRecord {
|
|
78
|
-
readonly schema: typeof POLICY_ENGINE_RECORD_SCHEMA;
|
|
79
|
-
readonly engineRecordId: string;
|
|
80
|
-
readonly ownerDid: string;
|
|
81
|
-
readonly endpoint: string;
|
|
82
|
-
readonly audience: string;
|
|
83
|
-
readonly supportedPolicyVersions: string[];
|
|
84
|
-
readonly supportedEvidenceVerifiers: string[];
|
|
85
|
-
readonly grantIssuerDid: string;
|
|
86
|
-
readonly expiresAt: string;
|
|
87
|
-
readonly signature: SignedObjectSignature;
|
|
88
|
-
}
|
|
89
|
-
type UnsignedPolicyEngineRecord = Omit<PolicyEngineRecord, "engineRecordId" | "signature">;
|
|
90
|
-
type SignedPolicyObject = Policy | PolicyStatus | PolicyEngineRecord;
|
|
91
|
-
type UnsignedPolicyObject = UnsignedPolicy | UnsignedPolicyStatus | UnsignedPolicyEngineRecord;
|
|
92
|
-
interface SignedObjectSigner {
|
|
93
|
-
readonly suite: SignatureSuite;
|
|
94
|
-
readonly signerDid: string;
|
|
95
|
-
signDigest(digest: Uint8Array): Promise<Uint8Array | string> | Uint8Array | string;
|
|
96
|
-
}
|
|
97
|
-
interface SignedObjectMaterial {
|
|
98
|
-
readonly kind: SignedObjectKind;
|
|
99
|
-
readonly idField: string;
|
|
100
|
-
readonly id: string;
|
|
101
|
-
readonly domain: string;
|
|
102
|
-
readonly unsigned: JsonObject;
|
|
103
|
-
readonly jcs: string;
|
|
104
|
-
readonly jcsBytes: Uint8Array;
|
|
105
|
-
readonly digest: Uint8Array;
|
|
106
|
-
readonly digestHex: string;
|
|
107
|
-
}
|
|
108
|
-
type SignedObjectVerificationResult<T extends SignedPolicyObject> = {
|
|
109
|
-
readonly ok: true;
|
|
110
|
-
readonly object: T;
|
|
111
|
-
readonly material: SignedObjectMaterial;
|
|
112
|
-
} | {
|
|
113
|
-
readonly ok: false;
|
|
114
|
-
readonly error: SignedObjectProfileError;
|
|
115
|
-
};
|
|
116
|
-
declare function canonicalizeSignedObjectUnsigned(input: unknown): string;
|
|
117
|
-
declare function deriveSignedObjectMaterial(input: unknown): SignedObjectMaterial;
|
|
118
|
-
declare function signedObjectIdFor(input: unknown): string;
|
|
119
|
-
declare function createAndSignSignedObject(input: unknown, signer: SignedObjectSigner): Promise<SignedPolicyObject>;
|
|
120
|
-
declare function createAndSignPolicy(input: unknown, signer: SignedObjectSigner): Promise<Policy>;
|
|
121
|
-
declare function createAndSignPolicyStatus(input: unknown, signer: SignedObjectSigner): Promise<PolicyStatus>;
|
|
122
|
-
declare function createAndSignPolicyEngineRecord(input: unknown, signer: SignedObjectSigner): Promise<PolicyEngineRecord>;
|
|
123
|
-
declare function verifySignedObject(input: unknown): Promise<{
|
|
124
|
-
object: SignedPolicyObject;
|
|
125
|
-
material: SignedObjectMaterial;
|
|
126
|
-
}>;
|
|
127
|
-
declare function verifyPolicy(input: unknown): Promise<{
|
|
128
|
-
object: Policy;
|
|
129
|
-
material: SignedObjectMaterial;
|
|
130
|
-
}>;
|
|
131
|
-
declare function verifyPolicyStatus(input: unknown): Promise<{
|
|
132
|
-
object: PolicyStatus;
|
|
133
|
-
material: SignedObjectMaterial;
|
|
134
|
-
}>;
|
|
135
|
-
declare function verifyPolicyEngineRecord(input: unknown): Promise<{
|
|
136
|
-
object: PolicyEngineRecord;
|
|
137
|
-
material: SignedObjectMaterial;
|
|
138
|
-
}>;
|
|
139
|
-
declare function validatePolicySigned(input: unknown): Promise<SignedObjectVerificationResult<Policy>>;
|
|
140
|
-
declare function validatePolicyStatusSigned(input: unknown): Promise<SignedObjectVerificationResult<PolicyStatus>>;
|
|
141
|
-
declare function validatePolicyEngineRecordSigned(input: unknown): Promise<SignedObjectVerificationResult<PolicyEngineRecord>>;
|
|
142
|
-
declare function validatePolicyUnsigned(input: unknown): UnsignedPolicy;
|
|
143
|
-
declare function validatePolicyStatusUnsigned(input: unknown): UnsignedPolicyStatus;
|
|
144
|
-
declare function validatePolicyEngineRecordUnsigned(input: unknown): UnsignedPolicyEngineRecord;
|
|
145
|
-
declare function validatePolicySignedShape(input: unknown): Policy;
|
|
146
|
-
declare function validatePolicyStatusSignedShape(input: unknown): PolicyStatus;
|
|
147
|
-
declare function validatePolicyEngineRecordSignedShape(input: unknown): PolicyEngineRecord;
|
|
148
|
-
|
|
149
|
-
export { createAndSignPolicy as A, createAndSignPolicyEngineRecord as B, createAndSignPolicyStatus as C, createAndSignSignedObject as D, ED25519_JCS_SIGNATURE_SUITE as E, deriveSignedObjectMaterial as F, signedObjectIdFor as G, toSignedObjectError as H, validatePolicyEngineRecordSigned as I, type JsonObject as J, validatePolicyEngineRecordSignedShape as K, validatePolicyEngineRecordUnsigned as L, validatePolicySigned as M, validatePolicySignedShape as N, validatePolicyStatusSigned as O, type PolicyEngineRecord as P, validatePolicyStatusSignedShape as Q, validatePolicyStatusUnsigned as R, type SignedObjectSigner as S, validatePolicyUnsigned as T, type UnsignedPolicyEngineRecord as U, verifyPolicy as V, verifyPolicyEngineRecord as W, verifyPolicyStatus as X, verifySignedObject as Y, type Policy as a, EIP191_JCS_SIGNATURE_SUITE as b, POLICY_ENGINE_RECORD_SCHEMA as c, POLICY_SCHEMA as d, POLICY_STATUS_SCHEMA as e, type PolicyStatus as f, SignatureMaterialError as g, type SignatureSuite as h, SignatureVerificationError as i, SignedObjectCanonicalizationError as j, SignedObjectDigestError as k, type SignedObjectErrorCode as l, SignedObjectIdError as m, type SignedObjectKind as n, type SignedObjectMaterial as o, SignedObjectProfileError as p, SignedObjectSchemaError as q, type SignedObjectSignature as r, type SignedObjectVerificationResult as s, type SignedPolicyObject as t, SigningKeyBindingError as u, type UnsignedPolicy as v, type UnsignedPolicyObject as w, type UnsignedPolicyStatus as x, UnsupportedSignatureSuiteError as y, canonicalizeSignedObjectUnsigned as z };
|