importer-storage 1.0.25 → 1.0.27
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/index.cjs +14 -4
- package/dist/index.d.cts +9 -4
- package/dist/index.d.ts +9 -4
- package/dist/index.global.js +14 -4
- package/dist/index.js +14 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -253,7 +253,9 @@ var S3Storage = class {
|
|
|
253
253
|
MaxKeys: 1e3
|
|
254
254
|
})
|
|
255
255
|
);
|
|
256
|
-
if (!list.Contents)
|
|
256
|
+
if (!list.Contents) {
|
|
257
|
+
return false;
|
|
258
|
+
}
|
|
257
259
|
for (const obj of list.Contents) {
|
|
258
260
|
if (!obj.Key) continue;
|
|
259
261
|
const currentTags = yield s3.send(
|
|
@@ -273,12 +275,15 @@ var S3Storage = class {
|
|
|
273
275
|
})
|
|
274
276
|
);
|
|
275
277
|
}
|
|
278
|
+
return true;
|
|
276
279
|
});
|
|
277
280
|
}
|
|
278
281
|
addTag(savePath, tags, options) {
|
|
279
282
|
return __async(this, null, function* () {
|
|
280
283
|
var _a;
|
|
281
|
-
if (!tags.length)
|
|
284
|
+
if (!tags.length) {
|
|
285
|
+
return false;
|
|
286
|
+
}
|
|
282
287
|
const Bucket = (options == null ? void 0 : options.bucketName) || BUCKET_NAME;
|
|
283
288
|
console.info(`addTag to bucket ${Bucket}`);
|
|
284
289
|
const list = yield s3.send(
|
|
@@ -288,13 +293,17 @@ var S3Storage = class {
|
|
|
288
293
|
MaxKeys: 1e3
|
|
289
294
|
})
|
|
290
295
|
);
|
|
291
|
-
if (!list.Contents)
|
|
296
|
+
if (!list.Contents) {
|
|
297
|
+
return false;
|
|
298
|
+
}
|
|
292
299
|
const tagsToAdd = tags.map((tag) => {
|
|
293
300
|
const [key, value] = tag.split(":");
|
|
294
301
|
if (!key || value === void 0) return null;
|
|
295
302
|
return { Key: key, Value: value };
|
|
296
303
|
}).filter((t) => t !== null);
|
|
297
|
-
if (!tagsToAdd.length)
|
|
304
|
+
if (!tagsToAdd.length) {
|
|
305
|
+
return false;
|
|
306
|
+
}
|
|
298
307
|
for (const obj of list.Contents) {
|
|
299
308
|
if (!obj.Key) continue;
|
|
300
309
|
const currentTags = yield s3.send(
|
|
@@ -324,6 +333,7 @@ var S3Storage = class {
|
|
|
324
333
|
})
|
|
325
334
|
);
|
|
326
335
|
}
|
|
336
|
+
return true;
|
|
327
337
|
});
|
|
328
338
|
}
|
|
329
339
|
};
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type StorageTag = "delete:60d" | "delete:1d";
|
|
1
|
+
type StorageTag = "delete:60d" | "delete:1d" | "voted";
|
|
2
2
|
|
|
3
3
|
interface IStorage {
|
|
4
4
|
saveFiles(keys: Array<{
|
|
@@ -22,7 +22,12 @@ interface IStorage {
|
|
|
22
22
|
uploadUrl: string;
|
|
23
23
|
}>;
|
|
24
24
|
}>;
|
|
25
|
-
removeTag(savePath: string, tags: Array<StorageTag
|
|
25
|
+
removeTag(savePath: string, tags: Array<StorageTag>, options?: {
|
|
26
|
+
bucketName: string;
|
|
27
|
+
}): Promise<boolean>;
|
|
28
|
+
addTag(savePath: string, tags: Array<StorageTag>, options?: {
|
|
29
|
+
bucketName: string;
|
|
30
|
+
}): Promise<boolean>;
|
|
26
31
|
}
|
|
27
32
|
|
|
28
33
|
type Options = {
|
|
@@ -51,10 +56,10 @@ declare class S3Storage implements IStorage {
|
|
|
51
56
|
}>;
|
|
52
57
|
removeTag(savePath: string, tags: Array<StorageTag>, options?: {
|
|
53
58
|
bucketName: string;
|
|
54
|
-
}): Promise<
|
|
59
|
+
}): Promise<boolean>;
|
|
55
60
|
addTag(savePath: string, tags: Array<StorageTag>, options?: {
|
|
56
61
|
bucketName: string;
|
|
57
|
-
}): Promise<
|
|
62
|
+
}): Promise<boolean>;
|
|
58
63
|
}
|
|
59
64
|
|
|
60
65
|
declare const Storage: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type StorageTag = "delete:60d" | "delete:1d";
|
|
1
|
+
type StorageTag = "delete:60d" | "delete:1d" | "voted";
|
|
2
2
|
|
|
3
3
|
interface IStorage {
|
|
4
4
|
saveFiles(keys: Array<{
|
|
@@ -22,7 +22,12 @@ interface IStorage {
|
|
|
22
22
|
uploadUrl: string;
|
|
23
23
|
}>;
|
|
24
24
|
}>;
|
|
25
|
-
removeTag(savePath: string, tags: Array<StorageTag
|
|
25
|
+
removeTag(savePath: string, tags: Array<StorageTag>, options?: {
|
|
26
|
+
bucketName: string;
|
|
27
|
+
}): Promise<boolean>;
|
|
28
|
+
addTag(savePath: string, tags: Array<StorageTag>, options?: {
|
|
29
|
+
bucketName: string;
|
|
30
|
+
}): Promise<boolean>;
|
|
26
31
|
}
|
|
27
32
|
|
|
28
33
|
type Options = {
|
|
@@ -51,10 +56,10 @@ declare class S3Storage implements IStorage {
|
|
|
51
56
|
}>;
|
|
52
57
|
removeTag(savePath: string, tags: Array<StorageTag>, options?: {
|
|
53
58
|
bucketName: string;
|
|
54
|
-
}): Promise<
|
|
59
|
+
}): Promise<boolean>;
|
|
55
60
|
addTag(savePath: string, tags: Array<StorageTag>, options?: {
|
|
56
61
|
bucketName: string;
|
|
57
|
-
}): Promise<
|
|
62
|
+
}): Promise<boolean>;
|
|
58
63
|
}
|
|
59
64
|
|
|
60
65
|
declare const Storage: {
|
package/dist/index.global.js
CHANGED
|
@@ -77063,7 +77063,9 @@ For more information please go to https://github.com/aws/aws-sdk-js-v3#functiona
|
|
|
77063
77063
|
MaxKeys: 1e3
|
|
77064
77064
|
})
|
|
77065
77065
|
);
|
|
77066
|
-
if (!list.Contents)
|
|
77066
|
+
if (!list.Contents) {
|
|
77067
|
+
return false;
|
|
77068
|
+
}
|
|
77067
77069
|
for (const obj of list.Contents) {
|
|
77068
77070
|
if (!obj.Key) continue;
|
|
77069
77071
|
const currentTags = yield s32.send(
|
|
@@ -77083,12 +77085,15 @@ For more information please go to https://github.com/aws/aws-sdk-js-v3#functiona
|
|
|
77083
77085
|
})
|
|
77084
77086
|
);
|
|
77085
77087
|
}
|
|
77088
|
+
return true;
|
|
77086
77089
|
});
|
|
77087
77090
|
}
|
|
77088
77091
|
addTag(savePath, tags, options) {
|
|
77089
77092
|
return __async(this, null, function* () {
|
|
77090
77093
|
var _a2;
|
|
77091
|
-
if (!tags.length)
|
|
77094
|
+
if (!tags.length) {
|
|
77095
|
+
return false;
|
|
77096
|
+
}
|
|
77092
77097
|
const Bucket = (options == null ? void 0 : options.bucketName) || BUCKET_NAME;
|
|
77093
77098
|
console.info(`addTag to bucket ${Bucket}`);
|
|
77094
77099
|
const list = yield s32.send(
|
|
@@ -77098,13 +77103,17 @@ For more information please go to https://github.com/aws/aws-sdk-js-v3#functiona
|
|
|
77098
77103
|
MaxKeys: 1e3
|
|
77099
77104
|
})
|
|
77100
77105
|
);
|
|
77101
|
-
if (!list.Contents)
|
|
77106
|
+
if (!list.Contents) {
|
|
77107
|
+
return false;
|
|
77108
|
+
}
|
|
77102
77109
|
const tagsToAdd = tags.map((tag) => {
|
|
77103
77110
|
const [key, value] = tag.split(":");
|
|
77104
77111
|
if (!key || value === void 0) return null;
|
|
77105
77112
|
return { Key: key, Value: value };
|
|
77106
77113
|
}).filter((t5) => t5 !== null);
|
|
77107
|
-
if (!tagsToAdd.length)
|
|
77114
|
+
if (!tagsToAdd.length) {
|
|
77115
|
+
return false;
|
|
77116
|
+
}
|
|
77108
77117
|
for (const obj of list.Contents) {
|
|
77109
77118
|
if (!obj.Key) continue;
|
|
77110
77119
|
const currentTags = yield s32.send(
|
|
@@ -77134,6 +77143,7 @@ For more information please go to https://github.com/aws/aws-sdk-js-v3#functiona
|
|
|
77134
77143
|
})
|
|
77135
77144
|
);
|
|
77136
77145
|
}
|
|
77146
|
+
return true;
|
|
77137
77147
|
});
|
|
77138
77148
|
}
|
|
77139
77149
|
};
|
package/dist/index.js
CHANGED
|
@@ -224,7 +224,9 @@ var S3Storage = class {
|
|
|
224
224
|
MaxKeys: 1e3
|
|
225
225
|
})
|
|
226
226
|
);
|
|
227
|
-
if (!list.Contents)
|
|
227
|
+
if (!list.Contents) {
|
|
228
|
+
return false;
|
|
229
|
+
}
|
|
228
230
|
for (const obj of list.Contents) {
|
|
229
231
|
if (!obj.Key) continue;
|
|
230
232
|
const currentTags = yield s3.send(
|
|
@@ -244,12 +246,15 @@ var S3Storage = class {
|
|
|
244
246
|
})
|
|
245
247
|
);
|
|
246
248
|
}
|
|
249
|
+
return true;
|
|
247
250
|
});
|
|
248
251
|
}
|
|
249
252
|
addTag(savePath, tags, options) {
|
|
250
253
|
return __async(this, null, function* () {
|
|
251
254
|
var _a;
|
|
252
|
-
if (!tags.length)
|
|
255
|
+
if (!tags.length) {
|
|
256
|
+
return false;
|
|
257
|
+
}
|
|
253
258
|
const Bucket = (options == null ? void 0 : options.bucketName) || BUCKET_NAME;
|
|
254
259
|
console.info(`addTag to bucket ${Bucket}`);
|
|
255
260
|
const list = yield s3.send(
|
|
@@ -259,13 +264,17 @@ var S3Storage = class {
|
|
|
259
264
|
MaxKeys: 1e3
|
|
260
265
|
})
|
|
261
266
|
);
|
|
262
|
-
if (!list.Contents)
|
|
267
|
+
if (!list.Contents) {
|
|
268
|
+
return false;
|
|
269
|
+
}
|
|
263
270
|
const tagsToAdd = tags.map((tag) => {
|
|
264
271
|
const [key, value] = tag.split(":");
|
|
265
272
|
if (!key || value === void 0) return null;
|
|
266
273
|
return { Key: key, Value: value };
|
|
267
274
|
}).filter((t) => t !== null);
|
|
268
|
-
if (!tagsToAdd.length)
|
|
275
|
+
if (!tagsToAdd.length) {
|
|
276
|
+
return false;
|
|
277
|
+
}
|
|
269
278
|
for (const obj of list.Contents) {
|
|
270
279
|
if (!obj.Key) continue;
|
|
271
280
|
const currentTags = yield s3.send(
|
|
@@ -295,6 +304,7 @@ var S3Storage = class {
|
|
|
295
304
|
})
|
|
296
305
|
);
|
|
297
306
|
}
|
|
307
|
+
return true;
|
|
298
308
|
});
|
|
299
309
|
}
|
|
300
310
|
};
|