@activepieces/piece-amazon-s3 0.0.1
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/README.md +7 -0
- package/package.json +15 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +19 -0
- package/src/index.js.map +1 -0
- package/src/lib/actions/upload-file-from-base64.d.ts +1 -0
- package/src/lib/actions/upload-file-from-base64.js +140 -0
- package/src/lib/actions/upload-file-from-base64.js.map +1 -0
- package/src/lib/actions/upload-file-from-url.d.ts +1 -0
- package/src/lib/actions/upload-file-from-url.js +93 -0
- package/src/lib/actions/upload-file-from-url.js.map +1 -0
- package/src/lib/common/auth.d.ts +6 -0
- package/src/lib/common/auth.js +147 -0
- package/src/lib/common/auth.js.map +1 -0
package/README.md
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@activepieces/piece-amazon-s3",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"dependencies": {
|
|
5
|
+
"@aws-sdk/client-s3": "3.276.0",
|
|
6
|
+
"@sinclair/typebox": "0.26.8",
|
|
7
|
+
"axios": "1.2.4",
|
|
8
|
+
"nanoid": "3.3.4",
|
|
9
|
+
"@activepieces/pieces-framework": "0.3.16",
|
|
10
|
+
"@activepieces/shared": "0.3.18",
|
|
11
|
+
"tslib": "2.4.1"
|
|
12
|
+
},
|
|
13
|
+
"main": "./src/index.js",
|
|
14
|
+
"types": "./src/index.d.ts"
|
|
15
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const amazonS3: import("@activepieces/pieces-framework").Piece;
|
package/src/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.amazonS3 = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const package_json_1 = tslib_1.__importDefault(require("../package.json"));
|
|
7
|
+
const upload_file_from_url_1 = require("./lib/actions/upload-file-from-url");
|
|
8
|
+
const upload_file_from_base64_1 = require("./lib/actions/upload-file-from-base64");
|
|
9
|
+
exports.amazonS3 = (0, pieces_framework_1.createPiece)({
|
|
10
|
+
name: "amazon-s3",
|
|
11
|
+
displayName: "Amazon S3",
|
|
12
|
+
logoUrl: "https://cdn.activepieces.com/pieces/amazon-s3.png",
|
|
13
|
+
version: package_json_1.default.version,
|
|
14
|
+
minimumSupportedRelease: "0.3.12",
|
|
15
|
+
authors: ["Willianwg"],
|
|
16
|
+
actions: [upload_file_from_base64_1.uploadBase64File, upload_file_from_url_1.uploadFileFromUrl],
|
|
17
|
+
triggers: [],
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/pieces/amazon-s3/src/index.ts"],"names":[],"mappings":";;;;AACA,qEAA6D;AAC7D,2EAA0C;AAC1C,6EAAuE;AACvE,mFAAyE;AAE5D,QAAA,QAAQ,GAAG,IAAA,8BAAW,EAAC;IAClC,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,WAAW;IACxB,OAAO,EAAE,mDAAmD;IAC5D,OAAO,EAAE,sBAAW,CAAC,OAAO;IAC5B,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,CAAC,WAAW,CAAC;IACtB,OAAO,EAAE,CAAC,0CAAgB,EAAE,wCAAiB,CAAC;IAC9C,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const uploadBase64File: import("@activepieces/pieces-framework").Action;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uploadBase64File = 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 auth_1 = require("../common/auth");
|
|
8
|
+
exports.uploadBase64File = (0, pieces_framework_1.createAction)({
|
|
9
|
+
name: 'upload-base64-file',
|
|
10
|
+
displayName: "Upload base64 File",
|
|
11
|
+
description: "Upload an File to S3 by using it's base64 string",
|
|
12
|
+
props: {
|
|
13
|
+
authentication: auth_1.auth,
|
|
14
|
+
base64: pieces_framework_1.Property.LongText({
|
|
15
|
+
displayName: 'Base64',
|
|
16
|
+
required: true,
|
|
17
|
+
}),
|
|
18
|
+
fileName: pieces_framework_1.Property.ShortText({
|
|
19
|
+
displayName: 'File Name',
|
|
20
|
+
required: false,
|
|
21
|
+
description: "my-file-name (no extension)"
|
|
22
|
+
}),
|
|
23
|
+
acl: pieces_framework_1.Property.StaticDropdown({
|
|
24
|
+
displayName: 'ACL',
|
|
25
|
+
required: false,
|
|
26
|
+
options: {
|
|
27
|
+
options: [
|
|
28
|
+
{
|
|
29
|
+
label: "private",
|
|
30
|
+
value: "private"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
label: "public-read",
|
|
34
|
+
value: "public-read"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: "public-read-write",
|
|
38
|
+
value: "public-read-write"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
label: "authenticated-read",
|
|
42
|
+
value: "authenticated-read"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
label: "aws-exec-read",
|
|
46
|
+
value: "aws-exec-read"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
label: "bucket-owner-read",
|
|
50
|
+
value: "bucket-owner-read"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
label: "bucket-owner-full-control",
|
|
54
|
+
value: "bucket-owner-full-control"
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
}),
|
|
59
|
+
type: pieces_framework_1.Property.StaticDropdown({
|
|
60
|
+
displayName: 'Type',
|
|
61
|
+
required: true,
|
|
62
|
+
options: {
|
|
63
|
+
options: [
|
|
64
|
+
{
|
|
65
|
+
label: "image/png",
|
|
66
|
+
value: "image/png"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
label: "image/jpeg",
|
|
70
|
+
value: "image/jpeg"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
label: "image/gif",
|
|
74
|
+
value: "image/gif"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
label: "audio/mpeg",
|
|
78
|
+
value: "audio/mpeg"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
label: "audio/wav",
|
|
82
|
+
value: "audio/wav"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
label: "video/mp4",
|
|
86
|
+
value: "video/mp4"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
label: "application/pdf",
|
|
90
|
+
value: "application/pdf"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
label: "application/msword",
|
|
94
|
+
value: "application/msword"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
label: "text/plain",
|
|
98
|
+
value: "text/plain"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
label: "application/json",
|
|
102
|
+
value: "application/json"
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
}),
|
|
107
|
+
},
|
|
108
|
+
run(context) {
|
|
109
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
110
|
+
const { accessKeyId, secretAccessKey, region, bucket } = context.propsValue.authentication;
|
|
111
|
+
const { base64, fileName: imageName, acl, type } = context.propsValue;
|
|
112
|
+
const buffer = Buffer.from(base64.replace(/^data:image\/\w+;base64,/, ""), 'base64');
|
|
113
|
+
const s3 = new client_s3_1.S3({
|
|
114
|
+
credentials: {
|
|
115
|
+
accessKeyId,
|
|
116
|
+
secretAccessKey
|
|
117
|
+
},
|
|
118
|
+
region: region || "us-east-1"
|
|
119
|
+
});
|
|
120
|
+
const contentType = type;
|
|
121
|
+
const [_, ext] = contentType.split("/");
|
|
122
|
+
const extension = "." + ext;
|
|
123
|
+
const generatedName = new Date().toISOString() + Date.now() + extension;
|
|
124
|
+
const finalFileName = imageName ? imageName + extension : generatedName;
|
|
125
|
+
const uploadResponse = yield s3.putObject({
|
|
126
|
+
Bucket: bucket,
|
|
127
|
+
Key: finalFileName,
|
|
128
|
+
ACL: acl,
|
|
129
|
+
ContentType: contentType,
|
|
130
|
+
Body: buffer,
|
|
131
|
+
});
|
|
132
|
+
return {
|
|
133
|
+
fileName: finalFileName,
|
|
134
|
+
url: `https://${bucket}.s3.${region}.amazonaws.com/${finalFileName}`,
|
|
135
|
+
etag: uploadResponse.ETag,
|
|
136
|
+
};
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
//# sourceMappingURL=upload-file-from-base64.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-file-from-base64.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/amazon-s3/src/lib/actions/upload-file-from-base64.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,kDAAwC;AACxC,yCAAsC;AAEzB,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,kDAAkD;IAC/D,KAAK,EAAE;QACH,cAAc,EAAE,WAAI;QACpB,MAAM,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACtB,WAAW,EAAE,QAAQ;YACrB,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACzB,WAAW,EAAE,WAAW;Y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AG,EAAE,aAAa;gBAClB,GAAG,EAAE,GAAG;gBACR,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,MAAM;aACf,CAAC,CAAA;YAEF,OAAO;gBACH,QAAQ,EAAE,aAAa;gBACvB,GAAG,EAAE,WAAW,MAAM,OAAO,MAAM,kBAAkB,aAAa,EAAE;gBACpE,IAAI,EAAE,cAAc,CAAC,IAAI;aAC5B,CAAC;QACN,CAAC;KAAA;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const uploadFileFromUrl: import("@activepieces/pieces-framework").Action;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uploadFileFromUrl = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const auth_1 = require("../common/auth");
|
|
7
|
+
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
8
|
+
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
9
|
+
exports.uploadFileFromUrl = (0, pieces_framework_1.createAction)({
|
|
10
|
+
name: 'upload-file-from-url',
|
|
11
|
+
displayName: "Upload File from URL",
|
|
12
|
+
description: "Upload an file to S3 by using it's url",
|
|
13
|
+
props: {
|
|
14
|
+
authentication: auth_1.auth,
|
|
15
|
+
url: pieces_framework_1.Property.LongText({
|
|
16
|
+
displayName: 'url',
|
|
17
|
+
required: true,
|
|
18
|
+
}),
|
|
19
|
+
imageName: pieces_framework_1.Property.ShortText({
|
|
20
|
+
displayName: 'File Name',
|
|
21
|
+
required: false,
|
|
22
|
+
description: "my-file-name (no extension)"
|
|
23
|
+
}),
|
|
24
|
+
acl: pieces_framework_1.Property.StaticDropdown({
|
|
25
|
+
displayName: 'ACL',
|
|
26
|
+
required: false,
|
|
27
|
+
options: {
|
|
28
|
+
options: [
|
|
29
|
+
{
|
|
30
|
+
label: "private",
|
|
31
|
+
value: "private"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
label: "public-read",
|
|
35
|
+
value: "public-read"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
label: "public-read-write",
|
|
39
|
+
value: "public-read-write"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
label: "authenticated-read",
|
|
43
|
+
value: "authenticated-read"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: "aws-exec-read",
|
|
47
|
+
value: "aws-exec-read"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
label: "bucket-owner-read",
|
|
51
|
+
value: "bucket-owner-read"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
label: "bucket-owner-full-control",
|
|
55
|
+
value: "bucket-owner-full-control"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
}),
|
|
60
|
+
},
|
|
61
|
+
run(context) {
|
|
62
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
const { accessKeyId, secretAccessKey, region, bucket } = context.propsValue.authentication;
|
|
64
|
+
const { url, imageName, acl } = context.propsValue;
|
|
65
|
+
const s3 = new client_s3_1.S3({
|
|
66
|
+
credentials: {
|
|
67
|
+
accessKeyId,
|
|
68
|
+
secretAccessKey
|
|
69
|
+
},
|
|
70
|
+
region: region || "us-east-1"
|
|
71
|
+
});
|
|
72
|
+
const response = yield axios_1.default.get(url, { responseType: 'arraybuffer' });
|
|
73
|
+
const contentType = response.headers['content-type'];
|
|
74
|
+
const [_, ext] = contentType.split("/");
|
|
75
|
+
const extension = "." + ext;
|
|
76
|
+
const generatedName = new Date().toISOString() + Date.now() + extension;
|
|
77
|
+
const finalFileName = imageName ? imageName + extension : generatedName;
|
|
78
|
+
const uploadResponse = yield s3.putObject({
|
|
79
|
+
Bucket: bucket,
|
|
80
|
+
Key: finalFileName,
|
|
81
|
+
ACL: (!acl || acl.length === 0) ? undefined : acl,
|
|
82
|
+
ContentType: contentType,
|
|
83
|
+
Body: response.data,
|
|
84
|
+
});
|
|
85
|
+
return {
|
|
86
|
+
fileName: finalFileName,
|
|
87
|
+
url: `https://${bucket}.s3.${region}.amazonaws.com/${finalFileName}`,
|
|
88
|
+
etag: uploadResponse.ETag,
|
|
89
|
+
};
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
//# sourceMappingURL=upload-file-from-url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-file-from-url.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/amazon-s3/src/lib/actions/upload-file-from-url.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,yCAAsC;AACtC,kDAAwC;AACxC,0DAA0B;AAEb,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE,wCAAwC;IACrD,KAAK,EAAE;QACH,cAAc,EAAE,WAAI;QACpB,GAAG,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACnB,WAAW,EAAE,KAAK;YAClB,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,WAAW;YACxB,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,6BAA6B;SAC7C,CAAC;QACF,GAAG,EAAE,2BAAQ,CAAC,cAAc,CAAC;YACzB,WAAW,EAAE,KAAK;YAClB,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACL,OAAO,EAAE;oBACL;wBACI,KAAK,EAAE,SAAS;wBAChB,KAAK,EAAE,SAAS;qBACnB;oBACD;wBACI,KAAK,EAAE,aAAa;wBACpB,KAAK,EAAE,aAAa;qBACvB;oBACD;wBACI,KAAK,EAAE,mBAAmB;wBAC1B,KAAK,EAAE,mBAAmB;qBAC7B;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AAC;gBACtC,MAAM,EAAE,MAAM;gBACd,GAAG,EAAE,aAAa;gBAClB,GAAG,EAAE,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG;gBACjD,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,QAAQ,CAAC,IAAI;aACtB,CAAC,CAAA;YAEF,OAAO;gBACH,QAAQ,EAAE,aAAa;gBACvB,GAAG,EAAE,WAAW,MAAM,OAAO,MAAM,kBAAkB,aAAa,EAAE;gBACpE,IAAI,EAAE,cAAc,CAAC,IAAI;aAC5B,CAAC;QACN,CAAC;KAAA;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const auth: import("@activepieces/pieces-framework").CustomAuthProperty<true, {
|
|
2
|
+
accessKeyId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
secretAccessKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
4
|
+
region: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
5
|
+
bucket: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
6
|
+
}>;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.auth = void 0;
|
|
4
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
5
|
+
exports.auth = pieces_framework_1.Property.CustomAuth({
|
|
6
|
+
displayName: "Authentication",
|
|
7
|
+
props: {
|
|
8
|
+
accessKeyId: pieces_framework_1.Property.ShortText({
|
|
9
|
+
displayName: 'Access Key ID',
|
|
10
|
+
required: true,
|
|
11
|
+
}),
|
|
12
|
+
secretAccessKey: pieces_framework_1.Property.SecretText({
|
|
13
|
+
displayName: 'Secret Access Key',
|
|
14
|
+
required: true,
|
|
15
|
+
}),
|
|
16
|
+
region: pieces_framework_1.Property.StaticDropdown({
|
|
17
|
+
displayName: 'Region',
|
|
18
|
+
options: {
|
|
19
|
+
"options": [
|
|
20
|
+
{
|
|
21
|
+
"label": "US East (N. Virginia) [us-east-1]",
|
|
22
|
+
"value": "us-east-1"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"label": "US East (Ohio) [us-east-2]",
|
|
26
|
+
"value": "us-east-2"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"label": "US West (N. California) [us-west-1]",
|
|
30
|
+
"value": "us-west-1"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"label": "US West (Oregon) [us-west-2]",
|
|
34
|
+
"value": "us-west-2"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"label": "Africa (Cape Town) [af-south-1]",
|
|
38
|
+
"value": "af-south-1"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"label": "Asia Pacific (Hong Kong) [ap-east-1]",
|
|
42
|
+
"value": "ap-east-1"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"label": "Asia Pacific (Mumbai) [ap-south-1]",
|
|
46
|
+
"value": "ap-south-1"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"label": "Asia Pacific (Osaka-Local) [ap-northeast-3]",
|
|
50
|
+
"value": "ap-northeast-3"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"label": "Asia Pacific (Seoul) [ap-northeast-2]",
|
|
54
|
+
"value": "ap-northeast-2"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"label": "Asia Pacific (Singapore) [ap-southeast-1]",
|
|
58
|
+
"value": "ap-southeast-1"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"label": "Asia Pacific (Sydney) [ap-southeast-2]",
|
|
62
|
+
"value": "ap-southeast-2"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"label": "Asia Pacific (Tokyo) [ap-northeast-1]",
|
|
66
|
+
"value": "ap-northeast-1"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"label": "Canada (Central) [ca-central-1]",
|
|
70
|
+
"value": "ca-central-1"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"label": "Europe (Frankfurt) [eu-central-1]",
|
|
74
|
+
"value": "eu-central-1"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"label": "Europe (Ireland) [eu-west-1]",
|
|
78
|
+
"value": "eu-west-1"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"label": "Europe (London) [eu-west-2]",
|
|
82
|
+
"value": "eu-west-2"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"label": "Europe (Milan) [eu-south-1]",
|
|
86
|
+
"value": "eu-south-1"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"label": "Europe (Paris) [eu-west-3]",
|
|
90
|
+
"value": "eu-west-3"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"label": "Europe (Stockholm) [eu-north-1]",
|
|
94
|
+
"value": "eu-north-1"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"label": "Middle East (Bahrain) [me-south-1]",
|
|
98
|
+
"value": "me-south-1"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"label": "South America (São Paulo) [sa-east-1]",
|
|
102
|
+
"value": "sa-east-1"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"label": "Europe (Spain) [eu-south-2]",
|
|
106
|
+
"value": "eu-south-2"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"label": "Asia Pacific (Hyderabad) [ap-south-2]",
|
|
110
|
+
"value": "ap-south-2"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"label": "Asia Pacific (Jakarta) [ap-southeast-3]",
|
|
114
|
+
"value": "ap-southeast-3"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"label": "Asia Pacific (Melbourne) [ap-southeast-4]",
|
|
118
|
+
"value": "ap-southeast-4"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"label": "China (Beijing) [cn-north-1]",
|
|
122
|
+
"value": "cn-north-1"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"label": "China (Ningxia) [cn-northwest-1]",
|
|
126
|
+
"value": "cn-northwest-1"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"label": "Europe (Zurich) [eu-central-2]",
|
|
130
|
+
"value": "eu-central-2"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"label": "Middle East (UAE) [me-central-1]",
|
|
134
|
+
"value": "me-central-1"
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
required: true,
|
|
139
|
+
}),
|
|
140
|
+
bucket: pieces_framework_1.Property.ShortText({
|
|
141
|
+
displayName: 'Bucket',
|
|
142
|
+
required: true,
|
|
143
|
+
})
|
|
144
|
+
},
|
|
145
|
+
required: true
|
|
146
|
+
});
|
|
147
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/amazon-s3/src/lib/common/auth.ts"],"names":[],"mappings":";;;AAAA,qEAA0D;AAE7C,QAAA,IAAI,GAAG,2BAAQ,CAAC,UAAU,CAAC;IACpC,WAAW,EAAE,gBAAgB;IAC7B,KAAK,EAAE;QACH,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,eAAe;YAC5B,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,eAAe,EAAE,2BAAQ,CAAC,UAAU,CAAC;YACjC,WAAW,EAAE,mBAAmB;YAChC,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC5B,WAAW,EAAE,QAAQ;YACrB,OAAO,EAAE;g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