@pushwoosh/rpc-gateway-ai-assistant 0.1.187 → 0.1.189
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 +0 -8
- package/data.js +86 -12
- package/package.json +1 -1
- package/pushwoosh_aibuilder_v1.d.ts +43 -11
- package/pushwoosh_aigen_v1.d.ts +66 -0
- package/pushwoosh_templates_v1.d.ts +4 -4
package/commonTypes.d.ts
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
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
|
-
};
|
|
10
2
|
export type RpcMethod<Req, Res> = ((request: Req) => Promise<Res>) & {
|
|
11
3
|
safe(request: Req): Promise<[{
|
|
12
4
|
error: unknown;
|
package/data.js
CHANGED
|
@@ -164,6 +164,20 @@ export const data = {
|
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
},
|
|
167
|
+
"pushwoosh.aibuilder.v1.BackgroundGradient": {
|
|
168
|
+
"type": "I",
|
|
169
|
+
"fields": {
|
|
170
|
+
"from": {
|
|
171
|
+
"type": "string"
|
|
172
|
+
},
|
|
173
|
+
"to": {
|
|
174
|
+
"type": "string"
|
|
175
|
+
},
|
|
176
|
+
"angle": {
|
|
177
|
+
"type": "number"
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
},
|
|
167
181
|
"pushwoosh.aibuilder.v1.ColumnsStyles": {
|
|
168
182
|
"type": "I",
|
|
169
183
|
"fields": {
|
|
@@ -237,6 +251,14 @@ export const data = {
|
|
|
237
251
|
"fontFamily": {
|
|
238
252
|
"type": "string",
|
|
239
253
|
"optional": true
|
|
254
|
+
},
|
|
255
|
+
"backgroundImage": {
|
|
256
|
+
"type": "string",
|
|
257
|
+
"optional": true
|
|
258
|
+
},
|
|
259
|
+
"backgroundGradient": {
|
|
260
|
+
"type": "pushwoosh.aibuilder.v1.BackgroundGradient",
|
|
261
|
+
"optional": true
|
|
240
262
|
}
|
|
241
263
|
}
|
|
242
264
|
},
|
|
@@ -390,6 +412,13 @@ export const data = {
|
|
|
390
412
|
},
|
|
391
413
|
"list": {
|
|
392
414
|
"type": "pushwoosh.aibuilder.v1.List"
|
|
415
|
+
},
|
|
416
|
+
"image": {
|
|
417
|
+
"type": "pushwoosh.aibuilder.v1.Image"
|
|
418
|
+
},
|
|
419
|
+
"padding": {
|
|
420
|
+
"type": "pushwoosh.aibuilder.v1.EdgeInsets",
|
|
421
|
+
"optional": true
|
|
393
422
|
}
|
|
394
423
|
},
|
|
395
424
|
"oneofs": {
|
|
@@ -397,7 +426,8 @@ export const data = {
|
|
|
397
426
|
"oneof": [
|
|
398
427
|
"text",
|
|
399
428
|
"buttonGroup",
|
|
400
|
-
"list"
|
|
429
|
+
"list",
|
|
430
|
+
"image"
|
|
401
431
|
]
|
|
402
432
|
}
|
|
403
433
|
}
|
|
@@ -412,14 +442,6 @@ export const data = {
|
|
|
412
442
|
"textPrompt": {
|
|
413
443
|
"type": "string",
|
|
414
444
|
"optional": true
|
|
415
|
-
},
|
|
416
|
-
"margin": {
|
|
417
|
-
"type": "pushwoosh.aibuilder.v1.EdgeInsets",
|
|
418
|
-
"optional": true
|
|
419
|
-
},
|
|
420
|
-
"padding": {
|
|
421
|
-
"type": "pushwoosh.aibuilder.v1.EdgeInsets",
|
|
422
|
-
"optional": true
|
|
423
445
|
}
|
|
424
446
|
}
|
|
425
447
|
},
|
|
@@ -449,6 +471,13 @@ export const data = {
|
|
|
449
471
|
},
|
|
450
472
|
"origHeight": {
|
|
451
473
|
"type": "number"
|
|
474
|
+
},
|
|
475
|
+
"padding": {
|
|
476
|
+
"type": "pushwoosh.aibuilder.v1.EdgeInsets",
|
|
477
|
+
"optional": true
|
|
478
|
+
},
|
|
479
|
+
"align": {
|
|
480
|
+
"type": "pushwoosh.aibuilder.v1.TextAlign"
|
|
452
481
|
}
|
|
453
482
|
}
|
|
454
483
|
},
|
|
@@ -519,6 +548,10 @@ export const data = {
|
|
|
519
548
|
"width": {
|
|
520
549
|
"type": "string",
|
|
521
550
|
"optional": true
|
|
551
|
+
},
|
|
552
|
+
"padding": {
|
|
553
|
+
"type": "pushwoosh.aibuilder.v1.EdgeInsets",
|
|
554
|
+
"optional": true
|
|
522
555
|
}
|
|
523
556
|
}
|
|
524
557
|
},
|
|
@@ -867,6 +900,12 @@ export const data = {
|
|
|
867
900
|
"response": "pushwoosh.aigen.v1.AiGenExtractStyleResponse",
|
|
868
901
|
"method": "post",
|
|
869
902
|
"path": "/api/v1/aigen/extract-style"
|
|
903
|
+
},
|
|
904
|
+
"ConvertUnlayer": {
|
|
905
|
+
"request": "pushwoosh.aigen.v1.AiGenConvertUnlayerRequest",
|
|
906
|
+
"response": "pushwoosh.aigen.v1.AiGenConvertUnlayerResponse",
|
|
907
|
+
"method": "post",
|
|
908
|
+
"path": "/api/v1/aigen/convert-unlayer"
|
|
870
909
|
}
|
|
871
910
|
}
|
|
872
911
|
},
|
|
@@ -1293,6 +1332,41 @@ export const data = {
|
|
|
1293
1332
|
}
|
|
1294
1333
|
}
|
|
1295
1334
|
},
|
|
1335
|
+
"pushwoosh.aigen.v1.AiGenConvertUnlayerRequest": {
|
|
1336
|
+
"type": "I",
|
|
1337
|
+
"fields": {
|
|
1338
|
+
"editorConfig": {
|
|
1339
|
+
"type": "object"
|
|
1340
|
+
},
|
|
1341
|
+
"localizationData": {
|
|
1342
|
+
"type": "object"
|
|
1343
|
+
},
|
|
1344
|
+
"language": {
|
|
1345
|
+
"type": "string"
|
|
1346
|
+
},
|
|
1347
|
+
"application": {
|
|
1348
|
+
"type": "string"
|
|
1349
|
+
},
|
|
1350
|
+
"templateName": {
|
|
1351
|
+
"type": "string"
|
|
1352
|
+
},
|
|
1353
|
+
"subject": {
|
|
1354
|
+
"type": "string"
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
},
|
|
1358
|
+
"pushwoosh.aigen.v1.AiGenConvertUnlayerResponse": {
|
|
1359
|
+
"type": "I",
|
|
1360
|
+
"fields": {
|
|
1361
|
+
"document": {
|
|
1362
|
+
"type": "pushwoosh.aibuilder.v1.AiBuilderDocument"
|
|
1363
|
+
},
|
|
1364
|
+
"warnings": {
|
|
1365
|
+
"type": "string",
|
|
1366
|
+
"array": true
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
},
|
|
1296
1370
|
"pushwoosh.accounts.assistant.v1.Role": {
|
|
1297
1371
|
"type": "E",
|
|
1298
1372
|
"values": [
|
|
@@ -1873,7 +1947,7 @@ export const data = {
|
|
|
1873
1947
|
"optional": true
|
|
1874
1948
|
},
|
|
1875
1949
|
"template": {
|
|
1876
|
-
"type": "
|
|
1950
|
+
"type": "object"
|
|
1877
1951
|
},
|
|
1878
1952
|
"categories": {
|
|
1879
1953
|
"type": "string",
|
|
@@ -2008,7 +2082,7 @@ export const data = {
|
|
|
2008
2082
|
"optional": true
|
|
2009
2083
|
},
|
|
2010
2084
|
"template": {
|
|
2011
|
-
"type": "
|
|
2085
|
+
"type": "object"
|
|
2012
2086
|
},
|
|
2013
2087
|
"categories": {
|
|
2014
2088
|
"type": "string",
|
|
@@ -2042,7 +2116,7 @@ export const data = {
|
|
|
2042
2116
|
"optional": true
|
|
2043
2117
|
},
|
|
2044
2118
|
"template": {
|
|
2045
|
-
"type": "
|
|
2119
|
+
"type": "object"
|
|
2046
2120
|
},
|
|
2047
2121
|
"updateCategories": {
|
|
2048
2122
|
"type": "boolean"
|
package/package.json
CHANGED
|
@@ -206,6 +206,14 @@ export type BlockStyles = {
|
|
|
206
206
|
/** Explicit 0 is distinct from unset and preserved. */
|
|
207
207
|
borderRadius?: number;
|
|
208
208
|
};
|
|
209
|
+
/** Two-stop CSS linear gradient: `linear-gradient(<angle>deg, from, to)`. */
|
|
210
|
+
export type BackgroundGradient = {
|
|
211
|
+
/** #RRGGBB */
|
|
212
|
+
from: string;
|
|
213
|
+
to: string;
|
|
214
|
+
/** CSS angle in degrees (180 = top→bottom). */
|
|
215
|
+
angle: number;
|
|
216
|
+
};
|
|
209
217
|
export type ColumnsStyles = {
|
|
210
218
|
/** Padding applied to each column in the columns block. */
|
|
211
219
|
columnPadding?: EdgeInsets;
|
|
@@ -258,6 +266,12 @@ export type DocumentSettings = {
|
|
|
258
266
|
* button → variant → document → renderer default.
|
|
259
267
|
*/
|
|
260
268
|
fontFamily?: string;
|
|
269
|
+
/**
|
|
270
|
+
* Document-wide backdrop behind all blocks (email body background).
|
|
271
|
+
* Same semantics as the BlockStyles pair. Client-managed.
|
|
272
|
+
*/
|
|
273
|
+
backgroundImage?: string;
|
|
274
|
+
backgroundGradient?: BackgroundGradient;
|
|
261
275
|
};
|
|
262
276
|
export type TextBlock = {
|
|
263
277
|
variant: string;
|
|
@@ -362,23 +376,22 @@ export type ContentItem_item_list = {
|
|
|
362
376
|
type: 'list';
|
|
363
377
|
data: List;
|
|
364
378
|
};
|
|
365
|
-
export type
|
|
379
|
+
export type ContentItem_item_image = {
|
|
380
|
+
type: 'image';
|
|
381
|
+
data: Image;
|
|
382
|
+
};
|
|
383
|
+
export type ContentItem_item = ContentItem_item_text | ContentItem_item_buttonGroup | ContentItem_item_list | ContentItem_item_image;
|
|
366
384
|
export type ContentItem = {
|
|
385
|
+
/**
|
|
386
|
+
* Container padding of the item. Unset = client's default inter-item gap;
|
|
387
|
+
* set (even zeros) = used verbatim. Client-managed, hidden from the LLM.
|
|
388
|
+
*/
|
|
389
|
+
padding?: EdgeInsets;
|
|
367
390
|
item: ContentItem_item;
|
|
368
391
|
};
|
|
369
392
|
export type Content = {
|
|
370
393
|
items: ContentItem[];
|
|
371
394
|
textPrompt?: string;
|
|
372
|
-
/**
|
|
373
|
-
* Client-managed margin around the content block. Preserved by the backend
|
|
374
|
-
* across Update but never exposed to the LLM.
|
|
375
|
-
*/
|
|
376
|
-
margin?: EdgeInsets;
|
|
377
|
-
/**
|
|
378
|
-
* Client-managed padding inside the content block. Preserved by the backend
|
|
379
|
-
* across Update but never exposed to the LLM.
|
|
380
|
-
*/
|
|
381
|
-
padding?: EdgeInsets;
|
|
382
395
|
};
|
|
383
396
|
export type Image = {
|
|
384
397
|
prompt: string;
|
|
@@ -389,6 +402,19 @@ export type Image = {
|
|
|
389
402
|
mediaUuid: string;
|
|
390
403
|
origWidth: number;
|
|
391
404
|
origHeight: number;
|
|
405
|
+
/**
|
|
406
|
+
* Container padding of the image within its slot (card TOP image, column
|
|
407
|
+
* image). Same semantics as ContentItem.padding: client-managed, written
|
|
408
|
+
* by importers / the editor, never exposed to the LLM, round-tripped
|
|
409
|
+
* verbatim. Layouts without a discrete image box (BACKGROUND, LEFT/RIGHT
|
|
410
|
+
* fills) may ignore it.
|
|
411
|
+
*/
|
|
412
|
+
padding?: EdgeInsets;
|
|
413
|
+
/**
|
|
414
|
+
* Horizontal alignment when the image is a content item; slots ignore it.
|
|
415
|
+
* UNSPECIFIED renders as center (Unlayer's image default).
|
|
416
|
+
*/
|
|
417
|
+
align: TextAlign;
|
|
392
418
|
};
|
|
393
419
|
export type AiBuilderCard = {
|
|
394
420
|
layout: CardLayout;
|
|
@@ -427,6 +453,12 @@ export type AiBuilderColumn = {
|
|
|
427
453
|
image?: Image;
|
|
428
454
|
content: Content;
|
|
429
455
|
width?: string;
|
|
456
|
+
/**
|
|
457
|
+
* Container padding of this column, wrapping BOTH the image slot and the
|
|
458
|
+
* content (Unlayer column padding). Overrides ColumnsStyles.column_padding
|
|
459
|
+
* for this column when set. Client-managed; the LLM never sets it.
|
|
460
|
+
*/
|
|
461
|
+
padding?: EdgeInsets;
|
|
430
462
|
};
|
|
431
463
|
/**
|
|
432
464
|
* AiBuilderGroup is a structural stack container. Children live as
|
package/pushwoosh_aigen_v1.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { TextVariantStyle as pushwoosh_aibuilder_v1_TextVariantStyle } from './p
|
|
|
5
5
|
import { ColorSchemeItem as pushwoosh_aibuilder_v1_ColorSchemeItem } from './pushwoosh_aibuilder_v1';
|
|
6
6
|
import { AiBuilderBlock as pushwoosh_aibuilder_v1_AiBuilderBlock } from './pushwoosh_aibuilder_v1';
|
|
7
7
|
export type AiGenService_ExtractStyle = RpcMethod<AiGenExtractStyleRequest, AiGenExtractStyleResponse>;
|
|
8
|
+
export type AiGenService_ConvertUnlayer = RpcMethod<AiGenConvertUnlayerRequest, AiGenConvertUnlayerResponse>;
|
|
8
9
|
/**
|
|
9
10
|
* AiGenService unifies document create / edit / per-block regeneration and
|
|
10
11
|
* targeted block insertion into a single streaming RPC. Dispatch rules:
|
|
@@ -58,6 +59,20 @@ export interface AiGenService {
|
|
|
58
59
|
* design screenshot. Unary; the result is small.
|
|
59
60
|
*/
|
|
60
61
|
ExtractStyle: AiGenService_ExtractStyle;
|
|
62
|
+
/**
|
|
63
|
+
* ConvertUnlayer deterministically converts an Unlayer email-template
|
|
64
|
+
* design (the `editorConfig` JSON stored in EmailContent.Unlayer) into
|
|
65
|
+
* an AiBuilderDocument, so templates built in the Unlayer block editor
|
|
66
|
+
* can be opened in the AI builder. No LLM involved — the mapping is
|
|
67
|
+
* pure and repeatable, and the same call can back a bulk migration.
|
|
68
|
+
*
|
|
69
|
+
* Unlayer widgets with no AiBuilderDocument equivalent (countdown
|
|
70
|
+
* timers, custom tools, raw HTML) become Placeholder blocks the AI can
|
|
71
|
+
* materialise on a follow-up edit; every such lossy step is reported
|
|
72
|
+
* in `warnings`. The returned document always passes the EMAIL-mode
|
|
73
|
+
* document validation. Unary; the result is document-sized.
|
|
74
|
+
*/
|
|
75
|
+
ConvertUnlayer: AiGenService_ConvertUnlayer;
|
|
61
76
|
}
|
|
62
77
|
export type AiGenBlockTypeHint = 'AI_GEN_BLOCK_TYPE_HINT_UNSPECIFIED' | 'AI_GEN_BLOCK_TYPE_HINT_CARD' | 'AI_GEN_BLOCK_TYPE_HINT_COLUMNS'
|
|
63
78
|
/** Top-level free-form Content block. Allowed in WEB_POPUP only. */
|
|
@@ -535,3 +550,54 @@ export type AiGenExtractStyleResponse = {
|
|
|
535
550
|
*/
|
|
536
551
|
typographyNotes: string;
|
|
537
552
|
};
|
|
553
|
+
export type AiGenConvertUnlayerRequest = {
|
|
554
|
+
/**
|
|
555
|
+
* The Unlayer design JSON (EmailContent.Unlayer.editor_config): the
|
|
556
|
+
* object carrying body.rows[].columns[].contents[]. Required.
|
|
557
|
+
*/
|
|
558
|
+
editorConfig: object;
|
|
559
|
+
/**
|
|
560
|
+
* Unlayer localization placeholders. Accepts either the per-language
|
|
561
|
+
* map {"<lang>": {"<path>": "<value>"}} stored alongside the design in
|
|
562
|
+
* EmailContent.Unlayer.localization_data, or an already-flat
|
|
563
|
+
* {"<path>": "<value>"} map. Values are substituted into the design's
|
|
564
|
+
* {{path|type|fallback}} tokens during conversion. Optional — without
|
|
565
|
+
* it tokens resolve to their inline fallbacks.
|
|
566
|
+
*/
|
|
567
|
+
localizationData: object;
|
|
568
|
+
/**
|
|
569
|
+
* Language key to resolve localized values with when localization_data
|
|
570
|
+
* is per-language. Empty → "default", falling back to the first
|
|
571
|
+
* language present.
|
|
572
|
+
*/
|
|
573
|
+
language: string;
|
|
574
|
+
/**
|
|
575
|
+
* Application code. Required by the server's application-scoping
|
|
576
|
+
* middleware (same as the other AiGen RPCs); the converter itself does
|
|
577
|
+
* not use it.
|
|
578
|
+
*/
|
|
579
|
+
application: string;
|
|
580
|
+
/**
|
|
581
|
+
* Optional document metadata carried into the result verbatim: the
|
|
582
|
+
* template name (Meta.template_name) and the email subject
|
|
583
|
+
* (EmailSettings.subject). Both live outside editor_config on the
|
|
584
|
+
* stored EmailTemplate, so the caller supplies them.
|
|
585
|
+
*/
|
|
586
|
+
templateName: string;
|
|
587
|
+
subject: string;
|
|
588
|
+
};
|
|
589
|
+
export type AiGenConvertUnlayerResponse = {
|
|
590
|
+
/**
|
|
591
|
+
* The converted document. Complete and EMAIL-mode valid; block ids are
|
|
592
|
+
* deterministic ("u<row>-<n>") so repeated conversions of the same
|
|
593
|
+
* design yield the same document.
|
|
594
|
+
*/
|
|
595
|
+
document: pushwoosh_aibuilder_v1_AiBuilderDocument;
|
|
596
|
+
/**
|
|
597
|
+
* Human-readable notes about content that could not be mapped 1:1 —
|
|
598
|
+
* unsupported widgets replaced with placeholders, dropped image links,
|
|
599
|
+
* per-column backgrounds, and similar. Order follows document order.
|
|
600
|
+
* Empty when the conversion was lossless.
|
|
601
|
+
*/
|
|
602
|
+
warnings: string[];
|
|
603
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RpcMethod
|
|
1
|
+
import { RpcMethod } 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:
|
|
49
|
+
template: object;
|
|
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:
|
|
116
|
+
template: object;
|
|
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:
|
|
137
|
+
template: object;
|
|
138
138
|
/**
|
|
139
139
|
* Controls how categories is applied (PATCH semantics):
|
|
140
140
|
* - true → replace categories with the provided list
|