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.
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://initiativetasks.com/schemas/plugin-manifest-v1.json",
4
4
  "title": "Initiative plug-in manifest (the 'definition' body)",
5
- "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.",
5
+ "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.",
6
6
  "type": "object",
7
7
  "required": [
8
8
  "plugin_kind",
@@ -43,8 +43,6 @@
43
43
  "projects:write",
44
44
  "files:read",
45
45
  "files:write",
46
- "queues:read",
47
- "queues:write",
48
46
  "counter_groups:read",
49
47
  "counter_groups:write",
50
48
  "calendars:read",
@@ -55,6 +53,8 @@
55
53
  "posts:write",
56
54
  "wikis:read",
57
55
  "wikis:write",
56
+ "contacts:read",
57
+ "contacts:write",
58
58
  "comments:read",
59
59
  "comments:write",
60
60
  "relationships:read",
@@ -152,8 +152,6 @@
152
152
  "projects:write",
153
153
  "files:read",
154
154
  "files:write",
155
- "queues:read",
156
- "queues:write",
157
155
  "counter_groups:read",
158
156
  "counter_groups:write",
159
157
  "calendars:read",
@@ -164,6 +162,8 @@
164
162
  "posts:write",
165
163
  "wikis:read",
166
164
  "wikis:write",
165
+ "contacts:read",
166
+ "contacts:write",
167
167
  "comments:read",
168
168
  "comments:write",
169
169
  "relationships:read",
@@ -1309,26 +1309,30 @@
1309
1309
  "datetime",
1310
1310
  "link",
1311
1311
  "badge",
1312
- "progress",
1313
- "checkbox"
1312
+ "scale",
1313
+ "checkbox",
1314
+ "url",
1315
+ "currency",
1316
+ "select",
1317
+ "multi_select",
1318
+ "user_reference"
1314
1319
  ],
1315
- "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."
1320
+ "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 ÷ max × 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."
1316
1321
  },
1317
1322
  "list": {
1318
1323
  "type": "boolean",
1319
1324
  "default": false,
1320
- "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."
1325
+ "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."
1321
1326
  },
1322
1327
  "on": {
1323
1328
  "type": "array",
1324
1329
  "minItems": 1,
1325
- "maxItems": 5,
1330
+ "maxItems": 4,
1326
1331
  "uniqueItems": true,
1327
1332
  "items": {
1328
1333
  "enum": [
1329
1334
  "task",
1330
1335
  "calendar_event",
1331
- "queue_item",
1332
1336
  "counter",
1333
1337
  "post"
1334
1338
  ]
@@ -1350,6 +1354,20 @@
1350
1354
  ],
1351
1355
  "description": "A badge's tone when its value names none."
1352
1356
  },
1357
+ "currency": {
1358
+ "type": "string",
1359
+ "pattern": "^[A-Z]{3}$",
1360
+ "description": "A currency field's ISO 4217 code, such as 'EUR': what its amounts are in. Required on one."
1361
+ },
1362
+ "options": {
1363
+ "type": "array",
1364
+ "minItems": 1,
1365
+ "maxItems": 24,
1366
+ "items": {
1367
+ "$ref": "#/$defs/fieldOption"
1368
+ },
1369
+ "description": "A select or multi_select field's options, each value at most once. Required on one."
1370
+ },
1353
1371
  "states": {
1354
1372
  "type": "object",
1355
1373
  "minProperties": 1,
@@ -1360,7 +1378,7 @@
1360
1378
  "additionalProperties": {
1361
1379
  "$ref": "#/$defs/stateFacet"
1362
1380
  },
1363
- "description": "What state the value is in, as facets by id, at most 4, 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\": …, \"state\": …}."
1381
+ "description": "What state the value is in, as facets by id, at most 4, 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\": …, \"state\": …}."
1364
1382
  },
