@osdk/typescript-sdk-docs 0.27.0 → 0.28.0

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.
@@ -315,6 +315,12 @@ var snippets = {
315
315
  "loadObjectPageGuide": [{
316
316
  "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\n// $select only the properties you read. Without it, the API loads its default property set,\n// and reading fewer properties afterwards does not avoid the cost of fetching them.\n// $pageSize is the size of one page, not a limit on the total number of objects.\n// fetchPage does not request a snapshot unless you pass $snapshot: true (a snapshot configured for\n// a function run still applies). Without one, if data changes between requests, later pages may\n// repeat or skip objects. Pass $snapshot: true on every request to page through one consistent\n// view, or use asyncIter(), which always requests a snapshot.\ntry {\n const firstPage: PageResult<Osdk.Instance<{{objectType}}, never, "{{titleProperty}}">>\n = await client({{objectType}}).fetchPage({ $select: ["{{titleProperty}}"], $pageSize: 30 });\n if (firstPage.nextPageToken === undefined) {\n console.log(firstPage.data);\n }\n const secondPage: PageResult<Osdk.Instance<{{objectType}}, never, "{{titleProperty}}">>\n = await client({{objectType}}).fetchPage({\n $select: ["{{titleProperty}}"],\n $pageSize: 30,\n $nextPageToken: firstPage.nextPageToken,\n });\n console.log([...firstPage.data, ...secondPage.data]);\n}\ncatch (e) {\n throw e;\n}'
317
317
  }],
318
+ "selectPropertiesGuide": [{
319
+ "template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\n\nconst page = await client({{objectType}}).fetchPage({\n $select: ["{{titleProperty}}"],\n});'
320
+ }],
321
+ "applyPropertyModifiersGuide": [{
322
+ "template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\n\nconst page = await client({{objectType}}).fetchPage({\n $applyModifiers: {\n {{arrayProperty}}: "applyReducers",\n },\n});\n\nfor (const object of page.data) {\n // The property type is the array element type, not the original array type.\n const reducedValue = object.{{arrayProperty}};\n}'
323
+ }],
318
324
  "orderObjectsGuide": [{
319
325
  "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\n// $select only the properties you read; without it, the default property set is loaded.\n// $pageSize is the size of one page, not a limit on the total number of objects.\ntry {\n const page: PageResult<Osdk.Instance<{{objectType}}, never, "{{titleProperty}}">> = await client({{objectType}})\n .fetchPage({\n $select: ["{{titleProperty}}"],\n $orderBy: {"{{titleProperty}}": "asc"},\n $pageSize: 30\n });\n const objects = page.data;\n const object = objects[0];\n} catch (e) {\n throw e;\n}'
320
326
  }],
@@ -874,6 +880,9 @@ function renderType(type, majorVersion, context) {
874
880
  case "objectType": {
875
881
  return `"${type.objectTypeApiName}"`;
876
882
  }
883
+ case "scenarioReference": {
884
+ return `"${type.rid}"`;
885
+ }
877
886
  case "map": {
878
887
  if (type.keyType.type === "object") {
879
888
  return `{[${getMapKeyObjectName(type.keyType.apiName)}.$objectSpecifier]: ${renderType(type.valueType, majorVersion, context)}}`;