@pushwoosh/rpc-gateway-ai-assistant 0.1.249 → 0.1.250

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/commonTypes.d.ts CHANGED
@@ -1,4 +1,12 @@
1
1
  export type Duration = number;
2
+ /** Arbitrary JSON value (google.protobuf.Value). */
3
+ export type JsonValue = string | number | boolean | null | JsonValue[] | {
4
+ [key: string]: JsonValue;
5
+ };
6
+ /** Arbitrary JSON object (google.protobuf.Struct). */
7
+ export type JsonObject = {
8
+ [key: string]: JsonValue;
9
+ };
2
10
  export type RpcMethod<Req, Res> = ((request: Req) => Promise<Res>) & {
3
11
  safe(request: Req): Promise<[{
4
12
  error: unknown;
package/data.js CHANGED
@@ -134,6 +134,18 @@ export const data = {
134
134
  }
135
135
  }
136
136
  },
137
+ "pushwoosh.aibuilder.v1.DarkColorScheme": {
138
+ "type": "I",
139
+ "fields": {
140
+ "enabled": {
141
+ "type": "boolean"
142
+ },
143
+ "colors": {
144
+ "type": "pushwoosh.aibuilder.v1.ColorSchemeItem",
145
+ "mapKeyType": "string"
146
+ }
147
+ }
148
+ },
137
149
  "pushwoosh.aibuilder.v1.EdgeInsets": {
138
150
  "type": "I",
139
151
  "fields": {
@@ -844,6 +856,10 @@ export const data = {
844
856
  "mobilePadding": {
845
857
  "type": "pushwoosh.aibuilder.v1.EdgeInsets",
846
858
  "optional": true
859
+ },
860
+ "displayCondition": {
861
+ "type": "pushwoosh.aibuilder.v1.DisplayCondition",
862
+ "optional": true
847
863
  }
848
864
  },
849
865
  "oneofs": {
@@ -960,6 +976,18 @@ export const data = {
960
976
  "imagePosition": {
961
977
  "type": "pushwoosh.aibuilder.v1.CardImagePosition",
962
978
  "optional": true
979
+ },
980
+ "imageWrap": {
981
+ "type": "boolean",
982
+ "optional": true
983
+ },
984
+ "imageMobilePadding": {
985
+ "type": "pushwoosh.aibuilder.v1.EdgeInsets",
986
+ "optional": true
987
+ },
988
+ "sideImageRatio": {
989
+ "type": "number",
990
+ "optional": true
963
991
  }
964
992
  }
965
993
  },
@@ -996,6 +1024,22 @@ export const data = {
996
1024
  "padding": {
997
1025
  "type": "pushwoosh.aibuilder.v1.EdgeInsets",
998
1026
  "optional": true
1027
+ },
1028
+ "imageSize": {
1029
+ "type": "pushwoosh.aibuilder.v1.CardImageSize",
1030
+ "optional": true
1031
+ },
1032
+ "imageFit": {
1033
+ "type": "pushwoosh.aibuilder.v1.CardImageFit",
1034
+ "optional": true
1035
+ },
1036
+ "imagePosition": {
1037
+ "type": "pushwoosh.aibuilder.v1.CardImagePosition",
1038
+ "optional": true
1039
+ },
1040
+ "imageRatio": {
1041
+ "type": "number",
1042
+ "optional": true
999
1043
  }
1000
1044
  }
1001
1045
  },
@@ -1074,6 +1118,224 @@ export const data = {
1074
1118
  }
1075
1119
  }
1076
1120
  },
