@pushwoosh/rpc-v2-http-api-data 0.2.23 → 0.2.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.
package/data.js CHANGED
@@ -10237,6 +10237,15 @@ export const data = {
10237
10237
  "failedPreconditions": "pushwoosh.rpc.external_segments.v3.ExternalSegmentsService_Delete_FailedPreconditions",
10238
10238
  "commonFailedPreconditions": "pushwoosh.rpc.errors.v3.Common_FailedPreconditions"
10239
10239
  }
10240
+ },
10241
+ "CheckConnection": {
10242
+ "request": "pushwoosh.rpc.external_segments.v3.CheckConnectionRequest",
10243
+ "response": "pushwoosh.rpc.external_segments.v3.CheckConnectionResponse",
10244
+ "method": "post",
10245
+ "path": "/api/external-segments/{code}:check-connection",
10246
+ "errors": {
10247
+ "commonFailedPreconditions": "pushwoosh.rpc.errors.v3.Common_FailedPreconditions"
10248
+ }
10240
10249
  }
10241
10250
  }
10242
10251
  },
@@ -10261,6 +10270,18 @@ export const data = {
10261
10270
  "options": {
10262
10271
  "type": "string",
10263
10272
  "mapKeyType": "string"
10273
+ },
10274
+ "sslmode": {
10275
+ "type": "string"
10276
+ },
10277
+ "caCert": {
10278
+ "type": "string"
10279
+ },
10280
+ "clientCert": {
10281
+ "type": "string"
10282
+ },
10283
+ "clientKey": {
10284
+ "type": "string"
10264
10285
  }
10265
10286
  }
10266
10287
  },
@@ -10462,6 +10483,28 @@ export const data = {
10462
10483
  "type": "I",
10463
10484
  "fields": {}
10464
10485
  },
10486
+ "pushwoosh.rpc.external_segments.v3.CheckConnectionRequest": {
10487
+ "type": "I",
10488
+ "fields": {
10489
+ "application": {
10490
+ "type": "string"
10491
+ },
10492
+ "code": {
10493
+ "type": "string"
10494
+ }
10495
+ }
10496
+ },
10497
+ "pushwoosh.rpc.external_segments.v3.CheckConnectionResponse": {
10498
+ "type": "I",
10499
+ "fields": {
10500
+ "valid": {
10501
+ "type": "boolean"
10502
+ },
10503
+ "error": {
10504
+ "type": "string"
10505
+ }
10506
+ }
10507
+ },
10465
10508
  "pushwoosh.rpc_v2.filters.FiltersService": {
10466
10509
  "type": "S",
10467
10510
  "key": "filters",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/rpc-v2-http-api-data",
3
- "version": "0.2.23",
3
+ "version": "0.2.25",
4
4
  "description": "RPC V2 HTTP API Types and Data",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -138,6 +138,13 @@ export type ExternalSegmentsService_Delete = RpcMethodV3<DeleteRequest, DeleteRe
138
138
  error?: undefined;
139
139
  failedPreconditions?: ExternalSegmentsService_Delete_FailedPreconditions | pushwoosh_rpc_errors_v3_Common_FailedPreconditions;
140
140
  }>;
141
+ export type ExternalSegmentsService_CheckConnection = RpcMethodV3<CheckConnectionRequest, CheckConnectionResponse, {
142
+ error: unknown;
143
+ failedPreconditions?: undefined;
144
+ } | {
145
+ error?: undefined;
146
+ failedPreconditions?: pushwoosh_rpc_errors_v3_Common_FailedPreconditions;
147
+ }>;
141
148
  /**
142
149
  * ExternalSegmentsService manages external segments: user populations materialized
143
150
  * from an external database (PostgreSQL / MySQL) via a user-supplied SQL query.
@@ -162,6 +169,11 @@ export interface ExternalSegmentsService {
162
169
  Update: ExternalSegmentsService_Update;
163
170
  /** Delete an external segment. */
164
171
  Delete: ExternalSegmentsService_Delete;
172
+ /**
173
+ * CheckConnection connects to the segment's database and pings it, then
174
+ * stores the outcome in the segment's `valid` flag. Returns the result.
175
+ */
176
+ CheckConnection: ExternalSegmentsService_CheckConnection;
165
177
  }
166
178
  export type ExternalSegmentsService_Errors = {
167
179
  List: {
@@ -181,6 +193,9 @@ export type ExternalSegmentsService_Errors = {
181
193
  Delete: {
182
194
  failedPreconditions: ExternalSegmentsService_Delete_FailedPreconditions | pushwoosh_rpc_errors_v3_Common_FailedPreconditions;
183
195
  };
196
+ CheckConnection: {
197
+ failedPreconditions: pushwoosh_rpc_errors_v3_Common_FailedPreconditions;
198
+ };
184
199
  };
185
200
  /**
186
201
  * PostgresConnection holds PostgreSQL connection parameters.
@@ -199,11 +214,26 @@ export type PostgresConnection = {
199
214
  /** Database name. */
200
215
  database: string;
201
216
  /**
202
- * Any additional standard libpq connection parameters (e.g. sslmode,
203
- * connect_timeout, application_name, sslcert, sslkey, sslrootcert,
204
- * target_session_attrs, options). Keys must be valid libpq keywords.
217
+ * Any additional standard libpq connection parameters (e.g.
218
+ * connect_timeout, application_name, target_session_attrs, options).
219
+ * Keys must be valid libpq keywords.
205
220
  */
206
221
  options: Record<string, string>;
222
+ /**
223
+ * SSL/TLS mode: disable, require, verify-ca, verify-full.
224
+ * Defaults to disable when empty.
225
+ */
226
+ sslmode: string;
227
+ /**
228
+ * TLS material. All three are write-only: never returned by read methods.
229
+ * On update, an empty value keeps the currently stored file (send it again
230
+ * to replace it). They are stored as external segment files, not in the DSN.
231
+ */
232
+ caCert: string;
233
+ /** client certificate (sslcert) */
234
+ clientCert: string;
235
+ /** client private key (sslkey) */
236
+ clientKey: string;
207
237
  };
208
238
  /**
209
239
  * MysqlConnection holds MySQL connection parameters.
@@ -333,3 +363,15 @@ export type DeleteRequest = {
333
363
  code?: string;
334
364
  };
335
365
  export type DeleteResponse = {};
366
+ export type CheckConnectionRequest = {
367
+ /** Application code the segment belongs to. */
368
+ application?: string;
369
+ /** External segment code to check. */
370
+ code?: string;
371
+ };
372
+ export type CheckConnectionResponse = {
373
+ /** Whether the database connection succeeded (also stored on the segment). */
374
+ valid: boolean;
375
+ /** Connection error message when valid is false; empty otherwise. */
376
+ error: string;
377
+ };