@pushwoosh/rpc-v2-http-api-data 0.1.959 → 0.1.961

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.
Files changed (3) hide show
  1. package/data.js +41 -0
  2. package/package.json +1 -1
  3. package/presets.d.ts +28 -0
package/data.js CHANGED
@@ -21007,6 +21007,12 @@ export const data = {
21007
21007
  "response": "pushwoosh.rpc_v2.presets.DeletePresetResponse",
21008
21008
  "method": "delete",
21009
21009
  "path": "/api/presets/{code}"
21010
+ },
21011
+ "ValidateLiquid": {
21012
+ "request": "pushwoosh.rpc_v2.presets.ValidateLiquidRequest",
21013
+ "response": "pushwoosh.rpc_v2.presets.ValidateLiquidResponse",
21014
+ "method": "post",
21015
+ "path": "/api/presets:validate-liquid"
21010
21016
  }
21011
21017
  }
21012
21018
  },
@@ -21519,6 +21525,41 @@ export const data = {
21519
21525
  "type": "I",
21520
21526
  "fields": {}
21521
21527
  },
21528
+ "pushwoosh.rpc_v2.presets.ValidateLiquidRequest": {
21529
+ "type": "I",
21530
+ "fields": {
21531
+ "templates": {
21532
+ "type": "string",
21533
+ "mapKeyType": "string"
21534
+ }
21535
+ }
21536
+ },
21537
+ "pushwoosh.rpc_v2.presets.LiquidValidationError": {
21538
+ "type": "I",
21539
+ "fields": {
21540
+ "field": {
21541
+ "type": "string"
21542
+ },
21543
+ "line": {
21544
+ "type": "number"
21545
+ },
21546
+ "message": {
21547
+ "type": "string"
21548
+ }
21549
+ }
21550
+ },
21551
+ "pushwoosh.rpc_v2.presets.ValidateLiquidResponse": {
21552
+ "type": "I",
21553
+ "fields": {
21554
+ "valid": {
21555
+ "type": "boolean"
21556
+ },
21557
+ "errors": {
21558
+ "type": "pushwoosh.rpc_v2.presets.LiquidValidationError",
21559
+ "array": true
21560
+ }
21561
+ }
21562
+ },
21522
21563
  "pushwoosh.rpc_v2.referral_partners.ReferralPartnerService": {
21523
21564
  "type": "S",
21524
21565
  "key": "referralPartner",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/rpc-v2-http-api-data",
3
- "version": "0.1.959",
3
+ "version": "0.1.961",
4
4
  "description": "RPC V2 HTTP API Types and Data",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
package/presets.d.ts CHANGED
@@ -8,6 +8,7 @@ export type presetsService_Update = RpcMethod<UpdatePresetRequest, UpdatePresetR
8
8
  export type presetsService_UpdatePartial = RpcMethod<UpdatePresetPartialRequest, UpdatePresetResponse>;
9
9
  export type presetsService_Clone = RpcMethod<ClonePresetRequest, ClonePresetResponse>;
10
10
  export type presetsService_Delete = RpcMethod<DeletePresetRequest, DeletePresetResponse>;
11
+ export type presetsService_ValidateLiquid = RpcMethod<ValidateLiquidRequest, ValidateLiquidResponse>;
11
12
  export interface presetsService {
12
13
  List: presetsService_List;
13
14
  Get: presetsService_Get;
@@ -16,6 +17,12 @@ export interface presetsService {
16
17
  UpdatePartial: presetsService_UpdatePartial;
17
18
  Clone: presetsService_Clone;
18
19
  Delete: presetsService_Delete;
20
+ /**
21
+ * ValidateLiquid checks the Liquid syntax of one or more template strings
22
+ * using the same engine the publisher uses at send time. It does not touch
23
+ * any preset or account data.
24
+ */
25
+ ValidateLiquid: presetsService_ValidateLiquid;
19
26
  }
20
27
  export type ListPresetsRequest_OrderBy = 'NAME' | 'CREATED' | 'UPDATED';
21
28
  export type ListPresetsRequest_OrderDirection = 'ASC' | 'DESC';
@@ -252,3 +259,24 @@ export type DeletePresetRequest = {
252
259
  code?: string;
253
260
  };
254
261
  export type DeletePresetResponse = {};
262
+ export type ValidateLiquidRequest = {
263
+ /**
264
+ * Templates to validate, keyed by a caller-defined field id
265
+ * (e.g. "title.en", "content.fr") so the client can map errors back to
266
+ * the corresponding form field.
267
+ */
268
+ templates?: Record<string, string>;
269
+ };
270
+ export type LiquidValidationError = {
271
+ /** field id from the request map this error belongs to */
272
+ field: string;
273
+ /** 1-based line number within the template, 0 if the location is unknown */
274
+ line: number;
275
+ /** human readable error message */
276
+ message: string;
277
+ };
278
+ export type ValidateLiquidResponse = {
279
+ /** true when every template is syntactically valid */
280
+ valid: boolean;
281
+ errors: LiquidValidationError[];
282
+ };