1365
1383
  "actions": {
1366
1384
  "type": "array",
@@ -1375,7 +1393,92 @@
1375
1393
  "requires": {
1376
1394
  "$ref": "#/$defs/requires"
1377
1395
  }
1378
- }
1396
+ },
1397
+ "allOf": [
1398
+ {
1399
+ "if": {
1400
+ "properties": {
1401
+ "kind": {
1402
+ "const": "currency"
1403
+ }
1404
+ },
1405
+ "required": [
1406
+ "kind"
1407
+ ]
1408
+ },
1409
+ "then": {
1410
+ "required": [
1411
+ "currency"
1412
+ ]
1413
+ }
1414
+ },
1415
+ {
1416
+ "if": {
1417
+ "properties": {
1418
+ "kind": {
1419
+ "enum": [
1420
+ "select",
1421
+ "multi_select"
1422
+ ]
1423
+ }
1424
+ },
1425
+ "required": [
1426
+ "kind"
1427
+ ]
1428
+ },
1429
+ "then": {
1430
+ "required": [
1431
+ "options"
1432
+ ]
1433
+ }
1434
+ },
1435
+ {
1436
+ "if": {
1437
+ "properties": {
1438
+ "kind": {
1439
+ "const": "multi_select"
1440
+ }
1441
+ },
1442
+ "required": [
1443
+ "kind"
1444
+ ]
1445
+ },
1446
+ "then": {
1447
+ "properties": {
1448
+ "list": {
1449
+ "const": false
1450
+ }
1451
+ }
1452
+ }
1453
+ }
1454
+ ]
1455
+ },
1456
+ "fieldOption": {
1457
+ "type": "object",
1458
+ "description": "One option of a select or multi_select field: the value a value names, and how Initiative shows it.",
1459
+ "required": [
1460
+ "value",
1461
+ "label"
1462
+ ],
1463
+ "properties": {
1464
+ "value": {
1465
+ "type": "string",
1466
+ "minLength": 1,
1467
+ "maxLength": 64,
1468
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_\\-]*$",
1469
+ "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."
1470
+ },
1471
+ "label": {
1472
+ "$ref": "#/$defs/localizedText",
1473
+ "description": "The option's words, in the reader's language."
1474
+ },
1475
+ "color": {
1476
+ "type": "string",
1477
+ "pattern": "^#[0-9A-Fa-f]{6}$",
1478
+ "description": "The option's colour, as '#rrggbb'."
1479
+ }
1480
+ },
1481
+ "additionalProperties": false
1379
1482
  },
1380
1483
  "stateFacet": {
1381
1484
  "type": "object",
@@ -1679,13 +1782,12 @@
1679
1782
  "on": {
1680
1783
  "type": "array",
1681
1784
  "minItems": 1,
1682
- "maxItems": 5,
1785
+ "maxItems": 4,
1683
1786
  "uniqueItems": true,
1684
1787
  "items": {
1685
1788
  "enum": [
1686
1789
  "task",
1687
1790
  "calendar_event",
1688
- "queue_item",
1689
1791
  "counter",
1690
1792
  "post"
1691
1793
  ]
@@ -1743,13 +1845,12 @@
1743
1845
  "on": {
1744
1846
  "type": "array",
1745
1847
  "minItems": 1,
1746
- "maxItems": 5,
1848
+ "maxItems": 4,
1747
1849
  "uniqueItems": true,
1748
1850
  "items": {
1749
1851
  "enum": [
1750
1852
  "task",
1751
1853
  "calendar_event",
1752
- "queue_item",
1753
1854
  "counter",
1754
1855
  "post"
1755
1856
  ]
@@ -1909,7 +2010,6 @@
1909
2010
  "enum": [
1910
2011
  "task",
1911
2012
  "calendar_event",
1912
- "queue_item",
1913
2013
  "counter",
1914
2014
  "post"
1915
2015
  ]
@@ -1964,7 +2064,7 @@
1964
2064
  },
1965
2065
  "listElement": {
1966
2066
  "type": "object",
1967
- "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 8192 bytes as JSON. An 'upsert' may give only some of an element's properties: they are merged into the element with its 'ref'.",
2067
+ "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 8192 bytes as JSON. An 'upsert' may give only some of an element's properties: they are merged into the element with its 'ref'.",
1968
2068
  "required": [
1969
2069
  "ref"
1970
2070
  ],
@@ -1978,7 +2078,7 @@
1978
2078
  "number",
1979
2079
  "boolean"
1980
2080
  ],
1981
- "description": "A text, number, date, datetime or checkbox element's value, or a progress element's figure."
2081
+ "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'."
1982
2082
  },
1983
2083
  "url": {
1984
2084
  "type": "string",
@@ -2001,7 +2101,8 @@
2001
2101
  },
2002
2102
  "max": {
2003
2103
  "type": "number",
2004
- "description": "A progress element's whole."
2104
+ "exclusiveMinimum": 0,
2105
+ "description": "A scale element's whole, when its figure is not already out of 100: Initiative keeps value ÷ max × 100."
2005
2106
  },
2006
2107
  "state": {
2007
2108
  "type": "object",