initiative-plugin-sdk 10.0.1 → 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.
@@ -248,6 +248,7 @@
248
248
  "fields": 32,
249
249
  "parts": 16,
250
250
  "actions": 16,
251
+ "permissions": 16,
251
252
  "partNodes": 50,
252
253
  "partDepth": 4,
253
254
  "facetsPerField": 4,
@@ -426,7 +427,7 @@
426
427
  "managed": {
427
428
  "type": "boolean",
428
429
  "default": false,
429
- "description": "Returned by the plug-in's after_connect hook when a flow finishes; it is not typed into the settings form."
430
+ "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."
430
431
  }
431
432
  },
432
433
  "if": {
@@ -721,12 +722,17 @@
721
722
  "items": {
722
723
  "ref": "connectionField"
723
724
  },
724
- "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."
725
+ "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."
725
726
  },
726
727
  "flow": {
727
728
  "ref": "connectionFlow",
728
729
  "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."
729
730
  },
731
+ "after_connect": {
732
+ "type": "boolean",
733
+ "default": false,
734
+ "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."
735
+ },
730
736
  "token": {
731
737
  "ref": "connectionToken",
732
738
  "description": "How a usable access token is got for this connection. Absent: the tokens the flow stored, refreshed as needed. Static connections only."
@@ -887,7 +893,7 @@
887
893
  },
888
894
  "webhooks": {
889
895
  "type": "object",
890
- "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.",
896
+ "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.",
891
897
  "required": [
892
898
  "verify",
893
899
  "dedup",
@@ -903,7 +909,7 @@
903
909
  "maxLength": "identifierLength",
904
910
  "patternFrom": "headerName",
905
911
  "patternForm": "plus",
906
- "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."
912
+ "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."
907
913
  },
908
914
  "route": {
909
915
  "ref": "webhookRoute"
@@ -930,7 +936,7 @@
930
936
  },
931
937
  "webhookVerify": {
932
938
  "type": "object",
933
- "description": "How a delivery's signature is checked: an HMAC over the raw body under a vendor value.",
939
+ "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.",
934
940
  "required": [
935
941
  "scheme",
936
942
  "header",
@@ -962,7 +968,7 @@
962
968
  "type": "string",
963
969
  "minLength": 1,
964
970
  "maxLength": "urlLength",
965
- "description": "The signing secret, as one vendor value: '{vendor.<key>}'."
971
+ "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."
966
972
  }
967
973
  }
968
974
  },
@@ -1103,10 +1109,9 @@
1103
1109
  },
1104
1110
  "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."
1105
1111
  },
1106
- "admin_only": {
1107
- "type": "boolean",
1108
- "default": false,
1109
- "description": "Only the community's admins read or call this endpoint \u2014 a figure for the community's settings page, say. Anyone who can see where it is used may otherwise."
1112
+ "permission": {
1113
+ "ref": "identifier",
1114
+ "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."
1110
1115
  },
1111
1116
  "public": {
1112
1117
  "type": "boolean",
@@ -1229,10 +1234,9 @@
1229
1234
  ],
1230
1235
  "description": "Where the page renders. Declaring both gives it a community-wide entry and an entry inside each initiative."
1231
1236
  },
1232
- "admin_only": {
1233
- "type": "boolean",
1234
- "default": false,
1235
- "description": "Only the community's admins open this page, whatever roles a placement allows \u2014 a settings page, say. Who else may open a page is chosen in the community, per initiative and per role, not declared here."
1237
+ "permission": {
1238
+ "ref": "identifier",
1239
+ "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."
1236
1240
  },
1237
1241
  "capabilities": {
1238
1242
  "type": "array",
@@ -1338,6 +1342,10 @@
1338
1342
  },
1339
1343
  "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'."
1340
1344
  },
1345
+ "permission": {
1346
+ "ref": "identifier",
1347
+ "description": "The initiative permission a reader holds to see it: one this manifest declares at the initiative level, or 'use'. Absent: 'use'."
1348
+ },
1341
1349
  "requires": {
1342
1350
  "ref": "requires"
1343
1351
  }
@@ -1733,6 +1741,10 @@
1733
1741
  "ref": "localizedText",
