@osdk/typescript-sdk-docs 0.4.0-beta.3 → 0.4.0-beta.5
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 +3 -3
- package/build/browser/generatedNoCheck/docsNoComputedVariables.js.map +1 -1
- package/build/cjs/index.cjs +3 -3
- package/build/cjs/index.cjs.map +1 -1
- package/build/esm/generatedNoCheck/docsNoComputedVariables.js +3 -3
- package/build/esm/generatedNoCheck/docsNoComputedVariables.js.map +1 -1
- package/package.json +1 -1
package/build/cjs/index.cjs
CHANGED
|
@@ -327,7 +327,7 @@ var snippets = {
|
|
|
327
327
|
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\nimport type { Osdk, PageResult, Result } from "@osdk/client";\n\nconst response: Result<PageResult<Osdk.Instance<{{objectType}}>>>\n = await client({{objectType}}).fetchPageWithErrors({ $pageSize: 30 });\n\n// To fetch a page without a result wrapper, use fetchPage instead\nconst responseNoErrorWrapper: PageResult<Osdk.Instance<{{objectType}}>>\n = await client({{objectType}}).fetchPage({ $pageSize: 30 });\n'
|
|
328
328
|
}],
|
|
329
329
|
"loadAllObjectsReference": [{
|
|
330
|
-
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\nimport type { Osdk } from "@osdk/client";\n\
|
|
330
|
+
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\nimport type { Osdk } from "@osdk/client";\n\nasync function getAll(): Promise<Array<Osdk.Instance<{{objectType}}>>> {\n const objects: Osdk.Instance<{{objectType}}>[]= [];\n for await(const obj of client({{objectType}}).asyncIter()) {\n objects.push(obj);\n }\n\n return objects;\n}\n\n// If Array.fromAsync() is available in your target environment\nfunction getAllFromAsync(): Promise<Array<Osdk.Instance<{{objectType}}>>> {\n return Array.fromAsync(client({{objectType}}).asyncIter());\n}'
|
|
331
331
|
}],
|
|
332
332
|
"loadLinkedObjectReference": [{
|
|
333
333
|
"template": 'import { {{sourceObjectType}}, {{linkedObjectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\nimport { type Osdk, type Result } from "@osdk/client";\n\nfunction getLinked{{linkedObjectType}}(source: Osdk.Instance<{{sourceObjectType}}>, linkedObjectPrimaryKey: {{linkedPrimaryKeyPropertyV2.type}}): Result<Osdk.Instance<{{linkedObjectType}}>>\n{\n return source.$link.{{linkApiName}}.fetchOneWithErrors(linkedObjectPrimaryKey);\n}\n\n// You can also get a linked object without the result wrapper\nfunction getLinkedNoWrapper{{linkedObjectType}}(source: Osdk.Instance<{{sourceObjectType}}>, linkedObjectPrimaryKey: {{linkedPrimaryKeyPropertyV2.type}}): Osdk.Instance<{{linkedObjectType}}> {\n return source.$link.{{linkApiName}}.fetchOne(linkedObjectPrimaryKey);\n}',
|
|
@@ -572,10 +572,10 @@ var snippets = {
|
|
|
572
572
|
"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 });'
|
|
573
573
|
}],
|
|
574
574
|
"nearestNeighborsTextQuery": [{
|
|
575
|
-
"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, "{{
|
|
575
|
+
"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, "{{property}}")\n .fetchPage();'
|
|
576
576
|
}],
|
|
577
577
|
"nearestNeighborsVectorQuery": [{
|
|
578
|
-
"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 "{{
|
|
578
|
+
"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();'
|
|
579
579
|
}]
|
|
580
580
|
}
|
|
581
581
|
}
|