@osdk/faux 0.19.0 → 0.19.1-beta.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/CHANGELOG.md +11 -0
- package/build/browser/FauxFoundry/typeHelpers/TH_ApplyActionRequestV2.js.map +1 -1
- package/build/browser/FauxFoundry/validateAction.js +10 -0
- package/build/browser/FauxFoundry/validateAction.js.map +1 -1
- package/build/cjs/index.cjs +37 -18
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/index.d.cts +9 -1
- package/build/esm/FauxFoundry/typeHelpers/TH_ApplyActionRequestV2.js.map +1 -1
- package/build/esm/FauxFoundry/validateAction.js +10 -0
- package/build/esm/FauxFoundry/validateAction.js.map +1 -1
- package/build/types/FauxFoundry/typeHelpers/TH_ApplyActionRequestV2.d.ts +9 -1
- package/build/types/FauxFoundry/typeHelpers/TH_ApplyActionRequestV2.d.ts.map +1 -1
- package/build/types/FauxFoundry/validateAction.d.ts.map +1 -1
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @osdk/shared.test
|
|
2
2
|
|
|
3
|
+
## 0.19.1-beta.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 60aff19: Bump `@osdk/foundry.*` and `@osdk/internal.foundry.*` catalog entries from `2.57.0` to `2.61.0`. Includes type-fixups for the new `applyScenario` / `scenarioReference` discriminated-union variants and the now-required `QueryParameterV2.required` field.
|
|
8
|
+
- Updated dependencies [a492285]
|
|
9
|
+
- Updated dependencies [60aff19]
|
|
10
|
+
- Updated dependencies [cdc73e0]
|
|
11
|
+
- @osdk/api@2.23.1-beta.2
|
|
12
|
+
- @osdk/generator-converters@2.23.1-beta.2
|
|
13
|
+
|
|
3
14
|
## 0.19.0
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TH_ApplyActionRequestV2.js","names":[],"sources":["TH_ApplyActionRequestV2.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ActionParam } from \"@osdk/api\";\nimport type {\n ActionParameterType,\n ActionParameterV2,\n ActionTypeV2,\n ApplyActionRequestV2,\n AttachmentRid,\n ParameterId,\n} from \"@osdk/foundry.ontologies\";\n\ntype TH_ActionParameterType_Primitive<X extends ActionParameterType> = X extends\n { type: \"attachment\" } ? AttachmentRid\n : ActionParam.PrimitiveType<\n Exclude<\n X[\"type\"],\n | \"object\"\n | \"array\"\n | \"objectSet\"\n | \"interfaceObject\"\n | \"attachment\"\n | \"vector\"\n >\n >;\n\ntype TH_ActionParameterType<X extends ActionParameterType> = X extends\n { type: \"array\" }\n ? TH_ActionParameterType_Primitive<Extract<X, { type: \"array\" }>[\"subType\"]>[]\n : X extends { type: \"object\" } ? string | number | boolean\n : X extends { type: \"objectSet\" } ? string\n : X extends { type: \"interfaceObject\" }\n ? { objectTypeApiName: string; primaryKeyValue: string }\n : TH_ActionParameterType_Primitive<X>;\n\ntype TH_Parameters<X extends Record<ParameterId, ActionParameterV2>> =\n & {\n [K in keyof X & string as X[K][\"required\"] extends true ? K : never]:\n TH_ActionParameterType<X[K][\"dataType\"]>;\n }\n & {\n [K in keyof X & string as X[K][\"required\"] extends true ? never : K]?:\n TH_ActionParameterType<X[K][\"dataType\"]>;\n };\n\nexport type TH_ApplyActionRequestV2<X extends ActionTypeV2> =\n & Omit<ApplyActionRequestV2, \"parameters\">\n & { parameters: TH_Parameters<X[\"parameters\"]> };\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"TH_ApplyActionRequestV2.js","names":[],"sources":["TH_ApplyActionRequestV2.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ActionParam } from \"@osdk/api\";\nimport type {\n ActionParameterType,\n ActionParameterV2,\n ActionTypeV2,\n ApplyActionRequestV2,\n AttachmentRid,\n ParameterId,\n} from \"@osdk/foundry.ontologies\";\n\ntype TH_ActionParameterType_Primitive<X extends ActionParameterType> = X extends\n { type: \"attachment\" } ? AttachmentRid\n : X extends { type: \"scenarioReference\" } ? { scenarioRid: string }\n : ActionParam.PrimitiveType<\n Exclude<\n X[\"type\"],\n | \"object\"\n | \"array\"\n | \"objectSet\"\n | \"interfaceObject\"\n | \"attachment\"\n | \"vector\"\n | \"scenarioReference\"\n >\n >;\n\ntype TH_ActionParameterType<X extends ActionParameterType> = X extends\n { type: \"array\" }\n ? TH_ActionParameterType_Primitive<Extract<X, { type: \"array\" }>[\"subType\"]>[]\n : X extends { type: \"object\" } ? string | number | boolean\n : X extends { type: \"objectSet\" } ? string\n : X extends { type: \"interfaceObject\" }\n ? { objectTypeApiName: string; primaryKeyValue: string }\n : X extends { type: \"scenarioReference\" } ? { scenarioRid: string }\n : TH_ActionParameterType_Primitive<X>;\n\ntype TH_Parameters<X extends Record<ParameterId, ActionParameterV2>> =\n & {\n [K in keyof X & string as X[K][\"required\"] extends true ? K : never]:\n TH_ActionParameterType<X[K][\"dataType\"]>;\n }\n & {\n [K in keyof X & string as X[K][\"required\"] extends true ? never : K]?:\n TH_ActionParameterType<X[K][\"dataType\"]>;\n };\n\nexport type TH_ApplyActionRequestV2<X extends ActionTypeV2> =\n & Omit<ApplyActionRequestV2, \"parameters\">\n & { parameters: TH_Parameters<X[\"parameters\"]> };\n"],"mappings":"","ignoreList":[]}
|
|
@@ -211,6 +211,16 @@ function validateActionParameterType(dataType, paramDef, value, ret, paramKey, d
|
|
|
211
211
|
}
|
|
212
212
|
return;
|
|
213
213
|
}
|
|
214
|
+
case "scenarioReference":
|
|
215
|
+
{
|
|
216
|
+
if (!value || typeof value !== "object" || typeof value.scenarioRid !== "string") {
|
|
217
|
+
ret.result = "INVALID";
|
|
218
|
+
ret.parameters[paramKey] = {
|
|
219
|
+
...baseParam
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
214
224
|
default:
|
|
215
225
|
{
|
|
216
226
|
throw new Error(`validateDataType: unknown type`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateAction.js","names":["NUMERIC_LITERAL_BOUNDS","byte","minimum","maximum","double","Number","MAX_VALUE","float","integer","long","MIN_SAFE_INTEGER","MAX_SAFE_INTEGER","short","validateAction","payload","def","dataStore","ret","parameters","submissionCriteria","result","k","v","Object","entries","value","validateActionParameterType","dataType","paramDef","paramKey","required","evaluatedConstraints","baseParam","type","Array","isArray","item","subType","matchesOntologyDataType","isInterfaceActionParam","getObject","objectTypeApiName","primaryKeyValue","isMediaReference","name","fieldType","fields","fieldValue","ontology","getObjectTypeFullMetadata","Error","odt","every","itemType","isInBounds","isValidCipherText","isValidDateString","isValidDecimalString","isInteger","startsWith","isValidTimestampString","o","mimeType","reference","mediaSetViewItem","mediaSetRid","mediaSetViewRid","mediaItemRid","isPoint","obj","coordinates","length","bounds","test","date","Date","isNaN","getTime","toISOString","parts","split","isValidCipherAffix","channelRid","encryptedValue","affix","prefixOnly","totalParts","parseFloat"],"sources":["validateAction.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { MediaReference } from \"@osdk/foundry.core\";\nimport type {\n ActionParameterType,\n ActionParameterV2,\n ActionTypeV2,\n ApplyActionRequestV2,\n BatchApplyActionRequestItem,\n OntologyDataType,\n ParameterEvaluationResult,\n ValidateActionResponseV2,\n} from \"@osdk/foundry.ontologies\";\nimport type { FauxDataStore } from \"./FauxDataStore.js\";\n\ninterface Bounds {\n minimum: number;\n maximum: number;\n}\n\nconst NUMERIC_LITERAL_BOUNDS: Record<\n Extract<\n OntologyDataType[\"type\"],\n \"double\" | \"integer\" | \"long\" | \"float\" | \"byte\" | \"short\"\n >,\n Bounds\n> = {\n byte: {\n // Java min/max byte bounds\n minimum: -128,\n maximum: 127,\n },\n double: {\n // These numbers are smaller than the actual min/max of a java double,\n // but going higher will require using BigInt in our input fields.\n minimum: -Number.MAX_VALUE,\n maximum: Number.MAX_VALUE,\n },\n float: {\n // Java min/max float bounds\n minimum: -3.4028235e38,\n maximum: 3.4028235e38,\n },\n integer: {\n // Java min/max integer bounds\n minimum: -2147483648,\n maximum: 2147483647,\n },\n long: {\n // These numbers are smaller than the actual min/max of a java long,\n // but going higher will require using BigInt in our input fields.\n minimum: Number.MIN_SAFE_INTEGER,\n maximum: Number.MAX_SAFE_INTEGER,\n },\n short: {\n // Java min/max short bounds\n minimum: -32768,\n maximum: 32767,\n },\n} as const;\n\nexport function validateAction(\n payload: ApplyActionRequestV2 | BatchApplyActionRequestItem,\n def: ActionTypeV2,\n dataStore: FauxDataStore,\n): ValidateActionResponseV2 {\n const ret: ValidateActionResponseV2 = {\n parameters: {},\n submissionCriteria: [],\n result: \"VALID\",\n };\n for (const [k, v] of Object.entries(def.parameters)) {\n const value = payload.parameters[k];\n validateActionParameterType(v.dataType, v, value, ret, k, dataStore);\n }\n\n return ret;\n}\n\n// So far these all basically return the same thing\n// and can likely be rewritten as a function that return boolean\nfunction validateActionParameterType(\n dataType: ActionParameterType,\n paramDef: ActionParameterV2,\n value: unknown,\n ret: ValidateActionResponseV2,\n paramKey: string,\n dataStore: FauxDataStore,\n) {\n if (paramDef.required && value == null) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n result: \"INVALID\",\n evaluatedConstraints: [],\n required: true,\n };\n return;\n }\n if (!paramDef.required && value == null) {\n return;\n }\n\n const baseParam: ParameterEvaluationResult = {\n result: \"INVALID\",\n evaluatedConstraints: [],\n required: paramDef.required,\n };\n\n switch (dataType.type) {\n case \"array\": {\n if (!Array.isArray(value)) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n return;\n }\n for (const item of value) {\n validateActionParameterType(\n dataType.subType,\n paramDef,\n item,\n ret,\n paramKey,\n dataStore,\n );\n }\n return;\n }\n\n case \"attachment\": {\n if (typeof value !== \"string\") {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n }\n return;\n }\n\n case \"boolean\":\n case \"date\":\n case \"long\":\n case \"double\":\n case \"integer\":\n case \"marking\":\n case \"objectSet\":\n case \"timestamp\":\n case \"object\":\n case \"string\":\n if (!matchesOntologyDataType(dataType, value)) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n }\n return;\n case \"geohash\":\n if (!(typeof value === \"string\")) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n }\n return;\n\n case \"geoshape\":\n if (\n !(typeof value === \"object\"\n && (\"coordinates\" in value! || \"geometries\" in value!\n || \"features\" in value!))\n ) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n }\n return;\n case \"interfaceObject\": {\n if (!isInterfaceActionParam(value)) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n } else if (\n dataStore.getObject(\n value.objectTypeApiName,\n value.primaryKeyValue,\n ) == null\n ) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n evaluatedConstraints: [{\n type: \"objectPropertyValue\",\n }],\n };\n }\n return;\n }\n\n case \"mediaReference\": {\n if (!isMediaReference(value)) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n }\n return;\n }\n\n case \"vector\": {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n return;\n }\n\n case \"struct\": {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n return;\n }\n\n for (const { name, fieldType, required } of dataType.fields) {\n const fieldValue = (value as Record<string, unknown>)[name];\n if (\n (required && fieldValue == null)\n || !matchesOntologyDataType(fieldType, fieldValue)\n ) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n\n return;\n }\n }\n\n return;\n }\n\n case \"objectType\": {\n if (\n typeof value !== \"string\"\n || !dataStore.ontology.getObjectTypeFullMetadata(value)\n ) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n return;\n }\n\n return;\n }\n\n default: {\n const _assertNever: never = dataType;\n throw new Error(\n `validateDataType: unknown type`,\n );\n }\n }\n}\n\nexport function matchesOntologyDataType(\n odt: OntologyDataType,\n value: unknown,\n): boolean {\n switch (odt.type) {\n case \"any\":\n return true;\n case \"array\":\n return Array.isArray(value)\n && value.every((v) => matchesOntologyDataType(odt.itemType, v));\n case \"binary\":\n throw new Error(`validateDataType: ${odt.type} not implemented yet.`);\n case \"boolean\":\n return typeof value === \"boolean\";\n case \"byte\":\n return typeof value === \"number\"\n && isInBounds(value, NUMERIC_LITERAL_BOUNDS.byte);\n case \"cipherText\":\n return isValidCipherText(value);\n case \"date\":\n return isValidDateString(value);\n case \"decimal\":\n return isValidDecimalString(value);\n case \"double\":\n return typeof value === \"number\"\n && isInBounds(value, NUMERIC_LITERAL_BOUNDS.double);\n case \"float\":\n return typeof value === \"number\"\n && isInBounds(value, NUMERIC_LITERAL_BOUNDS.float);\n case \"integer\":\n return (typeof value === \"number\" && Number.isInteger(value)\n && isInBounds(value, NUMERIC_LITERAL_BOUNDS.integer));\n case \"long\":\n return (typeof value === \"number\" && Number.isInteger(value)\n && isInBounds(value, NUMERIC_LITERAL_BOUNDS.long));\n case \"map\":\n throw new Error(\n `matchesOntologyDataType: ${odt.type} not implemented yet.`,\n );\n case \"marking\":\n return typeof value === \"string\";\n case \"object\":\n return typeof value === \"string\"\n || (value != null && typeof value === \"object\"\n && \"$primaryKey\" in value);\n case \"objectSet\":\n return typeof value === \"string\" && value.startsWith(\"ri.\")\n || (value != null && typeof value === \"object\"\n && \"objectSet\" in value);\n case \"set\":\n throw new Error(\n `matchesOntologyDataType: ${odt.type} not implemented yet.`,\n );\n case \"short\":\n return typeof value === \"number\"\n && isInBounds(value, NUMERIC_LITERAL_BOUNDS.short);\n case \"string\":\n return (typeof value === \"string\");\n case \"struct\":\n throw new Error(\n `matchesOntologyDataType: ${odt.type} not implemented yet.`,\n );\n case \"timestamp\":\n return isValidTimestampString(value);\n case \"unsupported\":\n throw new Error(\n `matchesOntologyDataType: ${odt.type} not implemented yet.`,\n );\n default:\n const _assertNever = odt;\n throw new Error(\n `matchesOntologyDataType: ${(odt as any).type} not implemented yet.`,\n );\n }\n}\n\nexport function isMediaReference(o: any): o is MediaReference {\n return typeof o === `object`\n && typeof o.mimeType === \"string\"\n && \"reference\" in o\n && typeof o.reference === \"object\"\n && o.reference.type === \"mediaSetViewItem\"\n && \"mediaSetViewItem\" in o.reference\n && typeof o.reference.mediaSetViewItem === \"object\"\n && typeof o.reference.mediaSetViewItem.mediaSetRid === \"string\"\n && typeof o.reference.mediaSetViewItem.mediaSetViewRid === \"string\"\n && typeof o.reference.mediaSetViewItem.mediaItemRid === \"string\";\n}\n\nexport function isInterfaceActionParam(value: any): value is {\n objectTypeApiName: string;\n primaryKeyValue: string | number | boolean;\n} {\n return (\n typeof value === \"object\"\n && \"objectTypeApiName\" in value\n && typeof value.objectTypeApiName === \"string\"\n && \"primaryKeyValue\" in value\n && (typeof value.primaryKeyValue === \"string\"\n || typeof value.primaryKeyValue === \"number\"\n || typeof value.primaryKeyValue === \"boolean\")\n );\n}\n\nfunction isPoint(obj: any): obj is GeoJSON.Point {\n return obj.type === \"Point\"\n && Array.isArray(obj.coordinates)\n && obj.coordinates.length === 2\n && typeof obj.coordinates[0] === \"number\"\n && typeof obj.coordinates[1] === \"number\";\n}\n\nfunction isInBounds(\n value: number,\n bounds: { minimum: number; maximum: number },\n) {\n return bounds.minimum <= value && value <= bounds.maximum;\n}\n\nfunction isValidDateString(value: unknown): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n\n const dateRegex = /^\\d{4}-\\d{2}-\\d{2}$/;\n if (!dateRegex.test(value)) {\n return false;\n }\n const date = new Date(value);\n return !isNaN(date.getTime()) && date.toISOString().startsWith(value);\n}\n\nfunction isValidTimestampString(value: unknown): boolean {\n return typeof value === \"string\" && !isNaN(new Date(value).getTime());\n}\n\nfunction isValidCipherText(value: unknown): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n\n const parts = value.split(\"::\");\n\n if (\n !(isValidCipherAffix(parts, \"CIPHER\")\n || isValidCipherAffix(parts, \"BELLASO\")\n || isValidCipherAffix(parts, \"BELLASO\", true))\n ) {\n return false;\n }\n\n const channelRid = parts[1];\n const encryptedValue = parts[2];\n\n return channelRid.startsWith(\"ri.\") && encryptedValue !== \"\";\n}\n\nfunction isValidCipherAffix(\n parts: string[],\n affix: \"BELLASO\" | \"CIPHER\",\n prefixOnly: boolean = false,\n): boolean {\n const totalParts = prefixOnly ? 3 : 4;\n\n return parts.length === totalParts && parts[0] === affix\n && (prefixOnly || parts[3] === affix);\n}\n\nfunction isValidDecimalString(value: unknown): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n\n const decimalRegex = /^[+-]?(\\d+\\.?\\d*|\\.\\d+)(E[+-]?\\d+)?$/;\n return decimalRegex.test(value) && !isNaN(parseFloat(value));\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoBA,MAAMA,sBAML,GAAG;EACFC,IAAI,EAAE;IACJ;IACAC,OAAO,EAAE,CAAC,GAAG;IACbC,OAAO,EAAE;EACX,CAAC;EACDC,MAAM,EAAE;IACN;IACA;IACAF,OAAO,EAAE,CAACG,MAAM,CAACC,SAAS;IAC1BH,OAAO,EAAEE,MAAM,CAACC;EAClB,CAAC;EACDC,KAAK,EAAE;IACL;IACAL,OAAO,EAAE,CAAC,YAAY;IACtBC,OAAO,EAAE;EACX,CAAC;EACDK,OAAO,EAAE;IACP;IACAN,OAAO,EAAE,CAAC,UAAU;IACpBC,OAAO,EAAE;EACX,CAAC;EACDM,IAAI,EAAE;IACJ;IACA;IACAP,OAAO,EAAEG,MAAM,CAACK,gBAAgB;IAChCP,OAAO,EAAEE,MAAM,CAACM;EAClB,CAAC;EACDC,KAAK,EAAE;IACL;IACAV,OAAO,EAAE,CAAC,KAAK;IACfC,OAAO,EAAE;EACX;AACF,CAAU;AAEV,OAAO,SAASU,cAAcA,CAC5BC,OAA2D,EAC3DC,GAAiB,EACjBC,SAAwB,EACE;EAC1B,MAAMC,GAA6B,GAAG;IACpCC,UAAU,EAAE,CAAC,CAAC;IACdC,kBAAkB,EAAE,EAAE;IACtBC,MAAM,EAAE;EACV,CAAC;EACD,KAAK,MAAM,CAACC,CAAC,EAAEC,CAAC,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACT,GAAG,CAACG,UAAU,CAAC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AAC;EAE/B,IACE,EAAEC,kBAAkB,CAACF,KAAK,EAAE,QAAQ,CAAC,IAChCE,kBAAkB,CAACF,KAAK,EAAE,SAAS,CAAC,IACpCE,kBAAkB,CAACF,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,EAChD;IACA,OAAO,KAAK;EACd;EAEA,MAAMG,UAAU,GAAGH,KAAK,CAAC,CAAC,CAAC;EAC3B,MAAMI,cAAc,GAAGJ,KAAK,CAAC,CAAC,CAAC;EAE/B,OAAOG,UAAU,CAACvB,UAAU,CAAC,KAAK,CAAC,IAAIwB,cAAc,KAAK,EAAE;AAC9D;AAEA,SAASF,kBAAkBA,CACzBF,KAAe,EACfK,KAA2B,EAC3BC,UAAmB,GAAG,KAAK,EAClB;EACT,MAAMC,UAAU,GAAGD,UAAU,GAAG,CAAC,GAAG,CAAC;EAErC,OAAON,KAAK,CAACR,MAAM,KAAKe,UAAU,IAAIP,KAAK,CAAC,CAAC,CAAC,KAAKK,KAAK,KAClDC,UAAU,IAAIN,KAAK,CAAC,CAAC,CAAC,KAAKK,KAAK,CAAC;AACzC;AAEA,SAAS3B,oBAAoBA,CAAChC,KAAc,EAAW;EACrD,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAO,KAAK;EACd;EAGA,OADqB,sCAAsC,CACvCgD,IAAI,CAAChD,KAAK,CAAC,IAAI,CAACmD,KAAK,CAACW,UAAU,CAAC9D,KAAK,CAAC,CAAC;AAC9D","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"validateAction.js","names":["NUMERIC_LITERAL_BOUNDS","byte","minimum","maximum","double","Number","MAX_VALUE","float","integer","long","MIN_SAFE_INTEGER","MAX_SAFE_INTEGER","short","validateAction","payload","def","dataStore","ret","parameters","submissionCriteria","result","k","v","Object","entries","value","validateActionParameterType","dataType","paramDef","paramKey","required","evaluatedConstraints","baseParam","type","Array","isArray","item","subType","matchesOntologyDataType","isInterfaceActionParam","getObject","objectTypeApiName","primaryKeyValue","isMediaReference","name","fieldType","fields","fieldValue","ontology","getObjectTypeFullMetadata","scenarioRid","Error","odt","every","itemType","isInBounds","isValidCipherText","isValidDateString","isValidDecimalString","isInteger","startsWith","isValidTimestampString","o","mimeType","reference","mediaSetViewItem","mediaSetRid","mediaSetViewRid","mediaItemRid","isPoint","obj","coordinates","length","bounds","test","date","Date","isNaN","getTime","toISOString","parts","split","isValidCipherAffix","channelRid","encryptedValue","affix","prefixOnly","totalParts","parseFloat"],"sources":["validateAction.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { MediaReference } from \"@osdk/foundry.core\";\nimport type {\n ActionParameterType,\n ActionParameterV2,\n ActionTypeV2,\n ApplyActionRequestV2,\n BatchApplyActionRequestItem,\n OntologyDataType,\n ParameterEvaluationResult,\n ValidateActionResponseV2,\n} from \"@osdk/foundry.ontologies\";\nimport type { FauxDataStore } from \"./FauxDataStore.js\";\n\ninterface Bounds {\n minimum: number;\n maximum: number;\n}\n\nconst NUMERIC_LITERAL_BOUNDS: Record<\n Extract<\n OntologyDataType[\"type\"],\n \"double\" | \"integer\" | \"long\" | \"float\" | \"byte\" | \"short\"\n >,\n Bounds\n> = {\n byte: {\n // Java min/max byte bounds\n minimum: -128,\n maximum: 127,\n },\n double: {\n // These numbers are smaller than the actual min/max of a java double,\n // but going higher will require using BigInt in our input fields.\n minimum: -Number.MAX_VALUE,\n maximum: Number.MAX_VALUE,\n },\n float: {\n // Java min/max float bounds\n minimum: -3.4028235e38,\n maximum: 3.4028235e38,\n },\n integer: {\n // Java min/max integer bounds\n minimum: -2147483648,\n maximum: 2147483647,\n },\n long: {\n // These numbers are smaller than the actual min/max of a java long,\n // but going higher will require using BigInt in our input fields.\n minimum: Number.MIN_SAFE_INTEGER,\n maximum: Number.MAX_SAFE_INTEGER,\n },\n short: {\n // Java min/max short bounds\n minimum: -32768,\n maximum: 32767,\n },\n} as const;\n\nexport function validateAction(\n payload: ApplyActionRequestV2 | BatchApplyActionRequestItem,\n def: ActionTypeV2,\n dataStore: FauxDataStore,\n): ValidateActionResponseV2 {\n const ret: ValidateActionResponseV2 = {\n parameters: {},\n submissionCriteria: [],\n result: \"VALID\",\n };\n for (const [k, v] of Object.entries(def.parameters)) {\n const value = payload.parameters[k];\n validateActionParameterType(v.dataType, v, value, ret, k, dataStore);\n }\n\n return ret;\n}\n\n// So far these all basically return the same thing\n// and can likely be rewritten as a function that return boolean\nfunction validateActionParameterType(\n dataType: ActionParameterType,\n paramDef: ActionParameterV2,\n value: unknown,\n ret: ValidateActionResponseV2,\n paramKey: string,\n dataStore: FauxDataStore,\n) {\n if (paramDef.required && value == null) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n result: \"INVALID\",\n evaluatedConstraints: [],\n required: true,\n };\n return;\n }\n if (!paramDef.required && value == null) {\n return;\n }\n\n const baseParam: ParameterEvaluationResult = {\n result: \"INVALID\",\n evaluatedConstraints: [],\n required: paramDef.required,\n };\n\n switch (dataType.type) {\n case \"array\": {\n if (!Array.isArray(value)) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n return;\n }\n for (const item of value) {\n validateActionParameterType(\n dataType.subType,\n paramDef,\n item,\n ret,\n paramKey,\n dataStore,\n );\n }\n return;\n }\n\n case \"attachment\": {\n if (typeof value !== \"string\") {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n }\n return;\n }\n\n case \"boolean\":\n case \"date\":\n case \"long\":\n case \"double\":\n case \"integer\":\n case \"marking\":\n case \"objectSet\":\n case \"timestamp\":\n case \"object\":\n case \"string\":\n if (!matchesOntologyDataType(dataType, value)) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n }\n return;\n case \"geohash\":\n if (!(typeof value === \"string\")) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n }\n return;\n\n case \"geoshape\":\n if (\n !(typeof value === \"object\"\n && (\"coordinates\" in value! || \"geometries\" in value!\n || \"features\" in value!))\n ) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n }\n return;\n case \"interfaceObject\": {\n if (!isInterfaceActionParam(value)) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n } else if (\n dataStore.getObject(\n value.objectTypeApiName,\n value.primaryKeyValue,\n ) == null\n ) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n evaluatedConstraints: [{\n type: \"objectPropertyValue\",\n }],\n };\n }\n return;\n }\n\n case \"mediaReference\": {\n if (!isMediaReference(value)) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n }\n return;\n }\n\n case \"vector\": {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n return;\n }\n\n case \"struct\": {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n return;\n }\n\n for (const { name, fieldType, required } of dataType.fields) {\n const fieldValue = (value as Record<string, unknown>)[name];\n if (\n (required && fieldValue == null)\n || !matchesOntologyDataType(fieldType, fieldValue)\n ) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n\n return;\n }\n }\n\n return;\n }\n\n case \"objectType\": {\n if (\n typeof value !== \"string\"\n || !dataStore.ontology.getObjectTypeFullMetadata(value)\n ) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n return;\n }\n\n return;\n }\n\n case \"scenarioReference\": {\n if (\n !value\n || typeof value !== \"object\"\n || typeof (value as { scenarioRid?: unknown }).scenarioRid !== \"string\"\n ) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n }\n return;\n }\n\n default: {\n const _assertNever: never = dataType;\n throw new Error(\n `validateDataType: unknown type`,\n );\n }\n }\n}\n\nexport function matchesOntologyDataType(\n odt: OntologyDataType,\n value: unknown,\n): boolean {\n switch (odt.type) {\n case \"any\":\n return true;\n case \"array\":\n return Array.isArray(value)\n && value.every((v) => matchesOntologyDataType(odt.itemType, v));\n case \"binary\":\n throw new Error(`validateDataType: ${odt.type} not implemented yet.`);\n case \"boolean\":\n return typeof value === \"boolean\";\n case \"byte\":\n return typeof value === \"number\"\n && isInBounds(value, NUMERIC_LITERAL_BOUNDS.byte);\n case \"cipherText\":\n return isValidCipherText(value);\n case \"date\":\n return isValidDateString(value);\n case \"decimal\":\n return isValidDecimalString(value);\n case \"double\":\n return typeof value === \"number\"\n && isInBounds(value, NUMERIC_LITERAL_BOUNDS.double);\n case \"float\":\n return typeof value === \"number\"\n && isInBounds(value, NUMERIC_LITERAL_BOUNDS.float);\n case \"integer\":\n return (typeof value === \"number\" && Number.isInteger(value)\n && isInBounds(value, NUMERIC_LITERAL_BOUNDS.integer));\n case \"long\":\n return (typeof value === \"number\" && Number.isInteger(value)\n && isInBounds(value, NUMERIC_LITERAL_BOUNDS.long));\n case \"map\":\n throw new Error(\n `matchesOntologyDataType: ${odt.type} not implemented yet.`,\n );\n case \"marking\":\n return typeof value === \"string\";\n case \"object\":\n return typeof value === \"string\"\n || (value != null && typeof value === \"object\"\n && \"$primaryKey\" in value);\n case \"objectSet\":\n return typeof value === \"string\" && value.startsWith(\"ri.\")\n || (value != null && typeof value === \"object\"\n && \"objectSet\" in value);\n case \"set\":\n throw new Error(\n `matchesOntologyDataType: ${odt.type} not implemented yet.`,\n );\n case \"short\":\n return typeof value === \"number\"\n && isInBounds(value, NUMERIC_LITERAL_BOUNDS.short);\n case \"string\":\n return (typeof value === \"string\");\n case \"struct\":\n throw new Error(\n `matchesOntologyDataType: ${odt.type} not implemented yet.`,\n );\n case \"timestamp\":\n return isValidTimestampString(value);\n case \"unsupported\":\n throw new Error(\n `matchesOntologyDataType: ${odt.type} not implemented yet.`,\n );\n default:\n const _assertNever = odt;\n throw new Error(\n `matchesOntologyDataType: ${(odt as any).type} not implemented yet.`,\n );\n }\n}\n\nexport function isMediaReference(o: any): o is MediaReference {\n return typeof o === `object`\n && typeof o.mimeType === \"string\"\n && \"reference\" in o\n && typeof o.reference === \"object\"\n && o.reference.type === \"mediaSetViewItem\"\n && \"mediaSetViewItem\" in o.reference\n && typeof o.reference.mediaSetViewItem === \"object\"\n && typeof o.reference.mediaSetViewItem.mediaSetRid === \"string\"\n && typeof o.reference.mediaSetViewItem.mediaSetViewRid === \"string\"\n && typeof o.reference.mediaSetViewItem.mediaItemRid === \"string\";\n}\n\nexport function isInterfaceActionParam(value: any): value is {\n objectTypeApiName: string;\n primaryKeyValue: string | number | boolean;\n} {\n return (\n typeof value === \"object\"\n && \"objectTypeApiName\" in value\n && typeof value.objectTypeApiName === \"string\"\n && \"primaryKeyValue\" in value\n && (typeof value.primaryKeyValue === \"string\"\n || typeof value.primaryKeyValue === \"number\"\n || typeof value.primaryKeyValue === \"boolean\")\n );\n}\n\nfunction isPoint(obj: any): obj is GeoJSON.Point {\n return obj.type === \"Point\"\n && Array.isArray(obj.coordinates)\n && obj.coordinates.length === 2\n && typeof obj.coordinates[0] === \"number\"\n && typeof obj.coordinates[1] === \"number\";\n}\n\nfunction isInBounds(\n value: number,\n bounds: { minimum: number; maximum: number },\n) {\n return bounds.minimum <= value && value <= bounds.maximum;\n}\n\nfunction isValidDateString(value: unknown): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n\n const dateRegex = /^\\d{4}-\\d{2}-\\d{2}$/;\n if (!dateRegex.test(value)) {\n return false;\n }\n const date = new Date(value);\n return !isNaN(date.getTime()) && date.toISOString().startsWith(value);\n}\n\nfunction isValidTimestampString(value: unknown): boolean {\n return typeof value === \"string\" && !isNaN(new Date(value).getTime());\n}\n\nfunction isValidCipherText(value: unknown): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n\n const parts = value.split(\"::\");\n\n if (\n !(isValidCipherAffix(parts, \"CIPHER\")\n || isValidCipherAffix(parts, \"BELLASO\")\n || isValidCipherAffix(parts, \"BELLASO\", true))\n ) {\n return false;\n }\n\n const channelRid = parts[1];\n const encryptedValue = parts[2];\n\n return channelRid.startsWith(\"ri.\") && encryptedValue !== \"\";\n}\n\nfunction isValidCipherAffix(\n parts: string[],\n affix: \"BELLASO\" | \"CIPHER\",\n prefixOnly: boolean = false,\n): boolean {\n const totalParts = prefixOnly ? 3 : 4;\n\n return parts.length === totalParts && parts[0] === affix\n && (prefixOnly || parts[3] === affix);\n}\n\nfunction isValidDecimalString(value: unknown): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n\n const decimalRegex = /^[+-]?(\\d+\\.?\\d*|\\.\\d+)(E[+-]?\\d+)?$/;\n return decimalRegex.test(value) && !isNaN(parseFloat(value));\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoBA,MAAMA,sBAML,GAAG;EACFC,IAAI,EAAE;IACJ;IACAC,OAAO,EAAE,CAAC,GAAG;IACbC,OAAO,EAAE;EACX,CAAC;EACDC,MAAM,EAAE;IACN;IACA;IACAF,OAAO,EAAE,CAACG,MAAM,CAACC,SAAS;IAC1BH,OAAO,EAAEE,MAAM,CAACC;EAClB,CAAC;EACDC,KAAK,EAAE;IACL;IACAL,OAAO,EAAE,CAAC,YAAY;IACtBC,OAAO,EAAE;EACX,CAAC;EACDK,OAAO,EAAE;IACP;IACAN,OAAO,EAAE,CAAC,UAAU;IACpBC,OAAO,EAAE;EACX,CAAC;EACDM,IAAI,E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,UAAU,GAAG,CAAC,GAAG,CAAC;EAErC,OAAON,KAAK,CAACR,MAAM,KAAKe,UAAU,IAAIP,KAAK,CAAC,CAAC,CAAC,KAAKK,KAAK,KAClDC,UAAU,IAAIN,KAAK,CAAC,CAAC,CAAC,KAAKK,KAAK,CAAC;AACzC;AAEA,SAAS3B,oBAAoBA,CAACjC,KAAc,EAAW;EACrD,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAO,KAAK;EACd;EAGA,OADqB,sCAAsC,CACvCiD,IAAI,CAACjD,KAAK,CAAC,IAAI,CAACoD,KAAK,CAACW,UAAU,CAAC/D,KAAK,CAAC,CAAC;AAC9D","ignoreList":[]}
|
package/build/cjs/index.cjs
CHANGED
|
@@ -1510,6 +1510,15 @@ function validateActionParameterType(dataType, paramDef, value, ret, paramKey, d
|
|
|
1510
1510
|
}
|
|
1511
1511
|
return;
|
|
1512
1512
|
}
|
|
1513
|
+
case "scenarioReference": {
|
|
1514
|
+
if (!value || typeof value !== "object" || typeof value.scenarioRid !== "string") {
|
|
1515
|
+
ret.result = "INVALID";
|
|
1516
|
+
ret.parameters[paramKey] = {
|
|
1517
|
+
...baseParam
|
|
1518
|
+
};
|
|
1519
|
+
}
|
|
1520
|
+
return;
|
|
1521
|
+
}
|
|
1513
1522
|
default: {
|
|
1514
1523
|
throw new Error(`validateDataType: unknown type`);
|
|
1515
1524
|
}
|
|
@@ -2253,12 +2262,13 @@ __export(Actions_exports, {
|
|
|
2253
2262
|
applyBatch: () => applyBatch2
|
|
2254
2263
|
});
|
|
2255
2264
|
|
|
2256
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
2265
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Action.js
|
|
2257
2266
|
var Action_exports = {};
|
|
2258
2267
|
__export(Action_exports, {
|
|
2259
2268
|
apply: () => apply,
|
|
2260
2269
|
applyAsync: () => applyAsync,
|
|
2261
2270
|
applyBatch: () => applyBatch,
|
|
2271
|
+
applyBatchWithOverrides: () => applyBatchWithOverrides,
|
|
2262
2272
|
applyWithOverrides: () => applyWithOverrides
|
|
2263
2273
|
});
|
|
2264
2274
|
|
|
@@ -2355,7 +2365,7 @@ function parseUrl(baseUrl, endpointPath) {
|
|
|
2355
2365
|
return new URL(`api${endpointPath}`, baseUrl);
|
|
2356
2366
|
}
|
|
2357
2367
|
|
|
2358
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
2368
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Action.js
|
|
2359
2369
|
var _apply = [1, "/v2/ontologies/{0}/actions/{1}/apply", 7];
|
|
2360
2370
|
function apply($ctx, ...args) {
|
|
2361
2371
|
return foundryPlatformFetch($ctx, _apply, ...args);
|
|
@@ -2372,8 +2382,12 @@ var _applyWithOverrides = [1, "/v2/ontologies/{0}/actions/{1}/applyWithOverrides
|
|
|
2372
2382
|
function applyWithOverrides($ctx, ...args) {
|
|
2373
2383
|
return foundryPlatformFetch($ctx, _applyWithOverrides, ...args);
|
|
2374
2384
|
}
|
|
2385
|
+
var _applyBatchWithOverrides = [1, "/v2/ontologies/{0}/actions/{1}/applyBatchWithOverrides", 3];
|
|
2386
|
+
function applyBatchWithOverrides($ctx, ...args) {
|
|
2387
|
+
return foundryPlatformFetch($ctx, _applyBatchWithOverrides, ...args);
|
|
2388
|
+
}
|
|
2375
2389
|
|
|
2376
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
2390
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/ActionTypeV2.js
|
|
2377
2391
|
var ActionTypeV2_exports = {};
|
|
2378
2392
|
__export(ActionTypeV2_exports, {
|
|
2379
2393
|
get: () => get,
|
|
@@ -2398,7 +2412,7 @@ function getByRidBatch($ctx, ...args) {
|
|
|
2398
2412
|
return foundryPlatformFetch($ctx, _getByRidBatch, ...args);
|
|
2399
2413
|
}
|
|
2400
2414
|
|
|
2401
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
2415
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Attachment.js
|
|
2402
2416
|
var Attachment_exports = {};
|
|
2403
2417
|
__export(Attachment_exports, {
|
|
2404
2418
|
get: () => get2,
|
|
@@ -2433,7 +2447,7 @@ function get2($ctx, ...args) {
|
|
|
2433
2447
|
return foundryPlatformFetch($ctx, _get2, ...args);
|
|
2434
2448
|
}
|
|
2435
2449
|
|
|
2436
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
2450
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/AttachmentPropertyV2.js
|
|
2437
2451
|
var AttachmentPropertyV2_exports = {};
|
|
2438
2452
|
__export(AttachmentPropertyV2_exports, {
|
|
2439
2453
|
getAttachment: () => getAttachment,
|
|
@@ -2458,7 +2472,7 @@ function readAttachmentByRid($ctx, ...args) {
|
|
|
2458
2472
|
return foundryPlatformFetch($ctx, _readAttachmentByRid, ...args);
|
|
2459
2473
|
}
|
|
2460
2474
|
|
|
2461
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
2475
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/LinkedObjectV2.js
|
|
2462
2476
|
var LinkedObjectV2_exports = {};
|
|
2463
2477
|
__export(LinkedObjectV2_exports, {
|
|
2464
2478
|
getLinkedObject: () => getLinkedObject,
|
|
@@ -2473,7 +2487,7 @@ function getLinkedObject($ctx, ...args) {
|
|
|
2473
2487
|
return foundryPlatformFetch($ctx, _getLinkedObject, ...args);
|
|
2474
2488
|
}
|
|
2475
2489
|
|
|
2476
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
2490
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/MediaReferenceProperty.js
|
|
2477
2491
|
var MediaReferenceProperty_exports = {};
|
|
2478
2492
|
__export(MediaReferenceProperty_exports, {
|
|
2479
2493
|
getMediaContent: () => getMediaContent,
|
|
@@ -2493,7 +2507,7 @@ function upload2($ctx, ...args) {
|
|
|
2493
2507
|
return foundryPlatformFetch($ctx, _upload2, ...args);
|
|
2494
2508
|
}
|
|
2495
2509
|
|
|
2496
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
2510
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/ObjectTypeV2.js
|
|
2497
2511
|
var ObjectTypeV2_exports = {};
|
|
2498
2512
|
__export(ObjectTypeV2_exports, {
|
|
2499
2513
|
get: () => get3,
|
|
@@ -2501,6 +2515,7 @@ __export(ObjectTypeV2_exports, {
|
|
|
2501
2515
|
getEditsHistory: () => getEditsHistory,
|
|
2502
2516
|
getFullMetadata: () => getFullMetadata,
|
|
2503
2517
|
getOutgoingLinkType: () => getOutgoingLinkType,
|
|
2518
|
+
getOutgoingLinkTypesByObjectTypeRidBatch: () => getOutgoingLinkTypesByObjectTypeRidBatch,
|
|
2504
2519
|
list: () => list2,
|
|
2505
2520
|
listOutgoingLinkTypes: () => listOutgoingLinkTypes
|
|
2506
2521
|
});
|
|
@@ -2532,8 +2547,12 @@ var _getOutgoingLinkType = [0, "/v2/ontologies/{0}/objectTypes/{1}/outgoingLinkT
|
|
|
2532
2547
|
function getOutgoingLinkType($ctx, ...args) {
|
|
2533
2548
|
return foundryPlatformFetch($ctx, _getOutgoingLinkType, ...args);
|
|
2534
2549
|
}
|
|
2550
|
+
var _getOutgoingLinkTypesByObjectTypeRidBatch = [1, "/v2/ontologies/{0}/outgoingLinkTypes/getByRidBatch", 3];
|
|
2551
|
+
function getOutgoingLinkTypesByObjectTypeRidBatch($ctx, ...args) {
|
|
2552
|
+
return foundryPlatformFetch($ctx, _getOutgoingLinkTypesByObjectTypeRidBatch, ...args);
|
|
2553
|
+
}
|
|
2535
2554
|
|
|
2536
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
2555
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/OntologyInterface.js
|
|
2537
2556
|
var OntologyInterface_exports = {};
|
|
2538
2557
|
__export(OntologyInterface_exports, {
|
|
2539
2558
|
aggregate: () => aggregate,
|
|
@@ -2578,7 +2597,7 @@ function listInterfaceLinkedObjects($ctx, ...args) {
|
|
|
2578
2597
|
return foundryPlatformFetch($ctx, _listInterfaceLinkedObjects, ...args);
|
|
2579
2598
|
}
|
|
2580
2599
|
|
|
2581
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
2600
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/OntologyObjectSet.js
|
|
2582
2601
|
var OntologyObjectSet_exports = {};
|
|
2583
2602
|
__export(OntologyObjectSet_exports, {
|
|
2584
2603
|
aggregate: () => aggregate2,
|
|
@@ -2618,7 +2637,7 @@ function loadLinks($ctx, ...args) {
|
|
|
2618
2637
|
return foundryPlatformFetch($ctx, _loadLinks, ...args);
|
|
2619
2638
|
}
|
|
2620
2639
|
|
|
2621
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
2640
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/OntologyObjectV2.js
|
|
2622
2641
|
var OntologyObjectV2_exports = {};
|
|
2623
2642
|
__export(OntologyObjectV2_exports, {
|
|
2624
2643
|
aggregate: () => aggregate3,
|
|
@@ -2648,7 +2667,7 @@ function aggregate3($ctx, ...args) {
|
|
|
2648
2667
|
return foundryPlatformFetch($ctx, _aggregate3, ...args);
|
|
2649
2668
|
}
|
|
2650
2669
|
|
|
2651
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
2670
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/OntologyTransaction.js
|
|
2652
2671
|
var OntologyTransaction_exports = {};
|
|
2653
2672
|
__export(OntologyTransaction_exports, {
|
|
2654
2673
|
postEdits: () => postEdits
|
|
@@ -2658,7 +2677,7 @@ function postEdits($ctx, ...args) {
|
|
|
2658
2677
|
return foundryPlatformFetch($ctx, _postEdits, ...args);
|
|
2659
2678
|
}
|
|
2660
2679
|
|
|
2661
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
2680
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/OntologyV2.js
|
|
2662
2681
|
var OntologyV2_exports = {};
|
|
2663
2682
|
__export(OntologyV2_exports, {
|
|
2664
2683
|
get: () => get7,
|
|
@@ -2683,7 +2702,7 @@ function loadMetadata($ctx, ...args) {
|
|
|
2683
2702
|
return foundryPlatformFetch($ctx, _loadMetadata, ...args);
|
|
2684
2703
|
}
|
|
2685
2704
|
|
|
2686
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
2705
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Query.js
|
|
2687
2706
|
var Query_exports = {};
|
|
2688
2707
|
__export(Query_exports, {
|
|
2689
2708
|
execute: () => execute
|
|
@@ -2693,7 +2712,7 @@ function execute($ctx, ...args) {
|
|
|
2693
2712
|
return foundryPlatformFetch($ctx, _execute, ...args);
|
|
2694
2713
|
}
|
|
2695
2714
|
|
|
2696
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
2715
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/QueryType.js
|
|
2697
2716
|
var QueryType_exports = {};
|
|
2698
2717
|
__export(QueryType_exports, {
|
|
2699
2718
|
get: () => get8,
|
|
@@ -2708,7 +2727,7 @@ function get8($ctx, ...args) {
|
|
|
2708
2727
|
return foundryPlatformFetch($ctx, _get8, ...args);
|
|
2709
2728
|
}
|
|
2710
2729
|
|
|
2711
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
2730
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/TimeSeriesPropertyV2.js
|
|
2712
2731
|
var TimeSeriesPropertyV2_exports = {};
|
|
2713
2732
|
__export(TimeSeriesPropertyV2_exports, {
|
|
2714
2733
|
getFirstPoint: () => getFirstPoint,
|
|
@@ -2728,7 +2747,7 @@ function streamPoints($ctx, ...args) {
|
|
|
2728
2747
|
return foundryPlatformFetch($ctx, _streamPoints, ...args);
|
|
2729
2748
|
}
|
|
2730
2749
|
|
|
2731
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
2750
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/TimeSeriesValueBankProperty.js
|
|
2732
2751
|
var TimeSeriesValueBankProperty_exports = {};
|
|
2733
2752
|
__export(TimeSeriesValueBankProperty_exports, {
|
|
2734
2753
|
getLatestValue: () => getLatestValue,
|
|
@@ -2797,7 +2816,7 @@ __export(MediaReferenceProperties_exports, {
|
|
|
2797
2816
|
uploadMedia: () => uploadMedia2
|
|
2798
2817
|
});
|
|
2799
2818
|
|
|
2800
|
-
// ../../node_modules/.pnpm/@osdk+foundry.mediasets@2.
|
|
2819
|
+
// ../../node_modules/.pnpm/@osdk+foundry.mediasets@2.61.0/node_modules/@osdk/foundry.mediasets/build/esm/public/MediaSet.js
|
|
2801
2820
|
var MediaSet_exports = {};
|
|
2802
2821
|
__export(MediaSet_exports, {
|
|
2803
2822
|
abort: () => abort,
|