neonctl 2.23.0 → 2.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/commands/functions.js +3 -12
- package/functions_api.js +0 -1
- package/package.json +1 -1
package/commands/functions.js
CHANGED
|
@@ -21,9 +21,8 @@ const DEPLOYMENT_FIELDS = [
|
|
|
21
21
|
'memory_mib',
|
|
22
22
|
'created_at',
|
|
23
23
|
];
|
|
24
|
-
const SLUG_PATTERN = /^[a-z0-9]
|
|
25
|
-
const SLUG_HELP = 'Use 1-
|
|
26
|
-
const MEMORY_CHOICES = [256, 512, 1024, 2048, 4096, 8192];
|
|
24
|
+
const SLUG_PATTERN = /^[a-z0-9]{1,20}$/;
|
|
25
|
+
const SLUG_HELP = 'Use 1-20 lowercase letters and digits (no hyphens or other characters).';
|
|
27
26
|
// Overridable so tests can poll fast; defaults to 2s in real use.
|
|
28
27
|
const POLL_INTERVAL_MS = Number(process.env.NEON_FUNCTIONS_POLL_INTERVAL_MS) || 2000;
|
|
29
28
|
// Upper bound on --wait polling so the CLI never hangs (e.g. if our deployment
|
|
@@ -48,7 +47,7 @@ export const builder = (argv) => argv
|
|
|
48
47
|
.middleware(fillSingleProject)
|
|
49
48
|
.command('deploy <slug>', 'Deploy a function from a local directory', (yargs) => yargs
|
|
50
49
|
.positional('slug', {
|
|
51
|
-
describe: 'Function slug (lowercase
|
|
50
|
+
describe: 'Function slug (1-20 lowercase letters and digits)',
|
|
52
51
|
type: 'string',
|
|
53
52
|
demandOption: true,
|
|
54
53
|
})
|
|
@@ -61,11 +60,6 @@ export const builder = (argv) => argv
|
|
|
61
60
|
describe: 'Entry file to bundle, relative to --path',
|
|
62
61
|
type: 'string',
|
|
63
62
|
},
|
|
64
|
-
'memory-mib': {
|
|
65
|
-
describe: 'Memory in MiB',
|
|
66
|
-
type: 'number',
|
|
67
|
-
choices: MEMORY_CHOICES,
|
|
68
|
-
},
|
|
69
63
|
runtime: {
|
|
70
64
|
describe: 'Function runtime',
|
|
71
65
|
type: 'string',
|
|
@@ -122,7 +116,6 @@ const deploy = async (props) => {
|
|
|
122
116
|
const hasOption = props.path !== undefined ||
|
|
123
117
|
props.entry !== undefined ||
|
|
124
118
|
props.env !== undefined ||
|
|
125
|
-
props.memoryMib !== undefined ||
|
|
126
119
|
props.runtime !== undefined;
|
|
127
120
|
if (!hasOption) {
|
|
128
121
|
throw new Error('Provide at least one option to deploy, e.g. --path, --entry, or --env. ' +
|
|
@@ -134,7 +127,6 @@ const deploy = async (props) => {
|
|
|
134
127
|
}
|
|
135
128
|
const path = props.path ?? '.';
|
|
136
129
|
const entry = props.entry ?? 'index.ts';
|
|
137
|
-
const memoryMib = props.memoryMib ?? 256;
|
|
138
130
|
const runtime = props.runtime ?? 'nodejs24';
|
|
139
131
|
const environment = parseEnv(props.env);
|
|
140
132
|
const source = join(path, entry);
|
|
@@ -157,7 +149,6 @@ const deploy = async (props) => {
|
|
|
157
149
|
}
|
|
158
150
|
await retryOnLock(() => createDeployment(props.apiClient, props.projectId, branchId, props.slug, {
|
|
159
151
|
zip,
|
|
160
|
-
memoryMib,
|
|
161
152
|
runtime,
|
|
162
153
|
environment,
|
|
163
154
|
}));
|
package/functions_api.js
CHANGED
|
@@ -28,7 +28,6 @@ export const deleteFunction = async (apiClient, projectId, branchId, slug) => {
|
|
|
28
28
|
export const createDeployment = async (apiClient, projectId, branchId, slug, params) => {
|
|
29
29
|
const form = new FormData();
|
|
30
30
|
form.append('zip', new Blob([params.zip]), 'bundle.zip');
|
|
31
|
-
form.append('memory_mib', String(params.memoryMib));
|
|
32
31
|
form.append('runtime', params.runtime);
|
|
33
32
|
if (params.environment)
|
|
34
33
|
form.append('environment', params.environment);
|