@friggframework/schemas 2.0.0--canary.680.6bacd26.0 → 2.0.0--canary.663.8de669c.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@friggframework/schemas",
3
- "version": "2.0.0--canary.680.6bacd26.0",
3
+ "version": "2.0.0--canary.663.8de669c.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": "6bacd2666932cc417e175260ee2dbf3522740572"
44
+ "gitHead": "8de669cbe925abbcd0908be6e792e38e2a14ffd8"
45
45
  }
@@ -6,13 +6,13 @@
6
6
  "definitions": {
7
7
  "authorizationRequirements": {
8
8
  "type": "object",
9
- "description": "Authorization requirements response from GET /api/v2/authorize (GET /api/authorize in v1 returns the module requirements unwrapped)",
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
- "description": "Type of authentication required: oauth2, form, api-key, basic, or a module-defined step type (e.g. email, otp)",
15
- "examples": ["oauth2", "form", "api-key", "basic", "otp"]
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/v2/entities/types/:entityType/requirements",
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
- "description": "Type of authentication required: oauth2, form, api-key, basic, or a module-defined step type (e.g. email, otp)",
121
- "examples": ["oauth2", "form", "api-key", "basic", "otp"]
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/v2/authorize (and v1 POST /api/authorize)",
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/v2/credentials - returns list of credentials for the authenticated user",
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/v2/credentials/:credentialId - returns a single credential",
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": "Legacy delete result. DELETE /api/v2/credentials/:credentialId answers 204 No Content.",
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/v2/credentials/:credentialId/reauthorize - refresh or update credential authentication",
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": "Legacy re-authorization result. POST /api/v2/credentials/:credentialId/reauthorize answers api-authorization#/definitions/authorizeV2Response.",
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/v2/entities",
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 (v1 POST /api/entity). Not served by v2: POST /api/v2/authorize creates the entity.",
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 (v1 POST /api/entity). Not served by v2.",
91
+ "description": "Response from POST /api/entities",
92
92
  "required": ["entity_id", "credential_id", "type"],
93
93
  "properties": {
94
94
  "entity_id": {
@@ -122,11 +122,6 @@
122
122
  "type": "string",
123
123
  "description": "Description of the entity type"
124
124
  },
125
- "usedBy": {
126
- "type": "array",
127
- "items": { "type": "string" },
128
- "description": "Names of the integrations that bind this entity type; empty for a type registered only in appDefinition.entities"
129
- },
130
125
  "authType": {
131
126
  "type": "string",
132
127
  "enum": ["oauth2", "form", "api-key", "basic"],
@@ -152,7 +147,7 @@
152
147
  },
153
148
  "listEntityTypesResponse": {
154
149
  "type": "object",
155
- "description": "Response from GET /api/v2/entities/types",
150
+ "description": "Response from GET /api/entities/types",
156
151
  "required": ["types"],
157
152
  "properties": {
158
153
  "types": {
@@ -166,7 +161,7 @@
166
161
  },
167
162
  "getEntityTypeResponse": {
168
163
  "type": "object",
169
- "description": "Response from GET /api/v2/entities/types/:entityType",
164
+ "description": "Response from GET /api/entities/types/:typeName",
170
165
  "required": ["type", "name"],
171
166
  "properties": {
172
167
  "type": {
@@ -206,7 +201,7 @@
206
201
  },
207
202
  "reauthorizeEntityRequest": {
208
203
  "type": "object",
209
- "description": "Request to re-authorize an entity. Not served in 2.0.1: use POST /api/v2/credentials/:credentialId/reauthorize.",
204
+ "description": "Request to POST /api/entities/:id/reauthorize",
210
205
  "required": ["data"],
211
206
  "properties": {
212
207
  "data": {
@@ -228,7 +223,7 @@
228
223
  },
229
224
  "reauthorizeEntityResponse": {
230
225
  "type": "object",
231
- "description": "Entity re-authorization result. Not served in 2.0.1: POST /api/v2/credentials/:credentialId/reauthorize answers api-authorization#/definitions/authorizeV2Response.",
226
+ "description": "Response from POST /api/entities/:id/reauthorize (success or next step)",
232
227
  "oneOf": [
233
228
  {
234
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/v2/entities/:entityId/proxy (ADR-052). Off unless the app sets managementApi.proxy.enable, and only for paths the module (or the app definition) allow-lists.",
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": "Path relative to the module's base URL (e.g. '/v3/contacts'). Must start with a single /. Rejected: //, backslashes, ? and # (use query), . and .. segments, encoded separators (%2f, %5c), double encoding, control and whitespace characters other than %20. The host always comes from the module.",
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": "Request headers. Only accept, content-type, accept-language, if-match, if-none-match and headers the module lists in proxy.headers are forwarded; others are dropped. Authorization, Proxy-Authorization, Cookie, Host, Forwarded, X-Forwarded-*, X-Real-IP, X-API-Key and the module's own auth header are refused (400). Auth headers come only from the module.",
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": "Upstream answer relayed by the proxy. The HTTP status of the Frigg response equals `status`; `success` is false for upstream 4xx.",
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
- "description": "True when the upstream status is below 400"
92
+ "const": true,
93
+ "description": "Indicates successful proxy operation"
93
94
  },
94
95
  "status": {
95
96
  "type": "integer",
96
97
  "minimum": 200,
97
- "maximum": 499,
98
- "description": "HTTP status code from the upstream API response (5xx, 401 and 429 are reported as proxy errors)"
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
- "INVALID_PROXY_REQUEST",
179
- "PROXY_NOT_ALLOWED",
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
- "ENTITY_NOT_FOUND",
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,151 +643,6 @@
643
643
  },
644
644
  "additionalProperties": false
645
645
  },
646
- "entities": {
647
- "type": "object",
648
- "description": "App-level entity type registry (ADR-059). Keyed by entity type name; each key must equal its definition's moduleName / getName(). Registered types can be connected without any integration. Entity types bound by declared integrations are inferred and merged unless $infer is false.",
649
- "properties": {
650
- "$infer": {
651
- "type": "boolean",
652
- "default": true,
653
- "description": "false turns inference off: every module an integration binds must then be registered here, or the app fails to load."
654
- }
655
- },
656
- "additionalProperties": {
657
- "type": "object",
658
- "description": "One entity type: its module definition plus app-level settings.",
659
- "required": ["definition"],
660
- "properties": {
661
- "definition": {
662
- "type": "object",
663
- "description": "The API module definition (the object an integration binds as modules.<key>.definition)."
664
- },
665
- "scope": {
666
- "description": "Who owns entities of this type (ADR-056): one scope, or a default plus the scopes callers may choose.",
667
- "oneOf": [
668
- { "type": "string", "enum": ["individual", "organization", "global"] },
669
- {
670
- "type": "object",
671
- "properties": {
672
- "default": { "type": "string", "enum": ["individual", "organization", "global"] },
673
- "allow": {
674
- "type": "array",
675
- "items": { "type": "string", "enum": ["individual", "organization", "global"] },
676
- "minItems": 1,
677
- "uniqueItems": true
678
- }
679
- },
680
- "additionalProperties": false
681
- }
682
- ]
683
- },
684
- "proxy": {
685
- "type": "object",
686
- "description": "Per-type entity proxy allow-list override (ADR-052)."
687
- },
688
- "display": {
689
- "type": "object",
690
- "description": "Label, icon and description shown by UIs and GET /api/v2/entity-types."
691
- }
692
- },
693
- "additionalProperties": false
694
- }
695
- },
696
- "managementApi": {
697
- "type": "object",
698
- "description": "Management API settings (ADR-053 versioning, ADR-052 entity proxy).",
699
- "properties": {
700
- "v1": {
701
- "type": "boolean",
702
- "default": true,
703
- "description": "Serve the deprecated v1 routes (unprefixed /api/*). false removes them from the router and from the generated API Gateway routes."
704
- },
705
- "proxy": {
706
- "type": "object",
707
- "description": "Entity proxy, POST /api/v2/entities/:id/proxy (ADR-052). Off by default.",
708
- "properties": {
709
- "enable": {
710
- "type": "boolean",
711
- "default": false,
712
- "description": "Mount the entity proxy route and advertise the entityProxy capability."
713
- },
714
- "timeoutMs": {
715
- "type": "integer",
716
- "minimum": 1,
717
- "maximum": 25000,
718
- "default": 25000,
719
- "description": "Upstream timeout for one proxied call, in milliseconds (can only be lowered)."
720
- },
721
- "maxRequestBytes": {
722
- "type": "integer",
723
- "minimum": 1,
724
- "maximum": 10485760,
725
- "default": 1048576,
726
- "description": "Largest proxied request body, in bytes."
727
- },
728
- "maxResponseBytes": {
729
- "type": "integer",
730
- "minimum": 1,
731
- "maximum": 5242880,
732
- "default": 5242880,
733
- "description": "Largest proxied response body, in bytes (can only be lowered)."
734
- },
735
- "modules": {
736
- "type": "object",
737
- "description": "Per-module allow-list override, keyed by module name. 'module' uses the module's own proxy.allow list.",
738
- "additionalProperties": {
739
- "type": "object",
740
- "properties": {
741
- "allow": {
742
- "oneOf": [
743
- {
744
- "type": "string",
745
- "enum": [
746
- "module"
747
- ]
748
- },
749
- {
750
- "type": "array",
751
- "items": {
752
- "type": "object",
753
- "required": [
754
- "method",
755
- "path"
756
- ],
757
- "properties": {
758
- "method": {
759
- "type": "string",
760
- "enum": [
761
- "GET",
762
- "POST",
763
- "PUT",
764
- "PATCH",
765
- "DELETE",
766
- "*"
767
- ],
768
- "description": "HTTP method, or * for any (app definition only; frigg validate warns)"
769
- },
770
- "path": {
771
- "type": "string",
772
- "pattern": "^/",
773
- "description": "Path pattern relative to the module's base URL. `:param` matches one segment; a trailing `/**` matches a subtree."
774
- }
775
- },
776
- "additionalProperties": false
777
- }
778
- }
779
- ]
780
- }
781
- },
782
- "additionalProperties": false
783
- }
784
- }
785
- },
786
- "additionalProperties": false
787
- }
788
- },
789
- "additionalProperties": false
790
- },
791
646
  "custom": {
792
647
  "type": "object",
793
648
  "description": "Custom application-specific configuration",