@gigadrive/network-config 5.0.0 → 5.1.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.
@@ -144,17 +144,22 @@
144
144
  "minimum": 1
145
145
  },
146
146
  "runtime": {
147
- "$ref": "#/$defs/runtimes",
148
- "description": "The runtime to use for the function."
147
+ "anyOf": [{ "$ref": "#/$defs/runtimes" }, { "const": "docker" }],
148
+ "description": "The runtime to use for the function. `docker` builds the matched file as a Dockerfile, with its directory as the build context, and runs the image as the function."
149
+ },
150
+ "port": {
151
+ "type": "integer",
152
+ "minimum": 1,
153
+ "maximum": 65535,
154
+ "description": "TCP port the image listens on. Only for `runtime: docker`. Defaults to the first exposed port of the image, then 8080."
149
155
  },
150
156
  "streaming": {
151
157
  "type": "boolean",
152
158
  "description": "Enable function response streaming. When omitted, Node and Bun runtimes stream by default."
153
159
  },
154
160
  "schedule": {
155
- "type": "string",
156
- "description": "An expression to schedule the function to run at specific times.",
157
- "pattern": "^(?:rate[(](?:(?:1[ ]+(hour|minute|day))|(?:[0-9]+[ ]+(hours|minutes|days)))[)])|(?:cron[(](?:(?:(?:[0-5]?[0-9])|[*])(?:(?:[-](?:(?:[0-5]?[0-9])|[*]))|(?:[/][0-9]+))?(?:[,](?:(?:[0-5]?[0-9])|[*])(?:(?:[-](?:(?:[0-5]?[0-9])|[*]))|(?:[/][0-9]+))?)*)[ ]+(?:(?:(?:[0-2]?[0-9])|[*])(?:(?:[-](?:(?:[0-2]?[0-9])|[*]))|(?:[/][0-9]+))?(?:[,](?:(?:[0-2]?[0-9])|[*])(?:(?:[-](?:(?:[0-2]?[0-9])|[*]))|(?:[/][0-9]+))?)*)[ ]+(?:(?:[?][ ]+(?:(?:(?:[1]?[0-9])|(?:JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)|[*])(?:(?:[-](?:(?:[1]?[0-9])|(?:JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SE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EB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)|[*])(?:[/][0-9]+)?)|(?:[/][0-9]+))?)*)[ ]+[?]))[ ]+(?:(?:(?:[12][0-9]{3})|[*])(?:(?:[-](?:(?:[12][0-9]{3})|[*]))|(?:[/][0-9]+))?(?:[,](?:(?:[12][0-9]{3})|[*])(?:(?:[-](?:(?:[12][0-9]{3})|[*]))|(?:[/][0-9]+))?)*)[)])$"
161
+ "$ref": "#/$defs/schedule",
162
+ "description": "An expression to schedule the function to run at specific times."
158
163
  },
159
164
  "symlinks": {
160
165
  "type": "object",
@@ -246,6 +251,151 @@
246
251
  }
247
252
  }
248
253
  },
