@osdk/typescript-sdk-docs 0.3.0-beta.2 → 0.3.0-beta.4
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 +2 -2
- package/build/browser/generatedNoCheck/docsNoComputedVariables.js.map +1 -1
- package/build/cjs/index.cjs +2 -2
- package/build/cjs/index.cjs.map +1 -1
- package/build/esm/generatedNoCheck/docsNoComputedVariables.js +2 -2
- package/build/esm/generatedNoCheck/docsNoComputedVariables.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @osdk/typescript-sdk-docs
|
|
2
2
|
|
|
3
|
+
## 0.3.0-beta.4
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 5659984: Fix formatting of subscribeToObjectSetInstructions template and fix aggregationTemplate syntax error
|
|
8
|
+
|
|
9
|
+
## 0.3.0-beta.3
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- d8cdf4d: fix aggregation doc example
|
|
14
|
+
|
|
3
15
|
## 0.3.0-beta.2
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -333,7 +333,7 @@ export const snippets = {
|
|
|
333
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}"
|
|
334
334
|
}],
|
|
335
335
|
"aggregationTemplate": [{
|
|
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 });"
|
|
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 });"
|
|
337
337
|
}],
|
|
338
338
|
"countAggregationTemplate": [{
|
|
339
339
|
"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 });"
|
|
@@ -549,7 +549,7 @@ export const snippets = {
|
|
|
549
549
|
"template": "import { {{objectType}} } from \"{{{packageName}}}\";\n\nfunction getLastTimeSeriesPoint(obj: {{objectType}}) {\n return obj.{{property}}.getLatestValue();\n}"
|
|
550
550
|
}],
|
|
551
551
|
"subscribeToObjectSetInstructions": [{
|
|
552
|
-
"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(
|
|
552
|
+
"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();"
|
|
553
553
|
}],
|
|
554
554
|
"uploadMedia": [{
|
|
555
555
|
"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 });"
|