@friggframework/schemas 2.0.0--canary.707.df80bfd.0 → 2.0.0--canary.680.d670696.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.707.df80bfd.0",
3
+ "version": "2.0.0--canary.680.d670696.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": "df80bfd35bba914a7b20184bd2d5aa88f9f406ff"
44
+ "gitHead": "d6706963c56674519299fca904c380268b721911"
45
45
  }
@@ -173,11 +173,6 @@
173
173
  "default": 1,
174
174
  "description": "Current step number for multi-step flows"
175
175
  },
176
- "scope": {
177
- "type": "string",
178
- "enum": ["individual", "organization"],
179
- "description": "The scope to connect at, from the entity type's allow list (ADR-056 §3.1). Omit to take the type's default. global is refused."
180
- },
181
176
  "sessionId": {
182
177
  "type": "string",
183
178
  "description": "Session ID from previous step (required for step > 1)"
@@ -29,32 +29,10 @@
29
29
  "type": "boolean",
30
30
  "description": "Whether the authentication is currently valid"
31
31
  },
32
- "scope": {
33
- "type": "string",
34
- "enum": ["individual", "organization"],
35
- "description": "Whose the credential is (ADR-056 §3.4), from who owns the credential. `global` ones are not listed to tenants."
36
- },
37
- "owner": {
38
- "type": "object",
39
- "properties": {
40
- "type": { "type": "string", "enum": ["individual", "organization"] },
41
- "id": { "type": "string" }
42
- },
43
- "description": "The user that owns it: the person, or the organization's user"
44
- },
45
- "organizationId": {
46
- "type": ["string", "null"],
47
- "description": "The organization it belongs to. Null for an individual credential connected outside an organization, or under ownership.individualAcross 'all'."
48
- },
49
- "access": {
50
- "type": "string",
51
- "enum": ["manage", "use", "view"],
52
- "description": "What the caller may do: manage (reauthorize, delete) or use. A member only uses an organization's credential."
53
- },
54
32
  "entityCount": {
55
33
  "type": "integer",
56
34
  "minimum": 0,
57
- "description": "Number of entities using this credential that the caller may see"
35
+ "description": "Number of entities using this credential"
58
36
  },
59
37
  "createdAt": {
60
38
  "type": "string",
@@ -37,28 +37,6 @@
37
37
  "type": "boolean",
38
38
  "description": "Whether authentication is currently valid"
39
39
  },
40
- "scope": {
41
- "type": "string",
42
- "enum": ["individual", "organization"],
43
- "description": "Whose the entity is (ADR-056 §3.4). `global` ones are not listed to tenants."
44
- },
45
- "owner": {
46
- "type": "object",
47
- "properties": {
48
- "type": { "type": "string", "enum": ["individual", "organization"] },
49
- "id": { "type": "string" }
50
- },
51
- "description": "The user that owns it: the person, or the organization's user"
52
- },
53
- "organizationId": {
54
- "type": ["string", "null"],
55
- "description": "The organization it belongs to. Null for an individual entity connected outside an organization, or under ownership.individualAcross 'all'."
56
- },
57
- "access": {
58
- "type": "string",
59
- "enum": ["manage", "use", "view"],
60
- "description": "What the caller may do: manage (create, reauthorize, delete), use (bind it, proxy through it) or view (metadata only)"
61
- },
62
40
  "createdAt": {
63
41
  "type": "string",
64
42
  "format": "date-time",
@@ -169,15 +147,6 @@
169
147
  "type": "string"
170
148
  },
171
149
  "description": "List of capabilities this entity type supports"
172
- },
173
- "scope": {
174
- "type": "object",
175
- "description": "The scope a new connection of this type gets and the scopes a request may choose (ADR-056 §3.1). global is never offered.",
176
- "properties": {
177
- "default": { "type": "string", "enum": ["individual", "organization", "global"] },
178
- "allow": { "type": "array", "items": { "type": "string", "enum": ["individual", "organization"] } },
179
- "source": { "type": "string", "enum": ["binding", "integration", "entityType", "app", "default"] }
180
- }
181
150
  }
182
151
  }
183
152
  },
@@ -106,12 +106,7 @@
106
106
  "required": ["method", "path"],
107
107
  "properties": {
108
108
  "method": { "type": "string", "enum": ["GET", "POST", "PUT", "PATCH", "DELETE"] },
109
- "path": { "type": "string", "pattern": "^/" },
110
- "base": {
111
- "type": "string",
112
- "pattern": "^[a-z][a-z0-9-]*$",
113
- "description": "Which of the module's named bases (baseUrls) the rule applies to. Default 'default'. Must be declared by the module (checked at load)."
114
- }
109
+ "path": { "type": "string", "pattern": "^/" }
115
110
  },
