Socket
Socket
Sign inDemoInstall

@field123/client-shopper

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@field123/client-shopper - npm Package Compare versions

Comparing version 0.1.2 to 0.1.4

14

dist-cjs/create-shopper-client.js

@@ -5,10 +5,18 @@ "use strict";

const middleware_stack_1 = require("@field123/middleware-stack");
const client_1 = require("@field123/client");
function createShopperClient(client, config) {
let resolvedEpccClient;
if ('middlewareStack' in client) {
resolvedEpccClient = client;
}
else {
resolvedEpccClient = (0, client_1.createEpccClient)(client);
}
const shopperMiddlewareStack = (0, middleware_stack_1.constructStack)();
const combinedMiddleware = client.middlewareStack.concat(shopperMiddlewareStack);
const combinedMiddleware = resolvedEpccClient.middlewareStack.concat(shopperMiddlewareStack);
const combinedConfig = {
...client.config
...resolvedEpccClient.config
};
return {
...client,
...resolvedEpccClient,
config: combinedConfig,

@@ -15,0 +23,0 @@ middlewareStack: combinedMiddleware,

@@ -8,1 +8,2 @@ "use strict";

tslib_1.__exportStar(require("@field123/credential-providers"), exports);
tslib_1.__exportStar(require("@field123/client"), exports);

@@ -10,5 +10,5 @@ "use strict";

};
const path = (0, get_url_1.getUrl)('/catalog/hierarchies', input);
const path = (0, get_url_1.getUrl)("/catalog/hierarchies", input);
return (0, util_1.buildHttpGetRequest)(context, { headers, path });
};
exports.serializeGetAllHierarchiesCommand = serializeGetAllHierarchiesCommand;

@@ -10,5 +10,5 @@ "use strict";

};
const path = (0, get_url_1.getUrl)('/catalog/nodes', input);
const path = (0, get_url_1.getUrl)("/catalog/nodes", input);
return (0, util_1.buildHttpGetRequest)(context, { headers, path });
};
exports.serializeGetAllNodesCommand = serializeGetAllNodesCommand;

@@ -10,5 +10,5 @@ "use strict";

};
const path = (0, get_url_1.getUrl)('/catalog/products', input);
const path = (0, get_url_1.getUrl)("/catalog/products", input);
return (0, util_1.buildHttpGetRequest)(context, { headers, path });
};
exports.serializeGetAllProductsCommand = serializeGetAllProductsCommand;

@@ -10,5 +10,5 @@ "use strict";

};
const path = (0, get_url_1.getUrl)('/catalog/hierarchies/{hierarchyId}', input);
const path = (0, get_url_1.getUrl)("/catalog/hierarchies/{hierarchyId}", input);
return (0, util_1.buildHttpGetRequest)(context, { headers, path });
};
exports.serializeGetHierarchyByIdCommand = serializeGetHierarchyByIdCommand;

@@ -10,5 +10,5 @@ "use strict";

};
const path = (0, get_url_1.getUrl)('/catalog/hierarchies/{hierarchyId}/children', input);
const path = (0, get_url_1.getUrl)("/catalog/hierarchies/{hierarchyId}/children", input);
return (0, util_1.buildHttpGetRequest)(context, { headers, path });
};
exports.serializeGetHierarchyChildNodesCommand = serializeGetHierarchyChildNodesCommand;

@@ -10,5 +10,5 @@ "use strict";

};
const path = (0, get_url_1.getUrl)('/catalog/hierarchies/{hierarchyId}/nodes', input);
const path = (0, get_url_1.getUrl)("/catalog/hierarchies/{hierarchyId}/nodes", input);
return (0, util_1.buildHttpGetRequest)(context, { headers, path });
};
exports.serializeGetHierarchyNodesCommand = serializeGetHierarchyNodesCommand;

@@ -10,5 +10,5 @@ "use strict";

};
const path = (0, get_url_1.getUrl)('/catalog/hierarchies/{hierarchyId}/products', input);
const path = (0, get_url_1.getUrl)("/catalog/hierarchies/{hierarchyId}/products", input);
return (0, util_1.buildHttpGetRequest)(context, { headers, path });
};
exports.serializeGetHierarchyProductsCommand = serializeGetHierarchyProductsCommand;

