@arrowsphere/api-client 3.195.0-rc.tbo.2 → 3.195.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 CHANGED
@@ -3,6 +3,11 @@
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.195.0] - 2025.05.12
7
+
8
+ ### Added
9
+ - [licenses] Handle compare for endpoint find licenses v2
10
+
6
11
  ## [3.194.0] - 2025.05.12
7
12
 
8
13
  ### Added
@@ -36,6 +36,10 @@ export declare enum LicenseFindParameters {
36
36
  * The key for aggregation search query parameter (to request extra aggregation, which are not provided by default)
37
37
  */
38
38
  DATA_AGGREGATION = "aggregations",
39
+ /**
40
+ * The key for comparisons
41
+ */
42
+ DATA_COMPARE = "compare",
39
43
  /**
40
44
  * The key for keyword search query parameter (to search one string in all available search fields)
41
45
  */
@@ -135,6 +139,9 @@ export declare type BaseParameters<LicenseType, OfferType, endCustomerOrganizati
135
139
  endCustomerOrganizationUnit?: endCustomerOrganizationUnitType;
136
140
  };
137
141
  export declare type LicenseSortParameters = BaseParameters<LicenceFindDataSortParameters, OfferFindResultDataSortParameters, EndCustomerOrganizationUnitSortParameters>;
142
+ export declare type LicenseCompareParameters = {
143
+ [field: string]: unknown;
144
+ };
138
145
  export declare type LicenseFiltersParameters = BaseParameters<LicenceFindDataFiltersParameters, OfferFindResultDataFiltersParameters, EndCustomerOrganizationUnitFiltersParameters>;
139
146
  /**
140
147
  * List of keywords to search with.
@@ -174,6 +181,9 @@ export declare type FiltersCompareValue = {
174
181
  [LicenseFindParameters.FILTERS_LTE]?: string | number;
175
182
  };
176
183
  export declare type FiltersParameters = string | string[] | number | number[] | boolean | FiltersCompareValue;
184
+ export declare type LicenseRawCompareParameters = {
185
+ [field: string]: unknown;
186
+ };
177
187
  export declare type LicenseRawFiltersParameters = {
178
188
  [field: string]: unknown;
179
189
  };
@@ -182,6 +192,7 @@ export declare type LicenseRawFiltersParameters = {
182
192
  */