254
+ "compose": {
255
+ "type": ["string", "null"],
256
+ "minLength": 1,
257
+ "maxLength": 1024,
258
+ "description": "Project-relative path of a Compose file whose services are imported as containers. Entries in `containers` win over imported services of the same name."
259
+ },
260
+ "containers": {
261
+ "type": ["object", "null"],
262
+ "description": "Container images to run, keyed by name. A container runs as a function unless `sidecar` is true; routes target it with `destination: container:<name>`. A sidecar runs next to every function instance and answers at `<name>:<port>`.",
263
+ "maxProperties": 16,
264
+ "propertyNames": {
265
+ "pattern": "^[a-z][a-z0-9_-]{0,62}$",
266
+ "not": {
267
+ "enum": ["localhost"]
268
+ }
269
+ },
270
+ "additionalProperties": {
271
+ "type": "object",
272
+ "additionalProperties": false,
273
+ "oneOf": [
274
+ {
275
+ "required": ["image"]
276
+ },
277
+ {
278
+ "required": ["build"]
279
+ }
280
+ ],
281
+ "properties": {
282
+ "image": {
283
+ "type": "string",
284
+ "minLength": 1,
285
+ "maxLength": 512,
286
+ "pattern": "^[^\\s]+$",
287
+ "description": "Registry image reference, e.g. `redis:7-alpine` or `ghcr.io/acme/api:1.4`."
288
+ },
289
+ "build": {
290
+ "description": "Build context directory, or the full build settings, for a Dockerfile in the repository.",
291
+ "oneOf": [
292
+ {
293
+ "type": "string",
294
+ "minLength": 1,
295
+ "maxLength": 1024
296
+ },
297
+ {
298
+ "type": "object",
299
+ "additionalProperties": false,
300
+ "properties": {
301
+ "context": {
302
+ "type": "string",
303
+ "minLength": 1,
304
+ "maxLength": 1024
305
+ },
306
+ "dockerfile": {
307
+ "type": "string",
308
+ "minLength": 1,
309
+ "maxLength": 1024
310
+ },
311
+ "target": {
312
+ "type": "string",
313
+ "minLength": 1,
314
+ "maxLength": 128
315
+ },
316
+ "args": {
317
+ "type": "object",
318
+ "maxProperties": 100,
319
+ "additionalProperties": {
320
+ "type": "string",
321
+ "maxLength": 65536
322
+ }
323
+ }
324
+ }
325
+ }
326
+ ]
327
+ },
328
+ "sidecar": {
329
+ "type": "boolean",
330
+ "description": "Run next to every function instance instead of serving routes. Defaults to false."
331
+ },
332
+ "port": {
333
+ "type": "integer",
334
+ "minimum": 1,
335
+ "maximum": 65535,
336
+ "description": "TCP port the container listens on. Defaults to the first exposed port of the image, then 8080."
337
+ },
338
+ "entrypoint": {
339
+ "$ref": "#/$defs/stringOrStringArray",
340
+ "description": "Replaces the image ENTRYPOINT. A string is split into words the way Compose splits it."
341
+ },
342
+ "command": {
343
+ "$ref": "#/$defs/stringOrStringArray",
344
+ "description": "Replaces the image CMD. A string is split into words the way Compose splits it."
345
+ },
346
+ "env": {
347
+ "type": "object",
348
+ "maxProperties": 100,
349
+ "additionalProperties": {
350
+ "type": "string",
351
+ "maxLength": 65536
352
+ },
353
+ "description": "Environment variables baked into the container, merged over the image ENV."
354
+ },
355
+ "working_dir": {
356
+ "type": "string",
357
+ "minLength": 1,
358
+ "maxLength": 1024,
359
+ "pattern": "^/",
360
+ "description": "Replaces the image WORKDIR. Must be absolute."
361
+ },
362
+ "user": {
363
+ "oneOf": [
364
+ {
365
+ "type": "string",
366
+ "minLength": 1,
367
+ "maxLength": 256
368
+ },
369
+ {
370
+ "type": "integer",
371
+ "minimum": 0
372
+ }
373
+ ],
374
+ "description": "Replaces the image USER: a name, a uid, `name:group` or `uid:gid`. A bare uid may be a number."
375
+ },
376
+ "memory": {
377
+ "type": "integer",
378
+ "minimum": 128,
379
+ "maximum": 3009,
380
+ "description": "Memory in MB. Defaults to 512 for a container function and 256 for a sidecar."
381
+ },
382
+ "max_duration": {
383
+ "type": "number",
384
+ "minimum": 1,
385
+ "maximum": 28800,
386
+ "description": "Maximum lifetime in seconds of one request. Container functions only."
387
+ },
388
+ "streaming": {
389
+ "type": "boolean",
390
+ "description": "Stream responses. Defaults to true. Container functions only."
391
+ },
392
+ "schedule": {
393
+ "$ref": "#/$defs/schedule",
394
+ "description": "An expression to run the container function at specific times. Container functions only."
395
+ }
396
+ }
397
+ }
398
+ },
249
399
  "services": {
250
400
  "type": "object",
251
401
  "description": "Managed services to provision for the deployment environment.",
@@ -396,11 +546,179 @@
396
546
  }
