@aithos/sdk 0.1.0-alpha.3 → 0.1.0-alpha.31
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/README.md +159 -0
- package/dist/src/auth-api.d.ts +149 -0
- package/dist/src/auth-api.js +226 -0
- package/dist/src/auth.d.ts +436 -67
- package/dist/src/auth.js +1098 -69
- package/dist/src/compute.d.ts +221 -9
- package/dist/src/compute.js +293 -16
- package/dist/src/data-schema-contacts-v1.d.ts +14 -0
- package/dist/src/data-schema-contacts-v1.js +28 -0
- package/dist/src/data.d.ts +97 -0
- package/dist/src/data.js +634 -0
- package/dist/src/endpoints.d.ts +9 -0
- package/dist/src/endpoints.js +5 -0
- package/dist/src/ethos.d.ts +202 -1
- package/dist/src/ethos.js +821 -16
- package/dist/src/index.d.ts +15 -6
- package/dist/src/index.js +36 -9
- package/dist/src/internal/delegate-bundle.d.ts +18 -0
- package/dist/src/internal/delegate-bundle.js +94 -0
- package/dist/src/internal/delegate-state.d.ts +45 -0
- package/dist/src/internal/delegate-state.js +120 -0
- package/dist/src/internal/owner-signers.d.ts +78 -0
- package/dist/src/internal/owner-signers.js +179 -0
- package/dist/src/internal/protocol-client-bridge.d.ts +8 -0
- package/dist/src/internal/protocol-client-bridge.js +20 -0
- package/dist/src/internal/recovery-file.d.ts +29 -0
- package/dist/src/internal/recovery-file.js +98 -0
- package/dist/src/internal/signer.d.ts +59 -0
- package/dist/src/internal/signer.js +86 -0
- package/dist/src/key-store.d.ts +128 -0
- package/dist/src/key-store.js +244 -0
- package/dist/src/mandates.d.ts +163 -1
- package/dist/src/mandates.js +286 -8
- package/dist/src/sdk.d.ts +39 -3
- package/dist/src/sdk.js +36 -23
- package/dist/src/session-store.d.ts +58 -0
- package/dist/src/session-store.js +158 -0
- package/dist/src/wallet.d.ts +4 -6
- package/dist/src/wallet.js +18 -8
- package/dist/src/web.d.ts +279 -0
- package/dist/src/web.js +186 -0
- package/dist/test/auth-j3.test.d.ts +2 -0
- package/dist/test/auth-j3.test.js +391 -0
- package/dist/test/compute-delegate-path.test.d.ts +2 -0
- package/dist/test/compute-delegate-path.test.js +183 -0
- package/dist/test/compute.test.js +26 -11
- package/dist/test/endpoints.test.js +20 -1
- package/dist/test/ethos-first-edition.test.d.ts +2 -0
- package/dist/test/ethos-first-edition.test.js +248 -0
- package/dist/test/ethos.test.d.ts +2 -0
- package/dist/test/ethos.test.js +219 -0
- package/dist/test/key-store.test.d.ts +2 -0
- package/dist/test/key-store.test.js +161 -0
- package/dist/test/mandates-compute.test.d.ts +2 -0
- package/dist/test/mandates-compute.test.js +256 -0
- package/dist/test/mandates.test.d.ts +2 -0
- package/dist/test/mandates.test.js +93 -0
- package/dist/test/sdk.test.js +70 -30
- package/dist/test/signer.test.d.ts +2 -0
- package/dist/test/signer.test.js +117 -0
- package/dist/test/signup-bootstrap.test.d.ts +2 -0
- package/dist/test/signup-bootstrap.test.js +222 -0
- package/dist/test/wallet.test.js +20 -9
- package/dist/test/web.test.d.ts +2 -0
- package/dist/test/web.test.js +270 -0
- package/package.json +5 -4
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export interface AithosSchemaLite {
|
|
2
|
+
readonly schema: string;
|
|
3
|
+
readonly indexable: ReadonlySet<string>;
|
|
4
|
+
readonly encrypted: ReadonlySet<string>;
|
|
5
|
+
readonly auto: ReadonlySet<string>;
|
|
6
|
+
readonly defaults: Readonly<Record<string, unknown>>;
|
|
7
|
+
}
|
|
8
|
+
export interface CreateDataClientArgs {
|
|
9
|
+
/** Base URL of the deployed PDS (e.g. https://abc.execute-api.eu-west-3.amazonaws.com). */
|
|
10
|
+
readonly pdsUrl: string;
|
|
11
|
+
/** Subject DID — typically did:key:… in dev, did:aithos:… in prod. */
|
|
12
|
+
readonly did: string;
|
|
13
|
+
/**
|
|
14
|
+
* Ed25519 sphere seed (32 bytes). For did:key this is the same as
|
|
15
|
+
* the key embedded in the DID itself. For did:aithos this is the
|
|
16
|
+
* subject's `#data` (or `#public`) sphere key.
|
|
17
|
+
*/
|
|
18
|
+
readonly sphereSeed: Uint8Array;
|
|
19
|
+
/**
|
|
20
|
+
* The verification method URL within the DID document used to sign
|
|
21
|
+
* envelopes. For did:key this is `<did>#<multibase>`. For did:aithos
|
|
22
|
+
* this is `<did>#data` (or `#public`).
|
|
23
|
+
*/
|
|
24
|
+
readonly verificationMethod: string;
|
|
25
|
+
/** Optional fetch implementation. Defaults to globalThis.fetch. */
|
|
26
|
+
readonly fetch?: typeof fetch;
|
|
27
|
+
}
|
|
28
|
+
export interface DataClient {
|
|
29
|
+
/** Get / create a collection handle. */
|
|
30
|
+
collection(name: string): DataCollection;
|
|
31
|
+
/** Initialize a new collection with an explicit schema. */
|
|
32
|
+
createCollection(args: {
|
|
33
|
+
name: string;
|
|
34
|
+
schema: string;
|
|
35
|
+
forwardSecrecy?: "best_effort" | "strict";
|
|
36
|
+
}): Promise<void>;
|
|
37
|
+
/** List collections owned by this subject. */
|
|
38
|
+
listCollections(): Promise<readonly {
|
|
39
|
+
name: string;
|
|
40
|
+
schema: string;
|
|
41
|
+
record_count: number;
|
|
42
|
+
}[]>;
|
|
43
|
+
/** List gamma audit entries. */
|
|
44
|
+
listGammaEntries(opts?: {
|
|
45
|
+
limit?: number;
|
|
46
|
+
opPrefix?: string;
|
|
47
|
+
verify?: boolean;
|
|
48
|
+
}): Promise<unknown>;
|
|
49
|
+
/** Drop in-memory cache (CMK, collection metadata, …). */
|
|
50
|
+
reset(): void;
|
|
51
|
+
}
|
|
52
|
+
export interface DataCollection {
|
|
53
|
+
readonly name: string;
|
|
54
|
+
/**
|
|
55
|
+
* Insert a record. The object MAY contain both indexable and
|
|
56
|
+
* encrypted fields per the schema; the SDK splits them.
|
|
57
|
+
*/
|
|
58
|
+
insert(record: Record<string, unknown>): Promise<string>;
|
|
59
|
+
/** Fetch one record by id (decrypted client-side). */
|
|
60
|
+
get(recordId: string): Promise<Record<string, unknown> | null>;
|
|
61
|
+
/** List records, decrypted. Pagination via opaque cursor. */
|
|
62
|
+
list(opts?: ListOpts): Promise<{
|
|
63
|
+
items: Record<string, unknown>[];
|
|
64
|
+
nextCursor?: string;
|
|
65
|
+
}>;
|
|
66
|
+
/**
|
|
67
|
+
* Replace a record. Same shape as insert; the SDK splits indexable
|
|
68
|
+
* vs encrypted again per the schema.
|
|
69
|
+
*/
|
|
70
|
+
update(recordId: string, record: Record<string, unknown>): Promise<void>;
|
|
71
|
+
/** Soft-delete a record. */
|
|
72
|
+
delete(recordId: string): Promise<void>;
|
|
73
|
+
}
|
|
74
|
+
export interface ListOpts {
|
|
75
|
+
readonly filter?: {
|
|
76
|
+
readonly equals?: {
|
|
77
|
+
field: string;
|
|
78
|
+
value: unknown;
|
|
79
|
+
};
|
|
80
|
+
readonly contains?: {
|
|
81
|
+
field: string;
|
|
82
|
+
value: string;
|
|
83
|
+
};
|
|
84
|
+
readonly tagsAny?: readonly string[];
|
|
85
|
+
readonly tagsAll?: readonly string[];
|
|
86
|
+
readonly range?: {
|
|
87
|
+
field: string;
|
|
88
|
+
gte?: string;
|
|
89
|
+
lte?: string;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
readonly order?: "newest" | "oldest";
|
|
93
|
+
readonly limit?: number;
|
|
94
|
+
readonly cursor?: string;
|
|
95
|
+
}
|
|
96
|
+
export declare function createDataClient(args: CreateDataClientArgs): DataClient;
|
|
97
|
+
//# sourceMappingURL=data.d.ts.map
|