initiative-plugin-sdk 8.1.0 → 9.0.1
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/README.md +37 -14
- package/dist/contract.d.ts +66 -24
- package/dist/contract.js +6 -4
- package/dist/contract.js.map +1 -1
- package/dist/plugin-api.generated.d.ts +731 -581
- package/dist/plugin-api.generated.js +179 -159
- package/dist/plugin-api.generated.js.map +1 -1
- package/dist/validate.d.ts +4 -3
- package/dist/validate.js +14 -6
- package/dist/validate.js.map +1 -1
- package/dist/widget.d.ts +1 -1
- package/manifest.contract.json +116 -13
- package/package.json +2 -2
- package/schemas/plugin-api.json +3934 -3092
- package/schemas/plugin-manifest.json +120 -23
|
@@ -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",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"scopes": {
|
|
35
35
|
"type": "array",
|
|
36
|
-
"maxItems":
|
|
36
|
+
"maxItems": 54,
|
|
37
37
|
"uniqueItems": true,
|
|
38
38
|
"items": {
|
|
39
39
|
"anyOf": [
|
|
@@ -53,8 +53,6 @@
|
|
|
53
53
|
"dashboards:write",
|
|
54
54
|
"posts:read",
|
|
55
55
|
"posts:write",
|
|
56
|
-
"galleries:read",
|
|
57
|
-
"galleries:write",
|
|
58
56
|
"wikis:read",
|
|
59
57
|
"wikis:write",
|
|
60
58
|
"comments:read",
|
|
@@ -144,7 +142,7 @@
|
|
|
144
142
|
},
|
|
145
143
|
"scopes": {
|
|
146
144
|
"type": "array",
|
|
147
|
-
"maxItems":
|
|
145
|
+
"maxItems": 54,
|
|
148
146
|
"uniqueItems": true,
|
|
149
147
|
"items": {
|
|
150
148
|
"anyOf": [
|
|
@@ -164,8 +162,6 @@
|
|
|
164
162
|
"dashboards:write",
|
|
165
163
|
"posts:read",
|
|
166
164
|
"posts:write",
|
|
167
|
-
"galleries:read",
|
|
168
|
-
"galleries:write",
|
|
169
165
|
"wikis:read",
|
|
170
166
|
"wikis:write",
|
|
171
167
|
"comments:read",
|
|
@@ -1313,20 +1309,25 @@
|
|
|
1313
1309
|
"datetime",
|
|
1314
1310
|
"link",
|
|
1315
1311
|
"badge",
|
|
1316
|
-
"
|
|
1317
|
-
"checkbox"
|
|
1312
|
+
"scale",
|
|
1313
|
+
"checkbox",
|
|
1314
|
+
"url",
|
|
1315
|
+
"currency",
|
|
1316
|
+
"select",
|
|
1317
|
+
"multi_select",
|
|
1318
|
+
"user_reference"
|
|
1318
1319
|
],
|
|
1319
|
-
"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?}; '
|
|
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."
|
|
1320
1321
|
},
|
|
1321
1322
|
"list": {
|
|
1322
1323
|
"type": "boolean",
|
|
1323
1324
|
"default": false,
|
|
1324
|
-
"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."
|
|
1325
1326
|
},
|
|
1326
1327
|
"on": {
|
|
1327
1328
|
"type": "array",
|
|
1328
1329
|
"minItems": 1,
|
|
1329
|
-
"maxItems":
|
|
1330
|
+
"maxItems": 5,
|
|
1330
1331
|
"uniqueItems": true,
|
|
1331
1332
|
"items": {
|
|
1332
1333
|
"enum": [
|
|
@@ -1334,7 +1335,6 @@
|
|
|
1334
1335
|
"calendar_event",
|
|
1335
1336
|
"queue_item",
|
|
1336
1337
|
"counter",
|
|
1337
|
-
"gallery_image",
|
|
1338
1338
|
"post"
|
|
1339
1339
|
]
|
|
1340
1340
|
},
|
|
@@ -1355,6 +1355,20 @@
|
|
|
1355
1355
|
],
|
|
1356
1356
|
"description": "A badge's tone when its value names none."
|
|
1357
1357
|
},
|
|
1358
|
+
"currency": {
|
|
1359
|
+
"type": "string",
|
|
1360
|
+
"pattern": "^[A-Z]{3}$",
|
|
1361
|
+
"description": "A currency field's ISO 4217 code, such as 'EUR': what its amounts are in. Required on one."
|
|
1362
|
+
},
|
|
1363
|
+
"options": {
|
|
1364
|
+
"type": "array",
|
|
1365
|
+
"minItems": 1,
|
|
1366
|
+
"maxItems": 24,
|
|
1367
|
+
"items": {
|
|
1368
|
+
"$ref": "#/$defs/fieldOption"
|
|
1369
|
+
},
|
|
1370
|
+
"description": "A select or multi_select field's options, each value at most once. Required on one."
|
|
1371
|
+
},
|
|
1358
1372
|
"states": {
|
|
1359
1373
|
"type": "object",
|
|
1360
1374
|
"minProperties": 1,
|
|
@@ -1365,7 +1379,7 @@
|
|
|
1365
1379
|
"additionalProperties": {
|
|
1366
1380
|
"$ref": "#/$defs/stateFacet"
|
|
1367
1381
|
},
|
|
1368
|
-
"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
|
|
1382
|
+
"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\": …}."
|
|
1369
1383
|
},
|
|
1370
1384
|
"actions": {
|
|
1371
1385
|
"type": "array",
|
|
@@ -1380,7 +1394,92 @@
|
|
|
1380
1394
|
"requires": {
|
|
1381
1395
|
"$ref": "#/$defs/requires"
|
|
1382
1396
|
}
|
|
1383
|
-
}
|
|
1397
|
+
},
|
|
1398
|
+
"allOf": [
|
|
1399
|
+
{
|
|
1400
|
+
"if": {
|
|
1401
|
+
"properties": {
|
|
1402
|
+
"kind": {
|
|
1403
|
+
"const": "currency"
|
|
1404
|
+
}
|
|
1405
|
+
},
|
|
1406
|
+
"required": [
|
|
1407
|
+
"kind"
|
|
1408
|
+
]
|
|
1409
|
+
},
|
|
1410
|
+
"then": {
|
|
1411
|
+
"required": [
|
|
1412
|
+
"currency"
|
|
1413
|
+
]
|
|
1414
|
+
}
|
|
1415
|
+
},
|
|
1416
|
+
{
|
|
1417
|
+
"if": {
|
|
1418
|
+
"properties": {
|
|
1419
|
+
"kind": {
|
|
1420
|
+
"enum": [
|
|
1421
|
+
"select",
|
|
1422
|
+
"multi_select"
|
|
1423
|
+
]
|
|
1424
|
+
}
|
|
1425
|
+
},
|
|
1426
|
+
"required": [
|
|
1427
|
+
"kind"
|
|
1428
|
+
]
|
|
1429
|
+
},
|
|
1430
|
+
"then": {
|
|
1431
|
+
"required": [
|
|
1432
|
+
"options"
|
|
1433
|
+
]
|
|
1434
|
+
}
|
|
1435
|
+
},
|
|
1436
|
+
{
|
|
1437
|
+
"if": {
|
|
1438
|
+
"properties": {
|
|
1439
|
+
"kind": {
|
|
1440
|
+
"const": "multi_select"
|
|
1441
|
+
}
|
|
1442
|
+
},
|
|
1443
|
+
"required": [
|
|
1444
|
+
"kind"
|
|
1445
|
+
]
|
|
1446
|
+
},
|
|
1447
|
+
"then": {
|
|
1448
|
+
"properties": {
|
|
1449
|
+
"list": {
|
|
1450
|
+
"const": false
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
]
|
|
1456
|
+
},
|
|
1457
|
+
"fieldOption": {
|
|
1458
|
+
"type": "object",
|
|
1459
|
+
"description": "One option of a select or multi_select field: the value a value names, and how Initiative shows it.",
|
|
1460
|
+
"required": [
|
|
1461
|
+
"value",
|
|
1462
|
+
"label"
|
|
1463
|
+
],
|
|
1464
|
+
"properties": {
|
|
1465
|
+
"value": {
|
|
1466
|
+
"type": "string",
|
|
1467
|
+
"minLength": 1,
|
|
1468
|
+
"maxLength": 64,
|
|
1469
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9_\\-]*$",
|
|
1470
|
+
"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."
|
|
1471
|
+
},
|
|
1472
|
+
"label": {
|
|
1473
|
+
"$ref": "#/$defs/localizedText",
|
|
1474
|
+
"description": "The option's words, in the reader's language."
|
|
1475
|
+
},
|
|
1476
|
+
"color": {
|
|
1477
|
+
"type": "string",
|
|
1478
|
+
"pattern": "^#[0-9A-Fa-f]{6}$",
|
|
1479
|
+
"description": "The option's colour, as '#rrggbb'."
|
|
1480
|
+
}
|
|
1481
|
+
},
|
|
1482
|
+
"additionalProperties": false
|
|
1384
1483
|
},
|
|
1385
1484
|
"stateFacet": {
|
|
1386
1485
|
"type": "object",
|
|
@@ -1684,7 +1783,7 @@
|
|
|
1684
1783
|
"on": {
|
|
1685
1784
|
"type": "array",
|
|
1686
1785
|
"minItems": 1,
|
|
1687
|
-
"maxItems":
|
|
1786
|
+
"maxItems": 5,
|
|
1688
1787
|
"uniqueItems": true,
|
|
1689
1788
|
"items": {
|
|
1690
1789
|
"enum": [
|
|
@@ -1692,7 +1791,6 @@
|
|
|
1692
1791
|
"calendar_event",
|
|
1693
1792
|
"queue_item",
|
|
1694
1793
|
"counter",
|
|
1695
|
-
"gallery_image",
|
|
1696
1794
|
"post"
|
|
1697
1795
|
]
|
|
1698
1796
|
},
|
|
@@ -1749,7 +1847,7 @@
|
|
|
1749
1847
|
"on": {
|
|
1750
1848
|
"type": "array",
|
|
1751
1849
|
"minItems": 1,
|
|
1752
|
-
"maxItems":
|
|
1850
|
+
"maxItems": 5,
|
|
1753
1851
|
"uniqueItems": true,
|
|
1754
1852
|
"items": {
|
|
1755
1853
|
"enum": [
|
|
@@ -1757,7 +1855,6 @@
|
|
|
1757
1855
|
"calendar_event",
|
|
1758
1856
|
"queue_item",
|
|
1759
1857
|
"counter",
|
|
1760
|
-
"gallery_image",
|
|
1761
1858
|
"post"
|
|
1762
1859
|
]
|
|
1763
1860
|
},
|
|
@@ -1918,7 +2015,6 @@
|
|
|
1918
2015
|
"calendar_event",
|
|
1919
2016
|
"queue_item",
|
|
1920
2017
|
"counter",
|
|
1921
|
-
"gallery_image",
|
|
1922
2018
|
"post"
|
|
1923
2019
|
]
|
|
1924
2020
|
},
|
|
@@ -1972,7 +2068,7 @@
|
|
|
1972
2068
|
},
|
|
1973
2069
|
"listElement": {
|
|
1974
2070
|
"type": "object",
|
|
1975
|
-
"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
|
|
2071
|
+
"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'.",
|
|
1976
2072
|
"required": [
|
|
1977
2073
|
"ref"
|
|
1978
2074
|
],
|
|
@@ -1986,7 +2082,7 @@
|
|
|
1986
2082
|
"number",
|
|
1987
2083
|
"boolean"
|
|
1988
2084
|
],
|
|
1989
|
-
"description": "A text, number, date, datetime or
|
|
2085
|
+
"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'."
|
|
1990
2086
|
},
|
|
1991
2087
|
"url": {
|
|
1992
2088
|
"type": "string",
|
|
@@ -2009,7 +2105,8 @@
|
|
|
2009
2105
|
},
|
|
2010
2106
|
"max": {
|
|
2011
2107
|
"type": "number",
|
|
2012
|
-
"
|
|
2108
|
+
"exclusiveMinimum": 0,
|
|
2109
|
+
"description": "A scale element's whole, when its figure is not already out of 100: Initiative keeps value ÷ max × 100."
|
|
2013
2110
|
},
|
|
2014
2111
|
"state": {
|
|
2015
2112
|
"type": "object",
|