@pushwoosh/rpc-gateway-ai-assistant 0.1.187 → 0.1.188

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,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
@@ -390,6 +390,10 @@ export const data = {
390
390
  },
391
391
  "list": {
392
392
  "type": "pushwoosh.aibuilder.v1.List"
393
+ },
394
+ "margin": {
395
+ "type": "pushwoosh.aibuilder.v1.EdgeInsets",
396
+ "optional": true
393
397
  }
394
398
  },
395
399
  "oneofs": {
@@ -449,6 +453,10 @@ export const data = {
449
453
  },
450
454
  "origHeight": {
451
455
  "type": "number"
456
+ },
457
+ "margin": {
458
+ "type": "pushwoosh.aibuilder.v1.EdgeInsets",
459
+ "optional": true
452
460
  }
453
461
  }
454
462
  },
@@ -867,6 +875,12 @@ export const data = {
867
875
  "response": "pushwoosh.aigen.v1.AiGenExtractStyleResponse",
868
876
  "method": "post",
869
877
  "path": "/api/v1/aigen/extract-style"
878
+ },
879
+ "ConvertUnlayer": {
880
+ "request": "pushwoosh.aigen.v1.AiGenConvertUnlayerRequest",
881
+ "response": "pushwoosh.aigen.v1.AiGenConvertUnlayerResponse",
882
+ "method": "post",
883
+ "path": "/api/v1/aigen/convert-unlayer"
870
884
  }
871
885
  }
872
886
  },
@@ -1293,6 +1307,41 @@ export const data = {
1293
1307
  }
1294
1308
  }
1295
1309
  },
1310
+ "pushwoosh.aigen.v1.AiGenConvertUnlayerRequest": {
1311
+ "type": "I",
1312
+ "fields": {
1313
+ "editorConfig": {
1314
+ "type": "object"
1315
+ },
1316
+ "localizationData": {
1317
+ "type": "object"
1318
+ },
1319
+ "language": {
1320
+ "type": "string"
1321
+ },
1322
+ "application": {
1323
+ "type": "string"
1324
+ },
1325
+ "templateName": {
1326
+ "type": "string"
1327
+ },
1328
+ "subject": {
1329
+ "type": "string"
1330
+ }
1331
+ }
1332
+ },
1333
+ "pushwoosh.aigen.v1.AiGenConvertUnlayerResponse": {
1334
+ "type": "I",
1335
+ "fields": {
1336
+ "document": {
1337
+ "type": "pushwoosh.aibuilder.v1.AiBuilderDocument"
1338
+ },
1339
+ "warnings": {
1340
+ "type": "string",
1341
+ "array": true
1342
+ }
1343
+ }
1344
+ },
1296
1345
  "pushwoosh.accounts.assistant.v1.Role": {
1297
1346
  "type": "E",
1298
1347
  "values": [
@@ -1873,7 +1922,7 @@ export const data = {
1873
1922
  "optional": true
1874
1923
  },
1875
1924
  "template": {
1876
- "type": "JsonObject"
1925
+ "type": "object"
1877
1926
  },
1878
1927
  "categories": {
1879
1928
  "type": "string",
@@ -2008,7 +2057,7 @@ export const data = {
2008
2057
  "optional": true
2009
2058
  },
2010
2059
  "template": {
2011
- "type": "JsonObject"
2060
+ "type": "object"
2012
2061
  },
2013
2062
  "categories": {
2014
2063
  "type": "string",
@@ -2042,7 +2091,7 @@ export const data = {
2042
2091
  "optional": true
2043
2092
  },
2044
2093
  "template": {
2045
- "type": "JsonObject"
2094
+ "type": "object"
2046
2095
  },
2047
2096
  "updateCategories": {
2048
2097
  "type": "boolean"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/rpc-gateway-ai-assistant",
3
- "version": "0.1.187",
3
+ "version": "0.1.188",
4
4
  "description": "AI Assistant api gateway HTTP API Types and Data",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -364,6 +364,15 @@ export type ContentItem_item_list = {
364
364
  };
365
365
  export type ContentItem_item = ContentItem_item_text | ContentItem_item_buttonGroup | ContentItem_item_list;
366
366
  export type ContentItem = {
367
+ /**
368
+ * Client-managed margin around this single item (outer box of the
369
+ * element, CSS margin semantics). Unset = the client applies its default
370
+ * inter-item gap; set (even to zeros) = the client uses exactly this and
371
+ * skips the default gap. Written by importers (e.g. the Unlayer
372
+ * converter maps each widget's containerPadding here) and by the editor;
373
+ * never exposed to the LLM, round-tripped verbatim by the backend.
374
+ */
375
+ margin?: EdgeInsets;
367
376
  item: ContentItem_item;
368
377
  };
369
378
  export type Content = {
@@ -389,6 +398,14 @@ export type Image = {
389
398
  mediaUuid: string;
390
399
  origWidth: number;
391
400
  origHeight: number;
401
+ /**
402
+ * Client-managed outer margin of the image within its slot (card TOP
403
+ * image, column image). Same semantics as ContentItem.margin: written by
404
+ * importers / the editor, never exposed to the LLM, round-tripped
405
+ * verbatim. Layouts without a discrete image box (BACKGROUND, LEFT/RIGHT
406
+ * fills) may ignore it.
407
+ */
408
+ margin?: EdgeInsets;
392
409
  };
393
410
  export type AiBuilderCard = {
394
411
  layout: CardLayout;
@@ -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, JsonObject } from './commonTypes';
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: JsonObject;
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: JsonObject;
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: JsonObject;
137
+ template: object;
138
138
  /**
139
139
  * Controls how categories is applied (PATCH semantics):
140
140
  * - true → replace categories with the provided list