initiative-plugin-sdk 10.0.0 → 10.1.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.
@@ -233,6 +233,24 @@
233
233
  "$ref": "#/$defs/page"
234
234
  }
235
235
  },
236
+ "sign_in": {
237
+ "type": "object",
238
+ "required": [
239
+ "page",
240
+ "return_path"
241
+ ],
242
+ "properties": {
243
+ "page": {
244
+ "$ref": "#/$defs/identifier",
245
+ "description": "The id of one of this plug-in's pages: the page somebody lands in after signing in at the plug-in's own address. Who may open it is decided as for that page inside Initiative, so somebody signs in only to a place where they could open it there."
246
+ },
247
+ "return_path": {
248
+ "$ref": "#/$defs/path",
249
+ "description": "Where Initiative sends somebody back with an authorization code: this path on the origin the deployment serves the plug-in's pages from. Matched exactly."
250
+ }
251
+ },
252
+ "description": "Sign in with Initiative: people may also open the plug-in at its own address, full-window, signing in with their Initiative account through OpenID Connect's authorization code flow. The ID token carries what the page handoff carries for the place they chose, and renews against Initiative. Needs 'pages'. Absent: the plug-in's pages open only inside Initiative."
253
+ },
236
254
  "dashboards": {
237
255
  "type": "array",
238
256
  "maxItems": 8,
@@ -273,6 +291,14 @@
273
291
  },
274
292
  "description": "Values the community's admins set on the install, which the plug-in's expressions and its parts' text read. At most 16."
275
293
  },
294
+ "permissions": {
295
+ "type": "array",
296
+ "maxItems": 16,
297
+ "items": {
298
+ "$ref": "#/$defs/permission"
299
+ },
300
+ "description": "What the community decides who may do with this plug-in, at most 16. Every page, field, part, action and endpoint answers to one: the one it names, or 'use' at its level. Absent: 'use' alone, at each level, which inside an initiative members start without."
301
+ },
276
302
  "help": {
277
303
  "type": "object",
278
304
  "minProperties": 1,
@@ -403,7 +429,7 @@
403
429
  "managed": {
404
430
  "type": "boolean",
405
431
  "default": false,
406
- "description": "Returned by the plug-in's after_connect hook when a flow finishes; it is not typed into the settings form."
432
+ "description": "Returned by the plug-in's after_connect hook, when a flow finishes or when an admin saves a connection that declares 'after_connect'; it is not typed into the settings form."
407
433
  }
408
434
  },
409
435
  "if": {
@@ -726,12 +752,17 @@
726
752
  "items": {
727
753
  "$ref": "#/$defs/connectionField"
728
754
  },
729
- "description": "Without a 'flow', what an admin types. With one, only the values the plug-in's after_connect hook returns, and every field is 'managed'. The tokens a flow obtains are held apart from these, under reserved keys the plug-in never declares."
755
+ "description": "Without a 'flow', what an admin types, and the managed values its 'after_connect' returns. With one, only the values the plug-in's after_connect hook returns, and every field is 'managed'. The tokens a flow obtains are held apart from these, under reserved keys the plug-in never declares."
730
756
  },
731
757
  "flow": {
732
758
  "$ref": "#/$defs/connectionFlow",
733
759
  "description": "How the connection is established. Initiative runs it: the redirect, the code exchange, refreshing and revoking. The plug-in never holds the vendor client's secret or a refresh token."
734
760
  },
761
+ "after_connect": {
762
+ "type": "boolean",
763
+ "default": false,
764
+ "description": "Static connections without a 'flow', container plug-ins only. True: when an admin saves the connection, Initiative sends what they typed to the plug-in's after_connect hook before storing anything, and stores it with the managed values and account label the hook answers; when the hook refuses, nothing is stored. When the connection is cleared or replaced, Initiative sends the plug-in's revoke hook with the values it held, so it can remove what it made at the vendor."
765
+ },
735
766
  "token": {
736
767
  "$ref": "#/$defs/connectionToken",
737
768
  "description": "How a usable access token is got for this connection. Absent: the tokens the flow stored, refreshed as needed. Static connections only."
@@ -903,7 +934,7 @@
903
934
  },
