@arke-institute/sdk 2.1.0 → 2.2.0
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/{crypto-CQnwqWQn.d.ts → crypto-7c990p-j.d.ts} +40 -16
- package/dist/{crypto-iYgzUi77.d.cts → crypto-El5Z3bNI.d.cts} +40 -16
- package/dist/generated/index.d.cts +385 -134
- package/dist/generated/index.d.ts +385 -134
- package/dist/index.cjs +294 -210
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +292 -210
- package/dist/index.js.map +1 -1
- package/dist/operations/index.cjs +280 -209
- package/dist/operations/index.cjs.map +1 -1
- package/dist/operations/index.d.cts +25 -9
- package/dist/operations/index.d.ts +25 -9
- package/dist/operations/index.js +280 -209
- package/dist/operations/index.js.map +1 -1
- package/openapi/spec.json +588 -205
- package/openapi/version.json +1 -1
- package/package.json +1 -1
|
@@ -11,7 +11,12 @@ interface ArkeClientConfig {
|
|
|
11
11
|
*/
|
|
12
12
|
baseUrl?: string;
|
|
13
13
|
/**
|
|
14
|
-
* Authentication token
|
|
14
|
+
* Authentication token - accepts either:
|
|
15
|
+
* - JWT token from Supabase auth (sent as Bearer)
|
|
16
|
+
* - Agent API key with 'ak_' prefix (sent as ApiKey)
|
|
17
|
+
* - User API key with 'uk_' prefix (sent as ApiKey)
|
|
18
|
+
*
|
|
19
|
+
* The correct Authorization header format is auto-detected from the token prefix.
|
|
15
20
|
*/
|
|
16
21
|
authToken?: string;
|
|
17
22
|
/**
|
|
@@ -39,13 +44,28 @@ declare const DEFAULT_CONFIG: Required<Pick<ArkeClientConfig, 'baseUrl' | 'netwo
|
|
|
39
44
|
*/
|
|
40
45
|
|
|
41
46
|
type ArkeApiClient = Client<paths>;
|
|
47
|
+
/**
|
|
48
|
+
* Check if a token is an API key (starts with 'ak_' or 'uk_')
|
|
49
|
+
*/
|
|
50
|
+
declare function isApiKey(token: string): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Get the appropriate Authorization header value for a token
|
|
53
|
+
* - API keys (ak_*, uk_*) use: ApiKey {token}
|
|
54
|
+
* - JWT tokens use: Bearer {token}
|
|
55
|
+
*/
|
|
56
|
+
declare function getAuthorizationHeader(token: string): string;
|
|
42
57
|
/**
|
|
43
58
|
* Type-safe client for the Arke API
|
|
44
59
|
*
|
|
45
60
|
* @example
|
|
46
61
|
* ```typescript
|
|
62
|
+
* // With JWT token
|
|
47
63
|
* const arke = new ArkeClient({ authToken: 'your-jwt-token' });
|
|
48
64
|
*
|
|
65
|
+
* // With API key (agent or user)
|
|
66
|
+
* const arke = new ArkeClient({ authToken: 'ak_your-agent-api-key' });
|
|
67
|
+
* const arke = new ArkeClient({ authToken: 'uk_your-user-api-key' });
|
|
68
|
+
*
|
|
49
69
|
* // Create an entity
|
|
50
70
|
* const { data, error } = await arke.api.POST('/entities', {
|
|
51
71
|
* body: {
|
|
@@ -175,22 +195,26 @@ interface UploadTarget {
|
|
|
175
195
|
*/
|
|
176
196
|
interface UploadProgress$1 {
|
|
177
197
|
/** Current phase of the upload */
|
|
178
|
-
phase: '
|
|
179
|
-
/**
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
|
|
198
|
+
phase: 'computing-cids' | 'creating' | 'backlinking' | 'uploading' | 'complete' | 'error';
|
|
199
|
+
/** Current phase index (0=computing-cids, 1=creating, 2=backlinking, 3=uploading) */
|
|
200
|
+
phaseIndex: number;
|
|
201
|
+
/** Total number of phases (4, excluding complete/error) */
|
|
202
|
+
phaseCount: number;
|
|
203
|
+
/** Progress within current phase (0-100) */
|
|
204
|
+
phasePercent: number;
|
|
205
|
+
/** Total number of entities (files + folders) */
|
|
206
|
+
totalEntities: number;
|
|
207
|
+
/** Number of entities completed */
|
|
208
|
+
completedEntities: number;
|
|
209
|
+
/** Total number of parents to backlink */
|
|
210
|
+
totalParents: number;
|
|
211
|
+
/** Number of parents backlinked */
|
|
212
|
+
completedParents: number;
|
|
213
|
+
/** Current item being processed */
|
|
214
|
+
currentItem?: string;
|
|
191
215
|
/** Error message if phase is 'error' */
|
|
192
216
|
error?: string;
|
|
193
|
-
/** Bytes uploaded so far
|
|
217
|
+
/** Bytes uploaded so far */
|
|
194
218
|
bytesUploaded?: number;
|
|
195
219
|
/** Total bytes to upload */
|
|
196
220
|
totalBytes?: number;
|
|
@@ -456,4 +480,4 @@ declare class CryptoOperations {
|
|
|
456
480
|
static computeCID(_content: Uint8Array): Promise<string>;
|
|
457
481
|
}
|
|
458
482
|
|
|
459
|
-
export { ArkeClient as A, BatchOperations as B, CryptoOperations as C, DEFAULT_CONFIG as D, FolderOperations as F, type KeyPair as K, type SignedPayload as S, type UploadProgress$1 as U, type ArkeApiClient as a, type ArkeClientConfig as b, createArkeClient as c, type UploadDirectoryOptions as d, type UploadDirectoryResult as e, type BatchCreateOptions as f, type BatchResult as
|
|
483
|
+
export { ArkeClient as A, BatchOperations as B, CryptoOperations as C, DEFAULT_CONFIG as D, FolderOperations as F, type KeyPair as K, type SignedPayload as S, type UploadProgress$1 as U, type ArkeApiClient as a, type ArkeClientConfig as b, createArkeClient as c, type UploadDirectoryOptions as d, type UploadDirectoryResult as e, type BatchCreateOptions as f, getAuthorizationHeader as g, type BatchResult as h, isApiKey as i, type UploadTree as j, type UploadOptions as k, type UploadResult as l, type UploadFile as m, type UploadFolder as n, type UploadTarget as o, type CreatedEntity as p };
|
|
@@ -11,7 +11,12 @@ interface ArkeClientConfig {
|
|
|
11
11
|
*/
|
|
12
12
|
baseUrl?: string;
|
|
13
13
|
/**
|
|
14
|
-
* Authentication token
|
|
14
|
+
* Authentication token - accepts either:
|
|
15
|
+
* - JWT token from Supabase auth (sent as Bearer)
|
|
16
|
+
* - Agent API key with 'ak_' prefix (sent as ApiKey)
|
|
17
|
+
* - User API key with 'uk_' prefix (sent as ApiKey)
|
|
18
|
+
*
|
|
19
|
+
* The correct Authorization header format is auto-detected from the token prefix.
|
|
15
20
|
*/
|
|
16
21
|
authToken?: string;
|
|
17
22
|
/**
|
|
@@ -39,13 +44,28 @@ declare const DEFAULT_CONFIG: Required<Pick<ArkeClientConfig, 'baseUrl' | 'netwo
|
|
|
39
44
|
*/
|
|
40
45
|
|
|
41
46
|
type ArkeApiClient = Client<paths>;
|
|
47
|
+
/**
|
|
48
|
+
* Check if a token is an API key (starts with 'ak_' or 'uk_')
|
|
49
|
+
*/
|
|
50
|
+
declare function isApiKey(token: string): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Get the appropriate Authorization header value for a token
|
|
53
|
+
* - API keys (ak_*, uk_*) use: ApiKey {token}
|
|
54
|
+
* - JWT tokens use: Bearer {token}
|
|
55
|
+
*/
|
|
56
|
+
declare function getAuthorizationHeader(token: string): string;
|
|
42
57
|
/**
|
|
43
58
|
* Type-safe client for the Arke API
|
|
44
59
|
*
|
|
45
60
|
* @example
|
|
46
61
|
* ```typescript
|
|
62
|
+
* // With JWT token
|
|
47
63
|
* const arke = new ArkeClient({ authToken: 'your-jwt-token' });
|
|
48
64
|
*
|
|
65
|
+
* // With API key (agent or user)
|
|
66
|
+
* const arke = new ArkeClient({ authToken: 'ak_your-agent-api-key' });
|
|
67
|
+
* const arke = new ArkeClient({ authToken: 'uk_your-user-api-key' });
|
|
68
|
+
*
|
|
49
69
|
* // Create an entity
|
|
50
70
|
* const { data, error } = await arke.api.POST('/entities', {
|
|
51
71
|
* body: {
|
|
@@ -175,22 +195,26 @@ interface UploadTarget {
|
|
|
175
195
|
*/
|
|
176
196
|
interface UploadProgress$1 {
|
|
177
197
|
/** Current phase of the upload */
|
|
178
|
-
phase: '
|
|
179
|
-
/**
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
|
|
198
|
+
phase: 'computing-cids' | 'creating' | 'backlinking' | 'uploading' | 'complete' | 'error';
|
|
199
|
+
/** Current phase index (0=computing-cids, 1=creating, 2=backlinking, 3=uploading) */
|
|
200
|
+
phaseIndex: number;
|
|
201
|
+
/** Total number of phases (4, excluding complete/error) */
|
|
202
|
+
phaseCount: number;
|
|
203
|
+
/** Progress within current phase (0-100) */
|
|
204
|
+
phasePercent: number;
|
|
205
|
+
/** Total number of entities (files + folders) */
|
|
206
|
+
totalEntities: number;
|
|
207
|
+
/** Number of entities completed */
|
|
208
|
+
completedEntities: number;
|
|
209
|
+
/** Total number of parents to backlink */
|
|
210
|
+
totalParents: number;
|
|
211
|
+
/** Number of parents backlinked */
|
|
212
|
+
completedParents: number;
|
|
213
|
+
/** Current item being processed */
|
|
214
|
+
currentItem?: string;
|
|
191
215
|
/** Error message if phase is 'error' */
|
|
192
216
|
error?: string;
|
|
193
|
-
/** Bytes uploaded so far
|
|
217
|
+
/** Bytes uploaded so far */
|
|
194
218
|
bytesUploaded?: number;
|
|
195
219
|
/** Total bytes to upload */
|
|
196
220
|
totalBytes?: number;
|
|
@@ -456,4 +480,4 @@ declare class CryptoOperations {
|
|
|
456
480
|
static computeCID(_content: Uint8Array): Promise<string>;
|
|
457
481
|
}
|
|
458
482
|
|
|
459
|
-
export { ArkeClient as A, BatchOperations as B, CryptoOperations as C, DEFAULT_CONFIG as D, FolderOperations as F, type KeyPair as K, type SignedPayload as S, type UploadProgress$1 as U, type ArkeApiClient as a, type ArkeClientConfig as b, createArkeClient as c, type UploadDirectoryOptions as d, type UploadDirectoryResult as e, type BatchCreateOptions as f, type BatchResult as
|
|
483
|
+
export { ArkeClient as A, BatchOperations as B, CryptoOperations as C, DEFAULT_CONFIG as D, FolderOperations as F, type KeyPair as K, type SignedPayload as S, type UploadProgress$1 as U, type ArkeApiClient as a, type ArkeClientConfig as b, createArkeClient as c, type UploadDirectoryOptions as d, type UploadDirectoryResult as e, type BatchCreateOptions as f, getAuthorizationHeader as g, type BatchResult as h, isApiKey as i, type UploadTree as j, type UploadOptions as k, type UploadResult as l, type UploadFile as m, type UploadFolder as n, type UploadTarget as o, type CreatedEntity as p };
|