edgeone 1.6.28 → 1.6.30

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.
@@ -0,0 +1,2 @@
1
+ var z=Object.defineProperty,T=Object.getOwnPropertyDescriptor,O=Object.getOwnPropertyNames,N=Object.prototype.hasOwnProperty,k=(o,n)=>{for(var t in n)z(o,t,{get:n[t],enumerable:!0})},Z=(o,n,t,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of O(n))!N.call(o,i)&&i!==t&&z(o,i,{get:()=>n[i],enumerable:!(a=T(n,i))||a.enumerable});return o},I=o=>Z(z({},"__esModule",{value:!0}),o),y={};k(y,{defineConfig:()=>oe,envConfigSchema:()=>ee,filteredTefConfigSchema:()=>W,nodeFunctionsConfigSchema:()=>R,pathMatch:()=>s,sandboxConfigSchema:()=>P,showError:()=>l,tefBuildConfigSchema:()=>x,tefConfCachesSchema:()=>F,tefConfigSchema:()=>h,tefDevConfigSchema:()=>_,tefDevSiteConfigSchema:()=>j,tefPublishConfigSchema:()=>D,tefRuleConditionSchema:()=>w,tefRuleConfigSchema:()=>E,validateConfig:()=>ne});module.exports=I(y);var e=require("zod"),x=e.z.object({monitor:e.z.array(e.z.string()).optional(),command:e.z.string().optional(),cwd:e.z.string().optional(),target_file:e.z.string()}),j=e.z.object({assets_dir:e.z.string().optional(),proxy_path:e.z.string().optional()}),_=e.z.object({port:e.z.union([e.z.number(),e.z.string()]).optional(),origin:e.z.string().optional(),timeout:e.z.union([e.z.number(),e.z.string()]).optional(),sandbox:e.z.boolean().optional(),favicon:e.z.boolean().optional(),minify:e.z.boolean().optional(),site:j.optional()}),w=e.z.object({target:e.z.string(),operator:e.z.union([e.z.literal("equal"),e.z.literal("notequal")]),values:e.z.array(e.z.string())}),E=e.z.object({condition:e.z.array(w)}),D=e.z.object({minify:e.z.boolean().optional(),rule:e.z.array(E).optional()}),R=e.z.object({maxDuration:e.z.number().min(10).max(120).optional()}),te=e.z.object({type:e.z.enum(["header","cookie","host","query"]),key:e.z.string(),value:e.z.string().optional()}),s=(o,n)=>{var i,r;let t=o.replace(/\\([?*])/g,"$1");return t.length===0?n.addIssue({code:e.z.ZodIssueCode.custom,message:"length match error"}):/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]/.test(t)?n.addIssue({code:e.z.ZodIssueCode.custom,message:"char match error"}):((r=(i=t.match(/\*/g))==null?void 0:i.length)!=null?r:0)>1?n.addIssue({code:e.z.ZodIssueCode.custom,message:"* match error"}):/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]:/.test(t)||/:(?![a-zA-Z0-9]+)/.test(t)?n.addIssue({code:e.z.ZodIssueCode.custom,message:": match error"}):!0},f=e.z.object({source:e.z.string().superRefine(s)});function $(o){let n=o.split(",").map(t=>t.trim()).filter(Boolean);for(let t of n){let a=t.indexOf("="),i=a===-1?t.trim().toLowerCase():t.slice(0,a).trim().toLowerCase();if(i==="stale-while-revalidate"||i==="stale-if-error"){let r=`${i}=86400`;if(a===-1)return`value match error: Cache-Control directive "${i}" must be in k=v form (e.g. ${r})`;if(!t.slice(a+1).trim())return`value match error: Cache-Control directive "${t}" must have a value (e.g. ${r})`}}}var M=e.z.object({key:e.z.string().min(1).max(100).superRefine((o,n)=>/[^a-zA-Z0-9-]/.test(o)?n.addIssue({code:e.z.ZodIssueCode.custom,message:"char match error"}):!0),value:e.z.string().min(1).max(1e3).superRefine((o,n)=>/[\u4e00-\u9fa5]/.test(o)?n.addIssue({code:e.z.ZodIssueCode.custom,message:"char match error"}):!0)}).superRefine((o,n)=>{if(o.key.toLowerCase()==="cache-control"){let t=$(o.value);t&&n.addIssue({code:e.z.ZodIssueCode.custom,path:["value"],message:t})}}),q=M.array().min(1),V=f.merge(e.z.object({headers:q})).array(),H=e.z.union([e.z.literal(307),e.z.literal(301),e.z.literal(302),e.z.literal(308),e.z.literal(303),e.z.literal(304)]),B=f.merge(e.z.object({destination:e.z.string().superRefine(s),permanent:e.z.boolean().optional(),statusCode:H.optional()})).array(),L=f.merge(e.z.object({destination:e.z.string().superRefine(s)})),G=e.z.object({src:e.z.string().superRefine(s),dest:e.z.string().superRefine(s)}),J=e.z.union([L,G]).array(),F=f.merge(e.z.object({cacheTtl:e.z.number()})).array(),C=e.z.object({included_files:e.z.array(e.z.string()).optional().describe("Glob patterns for files to include in the function bundle"),included_files_base_path:e.z.string().optional().describe("Base path for included_files patterns, defaults to project root"),external_node_modules:e.z.array(e.z.string()).optional().describe("Node modules to be treated as external dependencies")}),A=e.z.object({includeFiles:e.z.array(e.z.string()).optional().describe("Glob patterns for files to include in the function bundle"),externalNodeModules:e.z.array(e.z.string()).optional().describe("Node modules to be treated as external dependencies"),maxDuration:e.z.number().min(10).max(120).optional().describe("Maximum execution duration for a single invocation (seconds)")}),S=e.z.object({maxDuration:e.z.number().min(10).max(120).optional().describe("Maximum execution duration for a single invocation (seconds)")}),U=e.z.object({dir:e.z.string().optional().describe("Directory containing agent route files, relative to project root"),framework:e.z.enum(["claude-agent-sdk","openai-sdk","openai-agents-sdk","langgraph","crewai","deepagents"]).optional().describe("Agent framework hint for runtime adapters"),runtime:e.z.string().regex(/^(agent-node|agent-python):(\d+|\d+\.\d+\.\d+)(\|(agent-node|agent-python):(\d+|\d+\.\d+\.\d+))*$/).optional().describe("Agent runtime image tag, e.g. agent-node:1 or agent-python:1.2.0"),timeout:e.z.number().min(1).max(1800).optional().describe("Maximum execution duration for a single agent run (seconds)"),idleTimeout:e.z.number().int().min(1).max(21600).optional().describe("Maximum idle time for an agent session before recycling (seconds)"),maxLifetime:e.z.number().int().min(1).max(604800).optional().describe("Maximum lifetime of an agent session (seconds)"),memoryQuota:e.z.object({maxMessagesPerConversation:e.z.number().int().positive().optional().describe("Maximum messages allowed in a single memory conversation")}).optional().describe("Agent memory quota settings"),includeFiles:e.z.array(e.z.string()).optional().describe("Glob patterns for files to include in the agent bundle"),sandbox:e.z.object({timeout:e.z.number().int().positive().optional().describe("Sandbox instance lifetime/idle timeout in seconds")}).optional().describe("Sandbox configuration for agent runtime"),externalNodeModules:e.z.array(e.z.string()).optional().describe("Node modules to be treated as external dependencies for agent runtime")}),P=e.z.object({timeout:e.z.number().int().positive().optional().describe("Sandbox instance lifetime/idle timeout in seconds")}),K=e.z.object({maxDuration:e.z.number().min(10).max(120).optional().describe("Maximum execution duration for a single invocation (seconds)"),regions:e.z.object({mainland:e.z.array(e.z.string()).optional().describe('\u56FD\u5185 SCF \u90E8\u7F72\u5730\u57DF, \u5982 ["ap-beijing"]'),overseas:e.z.array(e.z.string()).optional().describe('\u6D77\u5916 SCF \u90E8\u7F72\u5730\u57DF, \u5982 ["ap-tokyo"]')}).optional(),includeFiles:e.z.array(e.z.string()).optional().describe("Glob patterns for files to include in the function bundle"),externalNodeModules:e.z.array(e.z.string()).optional().describe("Node modules to be treated as external dependencies"),nodejs:A.optional(),python:S.optional(),go:S.optional(),mainlandRegions:e.z.array(e.z.string()).optional().describe('\u56FD\u5185 SCF \u90E8\u7F72\u5730\u57DF, \u5982 ["ap-shanghai"]'),overseasRegions:e.z.array(e.z.string()).optional().describe('\u6D77\u5916 SCF \u90E8\u7F72\u5730\u57DF, \u5982 ["ap-bangkok"]')}),Q=e.z.object({name:e.z.string().min(1).max(128).describe("Unique name for the schedule task within the project"),cron:e.z.string().min(1).describe("Standard 5-field cron expression, e.g. */5 * * * *"),timezone:e.z.string().optional().describe("Timezone for cron parsing, e.g. Asia/Shanghai. Defaults to local system timezone at build time"),method:e.z.enum(["GET","POST","PUT","DELETE","PATCH","HEAD"]).optional().default("POST").describe("HTTP method for the trigger request. Defaults to POST"),path:e.z.string().min(1).describe("HTTP path of the cloud function to trigger, e.g. /api/cron/tick"),payload:e.z.record(e.z.unknown()).optional().describe("JSON payload to send with the trigger request")}),Y=e.z.array(Q).max(10),h=e.z.object({name:e.z.string().optional(),main:e.z.string().optional(),zone_id:e.z.string().optional(),create_date:e.z.string().optional(),dev:_.optional(),publish:D.optional(),build:x.optional(),$schema:e.z.string().transform(o=>"").optional(),outputDirectory:e.z.string().optional().describe("the output directory relative to project root directory after run build command."),installCommand:e.z.string().optional().describe("the install command to run."),buildCommand:e.z.string().optional().describe("the build command to run."),nodeVersion:e.z.string().optional().describe("the node version to use."),nodeFunctionsConfig:R.optional(),cloudFunctions:K.optional(),agents:U.optional(),sandbox:P.optional(),headers:V.optional(),redirects:B.optional(),rewrites:J.optional(),caches:F.optional(),"node-functions":C.optional().describe("Node function specific configuration"),"edge-functions":C.optional().describe("Edge function specific configuration"),schedules:Y.optional().describe("Cron schedule tasks that trigger cloud functions")}),g=Symbol("filteredSchema"),m=Symbol("symFilteredValue"),W=p(h);function X(o){return o.errors.map(n=>`${n.message}`).join(`
2
+ `)}function l(){return!0}function p(o,n=["root"]){if(o[g])return o;let t=o;if((o instanceof e.z.ZodOptional||o instanceof e.z.ZodNullable||o instanceof e.z.ZodReadonly||o instanceof e.z.ZodPromise||o instanceof e.z.ZodBranded)&&(t=o.unwrap()),t[g])return t;let a=null;try{if(t instanceof e.z.ZodArray){let i=p(t.element,[...n,"[]"]);return a=e.z.array(e.z.any()).optional().transform(r=>{if(n.length===4&&n.includes("headers")&&(r?r!=null&&r.length||console.warn('"error in root.headers.[].headers": length is invalid, min 1 length error'):console.warn('"error in root.headers.[].headers": undefined is invalid, Required')),!r)return;if(!r.length)return[];let c=[];for(let d=0;d<r.length;d++){let v=r[d];if(v===m)continue;let u=i.safeParse(v,{path:[...n,`[${d}]`]});if(!u.success){l();continue}!u.data||u.data===m||c.push(u.data)}let b=30;return n.length===4&&n[3]==="headers"&&c.length>3?(console.warn(`"error in root.headers.[].headers": length is invalid, max ${b} length error`),c.slice(0,b)):c}),a}return t instanceof e.z.ZodObject?(a=e.z.object(Object.fromEntries(Object.entries(t.shape).map(([i,r])=>[i,p(r,[...n,i])]))).transform(i=>{let r=o.safeParse(i,{path:n});return r.success?r.data:(l(),m)}),a):(a=e.z.any().transform(i=>{if(i===m)return;let r=o.safeParse(i,{path:n});if(!r.success){l()&&console.warn(`"error in ${n.join(".")}": ${JSON.stringify(i)} is invalid, ${X(r.error)}`);return}return r.data}),a)}catch(i){l()&&console.error("%c [ e ]-220","font-size:13px; background:pink; color:#bf2c9f;",i)}finally{a&&(a[g]=!0)}return a}var ee=e.z.object({TENCENT_SECRET_KEY:e.z.string(),TENCENT_SECRET_ID:e.z.string(),DEV_SERVER_ENDPOINT:e.z.string().optional(),DEV_SERVER_PORT:e.z.union([e.z.number(),e.z.string()]).optional()});function oe(o){return o}function ne(o){return h.safeParse(o)}
@@ -0,0 +1,606 @@
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "name": {
5
+ "type": "string"
6
+ },
7
+ "main": {
8
+ "type": "string"
9
+ },
10
+ "zone_id": {
11
+ "type": "string"
12
+ },
13
+ "create_date": {
14
+ "type": "string"
15
+ },
16
+ "dev": {
17
+ "type": "object",
18
+ "properties": {
19
+ "port": {
20
+ "type": [
21
+ "number",
22
+ "string"
23
+ ]
24
+ },
25
+ "origin": {
26
+ "type": "string"
27
+ },
28
+ "timeout": {
29
+ "type": [
30
+ "number",
31
+ "string"
32
+ ]
33
+ },
34
+ "sandbox": {
35
+ "type": "boolean"
36
+ },
37
+ "favicon": {
38
+ "type": "boolean"
39
+ },
40
+ "minify": {
41
+ "type": "boolean"
42
+ },
43
+ "site": {
44
+ "type": "object",
45
+ "properties": {
46
+ "assets_dir": {
47
+ "type": "string"
48
+ },
49
+ "proxy_path": {
50
+ "type": "string"
51
+ }
52
+ },
53
+ "additionalProperties": false
54
+ }
55
+ },
56
+ "additionalProperties": false
57
+ },
58
+ "publish": {
59
+ "type": "object",
60
+ "properties": {
61
+ "minify": {
62
+ "type": "boolean"
63
+ },
64
+ "rule": {
65
+ "type": "array",
66
+ "items": {
67
+ "type": "object",
68
+ "properties": {
69
+ "condition": {
70
+ "type": "array",
71
+ "items": {
72
+ "type": "object",
73
+ "properties": {
74
+ "target": {
75
+ "type": "string"
76
+ },
77
+ "operator": {
78
+ "type": "string",
79
+ "enum": [
80
+ "equal",
81
+ "notequal"
82
+ ]
83
+ },
84
+ "values": {
85
+ "type": "array",
86
+ "items": {
87
+ "type": "string"
88
+ }
89
+ }
90
+ },
91
+ "required": [
92
+ "target",
93
+ "operator",
94
+ "values"
95
+ ],
96
+ "additionalProperties": false
97
+ }
98
+ }
99
+ },
100
+ "required": [
101
+ "condition"
102
+ ],
103
+ "additionalProperties": false
104
+ }
105
+ }
106
+ },
107
+ "additionalProperties": false
108
+ },
109
+ "build": {
110
+ "type": "object",
111
+ "properties": {
112
+ "monitor": {
113
+ "type": "array",
114
+ "items": {
115
+ "type": "string"
116
+ }
117
+ },
118
+ "command": {
119
+ "type": "string"
120
+ },
121
+ "cwd": {
122
+ "type": "string"
123
+ },
124
+ "target_file": {
125
+ "type": "string"
126
+ }
127
+ },
128
+ "required": [
129
+ "target_file"
130
+ ],
131
+ "additionalProperties": false
132
+ },
133
+ "$schema": {
134
+ "type": "string"
135
+ },
136
+ "outputDirectory": {
137
+ "type": "string",
138
+ "description": "the output directory relative to project root directory after run build command."
139
+ },
140
+ "installCommand": {
141
+ "type": "string",
142
+ "description": "the install command to run."
143
+ },
144
+ "buildCommand": {
145
+ "type": "string",
146
+ "description": "the build command to run."
147
+ },
148
+ "nodeVersion": {
149
+ "type": "string",
150
+ "description": "the node version to use."
151
+ },
152
+ "nodeFunctionsConfig": {
153
+ "type": "object",
154
+ "properties": {
155
+ "maxDuration": {
156
+ "type": "number",
157
+ "minimum": 10,
158
+ "maximum": 120
159
+ }
160
+ },
161
+ "additionalProperties": false
162
+ },
163
+ "cloudFunctions": {
164
+ "type": "object",
165
+ "properties": {
166
+ "maxDuration": {
167
+ "type": "number",
168
+ "minimum": 10,
169
+ "maximum": 120,
170
+ "description": "Maximum execution duration for a single invocation (seconds)"
171
+ },
172
+ "regions": {
173
+ "type": "object",
174
+ "properties": {
175
+ "mainland": {
176
+ "type": "array",
177
+ "items": {
178
+ "type": "string"
179
+ },
180
+ "description": "国内 SCF 部署地域, 如 [\"ap-beijing\"]"
181
+ },
182
+ "overseas": {
183
+ "type": "array",
184
+ "items": {
185
+ "type": "string"
186
+ },
187
+ "description": "海外 SCF 部署地域, 如 [\"ap-tokyo\"]"
188
+ }
189
+ },
190
+ "additionalProperties": false
191
+ },
192
+ "includeFiles": {
193
+ "type": "array",
194
+ "items": {
195
+ "type": "string"
196
+ },
197
+ "description": "Glob patterns for files to include in the function bundle"
198
+ },
199
+ "externalNodeModules": {
200
+ "type": "array",
201
+ "items": {
202
+ "type": "string"
203
+ },
204
+ "description": "Node modules to be treated as external dependencies"
205
+ },
206
+ "nodejs": {
207
+ "type": "object",
208
+ "properties": {
209
+ "includeFiles": {
210
+ "type": "array",
211
+ "items": {
212
+ "type": "string"
213
+ },
214
+ "description": "Glob patterns for files to include in the function bundle"
215
+ },
216
+ "externalNodeModules": {
217
+ "type": "array",
218
+ "items": {
219
+ "type": "string"
220
+ },
221
+ "description": "Node modules to be treated as external dependencies"
222
+ },
223
+ "maxDuration": {
224
+ "type": "number",
225
+ "minimum": 10,
226
+ "maximum": 120,
227
+ "description": "Maximum execution duration for a single invocation (seconds)"
228
+ }
229
+ },
230
+ "additionalProperties": false
231
+ },
232
+ "python": {
233
+ "type": "object",
234
+ "properties": {
235
+ "maxDuration": {
236
+ "type": "number",
237
+ "minimum": 10,
238
+ "maximum": 120,
239
+ "description": "Maximum execution duration for a single invocation (seconds)"
240
+ }
241
+ },
242
+ "additionalProperties": false
243
+ },
244
+ "go": {
245
+ "type": "object",
246
+ "properties": {
247
+ "maxDuration": {
248
+ "type": "number",
249
+ "minimum": 10,
250
+ "maximum": 120,
251
+ "description": "Maximum execution duration for a single invocation (seconds)"
252
+ }
253
+ },
254
+ "additionalProperties": false
255
+ },
256
+ "mainlandRegions": {
257
+ "type": "array",
258
+ "items": {
259
+ "type": "string"
260
+ },
261
+ "description": "国内 SCF 部署地域, 如 [\"ap-shanghai\"]"
262
+ },
263
+ "overseasRegions": {
264
+ "type": "array",
265
+ "items": {
266
+ "type": "string"
267
+ },
268
+ "description": "海外 SCF 部署地域, 如 [\"ap-bangkok\"]"
269
+ }
270
+ },
271
+ "additionalProperties": false
272
+ },
273
+ "agents": {
274
+ "type": "object",
275
+ "properties": {
276
+ "dir": {
277
+ "type": "string",
278
+ "description": "Directory containing agent route files, relative to project root"
279
+ },
280
+ "framework": {
281
+ "type": "string",
282
+ "enum": [
283
+ "claude-agent-sdk",
284
+ "openai-sdk",
285
+ "openai-agents-sdk",
286
+ "langgraph",
287
+ "crewai",
288
+ "deepagents"
289
+ ],
290
+ "description": "Agent framework hint for runtime adapters"
291
+ },
292
+ "runtime": {
293
+ "type": "string",
294
+ "pattern": "^(agent-node|agent-python):(\\d+|\\d+\\.\\d+\\.\\d+)(\\|(agent-node|agent-python):(\\d+|\\d+\\.\\d+\\.\\d+))*$",
295
+ "description": "Agent runtime image tag, e.g. agent-node:1 or agent-python:1.2.0"
296
+ },
297
+ "timeout": {
298
+ "type": "number",
299
+ "minimum": 1,
300
+ "maximum": 1800,
301
+ "description": "Maximum execution duration for a single agent run (seconds)"
302
+ },
303
+ "idleTimeout": {
304
+ "type": "integer",
305
+ "minimum": 1,
306
+ "maximum": 21600,
307
+ "description": "Maximum idle time for an agent session before recycling (seconds)"
308
+ },
309
+ "maxLifetime": {
310
+ "type": "integer",
311
+ "minimum": 1,
312
+ "maximum": 604800,
313
+ "description": "Maximum lifetime of an agent session (seconds)"
314
+ },
315
+ "memoryQuota": {
316
+ "type": "object",
317
+ "properties": {
318
+ "maxMessagesPerConversation": {
319
+ "type": "integer",
320
+ "exclusiveMinimum": 0,
321
+ "description": "Maximum messages allowed in a single memory conversation"
322
+ }
323
+ },
324
+ "additionalProperties": false,
325
+ "description": "Agent memory quota settings"
326
+ },
327
+ "includeFiles": {
328
+ "type": "array",
329
+ "items": {
330
+ "type": "string"
331
+ },
332
+ "description": "Glob patterns for files to include in the agent bundle"
333
+ },
334
+ "sandbox": {
335
+ "type": "object",
336
+ "properties": {
337
+ "timeout": {
338
+ "type": "integer",
339
+ "exclusiveMinimum": 0,
340
+ "description": "Sandbox instance lifetime/idle timeout in seconds"
341
+ }
342
+ },
343
+ "additionalProperties": false,
344
+ "description": "Sandbox configuration for agent runtime"
345
+ },
346
+ "externalNodeModules": {
347
+ "type": "array",
348
+ "items": {
349
+ "type": "string"
350
+ },
351
+ "description": "Node modules to be treated as external dependencies for agent runtime"
352
+ }
353
+ },
354
+ "additionalProperties": false
355
+ },
356
+ "sandbox": {
357
+ "type": "object",
358
+ "properties": {
359
+ "timeout": {
360
+ "type": "integer",
361
+ "exclusiveMinimum": 0,
362
+ "description": "Sandbox instance lifetime/idle timeout in seconds"
363
+ }
364
+ },
365
+ "additionalProperties": false
366
+ },
367
+ "headers": {
368
+ "type": "array",
369
+ "items": {
370
+ "type": "object",
371
+ "properties": {
372
+ "source": {
373
+ "type": "string"
374
+ },
375
+ "headers": {
376
+ "type": "array",
377
+ "items": {
378
+ "type": "object",
379
+ "properties": {
380
+ "key": {
381
+ "type": "string",
382
+ "minLength": 1,
383
+ "maxLength": 100
384
+ },
385
+ "value": {
386
+ "type": "string",
387
+ "minLength": 1,
388
+ "maxLength": 1000
389
+ }
390
+ },
391
+ "required": [
392
+ "key",
393
+ "value"
394
+ ],
395
+ "additionalProperties": false
396
+ },
397
+ "minItems": 1
398
+ }
399
+ },
400
+ "required": [
401
+ "source",
402
+ "headers"
403
+ ],
404
+ "additionalProperties": false
405
+ }
406
+ },
407
+ "redirects": {
408
+ "type": "array",
409
+ "items": {
410
+ "type": "object",
411
+ "properties": {
412
+ "source": {
413
+ "type": "string"
414
+ },
415
+ "destination": {
416
+ "type": "string"
417
+ },
418
+ "permanent": {
419
+ "type": "boolean"
420
+ },
421
+ "statusCode": {
422
+ "type": "number",
423
+ "enum": [
424
+ 307,
425
+ 301,
426
+ 302,
427
+ 308,
428
+ 303,
429
+ 304
430
+ ]
431
+ }
432
+ },
433
+ "required": [
434
+ "source",
435
+ "destination"
436
+ ],
437
+ "additionalProperties": false
438
+ }
439
+ },
440
+ "rewrites": {
441
+ "type": "array",
442
+ "items": {
443
+ "anyOf": [
444
+ {
445
+ "type": "object",
446
+ "properties": {
447
+ "source": {
448
+ "type": "string"
449
+ },
450
+ "destination": {
451
+ "type": "string"
452
+ }
453
+ },
454
+ "required": [
455
+ "source",
456
+ "destination"
457
+ ],
458
+ "additionalProperties": false
459
+ },
460
+ {
461
+ "type": "object",
462
+ "properties": {
463
+ "src": {
464
+ "type": "string"
465
+ },
466
+ "dest": {
467
+ "type": "string"
468
+ }
469
+ },
470
+ "required": [
471
+ "src",
472
+ "dest"
473
+ ],
474
+ "additionalProperties": false
475
+ }
476
+ ]
477
+ }
478
+ },
479
+ "caches": {
480
+ "type": "array",
481
+ "items": {
482
+ "type": "object",
483
+ "properties": {
484
+ "source": {
485
+ "type": "string"
486
+ },
487
+ "cacheTtl": {
488
+ "type": "number"
489
+ }
490
+ },
491
+ "required": [
492
+ "source",
493
+ "cacheTtl"
494
+ ],
495
+ "additionalProperties": false
496
+ }
497
+ },
498
+ "node-functions": {
499
+ "type": "object",
500
+ "properties": {
501
+ "included_files": {
502
+ "type": "array",
503
+ "items": {
504
+ "type": "string"
505
+ },
506
+ "description": "Glob patterns for files to include in the function bundle"
507
+ },
508
+ "included_files_base_path": {
509
+ "type": "string",
510
+ "description": "Base path for included_files patterns, defaults to project root"
511
+ },
512
+ "external_node_modules": {
513
+ "type": "array",
514
+ "items": {
515
+ "type": "string"
516
+ },
517
+ "description": "Node modules to be treated as external dependencies"
518
+ }
519
+ },
520
+ "additionalProperties": false,
521
+ "description": "Node function specific configuration"
522
+ },
523
+ "edge-functions": {
524
+ "type": "object",
525
+ "properties": {
526
+ "included_files": {
527
+ "type": "array",
528
+ "items": {
529
+ "type": "string"
530
+ },
531
+ "description": "Glob patterns for files to include in the function bundle"
532
+ },
533
+ "included_files_base_path": {
534
+ "type": "string",
535
+ "description": "Base path for included_files patterns, defaults to project root"
536
+ },
537
+ "external_node_modules": {
538
+ "type": "array",
539
+ "items": {
540
+ "type": "string"
541
+ },
542
+ "description": "Node modules to be treated as external dependencies"
543
+ }
544
+ },
545
+ "additionalProperties": false,
546
+ "description": "Edge function specific configuration"
547
+ },
548
+ "schedules": {
549
+ "type": "array",
550
+ "items": {
551
+ "type": "object",
552
+ "properties": {
553
+ "name": {
554
+ "type": "string",
555
+ "minLength": 1,
556
+ "maxLength": 128,
557
+ "description": "Unique name for the schedule task within the project"
558
+ },
559
+ "cron": {
560
+ "type": "string",
561
+ "minLength": 1,
562
+ "description": "Standard 5-field cron expression, e.g. */5 * * * *"
563
+ },
564
+ "timezone": {
565
+ "type": "string",
566
+ "description": "Timezone for cron parsing, e.g. Asia/Shanghai. Defaults to local system timezone at build time"
567
+ },
568
+ "method": {
569
+ "type": "string",
570
+ "enum": [
571
+ "GET",
572
+ "POST",
573
+ "PUT",
574
+ "DELETE",
575
+ "PATCH",
576
+ "HEAD"
577
+ ],
578
+ "default": "POST",
579
+ "description": "HTTP method for the trigger request. Defaults to POST"
580
+ },
581
+ "path": {
582
+ "type": "string",
583
+ "minLength": 1,
584
+ "description": "HTTP path of the cloud function to trigger, e.g. /api/cron/tick"
585
+ },
586
+ "payload": {
587
+ "type": "object",
588
+ "additionalProperties": {},
589
+ "description": "JSON payload to send with the trigger request"
590
+ }
591
+ },
592
+ "required": [
593
+ "name",
594
+ "cron",
595
+ "path"
596
+ ],
597
+ "additionalProperties": false
598
+ },
599
+ "maxItems": 10,
600
+ "description": "Cron schedule tasks that trigger cloud functions"
601
+ }
602
+ },
603
+ "additionalProperties": false,
604
+ "$schema": "https://json-schema.org/draft-07/schema#",
605
+ "title": "EdgeOne Project Configuration"
606
+ }