@osdk/typescript-sdk-docs 0.5.0-beta.1 → 0.5.0-beta.3
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 +1 -1
- package/build/browser/docs.js.map +1 -1
- package/build/browser/generatedNoCheck/docsNoComputedVariables.js +22 -5
- package/build/browser/generatedNoCheck/docsNoComputedVariables.js.map +1 -1
- package/build/cjs/index.cjs +23 -6
- package/build/cjs/index.cjs.map +1 -1
- package/build/esm/docs.js +1 -1
- package/build/esm/docs.js.map +1 -1
- package/build/esm/generatedNoCheck/docsNoComputedVariables.js +22 -5
- package/build/esm/generatedNoCheck/docsNoComputedVariables.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @osdk/typescript-sdk-docs
|
|
2
2
|
|
|
3
|
+
## 0.5.0-beta.3
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- a035fdc: Add draft of media upload docs
|
|
8
|
+
|
|
9
|
+
## 0.5.0-beta.2
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 7cac2f8: Upgrade to latest spec and fix attachment template"
|
|
14
|
+
|
|
3
15
|
## 0.4.0-beta.6
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/build/browser/docs.js
CHANGED
|
@@ -275,7 +275,7 @@ function renderType(type, majorVersion, context) {
|
|
|
275
275
|
case "marking":
|
|
276
276
|
return "{}";
|
|
277
277
|
case "mediaReference":
|
|
278
|
-
return context === "actionParameter" ? "
|
|
278
|
+
return context === "actionParameter" ? "mediaReferenceOrUpload" : "mediaReferenceRid";
|
|
279
279
|
case "objectType":
|
|
280
280
|
return `"${type.objectTypeApiName}"`;
|
|
281
281
|
case "map":
|
|
@@ -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 ? `{ $primaryKey: ${primaryKeyValue}, /* other properties */ }`\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 ? \"mediaReference\"\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,mCAAmC;IAClEC,eAAe,EAAEC,qBAAqB;IACtCC,eAAe,EAAEC,qBAAqB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5B,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","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 ? `{ $primaryKey: ${primaryKeyValue}, /* other properties */ }`\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 ? \"mediaReferenceOrUpload\"\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,MAA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AG,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":[]}
|
|
@@ -362,17 +362,19 @@ export const snippets = {
|
|
|
362
362
|
"computedVariables": ["propertyValueV2", "propertyValueIncrementedV2"]
|
|
363
363
|
}],
|
|
364
364
|
"applyAction": [{
|
|
365
|
-
"template": "// Edit this import if your client location differs\nimport { client } from \"./client\";\n{{#hasAttachmentProperty}}\nimport type { AttachmentUpload {{#hasMediaParameter}}, MediaReference {{/hasMediaParameter}} } from \"@osdk/api\";\n{{/hasAttachmentProperty}}\n{{^hasAttachmentProperty}}{{#hasMediaParameter}}\nimport type { MediaReference } from \"@osdk/api\";\n{{/hasMediaParameter}}{{/hasAttachmentProperty}}\n{{#hasAttachmentProperty}}\nimport { createAttachmentUpload } from \"@osdk/client\";\n{{/hasAttachmentProperty}}\n{{#hasMediaParameter}}\nimport { __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference } from \"@osdk/api/unstable\";\n{{/hasMediaParameter}}\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{{/hasAttachmentProperty}}\n{{#hasMediaParameter}}\n // Create media reference\n const mediaFile = await fetch(\"media.mp4\");\n const mediaBlob = await mediaFile.blob();\n const mediaReference: MediaReference = await client(\n __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference,\n ).createMediaReference({\n data: mediaBlob,\n fileName: \"myMedia\",\n objectType: {{objectType}},\n propertyType: \"{{property}}\",\n });\n // alternatively, you can get the Rid from the media property on the object type you are modifying\n // const mediaRid = objectTypeWithMedia.{mediaProperty}?.rid;\n{{/hasMediaParameter}}\n const result = await client({{actionApiName}}).applyAction(\n {\n {{#actionParameterSampleValuesV2}}\n \"{{key}}\": {{{value}}},\n {{/actionParameterSampleValuesV2}}\n
|
|
365
|
+
"template": "// Edit this import if your client location differs\nimport { client } from \"./client\";\n{{#hasAttachmentProperty}}\nimport type { AttachmentUpload {{#hasMediaParameter}}, MediaReference {{/hasMediaParameter}} } from \"@osdk/api\";\n{{/hasAttachmentProperty}}\n{{^hasAttachmentProperty}}{{#hasMediaParameter}}\nimport type { MediaReference } from \"@osdk/api\";\n{{/hasMediaParameter}}{{/hasAttachmentProperty}}\n{{#hasAttachmentProperty}}\nimport { createAttachmentUpload } from \"@osdk/client\";\n{{/hasAttachmentProperty}}\n{{#hasMediaParameter}}\nimport { __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference } from \"@osdk/api/unstable\";\n{{/hasMediaParameter}}\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{{/hasAttachmentProperty}}\n{{#hasMediaParameter}}\n // Create media reference\n const mediaFile = await fetch(\"media.mp4\");\n const mediaBlob = await mediaFile.blob();\n const mediaReference: MediaReference = await client(\n __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference,\n ).createMediaReference({\n data: mediaBlob,\n fileName: \"myMedia\",\n objectType: {{objectType}},\n propertyType: \"{{property}}\",\n });\n // alternatively, you can get the Rid from the media property on the object type you are modifying\n // const mediaRid = objectTypeWithMedia.{mediaProperty}?.rid;\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}",
|
|
366
|
+
"computedVariables": ["actionParameterSampleValuesV2"]
|
|
366
367
|
}],
|
|
367
368
|
"batchApplyAction": [{
|
|
368
|
-
"template": "// Edit this import if your client location differs\nimport { client } from \"./client\";\n{{#hasAttachmentProperty}}\nimport type { AttachmentUpload {{#hasMediaParameter}}, MediaReference {{/hasMediaParameter}} } from \"@osdk/api\";\n{{/hasAttachmentProperty}}\n{{^hasAttachmentProperty}}{{#hasMediaParameter}}\nimport type { MediaReference } from \"@osdk/api\";\n{{/hasMediaParameter}}{{/hasAttachmentProperty}}\n{{#hasAttachmentProperty}}\nimport { createAttachmentUpload } from \"@osdk/client\";\n{{/hasAttachmentProperty}}\n{{#hasMediaParameter}}\nimport { __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference } from \"@osdk/api/unstable\";\n{{/hasMediaParameter}}\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{{/hasAttachmentProperty}}\n{{#hasMediaParameter}}\n // Create media reference\n const mediaFile = await fetch(\"media.mp4\");\n const mediaBlob = await mediaFile.blob();\n const mediaReference: MediaReference = await client(\n __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference,\n ).createMediaReference({\n data: mediaBlob,\n fileName: \"myMedia\",\n objectType: {{objectType}},\n propertyType: \"{{property}}\",\n });\n{{/hasMediaParameter}}\n const result = await client({{actionApiName}}).batchApplyAction([\n {\n {{#actionParameterSampleValuesV2}}\n \"{{key}}\": {{{value}}},\n {{/actionParameterSampleValuesV2}}\n
|
|
369
|
+
"template": "// Edit this import if your client location differs\nimport { client } from \"./client\";\n{{#hasAttachmentProperty}}\nimport type { AttachmentUpload {{#hasMediaParameter}}, MediaReference {{/hasMediaParameter}} } from \"@osdk/api\";\n{{/hasAttachmentProperty}}\n{{^hasAttachmentProperty}}{{#hasMediaParameter}}\nimport type { MediaReference } from \"@osdk/api\";\n{{/hasMediaParameter}}{{/hasAttachmentProperty}}\n{{#hasAttachmentProperty}}\nimport { createAttachmentUpload } from \"@osdk/client\";\n{{/hasAttachmentProperty}}\n{{#hasMediaParameter}}\nimport { __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference } from \"@osdk/api/unstable\";\n{{/hasMediaParameter}}\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{{/hasAttachmentProperty}}\n{{#hasMediaParameter}}\n // Create media reference\n const mediaFile = await fetch(\"media.mp4\");\n const mediaBlob = await mediaFile.blob();\n const mediaReference: MediaReference = await client(\n __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference,\n ).createMediaReference({\n data: mediaBlob,\n fileName: \"myMedia\",\n objectType: {{objectType}},\n propertyType: \"{{property}}\",\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}",
|
|
370
|
+
"computedVariables": ["actionParameterSampleValuesV2"]
|
|
369
371
|
}],
|
|
370
372
|
"uploadAttachment": [{
|
|
371
373
|
"template": "// Edit this import if your client location differs\nimport { client } from \"./client\";\nimport { createAttachmentUpload } from \"@osdk/client\";\nimport type { AttachmentUpload } from \"@osdk/api\";\nimport { {{actionApiName}} } from \"{{{packageName}}}\";\n\n// To call an action with an attachment property, you first need to upload the file\nasync function createAttachmentReference() {\n const file = await fetch(\"file.json\");\n const blob = await file.blob();\n return createAttachmentUpload(blob, \"myFile\");\n}\n\nconst myAttachmentUpload: AttachmentUpload = await createAttachmentReference();\n// then pass the attachment to the action in the action parameter.\nconst actionResult = client({{actionApiName}}).applyAction({ \n {{primaryKeyPropertyV2.apiName}}: {{{propertyValueV2}}},\n {{property}}: myAttachmentUpload\n });",
|
|
372
374
|
"computedVariables": ["propertyValueV2"]
|
|
373
375
|
}],
|
|
374
376
|
"castInterfaceToObjectReference": [{
|
|
375
|
-
"template": "import { {{objectTypeApiName}}, {{interfaceApiName}} } from \"{{{packageName}}}\";\n// Edit this import if your client location differs\nimport { client } from \"./client\";\nimport {
|
|
377
|
+
"template": "import { {{objectTypeApiName}}, {{interfaceApiName}} } from \"{{{packageName}}}\";\n// Edit this import if your client location differs\nimport { client } from \"./client\";\nimport { type Osdk } from \"@osdk/client\";\n try {\n const page = await client({{interfaceApiName}}).fetchPage();\n\n const interfaces = page.data;\n const {{interfaceApiNameCamelCase}}: Osdk<{{interfaceApiName}}> = interfaces[0];\n\n // Cast from interface to object type\n const {{objectTypeApiNameCamelCase}}: Osdk<{{objectTypeApiName}}> = {{interfaceApiNameCamelCase}}.$as({{objectTypeApiName}});\n // Or from object type back to interface\n const {{interfaceApiNameCamelCase}}2: Osdk<{{interfaceApiName}}> = {{objectTypeApiNameCamelCase}}.$as({{interfaceApiName}});\n } catch (e) {\n throw e;\n }"
|
|
376
378
|
}],
|
|
377
379
|
"executeFunction": [{
|
|
378
380
|
"template": "// Edit this import if your client location differs\nimport { client } from \"./client\";\n{{#hasAttachmentProperty}}\n{{#hasAttachmentUpload}}\nimport type { AttachmentUpload } from \"@osdk/api\";\nimport { createAttachmentUpload } from \"@osdk/client\";\nimport { {{funcApiName}} } from \"{{{packageName}}}\";\n{{/hasAttachmentUpload}}\n{{^hasAttachmentUpload}}\nimport type { Osdk } from \"@osdk/client\";\nimport { {{funcApiName}}, type {{objectType}} } from \"{{{packageName}}}\";\n{{/hasAttachmentUpload}}\n\n{{#hasAttachmentUpload}}\nasync function callFunctionWithAttachmentUpload() {\n async function createAttachmentReference() {\n const file = await fetch(\"file.json\");\n const blob = await file.blob();\n return createAttachmentUpload(blob, \"myFile\");\n }\n const attachment: AttachmentUpload = await createAttachmentReference();\n{{/hasAttachmentUpload}}\n{{^hasAttachmentUpload}}\nasync function callFunctionWithAttachmentLoaded(objectWithAttachment: Osdk.Instance<{{objectType}}>) {\n const attachment = objectWithAttachment.{{attachmentProperty}}?.rid;\n if (attachment == null) {\n throw new Error(\"Attachment is required\");\n }\n{{/hasAttachmentUpload}}\n const result = await client({{funcApiName}}).executeFunction({{{functionInputValuesV2}}});\n return result;\n}\n{{/hasAttachmentProperty}}\n{{^hasAttachmentProperty}}\nimport { {{funcApiName}} } from \"{{{packageName}}}\";\n\nconst result = await client({{funcApiName}}).executeFunction({{{functionInputValuesV2}}});\n{{/hasAttachmentProperty}}",
|
|
@@ -437,7 +439,7 @@ export const snippets = {
|
|
|
437
439
|
"computedVariables": ["arrayElementValue"]
|
|
438
440
|
}],
|
|
439
441
|
"loadInterfacesReference": [{
|
|
440
|
-
"template": "import { {{interfaceApiName}} } from \"{{{packageName}}}\";\n// Edit this import if your client location differs\nimport { client } from \"./client\";\nimport { type Osdk, type PageResult
|
|
442
|
+
"template": "import { {{interfaceApiName}} } from \"{{{packageName}}}\";\n// Edit this import if your client location differs\nimport { client } from \"./client\";\nimport { type Osdk, type PageResult } from \"@osdk/client\";\n\nconst response: PageResult<Osdk<{{interfaceApiName}}>>\n = await client({{interfaceApiName}}).fetchPage({ $pageSize: 30 });"
|
|
441
443
|
}],
|
|
442
444
|
"loadAllInterfacesReference": [{
|
|
443
445
|
"template": "import { {{interfaceApiName}} } from \"{{{packageName}}}\";\n// Edit this import if your client location differs\nimport { client } from \"./client\";\nimport type { Osdk } from \"@osdk/client\";\n\nconst interfaces: Osdk<{{interfaceApiName}}>[] = [];\n\nfor await(const int of client({{interfaceApiName}}).asyncIter()) {\n interfaces.push(int);\n}\nconst interface1 = interfaces[0];"
|
|
@@ -446,7 +448,7 @@ export const snippets = {
|
|
|
446
448
|
"template": "import { {{interfaceApiName}} } from \"{{{packageName}}}\";\n// Edit this import if your client location differs\nimport { client } from \"./client\";\nimport { type Osdk, type PageResult } from \"@osdk/client\";\n\ntry {\n const page: PageResult<Osdk<{{interfaceApiName}}>> = await client({{interfaceApiName}})\n .fetchPage({\n $orderBy: { {{property}}: \"asc\"},\n $pageSize: 30\n });\n} catch (e) {\n throw e;\n}"
|
|
447
449
|
}],
|
|
448
450
|
"searchInterfacesReference": [{
|
|
449
|
-
"template": "import { {{interfaceApiName}} } from \"{{{packageName}}}\";\n// Edit this import if your client location differs\nimport { client } from \"./client\";\nimport {
|
|
451
|
+
"template": "import { {{interfaceApiName}} } from \"{{{packageName}}}\";\n// Edit this import if your client location differs\nimport { client } from \"./client\";\nimport { type Osdk, type PageResult } from \"@osdk/client\";\n\ntry {\n const page: PageResult<Osdk<{{interfaceApiName}}>> = await client({{interfaceApiName}})\n .where({\n {{#structSubPropertyApiName}}\n {{property}}: { {{structSubPropertyApiName}}: { $startsWith: \"foo\" }}\n {{/structSubPropertyApiName}}\n {{^structSubPropertyApiName}}\n {{property}}: { $startsWith: \"foo\" }\n {{/structSubPropertyApiName}}\n })\n .fetchPage({\n $pageSize: 30\n });\n\n const interfaces = page.data;\n const interface1 = interfaces[0];\n} catch (e) {\n throw e;\n}",
|
|
450
452
|
"computedVariables": ["propertyValueV2"]
|
|
451
453
|
}],
|
|
452
454
|
"loadTimeSeriesPointsSnippet": [{
|
|
@@ -577,6 +579,21 @@ export const snippets = {
|
|
|
577
579
|
"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();"
|
|
578
580
|
}]
|
|
579
581
|
}
|
|
582
|
+
},
|
|
583
|
+
"2.6.0": {
|
|
584
|
+
"snippets": {
|
|
585
|
+
"applyAction": [{
|
|
586
|
+
"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{{/hasAttachmentProperty}}\n{{#hasMediaParameter}}\n // Use existing media reference\n const objectPage = await client({{objectType}}).fetchPage();\n const mediaReference: MediaReference = objectPage.data[0].{{property}}!.getMediaReference();\n\n // Upload media data\n const mediaFile = await fetch(\"media.mp4\");\n const mediaBlob = await mediaFile.blob();\n const mediaUpload: MediaUpload = { data: mediaBlob, fileName: \"myMedia\" };\n\n const mediaReferenceOrUpload = Math.random() < 0.5 ? mediaReference : mediaUpload;\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}",
|
|
587
|
+
"computedVariables": ["actionParameterSampleValuesV2"]
|
|
588
|
+
}],
|
|
589
|
+
"batchApplyAction": [{
|
|
590
|
+
"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{{/hasAttachmentProperty}}\n{{#hasMediaParameter}}\n // Use existing media reference\n const objectPage = await client({{objectType}}).fetchPage();\n const mediaReference: MediaReference = objectPage.data[0].{{property}}!.getMediaReference();\n\n // Upload media data\n const mediaFile = await fetch(\"media.mp4\");\n const mediaBlob = await mediaFile.blob();\n const mediaUpload: MediaUpload = { data: mediaBlob, fileName: \"myMedia\" };\n\n const mediaReferenceOrUpload = Math.random() < 0.5 ? mediaReference : mediaUpload;\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}",
|
|
591
|
+
"computedVariables": ["actionParameterSampleValuesV2"]
|
|
592
|
+
}],
|
|
593
|
+
"uploadMediaOntologyEdits": [{
|
|
594
|
+
"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}}, {\n // \"<mediaProperty>\": mediaReference,\n });\n\n return batch.getEdits();\n}\n\nexport default createObject;"
|
|
595
|
+
}]
|
|
596
|
+
}
|
|
580
597
|
}
|
|
581
598
|
}
|
|
582
599
|
};
|