@makehq/forman-schema 1.4.0 → 1.4.1
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/index.cjs +5 -1
- package/dist/index.js +5 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -42,6 +42,10 @@ function containsIMLExpression(value) {
|
|
|
42
42
|
if (typeof value !== "string") return false;
|
|
43
43
|
return value.indexOf("{{") > -1 && value.indexOf("}}") > -1;
|
|
44
44
|
}
|
|
45
|
+
function isPrimitiveIMLExpression(value) {
|
|
46
|
+
if (typeof value !== "string") return false;
|
|
47
|
+
return value.lastIndexOf("{{") === 0 && value.indexOf("}}") === value.length - 2;
|
|
48
|
+
}
|
|
45
49
|
var API_ENDPOINTS = {
|
|
46
50
|
account: "api://connections/{{kind}}",
|
|
47
51
|
aiagent: "api://ai-agents/v1/agents",
|
|
@@ -512,7 +516,7 @@ async function validateFormanValue(value, field, context) {
|
|
|
512
516
|
const expectedType = FORMAN_TYPE_MAP2[normalizedField.type];
|
|
513
517
|
let actualType = typeof value;
|
|
514
518
|
if (actualType === "object" && Array.isArray(value)) actualType = "array";
|
|
515
|
-
if (expectedType && expectedType !== actualType) {
|
|
519
|
+
if (expectedType && expectedType !== actualType && !isPrimitiveIMLExpression(value)) {
|
|
516
520
|
return {
|
|
517
521
|
valid: false,
|
|
518
522
|
errors: [
|
package/dist/index.js
CHANGED
|
@@ -13,6 +13,10 @@ function containsIMLExpression(value) {
|
|
|
13
13
|
if (typeof value !== "string") return false;
|
|
14
14
|
return value.indexOf("{{") > -1 && value.indexOf("}}") > -1;
|
|
15
15
|
}
|
|
16
|
+
function isPrimitiveIMLExpression(value) {
|
|
17
|
+
if (typeof value !== "string") return false;
|
|
18
|
+
return value.lastIndexOf("{{") === 0 && value.indexOf("}}") === value.length - 2;
|
|
19
|
+
}
|
|
16
20
|
var API_ENDPOINTS = {
|
|
17
21
|
account: "api://connections/{{kind}}",
|
|
18
22
|
aiagent: "api://ai-agents/v1/agents",
|
|
@@ -483,7 +487,7 @@ async function validateFormanValue(value, field, context) {
|
|
|
483
487
|
const expectedType = FORMAN_TYPE_MAP2[normalizedField.type];
|
|
484
488
|
let actualType = typeof value;
|
|
485
489
|
if (actualType === "object" && Array.isArray(value)) actualType = "array";
|
|
486
|
-
if (expectedType && expectedType !== actualType) {
|
|
490
|
+
if (expectedType && expectedType !== actualType && !isPrimitiveIMLExpression(value)) {
|
|
487
491
|
return {
|
|
488
492
|
valid: false,
|
|
489
493
|
errors: [
|