@pi-r/aws-lib 0.9.0 → 0.9.2

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/types/index.d.ts +104 -104
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/aws-lib",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "description": "AWS cloud utility functions for E-mc.",
5
5
  "main": "index.js",
6
6
  "types": "types/index.d.ts",
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;