@pushwoosh/rpc-v2-http-api-data 0.2.24 → 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
  },
@@ -10474,6 +10483,28 @@ export const data = {
10474
10483
  "type": "I",
10475
10484
  "fields": {}
10476
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
+ },
10477
10508
  "pushwoosh.rpc_v2.filters.FiltersService": {
10478
10509
  "type": "S",
10479
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.24",
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.
@@ -348,3 +363,15 @@ export type DeleteRequest = {
348
363
  code?: string;
349
364
  };
350
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
+ };