@arrowsphere/api-client 3.196.0 → 3.197.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.197.0] - 2025.05.23
7
+
8
+ ### Added
9
+ - [subscriptions] Add endpoint for listing partners subscriptions and rename the endpoint for listing subscriptions as admin
10
+
6
11
  ## [3.196.0] - 2025.05.23
7
12
 
8
13
  ### Added
@@ -1,5 +1,5 @@
1
1
  import { AbstractEntity } from '../../abstractEntity';
2
- import { SubscriptionsClient, SubscriptionsListData, SubscriptionsListPayload } from '../subscriptionsClient';
2
+ import { AdminSubscriptionsListData, SubscriptionsClient, 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<SubscriptionsListData> {
12
+ export declare class SubscriptionsListResult extends AbstractEntity<AdminSubscriptionsListData> {
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<Subscription
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: SubscriptionsListData, client: SubscriptionsClient, payload?: SubscriptionsListPayload);
20
+ constructor(response: AdminSubscriptionsListData, 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 SubscriptionsListData = {
21
+ export declare type AdminSubscriptionsListData = {
22
22
  data: Array<SubscriptionData>;
23
23
  pagination: {
24
24
  perPage: number;
@@ -29,6 +29,28 @@ export declare type SubscriptionsListData = {
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
+ };
32
54
  export declare type SubscriptionCreationData = {
33
55
  name: string;
34
56
  level: string;
@@ -53,24 +75,26 @@ export declare class SubscriptionsClient extends AbstractRestfulClient {
53
75
  */
54
76
  protected isCamelPagination: boolean;
55
77
  /**
56
- * Calls the subscriptions API list endpoint
78
+ * @deprecated use listAdmin instead
79
+ * Calls the admin subscriptions API list endpoint
57
80
  *
58
81
  * @param data - List payload
59
82
  *
60
- * @returns Promise\<AxiosResponse\<{@link SubscriptionsListData}\>\> */
61
- listRaw(data?: SubscriptionsListPayload): Promise<SubscriptionsListData>;
83
+ * @returns Promise\<AxiosResponse\<{@link AdminSubscriptionsListData}\>\> */
84
+ listRaw(data?: SubscriptionsListPayload): Promise<AdminSubscriptionsListData>;
62
85
  /**
63
86
  * Lists subscriptions and returns a SubscriptionsListResult to manipulate the results.
64
87
  *
65
88
  * Note: This endpoint requires an admin token to be called
66
89
  *
67
- * @param postData - List payload
90
+ * @param filters - List payload
68
91
  * @param perPage - Number of results per page
69
92
  * @param page - Page number to fetch
70
93
  *
71
94
  * @returns Promise\<{@link SubscriptionsListResult}\>
72
95
  *
73
96
  */
74
- list(postData?: SubscriptionsListPayload, perPage?: number, page?: number): Promise<SubscriptionsListResult>;
75
- addSubscription(postData: SubscriptionCreationData): Promise<void>;
97
+ list(filters?: SubscriptionsListPayload): Promise<PartnerSubscriptionsListData>;
98
+ listAdmin(filters?: SubscriptionsListPayload, perPage?: number, page?: number): Promise<SubscriptionsListResult>;
99
+ addSubscription(filters: SubscriptionCreationData): Promise<void>;
76
100
  }
@@ -23,11 +23,12 @@ class SubscriptionsClient extends abstractRestfulClient_1.AbstractRestfulClient
23
23
  this.isCamelPagination = true;
24
24
  }
25
25
  /**
26
- * Calls the subscriptions API list endpoint
26
+ * @deprecated use listAdmin instead
27
+ * Calls the admin subscriptions API list endpoint
27
28
  *
28
29
  * @param data - List payload
29
30
  *
30
- * @returns Promise\<AxiosResponse\<{@link SubscriptionsListData}\>\> */
31
+ * @returns Promise\<AxiosResponse\<{@link AdminSubscriptionsListData}\>\> */
31
32
  async listRaw(data = {}) {
32
33
  this.path = this.LIST_PATH;
33
34
  return this.get(data, {}, { isAdmin: true });
@@ -37,21 +38,24 @@ class SubscriptionsClient extends abstractRestfulClient_1.AbstractRestfulClient
37
38
  *
38
39
  * Note: This endpoint requires an admin token to be called
39
40
  *
40
- * @param postData - List payload
41
+ * @param filters - List payload
41
42
  * @param perPage - Number of results per page
42
43
  * @param page - Page number to fetch
43
44
  *
44
45
  * @returns Promise\<{@link SubscriptionsListResult}\>
45
46
  *
46
47
  */
47
- async list(postData = {}, perPage = 100, page = 1) {
48
+ async list(filters = {}) {
49
+ return this.get(filters, {}, { isAdmin: false });
50
+ }
51
+ async listAdmin(filters = {}, perPage = 100, page = 1) {
48
52
  this.setPerPage(perPage);
49
53
  this.setPage(page);
50
- const response = await this.listRaw(postData);
51
- return new subscriptionsListResult_1.SubscriptionsListResult(response, this, postData);
54
+ const response = await this.listRaw(filters);
55
+ return new subscriptionsListResult_1.SubscriptionsListResult(response, this, filters);
52
56
  }
53
- async addSubscription(postData) {
54
- return this.post(postData);
57
+ async addSubscription(filters) {
58
+ return this.post(filters);
55
59
  }
56
60
  }
57
61
  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.196.0",
7
+ "version": "3.197.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",