initiative-plugin-sdk 4.1.0 → 4.2.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.
- package/LICENSE +1 -1
- package/README.md +64 -10
- package/dist/contract.d.ts +11 -1
- package/dist/contract.js +1 -1
- package/dist/contract.js.map +1 -1
- package/dist/define.d.ts +8 -0
- package/dist/define.js +1 -0
- package/dist/define.js.map +1 -1
- package/dist/manifest.d.ts +3 -1
- package/dist/manifest.js +3 -1
- package/dist/manifest.js.map +1 -1
- package/dist/plugin-api.d.ts +20 -0
- package/dist/plugin-api.generated.d.ts +2 -2
- package/dist/plugin-api.generated.js +2 -2
- package/dist/plugin-api.js +35 -0
- package/dist/plugin-api.js.map +1 -0
- package/manifest.contract.json +6 -1
- package/package.json +6 -5
- package/schemas/env-contract.json +1 -1
- package/schemas/plugin-api.json +20925 -0
- package/schemas/plugin-manifest.json +6 -1
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# initiative-plugin-sdk
|
|
2
2
|
|
|
3
|
-
Build a plug-in for [Initiative](https://github.com/
|
|
3
|
+
Build a plug-in for [Initiative](https://github.com/beyonders-studio/initiative): a
|
|
4
4
|
service that reads and writes a community's content, answers Initiative's
|
|
5
5
|
calls, and draws tiles on its dashboards.
|
|
6
6
|
|
|
@@ -10,11 +10,12 @@ holds its tokens, and builds its manifest.
|
|
|
10
10
|
|
|
11
11
|
| Import | Holds |
|
|
12
12
|
|---|---|
|
|
13
|
-
| `initiative-plugin-sdk/manifest` | `definePlugin`, `defineEndpoint`, the contract's types, `validateManifest` |
|
|
13
|
+
| `initiative-plugin-sdk/manifest` | `definePlugin`, `defineEndpoint`, the contract's types, `validateManifest`, `pluginApiCompatible` |
|
|
14
14
|
| `initiative-plugin-sdk/server` | `createPlugin`, `serve`, `EndpointError` |
|
|
15
15
|
| `initiative-plugin-sdk/client` | `Initiative` and the `Client` it gives, acting as the community or a member; plug-in keys |
|
|
16
16
|
| `initiative-plugin-sdk/widget` | What a widget is handed, and the scenes it returns |
|
|
17
17
|
| `initiative-plugin-sdk/testing` | A declarative plug-in's requests and maps, run against recorded vendor answers |
|
|
18
|
+
| `initiative-plugin-sdk/plugin-api.json` | The plug-in API contract: the OpenAPI document of every route a plug-in may call |
|
|
18
19
|
| bin `initiative-plugin` | `init`, `build`, `pack`, `dev`, `validate`, `keygen`, `uid`, `schema` |
|
|
19
20
|
|
|
20
21
|
Node 20 or later. Two runtime dependencies, `ajv` and `jsonata`; everything
|
|
@@ -368,10 +369,10 @@ for (const { installation, active } of await initiative.installations()) {
|
|
|
368
369
|
`files:write`), or, where Initiative checks each item, at least one of
|
|
369
370
|
them. `MissingScopeError` names the scope instead. Writing implies reading.
|
|
370
371
|
|
|
371
|
-
`client.api`
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
372
|
+
`client.api` is generated from the plug-in API contract this SDK publishes
|
|
373
|
+
([The plug-in API contract](#the-plug-in-api-contract)), so it changes as
|
|
374
|
+
the contract does: a minor release adds routes and fields, and only a major
|
|
375
|
+
release removes or changes one.
|
|
375
376
|
`PluginApiSchemas["TaskRead"]` names a schema's type.
|
|
376
377
|
- `client.request(method, path, { scope, body })` calls a community route (the
|
|
377
378
|
path after `/c/{community}`) by hand, with the same scope check.
|
|
@@ -426,6 +427,19 @@ the build, so a misspelt placeholder cannot ship. `baseUrl` is where the
|
|
|
426
427
|
service answers on the Compose network, an http or https URL of at most 512
|
|
427
428
|
characters; Initiative pre-fills the deployment's base URL with it.
|
|
428
429
|
|
|
430
|
+
`minAppVersion` is the oldest Initiative release a version runs on. Beside it,
|
|
431
|
+
the definition's `minPluginApi` (the manifest's `min_plugin_api`) is the
|
|
432
|
+
oldest [plug-in API contract](#the-plug-in-api-contract) the plug-in calls, as
|
|
433
|
+
`"MAJOR.MINOR"`: the SDK version its `client.api` was written against.
|
|
434
|
+
|
|
435
|
+
```ts
|
|
436
|
+
definePlugin({ publicId: "acme.tracker", /* … */ minPluginApi: "4.1" });
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
A deployment serving contract `4.3.2` runs it; one serving `4.0.5` or `5.0.0`
|
|
440
|
+
does not. Leave it out and the plug-in makes no claim: it is offered on any
|
|
441
|
+
contract, as listings written before the field were.
|
|
442
|
+
|
|
429
443
|
```sh
|
|
430
444
|
npx initiative-plugin build --registry ../registry/sources
|
|
431
445
|
```
|
|
@@ -642,10 +656,45 @@ may say. `schemas/plugin-manifest.json` and `src/contract.ts` (its types) are
|
|
|
642
656
|
generated from it with `npm run generate`; `npm run check:generated` fails when
|
|
643
657
|
either is stale. Initiative vendors the contract from this repository's tags.
|
|
644
658
|
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
659
|
+
## The plug-in API contract
|
|
660
|
+
|
|
661
|
+
A plug-in and Initiative release on their own schedules. What they share is
|
|
662
|
+
one file this package publishes, `schemas/plugin-api.json`, exported as
|
|
663
|
+
`initiative-plugin-sdk/plugin-api.json`: the OpenAPI document of every route a
|
|
664
|
+
plug-in may call, as Initiative describes it. A plug-in depends on an SDK
|
|
665
|
+
version and nothing else.
|
|
666
|
+
|
|
667
|
+
- **The contract version is this package's version.** The file's
|
|
668
|
+
`info.version` is the SDK's version, and `info["x-initiative-source"]` names
|
|
669
|
+
the Initiative release and commit the document was taken from. A minor
|
|
670
|
+
release adds operations, fields or optional parameters; removing or changing
|
|
671
|
+
anything is a major release.
|
|
672
|
+
- **Every client comes from the file.** `src/plugin-api.generated.ts`, behind
|
|
673
|
+
`client.api`, is generated from `schemas/plugin-api.json`, never from
|
|
674
|
+
Initiative directly. A plug-in in another language generates its own client
|
|
675
|
+
from the same file, at the SDK version it targets.
|
|
676
|
+
- **A deployment serves the contract it vendors.** Initiative carries a copy of
|
|
677
|
+
this file from an SDK release, serves that SDK version as its plug-in API
|
|
678
|
+
version, and checks in its own CI that what it serves still holds every
|
|
679
|
+
route, parameter and response field the copy has. It may serve more.
|
|
680
|
+
- **A plug-in names the oldest contract it needs**, as `min_plugin_api`
|
|
681
|
+
(`"MAJOR.MINOR"`) in its manifest. A deployment serving contract `S` runs a
|
|
682
|
+
plug-in needing `N` when they share a major version and `S`'s minor is at
|
|
683
|
+
least `N`'s. A manifest without the field runs on any contract.
|
|
684
|
+
Initiative, the registry and the SDK decide with the same rule, exported as
|
|
685
|
+
`pluginApiCompatible`:
|
|
686
|
+
|
|
687
|
+
```ts
|
|
688
|
+
import { pluginApiCompatible } from "initiative-plugin-sdk/manifest";
|
|
689
|
+
|
|
690
|
+
pluginApiCompatible("4.3.2", "4.1"); // true
|
|
691
|
+
pluginApiCompatible("5.0.0", "4.1"); // false: another major
|
|
692
|
+
pluginApiCompatible("4.3.2", undefined); // true: no claim
|
|
693
|
+
```
|
|
694
|
+
|
|
695
|
+
The file is never edited by hand. Take it again when Initiative's plug-in API
|
|
696
|
+
grows, from a checkout, a release or a running deployment; this rewrites the
|
|
697
|
+
file at the package's version and then the client from it:
|
|
649
698
|
|
|
650
699
|
```sh
|
|
651
700
|
npm run generate:plugin-api -- --checkout ../initiative # runs its export with uv
|
|
@@ -653,6 +702,11 @@ npm run generate:plugin-api -- --release v0.75.0
|
|
|
653
702
|
npm run generate:plugin-api -- --url https://initiative.example.com
|
|
654
703
|
```
|
|
655
704
|
|
|
705
|
+
With no source, `npm run generate:plugin-api` regenerates the client from the
|
|
706
|
+
file and restamps its `info.version` with the package's; the Promote workflow
|
|
707
|
+
does this when it bumps the version. `npm run check:generated` fails when
|
|
708
|
+
either the file's version or the client is stale.
|
|
709
|
+
|
|
656
710
|
## Scopes
|
|
657
711
|
|
|
658
712
|
| Scope | Grants |
|
package/dist/contract.d.ts
CHANGED
|
@@ -190,7 +190,7 @@ export declare const FIELDS: {
|
|
|
190
190
|
readonly healthState: readonly ["status", "when", "state"];
|
|
191
191
|
readonly webhookEvent: readonly ["when", "emit", "map"];
|
|
192
192
|
readonly webhookStatus: readonly ["when", "connection", "state"];
|
|
193
|
-
readonly manifest: readonly ["plugin_kind", "service", "features", "default_name", "minimum_age", "hosts", "auth", "vendor", "connections", "webhooks", "schedules", "endpoints", "community_summary", "widgets", "embeds", "dashboards"];
|
|
193
|
+
readonly manifest: readonly ["plugin_kind", "service", "features", "default_name", "minimum_age", "min_plugin_api", "hosts", "auth", "vendor", "connections", "webhooks", "schedules", "endpoints", "community_summary", "widgets", "embeds", "dashboards"];
|
|
194
194
|
};
|
|
195
195
|
export type Identifier = string;
|
|
196
196
|
/**
|
|
@@ -1232,6 +1232,16 @@ export interface Manifest {
|
|
|
1232
1232
|
* each from 13 to 21.
|
|
1233
1233
|
*/
|
|
1234
1234
|
minimum_age?: Record<string, number>;
|
|
1235
|
+
/**
|
|
1236
|
+
* The oldest plug-in API contract this plug-in needs, as 'MAJOR.MINOR':
|
|
1237
|
+
* '4.1'. The contract is the plug-in API published with
|
|
1238
|
+
* initiative-plugin-sdk, versioned as that package is. A deployment serving
|
|
1239
|
+
* contract S can run it when S has the same major version and a minor version
|
|
1240
|
+
* at least this one's. Absent: any contract; the plug-in makes no claim.
|
|
1241
|
+
* Beside a listing's min_app_version, the oldest Initiative release it runs
|
|
1242
|
+
* on, this says what the plug-in calls rather than which release serves it.
|
|
1243
|
+
*/
|
|
1244
|
+
min_plugin_api?: string;
|
|
1235
1245
|
/**
|
|
1236
1246
|
* Declarative plug-ins, which must name at least one: every host their
|
|
1237
1247
|
* requests, paging and links may reach. A container plug-in names none.
|
package/dist/contract.js
CHANGED
|
@@ -164,6 +164,6 @@ export const FIELDS = {
|
|
|
164
164
|
healthState: ["status", "when", "state"],
|
|
165
165
|
webhookEvent: ["when", "emit", "map"],
|
|
166
166
|
webhookStatus: ["when", "connection", "state"],
|
|
167
|
-
manifest: ["plugin_kind", "service", "features", "default_name", "minimum_age", "hosts", "auth", "vendor", "connections", "webhooks", "schedules", "endpoints", "community_summary", "widgets", "embeds", "dashboards"],
|
|
167
|
+
manifest: ["plugin_kind", "service", "features", "default_name", "minimum_age", "min_plugin_api", "hosts", "auth", "vendor", "connections", "webhooks", "schedules", "endpoints", "community_summary", "widgets", "embeds", "dashboards"],
|
|
168
168
|
};
|
|
169
169
|
//# sourceMappingURL=contract.js.map
|
package/dist/contract.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,MAAM,CAAC,MAAM,QAAQ,GAAuB,CAAC,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;AAG7F,MAAM,CAAC,MAAM,SAAS,GAAwB,CAAC,CAAC,CAAC,CAAC;AAGlD,MAAM,CAAC,MAAM,iBAAiB,GAA+B,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;AAGvF,MAAM,CAAC,MAAM,UAAU,GAAwB,CAAC,QAAQ,CAAC,CAAC;AAG1D,MAAM,CAAC,MAAM,WAAW,GAAyB,CAAC,YAAY,CAAC,CAAC;AAGhE,MAAM,CAAC,MAAM,cAAc,GAA4B,CAAC,cAAc,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;AAG3F,MAAM,CAAC,MAAM,cAAc,GAA4B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAG1E,MAAM,CAAC,MAAM,WAAW,GAAyB,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AAGtG,MAAM,CAAC,MAAM,kBAAkB,GAA+B,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AAG1F,MAAM,CAAC,MAAM,wBAAwB,GAAqC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAG5F,MAAM,CAAC,MAAM,iBAAiB,GAA8B,CAAC,WAAW,EAAE,eAAe,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAGlI,MAAM,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EAAE,SAAS,CAAC;IAChC,gBAAgB,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,CAAC;IACxG,gBAAgB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,CAAC;IAC5D,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,CAAC;IAC7F,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;IACrC,YAAY,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,CAAC;IAChE,gBAAgB,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC;IAChD,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC;IACxC,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC;IACrC,aAAa,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,CAAC;IAC9C,QAAQ,EAAE,CAAC,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,mBAAmB,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,CAAC;CACjO,CAAC"}
|
package/dist/define.d.ts
CHANGED
|
@@ -296,6 +296,14 @@ export interface PluginDefinition<E, W> {
|
|
|
296
296
|
name: string;
|
|
297
297
|
/** How old somebody must be to use it, by ISO 3166-1 alpha-2 country, with `default` for the rest: `{ default: 16, US: 13 }`. */
|
|
298
298
|
minimumAge?: Record<string, number>;
|
|
299
|
+
/**
|
|
300
|
+
* The oldest plug-in API contract the plug-in needs, as `"MAJOR.MINOR"`: the
|
|
301
|
+
* SDK version whose `client.api` it was written against, such as `"4.1"`. A
|
|
302
|
+
* deployment serving a contract of the same major version and at least this
|
|
303
|
+
* minor runs it (`pluginApiCompatible`). Absent: no claim. Beside
|
|
304
|
+
* `listing.minAppVersion`, the oldest Initiative release it runs on.
|
|
305
|
+
*/
|
|
306
|
+
minPluginApi?: string;
|
|
299
307
|
scopes?: Array<Scope | PluginScope>;
|
|
300
308
|
/** A declarative plug-in's hosts: every host its requests may reach. Naming them makes the plug-in declarative. */
|
|
301
309
|
hosts?: string[];
|
package/dist/define.js
CHANGED
|
@@ -72,6 +72,7 @@ export function manifestOf(plugin, modules = {}) {
|
|
|
72
72
|
features: FEATURES.filter((feature) => present[feature] !== undefined),
|
|
73
73
|
default_name: plugin.name,
|
|
74
74
|
...(plugin.minimumAge ? { minimum_age: { ...plugin.minimumAge } } : {}),
|
|
75
|
+
...(plugin.minPluginApi !== undefined ? { min_plugin_api: plugin.minPluginApi } : {}),
|
|
75
76
|
...(plugin.hosts ? { hosts: [...plugin.hosts] } : {}),
|
|
76
77
|
...(plugin.auth ? { auth: plugin.auth } : {}),
|
|
77
78
|
...present,
|
package/dist/define.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define.js","sourceRoot":"","sources":["../src/define.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAyBH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAgIzC,MAAM,UAAU,cAAc,CAAC,QAA6B;IAC1D,OAAO,QAAQ,CAAC;AAClB,CAAC;
|
|
1
|
+
{"version":3,"file":"define.js","sourceRoot":"","sources":["../src/define.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAyBH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAgIzC,MAAM,UAAU,cAAc,CAAC,QAA6B;IAC1D,OAAO,QAAQ,CAAC;AAClB,C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AI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,CAC9E,CAAC;QACJ,CAAC;;YAAM,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IAC1B,CAAC;IACD,OAAO,GAA0B,CAAC;AACpC,CAAC;AAED,SAAS,QAAQ,CACf,GAAW,EACX,MAA8B,EAC9B,MAAc,EACd,EAA4B;IAE5B,MAAM,GAAG,GAA4B,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC;IACjD,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACpD,IAAI,KAAK,KAAK,QAAQ;YAAE,GAAG,CAAC,aAAa,GAAG,MAAM,CAAC;aAC9C,IAAI,KAAK,KAAK,WAAW;YAAE,GAAG,CAAC,SAAS,GAAI,KAAkB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;aACvE,IAAI,KAAK,KAAK,aAAa,EAAE,CAAC;YACjC,GAAG,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,KAAe,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;QACpH,CAAC;;YAAM,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;IAC5B,CAAC;IACD,OAAO,GAAwB,CAAC;AAClC,CAAC"}
|
package/dist/manifest.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `initiative-plugin-sdk/manifest`: the contract as types, the plug-in's one
|
|
3
|
-
* definition,
|
|
3
|
+
* definition, checking a manifest before a deployment does, and the rule for
|
|
4
|
+
* which plug-in API contract a manifest's `min_plugin_api` runs on.
|
|
4
5
|
*/
|
|
5
6
|
export * from "./contract.js";
|
|
6
7
|
export { definePlugin, defineEndpoint, type Actor, type AfterConnectAnswer, type AfterConnectCall, type PluginContext, type PluginDefinition, type Call, type CallableEndpoint, type DashboardDeclaration, type EmittedEndpoint, type EndpointCall, type EndpointDeclaration, type Handoff, type Hooks, type ListingDeclaration, type Outcome, type Params, type ParamSpec, type ParamValue, type Result, type ReturnSpec, type RevokeCall, type ScheduleCall, type ScheduleDeclaration, type SurfaceCall, type SurfaceDeclaration, type WebhookCall, type WidgetDeclaration, } from "./define.js";
|
|
7
8
|
export { MANIFEST_PATH, manifestSchema, validateDocument, validateManifest, type PluginDocument, type ValidationProblem, } from "./validate.js";
|
|
9
|
+
export { pluginApiCompatible } from "./plugin-api.js";
|
|
8
10
|
export type { Jwks, PublicJwk } from "./keys.js";
|
package/dist/manifest.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `initiative-plugin-sdk/manifest`: the contract as types, the plug-in's one
|
|
3
|
-
* definition,
|
|
3
|
+
* definition, checking a manifest before a deployment does, and the rule for
|
|
4
|
+
* which plug-in API contract a manifest's `min_plugin_api` runs on.
|
|
4
5
|
*/
|
|
5
6
|
export * from "./contract.js";
|
|
6
7
|
export { definePlugin, defineEndpoint, } from "./define.js";
|
|
7
8
|
export { MANIFEST_PATH, manifestSchema, validateDocument, validateManifest, } from "./validate.js";
|
|
9
|
+
export { pluginApiCompatible } from "./plugin-api.js";
|
|
8
10
|
//# sourceMappingURL=manifest.js.map
|
package/dist/manifest.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,eAAe,CAAC;AAE9B,OAAO,EACL,YAAY,EACZ,cAAc,GA4Bf,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,gBAAgB,GAGjB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The plug-in API contract's one compatibility rule.
|
|
3
|
+
*
|
|
4
|
+
* The contract is `schemas/plugin-api.json`, published at this package's
|
|
5
|
+
* version: a minor release adds to it, a major one removes or changes
|
|
6
|
+
* something. A deployment serves one contract version, `MAJOR.MINOR.PATCH`; a
|
|
7
|
+
* plug-in's manifest may name the oldest it needs, `min_plugin_api`, as
|
|
8
|
+
* `MAJOR.MINOR`. Initiative, the registry and the SDK all decide with this
|
|
9
|
+
* rule, so it is stated once here.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Whether a deployment serving contract `served` (`"4.1.1"`) can run a plug-in
|
|
13
|
+
* whose manifest needs `required` (`"4.1"`): the same major version, and a
|
|
14
|
+
* minor version at least the one needed. A plug-in that names no
|
|
15
|
+
* `min_plugin_api` (`undefined` or `null`) runs on any contract.
|
|
16
|
+
*
|
|
17
|
+
* Throws a `RangeError` on a version that is not in its form, rather than
|
|
18
|
+
* guessing: a manifest that passed validation cannot carry one.
|
|
19
|
+
*/
|
|
20
|
+
export declare function pluginApiCompatible(served: string, required: string | null | undefined): boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generated by scripts/generate-plugin-api.mjs from
|
|
3
|
-
*
|
|
2
|
+
* Generated by scripts/generate-plugin-api.mjs from schemas/plugin-api.json, the plug-in API
|
|
3
|
+
* taken from Initiative 0.74.0 (commit 0492f28bb). Do not edit: regenerate.
|
|
4
4
|
*/
|
|
5
5
|
import type { Scope } from "./contract.js";
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generated by scripts/generate-plugin-api.mjs from
|
|
3
|
-
*
|
|
2
|
+
* Generated by scripts/generate-plugin-api.mjs from schemas/plugin-api.json, the plug-in API
|
|
3
|
+
* taken from Initiative 0.74.0 (commit 0492f28bb). Do not edit: regenerate.
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* Each operation a plug-in may call: its method, its path after `/api/v1/c/0`, the
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The plug-in API contract's one compatibility rule.
|
|
3
|
+
*
|
|
4
|
+
* The contract is `schemas/plugin-api.json`, published at this package's
|
|
5
|
+
* version: a minor release adds to it, a major one removes or changes
|
|
6
|
+
* something. A deployment serves one contract version, `MAJOR.MINOR.PATCH`; a
|
|
7
|
+
* plug-in's manifest may name the oldest it needs, `min_plugin_api`, as
|
|
8
|
+
* `MAJOR.MINOR`. Initiative, the registry and the SDK all decide with this
|
|
9
|
+
* rule, so it is stated once here.
|
|
10
|
+
*/
|
|
11
|
+
const SERVED = /^([0-9]+)\.([0-9]+)\.([0-9]+)$/;
|
|
12
|
+
const REQUIRED = /^([0-9]+)\.([0-9]+)$/;
|
|
13
|
+
/**
|
|
14
|
+
* Whether a deployment serving contract `served` (`"4.1.1"`) can run a plug-in
|
|
15
|
+
* whose manifest needs `required` (`"4.1"`): the same major version, and a
|
|
16
|
+
* minor version at least the one needed. A plug-in that names no
|
|
17
|
+
* `min_plugin_api` (`undefined` or `null`) runs on any contract.
|
|
18
|
+
*
|
|
19
|
+
* Throws a `RangeError` on a version that is not in its form, rather than
|
|
20
|
+
* guessing: a manifest that passed validation cannot carry one.
|
|
21
|
+
*/
|
|
22
|
+
export function pluginApiCompatible(served, required) {
|
|
23
|
+
const serving = SERVED.exec(served);
|
|
24
|
+
if (!serving)
|
|
25
|
+
throw new RangeError(`the served plug-in API version '${served}' is not MAJOR.MINOR.PATCH`);
|
|
26
|
+
if (required === undefined || required === null)
|
|
27
|
+
return true;
|
|
28
|
+
const needing = REQUIRED.exec(required);
|
|
29
|
+
if (!needing)
|
|
30
|
+
throw new RangeError(`min_plugin_api '${required}' is not MAJOR.MINOR`);
|
|
31
|
+
const [servedMajor, servedMinor] = [Number(serving[1]), Number(serving[2])];
|
|
32
|
+
const [neededMajor, neededMinor] = [Number(needing[1]), Number(needing[2])];
|
|
33
|
+
return servedMajor === neededMajor && servedMinor >= neededMinor;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=plugin-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-api.js","sourceRoot":"","sources":["../src/plugin-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,MAAM,GAAG,gCAAgC,CAAC;AAChD,MAAM,QAAQ,GAAG,sBAAsB,CAAC;AAExC;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAc,EAAE,QAAmC;IACrF,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACpC,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,UAAU,CAAC,mCAAmC,MAAM,4BAA4B,CAAC,CAAC;IAC1G,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC7D,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACxC,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,UAAU,CAAC,mBAAmB,QAAQ,sBAAsB,CAAC,CAAC;IACtF,MAAM,CAAC,WAAW,EAAE,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5E,MAAM,CAAC,WAAW,EAAE,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5E,OAAO,WAAW,KAAK,WAAW,IAAI,WAAW,IAAI,WAAW,CAAC;AACnE,CAAC"}
|
package/manifest.contract.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$comment": "The Initiative plug-in contract: the vocabulary a plug-in manifest draws on and the shape it takes. Hand-authored HERE, in the initiative-plugin-sdk repository, and nowhere else. Running `npm run generate` in that repository rewrites schemas/plugin-manifest.json and src/contract.ts from this file. Initiative vendors this file to derive its validator's constants and hold its normalizer to the field inventory; the copies under initiative's backend/vendor/plugin-kit and frontend/src/contract are refreshed by backend/scripts/refresh_plugin_kit.py and are not edited there. Edit this; never the generated output. A manifest describes a plug-in's API and nothing about how a consumer PRESENTS it: there is no term here for a control, a picker, a default or a bound, because what a step looks like on somebody's canvas is that consumer's to decide and ours to stay out of.",
|
|
3
3
|
"schema": {
|
|
4
|
-
"$id": "https://
|
|
4
|
+
"$id": "https://initiativetasks.com/schemas/plugin-manifest-v1.json",
|
|
5
5
|
"title": "Initiative plug-in manifest (the 'definition' body)",
|
|
6
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 and webhook events Initiative runs itself from the requests and JSONata expressions written here; 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, and the bounds and unique ids of schedules are enforced by the platform on publish and are not expressible here."
|
|
7
7
|
},
|
|
@@ -1836,6 +1836,11 @@
|
|
|
1836
1836
|
},
|
|
1837
1837
|
"description": "How old somebody must be to use this plug-in, by where they are. Keys are ISO 3166-1 alpha-2 country codes, upper case, and 'default' for every country not listed: {\"default\": 16, \"US\": 13}. The age of digital consent differs by country, inside the EU as well as outside it, which is why a region is a country rather than a regime. Absent, or a country with no entry and no 'default': the deployment's own minimum applies. A declaration, not a gate: whether a deployment enforces it, and how it learns somebody's age and country, are its decisions. At most {minimumAgeRegions} entries, each from 13 to {minimumAgeYears}."
|
|
1838
1838
|
},
|
|
1839
|
+
"min_plugin_api": {
|
|
1840
|
+
"type": "string",
|
|
1841
|
+
"pattern": "^[0-9]+\\.[0-9]+$",
|
|
1842
|
+
"description": "The oldest plug-in API contract this plug-in needs, as 'MAJOR.MINOR': '4.1'. The contract is the plug-in API published with initiative-plugin-sdk, versioned as that package is. A deployment serving contract S can run it when S has the same major version and a minor version at least this one's. Absent: any contract; the plug-in makes no claim. Beside a listing's min_app_version, the oldest Initiative release it runs on, this says what the plug-in calls rather than which release serves it."
|
|
1843
|
+
},
|
|
1839
1844
|
"hosts": {
|
|
1840
1845
|
"type": "array",
|
|
1841
1846
|
"minItems": 1,
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "initiative-plugin-sdk",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.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",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/
|
|
9
|
+
"url": "git+https://github.com/beyonders-studio/initiative-plugin-sdk.git"
|
|
10
10
|
},
|
|
11
|
-
"homepage": "https://github.com/
|
|
12
|
-
"bugs": "https://github.com/
|
|
11
|
+
"homepage": "https://github.com/beyonders-studio/initiative-plugin-sdk#readme",
|
|
12
|
+
"bugs": "https://github.com/beyonders-studio/initiative-plugin-sdk/issues",
|
|
13
13
|
"keywords": [
|
|
14
14
|
"initiative",
|
|
15
15
|
"plugin",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"default": "./dist/testing.js"
|
|
47
47
|
},
|
|
48
48
|
"./schemas/plugin-manifest.json": "./schemas/plugin-manifest.json",
|
|
49
|
+
"./plugin-api.json": "./schemas/plugin-api.json",
|
|
49
50
|
"./manifest.contract.json": "./manifest.contract.json"
|
|
50
51
|
},
|
|
51
52
|
"bin": {
|
|
@@ -68,7 +69,7 @@
|
|
|
68
69
|
"typecheck": "tsc --noEmit",
|
|
69
70
|
"prepublishOnly": "npm run build",
|
|
70
71
|
"generate": "node scripts/generate.mjs",
|
|
71
|
-
"check:generated": "node scripts/generate.mjs --check",
|
|
72
|
+
"check:generated": "node scripts/generate.mjs --check && node scripts/generate-plugin-api.mjs --check",
|
|
72
73
|
"generate:plugin-api": "node scripts/generate-plugin-api.mjs"
|
|
73
74
|
},
|
|
74
75
|
"dependencies": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://
|
|
3
|
+
"$id": "https://initiativetasks.com/schemas/env-contract.json",
|
|
4
4
|
"title": "Initiative app deployment contract",
|
|
5
5
|
"description": "What an app requires of whoever deploys it, published as data at env-contract.json in the app's repository root.\n\nEvery app in the set publishes one, generated from its own settings declaration and committed — because whoever reads it has a checkout, not a build. A deployment tool reads these instead of parsing each app's source, which is how a setting enforced by a validator rather than by a missing default came to be absent from the Helm chart until 2026-09-23.\n\nThe classes exist because 'required' is the distinction that misleads. An app with 131 settings and 3 mandatory ones is easy to deploy; an app that presents all 131 as configuration is not, and they look identical until someone splits them up.",
|
|
6
6
|
"type": "object",
|