@lunnoa/client 1.0.0 → 1.1.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 +7 -1
- package/dist/cli.js +97 -3
- 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/dist/react.js
CHANGED
|
@@ -1038,6 +1038,21 @@ var EntitiesResource = class {
|
|
|
1038
1038
|
};
|
|
1039
1039
|
|
|
1040
1040
|
// src/resources/entity-types.ts
|
|
1041
|
+
function entityTypeDefinitionToUpsert(def) {
|
|
1042
|
+
return {
|
|
1043
|
+
slug: def.slug,
|
|
1044
|
+
name: def.name,
|
|
1045
|
+
namePlural: def.namePlural,
|
|
1046
|
+
description: def.description,
|
|
1047
|
+
icon: def.icon,
|
|
1048
|
+
color: def.color,
|
|
1049
|
+
attributeSchema: def.attributeSchema,
|
|
1050
|
+
stateSchema: def.stateSchema,
|
|
1051
|
+
isEnabled: def.isEnabled,
|
|
1052
|
+
allowUnknownAttributes: def.allowUnknownAttributes ?? false,
|
|
1053
|
+
managedByCode: true
|
|
1054
|
+
};
|
|
1055
|
+
}
|
|
1041
1056
|
var EntityTypesResource = class {
|
|
1042
1057
|
constructor(http) {
|
|
1043
1058
|
this.http = http;
|
|
@@ -1068,6 +1083,19 @@ var EntityTypesResource = class {
|
|
|
1068
1083
|
query: { expansion: serializeCsv(options.expansion) }
|
|
1069
1084
|
});
|
|
1070
1085
|
}
|
|
1086
|
+
/**
|
|
1087
|
+
* Creates or updates an entity type by workspace-scoped slug.
|
|
1088
|
+
* Prefer the CLI (`npx @lunnoa/client entity-types deploy`) for happy-path deploy.
|
|
1089
|
+
*/
|
|
1090
|
+
upsertBySlug(definition) {
|
|
1091
|
+
const payload = "kind" in definition && definition.kind === "entityType" ? entityTypeDefinitionToUpsert(definition) : definition;
|
|
1092
|
+
return this.http.post("/api/object-types/upsert", {
|
|
1093
|
+
body: payload,
|
|
1094
|
+
query: {
|
|
1095
|
+
expansion: "attributeSchema,stateSchema,description"
|
|
1096
|
+
}
|
|
1097
|
+
});
|
|
1098
|
+
}
|
|
1071
1099
|
};
|
|
1072
1100
|
|
|
1073
1101
|
// src/resources/approvals.ts
|