@opens/gateways 1.16.24 → 1.16.25

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.
@@ -151,43 +151,84 @@ interface ProviderDisplayInfoResponse {
151
151
  channel: string | null;
152
152
  }
153
153
 
154
- /** A provider entity nested within a configuration response. */
154
+ /**
155
+ * Provider entity nested in `GET /config/provider/:providerId` via the
156
+ * Sequelize association `providers` (`Configs.belongsTo(Providers)`).
157
+ * `id` is the integer primary key of the `Providers` table.
158
+ */
155
159
  interface ConfigProvider {
156
- id: string;
160
+ /** Provider primary key (`Providers.id`, integer). */
161
+ id: number | string;
162
+ /** Provider name (e.g. `whatsapp`, `gmail`, `outlook`, `messenger`, `direct`, `yunique`). */
157
163
  name: string;
164
+ /** Provider channel type (e.g. `chat`, `email`). */
158
165
  type: string;
166
+ /** Default session TTL in seconds. */
159
167
  defaultSession: number;
168
+ /** JSON schema describing provider-specific `configurations` fields, when available. */
160
169
  configurationsSchema: Record<string, unknown> | null;
161
170
  createdAt: string;
162
171
  updatedAt: string;
163
172
  }
164
- /** A configuration entity returned by the Chat Config API. */
173
+ /**
174
+ * A configuration row from the `Configs` table.
175
+ * Returned by `GET /config/:configId` and inside
176
+ * `GET /config/provider/:providerId` (`{ configurations: Config[] }`).
177
+ * When listed by provider, each item includes the nested `providers` association.
178
+ */
165
179
  interface Config {
180
+ /** Configuration UUID (`Configs.id`). */
166
181
  id: string;
167
182
  isAssistanceEnabled: boolean;
168
183
  rewind: number | null;
184
+ /** Company UUID resolved from the auth token on list-by-provider. */
169
185
  companyId: string;
170
186
  active: boolean;
187
+ /** Provider-specific settings JSON (shape varies by provider). */
171
188
  configurations: Record<string, unknown>;
172
189
  priority: number | null;
190
+ /** Foreign key to `Providers.id`. */
191
+ providerId: number | string;
173
192
  inbound: boolean;
174
193
  outbound: boolean;
175
194
  deletedAt: string | null;
195
+ csatConditionalRulesEnabled: boolean;
196
+ csatFeedbackTTL: number | null;
197
+ createdAt: string;
198
+ updatedAt: string;
199
+ /** Nested provider loaded by `GET /config/provider/:providerId`. */
176
200
  providers: ConfigProvider;
177
201
  }
178
- /** Response returned by the Chat Config API when listing configurations by provider. */
202
+ /**
203
+ * Response of `GET /config/provider/:providerId`.
204
+ * Always wrapped as `{ configurations }` (empty array when none match).
205
+ */
179
206
  interface ConfigListByProviderResponse {
180
207
  configurations: Config[];
181
208
  }
182
- /** Query parameters for filtering configurations by provider. */
209
+ /**
210
+ * Optional query filters for `GET /config/provider/:providerId`.
211
+ * Filters map to `Configs` columns, except `providerType` / `providerName`
212
+ * which filter the nested `providers` association (`type` / `name`).
213
+ * The backend applies filters with truthiness checks, so `false` / `0` values
214
+ * are ignored and do not filter.
215
+ */
183
216
  interface GetConfigsByProviderParams {
217
+ /** Filter by `Configs.isAssistanceEnabled`. */
184
218
  isAssistanceEnabled?: boolean;
219
+ /** Filter by `Configs.rewind`. */
185
220
  rewind?: number;
221
+ /** Filter by `Configs.active`. */
186
222
  active?: boolean;
223
+ /** Filter by `Configs.priority`. */
187
224
  priority?: number;
225
+ /** Filter by `Configs.inbound` (e.g. inbound WhatsApp channels). */
188
226
  inbound?: boolean;
227
+ /** Filter by `Configs.outbound`. */
189
228
  outbound?: boolean;
229
+ /** Filter by nested `providers.type` (e.g. `chat`, `email`). */
190
230
  providerType?: string;
231
+ /** Filter by nested `providers.name` (e.g. `whatsapp`). */
191
232
  providerName?: string;
192
233
  }
