Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor app management client to prepare for new BP mutation #5529

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gordonhirsch
Copy link
Contributor

@gordonhirsch gordonhirsch commented Mar 16, 2025

WHY are these changes introduced?

This Refactor/cleanup of the business platform interface allows the addition of new BP calls in the future and makes the existing code clearer.

WHAT is this pull request doing?

This PR renames the encodedGidFromId function to encodedGidFromOrganizationId to make its purpose more explicit and to make room for encoding other id types in the future.

Additionally, it updates the type signature for businessPlatformOrganizationsRequestDoc to properly handle generic variables, improving type safety. This makes it consistent with other *RequestDoc functions and seems to allow proper usage with mutations.

How to test your changes?

Run the existing test suite to ensure all tests pass with the renamed function. It was not necessary to add new test.

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

Copy link
Contributor

github-actions bot commented Mar 16, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
76.62% (+0.01% 🔼)
9410/12282
🟡 Branches
71.79% (+0.02% 🔼)
4611/6423
🟡 Functions 76.38% 2444/3200
🟡 Lines
77.12% (+0.01% 🔼)
8894/11532

Test suite run success

2169 tests passing in 950 suites.

Report generated by 🧪jest coverage report action from 6f7f603

@gordonhirsch gordonhirsch force-pushed the refactor-app-management-client branch from d684699 to a642ed7 Compare March 17, 2025 23:03
@gordonhirsch gordonhirsch force-pushed the refactor-app-management-client branch from a642ed7 to 0df7e14 Compare March 28, 2025 01:49
Copy link
Contributor

github-actions bot commented Apr 1, 2025

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/public/node/api/business-platform.d.ts
@@ -40,6 +40,6 @@ export declare function businessPlatformOrganizationsRequest<T>(query: string, t
  * @param variables - GraphQL variables to pass to the query.
  * @returns The response of the query of generic type <T>.
  */
-export declare function businessPlatformOrganizationsRequestDoc<TResult>(query: TypedDocumentNode<TResult, GraphQLVariables> | TypedDocumentNode<TResult, Exact<{
+export declare function businessPlatformOrganizationsRequestDoc<TResult, TVariables extends Variables>(query: TypedDocumentNode<TResult, TVariables> | TypedDocumentNode<TResult, Exact<{
     [key: string]: never;
-}>>, token: string, organizationId: string, variables?: GraphQLVariables): Promise<TResult>;
\ No newline at end of file
+}>>, token: string, organizationId: string, variables?: TVariables): Promise<TResult>;
\ No newline at end of file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants