@lowdefy/plugin-aws 4.0.2 → 4.2.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.
@@ -1,63 +0,0 @@
1
- {
2
- "type": "object",
3
- "properties": {
4
- "type": "object",
5
- "required": ["s3PostPolicyRequestId"],
6
- "properties": {
7
- "s3PostPolicyRequestId": {
8
- "type": "string",
9
- "description": "Id of a request of type AwsS3PresignedPostPolicy that defines to which S3 bucket and how the file should be uploaded.",
10
- "docs": {
11
- "displayType": "manual",
12
- "block": {
13
- "id": "block_properties_s3PostPolicyRequestId",
14
- "layout": { "_global": "settings_input_layout" },
15
- "type": "Label",
16
- "required": true,
17
- "properties": {
18
- "title": "s3PostPolicyRequestId",
19
- "span": 8,
20
- "align": "right"
21
- },
22
- "blocks": [
23
- {
24
- "id": "block_properties_s3PostPolicyRequestId_text",
25
- "type": "Markdown",
26
- "style": {
27
- "color": "#8c8c8c"
28
- },
29
- "properties": {
30
- "content": "Id of a request of type AwsS3PresignedPostPolicy that defines to which S3 bucket and how the file should be uploaded."
31
- }
32
- }
33
- ]
34
- },
35
- "getter": {}
36
- }
37
- },
38
- "showUploadList": {
39
- "type": "boolean",
40
- "default": true,
41
- "description": "Whether to show default upload list."
42
- },
43
- "singleFile": {
44
- "type": "boolean",
45
- "default": false,
46
- "description": "Only allow a single file to be uploaded. Only one file can be selected in the prompt and the upload button is disabled after a file is uploaded."
47
- }
48
- }
49
- },
50
- "events": {
51
- "type": "object",
52
- "properties": {
53
- "onChange": {
54
- "type": "array",
55
- "description": "Triggered when the upload state is changing."
56
- },
57
- "onClick": {
58
- "type": "array",
59
- "description": "Triggered when the upload button is clicked."
60
- }
61
- }
62
- }
63
- }
@@ -1,17 +0,0 @@
1
- /*
2
- Copyright 2020-2024 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */
16
-
17
- @import 'antd/lib/upload/style/index.less';
package/dist/blocks.js DELETED
@@ -1,16 +0,0 @@
1
- /*
2
- Copyright 2020-2024 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ export { default as S3UploadButton } from './blocks/S3UploadButton/S3UploadButton.js';
16
- export { default as S3UploadPhoto } from './blocks/S3UploadPhoto/S3UploadPhoto.js';
@@ -1,24 +0,0 @@
1
- /*
2
- Copyright 2020-2024 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ import AwsS3PresignedGetObject from './AwsS3PresignedGetObject/AwsS3PresignedGetObject.js';
16
- import AwsS3PresignedPostPolicy from './AwsS3PresignedPostPolicy/AwsS3PresignedPostPolicy.js';
17
- import schema from './schema.js';
18
- export default {
19
- schema,
20
- requests: {
21
- AwsS3PresignedGetObject,
22
- AwsS3PresignedPostPolicy
23
- }
24
- };
@@ -1,41 +0,0 @@
1
- /*
2
- Copyright 2020-2024 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ import AWS from 'aws-sdk';
16
- import schema from './schema.js';
17
- function AwsS3PresignedGetObject({ request, connection }) {
18
- const { accessKeyId, secretAccessKey, region, bucket } = connection;
19
- const { expires, key, versionId, responseContentDisposition, responseContentType } = request;
20
- const params = {
21
- Bucket: bucket,
22
- Key: key,
23
- Expires: expires,
24
- VersionId: versionId,
25
- ResponseContentDisposition: responseContentDisposition,
26
- ResponseContentType: responseContentType
27
- };
28
- const s3 = new AWS.S3({
29
- accessKeyId,
30
- secretAccessKey,
31
- region,
32
- bucket
33
- });
34
- return s3.getSignedUrl('getObject', params);
35
- }
36
- AwsS3PresignedGetObject.schema = schema;
37
- AwsS3PresignedGetObject.meta = {
38
- checkRead: true,
39
- checkWrite: false
40
- };
41
- export default AwsS3PresignedGetObject;
@@ -1,64 +0,0 @@
1
- /*
2
- Copyright 2020-2024 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ export default {
16
- $schema: 'http://json-schema.org/draft-07/schema#',
17
- title: 'Lowdefy Request Schema - AwsS3PresignedGetObject',
18
- type: 'object',
19
- required: [
20
- 'key'
21
- ],
22
- properties: {
23
- expires: {
24
- type: 'number',
25
- description: 'Number of seconds for which the policy should be valid.',
26
- default: 3600,
27
- errorMessage: {
28
- type: 'AwsS3PresignedGetObject request property "expires" should be a number.'
29
- }
30
- },
31
- key: {
32
- type: 'string',
33
- description: 'Key under which object is stored.',
34
- errorMessage: {
35
- type: 'AwsS3PresignedGetObject request property "key" should be a string.'
36
- }
37
- },
38
- responseContentDisposition: {
39
- type: 'string',
40
- description: 'Sets the Content-Disposition header of the response.',
41
- errorMessage: {
42
- type: 'AwsS3PresignedGetObject request property "responseContentDisposition" should be a string.'
43
- }
44
- },
45
- responseContentType: {
46
- type: 'string',
47
- description: 'Sets the Content-Type header of the response.',
48
- errorMessage: {
49
- type: 'AwsS3PresignedGetObject request property "responseContentType" should be a string.'
50
- }
51
- },
52
- versionId: {
53
- type: 'string',
54
- description: 'VersionId used to reference a specific version of the object.',
55
- errorMessage: {
56
- type: 'AwsS3PresignedGetObject request property "versionId" should be a string.'
57
- }
58
- }
59
- },
60
- errorMessage: {
61
- type: 'AwsS3PresignedGetObject request properties should be an object.',
62
- required: 'AwsS3PresignedGetObject request should have required property "key".'
63
- }
64
- };
@@ -1,48 +0,0 @@
1
- /*
2
- Copyright 2020-2024 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ import AWS from 'aws-sdk';
16
- import schema from './schema.js';
17
- function AwsS3PresignedPostPolicy({ request, connection }) {
18
- const { accessKeyId, secretAccessKey, region, bucket } = connection;
19
- const { acl, conditions, expires, key } = request;
20
- const params = {
21
- Bucket: bucket,
22
- Fields: {
23
- key
24
- }
25
- };
26
- if (conditions) {
27
- params.Conditions = conditions;
28
- }
29
- if (expires) {
30
- params.Expires = expires;
31
- }
32
- if (acl) {
33
- params.Fields.acl = acl;
34
- }
35
- const s3 = new AWS.S3({
36
- accessKeyId,
37
- secretAccessKey,
38
- region,
39
- bucket
40
- });
41
- return s3.createPresignedPost(params);
42
- }
43
- AwsS3PresignedPostPolicy.schema = schema;
44
- AwsS3PresignedPostPolicy.meta = {
45
- checkRead: false,
46
- checkWrite: true
47
- };
48
- export default AwsS3PresignedPostPolicy;
@@ -1,70 +0,0 @@
1
- /*
2
- Copyright 2020-2024 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ export default {
16
- $schema: 'http://json-schema.org/draft-07/schema#',
17
- title: 'Lowdefy Request Schema - AwsS3PresignedPostPolicy',
18
- type: 'object',
19
- required: [
20
- 'key'
21
- ],
22
- properties: {
23
- acl: {
24
- type: 'string',
25
- enum: [
26
- 'private',
27
- 'public-read',
28
- 'public-read-write',
29
- 'aws-exec-read',
30
- 'authenticated-read',
31
- 'bucket-owner-read',
32
- 'bucket-owner-full-control'
33
- ],
34
- description: 'Access control lists used to grant read and write access.',
35
- errorMessage: {
36
- type: 'AwsS3PresignedPostPolicy request property "acl" should be a string.',
37
- enum: 'AwsS3PresignedPostPolicy request property "acl" is not one of "private", "public-read", "public-read-write", "aws-exec-read", "authenticated-read", "bucket-owner-read", "bucket-owner-full-control".'
38
- }
39
- },
40
- conditions: {
41
- type: 'array',
42
- items: {
43
- type: 'array'
44
- },
45
- description: 'Conditions to be enforced on the request.',
46
- errorMessage: {
47
- type: 'AwsS3PresignedPostPolicy request property "conditions" should be a array.'
48
- }
49
- },
50
- expires: {
51
- type: 'number',
52
- description: 'Number of seconds for which the policy should be valid.',
53
- default: 3600,
54
- errorMessage: {
55
- type: 'AwsS3PresignedPostPolicy request property "expires" should be a number.'
56
- }
57
- },
58
- key: {
59
- type: 'string',
60
- description: 'Key under which object will be stored.',
61
- errorMessage: {
62
- type: 'AwsS3PresignedPostPolicy request property "key" should be a string.'
63
- }
64
- }
65
- },
66
- errorMessage: {
67
- type: 'AwsS3PresignedPostPolicy request properties should be an object.',
68
- required: 'AwsS3PresignedPostPolicy request should have required property "key".'
69
- }
70
- };
@@ -1,80 +0,0 @@
1
- /*
2
- Copyright 2020-2024 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ export default {
16
- $schema: 'http://json-schema.org/draft-07/schema#',
17
- title: 'Lowdefy Connection Schema - AwsS3Bucket',
18
- type: 'object',
19
- required: [
20
- 'accessKeyId',
21
- 'secretAccessKey',
22
- 'region',
23
- 'bucket'
24
- ],
25
- properties: {
26
- accessKeyId: {
27
- type: 'string',
28
- description: 'AWS IAM access key id with s3 access.',
29
- errorMessage: {
30
- type: 'AwsS3Bucket connection property "accessKeyId" should be a string.'
31
- }
32
- },
33
- secretAccessKey: {
34
- type: 'string',
35
- description: 'AWS IAM secret access key with s3 access.',
36
- errorMessage: {
37
- type: 'AwsS3Bucket connection property "secretAccessKey" should be a string.'
38
- }
39
- },
40
- region: {
41
- type: 'string',
42
- description: 'AWS region the bucket is located in.',
43
- errorMessage: {
44
- type: 'AwsS3Bucket connection property "region" should be a string.'
45
- }
46
- },
47
- bucket: {
48
- type: 'string',
49
- description: 'S3 bucket name.',
50
- errorMessage: {
51
- type: 'AwsS3Bucket connection property "bucket" should be a string.'
52
- }
53
- },
54
- read: {
55
- type: 'boolean',
56
- default: true,
57
- description: 'Allow reads from the bucket.',
58
- errorMessage: {
59
- type: 'AwsS3Bucket connection property "read" should be a boolean.'
60
- }
61
- },
62
- write: {
63
- type: 'boolean',
64
- default: false,
65
- description: 'Allow writes to the bucket.',
66
- errorMessage: {
67
- type: 'AwsS3Bucket connection property "write" should be a boolean.'
68
- }
69
- }
70
- },
71
- errorMessage: {
72
- type: 'AwsS3Bucket connection properties should be an object.',
73
- required: {
74
- accessKeyId: 'AwsS3Bucket connection should have required property "accessKeyId".',
75
- secretAccessKey: 'AwsS3Bucket connection should have required property "secretAccessKey".',
76
- region: 'AwsS3Bucket connection should have required property "region".',
77
- bucket: 'AwsS3Bucket connection should have required property "bucket".'
78
- }
79
- }
80
- };
@@ -1,15 +0,0 @@
1
- /*
2
- Copyright 2020-2024 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ export { default as AwsS3Bucket } from './connections/AwsS3Bucket/AwsS3Bucket.js';
package/dist/types.js DELETED
@@ -1,32 +0,0 @@
1
- /* eslint-disable import/namespace */ /*
2
- Copyright 2020-2024 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ import * as connections from './connections.js';
16
- import * as blocks from './blocks.js';
17
- const icons = {};
18
- const styles = {};
19
- Object.keys(blocks).forEach((block)=>{
20
- icons[block] = blocks[block].meta.icons ?? [];
21
- styles[block] = blocks[block].meta.styles ?? [];
22
- });
23
- export default {
24
- blocks: Object.keys(blocks),
25
- icons,
26
- styles: {
27
- default: [],
28
- ...styles
29
- },
30
- connections: Object.keys(connections),
31
- requests: Object.keys(connections).map((connection)=>Object.keys(connections[connection].requests)).flat()
32
- };