@lcdp/api-react-rest-client 3.1.3-LDS-5369-api-modifications-routes-et-sch.22191144448 → 3.1.3-develop.22308664019
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/magic-cart/src/models/ExpressOrder.d.ts +3 -3
- package/magic-cart/src/models/ExpressOrder.js +3 -3
- package/magic-cart/src/models/SaleOfferProposal.d.ts +51 -0
- package/magic-cart/src/models/SaleOfferProposal.js +61 -0
- package/magic-cart/src/models/SellerProposal.d.ts +45 -0
- package/magic-cart/src/models/SellerProposal.js +57 -0
- package/magic-cart/src/models/index.d.ts +2 -1
- package/magic-cart/src/models/index.js +2 -1
- package/package.json +1 -1
- package/shopping-cart/src/apis/ManageCartApi.d.ts +33 -8
- package/shopping-cart/src/apis/ManageCartApi.js +237 -10
- package/shopping-cart/src/apis/ManageCartSubCartApi.d.ts +107 -0
- package/shopping-cart/src/apis/{ManageCartLineApi.js → ManageCartSubCartApi.js} +157 -86
- package/shopping-cart/src/apis/ManageCartSubCartLineApi.d.ts +151 -0
- package/shopping-cart/src/apis/ManageCartSubCartLineApi.js +879 -0
- package/shopping-cart/src/apis/index.d.ts +2 -2
- package/shopping-cart/src/apis/index.js +2 -2
- package/shopping-cart/src/models/Cart.d.ts +5 -50
- package/shopping-cart/src/models/Cart.js +4 -39
- package/shopping-cart/src/models/CartSubCart.d.ts +76 -0
- package/shopping-cart/src/models/CartSubCart.js +78 -0
- package/shopping-cart/src/models/{CartLine.d.ts → CartSubCartLine.d.ts} +13 -13
- package/shopping-cart/src/models/{CartLine.js → CartSubCartLine.js} +11 -11
- package/shopping-cart/src/models/CartSubCartLineUpdateParameters.d.ts +37 -0
- package/shopping-cart/src/models/CartSubCartLineUpdateParameters.js +49 -0
- package/shopping-cart/src/models/{CartTransport.d.ts → CartSubCartTransport.d.ts} +12 -12
- package/shopping-cart/src/models/{CartTransport.js → CartSubCartTransport.js} +11 -11
- package/shopping-cart/src/models/index.d.ts +4 -12
- package/shopping-cart/src/models/index.js +4 -12
- package/ubo/src/models/Address.d.ts +1 -1
- package/magic-cart/src/models/ShoppedOffer.d.ts +0 -43
- package/magic-cart/src/models/ShoppedOffer.js +0 -53
- package/shopping-cart/src/apis/ManageCartLineApi.d.ts +0 -82
- package/shopping-cart/src/apis/SearchCartApi.d.ts +0 -45
- package/shopping-cart/src/apis/SearchCartApi.js +0 -183
- package/shopping-cart/src/models/CartCreationParameters.d.ts +0 -44
- package/shopping-cart/src/models/CartCreationParameters.js +0 -56
- package/shopping-cart/src/models/CartCreationResponse.d.ts +0 -39
- package/shopping-cart/src/models/CartCreationResponse.js +0 -49
- package/shopping-cart/src/models/CartLineResponse.d.ts +0 -39
- package/shopping-cart/src/models/CartLineResponse.js +0 -49
- package/shopping-cart/src/models/CartLineUpdateParameters.d.ts +0 -37
- package/shopping-cart/src/models/CartLineUpdateParameters.js +0 -49
- package/shopping-cart/src/models/CartLinesResponse.d.ts +0 -39
- package/shopping-cart/src/models/CartLinesResponse.js +0 -49
- package/shopping-cart/src/models/CartSummary.d.ts +0 -31
- package/shopping-cart/src/models/CartSummary.js +0 -47
- package/shopping-cart/src/models/CartWarning.d.ts +0 -70
- package/shopping-cart/src/models/CartWarning.js +0 -71
- package/shopping-cart/src/models/OwnerLink.d.ts +0 -43
- package/shopping-cart/src/models/OwnerLink.js +0 -53
- package/shopping-cart/src/models/PaginatedCarts.d.ts +0 -46
- package/shopping-cart/src/models/PaginatedCarts.js +0 -58
- package/shopping-cart/src/models/PagingMetadata.d.ts +0 -49
- package/shopping-cart/src/models/PagingMetadata.js +0 -55
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
-
import type {
|
|
12
|
+
import type { SellerProposal } from './SellerProposal';
|
|
13
13
|
/**
|
|
14
14
|
* Express Order as a list of sale offer proposal grouped by sellers
|
|
15
15
|
* @export
|
|
@@ -24,10 +24,10 @@ export interface ExpressOrder {
|
|
|
24
24
|
optimal?: boolean;
|
|
25
25
|
/**
|
|
26
26
|
*
|
|
27
|
-
* @type {Array<
|
|
27
|
+
* @type {Array<SellerProposal>}
|
|
28
28
|
* @memberof ExpressOrder
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
sellerProposals?: Array<SellerProposal>;
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
33
|
* Check if a given object implements the ExpressOrder interface.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.ExpressOrderToJSON = exports.ExpressOrderFromJSONTyped = exports.ExpressOrderFromJSON = exports.instanceOfExpressOrder = void 0;
|
|
17
|
-
var
|
|
17
|
+
var SellerProposal_1 = require("./SellerProposal");
|
|
18
18
|
/**
|
|
19
19
|
* Check if a given object implements the ExpressOrder interface.
|
|
20
20
|
*/
|
|
@@ -32,7 +32,7 @@ function ExpressOrderFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
32
32
|
}
|
|
33
33
|
return {
|
|
34
34
|
'optimal': json['optimal'],
|
|
35
|
-
'
|
|
35
|
+
'sellerProposals': (json['sellerProposals'] === null || json['sellerProposals'] === undefined) ? json['sellerProposals'] : json['sellerProposals'].map(SellerProposal_1.SellerProposalFromJSON),
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
exports.ExpressOrderFromJSONTyped = ExpressOrderFromJSONTyped;
|
|
@@ -42,7 +42,7 @@ function ExpressOrderToJSON(value) {
|
|
|
42
42
|
}
|
|
43
43
|
return {
|
|
44
44
|
'optimal': value['optimal'],
|
|
45
|
-
'
|
|
45
|
+
'sellerProposals': (value['sellerProposals'] === null || value['sellerProposals'] === undefined) ? value['sellerProposals'] : value['sellerProposals'].map(SellerProposal_1.SellerProposalToJSON),
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
exports.ExpressOrderToJSON = ExpressOrderToJSON;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* lcdp-magic-cart
|
|
3
|
+
* This is the REST API of Magic cart
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
* Contact: contact@lecomptoirdespharmacies.fr
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import type { ProductLink } from './ProductLink';
|
|
13
|
+
import type { SaleOfferLink } from './SaleOfferLink';
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @export
|
|
17
|
+
* @interface SaleOfferProposal
|
|
18
|
+
*/
|
|
19
|
+
export interface SaleOfferProposal {
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @type {ProductLink}
|
|
23
|
+
* @memberof SaleOfferProposal
|
|
24
|
+
*/
|
|
25
|
+
product: ProductLink;
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @type {SaleOfferLink}
|
|
29
|
+
* @memberof SaleOfferProposal
|
|
30
|
+
*/
|
|
31
|
+
saleOffer: SaleOfferLink;
|
|
32
|
+
/**
|
|
33
|
+
* Set when sale offer's distribution mode is RANGE
|
|
34
|
+
* @type {number}
|
|
35
|
+
* @memberof SaleOfferProposal
|
|
36
|
+
*/
|
|
37
|
+
distributedRangeId: number | null;
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* @type {number}
|
|
41
|
+
* @memberof SaleOfferProposal
|
|
42
|
+
*/
|
|
43
|
+
quantity: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Check if a given object implements the SaleOfferProposal interface.
|
|
47
|
+
*/
|
|
48
|
+
export declare function instanceOfSaleOfferProposal(value: object): value is SaleOfferProposal;
|
|
49
|
+
export declare function SaleOfferProposalFromJSON(json: any): SaleOfferProposal;
|
|
50
|
+
export declare function SaleOfferProposalFromJSONTyped(json: any, ignoreDiscriminator: boolean): SaleOfferProposal;
|
|
51
|
+
export declare function SaleOfferProposalToJSON(value?: SaleOfferProposal | null): any;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* lcdp-magic-cart
|
|
6
|
+
* This is the REST API of Magic cart
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
* Contact: contact@lecomptoirdespharmacies.fr
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.SaleOfferProposalToJSON = exports.SaleOfferProposalFromJSONTyped = exports.SaleOfferProposalFromJSON = exports.instanceOfSaleOfferProposal = void 0;
|
|
17
|
+
var ProductLink_1 = require("./ProductLink");
|
|
18
|
+
var SaleOfferLink_1 = require("./SaleOfferLink");
|
|
19
|
+
/**
|
|
20
|
+
* Check if a given object implements the SaleOfferProposal interface.
|
|
21
|
+
*/
|
|
22
|
+
function instanceOfSaleOfferProposal(value) {
|
|
23
|
+
if (!('product' in value) || value['product'] === undefined)
|
|
24
|
+
return false;
|
|
25
|
+
if (!('saleOffer' in value) || value['saleOffer'] === undefined)
|
|
26
|
+
return false;
|
|
27
|
+
if (!('distributedRangeId' in value) || value['distributedRangeId'] === undefined)
|
|
28
|
+
return false;
|
|
29
|
+
if (!('quantity' in value) || value['quantity'] === undefined)
|
|
30
|
+
return false;
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
exports.instanceOfSaleOfferProposal = instanceOfSaleOfferProposal;
|
|
34
|
+
function SaleOfferProposalFromJSON(json) {
|
|
35
|
+
return SaleOfferProposalFromJSONTyped(json, false);
|
|
36
|
+
}
|
|
37
|
+
exports.SaleOfferProposalFromJSON = SaleOfferProposalFromJSON;
|
|
38
|
+
function SaleOfferProposalFromJSONTyped(json, ignoreDiscriminator) {
|
|
39
|
+
if (json == null) {
|
|
40
|
+
return json;
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
'product': (json['product'] === null || json['product'] === undefined) ? json['product'] : (0, ProductLink_1.ProductLinkFromJSON)(json['product']),
|
|
44
|
+
'saleOffer': (json['saleOffer'] === null || json['saleOffer'] === undefined) ? json['saleOffer'] : (0, SaleOfferLink_1.SaleOfferLinkFromJSON)(json['saleOffer']),
|
|
45
|
+
'distributedRangeId': json['distributedRangeId'],
|
|
46
|
+
'quantity': json['quantity'],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
exports.SaleOfferProposalFromJSONTyped = SaleOfferProposalFromJSONTyped;
|
|
50
|
+
function SaleOfferProposalToJSON(value) {
|
|
51
|
+
if (value == null) {
|
|
52
|
+
return value;
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
'product': (0, ProductLink_1.ProductLinkToJSON)(value['product']),
|
|
56
|
+
'saleOffer': (0, SaleOfferLink_1.SaleOfferLinkToJSON)(value['saleOffer']),
|
|
57
|
+
'distributedRangeId': value['distributedRangeId'],
|
|
58
|
+
'quantity': value['quantity'],
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
exports.SaleOfferProposalToJSON = SaleOfferProposalToJSON;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* lcdp-magic-cart
|
|
3
|
+
* This is the REST API of Magic cart
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
* Contact: contact@lecomptoirdespharmacies.fr
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import type { UserLink } from './UserLink';
|
|
13
|
+
import type { SaleOfferProposal } from './SaleOfferProposal';
|
|
14
|
+
/**
|
|
15
|
+
* A list of proposed sale offers to buy from seller
|
|
16
|
+
* @export
|
|
17
|
+
* @interface SellerProposal
|
|
18
|
+
*/
|
|
19
|
+
export interface SellerProposal {
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @type {Array<SaleOfferProposal>}
|
|
23
|
+
* @memberof SellerProposal
|
|
24
|
+
*/
|
|
25
|
+
saleOfferProposals: Array<SaleOfferProposal>;
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @type {UserLink}
|
|
29
|
+
* @memberof SellerProposal
|
|
30
|
+
*/
|
|
31
|
+
seller: UserLink;
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @type {number}
|
|
35
|
+
* @memberof SellerProposal
|
|
36
|
+
*/
|
|
37
|
+
freeCarriageThreshold: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Check if a given object implements the SellerProposal interface.
|
|
41
|
+
*/
|
|
42
|
+
export declare function instanceOfSellerProposal(value: object): value is SellerProposal;
|
|
43
|
+
export declare function SellerProposalFromJSON(json: any): SellerProposal;
|
|
44
|
+
export declare function SellerProposalFromJSONTyped(json: any, ignoreDiscriminator: boolean): SellerProposal;
|
|
45
|
+
export declare function SellerProposalToJSON(value?: SellerProposal | null): any;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* lcdp-magic-cart
|
|
6
|
+
* This is the REST API of Magic cart
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
* Contact: contact@lecomptoirdespharmacies.fr
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.SellerProposalToJSON = exports.SellerProposalFromJSONTyped = exports.SellerProposalFromJSON = exports.instanceOfSellerProposal = void 0;
|
|
17
|
+
var UserLink_1 = require("./UserLink");
|
|
18
|
+
var SaleOfferProposal_1 = require("./SaleOfferProposal");
|
|
19
|
+
/**
|
|
20
|
+
* Check if a given object implements the SellerProposal interface.
|
|
21
|
+
*/
|
|
22
|
+
function instanceOfSellerProposal(value) {
|
|
23
|
+
if (!('saleOfferProposals' in value) || value['saleOfferProposals'] === undefined)
|
|
24
|
+
return false;
|
|
25
|
+
if (!('seller' in value) || value['seller'] === undefined)
|
|
26
|
+
return false;
|
|
27
|
+
if (!('freeCarriageThreshold' in value) || value['freeCarriageThreshold'] === undefined)
|
|
28
|
+
return false;
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
exports.instanceOfSellerProposal = instanceOfSellerProposal;
|
|
32
|
+
function SellerProposalFromJSON(json) {
|
|
33
|
+
return SellerProposalFromJSONTyped(json, false);
|
|
34
|
+
}
|
|
35
|
+
exports.SellerProposalFromJSON = SellerProposalFromJSON;
|
|
36
|
+
function SellerProposalFromJSONTyped(json, ignoreDiscriminator) {
|
|
37
|
+
if (json == null) {
|
|
38
|
+
return json;
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
'saleOfferProposals': (json['saleOfferProposals'] === null || json['saleOfferProposals'] === undefined) ? json['saleOfferProposals'] : json['saleOfferProposals'].map(SaleOfferProposal_1.SaleOfferProposalFromJSON),
|
|
42
|
+
'seller': (json['seller'] === null || json['seller'] === undefined) ? json['seller'] : (0, UserLink_1.UserLinkFromJSON)(json['seller']),
|
|
43
|
+
'freeCarriageThreshold': json['freeCarriageThreshold'],
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
exports.SellerProposalFromJSONTyped = SellerProposalFromJSONTyped;
|
|
47
|
+
function SellerProposalToJSON(value) {
|
|
48
|
+
if (value == null) {
|
|
49
|
+
return value;
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
'saleOfferProposals': (value['saleOfferProposals'] === null || value['saleOfferProposals'] === undefined) ? value['saleOfferProposals'] : value['saleOfferProposals'].map(SaleOfferProposal_1.SaleOfferProposalToJSON),
|
|
53
|
+
'seller': (0, UserLink_1.UserLinkToJSON)(value['seller']),
|
|
54
|
+
'freeCarriageThreshold': value['freeCarriageThreshold'],
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
exports.SellerProposalToJSON = SellerProposalToJSON;
|
|
@@ -12,7 +12,8 @@ export * from './ProductLink';
|
|
|
12
12
|
export * from './ProductStorageType';
|
|
13
13
|
export * from './QuotationDistributionMode';
|
|
14
14
|
export * from './SaleOfferLink';
|
|
15
|
-
export * from './
|
|
15
|
+
export * from './SaleOfferProposal';
|
|
16
|
+
export * from './SellerProposal';
|
|
16
17
|
export * from './Stock';
|
|
17
18
|
export * from './UnitaryDistributionMode';
|
|
18
19
|
export * from './UserLink';
|
|
@@ -30,7 +30,8 @@ __exportStar(require("./ProductLink"), exports);
|
|
|
30
30
|
__exportStar(require("./ProductStorageType"), exports);
|
|
31
31
|
__exportStar(require("./QuotationDistributionMode"), exports);
|
|
32
32
|
__exportStar(require("./SaleOfferLink"), exports);
|
|
33
|
-
__exportStar(require("./
|
|
33
|
+
__exportStar(require("./SaleOfferProposal"), exports);
|
|
34
|
+
__exportStar(require("./SellerProposal"), exports);
|
|
34
35
|
__exportStar(require("./Stock"), exports);
|
|
35
36
|
__exportStar(require("./UnitaryDistributionMode"), exports);
|
|
36
37
|
__exportStar(require("./UserLink"), exports);
|
package/package.json
CHANGED
|
@@ -10,22 +10,47 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type {
|
|
13
|
+
import type { Cart } from '../models/index';
|
|
14
14
|
export interface CreateCartRequest {
|
|
15
|
-
|
|
15
|
+
cartId: number;
|
|
16
|
+
}
|
|
17
|
+
export interface GetCartRequest {
|
|
18
|
+
cartId: number;
|
|
16
19
|
}
|
|
17
20
|
/**
|
|
18
21
|
*
|
|
19
22
|
*/
|
|
20
23
|
export declare class ManageCartApi extends runtime.BaseAPI {
|
|
21
24
|
/**
|
|
22
|
-
* Create
|
|
23
|
-
|
|
25
|
+
* Create current cart if get cart return object not found
|
|
26
|
+
*/
|
|
27
|
+
createCartRaw(requestParameters: CreateCartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Cart | runtime.BlobWithMeta>>;
|
|
28
|
+
/**
|
|
29
|
+
* Create current cart if get cart return object not found
|
|
30
|
+
*/
|
|
31
|
+
createCart(requestParameters: CreateCartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Cart | runtime.BlobWithMeta>;
|
|
32
|
+
/**
|
|
33
|
+
* Create current cart if get cart return object not found
|
|
34
|
+
*/
|
|
35
|
+
createCurrentCartRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Cart | runtime.BlobWithMeta>>;
|
|
36
|
+
/**
|
|
37
|
+
* Create current cart if get cart return object not found
|
|
38
|
+
*/
|
|
39
|
+
createCurrentCart(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Cart | runtime.BlobWithMeta>;
|
|
40
|
+
/**
|
|
41
|
+
* Get current cart
|
|
42
|
+
*/
|
|
43
|
+
getCartRaw(requestParameters: GetCartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Cart | runtime.BlobWithMeta>>;
|
|
44
|
+
/**
|
|
45
|
+
* Get current cart
|
|
46
|
+
*/
|
|
47
|
+
getCart(requestParameters: GetCartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Cart | runtime.BlobWithMeta>;
|
|
48
|
+
/**
|
|
49
|
+
* Get current cart
|
|
24
50
|
*/
|
|
25
|
-
|
|
51
|
+
getCurrentCartRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Cart | runtime.BlobWithMeta>>;
|
|
26
52
|
/**
|
|
27
|
-
*
|
|
28
|
-
* Create a cart and add items
|
|
53
|
+
* Get current cart
|
|
29
54
|
*/
|
|
30
|
-
|
|
55
|
+
getCurrentCart(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Cart | runtime.BlobWithMeta>;
|
|
31
56
|
}
|
|
@@ -76,8 +76,7 @@ var ManageCartApi = /** @class */ (function (_super) {
|
|
|
76
76
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
79
|
-
* Create
|
|
80
|
-
* Create a cart and add items
|
|
79
|
+
* Create current cart if get cart return object not found
|
|
81
80
|
*/
|
|
82
81
|
ManageCartApi.prototype.createCartRaw = function (requestParameters, initOverrides) {
|
|
83
82
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -85,12 +84,11 @@ var ManageCartApi = /** @class */ (function (_super) {
|
|
|
85
84
|
return __generator(this, function (_c) {
|
|
86
85
|
switch (_c.label) {
|
|
87
86
|
case 0:
|
|
88
|
-
if (requestParameters['
|
|
89
|
-
throw new runtime.RequiredError('
|
|
87
|
+
if (requestParameters['cartId'] == null) {
|
|
88
|
+
throw new runtime.RequiredError('cartId', 'Required parameter "cartId" was null or undefined when calling createCart().');
|
|
90
89
|
}
|
|
91
90
|
queryParameters = {};
|
|
92
91
|
headerParameters = {};
|
|
93
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
94
92
|
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
95
93
|
_a = headerParameters;
|
|
96
94
|
_b = "x-api-key";
|
|
@@ -111,17 +109,16 @@ var ManageCartApi = /** @class */ (function (_super) {
|
|
|
111
109
|
case 4:
|
|
112
110
|
_c.trys.push([4, 6, , 7]);
|
|
113
111
|
return [4 /*yield*/, this.request({
|
|
114
|
-
path: "/carts",
|
|
112
|
+
path: "/carts/{cartId}".replace("{".concat("cartId", "}"), encodeURIComponent(String(requestParameters['cartId']))),
|
|
115
113
|
method: 'POST',
|
|
116
114
|
headers: headerParameters,
|
|
117
115
|
query: queryParameters,
|
|
118
|
-
body: (0, index_1.CartCreationParametersToJSON)(requestParameters['cartCreationParameters']),
|
|
119
116
|
}, initOverrides)];
|
|
120
117
|
case 5:
|
|
121
118
|
response = _c.sent();
|
|
122
119
|
contentType = response.headers.get("content-type");
|
|
123
120
|
if (contentType && contentType.indexOf("application/json") !== -1) {
|
|
124
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.
|
|
121
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.CartFromJSON)(jsonValue); })];
|
|
125
122
|
}
|
|
126
123
|
else if (contentType && contentType.indexOf("text/plain") !== -1) {
|
|
127
124
|
return [2 /*return*/, new runtime.TextApiResponse(response)];
|
|
@@ -141,8 +138,7 @@ var ManageCartApi = /** @class */ (function (_super) {
|
|
|
141
138
|
});
|
|
142
139
|
};
|
|
143
140
|
/**
|
|
144
|
-
* Create
|
|
145
|
-
* Create a cart and add items
|
|
141
|
+
* Create current cart if get cart return object not found
|
|
146
142
|
*/
|
|
147
143
|
ManageCartApi.prototype.createCart = function (requestParameters, initOverrides) {
|
|
148
144
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -158,6 +154,237 @@ var ManageCartApi = /** @class */ (function (_super) {
|
|
|
158
154
|
});
|
|
159
155
|
});
|
|
160
156
|
};
|
|
157
|
+
/**
|
|
158
|
+
* Create current cart if get cart return object not found
|
|
159
|
+
*/
|
|
160
|
+
ManageCartApi.prototype.createCurrentCartRaw = function (initOverrides) {
|
|
161
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
162
|
+
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_2;
|
|
163
|
+
return __generator(this, function (_c) {
|
|
164
|
+
switch (_c.label) {
|
|
165
|
+
case 0:
|
|
166
|
+
queryParameters = {};
|
|
167
|
+
headerParameters = {};
|
|
168
|
+
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
169
|
+
_a = headerParameters;
|
|
170
|
+
_b = "x-api-key";
|
|
171
|
+
return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
|
|
172
|
+
case 1:
|
|
173
|
+
_a[_b] = _c.sent(); // apiKeyAuth authentication
|
|
174
|
+
_c.label = 2;
|
|
175
|
+
case 2:
|
|
176
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
|
|
177
|
+
token = this.configuration.accessToken;
|
|
178
|
+
return [4 /*yield*/, token("bearerAuth", [])];
|
|
179
|
+
case 3:
|
|
180
|
+
tokenString = _c.sent();
|
|
181
|
+
if (tokenString) {
|
|
182
|
+
headerParameters["Authorization"] = "Bearer ".concat(tokenString);
|
|
183
|
+
}
|
|
184
|
+
_c.label = 4;
|
|
185
|
+
case 4:
|
|
186
|
+
_c.trys.push([4, 6, , 7]);
|
|
187
|
+
return [4 /*yield*/, this.request({
|
|
188
|
+
path: "/carts/me",
|
|
189
|
+
method: 'POST',
|
|
190
|
+
headers: headerParameters,
|
|
191
|
+
query: queryParameters,
|
|
192
|
+
}, initOverrides)];
|
|
193
|
+
case 5:
|
|
194
|
+
response = _c.sent();
|
|
195
|
+
contentType = response.headers.get("content-type");
|
|
196
|
+
if (contentType && contentType.indexOf("application/json") !== -1) {
|
|
197
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.CartFromJSON)(jsonValue); })];
|
|
198
|
+
}
|
|
199
|
+
else if (contentType && contentType.indexOf("text/plain") !== -1) {
|
|
200
|
+
return [2 /*return*/, new runtime.TextApiResponse(response)];
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
// TODO : Better handling of others application types
|
|
204
|
+
return [2 /*return*/, new runtime.BlobWithMetaApiResponse(response)];
|
|
205
|
+
}
|
|
206
|
+
return [3 /*break*/, 7];
|
|
207
|
+
case 6:
|
|
208
|
+
response_2 = _c.sent();
|
|
209
|
+
console.debug(response_2);
|
|
210
|
+
throw response_2;
|
|
211
|
+
case 7: return [2 /*return*/];
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
};
|
|
216
|
+
/**
|
|
217
|
+
* Create current cart if get cart return object not found
|
|
218
|
+
*/
|
|
219
|
+
ManageCartApi.prototype.createCurrentCart = function (initOverrides) {
|
|
220
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
221
|
+
var response;
|
|
222
|
+
return __generator(this, function (_a) {
|
|
223
|
+
switch (_a.label) {
|
|
224
|
+
case 0: return [4 /*yield*/, this.createCurrentCartRaw(initOverrides)];
|
|
225
|
+
case 1:
|
|
226
|
+
response = _a.sent();
|
|
227
|
+
return [4 /*yield*/, response.value()];
|
|
228
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
};
|
|
233
|
+
/**
|
|
234
|
+
* Get current cart
|
|
235
|
+
*/
|
|
236
|
+
ManageCartApi.prototype.getCartRaw = function (requestParameters, initOverrides) {
|
|
237
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
238
|
+
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_3;
|
|
239
|
+
return __generator(this, function (_c) {
|
|
240
|
+
switch (_c.label) {
|
|
241
|
+
case 0:
|
|
242
|
+
if (requestParameters['cartId'] == null) {
|
|
243
|
+
throw new runtime.RequiredError('cartId', 'Required parameter "cartId" was null or undefined when calling getCart().');
|
|
244
|
+
}
|
|
245
|
+
queryParameters = {};
|
|
246
|
+
headerParameters = {};
|
|
247
|
+
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
248
|
+
_a = headerParameters;
|
|
249
|
+
_b = "x-api-key";
|
|
250
|
+
return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
|
|
251
|
+
case 1:
|
|
252
|
+
_a[_b] = _c.sent(); // apiKeyAuth authentication
|
|
253
|
+
_c.label = 2;
|
|
254
|
+
case 2:
|
|
255
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
|
|
256
|
+
token = this.configuration.accessToken;
|
|
257
|
+
return [4 /*yield*/, token("bearerAuth", [])];
|
|
258
|
+
case 3:
|
|
259
|
+
tokenString = _c.sent();
|
|
260
|
+
if (tokenString) {
|
|
261
|
+
headerParameters["Authorization"] = "Bearer ".concat(tokenString);
|
|
262
|
+
}
|
|
263
|
+
_c.label = 4;
|
|
264
|
+
case 4:
|
|
265
|
+
_c.trys.push([4, 6, , 7]);
|
|
266
|
+
return [4 /*yield*/, this.request({
|
|
267
|
+
path: "/carts/{cartId}".replace("{".concat("cartId", "}"), encodeURIComponent(String(requestParameters['cartId']))),
|
|
268
|
+
method: 'GET',
|
|
269
|
+
headers: headerParameters,
|
|
270
|
+
query: queryParameters,
|
|
271
|
+
}, initOverrides)];
|
|
272
|
+
case 5:
|
|
273
|
+
response = _c.sent();
|
|
274
|
+
contentType = response.headers.get("content-type");
|
|
275
|
+
if (contentType && contentType.indexOf("application/json") !== -1) {
|
|
276
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.CartFromJSON)(jsonValue); })];
|
|
277
|
+
}
|
|
278
|
+
else if (contentType && contentType.indexOf("text/plain") !== -1) {
|
|
279
|
+
return [2 /*return*/, new runtime.TextApiResponse(response)];
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
// TODO : Better handling of others application types
|
|
283
|
+
return [2 /*return*/, new runtime.BlobWithMetaApiResponse(response)];
|
|
284
|
+
}
|
|
285
|
+
return [3 /*break*/, 7];
|
|
286
|
+
case 6:
|
|
287
|
+
response_3 = _c.sent();
|
|
288
|
+
console.debug(response_3);
|
|
289
|
+
throw response_3;
|
|
290
|
+
case 7: return [2 /*return*/];
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
};
|
|
295
|
+
/**
|
|
296
|
+
* Get current cart
|
|
297
|
+
*/
|
|
298
|
+
ManageCartApi.prototype.getCart = function (requestParameters, initOverrides) {
|
|
299
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
300
|
+
var response;
|
|
301
|
+
return __generator(this, function (_a) {
|
|
302
|
+
switch (_a.label) {
|
|
303
|
+
case 0: return [4 /*yield*/, this.getCartRaw(requestParameters, initOverrides)];
|
|
304
|
+
case 1:
|
|
305
|
+
response = _a.sent();
|
|
306
|
+
return [4 /*yield*/, response.value()];
|
|
307
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
});
|
|
311
|
+
};
|
|
312
|
+
/**
|
|
313
|
+
* Get current cart
|
|
314
|
+
*/
|
|
315
|
+
ManageCartApi.prototype.getCurrentCartRaw = function (initOverrides) {
|
|
316
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
317
|
+
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_4;
|
|
318
|
+
return __generator(this, function (_c) {
|
|
319
|
+
switch (_c.label) {
|
|
320
|
+
case 0:
|
|
321
|
+
queryParameters = {};
|
|
322
|
+
headerParameters = {};
|
|
323
|
+
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
324
|
+
_a = headerParameters;
|
|
325
|
+
_b = "x-api-key";
|
|
326
|
+
return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
|
|
327
|
+
case 1:
|
|
328
|
+
_a[_b] = _c.sent(); // apiKeyAuth authentication
|
|
329
|
+
_c.label = 2;
|
|
330
|
+
case 2:
|
|
331
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
|
|
332
|
+
token = this.configuration.accessToken;
|
|
333
|
+
return [4 /*yield*/, token("bearerAuth", [])];
|
|
334
|
+
case 3:
|
|
335
|
+
tokenString = _c.sent();
|
|
336
|
+
if (tokenString) {
|
|
337
|
+
headerParameters["Authorization"] = "Bearer ".concat(tokenString);
|
|
338
|
+
}
|
|
339
|
+
_c.label = 4;
|
|
340
|
+
case 4:
|
|
341
|
+
_c.trys.push([4, 6, , 7]);
|
|
342
|
+
return [4 /*yield*/, this.request({
|
|
343
|
+
path: "/carts/me",
|
|
344
|
+
method: 'GET',
|
|
345
|
+
headers: headerParameters,
|
|
346
|
+
query: queryParameters,
|
|
347
|
+
}, initOverrides)];
|
|
348
|
+
case 5:
|
|
349
|
+
response = _c.sent();
|
|
350
|
+
contentType = response.headers.get("content-type");
|
|
351
|
+
if (contentType && contentType.indexOf("application/json") !== -1) {
|
|
352
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.CartFromJSON)(jsonValue); })];
|
|
353
|
+
}
|
|
354
|
+
else if (contentType && contentType.indexOf("text/plain") !== -1) {
|
|
355
|
+
return [2 /*return*/, new runtime.TextApiResponse(response)];
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
// TODO : Better handling of others application types
|
|
359
|
+
return [2 /*return*/, new runtime.BlobWithMetaApiResponse(response)];
|
|
360
|
+
}
|
|
361
|
+
return [3 /*break*/, 7];
|
|
362
|
+
case 6:
|
|
363
|
+
response_4 = _c.sent();
|
|
364
|
+
console.debug(response_4);
|
|
365
|
+
throw response_4;
|
|
366
|
+
case 7: return [2 /*return*/];
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
});
|
|
370
|
+
};
|
|
371
|
+
/**
|
|
372
|
+
* Get current cart
|
|
373
|
+
*/
|
|
374
|
+
ManageCartApi.prototype.getCurrentCart = function (initOverrides) {
|
|
375
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
376
|
+
var response;
|
|
377
|
+
return __generator(this, function (_a) {
|
|
378
|
+
switch (_a.label) {
|
|
379
|
+
case 0: return [4 /*yield*/, this.getCurrentCartRaw(initOverrides)];
|
|
380
|
+
case 1:
|
|
381
|
+
response = _a.sent();
|
|
382
|
+
return [4 /*yield*/, response.value()];
|
|
383
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
});
|
|
387
|
+
};
|
|
161
388
|
return ManageCartApi;
|
|
162
389
|
}(runtime.BaseAPI));
|
|
163
390
|
exports.ManageCartApi = ManageCartApi;
|