@epcc-sdk/sdks-shopper 0.0.10 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Options } from "@hey-api/client-fetch";
|
|
2
2
|
import { type UseMutationOptions } from "@tanstack/react-query";
|
|
3
|
-
import type { GetByContextReleaseData, GetByContextAllHierarchiesData, GetByContextHierarchyData, GetByContextHierarchyNodesData, GetByContextHierarchyChildNodesData, GetByContextAllNodesData, GetByContextNodeData, GetByContextChildNodesData, GetByContextAllProductsData, GetByContextProductData, GetByContextComponentProductIdsData, GetByContextChildProductsData, GetByContextProductsForHierarchyData, GetByContextProductsForNodeData, ConfigureByContextProductData, GetCatalogsData, CreateCatalogData, DeleteCatalogByIdData, GetCatalogByIdData, UpdateCatalogData, DeleteReleasesData, GetReleasesData, PublishReleaseData, DeleteReleaseByIdData, GetReleaseByIdData, GetRulesData, CreateRuleData, DeleteRuleByIdData, GetRuleByIdData, UpdateRuleData, GetAllHierarchiesData, GetHierarchyData, GetHierarchyNodesData, GetHierarchyChildNodesData, GetAllNodesData, GetNodeData, GetChildNodesData, GetAllProductsData, GetProductData, GetComponentProductIdsData, GetChildProductsData, GetProductsForHierarchyData, GetProductsForNodeData, GetCartsData, CreateACartData, DeleteACartData, GetCartData, UpdateACartData, DeleteAllCartItemsData, GetCartItemsData, ManageCartsData, BulkUpdateItemsInCartData, DeleteACartItemData, UpdateACartItemData, DeleteAccountCartAssociationData, CreateAccountCartAssociationData, CreateAccountCartAssociationResponse, DeleteCustomerCartAssociationData, CreateCustomerCartAssociationData, DeleteAPromotionViaPromotionCodeData, AddTaxItemToCartData, BulkDeleteTaxItemsFromCartData, BulkAddTaxItemsToCartData, DeleteATaxItemData, UpdateATaxItemData, BulkDeleteCustomDiscountsFromCartData, BulkAddCustomDiscountsToCartData, DeleteCustomDiscountFromCartData, UpdateCustomDiscountForCartData, AddCustomDiscountToCartItemData, DeleteCustomDiscountFromCartItemData, UpdateCustomDiscountForCartItemData, CreateCartPaymentIntentData, CheckoutApiData, GetCustomerOrdersData, GetAnOrderData, UpdateAnOrderData, GetOrderItemsData, AnonymizeOrdersData, PaymentSetupData, ConfirmPaymentData, CaptureATransactionData, RefundATransactionData, GetOrderTransactionsData, GetATransactionData, CancelATransactionData, GetSubscriptionProductData, GetPlanData, ListOfferingsData, GetOfferingData, ListOfferingPlansData, ListOfferingFeaturesData, ListOfferingProductsData, GetFeatureData, GetStockData, ListLocationsData } from "../types.gen";
|
|
3
|
+
import type { GetByContextReleaseData, GetByContextAllHierarchiesData, GetByContextHierarchyData, GetByContextHierarchyNodesData, GetByContextHierarchyChildNodesData, GetByContextAllNodesData, GetByContextNodeData, GetByContextChildNodesData, GetByContextAllProductsData, GetByContextProductData, GetByContextComponentProductIdsData, GetByContextChildProductsData, GetByContextProductsForHierarchyData, GetByContextProductsForNodeData, ConfigureByContextProductData, GetCatalogsData, CreateCatalogData, DeleteCatalogByIdData, GetCatalogByIdData, UpdateCatalogData, DeleteReleasesData, GetReleasesData, PublishReleaseData, DeleteReleaseByIdData, GetReleaseByIdData, GetRulesData, CreateRuleData, DeleteRuleByIdData, GetRuleByIdData, UpdateRuleData, GetAllHierarchiesData, GetHierarchyData, GetHierarchyNodesData, GetHierarchyChildNodesData, GetAllNodesData, GetNodeData, GetChildNodesData, GetAllProductsData, GetProductData, GetComponentProductIdsData, GetChildProductsData, GetProductsForHierarchyData, GetProductsForNodeData, GetCartsData, CreateACartData, DeleteACartData, GetCartData, UpdateACartData, DeleteAllCartItemsData, GetCartItemsData, ManageCartsData, BulkUpdateItemsInCartData, DeleteACartItemData, UpdateACartItemData, DeleteAccountCartAssociationData, CreateAccountCartAssociationData, CreateAccountCartAssociationResponse, DeleteCustomerCartAssociationData, CreateCustomerCartAssociationData, DeleteAPromotionViaPromotionCodeData, AddTaxItemToCartData, BulkDeleteTaxItemsFromCartData, BulkAddTaxItemsToCartData, DeleteATaxItemData, UpdateATaxItemData, BulkDeleteCustomDiscountsFromCartData, BulkAddCustomDiscountsToCartData, DeleteCustomDiscountFromCartData, UpdateCustomDiscountForCartData, AddCustomDiscountToCartItemData, DeleteCustomDiscountFromCartItemData, UpdateCustomDiscountForCartItemData, CreateCartPaymentIntentData, CheckoutApiData, GetCustomerOrdersData, GetAnOrderData, UpdateAnOrderData, GetOrderItemsData, AnonymizeOrdersData, PaymentSetupData, ConfirmPaymentData, CaptureATransactionData, RefundATransactionData, GetOrderTransactionsData, GetATransactionData, CancelATransactionData, GetSubscriptionProductData, GetPlanData, ListOfferingsData, GetOfferingData, ListOfferingPlansData, ListOfferingFeaturesData, ListOfferingProductsData, GetFeatureData, GetStockData, ListLocationsData, CreateAnAccessTokenData } from "../types.gen";
|
|
4
4
|
export declare const getByContextReleaseQueryKey: (options?: Options<GetByContextReleaseData>) => (Pick<Options<GetByContextReleaseData>, "body" | "headers" | "path" | "query" | "baseUrl"> & {
|
|
5
5
|
_id: string;
|
|
6
6
|
_infinite?: boolean;
|
|
@@ -1838,3 +1838,35 @@ export declare const listLocationsOptions: (options?: Options<ListLocationsData>
|
|
|
1838
1838
|
[dataTagErrorSymbol]: Error;
|
|
1839
1839
|
};
|
|
1840
1840
|
};
|
|
1841
|
+
export declare const createAnAccessTokenQueryKey: (options?: Options<CreateAnAccessTokenData>) => (Pick<Options<CreateAnAccessTokenData>, "body" | "headers" | "path" | "query" | "baseUrl"> & {
|
|
1842
|
+
_id: string;
|
|
1843
|
+
_infinite?: boolean;
|
|
1844
|
+
})[];
|
|
1845
|
+
export declare const createAnAccessTokenOptions: (options?: Options<CreateAnAccessTokenData>) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
1846
|
+
data?: import("../types.gen").AccessTokenResponse;
|
|
1847
|
+
}, Error, {
|
|
1848
|
+
data?: import("../types.gen").AccessTokenResponse;
|
|
1849
|
+
}, (Pick<Options<CreateAnAccessTokenData>, "body" | "headers" | "path" | "query" | "baseUrl"> & {
|
|
1850
|
+
_id: string;
|
|
1851
|
+
_infinite?: boolean;
|
|
1852
|
+
})[]>, "queryFn"> & {
|
|
1853
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
1854
|
+
data?: import("../types.gen").AccessTokenResponse;
|
|
1855
|
+
}, (Pick<Options<CreateAnAccessTokenData>, "body" | "headers" | "path" | "query" | "baseUrl"> & {
|
|
1856
|
+
_id: string;
|
|
1857
|
+
_infinite?: boolean;
|
|
1858
|
+
})[], never> | undefined;
|
|
1859
|
+
} & {
|
|
1860
|
+
queryKey: (Pick<Options<CreateAnAccessTokenData>, "body" | "headers" | "path" | "query" | "baseUrl"> & {
|
|
1861
|
+
_id: string;
|
|
1862
|
+
_infinite?: boolean;
|
|
1863
|
+
})[] & {
|
|
1864
|
+
[dataTagSymbol]: {
|
|
1865
|
+
data?: import("../types.gen").AccessTokenResponse;
|
|
1866
|
+
};
|
|
1867
|
+
[dataTagErrorSymbol]: Error;
|
|
1868
|
+
};
|
|
1869
|
+
};
|
|
1870
|
+
export declare const createAnAccessTokenMutation: (options?: Partial<Options<CreateAnAccessTokenData>>) => UseMutationOptions<{
|
|
1871
|
+
data?: import("../types.gen").AccessTokenResponse;
|
|
1872
|
+
}, import("../types.gen").ErrorResponse2, Options<CreateAnAccessTokenData>, unknown>;
|
|
@@ -47,7 +47,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
import { queryOptions } from "@tanstack/react-query";
|
|
50
|
-
import { getByContextRelease, getByContextAllHierarchies, getByContextHierarchy, getByContextHierarchyNodes, getByContextHierarchyChildNodes, getByContextAllNodes, getByContextNode, getByContextChildNodes, getByContextAllProducts, getByContextProduct, getByContextComponentProductIds, getByContextChildProducts, getByContextProductsForHierarchy, getByContextProductsForNode, configureByContextProduct, getCatalogs, createCatalog, deleteCatalogById, getCatalogById, updateCatalog, deleteReleases, getReleases, publishRelease, deleteReleaseById, getReleaseById, getRules, createRule, deleteRuleById, getRuleById, updateRule, getAllHierarchies, getHierarchy, getHierarchyNodes, getHierarchyChildNodes, getAllNodes, getNode, getChildNodes, getAllProducts, getProduct, getComponentProductIds, getChildProducts, getProductsForHierarchy, getProductsForNode, getCarts, createACart, deleteACart, getCart, updateACart, deleteAllCartItems, getCartItems, manageCarts, bulkUpdateItemsInCart, deleteACartItem, updateACartItem, deleteAccountCartAssociation, createAccountCartAssociation, deleteCustomerCartAssociation, createCustomerCartAssociation, deleteAPromotionViaPromotionCode, addTaxItemToCart, bulkDeleteTaxItemsFromCart, bulkAddTaxItemsToCart, deleteATaxItem, updateATaxItem, bulkDeleteCustomDiscountsFromCart, bulkAddCustomDiscountsToCart, deleteCustomDiscountFromCart, updateCustomDiscountForCart, addCustomDiscountToCartItem, deleteCustomDiscountFromCartItem, updateCustomDiscountForCartItem, createCartPaymentIntent, checkoutApi, getCustomerOrders, getAnOrder, updateAnOrder, getOrderItems, anonymizeOrders, paymentSetup, confirmPayment, captureATransaction, refundATransaction, getOrderTransactions, getATransaction, cancelATransaction, getSubscriptionProduct, getPlan, listOfferings, getOffering, listOfferingPlans, listOfferingFeatures, listOfferingProducts, getFeature, getStock, listLocations, client, } from "../sdk.gen";
|
|
50
|
+
import { getByContextRelease, getByContextAllHierarchies, getByContextHierarchy, getByContextHierarchyNodes, getByContextHierarchyChildNodes, getByContextAllNodes, getByContextNode, getByContextChildNodes, getByContextAllProducts, getByContextProduct, getByContextComponentProductIds, getByContextChildProducts, getByContextProductsForHierarchy, getByContextProductsForNode, configureByContextProduct, getCatalogs, createCatalog, deleteCatalogById, getCatalogById, updateCatalog, deleteReleases, getReleases, publishRelease, deleteReleaseById, getReleaseById, getRules, createRule, deleteRuleById, getRuleById, updateRule, getAllHierarchies, getHierarchy, getHierarchyNodes, getHierarchyChildNodes, getAllNodes, getNode, getChildNodes, getAllProducts, getProduct, getComponentProductIds, getChildProducts, getProductsForHierarchy, getProductsForNode, getCarts, createACart, deleteACart, getCart, updateACart, deleteAllCartItems, getCartItems, manageCarts, bulkUpdateItemsInCart, deleteACartItem, updateACartItem, deleteAccountCartAssociation, createAccountCartAssociation, deleteCustomerCartAssociation, createCustomerCartAssociation, deleteAPromotionViaPromotionCode, addTaxItemToCart, bulkDeleteTaxItemsFromCart, bulkAddTaxItemsToCart, deleteATaxItem, updateATaxItem, bulkDeleteCustomDiscountsFromCart, bulkAddCustomDiscountsToCart, deleteCustomDiscountFromCart, updateCustomDiscountForCart, addCustomDiscountToCartItem, deleteCustomDiscountFromCartItem, updateCustomDiscountForCartItem, createCartPaymentIntent, checkoutApi, getCustomerOrders, getAnOrder, updateAnOrder, getOrderItems, anonymizeOrders, paymentSetup, confirmPayment, captureATransaction, refundATransaction, getOrderTransactions, getATransaction, cancelATransaction, getSubscriptionProduct, getPlan, listOfferings, getOffering, listOfferingPlans, listOfferingFeatures, listOfferingProducts, getFeature, getStock, listLocations, createAnAccessToken, client, } from "../sdk.gen";
|
|
51
51
|
var createQueryKey = function (id, options, infinite) {
|
|
52
52
|
var _a;
|
|
53
53
|
var params = {
|
|
@@ -2105,3 +2105,37 @@ export var listLocationsOptions = function (options) {
|
|
|
2105
2105
|
queryKey: listLocationsQueryKey(options),
|
|
2106
2106
|
});
|
|
2107
2107
|
};
|
|
2108
|
+
export var createAnAccessTokenQueryKey = function (options) { return [createQueryKey("createAnAccessToken", options)]; };
|
|
2109
|
+
export var createAnAccessTokenOptions = function (options) {
|
|
2110
|
+
return queryOptions({
|
|
2111
|
+
queryFn: function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
2112
|
+
var data;
|
|
2113
|
+
var queryKey = _b.queryKey, signal = _b.signal;
|
|
2114
|
+
return __generator(this, function (_c) {
|
|
2115
|
+
switch (_c.label) {
|
|
2116
|
+
case 0: return [4 /*yield*/, createAnAccessToken(__assign(__assign(__assign({}, options), queryKey[0]), { signal: signal, throwOnError: true }))];
|
|
2117
|
+
case 1:
|
|
2118
|
+
data = (_c.sent()).data;
|
|
2119
|
+
return [2 /*return*/, data];
|
|
2120
|
+
}
|
|
2121
|
+
});
|
|
2122
|
+
}); },
|
|
2123
|
+
queryKey: createAnAccessTokenQueryKey(options),
|
|
2124
|
+
});
|
|
2125
|
+
};
|
|
2126
|
+
export var createAnAccessTokenMutation = function (options) {
|
|
2127
|
+
var mutationOptions = {
|
|
2128
|
+
mutationFn: function (localOptions) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2129
|
+
var data;
|
|
2130
|
+
return __generator(this, function (_a) {
|
|
2131
|
+
switch (_a.label) {
|
|
2132
|
+
case 0: return [4 /*yield*/, createAnAccessToken(__assign(__assign(__assign({}, options), localOptions), { throwOnError: true }))];
|
|
2133
|
+
case 1:
|
|
2134
|
+
data = (_a.sent()).data;
|
|
2135
|
+
return [2 /*return*/, data];
|
|
2136
|
+
}
|
|
2137
|
+
});
|
|
2138
|
+
}); },
|
|
2139
|
+
};
|
|
2140
|
+
return mutationOptions;
|
|
2141
|
+
};
|
package/dist/client/sdk.gen.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Options } from "@hey-api/client-fetch";
|
|
2
|
-
import type { GetByContextReleaseData, GetByContextAllHierarchiesData, GetByContextHierarchyData, GetByContextHierarchyNodesData, GetByContextHierarchyChildNodesData, GetByContextAllNodesData, GetByContextNodeData, GetByContextChildNodesData, GetByContextAllProductsData, GetByContextProductData, GetByContextComponentProductIdsData, GetByContextChildProductsData, GetByContextProductsForHierarchyData, GetByContextProductsForNodeData, ConfigureByContextProductData, GetCatalogsData, CreateCatalogData, DeleteCatalogByIdData, GetCatalogByIdData, UpdateCatalogData, DeleteReleasesData, GetReleasesData, PublishReleaseData, DeleteReleaseByIdData, GetReleaseByIdData, GetRulesData, CreateRuleData, DeleteRuleByIdData, GetRuleByIdData, UpdateRuleData, GetAllHierarchiesData, GetHierarchyData, GetHierarchyNodesData, GetHierarchyChildNodesData, GetAllNodesData, GetNodeData, GetChildNodesData, GetAllProductsData, GetProductData, GetComponentProductIdsData, GetChildProductsData, GetProductsForHierarchyData, GetProductsForNodeData, GetCartsData, CreateACartData, DeleteACartData, GetCartData, UpdateACartData, DeleteAllCartItemsData, GetCartItemsData, ManageCartsData, BulkUpdateItemsInCartData, DeleteACartItemData, UpdateACartItemData, DeleteAccountCartAssociationData, CreateAccountCartAssociationData, CreateAccountCartAssociationResponse, DeleteCustomerCartAssociationData, CreateCustomerCartAssociationData, DeleteAPromotionViaPromotionCodeData, AddTaxItemToCartData, BulkDeleteTaxItemsFromCartData, BulkAddTaxItemsToCartData, DeleteATaxItemData, UpdateATaxItemData, BulkDeleteCustomDiscountsFromCartData, BulkAddCustomDiscountsToCartData, DeleteCustomDiscountFromCartData, UpdateCustomDiscountForCartData, AddCustomDiscountToCartItemData, DeleteCustomDiscountFromCartItemData, UpdateCustomDiscountForCartItemData, CreateCartPaymentIntentData, CheckoutApiData, GetCustomerOrdersData, GetAnOrderData, UpdateAnOrderData, GetOrderItemsData, AnonymizeOrdersData, PaymentSetupData, ConfirmPaymentData, CaptureATransactionData, RefundATransactionData, GetOrderTransactionsData, GetATransactionData, CancelATransactionData, GetSubscriptionProductData, GetPlanData, ListOfferingsData, GetOfferingData, ListOfferingPlansData, ListOfferingFeaturesData, ListOfferingProductsData, GetFeatureData, GetStockData, ListLocationsData } from "./types.gen";
|
|
2
|
+
import type { GetByContextReleaseData, GetByContextAllHierarchiesData, GetByContextHierarchyData, GetByContextHierarchyNodesData, GetByContextHierarchyChildNodesData, GetByContextAllNodesData, GetByContextNodeData, GetByContextChildNodesData, GetByContextAllProductsData, GetByContextProductData, GetByContextComponentProductIdsData, GetByContextChildProductsData, GetByContextProductsForHierarchyData, GetByContextProductsForNodeData, ConfigureByContextProductData, GetCatalogsData, CreateCatalogData, DeleteCatalogByIdData, GetCatalogByIdData, UpdateCatalogData, DeleteReleasesData, GetReleasesData, PublishReleaseData, DeleteReleaseByIdData, GetReleaseByIdData, GetRulesData, CreateRuleData, DeleteRuleByIdData, GetRuleByIdData, UpdateRuleData, GetAllHierarchiesData, GetHierarchyData, GetHierarchyNodesData, GetHierarchyChildNodesData, GetAllNodesData, GetNodeData, GetChildNodesData, GetAllProductsData, GetProductData, GetComponentProductIdsData, GetChildProductsData, GetProductsForHierarchyData, GetProductsForNodeData, GetCartsData, CreateACartData, DeleteACartData, GetCartData, UpdateACartData, DeleteAllCartItemsData, GetCartItemsData, ManageCartsData, BulkUpdateItemsInCartData, DeleteACartItemData, UpdateACartItemData, DeleteAccountCartAssociationData, CreateAccountCartAssociationData, CreateAccountCartAssociationResponse, DeleteCustomerCartAssociationData, CreateCustomerCartAssociationData, DeleteAPromotionViaPromotionCodeData, AddTaxItemToCartData, BulkDeleteTaxItemsFromCartData, BulkAddTaxItemsToCartData, DeleteATaxItemData, UpdateATaxItemData, BulkDeleteCustomDiscountsFromCartData, BulkAddCustomDiscountsToCartData, DeleteCustomDiscountFromCartData, UpdateCustomDiscountForCartData, AddCustomDiscountToCartItemData, DeleteCustomDiscountFromCartItemData, UpdateCustomDiscountForCartItemData, CreateCartPaymentIntentData, CheckoutApiData, GetCustomerOrdersData, GetAnOrderData, UpdateAnOrderData, GetOrderItemsData, AnonymizeOrdersData, PaymentSetupData, ConfirmPaymentData, CaptureATransactionData, RefundATransactionData, GetOrderTransactionsData, GetATransactionData, CancelATransactionData, GetSubscriptionProductData, GetPlanData, ListOfferingsData, GetOfferingData, ListOfferingPlansData, ListOfferingFeaturesData, ListOfferingProductsData, GetFeatureData, GetStockData, ListLocationsData, CreateAnAccessTokenData } from "./types.gen";
|
|
3
3
|
export declare const client: import("@hey-api/client-fetch").Client<Request, Response, unknown, import("@hey-api/client-fetch").RequestOptions<boolean, string>>;
|
|
4
4
|
/**
|
|
5
5
|
* Get the catalog release as shoppers
|
|
@@ -2273,3 +2273,29 @@ export declare const listLocations: <ThrowOnError extends boolean = false>(optio
|
|
|
2273
2273
|
data?: Array<import("./types.gen").Location>;
|
|
2274
2274
|
links?: import("./types.gen").Links2;
|
|
2275
2275
|
}, import("./types.gen").InventoriesErrorResponse, ThrowOnError>;
|
|
2276
|
+
/**
|
|
2277
|
+
* Create an Access Token
|
|
2278
|
+
*
|
|
2279
|
+
* ### Client Credentials
|
|
2280
|
+
*
|
|
2281
|
+
* A `client_credentials` token is used when the credentials are not publicly exposed, usually a server-side language such as PHP or Node.js. This type of authentication enables `CRUD` access to all resources.
|
|
2282
|
+
*
|
|
2283
|
+
* `client_id` and `client_secret` are created and managed via [Application Keys](/docs/authentication/application-keys/create-an-application-key).
|
|
2284
|
+
*
|
|
2285
|
+
* To see the access granted by a `client_credentials` token, refer to [Permissions](/docs/authentication/Tokens/permissions).
|
|
2286
|
+
*
|
|
2287
|
+
*
|
|
2288
|
+
* ### Implicit
|
|
2289
|
+
*
|
|
2290
|
+
* An `implicit` token is typically used for situations where you are requesting data on the client side and you are exposing your public key. When authenticated implicitly, you can only fetch (`GET`) data with live status (products, categories, brands, etc).
|
|
2291
|
+
*
|
|
2292
|
+
* The `implicit` token is most appropriate for use inside client-side applications, such as JavaScript.
|
|
2293
|
+
*
|
|
2294
|
+
* :::caution
|
|
2295
|
+
* An `implicit` token can be thought of as a **Read only** token.
|
|
2296
|
+
* :::
|
|
2297
|
+
*
|
|
2298
|
+
*/
|
|
2299
|
+
export declare const createAnAccessToken: <ThrowOnError extends boolean = false>(options?: Options<CreateAnAccessTokenData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
|
|
2300
|
+
data?: import("./types.gen").AccessTokenResponse;
|
|
2301
|
+
}, import("./types.gen").ErrorResponse2, ThrowOnError>;
|
package/dist/client/sdk.gen.js
CHANGED
|
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
-
import { createClient, createConfig } from "@hey-api/client-fetch";
|
|
13
|
+
import { createClient, createConfig, urlSearchParamsBodySerializer, } from "@hey-api/client-fetch";
|
|
14
14
|
export var client = createClient(createConfig());
|
|
15
15
|
/**
|
|
16
16
|
* Get the catalog release as shoppers
|
|
@@ -2966,3 +2966,30 @@ export var listLocations = function (options) {
|
|
|
2966
2966
|
},
|
|
2967
2967
|
], url: "/v2/inventories/locations" }));
|
|
2968
2968
|
};
|
|
2969
|
+
/**
|
|
2970
|
+
* Create an Access Token
|
|
2971
|
+
*
|
|
2972
|
+
* ### Client Credentials
|
|
2973
|
+
*
|
|
2974
|
+
* A `client_credentials` token is used when the credentials are not publicly exposed, usually a server-side language such as PHP or Node.js. This type of authentication enables `CRUD` access to all resources.
|
|
2975
|
+
*
|
|
2976
|
+
* `client_id` and `client_secret` are created and managed via [Application Keys](/docs/authentication/application-keys/create-an-application-key).
|
|
2977
|
+
*
|
|
2978
|
+
* To see the access granted by a `client_credentials` token, refer to [Permissions](/docs/authentication/Tokens/permissions).
|
|
2979
|
+
*
|
|
2980
|
+
*
|
|
2981
|
+
* ### Implicit
|
|
2982
|
+
*
|
|
2983
|
+
* An `implicit` token is typically used for situations where you are requesting data on the client side and you are exposing your public key. When authenticated implicitly, you can only fetch (`GET`) data with live status (products, categories, brands, etc).
|
|
2984
|
+
*
|
|
2985
|
+
* The `implicit` token is most appropriate for use inside client-side applications, such as JavaScript.
|
|
2986
|
+
*
|
|
2987
|
+
* :::caution
|
|
2988
|
+
* An `implicit` token can be thought of as a **Read only** token.
|
|
2989
|
+
* :::
|
|
2990
|
+
*
|
|
2991
|
+
*/
|
|
2992
|
+
export var createAnAccessToken = function (options) {
|
|
2993
|
+
var _a;
|
|
2994
|
+
return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : client).post(__assign(__assign(__assign({}, options), urlSearchParamsBodySerializer), { headers: __assign({ "Content-Type": "application/x-www-form-urlencoded" }, options === null || options === void 0 ? void 0 : options.headers), url: "/oauth/access_token" }));
|
|
2995
|
+
};
|
|
@@ -3178,7 +3178,7 @@ export type CartInclude = {
|
|
|
3178
3178
|
/**
|
|
3179
3179
|
* The cart items associated with a cart.
|
|
3180
3180
|
*/
|
|
3181
|
-
items?: Array<CartItemResponse>;
|
|
3181
|
+
items?: Array<CartItemObjectData & CartItemResponse>;
|
|
3182
3182
|
};
|
|
3183
3183
|
/**
|
|
3184
3184
|
* Whether a plan is active on a subscription using that offering. The `active_plan` attribute is null if a plan is not active in a subscription.
|
|
@@ -4959,6 +4959,59 @@ export type InventoriesError = {
|
|
|
4959
4959
|
[key: string]: unknown;
|
|
4960
4960
|
};
|
|
4961
4961
|
};
|
|
4962
|
+
export type AccessTokenRequest = {
|
|
4963
|
+
/**
|
|
4964
|
+
* The grant type, choices are `client_credentials` or `implicit`
|
|
4965
|
+
*/
|
|
4966
|
+
grant_type: string;
|
|
4967
|
+
/**
|
|
4968
|
+
* Your `client_id`
|
|
4969
|
+
*/
|
|
4970
|
+
client_id: string;
|
|
4971
|
+
/**
|
|
4972
|
+
* Your `client_secret`. Only required for client credentials.
|
|
4973
|
+
*/
|
|
4974
|
+
client_secret?: string;
|
|
4975
|
+
};
|
|
4976
|
+
export type AccessTokenResponse = {
|
|
4977
|
+
/**
|
|
4978
|
+
* The access token you use to authenticate requests to the API.
|
|
4979
|
+
*/
|
|
4980
|
+
access_token?: string;
|
|
4981
|
+
/**
|
|
4982
|
+
* Right now this is only `Bearer`.
|
|
4983
|
+
*/
|
|
4984
|
+
token_type?: string;
|
|
4985
|
+
/**
|
|
4986
|
+
* The type of token requested. This can be a `client_credentials` or `implicit`.
|
|
4987
|
+
*/
|
|
4988
|
+
identifier?: string;
|
|
4989
|
+
/**
|
|
4990
|
+
* The duration in seconds after which the token expires.
|
|
4991
|
+
*/
|
|
4992
|
+
expires_in?: number;
|
|
4993
|
+
/**
|
|
4994
|
+
* The epoch time that this token expires at.
|
|
4995
|
+
*/
|
|
4996
|
+
expires?: number;
|
|
4997
|
+
};
|
|
4998
|
+
export type ErrorResponse2 = {
|
|
4999
|
+
errors: Array<Error2>;
|
|
5000
|
+
};
|
|
5001
|
+
export type Error2 = {
|
|
5002
|
+
/**
|
|
5003
|
+
* A brief summary of the error.
|
|
5004
|
+
*/
|
|
5005
|
+
title: string;
|
|
5006
|
+
/**
|
|
5007
|
+
* The HTTP response code of the error.
|
|
5008
|
+
*/
|
|
5009
|
+
status: string;
|
|
5010
|
+
/**
|
|
5011
|
+
* Optional additional detail about the error.
|
|
5012
|
+
*/
|
|
5013
|
+
detail?: string;
|
|
5014
|
+
};
|
|
4962
5015
|
/**
|
|
4963
5016
|
* The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language).
|
|
4964
5017
|
*/
|
|
@@ -8337,3 +8390,33 @@ export type ListLocationsResponses = {
|
|
|
8337
8390
|
};
|
|
8338
8391
|
};
|
|
8339
8392
|
export type ListLocationsResponse = ListLocationsResponses[keyof ListLocationsResponses];
|
|
8393
|
+
export type CreateAnAccessTokenData = {
|
|
8394
|
+
body?: AccessTokenRequest;
|
|
8395
|
+
path?: never;
|
|
8396
|
+
query?: never;
|
|
8397
|
+
url: "/oauth/access_token";
|
|
8398
|
+
};
|
|
8399
|
+
export type CreateAnAccessTokenErrors = {
|
|
8400
|
+
/**
|
|
8401
|
+
* Bad Request
|
|
8402
|
+
*/
|
|
8403
|
+
400: ErrorResponse2;
|
|
8404
|
+
/**
|
|
8405
|
+
* Unauthorized
|
|
8406
|
+
*/
|
|
8407
|
+
401: ErrorResponse2;
|
|
8408
|
+
/**
|
|
8409
|
+
* Internal server error. There was a system failure in the platform.
|
|
8410
|
+
*/
|
|
8411
|
+
default: ErrorResponse2;
|
|
8412
|
+
};
|
|
8413
|
+
export type CreateAnAccessTokenError = CreateAnAccessTokenErrors[keyof CreateAnAccessTokenErrors];
|
|
8414
|
+
export type CreateAnAccessTokenResponses = {
|
|
8415
|
+
/**
|
|
8416
|
+
* OK
|
|
8417
|
+
*/
|
|
8418
|
+
200: {
|
|
8419
|
+
data?: AccessTokenResponse;
|
|
8420
|
+
};
|
|
8421
|
+
};
|
|
8422
|
+
export type CreateAnAccessTokenResponse = CreateAnAccessTokenResponses[keyof CreateAnAccessTokenResponses];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epcc-sdk/sdks-shopper",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"oas:openapi-ts": "openapi-ts",
|
|
50
50
|
"oas:redocly": "redocly --config ./redocly.json",
|
|
51
51
|
"oas:redocly:lint": "redocly lint --config ../specs/config/redocly.yaml",
|
|
52
|
-
"oas:redocly:join:shopper": "redocly join --config ../specs/config/redocly.yaml --output ../specs/shopper.yaml ../specs/bundled/catalog_view_3.1.yaml ../specs/bundled/cart_checkout.yaml ../specs/bundled/subscriptions_3.1.yaml ../specs/bundled/inventories_3.1.yaml",
|
|
52
|
+
"oas:redocly:join:shopper": "redocly join --config ../specs/config/redocly.yaml --output ../specs/shopper.yaml ../specs/bundled/catalog_view_3.1.yaml ../specs/bundled/cart_checkout.yaml ../specs/bundled/subscriptions_3.1.yaml ../specs/bundled/inventories_3.1.yaml ../specs/bundled/authentication.yaml",
|
|
53
53
|
"oas:redocly:bundle": "redocly bundle --config ../specs/config/redocly.yaml",
|
|
54
54
|
"oas:openapi-format:convert": "pnpm dlx openapi-format ../specs/bundled/catalog_view.yaml -o ../specs/bundled/catalog_view_3.1.yaml --convertTo \"3.1\" && pnpm dlx openapi-format ../specs/bundled/subscriptions.yaml -o ../specs/bundled/subscriptions_3.1.yaml --convertTo \"3.1\" && pnpm dlx openapi-format ../specs/bundled/inventories.yaml -o ../specs/bundled/inventories_3.1.yaml --convertTo \"3.1\""
|
|
55
55
|
}
|