netlify-cli 17.23.5 → 17.23.7

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.
Files changed (63) hide show
  1. package/dist/commands/build/build.d.ts.map +1 -1
  2. package/dist/commands/build/build.js +6 -12
  3. package/dist/commands/deploy/deploy.d.ts.map +1 -1
  4. package/dist/commands/deploy/deploy.js +10 -13
  5. package/dist/commands/dev/dev-exec.d.ts.map +1 -1
  6. package/dist/commands/dev/dev-exec.js +3 -6
  7. package/dist/commands/dev/dev.d.ts.map +1 -1
  8. package/dist/commands/dev/dev.js +3 -3
  9. package/dist/commands/env/env-clone.d.ts.map +1 -1
  10. package/dist/commands/env/env-clone.js +3 -105
  11. package/dist/commands/env/env-get.d.ts.map +1 -1
  12. package/dist/commands/env/env-get.js +3 -9
  13. package/dist/commands/env/env-import.d.ts.map +1 -1
  14. package/dist/commands/env/env-import.js +2 -25
  15. package/dist/commands/env/env-list.d.ts.map +1 -1
  16. package/dist/commands/env/env-list.js +14 -17
  17. package/dist/commands/env/env-set.d.ts.map +1 -1
  18. package/dist/commands/env/env-set.js +1 -33
  19. package/dist/commands/env/env-unset.d.ts.map +1 -1
  20. package/dist/commands/env/env-unset.js +2 -34
  21. package/dist/commands/functions/functions-create.d.ts.map +1 -1
  22. package/dist/commands/functions/functions-create.js +3 -8
  23. package/dist/commands/integration/deploy.d.ts.map +1 -1
  24. package/dist/commands/integration/deploy.js +5 -2
  25. package/dist/commands/serve/serve.js +1 -1
  26. package/dist/commands/sites/sites-create-template.d.ts.map +1 -1
  27. package/dist/commands/sites/sites-create-template.js +13 -2
  28. package/dist/lib/exec-fetcher.d.ts +1 -1
  29. package/dist/lib/exec-fetcher.d.ts.map +1 -1
  30. package/dist/lib/exec-fetcher.js +2 -3
  31. package/dist/lib/functions/registry.js +1 -1
  32. package/dist/lib/functions/runtimes/js/index.d.ts +7 -5
  33. package/dist/lib/functions/runtimes/js/index.d.ts.map +1 -1
  34. package/dist/lib/functions/runtimes/js/index.js +4 -3
  35. package/dist/lib/functions/server.d.ts.map +1 -1
  36. package/dist/lib/functions/server.js +10 -11
  37. package/dist/lib/geo-location.js +2 -1
  38. package/dist/tsconfig.tsbuildinfo +1 -1
  39. package/dist/utils/copy-template-dir/copy-template-dir.d.ts +2 -0
  40. package/dist/utils/copy-template-dir/copy-template-dir.d.ts.map +1 -0
  41. package/dist/utils/copy-template-dir/copy-template-dir.js +74 -0
  42. package/dist/utils/functions/functions.d.ts +3 -3
  43. package/dist/utils/functions/functions.d.ts.map +1 -1
  44. package/dist/utils/functions/functions.js +0 -3
  45. package/dist/utils/gh-auth.js +1 -1
  46. package/dist/utils/live-tunnel.d.ts.map +1 -1
  47. package/dist/utils/live-tunnel.js +5 -1
  48. package/dist/utils/proxy.d.ts.map +1 -1
  49. package/dist/utils/proxy.js +3 -4
  50. package/dist/utils/read-repo-url.d.ts +1 -1
  51. package/dist/utils/read-repo-url.d.ts.map +1 -1
  52. package/dist/utils/sites/utils.d.ts +2 -2
  53. package/dist/utils/sites/utils.d.ts.map +1 -1
  54. package/dist/utils/sites/utils.js +1 -0
  55. package/functions-templates/go/hello-world/go.mod +1 -1
  56. package/functions-templates/javascript/scheduled-function/package.json +1 -1
  57. package/functions-templates/javascript/submission-created/package.json +1 -1
  58. package/functions-templates/rust/hello-world/Cargo.toml +1 -1
  59. package/functions-templates/typescript/hello-world/package-lock.json +38 -121
  60. package/functions-templates/typescript/hello-world/package.json +2 -2
  61. package/functions-templates/typescript/scheduled-function/package.json +2 -2
  62. package/npm-shrinkwrap.json +2709 -4822
  63. package/package.json +28 -26