193
234
 
@@ -151,43 +151,84 @@ interface ProviderDisplayInfoResponse {
151
151
  channel: string | null;
152
152
  }
153
153
 
154
- /** A provider entity nested within a configuration response. */
154
+ /**
155
+ * Provider entity nested in `GET /config/provider/:providerId` via the
156
+ * Sequelize association `providers` (`Configs.belongsTo(Providers)`).
157
+ * `id` is the integer primary key of the `Providers` table.
158
+ */
155
159
  interface ConfigProvider {
156
- id: string;
160
+ /** Provider primary key (`Providers.id`, integer). */
161
+ id: number | string;
162
+ /** Provider name (e.g. `whatsapp`, `gmail`, `outlook`, `messenger`, `direct`, `yunique`). */
157
163
  name: string;
164
+ /** Provider channel type (e.g. `chat`, `email`). */
158
165
  type: string;
166
+ /** Default session TTL in seconds. */
159
167
  defaultSession: number;
168
+ /** JSON schema describing provider-specific `configurations` fields, when available. */
160
169
  configurationsSchema: Record<string, unknown> | null;
161
170
  createdAt: string;
162
171
  updatedAt: string;
163
172
  }
164
- /** A configuration entity returned by the Chat Config API. */
173
+ /**
174
+ * A configuration row from the `Configs` table.
175
+ * Returned by `GET /config/:configId` and inside
176
+ * `GET /config/provider/:providerId` (`{ configurations: Config[] }`).
177
+ * When listed by provider, each item includes the nested `providers` association.
178
+ */
165
179
  interface Config {
180
+ /** Configuration UUID (`Configs.id`). */
166
181
  id: string;
167
182
  isAssistanceEnabled: boolean;
168
183
  rewind: number | null;
184
+ /** Company UUID resolved from the auth token on list-by-provider. */
169
185
  companyId: string;
170
186
  active: boolean;
187
+ /** Provider-specific settings JSON (shape varies by provider). */
171
188
  configurations: Record<string, unknown>;
172
189
  priority: number | null;
190
+ /** Foreign key to `Providers.id`. */
191
+ providerId: number | string;
173
192
  inbound: boolean;
174
193
  outbound: boolean;
175
194
  deletedAt: string | null;
195
+ csatConditionalRulesEnabled: boolean;
196
+ csatFeedbackTTL: number | null;
197
+ createdAt: string;
198
+ updatedAt: string;
199
+ /** Nested provider loaded by `GET /config/provider/:providerId`. */
176
200
  providers: ConfigProvider;
177
201
  }
178
- /** Response returned by the Chat Config API when listing configurations by provider. */
202
+ /**
203
+ * Response of `GET /config/provider/:providerId`.
204
+ * Always wrapped as `{ configurations }` (empty array when none match).
205
+ */
179
206
  interface ConfigListByProviderResponse {
180
207
  configurations: Config[];
181
208
  }
182
- /** Query parameters for filtering configurations by provider. */
209
+ /**
210
+ * Optional query filters for `GET /config/provider/:providerId`.
211
+ * Filters map to `Configs` columns, except `providerType` / `providerName`
212
+ * which filter the nested `providers` association (`type` / `name`).
213
+ * The backend applies filters with truthiness checks, so `false` / `0` values
214
+ * are ignored and do not filter.
215
+ */
183
216
  interface GetConfigsByProviderParams {
217
+ /** Filter by `Configs.isAssistanceEnabled`. */
184
218
  isAssistanceEnabled?: boolean;
219
+ /** Filter by `Configs.rewind`. */
185
220
  rewind?: number;
221
+ /** Filter by `Configs.active`. */
186
222
  active?: boolean;
223
+ /** Filter by `Configs.priority`. */
187
224
  priority?: number;
225
+ /** Filter by `Configs.inbound` (e.g. inbound WhatsApp channels). */
188
226
  inbound?: boolean;
227
+ /** Filter by `Configs.outbound`. */
189
228
  outbound?: boolean;
229
+ /** Filter by nested `providers.type` (e.g. `chat`, `email`). */
190
230
  providerType?: string;
231
+ /** Filter by nested `providers.name` (e.g. `whatsapp`). */
191
232
  providerName?: string;
192
233
  }