@@ -10,5 +10,5 @@ "use strict";

};
const path = (0, get_url_1.getUrl)('/catalog/nodes/{nodeId}', input);
const path = (0, get_url_1.getUrl)("/catalog/nodes/{nodeId}", input);
return (0, util_1.buildHttpGetRequest)(context, { headers, path });
};
exports.serializeGetNodeByIdCommand = serializeGetNodeByIdCommand;

@@ -10,5 +10,5 @@ "use strict";

};
const path = (0, get_url_1.getUrl)('/catalog/nodes/{nodeId}/relationships/children', input);
const path = (0, get_url_1.getUrl)("/catalog/nodes/{nodeId}/relationships/children", input);
return (0, util_1.buildHttpGetRequest)(context, { headers, path });
};
exports.serializeGetNodeChildNodesCommand = serializeGetNodeChildNodesCommand;

@@ -10,5 +10,5 @@ "use strict";

};
const path = (0, get_url_1.getUrl)('/catalog/nodes/{nodeId}/relationships/products', input);
const path = (0, get_url_1.getUrl)("/catalog/nodes/{nodeId}/relationships/products", input);
return (0, util_1.buildHttpGetRequest)(context, { headers, path });
};
exports.serializeGetNodeProductsCommand = serializeGetNodeProductsCommand;

@@ -10,5 +10,5 @@ "use strict";

};
const path = (0, get_url_1.getUrl)('/catalog/products/{productId}', input);
const path = (0, get_url_1.getUrl)("/catalog/products/{productId}", input);
return (0, util_1.buildHttpGetRequest)(context, { headers, path });
};
exports.serializeGetProductByIdCommand = serializeGetProductByIdCommand;

@@ -10,5 +10,5 @@ "use strict";

};
const path = (0, get_url_1.getUrl)('/catalog', input);
const path = (0, get_url_1.getUrl)("/catalog", input);
return (0, util_1.buildHttpGetRequest)(context, { headers, path });
};
exports.serializeGetShopperCatalogCommand = serializeGetShopperCatalogCommand;
import { constructStack } from '@field123/middleware-stack';
import { createEpccClient } from '@field123/client';
export function createShopperClient(client, config) {
let resolvedEpccClient;
if ('middlewareStack' in client) {
resolvedEpccClient = client;
}
else {
resolvedEpccClient = createEpccClient(client);
}
const shopperMiddlewareStack = constructStack();
const combinedMiddleware = client.middlewareStack.concat(shopperMiddlewareStack);
const combinedMiddleware = resolvedEpccClient.middlewareStack.concat(shopperMiddlewareStack);
const combinedConfig = {
...client.config
...resolvedEpccClient.config
};
return {
...client,
...resolvedEpccClient,
config: combinedConfig,

@@ -11,0 +19,0 @@ middlewareStack: combinedMiddleware,

@@ -5,1 +5,2 @@ export * from './create-shopper-client';

export * from '@field123/credential-providers';
export * from '@field123/client';

@@ -7,4 +7,4 @@ import { buildHttpGetRequest } from '../util';

};
const path = getUrl('/catalog/hierarchies', input);
const path = getUrl("/catalog/hierarchies", input);
return buildHttpGetRequest(context, { headers, path });
};

@@ -7,4 +7,4 @@ import { buildHttpGetRequest } from '../util';

};
const path = getUrl('/catalog/nodes', input);
const path = getUrl("/catalog/nodes", input);
return buildHttpGetRequest(context, { headers, path });
};

@@ -7,4 +7,4 @@ import { buildHttpGetRequest } from '../util';

};
const path = getUrl('/catalog/products', input);
const path = getUrl("/catalog/products", input);
return buildHttpGetRequest(context, { headers, path });
};

@@ -7,4 +7,4 @@ import { buildHttpGetRequest } from '../util';

};
const path = getUrl('/catalog/hierarchies/{hierarchyId}', input);
const path = getUrl("/catalog/hierarchies/{hierarchyId}", input);
return buildHttpGetRequest(context, { headers, path });
};

@@ -7,4 +7,4 @@ import { buildHttpGetRequest } from '../util';

};
const path = getUrl('/catalog/hierarchies/{hierarchyId}/children', input);
const path = getUrl("/catalog/hierarchies/{hierarchyId}/children", input);
return buildHttpGetRequest(context, { headers, path });
};

