@gigadrive/network-config 4.3.7 → 4.4.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/dist/index.mjs CHANGED
@@ -1199,6 +1199,23 @@ var normalizeImagePolicy = (images) => {
1199
1199
  variants: images.variants ?? {}
1200
1200
  };
1201
1201
  };
1202
+ var normalizeServices = (services) => {
1203
+ if (services == null) return void 0;
1204
+ const normalized = [];
1205
+ if (services.redis !== void 0) {
1206
+ normalized.push({ type: "redis", ...services.redis ?? {} });
1207
+ }
1208
+ if (services.postgres !== void 0) {
1209
+ normalized.push({ type: "postgres", ...services.postgres ?? {} });
1210
+ }
1211
+ if (services.storage !== void 0) {
1212
+ normalized.push({
1213
+ type: "storage",
1214
+ buckets: Object.entries(services.storage.buckets).map(([name, bucket]) => ({ name, visibility: bucket?.visibility ?? "private" })).sort((left, right) => left.name < right.name ? -1 : left.name > right.name ? 1 : 0)
1215
+ });
1216
+ }
1217
+ return normalized.length > 0 ? normalized : void 0;
1218
+ };
1202
1219
  var normalizeRouteDestination = (destination) => {
1203
1220
  const [withoutHash] = destination.split("#", 1);
1204
1221
  const [withoutQuery] = withoutHash.split("?", 1);
@@ -1362,6 +1379,7 @@ var V4ConfigParser = class extends Effect14.Service()("V4ConfigParser", {
1362
1379
  environmentVariables: config.env ?? {},
1363
1380
  commands: config.build_commands ?? [],
1364
1381
  images: normalizeImagePolicy(config.images),
1382
+ services: normalizeServices(config.services),
1365
1383
  entrypoints,
1366
1384
  errors: [],
1367
1385
  warnings: [],
@@ -1879,7 +1897,8 @@ var schema_default = {
1879
1897
  },
1880
1898
  services: {
1881
1899
  type: "object",
1882
- description: "Optionally, specify additional services like databases to deploy.",
1900
+ description: "Managed services to provision for the deployment environment.",
1901
+ additionalProperties: false,
1883
1902
  properties: {
1884
1903
  redis: {
1885
1904
  oneOf: [
@@ -1993,6 +2012,39 @@ var schema_default = {
1993
2012
  }
1994
2013
  }
1995
2014
  ]
2015
+ },
2016
+ storage: {
2017
+ type: "object",
2018
+ required: ["buckets"],
2019
+ additionalProperties: false,
2020
+ description: "File Storage buckets to provision in the deployment environment. The environment and global delivery/S3 slug are assigned by the platform.",
2021
+ properties: {
2022
+ buckets: {
2023
+ type: "object",
2024
+ description: "Buckets keyed by immutable environment-scoped name. Use null or an empty object for the default private visibility.",
2025
+ propertyNames: {
2026
+ minLength: 3,
2027
+ maxLength: 63,
2028
+ pattern: "^(?![0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$"
2029
+ },
2030
+ additionalProperties: {
2031
+ oneOf: [
2032
+ { type: "null" },
2033
+ {
2034
+ type: "object",
2035
+ additionalProperties: false,
2036
+ properties: {
2037
+ visibility: {
2038
+ type: "string",
2039
+ enum: ["public", "private"],
2040
+ description: "Bucket access policy. Defaults to private when omitted. Public buckets can serve objects through their CDN hostname."
2041
+ }
2042
+ }
2043
+ }
2044
+ ]
2045
+ }
2046
+ }
2047
+ }
1996
2048
  }
1997
2049
  }
1998
2050
  }