A private plug-in¶
A deployment's owner can publish a plug-in of their own, which then sits on that deployment's shelf beside the registry's. Start one from the example, a declarative plug-in with one read and one widget:
npx initiative-plugin-sdk init my-plugin # copies examples/minimal, with a uid of its own
cd my-plugin && npm install && npm test
pack builds the plug-in as build does, checks it the same way, and writes its
listing file: what the catalogue shows, this version's manifest, and the
plug-in's registration. The deployment publishes it as it is, from
POST /api/v1/marketplace/local/upload (the file as {"manifest": …}) or from
its catalog directory (MARKETPLACE_EXTRA_CATALOG_DIR). The listing's picture
is named by its digest, so upload it beside the file, to
POST /api/v1/marketplace/local/media; PNG, JPEG, GIF and WebP are kept, and
any other picture leaves the deployment's default mark. Both routes take the
owner's session or personal API key. A container plug-in packs too, and is live
once its service is registered on the deployment.
dev packs a declarative or tool plug-in and uploads it, with its picture, to your
deployment, then again a moment after each change in the directory holding
src/plugin.ts. The key may be given as INITIATIVE_API_KEY instead. It prints
each upload and the deployment's answer:
uploaded example.gitlab-issues 1.0.0-dev.3f9a2c1b (uid ZNV2THEZGPHXXG): 201 {"uid":"ZNV2THEZGPHXXG","public_id":"example.gitlab-issues","version":"1.0.0-dev.3f9a2c1b"}
watching src for changes
A deployment publishes each version once, so each upload is versioned
<listing version>-dev.<digest>. A community that installed the plug-in moves to
it from its Update button, or on its own if it follows updates. The plug-in is
offered once the vendor values its manifest requires are set under the
deployment's plug-in services.