netlify-cli 17.5.3 → 17.7.0
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/bin/{run.mjs → run.js} +3 -3
- package/npm-shrinkwrap.json +4 -4
- package/package.json +8 -9
- package/scripts/{postinstall.mjs → postinstall.js} +3 -4
- package/src/commands/addons/addons-auth.js +22 -0
- package/src/commands/addons/{addons-config.mjs → addons-config.js} +9 -34
- package/src/commands/addons/{addons-create.mjs → addons-create.js} +7 -33
- package/src/commands/addons/addons-delete.js +33 -0
- package/src/commands/addons/{addons-list.mjs → addons-list.js} +3 -25
- package/src/commands/addons/addons.js +68 -0
- package/src/commands/addons/index.js +1 -0
- package/src/commands/api/{api.mjs → api.js} +2 -24
- package/src/commands/api/index.js +13 -0
- package/src/commands/{base-command.mjs → base-command.js} +7 -7
- package/src/commands/blobs/blobs-delete.js +20 -0
- package/src/commands/blobs/{blobs-get.mjs → blobs-get.js} +2 -15
- package/src/commands/blobs/{blobs-list.mjs → blobs-list.js} +2 -16
- package/src/commands/blobs/{blobs-set.mjs → blobs-set.js} +2 -17
- package/src/commands/blobs/blobs.js +74 -0
- package/src/commands/blobs/index.js +1 -0
- package/src/commands/build/{build.mjs → build.js} +7 -28
- package/src/commands/build/index.js +13 -0
- package/src/commands/completion/completion.js +29 -0
- package/src/commands/completion/index.js +26 -0
- package/src/commands/deploy/{deploy.mjs → deploy.js} +17 -133
- package/src/commands/deploy/index.js +106 -0
- package/src/commands/dev/{dev-exec.mjs → dev-exec.js} +3 -15
- package/src/commands/dev/{dev.mjs → dev.js} +19 -38
- package/src/commands/dev/index.js +1 -0
- package/src/commands/env/{env-clone.mjs → env-clone.js} +71 -94
- package/src/commands/env/env-get.js +34 -0
- package/src/commands/env/{env-import.mjs → env-import.js} +38 -65
- package/src/commands/env/{env-list.mjs → env-list.js} +3 -37
- package/src/commands/env/{env-set.mjs → env-set.js} +36 -81
- package/src/commands/env/{env-unset.mjs → env-unset.js} +30 -62
- package/src/commands/env/env.js +127 -0
- package/src/commands/env/index.js +1 -0
- package/src/commands/functions/{functions-build.mjs → functions-build.js} +3 -22
- package/src/commands/functions/{functions-create.mjs → functions-create.js} +20 -47
- package/src/commands/functions/{functions-invoke.mjs → functions-invoke.js} +3 -41
- package/src/commands/functions/{functions-list.mjs → functions-list.js} +3 -27
- package/src/commands/functions/{functions-serve.mjs → functions-serve.js} +6 -28
- package/src/commands/functions/functions.js +98 -0
- package/src/commands/functions/index.js +1 -0
- package/src/commands/index.js +2 -0
- package/src/commands/init/index.js +12 -0
- package/src/commands/init/{init.mjs → init.js} +10 -31
- package/src/commands/integration/{deploy.mjs → deploy.js} +7 -28
- package/src/commands/integration/index.js +26 -0
- package/src/commands/link/index.js +13 -0
- package/src/commands/link/{link.mjs → link.js} +6 -28
- package/src/commands/lm/index.js +1 -0
- package/src/commands/lm/{lm-info.mjs → lm-info.js} +2 -9
- package/src/commands/lm/lm-install.js +8 -0
- package/src/commands/lm/{lm-setup.mjs → lm-setup.js} +6 -25
- package/src/commands/lm/lm-uninstall.js +7 -0
- package/src/commands/lm/lm.js +46 -0
- package/src/commands/login/index.js +9 -0
- package/src/commands/login/{login.mjs → login.js} +1 -19
- package/src/commands/logout/index.js +7 -0
- package/src/commands/logout/{logout.mjs → logout.js} +3 -16
- package/src/commands/logs/{build.mjs → build.js} +3 -8
- package/src/commands/logs/{functions.mjs → functions.js} +14 -14
- package/src/commands/logs/index.js +39 -0
- package/src/commands/logs/log-levels.js +11 -0
- package/src/commands/{main.mjs → main.js} +32 -32
- package/src/commands/open/index.js +31 -0
- package/src/commands/open/open-admin.js +11 -0
- package/src/commands/open/open-site.js +12 -0
- package/src/commands/open/open.js +13 -0
- package/src/commands/recipes/{common.mjs → common.js} +2 -2
- package/src/commands/recipes/index.js +20 -0
- package/src/commands/recipes/recipes-list.js +14 -0
- package/src/commands/recipes/{recipes.mjs → recipes.js} +8 -32
- package/src/commands/serve/index.js +27 -0
- package/src/commands/serve/{serve.mjs → serve.js} +14 -51
- package/src/commands/sites/index.js +1 -0
- package/src/commands/sites/{sites-create-template.mjs → sites-create-template.js} +9 -38
- package/src/commands/sites/{sites-create.mjs → sites-create.js} +5 -38
- package/src/commands/sites/{sites-delete.mjs → sites-delete.js} +2 -22
- package/src/commands/sites/{sites-list.mjs → sites-list.js} +4 -24
- package/src/commands/sites/sites.js +77 -0
- package/src/commands/status/index.js +19 -0
- package/src/commands/status/{status-hooks.mjs → status-hooks.js} +2 -20
- package/src/commands/status/{status.mjs → status.js} +2 -23
- package/src/commands/switch/index.js +7 -0
- package/src/commands/switch/{switch.mjs → switch.js} +3 -16
- package/src/commands/unlink/index.js +7 -0
- package/src/commands/unlink/unlink.js +21 -0
- package/src/commands/watch/index.js +8 -0
- package/src/commands/watch/{watch.mjs → watch.js} +4 -21
- package/src/lib/{api.mjs → api.js} +1 -1
- package/src/lib/blobs/{blobs.mjs → blobs.js} +2 -2
- package/src/lib/{build.mjs → build.js} +3 -3
- package/src/lib/completion/{constants.mjs → constants.js} +1 -1
- package/src/lib/completion/{generate-autocompletion.mjs → generate-autocompletion.js} +3 -3
- package/src/lib/completion/{index.mjs → index.js} +1 -1
- package/src/lib/completion/{script.mjs → script.js} +3 -3
- package/src/lib/edge-functions/{deploy.mjs → deploy.js} +2 -2
- package/src/lib/edge-functions/{editor-helper.mjs → editor-helper.js} +1 -1
- package/src/lib/edge-functions/{internal.mjs → internal.js} +2 -2
- package/src/lib/edge-functions/{proxy.mjs → proxy.js} +10 -11
- package/src/lib/edge-functions/{registry.mjs → registry.js} +1 -1
- package/src/lib/{exec-fetcher.mjs → exec-fetcher.js} +2 -2
- package/src/lib/functions/{background.mjs → background.js} +2 -2
- package/src/lib/functions/{form-submissions-handler.mjs → form-submissions-handler.js} +3 -3
- package/src/lib/functions/{local-proxy.mjs → local-proxy.js} +1 -1
- package/src/lib/functions/{netlify-function.mjs → netlify-function.js} +3 -3
- package/src/lib/functions/{registry.mjs → registry.js} +9 -9
- package/src/lib/functions/runtimes/go/{index.mjs → index.js} +2 -2
- package/src/lib/functions/runtimes/{index.mjs → index.js} +3 -4
- package/src/lib/functions/runtimes/js/builders/{netlify-lambda.mjs → netlify-lambda.js} +3 -3
- package/src/lib/functions/runtimes/js/builders/{zisi.mjs → zisi.js} +6 -6
- package/src/lib/functions/runtimes/js/{index.mjs → index.js} +4 -4
- package/src/lib/functions/runtimes/rust/{index.mjs → index.js} +4 -4
- package/src/lib/functions/{scheduled.mjs → scheduled.js} +2 -2
- package/src/lib/functions/{server.mjs → server.js} +15 -15
- package/src/lib/functions/{synchronous.mjs → synchronous.js} +3 -3
- package/src/lib/functions/{utils.mjs → utils.js} +2 -2
- package/src/lib/{geo-location.mjs → geo-location.js} +1 -1
- package/src/lib/{http-agent.mjs → http-agent.js} +1 -1
- package/src/lib/images/{proxy.mjs → proxy.js} +2 -2
- package/src/lib/{log.mjs → log.js} +1 -1
- package/src/recipes/vscode/{index.mjs → index.js} +2 -2
- package/src/recipes/vscode/{settings.mjs → settings.js} +0 -1
- package/src/utils/addons/diffs/{index.mjs → index.js} +1 -1
- package/src/utils/addons/diffs/{options.mjs → options.js} +0 -1
- package/src/utils/addons/{prepare.mjs → prepare.js} +2 -2
- package/src/utils/addons/{prompts.mjs → prompts.js} +1 -1
- package/src/utils/addons/{render.mjs → render.js} +1 -1
- package/src/utils/{banner.mjs → banner.js} +1 -1
- package/src/utils/{build-info.mjs → build-info.js} +3 -3
- package/src/utils/{command-helpers.mjs → command-helpers.js} +4 -9
- package/src/utils/deploy/{deploy-site.mjs → deploy-site.js} +8 -8
- package/src/utils/deploy/{hash-files.mjs → hash-files.js} +1 -1
- package/src/utils/deploy/{hash-fns.mjs → hash-fns.js} +3 -3
- package/src/utils/deploy/{hasher-segments.mjs → hasher-segments.js} +1 -1
- package/src/utils/deploy/{upload-files.mjs → upload-files.js} +1 -1
- package/src/utils/deploy/{util.mjs → util.js} +1 -1
- package/src/utils/{detect-server-settings.mjs → detect-server-settings.js} +6 -7
- package/src/utils/{dev.mjs → dev.js} +3 -3
- package/src/utils/{dot-env.mjs → dot-env.js} +2 -2
- package/src/utils/env/{index.mjs → index.js} +1 -1
- package/src/utils/{framework-server.mjs → framework-server.js} +4 -4
- package/src/utils/functions/{functions.mjs → functions.js} +2 -2
- package/src/utils/functions/{get-functions.mjs → get-functions.js} +1 -1
- package/src/utils/functions/index.js +3 -0
- package/src/utils/{get-global-config.mjs → get-global-config.js} +1 -1
- package/src/utils/{get-repo-data.mjs → get-repo-data.js} +1 -1
- package/src/utils/{get-site.mjs → get-site.js} +1 -1
- package/src/utils/{gh-auth.mjs → gh-auth.js} +3 -3
- package/src/utils/{gitignore.mjs → gitignore.js} +2 -2
- package/src/utils/{headers.mjs → headers.js} +1 -1
- package/src/utils/hooks/{requires-site-info.mjs → requires-site-info.js} +1 -1
- package/src/utils/init/{config-github.mjs → config-github.js} +4 -4
- package/src/utils/init/{config-manual.mjs → config-manual.js} +5 -5
- package/src/utils/init/{config.mjs → config.js} +4 -4
- package/src/utils/init/{node-version.mjs → node-version.js} +1 -1
- package/src/utils/init/{utils.mjs → utils.js} +7 -7
- package/src/utils/{live-tunnel.mjs → live-tunnel.js} +4 -4
- package/src/utils/lm/{install.mjs → install.js} +6 -6
- package/src/utils/lm/{requirements.mjs → requirements.js} +1 -1
- package/src/utils/lm/{steps.mjs → steps.js} +2 -2
- package/src/utils/lm/{ui.mjs → ui.js} +2 -2
- package/src/utils/{open-browser.mjs → open-browser.js} +1 -1
- package/src/utils/{proxy-server.mjs → proxy-server.js} +5 -5
- package/src/utils/{proxy.mjs → proxy.js} +11 -11
- package/src/utils/{redirects.mjs → redirects.js} +1 -1
- package/src/utils/{rules-proxy.mjs → rules-proxy.js} +3 -3
- package/src/utils/{run-build.mjs → run-build.js} +8 -8
- package/src/utils/{shell.mjs → shell.js} +2 -2
- package/src/utils/{state-config.mjs → state-config.js} +1 -1
- package/src/utils/{static-server.mjs → static-server.js} +1 -1
- package/src/utils/telemetry/index.js +2 -0
- package/src/utils/telemetry/{report-error.mjs → report-error.js} +4 -4
- package/src/utils/telemetry/{request.mjs → request.js} +1 -1
- package/src/utils/telemetry/{telemetry.mjs → telemetry.js} +5 -5
- package/src/utils/telemetry/{utils.mjs → utils.js} +1 -1
- package/src/utils/telemetry/{validation.mjs → validation.js} +1 -1
- package/src/utils/{validation.mjs → validation.js} +1 -1
- package/src/commands/addons/addons-auth.mjs +0 -45
- package/src/commands/addons/addons-delete.mjs +0 -53
- package/src/commands/addons/addons.mjs +0 -39
- package/src/commands/addons/index.mjs +0 -1
- package/src/commands/api/index.mjs +0 -1
- package/src/commands/blobs/blobs-delete.mjs +0 -35
- package/src/commands/blobs/blobs.mjs +0 -32
- package/src/commands/blobs/index.mjs +0 -1
- package/src/commands/build/index.mjs +0 -1
- package/src/commands/completion/completion.mjs +0 -53
- package/src/commands/completion/index.mjs +0 -1
- package/src/commands/deploy/index.mjs +0 -1
- package/src/commands/dev/index.mjs +0 -1
- package/src/commands/dev/types.d.ts +0 -30
- package/src/commands/env/env-get.mjs +0 -66
- package/src/commands/env/env.mjs +0 -41
- package/src/commands/env/index.mjs +0 -1
- package/src/commands/functions/functions.mjs +0 -39
- package/src/commands/functions/index.mjs +0 -1
- package/src/commands/index.mjs +0 -2
- package/src/commands/init/index.mjs +0 -1
- package/src/commands/integration/index.mjs +0 -24
- package/src/commands/link/index.mjs +0 -1
- package/src/commands/lm/index.mjs +0 -1
- package/src/commands/lm/lm-install.mjs +0 -27
- package/src/commands/lm/lm-uninstall.mjs +0 -18
- package/src/commands/lm/lm.mjs +0 -30
- package/src/commands/login/index.mjs +0 -1
- package/src/commands/logout/index.mjs +0 -1
- package/src/commands/logs/index.mjs +0 -12
- package/src/commands/open/index.mjs +0 -1
- package/src/commands/open/open-admin.mjs +0 -30
- package/src/commands/open/open-site.mjs +0 -31
- package/src/commands/open/open.mjs +0 -36
- package/src/commands/recipes/index.mjs +0 -1
- package/src/commands/recipes/recipes-list.mjs +0 -25
- package/src/commands/serve/index.mjs +0 -1
- package/src/commands/sites/index.mjs +0 -2
- package/src/commands/sites/sites.mjs +0 -30
- package/src/commands/status/index.mjs +0 -1
- package/src/commands/switch/index.mjs +0 -1
- package/src/commands/types.d.ts +0 -31
- package/src/commands/unlink/index.mjs +0 -1
- package/src/commands/unlink/unlink.mjs +0 -34
- package/src/commands/watch/index.mjs +0 -1
- package/src/functions-templates/typescript/abtest/{{name}}.ts +0 -31
- package/src/functions-templates/typescript/geolocation/{{name}}.ts +0 -24
- package/src/functions-templates/typescript/hello-world/{{name}}.ts +0 -12
- package/src/functions-templates/typescript/json/{{name}}.ts +0 -5
- package/src/functions-templates/typescript/log/{{name}}.ts +0 -9
- package/src/functions-templates/typescript/scheduled-function/{{name}}.ts +0 -12
- package/src/functions-templates/typescript/set-cookies/{{name}}.ts +0 -29
- package/src/functions-templates/typescript/set-req-header/{{name}}.ts +0 -5
- package/src/functions-templates/typescript/set-res-header/{{name}}.ts +0 -7
- package/src/functions-templates/typescript/transform-response/{{name}}.ts +0 -13
- package/src/utils/functions/index.mjs +0 -3
- package/src/utils/telemetry/index.mjs +0 -2
- package/src/utils/types.d.ts +0 -46
- /package/src/functions-templates/go/hello-world/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/hello/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/hello-world/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/identity-signup/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/image-external/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/localized-content/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/sanity-create/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/sanity-groq/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/scheduled-function/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/set-cookies/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/set-req-header/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/set-res-header/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/submission-created/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/transform-response/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/rust/hello-world/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/abtest/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/geolocation/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/hello-world/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/json/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/log/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/scheduled-function/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/set-cookies/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/set-req-header/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/set-res-header/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/transform-response/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/lib/{account.mjs → account.js} +0 -0
- /package/src/lib/completion/{get-autocompletion.mjs → get-autocompletion.js} +0 -0
- /package/src/lib/edge-functions/{bootstrap.mjs → bootstrap.js} +0 -0
- /package/src/lib/edge-functions/{consts.mjs → consts.js} +0 -0
- /package/src/lib/edge-functions/{headers.mjs → headers.js} +0 -0
- /package/src/lib/{fs.mjs → fs.js} +0 -0
- /package/src/lib/functions/{config.mjs → config.js} +0 -0
- /package/src/lib/functions/{memoized-build.mjs → memoized-build.js} +0 -0
- /package/src/lib/functions/runtimes/js/{constants.mjs → constants.js} +0 -0
- /package/src/lib/functions/runtimes/js/{worker.mjs → worker.js} +0 -0
- /package/src/lib/{path.mjs → path.js} +0 -0
- /package/src/lib/{render-error-template.mjs → render-error-template.js} +0 -0
- /package/src/lib/{settings.mjs → settings.js} +0 -0
- /package/src/lib/{spinner.mjs → spinner.js} +0 -0
- /package/src/lib/{string.mjs → string.js} +0 -0
- /package/src/utils/addons/{compare.mjs → compare.js} +0 -0
- /package/src/utils/addons/{validation.mjs → validation.js} +0 -0
- /package/src/utils/{create-deferred.mjs → create-deferred.js} +0 -0
- /package/src/utils/{create-stream-promise.mjs → create-stream-promise.js} +0 -0
- /package/src/utils/deploy/{constants.mjs → constants.js} +0 -0
- /package/src/utils/deploy/{hash-config.mjs → hash-config.js} +0 -0
- /package/src/utils/{execa.mjs → execa.js} +0 -0
- /package/src/utils/{feature-flags.mjs → feature-flags.js} +0 -0
- /package/src/utils/functions/{constants.mjs → constants.js} +0 -0
- /package/src/utils/{get-package-json.mjs → get-package-json.js} +0 -0
- /package/src/utils/init/{plugins.mjs → plugins.js} +0 -0
- /package/src/utils/{parse-raw-flags.mjs → parse-raw-flags.js} +0 -0
- /package/src/utils/{read-repo-url.mjs → read-repo-url.js} +0 -0
- /package/src/utils/{request-id.mjs → request-id.js} +0 -0
- /package/src/utils/{sign-redirect.mjs → sign-redirect.js} +0 -0
- /package/src/utils/sites/{utils.mjs → utils.js} +0 -0
- /package/src/utils/websockets/{index.mjs → index.js} +0 -0
package/src/commands/types.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { NetlifyTOML } from '@netlify/build-info'
|
|
2
|
-
import type { NetlifyAPI } from 'netlify'
|
|
3
|
-
|
|
4
|
-
import StateConfig from '../utils/state-config.mjs'
|
|
5
|
-
|
|
6
|
-
export type NetlifySite = {
|
|
7
|
-
root?: string
|
|
8
|
-
configPath?: string
|
|
9
|
-
siteId?: string
|
|
10
|
-
get id(): string | undefined
|
|
11
|
-
set id(id: string): void
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* The netlify object inside each command with the state
|
|
16
|
-
*/
|
|
17
|
-
export type NetlifyOptions = {
|
|
18
|
-
api: NetlifyAPI
|
|
19
|
-
apiOpts: unknown
|
|
20
|
-
repositoryRoot: string
|
|
21
|
-
/** Absolute path of the netlify configuration file */
|
|
22
|
-
configFilePath: string
|
|
23
|
-
/** Relative path of the netlify configuration file */
|
|
24
|
-
relConfigFilePath: string
|
|
25
|
-
site: NetlifySite
|
|
26
|
-
siteInfo: unknown
|
|
27
|
-
config: NetlifyTOML
|
|
28
|
-
cachedConfig: Record<string, unknown>
|
|
29
|
-
globalConfig: unknown
|
|
30
|
-
state: StateConfig
|
|
31
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createUnlinkCommand } from './unlink.mjs';
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { exit, log } from '../../utils/command-helpers.mjs';
|
|
2
|
-
import { track } from '../../utils/telemetry/index.mjs';
|
|
3
|
-
/**
|
|
4
|
-
* The unlink command
|
|
5
|
-
* @param {import('commander').OptionValues} options
|
|
6
|
-
* @param {import('../base-command.mjs').default} command
|
|
7
|
-
*/
|
|
8
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'options' implicitly has an 'any' type.
|
|
9
|
-
const unlink = async (options, command) => {
|
|
10
|
-
const { site, siteInfo, state } = command.netlify;
|
|
11
|
-
const siteId = site.id;
|
|
12
|
-
if (!siteId) {
|
|
13
|
-
log(`Folder is not linked to a Netlify site. Run 'netlify link' to link it`);
|
|
14
|
-
return exit();
|
|
15
|
-
}
|
|
16
|
-
const siteData = siteInfo;
|
|
17
|
-
state.delete('siteId');
|
|
18
|
-
await track('sites_unlinked', {
|
|
19
|
-
siteId: siteData.id || siteId,
|
|
20
|
-
});
|
|
21
|
-
if (site) {
|
|
22
|
-
log(`Unlinked ${site.configPath} from ${siteData ? siteData.name : siteId}`);
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
log('Unlinked site');
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Creates the `netlify unlink` command
|
|
30
|
-
* @param {import('../base-command.mjs').default} program
|
|
31
|
-
* @returns
|
|
32
|
-
*/
|
|
33
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'program' implicitly has an 'any' type.
|
|
34
|
-
export const createUnlinkCommand = (program) => program.command('unlink').description('Unlink a local folder from a Netlify site').action(unlink);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createWatchCommand } from './watch.mjs';
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { Context } from "https://edge.netlify.com";
|
|
2
|
-
|
|
3
|
-
export default async (request: Request, context: Context) => {
|
|
4
|
-
// look for existing "test_bucket" cookie
|
|
5
|
-
const bucketName = "test_bucket";
|
|
6
|
-
const bucket = context.cookies.get(bucketName);
|
|
7
|
-
|
|
8
|
-
// return here if we find a cookie
|
|
9
|
-
if (bucket) {
|
|
10
|
-
return new Response(`Welcome back! You were assigned ${bucketName} **${bucket}** when you last visited the site!`);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// if no "test_bucket" cookie is found, assign the user to a bucket
|
|
14
|
-
// in this example we're using two buckets (a, b) with an equal weighting of 50/50
|
|
15
|
-
const weighting = 0.5;
|
|
16
|
-
|
|
17
|
-
// get a random number between (0-1)
|
|
18
|
-
// this is a basic example and you may want to experiment
|
|
19
|
-
const random = Math.random();
|
|
20
|
-
const newBucketValue = random <= weighting ? "a" : "b";
|
|
21
|
-
|
|
22
|
-
// set the new "test_bucket" cookie
|
|
23
|
-
context.cookies.set({
|
|
24
|
-
name: bucketName,
|
|
25
|
-
value: newBucketValue,
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
return new Response(
|
|
29
|
-
`Congratulations! You have been assigned ${bucketName} **${newBucketValue}**. View your browser cookies to check it out!`,
|
|
30
|
-
);
|
|
31
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Context } from "https://edge.netlify.com";
|
|
2
|
-
|
|
3
|
-
export default async (request: Request, context: Context) => {
|
|
4
|
-
// Here's what's available on context.geo
|
|
5
|
-
|
|
6
|
-
// context: {
|
|
7
|
-
// geo: {
|
|
8
|
-
// city?: string;
|
|
9
|
-
// country?: {
|
|
10
|
-
// code?: string;
|
|
11
|
-
// name?: string;
|
|
12
|
-
// },
|
|
13
|
-
// subdivision?: {
|
|
14
|
-
// code?: string;
|
|
15
|
-
// name?: string;
|
|
16
|
-
// },
|
|
17
|
-
// }
|
|
18
|
-
// }
|
|
19
|
-
|
|
20
|
-
return Response.json({
|
|
21
|
-
geo: context.geo,
|
|
22
|
-
header: request.headers.get("x-nf-geo"),
|
|
23
|
-
});
|
|
24
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Handler } from '@netlify/functions'
|
|
2
|
-
|
|
3
|
-
export const handler: Handler = async (event, context) => {
|
|
4
|
-
const { name = 'stranger' } = event.queryStringParameters
|
|
5
|
-
|
|
6
|
-
return {
|
|
7
|
-
statusCode: 200,
|
|
8
|
-
body: JSON.stringify({
|
|
9
|
-
message: `Hello, ${name}!`,
|
|
10
|
-
}),
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Context } from "https://edge.netlify.com";
|
|
2
|
-
|
|
3
|
-
export default async (request: Request, context: Context) => {
|
|
4
|
-
console.log(`There was a request from ${context.geo.city} to ${request.url}`);
|
|
5
|
-
|
|
6
|
-
return new Response("The request to this URL was logged", {
|
|
7
|
-
headers: { "content-type": "text/html" },
|
|
8
|
-
});
|
|
9
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { schedule } from '@netlify/functions';
|
|
2
|
-
|
|
3
|
-
// To learn about scheduled functions and supported cron extensions,
|
|
4
|
-
// see: https://ntl.fyi/sched-func
|
|
5
|
-
export const handler = schedule("@hourly", async (event) => {
|
|
6
|
-
const eventBody = JSON.parse(event.body);
|
|
7
|
-
console.log(`Next function run at ${eventBody.next_run}.`);
|
|
8
|
-
|
|
9
|
-
return {
|
|
10
|
-
statusCode: 200
|
|
11
|
-
};
|
|
12
|
-
});
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { Context } from "https://edge.netlify.com";
|
|
2
|
-
|
|
3
|
-
export default async (request: Request, context: Context) => {
|
|
4
|
-
const url = new URL(request.url);
|
|
5
|
-
|
|
6
|
-
switch (url.searchParams.get("action")) {
|
|
7
|
-
case "set":
|
|
8
|
-
context.cookies.set({
|
|
9
|
-
name: "action",
|
|
10
|
-
value: "hello",
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
return new Response('Cookie value has been set. Reload this page without the "action" parameter to see it.');
|
|
14
|
-
|
|
15
|
-
case "clear":
|
|
16
|
-
context.cookies.delete("action");
|
|
17
|
-
|
|
18
|
-
return new Response(
|
|
19
|
-
'Cookie value has been cleared. Reload this page without the "action" parameter to see the new state.',
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const value = context.cookies.get("action");
|
|
24
|
-
const message = value
|
|
25
|
-
? `Cookie value is "${value}". You can clear it by using "?action=clear".`
|
|
26
|
-
: 'Cookie has not been set. You can do so by adding "?action=set" to the URL.';
|
|
27
|
-
|
|
28
|
-
return new Response(message);
|
|
29
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Context } from "https://edge.netlify.com";
|
|
2
|
-
|
|
3
|
-
export default async (request: Request, context: Context) => {
|
|
4
|
-
const url = new URL(request.url);
|
|
5
|
-
|
|
6
|
-
// Look for the query parameter, and return if we don't find it
|
|
7
|
-
if (url.searchParams.get("method") !== "transform") {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
const response = await context.next();
|
|
11
|
-
const text = await response.text();
|
|
12
|
-
return new Response(text.toUpperCase(), response);
|
|
13
|
-
};
|
package/src/utils/types.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export type FrameworkNames = '#static' | '#auto' | '#custom' | string
|
|
2
|
-
|
|
3
|
-
export type FrameworkInfo = {
|
|
4
|
-
build: {
|
|
5
|
-
directory: string
|
|
6
|
-
}
|
|
7
|
-
dev: {
|
|
8
|
-
commands: string[]
|
|
9
|
-
port: number
|
|
10
|
-
pollingStrategies: { name: string }[]
|
|
11
|
-
}
|
|
12
|
-
name: FrameworkNames
|
|
13
|
-
staticAssetsDirectory: string
|
|
14
|
-
env: NodeJS.ProcessEnv
|
|
15
|
-
plugins?: string[]
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export type BaseServerSettings = {
|
|
19
|
-
baseDirectory?: string
|
|
20
|
-
dist?: string
|
|
21
|
-
/** The command that was provided for the dev config */
|
|
22
|
-
command?: string
|
|
23
|
-
/** If it should be served like static files */
|
|
24
|
-
useStaticServer?: boolean
|
|
25
|
-
|
|
26
|
-
/** A port where a proxy can listen to it */
|
|
27
|
-
frameworkPort?: number
|
|
28
|
-
/** The host where a proxy can listen to it */
|
|
29
|
-
frameworkHost?: '127.0.0.1' | '::1'
|
|
30
|
-
functions?: string
|
|
31
|
-
/** The framework name ('Create React App') */
|
|
32
|
-
framework?: string
|
|
33
|
-
env?: NodeJS.ProcessEnv
|
|
34
|
-
pollingStrategies?: string[]
|
|
35
|
-
plugins?: string[]
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export type ServerSettings = BaseServerSettings & {
|
|
39
|
-
/** default 'secret' */
|
|
40
|
-
jwtSecret: string
|
|
41
|
-
/** default 'app_metadata.authorization.roles' */
|
|
42
|
-
jwtRolePath: string
|
|
43
|
-
/** The port where the functions are running on */
|
|
44
|
-
port: number
|
|
45
|
-
https?: { key: string; cert: string; keyFilePath: string; certFilePath: string }
|
|
46
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|