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

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": {
@@ -930,6 +946,10 @@ export const data = {
930
946
  },
931
947
  "mobileAlign": {
932
948
  "type": "pushwoosh.aibuilder.v1.TextAlign"
949
+ },
950
+ "mobileWidth": {
951
+ "type": "string",
952
+ "optional": true
933
953
  }
934
954
  }
935
955
  },
@@ -960,6 +980,18 @@ export const data = {
960
980
  "imagePosition": {
961
981
  "type": "pushwoosh.aibuilder.v1.CardImagePosition",
962
982
  "optional": true
983
+ },
984
+ "imageWrap": {
985
+ "type": "boolean",
986
+ "optional": true
987
+ },
988
+ "imageMobilePadding": {
989
+ "type": "pushwoosh.aibuilder.v1.EdgeInsets",
990
+ "optional": true
991
+ },
992
+ "sideImageRatio": {
993
+ "type": "number",
994
+ "optional": true
963
995
  }
964
996
  }
965
997
  },
@@ -996,6 +1028,22 @@ export const data = {
996
1028
  "padding": {
997
1029
  "type": "pushwoosh.aibuilder.v1.EdgeInsets",
998
1030
  "optional": true
1031
+ },
1032
+ "imageSize": {
1033
+ "type": "pushwoosh.aibuilder.v1.CardImageSize",
1034
+ "optional": true
1035
+ },
1036
+ "imageFit": {
1037
+ "type": "pushwoosh.aibuilder.v1.CardImageFit",
1038
+ "optional": true
1039
+ },
1040
+ "imagePosition": {
1041
+ "type": "pushwoosh.aibuilder.v1.CardImagePosition",
1042
+ "optional": true
1043
+ },
1044
+ "imageRatio": {
1045
+ "type": "number",
1046
+ "optional": true
999
1047
  }
1000
1048
  }
1001
1049
  },
@@ -1074,6 +1122,224 @@ export const data = {
1074
1122
  }
1075
1123
  }
1076
1124
  },
