@gigadrive/network-config 1.0.0 → 2.0.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/LICENSE +201 -0
- package/dist/index.d.mts +127 -0
- package/dist/index.d.ts +127 -0
- package/dist/index.js +15971 -2
- package/dist/index.js.map +1 -7
- package/dist/index.mjs +393 -0
- package/dist/index.mjs.map +1 -0
- package/dist/v4/schema.json +334 -0
- package/package.json +27 -12
- package/src/v4/schema.json +334 -0
- package/tsconfig.json +7 -0
- package/dist/build-output-v3/index.js +0 -1
- package/dist/build-output-v3/index.js.map +0 -7
- package/dist/build-output-v3/parse.js +0 -2
- package/dist/build-output-v3/parse.js.map +0 -7
- package/dist/normalized-config.js +0 -2
- package/dist/normalized-config.js.map +0 -7
- package/dist/parse-raw-config.js +0 -2
- package/dist/parse-raw-config.js.map +0 -7
- package/dist/regions.js +0 -2
- package/dist/regions.js.map +0 -7
- package/dist/runtime.js +0 -2
- package/dist/runtime.js.map +0 -7
- package/dist/v4/index.js +0 -1
- package/dist/v4/index.js.map +0 -7
- package/dist/v4/parse.js +0 -2
- package/dist/v4/parse.js.map +0 -7
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "Config V4",
|
|
4
|
+
"description": "Configuration schema for version 4",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["version"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"version": {
|
|
9
|
+
"type": "integer",
|
|
10
|
+
"enum": [4],
|
|
11
|
+
"description": "The version of the configuration file"
|
|
12
|
+
},
|
|
13
|
+
"presets": {
|
|
14
|
+
"type": ["array", "null"],
|
|
15
|
+
"items": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"format": "uri"
|
|
18
|
+
},
|
|
19
|
+
"description": "A list of presets to apply to the project. Each preset will be applied in order."
|
|
20
|
+
},
|
|
21
|
+
"assets": {
|
|
22
|
+
"type": ["string", "null"],
|
|
23
|
+
"description": "The folder which holds the assets to be deployed to the edge. Defaults to none."
|
|
24
|
+
},
|
|
25
|
+
"populateAssetCache": {
|
|
26
|
+
"type": ["boolean", "null"],
|
|
27
|
+
"description": "If true, the assets will be cached at the edge during deployment. This may increase the deployment time, depending on the size of the assets. Defaults to false."
|
|
28
|
+
},
|
|
29
|
+
"regions": {
|
|
30
|
+
"type": ["array", "null"],
|
|
31
|
+
"description": "The regions to which the project will be deployed. Use \"global\" to deploy to all regions. More regions will incur higher costs.",
|
|
32
|
+
"items": {
|
|
33
|
+
"type": "string"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"build_commands": {
|
|
37
|
+
"type": ["array", "null"],
|
|
38
|
+
"description": "The commands to run to build the project. For example, `bun install` or `npm install`.",
|
|
39
|
+
"items": {
|
|
40
|
+
"type": "string"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"functions": {
|
|
44
|
+
"type": ["object", "null"],
|
|
45
|
+
"description": "The serverless functions to deploy.",
|
|
46
|
+
"additionalProperties": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"properties": {
|
|
49
|
+
"memory": {
|
|
50
|
+
"type": "number",
|
|
51
|
+
"description": "The memory in MB to allocate to the function. Defaults to 128.",
|
|
52
|
+
"maximum": 3009,
|
|
53
|
+
"minimum": 128
|
|
54
|
+
},
|
|
55
|
+
"max_duration": {
|
|
56
|
+
"type": "number",
|
|
57
|
+
"description": "The max duration in seconds for the function after which it will be terminated. Defaults to 30.",
|
|
58
|
+
"maximum": 900,
|
|
59
|
+
"minimum": 1
|
|
60
|
+
},
|
|
61
|
+
"runtime": {
|
|
62
|
+
"$ref": "#/$defs/runtimes",
|
|
63
|
+
"description": "The runtime to use for the function."
|
|
64
|
+
},
|
|
65
|
+
"schedule": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"description": "An expression to schedule the function to run at specific times.",
|
|
68
|
+
"pattern": "^(?:rate[(](?:(?:1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/][0-9]+))?)*)))|(?:(?:(?:(?:(?:[1-3]?[0-9])W?)|LW|[L*])(?:(?:[-](?:(?:(?:[1-3]?[0-9])W?)|LW|[L*]))|(?:[/][0-9]+))?(?:[,](?:(?:(?:[1-3]?[0-9])W?)|LW|[L*])(?:(?:[-](?:(?:(?:[1-3]?[0-9])W?)|LW|[L*]))|(?:[/][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)|[*])(?:(?:[-](?:(?:[1]?[0-9])|(?:JAN|FEB|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]+))?)*)[)])$"
|
|
69
|
+
},
|
|
70
|
+
"symlinks": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"description": "A list of symbolic links to create in the function's package.",
|
|
73
|
+
"maxProperties": 100,
|
|
74
|
+
"minProperties": 1,
|
|
75
|
+
"patternProperties": {
|
|
76
|
+
"^.{1,256}$": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"maxLength": 256
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"additionalProperties": false
|
|
82
|
+
},
|
|
83
|
+
"excludeFiles": {
|
|
84
|
+
"oneOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }],
|
|
85
|
+
"description": "A glob pattern to match files that should be excluded from your Serverless Function. If you're using a Community Runtime, the behavior might vary."
|
|
86
|
+
},
|
|
87
|
+
"includeFiles": {
|
|
88
|
+
"oneOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }],
|
|
89
|
+
"description": "A glob pattern to match files that should be included in your Serverless Function. If you're using a Community Runtime, the behavior might vary."
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"env": {
|
|
95
|
+
"type": "object",
|
|
96
|
+
"maxProperties": 100,
|
|
97
|
+
"minProperties": 0,
|
|
98
|
+
"patternProperties": {
|
|
99
|
+
".+": {
|
|
100
|
+
"maxLength": 65536,
|
|
101
|
+
"minLength": 0,
|
|
102
|
+
"type": "string"
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"additionalProperties": false,
|
|
106
|
+
"description": "Additional environment variables to set during runtime and build."
|
|
107
|
+
},
|
|
108
|
+
"routes": {
|
|
109
|
+
"type": ["array", "null"],
|
|
110
|
+
"description": "A list of route definitions.",
|
|
111
|
+
"maxItems": 1024,
|
|
112
|
+
"items": {
|
|
113
|
+
"type": "object",
|
|
114
|
+
"required": ["source", "destination"],
|
|
115
|
+
"properties": {
|
|
116
|
+
"source": {
|
|
117
|
+
"description": "A pattern that matches each incoming pathname (excluding querystring).",
|
|
118
|
+
"type": "string",
|
|
119
|
+
"maxLength": 4096
|
|
120
|
+
},
|
|
121
|
+
"destination": {
|
|
122
|
+
"description": "An absolute pathname to an existing resource or an external URL.",
|
|
123
|
+
"type": "string",
|
|
124
|
+
"maxLength": 4096
|
|
125
|
+
},
|
|
126
|
+
"has": {
|
|
127
|
+
"$ref": "#/$defs/matchRequirements"
|
|
128
|
+
},
|
|
129
|
+
"missing": {
|
|
130
|
+
"$ref": "#/$defs/matchRequirements"
|
|
131
|
+
},
|
|
132
|
+
"statusCode": {
|
|
133
|
+
"description": "An optional integer to override the status code of the response.",
|
|
134
|
+
"type": "integer",
|
|
135
|
+
"minimum": 100,
|
|
136
|
+
"maximum": 999
|
|
137
|
+
},
|
|
138
|
+
"redirect": {
|
|
139
|
+
"type": "boolean",
|
|
140
|
+
"description": "An optional boolean to force a redirect response."
|
|
141
|
+
},
|
|
142
|
+
"methods": {
|
|
143
|
+
"type": "array",
|
|
144
|
+
"description": "The HTTP methods to match for the route. Defaults to all methods.",
|
|
145
|
+
"items": {
|
|
146
|
+
"type": "string",
|
|
147
|
+
"enum": ["ANY", "GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"headers": {
|
|
151
|
+
"type": "object",
|
|
152
|
+
"description": "Additional headers to add to the response.",
|
|
153
|
+
"additionalProperties": {
|
|
154
|
+
"type": "string"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"services": {
|
|
161
|
+
"type": "object",
|
|
162
|
+
"description": "Optionally, specify additional services like databases to deploy.",
|
|
163
|
+
"properties": {
|
|
164
|
+
"redis": {
|
|
165
|
+
"oneOf": [
|
|
166
|
+
{
|
|
167
|
+
"type": "null"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"type": "object",
|
|
171
|
+
"properties": {
|
|
172
|
+
"envBindings": {
|
|
173
|
+
"type": "object",
|
|
174
|
+
"description": "Optionally, specify what environment variables the credentials will be bound to. For example: `{ url: 'REDIS_URL' }` will bind the `url` environment variable to the Redis URL. If you don't specify any bindings, they will be bound to the REDIS_URL, REDIS_HOST, REDIS_PORT, REDIS_PASSWORD, REDIS_DB, and REDIS_SSL environment variables.",
|
|
175
|
+
"additionalProperties": false,
|
|
176
|
+
"properties": {
|
|
177
|
+
"url": { "type": "string" },
|
|
178
|
+
"host": { "type": "string" },
|
|
179
|
+
"port": { "type": "string" },
|
|
180
|
+
"password": { "type": "string" },
|
|
181
|
+
"db": { "type": "string" },
|
|
182
|
+
"ssl": { "type": "string" }
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
"primaryRegion": {
|
|
186
|
+
"type": "string",
|
|
187
|
+
"description": "The primary region to deploy the Redis instance to.",
|
|
188
|
+
"enum": [
|
|
189
|
+
"us-east-1",
|
|
190
|
+
"us-east-2",
|
|
191
|
+
"us-west-1",
|
|
192
|
+
"us-west-2",
|
|
193
|
+
"eu-central-1",
|
|
194
|
+
"eu-west-1",
|
|
195
|
+
"eu-west-2",
|
|
196
|
+
"sa-east-1",
|
|
197
|
+
"ap-south-1",
|
|
198
|
+
"ap-northeast-1",
|
|
199
|
+
"ap-southeast-1",
|
|
200
|
+
"ap-southeast-2",
|
|
201
|
+
"us-central1"
|
|
202
|
+
]
|
|
203
|
+
},
|
|
204
|
+
"readRegions": {
|
|
205
|
+
"type": "array",
|
|
206
|
+
"description": "Optionally, add additional regions to read from. More regions will incur higher costs.",
|
|
207
|
+
"items": {
|
|
208
|
+
"type": "string",
|
|
209
|
+
"enum": [
|
|
210
|
+
"us-east-1",
|
|
211
|
+
"us-east-2",
|
|
212
|
+
"us-west-1",
|
|
213
|
+
"us-west-2",
|
|
214
|
+
"eu-central-1",
|
|
215
|
+
"eu-west-1",
|
|
216
|
+
"eu-west-2",
|
|
217
|
+
"sa-east-1",
|
|
218
|
+
"ap-south-1",
|
|
219
|
+
"ap-northeast-1",
|
|
220
|
+
"ap-southeast-1",
|
|
221
|
+
"ap-southeast-2"
|
|
222
|
+
]
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
"eviction": {
|
|
226
|
+
"type": "boolean",
|
|
227
|
+
"description": "Optionally, enable Redis eviction. This will evict the least recently used keys in order to make space for new ones."
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
]
|
|
232
|
+
},
|
|
233
|
+
"postgres": {
|
|
234
|
+
"oneOf": [
|
|
235
|
+
{
|
|
236
|
+
"type": "null"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"type": "object",
|
|
240
|
+
"properties": {
|
|
241
|
+
"envBindings": {
|
|
242
|
+
"type": "object",
|
|
243
|
+
"description": "Optionally, specify what environment variables the credentials will be bound to. For example: `{ url: 'POSTGRES_URL' }` will bind the `url` environment variable to the Postgres URL. If you don't specify any bindings, they will be bound to the POSTGRES_URL, POSTGRES_HOST, POSTGRES_PORT, POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DATABASE environment variables.",
|
|
244
|
+
"additionalProperties": false,
|
|
245
|
+
"properties": {
|
|
246
|
+
"url": { "type": "string" },
|
|
247
|
+
"host": { "type": "string" },
|
|
248
|
+
"port": { "type": "string" },
|
|
249
|
+
"user": { "type": "string" },
|
|
250
|
+
"password": { "type": "string" },
|
|
251
|
+
"database": { "type": "string" }
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
"postgresVersion": {
|
|
255
|
+
"type": "string",
|
|
256
|
+
"description": "The version of Postgres to deploy.",
|
|
257
|
+
"enum": ["17", "16", "15", "14"]
|
|
258
|
+
},
|
|
259
|
+
"region": {
|
|
260
|
+
"type": "string",
|
|
261
|
+
"description": "The region to deploy the Postgres instance to.",
|
|
262
|
+
"enum": [
|
|
263
|
+
"us-east-1",
|
|
264
|
+
"us-east-2",
|
|
265
|
+
"us-west-2",
|
|
266
|
+
"ap-southeast-1",
|
|
267
|
+
"ap-southeast-2",
|
|
268
|
+
"eu-central-1",
|
|
269
|
+
"eu-west-2",
|
|
270
|
+
"sa-east-1"
|
|
271
|
+
]
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
]
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
"$defs": {
|
|
281
|
+
"runtimes": {
|
|
282
|
+
"type": "string",
|
|
283
|
+
"enum": ["php-83", "php-82", "php-81", "php-80", "node-20", "node-18", "node-16", "bun-1"]
|
|
284
|
+
},
|
|
285
|
+
"matchRequirements": {
|
|
286
|
+
"description": "An array of requirements that are needed to match",
|
|
287
|
+
"type": "array",
|
|
288
|
+
"maxItems": 16,
|
|
289
|
+
"items": {
|
|
290
|
+
"anyOf": [
|
|
291
|
+
{
|
|
292
|
+
"type": "object",
|
|
293
|
+
"additionalProperties": false,
|
|
294
|
+
"required": ["type", "value"],
|
|
295
|
+
"properties": {
|
|
296
|
+
"type": {
|
|
297
|
+
"description": "The type of request element to check",
|
|
298
|
+
"type": "string",
|
|
299
|
+
"enum": ["host"]
|
|
300
|
+
},
|
|
301
|
+
"value": {
|
|
302
|
+
"description": "A regular expression used to match the value. Named groups can be used in the destination",
|
|
303
|
+
"type": "string",
|
|
304
|
+
"maxLength": 4096
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
"type": "object",
|
|
310
|
+
"additionalProperties": false,
|
|
311
|
+
"required": ["type", "key"],
|
|
312
|
+
"properties": {
|
|
313
|
+
"type": {
|
|
314
|
+
"description": "The type of request element to check",
|
|
315
|
+
"type": "string",
|
|
316
|
+
"enum": ["header", "cookie", "query"]
|
|
317
|
+
},
|
|
318
|
+
"key": {
|
|
319
|
+
"description": "The name of the element contained in the particular type",
|
|
320
|
+
"type": "string",
|
|
321
|
+
"maxLength": 4096
|
|
322
|
+
},
|
|
323
|
+
"value": {
|
|
324
|
+
"description": "A regular expression used to match the value. Named groups can be used in the destination",
|
|
325
|
+
"type": "string",
|
|
326
|
+
"maxLength": 4096
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
]
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
package/package.json
CHANGED
|
@@ -1,27 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gigadrive/network-config",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/Gigadrive/sdk.git"
|
|
7
|
+
},
|
|
8
|
+
"license": "Apache-2.0",
|
|
9
|
+
"author": "Gigadrive <business@gigadrivegroup.com> (https://gigadrive.de)",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"require": "./dist/index.js",
|
|
14
|
+
"import": "./dist/index.mjs"
|
|
15
|
+
}
|
|
6
16
|
},
|
|
17
|
+
"main": "dist/index.js",
|
|
18
|
+
"module": "dist/index.mjs",
|
|
19
|
+
"types": "dist/index.d.ts",
|
|
7
20
|
"files": [
|
|
8
|
-
"dist"
|
|
21
|
+
"dist",
|
|
22
|
+
"**/*.json"
|
|
9
23
|
],
|
|
10
24
|
"dependencies": {
|
|
11
25
|
"ajv": "^8.17.1",
|
|
12
26
|
"ajv-formats": "^3.0.1",
|
|
13
|
-
"minimatch": "^
|
|
14
|
-
"yaml": "^2.7.0"
|
|
27
|
+
"minimatch": "^10.0.1",
|
|
28
|
+
"yaml": "^2.7.0",
|
|
29
|
+
"@gigadrive/build-utils": "1.0.0"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/node": "^22",
|
|
33
|
+
"esbuild": "^0.25.0"
|
|
15
34
|
},
|
|
16
35
|
"publishConfig": {
|
|
17
36
|
"access": "public"
|
|
18
37
|
},
|
|
19
|
-
"repository": {
|
|
20
|
-
"type": "git",
|
|
21
|
-
"url": "https://github.com/Gigadrive/sdk.git"
|
|
22
|
-
},
|
|
23
38
|
"scripts": {
|
|
24
|
-
"
|
|
25
|
-
"
|
|
39
|
+
"build": "tsup && mkdir -p dist/v4 && cp -r ./src/v4/schema.json ./dist/v4/schema.json",
|
|
40
|
+
"clean": "rm -rf dist"
|
|
26
41
|
}
|
|
27
42
|
}
|