Skip to content

Commit

Permalink
consume new commerce-sdk-core
Browse files Browse the repository at this point in the history
  • Loading branch information
joeluong-sfcc committed May 9, 2024
1 parent 0c4b52a commit dcdcce6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
]
},
"dependencies": {
"@commerce-apps/core": "^1.6.1",
"@commerce-apps/core": "^1.7.0",
"nanoid": "^3.3.4",
"retry": "^0.13.1",
"tslib": "^2.4.1"
Expand Down
4 changes: 2 additions & 2 deletions src/static/helpers/customApi.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe("callCustomEndpoint", () => {
nock.cleanAll();
});

const clientConfig: ClientConfig<CustomApiParameters> = {
const clientConfig: ClientConfig<CustomApiParameters & CommonParameters> = {
parameters: {
shortCode: "short_code",
organizationId: "organization_id",
Expand Down Expand Up @@ -147,7 +147,7 @@ describe("callCustomEndpoint", () => {
);
expect(runFetchPassedArgs[1].queryParameters).to.deep.equal({
...options.parameters,
siteId: (clientConfig.parameters as CustomApiParameters).siteId as string,
siteId: (clientConfig.parameters as CommonParameters).siteId as string,
});
expect(runFetchPassedArgs[1].headers).to.deep.equal(options.headers);
expect(runFetchPassedArgs[1].rawResponse).to.equal(true);
Expand Down
7 changes: 6 additions & 1 deletion src/static/helpers/customApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import { BodyInit, RequestInit } from "node-fetch";
import { ClientConfig, Response, StaticClient, CommonParameters } from "@commerce-apps/core";
import {
ClientConfig,
Response,
StaticClient,
CommonParameters,
} from "@commerce-apps/core";
import { PathParameters } from "@commerce-apps/core/dist/base/resource";
import type { OperationOptions } from "retry";
import { CUSTOM_API_DEFAULT_BASE_URI } from "./config";
Expand Down

0 comments on commit dcdcce6

Please sign in to comment.