1125
+ "pushwoosh.aibuilder.v1.DisplayConditionOp": {
1126
+ "type": "E",
1127
+ "values": [
1128
+ "DISPLAY_CONDITION_OP_UNSPECIFIED",
1129
+ "DISPLAY_CONDITION_OP_EQ",
1130
+ "DISPLAY_CONDITION_OP_NEQ",
1131
+ "DISPLAY_CONDITION_OP_GT",
1132
+ "DISPLAY_CONDITION_OP_GTE",
1133
+ "DISPLAY_CONDITION_OP_LT",
1134
+ "DISPLAY_CONDITION_OP_LTE",
1135
+ "DISPLAY_CONDITION_OP_CONTAINS",
1136
+ "DISPLAY_CONDITION_OP_NOT_CONTAINS",
1137
+ "DISPLAY_CONDITION_OP_EXISTS",
1138
+ "DISPLAY_CONDITION_OP_NOT_EXISTS"
1139
+ ]
1140
+ },
1141
+ "pushwoosh.aibuilder.v1.DisplayConditionValueType": {
1142
+ "type": "E",
1143
+ "values": [
1144
+ "DISPLAY_CONDITION_VALUE_TYPE_UNSPECIFIED",
1145
+ "DISPLAY_CONDITION_VALUE_TYPE_STRING",
1146
+ "DISPLAY_CONDITION_VALUE_TYPE_NUMBER",
1147
+ "DISPLAY_CONDITION_VALUE_TYPE_BOOLEAN"
1148
+ ]
1149
+ },
1150
+ "pushwoosh.aibuilder.v1.DisplayConditionCombinator": {
1151
+ "type": "E",
1152
+ "values": [
1153
+ "DISPLAY_CONDITION_COMBINATOR_UNSPECIFIED",
1154
+ "DISPLAY_CONDITION_COMBINATOR_AND",
1155
+ "DISPLAY_CONDITION_COMBINATOR_OR"
1156
+ ]
1157
+ },
1158
+ "pushwoosh.aibuilder.v1.DisplayConditionUnknown": {
1159
+ "type": "E",
1160
+ "values": [
1161
+ "DISPLAY_CONDITION_UNKNOWN_UNSPECIFIED",
1162
+ "DISPLAY_CONDITION_UNKNOWN_HIDE",
1163
+ "DISPLAY_CONDITION_UNKNOWN_SHOW"
1164
+ ]
1165
+ },
1166
+ "pushwoosh.aibuilder.v1.DisplayConditionChain": {
1167
+ "type": "E",
1168
+ "values": [
1169
+ "DISPLAY_CONDITION_CHAIN_UNSPECIFIED",
1170
+ "DISPLAY_CONDITION_CHAIN_ELSIF",
1171
+ "DISPLAY_CONDITION_CHAIN_ELSE"
1172
+ ]
1173
+ },
1174
+ "pushwoosh.aibuilder.v1.DisplayConditionRule": {
1175
+ "type": "I",
1176
+ "fields": {
1177
+ "name": {
1178
+ "type": "string"
1179
+ },
1180
+ "op": {
1181
+ "type": "pushwoosh.aibuilder.v1.DisplayConditionOp"
1182
+ },
1183
+ "value": {
1184
+ "type": "string"
1185
+ },
1186
+ "valueType": {
1187
+ "type": "pushwoosh.aibuilder.v1.DisplayConditionValueType"
1188
+ }
1189
+ }
1190
+ },
1191
+ "pushwoosh.aibuilder.v1.DisplayCondition": {
1192
+ "type": "I",
1193
+ "fields": {
1194
+ "enabled": {
1195
+ "type": "boolean"
1196
+ },
1197
+ "combinator": {
1198
+ "type": "pushwoosh.aibuilder.v1.DisplayConditionCombinator"
1199
+ },
1200
+ "rules": {
1201
+ "type": "pushwoosh.aibuilder.v1.DisplayConditionRule",
1202
+ "array": true
1203
+ },
1204
+ "unknown": {
1205
+ "type": "pushwoosh.aibuilder.v1.DisplayConditionUnknown"
1206
+ },
1207
+ "liquidExpr": {
1208
+ "type": "string"
1209
+ },
1210
+ "chain": {
1211
+ "type": "pushwoosh.aibuilder.v1.DisplayConditionChain"
1212
+ }
1213
+ }
1214
+ },
1215
+ "pushwoosh.aibuilder.v1.ProductsSource": {
1216
+ "type": "E",
1217
+ "values": [
1218
+ "PRODUCTS_SOURCE_UNSPECIFIED",
1219
+ "PRODUCTS_SOURCE_MANUAL",
1220
+ "PRODUCTS_SOURCE_RULE",
1221
+ "PRODUCTS_SOURCE_CART"
1222
+ ]
1223
+ },
1224
+ "pushwoosh.aibuilder.v1.ProductsRuleSort": {
1225
+ "type": "E",
1226
+ "values": [
1227
+ "PRODUCTS_RULE_SORT_UNSPECIFIED",
1228
+ "PRODUCTS_RULE_SORT_NEWEST",
1229
+ "PRODUCTS_RULE_SORT_PRICE_ASC",
1230
+ "PRODUCTS_RULE_SORT_PRICE_DESC",
1231
+ "PRODUCTS_RULE_SORT_TITLE"
1232
+ ]
1233
+ },
1234
+ "pushwoosh.aibuilder.v1.ProductsRule": {
1235
+ "type": "I",
1236
+ "fields": {
1237
+ "application": {
1238
+ "type": "string"
1239
+ },
1240
+ "feedOrigin": {
1241
+ "type": "string"
1242
+ },
1243
+ "category": {
1244
+ "type": "string"
1245
+ },
1246
+ "sort": {
1247
+ "type": "pushwoosh.aibuilder.v1.ProductsRuleSort"
1248
+ },
1249
+ "limit": {
1250
+ "type": "number"
1251
+ }
1252
+ }
1253
+ },
1254
+ "pushwoosh.aibuilder.v1.ProductsCart": {
1255
+ "type": "I",
1256
+ "fields": {
1257
+ "application": {
1258
+ "type": "string"
1259
+ },
1260
+ "feedOrigin": {
1261
+ "type": "string"
1262
+ },
1263
+ "limit": {
1264
+ "type": "number"
1265
+ }
1266
+ }
1267
+ },
1268
+ "pushwoosh.aibuilder.v1.ProductItem": {
1269
+ "type": "I",
1270
+ "fields": {
1271
+ "catalogId": {
1272
+ "type": "string"
1273
+ },
1274
+ "image": {
1275
+ "type": "pushwoosh.aibuilder.v1.Image",
1276
+ "optional": true
1277
+ },
1278
+ "title": {
1279
+ "type": "string"
1280
+ },
1281
+ "titleTranslations": {
1282
+ "type": "string",
1283
+ "mapKeyType": "string"
1284
+ },
1285
+ "description": {
1286
+ "type": "string"
1287
+ },
1288
+ "descriptionTranslations": {
1289
+ "type": "string",
1290
+ "mapKeyType": "string"
1291
+ },
1292
+ "price": {
1293
+ "type": "string"
1294
+ },
1295
+ "oldPrice": {
1296
+ "type": "string"
1297
+ },
1298
+ "url": {
1299
+ "type": "string"
1300
+ }
1301
+ }
1302
+ },
1303
+ "pushwoosh.aibuilder.v1.ProductsData": {
1304
+ "type": "I",
1305
+ "fields": {
1306
+ "source": {
1307
+ "type": "pushwoosh.aibuilder.v1.ProductsSource"
1308
+ },
1309
+ "rule": {
1310
+ "type": "pushwoosh.aibuilder.v1.ProductsRule",
1311
+ "optional": true
1312
+ },
1313
+ "cart": {
1314
+ "type": "pushwoosh.aibuilder.v1.ProductsCart",
1315
+ "optional": true
1316
+ },
1317
+ "descriptionLimit": {
1318
+ "type": "number",
1319
+ "optional": true
1320
+ },
1321
+ "products": {
1322
+ "type": "pushwoosh.aibuilder.v1.ProductItem",
1323
+ "array": true
1324
+ },
1325
+ "template": {
1326
+ "type": "pushwoosh.aibuilder.v1.AiBuilderCard",
1327
+ "optional": true
1328
+ },
1329
+ "templateStyles": {
1330
+ "type": "pushwoosh.aibuilder.v1.BlockStyles",
1331
+ "optional": true
1332
+ },
1333
+ "columns": {
1334
+ "type": "number",
1335
+ "optional": true
1336
+ },
1337
+ "gap": {
1338
+ "type": "number",
1339
+ "optional": true
1340
+ }
1341
+ }
1342
+ },
1077
1343
  "pushwoosh.aibuilder.v1.AiBuilderBlock": {
1078
1344
  "type": "I",
1079
1345
  "fields": {
@@ -1108,6 +1374,14 @@ export const data = {
1108
1374
  },
1109
1375
  "parentId": {
1110
1376
  "type": "string"
1377
+ },
1378
+ "displayCondition": {
1379
+ "type": "pushwoosh.aibuilder.v1.DisplayCondition",
1380
+ "optional": true
1381
+ },
1382
+ "products": {
1383
+ "type": "pushwoosh.aibuilder.v1.ProductsData",
1384
+ "optional": true
1111
1385
  }
1112
1386
  },
1113
1387
  "oneofs": {
@@ -1279,9 +1553,33 @@ export const data = {
1279
1553
  "underlineLinks": {
1280
1554
  "type": "boolean",
1281
1555
  "optional": true
1556
+ },
1557
+ "socialIconShape": {
1558
+ "type": "pushwoosh.aibuilder.v1.SocialIconShape"
1559
+ },
1560
+ "socialIconVariant": {
1561
+ "type": "pushwoosh.aibuilder.v1.SocialIconVariant"
1282
1562
  }
1283
1563
  }
1284
1564
  },
1565
+ "pushwoosh.aibuilder.v1.SocialIconShape": {
1566
+ "type": "E",
1567
+ "values": [
1568
+ "SOCIAL_ICON_SHAPE_UNSPECIFIED",
1569
+ "SOCIAL_ICON_SHAPE_CIRCLE",
1570
+ "SOCIAL_ICON_SHAPE_SQUARE",
1571
+ "SOCIAL_ICON_SHAPE_REGULAR"
1572
+ ]
1573
+ },
1574
+ "pushwoosh.aibuilder.v1.SocialIconVariant": {
1575
+ "type": "E",
1576
+ "values": [
1577
+ "SOCIAL_ICON_VARIANT_UNSPECIFIED",
1578
+ "SOCIAL_ICON_VARIANT_BLACK",
1579
+ "SOCIAL_ICON_VARIANT_WHITE",
1580
+ "SOCIAL_ICON_VARIANT_COLOR"
1581
+ ]
1582
+ },
1285
1583
  "pushwoosh.aibuilder.v1.EmailSettings": {
1286
1584
  "type": "I",
1287
1585
  "fields": {
@@ -1420,6 +1718,10 @@ export const data = {
1420
1718
  "languages": {
1421
1719
  "type": "string",
1422
1720
  "array": true
1721
+ },
1722
+ "darkColorScheme": {
1723
+ "type": "pushwoosh.aibuilder.v1.DarkColorScheme",
1724
+ "optional": true
1423
1725
  }
1424
1726
  }
1425
1727
  },
@@ -1453,6 +1755,12 @@ export const data = {
1453
1755
  "method": "post",
1454
1756
  "path": "/api/v1/aigen/convert-unlayer"
1455
1757
  },
1758
+ "DocumentToHtml": {
1759
+ "request": "pushwoosh.aigen.v1.AiGenDocumentToHtmlRequest",
1760
+ "response": "pushwoosh.aigen.v1.AiGenDocumentToHtmlResponse",
1761
+ "method": "post",
1762
+ "path": "/api/v1/aigen/document-to-html"
1763
+ },
1456
1764
  "GenerateMediaImage": {
1457
1765
  "request": "pushwoosh.aigen.v1.AiGenMediaImageRequest",
1458
1766
  "response": "pushwoosh.aigen.v1.AiGenMediaImageResponse",
@@ -1907,10 +2215,10 @@ export const data = {
1907
2215
  "type": "I",
1908
2216
  "fields": {
1909
2217
  "editorConfig": {
1910
- "type": "object"
2218
+ "type": "JsonObject"
1911
2219
  },
1912
2220
  "localizationData": {
1913
- "type": "object"
2221
+ "type": "JsonObject"
1914
2222
  },
1915
2223
  "language": {
1916
2224
  "type": "string"
@@ -1944,6 +2252,59 @@ export const data = {
1944
2252
  }
1945
2253
  }
1946
2254
  },
2255
+ "pushwoosh.aigen.v1.AiGenDocumentToHtmlRequest": {
2256
+ "type": "I",
2257
+ "fields": {
2258
+ "document": {
2259
+ "type": "pushwoosh.aibuilder.v1.AiBuilderDocument"
2260
+ },
2261
+ "application": {
2262
+ "type": "string"
2263
+ },
2264
+ "timerBaseUrl": {
2265
+ "type": "string"
2266
+ },
2267
+ "syncedBlockTags": {
2268
+ "type": "boolean",
2269
+ "optional": true
2270
+ },
2271
+ "displayConditionTags": {
2272
+ "type": "boolean",
2273
+ "optional": true
2274
+ },
2275
+ "dynamicProductTags": {
2276
+ "type": "boolean",
2277
+ "optional": true
2278
+ },
2279
+ "webVersionLabel": {
2280
+ "type": "string"
2281
+ }
2282
+ }
2283
+ },
2284
+ "pushwoosh.aigen.v1.LocalizationLanguage": {
2285
+ "type": "I",
2286
+ "fields": {
2287
+ "values": {
2288
+ "type": "string",
2289
+ "mapKeyType": "string"
2290
+ }
2291
+ }
2292
+ },
2293
+ "pushwoosh.aigen.v1.AiGenDocumentToHtmlResponse": {
2294
+ "type": "I",
2295
+ "fields": {
2296
+ "html": {
2297
+ "type": "string"
2298
+ },
2299
+ "localizationData": {
2300
+ "type": "pushwoosh.aigen.v1.LocalizationLanguage",
2301
+ "mapKeyType": "string"
2302
+ },
2303
+ "document": {
2304
+ "type": "pushwoosh.aibuilder.v1.AiBuilderDocument"
2305
+ }
2306
+ }
2307
+ },
1947
2308
  "pushwoosh.aigen.v1.AiGenMediaImageRequest": {
1948
2309
  "type": "I",
1949
2310
  "fields": {
@@ -2882,7 +3243,7 @@ export const data = {
2882
3243
  "optional": true
2883
3244
  },
2884
3245
  "template": {
2885
- "type": "object"
3246
+ "type": "JsonObject"
2886
3247
  },
2887
3248
  "categories": {
2888
3249
  "type": "string",
@@ -3017,7 +3378,7 @@ export const data = {
3017
3378
  "optional": true
3018
3379
  },
3019
3380
  "template": {
3020
- "type": "object"
3381
+ "type": "JsonObject"
3021
3382
  },
3022
3383
  "categories": {
3023
3384
  "type": "string",
@@ -3051,7 +3412,7 @@ export const data = {
3051
3412
  "optional": true
3052
3413
  },
3053
3414
  "template": {
3054
- "type": "object"
3415
+ "type": "JsonObject"
3055
3416
  },
3056
3417
  "updateCategories": {
3057
3418
  "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.251",
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 = {
@@ -820,6 +840,12 @@ export type Image = {
820
840
  borderRadius?: number;
821
841
  /** Mobile alignment override (content items only). UNSPECIFIED = inherit `align`. Client-managed. */
822
842
  mobileAlign: TextAlign;
843
+ /**
844
+ * Mobile width override as a CSS length ("200px" / "60%"). Unset or empty =
845
+ * the desktop width, scaled by the client. Only these two units are emitted;
846
+ * anything else is ignored rather than written into a rule. Client-managed.
847
+ */
848
+ mobileWidth?: string;
823
849
  };
824
850
  export type AiBuilderCard = {
825
851
  layout: CardLayout;
@@ -844,6 +870,22 @@ export type AiBuilderCard = {
844
870
  * Unset → centre (50/50). Applies to the image layouts only.
845
871
  */
846
872
  imagePosition?: CardImagePosition;
873
+ /**
874
+ * LEFT/RIGHT only: float the image so copy flows around it instead of
875
+ * sitting in a separate column. Unset = off, which keeps pre-wrap documents
876
+ * on their two-column look. Client-managed.
877
+ */
878
+ imageWrap?: boolean;
879
+ /**
880
+ * Mobile override of image.padding for the TOP/LEFT/RIGHT slots.
881
+ * Client-managed.
882
+ */
883
+ imageMobilePadding?: EdgeInsets;
884
+ /**
885
+ * LEFT/RIGHT crop box: image height as a percentage of the image column's
886
+ * width. Unset = natural height. Client-managed.
887
+ */
888
+ sideImageRatio?: number;
847
889
  };
848
890
  export type AiBuilderColumns = {
849
891
  columns: AiBuilderColumn[];
@@ -861,6 +903,18 @@ export type AiBuilderColumn = {
861
903
  * for this column when set. Client-managed; the LLM never sets it.
862
904
  */
863
905
  padding?: EdgeInsets;
906
+ /**
907
+ * Slot-image geometry, same contract as the card's: size drives the WIDTH
908
+ * (unset = spans the cell), an explicit height or a crop ratio fixes the
909
+ * box, and the fit crops into it. CLIENT even though the card's image_fit is
910
+ * MODEL — for columns these have always been the editor's, and widening a
911
+ * policy later is safe while narrowing one is not.
912
+ */
913
+ imageSize?: CardImageSize;
914
+ imageFit?: CardImageFit;
915
+ imagePosition?: CardImagePosition;
916
+ /** Crop box: image height as a percentage of the cell width. Unset = natural. */
917
+ imageRatio?: number;
864
918
  };
865
919
  /**
866
920
  * AiBuilderGroup is a structural stack container. Children live as
@@ -969,6 +1023,118 @@ export type SyncedBlockRef = {
969
1023
  */
970
1024
  fragmentCode: string;
971
1025
  };
1026
+ export type DisplayConditionOp =
1027
+ /** Invalid: the rule is skipped at compile, as a malformed rule is today. */
1028
+ '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'
1029
+ /** Presence checks; `value` is ignored. */
1030
+ | 'DISPLAY_CONDITION_OP_EXISTS' | 'DISPLAY_CONDITION_OP_NOT_EXISTS';
1031
+ export type DisplayConditionValueType =
1032
+ /** Renders as STRING. */
1033
+ 'DISPLAY_CONDITION_VALUE_TYPE_UNSPECIFIED' | 'DISPLAY_CONDITION_VALUE_TYPE_STRING' | 'DISPLAY_CONDITION_VALUE_TYPE_NUMBER' | 'DISPLAY_CONDITION_VALUE_TYPE_BOOLEAN';
1034
+ export type DisplayConditionCombinator =
1035
+ /** Renders as AND. */
1036
+ 'DISPLAY_CONDITION_COMBINATOR_UNSPECIFIED' | 'DISPLAY_CONDITION_COMBINATOR_AND' | 'DISPLAY_CONDITION_COMBINATOR_OR';
1037
+ /** What to do for a recipient missing a referenced value. UNSPECIFIED = HIDE. */
1038
+ export type DisplayConditionUnknown = 'DISPLAY_CONDITION_UNKNOWN_UNSPECIFIED' | 'DISPLAY_CONDITION_UNKNOWN_HIDE' | 'DISPLAY_CONDITION_UNKNOWN_SHOW';
1039
+ /**
1040
+ * Branch role in an if/elsif/else chain of ADJACENT siblings; exactly one
1041
+ * branch renders. UNSPECIFIED = a standalone {% if %}.
1042
+ */
1043
+ export type DisplayConditionChain = 'DISPLAY_CONDITION_CHAIN_UNSPECIFIED' | 'DISPLAY_CONDITION_CHAIN_ELSIF' | 'DISPLAY_CONDITION_CHAIN_ELSE';
1044
+ export type DisplayConditionRule = {
1045
+ /**
1046
+ * Tag / dynamic-content variable exactly as the user typed it; the emitter
1047
+ * strips spaces to reach the Liquid binding name.
1048
+ */
1049
+ name: string;
1050
+ op: DisplayConditionOp;
1051
+ /** Raw input, parsed per value_type at compile. Ignored for EXISTS/NOT_EXISTS. */
1052
+ value: string;
1053
+ valueType: DisplayConditionValueType;
1054
+ };
1055
+ export type DisplayCondition = {
1056
+ /** False keeps the rules stored without emitting anything. */
1057
+ enabled: boolean;
1058
+ combinator: DisplayConditionCombinator;
1059
+ rules: DisplayConditionRule[];
1060
+ unknown: DisplayConditionUnknown;
1061
+ /**
1062
+ * Advanced mode: a raw Liquid boolean expression. Non-empty REPLACES `rules`
1063
+ * and is emitted verbatim — never escaped, never validated server-side.
1064
+ * "" = unset.
1065
+ */
1066
+ liquidExpr: string;
1067
+ chain: DisplayConditionChain;
1068
+ };
1069
+ export type ProductsSource =
1070
+ /** Renders as MANUAL. */
1071
+ 'PRODUCTS_SOURCE_UNSPECIFIED' | 'PRODUCTS_SOURCE_MANUAL' | 'PRODUCTS_SOURCE_RULE' | 'PRODUCTS_SOURCE_CART';
1072
+ export type ProductsRuleSort =
1073
+ /** Invalid: the rule degrades to MANUAL, as a malformed payload does today. */
1074
+ 'PRODUCTS_RULE_SORT_UNSPECIFIED' | 'PRODUCTS_RULE_SORT_NEWEST' | 'PRODUCTS_RULE_SORT_PRICE_ASC' | 'PRODUCTS_RULE_SORT_PRICE_DESC' | 'PRODUCTS_RULE_SORT_TITLE';
1075
+ /**
1076
+ * Catalog feed. A payload missing feed_origin, sort or a positive limit
1077
+ * degrades to MANUAL rather than emitting a call to a garbage URL.
1078
+ */
1079
+ export type ProductsRule = {
1080
+ application: string;
1081
+ /** Environment-resolved feed host. "" = unset → degrades to MANUAL. */
1082
+ feedOrigin: string;
1083
+ /** "" = unset (the query parameter is omitted). */
1084
+ category: string;
1085
+ sort: ProductsRuleSort;
1086
+ /** Grid cells emitted, and the feed limit. <= 0 → degrades to MANUAL. */
1087
+ limit: number;
1088
+ };
1089
+ /** Abandoned cart of the recipient. Same degradation contract as ProductsRule. */
1090
+ export type ProductsCart = {
1091
+ application: string;
1092
+ feedOrigin: string;
1093
+ limit: number;
1094
+ };
1095
+ /**
1096
+ * One product row. The card design lives in ProductsData.template; elements
1097
+ * whose plain text is exactly "$title" / "$description" / "$price" /
1098
+ * "$oldPrice" bind to these fields, as do an image src of "$image" and a
1099
+ * button url of "$url".
1100
+ */
1101
+ export type ProductItem = {
1102
+ /** Account catalog id when the row was picked from the catalog. "" = unset. */
1103
+ catalogId: string;
1104
+ image?: Image;
1105
+ title: string;
1106
+ titleTranslations: Record<string, string>;
1107
+ description: string;
1108
+ descriptionTranslations: Record<string, string>;
1109
+ price: string;
1110
+ oldPrice: string;
1111
+ url: string;
1112
+ };
1113
+ export type ProductsData = {
1114
+ source: ProductsSource;
1115
+ rule?: ProductsRule;
1116
+ cart?: ProductsCart;
1117
+ /**
1118
+ * Rendered-description cap in characters. Unset = renderer default,
1119
+ * explicit 0 = off.
1120
+ */
1121
+ descriptionLimit?: number;
1122
+ /**
1123
+ * Rows for MANUAL, and the baked preview rows shown for RULE / CART outside
1124
+ * the save path.
1125
+ */
1126
+ products: ProductItem[];
1127
+ /**
1128
+ * The card rendered once per row. Absent = the block falls back to the
1129
+ * stand-in card in the oneof.
1130
+ */
1131
+ template?: AiBuilderCard;
1132
+ templateStyles?: BlockStyles;
1133
+ /** Grid columns, clamped 1..3 by the renderer. Unset = renderer default. */
1134
+ columns?: number;
1135
+ /** Gap between cells in px. Unset = renderer default. */
1136
+ gap?: number;
1137
+ };
972
1138
  export type AiBuilderBlock_block_card = {
973
1139
  type: 'card';
974
1140
  data: AiBuilderCard;
@@ -1009,6 +1175,14 @@ export type AiBuilderBlock = {
1009
1175
  * structures appropriate for each channel.
1010
1176
  */
1011
1177
  parentId: string;
1178
+ /** Per-recipient visibility of this block, compiled to Liquid on save. */
1179
+ displayCondition?: DisplayCondition;
1180
+ /**
1181
+ * Products repeater. When set it OWNS the block's rendering and the oneof
1182
+ * holds a stand-in card, so the model (and an older editor) still sees a
1183
+ * valid block.
1184
+ */
1185
+ products?: ProductsData;
1012
1186
  block: AiBuilderBlock_block;
1013
1187
  };
1014
1188
  /**
@@ -1099,7 +1273,25 @@ export type FooterStyle = {
1099
1273
  * Optional so absent keeps the client default (underlined).
1100
1274
  */
1101
1275
  underlineLinks?: boolean;
1276
+ /**
1277
+ * Look of the social icons; both UNSPECIFIED reproduce today's defaults
1278
+ * (circle / black), so an absent value renders as it always has.
1279
+ */
1280
+ socialIconShape: SocialIconShape;
1281
+ socialIconVariant: SocialIconVariant;
1102
1282
  };
1283
+ /**
1284
+ * Renderer picks a hosted icon set from these two. The value names are not
1285
+ * cosmetic: they are the asset path segment and filename suffix
1286
+ * (<base>/<shape>/<platform>-<shape>-<variant>.png), so an invented value is a
1287
+ * 404, not a fallback.
1288
+ */
1289
+ export type SocialIconShape =
1290
+ /** Renders as CIRCLE. */
1291
+ 'SOCIAL_ICON_SHAPE_UNSPECIFIED' | 'SOCIAL_ICON_SHAPE_CIRCLE' | 'SOCIAL_ICON_SHAPE_SQUARE' | 'SOCIAL_ICON_SHAPE_REGULAR';
1292
+ export type SocialIconVariant =
1293
+ /** Renders as BLACK. */
1294
+ 'SOCIAL_ICON_VARIANT_UNSPECIFIED' | 'SOCIAL_ICON_VARIANT_BLACK' | 'SOCIAL_ICON_VARIANT_WHITE' | 'SOCIAL_ICON_VARIANT_COLOR';
1103
1295
  /**
1104
1296
  * EmailSettings holds the email-only document-level fields produced by
1105
1297
  * the meta generator under mode=EMAIL. Populated only when the
@@ -1231,4 +1423,9 @@ export type AiBuilderDocument = {
1231
1423
  * language may be listed before any translation exists. Client-managed.
1232
1424
  */
1233
1425
  languages: string[];
1426
+ /**
1427
+ * Authored dark palette, paired with color_scheme. Absent = the document
1428
+ * opts out of dark mode; see DarkColorScheme. Client-managed.
1429
+ */
1430
+ darkColorScheme?: DarkColorScheme;
1234
1431
  };
@@ -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