116
111
  "additionalProperties": false
117
112
  }
@@ -122,23 +117,15 @@
122
117
  "items": { "type": "string" }
123
118
  },
124
119
  "baseUrl": {
125
- "description": "Proxy base URL (https). A string, or a function of the Api instance for tenant hosts. Means { default: baseUrl }. Defaults to the Api's baseUrl. Declare this or baseUrls, not both.",
120
+ "description": "Proxy base URL (https). A string, or a function of the Api instance for tenant hosts. Defaults to the Api's baseUrl.",
126
121
  "type": ["string", "object"]
127
122
  },
128
- "baseUrls": {
129
- "type": "object",
130
- "description": "Named proxy base URLs for a module whose API spans several hosts (ADR-052, amendment 1). The proxy request names one in `base`; omitted means 'default'. Strings only, absolute https URLs with no credentials, query or fragment (checked at load). Declare this or baseUrl, not both.",
131
- "minProperties": 1,
132
- "propertyNames": { "pattern": "^[a-z][a-z0-9-]*$" },
133
- "additionalProperties": { "type": "string", "pattern": "^https://" }
134
- },
135
123
  "binary": {
136
124
  "type": "boolean",
137
125
  "default": false,
138
126
  "description": "Return binary upstream bodies base64-encoded instead of refusing them (415)"
139
127
  }
140
128
  },
141
- "not": { "required": ["baseUrl", "baseUrls"] },
142
129
  "additionalProperties": false
143
130
  },
144
131
  "env": {
@@ -20,11 +20,6 @@
20
20
  "pattern": "^/",
21
21
  "minLength": 1
22
22
  },
