@osdk/typescript-sdk-docs 0.0.0 → 0.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/build/browser/docs.js.map +1 -1
- package/build/browser/generatedNoCheck/docsNoComputedVariables.js +11 -4
- package/build/browser/generatedNoCheck/docsNoComputedVariables.js.map +1 -1
- package/build/cjs/index.cjs +11 -4
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/index.d.cts +2 -2
- package/build/esm/docs.js.map +1 -1
- package/build/esm/generatedNoCheck/docsNoComputedVariables.js +11 -4
- package/build/esm/generatedNoCheck/docsNoComputedVariables.js.map +1 -1
- package/build/types/docs.d.ts +2 -2
- package/build/types/docs.d.ts.map +1 -1
- package/build/types/generatedNoCheck/docsNoComputedVariables.d.ts +2 -2
- package/build/types/generatedNoCheck/docsNoComputedVariables.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# @osdk/typescript-sdk-docs
|
|
2
|
+
|
|
3
|
+
## 0.1.0-beta.1
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- dc418de: Add doc snippets for contains + searchAround
|
|
8
|
+
|
|
9
|
+
## 0.1.0-beta.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 023d76a: Fix TS OSDK types
|
|
14
|
+
- 37cba2a: Create @osdk/typescript-sdk-docs
|
|
@@ -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","linkedPropertiesV1","handleLinkedPropertiesV1","linkedPropertiesV2","handleLinkedPropertiesV2","linkedPrimaryKeyPropertyV1","handleLinkedPrimaryKeyPropertyV1","linkedPrimaryKeyPropertyV2","handleLinkedPrimaryKeyPropertyV2","SdkMajorVersion","rawFunctionInputValues","renderFunctionInputValues","V1","V2","rawActionTypeParameterValues","renderActionParameterValues","rawPropertyValue","renderPropertyValue","rawPropertyValueIncremented","rawProperties","Error","map","prop","apiName","value","rawPrimaryKeyProperty","rawLinkedProperties","rawLinkedPrimaryKeyProperty","type","majorVersion","Object","keys","parameters","length","entries","key","renderType","join","param","index","array","last","propertyValue","context","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 { DocsSnippets } 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: DocsSnippets<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 linkedPropertiesV1: handleLinkedPropertiesV1,\n linkedPropertiesV2: handleLinkedPropertiesV2,\n linkedPrimaryKeyPropertyV1: handleLinkedPrimaryKeyPropertyV1,\n linkedPrimaryKeyPropertyV2: handleLinkedPrimaryKeyPropertyV2,\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 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 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\",\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 return `[${renderType(type.subtype, majorVersion, context)}]`;\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,IAA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EAC3C,IAAI5B,IAAI,KAAK,CAAC,CAAC,EAAE;IACf,OAAO2B,aAAa;EACtB;EACA,OAAOA,aAAa,CAACF,KAAK,CAACzB,IAAI,GAAG,CAAC,CAAC;AACtC;;AAEA;AACA,SAASK,gBAAgBA,CACvBjB,YAA6B,EAC7BkB,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,IAAIlB,YAAY,IAAIpB,eAAe,CAACI,EAAE,EAAE;IACtC,OAAO,IAAIyD,UAAU,CAACI,WAAW,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,CAC5BnB,YAA6B,EAC7BkB,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,IAAIlB,YAAY,IAAIpB,eAAe,CAACI,EAAE,EAAE;IACtC,OAAO,IAAIyD,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","linkedPropertiesV1","handleLinkedPropertiesV1","linkedPropertiesV2","handleLinkedPropertiesV2","linkedPrimaryKeyPropertyV1","handleLinkedPrimaryKeyPropertyV1","linkedPrimaryKeyPropertyV2","handleLinkedPrimaryKeyPropertyV2","SdkMajorVersion","rawFunctionInputValues","renderFunctionInputValues","V1","V2","rawActionTypeParameterValues","renderActionParameterValues","rawPropertyValue","renderPropertyValue","rawPropertyValueIncremented","rawProperties","Error","map","prop","apiName","value","rawPrimaryKeyProperty","rawLinkedProperties","rawLinkedPrimaryKeyProperty","type","majorVersion","Object","keys","parameters","length","entries","key","renderType","join","param","index","array","last","propertyValue","context","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 linkedPropertiesV1: handleLinkedPropertiesV1,\n linkedPropertiesV2: handleLinkedPropertiesV2,\n linkedPrimaryKeyPropertyV1: handleLinkedPrimaryKeyPropertyV1,\n linkedPrimaryKeyPropertyV2: handleLinkedPrimaryKeyPropertyV2,\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 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 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\",\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 return `[${renderType(type.subtype, majorVersion, context)}]`;\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,eAA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W,CAAC,GAAG,CAAC;EAC3C,IAAI5B,IAAI,KAAK,CAAC,CAAC,EAAE;IACf,OAAO2B,aAAa;EACtB;EACA,OAAOA,aAAa,CAACF,KAAK,CAACzB,IAAI,GAAG,CAAC,CAAC;AACtC;;AAEA;AACA,SAASK,gBAAgBA,CACvBjB,YAA6B,EAC7BkB,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,IAAIlB,YAAY,IAAIpB,eAAe,CAACI,EAAE,EAAE;IACtC,OAAO,IAAIyD,UAAU,CAACI,WAAW,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,CAC5BnB,YAA6B,EAC7BkB,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,IAAIlB,YAAY,IAAIpB,eAAe,CAACI,EAAE,EAAE;IACtC,OAAO,IAAIyD,UAAU,CAACI,WAAW,CAAC,CAAC,GAAG;EACxC;EACA,OALkB3B,UAAU,KAAK,CAAC,GAM9B,4BAA4BA,UAAU,GAAG,GACzC,iBAAiB;AACvB","ignoreList":[]}
|
|
@@ -432,6 +432,10 @@ export const snippets = {
|
|
|
432
432
|
"template": "import { {{objectType}} } from \"{{{packageName}}}\";\n// Edit this import if your client location differs\nimport { client } from \"./client\";\n\nconst {{objectType}}ObjectSet = client({{objectType}})\n .where({ $or:[\n { $not: { {{primaryKeyPropertyV2.apiName}}: { $isNull: true }}},\n { {{primaryKeyPropertyV2.apiName}}: { $eq: \"<primaryKey>\" }}\n ]});",
|
|
433
433
|
"computedVariables": ["primaryKeyPropertyV2"]
|
|
434
434
|
}],
|
|
435
|
+
"containsTemplate": [{
|
|
436
|
+
"template": "import { {{objectType}} } from \"{{{packageName}}}\";\n// Edit this import if your client location differs\nimport { client } from \"./client\";\n\nconst filteredObjects = client({{objectType}})\n .where({\n {{property}} : { $contains: {{{arrayElementValue}}} }\n })",
|
|
437
|
+
"computedVariables": ["arrayElementValue"]
|
|
438
|
+
}],
|
|
435
439
|
"loadInterfacesReference": [{
|
|
436
440
|
"template": "import { {{interfaceApiName}} } from \"{{{packageName}}}\";\n// Edit this import if your client location differs\nimport { client } from \"./client\";\nimport { type Osdk, type PageResult, type Result } from \"@osdk/client\";\n\nconst response: Result<PageResult<Osdk<{{interfaceApiName}}>>>\n = await client({{interfaceApiName}}).fetchPageWithErrors({ $pageSize: 30 });\n\n// To fetch a page without a result wrapper, use fetchPage instead\nconst responseNoErrorWrapper: PageResult<Osdk<{{interfaceApiName}}>>\n = await client({{interfaceApiName}}).fetchPage({ $pageSize: 30 });"
|
|
437
441
|
}],
|
|
@@ -514,16 +518,19 @@ export const snippets = {
|
|
|
514
518
|
"template": "import { {{objectType}} } from \"{{{packageName}}}\";\n// Edit this import if your client location differs\nimport { client } from \"./client\";\n\nconst sum{{objectType}} = await client({{objectType}})\n .withProperties({\n \"newPropertyName\": (baseObjectSet) =>\n baseObjectSet.pivotTo(\"{{linkName}}\").aggregate(\"{{property}}:{{operation}}\")\n })"
|
|
515
519
|
}],
|
|
516
520
|
"objectSetOperationsGuide": [{
|
|
517
|
-
"template": "import { {{objectType}} } from \"{{{packageName}}}/ontology/objects\";\n\nconst objectSetA = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \"a\"}})\nconst objectSetB = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \"b\"}})\nconst objectSetC = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \"c\"}})\n\n// Object set operations can be chained. e.g. To find all objects in objectSetA \n// that are present in objectSetB but do not exist in objectSetC:\nconst result
|
|
521
|
+
"template": "import { {{objectType}} } from \"{{{packageName}}}/ontology/objects\";\n\nconst objectSetA = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \"a\"}})\nconst objectSetB = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \"b\"}})\nconst objectSetC = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \"c\"}})\n\n// Object set operations can be chained. e.g. To find all objects in objectSetA \n// that are present in objectSetB but do not exist in objectSetC:\nconst result = objectSetA\n .intersect(objectSetB)\n .subtract(objectSetC);"
|
|
518
522
|
}],
|
|
519
523
|
"objectSetOperationsUnion": [{
|
|
520
|
-
"template": "import { {{objectType}} } from \"{{{packageName}}}/ontology/objects\";\n\nconst objectSetA = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \"a\"}})\nconst objectSetB = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \"b\"}})\nconst objectSetC = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \"c\"}})\n\n// Combine objectSetA, objectSetB and objectSetC\nconst result
|
|
524
|
+
"template": "import { {{objectType}} } from \"{{{packageName}}}/ontology/objects\";\n\nconst objectSetA = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \"a\"}})\nconst objectSetB = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \"b\"}})\nconst objectSetC = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \"c\"}})\n\n// Combine objectSetA, objectSetB and objectSetC\nconst result = objectSetA\n .union(objectSetB)\n .union(objectSetC); // alternatively: objectSetA.union(objectSetB, objectSetC)"
|
|
521
525
|
}],
|
|
522
526
|
"objectSetOperationsSubtract": [{
|
|
523
|
-
"template": "import { {{objectType}} } from \"{{{packageName}}}/ontology/objects\";\n\nconst objectSetA = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \"a\"}})\nconst objectSetB = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \"b\"}})\nconst objectSetC = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \"c\"}})\n\n\n// Return objects in objectSetA that are not present in either objectSetB or objectSetC\nconst result
|
|
527
|
+
"template": "import { {{objectType}} } from \"{{{packageName}}}/ontology/objects\";\n\nconst objectSetA = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \"a\"}})\nconst objectSetB = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \"b\"}})\nconst objectSetC = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \"c\"}})\n\n\n// Return objects in objectSetA that are not present in either objectSetB or objectSetC\nconst result = objectSetA\n .subtract(objectSetB)\n .subtract(objectSetC); // alternatively: objectSetA.subtract(objectSetB, objectSetC)"
|
|
524
528
|
}],
|
|
525
529
|
"objectSetOperationsIntersect": [{
|
|
526
|
-
"template": "import { {{objectType}} } from \"{{{packageName}}}/ontology/objects\";\n\nconst objectSetA = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \"a\"}})\nconst objectSetB = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \"b\"}})\nconst objectSetC = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \"c\"}})\n\n\n// Return all objects common to objectSetA, objectSetB and objectSetC\nconst result
|
|
530
|
+
"template": "import { {{objectType}} } from \"{{{packageName}}}/ontology/objects\";\n\nconst objectSetA = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \"a\"}})\nconst objectSetB = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \"b\"}})\nconst objectSetC = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \"c\"}})\n\n\n// Return all objects common to objectSetA, objectSetB and objectSetC\nconst result = objectSetA\n .intersect(objectSetB)\n .intersect(objectSetC); // alternatively: objectSetA.intersect(objectSetB, objectSetC)"
|
|
531
|
+
}],
|
|
532
|
+
"searchAround": [{
|
|
533
|
+
"template": "import { {{sourceObjectType}} } from \"{{{packageName}}}\";\n// Edit this import if your client location differs\nimport { client } from \"./client\";\n\n// Object set containing objects a, b and c\nconst objects = client({{sourceObjectType}})\n .where({ {{rawLinkedPrimaryKeyProperty.apiName}}: { $in: [\"a\", \"b\", \"c\"]}});\n\n// Traverse the selected link type to find all objects of type\n// {{linkedObjectType}} linked to objects a, b and c\nconst linkedObjects = await objects.pivotTo(\"{{linkApiName}}\");"
|
|
527
534
|
}]
|
|
528
535
|
}
|
|
529
536
|
},
|