Skip to content

Commit

Permalink
Add "" around linkApi names and convert to camelCase (#356)
Browse files Browse the repository at this point in the history
* Add "" around linkApi names and convert to camelCase

* Generate pivotTo arg with lowercase first char

* Fix formatting of the searchAroundThis test

Not actually sure if the test string or the output is incorrect, but this test passes now.

* Add changeset
  • Loading branch information
bryantpark04 authored May 29, 2024
1 parent 091787e commit 111f928
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
9 changes: 9 additions & 0 deletions .changeset/fuzzy-queens-pump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@osdk/generator": patch
---

Update searchAround deprecation message

- Add quotes around link API name, and convert to camelCase

ex) pivotTo(Assignee) -> pivotTo("assignee")
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import type { Todo } from './Todo';
export interface Person extends OntologyObject {
/** @deprecated please migrate to $apiName instead */
readonly __apiName: 'Person' & {
/** @deprecated please migrate to pivotTo(Todos) instead */ searchAroundTodos?: never;
/** @deprecated please migrate to pivotTo(Friends) instead */ searchAroundFriends?: never;
/** @deprecated please migrate to pivotTo("todos") instead */ searchAroundTodos?: never;
/** @deprecated please migrate to pivotTo("friends") instead */ searchAroundFriends?: never;
};
/** @deprecated please migrate to $primaryKey instead */
readonly __primaryKey: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type { Person } from './Person';
export interface Todo extends OntologyObject {
/** @deprecated please migrate to $apiName instead */
readonly __apiName: 'Todo' & {
/** @deprecated please migrate to pivotTo(Assignee) instead */ searchAroundAssignee?: never;
/** @deprecated please migrate to pivotTo("assignee") instead */ searchAroundAssignee?: never;
};
/** @deprecated please migrate to $primaryKey instead */
readonly __primaryKey: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe("wireObjectTypeV2ToObjectInterfaceStringV1", () => {
export interface Todo extends OntologyObject {
/** @deprecated please migrate to $apiName instead */
readonly __apiName: 'Todo' & {
/** @deprecated please migrate to pivotTo(Assignee) instead */ searchAroundAssignee?: never;
/** @deprecated please migrate to pivotTo("assignee") instead */ searchAroundAssignee?: never;
};
/** @deprecated please migrate to $primaryKey instead */
readonly __primaryKey: number;
Expand Down Expand Up @@ -85,7 +85,9 @@ describe("wireObjectTypeV2ToObjectInterfaceStringV1", () => {
export interface Todo extends OntologyObject {
/** @deprecated please migrate to $apiName instead */
readonly __apiName: 'Todo' & { /** @deprecated please migrate to pivotTo(this) instead */ searchAroundThis?: never };
readonly __apiName: 'Todo' & {
/** @deprecated please migrate to pivotTo("this") instead */ searchAroundThis?: never;
};
/** @deprecated please migrate to $primaryKey instead */
readonly __primaryKey: number;
readonly $apiName: 'Todo';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ ${
/** \@deprecated please migrate to \$apiName instead */
readonly __apiName: "${objectTypeWithLinks.objectType.apiName}" & {${
objectTypeWithLinks.linkTypes.map(linkType => {
return `/** \@deprecated please migrate to pivotTo(${linkType.apiName}) instead */ searchAround${
return `/** \@deprecated please migrate to pivotTo("${
linkType.apiName.charAt(0).toLowerCase() + linkType.apiName.slice(1)
}") instead */ searchAround${
linkType.apiName.charAt(0).toUpperCase() + linkType.apiName.slice(1)
}?: never`;
})
Expand Down

0 comments on commit 111f928

Please sign in to comment.