183
193
  export declare type LicenseFindPayload = {
184
194
  [LicenseFindParameters.DATA_AGGREGATION]?: string[];
195
+ [LicenseFindParameters.DATA_COMPARE]?: LicenseCompareParameters;
185
196
  [LicenseFindParameters.DATA_KEYWORD]?: string;
186
197
  [LicenseFindParameters.DATA_KEYWORDS]?: LicenseKeywordsParameters;
187
198
  [LicenseFindParameters.DATA_FILTERS]?: LicenseFiltersParameters;
@@ -191,6 +202,7 @@ export declare type LicenseFindPayload = {
191
202
  };
192
203
  export declare type LicenseFindRawPayload = {
193
204
  [LicenseFindParameters.DATA_AGGREGATION]?: string[];
205
+ [LicenseFindParameters.DATA_COMPARE]?: LicenseRawCompareParameters;
194
206
  [LicenseFindParameters.DATA_KEYWORD]?: string;
195
207
  [LicenseFindParameters.DATA_KEYWORDS]?: {
196
208
  license?: LicenseRawKeywordsParametersLicence;
@@ -31,6 +31,10 @@ var LicenseFindParameters;
31
31
  * The key for aggregation search query parameter (to request extra aggregation, which are not provided by default)
32
32
  */
33
33
  LicenseFindParameters["DATA_AGGREGATION"] = "aggregations";
34
+ /**
35
+ * The key for comparisons
36
+ */
37
+ LicenseFindParameters["DATA_COMPARE"] = "compare";
34
38
  /**
35
39
  * The key for keyword search query parameter (to search one string in all available search fields)
36
40
  */
@@ -258,6 +262,7 @@ class LicensesClient extends abstractRestfulClient_1.AbstractRestfulClient {
258
262
  *
259
263
  */
260
264
  async find(postData = {}, perPage = 100, page = 1, parameters = {}) {
265
+ var _a;
261
266
  this.setPerPage(perPage);
262
267
  this.setPage(page);
263
268
  const rawLicensePayload = {
@@ -265,6 +270,9 @@ class LicensesClient extends abstractRestfulClient_1.AbstractRestfulClient {
265
270
  keyword: postData.keyword,
266
271
  highlight: postData.highlight,
267
272
  };
273
+ if (Object.keys((_a = postData.compare) !== null && _a !== void 0 ? _a : {}).length > 0) {
274
+ rawLicensePayload.compare = postData.compare;
275
+ }
268
276
  if (postData.keywords) {
269
277
  // Flatten with prefix for each type of keyword (license and offer)
270
278
  rawLicensePayload.keywords = {
@@ -1,5 +1,5 @@
1
1
  import { AbstractEntity } from '../../abstractEntity';
2
- import { AdminSubscriptionsListData, SubscriptionsClient, SubscriptionsListPayload } from '../subscriptionsClient';
2
+ import { SubscriptionsClient, SubscriptionsListData, SubscriptionsListPayload } from '../subscriptionsClient';
3
3
  import { SubscriptionData } from './subscription';
4
4
  /**
5
5
  * Subscriptions list result plain data
@@ -9,7 +9,7 @@ export declare type SubscriptionsListResultData = {
9
9
  totalPage: number;
10
10
  nbResults: number;
11
11
  };
12
- export declare class SubscriptionsListResult extends AbstractEntity<AdminSubscriptionsListData> {
12
+ export declare class SubscriptionsListResult extends AbstractEntity<SubscriptionsListData> {
13
13
  #private;
14
14
  /**
15
15
  * FindResult constructor. Uses the client and request data to go through the pages.
@@ -17,7 +17,7 @@ export declare class SubscriptionsListResult extends AbstractEntity<AdminSubscri
17
17
  * @param client - Subscriptions client the call was made with
18
18
  * @param payload - Payload parameter sent to the first call
19
19
  */
20
- constructor(response: AdminSubscriptionsListData, client: SubscriptionsClient, payload?: SubscriptionsListPayload);
20
+ constructor(response: SubscriptionsListData, client: SubscriptionsClient, payload?: SubscriptionsListPayload);
21
21
  get subscriptions(): AsyncGenerator<SubscriptionData, void, undefined>;
22
22
  get client(): SubscriptionsClient;
23
23
  get payload(): SubscriptionsListPayload;
@@ -18,7 +18,7 @@ export declare type SubscriptionsListPayload = {
18
18
  sortBy?: string;
19
19
  sortDirection?: 'ASC' | 'DESC';
20
20
  };
21
- export declare type AdminSubscriptionsListData = {
21
+ export declare type SubscriptionsListData = {
22
22
  data: Array<SubscriptionData>;
23
23
  pagination: {
24
24
  perPage: number;
@@ -29,28 +29,6 @@ export declare type AdminSubscriptionsListData = {
29
29
  previous: string;
30
30
  };
31
31
  };
32
- export declare type PartnerSubscriptionsListData = {
33
- data: Array<PartnerSubscription>;
34
- status: number;
35
- };
36
- export declare type PartnerSubscription = {
37
- reference: string;
38
- name: string;
39
- status: string;
40
- dateDemand: string;
41
- dateValidation: string | null;
42
- dateEnd: string | null;
43
- level: string | null;
44
- error_msg: string | null;
45
- details: {
46
- partnerId: string;
47
- };
48
- extraInformation: {
49
- programs: Record<string, {
50
- partnerId: string;
51
- }>;
52
- };
53
- };
54
32
  export declare type SubscriptionCreationData = {
55
33
  name: string;
56
34
  level: string;
@@ -75,26 +53,24 @@ export declare class SubscriptionsClient extends AbstractRestfulClient {
75
53
  */
76
54
  protected isCamelPagination: boolean;
77
55
  /**
78
- * @deprecated use listAdmin instead
79
- * Calls the admin subscriptions API list endpoint
56
+ * Calls the subscriptions API list endpoint
80
57
  *
81
58
  * @param data - List payload
82
59
  *
83
- * @returns Promise\<AxiosResponse\<{@link AdminSubscriptionsListData}\>\> */
84
- listRaw(data?: SubscriptionsListPayload): Promise<AdminSubscriptionsListData>;
60
+ * @returns Promise\<AxiosResponse\<{@link SubscriptionsListData}\>\> */
61
+ listRaw(data?: SubscriptionsListPayload): Promise<SubscriptionsListData>;
85
62
  /**
86
63
  * Lists subscriptions and returns a SubscriptionsListResult to manipulate the results.
87
64
  *
88
65
  * Note: This endpoint requires an admin token to be called
89
66
  *
90
- * @param filters - List payload
67
+ * @param postData - List payload
91
68
  * @param perPage - Number of results per page
92
69
  * @param page - Page number to fetch
93
70
  *
94
71
  * @returns Promise\<{@link SubscriptionsListResult}\>
95
72
  *
96
73
  */
97
- list(filters?: SubscriptionsListPayload): Promise<PartnerSubscriptionsListData>;
98
- listAdmin(filters?: SubscriptionsListPayload, perPage?: number, page?: number): Promise<SubscriptionsListResult>;
99
- addSubscription(filters: SubscriptionCreationData): Promise<void>;
74
+ list(postData?: SubscriptionsListPayload, perPage?: number, page?: number): Promise<SubscriptionsListResult>;
75
+ addSubscription(postData: SubscriptionCreationData): Promise<void>;
100
76
  }
@@ -23,12 +23,11 @@ class SubscriptionsClient extends abstractRestfulClient_1.AbstractRestfulClient
23
23
  this.isCamelPagination = true;
24
24
  }
25
25
  /**
26
- * @deprecated use listAdmin instead
27
- * Calls the admin subscriptions API list endpoint
26
+ * Calls the subscriptions API list endpoint
28
27
  *
29
28
  * @param data - List payload
30
29
  *
31
- * @returns Promise\<AxiosResponse\<{@link AdminSubscriptionsListData}\>\> */
30
+ * @returns Promise\<AxiosResponse\<{@link SubscriptionsListData}\>\> */
32
31
  async listRaw(data = {}) {
33
32
  this.path = this.LIST_PATH;
34
33
  return this.get(data, {}, { isAdmin: true });
@@ -38,24 +37,21 @@ class SubscriptionsClient extends abstractRestfulClient_1.AbstractRestfulClient
38
37
  *
39
38
  * Note: This endpoint requires an admin token to be called
40
39
  *
41
- * @param filters - List payload
40
+ * @param postData - List payload
42
41
  * @param perPage - Number of results per page
43
42
  * @param page - Page number to fetch
44
43
  *
45
44
  * @returns Promise\<{@link SubscriptionsListResult}\>
46
45
  *
47
46
  */
48
- async list(filters = {}) {
49
- return this.get(filters, {}, { isAdmin: false });
50
- }
51
- async listAdmin(filters = {}, perPage = 100, page = 1) {
47
+ async list(postData = {}, perPage = 100, page = 1) {
52
48
  this.setPerPage(perPage);
53
49
  this.setPage(page);
54
- const response = await this.listRaw(filters);
55
- return new subscriptionsListResult_1.SubscriptionsListResult(response, this, filters);
50
+ const response = await this.listRaw(postData);
51
+ return new subscriptionsListResult_1.SubscriptionsListResult(response, this, postData);
56
52
  }
57
- async addSubscription(filters) {
58
- return this.post(filters);
53
+ async addSubscription(postData) {
54
+ return this.post(postData);
59
55
  }
60
56
  }
61
57
  exports.SubscriptionsClient = SubscriptionsClient;
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.195.0-rc.tbo.2",
7
+ "version": "3.195.0",
8
8
  "description": "Node.js client for ArrowSphere's public API",
9
9
  "main": "build/index.js",
10
10
  "types": "build/index.d.ts",