@arke-institute/sdk 0.1.3 → 2.1.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/README.md +222 -176
- package/dist/crypto-CQnwqWQn.d.ts +459 -0
- package/dist/crypto-iYgzUi77.d.cts +459 -0
- package/dist/generated/index.cjs +19 -0
- package/dist/generated/index.cjs.map +1 -0
- package/dist/generated/index.d.cts +6545 -0
- package/dist/generated/index.d.ts +6545 -0
- package/dist/generated/index.js +1 -0
- package/dist/generated/index.js.map +1 -0
- package/dist/index.cjs +725 -4248
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +62 -7
- package/dist/index.d.ts +62 -7
- package/dist/index.js +706 -4221
- package/dist/index.js.map +1 -1
- package/dist/operations/index.cjs +806 -0
- package/dist/operations/index.cjs.map +1 -0
- package/dist/operations/index.d.cts +157 -0
- package/dist/operations/index.d.ts +157 -0
- package/dist/operations/index.js +759 -0
- package/dist/operations/index.js.map +1 -0
- package/openapi/spec.json +8648 -0
- package/openapi/version.json +7 -0
- package/package.json +51 -52
- package/dist/client-dAk3E64p.d.cts +0 -183
- package/dist/client-dAk3E64p.d.ts +0 -183
- package/dist/collections/index.cjs +0 -233
- package/dist/collections/index.cjs.map +0 -1
- package/dist/collections/index.d.cts +0 -9
- package/dist/collections/index.d.ts +0 -9
- package/dist/collections/index.js +0 -205
- package/dist/collections/index.js.map +0 -1
- package/dist/content/index.cjs +0 -591
- package/dist/content/index.cjs.map +0 -1
- package/dist/content/index.d.cts +0 -516
- package/dist/content/index.d.ts +0 -516
- package/dist/content/index.js +0 -558
- package/dist/content/index.js.map +0 -1
- package/dist/edit/index.cjs +0 -1503
- package/dist/edit/index.cjs.map +0 -1
- package/dist/edit/index.d.cts +0 -78
- package/dist/edit/index.d.ts +0 -78
- package/dist/edit/index.js +0 -1447
- package/dist/edit/index.js.map +0 -1
- package/dist/errors-3L7IiHcr.d.cts +0 -480
- package/dist/errors-BTe8GKRQ.d.ts +0 -480
- package/dist/errors-CT7yzKkU.d.cts +0 -874
- package/dist/errors-CT7yzKkU.d.ts +0 -874
- package/dist/graph/index.cjs +0 -427
- package/dist/graph/index.cjs.map +0 -1
- package/dist/graph/index.d.cts +0 -485
- package/dist/graph/index.d.ts +0 -485
- package/dist/graph/index.js +0 -396
- package/dist/graph/index.js.map +0 -1
- package/dist/query/index.cjs +0 -356
- package/dist/query/index.cjs.map +0 -1
- package/dist/query/index.d.cts +0 -636
- package/dist/query/index.d.ts +0 -636
- package/dist/query/index.js +0 -328
- package/dist/query/index.js.map +0 -1
- package/dist/upload/index.cjs +0 -1634
- package/dist/upload/index.cjs.map +0 -1
- package/dist/upload/index.d.cts +0 -150
- package/dist/upload/index.d.ts +0 -150
- package/dist/upload/index.js +0 -1597
- package/dist/upload/index.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arke-institute/sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"description": "TypeScript SDK for the Arke API - auto-generated from OpenAPI spec",
|
|
4
5
|
"type": "module",
|
|
5
|
-
"description": "TypeScript SDK for building applications on the Arke platform",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
7
7
|
"module": "dist/index.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
@@ -12,77 +12,76 @@
|
|
|
12
12
|
"import": "./dist/index.js",
|
|
13
13
|
"require": "./dist/index.cjs"
|
|
14
14
|
},
|
|
15
|
-
"./
|
|
16
|
-
"types": "./dist/
|
|
17
|
-
"import": "./dist/
|
|
18
|
-
"require": "./dist/
|
|
15
|
+
"./generated": {
|
|
16
|
+
"types": "./dist/generated/index.d.ts",
|
|
17
|
+
"import": "./dist/generated/index.js",
|
|
18
|
+
"require": "./dist/generated/index.cjs"
|
|
19
19
|
},
|
|
20
|
-
"./
|
|
21
|
-
"types": "./dist/
|
|
22
|
-
"import": "./dist/
|
|
23
|
-
"require": "./dist/
|
|
20
|
+
"./operations": {
|
|
21
|
+
"types": "./dist/operations/index.d.ts",
|
|
22
|
+
"import": "./dist/operations/index.js",
|
|
23
|
+
"require": "./dist/operations/index.cjs"
|
|
24
24
|
},
|
|
25
|
-
"./
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"require": "./dist/query/index.cjs"
|
|
29
|
-
},
|
|
30
|
-
"./edit": {
|
|
31
|
-
"types": "./dist/edit/index.d.ts",
|
|
32
|
-
"import": "./dist/edit/index.js",
|
|
33
|
-
"require": "./dist/edit/index.cjs"
|
|
34
|
-
},
|
|
35
|
-
"./content": {
|
|
36
|
-
"types": "./dist/content/index.d.ts",
|
|
37
|
-
"import": "./dist/content/index.js",
|
|
38
|
-
"require": "./dist/content/index.cjs"
|
|
39
|
-
},
|
|
40
|
-
"./graph": {
|
|
41
|
-
"types": "./dist/graph/index.d.ts",
|
|
42
|
-
"import": "./dist/graph/index.js",
|
|
43
|
-
"require": "./dist/graph/index.cjs"
|
|
25
|
+
"./spec": {
|
|
26
|
+
"import": "./openapi/spec.json",
|
|
27
|
+
"require": "./openapi/spec.json"
|
|
44
28
|
}
|
|
45
29
|
},
|
|
46
30
|
"files": [
|
|
47
|
-
"dist"
|
|
31
|
+
"dist",
|
|
32
|
+
"openapi",
|
|
33
|
+
"README.md"
|
|
48
34
|
],
|
|
49
35
|
"scripts": {
|
|
36
|
+
"generate:fetch": "tsx scripts/fetch-spec.ts",
|
|
37
|
+
"generate:fetch:local": "tsx scripts/fetch-spec.ts --local",
|
|
38
|
+
"generate:types": "tsx scripts/generate.ts",
|
|
39
|
+
"generate": "npm run generate:fetch && npm run generate:types",
|
|
40
|
+
"generate:local": "npm run generate:fetch:local && npm run generate:types",
|
|
50
41
|
"build": "tsup",
|
|
51
42
|
"dev": "tsup --watch",
|
|
52
|
-
"typecheck": "tsc --noEmit",
|
|
53
43
|
"test": "vitest run",
|
|
44
|
+
"test:watch": "vitest",
|
|
45
|
+
"test:e2e": "vitest run --config vitest.e2e.config.ts",
|
|
46
|
+
"typecheck": "tsc --noEmit",
|
|
54
47
|
"clean": "rm -rf dist",
|
|
55
|
-
"prepublishOnly": "npm run build"
|
|
48
|
+
"prepublishOnly": "npm run build",
|
|
49
|
+
"publish:dry": "npm publish --dry-run",
|
|
50
|
+
"publish:sdk": "npm publish --access public",
|
|
51
|
+
"publish-all": "npm run generate && npm run test && npm run build && npm run publish:sdk",
|
|
52
|
+
"publish-all:dry": "npm run generate && npm run test && npm run build && npm run publish:dry"
|
|
56
53
|
},
|
|
57
54
|
"dependencies": {
|
|
58
|
-
"
|
|
59
|
-
"
|
|
55
|
+
"multiformats": "^13.4.2",
|
|
56
|
+
"openapi-fetch": "^0.13.0"
|
|
60
57
|
},
|
|
61
58
|
"devDependencies": {
|
|
62
|
-
"@types/
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
59
|
+
"@types/node": "^22.0.0",
|
|
60
|
+
"jose": "^6.1.3",
|
|
61
|
+
"openapi-typescript": "^7.4.0",
|
|
62
|
+
"tsup": "^8.3.0",
|
|
63
|
+
"tsx": "^4.19.0",
|
|
64
|
+
"typescript": "^5.7.0",
|
|
65
|
+
"vitest": "^2.1.0"
|
|
66
|
+
},
|
|
67
|
+
"publishConfig": {
|
|
68
|
+
"access": "public"
|
|
69
|
+
},
|
|
70
|
+
"repository": {
|
|
71
|
+
"type": "git",
|
|
72
|
+
"url": "https://github.com/arke-institute/arke"
|
|
67
73
|
},
|
|
68
74
|
"keywords": [
|
|
69
75
|
"arke",
|
|
76
|
+
"api",
|
|
70
77
|
"sdk",
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"edit",
|
|
75
|
-
"knowledge-graph",
|
|
76
|
-
"content",
|
|
77
|
-
"typescript"
|
|
78
|
+
"typescript",
|
|
79
|
+
"ipfs",
|
|
80
|
+
"entities"
|
|
78
81
|
],
|
|
79
|
-
"license": "MIT",
|
|
80
|
-
"repository": {
|
|
81
|
-
"type": "git",
|
|
82
|
-
"url": "https://github.com/Arke-Institute/arke-sdk"
|
|
83
|
-
},
|
|
84
82
|
"author": "Arke Institute",
|
|
83
|
+
"license": "MIT",
|
|
85
84
|
"engines": {
|
|
86
|
-
"node": ">=18"
|
|
85
|
+
"node": ">=18.0.0"
|
|
87
86
|
}
|
|
88
87
|
}
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
type CollectionVisibility = 'public' | 'private';
|
|
2
|
-
type CollectionRole = 'owner' | 'editor';
|
|
3
|
-
interface Collection {
|
|
4
|
-
id: string;
|
|
5
|
-
title: string;
|
|
6
|
-
slug: string;
|
|
7
|
-
description?: string | null;
|
|
8
|
-
visibility: CollectionVisibility;
|
|
9
|
-
creator_user_id?: string;
|
|
10
|
-
created_at?: string;
|
|
11
|
-
updated_at?: string;
|
|
12
|
-
}
|
|
13
|
-
interface CollectionDetails extends Collection {
|
|
14
|
-
member_count: number;
|
|
15
|
-
root_pi: string | null;
|
|
16
|
-
users?: {
|
|
17
|
-
email?: string;
|
|
18
|
-
name?: string | null;
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
interface PaginatedCollections {
|
|
22
|
-
collections: CollectionDetails[];
|
|
23
|
-
pagination: {
|
|
24
|
-
total: number | null;
|
|
25
|
-
limit: number;
|
|
26
|
-
offset: number;
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
interface MemberUser {
|
|
30
|
-
id: string;
|
|
31
|
-
email: string;
|
|
32
|
-
name?: string | null;
|
|
33
|
-
}
|
|
34
|
-
interface Member {
|
|
35
|
-
role: CollectionRole;
|
|
36
|
-
created_at?: string;
|
|
37
|
-
user: MemberUser;
|
|
38
|
-
}
|
|
39
|
-
interface MembersResponse {
|
|
40
|
-
members: Member[];
|
|
41
|
-
}
|
|
42
|
-
interface InvitationUser {
|
|
43
|
-
email: string;
|
|
44
|
-
name?: string | null;
|
|
45
|
-
}
|
|
46
|
-
interface Invitation {
|
|
47
|
-
id: string;
|
|
48
|
-
role: CollectionRole;
|
|
49
|
-
status: 'pending' | 'accepted' | 'declined' | 'expired';
|
|
50
|
-
expires_at: string;
|
|
51
|
-
created_at: string;
|
|
52
|
-
responded_at?: string | null;
|
|
53
|
-
invitee?: InvitationUser;
|
|
54
|
-
inviter?: InvitationUser;
|
|
55
|
-
collection?: {
|
|
56
|
-
id: string;
|
|
57
|
-
title: string;
|
|
58
|
-
slug: string;
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
interface InvitationsResponse {
|
|
62
|
-
invitations: Invitation[];
|
|
63
|
-
}
|
|
64
|
-
interface CreateCollectionPayload {
|
|
65
|
-
title: string;
|
|
66
|
-
slug: string;
|
|
67
|
-
description?: string;
|
|
68
|
-
visibility?: CollectionVisibility;
|
|
69
|
-
}
|
|
70
|
-
interface RegisterRootPayload extends CreateCollectionPayload {
|
|
71
|
-
rootPi: string;
|
|
72
|
-
}
|
|
73
|
-
interface UpdateCollectionPayload {
|
|
74
|
-
title?: string;
|
|
75
|
-
description?: string;
|
|
76
|
-
visibility?: CollectionVisibility;
|
|
77
|
-
}
|
|
78
|
-
interface ChangeRootPayload {
|
|
79
|
-
newRootPi: string;
|
|
80
|
-
}
|
|
81
|
-
interface MyCollectionsResponse {
|
|
82
|
-
owned: Array<Collection & {
|
|
83
|
-
role: CollectionRole;
|
|
84
|
-
}>;
|
|
85
|
-
editing: Array<Collection & {
|
|
86
|
-
role: CollectionRole;
|
|
87
|
-
}>;
|
|
88
|
-
total: number;
|
|
89
|
-
}
|
|
90
|
-
interface MyAccessResponse {
|
|
91
|
-
isMember: boolean;
|
|
92
|
-
role: CollectionRole | null;
|
|
93
|
-
canView: boolean;
|
|
94
|
-
canEdit: boolean;
|
|
95
|
-
canInvite: boolean;
|
|
96
|
-
canManageMembers: boolean;
|
|
97
|
-
canDelete: boolean;
|
|
98
|
-
}
|
|
99
|
-
interface RootResponse {
|
|
100
|
-
rootPi: string;
|
|
101
|
-
}
|
|
102
|
-
interface ChangeRootResponse {
|
|
103
|
-
previousRoot: string | null;
|
|
104
|
-
newRoot: string;
|
|
105
|
-
}
|
|
106
|
-
interface SuccessResponse {
|
|
107
|
-
success: boolean;
|
|
108
|
-
}
|
|
109
|
-
interface PiPermissions {
|
|
110
|
-
pi: string;
|
|
111
|
-
canView: boolean;
|
|
112
|
-
canEdit: boolean;
|
|
113
|
-
canAdminister: boolean;
|
|
114
|
-
collection: {
|
|
115
|
-
id: string;
|
|
116
|
-
title: string;
|
|
117
|
-
slug: string;
|
|
118
|
-
visibility: CollectionVisibility;
|
|
119
|
-
role: CollectionRole | null;
|
|
120
|
-
rootPi: string;
|
|
121
|
-
hops: number;
|
|
122
|
-
} | null;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
interface CollectionsClientConfig {
|
|
126
|
-
/**
|
|
127
|
-
* Gateway base URL (e.g., https://api.arke.institute).
|
|
128
|
-
* Must already point at the Arke gateway that proxies /collections/*.
|
|
129
|
-
*/
|
|
130
|
-
gatewayUrl: string;
|
|
131
|
-
/**
|
|
132
|
-
* Optional bearer token for authenticated routes.
|
|
133
|
-
* Public routes will still include it if provided.
|
|
134
|
-
*/
|
|
135
|
-
authToken?: string;
|
|
136
|
-
/**
|
|
137
|
-
* Optional custom fetch (useful for testing).
|
|
138
|
-
*/
|
|
139
|
-
fetchImpl?: typeof fetch;
|
|
140
|
-
}
|
|
141
|
-
declare class CollectionsClient {
|
|
142
|
-
private baseUrl;
|
|
143
|
-
private authToken?;
|
|
144
|
-
private fetchImpl;
|
|
145
|
-
constructor(config: CollectionsClientConfig);
|
|
146
|
-
setAuthToken(token?: string): void;
|
|
147
|
-
private buildUrl;
|
|
148
|
-
private getHeaders;
|
|
149
|
-
private request;
|
|
150
|
-
listCollections(params?: {
|
|
151
|
-
limit?: number;
|
|
152
|
-
offset?: number;
|
|
153
|
-
}): Promise<PaginatedCollections>;
|
|
154
|
-
getCollection(id: string): Promise<CollectionDetails>;
|
|
155
|
-
getCollectionRoot(id: string): Promise<RootResponse>;
|
|
156
|
-
getMyAccess(id: string): Promise<MyAccessResponse>;
|
|
157
|
-
createCollection(payload: CreateCollectionPayload): Promise<Collection>;
|
|
158
|
-
registerRoot(payload: RegisterRootPayload): Promise<Collection & {
|
|
159
|
-
rootPi: string;
|
|
160
|
-
}>;
|
|
161
|
-
updateCollection(id: string, payload: UpdateCollectionPayload): Promise<Collection>;
|
|
162
|
-
changeRoot(id: string, payload: ChangeRootPayload): Promise<ChangeRootResponse>;
|
|
163
|
-
deleteCollection(id: string): Promise<SuccessResponse>;
|
|
164
|
-
listMembers(collectionId: string): Promise<MembersResponse>;
|
|
165
|
-
updateMemberRole(collectionId: string, userId: string, role: CollectionRole): Promise<{
|
|
166
|
-
success: true;
|
|
167
|
-
role: CollectionRole;
|
|
168
|
-
}>;
|
|
169
|
-
removeMember(collectionId: string, userId: string): Promise<SuccessResponse>;
|
|
170
|
-
createInvitation(collectionId: string, email: string, role: CollectionRole): Promise<Invitation>;
|
|
171
|
-
listInvitations(collectionId: string): Promise<InvitationsResponse>;
|
|
172
|
-
acceptInvitation(invitationId: string): Promise<{
|
|
173
|
-
success: true;
|
|
174
|
-
role: CollectionRole;
|
|
175
|
-
}>;
|
|
176
|
-
declineInvitation(invitationId: string): Promise<SuccessResponse>;
|
|
177
|
-
revokeInvitation(invitationId: string): Promise<SuccessResponse>;
|
|
178
|
-
getMyCollections(): Promise<MyCollectionsResponse>;
|
|
179
|
-
getMyInvitations(): Promise<InvitationsResponse>;
|
|
180
|
-
getPiPermissions(pi: string): Promise<PiPermissions>;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
export { CollectionsClient as C, type Invitation as I, type Member as M, type PaginatedCollections as P, type RegisterRootPayload as R, type SuccessResponse as S, type UpdateCollectionPayload as U, type CollectionsClientConfig as a, type Collection as b, type CollectionDetails as c, type CollectionRole as d, type CollectionVisibility as e, type CreateCollectionPayload as f, type ChangeRootPayload as g, type ChangeRootResponse as h, type MemberUser as i, type MembersResponse as j, type InvitationUser as k, type InvitationsResponse as l, type MyAccessResponse as m, type MyCollectionsResponse as n, type PiPermissions as o, type RootResponse as p };
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
type CollectionVisibility = 'public' | 'private';
|
|
2
|
-
type CollectionRole = 'owner' | 'editor';
|
|
3
|
-
interface Collection {
|
|
4
|
-
id: string;
|
|
5
|
-
title: string;
|
|
6
|
-
slug: string;
|
|
7
|
-
description?: string | null;
|
|
8
|
-
visibility: CollectionVisibility;
|
|
9
|
-
creator_user_id?: string;
|
|
10
|
-
created_at?: string;
|
|
11
|
-
updated_at?: string;
|
|
12
|
-
}
|
|
13
|
-
interface CollectionDetails extends Collection {
|
|
14
|
-
member_count: number;
|
|
15
|
-
root_pi: string | null;
|
|
16
|
-
users?: {
|
|
17
|
-
email?: string;
|
|
18
|
-
name?: string | null;
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
interface PaginatedCollections {
|
|
22
|
-
collections: CollectionDetails[];
|
|
23
|
-
pagination: {
|
|
24
|
-
total: number | null;
|
|
25
|
-
limit: number;
|
|
26
|
-
offset: number;
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
interface MemberUser {
|
|
30
|
-
id: string;
|
|
31
|
-
email: string;
|
|
32
|
-
name?: string | null;
|
|
33
|
-
}
|
|
34
|
-
interface Member {
|
|
35
|
-
role: CollectionRole;
|
|
36
|
-
created_at?: string;
|
|
37
|
-
user: MemberUser;
|
|
38
|
-
}
|
|
39
|
-
interface MembersResponse {
|
|
40
|
-
members: Member[];
|
|
41
|
-
}
|
|
42
|
-
interface InvitationUser {
|
|
43
|
-
email: string;
|
|
44
|
-
name?: string | null;
|
|
45
|
-
}
|
|
46
|
-
interface Invitation {
|
|
47
|
-
id: string;
|
|
48
|
-
role: CollectionRole;
|
|
49
|
-
status: 'pending' | 'accepted' | 'declined' | 'expired';
|
|
50
|
-
expires_at: string;
|
|
51
|
-
created_at: string;
|
|
52
|
-
responded_at?: string | null;
|
|
53
|
-
invitee?: InvitationUser;
|
|
54
|
-
inviter?: InvitationUser;
|
|
55
|
-
collection?: {
|
|
56
|
-
id: string;
|
|
57
|
-
title: string;
|
|
58
|
-
slug: string;
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
interface InvitationsResponse {
|
|
62
|
-
invitations: Invitation[];
|
|
63
|
-
}
|
|
64
|
-
interface CreateCollectionPayload {
|
|
65
|
-
title: string;
|
|
66
|
-
slug: string;
|
|
67
|
-
description?: string;
|
|
68
|
-
visibility?: CollectionVisibility;
|
|
69
|
-
}
|
|
70
|
-
interface RegisterRootPayload extends CreateCollectionPayload {
|
|
71
|
-
rootPi: string;
|
|
72
|
-
}
|
|
73
|
-
interface UpdateCollectionPayload {
|
|
74
|
-
title?: string;
|
|
75
|
-
description?: string;
|
|
76
|
-
visibility?: CollectionVisibility;
|
|
77
|
-
}
|
|
78
|
-
interface ChangeRootPayload {
|
|
79
|
-
newRootPi: string;
|
|
80
|
-
}
|
|
81
|
-
interface MyCollectionsResponse {
|
|
82
|
-
owned: Array<Collection & {
|
|
83
|
-
role: CollectionRole;
|
|
84
|
-
}>;
|
|
85
|
-
editing: Array<Collection & {
|
|
86
|
-
role: CollectionRole;
|
|
87
|
-
}>;
|
|
88
|
-
total: number;
|
|
89
|
-
}
|
|
90
|
-
interface MyAccessResponse {
|
|
91
|
-
isMember: boolean;
|
|
92
|
-
role: CollectionRole | null;
|
|
93
|
-
canView: boolean;
|
|
94
|
-
canEdit: boolean;
|
|
95
|
-
canInvite: boolean;
|
|
96
|
-
canManageMembers: boolean;
|
|
97
|
-
canDelete: boolean;
|
|
98
|
-
}
|
|
99
|
-
interface RootResponse {
|
|
100
|
-
rootPi: string;
|
|
101
|
-
}
|
|
102
|
-
interface ChangeRootResponse {
|
|
103
|
-
previousRoot: string | null;
|
|
104
|
-
newRoot: string;
|
|
105
|
-
}
|
|
106
|
-
interface SuccessResponse {
|
|
107
|
-
success: boolean;
|
|
108
|
-
}
|
|
109
|
-
interface PiPermissions {
|
|
110
|
-
pi: string;
|
|
111
|
-
canView: boolean;
|
|
112
|
-
canEdit: boolean;
|
|
113
|
-
canAdminister: boolean;
|
|
114
|
-
collection: {
|
|
115
|
-
id: string;
|
|
116
|
-
title: string;
|
|
117
|
-
slug: string;
|
|
118
|
-
visibility: CollectionVisibility;
|
|
119
|
-
role: CollectionRole | null;
|
|
120
|
-
rootPi: string;
|
|
121
|
-
hops: number;
|
|
122
|
-
} | null;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
interface CollectionsClientConfig {
|
|
126
|
-
/**
|
|
127
|
-
* Gateway base URL (e.g., https://api.arke.institute).
|
|
128
|
-
* Must already point at the Arke gateway that proxies /collections/*.
|
|
129
|
-
*/
|
|
130
|
-
gatewayUrl: string;
|
|
131
|
-
/**
|
|
132
|
-
* Optional bearer token for authenticated routes.
|
|
133
|
-
* Public routes will still include it if provided.
|
|
134
|
-
*/
|
|
135
|
-
authToken?: string;
|
|
136
|
-
/**
|
|
137
|
-
* Optional custom fetch (useful for testing).
|
|
138
|
-
*/
|
|
139
|
-
fetchImpl?: typeof fetch;
|
|
140
|
-
}
|
|
141
|
-
declare class CollectionsClient {
|
|
142
|
-
private baseUrl;
|
|
143
|
-
private authToken?;
|
|
144
|
-
private fetchImpl;
|
|
145
|
-
constructor(config: CollectionsClientConfig);
|
|
146
|
-
setAuthToken(token?: string): void;
|
|
147
|
-
private buildUrl;
|
|
148
|
-
private getHeaders;
|
|
149
|
-
private request;
|
|
150
|
-
listCollections(params?: {
|
|
151
|
-
limit?: number;
|
|
152
|
-
offset?: number;
|
|
153
|
-
}): Promise<PaginatedCollections>;
|
|
154
|
-
getCollection(id: string): Promise<CollectionDetails>;
|
|
155
|
-
getCollectionRoot(id: string): Promise<RootResponse>;
|
|
156
|
-
getMyAccess(id: string): Promise<MyAccessResponse>;
|
|
157
|
-
createCollection(payload: CreateCollectionPayload): Promise<Collection>;
|
|
158
|
-
registerRoot(payload: RegisterRootPayload): Promise<Collection & {
|
|
159
|
-
rootPi: string;
|
|
160
|
-
}>;
|
|
161
|
-
updateCollection(id: string, payload: UpdateCollectionPayload): Promise<Collection>;
|
|
162
|
-
changeRoot(id: string, payload: ChangeRootPayload): Promise<ChangeRootResponse>;
|
|
163
|
-
deleteCollection(id: string): Promise<SuccessResponse>;
|
|
164
|
-
listMembers(collectionId: string): Promise<MembersResponse>;
|
|
165
|
-
updateMemberRole(collectionId: string, userId: string, role: CollectionRole): Promise<{
|
|
166
|
-
success: true;
|
|
167
|
-
role: CollectionRole;
|
|
168
|
-
}>;
|
|
169
|
-
removeMember(collectionId: string, userId: string): Promise<SuccessResponse>;
|
|
170
|
-
createInvitation(collectionId: string, email: string, role: CollectionRole): Promise<Invitation>;
|
|
171
|
-
listInvitations(collectionId: string): Promise<InvitationsResponse>;
|
|
172
|
-
acceptInvitation(invitationId: string): Promise<{
|
|
173
|
-
success: true;
|
|
174
|
-
role: CollectionRole;
|
|
175
|
-
}>;
|
|
176
|
-
declineInvitation(invitationId: string): Promise<SuccessResponse>;
|
|
177
|
-
revokeInvitation(invitationId: string): Promise<SuccessResponse>;
|
|
178
|
-
getMyCollections(): Promise<MyCollectionsResponse>;
|
|
179
|
-
getMyInvitations(): Promise<InvitationsResponse>;
|
|
180
|
-
getPiPermissions(pi: string): Promise<PiPermissions>;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
export { CollectionsClient as C, type Invitation as I, type Member as M, type PaginatedCollections as P, type RegisterRootPayload as R, type SuccessResponse as S, type UpdateCollectionPayload as U, type CollectionsClientConfig as a, type Collection as b, type CollectionDetails as c, type CollectionRole as d, type CollectionVisibility as e, type CreateCollectionPayload as f, type ChangeRootPayload as g, type ChangeRootResponse as h, type MemberUser as i, type MembersResponse as j, type InvitationUser as k, type InvitationsResponse as l, type MyAccessResponse as m, type MyCollectionsResponse as n, type PiPermissions as o, type RootResponse as p };
|