23
- "base": {
24
- "type": "string",
25
- "pattern": "^[a-z][a-z0-9-]*$",
26
- "description": "Name of one of the module's base URLs (ADR-052 amendment); 'default' when omitted. A name the module declares in proxy.baseUrls, never a URL or host. An unknown name is 400 PROXY_UNKNOWN_BASE; a value that is not shaped like a name is 400 INVALID_PROXY_REQUEST."
27
- },
28
23
  "query": {
29
24
  "type": "object",
30
25
  "description": "Query parameters to include in the request as key-value pairs",
@@ -182,7 +177,6 @@
182
177
  "enum": [
183
178
  "INVALID_PROXY_REQUEST",
184
179
  "PROXY_NOT_ALLOWED",
185
- "PROXY_UNKNOWN_BASE",
186
180
  "PROXY_NOT_CONFIGURED",
187
181
  "PAYLOAD_TOO_LARGE",
188
182
  "UNSUPPORTED_MEDIA_TYPE",
@@ -16,8 +16,8 @@
16
16
  },
17
17
  "provider": {
18
18
  "type": "string",
19
- "description": "Deployment provider. Determines which @friggframework/provider-{name} package handles config generation and deploy. Built-in providers: 'aws' (default, serverless/Lambda), 'netlify' (Netlify Functions).",
20
- "enum": ["aws", "netlify"],
19
+ "description": "Cloud provider for deployment",
20
+ "enum": ["aws"],
21
21
  "default": "aws"
22
22
  },
23
23
  "label": {
@@ -105,28 +105,6 @@
105
105
  "description": "Require organization user for authentication",
106
106
  "default": false
107
107
  },
108
- "strictMembership": {
109
- "type": "boolean",
110
- "description": "Reject x-frigg headers that name an organization the person is not already a member of, instead of adding the membership (ADR-056 §3.6). Turn on once entities and integrations are scoped by organization and your app manages membership itself.",
111
- "default": false
112
- },
113
- "strictUserValidation": {
114
- "type": "boolean",
115
- "description": "DEPRECATED alias of strictMembership; its meaning changed.",
116
- "default": false
117
- },
118
- "orgAdminRoles": {
119
- "type": "array",
120
- "description": "Organization roles that may manage organization-level things: connect or delete an organization-level account, re-authorize or delete its credential, create, change or delete an organization-owned integration (ADR-056 §3). The role is the adopter token's role claim; when the token carries none, the role stored on the caller's membership of the active organization (OrganizationMembership.orgRole); when there is none, MEMBER, never admin. A shared-secret (x-frigg header) caller needs no role, and so does a Frigg bearer token unless orgAdminGateBearerTokens is true. Compared case-insensitively.",
121
- "items": { "type": "string", "minLength": 1 },
122
- "minItems": 1,
123
- "default": ["ADMIN"]
124
- },
125
- "orgAdminGateBearerTokens": {
126
- "type": "boolean",
127
- "description": "Judge Frigg bearer-token callers (/user/login) by organization role like adopter-token callers. Default false: a bearer token carries no role and keeps its behaviour from before organization roles, so it may manage the organization it acts in.",
128
- "default": false
129
- },
130
108
  "authModes": {
131
109
  "type": "object",
132
110
  "description": "Authentication mode configuration - enables multiple authentication strategies. x-frigg-appUserId and x-frigg-appOrgId headers are automatically supported for user identification with any auth mode.",
@@ -151,72 +129,30 @@
151
129
  },
152
130
  "jwtConfig": {
153
131
  "type": "object",
154
- "description": "Adopter token (JWT) verification for authModes.adopterJwt. Set exactly one of jwksUri (asymmetric keys, rotating) or secret (HMAC). With jwksUri, audience is required and issuer should be set.",
132
+ "description": "JWT configuration for adopter JWT authentication mode (when authModes.adopterJwt is true)",
155
133
  "properties": {
156
- "jwksUri": {
157
- "type": "string",
158
- "format": "uri",
159
- "description": "URL of the issuer's JWKS (https; http only for localhost, 127.0.0.0/8 or ::1). Keys are fetched, cached and rotated per process."
160
- },
161
134
  "secret": {
162
135
  "type": "string",
163
- "description": "Shared HMAC secret for HS* tokens (set via an environment variable, never in source)"
164
- },
165
- "issuer": {
166
- "type": "string",
167
- "description": "Required iss claim. Not checked when omitted; with jwksUri a startup warning is logged when it is unset."
168
- },
169
- "audience": {
170
- "description": "Accepted aud claim value(s). Required with jwksUri; optional (not checked when omitted) with secret.",
171
- "oneOf": [
172
- { "type": "string" },
173
- { "type": "array", "items": { "type": "string" }, "minItems": 1 }
174
- ]
175
- },
176
- "algorithms": {
177
- "type": "array",
178
- "description": "Allowed signing algorithms. Defaults to ES256 and RS256 with jwksUri, HS256 with secret. HS* only with secret, never with jwksUri.",
179
- "items": {
180
- "type": "string",
181
- "enum": ["ES256", "ES384", "RS256", "RS384", "RS512", "HS256", "HS384", "HS512"]
182
- },
183
- "minItems": 1
184
- },
185
- "algorithm": {
186
- "type": "string",
187
- "description": "Deprecated alias for a one-item algorithms list. Setting both algorithm and algorithms is an error.",
188
- "enum": ["ES256", "ES384", "RS256", "RS384", "RS512", "HS256", "HS384", "HS512"]
189
- },
190
- "clockToleranceSec": {
191
- "type": "integer",
192
- "minimum": 0,
193
- "description": "Clock skew allowed on exp and nbf, in seconds",
194
- "default": 30
136
+ "description": "JWT secret key for signature validation (should be set via environment variable)"
195
137
  },
196
138
  "userIdClaim": {
197
139
  "type": "string",
198
- "description": "JWT claim name containing the app user ID",
140
+ "description": "JWT claim name containing the user ID",
199
141
  "default": "sub"
200
142
  },
201
143
  "orgIdClaim": {
202
144
  "type": "string",
203
- "description": "JWT claim name containing the app organization ID",
145
+ "description": "JWT claim name containing the organization ID",
204
146
  "default": "org_id"
205
147
  },
206
- "roleClaim": {
148
+ "algorithm": {
207
149
  "type": "string",
208
- "description": "JWT claim name containing the organization role. Read and exposed on the authenticated user; not stored yet.",
209
- "default": "org_role"
150
+ "description": "JWT signing algorithm",
151
+ "enum": ["HS256", "HS384", "HS512", "RS256", "RS384", "RS512"],
152
+ "default": "HS256"
210
153
  }
211
154
  },
212
- "oneOf": [
213
- { "required": ["secret"] },
214
- { "required": ["jwksUri"] }
215
- ],
216
- "dependencies": {
217
- "jwksUri": ["audience"]
218
- },
219
- "not": { "required": ["algorithm", "algorithms"] },
155
+ "required": ["secret"],
220
156
  "additionalProperties": false
221
157
  },
222
158
  "fields": {
@@ -757,38 +693,6 @@
757
693
  "additionalProperties": false
758
694
  }
759
695
  },
760
- "ownership": {
761
- "type": "object",
762
- "description": "Who owns what a person connects (ADR-056 §3). `scope` is the app-level default for any entity type or integration binding that sets none; the order is request, binding, integration, entity type, app, then `organization` for an organization-primary app and `individual` otherwise.",
763
- "properties": {
764
- "scope": {
765
- "description": "One scope, or a default plus the scopes a request may choose from.",
766
- "oneOf": [
767
- { "type": "string", "enum": ["individual", "organization", "global"] },
768
- {
769
- "type": "object",
770
- "properties": {
771
- "default": { "type": "string", "enum": ["individual", "organization", "global"] },
772
- "allow": {
773
- "type": "array",
774
- "items": { "type": "string", "enum": ["individual", "organization", "global"] },
775
- "minItems": 1,
776
- "uniqueItems": true
777
- }
778
- },
779
- "additionalProperties": false
780
- }
781
- ]
782
- },
783
- "individualAcross": {
784
- "type": "string",
785
- "enum": ["organization", "all"],
786
- "default": "organization",
787
- "description": "`organization` (default): an individual entity belongs to the organization it was connected in and is not visible in another. `all`: one connection per person across every organization they belong to, stored with no organizationId."
788
- }
789
- },
790
- "additionalProperties": false
791
- },
792
696
  "managementApi": {
793
697
  "type": "object",
794
698
  "description": "Management API settings (ADR-053 versioning, ADR-052 entity proxy).",
@@ -828,22 +732,6 @@
828
732
  "default": 5242880,
829
733
  "description": "Largest proxied response body, in bytes (can only be lowered)."
830
734
  },
831
- "scopes": {
832
- "type": "array",
833
- "minItems": 1,
834
- "uniqueItems": true,
835
- "items": {
836
- "type": "string",
837
- "enum": [
838
- "individual",
839
- "organization"
840
- ]
841
- },
842
- "default": [
843
- "individual"
844
- ],
845
- "description": "Entity scopes the proxy accepts (ADR-056 §3.5). Narrowest by default: proxying through an organization entity lets any member with use access act on the organization's account, so an app opts in to 'organization' explicitly. 'global' is never accepted."
846
- },
847
735
  "modules": {
848
736
  "type": "object",
849
737
  "description": "Per-module allow-list override, keyed by module name. 'module' uses the module's own proxy.allow list.",
@@ -883,11 +771,6 @@
883
771
  "type": "string",
884
772
  "pattern": "^/",
885
773
  "description": "Path pattern relative to the module's base URL. `:param` matches one segment; a trailing `/**` matches a subtree."
886
- },
887
- "base": {
888
- "type": "string",
889
- "pattern": "^[a-z][a-z0-9-]*$",
890
- "description": "Which of the module's named bases the rule applies to. Default 'default'. A base the module does not declare stops the app at load."
891
774
  }
892
775
  },
