@anvil-works/anvil-cli 0.8.0-dev.0 → 0.8.0-dev.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/README.md +54 -0
- package/dist/WatchSession.d.ts.map +1 -1
- package/dist/api.d.ts +3 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/cli.js +1251 -216
- package/dist/commands/appDetection.d.ts +68 -1
- package/dist/commands/appDetection.d.ts.map +1 -1
- package/dist/commands/checkout.d.ts +1 -0
- package/dist/commands/checkout.d.ts.map +1 -1
- package/dist/commands/create.d.ts +52 -0
- package/dist/commands/create.d.ts.map +1 -0
- package/dist/commands/db.d.ts.map +1 -1
- package/dist/commands/deps.d.ts.map +1 -1
- package/dist/commands/env.d.ts +3 -1
- package/dist/commands/env.d.ts.map +1 -1
- package/dist/commands/index.d.ts +3 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/repl.d.ts.map +1 -1
- package/dist/commands/secret.d.ts +3 -0
- package/dist/commands/secret.d.ts.map +1 -0
- package/dist/commands/test.d.ts +26 -0
- package/dist/commands/test.d.ts.map +1 -0
- package/dist/commands/watch.d.ts +1 -25
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/config.d.ts +3 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/formTemplateValidation.d.ts.map +1 -1
- package/dist/index.js +225 -22
- package/dist/program.d.ts.map +1 -1
- package/dist/services/anvil-api.d.ts +20 -0
- package/dist/services/anvil-api.d.ts.map +1 -1
- package/dist/services/db.d.ts +2 -0
- package/dist/services/db.d.ts.map +1 -1
- package/dist/services/deps.d.ts +5 -2
- package/dist/services/deps.d.ts.map +1 -1
- package/dist/services/environment.d.ts +4 -0
- package/dist/services/environment.d.ts.map +1 -1
- package/dist/services/path-open.d.ts +1 -0
- package/dist/services/path-open.d.ts.map +1 -1
- package/dist/services/repl.d.ts +2 -0
- package/dist/services/repl.d.ts.map +1 -1
- package/dist/services/secret.d.ts +43 -0
- package/dist/services/secret.d.ts.map +1 -0
- package/dist/services/server-tests.d.ts +47 -0
- package/dist/services/server-tests.d.ts.map +1 -0
- package/dist/validateFormTemplateHtml.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface EncryptSecretOptions {
|
|
2
|
+
anvilUrl?: string;
|
|
3
|
+
/** The account to use, when there are several for the URL. */
|
|
4
|
+
username?: string;
|
|
5
|
+
/** The secret value. Omit to have the server autogenerate one. */
|
|
6
|
+
secret?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface EncryptSecretResponse {
|
|
9
|
+
plain_text: string;
|
|
10
|
+
encrypted: string;
|
|
11
|
+
}
|
|
12
|
+
/** Set an app secret, returning the encrypted value from the server. */
|
|
13
|
+
export declare function encryptSecret(appId: string, secretName: string, options?: EncryptSecretOptions): Promise<EncryptSecretResponse>;
|
|
14
|
+
export interface GenerateSecretKeyOptions {
|
|
15
|
+
anvilUrl?: string;
|
|
16
|
+
/** The account to use, when there are several for the URL. */
|
|
17
|
+
username?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface GenerateSecretKeyResponse {
|
|
20
|
+
encrypted: string;
|
|
21
|
+
}
|
|
22
|
+
/** Have the server generate an app encryption key, returning the encrypted value from the server. */
|
|
23
|
+
export declare function generateSecretKey(appId: string, keyName: string, options?: GenerateSecretKeyOptions): Promise<GenerateSecretKeyResponse>;
|
|
24
|
+
export type SecretType = "secret" | "key";
|
|
25
|
+
export interface ExistingSecret {
|
|
26
|
+
type?: SecretType;
|
|
27
|
+
existsForApp: boolean;
|
|
28
|
+
}
|
|
29
|
+
/** Look up `secretName` in `anvil.yaml`. Returns undefined if it isn't defined for any app. */
|
|
30
|
+
export declare function findSecretInAnvilYaml(projectRoot: string, secretName: string, appId: string): Promise<ExistingSecret | undefined>;
|
|
31
|
+
export interface WriteSecretOptions {
|
|
32
|
+
appId: string;
|
|
33
|
+
encrypted: string;
|
|
34
|
+
overwrite: boolean;
|
|
35
|
+
type: SecretType;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Add an encrypted secret for an app to `anvil.yaml`, preserving existing content.
|
|
39
|
+
* Fails if the secret is already defined with a different type, or is already defined for
|
|
40
|
+
* that app, unless `overwrite` is set and the existing definition has an `all` value.
|
|
41
|
+
*/
|
|
42
|
+
export declare function writeSecretToAnvilYaml(projectRoot: string, secretName: string, options: WriteSecretOptions): Promise<void>;
|
|
43
|
+
//# sourceMappingURL=secret.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secret.d.ts","sourceRoot":"","sources":["../../src/services/secret.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,oBAAoB;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kEAAkE;IAClE,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,wEAAwE;AACxE,wBAAsB,aAAa,CAC/B,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,oBAAyB,GACnC,OAAO,CAAC,qBAAqB,CAAC,CAoBhC;AAED,MAAM,WAAW,wBAAwB;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,yBAAyB;IACtC,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,qGAAqG;AACrG,wBAAsB,iBAAiB,CACnC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,wBAA6B,GACvC,OAAO,CAAC,yBAAyB,CAAC,CAiBpC;AAMD,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,KAAK,CAAC;AAgB1C,MAAM,WAAW,cAAc;IAC3B,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;CACzB;AAED,+FAA+F;AAC/F,wBAAsB,qBAAqB,CACvC,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,GACd,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAOrC;AAED,MAAM,WAAW,kBAAkB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,UAAU,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,CACxC,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,kBAAkB,GAC5B,OAAO,CAAC,IAAI,CAAC,CA8Bf"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export interface ServerTestSelection {
|
|
2
|
+
test_targets?: string[];
|
|
3
|
+
keyword_expression?: string;
|
|
4
|
+
}
|
|
5
|
+
/** The run's final `test_run_update` fields. */
|
|
6
|
+
export interface ServerTestRunState {
|
|
7
|
+
status?: string;
|
|
8
|
+
exit_code?: string | null;
|
|
9
|
+
error?: {
|
|
10
|
+
message: string;
|
|
11
|
+
type?: string;
|
|
12
|
+
traceback?: string;
|
|
13
|
+
} | null;
|
|
14
|
+
counts?: Record<string, number> | null;
|
|
15
|
+
duration?: number | null;
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}
|
|
18
|
+
export interface ServerTestRunResult {
|
|
19
|
+
runId: string;
|
|
20
|
+
/** Missing if the run never got a task. */
|
|
21
|
+
sessionId?: string;
|
|
22
|
+
state: ServerTestRunState;
|
|
23
|
+
}
|
|
24
|
+
export interface RunServerTestsOptions {
|
|
25
|
+
/** The full ID of a commit that's already on Anvil. */
|
|
26
|
+
commitId: string;
|
|
27
|
+
/** The branch to watch, which must be one the user can read. */
|
|
28
|
+
branch: string;
|
|
29
|
+
selection?: ServerTestSelection;
|
|
30
|
+
collectOnly?: boolean;
|
|
31
|
+
anvilUrl?: string;
|
|
32
|
+
/** The account to run as, when there are several for the URL. */
|
|
33
|
+
username?: string;
|
|
34
|
+
/** Aborting cancels the run, if it has started. */
|
|
35
|
+
signal?: AbortSignal;
|
|
36
|
+
/** Receives pytest's terminal output, in fragments. */
|
|
37
|
+
onOutput?: (text: string) => void;
|
|
38
|
+
/** Receives launch progress, in fragments. */
|
|
39
|
+
onLaunchMessage?: (text: string) => void;
|
|
40
|
+
onRunCreated?: (runId: string) => void;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Run the app's server tests on a commit, streaming pytest's output, and resolve with the run's final state once
|
|
44
|
+
* it's complete. Rejects if the connection is lost, the server reports an error, or the signal aborts.
|
|
45
|
+
*/
|
|
46
|
+
export declare function runServerTests(appId: string, options: RunServerTestsOptions): Promise<ServerTestRunResult>;
|
|
47
|
+
//# sourceMappingURL=server-tests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-tests.d.ts","sourceRoot":"","sources":["../../src/services/server-tests.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,mBAAmB;IAChC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,gDAAgD;AAChD,MAAM,WAAW,kBAAkB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,KAAK,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACtE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,kBAAkB,CAAC;CAC7B;AAED,MAAM,WAAW,qBAAqB;IAClC,uDAAuD;IACvD,QAAQ,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,mBAAmB,CAAC;IAChC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mDAAmD;IACnD,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,8CAA8C;IAC9C,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C;AA8DD;;;GAGG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAsRhH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateFormTemplateHtml.d.ts","sourceRoot":"","sources":["../src/validateFormTemplateHtml.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EAC1B,MAAM,mCAAmC,CAAC;AAM3C,OAAO,KAAK,EAAE,4BAA4B,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"validateFormTemplateHtml.d.ts","sourceRoot":"","sources":["../src/validateFormTemplateHtml.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EAC1B,MAAM,mCAAmC,CAAC;AAM3C,OAAO,KAAK,EAAE,4BAA4B,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAoClF,KAAK,gBAAgB,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,sBAAsB,CAAC,EAAE,sBAAsB,CAAA;CAAE,CAAC;AAChG,KAAK,SAAS,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,KAAK,kBAAkB,CAAC;AAClF,MAAM,MAAM,+BAA+B,GAAG;IAC1C,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;CACnD,CAAC;AA0EF,wBAAgB,gCAAgC,CAAC,WAAW,EAAE,MAAM,GAAG;IACnE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;CAC3B,CAUA;AAED,wBAAgB,uBAAuB,CAAC,eAAe,EAAE,MAAM,GAAG,eAAe,EAAE,CAyClF;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,kBAAkB,GAAG,eAAe,EAAE,CAExF;AAED,wBAAgB,wBAAwB,CACpC,WAAW,EAAE,MAAM,EACnB,SAAS,GAAE,SAA4C,EACvD,OAAO,GAAE,+BAAoC,GAC9C,4BAA4B,CA8C9B"}
|