initiative-plugin-sdk 9.0.0 → 10.0.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.
@@ -3,7 +3,7 @@
3
3
  "schema": {
4
4
  "$id": "https://initiativetasks.com/schemas/plugin-manifest-v1.json",
5
5
  "title": "Initiative plug-in manifest (the 'definition' body)",
6
- "description": "What a plug-in declares it can do. A plug-in is a container, which names its `service` and answers Initiative's calls, or declarative, which names its `hosts` and no service, and whose endpoints, connection checks, webhook events, schedules and actions Initiative runs itself from the requests and JSONata expressions written here, keeping the values they write on items; one plug-in is never both. This is the 'definition' field of the document served at /.well-known/initiative-plugin.json, NOT that whole document: a registrar also requires protocol_version, public_id and kind alongside it, and refuses a definition served bare. Generated from the platform's own validator vocabulary. A manifest that satisfies this schema is well-formed, not necessarily acceptable. Cross-references (the endpoint a widget binds, a requires term's connection, an endpoint's service prefix), the direction-specific rules on an endpoint, the features/blocks cross-check in both directions, UTF-8 byte-size caps, the rules tying a connection's flow and token to its scope and fields, what a webhooks block names, what a vendor setup writes to, whether every expression parses, what a declarative request and its steps name, the bounds, ids and endpoints of schedules, which terms each kind's schedules, actions, fields and webhook events take, the unique keys and ids of fields, parts, actions and settings, what a part's nodes, a field's element actions and an action's endpoint and params name, the placeholders in a part's text, and a part's size and depth are enforced by the platform on publish and are not expressible here."
6
+ "description": "What a plug-in declares it can do. A plug-in is a container, which names its `service` and answers Initiative's calls, or declarative, which names its `hosts` and no service, and whose endpoints, connection checks, webhook events, schedules and actions Initiative runs itself from the requests and JSONata expressions written here, keeping the values they write on items; one plug-in is never both. This is the 'definition' field of the document served at /.well-known/initiative-plugin.json, NOT that whole document: a registrar also requires protocol_version, public_id and kind alongside it, and refuses a definition served bare. Generated from the platform's own validator vocabulary. A manifest that satisfies this schema is well-formed, not necessarily acceptable. Cross-references (the endpoint a widget binds, a requires term's connection, an endpoint's service prefix), the direction-specific rules on an endpoint, the features/blocks cross-check in both directions, UTF-8 byte-size caps, the rules tying a connection's flow and token to its scope and fields, what a webhooks block names, what a vendor setup writes to, whether every expression parses, what a declarative request and its steps name, the bounds, ids and endpoints of schedules, which terms each kind's schedules, actions, fields and webhook events take, the unique keys and ids of fields, parts, actions and settings, the unique values of a field's options, what a part's nodes, a field's element actions and an action's endpoint and params name, the placeholders in a part's text, and a part's size and depth are enforced by the platform on publish and are not expressible here."
7
7
  },
8
8
  "charsets": {
9
9
  "identifier": "-0123456789_abcdefghijklmnopqrstuvwxyz",
@@ -114,8 +114,6 @@
114
114
  "projects:write",
115
115
  "files:read",
116
116
  "files:write",
117
- "queues:read",
118
- "queues:write",
119
117
  "counter_groups:read",
120
118
  "counter_groups:write",
121
119
  "calendars:read",
@@ -126,6 +124,8 @@
126
124
  "posts:write",
127
125
  "wikis:read",
128
126
  "wikis:write",
127
+ "contacts:read",
128
+ "contacts:write",
129
129
  "comments:read",
130
130
  "comments:write",
131
131
  "relationships:read",
@@ -157,7 +157,6 @@
157
157
  "itemKind": [
158
158
  "task",
159
159
  "calendar_event",
160
- "queue_item",
161
160
  "counter",
162
161
  "post"
163
162
  ],
@@ -168,8 +167,13 @@
168
167
  "datetime",
169
168
  "link",
170
169
  "badge",
171
- "progress",
172
- "checkbox"
170
+ "scale",
171
+ "checkbox",
172
+ "url",
173
+ "currency",
174
+ "select",
175
+ "multi_select",
176
+ "user_reference"
173
177
  ],
174
178
  "tone": [
175
179
  "accent",
@@ -231,6 +235,7 @@
231
235
  "authorizeParams": 12,
232
236
  "tokenLifetimeSeconds": 600,
233
237
  "selectOptions": 24,
238
+ "optionValueLength": 64,
234
239
  "accessHintScopes": 24,
235
240
  "requiresTerms": 10,
236
241
  "widgets": 12,
@@ -1270,12 +1275,12 @@
1270
1275
  },
