@fiado/api-invoker 4.32.0 → 4.33.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.
@@ -20,5 +20,10 @@ export declare class DirectoryApi implements IDirectoryApi {
20
20
  updateUserProfile(directoryId: string, profile: Profile): Promise<void>;
21
21
  updateStatus(directoryId: string, status: Status): Promise<void>;
22
22
  getByPeopleId(peopleId: string): Promise<any>;
23
+ getDirectoryList(params: {
24
+ index?: string;
25
+ pageSize?: number;
26
+ sort?: "ascending" | "descending";
27
+ }): Promise<any>;
23
28
  private normalizeE164Light;
24
29
  }
@@ -132,6 +132,19 @@ let DirectoryApi = class DirectoryApi {
132
132
  const operationName = "getUserInfoByParams";
133
133
  return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
134
134
  }
135
+ async getDirectoryList(params) {
136
+ const queryParams = [];
137
+ if (params.index)
138
+ queryParams.push(`index=${encodeURIComponent(params.index)}`);
139
+ if (params.pageSize)
140
+ queryParams.push(`pageSize=${params.pageSize}`);
141
+ if (params.sort)
142
+ queryParams.push(`sort=${params.sort}`);
143
+ const queryString = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
144
+ const url = `${this.baseUrl}${queryString}`;
145
+ const operationName = "getAllDirectories";
146
+ return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
147
+ }
135
148
  // --- Helper ligero para E.164 limpia espacios y garantiza '+'
136
149
  normalizeE164Light(input) {
137
150
  if (!input)
@@ -54,4 +54,14 @@ export interface IDirectoryApi {
54
54
  validateSecretNumber(directoryId: string, secretNumber: string): Promise<void>;
55
55
  deleteDirectory(directoryId: string): Promise<void>;
56
56
  getDirectoriesByPeopleId(peopleIds: string[]): Promise<any>;
57
+ /**
58
+ * Lista todos los directorios de usuario paginados por createDate (desc por defecto).
59
+ * @param params index (cursor de paginación), pageSize, sort opcional.
60
+ * @returns { data: { items: Directory[], index: string | null } }
61
+ */
62
+ getDirectoryList(params: {
63
+ index?: string;
64
+ pageSize?: number;
65
+ sort?: "ascending" | "descending";
66
+ }): Promise<any>;
57
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "4.32.0",
3
+ "version": "4.33.0",
4
4
  "description": "Sirve como un puente entre diferentes funciones lambda, facilitando la comunicación entre ellas a través de invocaciones http",
5
5
  "type": "module",
6
6
  "main": "bin/index.js",
@@ -34,7 +34,7 @@
34
34
  "@fiado/gateway-adapter": "^2.0.2",
35
35
  "@fiado/http-client": "^2.0.1",
36
36
  "@fiado/logger": "^1.1.3",
37
- "@fiado/type-kit": "^3.111.0",
37
+ "@fiado/type-kit": "^3.115.0",
38
38
  "dotenv": "^16.4.7"
39
39
  },
40
40
  "peerDependencies": {
@@ -181,6 +181,20 @@ export class DirectoryApi implements IDirectoryApi {
181
181
  return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
182
182
  }
183
183
 
184
+ public async getDirectoryList(params: { index?: string; pageSize?: number; sort?: "ascending" | "descending" }): Promise<any> {
185
+
186
+ const queryParams: string[] = [];
187
+ if (params.index) queryParams.push(`index=${encodeURIComponent(params.index)}`);
188
+ if (params.pageSize) queryParams.push(`pageSize=${params.pageSize}`);
189
+ if (params.sort) queryParams.push(`sort=${params.sort}`);
190
+ const queryString = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
191
+
192
+ const url = `${this.baseUrl}${queryString}`;
193
+ const operationName = "getAllDirectories";
194
+
195
+ return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
196
+ }
197
+
184
198
  // --- Helper ligero para E.164 limpia espacios y garantiza '+'
185
199
  private normalizeE164Light(input?: string): string {
186
200
  if (!input) return input as any;
@@ -69,5 +69,12 @@ export interface IDirectoryApi {
69
69
 
70
70
  getDirectoriesByPeopleId(peopleIds: string[]): Promise<any>;
71
71
 
72
+ /**
73
+ * Lista todos los directorios de usuario paginados por createDate (desc por defecto).
74
+ * @param params index (cursor de paginación), pageSize, sort opcional.
75
+ * @returns { data: { items: Directory[], index: string | null } }
76
+ */
77
+ getDirectoryList(params: { index?: string; pageSize?: number; sort?: "ascending" | "descending" }): Promise<any>;
78
+
72
79
 
73
80
  }