@osdk/typescript-sdk-docs 0.4.0-beta.1 → 0.4.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/generatedNoCheck/docsNoComputedVariables.js +7 -1
- package/build/browser/generatedNoCheck/docsNoComputedVariables.js.map +1 -1
- package/build/cjs/index.cjs +9 -3
- package/build/cjs/index.cjs.map +1 -1
- package/build/esm/generatedNoCheck/docsNoComputedVariables.js +7 -1
- package/build/esm/generatedNoCheck/docsNoComputedVariables.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -330,7 +330,7 @@ export const snippets = {
|
|
|
330
330
|
"computedVariables": ["linkedPrimaryKeyPropertyV2"]
|
|
331
331
|
}],
|
|
332
332
|
"loadLinkedObjectsReference": [{
|
|
333
|
-
"template": "import { {{linkedObjectType}} } from \"{{{packageName}}}\";\n\nfunction getLinked{{linkedObjectType}}(source: Osdk.Instance<{{sourceObjectType}}>) {\n {{#isLinkManySided}}\n return source.$link.{{linkApiName}}.fetchPageWithErrors({ $pageSize: 30 });\n {{/isLinkManySided}}\n {{^isLinkManySided}}\n return source.$link.{{linkApiName}}.fetchOneWithErrors();\n {{/isLinkManySided}}\n}"
|
|
333
|
+
"template": "import { {{linkedObjectType}} } from \"{{{packageName}}}\";\n// Edit this import if your client location differs\nimport { client } from \"./client\";\n\nfunction getLinked{{linkedObjectType}}(source: Osdk.Instance<{{sourceObjectType}}>) {\n {{#isLinkManySided}}\n return source.$link.{{linkApiName}}.fetchPageWithErrors({ $pageSize: 30 });\n {{/isLinkManySided}}\n {{^isLinkManySided}}\n return source.$link.{{linkApiName}}.fetchOneWithErrors();\n {{/isLinkManySided}}\n}\n\n// You can also get a linked object by doing an object set searcharound\nfunction getLinkedWithPivot{{linkedObjectType}}(){\n return client({{sourceObjectType}}).pivotTo({{linkApiName}}).fetchPage();\n}"
|
|
334
334
|
}],
|
|
335
335
|
"aggregationTemplate": [{
|
|
336
336
|
"template": "import { {{objectType}} } from \"{{{packageName}}}\";\n// Edit this import if your client location differs\nimport { client } from \"./client\";\n\nconst num{{objectType}} = await client({{objectType}})\n .where({{property}}: { $isNull : false }})\n .aggregate({\n $select: { $count: \"unordered\" },\n $groupBy: { name: \"exact\" },\n });"
|
|
@@ -566,6 +566,12 @@ export const snippets = {
|
|
|
566
566
|
}],
|
|
567
567
|
"derivedPropertyDatetimeExpression": [{
|
|
568
568
|
"template": "import { {{objectType}} } from \"{{{packageName}}}\";\n// Edit this import if your client location differs\nimport { client } from \"./client\";\n\nconst {{objectType}}WithExpression = await client({{objectType}})\n .withProperties({\n \"newPropertyName\": (baseObjectSet) =>\n {{^isExtractPart}} \n baseObjectSet.pivotTo(\"{{linkName}}\")\n .selectProperty(\"{{property}}\")\n .{{operation}}(baseObjectSet.pivotTo(\"{{linkName}}\").selectProperty(\"{{property}}\"))\n {{/isExtractPart}}\n {{#isExtractPart}}\n baseObjectSet.pivotTo(\"{{linkName}}\")\n .selectProperty(\"{{property}}\").{{operation}}(\"DAY\")\n {{/isExtractPart}}\n });"
|
|
569
|
+
}],
|
|
570
|
+
"nearestNeighborsTextQuery": [{
|
|
571
|
+
"template": "import { {{objectType}} } from \"{{{packageName}}}\";\n// Edit this import if your client location differs\nimport { client } from \"./client\";\n\nconst result = await client({{objectType}})\n .nearestNeighbors(\"coffee\", 5, \"{{vectorProperty}}\")\n .fetchPage();"
|
|
572
|
+
}],
|
|
573
|
+
"nearestNeighborsVectorQuery": [{
|
|
574
|
+
"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 \"{{vectorProperty}}\" property: {{vectorDimensionSize}}\nconst vector_query = Array.from({ length: {{vectorDimensionSize}} }, () => 0.3),\nconst result = await client({{objectType}})\n .nearestNeighbors(vector_query, 5, \"{{vectorProperty}}\")\n .fetchPage();"
|
|
569
575
|
}]
|
|
570
576
|
}
|
|
571
577
|
}
|