@lunnoa/client 1.0.0 → 1.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/README.md +27 -1
- package/dist/cli.js +832 -62
- package/dist/index.cjs +45 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1092 -932
- package/dist/index.d.ts +1092 -932
- package/dist/index.js +44 -2
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +28 -0
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +741 -630
- package/dist/react.d.ts +741 -630
- package/dist/react.js +28 -0
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
- package/skills/lunnoa-client/SKILL.md +19 -3
- package/skills/lunnoa-solution-design/SKILL.md +9 -7
package/dist/index.cjs
CHANGED
|
@@ -533,7 +533,8 @@ var DEFINE_KINDS = {
|
|
|
533
533
|
aiConnection: "aiConnection",
|
|
534
534
|
action: "action",
|
|
535
535
|
workflow: "workflow",
|
|
536
|
-
agent: "agent"
|
|
536
|
+
agent: "agent",
|
|
537
|
+
entityType: "entityType"
|
|
537
538
|
};
|
|
538
539
|
function defineConnection(config = {}) {
|
|
539
540
|
return { kind: DEFINE_KINDS.connection, ...config };
|
|
@@ -568,6 +569,19 @@ function defineAgent(config) {
|
|
|
568
569
|
}
|
|
569
570
|
return { kind: DEFINE_KINDS.agent, ...config };
|
|
570
571
|
}
|
|
572
|
+
function defineEntityType(config) {
|
|
573
|
+
if (!config.slug?.trim()) {
|
|
574
|
+
throw new Error("defineEntityType requires slug");
|
|
575
|
+
}
|
|
576
|
+
if (!config.attributeSchema || typeof config.attributeSchema !== "object" || Array.isArray(config.attributeSchema)) {
|
|
577
|
+
throw new Error("defineEntityType requires attributeSchema object");
|
|
578
|
+
}
|
|
579
|
+
return {
|
|
580
|
+
kind: DEFINE_KINDS.entityType,
|
|
581
|
+
allowUnknownAttributes: false,
|
|
582
|
+
...config
|
|
583
|
+
};
|
|
584
|
+
}
|
|
571
585
|
function resolveActionAppId(action) {
|
|
572
586
|
if (action.appId?.trim()) {
|
|
573
587
|
return action.appId.trim();
|
|
@@ -1045,6 +1059,21 @@ var EntitiesResource = class {
|
|
|
1045
1059
|
};
|
|
1046
1060
|
|
|
1047
1061
|
// src/resources/entity-types.ts
|
|
1062
|
+
function entityTypeDefinitionToUpsert(def) {
|
|
1063
|
+
return {
|
|
1064
|
+
slug: def.slug,
|
|
1065
|
+
name: def.name,
|
|
1066
|
+
namePlural: def.namePlural,
|
|
1067
|
+
description: def.description,
|
|
1068
|
+
icon: def.icon,
|
|
1069
|
+
color: def.color,
|
|
1070
|
+
attributeSchema: def.attributeSchema,
|
|
1071
|
+
stateSchema: def.stateSchema,
|
|
1072
|
+
isEnabled: def.isEnabled,
|
|
1073
|
+
allowUnknownAttributes: def.allowUnknownAttributes ?? false,
|
|
1074
|
+
managedByCode: true
|
|
1075
|
+
};
|
|
1076
|
+
}
|
|
1048
1077
|
var EntityTypesResource = class {
|
|
1049
1078
|
constructor(http) {
|
|
1050
1079
|
this.http = http;
|
|
@@ -1075,6 +1104,19 @@ var EntityTypesResource = class {
|
|
|
1075
1104
|
query: { expansion: serializeCsv(options.expansion) }
|
|
1076
1105
|
});
|
|
1077
1106
|
}
|
|
1107
|
+
/**
|
|
1108
|
+
* Creates or updates an entity type by workspace-scoped slug.
|
|
1109
|
+
* Prefer the CLI (`npx @lunnoa/client entity-types deploy`) for happy-path deploy.
|
|
1110
|
+
*/
|
|
1111
|
+
upsertBySlug(definition) {
|
|
1112
|
+
const payload = "kind" in definition && definition.kind === "entityType" ? entityTypeDefinitionToUpsert(definition) : definition;
|
|
1113
|
+
return this.http.post("/api/object-types/upsert", {
|
|
1114
|
+
body: payload,
|
|
1115
|
+
query: {
|
|
1116
|
+
expansion: "attributeSchema,stateSchema,description"
|
|
1117
|
+
}
|
|
1118
|
+
});
|
|
1119
|
+
}
|
|
1078
1120
|
};
|
|
1079
1121
|
|
|
1080
1122
|
// src/resources/approvals.ts
|
|
@@ -2158,7 +2200,9 @@ exports.defineAction = defineAction;
|
|
|
2158
2200
|
exports.defineAgent = defineAgent;
|
|
2159
2201
|
exports.defineAiConnection = defineAiConnection;
|
|
2160
2202
|
exports.defineConnection = defineConnection;
|
|
2203
|
+
exports.defineEntityType = defineEntityType;
|
|
2161
2204
|
exports.defineWorkflow = defineWorkflow;
|
|
2205
|
+
exports.entityTypeDefinitionToUpsert = entityTypeDefinitionToUpsert;
|
|
2162
2206
|
exports.isBrowserEnvironment = isBrowserEnvironment;
|
|
2163
2207
|
exports.isLoginRequires2FA = isLoginRequires2FA;
|
|
2164
2208
|
exports.iterateOffset = iterateOffset;
|