@wireapp/api-client 27.83.0 → 27.85.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/lib/APIClient.js +1 -1
- package/lib/asset/AssetAPI.d.ts +17 -17
- package/lib/asset/AssetAPI.d.ts.map +1 -1
- package/lib/asset/AssetAPI.js +15 -113
- package/lib/asset/AssetAPI.schema.d.ts +27 -0
- package/lib/asset/AssetAPI.schema.d.ts.map +1 -0
- package/lib/asset/{AssetUploadData.js → AssetAPI.schema.js} +16 -0
- package/lib/asset/index.d.ts +1 -1
- package/lib/asset/index.d.ts.map +1 -1
- package/lib/asset/index.js +0 -1
- package/lib/services/ServicesAPI.d.ts +6 -1
- package/lib/services/ServicesAPI.d.ts.map +1 -1
- package/lib/userGroups/UserGroup.d.ts +1 -0
- package/lib/userGroups/UserGroup.d.ts.map +1 -1
- package/package.json +2 -2
- package/lib/asset/AssetUploadData.d.ts +0 -8
- package/lib/asset/AssetUploadData.d.ts.map +0 -1
package/lib/APIClient.js
CHANGED
|
@@ -103,7 +103,7 @@ class APIClient extends events_1.EventEmitter {
|
|
|
103
103
|
}
|
|
104
104
|
configureApis(backendFeatures) {
|
|
105
105
|
this.logger.info('configuring APIs with config', backendFeatures);
|
|
106
|
-
const assetAPI = new asset_1.AssetAPI(this.transport.http
|
|
106
|
+
const assetAPI = new asset_1.AssetAPI(this.transport.http);
|
|
107
107
|
// Prevents the CellsAPI from being initialized multiple times
|
|
108
108
|
if (!this.cellsApi) {
|
|
109
109
|
this.cellsApi = new CellsAPI_1.CellsAPI({
|
package/lib/asset/AssetAPI.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { AssetRetentionPolicy } from './AssetRetentionPolicy';
|
|
2
|
-
import { AssetUploadData } from './AssetUploadData';
|
|
3
|
-
import { BackendFeatures } from '../APIClient';
|
|
4
2
|
import { HttpClient, ProgressCallback, RequestCancelable } from '../http/';
|
|
5
3
|
import { QualifiedId } from '../user';
|
|
6
4
|
export interface CipherOptions {
|
|
@@ -10,7 +8,7 @@ export interface CipherOptions {
|
|
|
10
8
|
hash?: Buffer;
|
|
11
9
|
}
|
|
12
10
|
export interface AssetAuditData {
|
|
13
|
-
|
|
11
|
+
conversationId: QualifiedId;
|
|
14
12
|
filename: string;
|
|
15
13
|
filetype: string;
|
|
16
14
|
}
|
|
@@ -19,6 +17,7 @@ export interface AssetOptions extends CipherOptions {
|
|
|
19
17
|
retention?: AssetRetentionPolicy;
|
|
20
18
|
/** If given, will upload an asset that can be shared in a federated env */
|
|
21
19
|
domain?: string;
|
|
20
|
+
/** Used for identifying the conversation the asset belongs to */
|
|
22
21
|
auditData?: AssetAuditData;
|
|
23
22
|
}
|
|
24
23
|
export interface AssetResponse {
|
|
@@ -27,20 +26,11 @@ export interface AssetResponse {
|
|
|
27
26
|
}
|
|
28
27
|
export declare class AssetAPI {
|
|
29
28
|
private readonly client;
|
|
30
|
-
private readonly
|
|
31
|
-
constructor(client: HttpClient
|
|
29
|
+
private readonly logger;
|
|
30
|
+
constructor(client: HttpClient);
|
|
32
31
|
private getAssetShared;
|
|
33
32
|
private postAssetShared;
|
|
34
|
-
|
|
35
|
-
cancel: () => void;
|
|
36
|
-
response: Promise<AssetResponse>;
|
|
37
|
-
};
|
|
38
|
-
getAssetV2(assetId: string, conversationId: string, forceCaching?: boolean, progressCallback?: ProgressCallback): {
|
|
39
|
-
cancel: () => void;
|
|
40
|
-
response: Promise<AssetResponse>;
|
|
41
|
-
};
|
|
42
|
-
getAssetV3(assetId: string, token?: string | null, forceCaching?: boolean, progressCallback?: ProgressCallback): RequestCancelable<AssetResponse>;
|
|
43
|
-
getAssetV4(assetId: string, assetDomain: string, token?: string | null, forceCaching?: boolean, progressCallback?: ProgressCallback): RequestCancelable<AssetResponse>;
|
|
33
|
+
getAsset(assetId: string, assetDomain: string, token?: string | null, forceCaching?: boolean, progressCallback?: ProgressCallback): RequestCancelable<AssetResponse>;
|
|
44
34
|
getServiceAsset(assetId: string, token?: string | null, forceCaching?: boolean, progressCallback?: ProgressCallback): RequestCancelable<AssetResponse>;
|
|
45
35
|
/**
|
|
46
36
|
* Uploads an asset to the backend
|
|
@@ -49,7 +39,17 @@ export declare class AssetAPI {
|
|
|
49
39
|
* @param options?
|
|
50
40
|
* @param progressCallback? Will be called at every progress of the upload
|
|
51
41
|
*/
|
|
52
|
-
postAsset(asset: Uint8Array, options?: AssetOptions, progressCallback?: ProgressCallback): RequestCancelable<
|
|
53
|
-
|
|
42
|
+
postAsset(asset: Uint8Array, options?: AssetOptions, progressCallback?: ProgressCallback): RequestCancelable<{
|
|
43
|
+
key: string;
|
|
44
|
+
token: string;
|
|
45
|
+
expires: string;
|
|
46
|
+
domain?: string | undefined;
|
|
47
|
+
}>;
|
|
48
|
+
postServiceAsset(asset: Uint8Array, options?: AssetOptions, progressCallback?: ProgressCallback): RequestCancelable<{
|
|
49
|
+
key: string;
|
|
50
|
+
token: string;
|
|
51
|
+
expires: string;
|
|
52
|
+
domain?: string | undefined;
|
|
53
|
+
}>;
|
|
54
54
|
}
|
|
55
55
|
//# sourceMappingURL=AssetAPI.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetAPI.d.ts","sourceRoot":"","sources":["../../src/asset/AssetAPI.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AssetAPI.d.ts","sourceRoot":"","sources":["../../src/asset/AssetAPI.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAG5D,OAAO,EAGL,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EAElB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAC,WAAW,EAA2B,MAAM,SAAS,CAAC;AAE9D,MAAM,WAAW,aAAa;IAC5B,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;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this.__importDefault) || function (mod) {
|
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
24
|
exports.AssetAPI = void 0;
|
|
25
25
|
const axios_1 = __importDefault(require("axios"));
|
|
26
|
+
const commons_1 = require("@wireapp/commons");
|
|
27
|
+
const AssetAPI_schema_1 = require("./AssetAPI.schema");
|
|
26
28
|
const AssetRetentionPolicy_1 = require("./AssetRetentionPolicy");
|
|
27
29
|
const AssetUtil_1 = require("./AssetUtil");
|
|
28
30
|
const http_1 = require("../http/");
|
|
29
31
|
const buffer_1 = require("../shims/node/buffer");
|
|
30
32
|
const random_1 = require("../shims/node/random");
|
|
31
33
|
const user_1 = require("../user");
|
|
32
|
-
const ASSET_URLS = {
|
|
33
|
-
ASSET_V3_URL: '/assets/v3',
|
|
34
|
-
ASSET_V4_URL: '/assets/v4',
|
|
35
|
-
ASSET_SERVICE_URL: '/bot/assets',
|
|
36
|
-
ASSET_V2_URL: '/otr/assets',
|
|
37
|
-
ASSET_V2_CONVERSATION_URL: '/conversations',
|
|
38
|
-
ASSET_V1_URL: '/assets',
|
|
39
|
-
ASSETS_URL: '/assets',
|
|
40
|
-
};
|
|
41
34
|
class AssetAPI {
|
|
42
35
|
client;
|
|
43
|
-
|
|
44
|
-
constructor(client
|
|
36
|
+
logger;
|
|
37
|
+
constructor(client) {
|
|
45
38
|
this.client = client;
|
|
46
|
-
this.
|
|
39
|
+
this.logger = commons_1.LogFactory.getLogger('@wireapp/api-client/AssetAPI');
|
|
47
40
|
}
|
|
48
41
|
getAssetShared(assetUrl, token, forceCaching = false, progressCallback) {
|
|
49
42
|
if (token && !(0, AssetUtil_1.isValidToken)(token)) {
|
|
@@ -93,7 +86,7 @@ class AssetAPI {
|
|
|
93
86
|
domain: options?.domain,
|
|
94
87
|
};
|
|
95
88
|
if (options?.auditData) {
|
|
96
|
-
metadataObject.convId = options.auditData.
|
|
89
|
+
metadataObject.convId = options.auditData.conversationId;
|
|
97
90
|
metadataObject.filename = options.auditData.filename;
|
|
98
91
|
metadataObject.filetype = options.auditData.filetype;
|
|
99
92
|
}
|
|
@@ -124,6 +117,10 @@ class AssetAPI {
|
|
|
124
117
|
const handleRequest = async () => {
|
|
125
118
|
try {
|
|
126
119
|
const response = await this.client.sendRequest(config);
|
|
120
|
+
const validation = AssetAPI_schema_1.PostAssetsResponseSchema.safeParse(response.data);
|
|
121
|
+
if (!validation.success) {
|
|
122
|
+
this.logger.warn('Asset upload response validation failed:', validation.error);
|
|
123
|
+
}
|
|
127
124
|
return response.data;
|
|
128
125
|
}
|
|
129
126
|
catch (error) {
|
|
@@ -138,99 +135,7 @@ class AssetAPI {
|
|
|
138
135
|
response: handleRequest(),
|
|
139
136
|
};
|
|
140
137
|
}
|
|
141
|
-
|
|
142
|
-
if (!(0, AssetUtil_1.isValidUUID)(assetId)) {
|
|
143
|
-
throw new TypeError(`Expected asset ID "${assetId}" to only contain alphanumeric values and dashes.`);
|
|
144
|
-
}
|
|
145
|
-
if (!(0, AssetUtil_1.isValidUUID)(conversationId)) {
|
|
146
|
-
throw new TypeError(`Expected conversation ID "${conversationId}" to only contain alphanumeric values and dashes.`);
|
|
147
|
-
}
|
|
148
|
-
const cancelSource = axios_1.default.CancelToken.source();
|
|
149
|
-
const config = {
|
|
150
|
-
cancelToken: cancelSource.token,
|
|
151
|
-
method: 'get',
|
|
152
|
-
onDownloadProgress: (0, http_1.handleProgressEvent)(progressCallback),
|
|
153
|
-
onUploadProgress: (0, http_1.handleProgressEvent)(progressCallback),
|
|
154
|
-
params: {
|
|
155
|
-
conv_id: conversationId,
|
|
156
|
-
},
|
|
157
|
-
responseType: 'arraybuffer',
|
|
158
|
-
url: `${ASSET_URLS.ASSET_V1_URL}/${assetId}`,
|
|
159
|
-
};
|
|
160
|
-
if (forceCaching) {
|
|
161
|
-
config.params.forceCaching = forceCaching;
|
|
162
|
-
}
|
|
163
|
-
const handleRequest = async () => {
|
|
164
|
-
try {
|
|
165
|
-
const response = await this.client.sendRequest(config);
|
|
166
|
-
return {
|
|
167
|
-
buffer: response.data,
|
|
168
|
-
mimeType: response.headers['content-type'],
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
catch (error) {
|
|
172
|
-
if (error.message === http_1.SyntheticErrorLabel.REQUEST_CANCELLED) {
|
|
173
|
-
throw new user_1.RequestCancellationError('Asset download got cancelled.');
|
|
174
|
-
}
|
|
175
|
-
throw error;
|
|
176
|
-
}
|
|
177
|
-
};
|
|
178
|
-
return {
|
|
179
|
-
cancel: () => cancelSource.cancel(http_1.SyntheticErrorLabel.REQUEST_CANCELLED),
|
|
180
|
-
response: handleRequest(),
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
getAssetV2(assetId, conversationId, forceCaching = false, progressCallback) {
|
|
184
|
-
if (!(0, AssetUtil_1.isValidUUID)(assetId)) {
|
|
185
|
-
throw new TypeError(`Expected asset ID "${assetId}" to only contain alphanumeric values and dashes.`);
|
|
186
|
-
}
|
|
187
|
-
if (!(0, AssetUtil_1.isValidUUID)(conversationId)) {
|
|
188
|
-
throw new TypeError(`Expected conversation ID "${conversationId}" to only contain alphanumeric values and dashes.`);
|
|
189
|
-
}
|
|
190
|
-
const cancelSource = axios_1.default.CancelToken.source();
|
|
191
|
-
const config = {
|
|
192
|
-
cancelToken: cancelSource.token,
|
|
193
|
-
method: 'get',
|
|
194
|
-
onDownloadProgress: (0, http_1.handleProgressEvent)(progressCallback),
|
|
195
|
-
onUploadProgress: (0, http_1.handleProgressEvent)(progressCallback),
|
|
196
|
-
params: {},
|
|
197
|
-
responseType: 'arraybuffer',
|
|
198
|
-
url: `${ASSET_URLS.ASSET_V2_CONVERSATION_URL}/${conversationId}${ASSET_URLS.ASSET_V2_URL}/${assetId}`,
|
|
199
|
-
};
|
|
200
|
-
if (forceCaching) {
|
|
201
|
-
config.params.forceCaching = forceCaching;
|
|
202
|
-
}
|
|
203
|
-
const handleRequest = async () => {
|
|
204
|
-
try {
|
|
205
|
-
const response = await this.client.sendRequest(config);
|
|
206
|
-
return {
|
|
207
|
-
buffer: response.data,
|
|
208
|
-
mimeType: response.headers['content-type'],
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
catch (error) {
|
|
212
|
-
if (error.message === http_1.SyntheticErrorLabel.REQUEST_CANCELLED) {
|
|
213
|
-
throw new user_1.RequestCancellationError('Asset download got cancelled.');
|
|
214
|
-
}
|
|
215
|
-
throw error;
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
return {
|
|
219
|
-
cancel: () => cancelSource.cancel(http_1.SyntheticErrorLabel.REQUEST_CANCELLED),
|
|
220
|
-
response: handleRequest(),
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
getAssetV3(assetId, token, forceCaching = false, progressCallback) {
|
|
224
|
-
const version2 = 2;
|
|
225
|
-
if (!(0, AssetUtil_1.isValidUUID)(assetId)) {
|
|
226
|
-
throw new TypeError(`Expected asset ID "${assetId}" to only contain alphanumeric values and dashes.`);
|
|
227
|
-
}
|
|
228
|
-
if (this.backendFeatures.version >= version2) {
|
|
229
|
-
throw new TypeError('Asset v3 is not supported on backend version 2 or higher.');
|
|
230
|
-
}
|
|
231
|
-
return this.getAssetShared(`${ASSET_URLS.ASSET_V3_URL}/${assetId}`, token, forceCaching, progressCallback);
|
|
232
|
-
}
|
|
233
|
-
getAssetV4(assetId, assetDomain, token, forceCaching = false, progressCallback) {
|
|
138
|
+
getAsset(assetId, assetDomain, token, forceCaching = false, progressCallback) {
|
|
234
139
|
if (!(0, AssetUtil_1.isValidUUID)(assetId)) {
|
|
235
140
|
throw new TypeError(`Expected asset ID "${assetId}" to only contain alphanumeric values and dashes.`);
|
|
236
141
|
}
|
|
@@ -238,14 +143,13 @@ class AssetAPI {
|
|
|
238
143
|
if (!isValidDomain(assetDomain)) {
|
|
239
144
|
throw new TypeError(`Invalid asset domain ${assetDomain}`);
|
|
240
145
|
}
|
|
241
|
-
|
|
242
|
-
return this.getAssetShared(`${assetBaseUrl}/${assetDomain}/${assetId}`, token, forceCaching, progressCallback);
|
|
146
|
+
return this.getAssetShared(`/assets/${assetDomain}/${assetId}`, token, forceCaching, progressCallback);
|
|
243
147
|
}
|
|
244
148
|
getServiceAsset(assetId, token, forceCaching = false, progressCallback) {
|
|
245
149
|
if (!(0, AssetUtil_1.isValidUUID)(assetId)) {
|
|
246
150
|
throw new TypeError(`Expected asset ID "${assetId}" to only contain alphanumeric values and dashes.`);
|
|
247
151
|
}
|
|
248
|
-
const assetBaseUrl =
|
|
152
|
+
const assetBaseUrl = `/bot/assets/${assetId}`;
|
|
249
153
|
return this.getAssetShared(assetBaseUrl, token, forceCaching, progressCallback);
|
|
250
154
|
}
|
|
251
155
|
/**
|
|
@@ -256,12 +160,10 @@ class AssetAPI {
|
|
|
256
160
|
* @param progressCallback? Will be called at every progress of the upload
|
|
257
161
|
*/
|
|
258
162
|
postAsset(asset, options, progressCallback) {
|
|
259
|
-
|
|
260
|
-
return this.postAssetShared(baseUrl, asset, options, progressCallback);
|
|
163
|
+
return this.postAssetShared('/assets', asset, options, progressCallback);
|
|
261
164
|
}
|
|
262
165
|
postServiceAsset(asset, options, progressCallback) {
|
|
263
|
-
|
|
264
|
-
return this.postAssetShared(assetBaseUrl, asset, options, progressCallback);
|
|
166
|
+
return this.postAssetShared('/bot/assets', asset, options, progressCallback);
|
|
265
167
|
}
|
|
266
168
|
}
|
|
267
169
|
exports.AssetAPI = AssetAPI;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Zod schema for validating POST /assets response (201 Created)
|
|
4
|
+
* Based on backend API specification
|
|
5
|
+
*/
|
|
6
|
+
export declare const PostAssetsResponseSchema: z.ZodObject<{
|
|
7
|
+
/** Asset domain (example.com) */
|
|
8
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
9
|
+
/** ISO 8601 formatted expiration date */
|
|
10
|
+
expires: z.ZodString;
|
|
11
|
+
/** Asset key (e.g., "3-1-47de4580-ae51-4650-acbb-d10c028cb0ac") */
|
|
12
|
+
key: z.ZodString;
|
|
13
|
+
/** Base64 encoded token (e.g., "aGVsbG8") */
|
|
14
|
+
token: z.ZodString;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
key: string;
|
|
17
|
+
token: string;
|
|
18
|
+
expires: string;
|
|
19
|
+
domain?: string | undefined;
|
|
20
|
+
}, {
|
|
21
|
+
key: string;
|
|
22
|
+
token: string;
|
|
23
|
+
expires: string;
|
|
24
|
+
domain?: string | undefined;
|
|
25
|
+
}>;
|
|
26
|
+
export type AssetUploadData = z.infer<typeof PostAssetsResponseSchema>;
|
|
27
|
+
//# sourceMappingURL=AssetAPI.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssetAPI.schema.d.ts","sourceRoot":"","sources":["../../src/asset/AssetAPI.schema.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB;;;GAGG;AACH,eAAO,MAAM,wBAAwB;IACnC,iCAAiC;;IAEjC,yCAAyC;;IAEzC,mEAAmE;;IAEnE,6CAA6C;;;;;;;;;;;;EAE7C,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
|
@@ -18,3 +18,19 @@
|
|
|
18
18
|
*
|
|
19
19
|
*/
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.PostAssetsResponseSchema = void 0;
|
|
22
|
+
const zod_1 = require("zod");
|
|
23
|
+
/**
|
|
24
|
+
* Zod schema for validating POST /assets response (201 Created)
|
|
25
|
+
* Based on backend API specification
|
|
26
|
+
*/
|
|
27
|
+
exports.PostAssetsResponseSchema = zod_1.z.object({
|
|
28
|
+
/** Asset domain (example.com) */
|
|
29
|
+
domain: zod_1.z.string().optional(),
|
|
30
|
+
/** ISO 8601 formatted expiration date */
|
|
31
|
+
expires: zod_1.z.string().datetime(),
|
|
32
|
+
/** Asset key (e.g., "3-1-47de4580-ae51-4650-acbb-d10c028cb0ac") */
|
|
33
|
+
key: zod_1.z.string().min(1),
|
|
34
|
+
/** Base64 encoded token (e.g., "aGVsbG8") */
|
|
35
|
+
token: zod_1.z.string().min(1),
|
|
36
|
+
});
|
package/lib/asset/index.d.ts
CHANGED
package/lib/asset/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/asset/index.ts"],"names":[],"mappings":"AAmBA,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/asset/index.ts"],"names":[],"mappings":"AAmBA,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,cAAc,aAAa,CAAC"}
|
package/lib/asset/index.js
CHANGED
|
@@ -34,5 +34,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
35
|
__exportStar(require("./AssetAPI"), exports);
|
|
36
36
|
__exportStar(require("./AssetRetentionPolicy"), exports);
|
|
37
|
-
__exportStar(require("./AssetUploadData"), exports);
|
|
38
37
|
__exportStar(require("./AssetUtil"), exports);
|
|
@@ -63,7 +63,12 @@ export declare class ServicesAPI {
|
|
|
63
63
|
* Upload an asset.
|
|
64
64
|
* Note that resumable uploads are not currently supported for services.
|
|
65
65
|
*/
|
|
66
|
-
postAsset(asset: Uint8Array, options?: AssetOptions, progressCallback?: ProgressCallback): import("../http").RequestCancelable<
|
|
66
|
+
postAsset(asset: Uint8Array, options?: AssetOptions, progressCallback?: ProgressCallback): import("../http").RequestCancelable<{
|
|
67
|
+
key: string;
|
|
68
|
+
token: string;
|
|
69
|
+
expires: string;
|
|
70
|
+
domain?: string | undefined;
|
|
71
|
+
}>;
|
|
67
72
|
/**
|
|
68
73
|
* Download an asset.
|
|
69
74
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServicesAPI.d.ts","sourceRoot":"","sources":["../../src/services/ServicesAPI.ts"],"names":[],"mappings":"AAqBA,OAAO,EACL,MAAM,EACN,IAAI,EACJ,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACf,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAC,YAAY,EAAE,QAAQ,EAAC,MAAM,UAAU,CAAC;AAChD,OAAO,EAAC,MAAM,EAAC,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAC,UAAU,EAAE,gBAAgB,EAAC,MAAM,SAAS,CAAC;AAErD,qBAAa,WAAW;IAEpB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBADR,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,QAAQ;IAGrC,gBAAuB,GAAG;;;;;;;;;;MAUxB;IAEF;;;;OAIG;IACU,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IASxC;;OAEG;IACU,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;IAUzC;;OAEG;IACU,gBAAgB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAUlD;;OAEG;IACU,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAU/E;;OAEG;IACU,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAU5E;;OAEG;IACU,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAUrC;;;;;;OAMG;IACU,mBAAmB,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAW7F;;OAEG;IACU,QAAQ,CAAC,GAAG,EAA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CAAC;IAUrC;;;;;;OAMG;IACU,mBAAmB,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAW7F;;OAEG;IACU,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAalE;;OAEG;IACU,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAUhE;;;OAGG;IACI,SAAS,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,YAAY,EAAE,gBAAgB,CAAC,EAAE,gBAAgB;;;;;;IAI/F;;OAEG;IACI,QAAQ,CACb,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,EACrB,YAAY,GAAE,OAAe,EAC7B,gBAAgB,CAAC,EAAE,gBAAgB;IAKrC;;OAEG;IACU,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IASxD;;OAEG;IACU,WAAW,CAAC,WAAW,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CASrE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserGroup.d.ts","sourceRoot":"","sources":["../../src/userGroups/UserGroup.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAExD,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,kBAAkB,CAAC;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd"}
|
|
1
|
+
{"version":3,"file":"UserGroup.d.ts","sourceRoot":"","sources":["../../src/userGroups/UserGroup.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAExD,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,kBAAkB,CAAC;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;CACd"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AssetUploadData.d.ts","sourceRoot":"","sources":["../../src/asset/AssetUploadData.ts"],"names":[],"mappings":"AAmBA,MAAM,WAAW,eAAe;IAC9B,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf"}
|