@fireproof/core-cli 0.23.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/LICENSE.md +201 -0
- package/README.md +269 -0
- package/build-cmd.d.ts +40 -0
- package/build-cmd.js +269 -0
- package/build-cmd.js.map +1 -0
- package/build-cmd.ts +299 -0
- package/cloud-token-key-cmd.d.ts +14 -0
- package/cloud-token-key-cmd.js +46 -0
- package/cloud-token-key-cmd.js.map +1 -0
- package/cloud-token-key-cmd.ts +50 -0
- package/main.d.ts +1 -0
- package/main.js +32 -0
- package/main.js.map +1 -0
- package/main.ts +38 -0
- package/package.json +57 -0
- package/pre-signed-url.d.ts +26 -0
- package/pre-signed-url.js +100 -0
- package/pre-signed-url.js.map +1 -0
- package/pre-signed-url.ts +113 -0
- package/run.sh +17 -0
- package/set-scripts-cmd.d.ts +33 -0
- package/set-scripts-cmd.js +155 -0
- package/set-scripts-cmd.js.map +1 -0
- package/set-scripts-cmd.ts +160 -0
- package/tsc-cmd.d.ts +11 -0
- package/tsc-cmd.js +33 -0
- package/tsc-cmd.js.map +1 -0
- package/tsc-cmd.ts +41 -0
- package/tsconfig.json +18 -0
- package/write-env.d.ts +23 -0
- package/write-env.js +103 -0
- package/write-env.js.map +1 -0
- package/write-env.ts +116 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { SuperThis } from "@fireproof/core-types-base";
|
|
2
|
+
import * as rt from "@fireproof/core-runtime";
|
|
3
|
+
import { command, flag, option, string } from "cmd-ts";
|
|
4
|
+
import { exportJWK } from "jose/key/export";
|
|
5
|
+
|
|
6
|
+
export function keyCmd(sthis: SuperThis) {
|
|
7
|
+
return command({
|
|
8
|
+
name: "cli-key-cmds",
|
|
9
|
+
description: "handle keys for cloud token generation",
|
|
10
|
+
version: "1.0.0",
|
|
11
|
+
args: {
|
|
12
|
+
generatePair: flag({
|
|
13
|
+
long: "generatePair",
|
|
14
|
+
short: "g",
|
|
15
|
+
}),
|
|
16
|
+
ourToJWK: option({
|
|
17
|
+
long: "ourToJWK",
|
|
18
|
+
short: "o",
|
|
19
|
+
defaultValue: () => "",
|
|
20
|
+
type: string,
|
|
21
|
+
}),
|
|
22
|
+
JWKToour: option({
|
|
23
|
+
long: "JWKToour",
|
|
24
|
+
short: "j",
|
|
25
|
+
defaultValue: () => "",
|
|
26
|
+
type: string,
|
|
27
|
+
}),
|
|
28
|
+
},
|
|
29
|
+
handler: async (args) => {
|
|
30
|
+
switch (true) {
|
|
31
|
+
case !!args.ourToJWK:
|
|
32
|
+
{
|
|
33
|
+
const key = await rt.sts.env2jwk(args.ourToJWK, "ES256", sthis).then((jwk) => jwk);
|
|
34
|
+
// eslint-disable-next-line no-console
|
|
35
|
+
console.log(`${JSON.stringify(await exportJWK(key))}`);
|
|
36
|
+
}
|
|
37
|
+
break;
|
|
38
|
+
case args.generatePair:
|
|
39
|
+
{
|
|
40
|
+
const key = await rt.sts.SessionTokenService.generateKeyPair("ES256", { extractable: true });
|
|
41
|
+
// eslint-disable-next-line no-console
|
|
42
|
+
console.log(`${rt.sts.envKeyDefaults.PUBLIC}=${key.strings.publicKey}`);
|
|
43
|
+
// eslint-disable-next-line no-console
|
|
44
|
+
console.log(`${rt.sts.envKeyDefaults.SECRET}=${key.strings.privateKey}`);
|
|
45
|
+
}
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
}
|
package/main.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/main.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ensureSuperThis } from "@fireproof/core-runtime";
|
|
2
|
+
import { run, subcommands } from "cmd-ts";
|
|
3
|
+
import { dotenv } from "zx";
|
|
4
|
+
import { buildCmd } from "./build-cmd.js";
|
|
5
|
+
import { setDependenciesCmd, setScriptsCmd } from "./set-scripts-cmd.js";
|
|
6
|
+
import { handleTsc, tscCmd } from "./tsc-cmd.js";
|
|
7
|
+
import { writeEnvCmd } from "./write-env.js";
|
|
8
|
+
import { keyCmd } from "./cloud-token-key-cmd.js";
|
|
9
|
+
import { preSignedUrlCmd } from "./pre-signed-url.js";
|
|
10
|
+
(async () => {
|
|
11
|
+
dotenv.config(process.env.FP_ENV ?? ".env");
|
|
12
|
+
const sthis = ensureSuperThis();
|
|
13
|
+
if (process.argv[2] === "tsc") {
|
|
14
|
+
return handleTsc(process.argv.slice(3), sthis);
|
|
15
|
+
}
|
|
16
|
+
const cmd = subcommands({
|
|
17
|
+
name: "fp-cli",
|
|
18
|
+
description: "fireproof cli",
|
|
19
|
+
version: "1.0.0",
|
|
20
|
+
cmds: {
|
|
21
|
+
tsc: tscCmd(sthis),
|
|
22
|
+
key: keyCmd(sthis),
|
|
23
|
+
writeEnv: writeEnvCmd(sthis),
|
|
24
|
+
preSigned: preSignedUrlCmd(sthis),
|
|
25
|
+
build: buildCmd(sthis),
|
|
26
|
+
setScripts: setScriptsCmd(sthis),
|
|
27
|
+
setDependencies: setDependenciesCmd(sthis),
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
await run(cmd, process.argv.slice(2));
|
|
31
|
+
})().catch(console.error);
|
|
32
|
+
//# sourceMappingURL=main.js.map
|
package/main.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,E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
|
|
4
|
+
import { dotenv } from "zx";
|
|
5
|
+
import { buildCmd } from "./build-cmd.js";
|
|
6
|
+
import { setDependenciesCmd, setScriptsCmd } from "./set-scripts-cmd.js";
|
|
7
|
+
import { handleTsc, tscCmd } from "./tsc-cmd.js";
|
|
8
|
+
import { writeEnvCmd } from "./write-env.js";
|
|
9
|
+
import { keyCmd } from "./cloud-token-key-cmd.js";
|
|
10
|
+
import { preSignedUrlCmd } from "./pre-signed-url.js";
|
|
11
|
+
|
|
12
|
+
(async () => {
|
|
13
|
+
dotenv.config(process.env.FP_ENV ?? ".env");
|
|
14
|
+
const sthis = ensureSuperThis();
|
|
15
|
+
|
|
16
|
+
// console.log("tsc", process.argv);
|
|
17
|
+
if (process.argv[2] === "tsc") {
|
|
18
|
+
return handleTsc(process.argv.slice(3), sthis);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const cmd = subcommands({
|
|
22
|
+
name: "fp-cli",
|
|
23
|
+
description: "fireproof cli",
|
|
24
|
+
version: "1.0.0",
|
|
25
|
+
cmds: {
|
|
26
|
+
tsc: tscCmd(sthis),
|
|
27
|
+
key: keyCmd(sthis),
|
|
28
|
+
writeEnv: writeEnvCmd(sthis),
|
|
29
|
+
preSigned: preSignedUrlCmd(sthis),
|
|
30
|
+
build: buildCmd(sthis),
|
|
31
|
+
setScripts: setScriptsCmd(sthis),
|
|
32
|
+
setDependencies: setDependenciesCmd(sthis),
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
await run(cmd, process.argv.slice(2));
|
|
37
|
+
// eslint-disable-next-line no-console
|
|
38
|
+
})().catch(console.error);
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fireproof/core-cli",
|
|
3
|
+
"version": "0.23.1",
|
|
4
|
+
"description": "Live ledger for the web.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"module": "./index.js",
|
|
7
|
+
"main": "./index.js",
|
|
8
|
+
"bin": "./run.sh",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"ledger",
|
|
11
|
+
"JSON",
|
|
12
|
+
"document",
|
|
13
|
+
"IPLD",
|
|
14
|
+
"CID",
|
|
15
|
+
"IPFS"
|
|
16
|
+
],
|
|
17
|
+
"contributors": [
|
|
18
|
+
"J Chris Anderson",
|
|
19
|
+
"Alan Shaw",
|
|
20
|
+
"Travis Vachon",
|
|
21
|
+
"Mikeal Rogers",
|
|
22
|
+
"Meno Abels"
|
|
23
|
+
],
|
|
24
|
+
"author": "J Chris Anderson",
|
|
25
|
+
"license": "AFL-2.0",
|
|
26
|
+
"homepage": "https://use-fireproof.com",
|
|
27
|
+
"gptdoc": "import { fireproof } from 'use-fireproof'; const db = fireproof('app-db-name'); const ok = await db.put({ anyField: ['any','json'] }); const doc = await db.get(ok.id); await db.del(doc._id); db.subscribe(myRedrawFn); const result = await db.query('anyField', {range : ['a', 'z']}); result.rows.map(({ key }) => key);",
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git+https://github.com/fireproof-storage/fireproof.git"
|
|
31
|
+
},
|
|
32
|
+
"bugs": {
|
|
33
|
+
"url": "https://github.com/fireproof-storage/fireproof/issues"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@adviser/cement": "^0.4.23",
|
|
37
|
+
"@fireproof/core-runtime": "0.23.1",
|
|
38
|
+
"@fireproof/core-types-base": "0.23.1",
|
|
39
|
+
"@fireproof/vendor": "0.23.1",
|
|
40
|
+
"aws4fetch": "^1.0.20",
|
|
41
|
+
"cmd-ts": "^0.13.0",
|
|
42
|
+
"find-up": "^7.0.0",
|
|
43
|
+
"fs-extra": "^11.3.1",
|
|
44
|
+
"jose": "^6.0.12",
|
|
45
|
+
"multiformats": "^13.3.7",
|
|
46
|
+
"semver": "^7.7.2",
|
|
47
|
+
"zx": "^8.8.0"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@fireproof/core-cli": "0.23.1",
|
|
51
|
+
"@types/fs-extra": "^11.0.4",
|
|
52
|
+
"@types/semver": "^7.7.0"
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"build": "./run.sh tsc"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SuperThis } from "@fireproof/core-types-base";
|
|
2
|
+
export declare function preSignedUrlCmd(sthis: SuperThis): Partial<import("cmd-ts/dist/cjs/argparser.js").Register> & {
|
|
3
|
+
parse(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<{
|
|
4
|
+
method: string;
|
|
5
|
+
accessKeyId: string;
|
|
6
|
+
secretAccessKey: string;
|
|
7
|
+
region: string;
|
|
8
|
+
service: string;
|
|
9
|
+
storageURL: string;
|
|
10
|
+
path: string;
|
|
11
|
+
expires: string;
|
|
12
|
+
now: string;
|
|
13
|
+
}>>;
|
|
14
|
+
} & import("cmd-ts/dist/cjs/helpdoc.js").PrintHelp & import("cmd-ts/dist/cjs/helpdoc.js").ProvidesHelp & import("cmd-ts/dist/cjs/helpdoc.js").Named & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Versioned> & import("cmd-ts/dist/cjs/argparser.js").Register & import("cmd-ts/dist/cjs/runner.js").Handling<{
|
|
15
|
+
method: string;
|
|
16
|
+
accessKeyId: string;
|
|
17
|
+
secretAccessKey: string;
|
|
18
|
+
region: string;
|
|
19
|
+
service: string;
|
|
20
|
+
storageURL: string;
|
|
21
|
+
path: string;
|
|
22
|
+
expires: string;
|
|
23
|
+
now: string;
|
|
24
|
+
}, Promise<void>> & {
|
|
25
|
+
run(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<Promise<void>>>;
|
|
26
|
+
} & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Versioned & import("cmd-ts/dist/cjs/helpdoc.js").Descriptive & import("cmd-ts/dist/cjs/helpdoc.js").Aliased>;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { BuildURI } from "@adviser/cement";
|
|
2
|
+
import { AwsClient } from "aws4fetch";
|
|
3
|
+
import { command, option, oneOf, string } from "cmd-ts";
|
|
4
|
+
export function preSignedUrlCmd(sthis) {
|
|
5
|
+
return command({
|
|
6
|
+
name: "pre-signed-url",
|
|
7
|
+
description: "sign a url for cloud storage",
|
|
8
|
+
version: "1.0.0",
|
|
9
|
+
args: {
|
|
10
|
+
method: option({
|
|
11
|
+
long: "method",
|
|
12
|
+
type: oneOf(["GET", "PUT", "POST", "DELETE"]),
|
|
13
|
+
defaultValue: () => "PUT",
|
|
14
|
+
defaultValueIsSerializable: true,
|
|
15
|
+
}),
|
|
16
|
+
accessKeyId: option({
|
|
17
|
+
long: "accessKeyId",
|
|
18
|
+
type: string,
|
|
19
|
+
defaultValue: () => sthis.env.get("ACCESS_KEY_ID") || "accessKeyId",
|
|
20
|
+
defaultValueIsSerializable: true,
|
|
21
|
+
}),
|
|
22
|
+
secretAccessKey: option({
|
|
23
|
+
long: "secretAccessKey",
|
|
24
|
+
type: string,
|
|
25
|
+
defaultValue: () => sthis.env.get("SECRET_ACCESS_KEY") || "secretAccessKey",
|
|
26
|
+
defaultValueIsSerializable: true,
|
|
27
|
+
}),
|
|
28
|
+
region: option({
|
|
29
|
+
long: "region",
|
|
30
|
+
type: string,
|
|
31
|
+
defaultValue: () => "us-east-1",
|
|
32
|
+
defaultValueIsSerializable: true,
|
|
33
|
+
}),
|
|
34
|
+
service: option({
|
|
35
|
+
long: "service",
|
|
36
|
+
type: string,
|
|
37
|
+
defaultValue: () => "s3",
|
|
38
|
+
defaultValueIsSerializable: true,
|
|
39
|
+
}),
|
|
40
|
+
storageURL: option({
|
|
41
|
+
long: "storageURL",
|
|
42
|
+
type: string,
|
|
43
|
+
defaultValue: () => sthis.env.get("STORAGE_URL") || "https://bucket.example.com/db/main",
|
|
44
|
+
defaultValueIsSerializable: true,
|
|
45
|
+
}),
|
|
46
|
+
path: option({
|
|
47
|
+
long: "path",
|
|
48
|
+
type: string,
|
|
49
|
+
defaultValue: () => "db/main",
|
|
50
|
+
defaultValueIsSerializable: true,
|
|
51
|
+
}),
|
|
52
|
+
expires: option({
|
|
53
|
+
long: "expires",
|
|
54
|
+
type: string,
|
|
55
|
+
defaultValue: () => "3600",
|
|
56
|
+
defaultValueIsSerializable: true,
|
|
57
|
+
}),
|
|
58
|
+
now: option({
|
|
59
|
+
long: "now",
|
|
60
|
+
type: {
|
|
61
|
+
async from(str) {
|
|
62
|
+
const decoded = new Date(str);
|
|
63
|
+
if (isNaN(decoded.getTime())) {
|
|
64
|
+
throw new Error("invalid date");
|
|
65
|
+
}
|
|
66
|
+
return decoded
|
|
67
|
+
.toISOString()
|
|
68
|
+
.replace(/[-:]/g, "")
|
|
69
|
+
.replace(/\.\d+Z$/, "Z");
|
|
70
|
+
},
|
|
71
|
+
displayName: "WithoutMillis",
|
|
72
|
+
description: "without milliseconds",
|
|
73
|
+
},
|
|
74
|
+
defaultValue: () => new Date()
|
|
75
|
+
.toISOString()
|
|
76
|
+
.replace(/[-:]/g, "")
|
|
77
|
+
.replace(/\.\d+Z$/, "Z"),
|
|
78
|
+
defaultValueIsSerializable: true,
|
|
79
|
+
}),
|
|
80
|
+
},
|
|
81
|
+
handler: async (args) => {
|
|
82
|
+
const a4f = new AwsClient({
|
|
83
|
+
accessKeyId: args.accessKeyId,
|
|
84
|
+
secretAccessKey: args.secretAccessKey,
|
|
85
|
+
region: args.region,
|
|
86
|
+
service: args.service,
|
|
87
|
+
});
|
|
88
|
+
const buildUrl = BuildURI.from(args.storageURL).appendRelative(args.path).setParam("X-Amz-Expires", args.expires);
|
|
89
|
+
console.log(await a4f
|
|
90
|
+
.sign(new Request(buildUrl.toString(), { method: args.method }), {
|
|
91
|
+
aws: {
|
|
92
|
+
signQuery: true,
|
|
93
|
+
datetime: args.now,
|
|
94
|
+
},
|
|
95
|
+
})
|
|
96
|
+
.then((res) => res.url));
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=pre-signed-url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pre-signed-url.js","sourceRoot":"","sources":["pre-signed-url.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIxD,MAAM,UAAU,eAAe,CAAC,KAAgB;IAC9C,OAAO,OAAO,CAAC;QACb,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,8BAA8B;QAC3C,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE;YACJ,MAAM,EAAE,MAAM,CAAC;gBACb,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,KAAK,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;gBAC7C,YAAY,EAAE,GAAG,EAAE,CAAC,KAAK;gBACzB,0BAA0B,EAAE,IAAI;aACjC,CAAC;YACF,WAAW,EAAE,MAAM,CAAC;gBAClB,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,MAAM;gBACZ,YAAY,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,aAAa;gBACnE,0BAA0B,EAAE,IAAI;aACjC,CAAC;YACF,eAAe,EAAE,MAAM,CAAC;gBACtB,IAAI,EAAE,iBAAiB;gBACvB,IAAI,EAAE,MAAM;gBACZ,YAAY,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,iBAAiB;gBAC3E,0BAA0B,EA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ool to generate pre-signed url for cloud storage
|
|
2
|
+
// curl $(npx tsx src/cloud/client/cli-pre-signed-url.ts GET)
|
|
3
|
+
// curl -X PUT --data-binary @/etc/protocols $(npx tsx src/cloud/client/cli-pre-signed-url.ts)
|
|
4
|
+
import { BuildURI } from "@adviser/cement";
|
|
5
|
+
import { AwsClient } from "aws4fetch";
|
|
6
|
+
import { command, option, oneOf, string } from "cmd-ts";
|
|
7
|
+
import { SuperThis } from "@fireproof/core-types-base";
|
|
8
|
+
// import * as t from 'io-ts';
|
|
9
|
+
|
|
10
|
+
export function preSignedUrlCmd(sthis: SuperThis) {
|
|
11
|
+
return command({
|
|
12
|
+
name: "pre-signed-url",
|
|
13
|
+
description: "sign a url for cloud storage",
|
|
14
|
+
version: "1.0.0",
|
|
15
|
+
args: {
|
|
16
|
+
method: option({
|
|
17
|
+
long: "method",
|
|
18
|
+
type: oneOf(["GET", "PUT", "POST", "DELETE"]),
|
|
19
|
+
defaultValue: () => "PUT",
|
|
20
|
+
defaultValueIsSerializable: true,
|
|
21
|
+
}),
|
|
22
|
+
accessKeyId: option({
|
|
23
|
+
long: "accessKeyId",
|
|
24
|
+
type: string,
|
|
25
|
+
defaultValue: () => sthis.env.get("ACCESS_KEY_ID") || "accessKeyId",
|
|
26
|
+
defaultValueIsSerializable: true,
|
|
27
|
+
}),
|
|
28
|
+
secretAccessKey: option({
|
|
29
|
+
long: "secretAccessKey",
|
|
30
|
+
type: string,
|
|
31
|
+
defaultValue: () => sthis.env.get("SECRET_ACCESS_KEY") || "secretAccessKey",
|
|
32
|
+
defaultValueIsSerializable: true,
|
|
33
|
+
}),
|
|
34
|
+
region: option({
|
|
35
|
+
long: "region",
|
|
36
|
+
type: string,
|
|
37
|
+
defaultValue: () => "us-east-1",
|
|
38
|
+
defaultValueIsSerializable: true,
|
|
39
|
+
}),
|
|
40
|
+
service: option({
|
|
41
|
+
long: "service",
|
|
42
|
+
type: string,
|
|
43
|
+
defaultValue: () => "s3",
|
|
44
|
+
defaultValueIsSerializable: true,
|
|
45
|
+
}),
|
|
46
|
+
storageURL: option({
|
|
47
|
+
long: "storageURL",
|
|
48
|
+
type: string,
|
|
49
|
+
defaultValue: () => sthis.env.get("STORAGE_URL") || "https://bucket.example.com/db/main",
|
|
50
|
+
defaultValueIsSerializable: true,
|
|
51
|
+
}),
|
|
52
|
+
path: option({
|
|
53
|
+
long: "path",
|
|
54
|
+
type: string,
|
|
55
|
+
defaultValue: () => "db/main",
|
|
56
|
+
defaultValueIsSerializable: true,
|
|
57
|
+
}),
|
|
58
|
+
expires: option({
|
|
59
|
+
long: "expires",
|
|
60
|
+
type: string,
|
|
61
|
+
defaultValue: () => "3600",
|
|
62
|
+
defaultValueIsSerializable: true,
|
|
63
|
+
}),
|
|
64
|
+
now: option({
|
|
65
|
+
long: "now",
|
|
66
|
+
type: {
|
|
67
|
+
async from(str): Promise<string> {
|
|
68
|
+
const decoded = new Date(str);
|
|
69
|
+
if (isNaN(decoded.getTime())) {
|
|
70
|
+
throw new Error("invalid date");
|
|
71
|
+
}
|
|
72
|
+
// 2021-09-01T12:34:56Z
|
|
73
|
+
return decoded
|
|
74
|
+
.toISOString()
|
|
75
|
+
.replace(/[-:]/g, "")
|
|
76
|
+
.replace(/\.\d+Z$/, "Z");
|
|
77
|
+
},
|
|
78
|
+
displayName: "WithoutMillis",
|
|
79
|
+
description: "without milliseconds",
|
|
80
|
+
},
|
|
81
|
+
// 2021-09-01T12:34:56Z
|
|
82
|
+
// 2024-11-17T07:21:10.958Z
|
|
83
|
+
defaultValue: () =>
|
|
84
|
+
new Date()
|
|
85
|
+
.toISOString()
|
|
86
|
+
.replace(/[-:]/g, "")
|
|
87
|
+
.replace(/\.\d+Z$/, "Z"),
|
|
88
|
+
defaultValueIsSerializable: true,
|
|
89
|
+
}),
|
|
90
|
+
},
|
|
91
|
+
handler: async (args) => {
|
|
92
|
+
const a4f = new AwsClient({
|
|
93
|
+
accessKeyId: args.accessKeyId,
|
|
94
|
+
secretAccessKey: args.secretAccessKey,
|
|
95
|
+
region: args.region,
|
|
96
|
+
service: args.service,
|
|
97
|
+
});
|
|
98
|
+
const buildUrl = BuildURI.from(args.storageURL).appendRelative(args.path).setParam("X-Amz-Expires", args.expires);
|
|
99
|
+
|
|
100
|
+
// eslint-disable-next-line no-console
|
|
101
|
+
console.log(
|
|
102
|
+
await a4f
|
|
103
|
+
.sign(new Request(buildUrl.toString(), { method: args.method }), {
|
|
104
|
+
aws: {
|
|
105
|
+
signQuery: true,
|
|
106
|
+
datetime: args.now,
|
|
107
|
+
},
|
|
108
|
+
})
|
|
109
|
+
.then((res) => res.url),
|
|
110
|
+
);
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
}
|
package/run.sh
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
#echo "run.sh $0,$1,$FP_TSC $PATH"
|
|
3
|
+
if [ "$1" = "tsc" ]
|
|
4
|
+
then
|
|
5
|
+
if [ -z "$FP_TSC" ]
|
|
6
|
+
then
|
|
7
|
+
FP_TSC=tsgo
|
|
8
|
+
fi
|
|
9
|
+
echo "Using typescript: $FP_TSC"
|
|
10
|
+
#echo $PWD
|
|
11
|
+
#which $FP_TSC
|
|
12
|
+
shift
|
|
13
|
+
#echo $(which $FP_TSC) $@
|
|
14
|
+
exec $(which $FP_TSC) $@
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
exec pnpm exec tsx $(dirname $0)/main.ts $@
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { SuperThis } from "@fireproof/core-types-base";
|
|
2
|
+
export declare function setDependenciesCmd(sthis: SuperThis): Partial<import("cmd-ts/dist/cjs/argparser.js").Register> & {
|
|
3
|
+
parse(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<{
|
|
4
|
+
packageJsons: string[];
|
|
5
|
+
depName: string;
|
|
6
|
+
depVersion: string;
|
|
7
|
+
devDependency: boolean;
|
|
8
|
+
peerDependency: boolean;
|
|
9
|
+
}>>;
|
|
10
|
+
} & import("cmd-ts/dist/cjs/helpdoc.js").PrintHelp & import("cmd-ts/dist/cjs/helpdoc.js").ProvidesHelp & import("cmd-ts/dist/cjs/helpdoc.js").Named & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Versioned> & import("cmd-ts/dist/cjs/argparser.js").Register & import("cmd-ts/dist/cjs/runner.js").Handling<{
|
|
11
|
+
packageJsons: string[];
|
|
12
|
+
depName: string;
|
|
13
|
+
depVersion: string;
|
|
14
|
+
devDependency: boolean;
|
|
15
|
+
peerDependency: boolean;
|
|
16
|
+
}, Promise<void>> & {
|
|
17
|
+
run(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<Promise<void>>>;
|
|
18
|
+
} & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Versioned & import("cmd-ts/dist/cjs/helpdoc.js").Descriptive & import("cmd-ts/dist/cjs/helpdoc.js").Aliased>;
|
|
19
|
+
export declare function setScriptsCmd(sthis: SuperThis): Partial<import("cmd-ts/dist/cjs/argparser.js").Register> & {
|
|
20
|
+
parse(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<{
|
|
21
|
+
packageJsons: string[];
|
|
22
|
+
scriptName: string;
|
|
23
|
+
scriptAction: string;
|
|
24
|
+
scriptDelete: boolean;
|
|
25
|
+
}>>;
|
|
26
|
+
} & import("cmd-ts/dist/cjs/helpdoc.js").PrintHelp & import("cmd-ts/dist/cjs/helpdoc.js").ProvidesHelp & import("cmd-ts/dist/cjs/helpdoc.js").Named & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Versioned> & import("cmd-ts/dist/cjs/argparser.js").Register & import("cmd-ts/dist/cjs/runner.js").Handling<{
|
|
27
|
+
packageJsons: string[];
|
|
28
|
+
scriptName: string;
|
|
29
|
+
scriptAction: string;
|
|
30
|
+
scriptDelete: boolean;
|
|
31
|
+
}, Promise<void>> & {
|
|
32
|
+
run(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<Promise<void>>>;
|
|
33
|
+
} & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Versioned & import("cmd-ts/dist/cjs/helpdoc.js").Descriptive & import("cmd-ts/dist/cjs/helpdoc.js").Aliased>;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { array, command, flag, multioption, option, string } from "cmd-ts";
|
|
2
|
+
import fs from "fs-extra";
|
|
3
|
+
import { glob } from "zx";
|
|
4
|
+
export function setDependenciesCmd(sthis) {
|
|
5
|
+
const cmd = command({
|
|
6
|
+
name: "fireproof set dependencies",
|
|
7
|
+
description: "helps to set dependencies in package.json files",
|
|
8
|
+
version: "1.0.0",
|
|
9
|
+
args: {
|
|
10
|
+
packageJsons: multioption({
|
|
11
|
+
long: "packageJsons",
|
|
12
|
+
short: "p",
|
|
13
|
+
type: array(string),
|
|
14
|
+
defaultValue: () => ["**/package.json"],
|
|
15
|
+
defaultValueIsSerializable: true,
|
|
16
|
+
description: "List of package.json files to patch, defaults to ['**/package.json'].",
|
|
17
|
+
}),
|
|
18
|
+
depName: option({
|
|
19
|
+
long: "depName",
|
|
20
|
+
short: "n",
|
|
21
|
+
type: string,
|
|
22
|
+
description: "The dependency name to set in package.json files.",
|
|
23
|
+
}),
|
|
24
|
+
depVersion: option({
|
|
25
|
+
long: "depVersion",
|
|
26
|
+
short: "v",
|
|
27
|
+
type: string,
|
|
28
|
+
defaultValue: () => "",
|
|
29
|
+
description: "The version of the dependency to set in package.json files.",
|
|
30
|
+
}),
|
|
31
|
+
devDependency: flag({
|
|
32
|
+
long: "devDependency",
|
|
33
|
+
short: "D",
|
|
34
|
+
description: "If set, the dependency will be added to devDependencies instead of dependencies.",
|
|
35
|
+
}),
|
|
36
|
+
peerDependency: flag({
|
|
37
|
+
long: "peerDependency",
|
|
38
|
+
short: "P",
|
|
39
|
+
description: "If set, the dependency will be added to peerDependencies instead of dependencies.",
|
|
40
|
+
}),
|
|
41
|
+
},
|
|
42
|
+
handler: async (args) => {
|
|
43
|
+
const packagesJsonFiles = await glob(args.packageJsons, {
|
|
44
|
+
gitignore: true,
|
|
45
|
+
dot: false,
|
|
46
|
+
ignore: [
|
|
47
|
+
"node_modules/**",
|
|
48
|
+
"**/node_modules/**",
|
|
49
|
+
"dist/**",
|
|
50
|
+
"build/**",
|
|
51
|
+
".next/**",
|
|
52
|
+
"coverage/**",
|
|
53
|
+
],
|
|
54
|
+
onlyFiles: true,
|
|
55
|
+
absolute: false,
|
|
56
|
+
caseSensitiveMatch: false,
|
|
57
|
+
});
|
|
58
|
+
console.log(`Found ${packagesJsonFiles.length} package.json files to patch.`);
|
|
59
|
+
for (const packageJsonPath of packagesJsonFiles) {
|
|
60
|
+
const packageJson = await fs.readJSON(packageJsonPath);
|
|
61
|
+
let ref;
|
|
62
|
+
if (args.devDependency) {
|
|
63
|
+
ref = packageJson.devDependencies || {};
|
|
64
|
+
packageJson.devDependencies = ref;
|
|
65
|
+
console.log(`Setting devDependency ${args.depName} to "${args.depVersion}" in ${packageJsonPath}`);
|
|
66
|
+
}
|
|
67
|
+
else if (args.peerDependency) {
|
|
68
|
+
ref = packageJson.peerDependencies || {};
|
|
69
|
+
packageJson.peerDependencies = ref;
|
|
70
|
+
console.log(`Setting peerDependency ${args.depName} to "${args.depVersion}" in ${packageJsonPath}`);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
ref = packageJson.dependencies || {};
|
|
74
|
+
packageJson.dependencies = ref;
|
|
75
|
+
console.log(`Setting dependency ${args.depName} to "${args.depVersion}" in ${packageJsonPath}`);
|
|
76
|
+
}
|
|
77
|
+
if (!args.depVersion) {
|
|
78
|
+
delete ref[args.depName];
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
ref[args.depName] = args.depVersion;
|
|
82
|
+
}
|
|
83
|
+
await fs.writeJSONSync(packageJsonPath, packageJson, { spaces: 2 });
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
return cmd;
|
|
88
|
+
}
|
|
89
|
+
export function setScriptsCmd(sthis) {
|
|
90
|
+
const cmd = command({
|
|
91
|
+
name: "fireproof build cli",
|
|
92
|
+
description: "helps to build fp",
|
|
93
|
+
version: "1.0.0",
|
|
94
|
+
args: {
|
|
95
|
+
packageJsons: multioption({
|
|
96
|
+
long: "packageJsons",
|
|
97
|
+
short: "p",
|
|
98
|
+
type: array(string),
|
|
99
|
+
defaultValue: () => ["**/package.json"],
|
|
100
|
+
defaultValueIsSerializable: true,
|
|
101
|
+
description: "List of package.json files to patch, defaults to ['**/package.json'].",
|
|
102
|
+
}),
|
|
103
|
+
scriptName: option({
|
|
104
|
+
long: "scriptName",
|
|
105
|
+
short: "s",
|
|
106
|
+
type: string,
|
|
107
|
+
description: "The script name to set in package.json files.",
|
|
108
|
+
}),
|
|
109
|
+
scriptAction: option({
|
|
110
|
+
long: "scriptAction",
|
|
111
|
+
short: "a",
|
|
112
|
+
type: string,
|
|
113
|
+
defaultValue: () => "",
|
|
114
|
+
description: "The script action to set in package.json files.",
|
|
115
|
+
}),
|
|
116
|
+
scriptDelete: flag({
|
|
117
|
+
long: "scriptDelete",
|
|
118
|
+
short: "d",
|
|
119
|
+
description: "If set, the script will be deleted instead of set.",
|
|
120
|
+
}),
|
|
121
|
+
},
|
|
122
|
+
handler: async (args) => {
|
|
123
|
+
const packagesJsonFiles = await glob(args.packageJsons, {
|
|
124
|
+
gitignore: true,
|
|
125
|
+
dot: false,
|
|
126
|
+
ignore: [
|
|
127
|
+
"node_modules/**",
|
|
128
|
+
"**/node_modules/**",
|
|
129
|
+
"dist/**",
|
|
130
|
+
"build/**",
|
|
131
|
+
".next/**",
|
|
132
|
+
"coverage/**",
|
|
133
|
+
],
|
|
134
|
+
onlyFiles: true,
|
|
135
|
+
absolute: false,
|
|
136
|
+
caseSensitiveMatch: false,
|
|
137
|
+
});
|
|
138
|
+
console.log(`Found ${packagesJsonFiles.length} package.json files to patch.`);
|
|
139
|
+
for (const packageJsonPath of packagesJsonFiles) {
|
|
140
|
+
const packageJson = await fs.readJSON(packageJsonPath);
|
|
141
|
+
if (args.scriptDelete || !args.scriptAction) {
|
|
142
|
+
delete packageJson.scripts[args.scriptName];
|
|
143
|
+
console.log(`Deleting script ${args.scriptName} from ${packageJsonPath}`);
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
packageJson.scripts[args.scriptName] = args.scriptAction;
|
|
147
|
+
console.log(`Setting script ${args.scriptName} to "${args.scriptAction}" in ${packageJsonPath}`);
|
|
148
|
+
}
|
|
149
|
+
await fs.writeJSONSync(packageJsonPath, packageJson, { spaces: 2 });
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
});
|
|
153
|
+
return cmd;
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=set-scripts-cmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-scripts-cmd.js","sourceRoot":"","sources":["set-scripts-cmd.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC3E,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAI1B,MAAM,UAAU,kBAAkB,CAAC,KAAgB;IACjD,MAAM,GAAG,GAAG,OAAO,CAAC;QAClB,IAAI,EAAE,4BAA4B;QAClC,WAAW,EAAE,iDAAiD;QAC9D,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE;YACJ,YAAY,EAAE,WAAW,CAAC;gBACxB,IAAI,EAAE,cAAc;gBACpB,KAAK,EAAE,GAAG;gBACV,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC;gBACnB,YA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