@activepieces/piece-amazon-s3 0.5.7 → 0.5.8
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 +6 -103
- package/src/index.d.ts.map +1 -1
- package/src/index.js +3 -9
- package/src/index.js.map +1 -1
- package/src/lib/actions/generate-signed-upload-url.d.ts +11 -0
- package/src/lib/actions/generate-signed-upload-url.d.ts.map +1 -0
- package/src/lib/actions/generate-signed-upload-url.js +48 -0
- package/src/lib/actions/generate-signed-upload-url.js.map +1 -0
package/package.json
CHANGED
|
@@ -1,116 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-amazon-s3",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.8",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
5
|
"types": "./src/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
7
|
+
"@activepieces/pieces-common": "0.12.3",
|
|
8
|
+
"@activepieces/pieces-framework": "0.28.1",
|
|
9
|
+
"@activepieces/shared": "0.67.1",
|
|
7
10
|
"@aws-sdk/client-s3": "3.974.0",
|
|
8
|
-
"@aws-sdk/client-secrets-manager": "3.
|
|
11
|
+
"@aws-sdk/client-secrets-manager": "3.0.0",
|
|
9
12
|
"@aws-sdk/s3-request-presigner": "3.894.0",
|
|
10
13
|
"dayjs": "1.11.9",
|
|
11
14
|
"mime-types": "2.1.35",
|
|
12
15
|
"openpgp": "6.3.0",
|
|
13
|
-
"tslib": "2.6.2"
|
|
14
|
-
"@aws-crypto/sha1-browser": "5.2.0",
|
|
15
|
-
"@aws-crypto/sha256-browser": "5.2.0",
|
|
16
|
-
"@aws-crypto/sha256-js": "5.2.0",
|
|
17
|
-
"@aws-sdk/core": "3.973.24",
|
|
18
|
-
"@aws-sdk/credential-provider-node": "3.972.25",
|
|
19
|
-
"@aws-sdk/middleware-bucket-endpoint": "3.972.8",
|
|
20
|
-
"@aws-sdk/middleware-expect-continue": "3.972.8",
|
|
21
|
-
"@aws-sdk/middleware-flexible-checksums": "3.974.4",
|
|
22
|
-
"@aws-sdk/middleware-host-header": "3.972.8",
|
|
23
|
-
"@aws-sdk/middleware-location-constraint": "3.972.8",
|
|
24
|
-
"@aws-sdk/middleware-logger": "3.972.8",
|
|
25
|
-
"@aws-sdk/middleware-recursion-detection": "3.972.8",
|
|
26
|
-
"@aws-sdk/middleware-sdk-s3": "3.972.25",
|
|
27
|
-
"@aws-sdk/middleware-ssec": "3.972.8",
|
|
28
|
-
"@aws-sdk/middleware-user-agent": "3.972.25",
|
|
29
|
-
"@aws-sdk/region-config-resolver": "3.972.9",
|
|
30
|
-
"@aws-sdk/signature-v4-multi-region": "3.972.0",
|
|
31
|
-
"@aws-sdk/types": "3.973.6",
|
|
32
|
-
"@aws-sdk/util-endpoints": "3.972.0",
|
|
33
|
-
"@aws-sdk/util-user-agent-browser": "3.972.8",
|
|
34
|
-
"@aws-sdk/util-user-agent-node": "3.973.11",
|
|
35
|
-
"@smithy/config-resolver": "4.4.13",
|
|
36
|
-
"@smithy/core": "3.23.12",
|
|
37
|
-
"@smithy/eventstream-serde-browser": "4.2.12",
|
|
38
|
-
"@smithy/eventstream-serde-config-resolver": "4.3.12",
|
|
39
|
-
"@smithy/eventstream-serde-node": "4.2.12",
|
|
40
|
-
"@smithy/fetch-http-handler": "5.3.15",
|
|
41
|
-
"@smithy/hash-blob-browser": "4.2.13",
|
|
42
|
-
"@smithy/hash-node": "4.2.12",
|
|
43
|
-
"@smithy/hash-stream-node": "4.2.12",
|
|
44
|
-
"@smithy/invalid-dependency": "4.2.12",
|
|
45
|
-
"@smithy/md5-js": "4.2.12",
|
|
46
|
-
"@smithy/middleware-content-length": "4.2.12",
|
|
47
|
-
"@smithy/middleware-endpoint": "4.4.27",
|
|
48
|
-
"@smithy/middleware-retry": "4.4.44",
|
|
49
|
-
"@smithy/middleware-serde": "4.2.15",
|
|
50
|
-
"@smithy/middleware-stack": "4.2.12",
|
|
51
|
-
"@smithy/node-config-provider": "4.3.12",
|
|
52
|
-
"@smithy/node-http-handler": "4.4.14",
|
|
53
|
-
"@smithy/protocol-http": "5.3.8",
|
|
54
|
-
"@smithy/smithy-client": "4.12.7",
|
|
55
|
-
"@smithy/types": "4.13.1",
|
|
56
|
-
"@smithy/url-parser": "4.2.12",
|
|
57
|
-
"@smithy/util-base64": "4.3.2",
|
|
58
|
-
"@smithy/util-body-length-browser": "4.2.2",
|
|
59
|
-
"@smithy/util-body-length-node": "4.2.3",
|
|
60
|
-
"@smithy/util-defaults-mode-browser": "4.3.43",
|
|
61
|
-
"@smithy/util-defaults-mode-node": "4.2.47",
|
|
62
|
-
"@smithy/util-endpoints": "3.3.3",
|
|
63
|
-
"@smithy/util-middleware": "4.2.12",
|
|
64
|
-
"@smithy/util-retry": "4.2.12",
|
|
65
|
-
"@smithy/util-stream": "4.5.20",
|
|
66
|
-
"@smithy/util-utf8": "4.2.2",
|
|
67
|
-
"@smithy/util-waiter": "4.2.13",
|
|
68
|
-
"@aws-sdk/util-format-url": "3.893.0",
|
|
69
|
-
"mime-db": "1.52.0",
|
|
70
|
-
"@aws-crypto/supports-web-crypto": "5.2.0",
|
|
71
|
-
"@aws-crypto/util": "5.2.0",
|
|
72
|
-
"@aws-sdk/util-locate-window": "3.965.5",
|
|
73
|
-
"@aws-sdk/xml-builder": "3.972.15",
|
|
74
|
-
"@smithy/property-provider": "4.2.12",
|
|
75
|
-
"@smithy/signature-v4": "5.3.12",
|
|
76
|
-
"@aws-sdk/credential-provider-env": "3.972.22",
|
|
77
|
-
"@aws-sdk/credential-provider-http": "3.972.24",
|
|
78
|
-
"@aws-sdk/credential-provider-ini": "3.972.24",
|
|
79
|
-
"@aws-sdk/credential-provider-process": "3.972.22",
|
|
80
|
-
"@aws-sdk/credential-provider-sso": "3.972.24",
|
|
81
|
-
"@aws-sdk/credential-provider-web-identity": "3.972.24",
|
|
82
|
-
"@smithy/credential-provider-imds": "4.2.12",
|
|
83
|
-
"@smithy/shared-ini-file-loader": "4.4.7",
|
|
84
|
-
"@aws-sdk/util-arn-parser": "3.972.3",
|
|
85
|
-
"@smithy/util-config-provider": "4.2.2",
|
|
86
|
-
"@aws-crypto/crc32": "5.2.0",
|
|
87
|
-
"@aws-crypto/crc32c": "5.2.0",
|
|
88
|
-
"@aws-sdk/crc64-nvme": "3.972.5",
|
|
89
|
-
"@smithy/is-array-buffer": "4.2.2",
|
|
90
|
-
"@aws/lambda-invoke-store": "0.2.4",
|
|
91
|
-
"bowser": "2.14.1",
|
|
92
|
-
"@smithy/uuid": "1.1.2",
|
|
93
|
-
"@smithy/eventstream-serde-universal": "4.2.12",
|
|
94
|
-
"@smithy/querystring-builder": "4.2.12",
|
|
95
|
-
"@smithy/chunked-blob-reader": "5.2.2",
|
|
96
|
-
"@smithy/chunked-blob-reader-native": "4.2.3",
|
|
97
|
-
"@smithy/util-buffer-from": "4.2.2",
|
|
98
|
-
"@smithy/service-error-classification": "4.2.12",
|
|
99
|
-
"@smithy/abort-controller": "4.2.12",
|
|
100
|
-
"@smithy/querystring-parser": "4.2.12",
|
|
101
|
-
"@smithy/util-hex-encoding": "4.2.2",
|
|
102
|
-
"fast-xml-parser": "5.5.6",
|
|
103
|
-
"@smithy/util-uri-escape": "4.2.2",
|
|
104
|
-
"@aws-sdk/credential-provider-login": "3.972.24",
|
|
105
|
-
"@aws-sdk/nested-clients": "3.996.14",
|
|
106
|
-
"@aws-sdk/token-providers": "3.1015.0",
|
|
107
|
-
"@smithy/eventstream-codec": "4.2.12",
|
|
108
|
-
"fast-xml-builder": "1.1.4",
|
|
109
|
-
"path-expression-matcher": "1.2.0",
|
|
110
|
-
"strnum": "2.2.2",
|
|
111
|
-
"@activepieces/pieces-common": "0.12.1",
|
|
112
|
-
"@activepieces/pieces-framework": "0.26.2",
|
|
113
|
-
"@activepieces/shared": "0.57.2"
|
|
16
|
+
"tslib": "2.6.2"
|
|
114
17
|
},
|
|
115
18
|
"scripts": {
|
|
116
19
|
"build": "tsc -p tsconfig.lib.json && cp package.json dist/",
|
package/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,QAAQ;;;;;;GAWnB,CAAC"}
|
package/src/index.js
CHANGED
|
@@ -7,27 +7,21 @@ const read_file_1 = require("./lib/actions/read-file");
|
|
|
7
7
|
const upload_file_1 = require("./lib/actions/upload-file");
|
|
8
8
|
const new_file_1 = require("./lib/triggers/new-file");
|
|
9
9
|
const generate_signed_url_1 = require("./lib/actions/generate-signed-url");
|
|
10
|
+
const generate_signed_upload_url_1 = require("./lib/actions/generate-signed-upload-url");
|
|
10
11
|
const move_file_1 = require("./lib/actions/move-file");
|
|
11
12
|
const delete_file_1 = require("./lib/actions/delete-file");
|
|
12
13
|
const list_files_1 = require("./lib/actions/list-files");
|
|
13
14
|
const decrypt_pgp_file_1 = require("./lib/actions/decrypt-pgp-file");
|
|
14
15
|
const auth_1 = require("./lib/auth");
|
|
15
|
-
const description = `
|
|
16
|
-
This piece allows you to upload files to Amazon S3 or other S3 compatible services.
|
|
17
|
-
|
|
18
|
-
Amazon S3 Settings:
|
|
19
|
-
Regions: https://docs.aws.amazon.com/general/latest/gr/s3.html
|
|
20
|
-
Endpoint: leave blank
|
|
21
|
-
`;
|
|
22
16
|
exports.amazonS3 = (0, pieces_framework_1.createPiece)({
|
|
23
17
|
displayName: 'Amazon S3',
|
|
24
18
|
description: 'Scalable storage in the cloud',
|
|
25
19
|
logoUrl: 'https://cdn.activepieces.com/pieces/amazon-s3.png',
|
|
26
20
|
minimumSupportedRelease: '0.30.0',
|
|
27
|
-
authors: ["Willianwg", "kishanprmr", "MoShizzle", "AbdulTheActivePiecer", "khaledmashaly", "abuaboud", "Kevinyu-alan"],
|
|
21
|
+
authors: ["Willianwg", "kishanprmr", "MoShizzle", "AbdulTheActivePiecer", "khaledmashaly", "abuaboud", "Kevinyu-alan", "hugh-codes"],
|
|
28
22
|
categories: [shared_1.PieceCategory.DEVELOPER_TOOLS],
|
|
29
23
|
auth: auth_1.amazonS3Auth,
|
|
30
|
-
actions: [upload_file_1.amazons3UploadFile, read_file_1.readFile, generate_signed_url_1.generateSignedUrl, move_file_1.moveFile, delete_file_1.deleteFile, list_files_1.listFiles, decrypt_pgp_file_1.decryptPgpFile],
|
|
24
|
+
actions: [upload_file_1.amazons3UploadFile, read_file_1.readFile, generate_signed_url_1.generateSignedUrl, generate_signed_upload_url_1.generateSignedUploadUrl, move_file_1.moveFile, delete_file_1.deleteFile, list_files_1.listFiles, decrypt_pgp_file_1.decryptPgpFile],
|
|
31
25
|
triggers: [new_file_1.newFile],
|
|
32
26
|
});
|
|
33
27
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,qEAIwC;AACxC,iDAAqD;AACrD,uDAAmD;AACnD,2DAA+D;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,qEAIwC;AACxC,iDAAqD;AACrD,uDAAmD;AACnD,2DAA+D;AAC/D,sDAAkD;AAClD,2EAAsE;AACtE,yFAAmF;AACnF,uDAAmD;AACnD,2DAAuD;AACvD,yDAAqD;AACrD,qEAAgE;AAChE,qCAA0C;AAE7B,QAAA,QAAQ,GAAG,IAAA,8BAAW,EAAC;IAClC,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,+BAA+B;IAE5C,OAAO,EAAE,mDAAmD;IAC5D,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,sBAAsB,EAAE,eAAe,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,CAAC;IACpI,UAAU,EAAE,CAAC,sBAAa,CAAC,eAAe,CAAC;IAC3C,IAAI,EAAE,mBAAY;IAClB,OAAO,EAAE,CAAC,gCAAkB,EAAE,oBAAQ,EAAE,uCAAiB,EAAE,oDAAuB,EAAE,oBAAQ,EAAE,wBAAU,EAAE,sBAAS,EAAE,iCAAc,CAAC;IACpI,QAAQ,EAAE,CAAC,kBAAO,CAAC;CACpB,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const generateSignedUploadUrl: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
accessKeyId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
secretAccessKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
4
|
+
bucket: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
5
|
+
endpoint: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
6
|
+
region: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
7
|
+
}>, {
|
|
8
|
+
key: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
9
|
+
expiresIn: import("@activepieces/pieces-framework").NumberProperty<true>;
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=generate-signed-upload-url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-signed-upload-url.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/generate-signed-upload-url.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,uBAAuB;;;;;;;;;EA+ClC,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateSignedUploadUrl = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
7
|
+
const s3_request_presigner_1 = require("@aws-sdk/s3-request-presigner");
|
|
8
|
+
const auth_1 = require("../auth");
|
|
9
|
+
exports.generateSignedUploadUrl = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: auth_1.amazonS3Auth,
|
|
11
|
+
name: 'generate-signed-upload-url',
|
|
12
|
+
displayName: 'Generate Signed Upload URL',
|
|
13
|
+
description: 'Generate a pre-signed URL that allows anyone with the link to upload a file directly to S3 without needing AWS credentials.',
|
|
14
|
+
props: {
|
|
15
|
+
key: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'File Key',
|
|
17
|
+
description: 'The destination path and filename inside the bucket, e.g. "uploads/photo.jpg".',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
expiresIn: pieces_framework_1.Property.Number({
|
|
21
|
+
displayName: 'Expires In (minutes)',
|
|
22
|
+
description: 'How long the upload URL should remain valid (in minutes).',
|
|
23
|
+
required: true,
|
|
24
|
+
defaultValue: 10,
|
|
25
|
+
}),
|
|
26
|
+
},
|
|
27
|
+
run(context) {
|
|
28
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
const { bucket, region, accessKeyId, secretAccessKey, endpoint } = context.auth.props;
|
|
30
|
+
const { key, expiresIn } = context.propsValue;
|
|
31
|
+
const client = new client_s3_1.S3Client(Object.assign({ region, credentials: {
|
|
32
|
+
accessKeyId,
|
|
33
|
+
secretAccessKey,
|
|
34
|
+
} }, (endpoint ? { endpoint, forcePathStyle: true } : {})));
|
|
35
|
+
const command = new client_s3_1.PutObjectCommand({
|
|
36
|
+
Bucket: bucket,
|
|
37
|
+
Key: key,
|
|
38
|
+
});
|
|
39
|
+
const signedUrl = yield (0, s3_request_presigner_1.getSignedUrl)(client, command, {
|
|
40
|
+
expiresIn: (expiresIn !== null && expiresIn !== void 0 ? expiresIn : 10) * 60,
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
url: signedUrl,
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=generate-signed-upload-url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-signed-upload-url.js","sourceRoot":"","sources":["../../../../src/lib/actions/generate-signed-upload-url.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,kDAAgE;AAChE,wEAA6D;AAC7D,kCAAuC;AAE1B,QAAA,uBAAuB,GAAG,IAAA,+BAAY,EAAC;IAClD,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,4BAA4B;IAClC,WAAW,EAAE,4BAA4B;IACzC,WAAW,EACT,6HAA6H;IAC/H,KAAK,EAAE;QACL,GAAG,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACtB,WAAW,EAAE,UAAU;YACvB,WAAW,EACT,gFAAgF;YAClF,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACzB,WAAW,EAAE,sBAAsB;YACnC,WAAW,EAAE,2DAA2D;YACxE,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,EAAE;SACjB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,QAAQ,EAAE,GAC9D,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;YACrB,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAE9C,MAAM,MAAM,GAAG,IAAI,oBAAQ,iBACzB,MAAM,EACN,WAAW,EAAE;oBACX,WAAW;oBACX,eAAe;iBAChB,IACE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EACvD,CAAC;YAEH,MAAM,OAAO,GAAG,IAAI,4BAAgB,CAAC;gBACnC,MAAM,EAAE,MAAM;gBACd,GAAG,EAAE,GAAG;aACT,CAAC,CAAC;YAEH,MAAM,SAAS,GAAG,MAAM,IAAA,mCAAY,EAAC,MAAM,EAAE,OAAO,EAAE;gBACpD,SAAS,EAAE,CAAC,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE,CAAC,GAAG,EAAE;aAClC,CAAC,CAAC;YAEH,OAAO;gBACL,GAAG,EAAE,SAAS;aACf,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
|