@osdk/typescript-sdk-docs 0.4.0-beta.6 → 0.4.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.
- package/CHANGELOG.md +7 -3
- package/build/browser/docs.js +0 -9
- package/build/browser/docs.js.map +1 -1
- package/build/browser/generatedNoCheck/docsNoComputedVariables.js +70 -73
- package/build/browser/generatedNoCheck/docsNoComputedVariables.js.map +1 -1
- package/build/cjs/index.cjs +70 -82
- package/build/cjs/index.cjs.map +1 -1
- package/build/esm/docs.js +0 -9
- package/build/esm/docs.js.map +1 -1
- package/build/esm/generatedNoCheck/docsNoComputedVariables.js +70 -73
- package/build/esm/generatedNoCheck/docsNoComputedVariables.js.map +1 -1
- package/package.json +4 -4
package/build/cjs/index.cjs
CHANGED
|
@@ -11,7 +11,7 @@ var snippets = {
|
|
|
11
11
|
"1.0.0": {
|
|
12
12
|
"snippets": {
|
|
13
13
|
"loadSingleObjectGuide": [{
|
|
14
|
-
"template": 'import { type GetObjectError, isOk, type Result } from "{{{packageName}}}";\nimport { {{objectType}} } from "{{{packageName}}}";\n\nconst result: Result<{{objectType}}, GetObjectError> = await client.ontology.objects.{{objectType}}.get("primaryKey");\nif (isOk(result)) {\n const object: {{objectType}} = result.value;\n} else {\n console.error(result.error.errorType);\n}'
|
|
14
|
+
"template": 'import { type GetObjectError, isOk, type Result } from "{{{packageName}}}";\nimport { {{objectType}} } from "{{{packageName}}}/ontology/objects";\n\nconst result: Result<{{objectType}}, GetObjectError> = await client.ontology.objects.{{objectType}}.get("primaryKey");\nif (isOk(result)) {\n const object: {{objectType}} = result.value;\n} else {\n console.error(result.error.errorType);\n}'
|
|
15
15
|
}],
|
|
16
16
|
"loadObjectPageGuide": [{
|
|
17
17
|
"template": 'import { isOk, type LoadObjectSetError, Page, type Result } from "{{{packageName}}}";\nimport { {{objectType}} } from "{{{packageName}}}/ontology/objects";\n\nconst firstPage: Result<Page<{{objectType}}>, LoadObjectSetError> = await client.ontology.objects.{{objectType}}.page({ pageSize: 30 });\n\nif (isOk(firstPage)) {\n const secondPage: Result<Page<{{objectType}}>, LoadObjectSetError> = await client.ontology.objects.{{objectType}}\n .page({ pageSize: 30, pageToken: firstPage.value.nextPageToken });\n\n const objects = isOk(secondPage) ? [...firstPage.value.data, ...secondPage.value.data] : firstPage.value.data;\n const object = objects[0];\n}'
|
|
@@ -160,10 +160,10 @@ var snippets = {
|
|
|
160
160
|
"1.1.0": {
|
|
161
161
|
"snippets": {
|
|
162
162
|
"loadSingleObjectGuide": [{
|
|
163
|
-
"template": 'import { type GetObjectError, isOk, type Result } from "{{{packageName}}}";\nimport { {{objectType}} } from "{{{packageName}}}/ontology/objects";\n\nconst result: Result<{{objectType}}, GetObjectError> = await client.ontology.objects.{{objectType}}.fetchOneWithErrors("primaryKey");\nif (isOk(result)) {\n const object: {{objectType}} = result.value;\n} else {\n console.error(result.error.errorType);\n}\n// You can also fetch a single object without the Result wrapper\ntry {\n const object: {{objectType}} = await client.ontology.objects.{{objectType}}.fetchOne("primaryKey");\n}\ncatch(e) {\n
|
|
163
|
+
"template": 'import { type GetObjectError, isOk, type Result } from "{{{packageName}}}";\nimport { {{objectType}} } from "{{{packageName}}}/ontology/objects";\n\nconst result: Result<{{objectType}}, GetObjectError> = await client.ontology.objects.{{objectType}}.fetchOneWithErrors("primaryKey");\nif (isOk(result)) {\n const object: {{objectType}} = result.value;\n} else {\n console.error(result.error.errorType);\n}\n// You can also fetch a single object without the Result wrapper\ntry {\n const object: {{objectType}} = await client.ontology.objects.{{objectType}}.fetchOne("primaryKey");\n}\ncatch(e) {\n console.error(e);\n}'
|
|
164
164
|
}],
|
|
165
165
|
"loadObjectPageGuide": [{
|
|
166
|
-
"template": 'import { isOk, type LoadObjectSetError, Page, type Result } from "{{{packageName}}}";\nimport { {{objectType}} } from "{{{packageName}}}/ontology/objects";\n\nconst firstPage: Result<Page<{{objectType}}>, LoadObjectSetError> = await client.ontology.objects.{{objectType}}.fetchPageWithErrors({ pageSize: 30 });\n\nif (isOk(firstPage)) {\n const secondPage: Result<Page<{{objectType}}>, LoadObjectSetError> = await client.ontology.objects.{{objectType}}\n .fetchPageWithErrors({ pageSize: 30, pageToken: firstPage.value.nextPageToken });\n\n const objects = isOk(secondPage) ? [...firstPage.value.data, ...secondPage.value.data] : firstPage.value.data;\n const object = objects[0];\n}\n\n// To fetch a page without a result wrapper, use fetchPage with a try/catch instead\ntry {\n const firstPage: Page<{{objectType}}> = await client.ontology.objects.{{objectType}}.fetchPage({ pageSize: 30 });\n const secondPage: Page<{{objectType}}> = await client.ontology.objects.{{objectType}}\n .fetchPage({ pageSize: 30, pageToken: firstPage.value.nextPageToken });\n const objects = [...firstPage.data, ...secondPage.data];\n const object = objects[0];\n}\ncatch (e) {\n
|
|
166
|
+
"template": 'import { isOk, type LoadObjectSetError, Page, type Result } from "{{{packageName}}}";\nimport { {{objectType}} } from "{{{packageName}}}/ontology/objects";\n\nconst firstPage: Result<Page<{{objectType}}>, LoadObjectSetError> = await client.ontology.objects.{{objectType}}.fetchPageWithErrors({ pageSize: 30 });\n\nif (isOk(firstPage)) {\n const secondPage: Result<Page<{{objectType}}>, LoadObjectSetError> = await client.ontology.objects.{{objectType}}\n .fetchPageWithErrors({ pageSize: 30, pageToken: firstPage.value.nextPageToken });\n\n const objects = isOk(secondPage) ? [...firstPage.value.data, ...secondPage.value.data] : firstPage.value.data;\n const object = objects[0];\n}\n\n// To fetch a page without a result wrapper, use fetchPage with a try/catch instead\ntry {\n const firstPage: Page<{{objectType}}> = await client.ontology.objects.{{objectType}}.fetchPage({ pageSize: 30 });\n const secondPage: Page<{{objectType}}> = await client.ontology.objects.{{objectType}}\n .fetchPage({ pageSize: 30, pageToken: firstPage.value.nextPageToken });\n const objects = [...firstPage.data, ...secondPage.data];\n const object = objects[0];\n}\ncatch (e) {\n console.error(e);\n}'
|
|
167
167
|
}],
|
|
168
168
|
"orderObjectsGuide": [{
|
|
169
169
|
"template": 'import { isOk, Page, type Result, type SearchObjectsError } from "{{{packageName}}}";\nimport { {{objectType}} } from "{{{packageName}}}/ontology/objects";\n\nconst page: Result<Page<{{objectType}}>, SearchObjectsError> = await client.ontology.objects.{{objectType}}\n .orderBy(sortBy => sortBy.{{titleProperty}}.asc())\n .fetchPageWithErrors({ pageSize: 30 });\n\nif (isOk(page)) {\n const objects = page.value.data;\n const object = objects[0];\n}'
|
|
@@ -309,36 +309,35 @@ var snippets = {
|
|
|
309
309
|
"2.0.0": {
|
|
310
310
|
"snippets": {
|
|
311
311
|
"loadSingleObjectGuide": [{
|
|
312
|
-
"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\ntry {\n const object: Osdk.Instance<{{objectType}}> = await client({{objectType}}).fetchOne(
|
|
313
|
-
"computedVariables": ["primaryKeyPropertyValueV2"]
|
|
312
|
+
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\nimport { isOk, type Osdk, type Result } from "@osdk/client";\n\nconst result: Result<Osdk.Instance<{{objectType}}>> = await client({{objectType}}).fetchOneWithErrors("<primaryKey>");\nif (isOk(result)) {\n const object: Osdk.Instance<{{objectType}}> = result.value;\n} else {\n console.error(result.error.message);\n}\n// You can also fetch a single object without the Result wrapper\ntry {\n const object: Osdk.Instance<{{objectType}}> = await client({{objectType}}).fetchOne("<primaryKey>");\n}\ncatch(e) {\n console.error(e);\n}'
|
|
314
313
|
}],
|
|
315
314
|
"loadObjectPageGuide": [{
|
|
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\
|
|
315
|
+
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\nimport { isOk, type Osdk, type PageResult, type Result } from "@osdk/client";\n\nconst firstPage: Result<PageResult<Osdk.Instance<{{objectType}}>>>\n = await client({{objectType}}).fetchPageWithErrors({ $pageSize: 30 });\n\nif (isOk(firstPage)) {\n const secondPage: Result<PageResult<Osdk.Instance<{{objectType}}, never, "{{titleProperty}}">>>\n // You can also down select properties to only get the properties you need from the object\n = await client({{objectType}}).fetchPageWithErrors({ $select: ["{{titleProperty}}"], $pageSize: 30, $nextPageToken: firstPage.value.nextPageToken });\n\n const objects = isOk(secondPage) ? [...firstPage.value.data, ...secondPage.value.data] : firstPage.value.data;\n const object = objects[0];\n}\n\n // If you want to get rids, you need to add a flag to specifically request for it. Note how the return type now includes $rid rather than never\nconst secondPageWithRids: Result<PageResult<Osdk.Instance<{{objectType}}, "$rid", "{{titleProperty}}">>>\n = await client({{objectType}}).fetchPageWithErrors({ $select: ["{{titleProperty}}"], $includeRid:true, $pageSize: 30, $nextPageToken: firstPage.value.nextPageToken });\n\n// To fetch a page without a result wrapper, use fetchPage with a try/catch instead\ntry {\n const firstPage: PageResult<Osdk.Instance<{{objectType}}>>\n = await client({{objectType}}).fetchPage({ $pageSize: 30 });\n const secondPage: PageResult<Osdk.Instance<{{objectType}}>>\n = await client({{objectType}}).fetchPage({ $pageSize: 30, $nextPageToken: firstPage.nextPageToken });\n const objects = [...firstPage.data, ...secondPage.data];\n const object = objects[0];\n}\ncatch (e) {\n console.error(e);\n}'
|
|
317
316
|
}],
|
|
318
317
|
"orderObjectsGuide": [{
|
|
319
|
-
"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\
|
|
318
|
+
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\nimport { isOk, type Osdk, type PageResult, type Result } from "@osdk/client";\n\nconst page: Result<PageResult<Osdk.Instance<{{objectType}}>>> = await client({{objectType}})\n .fetchPageWithErrors({\n $orderBy: {"{{titleProperty}}": "asc"},\n $pageSize: 30\n });\n\nif (isOk(page)) {\n const objects = page.value.data;\n const object = objects[0];\n}'
|
|
320
319
|
}],
|
|
321
320
|
"searchObjectsGuide": [{
|
|
322
|
-
"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\
|
|
321
|
+
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\nimport { isOk, type Osdk, type PageResult, type Result } from "@osdk/client";\n\nconst page: Result<PageResult<Osdk.Instance<{{objectType}}>>> = await client({{objectType}})\n .where({\n {{titleProperty}}: {$isNull: true}\n })\n .fetchPageWithErrors({\n $pageSize: 30\n });\n\nif (isOk(page)) {\n const objects = page.value.data;\n const object = objects[0];\n}'
|
|
323
322
|
}],
|
|
324
323
|
"loadSingleObjectReference": [{
|
|
325
|
-
"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
|
|
326
|
-
"computedVariables": ["primaryKeyPropertyValueV2"]
|
|
324
|
+
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\nimport type { Osdk, Result } from "@osdk/client";\n\nconst response: Result<Osdk.Instance<{{objectType}}>> = await client({{objectType}}).fetchOneWithErrors("<primaryKey>");\n\n// You can also fetch a single object without the Result wrapper\n\nconst responseNoErrorWrapper: Osdk.Instance<{{objectType}}> = await client({{objectType}}).fetchOne("<primaryKey>");\n\n'
|
|
327
325
|
}],
|
|
328
326
|
"loadObjectsReference": [{
|
|
329
|
-
"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";\
|
|
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'
|
|
330
328
|
}],
|
|
331
329
|
"loadAllObjectsReference": [{
|
|
332
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}'
|
|
333
331
|
}],
|
|
334
332
|
"loadLinkedObjectReference": [{
|
|
335
|
-
"template": 'import {
|
|
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}',
|
|
334
|
+
"computedVariables": ["linkedPrimaryKeyPropertyV2"]
|
|
336
335
|
}],
|
|
337
336
|
"loadLinkedObjectsReference": [{
|
|
338
|
-
"template": 'import { {{
|
|
337
|
+
"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}'
|
|
339
338
|
}],
|
|
340
339
|
"aggregationTemplate": [{
|
|
341
|
-
"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({
|
|
340
|
+
"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 });'
|
|
342
341
|
}],
|
|
343
342
|
"countAggregationTemplate": [{
|
|
344
343
|
"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 .aggregate({\n $select: {$count: "unordered"},\n });'
|
|
@@ -350,49 +349,50 @@ var snippets = {
|
|
|
350
349
|
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\n\nconst distinct{{objectType}} = await client({{objectType}})\n .aggregate({\n $select: { "{{property}}:exactDistinct" : "unordered" },\n });'
|
|
351
350
|
}],
|
|
352
351
|
"numericAggregationTemplate": [{
|
|
353
|
-
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\n\nconst {{operation}}{{objectType}} = await client({{objectType}})\n .
|
|
352
|
+
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\n\nconst {{operation}}{{objectType}} = await client({{objectType}})\n .aggregation({\n $select: { "{{property}}:{{operation}}" : "unordered" }\n });'
|
|
354
353
|
}],
|
|
355
354
|
"fixedWidthGroupByTemplate": [{
|
|
356
|
-
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\n\nconst grouped{{objectType}} = await client({{objectType}})\n .aggregate({\n $select: { $count: "unordered" },\n $groupBy: { {{property}}: { $fixedWidth: 10 } }\n });'
|
|
355
|
+
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\n\nconst grouped{{objectType}} = await client({{objectType}})\n .aggregate({\n $select: { $count: "unordered" },\n $groupBy: { {{property}} : { $fixedWidth: 10 } }\n });'
|
|
357
356
|
}],
|
|
358
357
|
"durationGroupByTemplate": [{
|
|
359
|
-
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\n\nconst grouped{{objectType}} = await client({{objectType}})\n .aggregate({\n $select: { $count: "unordered" },\n $groupBy: { {{property}}:
|
|
358
|
+
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\n\nconst grouped{{objectType}} = await client({{objectType}})\n .aggregate({\n $select: { $count: "unordered" },\n $groupBy: { {{property}} : $duration: [ {{#durationText}}{{arg}}{{/durationText}}, "{{#durationText}}{{unit}}{{/durationText}}"] }\n })'
|
|
360
359
|
}],
|
|
361
360
|
"exactGroupByTemplate": [{
|
|
362
|
-
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\n\nconst grouped{{objectType}} = await client({{objectType}})\n .aggregate({\n $select: { $count: "unordered" },\n $groupBy: { {{property}}: "exact" }\n })'
|
|
361
|
+
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\n\nconst grouped{{objectType}} = await client({{objectType}})\n .aggregate({\n $select: { $count: "unordered" },\n $groupBy: { {{property}} : "exact" }\n })'
|
|
363
362
|
}],
|
|
364
363
|
"rangeGroupByTemplate": [{
|
|
365
|
-
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\n\nconst grouped{{objectType}} = await client({{objectType}})\n .aggregate({\n $select: { $count: "unordered" },\n $groupBy: { {{property}}: { $ranges: [[{{{propertyValueV2}}}, {{{propertyValueIncrementedV2}}} ]]} }\n });',
|
|
364
|
+
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\n\nconst grouped{{objectType}} = await client({{objectType}})\n .aggregate({\n $select: { $count: "unordered" },\n $groupBy: { {{property}} : { $ranges: [[{{{propertyValueV2}}}, {{{propertyValueIncrementedV2}}} ]]} }\n });',
|
|
366
365
|
"computedVariables": ["propertyValueV2", "propertyValueIncrementedV2"]
|
|
367
366
|
}],
|
|
368
367
|
"applyAction": [{
|
|
369
|
-
"template": '// Edit this import if your client location differs\nimport { client } from "./client";\n{{#
|
|
368
|
+
"template": 'import { {{actionApiName}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\n{{#hasAttachmentImports}}import type { AttachmentUpload } from "@osdk/api";{{/hasAttachmentImports}}{{#hasMediaParameter}}import type { MediaReference } from "@osdk/api";{{/hasMediaParameter}}\n\n\n{{#hasAttachmentUpload}}\nconst attachment: AttachmentUpload = uploadMyFile();\n{{/hasAttachmentUpload}}\n{{#attachmentProperty}}\nconst attachment: Attachment = {{{attachmentProperty}}};\n{{/attachmentProperty}}\n{{#hasMediaParameter}}\nconst mediaReference: MediaReference = uploadMedia();\n{{/hasMediaParameter}}\nconst result = await client({{actionApiName}}).applyAction(\n{{^hasParameters}}{},\n{{/hasParameters}}{{#hasParameters}}\n {\n {{#actionParameterSampleValuesV2}}\n "{{key}}": {{{value}}}{{^last}}, {{/last}}\n {{/actionParameterSampleValuesV2}}\n },{{/hasParameters}}\n {\n $returnEdits: true,\n }\n);\n\nif (result.type === "edits") {\n // for new objects and updated objects edits will contain the primary key of the object\n const updatedObject = result.editedObjectTypes[0];\n console.log("Updated object", updatedObject);\n}',
|
|
369
|
+
"computedVariables": ["actionParameterSampleValuesV2"]
|
|
370
370
|
}],
|
|
371
371
|
"batchApplyAction": [{
|
|
372
|
-
"template": '// Edit this import if your client location differs\nimport { client } from "./client";\n{{#
|
|
372
|
+
"template": 'import { {{actionApiName}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\n{{#hasAttachmentImports}}\nimport type { AttachmentUpload } from "@osdk/api";\n{{/hasAttachmentImports}}{{#hasMediaParameter}}import type { MediaReference } from "@osdk/api";{{/hasMediaParameter}}\n\n\n{{#hasAttachmentUpload}}\nconst attachment: AttachmentUpload = uploadMyFile();\n{{/hasAttachmentUpload}}\n{{#attachmentProperty}}\nconst attachment: Attachment = {{{attachmentProperty}}};\n{{/attachmentProperty}}\n{{#hasMediaParameter}}\nconst mediaReference: MediaReference = uploadMedia();\n{{/hasMediaParameter}}\nconst result = await client({{actionApiName}}).batchApplyAction(\n [\n {{^hasParameters}}{},{}{{/hasParameters}}{{#hasParameters}}\n {\n {{#actionParameterSampleValuesV2}}\n "{{key}}": {{{value}}}{{^last}}, {{/last}}\n {{/actionParameterSampleValuesV2}}\n },\n {\n {{#actionParameterSampleValuesV2}}\n "{{key}}": {{{value}}}{{^last}}, {{/last}}\n {{/actionParameterSampleValuesV2}}\n },{{/hasParameters}}\n ],\n {\n $returnEdits: false,\n }\n);',
|
|
373
|
+
"computedVariables": ["actionParameterSampleValuesV2"]
|
|
373
374
|
}],
|
|
374
375
|
"uploadAttachment": [{
|
|
375
|
-
"template": '// Edit this import if your client location differs\nimport { client } from "./client";\nimport {
|
|
376
|
-
"computedVariables": ["propertyValueV2"]
|
|
376
|
+
"template": '// Edit this import if your client location differs\nimport { client } from "./client";\nimport { type Result, isOk } from "@osdk/client";\nimport type { AttachmentUpload } from "@osdk/api";\n\n// To upload an attachment with 2.0, it has to be linked to an action call\n\nasync function uploadMyFile() {\n const file = await fetch("file.json");\n const blob = await file.blob();\n return createAttachmentUpload(blob, "myFile");\n}\n\nconst myAttachmentUpload: AttachmentUpload = await uploadMyFile();\n\nconst actionResult = client(attachmentUploadingAction).applyAction({ attachment: myAttachmentUpload });\n'
|
|
377
377
|
}],
|
|
378
378
|
"castInterfaceToObjectReference": [{
|
|
379
379
|
"template": 'import { {{objectTypeApiName}}, {{interfaceApiName}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\nimport { isOk, type Osdk } from "@osdk/client";\n\nconst page = await client({{interfaceApiName}}).fetchPageWithErrors();\n\nif (isOk(page)) {\n const interfaces = page.value.data;\n const {{interfaceApiNameCamelCase}}: Osdk<{{interfaceApiName}}> = interfaces[0];\n\n // Cast from interface to object type\n const {{objectTypeApiNameCamelCase}}: Osdk<{{objectTypeApiName}}> = {{interfaceApiNameCamelCase}}.$as({{objectTypeApiName}});\n // Or from object type back to interface\n const {{interfaceApiNameCamelCase}}2: Osdk<{{interfaceApiName}}> = {{objectTypeApiNameCamelCase}}.$as({{interfaceApiName}});\n}'
|
|
380
380
|
}],
|
|
381
381
|
"executeFunction": [{
|
|
382
|
-
"template": '// Edit this import if your client location differs\nimport { client } from "./client";\n{{#
|
|
382
|
+
"template": '{{#needsImports}}\nimport { {{funcApiName}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\n{{#hasAttachmentImports}}import type { AttachmentUpload } from "@osdk/api";{{/hasAttachmentImports}}\n\n{{/needsImports}}\n{{#hasAttachmentUpload}}\nconst attachment: AttachmentUpload = uploadMyFile();\n{{/hasAttachmentUpload}}\n{{#attachmentProperty}}\nconst attachment: Attachment = {{{attachmentProperty}}};\n{{/attachmentProperty}}\nconst result = await client({{funcApiName}}).executeFunction({{{functionInputValuesV2}}});',
|
|
383
383
|
"computedVariables": ["functionInputValuesV2"]
|
|
384
384
|
}],
|
|
385
385
|
"stringStartsWithTemplate": [{
|
|
386
|
-
"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({\n {{#structSubPropertyApiName}}\n {{property}}: { {{structSubPropertyApiName}}: { $startsWith: "foo" }}\n {{/structSubPropertyApiName}}\n {{^structSubPropertyApiName}}\n {{property}}: { $startsWith: "foo" }\n {{/structSubPropertyApiName}}\n })'
|
|
386
|
+
"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({\n {{#structSubPropertyApiName}}\n {{property}}: { {{structSubPropertyApiName}}: { $startsWith: "foo" }}\n {{/structSubPropertyApiName}}\n {{^structSubPropertyApiName}}\n {{property}} : { $startsWith: "foo" }\n {{/structSubPropertyApiName}}\n })'
|
|
387
387
|
}],
|
|
388
388
|
"containsAllTermsInOrderTemplate": [{
|
|
389
|
-
"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({\n {{#structSubPropertyApiName}}\n {{property}}: { {{structSubPropertyApiName}}: { $containsAllTermsInOrder: "foo bar" }}\n {{/structSubPropertyApiName}}\n {{^structSubPropertyApiName}}\n {{property}}: { $containsAllTermsInOrder: "foo bar" }\n {{/structSubPropertyApiName}}\n })'
|
|
389
|
+
"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({\n {{#structSubPropertyApiName}}\n {{property}}: { {{structSubPropertyApiName}}: { $containsAllTermsInOrder: "foo bar" }}\n {{/structSubPropertyApiName}}\n {{^structSubPropertyApiName}}\n {{property}} : { $containsAllTermsInOrder: "foo bar" }\n {{/structSubPropertyApiName}}\n })'
|
|
390
390
|
}],
|
|
391
391
|
"containsAnyTermTemplate": [{
|
|
392
|
-
"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({\n {{#structSubPropertyApiName}}\n {{property}}: { {{structSubPropertyApiName}}: { $containsAnyTerm: "foo bar" }}\n {{/structSubPropertyApiName}}\n {{^structSubPropertyApiName}}\n {{property}}: { $containsAnyTerm: "foo bar" }\n {{/structSubPropertyApiName}}\n })'
|
|
392
|
+
"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({\n {{#structSubPropertyApiName}}\n {{property}}: { {{structSubPropertyApiName}}: { $containsAnyTerm: "foo bar" }}\n {{/structSubPropertyApiName}}\n {{^structSubPropertyApiName}}\n {{property}} : { $containsAnyTerm: "foo bar" }\n {{/structSubPropertyApiName}}\n })'
|
|
393
393
|
}],
|
|
394
394
|
"containsAllTermsTemplate": [{
|
|
395
|
-
"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({\n {{#structSubPropertyApiName}}\n {{property}}: { {{structSubPropertyApiName}}: { $containsAllTerms: "foo bar" }}\n {{/structSubPropertyApiName}}\n {{^structSubPropertyApiName}}\n {{property}}: { $containsAllTerms: "foo bar" }\n {{/structSubPropertyApiName}}\n })'
|
|
395
|
+
"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({\n {{#structSubPropertyApiName}}\n {{property}}: { {{structSubPropertyApiName}}: { $containsAllTerms: "foo bar" }}\n {{/structSubPropertyApiName}}\n {{^structSubPropertyApiName}}\n {{property}} : { $containsAllTerms: "foo bar" }\n {{/structSubPropertyApiName}}\n })'
|
|
396
396
|
}],
|
|
397
397
|
"equalityTemplate": [{
|
|
398
398
|
"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({\n {{#structSubPropertyApiName}}\n {{property}}: { {{structSubPropertyApiName}}: { $eq: {{{propertyValueV2}}} }}\n {{/structSubPropertyApiName}}\n {{^structSubPropertyApiName}}\n {{property}}: { $eq: {{{propertyValueV2}}} }\n {{/structSubPropertyApiName}}\n });',
|
|
@@ -413,31 +413,31 @@ var snippets = {
|
|
|
413
413
|
"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({\n {{#structSubPropertyApiName}}\n {{property}}: { {{structSubPropertyApiName}}: { $within: { $distance: [100, "{{distanceUnit}}"], $of: [-74.0060, 40.7128]} }}\n {{/structSubPropertyApiName}}\n {{^structSubPropertyApiName}}\n {{property}}: { $within: { $distance: [100, "{{distanceUnit}}"], $of: [-74.0060, 40.7128]}}\n {{/structSubPropertyApiName}}\n })'
|
|
414
414
|
}],
|
|
415
415
|
"withinBoundingBoxTemplate": [{
|
|
416
|
-
"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({\n {{#structSubPropertyApiName}}\n {{property}}: { {{structSubPropertyApiName}}: { $within: { $bbox: [-74.0060, 25.123, 80.4231, 40.7128]}}}\n {{/structSubPropertyApiName}}\n {{^structSubPropertyApiName}}\n {{property}}: { $within: { $bbox: [-74.0060, 25.123, 80.4231, 40.7128]}}\n {{/structSubPropertyApiName}}\n });'
|
|
416
|
+
"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({\n {{#structSubPropertyApiName}}\n {{property}}: { {{structSubPropertyApiName}}: { $within: { $bbox: [-74.0060, 25.123, 80.4231, 40.7128]}}}\n {{/structSubPropertyApiName}}\n {{^structSubPropertyApiName}}\n {{property}}: { $within: { $bbox: [-74.0060, 25.123, 80.4231, 40.7128]}}\n {{/structSubPropertyApiName}}\n\n });'
|
|
417
417
|
}],
|
|
418
418
|
"withinPolygonTemplate": [{
|
|
419
419
|
"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({\n {{#structSubPropertyApiName}}\n {{property}}: { {{structSubPropertyApiName}}: { $within: { type: "Polygon", coordinates: [[[10.0, 40.0], [20.0, 50.0], [20.0, 30.0], [10.0, 40.0]]]}}}\n {{/structSubPropertyApiName}}\n {{^structSubPropertyApiName}}\n {{property}}: { $within: { type: "Polygon", coordinates: [[[10.0, 40.0], [20.0, 50.0], [20.0, 30.0], [10.0, 40.0]]]}}\n {{/structSubPropertyApiName}}\n });'
|
|
420
420
|
}],
|
|
421
421
|
"intersectsPolygonTemplate": [{
|
|
422
|
-
"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({\n {{#structSubPropertyApiName}}\n {{property}}: { {{structSubPropertyApiName}}: { $intersects: { type: "Polygon", coordinates: [[[10.0, 40.0], [20.0, 50.0], [20.0, 30.0], [10.0, 40.0]]
|
|
422
|
+
"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({\n {{#structSubPropertyApiName}}\n {{property}}: { {{structSubPropertyApiName}}: { $intersects: { type: "Polygon", coordinates: [[[10.0, 40.0], [20.0, 50.0], [20.0, 30.0], [10.0, 40.0]]}}}\n {{/structSubPropertyApiName}}\n {{^structSubPropertyApiName}}\n {{property}}: { $intersects: { type: "Polygon", coordinates: [[[10.0, 40.0], [20.0, 50.0], [20.0, 30.0], [10.0, 40.0]]}}\n {{/structSubPropertyApiName}}\n });'
|
|
423
423
|
}],
|
|
424
424
|
"intersectsBboxTemplate": [{
|
|
425
|
-
"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({\n {{#structSubPropertyApiName}}\n {{property}}: { {{structSubPropertyApiName}}: { $intersects: { $bbox: [-74.0060, 25.123, 80.4231, 40.7128]}}}\n {{/structSubPropertyApiName}}\n {{^structSubPropertyApiName}}\n {{property}}: { $intersects: { $bbox: [-74.0060, 25.123, 80.4231, 40.7128]}}\n {{/structSubPropertyApiName}}\n });'
|
|
425
|
+
"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({\n {{#structSubPropertyApiName}}\n {{property}}: { {{structSubPropertyApiName}} : { $intersects: { $bbox: [-74.0060, 25.123, 80.4231, 40.7128]}}}\n {{/structSubPropertyApiName}}\n {{^structSubPropertyApiName}}\n {{property}} : { $intersects: { $bbox: [-74.0060, 25.123, 80.4231, 40.7128]}}\n {{/structSubPropertyApiName}}\n });'
|
|
426
426
|
}],
|
|
427
427
|
"notTemplate": [{
|
|
428
|
-
"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({ $not: { {{
|
|
429
|
-
"computedVariables": ["
|
|
428
|
+
"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({ $not: { {{primaryKeyPropertyV2.apiName}}: { $isNull: true }}});',
|
|
429
|
+
"computedVariables": ["primaryKeyPropertyV2"]
|
|
430
430
|
}],
|
|
431
431
|
"andTemplate": [{
|
|
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({ $and:[\n { $not: { {{primaryKeyPropertyV2.apiName}}: { $isNull: true }}},\n { {{
|
|
433
|
-
"computedVariables": ["primaryKeyPropertyV2"
|
|
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({ $and:[\n { $not: { {{primaryKeyPropertyV2.apiName}}: { $isNull: true }}},\n { {{primaryKeyPropertyV2.apiName}}: { $eq: "<primaryKey>" }}\n ]});',
|
|
433
|
+
"computedVariables": ["primaryKeyPropertyV2"]
|
|
434
434
|
}],
|
|
435
435
|
"orTemplate": [{
|
|
436
|
-
"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 { {{
|
|
437
|
-
"computedVariables": ["primaryKeyPropertyV2"
|
|
436
|
+
"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 ]});',
|
|
437
|
+
"computedVariables": ["primaryKeyPropertyV2"]
|
|
438
438
|
}],
|
|
439
439
|
"containsTemplate": [{
|
|
440
|
-
"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 })',
|
|
440
|
+
"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 })',
|
|
441
441
|
"computedVariables": ["arrayElementValue"]
|
|
442
442
|
}],
|
|
443
443
|
"loadInterfacesReference": [{
|
|
@@ -447,26 +447,25 @@ var snippets = {
|
|
|
447
447
|
"template": 'import { {{interfaceApiName}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\nimport type { Osdk } from "@osdk/client";\n\nconst interfaces: Osdk<{{interfaceApiName}}>[] = [];\n\nfor await(const int of client({{interfaceApiName}}).asyncIter()) {\n interfaces.push(int);\n}\nconst interface1 = interfaces[0];'
|
|
448
448
|
}],
|
|
449
449
|
"loadOrderedInterfacesReference": [{
|
|
450
|
-
"template": 'import { {{interfaceApiName}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\nimport { type Osdk, type PageResult } from "@osdk/client";\n\
|
|
450
|
+
"template": 'import { {{interfaceApiName}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\nimport { isOk, type Osdk, type PageResult, type Result } from "@osdk/client";\n\nconst page: Result<PageResult<Osdk<{{interfaceApiName}}>>> = await client({{interfaceApiName}})\n .fetchPageWithErrors({\n $orderBy: {"someProperty": "asc"},\n $pageSize: 30\n });\n\nif (isOk(page)) {\n const interfaces = page.value.data;\n const interface1 = interfaces[0];\n}'
|
|
451
451
|
}],
|
|
452
452
|
"searchInterfacesReference": [{
|
|
453
|
-
"template": 'import { {{interfaceApiName}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\nimport { isOk, type Osdk, type PageResult, type Result } from "@osdk/client";\n\nconst page: Result<PageResult<Osdk<{{interfaceApiName}}>>> = await client({{interfaceApiName}})\n .where({\n $and:[\n { $not: {
|
|
454
|
-
"computedVariables": ["propertyValueV2"]
|
|
453
|
+
"template": 'import { {{interfaceApiName}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\nimport { isOk, type Osdk, type PageResult, type Result } from "@osdk/client";\n\nconst page: Result<PageResult<Osdk<{{interfaceApiName}}>>> = await client({{interfaceApiName}})\n .where({\n $and:[\n { $not: { someProperty: { $isNull: true }}},\n { someProperty: { $eq: "foo" }}\n ]\n })\n .fetchPageWithErrors({\n $pageSize: 30\n });\n\nif (isOk(page)) {\n const interfaces = page.value.data;\n const interface1 = interfaces[0];\n}'
|
|
455
454
|
}],
|
|
456
455
|
"loadTimeSeriesPointsSnippet": [{
|
|
457
|
-
"template": 'import
|
|
456
|
+
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n\nfunction getAllTimeSeriesPoints(obj: {{objectType}}) {\n return obj.{{property}}.getAllPoints();\n}'
|
|
458
457
|
}],
|
|
459
458
|
"loadRelativeTimeSeriesPointsSnippet": [{
|
|
460
|
-
"template": 'import
|
|
459
|
+
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n\n// Only supports ranges in the past\nfunction getRelativeTimeSeriesPoints(obj: {{objectType}}) {\n return obj.{{property}}.getAllPoints({\n $before: 1,\n $unit: "{{timeUnit}}",\n })\n}'
|
|
461
460
|
}],
|
|
462
461
|
"loadAbsoluteTimeSeriesPointsSnippet": [{
|
|
463
|
-
"template": 'import {
|
|
462
|
+
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n\nfunction getAbsoluteTimeSeriesPoints(obj: {{objectType}}) {\n return obj.{{property}}.getAllPoints({\n $startTime: "2022-08-13T12:34:56Z",\n $endTime: "2022-08-14T12:34:56Z",\n });\n}'
|
|
464
463
|
}],
|
|
465
464
|
"loadTimeSeriesFirstPointSnippet": [{
|
|
466
|
-
"template": 'import
|
|
465
|
+
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n\nfunction getFirstTimeSeriesPoint(obj: {{objectType}}) {\n return obj.{{property}}.getFirstPoint();\n}'
|
|
467
466
|
}],
|
|
468
467
|
"loadTimeSeriesLastPointSnippet": [{
|
|
469
|
-
"template": 'import
|
|
468
|
+
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n\nfunction getLastTimeSeriesPoint(obj: {{objectType}}) {\n return obj.{{property}}.getLastPoint();\n}'
|
|
470
469
|
}],
|
|
471
470
|
"loadGeotimeSeriesPointsSnippet": [{
|
|
472
471
|
"template": "// Upgrade to 2.1 for official support"
|
|
@@ -481,7 +480,7 @@ var snippets = {
|
|
|
481
480
|
"template": "// Upgrade to 2.1 for official support"
|
|
482
481
|
}],
|
|
483
482
|
"loadObjectMetadataSnippet": [{
|
|
484
|
-
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\n\nconst objectTypeMetadata = await client.fetchMetadata({{objectType}});\n\nif (objectTypeMetadata
|
|
483
|
+
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\n\nconst objectTypeMetadata = await client.fetchMetadata({{objectType}});\n\nif (objectTypeMetadata.icon.type === "blueprint") {\n const blueprintIconName = objectTypeMetadata.icon.name;\n}\nconst currentVisibility = objectTypeMetadata.visibility;\nconst currentDescription = objectTypeMetadata.description;'
|
|
485
484
|
}],
|
|
486
485
|
"loadInterfaceMetadataSnippet": [{
|
|
487
486
|
"template": 'import { {{interfaceApiName}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\n\nconst interfaceTypeMetadata = await client.fetchMetadata({{interfaceApiName}});\n\nconst implementingObjectTypes = interfaceTypeMetadata.implementedBy;\nconst interfaceRid = interfaceTypeMetadata.rid;'
|
|
@@ -496,89 +495,87 @@ var snippets = {
|
|
|
496
495
|
"template": "// Upgrade to 2.1 for official support"
|
|
497
496
|
}],
|
|
498
497
|
"derivedPropertyBaseExample": [{
|
|
499
|
-
"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("
|
|
498
|
+
"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("fooLink").pivotTo("barLink").selectProperty("foo")\n })\n .where({\n "newPropertyName": { $gt: 10 }\n })\n .aggregate({\n $select: { "newPropertyName:max": "unordered" }\n });'
|
|
500
499
|
}],
|
|
501
500
|
"derivedPropertyApproximateDistinctAggregation": [{
|
|
502
|
-
"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("{{
|
|
501
|
+
"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}}:approximateDistinct")\n })'
|
|
503
502
|
}],
|
|
504
503
|
"derivedPropertyExactDistinctAggregation": [{
|
|
505
|
-
"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("{{
|
|
504
|
+
"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}}:exactDistinct")\n })'
|
|
506
505
|
}],
|
|
507
506
|
"derivedPropertyCollectToListAggregation": [{
|
|
508
|
-
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\n\nconst maxObjectsInList = 75; // Adjust this value as needed between 1 and 100\nconst sum{{objectType}} = await client({{objectType}})\n .withProperties({\n "newPropertyName": (baseObjectSet) =>\n baseObjectSet.pivotTo("{{
|
|
507
|
+
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\n\nconst maxObjectsInList = 75; // Adjust this value as needed between 1 and 100\nconst sum{{objectType}} = await client({{objectType}})\n .withProperties({\n "newPropertyName": (baseObjectSet) =>\n baseObjectSet.pivotTo("{{linkName}}").aggregate("{{property}}:collectList", maxObjectsInList)\n })'
|
|
509
508
|
}],
|
|
510
509
|
"derivedPropertyCollectToSetAggregation": [{
|
|
511
|
-
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\n\nconst maxObjectsInSet = 75; // Adjust this value as needed between 1 and 100\nconst sum{{objectType}} = await client({{objectType}})\n .withProperties({\n "newPropertyName": (baseObjectSet) =>\n baseObjectSet.pivotTo("{{
|
|
510
|
+
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\n\nconst maxObjectsInSet = 75; // Adjust this value as needed between 1 and 100\nconst sum{{objectType}} = await client({{objectType}})\n .withProperties({\n "newPropertyName": (baseObjectSet) =>\n baseObjectSet.pivotTo("{{linkName}}").aggregate("{{property}}:collectSet", maxObjectsInSet)\n })'
|
|
512
511
|
}],
|
|
513
512
|
"derivedPropertyCountAggregation": [{
|
|
514
|
-
"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("{{
|
|
513
|
+
"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("$count")\n })'
|
|
515
514
|
}],
|
|
516
515
|
"derivedPropertySelectPropertyAggregation": [{
|
|
517
|
-
"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("{{
|
|
516
|
+
"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}}").selectProperty("{{property}}")\n })'
|
|
518
517
|
}],
|
|
519
518
|
"derivedPropertyApproximatePercentileAggregation": [{
|
|
520
|
-
"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("{{
|
|
519
|
+
"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}}:approximatePercentile", 0.5)\n })'
|
|
521
520
|
}],
|
|
522
521
|
"derivedPropertyNumericAggregation": [{
|
|
523
|
-
"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("{{
|
|
522
|
+
"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 })'
|
|
524
523
|
}],
|
|
525
524
|
"objectSetOperationsGuide": [{
|
|
526
|
-
"template": '
|
|
525
|
+
"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);'
|
|
527
526
|
}],
|
|
528
527
|
"objectSetOperationsUnion": [{
|
|
529
|
-
"template": '
|
|
528
|
+
"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)'
|
|
530
529
|
}],
|
|
531
530
|
"objectSetOperationsSubtract": [{
|
|
532
|
-
"template": '
|
|
531
|
+
"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)'
|
|
533
532
|
}],
|
|
534
533
|
"objectSetOperationsIntersect": [{
|
|
535
|
-
"template": '
|
|
534
|
+
"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)'
|
|
536
535
|
}],
|
|
537
536
|
"searchAround": [{
|
|
538
|
-
"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//
|
|
537
|
+
"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}}");'
|
|
539
538
|
}]
|
|
540
539
|
}
|
|
541
540
|
},
|
|
542
541
|
"2.1.0": {
|
|
543
542
|
"snippets": {
|
|
544
543
|
"loadGeotimeSeriesPointsSnippet": [{
|
|
545
|
-
"template": 'import
|
|
544
|
+
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n\nfunction getAllTimeSeriesPoints(obj: {{objectType}}) {\n return obj.{{property}}.getAllValues();\n}'
|
|
546
545
|
}],
|
|
547
546
|
"loadRelativeGeotimeSeriesPointsSnippet": [{
|
|
548
|
-
"template": 'import
|
|
547
|
+
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n\n// Only supports ranges in the past\nfunction getRelativeTimeSeriesPoints(obj: {{objectType}}) {\n return obj.{{property}}.getAllValues({\n $before: 1,\n $unit: "{{timeUnit}}",\n })\n}'
|
|
549
548
|
}],
|
|
550
549
|
"loadAbsoluteGeotimeSeriesPointsSnippet": [{
|
|
551
|
-
"template": 'import
|
|
550
|
+
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n\nfunction getAbsoluteTimeSeriesPoints(obj: {{objectType}}) {\n return obj.{{property}}.getAllValues({\n $startTime: "2022-08-13T12:34:56Z",\n $endTime: "2022-08-14T12:34:56Z",\n });\n}'
|
|
552
551
|
}],
|
|
553
552
|
"loadGeotimeSeriesLastPointSnippet": [{
|
|
554
|
-
"template": 'import
|
|
553
|
+
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n\nfunction getLastTimeSeriesPoint(obj: {{objectType}}) {\n return obj.{{property}}.getLatestValue();\n}'
|
|
555
554
|
}],
|
|
556
555
|
"subscribeToObjectSetInstructions": [{
|
|
557
|
-
"template": 'import { {{objectOrInterfaceApiName}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\n\nconst subscription = client({{objectOrInterfaceApiName}}).subscribe(\n {\n onChange(update) {\n if (update.state === "ADDED_OR_UPDATED") {\n // An object has received an update or an object was added to the object set\n
|
|
556
|
+
"template": 'import { {{objectOrInterfaceApiName}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\n\n// A map of primary keys to objects loaded through the SDK\nconst objects: { [key: string]: {{objectOrInterfaceApiName}}.OsdkInstance } = ...\n\nconst subscription = client({{objectOrInterfaceApiName}}).subscribe(\n {\n onChange(update) {\n if (update.state === "ADDED_OR_UPDATED") {\n // An object has received an update or an object was added to the object set\n const currentObject = objects[update.object.$primaryKey];\n if (currentObject !== undefined) {\n currentObject["<propertyName>"] = update.object["<propertyName>"] ?? currentObject["<propertyName>"];\n }\n }\n else if (update.state === "REMOVED") {\n // The object was removed from the object set, which could mean it was deleted or no longer meets the filter criteria\n delete objects[update.object.$primaryKey];\n }\n },\n onSuccessfulSubscription() {\n // The subscription was successful and you can expect to receive updates\n },\n onError(err) {\n // There was an error with the subscription and you will not receive any more updates\n console.error(err);\n },\n onOutOfDate() {\n // We could not keep track of all changes. Please reload the objects in your set.\n },\n },\n { properties: [ {{#propertyNames}}"{{.}}", {{/propertyNames}}] }\n);\n\nsubscription.unsubscribe();'
|
|
558
557
|
}],
|
|
559
558
|
"uploadMedia": [{
|
|
560
|
-
"template": 'import { __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference } from "@osdk/api/unstable";\nimport { {{objectType}}
|
|
561
|
-
"computedVariables": ["propertyValueV2"]
|
|
559
|
+
"template": 'import { __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference } from "@osdk/api/unstable";\nimport { {{objectType}} } from "{{{packageName}}}"\n// Edit this import if your client location differs\nimport { client } from "./client";\nimport { Result, isOk } from "@osdk/client";\nimport type { MediaReference } from "@osdk/api";\n\n// To upload media with 2.x, it has to be linked to an Action call\nasync function uploadMedia() {\n const file = await fetch("file.json");\n const data = await file.blob();\n\n // Upload media to an object type with a media property. This returns a media reference that can passed to\n // a media parameter in an Action.\n return await client(\n __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference,\n ).createMediaReference({\n data,\n fileName: "myFile",\n objectType: {{objectType}},\n propertyType: "MediaPropertyApi",\n });\n}\n\nconst mediaReference: MediaReference = await uploadMedia();\nconst actionResult = client(mediaUploadingAction).applyAction({ media_parameter: mediaReference });'
|
|
562
560
|
}],
|
|
563
561
|
"readMedia": [{
|
|
564
|
-
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\nconst result = await client({{objectType}}).fetchOne(
|
|
565
|
-
"computedVariables": ["primaryKeyPropertyValueV2"]
|
|
562
|
+
"template": 'import { {{objectType}} } from "{{{packageName}}}";\n// Edit this import if your client location differs\nimport { client } from "./client";\nimport type { MediaMetadata, MediaReference } from "@osdk/api";\nimport { Osdk, Result } from "@osdk/client";\n\nconst result = await client({{objectType}}).fetchOne("<primaryKey>");\n\n// Fetch metadata of a media property\nconst mediaMetadata = await result.{{property}}?.fetchMetadata();\n\n// Fetch contents of a media property\nconst response = await result.{{property}}?.fetchContents();\n\nif (response.ok) {\n const data = await response.blob();\n ...\n}'
|
|
566
563
|
}]
|
|
567
564
|
}
|
|
568
565
|
},
|
|
569
566
|
"2.4.0": {
|
|
570
567
|
"snippets": {
|
|
571
568
|
"derivedPropertyNumericExpression": [{
|
|
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
|
|
569
|
+
"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 {{^isUnary}}\n baseObjectSet.pivotTo("{{linkName}}")\n .selectProperty("{{property}}").{{operation}}(\n baseObjectSet.pivotTo("{{linkName}}").aggregate("$count"))\n {{/isUnary}}\n {{#isUnary}}\n baseObjectSet.pivotTo("{{linkName}}").selectProperty("{{property}}").{{operation}}()\n {{/isUnary}}\n });'
|
|
573
570
|
}],
|
|
574
571
|
"derivedPropertyDatetimeExpression": [{
|
|
575
|
-
"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 {{^isExtractPart}} \n
|
|
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 });'
|
|
576
573
|
}],
|
|
577
574
|
"nearestNeighborsTextQuery": [{
|
|
578
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();'
|
|
579
576
|
}],
|
|
580
577
|
"nearestNeighborsVectorQuery": [{
|
|
581
|
-
"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)
|
|
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();'
|
|
582
579
|
}]
|
|
583
580
|
}
|
|
584
581
|
}
|
|
@@ -603,7 +600,6 @@ var TYPESCRIPT_OSDK_SNIPPETS = {
|
|
|
603
600
|
propertiesV2: handlePropertiesV2,
|
|
604
601
|
primaryKeyPropertyV1: handlePrimaryKeyPropertyV1,
|
|
605
602
|
primaryKeyPropertyV2: handlePrimaryKeyPropertyV2,
|
|
606
|
-
primaryKeyPropertyValueV2: handlePrimaryKeyPropertyValueV2,
|
|
607
603
|
linkedPropertiesV1: handleLinkedPropertiesV1,
|
|
608
604
|
linkedPropertiesV2: handleLinkedPropertiesV2,
|
|
609
605
|
linkedPrimaryKeyPropertyV1: handleLinkedPrimaryKeyPropertyV1,
|
|
@@ -711,14 +707,6 @@ function handlePrimaryKeyPropertyV2({
|
|
|
711
707
|
value: renderPropertyValue(rawPrimaryKeyProperty.value, SdkMajorVersion.V2)
|
|
712
708
|
};
|
|
713
709
|
}
|
|
714
|
-
function handlePrimaryKeyPropertyValueV2({
|
|
715
|
-
rawPrimaryKeyProperty
|
|
716
|
-
}) {
|
|
717
|
-
if (rawPrimaryKeyProperty == null) {
|
|
718
|
-
throw new Error("Cannot render with null rawPrimaryKeyProperty");
|
|
719
|
-
}
|
|
720
|
-
return renderPropertyValue(rawPrimaryKeyProperty.value, SdkMajorVersion.V2);
|
|
721
|
-
}
|
|
722
710
|
function handleLinkedPropertiesV1({
|
|
723
711
|
rawLinkedProperties
|
|
724
712
|
}) {
|