sst 2.8.3 → 2.8.5
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/cli/commands/bind.d.ts +2 -0
- package/cli/commands/bootstrap.d.ts +2 -0
- package/cli/commands/build.d.ts +2 -0
- package/cli/commands/connect.d.ts +15 -0
- package/cli/commands/connect.js +37 -0
- package/cli/commands/console.d.ts +2 -0
- package/cli/commands/deploy.d.ts +2 -0
- package/cli/commands/dev.d.ts +2 -0
- package/cli/commands/diff.d.ts +2 -0
- package/cli/commands/remove.d.ts +2 -0
- package/cli/commands/secrets/get.d.ts +2 -0
- package/cli/commands/secrets/list.d.ts +2 -0
- package/cli/commands/secrets/load.d.ts +2 -0
- package/cli/commands/secrets/remove.d.ts +2 -0
- package/cli/commands/secrets/set.d.ts +2 -0
- package/cli/commands/telemetry.d.ts +2 -0
- package/cli/commands/transform.d.ts +2 -0
- package/cli/commands/update.d.ts +2 -0
- package/cli/commands/version.d.ts +2 -0
- package/cli/program.d.ts +2 -0
- package/cli/program.js +4 -0
- package/cli/sst.js +2 -0
- package/constructs/NextjsSite.js +1 -1
- package/node/job/index.d.ts +1 -1
- package/node/job/index.js +4 -5
- package/package.json +1 -1
- package/sst.mjs +39874 -160
- package/support/base-site-archiver.mjs +1 -1
- package/scrap.d.ts +0 -1
- package/scrap.js +0 -58
package/cli/commands/bind.d.ts
CHANGED
package/cli/commands/build.d.ts
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="yargs" />
|
|
2
|
+
import type { Program } from "../program.js";
|
|
3
|
+
export declare const connect: (program: Program) => import("yargs").Argv<{
|
|
4
|
+
stage: string | undefined;
|
|
5
|
+
} & {
|
|
6
|
+
profile: string | undefined;
|
|
7
|
+
} & {
|
|
8
|
+
region: string | undefined;
|
|
9
|
+
} & {
|
|
10
|
+
verbose: boolean | undefined;
|
|
11
|
+
} & {
|
|
12
|
+
role: string | undefined;
|
|
13
|
+
} & {
|
|
14
|
+
future: boolean | undefined;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export const connect = (program) => program.command("connect", "", (yargs) => yargs, async (args) => {
|
|
2
|
+
if (!args.future)
|
|
3
|
+
throw new Error("This command is not yet available.");
|
|
4
|
+
const { useAWSClient } = await import("../../credentials.js");
|
|
5
|
+
const { useProject } = await import("../../project.js");
|
|
6
|
+
const { useSTSIdentity } = await import("../../credentials.js");
|
|
7
|
+
const { IAMClient, CreateRoleCommand, AttachRolePolicyCommand } = await import("@aws-sdk/client-iam");
|
|
8
|
+
const client = useAWSClient(IAMClient);
|
|
9
|
+
await client
|
|
10
|
+
.send(new CreateRoleCommand({
|
|
11
|
+
RoleName: "sst",
|
|
12
|
+
AssumeRolePolicyDocument: JSON.stringify({
|
|
13
|
+
Version: "2012-10-17",
|
|
14
|
+
Statement: [
|
|
15
|
+
{
|
|
16
|
+
Effect: "Allow",
|
|
17
|
+
Principal: {
|
|
18
|
+
AWS: "arn:aws:iam::917397401067:role/*",
|
|
19
|
+
},
|
|
20
|
+
Action: "sts:AssumeRole",
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
}),
|
|
24
|
+
}))
|
|
25
|
+
.catch((e) => {
|
|
26
|
+
if (e.Error.Code === "EntityAlreadyExists")
|
|
27
|
+
return;
|
|
28
|
+
throw e;
|
|
29
|
+
});
|
|
30
|
+
await client.send(new AttachRolePolicyCommand({
|
|
31
|
+
RoleName: "sst",
|
|
32
|
+
PolicyArn: "arn:aws:iam::aws:policy/AdministratorAccess",
|
|
33
|
+
}));
|
|
34
|
+
const project = useProject();
|
|
35
|
+
const identity = await useSTSIdentity();
|
|
36
|
+
console.log(`http://localhost:3000/connect?app=${project.config.name}&stage=${project.config.stage}&aws_account_id=${identity.Account}®ion=${project.config.region}`);
|
|
37
|
+
});
|
package/cli/commands/deploy.d.ts
CHANGED
package/cli/commands/dev.d.ts
CHANGED
package/cli/commands/diff.d.ts
CHANGED
package/cli/commands/remove.d.ts
CHANGED
package/cli/commands/update.d.ts
CHANGED
package/cli/program.d.ts
CHANGED
package/cli/program.js
CHANGED
|
@@ -21,6 +21,10 @@ export const program = yargs(hideBin(process.argv))
|
|
|
21
21
|
.option("role", {
|
|
22
22
|
type: "string",
|
|
23
23
|
describe: "ARN of the IAM role to use when invoking AWS",
|
|
24
|
+
})
|
|
25
|
+
.option("future", {
|
|
26
|
+
type: "boolean",
|
|
27
|
+
describe: "DO NOT USE. For enabling untested, experimental features",
|
|
24
28
|
})
|
|
25
29
|
.group(["stage", "profile", "region", "role", "verbose", "help"], "Global:")
|
|
26
30
|
.middleware(async (argv) => {
|
package/cli/sst.js
CHANGED
|
@@ -25,6 +25,7 @@ import { transform } from "./commands/transform.js";
|
|
|
25
25
|
import { diff } from "./commands/diff.js";
|
|
26
26
|
import { version } from "./commands/version.js";
|
|
27
27
|
import { telemetry } from "./commands/telemetry.js";
|
|
28
|
+
import { connect } from "./commands/connect.js";
|
|
28
29
|
bootstrap(program);
|
|
29
30
|
dev(program);
|
|
30
31
|
deploy(program);
|
|
@@ -38,6 +39,7 @@ consoleCommand(program);
|
|
|
38
39
|
diff(program);
|
|
39
40
|
version(program);
|
|
40
41
|
telemetry(program);
|
|
42
|
+
connect(program);
|
|
41
43
|
if ("setSourceMapsEnabled" in process) {
|
|
42
44
|
// @ts-expect-error
|
|
43
45
|
process.setSourceMapsEnabled(true);
|
package/constructs/NextjsSite.js
CHANGED
|
@@ -26,7 +26,7 @@ const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
|
|
|
26
26
|
export class NextjsSite extends SsrSite {
|
|
27
27
|
constructor(scope, id, props) {
|
|
28
28
|
super(scope, id, {
|
|
29
|
-
buildCommand: "npx --yes open-next@~1.
|
|
29
|
+
buildCommand: "npx --yes open-next@~1.2.0 build",
|
|
30
30
|
...props,
|
|
31
31
|
});
|
|
32
32
|
}
|
package/node/job/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export type JobType = {
|
|
|
9
9
|
[T in keyof JobResources]: ReturnType<typeof JobControl<T>>;
|
|
10
10
|
};
|
|
11
11
|
export declare const Job: JobType;
|
|
12
|
-
declare function JobControl<Name extends keyof JobResources>(name: Name): {
|
|
12
|
+
declare function JobControl<Name extends keyof JobResources>(name: Name, vars: Record<string, string>): {
|
|
13
13
|
run(props: JobRunProps<Name>): Promise<void>;
|
|
14
14
|
};
|
|
15
15
|
/**
|
package/node/job/index.js
CHANGED
|
@@ -5,17 +5,16 @@ export const Job = /* @__PURE__ */ (() => {
|
|
|
5
5
|
const result = createProxy("Job");
|
|
6
6
|
const vars = getVariables2("Job");
|
|
7
7
|
Object.keys(vars).forEach((name) => {
|
|
8
|
-
// @ts-
|
|
9
|
-
result[name] = JobControl(name);
|
|
8
|
+
// @ts-expect-error
|
|
9
|
+
result[name] = JobControl(name, vars[name]);
|
|
10
10
|
});
|
|
11
11
|
return result;
|
|
12
12
|
})();
|
|
13
|
-
function JobControl(name) {
|
|
13
|
+
function JobControl(name, vars) {
|
|
14
14
|
return {
|
|
15
15
|
async run(props) {
|
|
16
16
|
// Handle job permission not granted
|
|
17
|
-
|
|
18
|
-
const functionName = jobData[name].functionName;
|
|
17
|
+
const functionName = vars.functionName;
|
|
19
18
|
// Invoke the Lambda function
|
|
20
19
|
const ret = await lambda.send(new InvokeCommand({
|
|
21
20
|
FunctionName: functionName,
|