@pi-r/aws-lib 0.7.3 → 0.7.4

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/LICENSE CHANGED
@@ -1,7 +1,7 @@
1
- Copyright 2024 An Pham
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
-
5
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
-
1
+ Copyright 2024 An Pham
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
7
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
- ### @pi-r/aws-lib
2
-
3
- https://e-mc.readthedocs.io/en/latest/cloud/aws.html
4
-
5
- ### LICENSE
6
-
1
+ ### @pi-r/aws-lib
2
+
3
+ https://e-mc.readthedocs.io/en/latest/cloud/aws.html
4
+
5
+ ### LICENSE
6
+
7
7
  MIT
package/package.json CHANGED
@@ -1,24 +1,24 @@
1
- {
2
- "name": "@pi-r/aws-lib",
3
- "version": "0.7.3",
4
- "description": "AWS cloud utility functions for E-mc.",
5
- "main": "index.js",
6
- "types": "types/index.d.ts",
7
- "publishConfig": {
8
- "access": "public"
9
- },
10
- "repository": {
11
- "type": "git",
12
- "url": "git+https://github.com/anpham6/pi-r.git",
13
- "directory": "src/cloud/aws-lib"
14
- },
15
- "keywords": [
16
- "squared",
17
- "e-mc",
18
- "squared-functions"
19
- ],
20
- "author": "An Pham <anpham6@gmail.com>",
21
- "license": "MIT",
22
- "homepage": "https://github.com/anpham6/pi-r#readme",
23
- "dependencies": {}
24
- }
1
+ {
2
+ "name": "@pi-r/aws-lib",
3
+ "version": "0.7.4",
4
+ "description": "AWS cloud utility functions for E-mc.",
5
+ "main": "index.js",
6
+ "types": "types/index.d.ts",
7
+ "publishConfig": {
8
+ "access": "public"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/anpham6/pi-r.git",
13
+ "directory": "src/cloud/aws-lib"
14
+ },
15
+ "keywords": [
16
+ "squared",
17
+ "e-mc",
18
+ "squared-functions"
19
+ ],
20
+ "author": "An Pham <anpham6@gmail.com>",
21
+ "license": "MIT",
22
+ "homepage": "https://github.com/anpham6/pi-r#readme",
23
+ "dependencies": {}
24
+ }
package/types/index.d.ts CHANGED
@@ -1,105 +1,105 @@
1
- declare namespace AWS {
2
- type BucketCannedACL = "authenticated-read" | "private" | "public-read" | "public-read-write";
3
- type ObjectCannedACL = BucketCannedACL | "bucket-owner-full-control" | "bucket-owner-read";
4
-
5
- interface EndpointConfig {
6
- /**
7
- * The region to send service requests to.
8
- */
9
- region?: string | Provider<string>;
10
- /**
11
- * The endpoint URI to send requests to. The default endpoint is built from the configured region.
12
- * The endpoint should be a string like 'https://{service}.{region}.amazonaws.com' or an Endpoint object.
13
- */
14
- endpoint?: string | Endpoint;
15
- }
16
-
17
- interface AccessConfig {
18
- /**
19
- * AWS access key ID.
20
- *
21
- * @deprecated
22
- */
23
- accessKeyId?: string;
24
- /**
25
- * AWS secret access key.
26
- *
27
- * @deprecated
28
- */
29
- secretAccessKey?: string;
30
- /**
31
- * AWS session token.
32
- *
33
- * @deprecated
34
- */
35
- sessionToken?: string;
36
- }
37
-
38
- class Endpoint {
39
- /**
40
- * Constructs a new endpoint given an endpoint URL.
41
- */
42
- constructor(url: string);
43
-
44
- /**
45
- * The host portion of the endpoint including the port, e.g., example.com:80.
46
- */
47
- host: string;
48
- /**
49
- * The host portion of the endpoint, e.g., example.com.
50
- */
51
- hostname: string;
52
- /**
53
- * The full URL of the endpoint.
54
- */
55
- href: string;
56
- /**
57
- * The port of the endpoint.
58
- */
59
- port: number;
60
- /**
61
- * The protocol (http or https) of the endpoint URL.
62
- */
63
- protocol: string;
64
- }
65
-
66
- interface DefaultRetention {
67
- /**
68
- * @public
69
- * <p>The default Object Lock retention mode you want to apply to new objects placed in the
70
- * specified bucket. Must be used with either <code>Days</code> or <code>Years</code>.</p>
71
- */
72
- Mode?: ObjectLockRetentionMode;
73
- /**
74
- * @public
75
- * <p>The number of days that you want to specify for the default retention period. Must be
76
- * used with <code>Mode</code>.</p>
77
- */
78
- Days?: number;
79
- /**
80
- * @public
81
- * <p>The number of years that you want to specify for the default retention period. Must be
82
- * used with <code>Mode</code>.</p>
83
- */
84
- Years?: number;
85
- }
86
-
87
- type Provider<T> = () => Promise<T>;
88
- type ObjectLockRetentionMode = "GOVERNANCE" | "COMPLIANCE" | string; // eslint-disable-line @typescript-eslint/no-redundant-type-constituents
89
-
90
- function isAccessDefined(credential: AccessConfig): boolean;
91
- function isEnvDefined(): boolean;
92
- function isSharedCredentialsDefined(): boolean;
93
- function isProviderChainDefined(): boolean;
94
- function isDatabaseDefined(credential: unknown, data: unknown): boolean;
95
- function getPublicReadPolicy(bucket: string, authenticated?: boolean, write?: boolean): string;
96
- function getBucketPublicReadPolicy(bucket: string): string;
97
- function getPrivatePolicy(bucket: string): string;
98
- function setDatabaseEndpoint(config: EndpointConfig, fallbackRegion?: string): void;
99
- function setEndpoint(config: EndpointConfig, instance: string, fallbackRegion?: string): void;
100
- function checkBucketCannedACL(value: unknown): BucketCannedACL | undefined;
101
- function formatDefaultRetention(retention: DefaultRetention): string;
102
- function getBucketKey(credential: unknown, bucket: string, acl: string | undefined, service: string, sdk: string): string;
103
- }
104
-
1
+ declare namespace AWS {
2
+ type BucketCannedACL = "authenticated-read" | "private" | "public-read" | "public-read-write";
3
+ type ObjectCannedACL = BucketCannedACL | "bucket-owner-full-control" | "bucket-owner-read";
4
+
5
+ interface EndpointConfig {
6
+ /**
7
+ * The region to send service requests to.
8
+ */
9
+ region?: string | Provider<string>;
10
+ /**
11
+ * The endpoint URI to send requests to. The default endpoint is built from the configured region.
12
+ * The endpoint should be a string like 'https://{service}.{region}.amazonaws.com' or an Endpoint object.
13
+ */
14
+ endpoint?: string | Endpoint;
15
+ }
16
+
17
+ interface AccessConfig {
18
+ /**
19
+ * AWS access key ID.
20
+ *
21
+ * @deprecated
22
+ */
23
+ accessKeyId?: string;
24
+ /**
25
+ * AWS secret access key.
26
+ *
27
+ * @deprecated
28
+ */
29
+ secretAccessKey?: string;
30
+ /**
31
+ * AWS session token.
32
+ *
33
+ * @deprecated
34
+ */
35
+ sessionToken?: string;
36
+ }
37
+
38
+ class Endpoint {
39
+ /**
40
+ * Constructs a new endpoint given an endpoint URL.
41
+ */
42
+ constructor(url: string);
43
+
44
+ /**
45
+ * The host portion of the endpoint including the port, e.g., example.com:80.
46
+ */
47
+ host: string;
48
+ /**
49
+ * The host portion of the endpoint, e.g., example.com.
50
+ */
51
+ hostname: string;
52
+ /**
53
+ * The full URL of the endpoint.
54
+ */
55
+ href: string;
56
+ /**
57
+ * The port of the endpoint.
58
+ */
59
+ port: number;
60
+ /**
61
+ * The protocol (http or https) of the endpoint URL.
62
+ */
63
+ protocol: string;
64
+ }
65
+
66
+ interface DefaultRetention {
67
+ /**
68
+ * @public
69
+ * <p>The default Object Lock retention mode you want to apply to new objects placed in the
70
+ * specified bucket. Must be used with either <code>Days</code> or <code>Years</code>.</p>
71
+ */
72
+ Mode?: ObjectLockRetentionMode;
73
+ /**
74
+ * @public
75
+ * <p>The number of days that you want to specify for the default retention period. Must be
76
+ * used with <code>Mode</code>.</p>
77
+ */
78
+ Days?: number;
79
+ /**
80
+ * @public
81
+ * <p>The number of years that you want to specify for the default retention period. Must be
82
+ * used with <code>Mode</code>.</p>
83
+ */
84
+ Years?: number;
85
+ }
86
+
87
+ type Provider<T> = () => Promise<T>;
88
+ type ObjectLockRetentionMode = "GOVERNANCE" | "COMPLIANCE" | string; // eslint-disable-line @typescript-eslint/no-redundant-type-constituents
89
+
90
+ function isAccessDefined(credential: AccessConfig): boolean;
91
+ function isEnvDefined(): boolean;
92
+ function isSharedCredentialsDefined(): boolean;
93
+ function isProviderChainDefined(): boolean;
94
+ function isDatabaseDefined(credential: unknown, data: unknown): boolean;
95
+ function getPublicReadPolicy(bucket: string, authenticated?: boolean, write?: boolean): string;
96
+ function getBucketPublicReadPolicy(bucket: string): string;
97
+ function getPrivatePolicy(bucket: string): string;
98
+ function setDatabaseEndpoint(config: EndpointConfig, fallbackRegion?: string): void;
99
+ function setEndpoint(config: EndpointConfig, instance: string, fallbackRegion?: string): void;
100
+ function checkBucketCannedACL(value: unknown): BucketCannedACL | undefined;
101
+ function formatDefaultRetention(retention: DefaultRetention): string;
102
+ function getBucketKey(credential: unknown, bucket: string, acl: string | undefined, service: string, sdk: string): string;
103
+ }
104
+
105
105
  export = AWS;