@capybara-hq/kernel 0.1.0-rc.84 → 0.1.0-rc.86
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/dist/admin/admin.module.js +5 -0
- package/dist/admin/health.service.d.ts +2 -2
- package/dist/admin/health.service.js +10 -2
- package/dist/catalog/admin-catalog.controller.d.ts +2 -1
- package/dist/catalog/admin-catalog.controller.js +2 -1
- package/dist/catalog/catalog-content.d.ts +5 -15
- package/dist/catalog/catalog-content.js +5 -56
- package/dist/catalog/catalog-scope.service.d.ts +3 -3
- package/dist/catalog/catalog-scope.service.js +4 -3
- package/dist/catalog/catalog.module.d.ts +3 -1
- package/dist/catalog/catalog.module.js +14 -1
- package/dist/catalog/component-scope.service.d.ts +6 -1
- package/dist/catalog/component-scope.service.js +16 -2
- package/dist/catalog/job-ids.d.ts +29 -0
- package/dist/catalog/job-ids.js +29 -0
- package/dist/catalog/jobs.d.ts +12 -3
- package/dist/catalog/jobs.js +28 -7
- package/dist/catalog/marketplaces.service.d.ts +1 -1
- package/dist/catalog/org-catalog.controller.d.ts +2 -30
- package/dist/catalog/org-catalog.controller.js +3 -29
- package/dist/catalog/org-catalog.schemas.d.ts +9 -46
- package/dist/catalog/org-catalog.schemas.js +9 -23
- package/dist/catalog/org-catalog.service.js +14 -23
- package/dist/catalog/plugin-import.d.ts +21 -0
- package/dist/catalog/plugin-import.js +33 -3
- package/dist/catalog/plugin-install.d.ts +69 -76
- package/dist/catalog/plugin-install.js +156 -234
- package/dist/catalog/plugin-upgrade.d.ts +71 -11
- package/dist/catalog/plugin-upgrade.js +222 -43
- package/dist/catalog/scope-sync.d.ts +22 -20
- package/dist/catalog/scope-sync.js +57 -42
- package/dist/catalog/template-connector-ensure.d.ts +100 -0
- package/dist/catalog/template-connector-ensure.js +285 -0
- package/dist/catalog/template-connector-jobs.d.ts +28 -0
- package/dist/catalog/template-connector-jobs.js +54 -0
- package/dist/catalog/template-connector-reconcile.d.ts +44 -0
- package/dist/catalog/template-connector-reconcile.js +114 -0
- package/dist/catalog/template-connectors.processor.d.ts +32 -0
- package/dist/catalog/template-connectors.processor.js +101 -0
- package/dist/channels/cards.d.ts +7 -3
- package/dist/channels/cards.js +9 -4
- package/dist/channels/phrases.d.ts +10 -0
- package/dist/channels/phrases.js +10 -0
- package/dist/config/docs.js +1 -1
- package/dist/config/schema.d.ts +3 -0
- package/dist/config/schema.js +18 -12
- package/dist/ctx/create-ctx.d.ts +10 -1
- package/dist/ctx/create-ctx.js +42 -2
- package/dist/db/kernel-schema.d.ts +2 -1
- package/dist/device-access/device-access.module.d.ts +7 -0
- package/dist/device-access/device-access.module.js +41 -0
- package/dist/device-access/device-access.service.d.ts +142 -0
- package/dist/device-access/device-access.service.js +464 -0
- package/dist/device-access/token.d.ts +6 -0
- package/dist/device-access/token.js +6 -0
- package/dist/device-access/viewer-routes.d.ts +45 -0
- package/dist/device-access/viewer-routes.js +81 -0
- package/dist/device-access/viewer.d.ts +244 -0
- package/dist/device-access/viewer.js +844 -0
- package/dist/dial-in/access.d.ts +19 -0
- package/dist/dial-in/access.js +23 -0
- package/dist/dial-in/gateway.d.ts +48 -6
- package/dist/dial-in/gateway.js +145 -10
- package/dist/dial-in/keys.d.ts +7 -0
- package/dist/dial-in/keys.js +7 -0
- package/dist/dial-in/routes.d.ts +11 -3
- package/dist/dial-in/routes.js +15 -4
- package/dist/dial-in/streams.d.ts +58 -0
- package/dist/dial-in/streams.js +283 -0
- package/dist/errors.d.ts +2 -0
- package/dist/errors.js +2 -0
- package/dist/extensions/host.d.ts +13 -1
- package/dist/extensions/host.js +20 -1
- package/dist/extensions/org-config.d.ts +6 -1
- package/dist/extensions/org-config.js +15 -2
- package/dist/extensions/permission-set.d.ts +15 -1
- package/dist/extensions/permission-set.js +13 -1
- package/dist/extensions/permission-view.d.ts +6 -4
- package/dist/extensions/permission-view.js +6 -1
- package/dist/git/gateway.js +3 -1
- package/dist/http/error.filter.js +2 -0
- package/dist/http/gateway-routes.d.ts +8 -4
- package/dist/http/gateway-routes.js +4 -3
- package/dist/infra/lock/lock.service.d.ts +5 -1
- package/dist/infra/lock/lock.service.js +10 -4
- package/dist/infra/outbox/registry.d.ts +28 -0
- package/dist/infra/outbox/registry.js +33 -0
- package/dist/infra/queue/queue-names.d.ts +1 -1
- package/dist/infra/queue/queue-names.js +2 -0
- package/dist/infra/throttler/named-throttlers.d.ts +3 -0
- package/dist/infra/throttler/named-throttlers.js +16 -0
- package/dist/kernel.module.js +3 -0
- package/dist/lifecycle/kernel-lifecycle.d.ts +8 -1
- package/dist/lifecycle/kernel-lifecycle.js +37 -11
- package/dist/orgs/org-owner.d.ts +7 -0
- package/dist/orgs/org-owner.js +16 -0
- package/dist/platform/operation.d.ts +3 -4
- package/dist/platform/ops/connectors.ops.js +8 -1
- package/dist/platform/ops/org-plugins.ops.d.ts +0 -9
- package/dist/platform/ops/org-plugins.ops.js +18 -235
- package/dist/platform/ops/plugins.ops.d.ts +0 -1
- package/dist/platform/ops/plugins.ops.js +3 -31
- package/dist/roles/gateway-role.d.ts +13 -6
- package/dist/roles/gateway-role.js +27 -9
- package/dist/roles/gateway.module.d.ts +2 -1
- package/dist/roles/gateway.module.js +13 -3
- package/dist/roles/worker-role.d.ts +9 -4
- package/dist/roles/worker-role.js +18 -5
- package/dist/roles/worker.module.d.ts +1 -1
- package/dist/roles/worker.module.js +8 -1
- package/dist/sandbox/device-services.d.ts +62 -0
- package/dist/sandbox/device-services.js +183 -0
- package/dist/sandbox/leases.d.ts +18 -1
- package/dist/sandbox/leases.js +75 -1
- package/dist/sandbox/network-grants.js +5 -2
- package/dist/sandbox/sandbox.module.d.ts +2 -1
- package/dist/sandbox/sandbox.module.js +5 -2
- package/dist/sandbox/sandbox.service.d.ts +44 -1
- package/dist/sandbox/sandbox.service.js +142 -5
- package/dist/setup/setup-guides.service.d.ts +9 -1
- package/dist/setup/setup-guides.service.js +38 -8
- package/dist/tools/admin-connectors.d.ts +3 -2
- package/dist/tools/admin-connectors.js +5 -4
- package/dist/tools/approvals.service.d.ts +45 -20
- package/dist/tools/approvals.service.js +19 -9
- package/dist/tools/call-scope.d.ts +60 -0
- package/dist/tools/call-scope.js +23 -0
- package/dist/tools/connector-setup.d.ts +28 -0
- package/dist/tools/connector-setup.js +33 -0
- package/dist/tools/connector-tools-jobs.d.ts +35 -0
- package/dist/tools/connector-tools-jobs.js +40 -0
- package/dist/tools/connector-tools.processor.d.ts +32 -0
- package/dist/tools/connector-tools.processor.js +97 -0
- package/dist/tools/connectors.controller.d.ts +1 -0
- package/dist/tools/connectors.schemas.d.ts +1 -0
- package/dist/tools/connectors.schemas.js +5 -0
- package/dist/tools/connectors.service.d.ts +138 -14
- package/dist/tools/connectors.service.js +410 -50
- package/dist/tools/credentials.d.ts +35 -0
- package/dist/tools/credentials.js +89 -1
- package/dist/tools/drift.d.ts +5 -0
- package/dist/tools/drift.js +21 -2
- package/dist/tools/editable-endpoint.d.ts +23 -0
- package/dist/tools/editable-endpoint.js +92 -0
- package/dist/tools/network-asks.d.ts +13 -0
- package/dist/tools/network-asks.js +26 -2
- package/dist/tools/oauth/flow.d.ts +1 -1
- package/dist/tools/oauth/flow.js +3 -2
- package/dist/tools/pipeline.d.ts +30 -1
- package/dist/tools/pipeline.js +299 -59
- package/dist/tools/questions.service.d.ts +24 -3
- package/dist/tools/questions.service.js +3 -1
- package/dist/tools/registry.d.ts +14 -2
- package/dist/tools/registry.js +27 -6
- package/dist/tools/tools.module.js +4 -0
- package/package.json +3 -3
- package/src/migrations/0183_connectors_created_by_nullable.sql +5 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type AgentTemplate, type ConnectorTemplateFile, type
|
|
1
|
+
import { type AgentTemplate, type ConnectorTemplateFile, type PluginManifest } from "@capybara-hq/plugin-sdk";
|
|
2
2
|
import type { KernelSchemaDb, PluginInstallStatus, SourceFormat } from "../db/kernel-schema.js";
|
|
3
|
-
import { ApiError } from "../errors.js";
|
|
4
3
|
import { OrgExtensionConfigs, type OrgExtensionInput, type OrgExtensionPutOptions } from "../extensions/org-config.js";
|
|
5
4
|
import { ExtensionRegistry } from "../extensions/registry.js";
|
|
6
5
|
import { KernelConfigService } from "../infra/config/kernel-config.service.js";
|
|
7
6
|
import { KernelDb } from "../infra/database/kernel-db.js";
|
|
8
7
|
import { TransactionHost } from "../infra/database/transaction-host.js";
|
|
8
|
+
import { OutboxService } from "../infra/outbox/outbox.service.js";
|
|
9
9
|
import type { KernelLogger } from "../log.js";
|
|
10
10
|
import { OrgLock } from "../orgs/org-lock.js";
|
|
11
11
|
import type { OrgAction } from "../orgs/roles.js";
|
|
@@ -16,7 +16,11 @@ import type { ConnectorDetail, CreateConnectorInput, ToolIssue } from "../tools/
|
|
|
16
16
|
import { ConnectorsService } from "../tools/connectors.service.js";
|
|
17
17
|
import { type CatalogVersionFiles, type TemplateDeps } from "./catalog-content.js";
|
|
18
18
|
import { type DefinitionRefs, type TemplateSwitch } from "./component-state.js";
|
|
19
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* What an org fills in for one more connector from a connector template (C30; `POST …/
|
|
21
|
+
* connector-templates/:templateId/connectors`). Installs and enables take none (plugin pages spec
|
|
22
|
+
* §5.2.2).
|
|
23
|
+
*/
|
|
20
24
|
export interface ConnectorInstallInput {
|
|
21
25
|
name?: string;
|
|
22
26
|
slug?: string;
|
|
@@ -29,12 +33,12 @@ export interface ConnectorInstallInput {
|
|
|
29
33
|
};
|
|
30
34
|
}
|
|
31
35
|
/**
|
|
32
|
-
* What an org
|
|
33
|
-
* without `version`).
|
|
34
|
-
*
|
|
36
|
+
* What an org chooses when installing a plugin (the body of `POST …/catalog/:itemId/install`
|
|
37
|
+
* without `version`). No connector input (plugin pages spec §5.2.2): every connector template on
|
|
38
|
+
* becomes a connector, one that lacks an org credential or OAuth client waits as `needs_config`.
|
|
39
|
+
* Dependencies get no choice.
|
|
35
40
|
*/
|
|
36
41
|
export interface PluginInstallInput {
|
|
37
|
-
connectors?: Record<string, ConnectorInstallInput>;
|
|
38
42
|
/**
|
|
39
43
|
* The connector templates the org chose to switch on with the install (the install wizard's choose step):
|
|
40
44
|
* exactly these are on afterwards, the others switched off in the org. Absent: the templates on
|
|
@@ -101,11 +105,6 @@ export interface UninstallPreview {
|
|
|
101
105
|
export declare function uninstallPreviewHash(p: UninstallPreview): string;
|
|
102
106
|
/** Upserts the org's switch row of an item in the caller's transaction (the org lock is held). */
|
|
103
107
|
export declare function upsertOrgSwitch(db: KernelSchemaDb, orgId: string, itemId: string, enabled: boolean, actor: string | null): Promise<void>;
|
|
104
|
-
/** The kernel (actor null, the scope sync) never installs what needs the org's input. */
|
|
105
|
-
export declare class NeedsOrgInput extends ApiError {
|
|
106
|
-
readonly plugin: string;
|
|
107
|
-
constructor(plugin: string);
|
|
108
|
-
}
|
|
109
108
|
/** A plugin install in an org (`GET /orgs/:orgId/plugin-installs`). */
|
|
110
109
|
export interface PluginInstallView {
|
|
111
110
|
id: string;
|
|
@@ -232,17 +231,6 @@ export interface UninstallCtx {
|
|
|
232
231
|
* {@link DEPENDENCY_DEPTH_LIMIT} -> `catalog.dependency_cycle`. Returns the direct dependencies.
|
|
233
232
|
*/
|
|
234
233
|
export declare function resolveDependencies(db: KernelSchemaDb, manifest: PluginManifest): Promise<ResolvedDependency[]>;
|
|
235
|
-
/**
|
|
236
|
-
* The input a template needs that the org did not give: a static credential (the org's for an
|
|
237
|
-
* org-owned template; for a personal one the installer's own, stored as their personal credential,
|
|
238
|
-
* since creating the connector lists its tools with it), or the OAuth client of a
|
|
239
|
-
* client-credentials / manual-client template. Undefined when nothing is missing.
|
|
240
|
-
* `personalCredential: false` keeps a personal static template optional (an existing connector
|
|
241
|
-
* whose template's auth changed: its members keep giving their own).
|
|
242
|
-
*/
|
|
243
|
-
export declare function missingTemplateInput(template: ConnectorTemplateSpec, given: ConnectorInstallInput | undefined, o?: {
|
|
244
|
-
personalCredential?: boolean;
|
|
245
|
-
}): "credential" | "client" | undefined;
|
|
246
234
|
/** `e` with its validation paths under `at` (input errors of a template's connector). */
|
|
247
235
|
export declare function under(e: unknown, at: string): unknown;
|
|
248
236
|
/**
|
|
@@ -285,6 +273,8 @@ export declare class PluginInstaller {
|
|
|
285
273
|
/** Org connectors: installs create, upgrade and remove them. */
|
|
286
274
|
private readonly connectors;
|
|
287
275
|
private readonly log;
|
|
276
|
+
/** Owes the template connector ensure of an install's commit (`markInstalled`). */
|
|
277
|
+
private readonly outbox;
|
|
288
278
|
readonly txHost: TransactionHost;
|
|
289
279
|
constructor(kdb: KernelDb,
|
|
290
280
|
/** The org row lock (orgs/org-lock.ts): joins the caller's transaction. */
|
|
@@ -292,7 +282,9 @@ export declare class PluginInstaller {
|
|
|
292
282
|
/** The loaded extensions and connectors of this replica (the extension registry). */
|
|
293
283
|
registry: ExtensionRegistry, skills: SkillsService, orgConfigs: OrgExtensionConfigs, config: KernelConfigService,
|
|
294
284
|
/** Org connectors: installs create, upgrade and remove them. */
|
|
295
|
-
connectors: ConnectorsService, log: KernelLogger,
|
|
285
|
+
connectors: ConnectorsService, log: KernelLogger,
|
|
286
|
+
/** Owes the template connector ensure of an install's commit (`markInstalled`). */
|
|
287
|
+
outbox: Pick<OutboxService, "add">, txHost: TransactionHost);
|
|
296
288
|
/** The kernel-schema handle of the current context (the transaction, else the pool). */
|
|
297
289
|
private get db();
|
|
298
290
|
/** `catalog.staleInstallMinutes`: an install `installing` for longer can be cleaned up by uninstalling it. */
|
|
@@ -328,9 +320,10 @@ export declare class PluginInstaller {
|
|
|
328
320
|
templateDeps(): TemplateDeps;
|
|
329
321
|
/**
|
|
330
322
|
* Plans the install of one plugin version and, depth first, of its dependencies not yet
|
|
331
|
-
* installed in the org. `input` null
|
|
332
|
-
* an empty input. `at`
|
|
333
|
-
* `approvedBy` is the root
|
|
323
|
+
* installed in the org. `input` null plans no connectors (preflight, the scope preview: only the
|
|
324
|
+
* templates' connector extensions are checked); dependencies always get an empty input. `at`
|
|
325
|
+
* prefixes validation paths (`dependencies.<name>.` for a dependency); `approvedBy` is the root
|
|
326
|
+
* item for a dependency.
|
|
334
327
|
*/
|
|
335
328
|
plan(orgId: string, actor: string | null, itemId: string, version: string, input: PluginInstallInput | null, at: string, approvedBy: string | undefined): Promise<InstallPlan>;
|
|
336
329
|
/**
|
|
@@ -353,18 +346,20 @@ export declare class PluginInstaller {
|
|
|
353
346
|
name: string;
|
|
354
347
|
}[]): Promise<ResolvedDependency[]>;
|
|
355
348
|
/**
|
|
356
|
-
* The connector
|
|
357
|
-
* the template's connector extension deployed
|
|
358
|
-
*
|
|
349
|
+
* The connector of one template as an install creates it (plugin pages spec §5.2.2), checked
|
|
350
|
+
* without a connection: the template's connector extension deployed and its preset valid. No
|
|
351
|
+
* input is asked for: a template that needs an org credential or OAuth client becomes a
|
|
352
|
+
* `needs_config` connector ({@link setupNeed}), one that needs none `ready`. The name and slug
|
|
353
|
+
* are the first free defaults, chosen under the org lock (`slugDefault`), so an org connector of
|
|
354
|
+
* the same slug never blocks an install nobody can give input to.
|
|
359
355
|
*/
|
|
360
|
-
planConnector(actor: string, plugin: {
|
|
356
|
+
planConnector(actor: string | null, plugin: {
|
|
361
357
|
itemId: string;
|
|
362
358
|
version: string;
|
|
363
|
-
name: string;
|
|
364
359
|
}, ct: {
|
|
365
360
|
id: string;
|
|
366
361
|
file: ConnectorTemplateFile;
|
|
367
|
-
},
|
|
362
|
+
}, at: string, approvedBy: string | undefined): CreateConnectorInput;
|
|
368
363
|
/**
|
|
369
364
|
* The org's live install of a dependency's item (installing or installed), or undefined. One at a
|
|
370
365
|
* version outside the dependency's range -> `catalog.dependency_unresolved` (org upgrades arrive in
|
|
@@ -426,8 +421,6 @@ export declare class PluginInstaller {
|
|
|
426
421
|
* unaffected.
|
|
427
422
|
*/
|
|
428
423
|
planExtension(orgId: string, manifest: PluginManifest): Promise<string | null>;
|
|
429
|
-
/** The input only names the plugin's template ids. */
|
|
430
|
-
private checkInput;
|
|
431
424
|
/**
|
|
432
425
|
* Undoes the components this install created, in reverse order (the role is not re-checked: it
|
|
433
426
|
* undoes this install's own changes); returns the ones that failed. The component rows of undone
|
|
@@ -526,25 +519,11 @@ export declare class PluginInstaller {
|
|
|
526
519
|
/**
|
|
527
520
|
* Installs the dependencies an installed plugin's version declares and the org lacks (rule 9),
|
|
528
521
|
* as the kernel (actor null): a platform update can add one. Each is recorded on the install
|
|
529
|
-
* as a `plugin` component (created when this installed it, so an uninstall takes it along)
|
|
530
|
-
*
|
|
531
|
-
*
|
|
522
|
+
* as a `plugin` component (created when this installed it, so an uninstall takes it along); its
|
|
523
|
+
* connector templates become connectors as at any install. A dependency already installed in
|
|
524
|
+
* the org is recorded as it is (created false). Returns how many dependencies it installed.
|
|
532
525
|
*/
|
|
533
|
-
addMissingDependencies(orgId: string, installId: string): Promise<
|
|
534
|
-
/**
|
|
535
|
-
* The connector templates of an installed plugin that are on in the org (ruling P2-6) and have
|
|
536
|
-
* no live connector there: made from the platform template (`platform_template_id`) or recorded
|
|
537
|
-
* on the install (`template_id`). The org's plugin is `needs_config` while any is missing (ruling
|
|
538
|
-
* P2-10). Empty for a plugin not installed.
|
|
539
|
-
*/
|
|
540
|
-
missingConnectors(orgId: string, itemId: string): Promise<{
|
|
541
|
-
installId: string;
|
|
542
|
-
version: string;
|
|
543
|
-
templates: {
|
|
544
|
-
id: string;
|
|
545
|
-
file: ConnectorTemplateFile;
|
|
546
|
-
}[];
|
|
547
|
-
} | undefined>;
|
|
526
|
+
addMissingDependencies(orgId: string, installId: string): Promise<number>;
|
|
548
527
|
/**
|
|
549
528
|
* The org's live connectors made from one of the item's connector templates, oldest first
|
|
550
529
|
* (`templateId` picks one): an uninstall keeps a connector its agents use, and the plugin's next
|
|
@@ -555,34 +534,23 @@ export declare class PluginInstaller {
|
|
|
555
534
|
private liveTemplateConnector;
|
|
556
535
|
/**
|
|
557
536
|
* The org's connector templates it already has a live connector for, by template id: the install
|
|
558
|
-
* takes that connector back instead of creating one
|
|
559
|
-
*
|
|
537
|
+
* takes that connector back instead of creating one (the same join as
|
|
538
|
+
* {@link liveTemplateConnector}).
|
|
560
539
|
*/
|
|
561
540
|
connectedTemplates(orgId: string, itemId: string): Promise<Set<string>>;
|
|
562
|
-
/**
|
|
563
|
-
* Creates the connectors an installed plugin is missing (ruling P2-10, `POST …/catalog/:itemId/
|
|
564
|
-
* connectors`): `input.connectors` names some of {@link missingConnectors}' templates with the
|
|
565
|
-
* same input as an install (endpoint, credential or OAuth client); each is created as at install
|
|
566
|
-
* and recorded on the install. Returns the created connectors by template.
|
|
567
|
-
*/
|
|
568
|
-
configureConnectors(orgId: string, actor: string, itemId: string, input: PluginInstallInput, opts?: {
|
|
569
|
-
actorTokenId?: string;
|
|
570
|
-
auditDetail?: AuditDetail;
|
|
571
|
-
}): Promise<{
|
|
572
|
-
templateId: string;
|
|
573
|
-
connectorId: string;
|
|
574
|
-
}[]>;
|
|
575
|
-
/** A configured connector's ledger row (its own transaction). */
|
|
576
|
-
private recordConnector;
|
|
577
541
|
/**
|
|
578
542
|
* One more connector from a platform connector template on in the org (rulings P4-7, P4-T6-8;
|
|
579
543
|
* `POST …/connector-templates/:templateId/connectors`): `templateId` is the platform connector
|
|
580
|
-
* template's id; `config` is
|
|
581
|
-
*
|
|
582
|
-
*
|
|
583
|
-
*
|
|
584
|
-
*
|
|
585
|
-
*
|
|
544
|
+
* template's id; `config` is the connector's input (endpoint, credential or OAuth client, slug)
|
|
545
|
+
* and `name` its name. Without a slug the name and slug default to the first free ones, chosen
|
|
546
|
+
* by the create under the org lock after its outbound calls (`CreateConnectorInput.slugDefault`);
|
|
547
|
+
* only a given slug answers 409 `connector.slug_taken`. As on the connectors page's own create,
|
|
548
|
+
* the org credential or OAuth client the template needs is required; a personal static template
|
|
549
|
+
* given no credential is created ready without one, and a `dcr` one without a client
|
|
550
|
+
* (`createDeferredIn`: its members connect their own, the client registers on the first
|
|
551
|
+
* connect). Otherwise created by `ConnectorsService.create`, which lists the tools, checks the
|
|
552
|
+
* slug before any outbound call and re-checks it, `connectors.manage`, the item and the
|
|
553
|
+
* template being on under the org lock. Linked to the
|
|
586
554
|
* template, and recorded on the plugin's live install in the org when there is one. A template
|
|
587
555
|
* that is missing, deleted or not offered to the org -> 404 `component.not_found`; offered but
|
|
588
556
|
* off there (its plugin not installed, or switched off) -> 409 `component.off`; input errors ->
|
|
@@ -598,11 +566,36 @@ export declare class PluginInstaller {
|
|
|
598
566
|
connector: ConnectorDetail;
|
|
599
567
|
issues: ToolIssue[];
|
|
600
568
|
}>;
|
|
569
|
+
/**
|
|
570
|
+
* The connector of a platform connector template an org admin just switched on (plugin pages
|
|
571
|
+
* spec §5.2.2: a template switched on later creates its connector under the install rule), in
|
|
572
|
+
* the switch's transaction: only where the org has the template's plugin installed and no live
|
|
573
|
+
* connector from the template yet (one a switch-off kept is reused, left as it is). Created like
|
|
574
|
+
* an install's ({@link planConnector}, `createDeferredIn`: no outbound call, `needs_config` when
|
|
575
|
+
* it needs an org credential or OAuth client) and recorded on the install. Returns its id, or
|
|
576
|
+
* undefined when none was created. `actor` null: the kernel itself (the startup reconciliation,
|
|
577
|
+
* `TemplateConnectorReconciler`), which checks the template is on and holds the org lock.
|
|
578
|
+
*/
|
|
579
|
+
createSwitchedOnTemplateConnectorIn(orgId: string, actor: string | null, platformTemplateId: string, opts?: {
|
|
580
|
+
actorTokenId?: string;
|
|
581
|
+
auditDetail?: AuditDetail;
|
|
582
|
+
}): Promise<string | undefined>;
|
|
583
|
+
/**
|
|
584
|
+
* Records a connector made from one of the item's connector templates on the org's install of
|
|
585
|
+
* the item whose status is one of `statuses` (`created`: the plugin made it, so an uninstall and
|
|
586
|
+
* upgrades see it), in the caller's transaction. True when such an install exists.
|
|
587
|
+
*/
|
|
588
|
+
recordTemplateConnectorIn(orgId: string, itemId: string, connectorId: string, templateId: string, statuses: readonly PluginInstallStatus[]): Promise<boolean>;
|
|
601
589
|
/**
|
|
602
590
|
* Records a connector made from a plugin's template on the org's live install of that plugin,
|
|
603
591
|
* when there is one, under the org lock (so an uninstall in between is seen).
|
|
604
592
|
*/
|
|
605
593
|
private recordOnLiveInstall;
|
|
594
|
+
/** The `connector@1` implementations loaded on this replica, by extension and kind. */
|
|
595
|
+
loadedConnectors(): {
|
|
596
|
+
plugin: string;
|
|
597
|
+
kind: string;
|
|
598
|
+
}[];
|
|
606
599
|
/** The connector kinds an extension provides (the `connector@1` implementations loaded on this replica). */
|
|
607
600
|
connectorKindsOf(plugin: string): string[];
|
|
608
601
|
/**
|