397
547
  }
398
548
  }
549
+ },
550
+ "queues": {
551
+ "type": "object",
552
+ "description": "Queues to provision in the deployment environment, keyed by name. Use null for a pull queue with default settings. Queues you stop declaring are kept, with their messages.",
553
+ "propertyNames": {
554
+ "maxLength": 255,
555
+ "pattern": "^[A-Za-z0-9_][A-Za-z0-9_.~:@+=-]*$"
556
+ },
557
+ "additionalProperties": {
558
+ "oneOf": [
559
+ {
560
+ "type": "null"
561
+ },
562
+ {
563
+ "type": "object",
564
+ "additionalProperties": false,
565
+ "properties": {
566
+ "consumer": {
567
+ "type": ["string", "null"],
568
+ "pattern": "^/(?!/)\\S*$",
569
+ "maxLength": 2048,
570
+ "description": "Deployment-relative path that receives each message as a signed POST, for example /api/queues/emails. Omit it for a pull queue that you drain with receive."
571
+ },
572
+ "visibilityTimeout": {
573
+ "$ref": "#/$defs/queueDuration",
574
+ "description": "How long a push delivery may run, or how long a received message stays leased. Defaults to 60 seconds, at most 12 hours."
575
+ },
576
+ "retention": {
577
+ "$ref": "#/$defs/queueDuration",
578
+ "description": "How long an undelivered message is kept. Defaults to 4 days, at most 14 days."
579
+ },
580
+ "maxAttempts": {
581
+ "type": "integer",
582
+ "minimum": 1,
583
+ "maximum": 100,
584
+ "description": "Deliveries per message before it moves to the dead-letter list. Defaults to 10."
585
+ },
586
+ "retryBackoff": {
587
+ "type": "object",
588
+ "additionalProperties": false,
589
+ "description": "Exponential backoff between failed deliveries. Defaults to 5 seconds, doubling up to 15 minutes.",
590
+ "properties": {
591
+ "min": {
592
+ "$ref": "#/$defs/queueDuration"
593
+ },
594
+ "max": {
595
+ "$ref": "#/$defs/queueDuration"
596
+ }
597
+ }
598
+ },
599
+ "deduplicationWindow": {
600
+ "$ref": "#/$defs/queueDuration",
601
+ "description": "How long a deduplication key is remembered. Defaults to 24 hours, at most 7 days."
602
+ },
603
+ "concurrency": {
604
+ "type": ["integer", "null"],
605
+ "minimum": 1,
606
+ "maximum": 1000,
607
+ "description": "Most push deliveries in flight at once. Defaults to 100."
608
+ },
609
+ "rateLimit": {
610
+ "oneOf": [
611
+ {
612
+ "type": "null"
613
+ },
614
+ {
615
+ "type": "object",
616
+ "required": ["count"],
617
+ "additionalProperties": false,
618
+ "properties": {
619
+ "count": {
620
+ "type": "integer",
621
+ "minimum": 1,
622
+ "maximum": 1000000
623
+ },
624
+ "period": {
625
+ "$ref": "#/$defs/queueDuration"
626
+ }
627
+ }
628
+ }
629
+ ],
630
+ "description": "Most deliveries started per period. The period defaults to one second."
631
+ },
632
+ "deadLetter": {
633
+ "type": "boolean",
634
+ "description": "Keep messages that run out of attempts so you can inspect and redrive them. Defaults to true."
635
+ },
636
+ "schedules": {
637
+ "type": "object",
638
+ "description": "Cron schedules that send a message into this queue, keyed by schedule name.",
639
+ "propertyNames": {
640
+ "maxLength": 128,
641
+ "pattern": "^[A-Za-z0-9_][A-Za-z0-9_.-]*$"
642
+ },
643
+ "additionalProperties": {
644
+ "type": "object",
645
+ "required": ["cron"],
646
+ "additionalProperties": false,
647
+ "properties": {
648
+ "cron": {
649
+ "type": "string",
650
+ "minLength": 1,
651
+ "maxLength": 255,
652
+ "description": "Five-field cron expression, or a macro such as @hourly or @daily."
653
+ },
654
+ "timezone": {
655
+ "type": "string",
656
+ "description": "IANA time zone the expression is evaluated in. Defaults to UTC."
657
+ },
658
+ "body": {
659
+ "description": "Message body. Strings are sent as is; any other value is sent as JSON."
660
+ },
661
+ "contentType": {
662
+ "type": "string",
663
+ "description": "Content type of the body. Defaults to text/plain for a string body and application/json otherwise."
664
+ },
665
+ "headers": {
666
+ "type": "object",
667
+ "additionalProperties": {
668
+ "type": "string"
669
+ },
670
+ "description": "Headers delivered with every message from this schedule."
671
+ },
672
+ "enabled": {
673
+ "type": "boolean",
674
+ "description": "Set to false to keep the schedule without sending. Defaults to true."
675
+ }
676
+ }
677
+ }
678
+ }
679
+ }
680
+ }
681
+ ]
682
+ }
399
683
  }
