@friggframework/schemas 2.0.0-next.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,393 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://schemas.friggframework.org/serverless-config.schema.json",
4
+ "title": "Frigg Serverless Configuration",
5
+ "description": "Schema for Serverless Framework configuration used in Frigg applications for AWS deployment.",
6
+ "type": "object",
7
+ "required": ["service", "provider"],
8
+ "properties": {
9
+ "frameworkVersion": {
10
+ "type": "string",
11
+ "description": "Serverless Framework version constraint",
12
+ "pattern": "^[><=]*\\d+\\.\\d+\\.\\d+$",
13
+ "examples": [">=3.17.0", "3.38.0"]
14
+ },
15
+ "service": {
16
+ "type": "string",
17
+ "description": "Service name for the Serverless application",
18
+ "pattern": "^[a-zA-Z][a-zA-Z0-9-]*$",
19
+ "minLength": 1,
20
+ "maxLength": 128
21
+ },
22
+ "provider": {
23
+ "type": "object",
24
+ "description": "Cloud provider configuration",
25
+ "required": ["name", "runtime"],
26
+ "properties": {
27
+ "name": {
28
+ "type": "string",
29
+ "description": "Cloud provider name",
30
+ "enum": ["aws", "azure", "gcp"]
31
+ },
32
+ "runtime": {
33
+ "type": "string",
34
+ "description": "Runtime environment",
35
+ "enum": ["nodejs18.x", "nodejs20.x", "python3.9", "python3.10", "python3.11"]
36
+ },
37
+ "timeout": {
38
+ "type": "integer",
39
+ "description": "Function timeout in seconds",
40
+ "minimum": 1,
41
+ "maximum": 900,
42
+ "default": 30
43
+ },
44
+ "region": {
45
+ "type": "string",
46
+ "description": "AWS region for deployment",
47
+ "enum": [
48
+ "us-east-1", "us-east-2", "us-west-1", "us-west-2",
49
+ "eu-west-1", "eu-west-2", "eu-central-1", "ap-southeast-1",
50
+ "ap-southeast-2", "ap-northeast-1"
51
+ ],
52
+ "default": "us-east-1"
53
+ },
54
+ "stage": {
55
+ "type": "string",
56
+ "description": "Deployment stage",
57
+ "enum": ["dev", "staging", "prod", "test"],
58
+ "default": "dev"
59
+ },
60
+ "environment": {
61
+ "type": "object",
62
+ "description": "Environment variables for all functions",
63
+ "patternProperties": {
64
+ "^[A-Z][A-Z0-9_]*$": {
65
+ "type": "string"
66
+ }
67
+ },
68
+ "additionalProperties": false
69
+ },
70
+ "vpc": {
71
+ "type": "object",
72
+ "description": "VPC configuration",
73
+ "properties": {
74
+ "securityGroupIds": {
75
+ "type": "array",
76
+ "description": "Security group IDs",
77
+ "items": {
78
+ "type": "string",
79
+ "pattern": "^sg-[a-z0-9]+$"
80
+ }
81
+ },
82
+ "subnetIds": {
83
+ "type": "array",
84
+ "description": "Subnet IDs",
85
+ "items": {
86
+ "type": "string",
87
+ "pattern": "^subnet-[a-z0-9]+$"
88
+ }
89
+ }
90
+ },
91
+ "additionalProperties": false
92
+ },
93
+ "iam": {
94
+ "type": "object",
95
+ "description": "IAM role configuration",
96
+ "properties": {
97
+ "role": {
98
+ "type": "string",
99
+ "description": "IAM role ARN or role statements"
100
+ },
101
+ "roleStatements": {
102
+ "type": "array",
103
+ "description": "IAM policy statements",
104
+ "items": {
105
+ "type": "object",
106
+ "required": ["Effect", "Action"],
107
+ "properties": {
108
+ "Effect": {
109
+ "type": "string",
110
+ "enum": ["Allow", "Deny"]
111
+ },
112
+ "Action": {
113
+ "oneOf": [
114
+ {"type": "string"},
115
+ {"type": "array", "items": {"type": "string"}}
116
+ ]
117
+ },
118
+ "Resource": {
119
+ "oneOf": [
120
+ {"type": "string"},
121
+ {"type": "array", "items": {"type": "string"}}
122
+ ]
123
+ },
124
+ "Condition": {
125
+ "type": "object"
126
+ }
127
+ },
128
+ "additionalProperties": false
129
+ }
130
+ }
131
+ },
132
+ "additionalProperties": false
133
+ }
134
+ },
135
+ "additionalProperties": false
136
+ },
137
+ "functions": {
138
+ "type": "object",
139
+ "description": "Lambda function definitions",
140
+ "patternProperties": {
141
+ "^[a-zA-Z][a-zA-Z0-9_-]*$": {
142
+ "type": "object",
143
+ "required": ["handler"],
144
+ "properties": {
145
+ "handler": {
146
+ "type": "string",
147
+ "description": "Function handler path",
148
+ "pattern": "^[./a-zA-Z0-9_-]+\\.[a-zA-Z][a-zA-Z0-9_]*$"
149
+ },
150
+ "description": {
151
+ "type": "string",
152
+ "description": "Function description",
153
+ "maxLength": 256
154
+ },
155
+ "timeout": {
156
+ "type": "integer",
157
+ "description": "Function-specific timeout",
158
+ "minimum": 1,
159
+ "maximum": 900
160
+ },
161
+ "memorySize": {
162
+ "type": "integer",
163
+ "description": "Memory allocation in MB",
164
+ "minimum": 128,
165
+ "maximum": 10240,
166
+ "multipleOf": 64
167
+ },
168
+ "environment": {
169
+ "type": "object",
170
+ "description": "Function-specific environment variables",
171
+ "patternProperties": {
172
+ "^[A-Z][A-Z0-9_]*$": {
173
+ "type": "string"
174
+ }
175
+ }
176
+ },
177
+ "events": {
178
+ "type": "array",
179
+ "description": "Function event triggers",
180
+ "items": {
181
+ "type": "object",
182
+ "properties": {
183
+ "http": {
184
+ "type": "object",
185
+ "description": "HTTP API Gateway event",
186
+ "required": ["path", "method"],
187
+ "properties": {
188
+ "path": {
189
+ "type": "string",
190
+ "description": "API path",
191
+ "pattern": "^/[a-zA-Z0-9/_{}+-]*$"
192
+ },
193
+ "method": {
194
+ "type": "string",
195
+ "description": "HTTP method",
196
+ "enum": ["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD", "ANY"]
197
+ },
198
+ "cors": {
199
+ "type": "boolean",
200
+ "description": "Enable CORS",
201
+ "default": true
202
+ },
203
+ "authorizer": {
204
+ "type": "string",
205
+ "description": "Authorizer function name"
206
+ }
207
+ },
208
+ "additionalProperties": false
209
+ },
210
+ "sqs": {
211
+ "type": "object",
212
+ "description": "SQS queue event",
213
+ "required": ["arn"],
214
+ "properties": {
215
+ "arn": {
216
+ "type": "string",
217
+ "description": "SQS queue ARN",
218
+ "pattern": "^arn:aws:sqs:[a-z0-9-]+:\\d{12}:[a-zA-Z0-9_-]+$"
219
+ },
220
+ "batchSize": {
221
+ "type": "integer",
222
+ "description": "Batch size for SQS processing",
223
+ "minimum": 1,
224
+ "maximum": 10
225
+ }
226
+ },
227
+ "additionalProperties": false
228
+ },
229
+ "schedule": {
230
+ "type": "object",
231
+ "description": "Scheduled event",
232
+ "required": ["rate"],
233
+ "properties": {
234
+ "rate": {
235
+ "type": "string",
236
+ "description": "Schedule expression",
237
+ "pattern": "^(rate|cron)\\(.+\\)$"
238
+ },
239
+ "enabled": {
240
+ "type": "boolean",
241
+ "description": "Whether schedule is enabled",
242
+ "default": true
243
+ }
244
+ },
245
+ "additionalProperties": false
246
+ }
247
+ },
248
+ "additionalProperties": false
249
+ }
250
+ }
251
+ },
252
+ "additionalProperties": false
253
+ }
254
+ },
255
+ "additionalProperties": false
256
+ },
257
+ "resources": {
258
+ "type": "object",
259
+ "description": "CloudFormation resources",
260
+ "properties": {
261
+ "Resources": {
262
+ "type": "object",
263
+ "description": "CloudFormation resource definitions",
264
+ "patternProperties": {
265
+ "^[a-zA-Z][a-zA-Z0-9]*$": {
266
+ "type": "object",
267
+ "required": ["Type"],
268
+ "properties": {
269
+ "Type": {
270
+ "type": "string",
271
+ "description": "AWS resource type",
272
+ "pattern": "^AWS::[a-zA-Z0-9]+::[a-zA-Z0-9]+$"
273
+ },
274
+ "Properties": {
275
+ "type": "object",
276
+ "description": "Resource properties"
277
+ },
278
+ "DependsOn": {
279
+ "oneOf": [
280
+ {"type": "string"},
281
+ {"type": "array", "items": {"type": "string"}}
282
+ ],
283
+ "description": "Resource dependencies"
284
+ }
285
+ },
286
+ "additionalProperties": false
287
+ }
288
+ }
289
+ },
290
+ "Outputs": {
291
+ "type": "object",
292
+ "description": "CloudFormation outputs",
293
+ "patternProperties": {
294
+ "^[a-zA-Z][a-zA-Z0-9]*$": {
295
+ "type": "object",
296
+ "required": ["Value"],
297
+ "properties": {
298
+ "Value": {
299
+ "type": "string",
300
+ "description": "Output value"
301
+ },
302
+ "Description": {
303
+ "type": "string",
304
+ "description": "Output description"
305
+ },
306
+ "Export": {
307
+ "type": "object",
308
+ "properties": {
309
+ "Name": {
310
+ "type": "string",
311
+ "description": "Export name"
312
+ }
313
+ }
314
+ }
315
+ },
316
+ "additionalProperties": false
317
+ }
318
+ }
319
+ }
320
+ },
321
+ "additionalProperties": false
322
+ },
323
+ "plugins": {
324
+ "type": "array",
325
+ "description": "Serverless plugins",
326
+ "items": {
327
+ "type": "string",
328
+ "description": "Plugin name"
329
+ },
330
+ "uniqueItems": true
331
+ },
332
+ "custom": {
333
+ "type": "object",
334
+ "description": "Custom configuration for plugins and other settings",
335
+ "properties": {
336
+ "webpack": {
337
+ "type": "object",
338
+ "description": "Webpack configuration for serverless-webpack plugin"
339
+ },
340
+ "dotenv": {
341
+ "type": "object",
342
+ "description": "Environment file configuration"
343
+ }
344
+ },
345
+ "additionalProperties": true
346
+ }
347
+ },
348
+ "additionalProperties": false,
349
+ "examples": [
350
+ {
351
+ "frameworkVersion": ">=3.17.0",
352
+ "service": "frigg-backend",
353
+ "provider": {
354
+ "name": "aws",
355
+ "runtime": "nodejs20.x",
356
+ "timeout": 30,
357
+ "region": "us-east-1",
358
+ "environment": {
359
+ "STAGE": "${opt:stage}",
360
+ "NODE_ENV": "production"
361
+ }
362
+ },
363
+ "functions": {
364
+ "api": {
365
+ "handler": "./src/api.handler",
366
+ "events": [
367
+ {
368
+ "http": {
369
+ "path": "/api/{proxy+}",
370
+ "method": "ANY",
371
+ "cors": true
372
+ }
373
+ }
374
+ ]
375
+ }
376
+ },
377
+ "resources": {
378
+ "Resources": {
379
+ "ErrorQueue": {
380
+ "Type": "AWS::SQS::Queue",
381
+ "Properties": {
382
+ "QueueName": "frigg-errors-${opt:stage}"
383
+ }
384
+ }
385
+ }
386
+ },
387
+ "plugins": [
388
+ "serverless-webpack",
389
+ "serverless-offline"
390
+ ]
391
+ }
392
+ ]
393
+ }