@arrowsphere/api-client 3.135.0 → 3.136.0-rc.bdj.1
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/build/quotes/entities/PutQuoteResult.d.ts +19 -0
- package/build/quotes/entities/PutQuoteResult.js +52 -0
- package/build/quotes/quotesClient.d.ts +38 -2
- package/build/quotes/quotesClient.js +10 -2
- package/package.json +1 -1
- package/build/quotes/entities/ValidateQuoteResult.d.ts +0 -19
- package/build/quotes/entities/ValidateQuoteResult.js +0 -52
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AbstractEntity } from '../../abstractEntity';
|
|
2
|
+
export declare enum PutQuoteResultFields {
|
|
3
|
+
COLUMN_LINK = "link",
|
|
4
|
+
COLUMN_REFERENCE = "reference",
|
|
5
|
+
COLUMN_STATUS = "status"
|
|
6
|
+
}
|
|
7
|
+
export declare type PutQuoteResultType = {
|
|
8
|
+
[PutQuoteResultFields.COLUMN_LINK]: string;
|
|
9
|
+
[PutQuoteResultFields.COLUMN_REFERENCE]: string;
|
|
10
|
+
[PutQuoteResultFields.COLUMN_STATUS]: string;
|
|
11
|
+
};
|
|
12
|
+
export declare class PutQuoteResult extends AbstractEntity<PutQuoteResultType> {
|
|
13
|
+
#private;
|
|
14
|
+
constructor(quoteRequestResponse: PutQuoteResultType);
|
|
15
|
+
get link(): string;
|
|
16
|
+
get reference(): string;
|
|
17
|
+
get status(): string;
|
|
18
|
+
toJSON(): PutQuoteResultType;
|
|
19
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
+
};
|
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
+
};
|
|
13
|
+
var _PutQuoteResult_link, _PutQuoteResult_reference, _PutQuoteResult_status;
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.PutQuoteResult = exports.PutQuoteResultFields = void 0;
|
|
16
|
+
const abstractEntity_1 = require("../../abstractEntity");
|
|
17
|
+
var PutQuoteResultFields;
|
|
18
|
+
(function (PutQuoteResultFields) {
|
|
19
|
+
PutQuoteResultFields["COLUMN_LINK"] = "link";
|
|
20
|
+
PutQuoteResultFields["COLUMN_REFERENCE"] = "reference";
|
|
21
|
+
PutQuoteResultFields["COLUMN_STATUS"] = "status";
|
|
22
|
+
})(PutQuoteResultFields = exports.PutQuoteResultFields || (exports.PutQuoteResultFields = {}));
|
|
23
|
+
class PutQuoteResult extends abstractEntity_1.AbstractEntity {
|
|
24
|
+
constructor(quoteRequestResponse) {
|
|
25
|
+
super(quoteRequestResponse);
|
|
26
|
+
_PutQuoteResult_link.set(this, void 0);
|
|
27
|
+
_PutQuoteResult_reference.set(this, void 0);
|
|
28
|
+
_PutQuoteResult_status.set(this, void 0);
|
|
29
|
+
__classPrivateFieldSet(this, _PutQuoteResult_link, quoteRequestResponse[PutQuoteResultFields.COLUMN_LINK], "f");
|
|
30
|
+
__classPrivateFieldSet(this, _PutQuoteResult_status, quoteRequestResponse[PutQuoteResultFields.COLUMN_STATUS], "f");
|
|
31
|
+
__classPrivateFieldSet(this, _PutQuoteResult_reference, quoteRequestResponse[PutQuoteResultFields.COLUMN_REFERENCE], "f");
|
|
32
|
+
}
|
|
33
|
+
get link() {
|
|
34
|
+
return __classPrivateFieldGet(this, _PutQuoteResult_link, "f");
|
|
35
|
+
}
|
|
36
|
+
get reference() {
|
|
37
|
+
return __classPrivateFieldGet(this, _PutQuoteResult_reference, "f");
|
|
38
|
+
}
|
|
39
|
+
get status() {
|
|
40
|
+
return __classPrivateFieldGet(this, _PutQuoteResult_status, "f");
|
|
41
|
+
}
|
|
42
|
+
toJSON() {
|
|
43
|
+
return {
|
|
44
|
+
[PutQuoteResultFields.COLUMN_LINK]: this.link,
|
|
45
|
+
[PutQuoteResultFields.COLUMN_REFERENCE]: this.reference,
|
|
46
|
+
[PutQuoteResultFields.COLUMN_STATUS]: this.status,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.PutQuoteResult = PutQuoteResult;
|
|
51
|
+
_PutQuoteResult_link = new WeakMap(), _PutQuoteResult_reference = new WeakMap(), _PutQuoteResult_status = new WeakMap();
|
|
52
|
+
//# sourceMappingURL=PutQuoteResult.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AbstractRestfulClient, Parameters } from '../abstractRestfulClient';
|
|
2
2
|
import { GetResult } from '../getResult';
|
|
3
3
|
import { QuoteRequest } from './entities/QuoteRequest';
|
|
4
|
-
import {
|
|
4
|
+
import { PutQuoteResult } from './entities/PutQuoteResult';
|
|
5
5
|
export declare type RequestQuoteRequestType = {
|
|
6
6
|
agreeToReceiveCommunications: boolean;
|
|
7
7
|
agreeSharingInformation: boolean;
|
|
@@ -19,10 +19,46 @@ export declare type RequestQuoteIbmRequestType = {
|
|
|
19
19
|
endCustomerRef?: string;
|
|
20
20
|
reference?: string;
|
|
21
21
|
};
|
|
22
|
+
declare type QuoteCustomerType = {
|
|
23
|
+
reference: string;
|
|
24
|
+
};
|
|
25
|
+
declare type QuoteRateType = {
|
|
26
|
+
rateType: 'discount' | 'uplift';
|
|
27
|
+
value: number;
|
|
28
|
+
};
|
|
29
|
+
declare type QuoteCustomerPricesType = {
|
|
30
|
+
rate: QuoteRateType;
|
|
31
|
+
value: number;
|
|
32
|
+
};
|
|
33
|
+
declare type QuoteArrowPricesType = {
|
|
34
|
+
value: number;
|
|
35
|
+
};
|
|
36
|
+
declare type QuotePricesType = {
|
|
37
|
+
customer: QuoteCustomerPricesType;
|
|
38
|
+
partner?: QuoteCustomerPricesType;
|
|
39
|
+
arrow?: QuoteArrowPricesType;
|
|
40
|
+
};
|
|
41
|
+
declare type QuoteItemType = {
|
|
42
|
+
arrowSpherePriceBandSku: string;
|
|
43
|
+
quantity: number;
|
|
44
|
+
prices?: QuotePricesType;
|
|
45
|
+
};
|
|
46
|
+
export declare type PublishQuoteRequestType = {
|
|
47
|
+
customer?: QuoteCustomerType;
|
|
48
|
+
items: QuoteItemType[];
|
|
49
|
+
};
|
|
50
|
+
export declare type CreateQuoteRequestType = {
|
|
51
|
+
customer?: QuoteCustomerType;
|
|
52
|
+
items: QuoteItemType[];
|
|
53
|
+
promotionCode?: string;
|
|
54
|
+
};
|
|
22
55
|
export declare class QuotesClient extends AbstractRestfulClient {
|
|
23
56
|
protected basePath: string;
|
|
24
57
|
requestQuote(postData: RequestQuoteRequestType, parameters?: Parameters): Promise<GetResult<QuoteRequest>>;
|
|
25
58
|
requestQuoteForVendor(vendor: string, postData: RequestQuoteIbmRequestType, parameters?: Parameters): Promise<void>;
|
|
26
59
|
deleteQuote(quoteReference: string, parameters?: Parameters): Promise<void>;
|
|
27
|
-
validateQuote(quoteReference: string, parameters?: Parameters): Promise<GetResult<
|
|
60
|
+
validateQuote(quoteReference: string, parameters?: Parameters): Promise<GetResult<PutQuoteResult>>;
|
|
61
|
+
createQuote(postData: CreateQuoteRequestType, parameters?: Parameters): Promise<GetResult<PutQuoteResult>>;
|
|
62
|
+
publishQuote(quoteReference: string, postData: PublishQuoteRequestType, parameters?: Parameters): Promise<GetResult<PutQuoteResult>>;
|
|
28
63
|
}
|
|
64
|
+
export {};
|
|
@@ -4,7 +4,7 @@ exports.QuotesClient = void 0;
|
|
|
4
4
|
const abstractRestfulClient_1 = require("../abstractRestfulClient");
|
|
5
5
|
const getResult_1 = require("../getResult");
|
|
6
6
|
const QuoteRequest_1 = require("./entities/QuoteRequest");
|
|
7
|
-
const
|
|
7
|
+
const PutQuoteResult_1 = require("./entities/PutQuoteResult");
|
|
8
8
|
class QuotesClient extends abstractRestfulClient_1.AbstractRestfulClient {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
@@ -24,7 +24,15 @@ class QuotesClient extends abstractRestfulClient_1.AbstractRestfulClient {
|
|
|
24
24
|
}
|
|
25
25
|
async validateQuote(quoteReference, parameters = {}) {
|
|
26
26
|
this.path = `/request/${quoteReference}/validate`;
|
|
27
|
-
return new getResult_1.GetResult(
|
|
27
|
+
return new getResult_1.GetResult(PutQuoteResult_1.PutQuoteResult, await this.get(parameters));
|
|
28
|
+
}
|
|
29
|
+
async createQuote(postData, parameters = {}) {
|
|
30
|
+
this.path = '';
|
|
31
|
+
return new getResult_1.GetResult(PutQuoteResult_1.PutQuoteResult, await this.post(postData, parameters));
|
|
32
|
+
}
|
|
33
|
+
async publishQuote(quoteReference, postData, parameters = {}) {
|
|
34
|
+
this.path = `/request/${quoteReference}/publish`;
|
|
35
|
+
return new getResult_1.GetResult(PutQuoteResult_1.PutQuoteResult, await this.post(postData, parameters));
|
|
28
36
|
}
|
|
29
37
|
}
|
|
30
38
|
exports.QuotesClient = QuotesClient;
|
package/package.json
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AbstractEntity } from '../../abstractEntity';
|
|
2
|
-
export declare enum ValidateQuoteResultFields {
|
|
3
|
-
COLUMN_LINK = "link",
|
|
4
|
-
COLUMN_REFERENCE = "reference",
|
|
5
|
-
COLUMN_STATUS = "status"
|
|
6
|
-
}
|
|
7
|
-
export declare type ValidateQuoteResultType = {
|
|
8
|
-
[ValidateQuoteResultFields.COLUMN_LINK]: string;
|
|
9
|
-
[ValidateQuoteResultFields.COLUMN_REFERENCE]: string;
|
|
10
|
-
[ValidateQuoteResultFields.COLUMN_STATUS]: string;
|
|
11
|
-
};
|
|
12
|
-
export declare class ValidateQuoteResult extends AbstractEntity<ValidateQuoteResultType> {
|
|
13
|
-
#private;
|
|
14
|
-
constructor(quoteRequestResponse: ValidateQuoteResultType);
|
|
15
|
-
get link(): string;
|
|
16
|
-
get reference(): string;
|
|
17
|
-
get status(): string;
|
|
18
|
-
toJSON(): ValidateQuoteResultType;
|
|
19
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
-
};
|
|
8
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
-
};
|
|
13
|
-
var _ValidateQuoteResult_link, _ValidateQuoteResult_reference, _ValidateQuoteResult_status;
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.ValidateQuoteResult = exports.ValidateQuoteResultFields = void 0;
|
|
16
|
-
const abstractEntity_1 = require("../../abstractEntity");
|
|
17
|
-
var ValidateQuoteResultFields;
|
|
18
|
-
(function (ValidateQuoteResultFields) {
|
|
19
|
-
ValidateQuoteResultFields["COLUMN_LINK"] = "link";
|
|
20
|
-
ValidateQuoteResultFields["COLUMN_REFERENCE"] = "reference";
|
|
21
|
-
ValidateQuoteResultFields["COLUMN_STATUS"] = "status";
|
|
22
|
-
})(ValidateQuoteResultFields = exports.ValidateQuoteResultFields || (exports.ValidateQuoteResultFields = {}));
|
|
23
|
-
class ValidateQuoteResult extends abstractEntity_1.AbstractEntity {
|
|
24
|
-
constructor(quoteRequestResponse) {
|
|
25
|
-
super(quoteRequestResponse);
|
|
26
|
-
_ValidateQuoteResult_link.set(this, void 0);
|
|
27
|
-
_ValidateQuoteResult_reference.set(this, void 0);
|
|
28
|
-
_ValidateQuoteResult_status.set(this, void 0);
|
|
29
|
-
__classPrivateFieldSet(this, _ValidateQuoteResult_link, quoteRequestResponse[ValidateQuoteResultFields.COLUMN_LINK], "f");
|
|
30
|
-
__classPrivateFieldSet(this, _ValidateQuoteResult_status, quoteRequestResponse[ValidateQuoteResultFields.COLUMN_STATUS], "f");
|
|
31
|
-
__classPrivateFieldSet(this, _ValidateQuoteResult_reference, quoteRequestResponse[ValidateQuoteResultFields.COLUMN_REFERENCE], "f");
|
|
32
|
-
}
|
|
33
|
-
get link() {
|
|
34
|
-
return __classPrivateFieldGet(this, _ValidateQuoteResult_link, "f");
|
|
35
|
-
}
|
|
36
|
-
get reference() {
|
|
37
|
-
return __classPrivateFieldGet(this, _ValidateQuoteResult_reference, "f");
|
|
38
|
-
}
|
|
39
|
-
get status() {
|
|
40
|
-
return __classPrivateFieldGet(this, _ValidateQuoteResult_status, "f");
|
|
41
|
-
}
|
|
42
|
-
toJSON() {
|
|
43
|
-
return {
|
|
44
|
-
[ValidateQuoteResultFields.COLUMN_LINK]: this.link,
|
|
45
|
-
[ValidateQuoteResultFields.COLUMN_REFERENCE]: this.reference,
|
|
46
|
-
[ValidateQuoteResultFields.COLUMN_STATUS]: this.status,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
exports.ValidateQuoteResult = ValidateQuoteResult;
|
|
51
|
-
_ValidateQuoteResult_link = new WeakMap(), _ValidateQuoteResult_reference = new WeakMap(), _ValidateQuoteResult_status = new WeakMap();
|
|
52
|
-
//# sourceMappingURL=ValidateQuoteResult.js.map
|