Skip to content

Commit c8a3065

Browse files
committed
add type fix for Set
1 parent 29ae03d commit c8a3065

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

src/lib/utils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ export const ORG_ID = "893f605e-10e2-423a-bdb4-f952f56eb6d8";
1515

1616
/**
1717
* Wrapper around execSync to simplify stubbing in tests.
18+
* @param command
19+
* @param options
1820
*/
1921
export const runExecSync = (
2022
command: string,
@@ -24,6 +26,7 @@ export const runExecSync = (
2426
/**
2527
* Small wrapper to create an AdmZip instance.
2628
* Abstracted for easier stubbing in tests.
29+
* @param zipPath
2730
*/
2831
export const createAdmZip = (zipPath: string) => new AdmZip(zipPath);
2932

src/static/helpers/slas.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@
88
import { nanoid } from "nanoid";
99
import { URL, URLSearchParams } from "url";
1010
import { ResponseError } from "@commerce-apps/core";
11-
import {
12-
ISlasClient,
13-
TokenResponse,
14-
TokenRequest,
15-
} from "./slasClient";
11+
import { ISlasClient, TokenResponse, TokenRequest } from "./slasClient";
1612
import type { RequestRedirect } from "node-fetch";
1713
import { CustomQueryParameters, CustomRequestBody } from "../types";
1814

@@ -310,6 +306,8 @@ export async function loginRegisteredUserB2Cprivate(options: {
310306
* @param options.parameters.redirectURI - Per OAuth standard, a valid app route. Must be listed in your SLAS configuration. On server, this will not be actually called. On browser, this will be called, but ignored.
311307
* @param options.parameters.usid? - Unique Shopper Identifier to enable personalization.
312308
* @param options.body? - optional body to pass in the ShopperLogin authenticateCustomer method
309+
* @param options.parameters.usid
310+
* @param options.body
313311
* @returns TokenResponse
314312
*/
315313
export async function loginRegisteredUserB2C(options: {

templatesOas/apis.endpoint.mustache

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,19 @@
243243

244244
{{#queryParams}}
245245
if (optionParams["{{paramName}}"] !== undefined) {
246+
{{#uniqueItems}}
247+
queryParams["{{paramName}}"] = optionParams["{{paramName}}"] instanceof Set ? Array.from(optionParams["{{paramName}}"]) : optionParams["{{paramName}}"];
248+
{{/uniqueItems}}
249+
{{^uniqueItems}}
246250
queryParams["{{paramName}}"] = optionParams["{{paramName}}"];
251+
{{/uniqueItems}}
247252
} else if (configParams["{{paramName}}"] !== undefined) {
253+
{{#uniqueItems}}
254+
queryParams["{{paramName}}"] = configParams["{{paramName}}"] instanceof Set ? Array.from(configParams["{{paramName}}"]) : configParams["{{paramName}}"];
255+
{{/uniqueItems}}
256+
{{^uniqueItems}}
248257
queryParams["{{paramName}}"] = configParams["{{paramName}}"];
258+
{{/uniqueItems}}
249259
}
250260
{{#required}}
251261
else {

0 commit comments

Comments
 (0)