@autonomys/auto-drive 1.0.3 → 1.0.4
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/{cjs/api → api}/calls/download.d.ts +1 -0
- package/dist/api/calls/download.d.ts.map +1 -0
- package/dist/api/calls/download.js +21 -0
- package/dist/{esm/api → api}/calls/index.d.ts +1 -0
- package/dist/api/calls/index.d.ts.map +1 -0
- package/dist/{esm/api → api}/calls/read.d.ts +1 -0
- package/dist/api/calls/read.d.ts.map +1 -0
- package/dist/{cjs/api/calls/read.d.ts → api/calls/read.js} +72 -20
- package/dist/{esm/api → api}/calls/upload.d.ts +3 -2
- package/dist/api/calls/upload.d.ts.map +1 -0
- package/dist/{cjs/api/calls/upload.d.ts → api/calls/upload.js} +65 -29
- package/dist/{cjs/api → api}/calls/write.d.ts +1 -0
- package/dist/api/calls/write.d.ts.map +1 -0
- package/dist/{esm/api/calls/write.d.ts → api/calls/write.js} +38 -12
- package/dist/api/connection.d.ts +15 -0
- package/dist/api/connection.d.ts.map +1 -0
- package/dist/api/connection.js +24 -0
- package/dist/{esm/api → api}/index.d.ts +1 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/models/folderTree.d.ts +45 -0
- package/dist/api/models/folderTree.d.ts.map +1 -0
- package/dist/api/models/folderTree.js +56 -0
- package/dist/{esm/api → api}/models/index.d.ts +1 -0
- package/dist/api/models/index.d.ts.map +1 -0
- package/dist/{cjs/api → api}/models/objects.d.ts +1 -0
- package/dist/api/models/objects.d.ts.map +1 -0
- package/dist/api/models/objects.js +10 -0
- package/dist/api/models/uploads.d.ts +117 -0
- package/dist/api/models/uploads.d.ts.map +1 -0
- package/dist/api/models/uploads.js +40 -0
- package/dist/{cjs/api → api}/wrappers.d.ts +5 -3
- package/dist/api/wrappers.d.ts.map +1 -0
- package/dist/api/wrappers.js +192 -0
- package/dist/{esm/index.d.ts → index.d.ts} +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/{cjs/utils → utils}/async.d.ts +1 -0
- package/dist/utils/async.d.ts.map +1 -0
- package/dist/utils/async.js +58 -0
- package/dist/{cjs/utils → utils}/folder.d.ts +1 -0
- package/dist/utils/folder.d.ts.map +1 -0
- package/dist/utils/folder.js +23 -0
- package/dist/{esm/utils → utils}/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/{cjs/utils → utils}/stream.d.ts +1 -0
- package/dist/utils/stream.d.ts.map +1 -0
- package/dist/utils/stream.js +22 -0
- package/dist/{cjs/utils → utils}/types.d.ts +1 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/dist/utils/types.js +1 -0
- package/package.json +3 -3
- package/dist/cjs/api/connection.d.ts +0 -7
- package/dist/cjs/api/models/folderTree.d.ts +0 -29
- package/dist/cjs/api/models/uploads.d.ts +0 -113
- package/dist/cjs/index.js +0 -28810
- package/dist/cjs/index.js.map +0 -1
- package/dist/esm/api/calls/download.d.ts +0 -5
- package/dist/esm/api/connection.d.ts +0 -7
- package/dist/esm/api/models/folderTree.d.ts +0 -29
- package/dist/esm/api/models/objects.d.ts +0 -40
- package/dist/esm/api/models/uploads.d.ts +0 -113
- package/dist/esm/api/wrappers.d.ts +0 -66
- package/dist/esm/index.js +0 -28762
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/utils/async.d.ts +0 -2
- package/dist/esm/utils/folder.d.ts +0 -1
- package/dist/esm/utils/stream.d.ts +0 -2
- package/dist/esm/utils/types.d.ts +0 -5
- /package/dist/{cjs/api/calls/index.d.ts → api/calls/index.js} +0 -0
- /package/dist/{cjs/api/index.d.ts → api/index.js} +0 -0
- /package/dist/{cjs/api/models/index.d.ts → api/models/index.js} +0 -0
- /package/dist/{cjs/index.d.ts → index.js} +0 -0
- /package/dist/{cjs/utils/index.d.ts → utils/index.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../../src/api/calls/download.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE/C,eAAO,MAAM,cAAc,QACpB,YAAY,SACV,qBAAqB,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,KAC5C,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAcpC,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
export const downloadObject = (api, query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
11
|
+
const response = yield api.sendRequest(`/objects/${query.cid}/download`, {
|
|
12
|
+
method: 'GET',
|
|
13
|
+
});
|
|
14
|
+
if (!response.ok) {
|
|
15
|
+
throw new Error(`Failed to download file: ${response.statusText}`);
|
|
16
|
+
}
|
|
17
|
+
if (!response.body) {
|
|
18
|
+
throw new Error('No body returned from download request');
|
|
19
|
+
}
|
|
20
|
+
return response.body;
|
|
21
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/calls/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA"}
|
|
@@ -95,3 +95,4 @@ export declare const getObjectOwners: (api: AutoDriveApi, query: ArgsWithoutPagi
|
|
|
95
95
|
export declare const getObjectMetadata: (api: AutoDriveApi, query: ArgsWithoutPagination<{
|
|
96
96
|
cid: string;
|
|
97
97
|
}>) => Promise<ObjectInformation["metadata"]>;
|
|
98
|
+
//# sourceMappingURL=read.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../src/api/calls/read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAE9E;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,QACd,YAAY,SACV,kBAAkB,CAAC;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC,KAC1C,OAAO,CAAC,aAAa,EAAE,CAazB,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,QACrB,YAAY,SACV,kBAAkB,KACxB,OAAO,CAAC,aAAa,EAAE,CAazB,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,QAChB,YAAY,SACV,kBAAkB,KACxB,OAAO,CAAC,aAAa,EAAE,CAazB,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,QACf,YAAY,SACV,qBAAqB,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,KAC5C,OAAO,CAAC,iBAAiB,CAU3B,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,QAC3B,YAAY,SACV,qBAAqB,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,KAC5C,OAAO,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAU3C,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,QACrB,YAAY,SACV,qBAAqB,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,KAC5C,OAAO,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAUrC,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,QACvB,YAAY,SACV,qBAAqB,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,KAC5C,OAAO,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAUvC,CAAA"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
4
10
|
/**
|
|
5
11
|
* Retrieves the root objects based on the specified scope.
|
|
6
12
|
*
|
|
@@ -9,9 +15,15 @@ import { ObjectInformation, ObjectSummary, Scope } from '../models/objects.js';
|
|
|
9
15
|
* @returns {Promise<ObjectSummary[]>} - A promise that resolves to an array of ObjectSummary representing the root objects.
|
|
10
16
|
* @throws {Error} - Throws an error if the request fails.
|
|
11
17
|
*/
|
|
12
|
-
export
|
|
13
|
-
scope
|
|
14
|
-
|
|
18
|
+
export const getRoots = (api, query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
+
const response = yield api.sendRequest(`/objects/roots?scope=${query.scope}&limit=${query.limit}&offset=${query.offset}`, {
|
|
20
|
+
method: 'GET',
|
|
21
|
+
});
|
|
22
|
+
if (!response.ok) {
|
|
23
|
+
throw new Error(`Failed to get roots: ${response.statusText}`);
|
|
24
|
+
}
|
|
25
|
+
return response.json();
|
|
26
|
+
});
|
|
15
27
|
/**
|
|
16
28
|
* Retrieves the objects that have been shared with the authenticated user.
|
|
17
29
|
*
|
|
@@ -23,7 +35,15 @@ export declare const getRoots: (api: AutoDriveApi, query: ArgsWithPagination<{
|
|
|
23
35
|
* @returns {Promise<ObjectSummary[]>} - A promise that resolves to an array of ObjectSummary representing the shared objects.
|
|
24
36
|
* @throws {Error} - Throws an error if the request fails.
|
|
25
37
|
*/
|
|
26
|
-
export
|
|
38
|
+
export const getSharedWithMe = (api, query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
39
|
+
const response = yield api.sendRequest(`/objects/roots/shared?limit=${query.limit}&offset=${query.offset}`, {
|
|
40
|
+
method: 'GET',
|
|
41
|
+
});
|
|
42
|
+
if (!response.ok) {
|
|
43
|
+
throw new Error(`Failed to get shared with me: ${response.statusText}`);
|
|
44
|
+
}
|
|
45
|
+
return response.json();
|
|
46
|
+
});
|
|
27
47
|
/**
|
|
28
48
|
* Retrieves the objects that have been marked as deleted.
|
|
29
49
|
*
|
|
@@ -35,7 +55,15 @@ export declare const getSharedWithMe: (api: AutoDriveApi, query: ArgsWithPaginat
|
|
|
35
55
|
* @returns {Promise<ObjectSummary[]>} - A promise that resolves to an array of ObjectSummary representing the deleted objects.
|
|
36
56
|
* @throws {Error} - Throws an error if the request fails.
|
|
37
57
|
*/
|
|
38
|
-
export
|
|
58
|
+
export const getDeleted = (api, query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
59
|
+
const response = yield api.sendRequest(`/objects/roots/deleted?limit=${query.limit}&offset=${query.offset}`, {
|
|
60
|
+
method: 'GET',
|
|
61
|
+
});
|
|
62
|
+
if (!response.ok) {
|
|
63
|
+
throw new Error(`Failed to get deleted: ${response.statusText}`);
|
|
64
|
+
}
|
|
65
|
+
return response.json();
|
|
66
|
+
});
|
|
39
67
|
/**
|
|
40
68
|
* Retrieves the aggregated information of a specific object identified by its CID.
|
|
41
69
|
*
|
|
@@ -47,9 +75,15 @@ export declare const getDeleted: (api: AutoDriveApi, query: ArgsWithPagination)
|
|
|
47
75
|
* @returns {Promise<ObjectInformation>} - A promise that resolves to the information of the requested object.
|
|
48
76
|
* @throws {Error} - Throws an error if the request fails.
|
|
49
77
|
*/
|
|
50
|
-
export
|
|
51
|
-
cid
|
|
52
|
-
|
|
78
|
+
export const getObject = (api, query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
79
|
+
const response = yield api.sendRequest(`/objects/${query.cid}`, {
|
|
80
|
+
method: 'GET',
|
|
81
|
+
});
|
|
82
|
+
if (!response.ok) {
|
|
83
|
+
throw new Error(`Failed to get object: ${response.statusText}`);
|
|
84
|
+
}
|
|
85
|
+
return response.json();
|
|
86
|
+
});
|
|
53
87
|
/**
|
|
54
88
|
* Retrieves the upload status of a specific object identified by its CID.
|
|
55
89
|
*
|
|
@@ -62,9 +96,15 @@ export declare const getObject: (api: AutoDriveApi, query: ArgsWithoutPagination
|
|
|
62
96
|
* @returns {Promise<ObjectInformation['uploadStatus']>} - A promise that resolves to the upload status of the requested object.
|
|
63
97
|
* @throws {Error} - Throws an error if the request fails.
|
|
64
98
|
*/
|
|
65
|
-
export
|
|
66
|
-
cid
|
|
67
|
-
|
|
99
|
+
export const getObjectUploadStatus = (api, query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
100
|
+
const response = yield api.sendRequest(`/objects/${query.cid}/status`, {
|
|
101
|
+
method: 'GET',
|
|
102
|
+
});
|
|
103
|
+
if (!response.ok) {
|
|
104
|
+
throw new Error(`Failed to get object: ${response.statusText}`);
|
|
105
|
+
}
|
|
106
|
+
return response.json();
|
|
107
|
+
});
|
|
68
108
|
/**
|
|
69
109
|
* Retrieves the owners of a specific object identified by its CID.
|
|
70
110
|
*
|
|
@@ -77,9 +117,15 @@ export declare const getObjectUploadStatus: (api: AutoDriveApi, query: ArgsWitho
|
|
|
77
117
|
* @returns {Promise<ObjectInformation['owners']>} - A promise that resolves to the list of owners of the requested object.
|
|
78
118
|
* @throws {Error} - Throws an error if the request fails.
|
|
79
119
|
*/
|
|
80
|
-
export
|
|
81
|
-
cid
|
|
82
|
-
|
|
120
|
+
export const getObjectOwners = (api, query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
121
|
+
const response = yield api.sendRequest(`/objects/${query.cid}/owners`, {
|
|
122
|
+
method: 'GET',
|
|
123
|
+
});
|
|
124
|
+
if (!response.ok) {
|
|
125
|
+
throw new Error(`Failed to get object: ${response.statusText}`);
|
|
126
|
+
}
|
|
127
|
+
return response.json();
|
|
128
|
+
});
|
|
83
129
|
/**
|
|
84
130
|
* Retrieves the metadata of a specific object identified by its CID.
|
|
85
131
|
*
|
|
@@ -92,6 +138,12 @@ export declare const getObjectOwners: (api: AutoDriveApi, query: ArgsWithoutPagi
|
|
|
92
138
|
* @returns {Promise<ObjectInformation['metadata']>} - A promise that resolves to the metadata of the requested object.
|
|
93
139
|
* @throws {Error} - Throws an error if the request fails.
|
|
94
140
|
*/
|
|
95
|
-
export
|
|
96
|
-
cid
|
|
97
|
-
|
|
141
|
+
export const getObjectMetadata = (api, query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
142
|
+
const response = yield api.sendRequest(`/objects/${query.cid}/metadata`, {
|
|
143
|
+
method: 'GET',
|
|
144
|
+
});
|
|
145
|
+
if (!response.ok) {
|
|
146
|
+
throw new Error(`Failed to get object: ${response.statusText}`);
|
|
147
|
+
}
|
|
148
|
+
return response.json();
|
|
149
|
+
});
|
|
@@ -2,7 +2,7 @@ import { FileUploadOptions } from '@autonomys/auto-dag-data';
|
|
|
2
2
|
import { ArgsWithoutPagination } from '../../utils/types.js';
|
|
3
3
|
import { AutoDriveApi } from '../connection.js';
|
|
4
4
|
import { FolderTree } from '../models/folderTree.js';
|
|
5
|
-
import { FileUpload, FolderUpload } from '../models/uploads.js';
|
|
5
|
+
import { CompleteUploadResponse, FileUpload, FolderUpload } from '../models/uploads.js';
|
|
6
6
|
/**
|
|
7
7
|
* Initiates a file upload to the server.
|
|
8
8
|
*
|
|
@@ -90,4 +90,5 @@ export declare const uploadFileChunk: (api: AutoDriveApi, { uploadId, chunk, ind
|
|
|
90
90
|
*/
|
|
91
91
|
export declare const completeUpload: (api: AutoDriveApi, { uploadId }: ArgsWithoutPagination<{
|
|
92
92
|
uploadId: string;
|
|
93
|
-
}>) => Promise<
|
|
93
|
+
}>) => Promise<CompleteUploadResponse>;
|
|
94
|
+
//# sourceMappingURL=upload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../src/api/calls/upload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEvF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,QACtB,YAAY,0CAKd,qBAAqB,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,EAAE,iBAAiB,GAAG,IAAI,CAAA;CACxC,CAAC,KACD,OAAO,CAAC,UAAU,CAiBpB,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,QACxB,YAAY,gCAId,qBAAqB,CAAC;IAAE,QAAQ,EAAE,UAAU,CAAC;IAAC,aAAa,EAAE,iBAAiB,CAAA;CAAE,CAAC,KACnF,OAAO,CAAC,YAAY,CAiBtB,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,kCAAkC,QACxC,YAAY,4DAOd,qBAAqB,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,iBAAiB,CAAA;CACjC,CAAC,KACD,OAAO,CAAC,UAAU,CAiBpB,CAAA;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,eAAe,QACrB,YAAY,+BAKd,qBAAqB,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,KAC3E,OAAO,CAAC,IAAI,CAgBd,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,cAAc,QACpB,YAAY,gBACH,qBAAqB,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,KACxD,OAAO,CAAC,sBAAsB,CAUhC,CAAA"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
6
10
|
/**
|
|
7
11
|
* Initiates a file upload to the server.
|
|
8
12
|
*
|
|
@@ -14,11 +18,18 @@ import { FileUpload, FolderUpload } from '../models/uploads.js';
|
|
|
14
18
|
* @returns {Promise<FileUpload>} - A promise that resolves to the file upload information.
|
|
15
19
|
* @throws {Error} - Throws an error if the upload fails.
|
|
16
20
|
*/
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
export const createFileUpload = (api_1, _a) => __awaiter(void 0, [api_1, _a], void 0, function* (api, { mimeType, filename, uploadOptions = {}, }) {
|
|
22
|
+
const response = yield api.sendRequest(`/uploads/file`, {
|
|
23
|
+
method: 'POST',
|
|
24
|
+
headers: new Headers({
|
|
25
|
+
'Content-Type': 'application/json',
|
|
26
|
+
}),
|
|
27
|
+
}, JSON.stringify({ mimeType, filename, uploadOptions }));
|
|
28
|
+
if (!response.ok) {
|
|
29
|
+
throw new Error(`Failed to create file upload: ${response.statusText}`);
|
|
30
|
+
}
|
|
31
|
+
return response.json();
|
|
32
|
+
});
|
|
22
33
|
/**
|
|
23
34
|
* Initiates a folder upload to the server.
|
|
24
35
|
*
|
|
@@ -29,10 +40,18 @@ export declare const createFileUpload: (api: AutoDriveApi, { mimeType, filename,
|
|
|
29
40
|
* @returns {Promise<FolderUpload>} - A promise that resolves to the folder upload information.
|
|
30
41
|
* @throws {Error} - Throws an error if the upload fails.
|
|
31
42
|
*/
|
|
32
|
-
export
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
43
|
+
export const createFolderUpload = (api_1, _a) => __awaiter(void 0, [api_1, _a], void 0, function* (api, { fileTree, uploadOptions, }) {
|
|
44
|
+
const response = yield api.sendRequest(`/uploads/folder`, {
|
|
45
|
+
method: 'POST',
|
|
46
|
+
headers: new Headers({
|
|
47
|
+
'Content-Type': 'application/json',
|
|
48
|
+
}),
|
|
49
|
+
}, JSON.stringify({ fileTree, uploadOptions }));
|
|
50
|
+
if (!response.ok) {
|
|
51
|
+
throw new Error(`Failed to create folder upload: ${response.statusText}`);
|
|
52
|
+
}
|
|
53
|
+
return response.json();
|
|
54
|
+
});
|
|
36
55
|
/**
|
|
37
56
|
* Creates a file upload within an existing folder upload.
|
|
38
57
|
*
|
|
@@ -46,13 +65,18 @@ export declare const createFolderUpload: (api: AutoDriveApi, { fileTree, uploadO
|
|
|
46
65
|
* @returns {Promise<FileUpload>} - A promise that resolves to the file upload information.
|
|
47
66
|
* @throws {Error} - Throws an error if the upload fails.
|
|
48
67
|
*/
|
|
49
|
-
export
|
|
50
|
-
uploadId
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
68
|
+
export const createFileUploadWithinFolderUpload = (api_1, _a) => __awaiter(void 0, [api_1, _a], void 0, function* (api, { uploadId, name, mimeType, relativeId, uploadOptions = {}, }) {
|
|
69
|
+
const response = yield api.sendRequest(`/uploads/folder/${uploadId}/file`, {
|
|
70
|
+
method: 'POST',
|
|
71
|
+
headers: new Headers({
|
|
72
|
+
'Content-Type': 'application/json',
|
|
73
|
+
}),
|
|
74
|
+
}, JSON.stringify({ name, mimeType, relativeId, uploadOptions }));
|
|
75
|
+
if (!response.ok) {
|
|
76
|
+
throw new Error(`Failed to create file upload within folder upload: ${response.statusText}`);
|
|
77
|
+
}
|
|
78
|
+
return response.json();
|
|
79
|
+
});
|
|
56
80
|
/**
|
|
57
81
|
* Uploads a chunk of a file to the server.
|
|
58
82
|
*
|
|
@@ -69,11 +93,17 @@ export declare const createFileUploadWithinFolderUpload: (api: AutoDriveApi, { u
|
|
|
69
93
|
* @returns {Promise<void>} - A promise that resolves when the chunk is uploaded successfully.
|
|
70
94
|
* @throws {Error} - Throws an error if the upload fails.
|
|
71
95
|
*/
|
|
72
|
-
export
|
|
73
|
-
|
|
74
|
-
chunk
|
|
75
|
-
index
|
|
76
|
-
}
|
|
96
|
+
export const uploadFileChunk = (api_1, _a) => __awaiter(void 0, [api_1, _a], void 0, function* (api, { uploadId, chunk, index, }) {
|
|
97
|
+
const formData = new FormData();
|
|
98
|
+
formData.append('file', new Blob([chunk]));
|
|
99
|
+
formData.append('index', index.toString());
|
|
100
|
+
const response = yield api.sendRequest(`/uploads/file/${uploadId}/chunk`, {
|
|
101
|
+
method: 'POST',
|
|
102
|
+
}, formData);
|
|
103
|
+
if (!response.ok) {
|
|
104
|
+
throw new Error(`Failed to upload file chunk: ${response.statusText}`);
|
|
105
|
+
}
|
|
106
|
+
});
|
|
77
107
|
/**
|
|
78
108
|
* Completes a file or folder upload session on the server.
|
|
79
109
|
*
|
|
@@ -88,6 +118,12 @@ export declare const uploadFileChunk: (api: AutoDriveApi, { uploadId, chunk, ind
|
|
|
88
118
|
* @returns {Promise<any>} - A promise that resolves to the response from the server.
|
|
89
119
|
* @throws {Error} - Throws an error if the completion of the upload fails.
|
|
90
120
|
*/
|
|
91
|
-
export
|
|
92
|
-
uploadId
|
|
93
|
-
|
|
121
|
+
export const completeUpload = (api_1, _a) => __awaiter(void 0, [api_1, _a], void 0, function* (api, { uploadId }) {
|
|
122
|
+
const response = yield api.sendRequest(`/uploads/${uploadId}/complete`, {
|
|
123
|
+
method: 'POST',
|
|
124
|
+
});
|
|
125
|
+
if (!response.ok) {
|
|
126
|
+
throw new Error(`Failed to complete upload: ${response.statusText}`);
|
|
127
|
+
}
|
|
128
|
+
return response.json();
|
|
129
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../../../src/api/calls/write.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE/C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW,QACjB,YAAY,SACV,qBAAqB,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,iBAkBhE,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,QACzB,YAAY,SACV,qBAAqB,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,KAC5C,OAAO,CAAC,IAAI,CAQd,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,QACnB,YAAY,SACV,qBAAqB,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,KAC5C,OAAO,CAAC,IAAI,CAUd,CAAA"}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
3
10
|
/**
|
|
4
11
|
* Shares an object with a specified public ID.
|
|
5
12
|
*
|
|
@@ -12,10 +19,18 @@ import { AutoDriveApi } from '../connection.js';
|
|
|
12
19
|
* @returns {Promise<any>} - A promise that resolves to the response from the server.
|
|
13
20
|
* @throws {Error} - Throws an error if the sharing process fails.
|
|
14
21
|
*/
|
|
15
|
-
export
|
|
16
|
-
cid
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
export const shareObject = (api, query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
+
const response = yield api.sendRequest(`/objects/${query.cid}/share`, {
|
|
24
|
+
method: 'POST',
|
|
25
|
+
headers: new Headers({
|
|
26
|
+
'Content-Type': 'application/json',
|
|
27
|
+
}),
|
|
28
|
+
}, JSON.stringify({ publicId: query.publicId }));
|
|
29
|
+
if (!response.ok) {
|
|
30
|
+
throw new Error(`Failed to share object: ${response.statusText}`);
|
|
31
|
+
}
|
|
32
|
+
return response.json();
|
|
33
|
+
});
|
|
19
34
|
/**
|
|
20
35
|
* Marks an object as deleted by sending a request to the server.
|
|
21
36
|
*
|
|
@@ -28,9 +43,14 @@ export declare const shareObject: (api: AutoDriveApi, query: ArgsWithoutPaginati
|
|
|
28
43
|
* @returns {Promise<void>} - A promise that resolves when the object has been marked as deleted.
|
|
29
44
|
* @throws {Error} - Throws an error if the marking process fails.
|
|
30
45
|
*/
|
|
31
|
-
export
|
|
32
|
-
cid
|
|
33
|
-
|
|
46
|
+
export const markObjectAsDeleted = (api, query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
47
|
+
const response = yield api.sendRequest(`/objects/${query.cid}/delete`, {
|
|
48
|
+
method: 'POST',
|
|
49
|
+
});
|
|
50
|
+
if (!response.ok) {
|
|
51
|
+
throw new Error(`Failed to mark object as deleted: ${response.statusText}`);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
34
54
|
/**
|
|
35
55
|
* Restores an object that has been marked as deleted by sending a request to the server.
|
|
36
56
|
*
|
|
@@ -43,6 +63,12 @@ export declare const markObjectAsDeleted: (api: AutoDriveApi, query: ArgsWithout
|
|
|
43
63
|
* @returns {Promise<void>} - A promise that resolves when the object has been successfully restored.
|
|
44
64
|
* @throws {Error} - Throws an error if the restoration process fails.
|
|
45
65
|
*/
|
|
46
|
-
export
|
|
47
|
-
cid
|
|
48
|
-
|
|
66
|
+
export const restoreObject = (api, query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
67
|
+
const response = yield api.sendRequest(`/objects/${query.cid}/restore`, {
|
|
68
|
+
method: 'POST',
|
|
69
|
+
});
|
|
70
|
+
if (!response.ok) {
|
|
71
|
+
throw new Error(`Failed to restore object: ${response.statusText}`);
|
|
72
|
+
}
|
|
73
|
+
return response.json();
|
|
74
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface AutoDriveApi {
|
|
2
|
+
sendRequest: (relativeUrl: string, request: Partial<Request>, body?: BodyInit) => Promise<Response>;
|
|
3
|
+
}
|
|
4
|
+
export declare enum OAuthProvider {
|
|
5
|
+
GOOGLE = "google",
|
|
6
|
+
DISCORD = "discord"
|
|
7
|
+
}
|
|
8
|
+
export type ApiKeyAuthProvider = 'apikey';
|
|
9
|
+
export type AuthProvider = ApiKeyAuthProvider | 'oauth';
|
|
10
|
+
export declare const createAutoDriveApi: ({ provider, apiKey, url, }: {
|
|
11
|
+
provider: AuthProvider;
|
|
12
|
+
apiKey: string;
|
|
13
|
+
url?: string;
|
|
14
|
+
}) => AutoDriveApi;
|
|
15
|
+
//# sourceMappingURL=connection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../src/api/connection.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,CACX,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,EACzB,IAAI,CAAC,EAAE,QAAQ,KACZ,OAAO,CAAC,QAAQ,CAAC,CAAA;CACvB;AAED,oBAAY,aAAa;IACvB,MAAM,WAAW;IACjB,OAAO,YAAY;CACpB;AAED,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAA;AACzC,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,OAAO,CAAA;AAEvD,eAAO,MAAM,kBAAkB,+BAI5B;IACD,QAAQ,EAAE,YAAY,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,KAAG,YAiBH,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
export var OAuthProvider;
|
|
11
|
+
(function (OAuthProvider) {
|
|
12
|
+
OAuthProvider["GOOGLE"] = "google";
|
|
13
|
+
OAuthProvider["DISCORD"] = "discord";
|
|
14
|
+
})(OAuthProvider || (OAuthProvider = {}));
|
|
15
|
+
export const createAutoDriveApi = ({ provider = 'apikey', apiKey, url = 'https://demo.auto-drive.autonomys.xyz', }) => {
|
|
16
|
+
return {
|
|
17
|
+
sendRequest: (relativeUrl, request, body) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
+
var _a;
|
|
19
|
+
const headers = new Headers(Object.assign(Object.assign({}, Object.fromEntries(((_a = request.headers) === null || _a === void 0 ? void 0 : _a.entries()) || [])), { 'x-auth-provider': provider, Authorization: `Bearer ${apiKey}` }));
|
|
20
|
+
const fullRequest = Object.assign(Object.assign({}, request), { headers: new Headers(headers), body });
|
|
21
|
+
return fetch(`${url}${relativeUrl}`, fullRequest);
|
|
22
|
+
}),
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,eAAe,CAAA"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export type FolderTreeFolder = {
|
|
3
|
+
name: string;
|
|
4
|
+
type: 'folder';
|
|
5
|
+
children: FolderTree[];
|
|
6
|
+
id: string;
|
|
7
|
+
};
|
|
8
|
+
export type FolderTreeFile = {
|
|
9
|
+
name: string;
|
|
10
|
+
type: 'file';
|
|
11
|
+
id: string;
|
|
12
|
+
};
|
|
13
|
+
export type FolderTree = FolderTreeFolder | FolderTreeFile;
|
|
14
|
+
export declare const FolderTreeFolderSchema: z.ZodObject<{
|
|
15
|
+
name: z.ZodString;
|
|
16
|
+
type: z.ZodLiteral<"folder">;
|
|
17
|
+
children: z.ZodArray<z.ZodLazy<z.ZodType<FolderTree, z.ZodTypeDef, FolderTree>>, "many">;
|
|
18
|
+
id: z.ZodString;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
children: FolderTree[];
|
|
21
|
+
name: string;
|
|
22
|
+
type: "folder";
|
|
23
|
+
id: string;
|
|
24
|
+
}, {
|
|
25
|
+
children: FolderTree[];
|
|
26
|
+
name: string;
|
|
27
|
+
type: "folder";
|
|
28
|
+
id: string;
|
|
29
|
+
}>;
|
|
30
|
+
export declare const FolderTreeFileSchema: z.ZodObject<{
|
|
31
|
+
name: z.ZodString;
|
|
32
|
+
type: z.ZodLiteral<"file">;
|
|
33
|
+
id: z.ZodString;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
name: string;
|
|
36
|
+
type: "file";
|
|
37
|
+
id: string;
|
|
38
|
+
}, {
|
|
39
|
+
name: string;
|
|
40
|
+
type: "file";
|
|
41
|
+
id: string;
|
|
42
|
+
}>;
|
|
43
|
+
export declare const FolderTreeSchema: z.ZodType<FolderTree>;
|
|
44
|
+
export declare const constructFromFileSystemEntries: (entries: string[]) => FolderTree;
|
|
45
|
+
//# sourceMappingURL=folderTree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"folderTree.d.ts","sourceRoot":"","sources":["../../../src/api/models/folderTree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,QAAQ,CAAA;IACd,QAAQ,EAAE,UAAU,EAAE,CAAA;IACtB,EAAE,EAAE,MAAM,CAAA;CACX,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;CACX,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,gBAAgB,GAAG,cAAc,CAAA;AAE1D,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;EAKjC,CAAA;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;EAI/B,CAAA;AAEF,eAAO,MAAM,gBAAgB,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAGjD,CAAA;AAEF,eAAO,MAAM,8BAA8B,YAAa,MAAM,EAAE,KAAG,UA0ClE,CAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const FolderTreeFolderSchema = z.object({
|
|
3
|
+
name: z.string(),
|
|
4
|
+
type: z.literal('folder'),
|
|
5
|
+
children: z.array(z.lazy(() => FolderTreeSchema)),
|
|
6
|
+
id: z.string(),
|
|
7
|
+
});
|
|
8
|
+
export const FolderTreeFileSchema = z.object({
|
|
9
|
+
name: z.string(),
|
|
10
|
+
type: z.literal('file'),
|
|
11
|
+
id: z.string(),
|
|
12
|
+
});
|
|
13
|
+
export const FolderTreeSchema = z.discriminatedUnion('type', [
|
|
14
|
+
FolderTreeFolderSchema,
|
|
15
|
+
FolderTreeFileSchema,
|
|
16
|
+
]);
|
|
17
|
+
export const constructFromFileSystemEntries = (entries) => {
|
|
18
|
+
const root = {
|
|
19
|
+
name: 'root',
|
|
20
|
+
type: 'folder',
|
|
21
|
+
children: [],
|
|
22
|
+
id: 'root',
|
|
23
|
+
};
|
|
24
|
+
for (const entry of entries) {
|
|
25
|
+
const pathParts = entry.split('/').filter(Boolean);
|
|
26
|
+
let currentFolder = root;
|
|
27
|
+
for (const [index, part] of Array.from(pathParts.entries())) {
|
|
28
|
+
// Check if the part already exists in the current folder's children
|
|
29
|
+
let existingFolder = currentFolder.children.find((child) => child.name === part);
|
|
30
|
+
if (!existingFolder) {
|
|
31
|
+
// If it's the last part, create a file node
|
|
32
|
+
if (index === pathParts.length - 1) {
|
|
33
|
+
const fileNode = {
|
|
34
|
+
name: part,
|
|
35
|
+
type: 'file',
|
|
36
|
+
id: entry,
|
|
37
|
+
};
|
|
38
|
+
currentFolder.children.push(fileNode);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
// Create a new folder node
|
|
42
|
+
const folderNode = {
|
|
43
|
+
name: part,
|
|
44
|
+
type: 'folder',
|
|
45
|
+
children: [],
|
|
46
|
+
id: `${currentFolder.id.split('/').slice(1).join('/')}/${part}`,
|
|
47
|
+
};
|
|
48
|
+
currentFolder.children.push(folderNode);
|
|
49
|
+
existingFolder = folderNode;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
currentFolder = existingFolder; // Move to the next folder
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return root.children.length === 1 ? root.children[0] : root;
|
|
56
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"objects.d.ts","sourceRoot":"","sources":["../../../src/api/models/objects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAE3D,oBAAY,KAAK;IACf,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED,MAAM,WAAW,KAAK;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,SAAS,CAAA;CAChB;AAED,oBAAY,SAAS;IACnB,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;CACjC;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,YAAY,EAAE,kBAAkB,CAAA;CACjC,GAAG,CACA;IACE,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,GACD;IACE,IAAI,EAAE,QAAQ,CAAA;IACd,QAAQ,EAAE,CAAC,gBAAgB,GAAG;QAAE,IAAI,EAAE,QAAQ,CAAA;KAAE,CAAC,CAAC,UAAU,CAAC,CAAA;CAC9D,CACJ,CAAA;AAED,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAA;IACX,QAAQ,EAAE,gBAAgB,CAAA;IAC1B,YAAY,EAAE,kBAAkB,CAAA;IAChC,MAAM,EAAE,KAAK,EAAE,CAAA;CAChB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export var Scope;
|
|
2
|
+
(function (Scope) {
|
|
3
|
+
Scope["Global"] = "global";
|
|
4
|
+
Scope["User"] = "user";
|
|
5
|
+
})(Scope || (Scope = {}));
|
|
6
|
+
export var OwnerRole;
|
|
7
|
+
(function (OwnerRole) {
|
|
8
|
+
OwnerRole["ADMIN"] = "admin";
|
|
9
|
+
OwnerRole["VIEWER"] = "viewer";
|
|
10
|
+
})(OwnerRole || (OwnerRole = {}));
|