904
935
  "webhooks": {
905
936
  "type": "object",
906
- "description": "The vendor's webhooks, received by Initiative at one address per plug-in on the deployment, '/api/v1/plugin-hooks/<public_id>'. Initiative checks each delivery's signature, drops one it has already delivered, finds the communities it belongs to by a value in its body, and forwards it to the plug-in's webhook hook once for each. A container plug-in's hook receives each delivery; a declarative plug-in maps it with 'events' and 'status' instead.",
937
+ "description": "The vendor's webhooks, received by Initiative at one address per plug-in on the deployment, '/api/v1/plugin-hooks/<public_id>'. Initiative checks each delivery's signature, drops one it has already delivered, by its id or its body, finds the communities it belongs to by a value in its body, and forwards it to the plug-in's webhook hook once for each. A container plug-in's hook receives each delivery; a declarative plug-in maps it with 'events' and 'status' instead.",
907
938
  "required": [
908
939
  "verify",
909
940
  "dedup",
@@ -918,7 +949,7 @@
918
949
  "minLength": 1,
919
950
  "maxLength": 64,
920
951
  "pattern": "^[\\-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]+$",
921
- "description": "The header carrying the vendor's id for one delivery, such as 'X-GitHub-Delivery'. A delivery with an id already forwarded to a community is not forwarded to it again."
952
+ "description": "The header carrying the vendor's id for one delivery, such as 'X-GitHub-Delivery'. A delivery with an id already forwarded to a community, or with the body of one, is not forwarded to it again."
922
953
  },
923
954
  "route": {
924
955
  "$ref": "#/$defs/webhookRoute"
@@ -945,7 +976,7 @@
945
976
  },
946
977
  "webhookVerify": {
947
978
  "type": "object",
948
- "description": "How a delivery's signature is checked: an HMAC over the raw body under a vendor value.",
979
+ "description": "How a delivery's signature is checked: an HMAC over the raw body, under a vendor value or under the routed connection's own secret.",
949
980
  "required": [
950
981
  "scheme",
951
982
  "header",
@@ -982,7 +1013,7 @@
982
1013
  "type": "string",
983
1014
  "minLength": 1,
984
1015
  "maxLength": 300,
985
- "description": "The signing secret, as one vendor value: '{vendor.<key>}'."
1016
+ "description": "The signing secret: one vendor value, written '{vendor.<key>}', which signs every community's deliveries; or a managed 'secret' field of the connection 'route' names, written '{<key>}', which that connection's after_connect hook returned. With a connection's secret, a delivery is routed first and checked under the secret of each connection its route value names; one that none of them verifies is refused."
986
1017
  }
987
1018
  }
988
1019
  },
@@ -1123,10 +1154,9 @@
1123
1154
  },
1124
1155
  "description": "Whose credential the call runs on, best first. Read and write only. An endpoint offering only 'member' refuses when that member has connected nothing, rather than quietly acting as the plug-in instead."
1125
1156
  },
1126
- "admin_only": {
1127
- "type": "boolean",
1128
- "default": false,
1129
- "description": "Only the community's admins read or call this endpoint — a figure for the community's settings page, say. Anyone who can see where it is used may otherwise."
1157
+ "permission": {
1158
+ "$ref": "#/$defs/identifier",
1159
+ "description": "Read and write only. The initiative permission a reader holds, in the initiative it is read in, to read or call this through a widget, an action or a form: one this manifest declares at the initiative level, or 'use'. Absent: whoever can see where it is used. Another plug-in calling it for a member is held to that member's permission, the one named or 'use', where its token is confined to an initiative or else in one this plug-in is placed in; one calling it as the community, to what the community granted it."
1130
1160
  },
1131
1161
  "public": {
1132
1162
  "type": "boolean",
@@ -1250,10 +1280,9 @@
1250
1280
  ],
1251
1281
  "description": "Where the page renders. Declaring both gives it a community-wide entry and an entry inside each initiative."
1252
1282
  },
1253
- "admin_only": {
1254
- "type": "boolean",
1255
- "default": false,
1256
- "description": "Only the community's admins open this page, whatever roles a placement allows — a settings page, say. Who else may open a page is chosen in the community, per initiative and per role, not declared here."
1283
+ "permission": {
1284
+ "$ref": "#/$defs/identifier",
1285
+ "description": "The permission that opens it, at each level it renders in: one this manifest declares at that level, or 'use'. Absent: 'use'. Who holds it is the community's to decide, never the plug-in's."
1257
1286
  },
1258
1287
  "capabilities": {
1259
1288
  "type": "array",
@@ -1390,6 +1419,10 @@
1390
1419
  },
1391
1420
  "description": "Declarative plug-ins, on a list field: actions offered on each of its elements, by id, each one offered on every item kind this field is. An action run from an element reads that element's 'ref' as 'element'."
1392
1421
  },
1422
+ "permission": {
1423
+ "$ref": "#/$defs/identifier",
1424
+ "description": "The initiative permission a reader holds to see it: one this manifest declares at the initiative level, or 'use'. Absent: 'use'."
1425
+ },
1393
1426
  "requires": {
1394
1427
  "$ref": "#/$defs/requires"
1395
1428
  }
@@ -1802,6 +1835,10 @@
1802
1835
  "$ref": "#/$defs/localizedText",
1803
1836
  "description": "The one line the view editor's Add picker shows beside the name."
1804
1837
  },
1838
+ "permission": {
1839
+ "$ref": "#/$defs/identifier",
1840
+ "description": "The initiative permission a reader holds to see it: one this manifest declares at the initiative level, or 'use'. Absent: 'use'."
1841
+ },
1805
1842
  "requires": {
1806
1843
  "$ref": "#/$defs/requires"
1807
1844
  }
@@ -1866,16 +1903,63 @@
1866
1903
  "default": false,
1867
1904
  "description": "Also offered in the item's own menu."
