Skip to content

Commit

Permalink
Fix primary key encoding (#524)
Browse files Browse the repository at this point in the history
* fix primary key encoding

* add changeset
  • Loading branch information
ssanjay1 authored Jul 25, 2024
1 parent 0730323 commit cd37441
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/mean-dragons-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@osdk/legacy-client": patch
---

Fix primary key encoding in URLs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export async function getAllTimeSeriesPoints<T extends string | number>(
createOpenApiRequest(client.stack, client.fetch, undefined, true),
client.ontology.metadata.ontologyApiName,
apiName,
primaryKey,
encodeURIComponent(primaryKey),
propertyName,
body,
);
Expand Down
2 changes: 1 addition & 1 deletion packages/legacy-client/src/client/net/getFirstPoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export async function getFirstPoint<T extends string | number>(
createOpenApiRequest(client.stack, client.fetch),
client.ontology.metadata.ontologyApiName,
objectApiName,
primaryKey,
encodeURIComponent(primaryKey),
propertyName,
);
return {
Expand Down
2 changes: 1 addition & 1 deletion packages/legacy-client/src/client/net/getLastPoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export async function getLastPoint<T extends string | number>(
createOpenApiRequest(client.stack, client.fetch),
client.ontology.metadata.ontologyApiName,
objectApiName,
primaryKey,
encodeURIComponent(primaryKey),
propertyName,
);
return {
Expand Down
2 changes: 1 addition & 1 deletion packages/legacy-client/src/client/net/getLinkedObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export async function getLinkedObjectNoErrors<T extends OntologyObject>(
createOpenApiRequest(client.stack, client.fetch),
client.ontology.metadata.ontologyApiName,
sourceApiName,
primaryKey,
encodeURIComponent(primaryKey),
linkTypeApiName,
linkedObjectPrimaryKey,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export async function getLinkedObjectsPage<T extends OntologyObject>(
createOpenApiRequest(client.stack, client.fetch),
client.ontology.metadata.ontologyApiName,
sourceApiName,
primaryKey,
encodeURIComponent(primaryKey),
linkTypeApiName,
{
pageSize: options?.pageSize,
Expand Down
2 changes: 1 addition & 1 deletion packages/legacy-client/src/client/net/getObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export async function getObjectWithoutErrors<T extends OntologyObject>(
createOpenApiRequest(client.stack, client.fetch),
client.ontology.metadata.ontologyApiName,
objectApiName,
primaryKey.toString(),
encodeURIComponent(primaryKey.toString()),
{
select: selectedProperties.map(x => x.toString()),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export async function* iterateTimeSeriesPoints<T extends string | number>(
createOpenApiRequest(client.stack, client.fetch, undefined, true),
client.ontology.metadata.ontologyApiName,
apiName,
primaryKey,
encodeURIComponent(primaryKey),
propertyName,
body,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export async function* iterateLinkedObjects<T extends OntologyObject>(
createOpenApiRequest(client.stack, client.fetch),
client.ontology.metadata.ontologyApiName,
sourceApiName,
primaryKey,
encodeURIComponent(primaryKey),
linkTypeApiName,
{
pageSize: options?.pageSize,
Expand Down

0 comments on commit cd37441

Please sign in to comment.