@@ -0,0 +1,2 @@
1
+ export declare function copyTemplateDir(srcDir: string, outDir: string, vars: any): Promise<string[]>;
2
+ //# sourceMappingURL=copy-template-dir.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-template-dir.d.ts","sourceRoot":"","sources":["../../../src/utils/copy-template-dir/copy-template-dir.ts"],"names":[],"mappings":"AA0DA,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAiClG"}
@@ -0,0 +1,74 @@
1
+ // License for copy-template-dir.
2
+ // Original repository: https://github.com/yoshuawuyts/copy-template-dir
3
+ // The MIT License (MIT)
4
+ // Copyright (c) 2015 Yoshua Wuyts
5
+ // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
6
+ // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
7
+ // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
8
+ // persons to whom the Software is furnished to do so, subject to the following conditions:
9
+ // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
10
+ // Software.
11
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12
+ // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
13
+ // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
14
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15
+ import assert from 'assert';
16
+ import fs from 'fs';
17
+ import path from 'path';
18
+ import { pipeline } from 'stream';
19
+ import { promisify } from 'util';
20
+ // @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'maxstache... Remove this comment to see the full error message
21
+ import maxstache from 'maxstache';
22
+ // @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'maxstache-stream... Remove this comment to see the full error message
23
+ import maxstacheStream from 'maxstache-stream';
24
+ import readdirp from 'readdirp';
25
+ const noop = () => undefined;
26
+ // Remove a leading underscore
27
+ function removeUnderscore(filepath) {
28
+ const parts = filepath.split(path.sep);
29
+ const filename = parts.pop()?.replace(/^_/, '') || '';
30
+ return [...parts, filename].join(path.sep);
31
+ }
32
+ // Write a file to a directory
33
+ async function writeFile(outDir, vars, file) {
34
+ const fileName = file.path;
35
+ const inFile = file.fullPath;
36
+ const parentDir = path.dirname(file.path);
37
+ const outFile = path.join(outDir, maxstache(removeUnderscore(fileName), vars));
38
+ await fs.promises.mkdir(path.join(outDir, maxstache(parentDir, vars)), { recursive: true });
39
+ const rs = fs.createReadStream(inFile);
40
+ const ts = maxstacheStream(vars);
41
+ const ws = fs.createWriteStream(outFile);
42
+ await promisify(pipeline)(rs, ts, ws);
43
+ }
44
+ // High throughput template dir writes
45
+ export async function copyTemplateDir(srcDir, outDir, vars) {
46
+ if (!vars)
47
+ vars = noop;
48
+ assert.strictEqual(typeof srcDir, 'string');
49
+ assert.strictEqual(typeof outDir, 'string');
50
+ assert.strictEqual(typeof vars, 'object');
51
+ await fs.promises.mkdir(outDir, { recursive: true });
52
+ const rs = readdirp(srcDir);
53
+ const streams = [];
54
+ const createdFiles = [];
55
+ rs.on('data', (file) => {
56
+ createdFiles.push(path.join(outDir, maxstache(removeUnderscore(file.path), vars)));
57
+ streams.push(writeFile(outDir, vars, file));
58
+ });
59
+ await new Promise((resolve, reject) => {
60
+ rs.on('end', async () => {
61
+ try {
62
+ await Promise.all(streams);
63
+ resolve();
64
+ }
65
+ catch (error) {
66
+ reject(error);
67
+ }
68
+ });
69
+ rs.on('error', (error) => {
70
+ reject(error);
71
+ });
72
+ });
73
+ return createdFiles;
74
+ }
@@ -13,15 +13,15 @@ export declare const getFunctionsDir: ({ config, options }: {
13
13
  options: any;
14
14
  }, defaultValue: any) => any;
15
15
  export declare const getFunctionsManifestPath: ({ base, packagePath }: {
16
- base: any;
16
+ base: string;
17
17
  packagePath?: string | undefined;
18
18
  }) => Promise<string | null>;
19
19
  export declare const getFunctionsDistPath: ({ base, packagePath }: {
20
- base: any;
20
+ base: string;
21
21
  packagePath?: string | undefined;
22
22
  }) => Promise<string | null>;
23
23
  export declare const getFunctionsServePath: ({ base, packagePath }: {
24
- base: any;
24
+ base: string;
25
25
  packagePath?: string | undefined;
26
26
  }) => string;
27
27
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../../src/utils/functions/functions.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,yBAAyB,uBAAuB,CAAA;AAC7D,eAAO,MAAM,sBAAsB,oBAAoB,CAAA;AAEvD;;;;;;;GAOG;AAEH,eAAO,MAAM,eAAe;;;4BACsF,CAAA;AAGlH,eAAO,MAAM,wBAAwB;;;4BAKpC,CAAA;AAGD,eAAO,MAAM,oBAAoB;;;4BAKhC,CAAA;AAGD,eAAO,MAAM,qBAAqB;;;YAIjC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB;UAK5B,MAAM;;;qBAWb,CAAA"}
1
+ {"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../../src/utils/functions/functions.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,yBAAyB,uBAAuB,CAAA;AAC7D,eAAO,MAAM,sBAAsB,oBAAoB,CAAA;AAEvD;;;;;;;GAOG;AAEH,eAAO,MAAM,eAAe;;;4BACsF,CAAA;AAElH,eAAO,MAAM,wBAAwB;UAA8C,MAAM;;4BAKxF,CAAA;AAED,eAAO,MAAM,oBAAoB;UAA8C,MAAM;;4BAKpF,CAAA;AAED,eAAO,MAAM,qBAAqB;UAAwC,MAAM;;YAI/E,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB;UAK5B,MAAM;;;qBAWb,CAAA"}
@@ -14,19 +14,16 @@ export const SERVE_FUNCTIONS_FOLDER = 'functions-serve';
14
14
  */