893
776
  "additionalProperties": false
@@ -938,74 +821,6 @@
938
821
  }
939
822
  },
940
823
  "additionalProperties": true
941
- },
942
- "extensions": {
943
- "type": "object",
944
- "description": "ADR-017 Core Extensions: a keyed object { <binding>: { extension, config } }. Reserved for that design; the core extension loader does not read it. The array of { name, schema, encryption, routes, bootstrap } lives at coreExtensions, and an array here is rejected.",
945
- "additionalProperties": {
946
- "type": "object",
947
- "properties": {
948
- "extension": {},
949
- "config": { "type": "object" }
950
- },
951
- "required": ["extension"]
952
- }
953
- },
954
- "coreExtensions": {
955
- "type": "array",
956
- "description": "Core extensions that add custom Prisma models, encrypted fields, admin routes, and bootstrap lifecycle hooks to a Frigg app. Each extension can declare a schema fragment, encryption config, route handler, and bootstrap function. App-level; distinct from an integration's Definition.extensions (Tier 3 integration extensions) and from ADR-017's keyed appDefinition.extensions.",
957
- "items": {
958
- "type": "object",
959
- "required": ["name"],
960
- "properties": {
961
- "name": {
962
- "type": "string",
963
- "description": "Unique identifier for this extension",
964
- "minLength": 1,
965
- "examples": ["db-credentials", "audit-log"]
966
- },
967
- "schema": {
968
- "type": "string",
969
- "description": "Absolute path to a .prisma schema fragment. Models/enums from this file are composed into the main Prisma schema at build time.",
970
- "pattern": "\\.prisma$"
971
- },
972
- "encryption": {
973
- "type": "object",
974
- "description": "Encryption schema additions. Maps model names to arrays of field paths that should be encrypted at rest.",
975
- "patternProperties": {
976
- "^[A-Z][a-zA-Z0-9]*$": {
977
- "type": "object",
978
- "required": ["fields"],
979
- "properties": {
980
- "fields": {
981
- "type": "array",
982
- "items": { "type": "string" },
983
- "minItems": 1
984
- }
985
- },
986
- "additionalProperties": false
987
- }
988
- },
989
- "additionalProperties": false
990
- },
991
- "routes": {
992
- "type": "object",
993
- "description": "Express router to mount on the app. The handler factory receives (prisma, appDefinition) and returns an Express Router. Routes are protected by admin auth middleware.",
994
- "required": ["path"],
995
- "properties": {
996
- "path": {
997
- "type": "string",
998
- "description": "Base URL path for the extension routes. Admin routes live under /admin (never /api): /admin/<segment>[/<segment>...]. /admin/scripts, /admin/db-migrate and /admin/queue are reserved. Core's route registry turns the path into the API Gateway routes and netlify.toml redirects (auth function).",
999
- "pattern": "^/admin(/[A-Za-z0-9_-]+)+$",
1000
- "not": { "pattern": "^/admin/(scripts|db-migrate|queue)(/|$)" },
1001
- "examples": ["/admin/oauth-credentials"]
1002
- }
1003
- },
1004
- "additionalProperties": true
1005
- }
1006
- },
1007
- "additionalProperties": true
1008
- }
1009
824
  }
