@speedkit/cli 4.36.1 → 4.36.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.
- package/CHANGELOG.md +7 -0
- package/dist/base/sk-command.d.ts +41 -0
- package/dist/base/sk-command.js +56 -0
- package/dist/commands/auto-prewarm.d.ts +6 -4
- package/dist/commands/auto-prewarm.js +13 -66
- package/dist/commands/autocomplete/fish.d.ts +2 -2
- package/dist/commands/autocomplete/fish.js +3 -2
- package/dist/commands/browser/clean.d.ts +2 -2
- package/dist/commands/browser/clean.js +6 -6
- package/dist/commands/browser/list.d.ts +2 -2
- package/dist/commands/browser/list.js +6 -7
- package/dist/commands/browser/update.d.ts +2 -2
- package/dist/commands/browser/update.js +9 -11
- package/dist/commands/bulk-deploy.d.ts +4 -2
- package/dist/commands/bulk-deploy.js +7 -37
- package/dist/commands/config/edit.d.ts +2 -2
- package/dist/commands/config/edit.js +2 -2
- package/dist/commands/config/setup.d.ts +5 -2
- package/dist/commands/config/setup.js +9 -19
- package/dist/commands/deploy.d.ts +12 -3
- package/dist/commands/deploy.js +14 -20
- package/dist/commands/diff-url-parameters.d.ts +3 -2
- package/dist/commands/diff-url-parameters.js +19 -16
- package/dist/commands/extension/add.d.ts +2 -2
- package/dist/commands/extension/add.js +6 -6
- package/dist/commands/extension/devtools.d.ts +2 -2
- package/dist/commands/extension/devtools.js +6 -7
- package/dist/commands/extension/list.d.ts +2 -2
- package/dist/commands/extension/list.js +5 -6
- package/dist/commands/extension/remove.d.ts +2 -2
- package/dist/commands/extension/remove.js +6 -6
- package/dist/commands/extension/update.d.ts +2 -2
- package/dist/commands/extension/update.js +5 -6
- package/dist/commands/find-pops.d.ts +2 -2
- package/dist/commands/find-pops.js +10 -11
- package/dist/commands/generate-customer-config.d.ts +5 -2
- package/dist/commands/generate-customer-config.js +9 -27
- package/dist/commands/generate-pop-config.d.ts +2 -2
- package/dist/commands/generate-pop-config.js +19 -15
- package/dist/commands/login.d.ts +2 -2
- package/dist/commands/login.js +6 -9
- package/dist/commands/onboarding.d.ts +18 -3
- package/dist/commands/onboarding.js +13 -11
- package/dist/commands/origin-request.d.ts +4 -2
- package/dist/commands/origin-request.js +10 -42
- package/dist/commands/prewarm.d.ts +4 -2
- package/dist/commands/prewarm.js +12 -56
- package/dist/commands/pull.d.ts +4 -2
- package/dist/commands/pull.js +9 -14
- package/dist/commands/query/parameter.d.ts +4 -2
- package/dist/commands/query/parameter.js +12 -19
- package/dist/commands/query/prewarm.d.ts +4 -2
- package/dist/commands/query/prewarm.js +16 -23
- package/dist/commands/revalidate.d.ts +4 -2
- package/dist/commands/revalidate.js +13 -56
- package/dist/commands/wpt-launcher.d.ts +2 -2
- package/dist/commands/wpt-launcher.js +16 -17
- package/dist/hooks/init/first-run.js +9 -10
- package/dist/models/context.d.ts +24 -0
- package/dist/models/context.js +31 -0
- package/dist/services/athena/athena-flags.d.ts +18 -0
- package/dist/services/athena/athena-flags.js +29 -0
- package/dist/services/athena/athena-service-build-context.d.ts +25 -0
- package/dist/services/athena/athena-service-build-context.js +4 -0
- package/dist/services/athena/athena-service-factory.d.ts +3 -16
- package/dist/services/athena/athena-service-factory.js +11 -27
- package/dist/services/athena/baqend-athena-service.d.ts +3 -14
- package/dist/services/athena/baqend-athena-service.js +8 -16
- package/dist/services/athena/index.d.ts +1 -0
- package/dist/services/athena/index.js +1 -0
- package/dist/services/athena/spec/baqend-athena-service.spec.js +2 -2
- package/dist/services/browser-fetch/browser-origin-fetch.d.ts +2 -2
- package/dist/services/browser-fetch/browser-origin-fetch.js +1 -1
- package/dist/services/browser-fetch/browser-origin-fetcher.d.ts +3 -3
- package/dist/services/browser-fetch/browser-origin-fetcher.js +5 -5
- package/dist/services/browser-fetch/spec/browser-origin-fetch.spec.js +10 -10
- package/dist/services/cli/cli-environment-factory.d.ts +25 -0
- package/dist/services/cli/cli-environment-factory.js +30 -0
- package/dist/services/cli/cli-environment.d.ts +73 -0
- package/dist/services/cli/cli-environment.js +216 -0
- package/dist/services/cli/cli-service-build-context.d.ts +10 -0
- package/dist/services/cli/cli-service-build-context.js +4 -0
- package/dist/services/cli/cli-service-factory.d.ts +7 -7
- package/dist/services/cli/cli-service-factory.js +7 -7
- package/dist/services/cli/cli-service-model.d.ts +0 -4
- package/dist/services/cli/cli-service-model.js +0 -6
- package/dist/services/cli/cli-service.d.ts +16 -2
- package/dist/services/cli/cli-service.js +17 -18
- package/dist/services/cli/cli-settings.d.ts +37 -0
- package/dist/services/cli/cli-settings.js +23 -0
- package/dist/services/cli/command-build-context.d.ts +23 -0
- package/dist/services/cli/index.d.ts +5 -1
- package/dist/services/cli/index.js +5 -1
- package/dist/services/cli/spec/cli-environment-detection.spec.js +52 -0
- package/dist/services/cli/spec/cli-environment.spec.js +125 -0
- package/dist/services/cli/spec/cli-service.spec.js +9 -19
- package/dist/services/config-api/client.d.ts +3 -3
- package/dist/services/config-api/client.js +4 -4
- package/dist/services/config-api/config-api-factory.js +3 -3
- package/dist/services/config-api/entity-manager-provider.d.ts +11 -0
- package/dist/services/config-api/{entity-manager-factory.js → entity-manager-provider.js} +7 -1
- package/dist/services/customer-config/customer-config-service-build-context.d.ts +33 -0
- package/dist/services/customer-config/customer-config-service-build-context.js +36 -0
- package/dist/services/customer-config/customer-config-service-factory.d.ts +3 -4
- package/dist/services/customer-config/customer-config-service-factory.js +5 -8
- package/dist/services/customer-config/customer-config-service.d.ts +2 -2
- package/dist/services/customer-config/index.d.ts +1 -1
- package/dist/services/customer-config/index.js +1 -1
- package/dist/services/customer-config/site-analyzer/index.d.ts +1 -0
- package/dist/services/customer-config/site-analyzer/index.js +1 -0
- package/dist/services/customer-config/site-analyzer/site-analyzer-service-build-context.d.ts +6 -0
- package/dist/services/customer-config/site-analyzer/site-analyzer-service-build-context.js +4 -0
- package/dist/services/customer-config/site-analyzer/site-analyzer-service-factory.d.ts +3 -3
- package/dist/services/customer-config/site-analyzer/site-analyzer-service-factory.js +4 -5
- package/dist/services/deploy/bulk/bulk-deploy-model.d.ts +0 -25
- package/dist/services/deploy/bulk/bulk-deploy-model.js +1 -27
- package/dist/services/deploy/bulk/bulk-deploy-service-build-context.d.ts +51 -0
- package/dist/services/deploy/bulk/bulk-deploy-service-build-context.js +50 -0
- package/dist/services/deploy/bulk/bulk-deploy-service-factory.d.ts +2 -4
- package/dist/services/deploy/bulk/bulk-deploy-service-factory.js +2 -5
- package/dist/services/deploy/bulk/bulk-deploy-service.d.ts +3 -2
- package/dist/services/deploy/bulk/config-deploy-factory.d.ts +3 -3
- package/dist/services/deploy/bulk/config-deploy-factory.js +16 -8
- package/dist/services/deploy/bulk/index.d.ts +1 -0
- package/dist/services/deploy/bulk/index.js +1 -0
- package/dist/services/deploy/checks/activation/customer-approval-check.d.ts +3 -1
- package/dist/services/deploy/checks/activation/customer-approval-check.js +4 -2
- package/dist/services/deploy/checks/pre-deploy/device-detection-changed-check.d.ts +3 -1
- package/dist/services/deploy/checks/pre-deploy/device-detection-changed-check.js +4 -2
- package/dist/services/deploy/checks/pre-deploy/split-change-check.d.ts +3 -1
- package/dist/services/deploy/checks/pre-deploy/split-change-check.js +4 -2
- package/dist/services/deploy/deploy-service-build-context.d.ts +63 -0
- package/dist/services/deploy/deploy-service-build-context.js +64 -0
- package/dist/services/deploy/deploy-service-factory.d.ts +5 -8
- package/dist/services/deploy/deploy-service-factory.js +28 -19
- package/dist/services/deploy/mr/base-config-reader.d.ts +6 -4
- package/dist/services/deploy/mr/base-config-reader.js +6 -8
- package/dist/services/deploy/mr/index.d.ts +1 -0
- package/dist/services/deploy/mr/index.js +1 -0
- package/dist/services/deploy/mr/merge-request-deploy-model.d.ts +0 -35
- package/dist/services/deploy/mr/merge-request-deploy-model.js +0 -34
- package/dist/services/deploy/mr/merge-request-deploy-service-build-context.d.ts +32 -0
- package/dist/services/deploy/mr/merge-request-deploy-service-build-context.js +20 -0
- package/dist/services/deploy/mr/merge-request-deploy-service-factory.d.ts +2 -4
- package/dist/services/deploy/mr/merge-request-deploy-service-factory.js +31 -10
- package/dist/services/deploy/mr/merge-request-deploy-service.d.ts +3 -2
- package/dist/services/deploy/spec/bulk/bulk-deploy-service.spec.js +14 -3
- package/dist/services/deploy/spec/checks/activation/customer-approval-check.spec.js +7 -5
- package/dist/services/deploy/spec/checks/pre-deploy/split-change-check.spec.js +2 -1
- package/dist/services/diff/diff-service-build-context.d.ts +14 -0
- package/dist/services/diff/diff-service-build-context.js +4 -0
- package/dist/services/diff/diff-service-factory.d.ts +4 -5
- package/dist/services/diff/diff-service-factory.js +4 -7
- package/dist/services/diff/index.d.ts +1 -1
- package/dist/services/diff/index.js +1 -1
- package/dist/services/document-handler-runtime/{context/document-handler-runtime-context.d.ts → document-handler-runtime-model.d.ts} +0 -5
- package/dist/services/document-handler-runtime/document-handler-runtime-service-build-context.d.ts +11 -0
- package/dist/services/document-handler-runtime/document-handler-runtime-service-build-context.js +4 -0
- package/dist/services/document-handler-runtime/document-handler-server.js +2 -2
- package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.d.ts +3 -6
- package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.js +14 -14
- package/dist/services/document-handler-runtime/server/request.js +1 -1
- package/dist/services/document-handler-runtime/templates/database-mock.d.ts +1 -1
- package/dist/services/document-handler-runtime/templates/database-mock.js +1 -1
- package/dist/services/integration-api/customer-config-flags.d.ts +16 -0
- package/dist/services/integration-api/customer-config-flags.js +30 -0
- package/dist/services/integration-api/handler/install-resource-handler.d.ts +8 -0
- package/dist/services/integration-api/handler/install-resource-handler.js +10 -1
- package/dist/services/integration-api/index.d.ts +1 -0
- package/dist/services/integration-api/index.js +1 -0
- package/dist/services/integration-api/integration-api-factory.d.ts +4 -6
- package/dist/services/integration-api/integration-api-factory.js +11 -11
- package/dist/services/integration-api/integration-api-model.d.ts +0 -9
- package/dist/services/integration-api/integration-api-model.js +0 -16
- package/dist/services/integration-api/integration-api-service-build-context.d.ts +19 -0
- package/dist/services/integration-api/integration-api-service-build-context.js +4 -0
- package/dist/services/integration-api/spec/config-plugin.spec.js +1 -1
- package/dist/services/integration-api/spec/integration-api-service.spec.js +7 -3
- package/dist/services/integration-api/spec/speed-kit-config-file.spec.js +9 -2
- package/dist/services/integration-api/struct/config-plugin.d.ts +1 -1
- package/dist/services/integration-api/struct/config-plugin.js +12 -7
- package/dist/services/integration-api/struct/speed-kit-config-file.d.ts +18 -2
- package/dist/services/integration-api/struct/speed-kit-config-file.js +22 -12
- package/dist/services/integration-api/struct/speed-kit-config.d.ts +1 -1
- package/dist/services/onboarding/browser/config/browser-config.d.ts +3 -3
- package/dist/services/onboarding/browser/config/browser-config.js +5 -5
- package/dist/services/onboarding/browser/executable/executable-validator.d.ts +3 -3
- package/dist/services/onboarding/browser/executable/executable-validator.js +17 -15
- package/dist/services/onboarding/browser/extension/extension-downloader.d.ts +3 -3
- package/dist/services/onboarding/browser/extension/extension-downloader.js +6 -6
- package/dist/services/onboarding/browser/extension/extension-validator.d.ts +3 -3
- package/dist/services/onboarding/browser/extension/extension-validator.js +4 -4
- package/dist/services/onboarding/file-events/file-watcher.js +1 -0
- package/dist/services/onboarding/index.d.ts +1 -1
- package/dist/services/onboarding/index.js +1 -1
- package/dist/services/onboarding/onboarding-model.d.ts +8 -24
- package/dist/services/onboarding/onboarding-model.js +19 -87
- package/dist/services/onboarding/onboarding-service-build-context.d.ts +57 -0
- package/dist/services/onboarding/onboarding-service-build-context.js +67 -0
- package/dist/services/onboarding/onboarding-service-factory.d.ts +2 -5
- package/dist/services/onboarding/onboarding-service-factory.js +47 -34
- package/dist/services/onboarding/spec/onboarding-model.spec.js +11 -6
- package/dist/services/origin-request/index.d.ts +1 -1
- package/dist/services/origin-request/index.js +1 -1
- package/dist/services/origin-request/origin-request-service-build-context.d.ts +52 -0
- package/dist/services/origin-request/origin-request-service-build-context.js +54 -0
- package/dist/services/origin-request/origin-request-service-factory.d.ts +2 -5
- package/dist/services/origin-request/origin-request-service-factory.js +12 -12
- package/dist/services/origin-request/origin-request-service.d.ts +2 -2
- package/dist/services/pop-config/index.d.ts +1 -0
- package/dist/services/pop-config/index.js +1 -0
- package/dist/services/pop-config/pop-config-factory.d.ts +4 -1
- package/dist/services/pop-config/pop-config-factory.js +10 -3
- package/dist/services/pop-config/pop-config-service-build-context.d.ts +10 -0
- package/dist/services/pop-config/pop-config-service-build-context.js +4 -0
- package/dist/services/prewarm/auto-pre-warm-factory.d.ts +3 -31
- package/dist/services/prewarm/auto-pre-warm-factory.js +6 -11
- package/dist/services/prewarm/auto-pre-warm-service-build-context.d.ts +84 -0
- package/dist/services/prewarm/auto-pre-warm-service-build-context.js +68 -0
- package/dist/services/prewarm/index.d.ts +2 -0
- package/dist/services/prewarm/index.js +2 -0
- package/dist/services/prewarm/pre-warm-factory.d.ts +4 -5
- package/dist/services/prewarm/pre-warm-factory.js +6 -8
- package/dist/services/prewarm/pre-warm-model.d.ts +0 -10
- package/dist/services/prewarm/pre-warm-model.js +0 -18
- package/dist/services/prewarm/pre-warm-service-build-context.d.ts +47 -0
- package/dist/services/prewarm/pre-warm-service-build-context.js +64 -0
- package/dist/services/pull/index.d.ts +1 -0
- package/dist/services/pull/index.js +1 -0
- package/dist/services/pull/pull-service-build-context.d.ts +28 -0
- package/dist/services/pull/pull-service-build-context.js +17 -0
- package/dist/services/pull/pull-service-factory.d.ts +3 -5
- package/dist/services/pull/pull-service-factory.js +13 -14
- package/dist/services/pull/pull-service-model.d.ts +0 -5
- package/dist/services/pull/pull-service-model.js +0 -9
- package/dist/services/query-builder/query-builder-factory.d.ts +9 -7
- package/dist/services/query-builder/query-builder-factory.js +26 -15
- package/dist/{models/cli-parameters.d.ts → services/query-builder/query-builder-flags.d.ts} +1 -120
- package/dist/services/query-builder/query-builder-flags.js +150 -0
- package/dist/services/query-builder/query-builder-model.d.ts +1 -14
- package/dist/services/query-builder/query-builder-service-build-context.d.ts +113 -0
- package/dist/services/query-builder/query-builder-service-build-context.js +68 -0
- package/dist/services/query-builder/query-builder-service.d.ts +3 -3
- package/dist/services/query-builder/spec/query-builder-flags.spec.d.ts +1 -0
- package/dist/{models/spec/cli-parameters.spec.js → services/query-builder/spec/query-builder-flags.spec.js} +1 -1
- package/dist/services/revalidate/index.d.ts +1 -0
- package/dist/services/revalidate/index.js +1 -0
- package/dist/services/revalidate/revalidate-factory.d.ts +3 -5
- package/dist/services/revalidate/revalidate-factory.js +2 -6
- package/dist/services/revalidate/revalidate-model.d.ts +0 -9
- package/dist/services/revalidate/revalidate-model.js +0 -8
- package/dist/services/revalidate/revalidate-service-build-context.d.ts +38 -0
- package/dist/services/revalidate/revalidate-service-build-context.js +59 -0
- package/dist/services/setup/browser/browser-setup-service.d.ts +3 -4
- package/dist/services/setup/browser/browser-setup-service.js +16 -18
- package/dist/services/setup/difftool/difftool-setup-service.d.ts +3 -4
- package/dist/services/setup/difftool/difftool-setup-service.js +5 -7
- package/dist/services/setup/extension/extension-setup-service.d.ts +3 -4
- package/dist/services/setup/extension/extension-setup-service.js +8 -10
- package/dist/services/setup/index.d.ts +1 -1
- package/dist/services/setup/index.js +1 -1
- package/dist/services/setup/setup-service-build-context.d.ts +27 -0
- package/dist/services/setup/setup-service-build-context.js +26 -0
- package/dist/services/setup/setup-service-factory.d.ts +2 -6
- package/dist/services/setup/setup-service-factory.js +10 -18
- package/dist/services/setup/setup-service.d.ts +4 -5
- package/dist/services/setup/setup-service.js +6 -7
- package/oclif.manifest.json +1 -1
- package/package.json +4 -2
- package/dist/models/cli-parameters.js +0 -297
- package/dist/services/cli/cli-config.d.ts +0 -59
- package/dist/services/cli/cli-config.js +0 -180
- package/dist/services/cli/environment.d.ts +0 -15
- package/dist/services/cli/environment.js +0 -40
- package/dist/services/cli/spec/cli-config.spec.js +0 -117
- package/dist/services/cli/spec/environment.spec.js +0 -28
- package/dist/services/config-api/entity-manager-factory.d.ts +0 -5
- package/dist/services/customer-config/customer-config-service-context.d.ts +0 -13
- package/dist/services/customer-config/customer-config-service-context.js +0 -21
- package/dist/services/deploy/context/deploy-context.d.ts +0 -32
- package/dist/services/deploy/context/deploy-context.js +0 -72
- package/dist/services/diff/diff-model.d.ts +0 -9
- package/dist/services/diff/diff-model.js +0 -12
- package/dist/services/origin-request/origin-request-context.d.ts +0 -13
- package/dist/services/origin-request/origin-request-context.js +0 -23
- package/dist/services/query-builder/query-command.d.ts +0 -28
- package/dist/services/query-builder/query-command.js +0 -37
- package/dist/services/setup/setup-context.d.ts +0 -14
- package/dist/services/setup/setup-context.js +0 -15
- /package/dist/{models/spec/cli-parameters.spec.d.ts → services/cli/command-build-context.js} +0 -0
- /package/dist/services/cli/spec/{cli-config.spec.d.ts → cli-environment-detection.spec.d.ts} +0 -0
- /package/dist/services/cli/spec/{environment.spec.d.ts → cli-environment.spec.d.ts} +0 -0
- /package/dist/services/document-handler-runtime/{context/document-handler-runtime-context.js → document-handler-runtime-model.js} +0 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { Interfaces } from "@oclif/core";
|
|
2
|
+
import { CliEnvironment, CommandContextValues } from "../cli/index.js";
|
|
3
|
+
import { ParameterOptions, PrewarmOptions } from "./queries/query-model.js";
|
|
4
|
+
import { QueryFilterOptions, QueryType } from "./query-builder-model.js";
|
|
5
|
+
export interface QueryBuilderServiceBuildContextValues extends CommandContextValues, ParameterOptions, PrewarmOptions, QueryFilterOptions {
|
|
6
|
+
/** Athena data catalog the rum tables live in. */
|
|
7
|
+
readonly catalog?: string;
|
|
8
|
+
readonly configName: string;
|
|
9
|
+
readonly customerPath: string;
|
|
10
|
+
readonly execute?: boolean;
|
|
11
|
+
/** Report every rule the query leaves out, reduces or approximates. */
|
|
12
|
+
readonly explain?: boolean;
|
|
13
|
+
readonly isWindows?: boolean;
|
|
14
|
+
readonly quiet?: boolean;
|
|
15
|
+
/** Athena workgroup to execute in, when the query is executed at all. */
|
|
16
|
+
readonly workgroup?: string;
|
|
17
|
+
}
|
|
18
|
+
declare const args: {
|
|
19
|
+
customerPath: Interfaces.Arg<string, {
|
|
20
|
+
exists?: boolean;
|
|
21
|
+
}>;
|
|
22
|
+
};
|
|
23
|
+
declare const prewarmFlags: {
|
|
24
|
+
count: Interfaces.BooleanFlag<boolean>;
|
|
25
|
+
excludeNotFound: Interfaces.BooleanFlag<boolean>;
|
|
26
|
+
limit: Interfaces.OptionFlag<number, Interfaces.CustomOptions>;
|
|
27
|
+
match: Interfaces.OptionFlag<string[], Interfaces.CustomOptions>;
|
|
28
|
+
minHits: Interfaces.OptionFlag<number, Interfaces.CustomOptions>;
|
|
29
|
+
device: Interfaces.OptionFlag<string[], Interfaces.CustomOptions>;
|
|
30
|
+
variation: Interfaces.OptionFlag<string[], Interfaces.CustomOptions>;
|
|
31
|
+
execute: Interfaces.BooleanFlag<boolean>;
|
|
32
|
+
quiet: Interfaces.BooleanFlag<boolean>;
|
|
33
|
+
excludeNoindex: Interfaces.BooleanFlag<boolean>;
|
|
34
|
+
excludeSuspicious: Interfaces.BooleanFlag<boolean>;
|
|
35
|
+
explain: Interfaces.BooleanFlag<boolean>;
|
|
36
|
+
hardNavigationsOnly: Interfaces.BooleanFlag<boolean>;
|
|
37
|
+
days: Interfaces.OptionFlag<number, Interfaces.CustomOptions>;
|
|
38
|
+
configName: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
39
|
+
catalog: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
40
|
+
workgroup: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
41
|
+
};
|
|
42
|
+
declare const parameterFlags: {
|
|
43
|
+
bySet: Interfaces.BooleanFlag<boolean>;
|
|
44
|
+
minImpressions: Interfaces.OptionFlag<number, Interfaces.CustomOptions>;
|
|
45
|
+
execute: Interfaces.BooleanFlag<boolean>;
|
|
46
|
+
quiet: Interfaces.BooleanFlag<boolean>;
|
|
47
|
+
excludeNoindex: Interfaces.BooleanFlag<boolean>;
|
|
48
|
+
excludeSuspicious: Interfaces.BooleanFlag<boolean>;
|
|
49
|
+
explain: Interfaces.BooleanFlag<boolean>;
|
|
50
|
+
hardNavigationsOnly: Interfaces.BooleanFlag<boolean>;
|
|
51
|
+
days: Interfaces.OptionFlag<number, Interfaces.CustomOptions>;
|
|
52
|
+
configName: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
53
|
+
catalog: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
54
|
+
workgroup: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
55
|
+
};
|
|
56
|
+
declare const PrewarmQueryServiceBuildContext_base: new (values: QueryBuilderServiceBuildContextValues) => Readonly<QueryBuilderServiceBuildContextValues>;
|
|
57
|
+
/** What a prewarm query is built for: which urls of a customer to warm. */
|
|
58
|
+
export declare class PrewarmQueryServiceBuildContext extends PrewarmQueryServiceBuildContext_base {
|
|
59
|
+
static readonly args: {
|
|
60
|
+
customerPath: Interfaces.Arg<string, {
|
|
61
|
+
exists?: boolean;
|
|
62
|
+
}>;
|
|
63
|
+
};
|
|
64
|
+
static readonly flags: {
|
|
65
|
+
count: Interfaces.BooleanFlag<boolean>;
|
|
66
|
+
excludeNotFound: Interfaces.BooleanFlag<boolean>;
|
|
67
|
+
limit: Interfaces.OptionFlag<number, Interfaces.CustomOptions>;
|
|
68
|
+
match: Interfaces.OptionFlag<string[], Interfaces.CustomOptions>;
|
|
69
|
+
minHits: Interfaces.OptionFlag<number, Interfaces.CustomOptions>;
|
|
70
|
+
device: Interfaces.OptionFlag<string[], Interfaces.CustomOptions>;
|
|
71
|
+
variation: Interfaces.OptionFlag<string[], Interfaces.CustomOptions>;
|
|
72
|
+
execute: Interfaces.BooleanFlag<boolean>;
|
|
73
|
+
quiet: Interfaces.BooleanFlag<boolean>;
|
|
74
|
+
excludeNoindex: Interfaces.BooleanFlag<boolean>;
|
|
75
|
+
excludeSuspicious: Interfaces.BooleanFlag<boolean>;
|
|
76
|
+
explain: Interfaces.BooleanFlag<boolean>;
|
|
77
|
+
hardNavigationsOnly: Interfaces.BooleanFlag<boolean>;
|
|
78
|
+
days: Interfaces.OptionFlag<number, Interfaces.CustomOptions>;
|
|
79
|
+
configName: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
80
|
+
catalog: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
81
|
+
workgroup: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
82
|
+
};
|
|
83
|
+
readonly queryType = QueryType.prewarm;
|
|
84
|
+
static create(parsedArgs: Interfaces.InferredArgs<typeof args>, parsedFlags: Interfaces.InferredFlags<typeof prewarmFlags>, environment: CliEnvironment): PrewarmQueryServiceBuildContext;
|
|
85
|
+
}
|
|
86
|
+
declare const ParameterQueryServiceBuildContext_base: new (values: QueryBuilderServiceBuildContextValues) => Readonly<QueryBuilderServiceBuildContextValues>;
|
|
87
|
+
/** What a parameter query is built for: which query parameters change a page. */
|
|
88
|
+
export declare class ParameterQueryServiceBuildContext extends ParameterQueryServiceBuildContext_base {
|
|
89
|
+
static readonly args: {
|
|
90
|
+
customerPath: Interfaces.Arg<string, {
|
|
91
|
+
exists?: boolean;
|
|
92
|
+
}>;
|
|
93
|
+
};
|
|
94
|
+
static readonly flags: {
|
|
95
|
+
bySet: Interfaces.BooleanFlag<boolean>;
|
|
96
|
+
minImpressions: Interfaces.OptionFlag<number, Interfaces.CustomOptions>;
|
|
97
|
+
execute: Interfaces.BooleanFlag<boolean>;
|
|
98
|
+
quiet: Interfaces.BooleanFlag<boolean>;
|
|
99
|
+
excludeNoindex: Interfaces.BooleanFlag<boolean>;
|
|
100
|
+
excludeSuspicious: Interfaces.BooleanFlag<boolean>;
|
|
101
|
+
explain: Interfaces.BooleanFlag<boolean>;
|
|
102
|
+
hardNavigationsOnly: Interfaces.BooleanFlag<boolean>;
|
|
103
|
+
days: Interfaces.OptionFlag<number, Interfaces.CustomOptions>;
|
|
104
|
+
configName: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
105
|
+
catalog: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
106
|
+
workgroup: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
107
|
+
};
|
|
108
|
+
readonly queryType = QueryType.parameter;
|
|
109
|
+
static create(parsedArgs: Interfaces.InferredArgs<typeof args>, parsedFlags: Interfaces.InferredFlags<typeof parameterFlags>, environment: CliEnvironment): ParameterQueryServiceBuildContext;
|
|
110
|
+
}
|
|
111
|
+
/** Either query's build context; the factory builds both. */
|
|
112
|
+
export type QueryServiceBuildContext = PrewarmQueryServiceBuildContext | ParameterQueryServiceBuildContext;
|
|
113
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { CLI_ATHENA } from "../athena/athena-flags.js";
|
|
2
|
+
import { CLI_CONFIG_NAME, CLI_CUSTOMER_CONFIG, } from "../integration-api/customer-config-flags.js";
|
|
3
|
+
import { CLI_QUERY_DAYS, CLI_QUERY_FILTERS, CLI_QUERY_OUTPUT, CLI_QUERY_PARAMETER, CLI_QUERY_PREWARM, } from "./query-builder-flags.js";
|
|
4
|
+
import { Context } from "../../models/context.js";
|
|
5
|
+
import { normalizeDevices } from "./queries/device.js";
|
|
6
|
+
import { QueryType } from "./query-builder-model.js";
|
|
7
|
+
const args = { ...CLI_CUSTOMER_CONFIG };
|
|
8
|
+
/** The flags both query commands take. */
|
|
9
|
+
const commonFlags = {
|
|
10
|
+
...CLI_ATHENA,
|
|
11
|
+
...CLI_CONFIG_NAME,
|
|
12
|
+
...CLI_QUERY_DAYS,
|
|
13
|
+
...CLI_QUERY_FILTERS,
|
|
14
|
+
...CLI_QUERY_OUTPUT,
|
|
15
|
+
};
|
|
16
|
+
const prewarmFlags = { ...commonFlags, ...CLI_QUERY_PREWARM };
|
|
17
|
+
const parameterFlags = { ...commonFlags, ...CLI_QUERY_PARAMETER };
|
|
18
|
+
/** The values both query commands set from their common flags. */
|
|
19
|
+
function commonValues(parsedArgs, parsedFlags, environment) {
|
|
20
|
+
return {
|
|
21
|
+
environment,
|
|
22
|
+
customerPath: parsedArgs.customerPath,
|
|
23
|
+
configName: parsedFlags.configName,
|
|
24
|
+
catalog: parsedFlags.catalog,
|
|
25
|
+
workgroup: parsedFlags.workgroup,
|
|
26
|
+
days: parsedFlags.days,
|
|
27
|
+
excludeNoindex: parsedFlags.excludeNoindex,
|
|
28
|
+
excludeSuspicious: parsedFlags.excludeSuspicious,
|
|
29
|
+
explain: parsedFlags.explain,
|
|
30
|
+
hardNavigationsOnly: parsedFlags.hardNavigationsOnly,
|
|
31
|
+
execute: parsedFlags.execute,
|
|
32
|
+
quiet: parsedFlags.quiet,
|
|
33
|
+
isWindows: environment.oclif.windows,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/** What a prewarm query is built for: which urls of a customer to warm. */
|
|
37
|
+
export class PrewarmQueryServiceBuildContext extends Context() {
|
|
38
|
+
static args = args;
|
|
39
|
+
static flags = prewarmFlags;
|
|
40
|
+
queryType = QueryType.prewarm;
|
|
41
|
+
static create(parsedArgs, parsedFlags, environment) {
|
|
42
|
+
return new PrewarmQueryServiceBuildContext({
|
|
43
|
+
...commonValues(parsedArgs, parsedFlags, environment),
|
|
44
|
+
count: parsedFlags.count,
|
|
45
|
+
excludeNotFound: parsedFlags.excludeNotFound,
|
|
46
|
+
limit: parsedFlags.limit,
|
|
47
|
+
match: parsedFlags.match,
|
|
48
|
+
minHits: parsedFlags.minHits,
|
|
49
|
+
devices: normalizeDevices(parsedFlags.device),
|
|
50
|
+
variations: parsedFlags.variation,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/** What a parameter query is built for: which query parameters change a page. */
|
|
55
|
+
export class ParameterQueryServiceBuildContext extends Context() {
|
|
56
|
+
static args = args;
|
|
57
|
+
static flags = parameterFlags;
|
|
58
|
+
queryType = QueryType.parameter;
|
|
59
|
+
static create(parsedArgs, parsedFlags, environment) {
|
|
60
|
+
return new ParameterQueryServiceBuildContext({
|
|
61
|
+
...commonValues(parsedArgs, parsedFlags, environment),
|
|
62
|
+
bySet: parsedFlags.bySet,
|
|
63
|
+
minImpressions: parsedFlags.minImpressions,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
PrewarmQueryServiceBuildContext;
|
|
68
|
+
ParameterQueryServiceBuildContext;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { QueryBuilderOptions } from "./query-builder-model.js";
|
|
2
2
|
import { ParsedRuleSets } from "./rules/index.js";
|
|
3
3
|
import { CliServiceInterface } from "../cli/index.js";
|
|
4
4
|
import { AthenaService } from "../athena/index.js";
|
|
@@ -7,7 +7,7 @@ import { AthenaService } from "../athena/index.js";
|
|
|
7
7
|
* onboarding dashboard's query editor offers. Everything else a query is built
|
|
8
8
|
* from (the app, its rule sets, the catalog) is fixed for the process.
|
|
9
9
|
*/
|
|
10
|
-
export type QueryOverrides = Pick<
|
|
10
|
+
export type QueryOverrides = Pick<QueryBuilderOptions, "bySet" | "days" | "excludeNoindex" | "excludeSuspicious" | "hardNavigationsOnly" | "minImpressions">;
|
|
11
11
|
/** {@link QueryOverrides} with every default filled in. */
|
|
12
12
|
export type ResolvedQueryOptions = Required<QueryOverrides>;
|
|
13
13
|
export declare class QueryBuilderService {
|
|
@@ -15,7 +15,7 @@ export declare class QueryBuilderService {
|
|
|
15
15
|
private ruleSets;
|
|
16
16
|
private cli;
|
|
17
17
|
private athenaService?;
|
|
18
|
-
constructor(context:
|
|
18
|
+
constructor(context: QueryBuilderOptions, ruleSets: ParsedRuleSets, cli: CliServiceInterface, athenaService?: AthenaService);
|
|
19
19
|
/** The app the query targets, as read from the customer config. */
|
|
20
20
|
get app(): string;
|
|
21
21
|
run(): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { parse } from "@oclif/core/parser";
|
|
2
2
|
import { expect } from "chai";
|
|
3
3
|
import { describe, it } from "mocha";
|
|
4
|
-
import { CLI_QUERY_VARIATIONS } from "../
|
|
4
|
+
import { CLI_QUERY_VARIATIONS } from "../query-builder-flags.js";
|
|
5
5
|
async function parseFlags(argv) {
|
|
6
6
|
const { flags } = await parse(argv, { flags: CLI_QUERY_VARIATIONS });
|
|
7
7
|
return flags;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { RevalidateContextInterface } from "./revalidate-model.js";
|
|
1
|
+
import { RevalidateServiceBuildContext } from "./revalidate-service-build-context.js";
|
|
3
2
|
import { RevalidateService } from "./revalidate-service.js";
|
|
4
3
|
export declare class RevalidateFactory {
|
|
5
|
-
private context;
|
|
6
|
-
|
|
7
|
-
constructor(context: RevalidateContextInterface, cli?: CliServiceInterface);
|
|
4
|
+
private readonly context;
|
|
5
|
+
constructor(context: RevalidateServiceBuildContext);
|
|
8
6
|
getService(): RevalidateService;
|
|
9
7
|
}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import { CliContext, CliServiceFactory, } from "../cli/index.js";
|
|
2
1
|
import { ConfigApiContext, ConfigApiServiceFactory, } from "../config-api/index.js";
|
|
3
2
|
import { RevalidateService } from "./revalidate-service.js";
|
|
4
3
|
export class RevalidateFactory {
|
|
5
4
|
context;
|
|
6
|
-
|
|
7
|
-
constructor(context, cli) {
|
|
5
|
+
constructor(context) {
|
|
8
6
|
this.context = context;
|
|
9
|
-
this.cli = cli;
|
|
10
7
|
}
|
|
11
8
|
getService() {
|
|
12
|
-
const cli = this.cli
|
|
13
|
-
new CliServiceFactory(new CliContext(this.context.quiet)).getService();
|
|
9
|
+
const cli = this.context.environment.cli;
|
|
14
10
|
const configApi = new ConfigApiServiceFactory(new ConfigApiContext(this.context.app)).getService();
|
|
15
11
|
return new RevalidateService(configApi, cli, this.context.app);
|
|
16
12
|
}
|
|
@@ -39,12 +39,3 @@ export interface RevalidatePreviewInterface {
|
|
|
39
39
|
count: number;
|
|
40
40
|
sample: string[];
|
|
41
41
|
}
|
|
42
|
-
export interface RevalidateContextInterface {
|
|
43
|
-
app: string;
|
|
44
|
-
quiet: boolean;
|
|
45
|
-
}
|
|
46
|
-
export declare class RevalidateContext implements RevalidateContextInterface {
|
|
47
|
-
readonly app: string;
|
|
48
|
-
readonly quiet: boolean;
|
|
49
|
-
constructor(app: string, quiet?: boolean);
|
|
50
|
-
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Interfaces } from "@oclif/core";
|
|
2
|
+
import { CliEnvironment, CommandContextValues } from "../cli/index.js";
|
|
3
|
+
declare const args: {
|
|
4
|
+
app: Interfaces.Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
declare const flags: {
|
|
7
|
+
pattern: Interfaces.OptionFlag<string[], Interfaces.CustomOptions>;
|
|
8
|
+
prefix: Interfaces.OptionFlag<string[], Interfaces.CustomOptions>;
|
|
9
|
+
query: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
10
|
+
type: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
11
|
+
dryRun: Interfaces.BooleanFlag<boolean>;
|
|
12
|
+
wait: Interfaces.BooleanFlag<boolean>;
|
|
13
|
+
yes: Interfaces.BooleanFlag<boolean>;
|
|
14
|
+
quiet: Interfaces.BooleanFlag<boolean>;
|
|
15
|
+
};
|
|
16
|
+
export interface RevalidateServiceBuildContextValues extends CommandContextValues {
|
|
17
|
+
readonly app: string;
|
|
18
|
+
readonly quiet: boolean;
|
|
19
|
+
}
|
|
20
|
+
declare const RevalidateServiceBuildContext_base: new (values: RevalidateServiceBuildContextValues) => Readonly<RevalidateServiceBuildContextValues>;
|
|
21
|
+
/** Which app `sk revalidate` purges or revalidates in. */
|
|
22
|
+
export declare class RevalidateServiceBuildContext extends RevalidateServiceBuildContext_base {
|
|
23
|
+
static readonly args: {
|
|
24
|
+
app: Interfaces.Arg<string, Record<string, unknown>>;
|
|
25
|
+
};
|
|
26
|
+
static readonly flags: {
|
|
27
|
+
pattern: Interfaces.OptionFlag<string[], Interfaces.CustomOptions>;
|
|
28
|
+
prefix: Interfaces.OptionFlag<string[], Interfaces.CustomOptions>;
|
|
29
|
+
query: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
30
|
+
type: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
31
|
+
dryRun: Interfaces.BooleanFlag<boolean>;
|
|
32
|
+
wait: Interfaces.BooleanFlag<boolean>;
|
|
33
|
+
yes: Interfaces.BooleanFlag<boolean>;
|
|
34
|
+
quiet: Interfaces.BooleanFlag<boolean>;
|
|
35
|
+
};
|
|
36
|
+
static create(parsedArgs: Interfaces.InferredArgs<typeof args>, parsedFlags: Interfaces.InferredFlags<typeof flags>, environment: CliEnvironment): RevalidateServiceBuildContext;
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Args, Flags } from "@oclif/core";
|
|
2
|
+
import { Context } from "../../models/context.js";
|
|
3
|
+
import { CONFIRMATION_THRESHOLD, REVALIDATE_TYPES, } from "./revalidate-model.js";
|
|
4
|
+
const args = {
|
|
5
|
+
app: Args.string({
|
|
6
|
+
name: "app",
|
|
7
|
+
required: true,
|
|
8
|
+
description: "The customer app name",
|
|
9
|
+
}),
|
|
10
|
+
};
|
|
11
|
+
const flags = {
|
|
12
|
+
["pattern"]: Flags.string({
|
|
13
|
+
multiple: true,
|
|
14
|
+
description: 'URL pattern to purge, as a regex anchored at the scheme — mirror what the config excludes, e.g. "^https://www.example.com/en/.*-c1234$". Repeatable. The command derives the prefix the API requires from the pattern\'s literal head, and MongoDB reads that same literal as index bounds.',
|
|
15
|
+
}),
|
|
16
|
+
["prefix"]: Flags.string({
|
|
17
|
+
multiple: true,
|
|
18
|
+
description: "URL prefix, matched against the start of the cached URL. Derived from --pattern by default; state it only to override that, or to purge a whole path without a pattern.",
|
|
19
|
+
}),
|
|
20
|
+
["query"]: Flags.string({
|
|
21
|
+
description: "Raw MongoDB query on the asset fields, as JSON. An escape hatch for a rule --pattern cannot express, such as a condition on another field. It replaces the query --pattern would build.",
|
|
22
|
+
}),
|
|
23
|
+
["type"]: Flags.string({
|
|
24
|
+
options: [...REVALIDATE_TYPES],
|
|
25
|
+
default: "REFRESH",
|
|
26
|
+
description: "REFRESH revalidates against origin and keeps serving the cached copy meanwhile. A URL that went out of scope needs PURGE instead: it drops the entries and does not rebuild them, which is the only type that stops serving for good.",
|
|
27
|
+
}),
|
|
28
|
+
dryRun: Flags.boolean({
|
|
29
|
+
char: "d",
|
|
30
|
+
default: false,
|
|
31
|
+
description: "Report the assets the filter selects and exit. Changes nothing.",
|
|
32
|
+
}),
|
|
33
|
+
["wait"]: Flags.boolean({
|
|
34
|
+
default: false,
|
|
35
|
+
description: "Poll the job until it finishes.",
|
|
36
|
+
}),
|
|
37
|
+
["yes"]: Flags.boolean({
|
|
38
|
+
default: false,
|
|
39
|
+
description: `Skip the confirmation a dropping job above ${CONFIRMATION_THRESHOLD} assets asks for. Required in a non-interactive shell.`,
|
|
40
|
+
}),
|
|
41
|
+
quiet: Flags.boolean({
|
|
42
|
+
char: "q",
|
|
43
|
+
default: false,
|
|
44
|
+
description: "less output non interactive",
|
|
45
|
+
}),
|
|
46
|
+
};
|
|
47
|
+
/** Which app `sk revalidate` purges or revalidates in. */
|
|
48
|
+
export class RevalidateServiceBuildContext extends Context() {
|
|
49
|
+
static args = args;
|
|
50
|
+
static flags = flags;
|
|
51
|
+
static create(parsedArgs, parsedFlags, environment) {
|
|
52
|
+
return new RevalidateServiceBuildContext({
|
|
53
|
+
environment,
|
|
54
|
+
app: parsedArgs["app"],
|
|
55
|
+
quiet: parsedFlags["quiet"],
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
RevalidateServiceBuildContext;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CliEnvironment, CliServiceInterface } from "../../cli/index.js";
|
|
2
2
|
import { BrowserDetector } from "./browser-detector.js";
|
|
3
3
|
import { BrowserManager } from "./browser-manager.js";
|
|
4
4
|
export declare class BrowserSetupService {
|
|
5
5
|
private readonly cli;
|
|
6
|
-
private readonly
|
|
7
|
-
private readonly userConfig;
|
|
6
|
+
private readonly environment;
|
|
8
7
|
private readonly detector;
|
|
9
8
|
private readonly manager;
|
|
10
|
-
constructor(cli: CliServiceInterface,
|
|
9
|
+
constructor(cli: CliServiceInterface, environment: CliEnvironment, detector: BrowserDetector, manager: BrowserManager);
|
|
11
10
|
/**
|
|
12
11
|
* Interactive browser selection: pick a detected browser or download one via
|
|
13
12
|
* puppeteer, then persist the choice.
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
const MS_PER_DAY = 24 * 60 * 60 * 1000;
|
|
2
2
|
export class BrowserSetupService {
|
|
3
3
|
cli;
|
|
4
|
-
|
|
5
|
-
userConfig;
|
|
4
|
+
environment;
|
|
6
5
|
detector;
|
|
7
6
|
manager;
|
|
8
|
-
constructor(cli,
|
|
7
|
+
constructor(cli, environment, detector, manager) {
|
|
9
8
|
this.cli = cli;
|
|
10
|
-
this.
|
|
11
|
-
this.userConfig = userConfig;
|
|
9
|
+
this.environment = environment;
|
|
12
10
|
this.detector = detector;
|
|
13
11
|
this.manager = manager;
|
|
14
12
|
}
|
|
@@ -32,7 +30,7 @@ export class BrowserSetupService {
|
|
|
32
30
|
value: "install:experimental",
|
|
33
31
|
},
|
|
34
32
|
];
|
|
35
|
-
const currentDefault = detected.find((browser) => browser.executablePath === this.
|
|
33
|
+
const currentDefault = detected.find((browser) => browser.executablePath === this.environment.settings.chromePath)?.id;
|
|
36
34
|
const selected = await this.cli.select("Which browser should Speed Kit use?", choices, currentDefault);
|
|
37
35
|
if (selected.startsWith("install:")) {
|
|
38
36
|
const channel = selected.slice("install:".length);
|
|
@@ -44,7 +42,7 @@ export class BrowserSetupService {
|
|
|
44
42
|
this.cli.writeError("Selected browser could not be resolved.");
|
|
45
43
|
return;
|
|
46
44
|
}
|
|
47
|
-
this.
|
|
45
|
+
this.environment.save({
|
|
48
46
|
chromePath: chosen.executablePath,
|
|
49
47
|
// a manually selected browser is not update-managed by the wizard, so
|
|
50
48
|
// clear the channel to disable the update reminder for it
|
|
@@ -60,7 +58,7 @@ export class BrowserSetupService {
|
|
|
60
58
|
* callers must ensure the session is interactive first.
|
|
61
59
|
*/
|
|
62
60
|
async remindIfDue() {
|
|
63
|
-
const channel = this.
|
|
61
|
+
const channel = this.environment.settings.browserChannel;
|
|
64
62
|
if (channel !== "stable" && channel !== "experimental") {
|
|
65
63
|
return;
|
|
66
64
|
}
|
|
@@ -76,11 +74,11 @@ export class BrowserSetupService {
|
|
|
76
74
|
return;
|
|
77
75
|
}
|
|
78
76
|
// stamp the check regardless so we don't re-check until the next interval
|
|
79
|
-
this.
|
|
80
|
-
if (latestBuildId === this.
|
|
77
|
+
this.environment.save({ lastBrowserUpdateCheck: this.nowIso() });
|
|
78
|
+
if (latestBuildId === this.environment.settings.browserBuildId) {
|
|
81
79
|
return;
|
|
82
80
|
}
|
|
83
|
-
if (this.
|
|
81
|
+
if (this.environment.settings.browserAutoUpdate) {
|
|
84
82
|
await this.installAndPersist(channel);
|
|
85
83
|
return;
|
|
86
84
|
}
|
|
@@ -93,34 +91,34 @@ export class BrowserSetupService {
|
|
|
93
91
|
}
|
|
94
92
|
async installAndPersist(channel) {
|
|
95
93
|
const installed = await this.manager.installChannel(channel);
|
|
96
|
-
this.
|
|
94
|
+
this.environment.save({
|
|
97
95
|
chromePath: installed.executablePath,
|
|
98
96
|
browserChannel: channel,
|
|
99
97
|
browserBuildId: installed.buildId,
|
|
100
98
|
lastBrowserUpdateCheck: this.nowIso(),
|
|
101
99
|
});
|
|
102
|
-
const autoUpdate = await this.cli.confirm("Automatically update the browser when a newer build is available?", this.
|
|
103
|
-
this.
|
|
100
|
+
const autoUpdate = await this.cli.confirm("Automatically update the browser when a newer build is available?", this.environment.settings.browserAutoUpdate);
|
|
101
|
+
this.environment.save({ browserAutoUpdate: autoUpdate });
|
|
104
102
|
if (!autoUpdate) {
|
|
105
103
|
await this.askReminderDays();
|
|
106
104
|
}
|
|
107
105
|
}
|
|
108
106
|
async askReminderDays() {
|
|
109
107
|
const answer = await this.cli.prompt("Remind me to check for browser updates in how many days?", {
|
|
110
|
-
defaultAnswer: String(this.
|
|
108
|
+
defaultAnswer: String(this.environment.settings.updateReminderDays || 3),
|
|
111
109
|
validator: (value) => /^\d+$/.test(value.trim()) ? "" : "Enter a whole number of days",
|
|
112
110
|
});
|
|
113
111
|
const days = Number.parseInt(answer, 10);
|
|
114
112
|
if (!Number.isNaN(days) && days > 0) {
|
|
115
|
-
this.
|
|
113
|
+
this.environment.save({
|
|
116
114
|
updateReminderDays: days,
|
|
117
115
|
lastBrowserUpdateCheck: this.nowIso(),
|
|
118
116
|
});
|
|
119
117
|
}
|
|
120
118
|
}
|
|
121
119
|
isReminderDue() {
|
|
122
|
-
const days = this.
|
|
123
|
-
const last = this.
|
|
120
|
+
const days = this.environment.settings.updateReminderDays || 3;
|
|
121
|
+
const last = this.environment.settings.lastBrowserUpdateCheck;
|
|
124
122
|
if (!last) {
|
|
125
123
|
return true;
|
|
126
124
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CliEnvironment, CliServiceInterface } from "../../cli/index.js";
|
|
2
2
|
import { DiffToolDetector } from "./difftool-detector.js";
|
|
3
3
|
export declare class DiffToolSetupService {
|
|
4
4
|
private readonly cli;
|
|
5
|
-
private readonly
|
|
6
|
-
private readonly userConfig;
|
|
5
|
+
private readonly environment;
|
|
7
6
|
private readonly detector;
|
|
8
|
-
constructor(cli: CliServiceInterface,
|
|
7
|
+
constructor(cli: CliServiceInterface, environment: CliEnvironment, detector: DiffToolDetector);
|
|
9
8
|
/**
|
|
10
9
|
* Detects installed editors/diff tools, lets the user pick one, and persists
|
|
11
10
|
* it as diffExec + diffExecTemplate + diffTool.
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
export class DiffToolSetupService {
|
|
2
2
|
cli;
|
|
3
|
-
|
|
4
|
-
userConfig;
|
|
3
|
+
environment;
|
|
5
4
|
detector;
|
|
6
|
-
constructor(cli,
|
|
5
|
+
constructor(cli, environment, detector) {
|
|
7
6
|
this.cli = cli;
|
|
8
|
-
this.
|
|
9
|
-
this.userConfig = userConfig;
|
|
7
|
+
this.environment = environment;
|
|
10
8
|
this.detector = detector;
|
|
11
9
|
}
|
|
12
10
|
/**
|
|
@@ -27,7 +25,7 @@ export class DiffToolSetupService {
|
|
|
27
25
|
})),
|
|
28
26
|
{ name: "Skip — configure manually later", value: "skip" },
|
|
29
27
|
];
|
|
30
|
-
const selected = await this.cli.select("Which diff tool should Speed Kit use?", choices, this.
|
|
28
|
+
const selected = await this.cli.select("Which diff tool should Speed Kit use?", choices, this.environment.settings.diffTool || undefined);
|
|
31
29
|
if (selected === "skip") {
|
|
32
30
|
return;
|
|
33
31
|
}
|
|
@@ -36,7 +34,7 @@ export class DiffToolSetupService {
|
|
|
36
34
|
this.cli.writeError("Selected diff tool could not be resolved.");
|
|
37
35
|
return;
|
|
38
36
|
}
|
|
39
|
-
this.
|
|
37
|
+
this.environment.save({
|
|
40
38
|
diffTool: chosen.id,
|
|
41
39
|
diffExec: chosen.executablePath,
|
|
42
40
|
diffExecTemplate: chosen.diffExecTemplate,
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CliEnvironment, CliServiceInterface, ManagedExtension } from "../../cli/index.js";
|
|
2
2
|
import { ExtensionInstaller } from "./extension-installer.js";
|
|
3
3
|
export declare class ExtensionSetupService {
|
|
4
4
|
private readonly cli;
|
|
5
|
-
private readonly
|
|
6
|
-
private readonly userConfig;
|
|
5
|
+
private readonly environment;
|
|
7
6
|
private readonly installer;
|
|
8
|
-
constructor(cli: CliServiceInterface,
|
|
7
|
+
constructor(cli: CliServiceInterface, environment: CliEnvironment, installer: ExtensionInstaller);
|
|
9
8
|
/**
|
|
10
9
|
* Wizard step: optionally install one or more Chrome extensions by id/URL.
|
|
11
10
|
*/
|
|
@@ -2,13 +2,11 @@ import { compareVersions } from "./webstore.js";
|
|
|
2
2
|
const MS_PER_DAY = 24 * 60 * 60 * 1000;
|
|
3
3
|
export class ExtensionSetupService {
|
|
4
4
|
cli;
|
|
5
|
-
|
|
6
|
-
userConfig;
|
|
5
|
+
environment;
|
|
7
6
|
installer;
|
|
8
|
-
constructor(cli,
|
|
7
|
+
constructor(cli, environment, installer) {
|
|
9
8
|
this.cli = cli;
|
|
10
|
-
this.
|
|
11
|
-
this.userConfig = userConfig;
|
|
9
|
+
this.environment = environment;
|
|
12
10
|
this.installer = installer;
|
|
13
11
|
}
|
|
14
12
|
/**
|
|
@@ -81,7 +79,7 @@ export class ExtensionSetupService {
|
|
|
81
79
|
async updateAll() {
|
|
82
80
|
const list = this.current();
|
|
83
81
|
// stamp so the daily reminder does not immediately ask again
|
|
84
|
-
this.
|
|
82
|
+
this.environment.save({ lastExtensionUpdateCheck: this.nowIso() });
|
|
85
83
|
for (const ext of list) {
|
|
86
84
|
await this.remindOne(ext);
|
|
87
85
|
}
|
|
@@ -110,7 +108,7 @@ export class ExtensionSetupService {
|
|
|
110
108
|
}
|
|
111
109
|
}
|
|
112
110
|
current() {
|
|
113
|
-
return this.
|
|
111
|
+
return this.environment.settings.managedChromeExtensions ?? [];
|
|
114
112
|
}
|
|
115
113
|
upsert(list, ext) {
|
|
116
114
|
return [...list.filter((entry) => entry.id !== ext.id), ext];
|
|
@@ -123,20 +121,20 @@ export class ExtensionSetupService {
|
|
|
123
121
|
persist(managed) {
|
|
124
122
|
const managedDir = this.installer.extensionsDir;
|
|
125
123
|
const managedPaths = new Set(managed.map((ext) => ext.path));
|
|
126
|
-
const manualPaths = this.
|
|
124
|
+
const manualPaths = this.environment.settings.chromeExtensionPaths
|
|
127
125
|
.split(",")
|
|
128
126
|
.map((entry) => entry.trim())
|
|
129
127
|
.filter((entry) => entry.length > 0 &&
|
|
130
128
|
!entry.startsWith(managedDir) &&
|
|
131
129
|
!managedPaths.has(entry));
|
|
132
130
|
const combined = [...manualPaths, ...managed.map((ext) => ext.path)];
|
|
133
|
-
this.
|
|
131
|
+
this.environment.save({
|
|
134
132
|
managedChromeExtensions: managed,
|
|
135
133
|
chromeExtensionPaths: combined.join(","),
|
|
136
134
|
});
|
|
137
135
|
}
|
|
138
136
|
isCheckDue() {
|
|
139
|
-
const last = this.
|
|
137
|
+
const last = this.environment.settings.lastExtensionUpdateCheck;
|
|
140
138
|
if (!last) {
|
|
141
139
|
return true;
|
|
142
140
|
}
|