1121
+ "pushwoosh.aibuilder.v1.DisplayConditionOp": {
1122
+ "type": "E",
1123
+ "values": [
1124
+ "DISPLAY_CONDITION_OP_UNSPECIFIED",
1125
+ "DISPLAY_CONDITION_OP_EQ",
1126
+ "DISPLAY_CONDITION_OP_NEQ",
1127
+ "DISPLAY_CONDITION_OP_GT",
1128
+ "DISPLAY_CONDITION_OP_GTE",
1129
+ "DISPLAY_CONDITION_OP_LT",
1130
+ "DISPLAY_CONDITION_OP_LTE",
1131
+ "DISPLAY_CONDITION_OP_CONTAINS",
1132
+ "DISPLAY_CONDITION_OP_NOT_CONTAINS",
1133
+ "DISPLAY_CONDITION_OP_EXISTS",
1134
+ "DISPLAY_CONDITION_OP_NOT_EXISTS"
1135
+ ]
1136
+ },
1137
+ "pushwoosh.aibuilder.v1.DisplayConditionValueType": {
1138
+ "type": "E",
1139
+ "values": [
1140
+ "DISPLAY_CONDITION_VALUE_TYPE_UNSPECIFIED",
1141
+ "DISPLAY_CONDITION_VALUE_TYPE_STRING",
1142
+ "DISPLAY_CONDITION_VALUE_TYPE_NUMBER",
1143
+ "DISPLAY_CONDITION_VALUE_TYPE_BOOLEAN"
1144
+ ]
1145
+ },
1146
+ "pushwoosh.aibuilder.v1.DisplayConditionCombinator": {
1147
+ "type": "E",
1148
+ "values": [
1149
+ "DISPLAY_CONDITION_COMBINATOR_UNSPECIFIED",
1150
+ "DISPLAY_CONDITION_COMBINATOR_AND",
1151
+ "DISPLAY_CONDITION_COMBINATOR_OR"
1152
+ ]
1153
+ },
1154
+ "pushwoosh.aibuilder.v1.DisplayConditionUnknown": {
1155
+ "type": "E",
1156
+ "values": [
1157
+ "DISPLAY_CONDITION_UNKNOWN_UNSPECIFIED",
1158
+ "DISPLAY_CONDITION_UNKNOWN_HIDE",
1159
+ "DISPLAY_CONDITION_UNKNOWN_SHOW"
1160
+ ]
1161
+ },
1162
+ "pushwoosh.aibuilder.v1.DisplayConditionChain": {
1163
+ "type": "E",
1164
+ "values": [
1165
+ "DISPLAY_CONDITION_CHAIN_UNSPECIFIED",
1166
+ "DISPLAY_CONDITION_CHAIN_ELSIF",
1167
+ "DISPLAY_CONDITION_CHAIN_ELSE"
1168
+ ]
1169
+ },
1170
+ "pushwoosh.aibuilder.v1.DisplayConditionRule": {
1171
+ "type": "I",
1172
+ "fields": {
1173
+ "name": {
1174
+ "type": "string"
1175
+ },
1176
+ "op": {
1177
+ "type": "pushwoosh.aibuilder.v1.DisplayConditionOp"
1178
+ },
1179
+ "value": {
1180
+ "type": "string"
1181
+ },
1182
+ "valueType": {
1183
+ "type": "pushwoosh.aibuilder.v1.DisplayConditionValueType"
1184
+ }
1185
+ }
1186
+ },
1187
+ "pushwoosh.aibuilder.v1.DisplayCondition": {
1188
+ "type": "I",
1189
+ "fields": {
1190
+ "enabled": {
1191
+ "type": "boolean"
1192
+ },
1193
+ "combinator": {
1194
+ "type": "pushwoosh.aibuilder.v1.DisplayConditionCombinator"
1195
+ },
1196
+ "rules": {
1197
+ "type": "pushwoosh.aibuilder.v1.DisplayConditionRule",
1198
+ "array": true
1199
+ },
1200
+ "unknown": {
1201
+ "type": "pushwoosh.aibuilder.v1.DisplayConditionUnknown"
1202
+ },
1203
+ "liquidExpr": {
1204
+ "type": "string"
1205
+ },
1206
+ "chain": {
1207
+ "type": "pushwoosh.aibuilder.v1.DisplayConditionChain"
1208
+ }
1209
+ }
1210
+ },
1211
+ "pushwoosh.aibuilder.v1.ProductsSource": {
1212
+ "type": "E",
1213
+ "values": [
1214
+ "PRODUCTS_SOURCE_UNSPECIFIED",
1215
+ "PRODUCTS_SOURCE_MANUAL",
1216
+ "PRODUCTS_SOURCE_RULE",
1217
+ "PRODUCTS_SOURCE_CART"
1218
+ ]
1219
+ },
1220
+ "pushwoosh.aibuilder.v1.ProductsRuleSort": {
1221
+ "type": "E",
1222
+ "values": [
1223
+ "PRODUCTS_RULE_SORT_UNSPECIFIED",
1224
+ "PRODUCTS_RULE_SORT_NEWEST",
1225
+ "PRODUCTS_RULE_SORT_PRICE_ASC",
1226
+ "PRODUCTS_RULE_SORT_PRICE_DESC",
1227
+ "PRODUCTS_RULE_SORT_TITLE"
1228
+ ]
1229
+ },
1230
+ "pushwoosh.aibuilder.v1.ProductsRule": {
1231
+ "type": "I",
1232
+ "fields": {
1233
+ "application": {
1234
+ "type": "string"
1235
+ },
1236
+ "feedOrigin": {
1237
+ "type": "string"
1238
+ },
1239
+ "category": {
1240
+ "type": "string"
1241
+ },
1242
+ "sort": {
1243
+ "type": "pushwoosh.aibuilder.v1.ProductsRuleSort"
1244
+ },
1245
+ "limit": {
1246
+ "type": "number"
1247
+ }
1248
+ }
1249
+ },
1250
+ "pushwoosh.aibuilder.v1.ProductsCart": {
1251
+ "type": "I",
1252
+ "fields": {
1253
+ "application": {
1254
+ "type": "string"
1255
+ },
1256
+ "feedOrigin": {
1257
+ "type": "string"
1258
+ },
1259
+ "limit": {
1260
+ "type": "number"
1261
+ }
1262
+ }
1263
+ },
1264
+ "pushwoosh.aibuilder.v1.ProductItem": {
1265
+ "type": "I",
1266
+ "fields": {
1267
+ "catalogId": {
1268
+ "type": "string"
1269
+ },
1270
+ "image": {
1271
+ "type": "pushwoosh.aibuilder.v1.Image",
1272
+ "optional": true
1273
+ },
1274
+ "title": {
1275
+ "type": "string"
1276
+ },
1277
+ "titleTranslations": {
1278
+ "type": "string",
1279
+ "mapKeyType": "string"
1280
+ },
1281
+ "description": {
1282
+ "type": "string"
1283
+ },
1284
+ "descriptionTranslations": {
1285
+ "type": "string",
1286
+ "mapKeyType": "string"
1287
+ },
1288
+ "price": {
1289
+ "type": "string"
1290
+ },
1291
+ "oldPrice": {
1292
+ "type": "string"
1293
+ },
1294
+ "url": {
1295
+ "type": "string"
1296
+ }
1297
+ }
1298
+ },
1299
+ "pushwoosh.aibuilder.v1.ProductsData": {
1300
+ "type": "I",
1301
+ "fields": {
1302
+ "source": {
1303
+ "type": "pushwoosh.aibuilder.v1.ProductsSource"
1304
+ },
1305
+ "rule": {
1306
+ "type": "pushwoosh.aibuilder.v1.ProductsRule",
1307
+ "optional": true
1308
+ },
1309
+ "cart": {
1310
+ "type": "pushwoosh.aibuilder.v1.ProductsCart",
1311
+ "optional": true
1312
+ },
1313
+ "descriptionLimit": {
1314
+ "type": "number",
1315
+ "optional": true
1316
+ },
1317
+ "products": {
1318
+ "type": "pushwoosh.aibuilder.v1.ProductItem",
1319
+ "array": true
1320
+ },
1321
+ "template": {
1322
+ "type": "pushwoosh.aibuilder.v1.AiBuilderCard",
1323
+ "optional": true
1324
+ },
1325
+ "templateStyles": {
1326
+ "type": "pushwoosh.aibuilder.v1.BlockStyles",
1327
+ "optional": true
1328
+ },
1329
+ "columns": {
1330
+ "type": "number",
1331
+ "optional": true
1332
+ },
1333
+ "gap": {
1334
+ "type": "number",
1335
+ "optional": true
1336
+ }
1337
+ }
1338
+ },
1077
1339
  "pushwoosh.aibuilder.v1.AiBuilderBlock": {
1078
1340
  "type": "I",
1079
1341
  "fields": {
@@ -1108,6 +1370,14 @@ export const data = {
1108
1370
  },
1109
1371
  "parentId": {
1110
1372
  "type": "string"
1373
+ },
1374
+ "displayCondition": {
1375
+ "type": "pushwoosh.aibuilder.v1.DisplayCondition",
1376
+ "optional": true
1377
+ },
1378
+ "products": {
1379
+ "type": "pushwoosh.aibuilder.v1.ProductsData",
1380
+ "optional": true
1111
1381
  }
1112
1382
  },
1113
1383
  "oneofs": {
@@ -1279,9 +1549,33 @@ export const data = {
1279
1549
  "underlineLinks": {
1280
1550
  "type": "boolean",
1281
1551
  "optional": true
1552
+ },
1553
+ "socialIconShape": {
1554
+ "type": "pushwoosh.aibuilder.v1.SocialIconShape"
1555
+ },
1556
+ "socialIconVariant": {
1557
+ "type": "pushwoosh.aibuilder.v1.SocialIconVariant"
1282
1558
  }
1283
1559
  }
1284
1560
  },
1561
+ "pushwoosh.aibuilder.v1.SocialIconShape": {
1562
+ "type": "E",
1563
+ "values": [
1564
+ "SOCIAL_ICON_SHAPE_UNSPECIFIED",
1565
+ "SOCIAL_ICON_SHAPE_CIRCLE",
1566
+ "SOCIAL_ICON_SHAPE_SQUARE",
1567
+ "SOCIAL_ICON_SHAPE_REGULAR"
1568
+ ]
1569
+ },
1570
+ "pushwoosh.aibuilder.v1.SocialIconVariant": {
1571
+ "type": "E",
1572
+ "values": [
1573
+ "SOCIAL_ICON_VARIANT_UNSPECIFIED",
1574
+ "SOCIAL_ICON_VARIANT_BLACK",
1575
+ "SOCIAL_ICON_VARIANT_WHITE",
1576
+ "SOCIAL_ICON_VARIANT_COLOR"
1577
+ ]
1578
+ },
1285
1579
  "pushwoosh.aibuilder.v1.EmailSettings": {
1286
1580
  "type": "I",
1287
1581
  "fields": {
@@ -1420,6 +1714,10 @@ export const data = {
1420
1714
  "languages": {
1421
1715
  "type": "string",
1422
1716
  "array": true
1717
+ },
1718
+ "darkColorScheme": {
1719
+ "type": "pushwoosh.aibuilder.v1.DarkColorScheme",
1720
+ "optional": true
1423
1721
  }
1424
1722
  }
1425
1723
  },
@@ -1453,6 +1751,12 @@ export const data = {
1453
1751
  "method": "post",
1454
1752
  "path": "/api/v1/aigen/convert-unlayer"
1455
1753
  },
1754
+ "DocumentToHtml": {
1755
+ "request": "pushwoosh.aigen.v1.AiGenDocumentToHtmlRequest",
1756
+ "response": "pushwoosh.aigen.v1.AiGenDocumentToHtmlResponse",
1757
+ "method": "post",
1758
+ "path": "/api/v1/aigen/document-to-html"
1759
+ },
1456
1760
  "GenerateMediaImage": {
1457
1761
  "request": "pushwoosh.aigen.v1.AiGenMediaImageRequest",
1458
1762
  "response": "pushwoosh.aigen.v1.AiGenMediaImageResponse",
@@ -1907,10 +2211,10 @@ export const data = {
1907
2211
  "type": "I",
1908
2212
  "fields": {
1909
2213
  "editorConfig": {
1910
- "type": "object"
2214
+ "type": "JsonObject"
1911
2215
  },
1912
2216
  "localizationData": {
1913
- "type": "object"
2217
+ "type": "JsonObject"
1914
2218
  },
1915
2219
  "language": {
1916
2220
  "type": "string"
@@ -1944,6 +2248,59 @@ export const data = {
1944
2248
  }
1945
2249
  }
1946
2250
  },
2251
+ "pushwoosh.aigen.v1.AiGenDocumentToHtmlRequest": {
2252
+ "type": "I",
2253
+ "fields": {
2254
+ "document": {
2255
+ "type": "pushwoosh.aibuilder.v1.AiBuilderDocument"
2256
+ },
2257
+ "application": {
2258
+ "type": "string"
2259
+ },
2260
+ "timerBaseUrl": {
2261
+ "type": "string"
2262
+ },
2263
+ "syncedBlockTags": {
2264
+ "type": "boolean",
2265
+ "optional": true
2266
+ },
2267
+ "displayConditionTags": {
2268
+ "type": "boolean",
2269
+ "optional": true
2270
+ },
2271
+ "dynamicProductTags": {
2272
+ "type": "boolean",
2273
+ "optional": true
2274
+ },
2275
+ "webVersionLabel": {
2276
+ "type": "string"
2277
+ }
2278
+ }
2279
+ },
2280
+ "pushwoosh.aigen.v1.LocalizationLanguage": {
2281
+ "type": "I",
2282
+ "fields": {
2283
+ "values": {
2284
+ "type": "string",
2285
+ "mapKeyType": "string"
2286
+ }
2287
+ }
2288
+ },
2289
+ "pushwoosh.aigen.v1.AiGenDocumentToHtmlResponse": {
2290
+ "type": "I",
2291
+ "fields": {
2292
+ "html": {
2293
+ "type": "string"
2294
+ },
2295
+ "localizationData": {
2296
+ "type": "pushwoosh.aigen.v1.LocalizationLanguage",
2297
+ "mapKeyType": "string"
2298
+ },
2299
+ "document": {
2300
+ "type": "pushwoosh.aibuilder.v1.AiBuilderDocument"
2301
+ }
2302
+ }
2303
+ },
1947
2304
  "pushwoosh.aigen.v1.AiGenMediaImageRequest": {
1948
2305
  "type": "I",
1949
2306
  "fields": {
@@ -2882,7 +3239,7 @@ export const data = {
2882
3239
  "optional": true
2883
3240
  },
2884
3241
  "template": {
2885
- "type": "object"
3242
+ "type": "JsonObject"
2886
3243
  },
2887
3244
  "categories": {
2888
3245
  "type": "string",
@@ -3017,7 +3374,7 @@ export const data = {
3017
3374
  "optional": true
3018
3375
  },
3019
3376
  "template": {
3020
- "type": "object"
3377
+ "type": "JsonObject"
3021
3378
  },
3022
3379
  "categories": {
3023
3380
  "type": "string",
@@ -3051,7 +3408,7 @@ export const data = {
3051
3408
  "optional": true
3052
3409
  },
3053
3410
  "template": {
3054
- "type": "object"
3411
+ "type": "JsonObject"
3055
3412
  },
3056
3413
  "updateCategories": {
3057
3414
  "type": "boolean"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/rpc-gateway-ai-assistant",
3
- "version": "0.1.249",
3
+ "version": "0.1.250",
4
4
  "description": "AI Assistant api gateway HTTP API Types and Data",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -178,6 +178,21 @@ export type ColorSchemeItem = {
178
178
  color: string;
179
179
  description: string;
180
180
  };
181
+ /**
182
+ * Authored dark palette. Blocks store resolved hex, not slot references, so
183
+ * dark mode works by value: the renderer builds light-hex → dark-hex maps from
184
+ * the two palettes and rewrites the emitted HTML, pairing `pwd-N` class hooks
185
+ * with @media (prefers-color-scheme: dark) overrides.
186
+ *
187
+ * Absent is NOT the same as disabled-with-a-palette: without one the document
188
+ * declares `color-scheme: only light`, opting out of client recolouring
189
+ * entirely, because one light palette recoloured by a mail client collapses
190
+ * dark text onto a dark canvas.
191
+ */
192
+ export type DarkColorScheme = {
193
+ enabled: boolean;
194
+ colors: Record<string, ColorSchemeItem>;
195
+ };
181
196
  export type EdgeInsets = {
182
197
  top: number;
183
198
  right: number;
@@ -776,6 +791,11 @@ export type ContentItem = {
776
791
  * the client's automatic mobile clamp. Client-managed, hidden from the LLM.
777
792
  */
778
793
  mobilePadding?: EdgeInsets;
794
+ /**
795
+ * Per-recipient visibility of this item, compiled to Liquid on save.
796
+ * Client-managed: the model must never invent targeting rules.
797
+ */
798
+ displayCondition?: DisplayCondition;
779
799
  item: ContentItem_item;
780
800
  };
781
801
  export type Content = {
@@ -844,6 +864,22 @@ export type AiBuilderCard = {
844
864
  * Unset → centre (50/50). Applies to the image layouts only.
845
865
  */
846
866
  imagePosition?: CardImagePosition;
867
+ /**
868
+ * LEFT/RIGHT only: float the image so copy flows around it instead of
869
+ * sitting in a separate column. Unset = off, which keeps pre-wrap documents
870
+ * on their two-column look. Client-managed.
871
+ */
872
+ imageWrap?: boolean;
873
+ /**
874
+ * Mobile override of image.padding for the TOP/LEFT/RIGHT slots.
875
+ * Client-managed.
876
+ */
877
+ imageMobilePadding?: EdgeInsets;
878
+ /**
879
+ * LEFT/RIGHT crop box: image height as a percentage of the image column's
880
+ * width. Unset = natural height. Client-managed.
881
+ */
882
+ sideImageRatio?: number;
847
883
  };
848
884
  export type AiBuilderColumns = {
849
885
  columns: AiBuilderColumn[];
@@ -861,6 +897,18 @@ export type AiBuilderColumn = {
861
897
  * for this column when set. Client-managed; the LLM never sets it.
862
898
  */
863
899
  padding?: EdgeInsets;
900
+ /**
901
+ * Slot-image geometry, same contract as the card's: size drives the WIDTH
902
+ * (unset = spans the cell), an explicit height or a crop ratio fixes the
903
+ * box, and the fit crops into it. CLIENT even though the card's image_fit is
904
+ * MODEL — for columns these have always been the editor's, and widening a
905
+ * policy later is safe while narrowing one is not.
906
+ */
907
+ imageSize?: CardImageSize;
908
+ imageFit?: CardImageFit;
909
+ imagePosition?: CardImagePosition;
910
+ /** Crop box: image height as a percentage of the cell width. Unset = natural. */
911
+ imageRatio?: number;
864
912
  };
865
913
  /**
866
914
  * AiBuilderGroup is a structural stack container. Children live as
@@ -969,6 +1017,118 @@ export type SyncedBlockRef = {
969
1017
  */
970
1018
  fragmentCode: string;
971
1019
  };
1020
+ export type DisplayConditionOp =
1021
+ /** Invalid: the rule is skipped at compile, as a malformed rule is today. */
1022
+ 'DISPLAY_CONDITION_OP_UNSPECIFIED' | 'DISPLAY_CONDITION_OP_EQ' | 'DISPLAY_CONDITION_OP_NEQ' | 'DISPLAY_CONDITION_OP_GT' | 'DISPLAY_CONDITION_OP_GTE' | 'DISPLAY_CONDITION_OP_LT' | 'DISPLAY_CONDITION_OP_LTE' | 'DISPLAY_CONDITION_OP_CONTAINS' | 'DISPLAY_CONDITION_OP_NOT_CONTAINS'
1023
+ /** Presence checks; `value` is ignored. */
1024
+ | 'DISPLAY_CONDITION_OP_EXISTS' | 'DISPLAY_CONDITION_OP_NOT_EXISTS';
1025
+ export type DisplayConditionValueType =
1026
+ /** Renders as STRING. */
1027
+ 'DISPLAY_CONDITION_VALUE_TYPE_UNSPECIFIED' | 'DISPLAY_CONDITION_VALUE_TYPE_STRING' | 'DISPLAY_CONDITION_VALUE_TYPE_NUMBER' | 'DISPLAY_CONDITION_VALUE_TYPE_BOOLEAN';
1028
+ export type DisplayConditionCombinator =
1029
+ /** Renders as AND. */
1030
+ 'DISPLAY_CONDITION_COMBINATOR_UNSPECIFIED' | 'DISPLAY_CONDITION_COMBINATOR_AND' | 'DISPLAY_CONDITION_COMBINATOR_OR';
1031
+ /** What to do for a recipient missing a referenced value. UNSPECIFIED = HIDE. */
1032
+ export type DisplayConditionUnknown = 'DISPLAY_CONDITION_UNKNOWN_UNSPECIFIED' | 'DISPLAY_CONDITION_UNKNOWN_HIDE' | 'DISPLAY_CONDITION_UNKNOWN_SHOW';
1033
+ /**
1034
+ * Branch role in an if/elsif/else chain of ADJACENT siblings; exactly one
1035
+ * branch renders. UNSPECIFIED = a standalone {% if %}.
1036
+ */
1037
+ export type DisplayConditionChain = 'DISPLAY_CONDITION_CHAIN_UNSPECIFIED' | 'DISPLAY_CONDITION_CHAIN_ELSIF' | 'DISPLAY_CONDITION_CHAIN_ELSE';
1038
+ export type DisplayConditionRule = {
1039
+ /**
1040
+ * Tag / dynamic-content variable exactly as the user typed it; the emitter
1041
+ * strips spaces to reach the Liquid binding name.
1042
+ */
1043
+ name: string;
1044
+ op: DisplayConditionOp;
1045
+ /** Raw input, parsed per value_type at compile. Ignored for EXISTS/NOT_EXISTS. */
1046
+ value: string;
1047
+ valueType: DisplayConditionValueType;
1048
+ };
1049
+ export type DisplayCondition = {
1050
+ /** False keeps the rules stored without emitting anything. */
1051
+ enabled: boolean;
1052
+ combinator: DisplayConditionCombinator;
1053
+ rules: DisplayConditionRule[];
1054
+ unknown: DisplayConditionUnknown;
1055
+ /**
1056
+ * Advanced mode: a raw Liquid boolean expression. Non-empty REPLACES `rules`
1057
+ * and is emitted verbatim — never escaped, never validated server-side.
1058
+ * "" = unset.
1059
+ */
1060
+ liquidExpr: string;
1061
+ chain: DisplayConditionChain;
1062
+ };
1063
+ export type ProductsSource =
1064
+ /** Renders as MANUAL. */
1065
+ 'PRODUCTS_SOURCE_UNSPECIFIED' | 'PRODUCTS_SOURCE_MANUAL' | 'PRODUCTS_SOURCE_RULE' | 'PRODUCTS_SOURCE_CART';
1066
+ export type ProductsRuleSort =
1067
+ /** Invalid: the rule degrades to MANUAL, as a malformed payload does today. */
1068
+ 'PRODUCTS_RULE_SORT_UNSPECIFIED' | 'PRODUCTS_RULE_SORT_NEWEST' | 'PRODUCTS_RULE_SORT_PRICE_ASC' | 'PRODUCTS_RULE_SORT_PRICE_DESC' | 'PRODUCTS_RULE_SORT_TITLE';
1069
+ /**
1070
+ * Catalog feed. A payload missing feed_origin, sort or a positive limit
1071
+ * degrades to MANUAL rather than emitting a call to a garbage URL.
1072
+ */
1073
+ export type ProductsRule = {
1074
+ application: string;
1075
+ /** Environment-resolved feed host. "" = unset → degrades to MANUAL. */
1076
+ feedOrigin: string;
1077
+ /** "" = unset (the query parameter is omitted). */
1078
+ category: string;
1079
+ sort: ProductsRuleSort;
1080
+ /** Grid cells emitted, and the feed limit. <= 0 → degrades to MANUAL. */
1081
+ limit: number;
1082
+ };
1083
+ /** Abandoned cart of the recipient. Same degradation contract as ProductsRule. */
1084
+ export type ProductsCart = {
1085
+ application: string;
1086
+ feedOrigin: string;
1087
+ limit: number;
1088
+ };
1089
+ /**
1090
+ * One product row. The card design lives in ProductsData.template; elements
1091
+ * whose plain text is exactly "$title" / "$description" / "$price" /
1092
+ * "$oldPrice" bind to these fields, as do an image src of "$image" and a
1093
+ * button url of "$url".
1094
+ */
1095
+ export type ProductItem = {
1096
+ /** Account catalog id when the row was picked from the catalog. "" = unset. */
1097
+ catalogId: string;
1098
+ image?: Image;
1099
+ title: string;
1100
+ titleTranslations: Record<string, string>;
1101
+ description: string;
1102
+ descriptionTranslations: Record<string, string>;
1103
+ price: string;
1104
+ oldPrice: string;
1105
+ url: string;
1106
+ };
1107
+ export type ProductsData = {
1108
+ source: ProductsSource;
1109
+ rule?: ProductsRule;
1110
+ cart?: ProductsCart;
1111
+ /**
1112
+ * Rendered-description cap in characters. Unset = renderer default,
1113
+ * explicit 0 = off.
1114
+ */
1115
+ descriptionLimit?: number;
1116
+ /**
1117
+ * Rows for MANUAL, and the baked preview rows shown for RULE / CART outside
1118
+ * the save path.
1119
+ */
1120
+ products: ProductItem[];
1121
+ /**
1122
+ * The card rendered once per row. Absent = the block falls back to the
1123
+ * stand-in card in the oneof.
1124
+ */
1125
+ template?: AiBuilderCard;
1126
+ templateStyles?: BlockStyles;
1127
+ /** Grid columns, clamped 1..3 by the renderer. Unset = renderer default. */
1128
+ columns?: number;
1129
+ /** Gap between cells in px. Unset = renderer default. */
1130
+ gap?: number;
1131
+ };
972
1132
  export type AiBuilderBlock_block_card = {
973
1133
  type: 'card';
974
1134
  data: AiBuilderCard;
@@ -1009,6 +1169,14 @@ export type AiBuilderBlock = {
1009
1169
  * structures appropriate for each channel.
1010
1170
  */
1011
1171
  parentId: string;
1172
+ /** Per-recipient visibility of this block, compiled to Liquid on save. */
1173
+ displayCondition?: DisplayCondition;
1174
+ /**
1175
+ * Products repeater. When set it OWNS the block's rendering and the oneof
1176
+ * holds a stand-in card, so the model (and an older editor) still sees a
1177
+ * valid block.
1178
+ */
1179
+ products?: ProductsData;
1012
1180
  block: AiBuilderBlock_block;
1013
1181
  };
1014
1182
  /**
@@ -1099,7 +1267,25 @@ export type FooterStyle = {
1099
1267
  * Optional so absent keeps the client default (underlined).
1100
1268
  */
1101
1269
  underlineLinks?: boolean;
1270
+ /**
1271
+ * Look of the social icons; both UNSPECIFIED reproduce today's defaults
1272
+ * (circle / black), so an absent value renders as it always has.
1273
+ */
1274
+ socialIconShape: SocialIconShape;
1275
+ socialIconVariant: SocialIconVariant;
1102
1276
  };
1277
+ /**
1278
+ * Renderer picks a hosted icon set from these two. The value names are not
1279
+ * cosmetic: they are the asset path segment and filename suffix
1280
+ * (<base>/<shape>/<platform>-<shape>-<variant>.png), so an invented value is a
1281
+ * 404, not a fallback.
1282
+ */
1283
+ export type SocialIconShape =
1284
+ /** Renders as CIRCLE. */
1285
+ 'SOCIAL_ICON_SHAPE_UNSPECIFIED' | 'SOCIAL_ICON_SHAPE_CIRCLE' | 'SOCIAL_ICON_SHAPE_SQUARE' | 'SOCIAL_ICON_SHAPE_REGULAR';
1286
+ export type SocialIconVariant =
1287
+ /** Renders as BLACK. */
1288
+ 'SOCIAL_ICON_VARIANT_UNSPECIFIED' | 'SOCIAL_ICON_VARIANT_BLACK' | 'SOCIAL_ICON_VARIANT_WHITE' | 'SOCIAL_ICON_VARIANT_COLOR';
1103
1289
  /**
1104
1290
  * EmailSettings holds the email-only document-level fields produced by
1105
1291
  * the meta generator under mode=EMAIL. Populated only when the
@@ -1231,4 +1417,9 @@ export type AiBuilderDocument = {
1231
1417
  * language may be listed before any translation exists. Client-managed.
1232
1418
  */
1233
1419
  languages: string[];
1420
+ /**
1421
+ * Authored dark palette, paired with color_scheme. Absent = the document
1422
+ * opts out of dark mode; see DarkColorScheme. Client-managed.
1423
+ */
1424
+ darkColorScheme?: DarkColorScheme;
1234
1425
  };
@@ -1,4 +1,4 @@
1
- import { RpcMethod } from './commonTypes';
1
+ import { RpcMethod, JsonObject } from './commonTypes';
2
2
  import { AiBuilderDocument as pushwoosh_aibuilder_v1_AiBuilderDocument } from './pushwoosh_aibuilder_v1';
3
3
  import { DocumentSettings as pushwoosh_aibuilder_v1_DocumentSettings } from './pushwoosh_aibuilder_v1';
4
4
  import { TextVariantStyle as pushwoosh_aibuilder_v1_TextVariantStyle } from './pushwoosh_aibuilder_v1';
@@ -6,6 +6,7 @@ import { ColorSchemeItem as pushwoosh_aibuilder_v1_ColorSchemeItem } from './pus
6
6
  import { AiBuilderBlock as pushwoosh_aibuilder_v1_AiBuilderBlock } from './pushwoosh_aibuilder_v1';
7
7
  export type AiGenService_ExtractStyle = RpcMethod<AiGenExtractStyleRequest, AiGenExtractStyleResponse>;
8
8
  export type AiGenService_ConvertUnlayer = RpcMethod<AiGenConvertUnlayerRequest, AiGenConvertUnlayerResponse>;
9
+ export type AiGenService_DocumentToHtml = RpcMethod<AiGenDocumentToHtmlRequest, AiGenDocumentToHtmlResponse>;
9
10
  export type AiGenService_GenerateMediaImage = RpcMethod<AiGenMediaImageRequest, AiGenMediaImageResponse>;
10
11
  export type AiGenService_SearchStockPhotos = RpcMethod<AiGenStockSearchRequest, AiGenStockSearchResponse>;
11
12
  export type AiGenService_ImportStockPhoto = RpcMethod<AiGenStockImportRequest, AiGenStockImportResponse>;
@@ -77,6 +78,22 @@ export interface AiGenService {
77
78
  * document validation. Unary; the result is document-sized.
78
79
  */
79
80
  ConvertUnlayer: AiGenService_ConvertUnlayer;
81
+ /**
82
+ * DocumentToHtml renders an AiBuilderDocument to the finished email HTML
83
+ * deterministically — no LLM, byte-for-byte the same output the editor
84
+ * produces on save. It is the counterpart of RenderHtml: use RenderHtml
85
+ * when you want the model to reimagine the layout ("style it like this
86
+ * design"), use this when you want THE html of this document.
87
+ *
88
+ * The response carries the rendered html, the per-language localization
89
+ * map, and the document that produced them, so a caller can write the
90
+ * whole smartcards EmailContent without a second round-trip and without
91
+ * being able to desync the three.
92
+ *
93
+ * EMAIL only for now. Unary: the render is fast and the result is one
94
+ * document.
95
+ */
96
+ DocumentToHtml: AiGenService_DocumentToHtml;
80
97
  /**
81
98
  * GenerateMediaImage generates ONE image from a prompt and stores it in
82
99
  * the application's media library — the media-gallery "Generate" tab.
@@ -593,7 +610,7 @@ export type AiGenConvertUnlayerRequest = {
593
610
  * The Unlayer design JSON (EmailContent.Unlayer.editor_config): the
594
611
  * object carrying body.rows[].columns[].contents[]. Required.
595
612
  */
596
- editorConfig: object;
613
+ editorConfig: JsonObject;
597
614
  /**
598
615
  * Unlayer localization placeholders. Accepts either the per-language
599
616
  * map {"<lang>": {"<path>": "<value>"}} stored alongside the design in
@@ -602,7 +619,7 @@ export type AiGenConvertUnlayerRequest = {
602
619
  * {{path|type|fallback}} tokens during conversion. Optional — without
603
620
  * it tokens resolve to their inline fallbacks.
604
621
  */
605
- localizationData: object;
622
+ localizationData: JsonObject;
606
623
  /**
607
624
  * Language key to resolve localized values with when localization_data
608
625
  * is per-language. Empty → "default", falling back to the first
@@ -653,6 +670,59 @@ export type AiGenConvertUnlayerResponse = {
653
670
  */
654
671
  warnings: string[];
655
672
  };
673
+ export type AiGenDocumentToHtmlRequest = {
674
+ /** The document to render. Required; must carry at least one page. */
675
+ document: pushwoosh_aibuilder_v1_AiBuilderDocument;
676
+ /**
677
+ * Application id. Required: it scopes the request and it is how the
678
+ * renderer resolves the products feed credential, which is deliberately
679
+ * not a document field (see the note on ProductsRule).
680
+ */
681
+ application: string;
682
+ /**
683
+ * Base URL for the countdown-GIF service baked into timer items. Empty =
684
+ * the server default. Note it lands in SENT EMAIL, fetched by recipients'
685
+ * mail clients, so it is never a localhost route.
686
+ */
687
+ timerBaseUrl: string;
688
+ /**
689
+ * Save-path emission, all three ON when unset — that is what the editor
690
+ * does on save, and a plain proto-false default would quietly produce
691
+ * preview HTML (baked product rows, no Liquid) that looks right and sends
692
+ * wrong. Set false only to render a preview.
693
+ */
694
+ syncedBlockTags?: boolean;
695
+ displayConditionTags?: boolean;
696
+ dynamicProductTags?: boolean;
697
+ /**
698
+ * Anchor text of the "view in browser" strip. Empty = the built-in label
699
+ * for the document's default language.
700
+ */
701
+ webVersionLabel: string;
702
+ };
703
+ /**
704
+ * A per-language {key: value} map. proto forbids a map whose value is a map,
705
+ * so the inner one is wrapped.
706
+ */
707
+ export type LocalizationLanguage = {
708
+ values: Record<string, string>;
709
+ };
710
+ export type AiGenDocumentToHtmlResponse = {
711
+ /** The complete email document, ready to store as EmailContent.Smartcards.html. */
712
+ html: string;
713
+ /**
714
+ * Per-language values for the {{key|html|}} tokens in `html`, keyed by
715
+ * language ("default" plus each translated language). Empty for a
716
+ * single-language document, which carries no tokens.
717
+ */
718
+ localizationData: Record<string, LocalizationLanguage>;
719
+ /**
720
+ * The document these two were rendered from. Returned so the caller stores
721
+ * the same triple the editor does — html, localization_data and content —
722
+ * without being able to desync them.
723
+ */
724
+ document: pushwoosh_aibuilder_v1_AiBuilderDocument;
725
+ };
656
726
  export type AiGenMediaImageRequest = {
657
727
  application: string;
658
728
  /** Image generation prompt; required, capped server-side. */
@@ -1,4 +1,4 @@
1
- import { RpcMethod } from './commonTypes';
1
+ import { RpcMethod, JsonObject } from './commonTypes';
2
2
  export type TemplatesService_List = RpcMethod<ListRequest, ListResponse>;
3
3
  export type TemplatesService_Get = RpcMethod<GetRequest, GetResponse>;
4
4
  export type TemplatesService_Create = RpcMethod<CreateRequest, CreateResponse>;
@@ -46,7 +46,7 @@ export type Template = {
46
46
  * The template document itself: any valid JSON object, opaque to this
47
47
  * service.
48
48
  */
49
- template: object;
49
+ template: JsonObject;
50
50
  /** Category tags attached to this template. Order is not significant. */
51
51
  categories: string[];
52
52
  /** Creation timestamp. */
@@ -113,7 +113,7 @@ export type CreateRequest = {
113
113
  /** Optional free-form description. */
114
114
  description?: string;
115
115
  /** The template document: any valid JSON object. */
116
- template: object;
116
+ template: JsonObject;
117
117
  /** Category tags to attach. May be empty. */
118
118
  categories: string[];
119
119
  };
@@ -134,7 +134,7 @@ export type UpdateRequest = {
134
134
  * New template document (any valid JSON object). Only applied when set
135
135
  * (message presence).
136
136
  */
137
- template: object;
137
+ template: JsonObject;
138
138
  /**
139
139
  * Controls how categories is applied (PATCH semantics):
140
140
  * - true → replace categories with the provided list