400
684
  }
401
685
  }
402
686
  },
403
687
  "$defs": {
688
+ "schedule": {
689
+ "type": "string",
690
+ "pattern": "^(?:rate[(](?:(?:1[ ]+(hour|minute|day))|(?:[0-9]+[ ]+(hours|minutes|days)))[)])|(?:cron[(](?:(?:(?:[0-5]?[0-9])|[*])(?:(?:[-](?:(?:[0-5]?[0-9])|[*]))|(?:[/][0-9]+))?(?:[,](?:(?:[0-5]?[0-9])|[*])(?:(?:[-](?:(?:[0-5]?[0-9])|[*]))|(?:[/][0-9]+))?)*)[ ]+(?:(?:(?:[0-2]?[0-9])|[*])(?:(?:[-](?:(?:[0-2]?[0-9])|[*]))|(?:[/][0-9]+))?(?:[,](?:(?:[0-2]?[0-9])|[*])(?:(?:[-](?:(?:[0-2]?[0-9])|[*]))|(?:[/][0-9]+))?)*)[ ]+(?:(?:[?][ ]+(?:(?:(?:[1]?[0-9])|(?:JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)|[*])(?:(?:[-](?:(?:[1]?[0-9])|(?:JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)|[*])(?:[/][0-9]+)?)|(?:[/][0-9]+))?(?:[,](?:(?:[1]?[0-9])|(?:JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)|[*])(?:(?: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:[12][0-9]{3})|[*]))|(?:[/][0-9]+))?(?:[,](?:(?:[12][0-9]{3})|[*])(?:(?:[-](?:(?:[12][0-9]{3})|[*]))|(?:[/][0-9]+))?)*)[)])$"
691
+ },
692
+ "stringOrStringArray": {
693
+ "oneOf": [
694
+ {
695
+ "type": "string",
696
+ "minLength": 1,
697
+ "maxLength": 4096
698
+ },
699
+ {
700
+ "type": "array",
701
+ "maxItems": 256,
702
+ "items": {
703
+ "type": "string",
704
+ "maxLength": 4096
705
+ }
706
+ }
707
+ ]
708
+ },
709
+ "queueDuration": {
710
+ "oneOf": [
711
+ {
712
+ "type": "integer",
713
+ "minimum": 0
714
+ },
715
+ {
716
+ "type": "string",
717
+ "pattern": "^[0-9]+(\\.[0-9]+)?(s|m|h|d)$"
718
+ }
719
+ ],
720
+ "description": "A duration in seconds, or a string such as 30s, 10m, 1.5h or 4d."
721
+ },
404
722
  "runtimes": {
405
723
  "type": "string",
406
724
  "enum": ["php-84", "php-83", "php-81", "node-22", "node-20", "node-18", "node-16", "bun-1"]