Skip to content

Commit 5f92e79

Browse files
committed
Merge branch 'feature/oas' into ju/remove-api-family
2 parents cf95ccd + df85a14 commit 5f92e79

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

.nycrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"src/updateApis.ts",
77
"src/lib/config.ts",
88
"src/generate-oas.ts",
9+
"src/removeInternalOas.ts",
910
"src/static/helpers/index.ts",
1011
"src/lib/utils.ts"
1112
],

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ async function getGuestUserAuthToken(): Promise<ShopperLoginTypes.TokenResponse>
137137
}
138138

139139
// Alternatively you may use the SLAS helper functions to generate JWT/access token
140-
const guestTokenResponse = await slasHelpers.loginGuestUser(
141-
new ShopperLogin(config),
142-
{ redirectURI: 'http://localhost:3000/callback' }
143-
)
140+
const guestTokenResponse = await slasHelpers.loginGuestUser({
141+
slasClient: new ShopperLogin(config),
142+
parameters: { redirectURI: 'http://localhost:3000/callback' }
143+
})
144144
.then((guestTokenResponse) => {
145145
console.log("Guest Token Response: ", guestTokenResponse);
146146
return guestTokenResponse;

src/generate-oas.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ function appendVersionIfV2(name: string, version: string): string {
4848
* @param version
4949
*/
5050
export function resolveApiName(name: string, version: string): string {
51-
if (name === "Shopper Baskets OAS") {
52-
return version === "v2" ? "ShopperBasketsV2" : "ShopperBasketsV1";
51+
if (name === "Shopper Baskets OAS" && version === "v2") {
52+
return "ShopperBasketsV2";
5353
}
5454
if (name === "CDN API - Process APIs OAS") {
5555
return "CDNZones";
@@ -84,10 +84,7 @@ export function getAPIDetailsFromExchange(directory: string): ApiSpecDetail {
8484
) as download.ExchangeConfig;
8585

8686
return {
87-
filepath: path.join(
88-
directory,
89-
exchangeConfig.main.replace("-public.yaml", "-internal.yaml")
90-
),
87+
filepath: path.join(directory, exchangeConfig.main),
9188
filename: exchangeConfig.main,
9289
directoryName: kebabToCamelCase(
9390
appendVersionIfV2(

templates/index.ts.hbs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,5 @@ import type * as {{apiName}}Types from "./{{directoryName}}";
44
export type { {{apiName}}Types };
55
{{/each}}
66

7-
import * as helpers from "./helpers";
8-
export { helpers };
9-
7+
export { helpers, slasHelpers } from "./helpers";
108
export { ClientConfig, CommonParameters, sdkLogger } from "@commerce-apps/core"

0 commit comments

Comments
 (0)