1734
1742
  "description": "The one line the view editor's Add picker shows beside the name."
1735
1743
  },
1744
+ "permission": {
1745
+ "ref": "identifier",
1746
+ "description": "The initiative permission a reader holds to see it: one this manifest declares at the initiative level, or 'use'. Absent: 'use'."
1747
+ },
1736
1748
  "requires": {
1737
1749
  "ref": "requires"
1738
1750
  }
@@ -1794,16 +1806,60 @@
1794
1806
  "default": false,
1795
1807
  "description": "Also offered in the item's own menu."
1796
1808
  },
1797
- "admin_only": {
1798
- "type": "boolean",
1799
- "default": false,
1800
- "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."
1809
+ "permission": {
1810
+ "ref": "identifier",
1811
+ "description": "The initiative permission a reader holds to run it: one this manifest declares at the initiative level, or 'use'. Absent: 'use'."
1801
1812
  },
1802
1813
  "requires": {
1803
1814
  "ref": "requires"
1804
1815
  }
1805
1816
  }
1806
1817
  },
1818
+ "permission": {
1819
+ "type": "object",
1820
+ "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.",
1821
+ "required": [
1822
+ "id",
1823
+ "name",
1824
+ "level"
1825
+ ],
1826
+ "properties": {
1827
+ "id": {
1828
+ "ref": "identifier",
1829
+ "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."
1830
+ },
1831
+ "name": {
1832
+ "ref": "localizedText",
1833
+ "description": "What the community's role pages call it."
1834
+ },
1835
+ "level": {
1836
+ "enum": "surfaceScope",
1837
+ "description": "Where it is held: 'initiative' by an initiative's roles, 'community' by the community's admins."
1838
+ },
1839
+ "members": {
1840
+ "type": "boolean",
1841
+ "default": false,
1842
+ "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."
1843
+ }
1844
+ },
1845
+ "if": {
1846
+ "properties": {
1847
+ "level": {
1848
+ "const": "community"
1849
+ }
1850
+ },
1851
+ "required": [
1852
+ "level"
1853
+ ]
1854
+ },
1855
+ "then": {
1856
+ "properties": {
1857
+ "members": {
1858
+ "const": false
1859
+ }
1860
+ }
1861
+ }
1862
+ },
1807
1863
  "change": {
1808
1864
  "type": "object",
1809
1865
  "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.",
@@ -2881,6 +2937,24 @@
2881
2937
  "ref": "page"
2882
2938
  }
2883
2939
  },
2940
+ "sign_in": {
2941
+ "type": "object",
2942
+ "required": [
2943
+ "page",
2944
+ "return_path"
2945
+ ],
2946
+ "properties": {
2947
+ "page": {
2948
+ "ref": "identifier",
2949
+ "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."
2950
+ },
2951
+ "return_path": {
2952
+ "ref": "path",
2953
+ "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."
2954
+ }
2955
+ },
2956
+ "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."
2957
+ },
2884
2958
  "dashboards": {
2885
2959
  "type": "array",
2886
2960
  "maxItems": "bundledDashboards",
@@ -2921,6 +2995,14 @@
2921
2995
  },
2922
2996
  "description": "Values the community's admins set on the install, which the plug-in's expressions and its parts' text read. At most {settings}."
2923
2997
  },
2998
+ "permissions": {
2999
+ "type": "array",
3000
+ "maxItems": "permissions",
3001
+ "items": {
3002
+ "ref": "permission"
3003
+ },
3004
+ "description": "What the community decides who may do with this plug-in, at most {permissions}. 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."
3005
+ },
2924
3006
  "help": {
2925
3007
  "type": "object",
2926
3008
  "minProperties": 1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "initiative-plugin-sdk",
3
- "version": "10.0.1",
3
+ "version": "10.1.0",
4
4
  "description": "Build a plug-in for Initiative: one typed definition of its endpoints, hooks, schedules, widgets and listing, the server Initiative calls, the client it calls Initiative with, the CLI that builds its manifest, and declarative integrations Initiative runs from the manifest alone.",
5
5
  "license": "MIT",
6
6
  "type": "module",