1868
1905
  },
1869
- "admin_only": {
1870
- "type": "boolean",
1871
- "default": false,
1872
- "description": "Only the community's admins run this action, whatever roles a placement allows. Who else may run it is chosen in the community, per initiative and per role, not declared here."
1906
+ "permission": {
1907
+ "$ref": "#/$defs/identifier",
1908
+ "description": "The initiative permission a reader holds to run it: one this manifest declares at the initiative level, or 'use'. Absent: 'use'."
1873
1909
  },
1874
1910
  "requires": {
1875
1911
  "$ref": "#/$defs/requires"
1876
1912
  }
1877
1913
  }
1878
1914
  },
1915
+ "permission": {
1916
+ "type": "object",
1917
+ "description": "Something the community decides who may do with the plug-in, at one level. Inside an initiative, its roles hold it as they hold a tool's permissions, and its managers and the community's admins always do. At the community level, its admins hold it as they hold the parts of administering the community, and a custom role on the admin rung keeps some of them. The plug-in names a permission and says whether members start with it; who holds it is the community's to decide.",
1918
+ "required": [
1919
+ "id",
1920
+ "name",
1921
+ "level"
1922
+ ],
1923
+ "properties": {
1924
+ "id": {
1925
+ "$ref": "#/$defs/identifier",
1926
+ "description": "Unique among this manifest's permissions of its level. 'use' is every plug-in's at each level, declared or not: declaring it names it, and inside an initiative says whether members start with it."
1927
+ },
1928
+ "name": {
1929
+ "$ref": "#/$defs/localizedText",
1930
+ "description": "What the community's role pages call it."
1931
+ },
1932
+ "level": {
1933
+ "enum": [
1934
+ "community",
1935
+ "initiative"
1936
+ ],
1937
+ "description": "Where it is held: 'initiative' by an initiative's roles, 'community' by the community's admins."
1938
+ },
1939
+ "members": {
1940
+ "type": "boolean",
1941
+ "default": false,
1942
+ "description": "An initiative permission's only: whether a role holds it where nobody in the community said otherwise. Absent: only the roles the community chooses."
1943
+ }
1944
+ },
1945
+ "if": {
1946
+ "properties": {
1947
+ "level": {
1948
+ "const": "community"
1949
+ }
1950
+ },
1951
+ "required": [
1952
+ "level"
1953
+ ]
1954
+ },
1955
+ "then": {
1956
+ "properties": {
1957
+ "members": {
1958
+ "const": false
1959
+ }
1960
+ }
1961
+ }
1962
+ },
1879
1963
  "change": {
1880
1964
  "type": "object",
1881
1965
  "description": "A change to the plug-in's values on one item or on its install, as a declarative plug-in's 'write' answers it. 'set' writes values by key, as a container's client.metadata.set does; 'upsert' and 'remove' change a list field's elements by their 'ref'. A change gives at least one of the three, and changes each key with only one. Initiative makes it as the install, and holds what is kept to the caps a field's description gives.",
@@ -2428,7 +2512,7 @@
2428
2512
  "$ref": "#/$defs/actorConnections"
2429
2513
  }
2430
2514
  ],
2431
- "description": "Which connection's credential the request carries: one connection for every call, or, on a write endpoint's requests, one per actor ('actorConnections'), so a call made as the member carries the member's own credential and one made as the installation the community's. A static connection's credential is the community's, an interactive one's the acting member's, which a call made as the installation does not have. A call made as a member carries a static connection's credential only when the endpoint's 'requires' names that connection, and is refused otherwise. Required on an endpoint's requests. Absent on 'after_connect' and 'health', which carry the credential of the connection they belong to."
2515
+ "description": "Which connection's credential the request carries: one connection for every call, or one per actor ('actorConnections'), so a call made as the member carries the member's own credential and one made as the installation the community's. A static connection's credential is the community's, an interactive one's the acting member's, which a call made as the installation does not have. A call made as a member carries a static connection's credential only when the endpoint's 'requires' names that connection, and is refused otherwise. Required on an endpoint's requests. Absent on 'after_connect' and 'health', which carry the credential of the connection they belong to."
2432
2516
  },
2433
2517
  "paging": {
2434
2518
  "$ref": "#/$defs/paging"
@@ -2458,7 +2542,7 @@
2458
2542
  },
2459
2543
  "actorConnections": {
2460
2544
  "type": "object",
2461
- "description": "One connection per actor, on a write endpoint's requests: a call carries the credential of the connection named for the actor it is made as. Names exactly the actors the endpoint's 'actors' declare. The member's connection need not be named in 'requires': a call made as the member requires the connection its requests name for the member.",
2545
+ "description": "One connection per actor, on a read or write endpoint's requests: a call carries the credential of the connection named for the actor it is made as. Names exactly the actors the endpoint's 'actors' declare. The member's connection need not be named in 'requires': a call made as the member requires the connection its requests name for the member.",
2462
2546
  "minProperties": 1,
2463
2547
  "properties": {
2464
2548
  "member": {