@elevasis/sdk 1.4.0 → 1.5.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/dist/cli.cjs +75 -8
- package/dist/index.d.ts +1464 -749
- package/dist/index.js +74 -7
- package/dist/types/worker/adapters/crm.d.ts +20 -0
- package/dist/types/worker/adapters/index.d.ts +2 -0
- package/dist/types/worker/adapters/projects.d.ts +20 -0
- package/dist/worker/index.js +41 -1
- package/package.json +2 -2
- package/reference/_navigation.md +24 -0
- package/reference/deployment/provided-features.mdx +64 -25
- package/reference/framework/index.mdx +2 -2
- package/reference/framework/project-structure.mdx +10 -8
- package/reference/index.mdx +3 -3
- package/reference/packages/core/src/organization-model/README.md +19 -4
- package/reference/resources/patterns.mdx +54 -8
- package/reference/scaffold/core/organization-graph.mdx +262 -0
- package/reference/scaffold/core/organization-model.mdx +257 -0
- package/reference/scaffold/index.mdx +59 -0
- package/reference/scaffold/operations/workflow-recipes.md +419 -0
- package/reference/scaffold/recipes/add-a-feature.md +142 -0
- package/reference/scaffold/recipes/add-a-resource.md +163 -0
- package/reference/scaffold/recipes/gate-by-feature-or-admin.md +152 -0
- package/reference/scaffold/recipes/index.md +32 -0
- package/reference/scaffold/reference/contracts.md +1044 -0
- package/reference/scaffold/reference/feature-registry.md +30 -0
- package/reference/scaffold/reference/glossary.md +88 -0
- package/reference/scaffold/ui/composition-extensibility.mdx +216 -0
- package/reference/scaffold/ui/customization.md +239 -0
- package/reference/scaffold/ui/feature-flags-and-gating.md +265 -0
- package/reference/scaffold/ui/feature-shell.mdx +241 -0
- package/reference/scaffold/ui/recipes.md +418 -0
package/dist/cli.cjs
CHANGED
|
@@ -43272,6 +43272,71 @@ var ResourceRegistry = class {
|
|
|
43272
43272
|
validateRelationships(orgName, resources);
|
|
43273
43273
|
}
|
|
43274
43274
|
}
|
|
43275
|
+
/**
|
|
43276
|
+
* Get the remote resource IDs currently registered for an organization.
|
|
43277
|
+
* Used to validate redeployments against the post-swap state before any
|
|
43278
|
+
* live registry mutation occurs.
|
|
43279
|
+
*/
|
|
43280
|
+
getRemoteResourceIds(orgName) {
|
|
43281
|
+
const prefix = `${orgName}/`;
|
|
43282
|
+
const remoteIds = /* @__PURE__ */ new Set();
|
|
43283
|
+
for (const key of this.remoteResources.keys()) {
|
|
43284
|
+
if (key.startsWith(prefix)) {
|
|
43285
|
+
remoteIds.add(key.slice(prefix.length));
|
|
43286
|
+
}
|
|
43287
|
+
}
|
|
43288
|
+
return remoteIds;
|
|
43289
|
+
}
|
|
43290
|
+
/**
|
|
43291
|
+
* Build the "static + surviving" baseline for registration validation.
|
|
43292
|
+
* On redeploy, this strips the currently remote-owned resources and
|
|
43293
|
+
* deployment-owned metadata so validation reflects the state after swap.
|
|
43294
|
+
*/
|
|
43295
|
+
buildRegistrationBase(orgName) {
|
|
43296
|
+
const existingOrg = this.registry[orgName];
|
|
43297
|
+
if (!existingOrg) return void 0;
|
|
43298
|
+
const remoteIds = this.getRemoteResourceIds(orgName);
|
|
43299
|
+
if (remoteIds.size === 0) return existingOrg;
|
|
43300
|
+
const relationships = existingOrg.relationships ? Object.fromEntries(Object.entries(existingOrg.relationships).filter(([resourceId]) => !remoteIds.has(resourceId))) : void 0;
|
|
43301
|
+
return {
|
|
43302
|
+
...existingOrg,
|
|
43303
|
+
version: existingOrg.version ?? "0.0.0",
|
|
43304
|
+
workflows: (existingOrg.workflows ?? []).filter((w) => !remoteIds.has(w.config.resourceId)),
|
|
43305
|
+
agents: (existingOrg.agents ?? []).filter((a) => !remoteIds.has(a.config.resourceId)),
|
|
43306
|
+
triggers: void 0,
|
|
43307
|
+
integrations: void 0,
|
|
43308
|
+
humanCheckpoints: void 0,
|
|
43309
|
+
externalResources: void 0,
|
|
43310
|
+
relationships: relationships && Object.keys(relationships).length > 0 ? relationships : void 0
|
|
43311
|
+
};
|
|
43312
|
+
}
|
|
43313
|
+
/**
|
|
43314
|
+
* Validate the registry state that would exist after registration succeeds.
|
|
43315
|
+
* This runs before any live mutation so invalid redeploys preserve the
|
|
43316
|
+
* currently active remote resources.
|
|
43317
|
+
*/
|
|
43318
|
+
validateRegistrationCandidate(orgName, incoming) {
|
|
43319
|
+
const base = this.buildRegistrationBase(orgName);
|
|
43320
|
+
const candidate = base ? {
|
|
43321
|
+
...base,
|
|
43322
|
+
version: incoming.version ?? base.version ?? "0.0.0",
|
|
43323
|
+
workflows: [...base.workflows ?? [], ...incoming.workflows ?? []],
|
|
43324
|
+
agents: [...base.agents ?? [], ...incoming.agents ?? []],
|
|
43325
|
+
triggers: incoming.triggers,
|
|
43326
|
+
integrations: incoming.integrations,
|
|
43327
|
+
humanCheckpoints: incoming.humanCheckpoints,
|
|
43328
|
+
externalResources: incoming.externalResources,
|
|
43329
|
+
relationships: incoming.relationships ? {
|
|
43330
|
+
...base.relationships ?? {},
|
|
43331
|
+
...incoming.relationships
|
|
43332
|
+
} : base.relationships
|
|
43333
|
+
} : {
|
|
43334
|
+
...incoming,
|
|
43335
|
+
version: incoming.version ?? "0.0.0"
|
|
43336
|
+
};
|
|
43337
|
+
validateDeploymentSpec(orgName, candidate);
|
|
43338
|
+
validateRelationships(orgName, candidate);
|
|
43339
|
+
}
|
|
43275
43340
|
/**
|
|
43276
43341
|
* Get a resource definition by ID
|
|
43277
43342
|
* Returns full definition (WorkflowDefinition or AgentDefinition)
|
|
@@ -43380,13 +43445,10 @@ var ResourceRegistry = class {
|
|
|
43380
43445
|
);
|
|
43381
43446
|
}
|
|
43382
43447
|
}
|
|
43383
|
-
|
|
43384
|
-
|
|
43385
|
-
|
|
43386
|
-
|
|
43387
|
-
if (existingOrg) {
|
|
43388
|
-
const staticWorkflowIds = new Set((existingOrg.workflows ?? []).map((w) => w.config.resourceId));
|
|
43389
|
-
const staticAgentIds = new Set((existingOrg.agents ?? []).map((a) => a.config.resourceId));
|
|
43448
|
+
const validationBase = this.buildRegistrationBase(orgName);
|
|
43449
|
+
if (validationBase) {
|
|
43450
|
+
const staticWorkflowIds = new Set((validationBase.workflows ?? []).map((w) => w.config.resourceId));
|
|
43451
|
+
const staticAgentIds = new Set((validationBase.agents ?? []).map((a) => a.config.resourceId));
|
|
43390
43452
|
for (const id of incomingIds) {
|
|
43391
43453
|
if (staticWorkflowIds.has(id) || staticAgentIds.has(id)) {
|
|
43392
43454
|
throw new Error(
|
|
@@ -43395,6 +43457,11 @@ var ResourceRegistry = class {
|
|
|
43395
43457
|
}
|
|
43396
43458
|
}
|
|
43397
43459
|
}
|
|
43460
|
+
this.validateRegistrationCandidate(orgName, org);
|
|
43461
|
+
if (this.isRemote(orgName)) {
|
|
43462
|
+
this.unregisterOrganization(orgName);
|
|
43463
|
+
}
|
|
43464
|
+
const existingOrg = this.registry[orgName];
|
|
43398
43465
|
if (existingOrg) {
|
|
43399
43466
|
existingOrg.workflows = [...existingOrg.workflows ?? [], ...org.workflows ?? []];
|
|
43400
43467
|
existingOrg.agents = [...existingOrg.agents ?? [], ...org.agents ?? []];
|
|
@@ -43917,7 +43984,7 @@ function wrapAction(commandName, fn) {
|
|
|
43917
43984
|
// package.json
|
|
43918
43985
|
var package_default = {
|
|
43919
43986
|
name: "@elevasis/sdk",
|
|
43920
|
-
version: "1.
|
|
43987
|
+
version: "1.5.0",
|
|
43921
43988
|
description: "SDK for building Elevasis organization resources",
|
|
43922
43989
|
type: "module",
|
|
43923
43990
|
bin: {
|