1010
825
  },
1011
826
  "additionalProperties": false,
@@ -263,62 +263,11 @@
263
263
  "definition": {
264
264
  "type": "object",
265
265
  "description": "The API module definition (e.g., from @friggframework/api-module-*)"
266
- },
267
- "scope": {
268
- "description": "The scope this binding accepts (ADR-056 §3.1): an entity bound here must have it. Overrides ownership.scope.",
269
- "oneOf": [
270
- { "type": "string", "enum": ["individual", "organization", "global"] },
271
- {
272
- "type": "object",
273
- "properties": {
274
- "default": { "type": "string", "enum": ["individual", "organization", "global"] },
275
- "allow": {
276
- "type": "array",
277
- "items": { "type": "string", "enum": ["individual", "organization", "global"] },
278
- "minItems": 1,
279
- "uniqueItems": true
280
- }
281
- },
282
- "additionalProperties": false
283
- }
284
- ]
285
266
  }
286
267
  },
287
268
  "additionalProperties": true
288
269
  }
289
270
  },
290
- "ownership": {
291
- "type": "object",
292
- "description": "Who owns this integration and what scope its bindings accept (ADR-056 §3.1, §3.3).",
293
- "properties": {
294
- "scope": {
295
- "description": "One scope, or a default plus the scopes a request may choose from.",
296
- "oneOf": [
297
- { "type": "string", "enum": ["individual", "organization", "global"] },
298
- {
299
- "type": "object",
300
- "properties": {
301
- "default": { "type": "string", "enum": ["individual", "organization", "global"] },
302
- "allow": {
303
- "type": "array",
304
- "items": { "type": "string", "enum": ["individual", "organization", "global"] },
305
- "minItems": 1,
306
- "uniqueItems": true
307
- }
308
- },
309
- "additionalProperties": false
310
- }
311
- ]
312
- },
313
- "owner": {
314
- "type": "string",
315
- "enum": ["derive", "individual", "organization"],
316
- "default": "derive",
317
- "description": "`derive` (default): the organization when every entity it uses is organization-scoped, otherwise the person. An organization-owned integration cannot bind an individual entity."
318
- }
319
- },
320
- "additionalProperties": false
321
- },
322
271
  "hasUserConfig": {
323
272
  "type": "boolean",
324
273
  "description": "Whether integration requires user-specific configuration",
@@ -336,22 +285,6 @@
336
285
  },
337
286
  "additionalProperties": true
338
287
  },
339
- "schedule": {
340
- "type": "object",
341
- "description": "How a host that ticks ONGOING_SYNC from a cron (provider-netlify's scheduled-sync) dispatches it for this integration. Applies to integrations that implement startOngoingSync.",
342
- "properties": {
343
- "scope": {
344
- "type": "string",
345
- "enum": ["class", "installation"],
346
- "default": "class",
347
- "description": "'class': one ONGOING_SYNC per integration class per tick, with no integration id (the handler finds its own installations). 'installation': one per ENABLED integration record, carrying data.integrationId so the worker hydrates that installation."
348
- },
349
- "isDue": {
350
- "description": "Optional function (integration, { now }) => boolean | Promise<boolean>, scope 'installation' only. Return true to dispatch that installation this tick; without it every installation is dispatched on every tick."
351
- }
352
- },
353
- "additionalProperties": false
354
- },
355
288
  "display": {
356
289
  "type": "object",
357
290
  "description": "Display properties for UI representation",