@osdk/typescript-sdk-docs 0.25.0 → 0.25.1-main-90da45384efe5511167b3842002d74856955da34
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 +6 -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 +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @osdk/typescript-sdk-docs
|
|
2
2
|
|
|
3
|
+
## 0.25.1-main-90da45384efe5511167b3842002d74856955da34
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2ab4d7c: Clarify that ontology-defined derived properties require explicit selection, distinguish runtime-defined derived properties, and add object-loading examples.
|
|
8
|
+
|
|
3
9
|
## 0.25.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -318,14 +318,14 @@ export const snippets = {
|
|
|
318
318
|
"template": "import { {{objectType}} } 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.Instance<{{objectType}}>> = await client({{objectType}})\n .where({\n {{titleProperty}}: {$isNull: true}\n })\n .fetchPage({\n $pageSize: 30\n });\n const objects = page.data;\n const object = objects[0];\n} catch (e) {\n throw e;\n}"
|
|
319
319
|
}],
|
|
320
320
|
"loadSingleObjectReference": [{
|
|
321
|
-
"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\nconst responseNoErrorWrapper: Osdk.Instance<{{objectType}}> = await client({{objectType}}).fetchOne({{{primaryKeyPropertyValueV2}}});\n\n",
|
|
321
|
+
"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\nconst responseNoErrorWrapper: Osdk.Instance<{{objectType}}> = await client({{objectType}}).fetchOne({{{primaryKeyPropertyValueV2}}});\n\n// Ontology-defined derived properties are not returned by default.\n// Pass their API names in $select, along with any other properties you need.\n// Runtime-defined derived properties added via .withProperties(...) are returned\n// by default only when $select is omitted. If you pass $select, include them\n// in the selection as well.\nfunction getWithSelectedProperties(properties: {{objectType}}.PropertyKeys[]) {\n return client({{objectType}}).fetchOne({{{primaryKeyPropertyValueV2}}}, {\n $select: properties\n });\n}\n\n",
|
|
322
322
|
"computedVariables": ["primaryKeyPropertyValueV2"]
|
|
323
323
|
}],
|
|
324
324
|
"loadObjectsReference": [{
|
|
325
|
-
"template": "import { {{objectType}} } from \"{{{packageName}}}\";\n// Edit this import if your client location differs\nimport { client } from \"./client\";\nimport type { Osdk, PageResult } from \"@osdk/client\";\ntry {\n const responseNoErrorWrapper: PageResult<Osdk.Instance<{{objectType}}>>\n = await client({{objectType}}).fetchPage({ $pageSize: 30 });\n} catch (e) {\n throw e;\n}\n"
|
|
325
|
+
"template": "import { {{objectType}} } from \"{{{packageName}}}\";\n// Edit this import if your client location differs\nimport { client } from \"./client\";\nimport type { Osdk, PageResult } from \"@osdk/client\";\ntry {\n const responseNoErrorWrapper: PageResult<Osdk.Instance<{{objectType}}>>\n = await client({{objectType}}).fetchPage({ $pageSize: 30 });\n} catch (e) {\n throw e;\n}\n\n// Ontology-defined derived properties are not returned by default.\n// Pass their API names in $select, along with any other properties you need.\n// Runtime-defined derived properties added via .withProperties(...) are returned\n// by default only when $select is omitted. If you pass $select, include them\n// in the selection as well.\nfunction getPageWithSelectedProperties(properties: {{objectType}}.PropertyKeys[]) {\n return client({{objectType}}).fetchPage({\n $pageSize: 30,\n $select: properties\n });\n}\n"
|
|
326
326
|
}],
|
|
327
327
|
"loadAllObjectsReference": [{
|
|
328
|
-
"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}"
|
|
328
|
+
"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}\n\n// Ontology-defined derived properties are not returned by default.\n// Pass their API names in $select, along with any other properties you need.\n// Runtime-defined derived properties added via .withProperties(...) are returned\n// by default only when $select is omitted. If you pass $select, include them\n// in the selection as well.\nasync function getAllWithSelectedProperties(properties: {{objectType}}.PropertyKeys[]) {\n const objects = [];\n for await (const obj of client({{objectType}}).asyncIter({ $select: properties })) {\n objects.push(obj);\n }\n return objects;\n}"
|
|
329
329
|
}],
|
|
330
330
|
"loadLinkedObjectReference": [{
|
|
331
331
|
"template": "import { type {{objectType}} } from \"{{{packageName}}}\";\nimport { type Osdk } from \"@osdk/client\";\n\nasync function getLinked{{linkedObjectType}}(source: Osdk.Instance<{{objectType}}>) {\n try {\n {{#isLinkManySided}}\n return await source.$link.{{linkApiName}}.fetchPage();\n {{/isLinkManySided}}\n {{^isLinkManySided}}\n return await source.$link.{{linkApiName}}.fetchOne();\n {{/isLinkManySided}}\n } catch (error) {\n return { error };\n }\n}"
|