1271
1276
  "kind": {
1272
1277
  "enum": "fieldKind",
1273
- "description": "What the value is, and so how it is drawn: 'text' a string; 'number' a number; 'date' a 'YYYY-MM-DD' string; 'datetime' an ISO 8601 string with its offset; 'link' {url, text?}; 'badge' {text, tone?}; 'progress' {value, max}; 'checkbox' a boolean."
1278
+ "description": "What the value is, and so how it is drawn: 'text' a string; 'number' a number; 'date' a 'YYYY-MM-DD' string; 'datetime' an ISO 8601 string with its offset; 'link' {url, text?}; 'badge' {text, tone?}; 'scale' a number from 0 to 100, or {value, max}, which Initiative keeps as value \u00f7 max \u00d7 100, drawn as a number, stars or a bar; 'checkbox' a boolean; 'url' an address, as a string; 'currency' a number, an amount in the field's 'currency'; 'select' the value of one of the field's 'options'; 'multi_select' a list of them; 'user_reference' a person, as the install's own reference for them: the 'id' Initiative gives the person wherever the plug-in reads one."
1274
1279
  },
1275
1280
  "list": {
1276
1281
  "type": "boolean",
1277
1282
  "default": false,
1278
- "description": "Several values rather than one: the value is a list of elements, each one value of 'kind' with a 'ref' that tells it from the others ('listElement'). A change gives the whole list in 'set', or adds, replaces and removes elements by 'ref' with 'upsert' and 'remove'. Absent: one value, which a change sets."
1283
+ "description": "Several values rather than one: the value is a list of elements, each one value of 'kind' with a 'ref' that tells it from the others ('listElement'). A change gives the whole list in 'set', or adds, replaces and removes elements by 'ref' with 'upsert' and 'remove'. Absent: one value, which a change sets. Every kind but 'multi_select', whose one value is already several."
1279
1284
  },
1280
1285
  "on": {
1281
1286
  "type": "array",
@@ -1297,6 +1302,20 @@
1297
1302
  "enum": "tone",
1298
1303
  "description": "A badge's tone when its value names none."
1299
1304
  },
1305
+ "currency": {
1306
+ "type": "string",
1307
+ "pattern": "^[A-Z]{3}$",
1308
+ "description": "A currency field's ISO 4217 code, such as 'EUR': what its amounts are in. Required on one."
1309
+ },
1310
+ "options": {
1311
+ "type": "array",
1312
+ "minItems": 1,
1313
+ "maxItems": "selectOptions",
1314
+ "items": {
1315
+ "ref": "fieldOption"
1316
+ },
1317
+ "description": "A select or multi_select field's options, each value at most once. Required on one."
1318
+ },
1300
1319
  "states": {
1301
1320
  "type": "object",
1302
1321
  "minProperties": 1,
@@ -1307,7 +1326,7 @@
1307
1326
  "additionalProperties": {
1308
1327
  "ref": "stateFacet"
1309
1328
  },
1310
- "description": "What state the value is in, as facets by id, at most {facetsPerField}, each with keys of its own. The value names a key of each facet it is in as 'state', {\"<facet>\": \"<key>\"}, and Initiative draws each as a badge, labelled in the reader's language. A list element, and a link, badge or progress value, carries 'state' beside its other properties; a text, number, date, datetime or checkbox value that carries one is written as an element is, without the 'ref': {\"value\": \u2026, \"state\": \u2026}."
1329
+ "description": "What state the value is in, as facets by id, at most {facetsPerField}, each with keys of its own. The value names a key of each facet it is in as 'state', {\"<facet>\": \"<key>\"}, and Initiative draws each as a badge, labelled in the reader's language. A list element, and a link, badge or scale value written as an object, carries 'state' beside its other properties; any other value that carries one is written as an element is, without the 'ref': {\"value\": \u2026, \"state\": \u2026}."
1311
1330
  },
