@activepieces/piece-amazon-s3 0.5.9 → 0.6.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/package.json +5 -4
- package/src/index.d.ts +7 -3
- package/src/index.d.ts.map +1 -1
- package/src/index.js +1 -1
- package/src/index.js.map +1 -1
- package/src/lib/actions/decrypt-pgp-file.d.ts +7 -3
- package/src/lib/actions/decrypt-pgp-file.d.ts.map +1 -1
- package/src/lib/actions/decrypt-pgp-file.js +30 -20
- package/src/lib/actions/decrypt-pgp-file.js.map +1 -1
- package/src/lib/actions/delete-file.d.ts +7 -3
- package/src/lib/actions/delete-file.d.ts.map +1 -1
- package/src/lib/actions/delete-file.js +9 -3
- package/src/lib/actions/delete-file.js.map +1 -1
- package/src/lib/actions/generate-signed-upload-url.d.ts +7 -3
- package/src/lib/actions/generate-signed-upload-url.d.ts.map +1 -1
- package/src/lib/actions/generate-signed-upload-url.js +31 -13
- package/src/lib/actions/generate-signed-upload-url.js.map +1 -1
- package/src/lib/actions/generate-signed-url.d.ts +7 -3
- package/src/lib/actions/generate-signed-url.d.ts.map +1 -1
- package/src/lib/actions/generate-signed-url.js +31 -21
- package/src/lib/actions/generate-signed-url.js.map +1 -1
- package/src/lib/actions/list-files.d.ts +7 -3
- package/src/lib/actions/list-files.d.ts.map +1 -1
- package/src/lib/actions/list-files.js +9 -3
- package/src/lib/actions/list-files.js.map +1 -1
- package/src/lib/actions/move-file.d.ts +7 -3
- package/src/lib/actions/move-file.d.ts.map +1 -1
- package/src/lib/actions/move-file.js +9 -3
- package/src/lib/actions/move-file.js.map +1 -1
- package/src/lib/actions/read-file.d.ts +7 -3
- package/src/lib/actions/read-file.d.ts.map +1 -1
- package/src/lib/actions/read-file.js +9 -3
- package/src/lib/actions/read-file.js.map +1 -1
- package/src/lib/actions/upload-file.d.ts +7 -3
- package/src/lib/actions/upload-file.d.ts.map +1 -1
- package/src/lib/actions/upload-file.js +9 -3
- package/src/lib/actions/upload-file.js.map +1 -1
- package/src/lib/auth.d.ts +30 -1
- package/src/lib/auth.d.ts.map +1 -1
- package/src/lib/auth.js +210 -145
- package/src/lib/auth.js.map +1 -1
- package/src/lib/common.d.ts +25 -9
- package/src/lib/common.d.ts.map +1 -1
- package/src/lib/common.js +93 -0
- package/src/lib/common.js.map +1 -1
- package/src/lib/triggers/new-file.d.ts +28 -12
- package/src/lib/triggers/new-file.d.ts.map +1 -1
- package/src/lib/triggers/new-file.js +63 -46
- package/src/lib/triggers/new-file.js.map +1 -1
package/src/lib/common.d.ts
CHANGED
|
@@ -1,14 +1,30 @@
|
|
|
1
1
|
import { S3 } from '@aws-sdk/client-s3';
|
|
2
2
|
import { SecretsManagerClient } from '@aws-sdk/client-secrets-manager';
|
|
3
|
-
|
|
3
|
+
import { ServerContext } from '@activepieces/pieces-framework';
|
|
4
|
+
import { AccessKeyAuthProps, OidcAuthProps, S3AuthProps } from './auth';
|
|
5
|
+
export declare function createS3(auth: AccessKeyAuthProps): S3;
|
|
6
|
+
export declare function createSecretsManagerClient(auth: AccessKeyAuthProps): SecretsManagerClient;
|
|
7
|
+
export declare function createS3WithAssumeRole({ auth, server, durationSeconds, }: {
|
|
8
|
+
auth: OidcAuthProps;
|
|
9
|
+
server: ServerContext;
|
|
10
|
+
durationSeconds?: number;
|
|
11
|
+
}): Promise<S3>;
|
|
12
|
+
export declare function isOidcAuth(authProps: S3AuthProps): authProps is OidcAuthProps;
|
|
13
|
+
export declare function resolveS3Client({ authProps, server, }: {
|
|
14
|
+
authProps: S3AuthProps;
|
|
15
|
+
server: ServerContext;
|
|
16
|
+
}): Promise<S3>;
|
|
17
|
+
export declare function getTemporaryCredentials({ auth, server, durationSeconds, }: {
|
|
18
|
+
auth: OidcAuthProps;
|
|
19
|
+
server: ServerContext;
|
|
20
|
+
durationSeconds?: number;
|
|
21
|
+
}): Promise<TemporaryCredentials>;
|
|
22
|
+
export declare const MIN_STS_DURATION_SECONDS = 900;
|
|
23
|
+
export declare const MAX_STS_DURATION_SECONDS = 43200;
|
|
24
|
+
type TemporaryCredentials = {
|
|
4
25
|
accessKeyId: string;
|
|
5
26
|
secretAccessKey: string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
export declare function createSecretsManagerClient(auth: {
|
|
10
|
-
accessKeyId: string;
|
|
11
|
-
secretAccessKey: string;
|
|
12
|
-
region: string | undefined;
|
|
13
|
-
}): SecretsManagerClient;
|
|
27
|
+
sessionToken: string | undefined;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
14
30
|
//# sourceMappingURL=common.d.ts.map
|
package/src/lib/common.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/lib/common.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE,wBAAgB,QAAQ,CAAC,IAAI,EAAE;
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/lib/common.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAIxE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,kBAAkB,MAehD;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,kBAAkB,wBAalE;AAED,wBAAsB,sBAAsB,CAAC,EAC3C,IAAI,EACJ,MAAM,EACN,eAAe,GAChB,EAAE;IACD,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,aAAa,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,OAAO,CAAC,EAAE,CAAC,CAMd;AAED,wBAAgB,UAAU,CAAC,SAAS,EAAE,WAAW,GAAG,SAAS,IAAI,aAAa,CAE7E;AAED,wBAAsB,eAAe,CAAC,EACpC,SAAS,EACT,MAAM,GACP,EAAE;IACD,SAAS,EAAE,WAAW,CAAC;IACvB,MAAM,EAAE,aAAa,CAAC;CACvB,GAAG,OAAO,CAAC,EAAE,CAAC,CAId;AAED,wBAAsB,uBAAuB,CAAC,EAC5C,IAAI,EACJ,MAAM,EACN,eAA8C,GAC/C,EAAE;IACD,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,aAAa,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,iCAgDA;AAeD,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAC5C,eAAO,MAAM,wBAAwB,QAAQ,CAAC;AAE9C,KAAK,oBAAoB,GAAG;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC,CAAC"}
|
package/src/lib/common.js
CHANGED
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MAX_STS_DURATION_SECONDS = exports.MIN_STS_DURATION_SECONDS = void 0;
|
|
3
4
|
exports.createS3 = createS3;
|
|
4
5
|
exports.createSecretsManagerClient = createSecretsManagerClient;
|
|
6
|
+
exports.createS3WithAssumeRole = createS3WithAssumeRole;
|
|
7
|
+
exports.isOidcAuth = isOidcAuth;
|
|
8
|
+
exports.resolveS3Client = resolveS3Client;
|
|
9
|
+
exports.getTemporaryCredentials = getTemporaryCredentials;
|
|
10
|
+
const tslib_1 = require("tslib");
|
|
5
11
|
const shared_1 = require("@activepieces/shared");
|
|
6
12
|
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
7
13
|
const client_secrets_manager_1 = require("@aws-sdk/client-secrets-manager");
|
|
14
|
+
const client_sts_1 = require("@aws-sdk/client-sts");
|
|
15
|
+
const AWS_STS_AUDIENCE = 'sts.amazonaws.com';
|
|
8
16
|
function createS3(auth) {
|
|
17
|
+
if (!auth.accessKeyId || !auth.secretAccessKey) {
|
|
18
|
+
throw new Error('Access Key ID and Secret Access Key are required');
|
|
19
|
+
}
|
|
9
20
|
const s3 = new client_s3_1.S3({
|
|
10
21
|
credentials: {
|
|
11
22
|
accessKeyId: auth.accessKeyId,
|
|
@@ -18,6 +29,9 @@ function createS3(auth) {
|
|
|
18
29
|
return s3;
|
|
19
30
|
}
|
|
20
31
|
function createSecretsManagerClient(auth) {
|
|
32
|
+
if (!auth.accessKeyId || !auth.secretAccessKey) {
|
|
33
|
+
throw new Error('Access Key ID and Secret Access Key are required');
|
|
34
|
+
}
|
|
21
35
|
const client = new client_secrets_manager_1.SecretsManagerClient({
|
|
22
36
|
credentials: {
|
|
23
37
|
accessKeyId: auth.accessKeyId,
|
|
@@ -28,4 +42,83 @@ function createSecretsManagerClient(auth) {
|
|
|
28
42
|
});
|
|
29
43
|
return client;
|
|
30
44
|
}
|
|
45
|
+
function createS3WithAssumeRole(_a) {
|
|
46
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, server, durationSeconds, }) {
|
|
47
|
+
const credentials = yield getTemporaryCredentials({ auth, server, durationSeconds });
|
|
48
|
+
return new client_s3_1.S3({
|
|
49
|
+
credentials,
|
|
50
|
+
region: auth.region,
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function isOidcAuth(authProps) {
|
|
55
|
+
return 'roleArn' in authProps;
|
|
56
|
+
}
|
|
57
|
+
function resolveS3Client(_a) {
|
|
58
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ authProps, server, }) {
|
|
59
|
+
return isOidcAuth(authProps)
|
|
60
|
+
? createS3WithAssumeRole({ auth: authProps, server })
|
|
61
|
+
: createS3(authProps);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function getTemporaryCredentials(_a) {
|
|
65
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, server, durationSeconds = DEFAULT_STS_DURATION_SECONDS, }) {
|
|
66
|
+
var _b, _c;
|
|
67
|
+
if (!auth.roleArn) {
|
|
68
|
+
throw new Error('Role ARN is required for IAM Role authentication');
|
|
69
|
+
}
|
|
70
|
+
const clampedDuration = Math.min(Math.max(durationSeconds, exports.MIN_STS_DURATION_SECONDS), exports.MAX_STS_DURATION_SECONDS);
|
|
71
|
+
// Scoped by server.token (unique per flow execution) so credentials are never reused
|
|
72
|
+
// across projects/tenants, only across steps within the same run.
|
|
73
|
+
const cacheKey = `${server.token}:${auth.roleArn}:${auth.region}:${clampedDuration}`;
|
|
74
|
+
const cached = credentialsCache.get(cacheKey);
|
|
75
|
+
if (cached && cached.expiresAtMS - Date.now() > CREDENTIALS_EXPIRY_MARGIN_MS) {
|
|
76
|
+
return cached.credentials;
|
|
77
|
+
}
|
|
78
|
+
const response = yield fetch(`${server.apiUrl}v1/worker/oidc-token`, {
|
|
79
|
+
method: 'POST',
|
|
80
|
+
headers: {
|
|
81
|
+
Authorization: `Bearer ${server.token}`,
|
|
82
|
+
'Content-Type': 'application/json',
|
|
83
|
+
},
|
|
84
|
+
body: JSON.stringify({ audience: AWS_STS_AUDIENCE }),
|
|
85
|
+
});
|
|
86
|
+
if (!response.ok) {
|
|
87
|
+
throw new Error(`Failed to get OIDC token: ${response.statusText}`);
|
|
88
|
+
}
|
|
89
|
+
const { token } = (yield response.json());
|
|
90
|
+
const sts = new client_sts_1.STSClient({ region: auth.region });
|
|
91
|
+
const { Credentials } = yield sts.send(new client_sts_1.AssumeRoleWithWebIdentityCommand({
|
|
92
|
+
RoleArn: auth.roleArn,
|
|
93
|
+
RoleSessionName: 'activepieces-execution',
|
|
94
|
+
WebIdentityToken: token,
|
|
95
|
+
DurationSeconds: clampedDuration,
|
|
96
|
+
}));
|
|
97
|
+
if (!(Credentials === null || Credentials === void 0 ? void 0 : Credentials.AccessKeyId) || !Credentials.SecretAccessKey) {
|
|
98
|
+
throw new Error('Failed to assume role: no credentials returned');
|
|
99
|
+
}
|
|
100
|
+
const credentials = {
|
|
101
|
+
accessKeyId: Credentials.AccessKeyId,
|
|
102
|
+
secretAccessKey: Credentials.SecretAccessKey,
|
|
103
|
+
sessionToken: Credentials.SessionToken,
|
|
104
|
+
};
|
|
105
|
+
const expiresAtMS = (_c = (_b = Credentials.Expiration) === null || _b === void 0 ? void 0 : _b.getTime()) !== null && _c !== void 0 ? _c : Date.now() + clampedDuration * 1000;
|
|
106
|
+
sweepExpiredCredentials();
|
|
107
|
+
credentialsCache.set(cacheKey, { credentials, expiresAtMS });
|
|
108
|
+
return credentials;
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
function sweepExpiredCredentials() {
|
|
112
|
+
const now = Date.now();
|
|
113
|
+
for (const [key, value] of credentialsCache) {
|
|
114
|
+
if (value.expiresAtMS <= now) {
|
|
115
|
+
credentialsCache.delete(key);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
const DEFAULT_STS_DURATION_SECONDS = 3600;
|
|
120
|
+
const CREDENTIALS_EXPIRY_MARGIN_MS = 5 * 60 * 1000;
|
|
121
|
+
const credentialsCache = new Map();
|
|
122
|
+
exports.MIN_STS_DURATION_SECONDS = 900;
|
|
123
|
+
exports.MAX_STS_DURATION_SECONDS = 43200;
|
|
31
124
|
//# sourceMappingURL=common.js.map
|
package/src/lib/common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/lib/common.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/lib/common.ts"],"names":[],"mappings":";;;AASA,4BAeC;AAED,gEAaC;AAED,wDAcC;AAED,gCAEC;AAED,0CAUC;AAED,0DAwDC;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AE,OAAO,EAAE,mCAAI,IAAI,CAAC,GAAG,EAAE,GAAG,eAAe,GAAG,IAAI,CAAC;QAC7F,uBAAuB,EAAE,CAAC;QAC1B,gBAAgB,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC,CAAC;QAC7D,OAAO,WAAW,CAAC;IACrB,CAAC;CAAA;AAED,SAAS,uBAAuB;IAC9B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACvB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,gBAAgB,EAAE,CAAC;QAC5C,IAAI,KAAK,CAAC,WAAW,IAAI,GAAG,EAAE,CAAC;YAC7B,gBAAgB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,4BAA4B,GAAG,IAAI,CAAC;AAC1C,MAAM,4BAA4B,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AACnD,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAA6B,CAAC;AAEjD,QAAA,wBAAwB,GAAG,GAAG,CAAC;AAC/B,QAAA,wBAAwB,GAAG,KAAK,CAAC"}
|
|
@@ -1,38 +1,54 @@
|
|
|
1
1
|
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const newFile: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
export declare const newFile: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, (import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
3
3
|
accessKeyId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
4
|
secretAccessKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
-
bucket: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
6
5
|
endpoint: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
7
6
|
region: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
8
|
-
|
|
7
|
+
bucket: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
8
|
+
}> | import("@activepieces/pieces-framework").OIDCProperty<{
|
|
9
|
+
roleArn: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
+
region: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
11
|
+
bucket: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
12
|
+
}>)[], {
|
|
9
13
|
markdown: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
10
14
|
folderPath: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
11
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
15
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, (import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
12
16
|
accessKeyId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
13
17
|
secretAccessKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
14
|
-
bucket: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
15
18
|
endpoint: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
16
19
|
region: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
17
|
-
|
|
20
|
+
bucket: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
21
|
+
}> | import("@activepieces/pieces-framework").OIDCProperty<{
|
|
22
|
+
roleArn: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
23
|
+
region: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
24
|
+
bucket: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
25
|
+
}>)[], {
|
|
18
26
|
markdown: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
19
27
|
folderPath: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
20
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
28
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, (import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
21
29
|
accessKeyId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
22
30
|
secretAccessKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
23
|
-
bucket: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
24
31
|
endpoint: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
25
32
|
region: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
26
|
-
|
|
33
|
+
bucket: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
34
|
+
}> | import("@activepieces/pieces-framework").OIDCProperty<{
|
|
35
|
+
roleArn: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
36
|
+
region: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
37
|
+
bucket: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
38
|
+
}>)[], {
|
|
27
39
|
markdown: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
28
40
|
folderPath: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
29
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
41
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, (import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
30
42
|
accessKeyId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
31
43
|
secretAccessKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
32
|
-
bucket: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
33
44
|
endpoint: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
34
45
|
region: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
35
|
-
|
|
46
|
+
bucket: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
47
|
+
}> | import("@activepieces/pieces-framework").OIDCProperty<{
|
|
48
|
+
roleArn: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
49
|
+
region: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
50
|
+
bucket: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
51
|
+
}>)[], {
|
|
36
52
|
markdown: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
37
53
|
folderPath: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
38
54
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"new-file.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-file.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"new-file.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+C,eAAe,EAAiB,MAAM,gCAAgC,CAAC;AA0B7H,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0DlB,CAAC"}
|
|
@@ -3,70 +3,47 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.newFile = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_framework_2 = require("@activepieces/pieces-framework");
|
|
7
6
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const shared_1 = require("@activepieces/shared");
|
|
8
|
+
const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
|
|
8
9
|
const auth_1 = require("../auth");
|
|
9
10
|
const common_1 = require("../common");
|
|
10
|
-
const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
|
|
11
|
-
const shared_1 = require("@activepieces/shared");
|
|
12
11
|
const polling = {
|
|
13
12
|
strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
|
|
14
|
-
items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, lastFetchEpochMS,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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,
|
|
51
|
-
}));
|
|
13
|
+
items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, propsValue, lastFetchEpochMS, server }) {
|
|
14
|
+
if (!server) {
|
|
15
|
+
throw new Error('Server context is required to resolve Amazon S3 credentials');
|
|
16
|
+
}
|
|
17
|
+
const authProps = auth.props;
|
|
18
|
+
const s3 = yield (0, common_1.resolveS3Client)({ authProps, server });
|
|
19
|
+
const files = yield fetchS3FilesForTrigger({
|
|
20
|
+
s3,
|
|
21
|
+
bucket: authProps.bucket,
|
|
22
|
+
folderPath: propsValue.folderPath,
|
|
23
|
+
isTest: lastFetchEpochMS === 0,
|
|
24
|
+
});
|
|
25
|
+
return files.filter((f) => Number.isFinite(f.epochMilliSeconds));
|
|
52
26
|
}),
|
|
53
27
|
};
|
|
54
28
|
exports.newFile = (0, pieces_framework_1.createTrigger)({
|
|
55
|
-
auth: auth_1.
|
|
29
|
+
auth: auth_1.amazonS3CombinedAuth,
|
|
56
30
|
name: 'new_file',
|
|
57
31
|
displayName: 'New or Updated File',
|
|
58
32
|
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.',
|
|
33
|
+
aiMetadata: {
|
|
34
|
+
description: 'Fires when an object is added or modified in the configured S3 bucket, optionally scoped to a folder prefix. Polls the bucket and emits each new or updated file based on its last-modified time. The watched bucket/folder must contain no more than 10,000 files.',
|
|
35
|
+
},
|
|
59
36
|
props: {
|
|
60
37
|
markdown: pieces_framework_1.Property.MarkDown({
|
|
61
38
|
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.'
|
|
39
|
+
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
40
|
}),
|
|
64
41
|
folderPath: pieces_framework_1.Property.ShortText({
|
|
65
42
|
displayName: 'Folder Path',
|
|
66
43
|
required: false,
|
|
67
44
|
}),
|
|
68
45
|
},
|
|
69
|
-
type:
|
|
46
|
+
type: pieces_framework_1.TriggerStrategy.POLLING,
|
|
70
47
|
onEnable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
71
48
|
yield pieces_common_1.pollingHelper.onEnable(polling, {
|
|
72
49
|
auth: context.auth,
|
|
@@ -82,19 +59,21 @@ exports.newFile = (0, pieces_framework_1.createTrigger)({
|
|
|
82
59
|
});
|
|
83
60
|
}),
|
|
84
61
|
run: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
85
|
-
return
|
|
62
|
+
return pieces_common_1.pollingHelper.poll(polling, {
|
|
86
63
|
auth: context.auth,
|
|
87
64
|
store: context.store,
|
|
88
65
|
propsValue: context.propsValue,
|
|
89
66
|
files: context.files,
|
|
67
|
+
server: context.server,
|
|
90
68
|
});
|
|
91
69
|
}),
|
|
92
70
|
test: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
93
|
-
return
|
|
71
|
+
return pieces_common_1.pollingHelper.test(polling, {
|
|
94
72
|
auth: context.auth,
|
|
95
73
|
store: context.store,
|
|
96
74
|
propsValue: context.propsValue,
|
|
97
75
|
files: context.files,
|
|
76
|
+
server: context.server,
|
|
98
77
|
});
|
|
99
78
|
}),
|
|
100
79
|
sampleData: {
|
|
@@ -105,4 +84,42 @@ exports.newFile = (0, pieces_framework_1.createTrigger)({
|
|
|
105
84
|
StorageClass: 'STANDARD',
|
|
106
85
|
},
|
|
107
86
|
});
|
|
87
|
+
function fetchS3FilesForTrigger(_a) {
|
|
88
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ s3, bucket, folderPath, isTest, }) {
|
|
89
|
+
var _b, _c;
|
|
90
|
+
const MAX_TOTAL_FILES = 10000;
|
|
91
|
+
const bucketFiles = [];
|
|
92
|
+
let totalFetched = 0;
|
|
93
|
+
let hasMore = true;
|
|
94
|
+
let nextToken;
|
|
95
|
+
do {
|
|
96
|
+
const params = {
|
|
97
|
+
Bucket: bucket,
|
|
98
|
+
MaxKeys: isTest ? 10 : 1000,
|
|
99
|
+
ContinuationToken: nextToken,
|
|
100
|
+
};
|
|
101
|
+
if (folderPath) {
|
|
102
|
+
params.Prefix = folderPath.endsWith('/')
|
|
103
|
+
? folderPath.slice(0, -1)
|
|
104
|
+
: folderPath;
|
|
105
|
+
}
|
|
106
|
+
const response = yield s3.listObjectsV2(params);
|
|
107
|
+
const items = (_b = response.Contents) !== null && _b !== void 0 ? _b : [];
|
|
108
|
+
if (totalFetched + items.length > MAX_TOTAL_FILES) {
|
|
109
|
+
bucketFiles.push(...items.slice(0, MAX_TOTAL_FILES - totalFetched));
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
bucketFiles.push(...items);
|
|
113
|
+
totalFetched += items.length;
|
|
114
|
+
if (isTest)
|
|
115
|
+
break;
|
|
116
|
+
hasMore = !!response.IsTruncated;
|
|
117
|
+
nextToken = (_c = response.NextContinuationToken) !== null && _c !== void 0 ? _c : undefined;
|
|
118
|
+
} while (hasMore);
|
|
119
|
+
return bucketFiles.map((file) => ({
|
|
120
|
+
epochMilliSeconds: (0, dayjs_1.default)(file.LastModified).valueOf(),
|
|
121
|
+
data: file,
|
|
122
|
+
}));
|
|
123
|
+
});
|
|
124
|
+
}
|
|
108
125
|
//# sourceMappingURL=new-file.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"new-file.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-file.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"new-file.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-file.ts"],"names":[],"mappings":";;;;AAAA,qEAA6H;AAC7H,+DAAqF;AAErF,iDAAuD;AACvD,0DAA0B;AAC1B,kCAA4D;AAC5D,sCAA4C;AAE5C,MAAM,OAAO,GAAqG;IAChH,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,KAAuD,EAAE,oDAA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