@osdk/typescript-sdk-docs 0.3.0 → 0.4.0-beta.2

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 CHANGED
@@ -1,13 +1,10 @@
1
1
  # @osdk/typescript-sdk-docs
2
2
 
3
- ## 0.3.0
3
+ ## 0.4.0-beta.2
4
4
 
5
- ### Patch Changes
5
+ ### Minor Changes
6
6
 
7
- - 776ae8a: Simulated release
8
- - d8cdf4d: fix aggregation doc example
9
- - 29d2ada: Fix type in docs and tests
10
- - 5659984: Fix formatting of subscribeToObjectSetInstructions template and fix aggregationTemplate syntax error
7
+ - e9239a1: Add pivot docs.
11
8
 
12
9
  ## 0.3.0-beta.4
13
10
 
@@ -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 });"
@@ -558,6 +558,16 @@ export const snippets = {
558
558
  "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}"
559
559
  }]
560
560
  }
561
+ },
562
+ "2.4.0": {
563
+ "snippets": {
564
+ "derivedPropertyNumericExpression": [{
565
+ "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 });"
566
+ }],
567
+ "derivedPropertyDatetimeExpression": [{
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
+ }
561
571
  }
562
572
  }
563
573
  };