@osdk/typescript-sdk-docs 0.6.0-beta.2 → 0.6.0-beta.4
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 +12 -0
- package/build/browser/docs.js +2 -0
- package/build/browser/docs.js.map +1 -1
- package/build/browser/generatedNoCheck/docsNoComputedVariables.js +9 -16
- package/build/browser/generatedNoCheck/docsNoComputedVariables.js.map +1 -1
- package/build/cjs/index.cjs +11 -16
- package/build/cjs/index.cjs.map +1 -1
- package/build/esm/docs.js +2 -0
- package/build/esm/docs.js.map +1 -1
- package/build/esm/generatedNoCheck/docsNoComputedVariables.js +9 -16
- package/build/esm/generatedNoCheck/docsNoComputedVariables.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @osdk/typescript-sdk-docs
|
|
2
2
|
|
|
3
|
+
## 0.6.0-beta.4
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 3bfde5a: Add rendering support for objectSet action parameters
|
|
8
|
+
|
|
9
|
+
## 0.6.0-beta.3
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 579e518: Move new Media upload docs from 2.6 to 2.1
|
|
14
|
+
|
|
3
15
|
## 0.6.0-beta.2
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/build/browser/docs.js
CHANGED
|
@@ -266,6 +266,8 @@ function renderType(type, majorVersion, context) {
|
|
|
266
266
|
return majorVersion >= SdkMajorVersion.V2 ? `"primaryKeyValue" // or myObjectInstance` : `{ __primaryKey: ${primaryKeyValue}, /* other properties */ }`;
|
|
267
267
|
}
|
|
268
268
|
return primaryKeyValue;
|
|
269
|
+
case "objectSet":
|
|
270
|
+
return `client(${type.objectTypeApiName}).where({ /* filter conditions */ })`;
|
|
269
271
|
case "anonymousCustomType":
|
|
270
272
|
case "customType":
|
|
271
273
|
return "{}";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.js","names":["outdent","snippets","indentedNewLine","spacesCount","repeat","TYPESCRIPT_OSDK_SNIPPETS","computedVariables","functionInputValuesV1","handleFunctionInputValuesV1","functionInputValuesV2","handleFunctionInputValuesV2","actionParameterSampleValuesV1","handleActionParameterSampleValuesV1","actionParameterSampleValuesV2","handleActionParameterSampleValuesV2","propertyValueV1","handlePropertyValueV1","propertyValueV2","handlePropertyValueV2","propertyValueIncrementedV1","handlePropertyValueIncrementedV1","propertyValueIncrementedV2","handlePropertyValueIncrementedV2","propertiesV1","handlePropertiesV1","propertiesV2","handlePropertiesV2","primaryKeyPropertyV1","handlePrimaryKeyPropertyV1","primaryKeyPropertyV2","handlePrimaryKeyPropertyV2","primaryKeyPropertyValueV2","handlePrimaryKeyPropertyValueV2","linkedPropertiesV1","handleLinkedPropertiesV1","linkedPropertiesV2","handleLinkedPropertiesV2","linkedPrimaryKeyPropertyV1","handleLinkedPrimaryKeyPropertyV1","linkedPrimaryKeyPropertyV2","handleLinkedPrimaryKeyPropertyV2","arrayElementValue","handleArrayElementValue","SdkMajorVersion","rawFunctionInputValues","renderFunctionInputValues","V1","V2","rawActionTypeParameterValues","renderActionParameterValues","rawPropertyValue","renderPropertyValue","rawPropertyValueIncremented","renderArrayElementPropertyValue","propertyValue","majorVersion","Error","renderType","rawProperties","map","prop","apiName","value","rawPrimaryKeyProperty","rawLinkedProperties","rawLinkedPrimaryKeyProperty","type","Object","keys","parameters","length","entries","key","join","param","index","array","last","context","arraySubType","subtype","toString","getDateParameter","daysOffset","getTimestampParameter","primaryKeyValue","primaryKeyType","hasAttachments","objectTypeApiName","keyType","getMapKeyObjectName","valueType","getDisplayName","processObjectApiName","input","tokens","split","result","token","titleCase","toLowerCase","charAt","slice","toUpperCase","objectApiName","lastIndexOf","offsetDate","Date","setDate","getDate","toISOString"],"sources":["docs.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 { SdkSnippets } from \"@osdk/docs-spec-core\";\nimport type {\n ActionParameterSampleValuesIR,\n ActionParameterSampleValueTypeIR,\n FunctionSampleParametersIR,\n FunctionSampleValueTypeIR,\n OSDK_SNIPPETS_SPEC,\n PropertySampleIR,\n PropertySampleValueTypeIR,\n} from \"@osdk/docs-spec-sdk\";\nimport { outdent } from \"outdent\";\nimport { snippets } from \"./generatedNoCheck/docsNoComputedVariables.js\";\n\nconst indentedNewLine = (spacesCount: number) => `\\n${\" \".repeat(spacesCount)}`;\n\nexport const TYPESCRIPT_OSDK_SNIPPETS: SdkSnippets<typeof OSDK_SNIPPETS_SPEC> =\n {\n ...snippets,\n computedVariables: {\n functionInputValuesV1: handleFunctionInputValuesV1,\n functionInputValuesV2: handleFunctionInputValuesV2,\n actionParameterSampleValuesV1: handleActionParameterSampleValuesV1,\n actionParameterSampleValuesV2: handleActionParameterSampleValuesV2,\n propertyValueV1: handlePropertyValueV1,\n propertyValueV2: handlePropertyValueV2,\n propertyValueIncrementedV1: handlePropertyValueIncrementedV1,\n propertyValueIncrementedV2: handlePropertyValueIncrementedV2,\n propertiesV1: handlePropertiesV1,\n propertiesV2: handlePropertiesV2,\n primaryKeyPropertyV1: handlePrimaryKeyPropertyV1,\n primaryKeyPropertyV2: handlePrimaryKeyPropertyV2,\n primaryKeyPropertyValueV2: handlePrimaryKeyPropertyValueV2,\n linkedPropertiesV1: handleLinkedPropertiesV1,\n linkedPropertiesV2: handleLinkedPropertiesV2,\n linkedPrimaryKeyPropertyV1: handleLinkedPrimaryKeyPropertyV1,\n linkedPrimaryKeyPropertyV2: handleLinkedPrimaryKeyPropertyV2,\n arrayElementValue: handleArrayElementValue,\n },\n };\n\n// SDK major version enum\nenum SdkMajorVersion {\n V1 = 1,\n V2 = 2,\n}\n\n// Helper functions for properties\nfunction handleFunctionInputValuesV1({\n rawFunctionInputValues,\n}: {\n rawFunctionInputValues?: FunctionSampleParametersIR;\n}) {\n return renderFunctionInputValues(rawFunctionInputValues, SdkMajorVersion.V1);\n}\n\nfunction handleFunctionInputValuesV2({\n rawFunctionInputValues,\n}: {\n rawFunctionInputValues?: FunctionSampleParametersIR;\n}) {\n return renderFunctionInputValues(rawFunctionInputValues, SdkMajorVersion.V2);\n}\n\nfunction handleActionParameterSampleValuesV1({\n rawActionTypeParameterValues,\n}: {\n rawActionTypeParameterValues?: ActionParameterSampleValuesIR;\n}) {\n return renderActionParameterValues(\n rawActionTypeParameterValues,\n SdkMajorVersion.V1,\n );\n}\n\nfunction handleActionParameterSampleValuesV2({\n rawActionTypeParameterValues,\n}: {\n rawActionTypeParameterValues?: ActionParameterSampleValuesIR;\n}) {\n return renderActionParameterValues(\n rawActionTypeParameterValues,\n SdkMajorVersion.V2,\n );\n}\n\nfunction handlePropertyValueV1(\n { rawPropertyValue }: { rawPropertyValue?: PropertySampleValueTypeIR },\n) {\n return renderPropertyValue(rawPropertyValue, SdkMajorVersion.V1);\n}\n\nfunction handlePropertyValueV2(\n { rawPropertyValue }: { rawPropertyValue?: PropertySampleValueTypeIR },\n) {\n return renderPropertyValue(rawPropertyValue, SdkMajorVersion.V2);\n}\n\nfunction handlePropertyValueIncrementedV1({\n rawPropertyValueIncremented,\n}: {\n rawPropertyValueIncremented?: PropertySampleValueTypeIR;\n}) {\n return renderPropertyValue(rawPropertyValueIncremented, SdkMajorVersion.V1);\n}\n\nfunction handlePropertyValueIncrementedV2({\n rawPropertyValueIncremented,\n}: {\n rawPropertyValueIncremented?: PropertySampleValueTypeIR;\n}) {\n return renderPropertyValue(rawPropertyValueIncremented, SdkMajorVersion.V2);\n}\n\nfunction handleArrayElementValue(\n { rawPropertyValue }: { rawPropertyValue?: PropertySampleValueTypeIR },\n) {\n return renderArrayElementPropertyValue(rawPropertyValue, SdkMajorVersion.V2);\n}\n\nfunction renderArrayElementPropertyValue(\n propertyValue: PropertySampleValueTypeIR | undefined,\n majorVersion: SdkMajorVersion,\n): string {\n if (propertyValue == null) {\n throw new Error(\"Cannot render a null property value\");\n }\n\n return renderType(propertyValue, majorVersion, \"arraySubType\");\n}\n\nfunction handlePropertiesV1(\n { rawProperties }: { rawProperties?: PropertySampleIR[] },\n) {\n if (rawProperties == null) {\n throw new Error(\"Cannot render with null rawProperties\");\n }\n\n return rawProperties.map(prop => ({\n apiName: prop.apiName,\n value: renderPropertyValue(prop.value, SdkMajorVersion.V1),\n }));\n}\n\nfunction handlePropertiesV2(\n { rawProperties }: { rawProperties?: PropertySampleIR[] },\n) {\n if (rawProperties == null) {\n throw new Error(\"Cannot render with null rawProperties\");\n }\n\n return rawProperties.map(prop => ({\n apiName: prop.apiName,\n value: renderPropertyValue(prop.value, SdkMajorVersion.V2),\n }));\n}\n\nfunction handlePrimaryKeyPropertyV1(\n { rawPrimaryKeyProperty }: { rawPrimaryKeyProperty?: PropertySampleIR },\n) {\n if (rawPrimaryKeyProperty == null) {\n throw new Error(\"Cannot render with null rawPrimaryKeyProperty\");\n }\n\n return {\n apiName: rawPrimaryKeyProperty.apiName,\n value: renderPropertyValue(rawPrimaryKeyProperty.value, SdkMajorVersion.V1),\n };\n}\n\nfunction handlePrimaryKeyPropertyV2(\n { rawPrimaryKeyProperty }: { rawPrimaryKeyProperty?: PropertySampleIR },\n) {\n if (rawPrimaryKeyProperty == null) {\n throw new Error(\"Cannot render with null rawPrimaryKeyProperty\");\n }\n\n return {\n apiName: rawPrimaryKeyProperty.apiName,\n value: renderPropertyValue(rawPrimaryKeyProperty.value, SdkMajorVersion.V2),\n };\n}\n\nfunction handlePrimaryKeyPropertyValueV2({\n rawPrimaryKeyProperty,\n}: {\n rawPrimaryKeyProperty?: PropertySampleIR;\n}) {\n if (rawPrimaryKeyProperty == null) {\n throw new Error(\"Cannot render with null rawPrimaryKeyProperty\");\n }\n\n return renderPropertyValue(rawPrimaryKeyProperty.value, SdkMajorVersion.V2);\n}\n\nfunction handleLinkedPropertiesV1(\n { rawLinkedProperties }: { rawLinkedProperties?: PropertySampleIR[] },\n) {\n if (rawLinkedProperties == null) {\n throw new Error(\"Cannot render with null rawLinkedProperties\");\n }\n\n return rawLinkedProperties.map(prop => ({\n apiName: prop.apiName,\n value: renderPropertyValue(prop.value, SdkMajorVersion.V1),\n }));\n}\n\nfunction handleLinkedPropertiesV2(\n { rawLinkedProperties }: { rawLinkedProperties?: PropertySampleIR[] },\n) {\n if (rawLinkedProperties == null) {\n throw new Error(\"Cannot render with null rawLinkedProperties\");\n }\n\n return rawLinkedProperties.map(prop => ({\n apiName: prop.apiName,\n value: renderPropertyValue(prop.value, SdkMajorVersion.V2),\n }));\n}\n\nfunction handleLinkedPrimaryKeyPropertyV1({\n rawLinkedPrimaryKeyProperty,\n}: {\n rawLinkedPrimaryKeyProperty?: {\n apiName: string;\n value: PropertySampleValueTypeIR;\n type: string;\n };\n}) {\n if (rawLinkedPrimaryKeyProperty == null) {\n throw new Error(\"Cannot render with null rawLinkedPrimaryKeyProperty\");\n }\n\n return {\n apiName: rawLinkedPrimaryKeyProperty.apiName,\n value: renderPropertyValue(\n rawLinkedPrimaryKeyProperty.value,\n SdkMajorVersion.V1,\n ),\n type: rawLinkedPrimaryKeyProperty.type,\n };\n}\n\nfunction handleLinkedPrimaryKeyPropertyV2({\n rawLinkedPrimaryKeyProperty,\n}: {\n rawLinkedPrimaryKeyProperty?: {\n apiName: string;\n value: PropertySampleValueTypeIR;\n type: string;\n };\n}) {\n if (rawLinkedPrimaryKeyProperty == null) {\n throw new Error(\"Cannot render with null rawLinkedPrimaryKeyProperty\");\n }\n\n return {\n apiName: rawLinkedPrimaryKeyProperty.apiName,\n value: renderPropertyValue(\n rawLinkedPrimaryKeyProperty.value,\n SdkMajorVersion.V2,\n ),\n type: rawLinkedPrimaryKeyProperty.type,\n };\n}\n\n// Common function to render function input values for any version\nfunction renderFunctionInputValues(\n rawFunctionInputValues: FunctionSampleParametersIR | undefined,\n majorVersion: SdkMajorVersion,\n): string {\n if (rawFunctionInputValues == null) {\n throw new Error(\"Cannot render a null rawFunctionInputValues\");\n }\n if (Object.keys(rawFunctionInputValues.parameters).length === 0) {\n return \"\";\n }\n\n return outdent`\n {\n ${\n Object.entries(rawFunctionInputValues.parameters)\n .map(([key, value]) =>\n `\"${key}\": ${renderType(value, majorVersion, \"functionInput\")}`\n )\n .join(`,${indentedNewLine(4)}`)\n }\n }`;\n}\n\n// Common function to render action parameter values for any version\nfunction renderActionParameterValues(\n rawActionTypeParameterValues: ActionParameterSampleValuesIR | undefined,\n majorVersion: SdkMajorVersion,\n): Array<{ key: string; value: string; last: boolean }> {\n if (rawActionTypeParameterValues == null) {\n throw new Error(\"Cannot render a null rawActionTypeParameterValues\");\n }\n\n return rawActionTypeParameterValues.map((param, index, array) => ({\n key: param.key,\n value: renderType(param.value, majorVersion, \"actionParameter\"),\n last: index === array.length - 1,\n }));\n}\n\n// Function to render property values\nfunction renderPropertyValue(\n propertyValue: PropertySampleValueTypeIR | undefined,\n majorVersion: SdkMajorVersion,\n): string {\n if (propertyValue == null) {\n throw new Error(\"Cannot render a null property value\");\n }\n\n return renderType(propertyValue, majorVersion, \"property\");\n}\n\n// Unified render function for all types\nfunction renderType(\n type:\n | ActionParameterSampleValueTypeIR\n | FunctionSampleValueTypeIR\n | PropertySampleValueTypeIR,\n majorVersion: SdkMajorVersion,\n context: \"property\" | \"functionInput\" | \"actionParameter\" | \"arraySubType\",\n): string {\n if (type == null) {\n throw new Error(\"Cannot render a null type value\");\n }\n\n switch (type.type) {\n case \"array\":\n case \"set\":\n case \"list\":\n const arraySubType = renderType(type.subtype, majorVersion, context);\n return context === \"arraySubType\" ? arraySubType : `[${arraySubType}]`;\n case \"boolean\":\n return type.value ? \"true\" : \"false\";\n case \"byte\":\n case \"integer\":\n case \"long\":\n case \"short\":\n return type.value.toString();\n case \"decimal\":\n case \"double\":\n case \"float\":\n if (context === \"actionParameter\") {\n return `\"${type.value.toString()}\"`;\n }\n return type.value.toString();\n case \"date\":\n return getDateParameter(majorVersion, type.daysOffset);\n case \"timestamp\":\n return getTimestampParameter(majorVersion, type.daysOffset);\n case \"object\":\n const primaryKeyValue = type.primaryKeyType === \"string\"\n ? \"\\\"primaryKeyValue\\\"\"\n : \"primaryKeyValue\";\n if (context === \"actionParameter\") {\n return majorVersion >= SdkMajorVersion.V2\n ? `\"primaryKeyValue\" // or myObjectInstance`\n : `{ __primaryKey: ${primaryKeyValue}, /* other properties */ }`;\n }\n return primaryKeyValue;\n case \"anonymousCustomType\":\n case \"customType\":\n return \"{}\";\n case \"attachment\":\n return type.hasAttachments ? \"attachment\" : \"{}\";\n case \"interface\":\n case \"marking\":\n return \"{}\";\n case \"mediaReference\":\n return context === \"actionParameter\"\n ? \"mediaUpload\"\n : \"mediaReferenceRid\";\n case \"objectType\":\n return `\"${type.objectTypeApiName}\"`;\n case \"map\":\n if (type.keyType.type === \"object\") {\n return `{[${\n getMapKeyObjectName(type.keyType.apiName)\n }.$objectSpecifier]: ${\n renderType(type.valueType, majorVersion, context)\n }}`;\n }\n return `{${\n renderType(\n type.valueType,\n majorVersion,\n context,\n )\n }: ${renderType(type.valueType, majorVersion, context)}}`;\n\n case \"string\":\n case \"unknown\":\n default:\n return `\"${type.value ?? \"value\"}\"`;\n }\n}\n\nfunction getMapKeyObjectName(apiName?: string) {\n if (apiName == null) {\n return \"osdkObject\";\n }\n return `${getDisplayName(processObjectApiName(apiName))}OsdkObject`;\n}\n\nfunction getDisplayName(input: string): string {\n const tokens = input.split(/[_-]|(?<=[a-z])(?=[A-Z])/);\n const result = tokens.map(token => titleCase(token.toLowerCase())).join(\"\");\n return result.charAt(0).toLowerCase() + result.slice(1);\n}\n\nfunction titleCase(token: string) {\n return (token[0] ?? \"\").toUpperCase() + token.slice(1);\n}\n\n// For objects that have namespaces prefixed to their api name, we remove it and only return the last portion\n// As that is what the TS OSDK uses to generate identifiers for objects\nfunction processObjectApiName(objectApiName: string) {\n const last = objectApiName.lastIndexOf(\".\");\n if (last === -1) {\n return objectApiName;\n }\n return objectApiName.slice(last + 1);\n}\n\n// Generic helper functions for date and timestamp\nfunction getDateParameter(\n majorVersion: SdkMajorVersion,\n daysOffset = 0,\n): string {\n const offsetDate = new Date();\n offsetDate.setDate(offsetDate.getDate() + daysOffset);\n const hasOffset = daysOffset !== 0;\n\n if (majorVersion >= SdkMajorVersion.V2) {\n return `\"${offsetDate.toISOString().split(\"T\")[0]}\"`;\n }\n return hasOffset\n ? `LocalDate.now().plusDays(${daysOffset})`\n : \"LocalDate.now()\";\n}\n\nfunction getTimestampParameter(\n majorVersion: SdkMajorVersion,\n daysOffset = 0,\n): string {\n const offsetDate = new Date();\n offsetDate.setDate(offsetDate.getDate() + daysOffset);\n const hasOffset = daysOffset !== 0;\n\n if (majorVersion >= SdkMajorVersion.V2) {\n return `\"${offsetDate.toISOString()}\"`;\n }\n return hasOffset\n ? `Timestamp.now().plusDays(${daysOffset})`\n : \"Timestamp.now()\";\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA,SAASA,OAAO,QAAQ,SAAS;AACjC,SAASC,QAAQ,QAAQ,+CAA+C;AAExE,MAAMC,eAAe,GAAIC,WAAmB,IAAK,KAAK,GAAG,CAACC,MAAM,CAACD,WAAW,CAAC,EAAE;AAE/E,OAAO,MAAME,wBAAgE,GAC3E;EACE,GAAGJ,QAAQ;EACXK,iBAAiB,EAAE;IACjBC,qBAAqB,EAAEC,2BAA2B;IAClDC,qBAAqB,EAAEC,2BAA2B;IAClDC,6BAA6B,EAAEC,mCAAmC;IAClEC,6BAA6B,EAAEC,mCAA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C,CAAC,GAAG1B,UAAU,CAAC;EAGrD,IAAI5B,YAAY,IAAIZ,eAAe,CAACI,EAAE,EAAE;IACtC,OAAO,IAAI2D,UAAU,CAACI,WAAW,CAAC,CAAC,GAAG;EACxC;EACA,OALkB3B,UAAU,KAAK,CAAC,GAM9B,4BAA4BA,UAAU,GAAG,GACzC,iBAAiB;AACvB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"docs.js","names":["outdent","snippets","indentedNewLine","spacesCount","repeat","TYPESCRIPT_OSDK_SNIPPETS","computedVariables","functionInputValuesV1","handleFunctionInputValuesV1","functionInputValuesV2","handleFunctionInputValuesV2","actionParameterSampleValuesV1","handleActionParameterSampleValuesV1","actionParameterSampleValuesV2","handleActionParameterSampleValuesV2","propertyValueV1","handlePropertyValueV1","propertyValueV2","handlePropertyValueV2","propertyValueIncrementedV1","handlePropertyValueIncrementedV1","propertyValueIncrementedV2","handlePropertyValueIncrementedV2","propertiesV1","handlePropertiesV1","propertiesV2","handlePropertiesV2","primaryKeyPropertyV1","handlePrimaryKeyPropertyV1","primaryKeyPropertyV2","handlePrimaryKeyPropertyV2","primaryKeyPropertyValueV2","handlePrimaryKeyPropertyValueV2","linkedPropertiesV1","handleLinkedPropertiesV1","linkedPropertiesV2","handleLinkedPropertiesV2","linkedPrimaryKeyPropertyV1","handleLinkedPrimaryKeyPropertyV1","linkedPrimaryKeyPropertyV2","handleLinkedPrimaryKeyPropertyV2","arrayElementValue","handleArrayElementValue","SdkMajorVersion","rawFunctionInputValues","renderFunctionInputValues","V1","V2","rawActionTypeParameterValues","renderActionParameterValues","rawPropertyValue","renderPropertyValue","rawPropertyValueIncremented","renderArrayElementPropertyValue","propertyValue","majorVersion","Error","renderType","rawProperties","map","prop","apiName","value","rawPrimaryKeyProperty","rawLinkedProperties","rawLinkedPrimaryKeyProperty","type","Object","keys","parameters","length","entries","key","join","param","index","array","last","context","arraySubType","subtype","toString","getDateParameter","daysOffset","getTimestampParameter","primaryKeyValue","primaryKeyType","objectTypeApiName","hasAttachments","keyType","getMapKeyObjectName","valueType","getDisplayName","processObjectApiName","input","tokens","split","result","token","titleCase","toLowerCase","charAt","slice","toUpperCase","objectApiName","lastIndexOf","offsetDate","Date","setDate","getDate","toISOString"],"sources":["docs.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 { SdkSnippets } from \"@osdk/docs-spec-core\";\nimport type {\n ActionParameterSampleValuesIR,\n ActionParameterSampleValueTypeIR,\n FunctionSampleParametersIR,\n FunctionSampleValueTypeIR,\n OSDK_SNIPPETS_SPEC,\n PropertySampleIR,\n PropertySampleValueTypeIR,\n} from \"@osdk/docs-spec-sdk\";\nimport { outdent } from \"outdent\";\nimport { snippets } from \"./generatedNoCheck/docsNoComputedVariables.js\";\n\nconst indentedNewLine = (spacesCount: number) => `\\n${\" \".repeat(spacesCount)}`;\n\nexport const TYPESCRIPT_OSDK_SNIPPETS: SdkSnippets<typeof OSDK_SNIPPETS_SPEC> =\n {\n ...snippets,\n computedVariables: {\n functionInputValuesV1: handleFunctionInputValuesV1,\n functionInputValuesV2: handleFunctionInputValuesV2,\n actionParameterSampleValuesV1: handleActionParameterSampleValuesV1,\n actionParameterSampleValuesV2: handleActionParameterSampleValuesV2,\n propertyValueV1: handlePropertyValueV1,\n propertyValueV2: handlePropertyValueV2,\n propertyValueIncrementedV1: handlePropertyValueIncrementedV1,\n propertyValueIncrementedV2: handlePropertyValueIncrementedV2,\n propertiesV1: handlePropertiesV1,\n propertiesV2: handlePropertiesV2,\n primaryKeyPropertyV1: handlePrimaryKeyPropertyV1,\n primaryKeyPropertyV2: handlePrimaryKeyPropertyV2,\n primaryKeyPropertyValueV2: handlePrimaryKeyPropertyValueV2,\n linkedPropertiesV1: handleLinkedPropertiesV1,\n linkedPropertiesV2: handleLinkedPropertiesV2,\n linkedPrimaryKeyPropertyV1: handleLinkedPrimaryKeyPropertyV1,\n linkedPrimaryKeyPropertyV2: handleLinkedPrimaryKeyPropertyV2,\n arrayElementValue: handleArrayElementValue,\n },\n };\n\n// SDK major version enum\nenum SdkMajorVersion {\n V1 = 1,\n V2 = 2,\n}\n\n// Helper functions for properties\nfunction handleFunctionInputValuesV1({\n rawFunctionInputValues,\n}: {\n rawFunctionInputValues?: FunctionSampleParametersIR;\n}) {\n return renderFunctionInputValues(rawFunctionInputValues, SdkMajorVersion.V1);\n}\n\nfunction handleFunctionInputValuesV2({\n rawFunctionInputValues,\n}: {\n rawFunctionInputValues?: FunctionSampleParametersIR;\n}) {\n return renderFunctionInputValues(rawFunctionInputValues, SdkMajorVersion.V2);\n}\n\nfunction handleActionParameterSampleValuesV1({\n rawActionTypeParameterValues,\n}: {\n rawActionTypeParameterValues?: ActionParameterSampleValuesIR;\n}) {\n return renderActionParameterValues(\n rawActionTypeParameterValues,\n SdkMajorVersion.V1,\n );\n}\n\nfunction handleActionParameterSampleValuesV2({\n rawActionTypeParameterValues,\n}: {\n rawActionTypeParameterValues?: ActionParameterSampleValuesIR;\n}) {\n return renderActionParameterValues(\n rawActionTypeParameterValues,\n SdkMajorVersion.V2,\n );\n}\n\nfunction handlePropertyValueV1(\n { rawPropertyValue }: { rawPropertyValue?: PropertySampleValueTypeIR },\n) {\n return renderPropertyValue(rawPropertyValue, SdkMajorVersion.V1);\n}\n\nfunction handlePropertyValueV2(\n { rawPropertyValue }: { rawPropertyValue?: PropertySampleValueTypeIR },\n) {\n return renderPropertyValue(rawPropertyValue, SdkMajorVersion.V2);\n}\n\nfunction handlePropertyValueIncrementedV1({\n rawPropertyValueIncremented,\n}: {\n rawPropertyValueIncremented?: PropertySampleValueTypeIR;\n}) {\n return renderPropertyValue(rawPropertyValueIncremented, SdkMajorVersion.V1);\n}\n\nfunction handlePropertyValueIncrementedV2({\n rawPropertyValueIncremented,\n}: {\n rawPropertyValueIncremented?: PropertySampleValueTypeIR;\n}) {\n return renderPropertyValue(rawPropertyValueIncremented, SdkMajorVersion.V2);\n}\n\nfunction handleArrayElementValue(\n { rawPropertyValue }: { rawPropertyValue?: PropertySampleValueTypeIR },\n) {\n return renderArrayElementPropertyValue(rawPropertyValue, SdkMajorVersion.V2);\n}\n\nfunction renderArrayElementPropertyValue(\n propertyValue: PropertySampleValueTypeIR | undefined,\n majorVersion: SdkMajorVersion,\n): string {\n if (propertyValue == null) {\n throw new Error(\"Cannot render a null property value\");\n }\n\n return renderType(propertyValue, majorVersion, \"arraySubType\");\n}\n\nfunction handlePropertiesV1(\n { rawProperties }: { rawProperties?: PropertySampleIR[] },\n) {\n if (rawProperties == null) {\n throw new Error(\"Cannot render with null rawProperties\");\n }\n\n return rawProperties.map(prop => ({\n apiName: prop.apiName,\n value: renderPropertyValue(prop.value, SdkMajorVersion.V1),\n }));\n}\n\nfunction handlePropertiesV2(\n { rawProperties }: { rawProperties?: PropertySampleIR[] },\n) {\n if (rawProperties == null) {\n throw new Error(\"Cannot render with null rawProperties\");\n }\n\n return rawProperties.map(prop => ({\n apiName: prop.apiName,\n value: renderPropertyValue(prop.value, SdkMajorVersion.V2),\n }));\n}\n\nfunction handlePrimaryKeyPropertyV1(\n { rawPrimaryKeyProperty }: { rawPrimaryKeyProperty?: PropertySampleIR },\n) {\n if (rawPrimaryKeyProperty == null) {\n throw new Error(\"Cannot render with null rawPrimaryKeyProperty\");\n }\n\n return {\n apiName: rawPrimaryKeyProperty.apiName,\n value: renderPropertyValue(rawPrimaryKeyProperty.value, SdkMajorVersion.V1),\n };\n}\n\nfunction handlePrimaryKeyPropertyV2(\n { rawPrimaryKeyProperty }: { rawPrimaryKeyProperty?: PropertySampleIR },\n) {\n if (rawPrimaryKeyProperty == null) {\n throw new Error(\"Cannot render with null rawPrimaryKeyProperty\");\n }\n\n return {\n apiName: rawPrimaryKeyProperty.apiName,\n value: renderPropertyValue(rawPrimaryKeyProperty.value, SdkMajorVersion.V2),\n };\n}\n\nfunction handlePrimaryKeyPropertyValueV2({\n rawPrimaryKeyProperty,\n}: {\n rawPrimaryKeyProperty?: PropertySampleIR;\n}) {\n if (rawPrimaryKeyProperty == null) {\n throw new Error(\"Cannot render with null rawPrimaryKeyProperty\");\n }\n\n return renderPropertyValue(rawPrimaryKeyProperty.value, SdkMajorVersion.V2);\n}\n\nfunction handleLinkedPropertiesV1(\n { rawLinkedProperties }: { rawLinkedProperties?: PropertySampleIR[] },\n) {\n if (rawLinkedProperties == null) {\n throw new Error(\"Cannot render with null rawLinkedProperties\");\n }\n\n return rawLinkedProperties.map(prop => ({\n apiName: prop.apiName,\n value: renderPropertyValue(prop.value, SdkMajorVersion.V1),\n }));\n}\n\nfunction handleLinkedPropertiesV2(\n { rawLinkedProperties }: { rawLinkedProperties?: PropertySampleIR[] },\n) {\n if (rawLinkedProperties == null) {\n throw new Error(\"Cannot render with null rawLinkedProperties\");\n }\n\n return rawLinkedProperties.map(prop => ({\n apiName: prop.apiName,\n value: renderPropertyValue(prop.value, SdkMajorVersion.V2),\n }));\n}\n\nfunction handleLinkedPrimaryKeyPropertyV1({\n rawLinkedPrimaryKeyProperty,\n}: {\n rawLinkedPrimaryKeyProperty?: {\n apiName: string;\n value: PropertySampleValueTypeIR;\n type: string;\n };\n}) {\n if (rawLinkedPrimaryKeyProperty == null) {\n throw new Error(\"Cannot render with null rawLinkedPrimaryKeyProperty\");\n }\n\n return {\n apiName: rawLinkedPrimaryKeyProperty.apiName,\n value: renderPropertyValue(\n rawLinkedPrimaryKeyProperty.value,\n SdkMajorVersion.V1,\n ),\n type: rawLinkedPrimaryKeyProperty.type,\n };\n}\n\nfunction handleLinkedPrimaryKeyPropertyV2({\n rawLinkedPrimaryKeyProperty,\n}: {\n rawLinkedPrimaryKeyProperty?: {\n apiName: string;\n value: PropertySampleValueTypeIR;\n type: string;\n };\n}) {\n if (rawLinkedPrimaryKeyProperty == null) {\n throw new Error(\"Cannot render with null rawLinkedPrimaryKeyProperty\");\n }\n\n return {\n apiName: rawLinkedPrimaryKeyProperty.apiName,\n value: renderPropertyValue(\n rawLinkedPrimaryKeyProperty.value,\n SdkMajorVersion.V2,\n ),\n type: rawLinkedPrimaryKeyProperty.type,\n };\n}\n\n// Common function to render function input values for any version\nfunction renderFunctionInputValues(\n rawFunctionInputValues: FunctionSampleParametersIR | undefined,\n majorVersion: SdkMajorVersion,\n): string {\n if (rawFunctionInputValues == null) {\n throw new Error(\"Cannot render a null rawFunctionInputValues\");\n }\n if (Object.keys(rawFunctionInputValues.parameters).length === 0) {\n return \"\";\n }\n\n return outdent`\n {\n ${\n Object.entries(rawFunctionInputValues.parameters)\n .map(([key, value]) =>\n `\"${key}\": ${renderType(value, majorVersion, \"functionInput\")}`\n )\n .join(`,${indentedNewLine(4)}`)\n }\n }`;\n}\n\n// Common function to render action parameter values for any version\nfunction renderActionParameterValues(\n rawActionTypeParameterValues: ActionParameterSampleValuesIR | undefined,\n majorVersion: SdkMajorVersion,\n): Array<{ key: string; value: string; last: boolean }> {\n if (rawActionTypeParameterValues == null) {\n throw new Error(\"Cannot render a null rawActionTypeParameterValues\");\n }\n\n return rawActionTypeParameterValues.map((param, index, array) => ({\n key: param.key,\n value: renderType(param.value, majorVersion, \"actionParameter\"),\n last: index === array.length - 1,\n }));\n}\n\n// Function to render property values\nfunction renderPropertyValue(\n propertyValue: PropertySampleValueTypeIR | undefined,\n majorVersion: SdkMajorVersion,\n): string {\n if (propertyValue == null) {\n throw new Error(\"Cannot render a null property value\");\n }\n\n return renderType(propertyValue, majorVersion, \"property\");\n}\n\n// Unified render function for all types\nfunction renderType(\n type:\n | ActionParameterSampleValueTypeIR\n | FunctionSampleValueTypeIR\n | PropertySampleValueTypeIR,\n majorVersion: SdkMajorVersion,\n context: \"property\" | \"functionInput\" | \"actionParameter\" | \"arraySubType\",\n): string {\n if (type == null) {\n throw new Error(\"Cannot render a null type value\");\n }\n\n switch (type.type) {\n case \"array\":\n case \"set\":\n case \"list\":\n const arraySubType = renderType(type.subtype, majorVersion, context);\n return context === \"arraySubType\" ? arraySubType : `[${arraySubType}]`;\n case \"boolean\":\n return type.value ? \"true\" : \"false\";\n case \"byte\":\n case \"integer\":\n case \"long\":\n case \"short\":\n return type.value.toString();\n case \"decimal\":\n case \"double\":\n case \"float\":\n if (context === \"actionParameter\") {\n return `\"${type.value.toString()}\"`;\n }\n return type.value.toString();\n case \"date\":\n return getDateParameter(majorVersion, type.daysOffset);\n case \"timestamp\":\n return getTimestampParameter(majorVersion, type.daysOffset);\n case \"object\":\n const primaryKeyValue = type.primaryKeyType === \"string\"\n ? \"\\\"primaryKeyValue\\\"\"\n : \"primaryKeyValue\";\n if (context === \"actionParameter\") {\n return majorVersion >= SdkMajorVersion.V2\n ? `\"primaryKeyValue\" // or myObjectInstance`\n : `{ __primaryKey: ${primaryKeyValue}, /* other properties */ }`;\n }\n return primaryKeyValue;\n case \"objectSet\":\n return `client(${type.objectTypeApiName}).where({ /* filter conditions */ })`;\n case \"anonymousCustomType\":\n case \"customType\":\n return \"{}\";\n case \"attachment\":\n return type.hasAttachments ? \"attachment\" : \"{}\";\n case \"interface\":\n case \"marking\":\n return \"{}\";\n case \"mediaReference\":\n return context === \"actionParameter\"\n ? \"mediaUpload\"\n : \"mediaReferenceRid\";\n case \"objectType\":\n return `\"${type.objectTypeApiName}\"`;\n case \"map\":\n if (type.keyType.type === \"object\") {\n return `{[${\n getMapKeyObjectName(type.keyType.apiName)\n }.$objectSpecifier]: ${\n renderType(type.valueType, majorVersion, context)\n }}`;\n }\n return `{${\n renderType(\n type.valueType,\n majorVersion,\n context,\n )\n }: ${renderType(type.valueType, majorVersion, context)}}`;\n\n case \"string\":\n case \"unknown\":\n default:\n return `\"${type.value ?? \"value\"}\"`;\n }\n}\n\nfunction getMapKeyObjectName(apiName?: string) {\n if (apiName == null) {\n return \"osdkObject\";\n }\n return `${getDisplayName(processObjectApiName(apiName))}OsdkObject`;\n}\n\nfunction getDisplayName(input: string): string {\n const tokens = input.split(/[_-]|(?<=[a-z])(?=[A-Z])/);\n const result = tokens.map(token => titleCase(token.toLowerCase())).join(\"\");\n return result.charAt(0).toLowerCase() + result.slice(1);\n}\n\nfunction titleCase(token: string) {\n return (token[0] ?? \"\").toUpperCase() + token.slice(1);\n}\n\n// For objects that have namespaces prefixed to their api name, we remove it and only return the last portion\n// As that is what the TS OSDK uses to generate identifiers for objects\nfunction processObjectApiName(objectApiName: string) {\n const last = objectApiName.lastIndexOf(\".\");\n if (last === -1) {\n return objectApiName;\n }\n return objectApiName.slice(last + 1);\n}\n\n// Generic helper functions for date and timestamp\nfunction getDateParameter(\n majorVersion: SdkMajorVersion,\n daysOffset = 0,\n): string {\n const offsetDate = new Date();\n offsetDate.setDate(offsetDate.getDate() + daysOffset);\n const hasOffset = daysOffset !== 0;\n\n if (majorVersion >= SdkMajorVersion.V2) {\n return `\"${offsetDate.toISOString().split(\"T\")[0]}\"`;\n }\n return hasOffset\n ? `LocalDate.now().plusDays(${daysOffset})`\n : \"LocalDate.now()\";\n}\n\nfunction getTimestampParameter(\n majorVersion: SdkMajorVersion,\n daysOffset = 0,\n): string {\n const offsetDate = new Date();\n offsetDate.setDate(offsetDate.getDate() + daysOffset);\n const hasOffset = daysOffset !== 0;\n\n if (majorVersion >= SdkMajorVersion.V2) {\n return `\"${offsetDate.toISOString()}\"`;\n }\n return hasOffset\n ? `Timestamp.now().plusDays(${daysOffset})`\n : \"Timestamp.now()\";\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA,SAASA,OAAO,QAAQ,SAAS;AACjC,SAASC,QAAQ,QAAQ,+CAA+C;AAExE,MAAMC,eAAe,GAAIC,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,CAAC,CAAC,CAACd,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG;EACtD;EACA,OALkBb,UAAU,KAAK,CAAC,GAM9B,4BAA4BA,UAAU,GAAG,GACzC,iBAAiB;AACvB;AAEA,SAASC,qBAAqBA,CAC5B7B,YAA6B,EAC7B4B,UAAU,GAAG,CAAC,EACN;EACR,MAAMuB,UAAU,GAAG,IAAIC,IAAI,CAAC,CAAC;EAC7BD,UAAU,CAACE,OAAO,CAACF,UAAU,CAACG,OAAO,CAAC,CAAC,GAAG1B,UAAU,CAAC;EAGrD,IAAI5B,YAAY,IAAIZ,eAAe,CAACI,EAAE,EAAE;IACtC,OAAO,IAAI2D,UAAU,CAACI,WAAW,CAAC,CAAC,GAAG;EACxC;EACA,OALkB3B,UAAU,KAAK,CAAC,GAM9B,4BAA4BA,UAAU,GAAG,GACzC,iBAAiB;AACvB","ignoreList":[]}
|
|
@@ -554,8 +554,16 @@ export const snippets = {
|
|
|
554
554
|
"subscribeToObjectSetInstructions": [{
|
|
555
555
|
"template": "import { {{objectOrInterfaceApiName}} } from \"{{{packageName}}}\";\n// Edit this import if your client location differs\nimport { client } from \"./client\";\n\nconst subscription = client({{objectOrInterfaceApiName}}).subscribe(\n {\n onChange(update) {\n if (update.state === \"ADDED_OR_UPDATED\") {\n // An object has received an update or an object was added to the object set\n // Get the object using the $primaryKey from your cache\n // const currentObject = objects[update.object.$primaryKey];\n // use the update.object[\"<propertyName>\"] to update your cache \n //currentObject[\"<propertyName>\"] = update.object[\"<propertyName>\"] ?? currentObject[\"<propertyName>\"];\n }\n else if (update.state === \"REMOVED\") {\n // The object was removed from the object set, which could mean it was deleted or no longer meets the filter criteria\n // Remove the object from your cache using the $primaryKey\n // delete objects[update.object.$primaryKey];\n }\n },\n onSuccessfulSubscription() {\n // The subscription was successful and you can expect to receive updates\n },\n onError(err) {\n // There was an error with the subscription and you will not receive any more updates\n throw new Error(err.error instanceof Error ? err.error.message : String(err.error));\n },\n onOutOfDate() {\n // We could not keep track of all changes. Please reload the objects in your set.\n },\n },\n { properties: [ {{{propertyNames}}} ] }\n);\n\n// To stop receiving updates, call unsubscribe\nsubscription.unsubscribe();"
|
|
556
556
|
}],
|
|
557
|
+
"applyAction": [{
|
|
558
|
+
"template": "// Edit this import if your client location differs\nimport { client } from \"./client\";\n{{#hasAttachmentProperty}}\nimport type { AttachmentUpload {{#hasMediaParameter}}, MediaReference, MediaUpload {{/hasMediaParameter}} } from \"@osdk/api\";\n{{/hasAttachmentProperty}}\n{{^hasAttachmentProperty}}{{#hasMediaParameter}}\nimport type { MediaReference, MediaUpload } from \"@osdk/api\";\n{{/hasMediaParameter}}{{/hasAttachmentProperty}}\n{{#hasAttachmentProperty}}\nimport { createAttachmentUpload } from \"@osdk/client\";\n{{/hasAttachmentProperty}}\nimport { {{actionApiName}} {{#hasMediaParameter}}, {{objectType}} {{/hasMediaParameter}} } from \"{{{packageName}}}\";\n\nasync function callAction() {\n{{#hasAttachmentProperty}}\n // Create attachment upload\n const attachmentFile = await fetch(\"file.json\");\n const attachmentBlob = await attachmentFile.blob();\n const attachment: AttachmentUpload = createAttachmentUpload(attachmentBlob, \"myFile\");\n // alternatively, you can get the Rid from the attachment property on the object type you are modifying \n // const attachmentRid = objectTypeWithAttachment.{attachmentProperty}?.rid;\n\n{{/hasAttachmentProperty}}\n{{#hasMediaParameter}}\n // You can upload media data via your Action\n const mediaFile = await fetch(\"media.mp4\");\n const mediaBlob = await mediaFile.blob();\n const mediaUpload: MediaUpload = { data: mediaBlob, fileName: \"myMedia\" };\n \n // You can also pass an existing media reference into your Action\n const objectPage = await client({{objectType}}).fetchPage();\n const mediaReference: MediaReference = objectPage.data[0].{{property}}!.getMediaReference();\n\n{{/hasMediaParameter}}\n const result = await client({{actionApiName}}).applyAction(\n {\n {{#actionParameterSampleValuesV2}}\n \"{{key}}\": {{{value}}},\n {{/actionParameterSampleValuesV2}}\n },\n {\n $returnEdits: true,\n }\n );\n if (result.type === \"edits\") {\n // use the result object to report back on action results\n const updatedObject = result.editedObjectTypes[0];\n console.log(\"Updated object\", updatedObject);\n }\n}",
|
|
559
|
+
"computedVariables": ["actionParameterSampleValuesV2"]
|
|
560
|
+
}],
|
|
561
|
+
"batchApplyAction": [{
|
|
562
|
+
"template": "// Edit this import if your client location differs\nimport { client } from \"./client\";\n{{#hasAttachmentProperty}}\nimport type { AttachmentUpload {{#hasMediaParameter}}, MediaReference, MediaUpload {{/hasMediaParameter}} } from \"@osdk/api\";\n{{/hasAttachmentProperty}}\n{{^hasAttachmentProperty}}{{#hasMediaParameter}}\nimport type { MediaReference, MediaUpload } from \"@osdk/api\";\n{{/hasMediaParameter}}{{/hasAttachmentProperty}}\n{{#hasAttachmentProperty}}\nimport { createAttachmentUpload } from \"@osdk/client\";\n{{/hasAttachmentProperty}}\nimport { {{actionApiName}} {{#hasMediaParameter}}, {{objectType}} {{/hasMediaParameter}} } from \"{{{packageName}}}\";\n\nasync function callBatchAction() {\n{{#hasAttachmentProperty}}\n // Create attachment upload\n const attachmentFile = await fetch(\"file.json\");\n const attachmentBlob = await attachmentFile.blob();\n const attachment: AttachmentUpload = createAttachmentUpload(attachmentBlob, \"myFile\");\n\n{{/hasAttachmentProperty}}\n{{#hasMediaParameter}}\n // You can upload media data via your Action\n const mediaFile = await fetch(\"media.mp4\");\n const mediaBlob = await mediaFile.blob();\n const mediaUpload: MediaUpload = { data: mediaBlob, fileName: \"myMedia\" };\n \n // You can also pass an existing media reference into your Action\n const objectPage = await client({{objectType}}).fetchPage();\n const mediaReference: MediaReference = objectPage.data[0].{{property}}!.getMediaReference();\n \n{{/hasMediaParameter}}\n const result = await client({{actionApiName}}).batchApplyAction([\n {\n {{#actionParameterSampleValuesV2}}\n \"{{key}}\": {{{value}}},\n {{/actionParameterSampleValuesV2}}\n },\n {\n {{#actionParameterSampleValuesV2}}\n \"{{key}}\": {{{value}}},\n {{/actionParameterSampleValuesV2}}\n },\n ],\n {\n $returnEdits: true,\n }\n );\n if (result.type === \"edits\") {\n // use the result object to report back on action results\n const updatedObject = result.editedObjectTypes[0];\n console.log(\"Updated object\", updatedObject);\n }\n}",
|
|
563
|
+
"computedVariables": ["actionParameterSampleValuesV2"]
|
|
564
|
+
}],
|
|
557
565
|
"uploadMediaOntologyEdits": [{
|
|
558
|
-
"template": "
|
|
566
|
+
"template": "import type { Client } from \"@osdk/client\";\nimport { {{objectType}} } from \"{{{packageName}}}\";\nimport type { Edits } from \"@osdk/functions\";\nimport { createEditBatch, uploadMedia } from \"@osdk/functions\";\n\nasync function createObject(client: Client): Promise<Edits.Object<{{objectType}}>[]> {\n const batch = createEditBatch<Edits.Object<{{objectType}}>>(client);\n \n const blob = new Blob([\"Hello, world\"], { type: \"text/plain\" });\n const mediaReference = await uploadMedia(client, { data: blob, fileName: \"foundryFile.txt\" });\n\n // @ts-ignore \n batch.create({{objectType}}, { myMediaProperty: mediaReference, /* Other properties... */ });\n\n return batch.getEdits();\n}\n\nexport default createObject;"
|
|
559
567
|
}],
|
|
560
568
|
"uploadMedia": [{
|
|
561
569
|
"template": "import { __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference } from \"@osdk/api/unstable\";\nimport { {{objectType}}, {{actionApiName}} } from \"{{{packageName}}}\"\n// Edit this import if your client location differs\nimport { client } from \"./client\";\nimport type { MediaReference } from \"@osdk/api\";\n// To upload media with 2.x, it has to be linked to an Action call\nasync function createMediaReference() {\n const file = await fetch(\"file.json\");\n const data = await file.blob();\n // Upload media to an object type with a media property. This returns a media reference that can passed to\n // a media parameter in an Action.\n return await client(\n __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference,\n ).createMediaReference({\n data,\n fileName: \"myFile\",\n objectType: {{objectType}},\n propertyType: \"{{property}}\",\n });\n}\nconst mediaReference: MediaReference = await createMediaReference();\nconst actionResult = client({{actionApiName}}).applyAction({ \n {{primaryKeyPropertyV2.apiName}}: {{{propertyValueV2}}},\n {{mediaParameter}}: mediaReference \n});",
|
|
@@ -582,21 +590,6 @@ export const snippets = {
|
|
|
582
590
|
"template": "import { {{objectType}} } from \"{{{packageName}}}\";\n// Edit this import if your client location differs\nimport { client } from \"./client\";\n\n// Note that this vector maps to an arbitrary string\n// It must match the dimension of the \"{{property}}\" property: {{vectorDimensionSize}}\nconst vector_query = Array.from({ length: {{vectorDimensionSize}} }, () => 0.3);\nconst result = await client({{objectType}})\n .nearestNeighbors(vector_query, 5, \"{{property}}\")\n .fetchPage();"
|
|
583
591
|
}]
|
|
584
592
|
}
|
|
585
|
-
},
|
|
586
|
-
"2.6.0": {
|
|
587
|
-
"snippets": {
|
|
588
|
-
"applyAction": [{
|
|
589
|
-
"template": "// Edit this import if your client location differs\nimport { client } from \"./client\";\n{{#hasAttachmentProperty}}\nimport type { AttachmentUpload {{#hasMediaParameter}}, MediaReference, MediaUpload {{/hasMediaParameter}} } from \"@osdk/api\";\n{{/hasAttachmentProperty}}\n{{^hasAttachmentProperty}}{{#hasMediaParameter}}\nimport type { MediaReference, MediaUpload } from \"@osdk/api\";\n{{/hasMediaParameter}}{{/hasAttachmentProperty}}\n{{#hasAttachmentProperty}}\nimport { createAttachmentUpload } from \"@osdk/client\";\n{{/hasAttachmentProperty}}\nimport { {{actionApiName}} {{#hasMediaParameter}}, {{objectType}} {{/hasMediaParameter}} } from \"{{{packageName}}}\";\n\nasync function callAction() {\n{{#hasAttachmentProperty}}\n // Create attachment upload\n const attachmentFile = await fetch(\"file.json\");\n const attachmentBlob = await attachmentFile.blob();\n const attachment: AttachmentUpload = createAttachmentUpload(attachmentBlob, \"myFile\");\n // alternatively, you can get the Rid from the attachment property on the object type you are modifying \n // const attachmentRid = objectTypeWithAttachment.{attachmentProperty}?.rid;\n\n{{/hasAttachmentProperty}}\n{{#hasMediaParameter}}\n // You can upload media data via your Action\n const mediaFile = await fetch(\"media.mp4\");\n const mediaBlob = await mediaFile.blob();\n const mediaUpload: MediaUpload = { data: mediaBlob, fileName: \"myMedia\" };\n \n // You can also pass an existing media reference into your Action\n const objectPage = await client({{objectType}}).fetchPage();\n const mediaReference: MediaReference = objectPage.data[0].{{property}}!.getMediaReference();\n\n{{/hasMediaParameter}}\n const result = await client({{actionApiName}}).applyAction(\n {\n {{#actionParameterSampleValuesV2}}\n \"{{key}}\": {{{value}}},\n {{/actionParameterSampleValuesV2}}\n },\n {\n $returnEdits: true,\n }\n );\n if (result.type === \"edits\") {\n // use the result object to report back on action results\n const updatedObject = result.editedObjectTypes[0];\n console.log(\"Updated object\", updatedObject);\n }\n}",
|
|
590
|
-
"computedVariables": ["actionParameterSampleValuesV2"]
|
|
591
|
-
}],
|
|
592
|
-
"batchApplyAction": [{
|
|
593
|
-
"template": "// Edit this import if your client location differs\nimport { client } from \"./client\";\n{{#hasAttachmentProperty}}\nimport type { AttachmentUpload {{#hasMediaParameter}}, MediaReference, MediaUpload {{/hasMediaParameter}} } from \"@osdk/api\";\n{{/hasAttachmentProperty}}\n{{^hasAttachmentProperty}}{{#hasMediaParameter}}\nimport type { MediaReference, MediaUpload } from \"@osdk/api\";\n{{/hasMediaParameter}}{{/hasAttachmentProperty}}\n{{#hasAttachmentProperty}}\nimport { createAttachmentUpload } from \"@osdk/client\";\n{{/hasAttachmentProperty}}\nimport { {{actionApiName}} {{#hasMediaParameter}}, {{objectType}} {{/hasMediaParameter}} } from \"{{{packageName}}}\";\n\nasync function callBatchAction() {\n{{#hasAttachmentProperty}}\n // Create attachment upload\n const attachmentFile = await fetch(\"file.json\");\n const attachmentBlob = await attachmentFile.blob();\n const attachment: AttachmentUpload = createAttachmentUpload(attachmentBlob, \"myFile\");\n\n{{/hasAttachmentProperty}}\n{{#hasMediaParameter}}\n // You can upload media data via your Action\n const mediaFile = await fetch(\"media.mp4\");\n const mediaBlob = await mediaFile.blob();\n const mediaUpload: MediaUpload = { data: mediaBlob, fileName: \"myMedia\" };\n \n // You can also pass an existing media reference into your Action\n const objectPage = await client({{objectType}}).fetchPage();\n const mediaReference: MediaReference = objectPage.data[0].{{property}}!.getMediaReference();\n \n{{/hasMediaParameter}}\n const result = await client({{actionApiName}}).batchApplyAction([\n {\n {{#actionParameterSampleValuesV2}}\n \"{{key}}\": {{{value}}},\n {{/actionParameterSampleValuesV2}}\n },\n {\n {{#actionParameterSampleValuesV2}}\n \"{{key}}\": {{{value}}},\n {{/actionParameterSampleValuesV2}}\n },\n ],\n {\n $returnEdits: true,\n }\n );\n if (result.type === \"edits\") {\n // use the result object to report back on action results\n const updatedObject = result.editedObjectTypes[0];\n console.log(\"Updated object\", updatedObject);\n }\n}",
|
|
594
|
-
"computedVariables": ["actionParameterSampleValuesV2"]
|
|
595
|
-
}],
|
|
596
|
-
"uploadMediaOntologyEdits": [{
|
|
597
|
-
"template": "import type { Client } from \"@osdk/client\";\nimport { {{objectType}} } from \"{{{packageName}}}\";\nimport type { Edits } from \"@osdk/functions\";\nimport { createEditBatch, uploadMedia } from \"@osdk/functions\";\n\nasync function createObject(client: Client): Promise<Edits.Object<{{objectType}}>[]> {\n const batch = createEditBatch<Edits.Object<{{objectType}}>>(client);\n \n const blob = new Blob([\"Hello, world\"], { type: \"text/plain\" });\n const mediaReference = await uploadMedia(client, { data: blob, fileName: \"foundryFile.txt\" });\n\n // @ts-ignore \n batch.create({{objectType}}, { myMediaProperty: mediaReference, /* Other properties... */ });\n\n return batch.getEdits();\n}\n\nexport default createObject;"
|
|
598
|
-
}]
|
|
599
|
-
}
|
|
600
593
|
}
|
|
601
594
|
}
|
|
602
595
|
};
|