@friggframework/schemas 2.0.0--canary.681.2df9ef0.0 → 2.0.0--canary.683.f45da33.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.681.2df9ef0.0",
3
+ "version": "2.0.0--canary.683.f45da33.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": "2df9ef0d1e98841190c6a8136ff77c886ca9e629"
44
+ "gitHead": "f45da337e62262988666a166b3d721020dae9161"
45
45
  }
@@ -173,6 +173,11 @@
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
+ },
176
181
  "sessionId": {
177
182
  "type": "string",
178
183
  "description": "Session ID from previous step (required for step > 1)"
@@ -37,6 +37,28 @@
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
+ },
40
62
  "createdAt": {
41
63
  "type": "string",
42
64
  "format": "date-time",
@@ -122,6 +144,11 @@
122
144
  "type": "string",
123
145
  "description": "Description of the entity type"
124
146
  },
147
+ "usedBy": {
148
+ "type": "array",
149
+ "items": { "type": "string" },
150
+ "description": "Names of the integrations that bind this entity type; empty for a type registered only in appDefinition.entities"
151
+ },
125
152
  "authType": {
126
153
  "type": "string",
127
154
  "enum": ["oauth2", "form", "api-key", "basic"],
@@ -142,6 +169,15 @@
142
169
  "type": "string"
143
170
  },
144
171
  "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
+ }
145
181
  }
146
182
  }
147
183
  },
@@ -105,6 +105,23 @@
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 (the adopter token's role claim) 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). A token with no role claim is MEMBER, never admin. A shared-secret (x-frigg header) caller needs no role. Compared case-insensitively.",
121
+ "items": { "type": "string", "minLength": 1 },
122
+ "minItems": 1,
123
+ "default": ["ADMIN"]
124
+ },
108
125
  "authModes": {
109
126
  "type": "object",
110
127
  "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.",
@@ -685,6 +702,88 @@
685
702
  },
686
703
  "additionalProperties": false
687
704
  },
705
+ "entities": {
706
+ "type": "object",
707
+ "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.",
708
+ "properties": {
709
+ "$infer": {
710
+ "type": "boolean",
711
+ "default": true,
712
+ "description": "false turns inference off: every module an integration binds must then be registered here, or the app fails to load."
713
+ }
714
+ },
715
+ "additionalProperties": {
716
+ "type": "object",
717
+ "description": "One entity type: its module definition plus app-level settings.",
718
+ "required": ["definition"],
719
+ "properties": {
720
+ "definition": {
721
+ "type": "object",
722
+ "description": "The API module definition (the object an integration binds as modules.<key>.definition)."
723
+ },
724
+ "scope": {
725
+ "description": "Who owns entities of this type (ADR-056): one scope, or a default plus the scopes callers may choose.",
726
+ "oneOf": [
727
+ { "type": "string", "enum": ["individual", "organization", "global"] },
728
+ {
729
+ "type": "object",
730
+ "properties": {
731
+ "default": { "type": "string", "enum": ["individual", "organization", "global"] },
732
+ "allow": {
733
+ "type": "array",
734
+ "items": { "type": "string", "enum": ["individual", "organization", "global"] },
735
+ "minItems": 1,
736
+ "uniqueItems": true
737
+ }
738
+ },
739
+ "additionalProperties": false
740
+ }
741
+ ]
742
+ },
743
+ "proxy": {
744
+ "type": "object",
745
+ "description": "Per-type entity proxy allow-list override (ADR-052)."
746
+ },
747
+ "display": {
748
+ "type": "object",
749
+ "description": "Label, icon and description shown by UIs and GET /api/v2/entity-types."
750
+ }
751
+ },
752
+ "additionalProperties": false
753
+ }
754
+ },
755
+ "ownership": {
756
+ "type": "object",
757
+ "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.",
758
+ "properties": {
759
+ "scope": {
760
+ "description": "One scope, or a default plus the scopes a request may choose from.",
761
+ "oneOf": [
762
+ { "type": "string", "enum": ["individual", "organization", "global"] },
763
+ {
764
+ "type": "object",
765
+ "properties": {
766
+ "default": { "type": "string", "enum": ["individual", "organization", "global"] },
767
+ "allow": {
768
+ "type": "array",
769
+ "items": { "type": "string", "enum": ["individual", "organization", "global"] },
770
+ "minItems": 1,
771
+ "uniqueItems": true
772
+ }
773
+ },
774
+ "additionalProperties": false
775
+ }
776
+ ]
777
+ },
778
+ "individualAcross": {
779
+ "type": "string",
780
+ "enum": ["organization", "all"],
781
+ "default": "organization",
782
+ "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."
783
+ }
784
+ },
785
+ "additionalProperties": false
786
+ },
688
787
  "managementApi": {
689
788
  "type": "object",
690
789
  "description": "Management API settings (ADR-053 versioning, ADR-052 entity proxy).",
@@ -263,11 +263,62 @@
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
+ ]
266
285
  }
267
286
  },
268
287
  "additionalProperties": true
269
288
  }
270
289
  },
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
+ },
271
322
  "hasUserConfig": {
272
323
  "type": "boolean",
273
324
  "description": "Whether integration requires user-specific configuration",