@friggframework/schemas 2.0.0--canary.671.dc3e89f.0 → 2.0.0--canary.670.2873d95.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/package.json +2 -2
- package/schemas/api-authorization.schema.json +7 -41
- package/schemas/api-credentials.schema.json +5 -5
- package/schemas/api-entities.schema.json +7 -7
- package/schemas/api-module-definition.schema.json +0 -34
- package/schemas/api-proxy.schema.json +13 -26
- package/schemas/app-definition.schema.json +0 -95
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/schemas",
|
|
3
|
-
"version": "2.0.0--canary.
|
|
3
|
+
"version": "2.0.0--canary.670.2873d95.0",
|
|
4
4
|
"description": "Canonical JSON Schema definitions for Frigg Framework",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"middleware/",
|
|
42
42
|
"index.js"
|
|
43
43
|
],
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "2873d95d44e6504b8afcdb5b8c121f48ac66b4e2"
|
|
45
45
|
}
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
"definitions": {
|
|
7
7
|
"authorizationRequirements": {
|
|
8
8
|
"type": "object",
|
|
9
|
-
"description": "Authorization requirements response from GET /api/
|
|
9
|
+
"description": "Authorization requirements response from GET /api/authorize",
|
|
10
10
|
"required": ["type", "step", "totalSteps", "isMultiStep"],
|
|
11
11
|
"properties": {
|
|
12
12
|
"type": {
|
|
13
13
|
"type": "string",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
14
|
+
"enum": ["oauth2", "form", "api-key", "basic"],
|
|
15
|
+
"description": "Type of authentication required"
|
|
16
16
|
},
|
|
17
17
|
"step": {
|
|
18
18
|
"type": "integer",
|
|
@@ -112,13 +112,13 @@
|
|
|
112
112
|
},
|
|
113
113
|
"getEntityTypeRequirementsResponse": {
|
|
114
114
|
"type": "object",
|
|
115
|
-
"description": "Authorization requirements response from GET /api/
|
|
115
|
+
"description": "Authorization requirements response from GET /api/entities/types/:typeName/requirements",
|
|
116
116
|
"required": ["type", "step", "totalSteps", "isMultiStep"],
|
|
117
117
|
"properties": {
|
|
118
118
|
"type": {
|
|
119
119
|
"type": "string",
|
|
120
|
-
"
|
|
121
|
-
"
|
|
120
|
+
"enum": ["oauth2", "form", "api-key", "basic"],
|
|
121
|
+
"description": "Type of authentication required"
|
|
122
122
|
},
|
|
123
123
|
"step": {
|
|
124
124
|
"type": "integer",
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
},
|
|
152
152
|
"authorizationRequest": {
|
|
153
153
|
"type": "object",
|
|
154
|
-
"description": "Authorization request to POST /api/
|
|
154
|
+
"description": "Authorization request to POST /api/authorize",
|
|
155
155
|
"required": ["entityType"],
|
|
156
156
|
"properties": {
|
|
157
157
|
"entityType": {
|
|
@@ -238,40 +238,6 @@
|
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
},
|
|
241
|
-
"authorizeComplete": {
|
|
242
|
-
"type": "object",
|
|
243
|
-
"description": "POST /api/v2/authorize (or /api/v2/credentials/:credentialId/reauthorize) when the flow is complete. The credential is masked.",
|
|
244
|
-
"required": ["status", "entity", "credential"],
|
|
245
|
-
"properties": {
|
|
246
|
-
"status": { "const": "complete" },
|
|
247
|
-
"entity": { "type": "object", "description": "api-entities#/definitions/entity" },
|
|
248
|
-
"credential": { "type": "object", "description": "api-credentials#/definitions/credential, masked" },
|
|
249
|
-
"previousCredentialId": {
|
|
250
|
-
"type": "string",
|
|
251
|
-
"description": "Re-authorization only: set when the provider account changed and a new credential was stored"
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
},
|
|
255
|
-
"authorizePending": {
|
|
256
|
-
"type": "object",
|
|
257
|
-
"description": "POST /api/v2/authorize when another step is needed",
|
|
258
|
-
"required": ["status", "step", "totalSteps", "sessionId", "requirements"],
|
|
259
|
-
"properties": {
|
|
260
|
-
"status": { "const": "pending" },
|
|
261
|
-
"step": { "type": "integer", "minimum": 2 },
|
|
262
|
-
"totalSteps": { "type": "integer", "minimum": 2 },
|
|
263
|
-
"sessionId": { "type": "string" },
|
|
264
|
-
"requirements": { "$ref": "#/definitions/authorizationRequirements" },
|
|
265
|
-
"message": { "type": "string" }
|
|
266
|
-
}
|
|
267
|
-
},
|
|
268
|
-
"authorizeV2Response": {
|
|
269
|
-
"description": "Response from POST /api/v2/authorize and POST /api/v2/credentials/:credentialId/reauthorize",
|
|
270
|
-
"oneOf": [
|
|
271
|
-
{ "$ref": "#/definitions/authorizeComplete" },
|
|
272
|
-
{ "$ref": "#/definitions/authorizePending" }
|
|
273
|
-
]
|
|
274
|
-
},
|
|
275
241
|
"authorizationSession": {
|
|
276
242
|
"type": "object",
|
|
277
243
|
"description": "Authorization session stored in database",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"listCredentialsResponse": {
|
|
50
50
|
"type": "object",
|
|
51
|
-
"description": "Response from GET /api/
|
|
51
|
+
"description": "Response from GET /api/credentials - returns list of credentials for the authenticated user",
|
|
52
52
|
"required": ["credentials"],
|
|
53
53
|
"properties": {
|
|
54
54
|
"credentials": {
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
"getCredentialResponse": {
|
|
64
|
-
"description": "Response from GET /api/
|
|
64
|
+
"description": "Response from GET /api/credentials/:id - returns a single credential",
|
|
65
65
|
"allOf": [
|
|
66
66
|
{
|
|
67
67
|
"$ref": "#/definitions/credential"
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
},
|
|
71
71
|
"deleteCredentialResponse": {
|
|
72
72
|
"type": "object",
|
|
73
|
-
"description": "
|
|
73
|
+
"description": "Response from DELETE /api/credentials/:id",
|
|
74
74
|
"required": ["success"],
|
|
75
75
|
"properties": {
|
|
76
76
|
"success": {
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
},
|
|
86
86
|
"reauthorizeCredentialRequest": {
|
|
87
87
|
"type": "object",
|
|
88
|
-
"description": "Request to POST /api/
|
|
88
|
+
"description": "Request to POST /api/credentials/:id/reauthorize - refresh or update credential authentication",
|
|
89
89
|
"required": ["data"],
|
|
90
90
|
"properties": {
|
|
91
91
|
"data": {
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
},
|
|
108
108
|
"reauthorizeCredentialResponse": {
|
|
109
109
|
"type": "object",
|
|
110
|
-
"description": "
|
|
110
|
+
"description": "Response from POST /api/credentials/:id/reauthorize - either success or next step",
|
|
111
111
|
"oneOf": [
|
|
112
112
|
{
|
|
113
113
|
"$ref": "#/definitions/reauthorizeCredentialSuccess"
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
},
|
|
52
52
|
"listEntitiesResponse": {
|
|
53
53
|
"type": "object",
|
|
54
|
-
"description": "Response from GET /api/
|
|
54
|
+
"description": "Response from GET /api/entities",
|
|
55
55
|
"required": ["entities"],
|
|
56
56
|
"properties": {
|
|
57
57
|
"entities": {
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
},
|
|
66
66
|
"createEntityRequest": {
|
|
67
67
|
"type": "object",
|
|
68
|
-
"description": "Request to POST /api/entities
|
|
68
|
+
"description": "Request to POST /api/entities",
|
|
69
69
|
"required": ["entityType", "data"],
|
|
70
70
|
"properties": {
|
|
71
71
|
"entityType": {
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
},
|
|
89
89
|
"createEntityResponse": {
|
|
90
90
|
"type": "object",
|
|
91
|
-
"description": "Response from POST /api/entities
|
|
91
|
+
"description": "Response from POST /api/entities",
|
|
92
92
|
"required": ["entity_id", "credential_id", "type"],
|
|
93
93
|
"properties": {
|
|
94
94
|
"entity_id": {
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
},
|
|
148
148
|
"listEntityTypesResponse": {
|
|
149
149
|
"type": "object",
|
|
150
|
-
"description": "Response from GET /api/
|
|
150
|
+
"description": "Response from GET /api/entities/types",
|
|
151
151
|
"required": ["types"],
|
|
152
152
|
"properties": {
|
|
153
153
|
"types": {
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
},
|
|
162
162
|
"getEntityTypeResponse": {
|
|
163
163
|
"type": "object",
|
|
164
|
-
"description": "Response from GET /api/
|
|
164
|
+
"description": "Response from GET /api/entities/types/:typeName",
|
|
165
165
|
"required": ["type", "name"],
|
|
166
166
|
"properties": {
|
|
167
167
|
"type": {
|
|
@@ -201,7 +201,7 @@
|
|
|
201
201
|
},
|
|
202
202
|
"reauthorizeEntityRequest": {
|
|
203
203
|
"type": "object",
|
|
204
|
-
"description": "Request to
|
|
204
|
+
"description": "Request to POST /api/entities/:id/reauthorize",
|
|
205
205
|
"required": ["data"],
|
|
206
206
|
"properties": {
|
|
207
207
|
"data": {
|
|
@@ -223,7 +223,7 @@
|
|
|
223
223
|
},
|
|
224
224
|
"reauthorizeEntityResponse": {
|
|
225
225
|
"type": "object",
|
|
226
|
-
"description": "
|
|
226
|
+
"description": "Response from POST /api/entities/:id/reauthorize (success or next step)",
|
|
227
227
|
"oneOf": [
|
|
228
228
|
{
|
|
229
229
|
"$ref": "#/definitions/reauthorizeEntitySuccess"
|
|
@@ -94,40 +94,6 @@
|
|
|
94
94
|
},
|
|
95
95
|
"additionalProperties": false
|
|
96
96
|
},
|
|
97
|
-
"proxy": {
|
|
98
|
-
"type": "object",
|
|
99
|
-
"description": "Opt in to the Management API entity proxy (ADR-052). Without allow, nothing can be proxied.",
|
|
100
|
-
"properties": {
|
|
101
|
-
"allow": {
|
|
102
|
-
"type": "array",
|
|
103
|
-
"description": "Operations that may be proxied. :param matches one segment; a trailing /** matches a subtree. Wildcards (method * or path /**) are ignored here and only accepted in the app definition.",
|
|
104
|
-
"items": {
|
|
105
|
-
"type": "object",
|
|
106
|
-
"required": ["method", "path"],
|
|
107
|
-
"properties": {
|
|
108
|
-
"method": { "type": "string", "enum": ["GET", "POST", "PUT", "PATCH", "DELETE"] },
|
|
109
|
-
"path": { "type": "string", "pattern": "^/" }
|
|
110
|
-
},
|
|
111
|
-
"additionalProperties": false
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
"headers": {
|
|
115
|
-
"type": "array",
|
|
116
|
-
"description": "Provider-specific request headers callers may send, in addition to accept, content-type, accept-language, if-match and if-none-match",
|
|
117
|
-
"items": { "type": "string" }
|
|
118
|
-
},
|
|
119
|
-
"baseUrl": {
|
|
120
|
-
"description": "Proxy base URL (https). A string, or a function of the Api instance for tenant hosts. Defaults to the Api's baseUrl.",
|
|
121
|
-
"type": ["string", "object"]
|
|
122
|
-
},
|
|
123
|
-
"binary": {
|
|
124
|
-
"type": "boolean",
|
|
125
|
-
"default": false,
|
|
126
|
-
"description": "Return binary upstream bodies base64-encoded instead of refusing them (415)"
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
"additionalProperties": false
|
|
130
|
-
},
|
|
131
97
|
"env": {
|
|
132
98
|
"type": "object",
|
|
133
99
|
"description": "Environment variable configuration",
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"definitions": {
|
|
7
7
|
"proxyRequest": {
|
|
8
8
|
"type": "object",
|
|
9
|
-
"description": "Proxy request to POST /api/
|
|
9
|
+
"description": "Proxy request to POST /api/entities/:id/proxy or POST /api/credentials/:id/proxy",
|
|
10
10
|
"required": ["method", "path"],
|
|
11
11
|
"properties": {
|
|
12
12
|
"method": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"path": {
|
|
18
18
|
"type": "string",
|
|
19
|
-
"description": "
|
|
19
|
+
"description": "API path to call on the upstream service (e.g., '/v3/contacts' or '/api/users')",
|
|
20
20
|
"pattern": "^/",
|
|
21
21
|
"minLength": 1
|
|
22
22
|
},
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"headers": {
|
|
39
39
|
"type": "object",
|
|
40
|
-
"description": "
|
|
40
|
+
"description": "Additional headers to include in the upstream request (authorization headers are added automatically)",
|
|
41
41
|
"additionalProperties": { "type": "string" }
|
|
42
42
|
},
|
|
43
43
|
"body": {
|
|
@@ -84,23 +84,19 @@
|
|
|
84
84
|
},
|
|
85
85
|
"proxyResponse": {
|
|
86
86
|
"type": "object",
|
|
87
|
-
"description": "
|
|
87
|
+
"description": "Successful proxy response with data from upstream API",
|
|
88
88
|
"required": ["success", "status", "data"],
|
|
89
89
|
"properties": {
|
|
90
90
|
"success": {
|
|
91
91
|
"type": "boolean",
|
|
92
|
-
"
|
|
92
|
+
"const": true,
|
|
93
|
+
"description": "Indicates successful proxy operation"
|
|
93
94
|
},
|
|
94
95
|
"status": {
|
|
95
96
|
"type": "integer",
|
|
96
97
|
"minimum": 200,
|
|
97
|
-
"maximum":
|
|
98
|
-
"description": "HTTP status code from the upstream API response
|
|
99
|
-
},
|
|
100
|
-
"dataEncoding": {
|
|
101
|
-
"type": "string",
|
|
102
|
-
"enum": ["base64"],
|
|
103
|
-
"description": "Present when data is a base64-encoded binary body (only for modules with proxy.binary: true)"
|
|
98
|
+
"maximum": 299,
|
|
99
|
+
"description": "HTTP status code from the upstream API response"
|
|
104
100
|
},
|
|
105
101
|
"headers": {
|
|
106
102
|
"type": "object",
|
|
@@ -175,25 +171,16 @@
|
|
|
175
171
|
"type": "string",
|
|
176
172
|
"description": "Error code identifying the type of failure",
|
|
177
173
|
"enum": [
|
|
178
|
-
"
|
|
179
|
-
"
|
|
180
|
-
"PROXY_NOT_CONFIGURED",
|
|
181
|
-
"PAYLOAD_TOO_LARGE",
|
|
182
|
-
"UNSUPPORTED_MEDIA_TYPE",
|
|
183
|
-
"RESPONSE_TOO_LARGE",
|
|
184
|
-
"INVALID_CREDENTIALS",
|
|
185
|
-
"RATE_LIMITED",
|
|
174
|
+
"INVALID_AUTH",
|
|
175
|
+
"EXPIRED_TOKEN",
|
|
186
176
|
"UPSTREAM_ERROR",
|
|
187
177
|
"TIMEOUT",
|
|
188
178
|
"NETWORK_ERROR",
|
|
189
|
-
"
|
|
190
|
-
"NOT_FOUND",
|
|
191
|
-
"UNAUTHORIZED",
|
|
192
|
-
"VALIDATION_ERROR",
|
|
193
|
-
"INVALID_AUTH",
|
|
194
|
-
"EXPIRED_TOKEN",
|
|
179
|
+
"RATE_LIMITED",
|
|
195
180
|
"INVALID_REQUEST",
|
|
181
|
+
"NOT_FOUND",
|
|
196
182
|
"PERMISSION_DENIED",
|
|
183
|
+
"INVALID_CREDENTIALS",
|
|
197
184
|
"SERVICE_UNAVAILABLE"
|
|
198
185
|
]
|
|
199
186
|
},
|
|
@@ -643,101 +643,6 @@
|
|
|
643
643
|
},
|
|
644
644
|
"additionalProperties": false
|
|
645
645
|
},
|
|
646
|
-
"managementApi": {
|
|
647
|
-
"type": "object",
|
|
648
|
-
"description": "Management API settings (ADR-053 versioning, ADR-052 entity proxy).",
|
|
649
|
-
"properties": {
|
|
650
|
-
"v1": {
|
|
651
|
-
"type": "boolean",
|
|
652
|
-
"default": true,
|
|
653
|
-
"description": "Serve the deprecated v1 routes (unprefixed /api/*). false removes them from the router and from the generated API Gateway routes."
|
|
654
|
-
},
|
|
655
|
-
"proxy": {
|
|
656
|
-
"type": "object",
|
|
657
|
-
"description": "Entity proxy, POST /api/v2/entities/:id/proxy (ADR-052). Off by default.",
|
|
658
|
-
"properties": {
|
|
659
|
-
"enable": {
|
|
660
|
-
"type": "boolean",
|
|
661
|
-
"default": false,
|
|
662
|
-
"description": "Mount the entity proxy route and advertise the entityProxy capability."
|
|
663
|
-
},
|
|
664
|
-
"timeoutMs": {
|
|
665
|
-
"type": "integer",
|
|
666
|
-
"minimum": 1,
|
|
667
|
-
"maximum": 25000,
|
|
668
|
-
"default": 25000,
|
|
669
|
-
"description": "Upstream timeout for one proxied call, in milliseconds (can only be lowered)."
|
|
670
|
-
},
|
|
671
|
-
"maxRequestBytes": {
|
|
672
|
-
"type": "integer",
|
|
673
|
-
"minimum": 1,
|
|
674
|
-
"maximum": 10485760,
|
|
675
|
-
"default": 1048576,
|
|
676
|
-
"description": "Largest proxied request body, in bytes."
|
|
677
|
-
},
|
|
678
|
-
"maxResponseBytes": {
|
|
679
|
-
"type": "integer",
|
|
680
|
-
"minimum": 1,
|
|
681
|
-
"maximum": 5242880,
|
|
682
|
-
"default": 5242880,
|
|
683
|
-
"description": "Largest proxied response body, in bytes (can only be lowered)."
|
|
684
|
-
},
|
|
685
|
-
"modules": {
|
|
686
|
-
"type": "object",
|
|
687
|
-
"description": "Per-module allow-list override, keyed by module name. 'module' uses the module's own proxy.allow list.",
|
|
688
|
-
"additionalProperties": {
|
|
689
|
-
"type": "object",
|
|
690
|
-
"properties": {
|
|
691
|
-
"allow": {
|
|
692
|
-
"oneOf": [
|
|
693
|
-
{
|
|
694
|
-
"type": "string",
|
|
695
|
-
"enum": [
|
|
696
|
-
"module"
|
|
697
|
-
]
|
|
698
|
-
},
|
|
699
|
-
{
|
|
700
|
-
"type": "array",
|
|
701
|
-
"items": {
|
|
702
|
-
"type": "object",
|
|
703
|
-
"required": [
|
|
704
|
-
"method",
|
|
705
|
-
"path"
|
|
706
|
-
],
|
|
707
|
-
"properties": {
|
|
708
|
-
"method": {
|
|
709
|
-
"type": "string",
|
|
710
|
-
"enum": [
|
|
711
|
-
"GET",
|
|
712
|
-
"POST",
|
|
713
|
-
"PUT",
|
|
714
|
-
"PATCH",
|
|
715
|
-
"DELETE",
|
|
716
|
-
"*"
|
|
717
|
-
],
|
|
718
|
-
"description": "HTTP method, or * for any (app definition only; frigg validate warns)"
|
|
719
|
-
},
|
|
720
|
-
"path": {
|
|
721
|
-
"type": "string",
|
|
722
|
-
"pattern": "^/",
|
|
723
|
-
"description": "Path pattern relative to the module's base URL. `:param` matches one segment; a trailing `/**` matches a subtree."
|
|
724
|
-
}
|
|
725
|
-
},
|
|
726
|
-
"additionalProperties": false
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
]
|
|
730
|
-
}
|
|
731
|
-
},
|
|
732
|
-
"additionalProperties": false
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
},
|
|
736
|
-
"additionalProperties": false
|
|
737
|
-
}
|
|
738
|
-
},
|
|
739
|
-
"additionalProperties": false
|
|
740
|
-
},
|
|
741
646
|
"custom": {
|
|
742
647
|
"type": "object",
|
|
743
648
|
"description": "Custom application-specific configuration",
|