@arrowsphere/api-client 3.36.1-rc.fdi.2 → 3.36.1-rc.jpb.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/CHANGELOG.md CHANGED
@@ -3,12 +3,6 @@
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.36.1] - 2023-06-12
7
-
8
- ### Changed
9
-
10
- - Fix path for notification Endpoint
11
-
12
6
  ## [3.36.0] - 2023-06-09
13
7
 
14
8
  ### 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
+ * @param query
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
+ * @param query
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
@@ -0,0 +1,7 @@
1
+ import { PriceBandType, ProductType } from './catalogGraphQLTypes';
2
+ export declare type FindOneProductQueryOutput = {
3
+ product: ProductType;
4
+ };
5
+ export declare type FindOnePriceBandQueryOutput = {
6
+ priceBand: PriceBandType;
7
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=FindOneProductQueryOutput.js.map
@@ -1,12 +1,30 @@
1
- import { QueryArguments } from './queryArguments';
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
+ */
3
7
  export declare type CatalogQuery = {
4
8
  getProducts: GetPaginatedProductsQuery;
5
9
  };
10
+ /**
11
+ * Represent the Catalog Schema of Public API
12
+ */
13
+ export declare type CatalogQueries = {
14
+ getProducts?: GetPaginatedProductsQuery;
15
+ priceBand?: GetPriceBandQuery;
16
+ product?: GetProductQuery;
17
+ };
6
18
  export declare type GetPaginatedProductsQuery = {
7
- __args: QueryArguments;
19
+ __args: QueryProductArguments;
8
20
  filters?: FiltersSchema;
9
21
  pagination?: PaginationSchema;
10
22
  products?: ProductSchema;
11
23
  topOffers?: ProductSchema;
12
24
  };
25
+ export declare type GetProductQuery = Merge<{
26
+ __args: QueryProductArguments;
27
+ }, ProductSchema>;
28
+ export declare type GetPriceBandQuery = Merge<{
29
+ __args: QueryPriceBandArguments;
30
+ }, 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?: Array<AttributeSchema>;
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;
@@ -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
+ };
@@ -1,14 +1,35 @@
1
1
  /**
2
2
  * For field __args
3
3
  */
4
- export declare type QueryArguments = {
4
+ export declare type QueryProductArguments = {
5
5
  paginate?: PaginateArgument;
6
6
  searchBody: SearchBodyArgument;
7
7
  };
8
+ /**
9
+ * For field __args
10
+ */
11
+ export declare type QueryPriceBandArguments = {
12
+ paginate?: PaginateArgument;
13
+ searchBody: SearchBodyPriceBandsArgument;
14
+ };
8
15
  export declare type PaginateArgument = {
9
16
  page: number;
10
17
  perPage: number;
11
18
  };
19
+ export declare type SearchBodyPriceBandsArgument = {
20
+ keywords?: string;
21
+ filters?: SearchFilterArgument[];
22
+ exclusionFilters?: SearchFilterArgument[];
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
+ };
12
33
  export declare type SearchBodyArgument = {
13
34
  aggregatorFilter?: string[];
14
35
  endCustomerRef?: string;
@@ -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=queryArguments.js.map
10
+ //# sourceMappingURL=queryProductArguments.js.map
@@ -1,6 +1,7 @@
1
1
  import { AbstractRestfulClient, Parameters, ParametersWithPaginationType, Payload } from '../abstractRestfulClient';
2
2
  import { GetResult } from '../getResult';
3
3
  import { Notifications } from './entities/notifications';
4
+ import { Notification } from './entities/notification';
4
5
  import { Total } from './entities/total';
5
6
  export declare enum ListParametersFields {
6
7
  COLUMN_CREATED = "created",
@@ -29,7 +30,7 @@ export declare class NotificationsClient extends AbstractRestfulClient {
29
30
  protected basePath: string;
30
31
  list(parameters?: ListParametersType): Promise<GetResult<Notifications>>;
31
32
  deleteAll(parameters?: Parameters): Promise<void>;
32
- getOne(notificationId: string, parameters?: Parameters): Promise<GetResult<Notifications>>;
33
+ getOne(notificationId: string, parameters?: Parameters): Promise<GetResult<Notification>>;
33
34
  deleteOne(notificationId: string, parameters?: Parameters): Promise<void>;
34
35
  readAll(payload?: Payload, parameters?: Parameters): Promise<void>;
35
36
  readOne(notificationId: string, payload?: Payload, parameters?: Parameters): Promise<void>;
@@ -4,6 +4,7 @@ exports.NotificationsClient = exports.CreatePayloadFields = exports.ListParamete
4
4
  const abstractRestfulClient_1 = require("../abstractRestfulClient");
5
5
  const getResult_1 = require("../getResult");
6
6
  const notifications_1 = require("./entities/notifications");
7
+ const notification_1 = require("./entities/notification");
7
8
  const total_1 = require("./entities/total");
8
9
  var ListParametersFields;
9
10
  (function (ListParametersFields) {
@@ -32,11 +33,11 @@ class NotificationsClient extends abstractRestfulClient_1.AbstractRestfulClient
32
33
  return await this.delete(parameters);
33
34
  }
34
35
  async getOne(notificationId, parameters = {}) {
35
- this.path = `/${notificationId}`;
36
- return new getResult_1.GetResult(notifications_1.Notifications, await this.get(parameters));
36
+ this.path = `${notificationId}`;
37
+ return new getResult_1.GetResult(notification_1.Notification, await this.get(parameters));
37
38
  }
38
39
  async deleteOne(notificationId, parameters = {}) {
39
- this.path = `/${notificationId}`;
40
+ this.path = `${notificationId}`;
40
41
  return await this.delete(parameters);
41
42
  }
42
43
  async readAll(payload = {}, parameters = {}) {
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/ArrowSphere/nodejs-api-client.git"
6
6
  },
7
- "version": "3.36.1-rc.fdi.2",
7
+ "version": "3.36.1-rc.jpb.1",
8
8
  "description": "Node.js client for ArrowSphere's public API",
9
9
  "main": "build/index.js",
10
10
  "types": "build/index.d.ts",