@arrowsphere/api-client 3.40.0-rc.bdj.1 → 3.40.0
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/CHANGELOG.md +11 -0
- package/build/catalog/catalogGraphQLClient.d.ts +9 -2
- package/build/catalog/catalogGraphQLClient.js +48 -0
- package/build/catalog/types/FindOneProductQueryOutput.d.ts +7 -0
- package/build/catalog/types/FindOneProductQueryOutput.js +3 -0
- package/build/catalog/types/catalogGraphQLQueries.d.ts +22 -3
- package/build/catalog/types/catalogGraphQLSchemas.d.ts +4 -2
- package/build/catalog/types/catalogGraphQLTypes.d.ts +41 -2
- package/build/catalog/types/queryProductArguments.d.ts +62 -0
- package/build/catalog/types/{queryArguments.js → queryProductArguments.js} +1 -1
- package/package.json +1 -1
- package/build/catalog/types/queryArguments.d.ts +0 -41
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
4
4
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
5
5
|
|
|
6
|
+
## [3.40.0] - 2023-06-22
|
|
7
|
+
|
|
8
|
+
### Changed
|
|
9
|
+
|
|
10
|
+
- Add Query GetAdminData for Security Score
|
|
11
|
+
- Rename SearchFilterArgument to avoid name collision
|
|
12
|
+
- Refactor find products by query
|
|
13
|
+
- Add find one priceBand by query
|
|
14
|
+
- Add find one product by query
|
|
15
|
+
- Add fetch promotions
|
|
16
|
+
|
|
6
17
|
## [3.39.0] - 2023-06-20
|
|
7
18
|
|
|
8
19
|
### Changed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AbstractGraphQLClient } from '../abstractGraphQLClient';
|
|
2
|
-
import { GetProductsType } from './types/catalogGraphQLTypes';
|
|
3
|
-
import { CatalogQuery } from './types/catalogGraphQLQueries';
|
|
2
|
+
import { GetPriceBandType, GetProductsType, GetProductType } from './types/catalogGraphQLTypes';
|
|
3
|
+
import { CatalogQueries, CatalogQuery } from './types/catalogGraphQLQueries';
|
|
4
4
|
export declare class CatalogGraphQLClient extends AbstractGraphQLClient {
|
|
5
5
|
/**
|
|
6
6
|
* The base path of the API
|
|
@@ -11,5 +11,12 @@ export declare class CatalogGraphQLClient extends AbstractGraphQLClient {
|
|
|
11
11
|
*/
|
|
12
12
|
private GRAPHQL;
|
|
13
13
|
find(request: string): Promise<GetProductsType>;
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated
|
|
16
|
+
* Prefer using findProductsByQuery instead.
|
|
17
|
+
*/
|
|
14
18
|
findByQuery(query: CatalogQuery): Promise<GetProductsType | null>;
|
|
19
|
+
findProductsByQuery(query: Pick<CatalogQueries, 'getProducts'>): Promise<GetProductsType | null>;
|
|
20
|
+
findOneProductByQuery(query: Pick<CatalogQueries, 'product'>): Promise<GetProductType | null>;
|
|
21
|
+
findOnePriceBandByQuery(query: Pick<CatalogQueries, 'priceBand'>): Promise<GetPriceBandType | null>;
|
|
15
22
|
}
|
|
@@ -18,6 +18,10 @@ class CatalogGraphQLClient extends abstractGraphQLClient_1.AbstractGraphQLClient
|
|
|
18
18
|
this.path = this.GRAPHQL;
|
|
19
19
|
return await this.post(request);
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated
|
|
23
|
+
* Prefer using findProductsByQuery instead.
|
|
24
|
+
*/
|
|
21
25
|
async findByQuery(query) {
|
|
22
26
|
const queryStr = this.stringifyQuery(query);
|
|
23
27
|
try {
|
|
@@ -32,6 +36,50 @@ class CatalogGraphQLClient extends abstractGraphQLClient_1.AbstractGraphQLClient
|
|
|
32
36
|
}
|
|
33
37
|
return null;
|
|
34
38
|
}
|
|
39
|
+
async findProductsByQuery(query) {
|
|
40
|
+
const queryStr = this.stringifyQuery(query);
|
|
41
|
+
try {
|
|
42
|
+
return await this.find(queryStr);
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
const exception = this.mapToPublicApiException(error);
|
|
46
|
+
const { mustRetry } = await this.handleError(exception);
|
|
47
|
+
if (mustRetry) {
|
|
48
|
+
return await this.find(queryStr);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
async findOneProductByQuery(query) {
|
|
54
|
+
this.path = this.GRAPHQL;
|
|
55
|
+
const queryStr = this.stringifyQuery(query);
|
|
56
|
+
try {
|
|
57
|
+
return await this.post(queryStr);
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
const exception = this.mapToPublicApiException(error);
|
|
61
|
+
const { mustRetry } = await this.handleError(exception);
|
|
62
|
+
if (mustRetry) {
|
|
63
|
+
return await this.post(queryStr);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
async findOnePriceBandByQuery(query) {
|
|
69
|
+
this.path = this.GRAPHQL;
|
|
70
|
+
const queryStr = this.stringifyQuery(query);
|
|
71
|
+
try {
|
|
72
|
+
return await this.post(queryStr);
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
const exception = this.mapToPublicApiException(error);
|
|
76
|
+
const { mustRetry } = await this.handleError(exception);
|
|
77
|
+
if (mustRetry) {
|
|
78
|
+
return await this.post(queryStr);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
35
83
|
}
|
|
36
84
|
exports.CatalogGraphQLClient = CatalogGraphQLClient;
|
|
37
85
|
//# sourceMappingURL=catalogGraphQLClient.js.map
|
|
@@ -1,12 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { FiltersSchema, PaginationSchema, ProductSchema } from './catalogGraphQLSchemas';
|
|
1
|
+
import { QueryPriceBandArguments, QueryProductArguments } from './queryProductArguments';
|
|
2
|
+
import { FiltersSchema, PaginationSchema, PriceBandSchema, ProductSchema } from './catalogGraphQLSchemas';
|
|
3
|
+
import { Merge } from 'type-fest';
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated
|
|
6
|
+
* Prefer using CatalogQueries instead.
|
|
7
|
+
*/
|
|
3
8
|
export declare type CatalogQuery = {
|
|
4
9
|
getProducts: GetPaginatedProductsQuery;
|
|
5
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* Represent the Catalog Schema of Public API
|
|
13
|
+
*/
|
|
14
|
+
export declare type CatalogQueries = {
|
|
15
|
+
getProducts?: GetPaginatedProductsQuery;
|
|
16
|
+
priceBand?: GetPriceBandQuery;
|
|
17
|
+
product?: GetProductQuery;
|
|
18
|
+
};
|
|
6
19
|
export declare type GetPaginatedProductsQuery = {
|
|
7
|
-
__args:
|
|
20
|
+
__args: QueryProductArguments;
|
|
8
21
|
filters?: FiltersSchema;
|
|
9
22
|
pagination?: PaginationSchema;
|
|
10
23
|
products?: ProductSchema;
|
|
11
24
|
topOffers?: ProductSchema;
|
|
12
25
|
};
|
|
26
|
+
export declare type GetProductQuery = Merge<{
|
|
27
|
+
__args: QueryProductArguments;
|
|
28
|
+
}, ProductSchema>;
|
|
29
|
+
export declare type GetPriceBandQuery = Merge<{
|
|
30
|
+
__args: QueryPriceBandArguments;
|
|
31
|
+
}, PriceBandSchema>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { AttributeType, FiltersType, IdentifiersType, PaginationType, PriceBandType, PricesType, ProductType, RelatedOfferType } from './catalogGraphQLTypes';
|
|
1
|
+
import { AttributeType, FiltersType, IdentifiersType, PaginationType, PriceBandType, PricesType, ProductType, PromotionType, RelatedOfferType } from './catalogGraphQLTypes';
|
|
2
2
|
import { Merge, Schema } from 'type-fest';
|
|
3
3
|
export declare type PaginationSchema = Schema<PaginationType, boolean>;
|
|
4
4
|
export declare type FiltersSchema = Schema<FiltersType, boolean>;
|
|
5
5
|
declare type IdentifiersSchema = Schema<IdentifiersType, boolean>;
|
|
6
6
|
declare type RelatedOfferSchema = Schema<RelatedOfferType, boolean>;
|
|
7
|
+
declare type PromotionSchema = Schema<PromotionType, boolean>;
|
|
7
8
|
/**
|
|
8
9
|
* Field of type array are not handled by Schema, they must be overwritten
|
|
9
10
|
*/
|
|
@@ -13,6 +14,7 @@ declare type MissingFieldsOfProductSchema = {
|
|
|
13
14
|
conversionOfferPrimaries?: IdentifiersSchema;
|
|
14
15
|
relatedOffers?: RelatedOfferSchema;
|
|
15
16
|
priceBand?: PriceBandSchema;
|
|
17
|
+
promotions?: PromotionSchema;
|
|
16
18
|
};
|
|
17
19
|
export declare type ProductSchema = Merge<Schema<ProductType, boolean>, MissingFieldsOfProductSchema>;
|
|
18
20
|
declare type AttributeSchema = Schema<AttributeType, boolean>;
|
|
@@ -20,7 +22,7 @@ declare type AttributeSchema = Schema<AttributeType, boolean>;
|
|
|
20
22
|
* Field of type array are not handled by Schema, they must be overwritten
|
|
21
23
|
*/
|
|
22
24
|
declare type MissingFieldsOfPriceBandSchema = {
|
|
23
|
-
attributes?:
|
|
25
|
+
attributes?: AttributeSchema;
|
|
24
26
|
};
|
|
25
27
|
/**
|
|
26
28
|
* No type corresponding
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
export declare type GetProductsType = {
|
|
2
2
|
getProducts?: PaginatedProductsType;
|
|
3
3
|
};
|
|
4
|
+
export declare type GetProductType = {
|
|
5
|
+
product?: ProductType;
|
|
6
|
+
};
|
|
7
|
+
export declare type GetPriceBandType = {
|
|
8
|
+
priceBand?: PriceBandType;
|
|
9
|
+
};
|
|
4
10
|
export declare type PaginatedProductsType = {
|
|
5
11
|
filters?: Array<FiltersType>;
|
|
6
12
|
pagination?: PaginationType;
|
|
@@ -40,6 +46,7 @@ export declare type ProductType = {
|
|
|
40
46
|
baseOfferPrimaries?: Array<IdentifiersType>;
|
|
41
47
|
assets?: AssetsType;
|
|
42
48
|
environmentAvailability?: string;
|
|
49
|
+
promotions?: Array<PromotionType>;
|
|
43
50
|
marketplace?: string;
|
|
44
51
|
isEnabled?: boolean;
|
|
45
52
|
isTrial?: boolean;
|
|
@@ -153,6 +160,8 @@ export declare type PriceBandType = {
|
|
|
153
160
|
prices?: PricesType;
|
|
154
161
|
saleConstraints?: PriceBandSaleConstraintsType;
|
|
155
162
|
uom?: UomType;
|
|
163
|
+
promotionPrices?: PromotionPricesType;
|
|
164
|
+
vendor?: VendorType;
|
|
156
165
|
};
|
|
157
166
|
export declare type PriceBandActionFlagsType = {
|
|
158
167
|
canBeCancelled?: boolean;
|
|
@@ -171,10 +180,10 @@ export declare type BillingType = {
|
|
|
171
180
|
type?: string;
|
|
172
181
|
};
|
|
173
182
|
export declare type DynamicAttributesType = {
|
|
174
|
-
diskSize?: string;
|
|
175
|
-
ram?: string;
|
|
176
183
|
region?: string;
|
|
177
184
|
vCpu?: string;
|
|
185
|
+
ram?: string;
|
|
186
|
+
diskSize?: string;
|
|
178
187
|
reservationsAutofitGroup?: string;
|
|
179
188
|
acu?: string;
|
|
180
189
|
marketSegment?: string;
|
|
@@ -200,6 +209,7 @@ export declare type PricesType = {
|
|
|
200
209
|
buy?: string;
|
|
201
210
|
sell?: string;
|
|
202
211
|
public?: string;
|
|
212
|
+
vendorPricingSource?: VendorPricingSourceType;
|
|
203
213
|
};
|
|
204
214
|
export declare type PriceBandSaleConstraintsType = {
|
|
205
215
|
availableDate?: string;
|
|
@@ -222,3 +232,32 @@ export declare type OfferResellersType = {
|
|
|
222
232
|
export declare type ResellerType = {
|
|
223
233
|
xspRef?: string;
|
|
224
234
|
};
|
|
235
|
+
export declare type PromotionPricesType = {
|
|
236
|
+
promotionId?: string;
|
|
237
|
+
prices?: PricesType;
|
|
238
|
+
};
|
|
239
|
+
export declare type VendorPricingSourceType = {
|
|
240
|
+
currency?: string;
|
|
241
|
+
changeRate?: number;
|
|
242
|
+
prices?: PricesType;
|
|
243
|
+
};
|
|
244
|
+
export declare type PromotionType = {
|
|
245
|
+
promotionId?: string;
|
|
246
|
+
vendorSku?: string;
|
|
247
|
+
marketplace?: string;
|
|
248
|
+
name?: string;
|
|
249
|
+
description?: string;
|
|
250
|
+
isAutoApplicable?: boolean;
|
|
251
|
+
startDate?: string;
|
|
252
|
+
endDate?: string;
|
|
253
|
+
promotionType?: string;
|
|
254
|
+
pricingType?: string;
|
|
255
|
+
pricingValue?: number;
|
|
256
|
+
billing?: BillingType;
|
|
257
|
+
minQuantity?: number;
|
|
258
|
+
maxQuantity?: number;
|
|
259
|
+
currency?: string;
|
|
260
|
+
applicableUntil?: string;
|
|
261
|
+
applicableFor?: number;
|
|
262
|
+
checkEligibility?: boolean;
|
|
263
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* For field __args
|
|
3
|
+
*/
|
|
4
|
+
export declare type QueryProductArguments = {
|
|
5
|
+
paginate?: PaginateArgument;
|
|
6
|
+
searchBody: SearchBodyArgument;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* For field __args
|
|
10
|
+
*/
|
|
11
|
+
export declare type QueryPriceBandArguments = {
|
|
12
|
+
paginate?: PaginateArgument;
|
|
13
|
+
searchBody: SearchBodyPriceBandsArgument;
|
|
14
|
+
};
|
|
15
|
+
export declare type PaginateArgument = {
|
|
16
|
+
page: number;
|
|
17
|
+
perPage: number;
|
|
18
|
+
};
|
|
19
|
+
export declare type SearchBodyPriceBandsArgument = {
|
|
20
|
+
keywords?: string;
|
|
21
|
+
filters?: SearchProductFilterArgument[];
|
|
22
|
+
exclusionFilters?: SearchProductFilterArgument[];
|
|
23
|
+
sort?: SortArgument;
|
|
24
|
+
highlight?: boolean;
|
|
25
|
+
aggregatorFilter?: string[];
|
|
26
|
+
marketplace?: string;
|
|
27
|
+
resellerRef?: string;
|
|
28
|
+
endCustomerRef?: string;
|
|
29
|
+
restricted?: boolean;
|
|
30
|
+
getFamilies?: boolean;
|
|
31
|
+
quantity?: number;
|
|
32
|
+
};
|
|
33
|
+
export declare type SearchBodyArgument = {
|
|
34
|
+
aggregatorFilter?: string[];
|
|
35
|
+
endCustomerRef?: string;
|
|
36
|
+
exclusionFilters?: SearchProductFilterArgument[];
|
|
37
|
+
filters?: SearchProductFilterArgument[];
|
|
38
|
+
getFamilies?: boolean;
|
|
39
|
+
highlight?: boolean;
|
|
40
|
+
keywords?: string;
|
|
41
|
+
marketplace?: string;
|
|
42
|
+
quantity?: number;
|
|
43
|
+
resellerRef?: string;
|
|
44
|
+
restricted?: boolean;
|
|
45
|
+
sort?: SortArgument;
|
|
46
|
+
topOffers?: boolean;
|
|
47
|
+
};
|
|
48
|
+
export declare type SearchProductFilterArgument = {
|
|
49
|
+
name: string;
|
|
50
|
+
value: string | string[];
|
|
51
|
+
operator?: OperatorArgument;
|
|
52
|
+
filters?: SearchProductFilterArgument[];
|
|
53
|
+
};
|
|
54
|
+
export declare enum OperatorArgument {
|
|
55
|
+
OR = "OR",
|
|
56
|
+
AND = "AND",
|
|
57
|
+
BETWEEN = "BETWEEN"
|
|
58
|
+
}
|
|
59
|
+
export declare type SortArgument = {
|
|
60
|
+
name?: string;
|
|
61
|
+
order?: string;
|
|
62
|
+
};
|
|
@@ -7,4 +7,4 @@ var OperatorArgument;
|
|
|
7
7
|
OperatorArgument["AND"] = "AND";
|
|
8
8
|
OperatorArgument["BETWEEN"] = "BETWEEN";
|
|
9
9
|
})(OperatorArgument = exports.OperatorArgument || (exports.OperatorArgument = {}));
|
|
10
|
-
//# sourceMappingURL=
|
|
10
|
+
//# sourceMappingURL=queryProductArguments.js.map
|
package/package.json
CHANGED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* For field __args
|
|
3
|
-
*/
|
|
4
|
-
export declare type QueryArguments = {
|
|
5
|
-
paginate?: PaginateArgument;
|
|
6
|
-
searchBody: SearchBodyArgument;
|
|
7
|
-
};
|
|
8
|
-
export declare type PaginateArgument = {
|
|
9
|
-
page: number;
|
|
10
|
-
perPage: number;
|
|
11
|
-
};
|
|
12
|
-
export declare type SearchBodyArgument = {
|
|
13
|
-
aggregatorFilter?: string[];
|
|
14
|
-
endCustomerRef?: string;
|
|
15
|
-
exclusionFilters?: SearchFilterArgument[];
|
|
16
|
-
filters?: SearchFilterArgument[];
|
|
17
|
-
getFamilies?: boolean;
|
|
18
|
-
highlight?: boolean;
|
|
19
|
-
keywords?: string;
|
|
20
|
-
marketplace?: string;
|
|
21
|
-
quantity?: number;
|
|
22
|
-
resellerRef?: string;
|
|
23
|
-
restricted?: boolean;
|
|
24
|
-
sort?: SortArgument;
|
|
25
|
-
topOffers?: boolean;
|
|
26
|
-
};
|
|
27
|
-
export declare type SearchFilterArgument = {
|
|
28
|
-
name: string;
|
|
29
|
-
value: string | string[];
|
|
30
|
-
operator?: OperatorArgument;
|
|
31
|
-
filters?: SearchFilterArgument[];
|
|
32
|
-
};
|
|
33
|
-
export declare enum OperatorArgument {
|
|
34
|
-
OR = "OR",
|
|
35
|
-
AND = "AND",
|
|
36
|
-
BETWEEN = "BETWEEN"
|
|
37
|
-
}
|
|
38
|
-
export declare type SortArgument = {
|
|
39
|
-
name?: string;
|
|
40
|
-
order?: string;
|
|
41
|
-
};
|