15
15
  // @ts-expect-error TS(7031) FIXME: Binding element 'config' implicitly has an 'any' t... Remove this comment to see the full error message
16
16
  export const getFunctionsDir = ({ config, options }, defaultValue) => options.functions || config.dev?.functions || config.functionsDirectory || config.dev?.Functions || defaultValue;
17
- // @ts-expect-error TS(7031) FIXME: Binding element 'base' implicitly has an 'any' typ... Remove this comment to see the full error message
18
17
  export const getFunctionsManifestPath = async ({ base, packagePath = '' }) => {
19
18
  const path = resolve(base, packagePath, getPathInProject(['functions', 'manifest.json']));
20
19
  const isFile = await isFileAsync(path);
21
20
  return isFile ? path : null;
22
21
  };
23
- // @ts-expect-error TS(7031) FIXME: Binding element 'base' implicitly has an 'any' typ... Remove this comment to see the full error message
24
22
  export const getFunctionsDistPath = async ({ base, packagePath = '' }) => {
25
23
  const path = resolve(base, packagePath, getPathInProject(['functions']));
26
24
  const isDirectory = await isDirectoryAsync(path);
27
25
  return isDirectory ? path : null;
28
26
  };
29
- // @ts-expect-error TS(7031) FIXME: Binding element 'base' implicitly has an 'any' typ... Remove this comment to see the full error message
30
27
  export const getFunctionsServePath = ({ base, packagePath = '' }) => {
31
28
  const path = resolve(base, packagePath, getPathInProject([SERVE_FUNCTIONS_FOLDER]));
32
29
  return path;
@@ -44,7 +44,7 @@ export const authWithNetlify = async () => {
44
44
  // @ts-expect-error TS(2722) FIXME: Cannot invoke an object which is possibly 'undefin... Remove this comment to see the full error message
45
45
  deferredResolve(Object.fromEntries(parameters));
46
46
  res.end(`${"<html><head><title>Logged in</title><script>if(history.replaceState){history.replaceState({},'','/')}</script><style>html{font-family:system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';line-height:1.5;background:rgb(18 24 31)}body{overflow:hidden;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;height:100vh;width:100vw;}h3{margin:0}p{margin: 1rem 0 0.5rem}.card{position:relative;display:flex;flex-direction:column;width:75%;max-width:364px;padding:24px;background:white;color:rgb(18 24 31);border-radius:8px;box-shadow:rgb(6 11 16 / 20%) 0px 16px 24px, rgb(6 11 16 / 30%) 0px 6px 30px, rgb(6 11 16 / 40%) 0px 8px 10px;}</style></head>" +
47
- '<body><div class=card><h3>Logged in</h3><p>Youre now logged into Netlify CLI with your '}${parameters.get('provider')} credentials. Please close this window.</p></div>`);
47
+ "<body><div class=card><h3>Logged in</h3><p>You're now logged into Netlify CLI with your "}${parameters.get('provider')} credentials. Please close this window.</p></div>`);
48
48
  server.close();
49
49
  return;
50
50
  }
@@ -1 +1 @@
1
- {"version":3,"file":"live-tunnel.d.ts","sourceRoot":"","sources":["../../src/utils/live-tunnel.ts"],"names":[],"mappings":"AA+FA,eAAO,MAAM,eAAe;;;;;kBAkC3B,CAAA;AAGD,eAAO,MAAM,iBAAiB,oCAqB7B,CAAA"}
1
+ {"version":3,"file":"live-tunnel.d.ts","sourceRoot":"","sources":["../../src/utils/live-tunnel.ts"],"names":[],"mappings":"AA+FA,eAAO,MAAM,eAAe;;;;;kBAsC3B,CAAA;AAGD,eAAO,MAAM,iBAAiB,oCAqB7B,CAAA"}
@@ -31,6 +31,7 @@ const createTunnel = async function ({ netlifyApiToken, siteId, slug }) {
31
31
  });
32
32
  const data = await response.json();
33
33
  if (response.status !== 201) {
34
+ // @ts-expect-error TS(18046) - 'data' is of type 'unknown'
34
35
  throw new Error(data.message);
35
36
  }
36
37
  return data;
@@ -44,7 +45,6 @@ const connectTunnel = function ({ localPort, netlifyApiToken, session }) {
44
45
  log(execPath, args);
45
46
  }
46
47
  const ps = execa(execPath, args, { stdio: 'inherit' });
47
- // @ts-expect-error TS(7006) FIXME: Parameter 'code' implicitly has an 'any' type.
48
48
  ps.on('close', (code) => process.exit(code));
49
49
  ps.on('SIGINT', process.exit);
50
50
  ps.on('SIGTERM', process.exit);
@@ -79,6 +79,7 @@ export const startLiveTunnel = async ({ localPort, netlifyApiToken, siteId, slug
79
79
  slug,
80
80
  });
81
81
  const isLiveTunnelReady = async function () {
82
+ // @ts-expect-error TS(18046) - 'session' is of type 'unknown'
82
83
  const url = `https://api.netlify.com/api/v1/live_sessions/${session.id}`;
83
84
  const response = await fetch(url, {
84
85
  method: 'GET',
@@ -89,8 +90,10 @@ export const startLiveTunnel = async ({ localPort, netlifyApiToken, siteId, slug
89
90
  });
90
91
  const data = await response.json();
91
92
  if (response.status !== 200) {
93
+ // @ts-expect-error TS(18046) - 'session' is of type 'unknown'
92
94
  throw new Error(data.message);
93
95
  }
96
+ // @ts-expect-error TS(18046) - 'data' is of type 'unknown'
94
97
  return data.state === 'online';
95
98
  };
96
99
  connectTunnel({ session, netlifyApiToken, localPort });
@@ -99,6 +102,7 @@ export const startLiveTunnel = async ({ localPort, netlifyApiToken, siteId, slug
99
102
  interval: TUNNEL_POLL_INTERVAL,
100
103
  timeout: TUNNEL_POLL_TIMEOUT,
101
104
  });
105
+ // @ts-expect-error TS(18046) - 'session' is of type 'unknown'
102
106
  return session.session_url;
103
107
  };
104
108
  // @ts-expect-error TS(7006) FIXME: Parameter 'state' implicitly has an 'any' type.
@@ -1 +1 @@
1
- {"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../../src/utils/proxy.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAkB/C,OAAO,EAAqB,cAAc,EAAE,MAAM,YAAY,CAAA;AA0tB9D,eAAO,MAAM,WAAW,aAAuB,KAAK,cAAc,EAAE,OAAO,GAAG,MAAM,CAAC,WAGpF,CAAA;AAID,eAAO,MAAM,UAAU;aAqBT,WAAW;cAAY,cAAc;0BAAwB,OAAO;2CAoGjF,CAAA"}
1
+ {"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../../src/utils/proxy.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAkB/C,OAAO,EAAqB,cAAc,EAAE,MAAM,YAAY,CAAA;AAytB9D,eAAO,MAAM,WAAW,aAAuB,KAAK,cAAc,EAAE,OAAO,GAAG,MAAM,CAAC,WAGpF,CAAA;AAID,eAAO,MAAM,UAAU;aAqBT,WAAW;cAAY,cAAc;0BAAwB,OAAO;2CAoGjF,CAAA"}
@@ -17,7 +17,7 @@ import generateETag from 'etag';
17
17
  import getAvailablePort from 'get-port';
18
18
  import httpProxy from 'http-proxy';
19
19
  import { createProxyMiddleware } from 'http-proxy-middleware';
20
- import jwtDecode from 'jwt-decode';
20
+ import { jwtDecode } from 'jwt-decode';
21
21
  import { locatePath } from 'locate-path';
22
22
  import pFilter from 'p-filter';
23
23
  import toReadableStream from 'to-readable-stream';
@@ -27,9 +27,9 @@ import { getFormHandler } from '../lib/functions/form-submissions-handler.js';
27
27
  import { DEFAULT_FUNCTION_URL_EXPRESSION } from '../lib/functions/registry.js';
28
28
  import { initializeProxy as initializeImageProxy, isImageRequest } from '../lib/images/proxy.js';
29
29
  import renderErrorTemplate from '../lib/render-error-template.js';
30
- import { NETLIFYDEVLOG, NETLIFYDEVWARN, log, chalk } from './command-helpers.js';
30
+ import { NETLIFYDEVLOG, NETLIFYDEVWARN, chalk, log } from './command-helpers.js';
31
31
  import createStreamPromise from './create-stream-promise.js';
32
- import { headersForPath, parseHeaders, NFFunctionName, NFRequestID, NFFunctionRoute } from './headers.js';
32
+ import { NFFunctionName, NFFunctionRoute, NFRequestID, headersForPath, parseHeaders } from './headers.js';
33
33
  import { generateRequestID } from './request-id.js';
34
34
  import { createRewriter, onChanges } from './rules-proxy.js';
35
35
  import { signRedirect } from './sign-redirect.js';
@@ -191,7 +191,6 @@ const serveRedirect = async function ({ env, functionsRegistry, imageProxy, matc
191
191
  if (token) {
192
192
  let jwtValue = {};
193
193
  try {
194
- // @ts-expect-error TS(2349) This expression is not callable
195
194
  jwtValue = jwtDecode(token) || {};
196
195
  }
197
196
  catch (error) {
@@ -3,7 +3,7 @@
3
3
  * Takes a url like https://github.com/netlify-labs/all-the-functions/tree/master/functions/9-using-middleware
4
4
  * and returns https://api.github.com/repos/netlify-labs/all-the-functions/contents/functions/9-using-middleware
5
5
  */
6
- export declare const readRepoURL: (_url: any) => Promise<any>;
6
+ export declare const readRepoURL: (_url: any) => Promise<unknown>;
7
7
  /**
8
8
  * @param {string} _url
9
9
  */
@@ -1 +1 @@
1
- {"version":3,"file":"read-repo-url.d.ts","sourceRoot":"","sources":["../../src/utils/read-repo-url.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AAEH,eAAO,MAAM,WAAW,6BASvB,CAAA;AAkBD;;GAEG;AAEH,eAAO,MAAM,eAAe,gCAO3B,CAAA;AAGD,eAAO,MAAM,YAAY,oCASxB,CAAA"}
1
+ {"version":3,"file":"read-repo-url.d.ts","sourceRoot":"","sources":["../../src/utils/read-repo-url.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AAEH,eAAO,MAAM,WAAW,iCASvB,CAAA;AAkBD;;GAEG;AAEH,eAAO,MAAM,eAAe,gCAO3B,CAAA;AAGD,eAAO,MAAM,YAAY,oCASxB,CAAA"}
@@ -1,4 +1,4 @@
1
- export declare const getTemplatesFromGitHub: (token: any) => Promise<any>;
1
+ export declare const getTemplatesFromGitHub: (token: any) => Promise<unknown>;
2
2
  export declare const validateTemplate: ({ ghToken, templateName }: {
3
3
  ghToken: any;
4
4
  templateName: any;
@@ -9,5 +9,5 @@ export declare const validateTemplate: ({ ghToken, templateName }: {
9
9
  exists: boolean;
10
10
  isTemplate: any;
11
11
  }>;
12
- export declare const createRepo: (templateName: string, ghToken: string, siteName: string) => Promise<any>;
12
+ export declare const createRepo: (templateName: string, ghToken: string, siteName: string) => Promise<unknown>;
13
13
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/utils/sites/utils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,sBAAsB,8BAoBlC,CAAA;AAGD,eAAO,MAAM,gBAAgB;;;;;;;;;EAkB5B,CAAA;AAED,eAAO,MAAM,UAAU,iBAAwB,MAAM,WAAW,MAAM,YAAY,MAAM,iBAcvF,CAAA"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/utils/sites/utils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,sBAAsB,kCAoBlC,CAAA;AAGD,eAAO,MAAM,gBAAgB;;;;;;;;;EAmB5B,CAAA;AAED,eAAO,MAAM,UAAU,iBAAwB,MAAM,WAAW,MAAM,YAAY,MAAM,qBAcvF,CAAA"}
@@ -32,6 +32,7 @@ export const validateTemplate = async ({ ghToken, templateName }) => {
32
32
  throw new Error(`Error fetching template ${templateName}: ${await response.text()}`);
33
33
  }
34
34
  const data = await response.json();
35
+ // @ts-expect-error TS(18046) - 'data' is of type 'unknown'
35
36
  return { exists: true, isTemplate: data.is_template };
36
37
  };
37
38
  export const createRepo = async (templateName, ghToken, siteName) => {
@@ -2,4 +2,4 @@ module github.com/someone/{{name}}
2
2
 
3
3
  go 1.19
4
4
 
5
- require github.com/aws/aws-lambda-go v1.38.0
5
+ require github.com/aws/aws-lambda-go v1.47.0
@@ -15,6 +15,6 @@
15
15
  "author": "Netlify",
16
16
  "license": "MIT",
17
17
  "dependencies": {
18
- "@netlify/functions": "^2.6.3"
18
+ "@netlify/functions": "^2.7.0"
19
19
  }
20
20
  }
@@ -14,6 +14,6 @@
14
14
  "author": "Netlify",
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
- "node-fetch": "^2.6.1"
17
+ "node-fetch": "^3.0.0"
18
18
  }
19
19
  }
@@ -6,7 +6,7 @@ version = "0.1.0"
6
6
  # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7
7
 
8
8
  [dependencies]
9
- aws_lambda_events = "0.7.3"
9
+ aws_lambda_events = "0.15.0"
10
10
  http = "0.2.9"
11
11
  lambda_runtime = "0.7.3"
12
12
  log = "0.4.17"
@@ -9,33 +9,17 @@
9
9
  "version": "1.0.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "@netlify/functions": "^2.6.3",
13
- "@types/node": "^14.0.0",
12
+ "@netlify/functions": "^2.7.0",
13
+ "@types/node": "^20.0.0",
14
14
  "typescript": "^4.0.0"
15
15
  }
16
16
  },
17
- "node_modules/@mswjs/interceptors": {
18
- "version": "0.27.2",
19
- "resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.27.2.tgz",
20
- "integrity": "sha512-mE6PhwcoW70EX8+h+Y/4dLfHk33GFt/y5PzDJz56ktMyaVGFXMJ5BYLbUjdmGEABfE0x5GgAGyKbrbkYww2s3A==",
21
- "dependencies": {
22
- "@open-draft/deferred-promise": "^2.2.0",
23
- "@open-draft/logger": "^0.3.0",
24
- "@open-draft/until": "^2.0.0",
25
- "is-node-process": "^1.2.0",
26
- "outvariant": "^1.2.1",
27
- "strict-event-emitter": "^0.5.1"
28
- },
29
- "engines": {
30
- "node": ">=18"
31
- }
32
- },
33
17
  "node_modules/@netlify/functions": {
34
- "version": "2.6.3",
35
- "resolved": "https://registry.npmjs.org/@netlify/functions/-/functions-2.6.3.tgz",
36
- "integrity": "sha512-7Z9gWyAuPI2NnBOvpYPD66KIWOgNznLz9BkyZ0c7qeRE6p23UCMVZ2VsrJpjPDgoJtKplGSBzASl6fQD7iEeWw==",
18
+ "version": "2.7.0",
19
+ "resolved": "https://registry.npmjs.org/@netlify/functions/-/functions-2.7.0.tgz",
20
+ "integrity": "sha512-4pXC/fuj3eGQ86wbgPiM4zY8+AsNrdz6vcv6FEdUJnZW+LqF8IWjQcY3S0d1hLeLKODYOqq4CkrzGyCpce63Nw==",
37
21
  "dependencies": {
38
- "@netlify/serverless-functions-api": "1.18.0"
22
+ "@netlify/serverless-functions-api": "1.18.1"
39
23
  },
40
24
  "engines": {
41
25
  "node": ">=14.0.0"
@@ -50,11 +34,10 @@
50
34
  }
51
35
  },
52
36
  "node_modules/@netlify/serverless-functions-api": {
53
- "version": "1.18.0",
54
- "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.18.0.tgz",
55
- "integrity": "sha512-VCU5btoGZ8M6iI7HSwpfZXCpBLKWFmRtq5xYt0K7dY96BZWVBmaZY6Tn+w4L2DrGXwAsIeOFNp8CHjVXfuCAkg==",
37
+ "version": "1.18.1",
38
+ "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.18.1.tgz",
39
+ "integrity": "sha512-DrSvivchuwsuQW03zbVPT3nxCQa5tn7m4aoPOsQKibuJXIuSbfxzCBxPLz0+LchU5ds7YyOaCc9872Y32ngYzg==",
56
40
  "dependencies": {
57
- "@mswjs/interceptors": "0.27.2",
58
41
  "@netlify/node-cookies": "^0.1.0",
59
42
  "@opentelemetry/core": "^1.23.0",
60
43
  "@opentelemetry/otlp-transformer": "^0.50.0",
@@ -67,25 +50,6 @@
67
50
  "node": ">=18.0.0"
68
51
  }
69
52
  },
70
- "node_modules/@open-draft/deferred-promise": {
71
- "version": "2.2.0",
72
- "resolved": "https://registry.npmjs.org/@open-draft/deferred-promise/-/deferred-promise-2.2.0.tgz",
73
- "integrity": "sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA=="
74
- },
75
- "node_modules/@open-draft/logger": {
76
- "version": "0.3.0",
77
- "resolved": "https://registry.npmjs.org/@open-draft/logger/-/logger-0.3.0.tgz",
78
- "integrity": "sha512-X2g45fzhxH238HKO4xbSr7+wBS8Fvw6ixhTDuvLd5mqh6bJJCFAPwU9mPDxbcrRtfxv4u5IHCEH77BmxvXmmxQ==",
79
- "dependencies": {
80
- "is-node-process": "^1.2.0",
81
- "outvariant": "^1.4.0"
82
- }
83
- },
84
- "node_modules/@open-draft/until": {
85
- "version": "2.1.0",
86
- "resolved": "https://registry.npmjs.org/@open-draft/until/-/until-2.1.0.tgz",
87
- "integrity": "sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg=="
88
- },
89
53
  "node_modules/@opentelemetry/api": {
90
54
  "version": "1.8.0",
91
55
  "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.8.0.tgz",
@@ -337,30 +301,18 @@
337
301
  }
338
302
  },
339
303
  "node_modules/@types/node": {
340
- "version": "14.18.63",
341
- "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.63.tgz",
342
- "integrity": "sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ=="
343
- },
344
- "node_modules/is-node-process": {
345
- "version": "1.2.0",
346
- "resolved": "https://registry.npmjs.org/is-node-process/-/is-node-process-1.2.0.tgz",
347
- "integrity": "sha512-Vg4o6/fqPxIjtxgUH5QLJhwZ7gW5diGCVlXpuUfELC62CuxM1iHcRe51f2W1FDy04Ai4KJkagKjx3XaqyfRKXw=="
304
+ "version": "20.12.12",
305
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.12.tgz",
306
+ "integrity": "sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==",
307
+ "dependencies": {
308
+ "undici-types": "~5.26.4"
309
+ }
348
310
  },
349
311
  "node_modules/lodash.merge": {
350
312
  "version": "4.6.2",
351
313
  "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
352
314
  "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ=="
353
315
  },
354
- "node_modules/outvariant": {
355
- "version": "1.4.2",
356
- "resolved": "https://registry.npmjs.org/outvariant/-/outvariant-1.4.2.tgz",
357
- "integrity": "sha512-Ou3dJ6bA/UJ5GVHxah4LnqDwZRwAmWxrG3wtrHrbGnP4RnLCtA64A4F+ae7Y8ww660JaddSoArUR5HjipWSHAQ=="
358
- },
359
- "node_modules/strict-event-emitter": {
360
- "version": "0.5.1",
361
- "resolved": "https://registry.npmjs.org/strict-event-emitter/-/strict-event-emitter-0.5.1.tgz",
362
- "integrity": "sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ=="
363
- },
364
316
  "node_modules/typescript": {
365
317
  "version": "4.9.5",
366
318
  "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
@@ -373,6 +325,11 @@
373
325
  "node": ">=4.2.0"
374
326
  }
375
327
  },
328
+ "node_modules/undici-types": {
329
+ "version": "5.26.5",
330
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
331
+ "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="
332
+ },
376
333
  "node_modules/urlpattern-polyfill": {
377
334
  "version": "8.0.2",
378
335
  "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-8.0.2.tgz",
@@ -380,25 +337,12 @@
380
337
  }
381
338
  },
382
339
  "dependencies": {
383
- "@mswjs/interceptors": {
384
- "version": "0.27.2",
385
- "resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.27.2.tgz",
386
- "integrity": "sha512-mE6PhwcoW70EX8+h+Y/4dLfHk33GFt/y5PzDJz56ktMyaVGFXMJ5BYLbUjdmGEABfE0x5GgAGyKbrbkYww2s3A==",
387
- "requires": {
388
- "@open-draft/deferred-promise": "^2.2.0",
389
- "@open-draft/logger": "^0.3.0",
390
- "@open-draft/until": "^2.0.0",
391
- "is-node-process": "^1.2.0",
392
- "outvariant": "^1.2.1",
393
- "strict-event-emitter": "^0.5.1"
394
- }
395
- },
396
340
  "@netlify/functions": {
397
- "version": "2.6.3",
398
- "resolved": "https://registry.npmjs.org/@netlify/functions/-/functions-2.6.3.tgz",
399
- "integrity": "sha512-7Z9gWyAuPI2NnBOvpYPD66KIWOgNznLz9BkyZ0c7qeRE6p23UCMVZ2VsrJpjPDgoJtKplGSBzASl6fQD7iEeWw==",
341
+ "version": "2.7.0",
342
+ "resolved": "https://registry.npmjs.org/@netlify/functions/-/functions-2.7.0.tgz",
343
+ "integrity": "sha512-4pXC/fuj3eGQ86wbgPiM4zY8+AsNrdz6vcv6FEdUJnZW+LqF8IWjQcY3S0d1hLeLKODYOqq4CkrzGyCpce63Nw==",
400
344
  "requires": {
401
- "@netlify/serverless-functions-api": "1.18.0"
345
+ "@netlify/serverless-functions-api": "1.18.1"
402
346
  }
403
347
  },
404
348
  "@netlify/node-cookies": {
@@ -407,11 +351,10 @@
407
351
  "integrity": "sha512-OAs1xG+FfLX0LoRASpqzVntVV/RpYkgpI0VrUnw2u0Q1qiZUzcPffxRK8HF3gc4GjuhG5ahOEMJ9bswBiZPq0g=="
408
352
  },
409
353
  "@netlify/serverless-functions-api": {
410
- "version": "1.18.0",
411
- "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.18.0.tgz",
412
- "integrity": "sha512-VCU5btoGZ8M6iI7HSwpfZXCpBLKWFmRtq5xYt0K7dY96BZWVBmaZY6Tn+w4L2DrGXwAsIeOFNp8CHjVXfuCAkg==",
354
+ "version": "1.18.1",
355
+ "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.18.1.tgz",
356
+ "integrity": "sha512-DrSvivchuwsuQW03zbVPT3nxCQa5tn7m4aoPOsQKibuJXIuSbfxzCBxPLz0+LchU5ds7YyOaCc9872Y32ngYzg==",
413
357
  "requires": {
414
- "@mswjs/interceptors": "0.27.2",
415
358
  "@netlify/node-cookies": "^0.1.0",
416
359
  "@opentelemetry/core": "^1.23.0",
417
360
  "@opentelemetry/otlp-transformer": "^0.50.0",
@@ -421,25 +364,6 @@
421
364
  "urlpattern-polyfill": "8.0.2"
422
365
  }
423
366
  },
424
- "@open-draft/deferred-promise": {
425
- "version": "2.2.0",
426
- "resolved": "https://registry.npmjs.org/@open-draft/deferred-promise/-/deferred-promise-2.2.0.tgz",
427
- "integrity": "sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA=="
428
- },
429
- "@open-draft/logger": {
430
- "version": "0.3.0",
431
- "resolved": "https://registry.npmjs.org/@open-draft/logger/-/logger-0.3.0.tgz",
432
- "integrity": "sha512-X2g45fzhxH238HKO4xbSr7+wBS8Fvw6ixhTDuvLd5mqh6bJJCFAPwU9mPDxbcrRtfxv4u5IHCEH77BmxvXmmxQ==",
433
- "requires": {
434
- "is-node-process": "^1.2.0",
435
- "outvariant": "^1.4.0"
436
- }
437
- },
438
- "@open-draft/until": {
439
- "version": "2.1.0",
440
- "resolved": "https://registry.npmjs.org/@open-draft/until/-/until-2.1.0.tgz",
441
- "integrity": "sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg=="
442
- },
443
367
  "@opentelemetry/api": {
444
368
  "version": "1.8.0",
445
369
  "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.8.0.tgz",
@@ -600,35 +524,28 @@
600
524
  "integrity": "sha512-yL0jI6Ltuz8R+Opj7jClGrul6pOoYrdfVmzQS4SITXRPH7I5IRZbrwe/6/v8v4WYMa6MYZG480S1+uc/IGfqsA=="
601
525
  },
602
526
  "@types/node": {
603
- "version": "14.18.63",
604
- "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.63.tgz",
605
- "integrity": "sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ=="
606
- },
607
- "is-node-process": {
608
- "version": "1.2.0",
609
- "resolved": "https://registry.npmjs.org/is-node-process/-/is-node-process-1.2.0.tgz",
610
- "integrity": "sha512-Vg4o6/fqPxIjtxgUH5QLJhwZ7gW5diGCVlXpuUfELC62CuxM1iHcRe51f2W1FDy04Ai4KJkagKjx3XaqyfRKXw=="
527
+ "version": "20.12.12",
528
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.12.tgz",
529
+ "integrity": "sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==",
530
+ "requires": {
531
+ "undici-types": "~5.26.4"
532
+ }
611
533
  },
612
534
  "lodash.merge": {
613
535
  "version": "4.6.2",
614
536
  "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
615
537
  "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ=="
616
538
  },
617
- "outvariant": {
618
- "version": "1.4.2",
619
- "resolved": "https://registry.npmjs.org/outvariant/-/outvariant-1.4.2.tgz",
620
- "integrity": "sha512-Ou3dJ6bA/UJ5GVHxah4LnqDwZRwAmWxrG3wtrHrbGnP4RnLCtA64A4F+ae7Y8ww660JaddSoArUR5HjipWSHAQ=="
621
- },
622
- "strict-event-emitter": {
623
- "version": "0.5.1",
624
- "resolved": "https://registry.npmjs.org/strict-event-emitter/-/strict-event-emitter-0.5.1.tgz",
625
- "integrity": "sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ=="
626
- },
627
539
  "typescript": {
628
540
  "version": "4.9.5",
629
541
  "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
630
542
  "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g=="
631
543
  },
544
+ "undici-types": {
545
+ "version": "5.26.5",
546
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
547
+ "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="
548
+ },
632
549
  "urlpattern-polyfill": {
633
550
  "version": "8.0.2",
634
551
  "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-8.0.2.tgz",
@@ -14,8 +14,8 @@
14
14
  "author": "Netlify",
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
- "@netlify/functions": "^2.6.3",
18
- "@types/node": "^14.0.0",
17
+ "@netlify/functions": "^2.7.0",
18
+ "@types/node": "^20.0.0",
19
19
  "typescript": "^4.0.0"
20
20
  }
21
21
  }
@@ -15,8 +15,8 @@
15
15
  "author": "Netlify",
16
16
  "license": "MIT",
17
17
  "dependencies": {
18
- "@netlify/functions": "^2.6.3",
19
- "@types/node": "^18.0.0",
18
+ "@netlify/functions": "^2.7.0",
19
+ "@types/node": "^20.0.0",
20
20
  "typescript": "^4.5.5"
21
21
  }
22
22
  }