@osdk/react-sdk-docs 0.5.0 → 0.5.1-main-56c2c9fdaf97899b89e2dfd18c578bbc6d2de4de
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 +15 -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 +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @osdk/react-sdk-docs
|
|
2
2
|
|
|
3
|
+
## 0.5.1-main-56c2c9fdaf97899b89e2dfd18c578bbc6d2de4de
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- bb0817b: Fix misleading patterns in @osdk/react and @osdk/react-components docs that were confusing downstream coding agents and humans alike.
|
|
8
|
+
|
|
9
|
+
• react-sdk-docs `reactProviderSetup` and `clientSetup` snippets now pass a real ontology RID placeholder to `createClient` instead of `{{{packageName}}}` (which resolves to the npm SDK package name, not the ontology RID)
|
|
10
|
+
• Stop pretending `$` is exported from the user's SDK — `$` is a local alias users sometimes create; docs now use `client(Type)` directly, matching the pattern already used in getting-started.md / cache-management.md
|
|
11
|
+
• Standardize the SDK placeholder on `@my/osdk` across all docs (was a mix of `@my/osdk`, `@YourApp/sdk`, `@your-app/sdk`) and add a `:::note About @my/osdk` callout to each react-components doc that imports from it
|
|
12
|
+
• Fix several broken/missing imports in code snippets: `cache-management.md` setup block was using `createClient` / `createObservableClient` / `authProvider` without importing or defining any of them; `advanced-queries.md` derived-property fragments were missing `Employee` and `useOsdkObjects` imports
|
|
13
|
+
• Fix `querying-data.md` self-referential typo "_Stable - available from both `@osdk/react` and `@osdk/react`_" → second should be `@osdk/react/experimental`
|
|
14
|
+
• Fix `advanced-queries.md` duplicate `const { data }` declaration that would not compile
|
|
15
|
+
• Remove unused `useOsdkObject` import from one `advanced-queries.md` snippet
|
|
16
|
+
• Install commands now show npm / pnpm / yarn alternatives with a tip block recommending users skip the step if their tooling already installs dependencies — fixes Pilot running `pnpm` in npm-managed projects and the install-race-with-harness issue
|
|
17
|
+
|
|
3
18
|
## 0.5.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
|
@@ -7,7 +7,7 @@ export const snippets = {
|
|
|
7
7
|
"2.0.0": {
|
|
8
8
|
"snippets": {
|
|
9
9
|
"reactProviderSetup": [{
|
|
10
|
-
"template": "import { OsdkProvider } from \"@osdk/react\";\nimport { createClient } from \"@osdk/client\";\n\nconst client = createClient(\n \"https://your-stack.palantirfoundry.com\",\n \"{
|
|
10
|
+
"template": "import { OsdkProvider } from \"@osdk/react\";\nimport { createClient } from \"@osdk/client\";\n\nconst client = createClient(\n \"https://your-stack.palantirfoundry.com\",\n \"ri.ontology.main.ontology.{UUID}\",\n async () => \"your-token\"\n);\n\nfunction App() {\n return (\n <OsdkProvider client={client}>\n <YourApp />\n </OsdkProvider>\n );\n}"
|
|
11
11
|
}],
|
|
12
12
|
"reactUseOsdkObjectsBasic": [{
|
|
13
13
|
"template": "import { {{objectType}} } from \"{{{packageName}}}\";\nimport { useOsdkObjects } from \"@osdk/react\";\n\nfunction {{objectType}}List() {\n const { data, isLoading, error, fetchMore } = useOsdkObjects({{objectType}});\n\n return (\n <div>\n {error && <div className=\"error-banner\">Error: {error.message}</div>}\n {isLoading && !data && <div className=\"skeleton\">Loading...</div>}\n <ul>\n {data?.map(obj => (\n <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>\n ))}\n </ul>\n {isLoading && data && <span className=\"refresh-indicator\">Refreshing...</span>}\n {fetchMore && <button onClick={fetchMore}>Load more</button>}\n </div>\n );\n}"
|
|
@@ -101,7 +101,7 @@ export const snippets = {
|
|
|
101
101
|
"template": "// Batch actions in React should be handled with multiple hook calls\n// or by using the client directly for batch operations\nimport { {{actionApiName}} } from \"{{{packageName}}}\";\nimport { useOsdkAction } from \"@osdk/react\";\n\nfunction Batch{{actionApiName}}() {\n const { applyAction, isPending } = useOsdkAction({{actionApiName}});\n\n const handleBatchApply = async (items: Array<Parameters<typeof applyAction>[0]>) => {\n await Promise.all(items.map(item => applyAction(item)));\n };\n\n return (\n <button onClick={() => handleBatchApply([])} disabled={isPending}>\n Apply Batch\n </button>\n );\n}"
|
|
102
102
|
}],
|
|
103
103
|
"clientSetup": [{
|
|
104
|
-
"template": "import { OsdkProvider } from \"@osdk/react\";\nimport { createClient } from \"@osdk/client\";\n\nconst client = createClient(\n \"https://your-stack.palantirfoundry.com\",\n \"{
|
|
104
|
+
"template": "import { OsdkProvider } from \"@osdk/react\";\nimport { createClient } from \"@osdk/client\";\n\nconst client = createClient(\n \"https://your-stack.palantirfoundry.com\",\n \"ri.ontology.main.ontology.{UUID}\",\n async () => \"your-token\"\n);\n\nfunction App() {\n return (\n <OsdkProvider client={client}>\n <YourApp />\n </OsdkProvider>\n );\n}"
|
|
105
105
|
}],
|
|
106
106
|
"callFunction": [{
|
|
107
107
|
"template": "import { {{funcApiName}} } from \"{{{packageName}}}\";\nimport { useOsdkFunction } from \"@osdk/react\";\n\nfunction {{funcApiName}}Caller() {\n const { data, isLoading, error, refetch } = useOsdkFunction({{funcApiName}}, {\n params: { /* function parameters */ }\n });\n\n return (\n <div>\n {error && <div>Error: {error.message}</div>}\n {isLoading && !data && <div>Loading...</div>}\n {data && <pre>{JSON.stringify(data, null, 2)}</pre>}\n <button onClick={refetch}>Refresh</button>\n </div>\n );\n}"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docsNoComputedVariables.js","names":["snippets"],"sources":["docsNoComputedVariables.ts"],"sourcesContent":["\n// THIS FILE IS GENERATED. DO NOT MODIFY.\n// You probably want to modify ../documentation.yml instead.\n\nimport type { SdkSnippets } from \"@osdk/docs-spec-core\";\nimport type { OSDK_SNIPPETS_SPEC } from \"@osdk/docs-spec-sdk\";\n\nexport const snippets: SdkSnippets<typeof OSDK_SNIPPETS_SPEC> = {\n \"kind\": \"sdk\",\n \"versions\": {\n \"2.0.0\": {\n \"snippets\": {\n \"reactProviderSetup\": [\n {\n \"template\": \"import { OsdkProvider } from \\\"@osdk/react\\\";\\nimport { createClient } from \\\"@osdk/client\\\";\\n\\nconst client = createClient(\\n \\\"https://your-stack.palantirfoundry.com\\\",\\n \\\"{{{packageName}}}\\\",\\n async () => \\\"your-token\\\"\\n);\\n\\nfunction App() {\\n return (\\n <OsdkProvider client={client}>\\n <YourApp />\\n </OsdkProvider>\\n );\\n}\"\n }\n ],\n \"reactUseOsdkObjectsBasic\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}List() {\\n const { data, isLoading, error, fetchMore } = useOsdkObjects({{objectType}});\\n\\n return (\\n <div>\\n {error && <div className=\\\"error-banner\\\">Error: {error.message}</div>}\\n {isLoading && !data && <div className=\\\"skeleton\\\">Loading...</div>}\\n <ul>\\n {data?.map(obj => (\\n <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>\\n ))}\\n </ul>\\n {isLoading && data && <span className=\\\"refresh-indicator\\\">Refreshing...</span>}\\n {fetchMore && <button onClick={fetchMore}>Load more</button>}\\n </div>\\n );\\n}\"\n }\n ],\n \"reactUseOsdkObjectsFilter\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction Filtered{{objectType}}List() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{titleProperty}}: { $isNotNull: true }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div className=\\\"error-banner\\\">Error: {error.message}</div>}\\n {isLoading && !data && <div className=\\\"skeleton\\\">Loading...</div>}\\n <ul>\\n {data?.map(obj => (\\n <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>\\n ))}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"reactUseOsdkObjectByPrimaryKey\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObject } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}Detail({ primaryKey }: { primaryKey: string }) {\\n const { object, isLoading, error } = useOsdkObject({{objectType}}, primaryKey);\\n\\n return (\\n <div>\\n {error && <div className=\\\"error-banner\\\">Error: {error.message}</div>}\\n {isLoading && !object && <div className=\\\"skeleton\\\">Loading...</div>}\\n {object && (\\n <div>\\n <h2>{object.{{titleProperty}}}</h2>\\n </div>\\n )}\\n </div>\\n );\\n}\"\n }\n ],\n \"reactUseLinksBasic\": [\n {\n \"template\": \"import { {{sourceObjectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useLinks } from \\\"@osdk/react\\\";\\n\\nfunction Linked{{linkedObjectType}}({ source }: { source: {{sourceObjectType}}.OsdkInstance }) {\\n const { links, isLoading, error } = useLinks(source, \\\"{{linkApiName}}\\\");\\n\\n return (\\n <div>\\n {error && <div className=\\\"error-banner\\\">Error: {error.message}</div>}\\n {isLoading && !links && <div className=\\\"skeleton\\\">Loading...</div>}\\n <ul>\\n {links?.map(linked => (\\n <li key={linked.$primaryKey}>{linked.$primaryKey}</li>\\n ))}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"reactUseOsdkActionBasic\": [\n {\n \"template\": \"import { {{actionApiName}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAction } from \\\"@osdk/react\\\";\\n\\nfunction {{actionApiName}}Button() {\\n const { applyAction, isPending, error } = useOsdkAction({{actionApiName}});\\n\\n const handleClick = async () => {\\n await applyAction({\\n {{#actionParameterSampleValuesV2}}\\n {{key}}: {{value}}{{^last}},{{/last}}\\n {{/actionParameterSampleValuesV2}}\\n });\\n };\\n\\n return (\\n <div>\\n {error && <div className=\\\"error-banner\\\">Error: {String(error.unknown ?? error.actionValidation)}</div>}\\n <button onClick={handleClick} disabled={isPending}>\\n {isPending ? \\\"Applying...\\\" : \\\"Apply {{actionApiName}}\\\"}\\n </button>\\n </div>\\n );\\n}\",\n \"computedVariables\": [\n \"actionParameterSampleValuesV2\"\n ]\n }\n ],\n \"reactUseOsdkAggregationBasic\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAggregation } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}Count() {\\n const { data, isLoading, error } = useOsdkAggregation({{objectType}}, {\\n aggregate: { $select: { $count: \\\"unordered\\\" } }\\n });\\n\\n return (\\n <div>\\n {error && <div className=\\\"error-banner\\\">Error: {error.message}</div>}\\n {isLoading && data == null && <div className=\\\"skeleton\\\">Loading...</div>}\\n {data != null && <span>Total: {data}</span>}\\n </div>\\n );\\n}\"\n }\n ],\n \"reactUseOsdkObjectsEnabled\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction Conditional{{objectType}}List({ shouldFetch }: { shouldFetch: boolean }) {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n enabled: shouldFetch\\n });\\n\\n return (\\n <div>\\n {!shouldFetch && <div>Select criteria to load data</div>}\\n {error && <div className=\\\"error-banner\\\">Error: {error.message}</div>}\\n {isLoading && !data && <div className=\\\"skeleton\\\">Loading...</div>}\\n <ul>\\n {data?.map(obj => (\\n <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>\\n ))}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"loadSingleObjectGuide\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObject } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}Detail({ primaryKey }: { primaryKey: string }) {\\n const { object, isLoading, error } = useOsdkObject({{objectType}}, primaryKey);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !object && <div>Loading...</div>}\\n {object && <div>{object.{{titleProperty}}}</div>}\\n </div>\\n );\\n}\"\n }\n ],\n \"loadObjectPageGuide\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}List() {\\n const { data, isLoading, error, fetchMore } = useOsdkObjects({{objectType}}, {\\n pageSize: 30\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n {fetchMore && <button onClick={fetchMore}>Load more</button>}\\n </div>\\n );\\n}\"\n }\n ],\n \"orderObjectsGuide\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction Sorted{{objectType}}List() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n orderBy: { {{titleProperty}}: \\\"asc\\\" }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"searchObjectsGuide\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction Filtered{{objectType}}List() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{titleProperty}}: { $isNotNull: true }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"loadSingleObjectReference\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObject } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}Detail({ primaryKey }: { primaryKey: string }) {\\n const { object, isLoading, error } = useOsdkObject({{objectType}}, primaryKey);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !object && <div>Loading...</div>}\\n {object && <div>{object.{{titleProperty}}}</div>}\\n </div>\\n );\\n}\"\n }\n ],\n \"loadObjectsReference\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}List() {\\n const { data, isLoading, error, fetchMore } = useOsdkObjects({{objectType}}, {\\n pageSize: 30\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n {fetchMore && <button onClick={fetchMore}>Load more</button>}\\n </div>\\n );\\n}\"\n }\n ],\n \"loadAllObjectsReference\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\n// Note: For large datasets, consider using pagination with fetchMore\\nfunction All{{objectType}}List() {\\n const { data, isLoading, error, fetchMore } = useOsdkObjects({{objectType}});\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n {fetchMore && <button onClick={fetchMore}>Load more</button>}\\n </div>\\n );\\n}\"\n }\n ],\n \"loadLinkedObjectReference\": [\n {\n \"template\": \"import { {{sourceObjectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useLinks } from \\\"@osdk/react\\\";\\n\\nfunction {{linkedObjectType}}Detail({ source }: { source: {{sourceObjectType}}.OsdkInstance }) {\\n const { links, isLoading, error } = useLinks(source, \\\"{{linkApiName}}\\\");\\n const linkedObject = links?.[0];\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !links && <div>Loading...</div>}\\n {linkedObject && <div>{linkedObject.$primaryKey}</div>}\\n </div>\\n );\\n}\"\n }\n ],\n \"loadLinkedObjectsReference\": [\n {\n \"template\": \"import { {{sourceObjectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useLinks } from \\\"@osdk/react\\\";\\n\\nfunction Linked{{linkedObjectType}}List({ source }: { source: {{sourceObjectType}}.OsdkInstance }) {\\n const { links, isLoading, error, fetchMore } = useLinks(source, \\\"{{linkApiName}}\\\");\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !links && <div>Loading...</div>}\\n <ul>\\n {links?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n {fetchMore && <button onClick={fetchMore}>Load more</button>}\\n </div>\\n );\\n}\"\n }\n ],\n \"aggregationTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAggregation } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}Aggregation() {\\n const { data, isLoading, error } = useOsdkAggregation({{objectType}}, {\\n where: { {{property}}: { $isNull: false } },\\n aggregate: {\\n $select: { $count: \\\"unordered\\\" },\\n $groupBy: { {{property}}: \\\"exact\\\" }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && data == null && <div>Loading...</div>}\\n {data != null && <pre>{JSON.stringify(data, null, 2)}</pre>}\\n </div>\\n );\\n}\"\n }\n ],\n \"countAggregationTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAggregation } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}Count() {\\n const { data, isLoading, error } = useOsdkAggregation({{objectType}}, {\\n aggregate: { $select: { $count: \\\"unordered\\\" } }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && data == null && <div>Loading...</div>}\\n {data != null && <span>Total: {data}</span>}\\n </div>\\n );\\n}\"\n }\n ],\n \"approximateDistinctAggregationTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAggregation } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}DistinctCount() {\\n const { data, isLoading, error } = useOsdkAggregation({{objectType}}, {\\n aggregate: { $select: { \\\"{{property}}:approximateDistinct\\\": \\\"unordered\\\" } }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && data == null && <div>Loading...</div>}\\n {data != null && <span>Distinct count: {data}</span>}\\n </div>\\n );\\n}\"\n }\n ],\n \"exactDistinctAggregationTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAggregation } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}ExactDistinctCount() {\\n const { data, isLoading, error } = useOsdkAggregation({{objectType}}, {\\n aggregate: { $select: { \\\"{{property}}:exactDistinct\\\": \\\"unordered\\\" } }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && data == null && <div>Loading...</div>}\\n {data != null && <span>Exact distinct count: {data}</span>}\\n </div>\\n );\\n}\"\n }\n ],\n \"numericAggregationTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAggregation } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}{{operation}}() {\\n const { data, isLoading, error } = useOsdkAggregation({{objectType}}, {\\n aggregate: { $select: { \\\"{{property}}:{{operation}}\\\": \\\"unordered\\\" } }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && data == null && <div>Loading...</div>}\\n {data != null && <span>{{operation}}: {data}</span>}\\n </div>\\n );\\n}\"\n }\n ],\n \"fixedWidthGroupByTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAggregation } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}GroupedByFixedWidth() {\\n const { data, isLoading, error } = useOsdkAggregation({{objectType}}, {\\n aggregate: {\\n $select: { $count: \\\"unordered\\\" },\\n $groupBy: { {{property}}: { $fixedWidth: 10 } }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && data == null && <div>Loading...</div>}\\n {data != null && <pre>{JSON.stringify(data, null, 2)}</pre>}\\n </div>\\n );\\n}\"\n }\n ],\n \"durationGroupByTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAggregation } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}GroupedByDuration() {\\n const { data, isLoading, error } = useOsdkAggregation({{objectType}}, {\\n aggregate: {\\n $select: { $count: \\\"unordered\\\" },\\n $groupBy: { {{property}}: { $duration: [{{#durationText}}{{arg}}{{/durationText}}, \\\"{{#durationText}}{{unit}}{{/durationText}}\\\"] } }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && data == null && <div>Loading...</div>}\\n {data != null && <pre>{JSON.stringify(data, null, 2)}</pre>}\\n </div>\\n );\\n}\"\n }\n ],\n \"exactGroupByTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAggregation } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}GroupedByExact() {\\n const { data, isLoading, error } = useOsdkAggregation({{objectType}}, {\\n aggregate: {\\n $select: { $count: \\\"unordered\\\" },\\n $groupBy: { {{property}}: \\\"exact\\\" }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && data == null && <div>Loading...</div>}\\n {data != null && <pre>{JSON.stringify(data, null, 2)}</pre>}\\n </div>\\n );\\n}\"\n }\n ],\n \"rangeGroupByTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAggregation } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}GroupedByRange() {\\n const { data, isLoading, error } = useOsdkAggregation({{objectType}}, {\\n aggregate: {\\n $select: { $count: \\\"unordered\\\" },\\n $groupBy: { {{property}}: { $ranges: [[{{{propertyValueV2}}}, {{{propertyValueV2}}}]] } }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && data == null && <div>Loading...</div>}\\n {data != null && <pre>{JSON.stringify(data, null, 2)}</pre>}\\n </div>\\n );\\n}\",\n \"computedVariables\": [\n \"propertyValueV2\"\n ]\n }\n ],\n \"applyAction\": [\n {\n \"template\": \"import { {{actionApiName}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAction } from \\\"@osdk/react\\\";\\n\\nfunction {{actionApiName}}Button() {\\n const { applyAction, isPending, error } = useOsdkAction({{actionApiName}});\\n\\n const handleClick = async () => {\\n await applyAction({\\n {{#actionParameterSampleValuesV2}}\\n {{key}}: {{value}}{{^last}},{{/last}}\\n {{/actionParameterSampleValuesV2}}\\n });\\n };\\n\\n return (\\n <div>\\n {error && <div>Error: {String(error.unknown ?? error.actionValidation)}</div>}\\n <button onClick={handleClick} disabled={isPending}>\\n {isPending ? \\\"Applying...\\\" : \\\"Apply\\\"}\\n </button>\\n </div>\\n );\\n}\",\n \"computedVariables\": [\n \"actionParameterSampleValuesV2\"\n ]\n }\n ],\n \"applyActionResponse\": [\n {\n \"template\": \"import { {{actionApiName}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAction } from \\\"@osdk/react\\\";\\n\\nfunction {{actionApiName}}WithResult() {\\n const { applyAction, isPending, error, data } = useOsdkAction({{actionApiName}});\\n\\n const handleClick = async () => {\\n await applyAction({\\n {{#actionParameterSampleValuesV2}}\\n {{key}}: {{value}}{{^last}},{{/last}}\\n {{/actionParameterSampleValuesV2}}\\n });\\n };\\n\\n return (\\n <div>\\n {error && <div className=\\\"error-banner\\\">Error: {String(error.unknown ?? error.actionValidation)}</div>}\\n {data && <div>Action completed successfully</div>}\\n <button onClick={handleClick} disabled={isPending}>\\n {isPending ? \\\"Applying...\\\" : \\\"Apply {{actionApiName}}\\\"}\\n </button>\\n </div>\\n );\\n}\",\n \"computedVariables\": [\n \"actionParameterSampleValuesV2\"\n ]\n }\n ],\n \"validateAction\": [\n {\n \"template\": \"import { {{actionApiName}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAction, useDebouncedCallback } from \\\"@osdk/react\\\";\\nimport { useState } from \\\"react\\\";\\n\\nfunction {{actionApiName}}WithValidation() {\\n const { validateAction, applyAction, isPending, validationResult } = useOsdkAction({{actionApiName}});\\n const [params, setParams] = useState<Record<string, string>>({});\\n\\n const debouncedValidate = useDebouncedCallback(\\n (nextParams: Record<string, string>) => { validateAction(nextParams); },\\n 300\\n );\\n\\n const handleParamChange = (key: string, value: string) => {\\n const nextParams = { ...params, [key]: value };\\n setParams(nextParams);\\n debouncedValidate(nextParams);\\n };\\n\\n return (\\n <div>\\n <input\\n placeholder=\\\"Parameter value\\\"\\n onChange={(e) => handleParamChange(\\\"paramName\\\", e.target.value)}\\n />\\n {validationResult?.result === \\\"INVALID\\\" && (\\n <div>Validation errors present</div>\\n )}\\n <button\\n onClick={() => applyAction(params)}\\n disabled={isPending || validationResult?.result === \\\"INVALID\\\"}\\n >\\n {isPending ? \\\"Applying...\\\" : \\\"Apply\\\"}\\n </button>\\n </div>\\n );\\n}\"\n }\n ],\n \"batchApplyAction\": [\n {\n \"template\": \"// Batch actions in React should be handled with multiple hook calls\\n// or by using the client directly for batch operations\\nimport { {{actionApiName}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAction } from \\\"@osdk/react\\\";\\n\\nfunction Batch{{actionApiName}}() {\\n const { applyAction, isPending } = useOsdkAction({{actionApiName}});\\n\\n const handleBatchApply = async (items: Array<Parameters<typeof applyAction>[0]>) => {\\n await Promise.all(items.map(item => applyAction(item)));\\n };\\n\\n return (\\n <button onClick={() => handleBatchApply([])} disabled={isPending}>\\n Apply Batch\\n </button>\\n );\\n}\"\n }\n ],\n \"clientSetup\": [\n {\n \"template\": \"import { OsdkProvider } from \\\"@osdk/react\\\";\\nimport { createClient } from \\\"@osdk/client\\\";\\n\\nconst client = createClient(\\n \\\"https://your-stack.palantirfoundry.com\\\",\\n \\\"{{{packageName}}}\\\",\\n async () => \\\"your-token\\\"\\n);\\n\\nfunction App() {\\n return (\\n <OsdkProvider client={client}>\\n <YourApp />\\n </OsdkProvider>\\n );\\n}\"\n }\n ],\n \"callFunction\": [\n {\n \"template\": \"import { {{funcApiName}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkFunction } from \\\"@osdk/react\\\";\\n\\nfunction {{funcApiName}}Caller() {\\n const { data, isLoading, error, refetch } = useOsdkFunction({{funcApiName}}, {\\n params: { /* function parameters */ }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n {data && <pre>{JSON.stringify(data, null, 2)}</pre>}\\n <button onClick={refetch}>Refresh</button>\\n </div>\\n );\\n}\"\n }\n ],\n \"executeFunction\": [\n {\n \"template\": \"import { {{funcApiName}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkFunction } from \\\"@osdk/react\\\";\\n\\nfunction {{funcApiName}}Executor() {\\n const { data, isLoading, error, refetch } = useOsdkFunction({{funcApiName}}, {\\n params: { /* function parameters */ }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n {data && <pre>{JSON.stringify(data, null, 2)}</pre>}\\n <button onClick={refetch}>Refresh</button>\\n </div>\\n );\\n}\"\n }\n ],\n \"stringStartsWithTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}StartsWith() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{property}}: { $startsWith: \\\"foo\\\" }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"containsAnyTermTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}ContainsAnyTerm() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{property}}: { $containsAnyTerm: \\\"foo bar\\\" }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"containsAllTermsTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}ContainsAllTerms() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{property}}: { $containsAllTerms: \\\"foo bar\\\" }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"containsAllTermsInOrderTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}ContainsAllTermsInOrder() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{property}}: { $containsAllTermsInOrder: \\\"foo bar\\\" }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"containsTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}Contains() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{property}}: { $contains: \\\"value\\\" }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"equalityTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}Equality() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{property}}: { $eq: {{{propertyValueV2}}} }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\",\n \"computedVariables\": [\n \"propertyValueV2\"\n ]\n }\n ],\n \"inFilterTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}InFilter() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{property}}: { $in: [{{{propertyValueV2}}}] }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\",\n \"computedVariables\": [\n \"propertyValueV2\"\n ]\n }\n ],\n \"rangeTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}Range() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{property}}: { ${{operation}}: {{{propertyValueV2}}} }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\",\n \"computedVariables\": [\n \"propertyValueV2\"\n ]\n }\n ],\n \"nullTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}NullFilter() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{property}}: { $isNull: true }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"andTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}AndFilter() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n $and: [\\n { $not: { {{primaryKeyPropertyV2.apiName}}: { $isNull: true } } },\\n { {{property}}: { $eq: {{{propertyValueV2}}} } }\\n ]\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\",\n \"computedVariables\": [\n \"primaryKeyPropertyV2\",\n \"propertyValueV2\"\n ]\n }\n ],\n \"orTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}OrFilter() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n $or: [\\n { $not: { {{primaryKeyPropertyV2.apiName}}: { $isNull: true } } },\\n { {{property}}: { $eq: {{{propertyValueV2}}} } }\\n ]\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\",\n \"computedVariables\": [\n \"primaryKeyPropertyV2\",\n \"propertyValueV2\"\n ]\n }\n ],\n \"notTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}NotFilter() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n $not: { {{property}}: { $eq: {{{propertyValueV2}}} } }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\",\n \"computedVariables\": [\n \"propertyValueV2\"\n ]\n }\n ],\n \"withinDistanceTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}WithinDistance() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{property}}: { $within: { $distance: [100, \\\"{{distanceUnit}}\\\"], $of: [-74.0060, 40.7128] } }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"withinBoundingBoxTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}WithinBoundingBox() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{property}}: { $within: { $bbox: [-74.0060, 25.123, 80.4231, 40.7128] } }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"withinPolygonTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}WithinPolygon() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{property}}: { $within: { type: \\\"Polygon\\\", coordinates: [[[10.0, 40.0], [20.0, 50.0], [20.0, 30.0], [10.0, 40.0]]] } }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"intersectsPolygonTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}IntersectsPolygon() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{property}}: { $intersects: { type: \\\"Polygon\\\", coordinates: [[[10.0, 40.0], [20.0, 50.0], [20.0, 30.0], [10.0, 40.0]]] } }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"intersectsBboxTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}IntersectsBbox() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{property}}: { $intersects: { $bbox: [-74.0060, 25.123, 80.4231, 40.7128] } }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"objectSetOperationsGuide\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}SetOperations() {\\n const client = useOsdkClient();\\n const combinedSet = useMemo(() => {\\n const setA = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"a\\\" } });\\n const setB = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"b\\\" } });\\n const setC = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"c\\\" } });\\n return setA.intersect(setB).subtract(setC);\\n }, [client]);\\n\\n const { data, isLoading, error } = useObjectSet(combinedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"objectSetOperationsUnion\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}Union() {\\n const client = useOsdkClient();\\n const unionSet = useMemo(() => {\\n const setA = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"a\\\" } });\\n const setB = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"b\\\" } });\\n const setC = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"c\\\" } });\\n return setA.union(setB).union(setC);\\n }, [client]);\\n\\n const { data, isLoading, error } = useObjectSet(unionSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"objectSetOperationsSubtract\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}Subtract() {\\n const client = useOsdkClient();\\n const subtractedSet = useMemo(() => {\\n const setA = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"a\\\" } });\\n const setB = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"b\\\" } });\\n const setC = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"c\\\" } });\\n return setA.subtract(setB).subtract(setC);\\n }, [client]);\\n\\n const { data, isLoading, error } = useObjectSet(subtractedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"objectSetOperationsIntersect\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}Intersect() {\\n const client = useOsdkClient();\\n const intersectedSet = useMemo(() => {\\n const setA = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"a\\\" } });\\n const setB = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"b\\\" } });\\n const setC = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"c\\\" } });\\n return setA.intersect(setB).intersect(setC);\\n }, [client]);\\n\\n const { data, isLoading, error } = useObjectSet(intersectedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"derivedPropertyBaseExample\": [\n {\n \"template\": \"import { {{sourceObjectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{sourceObjectType}}DerivedProperty() {\\n const client = useOsdkClient();\\n const derivedSet = useMemo(() =>\\n client({{sourceObjectType}}).withProperties({\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\").aggregate(\\\"$count\\\")\\n }), [client]);\\n\\n const { data, isLoading, error } = useObjectSet(derivedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"derivedPropertyCountAggregation\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}DerivedCount() {\\n const client = useOsdkClient();\\n const derivedSet = useMemo(() =>\\n client({{objectType}}).withProperties({\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\").aggregate(\\\"$count\\\")\\n }), [client]);\\n\\n const { data, isLoading, error } = useObjectSet(derivedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"derivedPropertyNumericAggregation\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}DerivedNumeric() {\\n const client = useOsdkClient();\\n const derivedSet = useMemo(() =>\\n client({{objectType}}).withProperties({\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\").aggregate(\\\"{{property}}:{{operation}}\\\")\\n }), [client]);\\n\\n const { data, isLoading, error } = useObjectSet(derivedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"derivedPropertySelectPropertyAggregation\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}DerivedSelectProperty() {\\n const client = useOsdkClient();\\n const derivedSet = useMemo(() =>\\n client({{objectType}}).withProperties({\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\").selectProperty(\\\"{{property}}\\\")\\n }), [client]);\\n\\n const { data, isLoading, error } = useObjectSet(derivedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"derivedPropertyApproximateDistinctAggregation\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}DerivedApproxDistinct() {\\n const client = useOsdkClient();\\n const derivedSet = useMemo(() =>\\n client({{objectType}}).withProperties({\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\").aggregate(\\\"{{property}}:approximateDistinct\\\")\\n }), [client]);\\n\\n const { data, isLoading, error } = useObjectSet(derivedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"derivedPropertyExactDistinctAggregation\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}DerivedExactDistinct() {\\n const client = useOsdkClient();\\n const derivedSet = useMemo(() =>\\n client({{objectType}}).withProperties({\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\").aggregate(\\\"{{property}}:exactDistinct\\\")\\n }), [client]);\\n\\n const { data, isLoading, error } = useObjectSet(derivedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"derivedPropertyApproximatePercentileAggregation\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}DerivedPercentile() {\\n const client = useOsdkClient();\\n const derivedSet = useMemo(() =>\\n client({{objectType}}).withProperties({\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\").aggregate(\\\"{{property}}:approximatePercentile\\\", { percentile: 95 })\\n }), [client]);\\n\\n const { data, isLoading, error } = useObjectSet(derivedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"derivedPropertyCollectToListAggregation\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}DerivedCollectList() {\\n const client = useOsdkClient();\\n const maxObjectsInList = 75;\\n const derivedSet = useMemo(() =>\\n client({{objectType}}).withProperties({\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\").aggregate(\\\"{{property}}:collectList\\\", { limit: maxObjectsInList })\\n }), [client]);\\n\\n const { data, isLoading, error } = useObjectSet(derivedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"derivedPropertyCollectToSetAggregation\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}DerivedCollectSet() {\\n const client = useOsdkClient();\\n const maxObjectsInSet = 75;\\n const derivedSet = useMemo(() =>\\n client({{objectType}}).withProperties({\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\").aggregate(\\\"{{property}}:collectSet\\\", { limit: maxObjectsInSet })\\n }), [client]);\\n\\n const { data, isLoading, error } = useObjectSet(derivedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"loadObjectMetadataSnippet\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkMetadata } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}Metadata() {\\n const { loading, metadata, error } = useOsdkMetadata({{objectType}});\\n\\n return (\\n <div>\\n {error && <div className=\\\"error-banner\\\">Error: {error}</div>}\\n {loading && !metadata && <div className=\\\"skeleton\\\">Loading...</div>}\\n {metadata && (\\n <div>\\n <div>Description: {metadata.description}</div>\\n <div>Visibility: {metadata.visibility}</div>\\n </div>\\n )}\\n </div>\\n );\\n}\"\n }\n ],\n \"loadInterfaceMetadataSnippet\": [\n {\n \"template\": \"import { {{interfaceApiName}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkMetadata } from \\\"@osdk/react\\\";\\n\\nfunction {{interfaceApiName}}Metadata() {\\n const { loading, metadata, error } = useOsdkMetadata({{interfaceApiName}});\\n\\n return (\\n <div>\\n {error && <div className=\\\"error-banner\\\">Error: {error}</div>}\\n {loading && !metadata && <div className=\\\"skeleton\\\">Loading...</div>}\\n {metadata && (\\n <div>\\n <div>RID: {metadata.rid}</div>\\n <div>Implemented by: {metadata.implementedBy?.join(\\\", \\\")}</div>\\n </div>\\n )}\\n </div>\\n );\\n}\"\n }\n ],\n \"loadInterfacesReference\": [\n {\n \"template\": \"import { {{interfaceApiName}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{interfaceApiName}}List() {\\n const { data, isLoading, error, fetchMore } = useOsdkObjects({{interfaceApiName}}, {\\n pageSize: 30\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n {fetchMore && <button onClick={fetchMore}>Load more</button>}\\n </div>\\n );\\n}\"\n }\n ],\n \"loadAllInterfacesReference\": [\n {\n \"template\": \"import { {{interfaceApiName}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction All{{interfaceApiName}}List() {\\n const { data, isLoading, error, fetchMore } = useOsdkObjects({{interfaceApiName}});\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n {fetchMore && <button onClick={fetchMore}>Load more</button>}\\n </div>\\n );\\n}\"\n }\n ],\n \"loadOrderedInterfacesReference\": [\n {\n \"template\": \"import { {{interfaceApiName}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction Ordered{{interfaceApiName}}List() {\\n const { data, isLoading, error } = useOsdkObjects({{interfaceApiName}}, {\\n orderBy: { {{property}}: \\\"asc\\\" },\\n pageSize: 30\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"searchInterfacesReference\": [\n {\n \"template\": \"import { {{interfaceApiName}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction Search{{interfaceApiName}}() {\\n const { data, isLoading, error } = useOsdkObjects({{interfaceApiName}}, {\\n where: {\\n {{property}}: { $startsWith: \\\"foo\\\" }\\n },\\n pageSize: 30\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"castInterfaceToObjectReference\": [\n {\n \"template\": \"import { {{objectTypeApiName}}, {{interfaceApiName}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction CastInterface() {\\n const { data, isLoading, error } = useOsdkObjects({{interfaceApiName}}, {\\n pageSize: 10\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => {\\n const casted = obj.$as({{objectTypeApiName}});\\n return <li key={casted.$primaryKey}>{casted.$primaryKey}</li>;\\n })}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"subscribeToObjectSetInstructions\": [\n {\n \"template\": \"import { {{objectOrInterfaceApiName}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectOrInterfaceApiName}}LiveList() {\\n const { data, isLoading, error } = useOsdkObjects({{objectOrInterfaceApiName}}, {\\n streamUpdates: true\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"loadTimeSeriesPointsSnippet\": [\n {\n \"template\": \"// Timeseries does not have a dedicated React hook yet.\\n// Use the client API directly with a loaded OSDK object.\\nimport type { Osdk } from \\\"@osdk/client\\\";\\nimport type { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nasync function getAllTimeSeriesPoints(obj: Osdk.Instance<typeof {{objectType}}>) {\\n return obj.{{property}}?.getAllPoints();\\n}\"\n }\n ],\n \"loadTimeSeriesFirstPointSnippet\": [\n {\n \"template\": \"// Timeseries does not have a dedicated React hook yet.\\n// Use the client API directly with a loaded OSDK object.\\nimport type { Osdk } from \\\"@osdk/client\\\";\\nimport type { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nasync function getFirstTimeSeriesPoint(obj: Osdk.Instance<typeof {{objectType}}>) {\\n return obj.{{property}}?.getFirstPoint();\\n}\"\n }\n ],\n \"loadTimeSeriesLastPointSnippet\": [\n {\n \"template\": \"// Timeseries does not have a dedicated React hook yet.\\n// Use the client API directly with a loaded OSDK object.\\nimport type { Osdk } from \\\"@osdk/client\\\";\\nimport type { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nasync function getLastTimeSeriesPoint(obj: Osdk.Instance<typeof {{objectType}}>) {\\n return obj.{{property}}?.getLastPoint();\\n}\"\n }\n ],\n \"loadAbsoluteTimeSeriesPointsSnippet\": [\n {\n \"template\": \"// Timeseries does not have a dedicated React hook yet.\\n// Use the client API directly with a loaded OSDK object.\\nimport type { Osdk } from \\\"@osdk/client\\\";\\nimport type { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nasync function getAbsoluteTimeSeriesPoints(obj: Osdk.Instance<typeof {{objectType}}>) {\\n return obj.{{property}}?.getAllPoints({\\n $startTime: \\\"2022-08-13T12:34:56Z\\\",\\n $endTime: \\\"2022-08-14T12:34:56Z\\\",\\n });\\n}\"\n }\n ],\n \"loadRelativeTimeSeriesPointsSnippet\": [\n {\n \"template\": \"// Timeseries does not have a dedicated React hook yet.\\n// Use the client API directly with a loaded OSDK object.\\nimport type { Osdk } from \\\"@osdk/client\\\";\\nimport type { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nasync function getRelativeTimeSeriesPoints(obj: Osdk.Instance<typeof {{objectType}}>) {\\n return obj.{{property}}?.getAllPoints({\\n $before: 1,\\n $unit: \\\"{{timeUnit}}\\\",\\n });\\n}\"\n }\n ],\n \"loadGeotimeSeriesPointsSnippet\": [\n {\n \"template\": \"// Geo-time series does not have a dedicated React hook yet.\\n// Use the client API directly with a loaded OSDK object.\\nimport type { Osdk } from \\\"@osdk/client\\\";\\nimport type { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nasync function getAllGeotimeSeriesPoints(obj: Osdk.Instance<typeof {{objectType}}>) {\\n return obj.{{property}}?.getAllValues();\\n}\"\n }\n ],\n \"loadGeotimeSeriesLastPointSnippet\": [\n {\n \"template\": \"// Geo-time series does not have a dedicated React hook yet.\\n// Use the client API directly with a loaded OSDK object.\\nimport type { Osdk } from \\\"@osdk/client\\\";\\nimport type { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nasync function getLatestGeotimeSeriesPoint(obj: Osdk.Instance<typeof {{objectType}}>) {\\n return obj.{{property}}?.getLatestValue();\\n}\"\n }\n ],\n \"loadAbsoluteGeotimeSeriesPointsSnippet\": [\n {\n \"template\": \"// Geo-time series does not have a dedicated React hook yet.\\n// Use the client API directly with a loaded OSDK object.\\nimport type { Osdk } from \\\"@osdk/client\\\";\\nimport type { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nasync function getAbsoluteGeotimeSeriesPoints(obj: Osdk.Instance<typeof {{objectType}}>) {\\n return obj.{{property}}?.getAllValues({\\n $startTime: \\\"2022-08-13T12:34:56Z\\\",\\n $endTime: \\\"2022-08-14T12:34:56Z\\\",\\n });\\n}\"\n }\n ],\n \"loadRelativeGeotimeSeriesPointsSnippet\": [\n {\n \"template\": \"// Geo-time series does not have a dedicated React hook yet.\\n// Use the client API directly with a loaded OSDK object.\\nimport type { Osdk } from \\\"@osdk/client\\\";\\nimport type { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nasync function getRelativeGeotimeSeriesPoints(obj: Osdk.Instance<typeof {{objectType}}>) {\\n return obj.{{property}}?.getAllValues({\\n $before: 1,\\n $unit: \\\"{{timeUnit}}\\\",\\n });\\n}\"\n }\n ],\n \"uploadAttachment\": [\n {\n \"template\": \"import { useOsdkClient } from \\\"@osdk/react\\\";\\nimport { createAttachmentUpload } from \\\"@osdk/client\\\";\\nimport { {{actionApiName}} } from \\\"{{{packageName}}}\\\";\\n\\nfunction AttachmentUploader() {\\n const client = useOsdkClient();\\n\\n const handleUpload = async (file: File) => {\\n const attachment = createAttachmentUpload(file, file.name);\\n await client({{actionApiName}}).applyAction({\\n {{primaryKeyPropertyV2.apiName}}: {{{propertyValueV2}}},\\n {{property}}: attachment\\n });\\n };\\n\\n return (\\n <input type=\\\"file\\\" onChange={e => {\\n const file = e.target.files?.[0];\\n if (file) {\\n handleUpload(file);\\n }\\n }} />\\n );\\n}\",\n \"computedVariables\": [\n \"propertyValueV2\",\n \"primaryKeyPropertyV2\"\n ]\n }\n ],\n \"readMedia\": [\n {\n \"template\": \"// Media does not have a dedicated React hook yet.\\n// Use the client API directly with a loaded OSDK object.\\nimport type { Osdk } from \\\"@osdk/client\\\";\\nimport type { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nasync function readMediaContent(obj: Osdk.Instance<typeof {{objectType}}>) {\\n const contents = await obj.{{property}}?.fetchContents();\\n if (contents?.ok) {\\n return contents.blob();\\n }\\n}\"\n }\n ],\n \"uploadMedia\": [\n {\n \"template\": \"import { useOsdkClient } from \\\"@osdk/react\\\";\\nimport { __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference } from \\\"@osdk/api/unstable\\\";\\nimport type { MediaReference } from \\\"@osdk/api\\\";\\nimport { {{actionApiName}}, {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nfunction MediaUploader() {\\n const client = useOsdkClient();\\n\\n const handleUpload = async (file: File) => {\\n const mediaReference: MediaReference = await client(\\n __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference,\\n ).createMediaReference({\\n data: file,\\n fileName: file.name,\\n objectType: {{objectType}},\\n propertyType: \\\"{{property}}\\\",\\n });\\n await client({{actionApiName}}).applyAction({\\n // Pass the required action parameters including the primary key\\n {{mediaParameter}}: mediaReference\\n });\\n };\\n\\n return (\\n <input type=\\\"file\\\" onChange={e => {\\n const file = e.target.files?.[0];\\n if (file) {\\n handleUpload(file);\\n }\\n }} />\\n );\\n}\"\n }\n ],\n \"uploadMediaOntologyEdits\": [\n {\n \"template\": \"import { useOsdkClient } from \\\"@osdk/react\\\";\\nimport { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { createEditBatch, uploadMedia } from \\\"@osdk/functions\\\";\\n\\nfunction MediaOntologyEditsUploader() {\\n const client = useOsdkClient();\\n\\n const handleUpload = async (file: File) => {\\n const batch = createEditBatch(client);\\n const mediaReference = await uploadMedia(client, { data: file, fileName: file.name });\\n // @ts-expect-error - batch.create types don't support media references yet\\n batch.create({{objectType}}, { {{property}}: mediaReference });\\n return batch.getEdits();\\n };\\n\\n return (\\n <input type=\\\"file\\\" onChange={e => {\\n const file = e.target.files?.[0];\\n if (file) {\\n handleUpload(file);\\n }\\n }} />\\n );\\n}\"\n }\n ],\n \"uploadMediaEphemeral\": [\n {\n \"template\": \"// Ephemeral media upload is not yet supported in the React SDK\"\n }\n ],\n \"derivedPropertyNumericExpression\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}DerivedNumericExpression() {\\n const client = useOsdkClient();\\n const derivedSet = useMemo(() =>\\n client({{objectType}}).withProperties({\\n {{^isUnary}}\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\")\\n .aggregate(\\\"{{property}}\\\").{{operation}}(\\n baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\").aggregate(\\\"$count\\\"))\\n {{/isUnary}}\\n {{#isUnary}}\\n \\\"{{operation}}_{{property}}\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\")\\n .selectProperty(\\\"{{property}}\\\").{{operation}}()\\n {{/isUnary}}\\n }), [client]);\\n\\n const { data, isLoading, error } = useObjectSet(derivedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"derivedPropertyDatetimeExpression\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}DerivedDatetimeExpression() {\\n const client = useOsdkClient();\\n const derivedSet = useMemo(() =>\\n client({{objectType}}).withProperties({\\n {{^isExtractPart}}\\n \\\"derivedPropertyDatetime_{{operation}}\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\")\\n .selectProperty(\\\"{{property}}\\\")\\n .{{operation}}(baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\").selectProperty(\\\"{{property}}\\\"))\\n {{/isExtractPart}}\\n {{#isExtractPart}}\\n \\\"YEARS_part_of_{{property}}_of_{{linkApiName}}\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\")\\n .selectProperty(\\\"{{property}}\\\").extractPart(\\\"YEARS\\\")\\n {{/isExtractPart}}\\n }), [client]);\\n\\n const { data, isLoading, error } = useObjectSet(derivedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"nearestNeighborsTextQuery\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}NearestNeighborsText() {\\n const client = useOsdkClient();\\n const resultSet = useMemo(() =>\\n client({{objectType}}).nearestNeighbors(\\\"coffee\\\", 5, \\\"{{property}}\\\"),\\n [client]);\\n\\n const { data, isLoading, error } = useObjectSet(resultSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"nearestNeighborsVectorQuery\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}NearestNeighborsVector() {\\n const client = useOsdkClient();\\n // Note that this vector maps to an arbitrary string\\n // It must match the dimension of the \\\"{{property}}\\\" property: {{vectorDimensionSize}}\\n const vectorQuery = useMemo(() =>\\n Array.from({ length: {{vectorDimensionSize}} }, () => 0.3),\\n []);\\n const resultSet = useMemo(() =>\\n client({{objectType}}).nearestNeighbors(vectorQuery, 5, \\\"{{property}}\\\"),\\n [client, vectorQuery]);\\n\\n const { data, isLoading, error } = useObjectSet(resultSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"searchAround\": [\n {\n \"template\": \"import { {{sourceObjectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction SearchAround{{linkedObjectType}}() {\\n const client = useOsdkClient();\\n const linkedSet = useMemo(() =>\\n client({{sourceObjectType}})\\n .where({ {{rawLinkedPrimaryKeyProperty.apiName}}: { $in: [\\\"a\\\", \\\"b\\\", \\\"c\\\"] } })\\n .pivotTo(\\\"{{linkApiName}}\\\"),\\n [client]);\\n\\n const { data, isLoading, error } = useObjectSet(linkedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ]\n }\n }\n }\n};\n "],"mappings":"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","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"docsNoComputedVariables.js","names":["snippets"],"sources":["docsNoComputedVariables.ts"],"sourcesContent":["\n// THIS FILE IS GENERATED. DO NOT MODIFY.\n// You probably want to modify ../documentation.yml instead.\n\nimport type { SdkSnippets } from \"@osdk/docs-spec-core\";\nimport type { OSDK_SNIPPETS_SPEC } from \"@osdk/docs-spec-sdk\";\n\nexport const snippets: SdkSnippets<typeof OSDK_SNIPPETS_SPEC> = {\n \"kind\": \"sdk\",\n \"versions\": {\n \"2.0.0\": {\n \"snippets\": {\n \"reactProviderSetup\": [\n {\n \"template\": \"import { OsdkProvider } from \\\"@osdk/react\\\";\\nimport { createClient } from \\\"@osdk/client\\\";\\n\\nconst client = createClient(\\n \\\"https://your-stack.palantirfoundry.com\\\",\\n \\\"ri.ontology.main.ontology.{UUID}\\\",\\n async () => \\\"your-token\\\"\\n);\\n\\nfunction App() {\\n return (\\n <OsdkProvider client={client}>\\n <YourApp />\\n </OsdkProvider>\\n );\\n}\"\n }\n ],\n \"reactUseOsdkObjectsBasic\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}List() {\\n const { data, isLoading, error, fetchMore } = useOsdkObjects({{objectType}});\\n\\n return (\\n <div>\\n {error && <div className=\\\"error-banner\\\">Error: {error.message}</div>}\\n {isLoading && !data && <div className=\\\"skeleton\\\">Loading...</div>}\\n <ul>\\n {data?.map(obj => (\\n <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>\\n ))}\\n </ul>\\n {isLoading && data && <span className=\\\"refresh-indicator\\\">Refreshing...</span>}\\n {fetchMore && <button onClick={fetchMore}>Load more</button>}\\n </div>\\n );\\n}\"\n }\n ],\n \"reactUseOsdkObjectsFilter\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction Filtered{{objectType}}List() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{titleProperty}}: { $isNotNull: true }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div className=\\\"error-banner\\\">Error: {error.message}</div>}\\n {isLoading && !data && <div className=\\\"skeleton\\\">Loading...</div>}\\n <ul>\\n {data?.map(obj => (\\n <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>\\n ))}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"reactUseOsdkObjectByPrimaryKey\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObject } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}Detail({ primaryKey }: { primaryKey: string }) {\\n const { object, isLoading, error } = useOsdkObject({{objectType}}, primaryKey);\\n\\n return (\\n <div>\\n {error && <div className=\\\"error-banner\\\">Error: {error.message}</div>}\\n {isLoading && !object && <div className=\\\"skeleton\\\">Loading...</div>}\\n {object && (\\n <div>\\n <h2>{object.{{titleProperty}}}</h2>\\n </div>\\n )}\\n </div>\\n );\\n}\"\n }\n ],\n \"reactUseLinksBasic\": [\n {\n \"template\": \"import { {{sourceObjectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useLinks } from \\\"@osdk/react\\\";\\n\\nfunction Linked{{linkedObjectType}}({ source }: { source: {{sourceObjectType}}.OsdkInstance }) {\\n const { links, isLoading, error } = useLinks(source, \\\"{{linkApiName}}\\\");\\n\\n return (\\n <div>\\n {error && <div className=\\\"error-banner\\\">Error: {error.message}</div>}\\n {isLoading && !links && <div className=\\\"skeleton\\\">Loading...</div>}\\n <ul>\\n {links?.map(linked => (\\n <li key={linked.$primaryKey}>{linked.$primaryKey}</li>\\n ))}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"reactUseOsdkActionBasic\": [\n {\n \"template\": \"import { {{actionApiName}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAction } from \\\"@osdk/react\\\";\\n\\nfunction {{actionApiName}}Button() {\\n const { applyAction, isPending, error } = useOsdkAction({{actionApiName}});\\n\\n const handleClick = async () => {\\n await applyAction({\\n {{#actionParameterSampleValuesV2}}\\n {{key}}: {{value}}{{^last}},{{/last}}\\n {{/actionParameterSampleValuesV2}}\\n });\\n };\\n\\n return (\\n <div>\\n {error && <div className=\\\"error-banner\\\">Error: {String(error.unknown ?? error.actionValidation)}</div>}\\n <button onClick={handleClick} disabled={isPending}>\\n {isPending ? \\\"Applying...\\\" : \\\"Apply {{actionApiName}}\\\"}\\n </button>\\n </div>\\n );\\n}\",\n \"computedVariables\": [\n \"actionParameterSampleValuesV2\"\n ]\n }\n ],\n \"reactUseOsdkAggregationBasic\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAggregation } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}Count() {\\n const { data, isLoading, error } = useOsdkAggregation({{objectType}}, {\\n aggregate: { $select: { $count: \\\"unordered\\\" } }\\n });\\n\\n return (\\n <div>\\n {error && <div className=\\\"error-banner\\\">Error: {error.message}</div>}\\n {isLoading && data == null && <div className=\\\"skeleton\\\">Loading...</div>}\\n {data != null && <span>Total: {data}</span>}\\n </div>\\n );\\n}\"\n }\n ],\n \"reactUseOsdkObjectsEnabled\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction Conditional{{objectType}}List({ shouldFetch }: { shouldFetch: boolean }) {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n enabled: shouldFetch\\n });\\n\\n return (\\n <div>\\n {!shouldFetch && <div>Select criteria to load data</div>}\\n {error && <div className=\\\"error-banner\\\">Error: {error.message}</div>}\\n {isLoading && !data && <div className=\\\"skeleton\\\">Loading...</div>}\\n <ul>\\n {data?.map(obj => (\\n <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>\\n ))}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"loadSingleObjectGuide\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObject } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}Detail({ primaryKey }: { primaryKey: string }) {\\n const { object, isLoading, error } = useOsdkObject({{objectType}}, primaryKey);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !object && <div>Loading...</div>}\\n {object && <div>{object.{{titleProperty}}}</div>}\\n </div>\\n );\\n}\"\n }\n ],\n \"loadObjectPageGuide\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}List() {\\n const { data, isLoading, error, fetchMore } = useOsdkObjects({{objectType}}, {\\n pageSize: 30\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n {fetchMore && <button onClick={fetchMore}>Load more</button>}\\n </div>\\n );\\n}\"\n }\n ],\n \"orderObjectsGuide\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction Sorted{{objectType}}List() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n orderBy: { {{titleProperty}}: \\\"asc\\\" }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"searchObjectsGuide\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction Filtered{{objectType}}List() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{titleProperty}}: { $isNotNull: true }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"loadSingleObjectReference\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObject } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}Detail({ primaryKey }: { primaryKey: string }) {\\n const { object, isLoading, error } = useOsdkObject({{objectType}}, primaryKey);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !object && <div>Loading...</div>}\\n {object && <div>{object.{{titleProperty}}}</div>}\\n </div>\\n );\\n}\"\n }\n ],\n \"loadObjectsReference\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}List() {\\n const { data, isLoading, error, fetchMore } = useOsdkObjects({{objectType}}, {\\n pageSize: 30\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n {fetchMore && <button onClick={fetchMore}>Load more</button>}\\n </div>\\n );\\n}\"\n }\n ],\n \"loadAllObjectsReference\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\n// Note: For large datasets, consider using pagination with fetchMore\\nfunction All{{objectType}}List() {\\n const { data, isLoading, error, fetchMore } = useOsdkObjects({{objectType}});\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n {fetchMore && <button onClick={fetchMore}>Load more</button>}\\n </div>\\n );\\n}\"\n }\n ],\n \"loadLinkedObjectReference\": [\n {\n \"template\": \"import { {{sourceObjectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useLinks } from \\\"@osdk/react\\\";\\n\\nfunction {{linkedObjectType}}Detail({ source }: { source: {{sourceObjectType}}.OsdkInstance }) {\\n const { links, isLoading, error } = useLinks(source, \\\"{{linkApiName}}\\\");\\n const linkedObject = links?.[0];\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !links && <div>Loading...</div>}\\n {linkedObject && <div>{linkedObject.$primaryKey}</div>}\\n </div>\\n );\\n}\"\n }\n ],\n \"loadLinkedObjectsReference\": [\n {\n \"template\": \"import { {{sourceObjectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useLinks } from \\\"@osdk/react\\\";\\n\\nfunction Linked{{linkedObjectType}}List({ source }: { source: {{sourceObjectType}}.OsdkInstance }) {\\n const { links, isLoading, error, fetchMore } = useLinks(source, \\\"{{linkApiName}}\\\");\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !links && <div>Loading...</div>}\\n <ul>\\n {links?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n {fetchMore && <button onClick={fetchMore}>Load more</button>}\\n </div>\\n );\\n}\"\n }\n ],\n \"aggregationTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAggregation } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}Aggregation() {\\n const { data, isLoading, error } = useOsdkAggregation({{objectType}}, {\\n where: { {{property}}: { $isNull: false } },\\n aggregate: {\\n $select: { $count: \\\"unordered\\\" },\\n $groupBy: { {{property}}: \\\"exact\\\" }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && data == null && <div>Loading...</div>}\\n {data != null && <pre>{JSON.stringify(data, null, 2)}</pre>}\\n </div>\\n );\\n}\"\n }\n ],\n \"countAggregationTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAggregation } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}Count() {\\n const { data, isLoading, error } = useOsdkAggregation({{objectType}}, {\\n aggregate: { $select: { $count: \\\"unordered\\\" } }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && data == null && <div>Loading...</div>}\\n {data != null && <span>Total: {data}</span>}\\n </div>\\n );\\n}\"\n }\n ],\n \"approximateDistinctAggregationTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAggregation } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}DistinctCount() {\\n const { data, isLoading, error } = useOsdkAggregation({{objectType}}, {\\n aggregate: { $select: { \\\"{{property}}:approximateDistinct\\\": \\\"unordered\\\" } }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && data == null && <div>Loading...</div>}\\n {data != null && <span>Distinct count: {data}</span>}\\n </div>\\n );\\n}\"\n }\n ],\n \"exactDistinctAggregationTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAggregation } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}ExactDistinctCount() {\\n const { data, isLoading, error } = useOsdkAggregation({{objectType}}, {\\n aggregate: { $select: { \\\"{{property}}:exactDistinct\\\": \\\"unordered\\\" } }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && data == null && <div>Loading...</div>}\\n {data != null && <span>Exact distinct count: {data}</span>}\\n </div>\\n );\\n}\"\n }\n ],\n \"numericAggregationTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAggregation } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}{{operation}}() {\\n const { data, isLoading, error } = useOsdkAggregation({{objectType}}, {\\n aggregate: { $select: { \\\"{{property}}:{{operation}}\\\": \\\"unordered\\\" } }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && data == null && <div>Loading...</div>}\\n {data != null && <span>{{operation}}: {data}</span>}\\n </div>\\n );\\n}\"\n }\n ],\n \"fixedWidthGroupByTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAggregation } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}GroupedByFixedWidth() {\\n const { data, isLoading, error } = useOsdkAggregation({{objectType}}, {\\n aggregate: {\\n $select: { $count: \\\"unordered\\\" },\\n $groupBy: { {{property}}: { $fixedWidth: 10 } }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && data == null && <div>Loading...</div>}\\n {data != null && <pre>{JSON.stringify(data, null, 2)}</pre>}\\n </div>\\n );\\n}\"\n }\n ],\n \"durationGroupByTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAggregation } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}GroupedByDuration() {\\n const { data, isLoading, error } = useOsdkAggregation({{objectType}}, {\\n aggregate: {\\n $select: { $count: \\\"unordered\\\" },\\n $groupBy: { {{property}}: { $duration: [{{#durationText}}{{arg}}{{/durationText}}, \\\"{{#durationText}}{{unit}}{{/durationText}}\\\"] } }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && data == null && <div>Loading...</div>}\\n {data != null && <pre>{JSON.stringify(data, null, 2)}</pre>}\\n </div>\\n );\\n}\"\n }\n ],\n \"exactGroupByTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAggregation } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}GroupedByExact() {\\n const { data, isLoading, error } = useOsdkAggregation({{objectType}}, {\\n aggregate: {\\n $select: { $count: \\\"unordered\\\" },\\n $groupBy: { {{property}}: \\\"exact\\\" }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && data == null && <div>Loading...</div>}\\n {data != null && <pre>{JSON.stringify(data, null, 2)}</pre>}\\n </div>\\n );\\n}\"\n }\n ],\n \"rangeGroupByTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAggregation } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}GroupedByRange() {\\n const { data, isLoading, error } = useOsdkAggregation({{objectType}}, {\\n aggregate: {\\n $select: { $count: \\\"unordered\\\" },\\n $groupBy: { {{property}}: { $ranges: [[{{{propertyValueV2}}}, {{{propertyValueV2}}}]] } }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && data == null && <div>Loading...</div>}\\n {data != null && <pre>{JSON.stringify(data, null, 2)}</pre>}\\n </div>\\n );\\n}\",\n \"computedVariables\": [\n \"propertyValueV2\"\n ]\n }\n ],\n \"applyAction\": [\n {\n \"template\": \"import { {{actionApiName}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAction } from \\\"@osdk/react\\\";\\n\\nfunction {{actionApiName}}Button() {\\n const { applyAction, isPending, error } = useOsdkAction({{actionApiName}});\\n\\n const handleClick = async () => {\\n await applyAction({\\n {{#actionParameterSampleValuesV2}}\\n {{key}}: {{value}}{{^last}},{{/last}}\\n {{/actionParameterSampleValuesV2}}\\n });\\n };\\n\\n return (\\n <div>\\n {error && <div>Error: {String(error.unknown ?? error.actionValidation)}</div>}\\n <button onClick={handleClick} disabled={isPending}>\\n {isPending ? \\\"Applying...\\\" : \\\"Apply\\\"}\\n </button>\\n </div>\\n );\\n}\",\n \"computedVariables\": [\n \"actionParameterSampleValuesV2\"\n ]\n }\n ],\n \"applyActionResponse\": [\n {\n \"template\": \"import { {{actionApiName}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAction } from \\\"@osdk/react\\\";\\n\\nfunction {{actionApiName}}WithResult() {\\n const { applyAction, isPending, error, data } = useOsdkAction({{actionApiName}});\\n\\n const handleClick = async () => {\\n await applyAction({\\n {{#actionParameterSampleValuesV2}}\\n {{key}}: {{value}}{{^last}},{{/last}}\\n {{/actionParameterSampleValuesV2}}\\n });\\n };\\n\\n return (\\n <div>\\n {error && <div className=\\\"error-banner\\\">Error: {String(error.unknown ?? error.actionValidation)}</div>}\\n {data && <div>Action completed successfully</div>}\\n <button onClick={handleClick} disabled={isPending}>\\n {isPending ? \\\"Applying...\\\" : \\\"Apply {{actionApiName}}\\\"}\\n </button>\\n </div>\\n );\\n}\",\n \"computedVariables\": [\n \"actionParameterSampleValuesV2\"\n ]\n }\n ],\n \"validateAction\": [\n {\n \"template\": \"import { {{actionApiName}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAction, useDebouncedCallback } from \\\"@osdk/react\\\";\\nimport { useState } from \\\"react\\\";\\n\\nfunction {{actionApiName}}WithValidation() {\\n const { validateAction, applyAction, isPending, validationResult } = useOsdkAction({{actionApiName}});\\n const [params, setParams] = useState<Record<string, string>>({});\\n\\n const debouncedValidate = useDebouncedCallback(\\n (nextParams: Record<string, string>) => { validateAction(nextParams); },\\n 300\\n );\\n\\n const handleParamChange = (key: string, value: string) => {\\n const nextParams = { ...params, [key]: value };\\n setParams(nextParams);\\n debouncedValidate(nextParams);\\n };\\n\\n return (\\n <div>\\n <input\\n placeholder=\\\"Parameter value\\\"\\n onChange={(e) => handleParamChange(\\\"paramName\\\", e.target.value)}\\n />\\n {validationResult?.result === \\\"INVALID\\\" && (\\n <div>Validation errors present</div>\\n )}\\n <button\\n onClick={() => applyAction(params)}\\n disabled={isPending || validationResult?.result === \\\"INVALID\\\"}\\n >\\n {isPending ? \\\"Applying...\\\" : \\\"Apply\\\"}\\n </button>\\n </div>\\n );\\n}\"\n }\n ],\n \"batchApplyAction\": [\n {\n \"template\": \"// Batch actions in React should be handled with multiple hook calls\\n// or by using the client directly for batch operations\\nimport { {{actionApiName}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkAction } from \\\"@osdk/react\\\";\\n\\nfunction Batch{{actionApiName}}() {\\n const { applyAction, isPending } = useOsdkAction({{actionApiName}});\\n\\n const handleBatchApply = async (items: Array<Parameters<typeof applyAction>[0]>) => {\\n await Promise.all(items.map(item => applyAction(item)));\\n };\\n\\n return (\\n <button onClick={() => handleBatchApply([])} disabled={isPending}>\\n Apply Batch\\n </button>\\n );\\n}\"\n }\n ],\n \"clientSetup\": [\n {\n \"template\": \"import { OsdkProvider } from \\\"@osdk/react\\\";\\nimport { createClient } from \\\"@osdk/client\\\";\\n\\nconst client = createClient(\\n \\\"https://your-stack.palantirfoundry.com\\\",\\n \\\"ri.ontology.main.ontology.{UUID}\\\",\\n async () => \\\"your-token\\\"\\n);\\n\\nfunction App() {\\n return (\\n <OsdkProvider client={client}>\\n <YourApp />\\n </OsdkProvider>\\n );\\n}\"\n }\n ],\n \"callFunction\": [\n {\n \"template\": \"import { {{funcApiName}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkFunction } from \\\"@osdk/react\\\";\\n\\nfunction {{funcApiName}}Caller() {\\n const { data, isLoading, error, refetch } = useOsdkFunction({{funcApiName}}, {\\n params: { /* function parameters */ }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n {data && <pre>{JSON.stringify(data, null, 2)}</pre>}\\n <button onClick={refetch}>Refresh</button>\\n </div>\\n );\\n}\"\n }\n ],\n \"executeFunction\": [\n {\n \"template\": \"import { {{funcApiName}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkFunction } from \\\"@osdk/react\\\";\\n\\nfunction {{funcApiName}}Executor() {\\n const { data, isLoading, error, refetch } = useOsdkFunction({{funcApiName}}, {\\n params: { /* function parameters */ }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n {data && <pre>{JSON.stringify(data, null, 2)}</pre>}\\n <button onClick={refetch}>Refresh</button>\\n </div>\\n );\\n}\"\n }\n ],\n \"stringStartsWithTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}StartsWith() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{property}}: { $startsWith: \\\"foo\\\" }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"containsAnyTermTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}ContainsAnyTerm() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{property}}: { $containsAnyTerm: \\\"foo bar\\\" }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"containsAllTermsTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}ContainsAllTerms() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{property}}: { $containsAllTerms: \\\"foo bar\\\" }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"containsAllTermsInOrderTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}ContainsAllTermsInOrder() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{property}}: { $containsAllTermsInOrder: \\\"foo bar\\\" }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"containsTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}Contains() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{property}}: { $contains: \\\"value\\\" }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"equalityTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}Equality() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{property}}: { $eq: {{{propertyValueV2}}} }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\",\n \"computedVariables\": [\n \"propertyValueV2\"\n ]\n }\n ],\n \"inFilterTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}InFilter() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{property}}: { $in: [{{{propertyValueV2}}}] }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\",\n \"computedVariables\": [\n \"propertyValueV2\"\n ]\n }\n ],\n \"rangeTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}Range() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{property}}: { ${{operation}}: {{{propertyValueV2}}} }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\",\n \"computedVariables\": [\n \"propertyValueV2\"\n ]\n }\n ],\n \"nullTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}NullFilter() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{property}}: { $isNull: true }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"andTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}AndFilter() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n $and: [\\n { $not: { {{primaryKeyPropertyV2.apiName}}: { $isNull: true } } },\\n { {{property}}: { $eq: {{{propertyValueV2}}} } }\\n ]\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\",\n \"computedVariables\": [\n \"primaryKeyPropertyV2\",\n \"propertyValueV2\"\n ]\n }\n ],\n \"orTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}OrFilter() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n $or: [\\n { $not: { {{primaryKeyPropertyV2.apiName}}: { $isNull: true } } },\\n { {{property}}: { $eq: {{{propertyValueV2}}} } }\\n ]\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\",\n \"computedVariables\": [\n \"primaryKeyPropertyV2\",\n \"propertyValueV2\"\n ]\n }\n ],\n \"notTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}NotFilter() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n $not: { {{property}}: { $eq: {{{propertyValueV2}}} } }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\",\n \"computedVariables\": [\n \"propertyValueV2\"\n ]\n }\n ],\n \"withinDistanceTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}WithinDistance() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{property}}: { $within: { $distance: [100, \\\"{{distanceUnit}}\\\"], $of: [-74.0060, 40.7128] } }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"withinBoundingBoxTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}WithinBoundingBox() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{property}}: { $within: { $bbox: [-74.0060, 25.123, 80.4231, 40.7128] } }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"withinPolygonTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}WithinPolygon() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{property}}: { $within: { type: \\\"Polygon\\\", coordinates: [[[10.0, 40.0], [20.0, 50.0], [20.0, 30.0], [10.0, 40.0]]] } }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"intersectsPolygonTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}IntersectsPolygon() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{property}}: { $intersects: { type: \\\"Polygon\\\", coordinates: [[[10.0, 40.0], [20.0, 50.0], [20.0, 30.0], [10.0, 40.0]]] } }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"intersectsBboxTemplate\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}IntersectsBbox() {\\n const { data, isLoading, error } = useOsdkObjects({{objectType}}, {\\n where: {\\n {{property}}: { $intersects: { $bbox: [-74.0060, 25.123, 80.4231, 40.7128] } }\\n }\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"objectSetOperationsGuide\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}SetOperations() {\\n const client = useOsdkClient();\\n const combinedSet = useMemo(() => {\\n const setA = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"a\\\" } });\\n const setB = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"b\\\" } });\\n const setC = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"c\\\" } });\\n return setA.intersect(setB).subtract(setC);\\n }, [client]);\\n\\n const { data, isLoading, error } = useObjectSet(combinedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"objectSetOperationsUnion\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}Union() {\\n const client = useOsdkClient();\\n const unionSet = useMemo(() => {\\n const setA = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"a\\\" } });\\n const setB = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"b\\\" } });\\n const setC = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"c\\\" } });\\n return setA.union(setB).union(setC);\\n }, [client]);\\n\\n const { data, isLoading, error } = useObjectSet(unionSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"objectSetOperationsSubtract\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}Subtract() {\\n const client = useOsdkClient();\\n const subtractedSet = useMemo(() => {\\n const setA = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"a\\\" } });\\n const setB = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"b\\\" } });\\n const setC = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"c\\\" } });\\n return setA.subtract(setB).subtract(setC);\\n }, [client]);\\n\\n const { data, isLoading, error } = useObjectSet(subtractedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"objectSetOperationsIntersect\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}Intersect() {\\n const client = useOsdkClient();\\n const intersectedSet = useMemo(() => {\\n const setA = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"a\\\" } });\\n const setB = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"b\\\" } });\\n const setC = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"c\\\" } });\\n return setA.intersect(setB).intersect(setC);\\n }, [client]);\\n\\n const { data, isLoading, error } = useObjectSet(intersectedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"derivedPropertyBaseExample\": [\n {\n \"template\": \"import { {{sourceObjectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{sourceObjectType}}DerivedProperty() {\\n const client = useOsdkClient();\\n const derivedSet = useMemo(() =>\\n client({{sourceObjectType}}).withProperties({\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\").aggregate(\\\"$count\\\")\\n }), [client]);\\n\\n const { data, isLoading, error } = useObjectSet(derivedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"derivedPropertyCountAggregation\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}DerivedCount() {\\n const client = useOsdkClient();\\n const derivedSet = useMemo(() =>\\n client({{objectType}}).withProperties({\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\").aggregate(\\\"$count\\\")\\n }), [client]);\\n\\n const { data, isLoading, error } = useObjectSet(derivedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"derivedPropertyNumericAggregation\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}DerivedNumeric() {\\n const client = useOsdkClient();\\n const derivedSet = useMemo(() =>\\n client({{objectType}}).withProperties({\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\").aggregate(\\\"{{property}}:{{operation}}\\\")\\n }), [client]);\\n\\n const { data, isLoading, error } = useObjectSet(derivedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"derivedPropertySelectPropertyAggregation\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}DerivedSelectProperty() {\\n const client = useOsdkClient();\\n const derivedSet = useMemo(() =>\\n client({{objectType}}).withProperties({\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\").selectProperty(\\\"{{property}}\\\")\\n }), [client]);\\n\\n const { data, isLoading, error } = useObjectSet(derivedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"derivedPropertyApproximateDistinctAggregation\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}DerivedApproxDistinct() {\\n const client = useOsdkClient();\\n const derivedSet = useMemo(() =>\\n client({{objectType}}).withProperties({\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\").aggregate(\\\"{{property}}:approximateDistinct\\\")\\n }), [client]);\\n\\n const { data, isLoading, error } = useObjectSet(derivedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"derivedPropertyExactDistinctAggregation\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}DerivedExactDistinct() {\\n const client = useOsdkClient();\\n const derivedSet = useMemo(() =>\\n client({{objectType}}).withProperties({\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\").aggregate(\\\"{{property}}:exactDistinct\\\")\\n }), [client]);\\n\\n const { data, isLoading, error } = useObjectSet(derivedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"derivedPropertyApproximatePercentileAggregation\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}DerivedPercentile() {\\n const client = useOsdkClient();\\n const derivedSet = useMemo(() =>\\n client({{objectType}}).withProperties({\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\").aggregate(\\\"{{property}}:approximatePercentile\\\", { percentile: 95 })\\n }), [client]);\\n\\n const { data, isLoading, error } = useObjectSet(derivedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"derivedPropertyCollectToListAggregation\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}DerivedCollectList() {\\n const client = useOsdkClient();\\n const maxObjectsInList = 75;\\n const derivedSet = useMemo(() =>\\n client({{objectType}}).withProperties({\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\").aggregate(\\\"{{property}}:collectList\\\", { limit: maxObjectsInList })\\n }), [client]);\\n\\n const { data, isLoading, error } = useObjectSet(derivedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"derivedPropertyCollectToSetAggregation\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}DerivedCollectSet() {\\n const client = useOsdkClient();\\n const maxObjectsInSet = 75;\\n const derivedSet = useMemo(() =>\\n client({{objectType}}).withProperties({\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\").aggregate(\\\"{{property}}:collectSet\\\", { limit: maxObjectsInSet })\\n }), [client]);\\n\\n const { data, isLoading, error } = useObjectSet(derivedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"loadObjectMetadataSnippet\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkMetadata } from \\\"@osdk/react\\\";\\n\\nfunction {{objectType}}Metadata() {\\n const { loading, metadata, error } = useOsdkMetadata({{objectType}});\\n\\n return (\\n <div>\\n {error && <div className=\\\"error-banner\\\">Error: {error}</div>}\\n {loading && !metadata && <div className=\\\"skeleton\\\">Loading...</div>}\\n {metadata && (\\n <div>\\n <div>Description: {metadata.description}</div>\\n <div>Visibility: {metadata.visibility}</div>\\n </div>\\n )}\\n </div>\\n );\\n}\"\n }\n ],\n \"loadInterfaceMetadataSnippet\": [\n {\n \"template\": \"import { {{interfaceApiName}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkMetadata } from \\\"@osdk/react\\\";\\n\\nfunction {{interfaceApiName}}Metadata() {\\n const { loading, metadata, error } = useOsdkMetadata({{interfaceApiName}});\\n\\n return (\\n <div>\\n {error && <div className=\\\"error-banner\\\">Error: {error}</div>}\\n {loading && !metadata && <div className=\\\"skeleton\\\">Loading...</div>}\\n {metadata && (\\n <div>\\n <div>RID: {metadata.rid}</div>\\n <div>Implemented by: {metadata.implementedBy?.join(\\\", \\\")}</div>\\n </div>\\n )}\\n </div>\\n );\\n}\"\n }\n ],\n \"loadInterfacesReference\": [\n {\n \"template\": \"import { {{interfaceApiName}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{interfaceApiName}}List() {\\n const { data, isLoading, error, fetchMore } = useOsdkObjects({{interfaceApiName}}, {\\n pageSize: 30\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n {fetchMore && <button onClick={fetchMore}>Load more</button>}\\n </div>\\n );\\n}\"\n }\n ],\n \"loadAllInterfacesReference\": [\n {\n \"template\": \"import { {{interfaceApiName}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction All{{interfaceApiName}}List() {\\n const { data, isLoading, error, fetchMore } = useOsdkObjects({{interfaceApiName}});\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n {fetchMore && <button onClick={fetchMore}>Load more</button>}\\n </div>\\n );\\n}\"\n }\n ],\n \"loadOrderedInterfacesReference\": [\n {\n \"template\": \"import { {{interfaceApiName}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction Ordered{{interfaceApiName}}List() {\\n const { data, isLoading, error } = useOsdkObjects({{interfaceApiName}}, {\\n orderBy: { {{property}}: \\\"asc\\\" },\\n pageSize: 30\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"searchInterfacesReference\": [\n {\n \"template\": \"import { {{interfaceApiName}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction Search{{interfaceApiName}}() {\\n const { data, isLoading, error } = useOsdkObjects({{interfaceApiName}}, {\\n where: {\\n {{property}}: { $startsWith: \\\"foo\\\" }\\n },\\n pageSize: 30\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"castInterfaceToObjectReference\": [\n {\n \"template\": \"import { {{objectTypeApiName}}, {{interfaceApiName}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction CastInterface() {\\n const { data, isLoading, error } = useOsdkObjects({{interfaceApiName}}, {\\n pageSize: 10\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => {\\n const casted = obj.$as({{objectTypeApiName}});\\n return <li key={casted.$primaryKey}>{casted.$primaryKey}</li>;\\n })}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"subscribeToObjectSetInstructions\": [\n {\n \"template\": \"import { {{objectOrInterfaceApiName}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkObjects } from \\\"@osdk/react\\\";\\n\\nfunction {{objectOrInterfaceApiName}}LiveList() {\\n const { data, isLoading, error } = useOsdkObjects({{objectOrInterfaceApiName}}, {\\n streamUpdates: true\\n });\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"loadTimeSeriesPointsSnippet\": [\n {\n \"template\": \"// Timeseries does not have a dedicated React hook yet.\\n// Use the client API directly with a loaded OSDK object.\\nimport type { Osdk } from \\\"@osdk/client\\\";\\nimport type { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nasync function getAllTimeSeriesPoints(obj: Osdk.Instance<typeof {{objectType}}>) {\\n return obj.{{property}}?.getAllPoints();\\n}\"\n }\n ],\n \"loadTimeSeriesFirstPointSnippet\": [\n {\n \"template\": \"// Timeseries does not have a dedicated React hook yet.\\n// Use the client API directly with a loaded OSDK object.\\nimport type { Osdk } from \\\"@osdk/client\\\";\\nimport type { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nasync function getFirstTimeSeriesPoint(obj: Osdk.Instance<typeof {{objectType}}>) {\\n return obj.{{property}}?.getFirstPoint();\\n}\"\n }\n ],\n \"loadTimeSeriesLastPointSnippet\": [\n {\n \"template\": \"// Timeseries does not have a dedicated React hook yet.\\n// Use the client API directly with a loaded OSDK object.\\nimport type { Osdk } from \\\"@osdk/client\\\";\\nimport type { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nasync function getLastTimeSeriesPoint(obj: Osdk.Instance<typeof {{objectType}}>) {\\n return obj.{{property}}?.getLastPoint();\\n}\"\n }\n ],\n \"loadAbsoluteTimeSeriesPointsSnippet\": [\n {\n \"template\": \"// Timeseries does not have a dedicated React hook yet.\\n// Use the client API directly with a loaded OSDK object.\\nimport type { Osdk } from \\\"@osdk/client\\\";\\nimport type { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nasync function getAbsoluteTimeSeriesPoints(obj: Osdk.Instance<typeof {{objectType}}>) {\\n return obj.{{property}}?.getAllPoints({\\n $startTime: \\\"2022-08-13T12:34:56Z\\\",\\n $endTime: \\\"2022-08-14T12:34:56Z\\\",\\n });\\n}\"\n }\n ],\n \"loadRelativeTimeSeriesPointsSnippet\": [\n {\n \"template\": \"// Timeseries does not have a dedicated React hook yet.\\n// Use the client API directly with a loaded OSDK object.\\nimport type { Osdk } from \\\"@osdk/client\\\";\\nimport type { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nasync function getRelativeTimeSeriesPoints(obj: Osdk.Instance<typeof {{objectType}}>) {\\n return obj.{{property}}?.getAllPoints({\\n $before: 1,\\n $unit: \\\"{{timeUnit}}\\\",\\n });\\n}\"\n }\n ],\n \"loadGeotimeSeriesPointsSnippet\": [\n {\n \"template\": \"// Geo-time series does not have a dedicated React hook yet.\\n// Use the client API directly with a loaded OSDK object.\\nimport type { Osdk } from \\\"@osdk/client\\\";\\nimport type { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nasync function getAllGeotimeSeriesPoints(obj: Osdk.Instance<typeof {{objectType}}>) {\\n return obj.{{property}}?.getAllValues();\\n}\"\n }\n ],\n \"loadGeotimeSeriesLastPointSnippet\": [\n {\n \"template\": \"// Geo-time series does not have a dedicated React hook yet.\\n// Use the client API directly with a loaded OSDK object.\\nimport type { Osdk } from \\\"@osdk/client\\\";\\nimport type { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nasync function getLatestGeotimeSeriesPoint(obj: Osdk.Instance<typeof {{objectType}}>) {\\n return obj.{{property}}?.getLatestValue();\\n}\"\n }\n ],\n \"loadAbsoluteGeotimeSeriesPointsSnippet\": [\n {\n \"template\": \"// Geo-time series does not have a dedicated React hook yet.\\n// Use the client API directly with a loaded OSDK object.\\nimport type { Osdk } from \\\"@osdk/client\\\";\\nimport type { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nasync function getAbsoluteGeotimeSeriesPoints(obj: Osdk.Instance<typeof {{objectType}}>) {\\n return obj.{{property}}?.getAllValues({\\n $startTime: \\\"2022-08-13T12:34:56Z\\\",\\n $endTime: \\\"2022-08-14T12:34:56Z\\\",\\n });\\n}\"\n }\n ],\n \"loadRelativeGeotimeSeriesPointsSnippet\": [\n {\n \"template\": \"// Geo-time series does not have a dedicated React hook yet.\\n// Use the client API directly with a loaded OSDK object.\\nimport type { Osdk } from \\\"@osdk/client\\\";\\nimport type { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nasync function getRelativeGeotimeSeriesPoints(obj: Osdk.Instance<typeof {{objectType}}>) {\\n return obj.{{property}}?.getAllValues({\\n $before: 1,\\n $unit: \\\"{{timeUnit}}\\\",\\n });\\n}\"\n }\n ],\n \"uploadAttachment\": [\n {\n \"template\": \"import { useOsdkClient } from \\\"@osdk/react\\\";\\nimport { createAttachmentUpload } from \\\"@osdk/client\\\";\\nimport { {{actionApiName}} } from \\\"{{{packageName}}}\\\";\\n\\nfunction AttachmentUploader() {\\n const client = useOsdkClient();\\n\\n const handleUpload = async (file: File) => {\\n const attachment = createAttachmentUpload(file, file.name);\\n await client({{actionApiName}}).applyAction({\\n {{primaryKeyPropertyV2.apiName}}: {{{propertyValueV2}}},\\n {{property}}: attachment\\n });\\n };\\n\\n return (\\n <input type=\\\"file\\\" onChange={e => {\\n const file = e.target.files?.[0];\\n if (file) {\\n handleUpload(file);\\n }\\n }} />\\n );\\n}\",\n \"computedVariables\": [\n \"propertyValueV2\",\n \"primaryKeyPropertyV2\"\n ]\n }\n ],\n \"readMedia\": [\n {\n \"template\": \"// Media does not have a dedicated React hook yet.\\n// Use the client API directly with a loaded OSDK object.\\nimport type { Osdk } from \\\"@osdk/client\\\";\\nimport type { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nasync function readMediaContent(obj: Osdk.Instance<typeof {{objectType}}>) {\\n const contents = await obj.{{property}}?.fetchContents();\\n if (contents?.ok) {\\n return contents.blob();\\n }\\n}\"\n }\n ],\n \"uploadMedia\": [\n {\n \"template\": \"import { useOsdkClient } from \\\"@osdk/react\\\";\\nimport { __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference } from \\\"@osdk/api/unstable\\\";\\nimport type { MediaReference } from \\\"@osdk/api\\\";\\nimport { {{actionApiName}}, {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nfunction MediaUploader() {\\n const client = useOsdkClient();\\n\\n const handleUpload = async (file: File) => {\\n const mediaReference: MediaReference = await client(\\n __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference,\\n ).createMediaReference({\\n data: file,\\n fileName: file.name,\\n objectType: {{objectType}},\\n propertyType: \\\"{{property}}\\\",\\n });\\n await client({{actionApiName}}).applyAction({\\n // Pass the required action parameters including the primary key\\n {{mediaParameter}}: mediaReference\\n });\\n };\\n\\n return (\\n <input type=\\\"file\\\" onChange={e => {\\n const file = e.target.files?.[0];\\n if (file) {\\n handleUpload(file);\\n }\\n }} />\\n );\\n}\"\n }\n ],\n \"uploadMediaOntologyEdits\": [\n {\n \"template\": \"import { useOsdkClient } from \\\"@osdk/react\\\";\\nimport { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { createEditBatch, uploadMedia } from \\\"@osdk/functions\\\";\\n\\nfunction MediaOntologyEditsUploader() {\\n const client = useOsdkClient();\\n\\n const handleUpload = async (file: File) => {\\n const batch = createEditBatch(client);\\n const mediaReference = await uploadMedia(client, { data: file, fileName: file.name });\\n // @ts-expect-error - batch.create types don't support media references yet\\n batch.create({{objectType}}, { {{property}}: mediaReference });\\n return batch.getEdits();\\n };\\n\\n return (\\n <input type=\\\"file\\\" onChange={e => {\\n const file = e.target.files?.[0];\\n if (file) {\\n handleUpload(file);\\n }\\n }} />\\n );\\n}\"\n }\n ],\n \"uploadMediaEphemeral\": [\n {\n \"template\": \"// Ephemeral media upload is not yet supported in the React SDK\"\n }\n ],\n \"derivedPropertyNumericExpression\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}DerivedNumericExpression() {\\n const client = useOsdkClient();\\n const derivedSet = useMemo(() =>\\n client({{objectType}}).withProperties({\\n {{^isUnary}}\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\")\\n .aggregate(\\\"{{property}}\\\").{{operation}}(\\n baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\").aggregate(\\\"$count\\\"))\\n {{/isUnary}}\\n {{#isUnary}}\\n \\\"{{operation}}_{{property}}\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\")\\n .selectProperty(\\\"{{property}}\\\").{{operation}}()\\n {{/isUnary}}\\n }), [client]);\\n\\n const { data, isLoading, error } = useObjectSet(derivedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"derivedPropertyDatetimeExpression\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}DerivedDatetimeExpression() {\\n const client = useOsdkClient();\\n const derivedSet = useMemo(() =>\\n client({{objectType}}).withProperties({\\n {{^isExtractPart}}\\n \\\"derivedPropertyDatetime_{{operation}}\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\")\\n .selectProperty(\\\"{{property}}\\\")\\n .{{operation}}(baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\").selectProperty(\\\"{{property}}\\\"))\\n {{/isExtractPart}}\\n {{#isExtractPart}}\\n \\\"YEARS_part_of_{{property}}_of_{{linkApiName}}\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkApiName}}\\\")\\n .selectProperty(\\\"{{property}}\\\").extractPart(\\\"YEARS\\\")\\n {{/isExtractPart}}\\n }), [client]);\\n\\n const { data, isLoading, error } = useObjectSet(derivedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"nearestNeighborsTextQuery\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}NearestNeighborsText() {\\n const client = useOsdkClient();\\n const resultSet = useMemo(() =>\\n client({{objectType}}).nearestNeighbors(\\\"coffee\\\", 5, \\\"{{property}}\\\"),\\n [client]);\\n\\n const { data, isLoading, error } = useObjectSet(resultSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"nearestNeighborsVectorQuery\": [\n {\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction {{objectType}}NearestNeighborsVector() {\\n const client = useOsdkClient();\\n // Note that this vector maps to an arbitrary string\\n // It must match the dimension of the \\\"{{property}}\\\" property: {{vectorDimensionSize}}\\n const vectorQuery = useMemo(() =>\\n Array.from({ length: {{vectorDimensionSize}} }, () => 0.3),\\n []);\\n const resultSet = useMemo(() =>\\n client({{objectType}}).nearestNeighbors(vectorQuery, 5, \\\"{{property}}\\\"),\\n [client, vectorQuery]);\\n\\n const { data, isLoading, error } = useObjectSet(resultSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ],\n \"searchAround\": [\n {\n \"template\": \"import { {{sourceObjectType}} } from \\\"{{{packageName}}}\\\";\\nimport { useOsdkClient, useObjectSet } from \\\"@osdk/react\\\";\\nimport { useMemo } from \\\"react\\\";\\n\\nfunction SearchAround{{linkedObjectType}}() {\\n const client = useOsdkClient();\\n const linkedSet = useMemo(() =>\\n client({{sourceObjectType}})\\n .where({ {{rawLinkedPrimaryKeyProperty.apiName}}: { $in: [\\\"a\\\", \\\"b\\\", \\\"c\\\"] } })\\n .pivotTo(\\\"{{linkApiName}}\\\"),\\n [client]);\\n\\n const { data, isLoading, error } = useObjectSet(linkedSet);\\n\\n return (\\n <div>\\n {error && <div>Error: {error.message}</div>}\\n {isLoading && !data && <div>Loading...</div>}\\n <ul>\\n {data?.map(obj => <li key={obj.$primaryKey}>{obj.$primaryKey}</li>)}\\n </ul>\\n </div>\\n );\\n}\"\n }\n ]\n }\n }\n }\n};\n "],"mappings":"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","ignoreList":[]}
|
package/build/cjs/index.cjs
CHANGED
|
@@ -7,7 +7,7 @@ var snippets = {
|
|
|
7
7
|
"2.0.0": {
|
|
8
8
|
"snippets": {
|
|
9
9
|
"reactProviderSetup": [{
|
|
10
|
-
"template": 'import { OsdkProvider } from "@osdk/react";\nimport { createClient } from "@osdk/client";\n\nconst client = createClient(\n "https://your-stack.palantirfoundry.com",\n "{
|
|
10
|
+
"template": 'import { OsdkProvider } from "@osdk/react";\nimport { createClient } from "@osdk/client";\n\nconst client = createClient(\n "https://your-stack.palantirfoundry.com",\n "ri.ontology.main.ontology.{UUID}",\n async () => "your-token"\n);\n\nfunction App() {\n return (\n <OsdkProvider client={client}>\n <YourApp />\n </OsdkProvider>\n );\n}'
|
|
11
11
|
}],
|
|
12
12
|
"reactUseOsdkObjectsBasic": [{
|
|
13
13
|
"template": 'import { {{objectType}} } from "{{{packageName}}}";\nimport { useOsdkObjects } from "@osdk/react";\n\nfunction {{objectType}}List() {\n const { data, isLoading, error, fetchMore } = useOsdkObjects({{objectType}});\n\n return (\n <div>\n {error && <div className="error-banner">Error: {error.message}</div>}\n {isLoading && !data && <div className="skeleton">Loading...</div>}\n <ul>\n {data?.map(obj => (\n <li key={obj.$primaryKey}>{obj.{{titleProperty}}}</li>\n ))}\n </ul>\n {isLoading && data && <span className="refresh-indicator">Refreshing...</span>}\n {fetchMore && <button onClick={fetchMore}>Load more</button>}\n </div>\n );\n}'
|
|
@@ -101,7 +101,7 @@ var snippets = {
|
|
|
101
101
|
"template": '// Batch actions in React should be handled with multiple hook calls\n// or by using the client directly for batch operations\nimport { {{actionApiName}} } from "{{{packageName}}}";\nimport { useOsdkAction } from "@osdk/react";\n\nfunction Batch{{actionApiName}}() {\n const { applyAction, isPending } = useOsdkAction({{actionApiName}});\n\n const handleBatchApply = async (items: Array<Parameters<typeof applyAction>[0]>) => {\n await Promise.all(items.map(item => applyAction(item)));\n };\n\n return (\n <button onClick={() => handleBatchApply([])} disabled={isPending}>\n Apply Batch\n </button>\n );\n}'
|
|
102
102
|
}],
|
|
103
103
|
"clientSetup": [{
|
|
104
|
-
"template": 'import { OsdkProvider } from "@osdk/react";\nimport { createClient } from "@osdk/client";\n\nconst client = createClient(\n "https://your-stack.palantirfoundry.com",\n "{
|
|
104
|
+
"template": 'import { OsdkProvider } from "@osdk/react";\nimport { createClient } from "@osdk/client";\n\nconst client = createClient(\n "https://your-stack.palantirfoundry.com",\n "ri.ontology.main.ontology.{UUID}",\n async () => "your-token"\n);\n\nfunction App() {\n return (\n <OsdkProvider client={client}>\n <YourApp />\n </OsdkProvider>\n );\n}'
|
|
105
105
|
}],
|
|
106
106
|
"callFunction": [{
|
|
107
107
|
"template": 'import { {{funcApiName}} } from "{{{packageName}}}";\nimport { useOsdkFunction } from "@osdk/react";\n\nfunction {{funcApiName}}Caller() {\n const { data, isLoading, error, refetch } = useOsdkFunction({{funcApiName}}, {\n params: { /* function parameters */ }\n });\n\n return (\n <div>\n {error && <div>Error: {error.message}</div>}\n {isLoading && !data && <div>Loading...</div>}\n {data && <pre>{JSON.stringify(data, null, 2)}</pre>}\n <button onClick={refetch}>Refresh</button>\n </div>\n );\n}'
|