@@ -7,4 +7,4 @@ import { buildHttpGetRequest } from '../util';

};
const path = getUrl('/catalog/hierarchies/{hierarchyId}/nodes', input);
const path = getUrl("/catalog/hierarchies/{hierarchyId}/nodes", input);
return buildHttpGetRequest(context, { headers, path });
};

@@ -7,4 +7,4 @@ import { buildHttpGetRequest } from '../util';

};
const path = getUrl('/catalog/hierarchies/{hierarchyId}/products', input);
const path = getUrl("/catalog/hierarchies/{hierarchyId}/products", input);
return buildHttpGetRequest(context, { headers, path });
};

@@ -7,4 +7,4 @@ import { buildHttpGetRequest } from '../util';

};
const path = getUrl('/catalog/nodes/{nodeId}', input);
const path = getUrl("/catalog/nodes/{nodeId}", input);
return buildHttpGetRequest(context, { headers, path });
};

@@ -7,4 +7,4 @@ import { buildHttpGetRequest } from '../util';

};
const path = getUrl('/catalog/nodes/{nodeId}/relationships/children', input);
const path = getUrl("/catalog/nodes/{nodeId}/relationships/children", input);
return buildHttpGetRequest(context, { headers, path });
};

@@ -7,4 +7,4 @@ import { buildHttpGetRequest } from '../util';

};
const path = getUrl('/catalog/nodes/{nodeId}/relationships/products', input);
const path = getUrl("/catalog/nodes/{nodeId}/relationships/products", input);
return buildHttpGetRequest(context, { headers, path });
};

@@ -7,4 +7,4 @@ import { buildHttpGetRequest } from '../util';

};
const path = getUrl('/catalog/products/{productId}', input);
const path = getUrl("/catalog/products/{productId}", input);
return buildHttpGetRequest(context, { headers, path });
};

@@ -7,4 +7,4 @@ import { buildHttpGetRequest } from '../util';

};
const path = getUrl('/catalog', input);
const path = getUrl("/catalog", input);
return buildHttpGetRequest(context, { headers, path });
};
import { EpccClient, EpccClientResolvedConfig, ExtractCommandInputs, ExtractCommandOutputs, HttpHandlerOptions, RequestHandlingClient } from '@field123/sdk-types';
import { GetAllHierarchiesCommand, GetAllNodesCommand, GetAllProductsCommand, GetHierarchyByIdCommand, GetHierarchyChildNodesCommand, GetHierarchyNodesCommand, GetHierarchyProductsCommand, GetNodeByIdCommand, GetNodeChildNodesCommand, GetNodeProductsCommand, GetProductByIdCommand, GetShopperCatalogCommand } from './commands';
import { createEpccClient } from '@field123/client';
export declare type ResolvedShopperClientConfig = EpccClientResolvedConfig;

@@ -8,3 +9,5 @@ export declare type ShopperClientConfig = Record<never, never>;

declare type ServiceCommandOutputTypes = ExtractCommandOutputs<ServiceCommandTypes>;
declare type EPCCClientCreatorInput = Parameters<typeof createEpccClient>[0];
export declare function createShopperClient(client: EPCCClientCreatorInput): RequestHandlingClient<HttpHandlerOptions, ServiceCommandInputTypes, ServiceCommandOutputTypes, ResolvedShopperClientConfig>;
export declare function createShopperClient(client: EpccClient, config?: ShopperClientConfig): RequestHandlingClient<HttpHandlerOptions, ServiceCommandInputTypes, ServiceCommandOutputTypes, ResolvedShopperClientConfig>;
export {};

@@ -5,1 +5,2 @@ export * from './create-shopper-client';

export * from '@field123/credential-providers';
export * from '@field123/client';
{
"name": "@field123/client-shopper",
"version": "0.1.2",
"version": "0.1.4",
"main": "./dist-cjs/index.js",

@@ -44,2 +44,3 @@ "types": "./dist-types/index.d.ts",

"dependencies": {
"@field123/client": "*",
"@field123/client-common": "*",

@@ -46,0 +47,0 @@ "@field123/middleware-common": "*",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc