@certik/skynet 0.11.1 → 0.11.3
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/CHANGELOG.md +8 -0
- package/deploy.js +4 -4
- package/dynamodb.js +3 -17
- package/env.js +19 -0
- package/indexer.js +2 -2
- package/kafka.js +2 -2
- package/package.json +1 -1
- package/s3.js +2 -8
- package/sqs.js +3 -7
package/CHANGELOG.md
CHANGED
package/deploy.js
CHANGED
|
@@ -497,12 +497,12 @@ ${getSelectorDesc(selector)}
|
|
|
497
497
|
default: "delta",
|
|
498
498
|
},
|
|
499
499
|
from: {
|
|
500
|
-
|
|
500
|
+
aliases: ["since"],
|
|
501
501
|
type: "number",
|
|
502
502
|
default: 0,
|
|
503
503
|
},
|
|
504
504
|
to: {
|
|
505
|
-
|
|
505
|
+
aliases: ["until"],
|
|
506
506
|
type: "number",
|
|
507
507
|
default: 0,
|
|
508
508
|
},
|
|
@@ -514,7 +514,7 @@ ${getSelectorDesc(selector)}
|
|
|
514
514
|
default: false,
|
|
515
515
|
},
|
|
516
516
|
production: {
|
|
517
|
-
|
|
517
|
+
aliases: ["prd"],
|
|
518
518
|
type: "boolean",
|
|
519
519
|
default: false,
|
|
520
520
|
},
|
|
@@ -667,7 +667,7 @@ ${getSelectorDesc(selector)}
|
|
|
667
667
|
default: false,
|
|
668
668
|
},
|
|
669
669
|
production: {
|
|
670
|
-
|
|
670
|
+
aliases: ["prd"],
|
|
671
671
|
type: "boolean",
|
|
672
672
|
default: false,
|
|
673
673
|
},
|
package/dynamodb.js
CHANGED
|
@@ -8,29 +8,15 @@ import {
|
|
|
8
8
|
UpdateCommand,
|
|
9
9
|
} from "@aws-sdk/lib-dynamodb";
|
|
10
10
|
import { DynamoDBClient, DescribeTableCommand } from "@aws-sdk/client-dynamodb";
|
|
11
|
-
import {
|
|
11
|
+
import { getAWSSDKConfig } from "./env.js";
|
|
12
12
|
import { wait } from "./availability.js";
|
|
13
13
|
|
|
14
14
|
function getDynamoDB() {
|
|
15
|
-
return new DynamoDBClient(
|
|
16
|
-
credentials: {
|
|
17
|
-
accessKeyId: getAWSAccessKeyId(),
|
|
18
|
-
secretAccessKey: getAWSSecretAccessKey(),
|
|
19
|
-
},
|
|
20
|
-
region: getAWSRegion(),
|
|
21
|
-
});
|
|
15
|
+
return new DynamoDBClient(getAWSSDKConfig());
|
|
22
16
|
}
|
|
23
17
|
|
|
24
18
|
function getDocClient() {
|
|
25
|
-
return DynamoDBDocumentClient.from(
|
|
26
|
-
new DynamoDBClient({
|
|
27
|
-
credentials: {
|
|
28
|
-
accessKeyId: getAWSAccessKeyId(),
|
|
29
|
-
secretAccessKey: getAWSSecretAccessKey(),
|
|
30
|
-
},
|
|
31
|
-
region: getAWSRegion(),
|
|
32
|
-
}),
|
|
33
|
-
);
|
|
19
|
+
return DynamoDBDocumentClient.from(new DynamoDBClient(getAWSSDKConfig()));
|
|
34
20
|
}
|
|
35
21
|
|
|
36
22
|
function mergeQueries(q1, q2) {
|
package/env.js
CHANGED
|
@@ -6,6 +6,24 @@ function getAWSSecretAccessKey() {
|
|
|
6
6
|
return ensureAndGet(["SKYNET_AWS_SECRET_ACCESS_KEY"], undefined);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
function getAWSSDKConfig() {
|
|
10
|
+
const region = getAWSRegion();
|
|
11
|
+
const accessKeyId = getAWSAccessKeyId();
|
|
12
|
+
const secretAccessKey = getAWSSecretAccessKey();
|
|
13
|
+
|
|
14
|
+
if (!accessKeyId || !secretAccessKey) {
|
|
15
|
+
return { region };
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
region,
|
|
20
|
+
credentials: {
|
|
21
|
+
accessKeyId,
|
|
22
|
+
secretAccessKey,
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
9
27
|
function getAWSRegion() {
|
|
10
28
|
return ensureAndGet(["SKYNET_AWS_REGION"], "us-east-1");
|
|
11
29
|
}
|
|
@@ -56,6 +74,7 @@ export {
|
|
|
56
74
|
getEnvOrThrow,
|
|
57
75
|
getAWSAccessKeyId,
|
|
58
76
|
getAWSSecretAccessKey,
|
|
77
|
+
getAWSSDKConfig,
|
|
59
78
|
getAWSRegion,
|
|
60
79
|
getEnvironment,
|
|
61
80
|
isProduction,
|
package/indexer.js
CHANGED
|
@@ -516,11 +516,11 @@ ${getSelectorDesc(selector)}
|
|
|
516
516
|
default: "delta",
|
|
517
517
|
},
|
|
518
518
|
from: {
|
|
519
|
-
|
|
519
|
+
aliases: ["since"],
|
|
520
520
|
type: "string",
|
|
521
521
|
},
|
|
522
522
|
to: {
|
|
523
|
-
|
|
523
|
+
aliases: ["until"],
|
|
524
524
|
type: "string",
|
|
525
525
|
},
|
|
526
526
|
status: {
|
package/kafka.js
CHANGED
|
@@ -174,12 +174,12 @@ ${getSelectorDesc(selector)}
|
|
|
174
174
|
flags: {
|
|
175
175
|
...getSelectorFlags(selector),
|
|
176
176
|
from: {
|
|
177
|
-
|
|
177
|
+
aliases: ["since"],
|
|
178
178
|
type: "number",
|
|
179
179
|
default: 0,
|
|
180
180
|
},
|
|
181
181
|
to: {
|
|
182
|
-
|
|
182
|
+
aliases: ["until"],
|
|
183
183
|
type: "number",
|
|
184
184
|
default: 0,
|
|
185
185
|
},
|
package/package.json
CHANGED
package/s3.js
CHANGED
|
@@ -7,16 +7,10 @@ import {
|
|
|
7
7
|
ListObjectsV2Command,
|
|
8
8
|
NotFound,
|
|
9
9
|
} from "@aws-sdk/client-s3";
|
|
10
|
-
import {
|
|
10
|
+
import { getAWSSDKConfig } from "./env.js";
|
|
11
11
|
|
|
12
12
|
function getS3() {
|
|
13
|
-
return new S3Client(
|
|
14
|
-
credentials: {
|
|
15
|
-
accessKeyId: getAWSAccessKeyId(),
|
|
16
|
-
secretAccessKey: getAWSSecretAccessKey(),
|
|
17
|
-
},
|
|
18
|
-
region: getAWSRegion(),
|
|
19
|
-
});
|
|
13
|
+
return new S3Client(getAWSSDKConfig());
|
|
20
14
|
}
|
|
21
15
|
|
|
22
16
|
async function readFile(bucketName, key, verbose = false) {
|
package/sqs.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { SQSClient } from "@aws-sdk/client-sqs";
|
|
2
|
+
import { getAWSSDKConfig } from "./env.js";
|
|
3
3
|
|
|
4
4
|
export function getSQS() {
|
|
5
|
-
return new
|
|
6
|
-
accessKeyId: getAWSAccessKeyId(),
|
|
7
|
-
secretAccessKey: getAWSSecretAccessKey(),
|
|
8
|
-
region: getAWSRegion(),
|
|
9
|
-
});
|
|
5
|
+
return new SQSClient(getAWSSDKConfig());
|
|
10
6
|
}
|