netlify-cli 17.37.1 → 17.38.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.js +4 -2
- package/dist/commands/addons/addons-config.d.ts.map +1 -1
- package/dist/commands/addons/addons-config.js +0 -1
- package/dist/commands/addons/addons-create.d.ts.map +1 -1
- package/dist/commands/addons/addons-create.js +0 -1
- package/dist/commands/addons/addons-delete.d.ts.map +1 -1
- package/dist/commands/addons/addons-delete.js +0 -1
- package/dist/commands/addons/addons.d.ts.map +1 -1
- package/dist/commands/addons/addons.js +0 -1
- package/dist/commands/api/api.d.ts.map +1 -1
- package/dist/commands/api/api.js +0 -1
- package/dist/commands/base-command.d.ts +2 -2
- package/dist/commands/base-command.d.ts.map +1 -1
- package/dist/commands/base-command.js +2 -2
- package/dist/commands/blobs/blobs-delete.d.ts.map +1 -1
- package/dist/commands/blobs/blobs-delete.js +7 -1
- package/dist/commands/blobs/blobs-set.d.ts +1 -0
- package/dist/commands/blobs/blobs-set.d.ts.map +1 -1
- package/dist/commands/blobs/blobs-set.js +10 -2
- package/dist/commands/build/build.d.ts.map +1 -1
- package/dist/commands/build/build.js +0 -1
- package/dist/commands/completion/completion.d.ts.map +1 -1
- package/dist/commands/completion/completion.js +35 -2
- package/dist/commands/deploy/deploy.d.ts.map +1 -1
- package/dist/commands/deploy/deploy.js +3 -5
- package/dist/commands/deploy/index.d.ts.map +1 -1
- package/dist/commands/deploy/index.js +4 -3
- package/dist/commands/env/env-clone.d.ts.map +1 -1
- package/dist/commands/env/env-clone.js +12 -3
- package/dist/commands/env/env-set.d.ts.map +1 -1
- package/dist/commands/env/env-set.js +8 -3
- package/dist/commands/env/env-unset.d.ts.map +1 -1
- package/dist/commands/env/env-unset.js +7 -3
- package/dist/commands/functions/functions-create.d.ts.map +1 -1
- package/dist/commands/functions/functions-create.js +2 -5
- package/dist/commands/functions/functions-invoke.d.ts.map +1 -1
- package/dist/commands/functions/functions-invoke.js +0 -1
- package/dist/commands/init/index.d.ts.map +1 -1
- package/dist/commands/init/index.js +0 -1
- package/dist/commands/integration/deploy.d.ts.map +1 -1
- package/dist/commands/integration/deploy.js +13 -24
- package/dist/commands/link/link.d.ts.map +1 -1
- package/dist/commands/link/link.js +8 -21
- package/dist/commands/lm/lm-setup.d.ts.map +1 -1
- package/dist/commands/lm/lm-setup.js +0 -1
- package/dist/commands/login/login.d.ts.map +1 -1
- package/dist/commands/login/login.js +0 -2
- package/dist/commands/logout/logout.d.ts.map +1 -1
- package/dist/commands/logout/logout.js +0 -1
- package/dist/commands/logs/build.d.ts.map +1 -1
- package/dist/commands/logs/build.js +4 -0
- package/dist/commands/main.d.ts +34 -0
- package/dist/commands/main.d.ts.map +1 -1
- package/dist/commands/main.js +36 -6
- package/dist/commands/sites/sites-create-template.d.ts +2 -2
- package/dist/commands/sites/sites-create-template.d.ts.map +1 -1
- package/dist/commands/sites/sites-create-template.js +113 -101
- package/dist/commands/sites/sites-create.d.ts +2 -2
- package/dist/commands/sites/sites-create.d.ts.map +1 -1
- package/dist/commands/sites/sites-create.js +1 -9
- package/dist/commands/sites/sites-delete.d.ts.map +1 -1
- package/dist/commands/sites/sites-delete.js +3 -3
- package/dist/commands/sites/sites-list.d.ts.map +1 -1
- package/dist/commands/sites/sites-list.js +1 -5
- package/dist/commands/sites/sites.d.ts.map +1 -1
- package/dist/commands/sites/sites.js +0 -1
- package/dist/commands/status/status.js +3 -2
- package/dist/commands/unlink/unlink.js +2 -2
- package/dist/commands/watch/watch.d.ts.map +1 -1
- package/dist/commands/watch/watch.js +0 -1
- package/dist/lib/api.d.ts +2 -1
- package/dist/lib/api.d.ts.map +1 -1
- package/dist/lib/exec-fetcher.d.ts.map +1 -1
- package/dist/lib/exec-fetcher.js +0 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/addons/prepare.d.ts.map +1 -1
- package/dist/utils/addons/prepare.js +1 -5
- package/dist/utils/command-helpers.d.ts +37 -6
- package/dist/utils/command-helpers.d.ts.map +1 -1
- package/dist/utils/command-helpers.js +21 -9
- package/dist/utils/dev.d.ts.map +1 -1
- package/dist/utils/dev.js +0 -2
- package/dist/utils/framework-server.d.ts.map +1 -1
- package/dist/utils/framework-server.js +2 -3
- package/dist/utils/get-repo-data.d.ts +2 -2
- package/dist/utils/get-repo-data.d.ts.map +1 -1
- package/dist/utils/get-repo-data.js +0 -1
- package/dist/utils/get-site.d.ts.map +1 -1
- package/dist/utils/get-site.js +7 -2
- package/dist/utils/gh-auth.js +1 -1
- package/dist/utils/hooks/requires-site-info.d.ts.map +1 -1
- package/dist/utils/hooks/requires-site-info.js +0 -3
- package/dist/utils/prompts/blob-delete-prompts.d.ts +2 -0
- package/dist/utils/prompts/blob-delete-prompts.d.ts.map +1 -0
- package/dist/utils/prompts/blob-delete-prompts.js +11 -0
- package/dist/utils/prompts/blob-set-prompt.d.ts +2 -0
- package/dist/utils/prompts/blob-set-prompt.d.ts.map +1 -0
- package/dist/utils/prompts/blob-set-prompt.js +11 -0
- package/dist/utils/prompts/confirm-prompt.d.ts +2 -0
- package/dist/utils/prompts/confirm-prompt.d.ts.map +1 -0
- package/dist/utils/prompts/confirm-prompt.js +20 -0
- package/dist/utils/prompts/env-clone-prompt.d.ts +11 -0
- package/dist/utils/prompts/env-clone-prompt.d.ts.map +1 -0
- package/dist/utils/prompts/env-clone-prompt.js +27 -0
- package/dist/utils/prompts/env-set-prompts.d.ts +2 -0
- package/dist/utils/prompts/env-set-prompts.d.ts.map +1 -0
- package/dist/utils/prompts/env-set-prompts.js +11 -0
- package/dist/utils/prompts/env-unset-prompts.d.ts +8 -0
- package/dist/utils/prompts/env-unset-prompts.d.ts.map +1 -0
- package/dist/utils/prompts/env-unset-prompts.js +17 -0
- package/dist/utils/prompts/prompt-messages.d.ts +25 -0
- package/dist/utils/prompts/prompt-messages.d.ts.map +1 -0
- package/dist/utils/prompts/prompt-messages.js +25 -0
- package/dist/utils/run-build.d.ts +2 -0
- package/dist/utils/run-build.d.ts.map +1 -1
- package/dist/utils/run-program.d.ts +3 -0
- package/dist/utils/run-program.d.ts.map +1 -0
- package/dist/utils/run-program.js +12 -0
- package/dist/utils/scripted-commands.d.ts +3 -0
- package/dist/utils/scripted-commands.d.ts.map +1 -0
- package/dist/utils/scripted-commands.js +17 -0
- package/dist/utils/sites/create-template.d.ts +14 -0
- package/dist/utils/sites/create-template.d.ts.map +1 -0
- package/dist/utils/sites/create-template.js +46 -0
- package/dist/utils/sites/utils.d.ts +8 -5
- package/dist/utils/sites/utils.d.ts.map +1 -1
- package/dist/utils/sites/utils.js +23 -11
- package/dist/utils/static-server.d.ts +3 -1
- package/dist/utils/static-server.d.ts.map +1 -1
- package/dist/utils/static-server.js +2 -0
- package/dist/utils/types.d.ts +137 -0
- package/dist/utils/types.d.ts.map +1 -1
- package/functions-templates/javascript/hello-world/{{name}}.mjs +13 -0
- package/functions-templates/javascript/scheduled-function/{{name}}.mjs +11 -0
- package/functions-templates/rust/hello-world/Cargo.toml +1 -1
- package/functions-templates/typescript/hello-world/package-lock.json +15 -15
- package/functions-templates/typescript/hello-world/package.json +1 -1
- package/functions-templates/typescript/hello-world/{{name}}.mts +14 -0
- package/functions-templates/typescript/scheduled-function/package.json +1 -1
- package/functions-templates/typescript/scheduled-function/{{name}}.mts +11 -0
- package/npm-shrinkwrap.json +181 -252
- package/package.json +9 -9
- package/functions-templates/javascript/hello-world/{{name}}.js +0 -17
- package/functions-templates/javascript/identity-signup/.netlify-function-template.mjs +0 -5
- package/functions-templates/javascript/identity-signup/{{name}}.js +0 -29
- package/functions-templates/javascript/sanity-create/.netlify-function-template.mjs +0 -5
- package/functions-templates/javascript/sanity-create/package.json +0 -20
- package/functions-templates/javascript/sanity-create/{{name}}.js +0 -72
- package/functions-templates/javascript/sanity-groq/.netlify-function-template.mjs +0 -5
- package/functions-templates/javascript/sanity-groq/package.json +0 -21
- package/functions-templates/javascript/sanity-groq/{{name}}.js +0 -56
- package/functions-templates/javascript/scheduled-function/{{name}}.js +0 -12
- package/functions-templates/javascript/submission-created/.netlify-function-template.mjs +0 -5
- package/functions-templates/javascript/submission-created/package.json +0 -19
- package/functions-templates/javascript/submission-created/{{name}}.js +0 -29
- package/functions-templates/typescript/hello-world/{{name}}.ts +0 -12
- package/functions-templates/typescript/scheduled-function/{{name}}.ts +0 -12
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import inquirer from 'inquirer';
|
|
2
|
+
// @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'pars... Remove this comment to see the full error message
|
|
3
|
+
import parseGitHubUrl from 'parse-github-url';
|
|
4
|
+
import { log } from '../command-helpers.js';
|
|
5
|
+
import { getTemplatesFromGitHub } from './utils.js';
|
|
6
|
+
export const fetchTemplates = async (token) => {
|
|
7
|
+
const templatesFromGitHubOrg = await getTemplatesFromGitHub(token);
|
|
8
|
+
return templatesFromGitHubOrg
|
|
9
|
+
.filter((repo) => !repo.archived && !repo.disabled)
|
|
10
|
+
.map((template) => ({
|
|
11
|
+
name: template.name,
|
|
12
|
+
sourceCodeUrl: template.html_url,
|
|
13
|
+
slug: template.full_name,
|
|
14
|
+
}));
|
|
15
|
+
};
|
|
16
|
+
export const getTemplateName = async ({ ghToken, options, repository, }) => {
|
|
17
|
+
if (repository) {
|
|
18
|
+
const { repo } = parseGitHubUrl(repository);
|
|
19
|
+
return repo || `netlify-templates/${repository}`;
|
|
20
|
+
}
|
|
21
|
+
if (options.url) {
|
|
22
|
+
const urlFromOptions = new URL(options.url);
|
|
23
|
+
return urlFromOptions.pathname.slice(1);
|
|
24
|
+
}
|
|
25
|
+
const templates = await fetchTemplates(ghToken);
|
|
26
|
+
log(`Choose one of our starter templates. Netlify will create a new repo for this template in your GitHub account.`);
|
|
27
|
+
const { templateName } = await inquirer.prompt([
|
|
28
|
+
{
|
|
29
|
+
type: 'list',
|
|
30
|
+
name: 'templateName',
|
|
31
|
+
message: 'Template:',
|
|
32
|
+
choices: templates.map((template) => ({
|
|
33
|
+
value: template.slug,
|
|
34
|
+
name: template.name,
|
|
35
|
+
})),
|
|
36
|
+
},
|
|
37
|
+
]);
|
|
38
|
+
return templateName;
|
|
39
|
+
};
|
|
40
|
+
export const deployedSiteExists = async (name) => {
|
|
41
|
+
const resp = await fetch(`https://${name}.netlify.app`, {
|
|
42
|
+
method: 'GET',
|
|
43
|
+
});
|
|
44
|
+
return resp.status === 200;
|
|
45
|
+
};
|
|
46
|
+
export const getGitHubLink = ({ options, templateName }) => options.url || `https://github.com/${templateName}`;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import { GitHubRepoResponse } from '../command-helpers.js';
|
|
2
|
+
import { GitHubRepo } from '../types.js';
|
|
3
|
+
export declare const getTemplatesFromGitHub: (token: string) => Promise<GitHubRepo[]>;
|
|
2
4
|
export declare const validateTemplate: ({ ghToken, templateName }: {
|
|
3
|
-
ghToken:
|
|
4
|
-
templateName:
|
|
5
|
+
ghToken: string;
|
|
6
|
+
templateName: string;
|
|
5
7
|
}) => Promise<{
|
|
6
8
|
exists: boolean;
|
|
7
9
|
isTemplate?: undefined;
|
|
8
10
|
} | {
|
|
9
11
|
exists: boolean;
|
|
10
|
-
isTemplate:
|
|
12
|
+
isTemplate: boolean | undefined;
|
|
11
13
|
}>;
|
|
12
|
-
export declare const createRepo: (templateName: string, ghToken: string, siteName: string) => Promise<
|
|
14
|
+
export declare const createRepo: (templateName: string, ghToken: string, siteName: string) => Promise<GitHubRepoResponse>;
|
|
15
|
+
export declare const callLinkSite: (cliPath: string, repoName: string, input: string) => Promise<string>;
|
|
13
16
|
//# 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,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/utils/sites/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAO,kBAAkB,EAAS,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,UAAU,EAAY,MAAM,aAAa,CAAA;AAElD,eAAO,MAAM,sBAAsB,UAAiB,MAAM,KAAG,QAAQ,UAAU,EAAE,CAwBhF,CAAA;AAED,eAAO,MAAM,gBAAgB;aAAgD,MAAM;kBAAgB,MAAM;;;;;;;EAkBxG,CAAA;AAED,eAAO,MAAM,UAAU,iBACP,MAAM,WACX,MAAM,YACL,MAAM,KACf,QAAQ,kBAAkB,CAc5B,CAAA;AAED,eAAO,MAAM,YAAY,YAAmB,MAAM,YAAY,MAAM,SAAS,MAAM,oBAMlF,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import fetch from 'node-fetch';
|
|
2
|
-
|
|
2
|
+
import execa from 'execa';
|
|
3
|
+
import { error } from '../command-helpers.js';
|
|
3
4
|
export const getTemplatesFromGitHub = async (token) => {
|
|
4
5
|
const getPublicGitHubReposFromOrg = new URL(`https://api.github.com/orgs/netlify-templates/repos`);
|
|
5
6
|
// GitHub returns 30 by default and we want to avoid our limit
|
|
@@ -9,16 +10,21 @@ export const getTemplatesFromGitHub = async (token) => {
|
|
|
9
10
|
getPublicGitHubReposFromOrg.searchParams.set('sort', 'full_name');
|
|
10
11
|
// @ts-expect-error TS(2345) FIXME: Argument of type 'number' is not assignable to par... Remove this comment to see the full error message
|
|
11
12
|
getPublicGitHubReposFromOrg.searchParams.set('per_page', REPOS_PER_PAGE);
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
let allTemplates = [];
|
|
14
|
+
try {
|
|
15
|
+
const templates = await fetch(getPublicGitHubReposFromOrg, {
|
|
16
|
+
method: 'GET',
|
|
17
|
+
headers: {
|
|
18
|
+
Authorization: `token ${token}`,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
allTemplates = (await templates.json());
|
|
22
|
+
}
|
|
23
|
+
catch (error_) {
|
|
24
|
+
error(error_);
|
|
25
|
+
}
|
|
19
26
|
return allTemplates;
|
|
20
27
|
};
|
|
21
|
-
// @ts-expect-error TS(7031) FIXME: Binding element 'ghToken' implicitly has an 'any' ... Remove this comment to see the full error message
|
|
22
28
|
export const validateTemplate = async ({ ghToken, templateName }) => {
|
|
23
29
|
const response = await fetch(`https://api.github.com/repos/${templateName}`, {
|
|
24
30
|
headers: {
|
|
@@ -31,8 +37,7 @@ export const validateTemplate = async ({ ghToken, templateName }) => {
|
|
|
31
37
|
if (!response.ok) {
|
|
32
38
|
throw new Error(`Error fetching template ${templateName}: ${await response.text()}`);
|
|
33
39
|
}
|
|
34
|
-
const data = await response.json();
|
|
35
|
-
// @ts-expect-error TS(18046) - 'data' is of type 'unknown'
|
|
40
|
+
const data = (await response.json());
|
|
36
41
|
return { exists: true, isTemplate: data.is_template };
|
|
37
42
|
};
|
|
38
43
|
export const createRepo = async (templateName, ghToken, siteName) => {
|
|
@@ -48,3 +53,10 @@ export const createRepo = async (templateName, ghToken, siteName) => {
|
|
|
48
53
|
const data = await resp.json();
|
|
49
54
|
return data;
|
|
50
55
|
};
|
|
56
|
+
export const callLinkSite = async (cliPath, repoName, input) => {
|
|
57
|
+
const { stdout } = await execa(cliPath, ['link'], {
|
|
58
|
+
input,
|
|
59
|
+
cwd: repoName,
|
|
60
|
+
});
|
|
61
|
+
return stdout;
|
|
62
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static-server.d.ts","sourceRoot":"","sources":["../../src/utils/static-server.ts"],"names":[],"mappings":"AAOA;;;GAGG;AAEH,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"static-server.d.ts","sourceRoot":"","sources":["../../src/utils/static-server.ts"],"names":[],"mappings":"AAOA;;;GAGG;AAEH,eAAO,MAAM,iBAAiB;;;;EA2B7B,CAAA"}
|
|
@@ -29,5 +29,7 @@ export const startStaticServer = async ({ settings }) => {
|
|
|
29
29
|
done();
|
|
30
30
|
});
|
|
31
31
|
await server.listen({ port: settings.frameworkPort });
|
|
32
|
+
const [address] = server.addresses();
|
|
32
33
|
log(`\n${NETLIFYDEVLOG} Static server listening to`, settings.frameworkPort);
|
|
34
|
+
return { family: address.family };
|
|
33
35
|
};
|
package/dist/utils/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
/// <reference types="node" resolution-mode="require"/>
|
|
3
3
|
/// <reference types="node" resolution-mode="require"/>
|
|
4
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
4
5
|
import { Buffer } from 'buffer';
|
|
5
6
|
import { IncomingMessage } from 'http';
|
|
6
7
|
import { Match } from 'netlify-redirector';
|
|
@@ -64,4 +65,140 @@ export interface Request extends IncomingMessage {
|
|
|
64
65
|
hostname?: string;
|
|
65
66
|
}
|
|
66
67
|
export type Rewriter = (req: Request) => Match | null;
|
|
68
|
+
export interface SiteInfo {
|
|
69
|
+
account_name: string;
|
|
70
|
+
account_slug: string;
|
|
71
|
+
admin_url: string;
|
|
72
|
+
build_settings: {
|
|
73
|
+
allowed_branches: string[];
|
|
74
|
+
cmd: string;
|
|
75
|
+
deploy_key_id: string;
|
|
76
|
+
dir: string;
|
|
77
|
+
env?: Record<string, unknown>;
|
|
78
|
+
id: number;
|
|
79
|
+
private_logs: boolean;
|
|
80
|
+
provider: string;
|
|
81
|
+
public_repo: boolean;
|
|
82
|
+
repo_branch: string;
|
|
83
|
+
repo_path: string;
|
|
84
|
+
repo_url: string;
|
|
85
|
+
};
|
|
86
|
+
capabilities: Record<string, unknown>;
|
|
87
|
+
created_at: string;
|
|
88
|
+
custom_domain: string;
|
|
89
|
+
deploy_hook: string;
|
|
90
|
+
deploy_url: string;
|
|
91
|
+
domain_aliases: string[];
|
|
92
|
+
force_ssl: boolean;
|
|
93
|
+
git_provider: string;
|
|
94
|
+
id: string;
|
|
95
|
+
managed_dns: boolean;
|
|
96
|
+
name: string;
|
|
97
|
+
notification_email: string;
|
|
98
|
+
password: string;
|
|
99
|
+
plan: string;
|
|
100
|
+
processing_settings: {
|
|
101
|
+
css: {
|
|
102
|
+
bundle: boolean;
|
|
103
|
+
minify: boolean;
|
|
104
|
+
};
|
|
105
|
+
html: Record<string, unknown>;
|
|
106
|
+
images: Record<string, unknown>;
|
|
107
|
+
js: {
|
|
108
|
+
bundle: boolean;
|
|
109
|
+
minify: boolean;
|
|
110
|
+
};
|
|
111
|
+
skip: boolean;
|
|
112
|
+
};
|
|
113
|
+
published_deploy: {
|
|
114
|
+
admin_url: string;
|
|
115
|
+
branch: string;
|
|
116
|
+
build_id: string;
|
|
117
|
+
commit_ref: string;
|
|
118
|
+
commit_url: string;
|
|
119
|
+
context: string;
|
|
120
|
+
created_at: string;
|
|
121
|
+
deploy_ssl_url: string;
|
|
122
|
+
deploy_url: string;
|
|
123
|
+
draft: boolean;
|
|
124
|
+
error_message: string;
|
|
125
|
+
id: string;
|
|
126
|
+
locked: boolean;
|
|
127
|
+
name: string;
|
|
128
|
+
published_at: string;
|
|
129
|
+
required: string[];
|
|
130
|
+
required_functions: string[];
|
|
131
|
+
review_id: number;
|
|
132
|
+
review_url: string;
|
|
133
|
+
screenshot_url: string;
|
|
134
|
+
site_id: string;
|
|
135
|
+
skipped: boolean;
|
|
136
|
+
ssl_url: string;
|
|
137
|
+
state: string;
|
|
138
|
+
title: string;
|
|
139
|
+
updated_at: string;
|
|
140
|
+
url: string;
|
|
141
|
+
user_id: string;
|
|
142
|
+
};
|
|
143
|
+
screenshot_url: string;
|
|
144
|
+
session_id: string;
|
|
145
|
+
ssl: boolean;
|
|
146
|
+
ssl_url: string;
|
|
147
|
+
state: string;
|
|
148
|
+
updated_at: string;
|
|
149
|
+
url: string;
|
|
150
|
+
user_id: string;
|
|
151
|
+
}
|
|
152
|
+
export type TokenLocation = 'env' | 'flag' | 'config' | 'not found';
|
|
153
|
+
export type EnvVar = {
|
|
154
|
+
key: string;
|
|
155
|
+
scopes: string[];
|
|
156
|
+
values: EnvVarValue[];
|
|
157
|
+
updated_at: string;
|
|
158
|
+
is_secret: boolean;
|
|
159
|
+
};
|
|
160
|
+
type EnvVarValue = {
|
|
161
|
+
id: string;
|
|
162
|
+
context: string;
|
|
163
|
+
};
|
|
164
|
+
export interface Account {
|
|
165
|
+
id: string;
|
|
166
|
+
name: string;
|
|
167
|
+
slug: string;
|
|
168
|
+
type: string;
|
|
169
|
+
capabilities: {
|
|
170
|
+
sites: {
|
|
171
|
+
included: number;
|
|
172
|
+
used: number;
|
|
173
|
+
};
|
|
174
|
+
collaborators: {
|
|
175
|
+
included: number;
|
|
176
|
+
used: number;
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
billing_name: string;
|
|
180
|
+
billing_email: string;
|
|
181
|
+
billing_details: string;
|
|
182
|
+
billing_period: string;
|
|
183
|
+
payment_method_id: string;
|
|
184
|
+
type_name: string;
|
|
185
|
+
type_id: string;
|
|
186
|
+
owner_ids: string[];
|
|
187
|
+
roles_allowed: string[];
|
|
188
|
+
created_at: string;
|
|
189
|
+
updated_at: string;
|
|
190
|
+
}
|
|
191
|
+
export interface GitHubRepo {
|
|
192
|
+
name: string;
|
|
193
|
+
html_url: string;
|
|
194
|
+
full_name: string;
|
|
195
|
+
archived: boolean;
|
|
196
|
+
disabled: boolean;
|
|
197
|
+
}
|
|
198
|
+
export interface Template {
|
|
199
|
+
name: string;
|
|
200
|
+
sourceCodeUrl: string;
|
|
201
|
+
slug: string;
|
|
202
|
+
}
|
|
203
|
+
export {};
|
|
67
204
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":";;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ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,YAAY,EAAE;QACZ,KAAK,EAAE;YACL,QAAQ,EAAE,MAAM,CAAA;YAChB,IAAI,EAAE,MAAM,CAAA;SACb,CAAA;QACD,aAAa,EAAE;YACb,QAAQ,EAAE,MAAM,CAAA;YAChB,IAAI,EAAE,MAAM,CAAA;SACb,CAAA;KACF,CAAA;IACD,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,eAAe,EAAE,MAAM,CAAA;IACvB,cAAc,EAAE,MAAM,CAAA;IACtB,iBAAiB,EAAE,MAAM,CAAA;IACzB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,OAAO,CAAA;IACjB,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,CAAA;IACrB,IAAI,EAAE,MAAM,CAAA;CACb"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Docs on request and context https://docs.netlify.com/functions/build/#code-your-function-2
|
|
2
|
+
export default (request, context) => {
|
|
3
|
+
try {
|
|
4
|
+
const url = new URL(request.url)
|
|
5
|
+
const subject = url.searchParams.get('name') || 'World'
|
|
6
|
+
|
|
7
|
+
return new Response(`Hello ${subject}`)
|
|
8
|
+
} catch (error) {
|
|
9
|
+
return new Response(error.toString(), {
|
|
10
|
+
status: 500,
|
|
11
|
+
})
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// To learn about scheduled functions and supported cron extensions,
|
|
2
|
+
// see: https://ntl.fyi/sched-func
|
|
3
|
+
export default async (req) => {
|
|
4
|
+
const { next_run } = await req.json()
|
|
5
|
+
|
|
6
|
+
console.log('Received event! Next invocation at:', next_run)
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const config = {
|
|
10
|
+
schedule: '@hourly',
|
|
11
|
+
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@netlify/functions": "^2.8.2",
|
|
13
|
-
"@types/node": "^
|
|
13
|
+
"@types/node": "^22.0.0",
|
|
14
14
|
"typescript": "^4.0.0"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
"node_modules/@types/node": {
|
|
49
|
-
"version": "
|
|
50
|
-
"resolved": "https://registry.npmjs.org/@types/node/-/node-
|
|
51
|
-
"integrity": "sha512-
|
|
49
|
+
"version": "22.10.1",
|
|
50
|
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz",
|
|
51
|
+
"integrity": "sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==",
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"undici-types": "~6.
|
|
53
|
+
"undici-types": "~6.20.0"
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
56
|
"node_modules/typescript": {
|
|
@@ -66,9 +66,9 @@
|
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
"node_modules/undici-types": {
|
|
69
|
-
"version": "6.
|
|
70
|
-
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.
|
|
71
|
-
"integrity": "sha512-
|
|
69
|
+
"version": "6.20.0",
|
|
70
|
+
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz",
|
|
71
|
+
"integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="
|
|
72
72
|
},
|
|
73
73
|
"node_modules/urlpattern-polyfill": {
|
|
74
74
|
"version": "8.0.2",
|
|
@@ -100,11 +100,11 @@
|
|
|
100
100
|
}
|
|
101
101
|
},
|
|
102
102
|
"@types/node": {
|
|
103
|
-
"version": "
|
|
104
|
-
"resolved": "https://registry.npmjs.org/@types/node/-/node-
|
|
105
|
-
"integrity": "sha512-
|
|
103
|
+
"version": "22.10.1",
|
|
104
|
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz",
|
|
105
|
+
"integrity": "sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==",
|
|
106
106
|
"requires": {
|
|
107
|
-
"undici-types": "~6.
|
|
107
|
+
"undici-types": "~6.20.0"
|
|
108
108
|
}
|
|
109
109
|
},
|
|
110
110
|
"typescript": {
|
|
@@ -113,9 +113,9 @@
|
|
|
113
113
|
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g=="
|
|
114
114
|
},
|
|
115
115
|
"undici-types": {
|
|
116
|
-
"version": "6.
|
|
117
|
-
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.
|
|
118
|
-
"integrity": "sha512-
|
|
116
|
+
"version": "6.20.0",
|
|
117
|
+
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz",
|
|
118
|
+
"integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="
|
|
119
119
|
},
|
|
120
120
|
"urlpattern-polyfill": {
|
|
121
121
|
"version": "8.0.2",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Context } from '@netlify/functions'
|
|
2
|
+
|
|
3
|
+
export default (request: Request, context: Context) => {
|
|
4
|
+
try {
|
|
5
|
+
const url = new URL(request.url)
|
|
6
|
+
const subject = url.searchParams.get('name') || 'World'
|
|
7
|
+
|
|
8
|
+
return new Response(`Hello ${subject}`)
|
|
9
|
+
} catch (error) {
|
|
10
|
+
return new Response(error.toString(), {
|
|
11
|
+
status: 500,
|
|
12
|
+
})
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Config } from "@netlify/functions"
|
|
2
|
+
|
|
3
|
+
export default async (req: Request) => {
|
|
4
|
+
const { next_run } = await req.json()
|
|
5
|
+
|
|
6
|
+
console.log("Received event! Next invocation at:", next_run)
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const config: Config = {
|
|
10
|
+
schedule: "@hourly"
|
|
11
|
+
}
|