193
234
 
package/dist/index.d.mts CHANGED
@@ -270,12 +270,14 @@ declare class ChatConfigGateway {
270
270
  */
271
271
  getProviderDisplayInfo(params: GetProviderDisplayInfoParams): Promise<ProviderDisplayInfoResponse>;
272
272
  /**
273
- * Retrieves configurations filtered by provider.
274
- * @param providerId - The unique identifier of the provider.
275
- * @param params - Optional query parameters for filtering configurations.
276
- * @returns The configurations for the given provider.
277
- */
278
- getConfigsByProvider(providerId: string, params?: GetConfigsByProviderParams): Promise<ConfigListByProviderResponse>;
273
+ * Lists configurations for a provider (`GET /config/provider/:providerId`).
274
+ * Scoped to the authenticated company's `companyId` from the token.
275
+ * Each item includes the nested `providers` association.
276
+ * @param providerId - Provider primary key (`Providers.id`, e.g. `1` for WhatsApp).
277
+ * @param params - Optional filters on config columns and nested provider fields.
278
+ * @returns `{ configurations }` for the given provider (empty array when none match).
279
+ */
280
+ getConfigsByProvider(providerId: string | number, params?: GetConfigsByProviderParams): Promise<ConfigListByProviderResponse>;
279
281
  /**
280
282
  * Retrieves a queue by its ID.
281
283
  * @param queueId - The unique identifier of the queue.
package/dist/index.d.ts CHANGED
@@ -270,12 +270,14 @@ declare class ChatConfigGateway {
270
270
  */
271
271
  getProviderDisplayInfo(params: GetProviderDisplayInfoParams): Promise<ProviderDisplayInfoResponse>;
272
272
  /**
273
- * Retrieves configurations filtered by provider.
274
- * @param providerId - The unique identifier of the provider.
275
- * @param params - Optional query parameters for filtering configurations.
276
- * @returns The configurations for the given provider.
277
- */
278
- getConfigsByProvider(providerId: string, params?: GetConfigsByProviderParams): Promise<ConfigListByProviderResponse>;
273
+ * Lists configurations for a provider (`GET /config/provider/:providerId`).
274
+ * Scoped to the authenticated company's `companyId` from the token.
275
+ * Each item includes the nested `providers` association.
276
+ * @param providerId - Provider primary key (`Providers.id`, e.g. `1` for WhatsApp).
277
+ * @param params - Optional filters on config columns and nested provider fields.
278
+ * @returns `{ configurations }` for the given provider (empty array when none match).
279
+ */
280
+ getConfigsByProvider(providerId: string | number, params?: GetConfigsByProviderParams): Promise<ConfigListByProviderResponse>;
279
281
  /**
280
282
  * Retrieves a queue by its ID.
281
283
  * @param queueId - The unique identifier of the queue.
package/dist/index.js CHANGED
@@ -460,10 +460,12 @@ var ChatConfigGateway = class {
460
460
  return data;
461
461
  }
462
462
  /**
463
- * Retrieves configurations filtered by provider.
464
- * @param providerId - The unique identifier of the provider.
465
- * @param params - Optional query parameters for filtering configurations.
466
- * @returns The configurations for the given provider.
463
+ * Lists configurations for a provider (`GET /config/provider/:providerId`).
464
+ * Scoped to the authenticated company's `companyId` from the token.
465
+ * Each item includes the nested `providers` association.
466
+ * @param providerId - Provider primary key (`Providers.id`, e.g. `1` for WhatsApp).
467
+ * @param params - Optional filters on config columns and nested provider fields.
468
+ * @returns `{ configurations }` for the given provider (empty array when none match).
467
469
  */
468
470
  async getConfigsByProvider(providerId, params) {
469
471
  const { data } = await this.httpClient.get(