1312
1331
  "actions": {
1313
1332
  "type": "array",
@@ -1322,7 +1341,92 @@
1322
1341
  "requires": {
1323
1342
  "ref": "requires"
1324
1343
  }
1325
- }
1344
+ },
1345
+ "allOf": [
1346
+ {
1347
+ "if": {
1348
+ "properties": {
1349
+ "kind": {
1350
+ "const": "currency"
1351
+ }
1352
+ },
1353
+ "required": [
1354
+ "kind"
1355
+ ]
1356
+ },
1357
+ "then": {
1358
+ "required": [
1359
+ "currency"
1360
+ ]
1361
+ }
1362
+ },
1363
+ {
1364
+ "if": {
1365
+ "properties": {
1366
+ "kind": {
1367
+ "enum": [
1368
+ "select",
1369
+ "multi_select"
1370
+ ]
1371
+ }
1372
+ },
1373
+ "required": [
1374
+ "kind"
1375
+ ]
1376
+ },
1377
+ "then": {
1378
+ "required": [
1379
+ "options"
1380
+ ]
1381
+ }
1382
+ },
1383
+ {
1384
+ "if": {
1385
+ "properties": {
1386
+ "kind": {
1387
+ "const": "multi_select"
1388
+ }
1389
+ },
1390
+ "required": [
1391
+ "kind"
1392
+ ]
1393
+ },
1394
+ "then": {
1395
+ "properties": {
1396
+ "list": {
1397
+ "const": false
1398
+ }
1399
+ }
1400
+ }
1401
+ }
1402
+ ]
1403
+ },
1404
+ "fieldOption": {
1405
+ "type": "object",
1406
+ "description": "One option of a select or multi_select field: the value a value names, and how Initiative shows it.",
1407
+ "required": [
1408
+ "value",
1409
+ "label"
1410
+ ],
1411
+ "properties": {
1412
+ "value": {
1413
+ "type": "string",
1414
+ "minLength": 1,
1415
+ "maxLength": "optionValueLength",
1416
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_\\-]*$",
1417
+ "description": "What a value holds when it names this option: a letter or a digit, then letters, digits, '_' and '-'. Unique among the field's options."
1418
+ },
1419
+ "label": {
1420
+ "ref": "localizedText",
1421
+ "description": "The option's words, in the reader's language."
1422
+ },
1423
+ "color": {
1424
+ "type": "string",
1425
+ "pattern": "^#[0-9A-Fa-f]{6}$",
1426
+ "description": "The option's colour, as '#rrggbb'."
1427
+ }
1428
+ },
1429
+ "additionalProperties": false
1326
1430
  },
1327
1431
  "stateFacet": {
1328
1432
  "type": "object",
@@ -1883,7 +1987,7 @@
1883
1987
  },
1884
1988
  "listElement": {
1885
1989
  "type": "object",
1886
- "description": "One element of a list field's value: one value of the field's 'kind', with a 'ref' that tells it from the list's others. A text, number, date, datetime or checkbox element holds its value in 'value'; a link element is {ref, url, text?}, a badge element {ref, text, tone?} and a progress element {ref, value, max}. Initiative keeps each element as a value of its own, of at most {metadataValueBytes} bytes as JSON. An 'upsert' may give only some of an element's properties: they are merged into the element with its 'ref'.",
1990
+ "description": "One element of a list field's value: one value of the field's 'kind', with a 'ref' that tells it from the list's others. A text, number, date, datetime, checkbox, url, currency, select or user_reference element holds its value in 'value'; a link element is {ref, url, text?}, a badge element {ref, text, tone?} and a scale element {ref, value, max?}. Initiative keeps each element as a value of its own, of at most {metadataValueBytes} bytes as JSON. An 'upsert' may give only some of an element's properties: they are merged into the element with its 'ref'.",
1887
1991
  "required": [
1888
1992
  "ref"
1889
1993
  ],
@@ -1897,7 +2001,7 @@
1897
2001
  "number",
1898
2002
  "boolean"
1899
2003
  ],
1900
- "description": "A text, number, date, datetime or checkbox element's value, or a progress element's figure."
2004
+ "description": "A text, number, date, datetime, checkbox, url, currency, select or user_reference element's value, or a scale element's figure: from 0 to 100, or out of its 'max'."
1901
2005
  },
1902
2006
  "url": {
1903
2007
  "type": "string",
@@ -1913,7 +2017,8 @@
1913
2017
  },
1914
2018
  "max": {
1915
2019
  "type": "number",
1916
- "description": "A progress element's whole."
2020
+ "exclusiveMinimum": 0,
2021
+ "description": "A scale element's whole, when its figure is not already out of 100: Initiative keeps value \u00f7 max \u00d7 100."
1917
2022
  },
1918
2023
  "state": {
1919
2024
  "type": "object",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "initiative-plugin-sdk",
3
- "version": "9.0.0",
3
+ "version": "10.0.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",
@@ -97,7 +97,7 @@
97
97
  }
98
98
  },
99
99
  "devDependencies": {
100
- "@types/node": "^26.6.5",
100
+ "@types/node": "^26.6.6",
101
101
  "esbuild": "^0.28.2",
102
102
  "typescript": "^7.0.2",
103
103
  "vitest": "^5.0.5"