@activepieces/piece-amazon-s3 0.3.6 → 0.3.7
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/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-amazon-s3",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@ai-sdk/anthropic": "1.2.12",
|
|
6
|
+
"@ai-sdk/google": "1.2.19",
|
|
6
7
|
"@ai-sdk/openai": "1.3.22",
|
|
7
8
|
"@ai-sdk/replicate": "0.2.8",
|
|
8
9
|
"@aws-sdk/client-s3": "3.637.0",
|
|
@@ -11,16 +12,17 @@
|
|
|
11
12
|
"ai": "4.3.16",
|
|
12
13
|
"axios": "1.8.3",
|
|
13
14
|
"axios-retry": "4.4.1",
|
|
15
|
+
"dayjs": "1.11.9",
|
|
14
16
|
"deepmerge-ts": "7.1.0",
|
|
15
17
|
"fast-glob": "3.3.3",
|
|
16
18
|
"mime-types": "2.1.35",
|
|
17
19
|
"nanoid": "3.3.8",
|
|
18
20
|
"semver": "7.6.0",
|
|
19
|
-
"zod": "3.25.
|
|
20
|
-
"@activepieces/pieces-common": "0.5.
|
|
21
|
-
"@activepieces/pieces-framework": "0.14.
|
|
22
|
-
"@activepieces/shared": "0.
|
|
23
|
-
"tslib": "
|
|
21
|
+
"zod": "3.25.67",
|
|
22
|
+
"@activepieces/pieces-common": "0.5.2",
|
|
23
|
+
"@activepieces/pieces-framework": "0.14.1",
|
|
24
|
+
"@activepieces/shared": "0.15.2",
|
|
25
|
+
"tslib": "2.8.1"
|
|
24
26
|
},
|
|
25
27
|
"overrides": {
|
|
26
28
|
"@tryfabric/martian": {
|
|
@@ -33,7 +35,7 @@
|
|
|
33
35
|
"resolutions": {
|
|
34
36
|
"rollup": "npm:@rollup/wasm-node"
|
|
35
37
|
},
|
|
38
|
+
"types": "./src/index.d.ts",
|
|
36
39
|
"main": "./src/index.js",
|
|
37
|
-
"type": "commonjs"
|
|
38
|
-
"types": "./src/index.d.ts"
|
|
40
|
+
"type": "commonjs"
|
|
39
41
|
}
|
|
@@ -6,6 +6,7 @@ export declare const newFile: import("@activepieces/pieces-framework").ITrigger<
|
|
|
6
6
|
endpoint: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
7
7
|
region: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
8
8
|
}>, {
|
|
9
|
+
markdown: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
9
10
|
folderPath: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
10
11
|
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
11
12
|
accessKeyId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
@@ -14,6 +15,7 @@ export declare const newFile: import("@activepieces/pieces-framework").ITrigger<
|
|
|
14
15
|
endpoint: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
15
16
|
region: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
16
17
|
}>, {
|
|
18
|
+
markdown: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
17
19
|
folderPath: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
18
20
|
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
19
21
|
accessKeyId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
@@ -22,5 +24,6 @@ export declare const newFile: import("@activepieces/pieces-framework").ITrigger<
|
|
|
22
24
|
endpoint: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
23
25
|
region: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
24
26
|
}>, {
|
|
27
|
+
markdown: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
25
28
|
folderPath: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
26
29
|
}>;
|
|
@@ -7,34 +7,60 @@ const pieces_framework_2 = require("@activepieces/pieces-framework");
|
|
|
7
7
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
8
8
|
const __1 = require("../..");
|
|
9
9
|
const common_1 = require("../common");
|
|
10
|
+
const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
|
|
11
|
+
const shared_1 = require("@activepieces/shared");
|
|
10
12
|
const polling = {
|
|
11
|
-
strategy: pieces_common_1.DedupeStrategy.
|
|
12
|
-
items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth,
|
|
13
|
-
var _b;
|
|
13
|
+
strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
|
|
14
|
+
items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, lastFetchEpochMS, propsValue }) {
|
|
15
|
+
var _b, _c;
|
|
16
|
+
const isTest = lastFetchEpochMS === 0;
|
|
14
17
|
const s3 = (0, common_1.createS3)(auth);
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
params
|
|
22
|
-
|
|
23
|
-
:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
const bucketFiles = [];
|
|
19
|
+
const MAX_TOTAL_FILES = 10000;
|
|
20
|
+
let totalFetched = 0;
|
|
21
|
+
let hasMore = true;
|
|
22
|
+
let nextToken;
|
|
23
|
+
do {
|
|
24
|
+
const params = {
|
|
25
|
+
Bucket: auth.bucket,
|
|
26
|
+
MaxKeys: isTest ? 10 : 1000,
|
|
27
|
+
ContinuationToken: nextToken,
|
|
28
|
+
};
|
|
29
|
+
if (propsValue.folderPath)
|
|
30
|
+
params.Prefix = `${propsValue.folderPath.endsWith('/')
|
|
31
|
+
? propsValue.folderPath.slice(0, -1)
|
|
32
|
+
: propsValue.folderPath}`;
|
|
33
|
+
const response = yield s3.listObjectsV2(params);
|
|
34
|
+
const items = (_b = response.Contents) !== null && _b !== void 0 ? _b : [];
|
|
35
|
+
// Check if adding these items would exceed the 10,000 limit
|
|
36
|
+
if (totalFetched + items.length > MAX_TOTAL_FILES) {
|
|
37
|
+
const remaining = MAX_TOTAL_FILES - totalFetched;
|
|
38
|
+
bucketFiles.push(...items.slice(0, remaining));
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
bucketFiles.push(...items);
|
|
42
|
+
totalFetched += items.length;
|
|
43
|
+
if (isTest)
|
|
44
|
+
break;
|
|
45
|
+
hasMore = !!response.IsTruncated;
|
|
46
|
+
nextToken = (_c = response.NextContinuationToken) !== null && _c !== void 0 ? _c : undefined;
|
|
47
|
+
} while (hasMore);
|
|
48
|
+
return bucketFiles.map((file) => ({
|
|
49
|
+
epochMilliSeconds: (0, dayjs_1.default)(file.LastModified).valueOf(),
|
|
50
|
+
data: file,
|
|
28
51
|
}));
|
|
29
|
-
return items;
|
|
30
52
|
}),
|
|
31
53
|
};
|
|
32
54
|
exports.newFile = (0, pieces_framework_1.createTrigger)({
|
|
33
55
|
auth: __1.amazonS3Auth,
|
|
34
56
|
name: 'new_file',
|
|
35
|
-
displayName: 'New File',
|
|
36
|
-
description: '
|
|
57
|
+
displayName: 'New or Updated File',
|
|
58
|
+
description: 'Triggers when you add or update a file in your bucket. The bucket/folder you choose must not contain more than 10,000 files.',
|
|
37
59
|
props: {
|
|
60
|
+
markdown: pieces_framework_1.Property.MarkDown({
|
|
61
|
+
variant: shared_1.MarkdownVariant.INFO,
|
|
62
|
+
value: 'Triggers when you add or update a file in your bucket. The bucket/folder you choose must not contain more than 10,000 files.'
|
|
63
|
+
}),
|
|
38
64
|
folderPath: pieces_framework_1.Property.ShortText({
|
|
39
65
|
displayName: 'Folder Path',
|
|
40
66
|
required: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"new-file.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/amazon-s3/src/lib/triggers/new-file.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"new-file.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/amazon-s3/src/lib/triggers/new-file.ts"],"names":[],"mappings":";;;;AAAA,qEAA+F;AAC/F,qEAAiE;AACjE,+DAAqF;AAErF,6BAAqC;AACrC,sCAAqC;AACrC,0DAA0B;AAE1B,iDAAuD;AAEvD,MAAM,OAAO,GAAgF;IAC5F,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,KAA+C,EAAE,oDAA1C,EAAE,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE;;QACnD,MAAM,MAAM,GAAG,gBAAgB,KAAK,CAAC,CAAC;QAEtC,MAAM,EAAE,GAAG,IAAA,iBAAQ,EAAC,IAAI,CAAC,CAAC;QAE1B,MAAM,WAAW,GAAG,EAAE,CAAC;QAEvB,MAAM,eAAe,GAAG,KAAK,CAAC;QAC9B,IAAI,YAAY,GAAG,CAAC,CAAC;QAErB,IAAI,OAAO,GAAG,IAAI,CAAC;QACnB,IAAI,SAA6B,CAAC;QAElC,GAAG,CAAC;YACH,MAAM,MAAM,GAA8B;gBACzC,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;gBAC3B,iBAAiB,EAAE,SAAS;aAC5B,CAAC;YAEF,IAAI,UAAU,CAAC,UAAU;gBACxB,MAAM,CAAC,MAAM,GAAG,GACf,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC;oBAClC,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;oBACpC,CAAC,CAAC,UAAU,CAAC,UACf,EAAE,CA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