@epilot/journey-client 0.5.3 → 0.6.0-alpha.0

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.
@@ -1 +1 @@
1
- (()=>{"use strict";var e={223(e,r,t){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});var o=n(t(466));r.default=o.default},466(e){e.exports=JSON.parse('{"openapi":"3.0.0","info":{"title":"","version":""},"paths":{"/v1/journey/organization/{id}":{"get":{"operationId":"getJourneysByOrgId","parameters":[{"name":"id","in":"path","required":true},{"name":"hydrate","in":"query","required":false}],"responses":{}}},"/v1/journey/configuration/{id}":{"get":{"operationId":"getJourney","parameters":[{"name":"id","in":"path","required":true},{"name":"version","in":"query","required":false},{"name":"source","in":"query","required":false},{"name":"orgId","in":"query","required":false}],"responses":{}},"delete":{"operationId":"removeJourney","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/journey/products/{id}":{"get":{"operationId":"getJourneyProducts","parameters":[{"name":"id","in":"path","required":true},{"name":"source","in":"query","required":false},{"name":"postal_code","in":"query","required":false},{"name":"city","in":"query","required":false},{"name":"street","in":"query","required":false},{"name":"street_number","in":"query","required":false}],"responses":{}}},"/v1/journey/configuration":{"post":{"operationId":"createJourney","requestBody":{"content":{"application/json":{}}},"parameters":[{"name":"skipAutomation","in":"query","required":false}],"responses":{}},"put":{"operationId":"updateJourney","requestBody":{"content":{"application/json":{}}},"parameters":[],"responses":{}},"patch":{"operationId":"patchUpdateJourney","requestBody":{"content":{"application/json":{}}},"parameters":[],"responses":{}}},"/v1/journey/configuration/search":{"post":{"operationId":"searchJourneys","requestBody":{"content":{"application/json":{}}},"parameters":[],"responses":{}}},"/v1/journey/document:generate":{"post":{"operationId":"generateDocument","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v2/journey/configuration":{"post":{"operationId":"createJourneyV2","requestBody":{"content":{"application/json":{}}},"parameters":[{"name":"skipAutomation","in":"query","required":false}],"responses":{}},"put":{"operationId":"updateJourneyV2","requestBody":{"content":{"application/json":{}}},"parameters":[],"responses":{}},"patch":{"operationId":"patchUpdateJourneyV2","requestBody":{"content":{"application/json":{}}},"parameters":[],"responses":{}}},"/v2/journey/configuration/{id}":{"get":{"operationId":"getJourneyV2","parameters":[{"name":"id","in":"path","required":true},{"name":"version","in":"query","required":false}],"responses":{}},"delete":{"operationId":"removeJourneyV2","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/journey/{id}/settings":{"get":{"operationId":"getSettingsForJourney","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/journey/button-options":{"get":{"operationId":"getButtonOptions","parameters":[{"in":"query","name":"fileId","required":true}],"responses":{}}}},"components":{},"servers":[{"url":"https://journey-config.sls.epilot.io"}]}')}},r={},t=function t(n){var o=r[n];if(void 0!==o)return o.exports;var a=r[n]={exports:{}};return e[n].call(a.exports,a,a.exports,t),a.exports}(223),n=exports;for(var o in t)n[o]=t[o];t.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})();
1
+ (()=>{"use strict";var e={223(e,r,n){var t=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});var o=t(n(466));r.default=o.default},466(e){e.exports=JSON.parse('{"openapi":"3.0.0","info":{"title":"","version":""},"paths":{"/v1/journey/organization/{id}":{"get":{"operationId":"getJourneysByOrgId","parameters":[{"name":"id","in":"path","required":true},{"name":"hydrate","in":"query","required":false}],"responses":{}}},"/v1/journey/configuration/{id}":{"get":{"operationId":"getJourney","parameters":[{"name":"id","in":"path","required":true},{"name":"version","in":"query","required":false},{"name":"source","in":"query","required":false},{"name":"orgId","in":"query","required":false}],"responses":{}},"delete":{"operationId":"removeJourney","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/journey/configuration/{id}/environment":{"get":{"operationId":"getJourneyEnvironment","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/journey/products/{id}":{"get":{"operationId":"getJourneyProducts","parameters":[{"name":"id","in":"path","required":true},{"name":"source","in":"query","required":false},{"name":"postal_code","in":"query","required":false},{"name":"city","in":"query","required":false},{"name":"street","in":"query","required":false},{"name":"street_number","in":"query","required":false}],"responses":{}}},"/v1/journey/configuration":{"post":{"operationId":"createJourney","requestBody":{"content":{"application/json":{}}},"parameters":[{"name":"skipAutomation","in":"query","required":false}],"responses":{}},"put":{"operationId":"updateJourney","requestBody":{"content":{"application/json":{}}},"parameters":[],"responses":{}},"patch":{"operationId":"patchUpdateJourney","requestBody":{"content":{"application/json":{}}},"parameters":[],"responses":{}}},"/v1/journey/configuration/search":{"post":{"operationId":"searchJourneys","requestBody":{"content":{"application/json":{}}},"parameters":[],"responses":{}}},"/v1/journey/document:generate":{"post":{"operationId":"generateDocument","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v2/journey/configuration":{"post":{"operationId":"createJourneyV2","requestBody":{"content":{"application/json":{}}},"parameters":[{"name":"skipAutomation","in":"query","required":false}],"responses":{}},"put":{"operationId":"updateJourneyV2","requestBody":{"content":{"application/json":{}}},"parameters":[],"responses":{}},"patch":{"operationId":"patchUpdateJourneyV2","requestBody":{"content":{"application/json":{}}},"parameters":[],"responses":{}}},"/v2/journey/configuration/{id}":{"get":{"operationId":"getJourneyV2","parameters":[{"name":"id","in":"path","required":true},{"name":"version","in":"query","required":false}],"responses":{}},"delete":{"operationId":"removeJourneyV2","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/journey/{id}/settings":{"get":{"operationId":"getSettingsForJourney","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/journey/button-options":{"get":{"operationId":"getButtonOptions","parameters":[{"in":"query","name":"fileId","required":true}],"responses":{}}}},"components":{},"servers":[{"url":"https://journey-config.sls.epilot.io"}]}')}},r={},n=function n(t){var o=r[t];if(void 0!==o)return o.exports;var a=r[t]={exports:{}};return e[t].call(a.exports,a,a.exports,n),a.exports}(223),t=exports;for(var o in n)t[o]=n[o];n.__esModule&&Object.defineProperty(t,"__esModule",{value:!0})})();
package/dist/openapi.d.ts CHANGED
@@ -25,6 +25,16 @@ declare namespace Components {
25
25
  */
26
26
  label?: string;
27
27
  }
28
+ export interface EnvironmentMap {
29
+ fallbackLanguage?: string;
30
+ options: EnvironmentMapEntry[];
31
+ }
32
+ export interface EnvironmentMapEntry {
33
+ key: string;
34
+ value: string | {
35
+ [name: string]: string;
36
+ };
37
+ }
28
38
  export interface GenerateDocumentRequest {
29
39
  /**
30
40
  * Entity id for the template being used
@@ -38,6 +48,10 @@ declare namespace Components {
38
48
  context_data: {
39
49
  additionalProperties?: string;
40
50
  };
51
+ /**
52
+ * Entity id used to resolve entity and relational template variables
53
+ */
54
+ context_entity_id?: string; // uuid
41
55
  /**
42
56
  * Language code for the document
43
57
  * example:
@@ -150,6 +164,7 @@ declare namespace Components {
150
164
  showStepSubtitle?: boolean | null;
151
165
  showStepper?: boolean | null;
152
166
  showStepperLabels?: boolean | null;
167
+ stepperType?: "numbers" | "progress bar";
153
168
  hideNextButton?: boolean | null;
154
169
  name: string;
155
170
  stepId?: string;
@@ -262,6 +277,10 @@ declare namespace Components {
262
277
  * If type is not text, we can instruct the journey to fetch the entity id we receive as value
263
278
  */
264
279
  shouldLoadEntity?: boolean;
280
+ /**
281
+ * Human-readable note describing the parameter's purpose. Free text; may contain newlines.
282
+ */
283
+ description?: string | null;
265
284
  }[];
266
285
  /**
267
286
  * Journey Template
@@ -280,7 +299,11 @@ declare namespace Components {
280
299
  settings?: {
281
300
  embedOptions?: {
282
301
  mode?: "full-screen" | "inline";
283
- lang?: "de" | "en" | "fr";
302
+ /**
303
+ * example:
304
+ * de
305
+ */
306
+ lang?: string;
284
307
  width?: string;
285
308
  topBar?: boolean;
286
309
  scrollToTop?: boolean;
@@ -295,9 +318,13 @@ declare namespace Components {
295
318
  */
296
319
  canary?: boolean;
297
320
  designId: string;
298
- templateId?: string;
321
+ templateId?: string | null;
299
322
  entityId?: string | null;
300
323
  mappingsAutomationId?: string;
324
+ /**
325
+ * When true, the journey is created without a mapping config or automation; mappings are managed as advanced mappings on a lazily created automation.
326
+ */
327
+ newMappings?: boolean;
301
328
  targetedCustomer?: string;
302
329
  description?: string | null;
303
330
  organizationSettings?: {
@@ -341,12 +368,21 @@ declare namespace Components {
341
368
  */
342
369
  enableDarkMode?: boolean;
343
370
  accessMode?: "PUBLIC" | "PRIVATE";
371
+ /**
372
+ * Steps after this step require an authenticated session (auth gate)
373
+ */
374
+ authGate?: {
375
+ /**
376
+ * The step containing the Login & Registration block
377
+ */
378
+ stepId: string;
379
+ };
344
380
  isPublished?: boolean;
345
381
  status?: string;
346
382
  isActive?: boolean;
347
383
  savingProgress?: {
348
- savingMode?: "auto" | "local" | "remote" | "none";
349
- supportedVersion?: number;
384
+ mode?: "auto" | "local" | "remote" | "none";
385
+ supportedRevision?: number;
350
386
  };
351
387
  /**
352
388
  * If false, third-party cookies are disabled to comply with GDPR regulations without asking for consent.
@@ -355,14 +391,22 @@ declare namespace Components {
355
391
  };
356
392
  validationRules?: /**
357
393
  * References to validation rules organized by blocks and fields.
358
- * Maps block IDs to either rule IDs (for block-level rules) or rule references (for field-level rules).
394
+ * Maps block IDs to either one or more ordered rule IDs (for block-level rules)
395
+ * or rule references (for field-level rules).
359
396
  *
360
397
  * example:
361
398
  * {
362
399
  * "block1": "rule123",
363
- * "block2": {
364
- * "field1": "rule456",
365
- * "field2": "rule789"
400
+ * "block2": [
401
+ * "rule456",
402
+ * "rule789"
403
+ * ],
404
+ * "block3": {
405
+ * "field1": "rule101",
406
+ * "field2": [
407
+ * "rule102",
408
+ * "rule103"
409
+ * ]
366
410
  * }
367
411
  * }
368
412
  */
@@ -386,6 +430,18 @@ declare namespace Components {
386
430
  [name: string]: any;
387
431
  };
388
432
  }
433
+ /**
434
+ * Journeys read from the API always carry an explicit `settings.isActive`. The flag remains optional in request bodies.
435
+ *
436
+ */
437
+ export interface JourneyActivationGuarantee {
438
+ settings: {
439
+ /**
440
+ * Whether the journey is active (accessible to end customers)
441
+ */
442
+ isActive: boolean;
443
+ };
444
+ }
389
445
  export interface JourneyAuditInfo {
390
446
  createdAt: string;
391
447
  lastModifiedAt: string;
@@ -406,6 +462,7 @@ declare namespace Components {
406
462
  showStepSubtitle?: boolean | null;
407
463
  showStepper?: boolean | null;
408
464
  showStepperLabels?: boolean | null;
465
+ stepperType?: "numbers" | "progress bar";
409
466
  hideNextButton?: boolean | null;
410
467
  name: string;
411
468
  stepId?: string;
@@ -518,6 +575,10 @@ declare namespace Components {
518
575
  * If type is not text, we can instruct the journey to fetch the entity id we receive as value
519
576
  */
520
577
  shouldLoadEntity?: boolean;
578
+ /**
579
+ * Human-readable note describing the parameter's purpose. Free text; may contain newlines.
580
+ */
581
+ description?: string | null;
521
582
  }[];
522
583
  /**
523
584
  * Journey Template
@@ -536,7 +597,11 @@ declare namespace Components {
536
597
  settings?: {
537
598
  embedOptions?: {
538
599
  mode?: "full-screen" | "inline";
539
- lang?: "de" | "en" | "fr";
600
+ /**
601
+ * example:
602
+ * de
603
+ */
604
+ lang?: string;
540
605
  width?: string;
541
606
  topBar?: boolean;
542
607
  scrollToTop?: boolean;
@@ -551,9 +616,13 @@ declare namespace Components {
551
616
  */
552
617
  canary?: boolean;
553
618
  designId: string;
554
- templateId?: string;
619
+ templateId?: string | null;
555
620
  entityId?: string | null;
556
621
  mappingsAutomationId?: string;
622
+ /**
623
+ * When true, the journey is created without a mapping config or automation; mappings are managed as advanced mappings on a lazily created automation.
624
+ */
625
+ newMappings?: boolean;
557
626
  targetedCustomer?: string;
558
627
  description?: string | null;
559
628
  organizationSettings?: {
@@ -597,12 +666,21 @@ declare namespace Components {
597
666
  */
598
667
  enableDarkMode?: boolean;
599
668
  accessMode?: "PUBLIC" | "PRIVATE";
669
+ /**
670
+ * Steps after this step require an authenticated session (auth gate)
671
+ */
672
+ authGate?: {
673
+ /**
674
+ * The step containing the Login & Registration block
675
+ */
676
+ stepId: string;
677
+ };
600
678
  isPublished?: boolean;
601
679
  status?: string;
602
680
  isActive?: boolean;
603
681
  savingProgress?: {
604
- savingMode?: "auto" | "local" | "remote" | "none";
605
- supportedVersion?: number;
682
+ mode?: "auto" | "local" | "remote" | "none";
683
+ supportedRevision?: number;
606
684
  };
607
685
  /**
608
686
  * If false, third-party cookies are disabled to comply with GDPR regulations without asking for consent.
@@ -611,14 +689,22 @@ declare namespace Components {
611
689
  };
612
690
  validationRules?: /**
613
691
  * References to validation rules organized by blocks and fields.
614
- * Maps block IDs to either rule IDs (for block-level rules) or rule references (for field-level rules).
692
+ * Maps block IDs to either one or more ordered rule IDs (for block-level rules)
693
+ * or rule references (for field-level rules).
615
694
  *
616
695
  * example:
617
696
  * {
618
697
  * "block1": "rule123",
619
- * "block2": {
620
- * "field1": "rule456",
621
- * "field2": "rule789"
698
+ * "block2": [
699
+ * "rule456",
700
+ * "rule789"
701
+ * ],
702
+ * "block3": {
703
+ * "field1": "rule101",
704
+ * "field2": [
705
+ * "rule102",
706
+ * "rule103"
707
+ * ]
622
708
  * }
623
709
  * }
624
710
  */
@@ -645,6 +731,7 @@ declare namespace Components {
645
731
  showStepSubtitle?: boolean | null;
646
732
  showStepper?: boolean | null;
647
733
  showStepperLabels?: boolean | null;
734
+ stepperType?: "numbers" | "progress bar";
648
735
  hideNextButton?: boolean | null;
649
736
  name: string;
650
737
  stepId?: string;
@@ -757,6 +844,10 @@ declare namespace Components {
757
844
  * If type is not text, we can instruct the journey to fetch the entity id we receive as value
758
845
  */
759
846
  shouldLoadEntity?: boolean;
847
+ /**
848
+ * Human-readable note describing the parameter's purpose. Free text; may contain newlines.
849
+ */
850
+ description?: string | null;
760
851
  }[];
761
852
  /**
762
853
  * Journey Template
@@ -775,7 +866,11 @@ declare namespace Components {
775
866
  settings?: {
776
867
  embedOptions?: {
777
868
  mode?: "full-screen" | "inline";
778
- lang?: "de" | "en" | "fr";
869
+ /**
870
+ * example:
871
+ * de
872
+ */
873
+ lang?: string;
779
874
  width?: string;
780
875
  topBar?: boolean;
781
876
  scrollToTop?: boolean;
@@ -788,7 +883,11 @@ declare namespace Components {
788
883
  designId?: string;
789
884
  entityId?: string | null;
790
885
  mappingsAutomationId?: string;
791
- templateId?: string;
886
+ /**
887
+ * When true, the journey is created without a mapping config or automation; mappings are managed as advanced mappings on a lazily created automation.
888
+ */
889
+ newMappings?: boolean;
890
+ templateId?: string | null;
792
891
  targetedCustomer?: string;
793
892
  description?: string | null;
794
893
  publicToken?: string | null;
@@ -825,22 +924,47 @@ declare namespace Components {
825
924
  */
826
925
  thirdPartyCookies?: boolean;
827
926
  accessMode?: "PUBLIC" | "PRIVATE";
927
+ /**
928
+ * Steps after this step require an authenticated session (auth gate)
929
+ */
930
+ authGate?: {
931
+ /**
932
+ * The step containing the Login & Registration block
933
+ */
934
+ stepId: string;
935
+ };
828
936
  /**
829
937
  * If true, the journey shows an icon to toggle dark mode
830
938
  */
831
939
  enableDarkMode?: boolean;
940
+ /**
941
+ * If true, some journey input labels are in Austrian format
942
+ */
943
+ useAustrianLabels?: boolean;
832
944
  isActive?: boolean;
945
+ savingProgress?: {
946
+ mode?: "auto" | "local" | "remote" | "none";
947
+ supportedRevision?: number;
948
+ };
833
949
  };
834
950
  validationRules?: /**
835
951
  * References to validation rules organized by blocks and fields.
836
- * Maps block IDs to either rule IDs (for block-level rules) or rule references (for field-level rules).
952
+ * Maps block IDs to either one or more ordered rule IDs (for block-level rules)
953
+ * or rule references (for field-level rules).
837
954
  *
838
955
  * example:
839
956
  * {
840
957
  * "block1": "rule123",
841
- * "block2": {
842
- * "field1": "rule456",
843
- * "field2": "rule789"
958
+ * "block2": [
959
+ * "rule456",
960
+ * "rule789"
961
+ * ],
962
+ * "block3": {
963
+ * "field1": "rule101",
964
+ * "field2": [
965
+ * "rule102",
966
+ * "rule103"
967
+ * ]
844
968
  * }
845
969
  * }
846
970
  */
@@ -850,6 +974,17 @@ declare namespace Components {
850
974
  */
851
975
  _manifest?: string /* uuid */[];
852
976
  }
977
+ export interface JourneyEnvironmentResponse {
978
+ items: {
979
+ datasourceId: string;
980
+ type: "Text" | "Number" | "Boolean" | "Map";
981
+ value: string | number | boolean | EnvironmentMap;
982
+ }[];
983
+ errors: {
984
+ datasourceId: string;
985
+ code: "not_found" | "unsupported_type" | "not_set" | "invalid_value" | "incompatible_consumer";
986
+ }[];
987
+ }
853
988
  export interface JourneyFeatureFlags {
854
989
  featureFlags?: {
855
990
  [name: string]: any;
@@ -957,17 +1092,22 @@ declare namespace Components {
957
1092
  }
958
1093
  /**
959
1094
  * Field-level rule references within a block.
960
- * Maps field names to rule IDs.
1095
+ * Maps field names to one or more ordered rule IDs.
961
1096
  *
962
1097
  * example:
963
1098
  * {
964
1099
  * "firstName": "rule123",
965
- * "lastName": "rule456",
966
- * "email": "rule789"
1100
+ * "lastName": [
1101
+ * "rule456",
1102
+ * "rule789"
1103
+ * ]
967
1104
  * }
968
1105
  */
969
1106
  export interface RuleRef {
970
- [name: string]: string;
1107
+ [name: string]: string | [
1108
+ string,
1109
+ ...string[]
1110
+ ];
971
1111
  }
972
1112
  export interface S3Reference {
973
1113
  /**
@@ -1181,27 +1321,40 @@ declare namespace Components {
1181
1321
  }
1182
1322
  /**
1183
1323
  * References to validation rules organized by blocks and fields.
1184
- * Maps block IDs to either rule IDs (for block-level rules) or rule references (for field-level rules).
1324
+ * Maps block IDs to either one or more ordered rule IDs (for block-level rules)
1325
+ * or rule references (for field-level rules).
1185
1326
  *
1186
1327
  * example:
1187
1328
  * {
1188
1329
  * "block1": "rule123",
1189
- * "block2": {
1190
- * "field1": "rule456",
1191
- * "field2": "rule789"
1330
+ * "block2": [
1331
+ * "rule456",
1332
+ * "rule789"
1333
+ * ],
1334
+ * "block3": {
1335
+ * "field1": "rule101",
1336
+ * "field2": [
1337
+ * "rule102",
1338
+ * "rule103"
1339
+ * ]
1192
1340
  * }
1193
1341
  * }
1194
1342
  */
1195
1343
  export interface ValidationRuleRef {
1196
- [name: string]: string | /**
1344
+ [name: string]: string | [
1345
+ string,
1346
+ ...string[]
1347
+ ] | /**
1197
1348
  * Field-level rule references within a block.
1198
- * Maps field names to rule IDs.
1349
+ * Maps field names to one or more ordered rule IDs.
1199
1350
  *
1200
1351
  * example:
1201
1352
  * {
1202
1353
  * "firstName": "rule123",
1203
- * "lastName": "rule456",
1204
- * "email": "rule789"
1354
+ * "lastName": [
1355
+ * "rule456",
1356
+ * "rule789"
1357
+ * ]
1205
1358
  * }
1206
1359
  */
1207
1360
  RuleRef;
@@ -1326,7 +1479,309 @@ declare namespace Paths {
1326
1479
  orgId?: Parameters.OrgId;
1327
1480
  }
1328
1481
  namespace Responses {
1329
- export type $200 = Components.Schemas.Journey;
1482
+ /**
1483
+ * Journeys read from the API always carry an explicit `settings.isActive`. The flag remains optional in request bodies.
1484
+ *
1485
+ */
1486
+ export interface $200 {
1487
+ [name: string]: any;
1488
+ journeyId?: string;
1489
+ organizationId: string;
1490
+ brandId?: string;
1491
+ name: string;
1492
+ steps: {
1493
+ showStepName?: boolean | null;
1494
+ title?: string | null;
1495
+ subTitle?: string | null;
1496
+ showStepSubtitle?: boolean | null;
1497
+ showStepper?: boolean | null;
1498
+ showStepperLabels?: boolean | null;
1499
+ stepperType?: "numbers" | "progress bar";
1500
+ hideNextButton?: boolean | null;
1501
+ name: string;
1502
+ stepId?: string;
1503
+ schema: any;
1504
+ uischema: any;
1505
+ maxWidth?: "small" | "medium" | "large" | "extra large";
1506
+ }[];
1507
+ design?: {
1508
+ logoUrl?: string | null;
1509
+ theme?: {
1510
+ [name: string]: any;
1511
+ };
1512
+ designTokens?: {
1513
+ [key: string]: any;
1514
+ };
1515
+ };
1516
+ rules?: {
1517
+ type: "inject" | "injectWithKey";
1518
+ sourceType: "journey" | "step" | "block";
1519
+ source: string;
1520
+ target: string;
1521
+ }[];
1522
+ logics?: {
1523
+ autoGeneratedId?: string;
1524
+ conditions: string[];
1525
+ actions: string[];
1526
+ }[];
1527
+ logicsV4?: {
1528
+ [name: string]: {
1529
+ /**
1530
+ * Unique identifier for logic. Use uuidv7
1531
+ */
1532
+ id?: string; // uuid
1533
+ /**
1534
+ * If true, logic can't be manipulated by the configuring user
1535
+ */
1536
+ protected?: boolean;
1537
+ /**
1538
+ * Indicates which action to take in case logic evaluates to true
1539
+ */
1540
+ action?: string;
1541
+ /**
1542
+ * Indicates when the logic should be evaluated
1543
+ */
1544
+ triggeredOn?: string;
1545
+ conditions?: {
1546
+ /**
1547
+ * Operator to be applied between the fact value and the value
1548
+ */
1549
+ operator?: string;
1550
+ /**
1551
+ * If operator is a custom function, this needs to be provided
1552
+ */
1553
+ functionName?: string;
1554
+ fact?: {
1555
+ /**
1556
+ * Unique identifier for a fact
1557
+ */
1558
+ id?: string; // uuid
1559
+ /**
1560
+ * Indicates reference type (block or context parameter)
1561
+ */
1562
+ referenceType?: string;
1563
+ /**
1564
+ * Id of the reference
1565
+ */
1566
+ referenceId?: string;
1567
+ /**
1568
+ * Path to a property. Used if only part of the value is needed
1569
+ */
1570
+ path?: string;
1571
+ /**
1572
+ * If path is a reference, indicates the intention of it
1573
+ */
1574
+ meaning?: string;
1575
+ };
1576
+ value?: string | number | boolean | {
1577
+ [key: string]: any;
1578
+ } | any[];
1579
+ args?: {
1580
+ [key: string]: any;
1581
+ };
1582
+ }[][];
1583
+ /**
1584
+ * Logic specific settings. Will vary by type of logic
1585
+ */
1586
+ settings?: {
1587
+ [key: string]: any;
1588
+ };
1589
+ };
1590
+ };
1591
+ contextSchema?: {
1592
+ /**
1593
+ * Unique identifier for the context schema item
1594
+ */
1595
+ id?: string; // uuid
1596
+ /**
1597
+ * Type of the parameter. It could be either an entity slug, or a text
1598
+ */
1599
+ type: string;
1600
+ /**
1601
+ * Expected key to be received in the context
1602
+ */
1603
+ paramKey: string;
1604
+ /**
1605
+ * Indicates if a value is expected to be provided
1606
+ */
1607
+ isRequired?: boolean;
1608
+ /**
1609
+ * If type is not text, we can instruct the journey to fetch the entity id we receive as value
1610
+ */
1611
+ shouldLoadEntity?: boolean;
1612
+ /**
1613
+ * Human-readable note describing the parameter's purpose. Free text; may contain newlines.
1614
+ */
1615
+ description?: string | null;
1616
+ }[];
1617
+ /**
1618
+ * Journey Template
1619
+ * example:
1620
+ * Sales template (Premium)
1621
+ */
1622
+ journey_type?: string;
1623
+ /**
1624
+ * If true, journey is displayed in read-only mode
1625
+ */
1626
+ protected?: boolean;
1627
+ /**
1628
+ * Whitelist of paths that remain editable when the journey is protected. Supports wildcard patterns (e.g. steps/*​/blocks/**).
1629
+ */
1630
+ protectedEditable?: string[];
1631
+ settings: {
1632
+ embedOptions?: {
1633
+ mode?: "full-screen" | "inline";
1634
+ /**
1635
+ * example:
1636
+ * de
1637
+ */
1638
+ lang?: string;
1639
+ width?: string;
1640
+ topBar?: boolean;
1641
+ scrollToTop?: boolean;
1642
+ button?: {
1643
+ text?: string | null;
1644
+ align?: "left" | "center" | "right";
1645
+ };
1646
+ };
1647
+ safeModeAutomation?: boolean;
1648
+ /**
1649
+ * DEPRECATED - This API will return hardcoded value of false. Please note that this field is internal to epilot and should not be used by external clients. If you wish to get the canary flag, please use the /v1/journey/{id}/settings API.
1650
+ */
1651
+ canary?: boolean;
1652
+ designId: string;
1653
+ templateId?: string | null;
1654
+ entityId?: string | null;
1655
+ mappingsAutomationId?: string;
1656
+ /**
1657
+ * When true, the journey is created without a mapping config or automation; mappings are managed as advanced mappings on a lazily created automation.
1658
+ */
1659
+ newMappings?: boolean;
1660
+ targetedCustomer?: string;
1661
+ description?: string | null;
1662
+ organizationSettings?: {
1663
+ [name: string]: boolean;
1664
+ } | null;
1665
+ publicToken?: string | null;
1666
+ runtimeEntities?: ("ORDER" | "OPPORTUNITY")[];
1667
+ filePurposes?: string[];
1668
+ entityTags?: string[];
1669
+ /**
1670
+ * @deprecated Use addressSuggestionsFileId instead
1671
+ */
1672
+ addressSuggestionsFileUrl?: string | null;
1673
+ addressSuggestionsFileId?: string | null;
1674
+ /**
1675
+ * Country code for address format (e.g. DE, AT, CH, LU)
1676
+ */
1677
+ addressSuggestionsCountryCode?: string | null;
1678
+ /**
1679
+ * Whether address auto-complete is enabled
1680
+ */
1681
+ addressSuggestionsEnableAutoComplete?: boolean;
1682
+ /**
1683
+ * Sources for address auto-complete (e.g. deutschePostService, customAddressesFile)
1684
+ */
1685
+ addressSuggestionsSource?: string[];
1686
+ /**
1687
+ * Whether free text input is allowed when auto-complete is on
1688
+ */
1689
+ addressSuggestionsEnableFreeText?: boolean;
1690
+ /**
1691
+ * This property is deprecated and will be removed in a future version
1692
+ */
1693
+ useNewDesign?: boolean;
1694
+ /**
1695
+ * If true, some journey input labels are in Austrian format
1696
+ */
1697
+ useAustrianLabels?: boolean;
1698
+ /**
1699
+ * If true, the journey shows an icon to toggle dark mode
1700
+ */
1701
+ enableDarkMode?: boolean;
1702
+ accessMode?: "PUBLIC" | "PRIVATE";
1703
+ /**
1704
+ * Steps after this step require an authenticated session (auth gate)
1705
+ */
1706
+ authGate?: {
1707
+ /**
1708
+ * The step containing the Login & Registration block
1709
+ */
1710
+ stepId: string;
1711
+ };
1712
+ isPublished?: boolean;
1713
+ status?: string;
1714
+ /**
1715
+ * Whether the journey is active (accessible to end customers)
1716
+ */
1717
+ isActive: boolean;
1718
+ savingProgress?: {
1719
+ mode?: "auto" | "local" | "remote" | "none";
1720
+ supportedRevision?: number;
1721
+ };
1722
+ /**
1723
+ * If false, third-party cookies are disabled to comply with GDPR regulations without asking for consent.
1724
+ */
1725
+ thirdPartyCookies?: boolean;
1726
+ };
1727
+ validationRules?: /**
1728
+ * References to validation rules organized by blocks and fields.
1729
+ * Maps block IDs to either one or more ordered rule IDs (for block-level rules)
1730
+ * or rule references (for field-level rules).
1731
+ *
1732
+ * example:
1733
+ * {
1734
+ * "block1": "rule123",
1735
+ * "block2": [
1736
+ * "rule456",
1737
+ * "rule789"
1738
+ * ],
1739
+ * "block3": {
1740
+ * "field1": "rule101",
1741
+ * "field2": [
1742
+ * "rule102",
1743
+ * "rule103"
1744
+ * ]
1745
+ * }
1746
+ * }
1747
+ */
1748
+ Components.Schemas.ValidationRuleRef;
1749
+ /**
1750
+ * Manifest/Blueprint ID used to create/update the entity
1751
+ */
1752
+ _manifest?: string /* uuid */[];
1753
+ createdBy?: string;
1754
+ updatedBy?: string | null;
1755
+ /**
1756
+ * If passed with value of null, the API won't modify the lastModifiedAt field on updating the journey
1757
+ */
1758
+ __lastModifiedAt?: string | null;
1759
+ createdAt: string;
1760
+ lastModifiedAt: string;
1761
+ deletedAt?: string;
1762
+ version: number;
1763
+ revisions: number;
1764
+ featureFlags?: {
1765
+ [name: string]: any;
1766
+ };
1767
+ }
1768
+ }
1769
+ }
1770
+ namespace GetJourneyEnvironment {
1771
+ namespace Parameters {
1772
+ export type Id = string; // uuid
1773
+ }
1774
+ export interface PathParameters {
1775
+ id: Parameters.Id /* uuid */;
1776
+ }
1777
+ namespace Responses {
1778
+ export type $200 = Components.Schemas.JourneyEnvironmentResponse;
1779
+ export interface $401 {
1780
+ }
1781
+ export interface $403 {
1782
+ }
1783
+ export interface $502 {
1784
+ }
1330
1785
  }
1331
1786
  }
1332
1787
  namespace GetJourneyProducts {
@@ -1380,7 +1835,267 @@ declare namespace Paths {
1380
1835
  version?: Parameters.Version;
1381
1836
  }
1382
1837
  namespace Responses {
1383
- export type $200 = Components.Schemas.JourneyCreationRequestV2;
1838
+ /**
1839
+ * Journeys read from the API always carry an explicit `settings.isActive`. The flag remains optional in request bodies.
1840
+ *
1841
+ */
1842
+ export interface $200 {
1843
+ journeyId?: string;
1844
+ brandId?: string;
1845
+ name: string;
1846
+ steps: {
1847
+ showStepName?: boolean | null;
1848
+ title?: string | null;
1849
+ subTitle?: string | null;
1850
+ showStepSubtitle?: boolean | null;
1851
+ showStepper?: boolean | null;
1852
+ showStepperLabels?: boolean | null;
1853
+ stepperType?: "numbers" | "progress bar";
1854
+ hideNextButton?: boolean | null;
1855
+ name: string;
1856
+ stepId?: string;
1857
+ schema: any;
1858
+ uischema: any;
1859
+ maxWidth?: "small" | "medium" | "large" | "extra large";
1860
+ }[];
1861
+ design?: {
1862
+ logoUrl?: string | null;
1863
+ theme?: {
1864
+ [name: string]: any;
1865
+ };
1866
+ designTokens?: {
1867
+ [key: string]: any;
1868
+ };
1869
+ };
1870
+ rules?: {
1871
+ type: "inject" | "injectWithKey";
1872
+ sourceType: "journey" | "step" | "block";
1873
+ source: string;
1874
+ target: string;
1875
+ }[];
1876
+ logics?: {
1877
+ autoGeneratedId?: string;
1878
+ conditions: string[];
1879
+ actions: string[];
1880
+ }[];
1881
+ logicsV4?: {
1882
+ [name: string]: {
1883
+ /**
1884
+ * Unique identifier for logic. Use uuidv7
1885
+ */
1886
+ id?: string; // uuid
1887
+ /**
1888
+ * If true, logic can't be manipulated by the configuring user
1889
+ */
1890
+ protected?: boolean;
1891
+ /**
1892
+ * Indicates which action to take in case logic evaluates to true
1893
+ */
1894
+ action?: string;
1895
+ /**
1896
+ * Indicates when the logic should be evaluated
1897
+ */
1898
+ triggeredOn?: string;
1899
+ conditions?: {
1900
+ /**
1901
+ * Operator to be applied between the fact value and the value
1902
+ */
1903
+ operator?: string;
1904
+ /**
1905
+ * If operator is a custom function, this needs to be provided
1906
+ */
1907
+ functionName?: string;
1908
+ fact?: {
1909
+ /**
1910
+ * Unique identifier for a fact
1911
+ */
1912
+ id?: string; // uuid
1913
+ /**
1914
+ * Indicates reference type (block or context parameter)
1915
+ */
1916
+ referenceType?: string;
1917
+ /**
1918
+ * Id of the reference
1919
+ */
1920
+ referenceId?: string;
1921
+ /**
1922
+ * Path to a property. Used if only part of the value is needed
1923
+ */
1924
+ path?: string;
1925
+ /**
1926
+ * If path is a reference, indicates the intention of it
1927
+ */
1928
+ meaning?: string;
1929
+ };
1930
+ value?: string | number | boolean | {
1931
+ [key: string]: any;
1932
+ } | any[];
1933
+ args?: {
1934
+ [key: string]: any;
1935
+ };
1936
+ }[][];
1937
+ /**
1938
+ * Logic specific settings. Will vary by type of logic
1939
+ */
1940
+ settings?: {
1941
+ [key: string]: any;
1942
+ };
1943
+ };
1944
+ };
1945
+ contextSchema?: {
1946
+ /**
1947
+ * Unique identifier for the context schema item
1948
+ */
1949
+ id?: string; // uuid
1950
+ /**
1951
+ * Type of the parameter. It could be either an entity slug, or a text
1952
+ */
1953
+ type: string;
1954
+ /**
1955
+ * Expected key to be received in the context
1956
+ */
1957
+ paramKey: string;
1958
+ /**
1959
+ * Indicates if a value is expected to be provided
1960
+ */
1961
+ isRequired?: boolean;
1962
+ /**
1963
+ * If type is not text, we can instruct the journey to fetch the entity id we receive as value
1964
+ */
1965
+ shouldLoadEntity?: boolean;
1966
+ /**
1967
+ * Human-readable note describing the parameter's purpose. Free text; may contain newlines.
1968
+ */
1969
+ description?: string | null;
1970
+ }[];
1971
+ /**
1972
+ * Journey Template
1973
+ * example:
1974
+ * Sales template (Premium)
1975
+ */
1976
+ journey_type?: string;
1977
+ /**
1978
+ * If true, journey is displayed in read-only mode
1979
+ */
1980
+ protected?: boolean;
1981
+ /**
1982
+ * Whitelist of paths that remain editable when the journey is protected. Supports wildcard patterns (e.g. steps/*​/blocks/**).
1983
+ */
1984
+ protectedEditable?: string[];
1985
+ settings: {
1986
+ embedOptions?: {
1987
+ mode?: "full-screen" | "inline";
1988
+ /**
1989
+ * example:
1990
+ * de
1991
+ */
1992
+ lang?: string;
1993
+ width?: string;
1994
+ topBar?: boolean;
1995
+ scrollToTop?: boolean;
1996
+ button?: {
1997
+ text?: string | null;
1998
+ align?: "left" | "center" | "right";
1999
+ };
2000
+ };
2001
+ safeModeAutomation?: boolean;
2002
+ designId?: string;
2003
+ entityId?: string | null;
2004
+ mappingsAutomationId?: string;
2005
+ /**
2006
+ * When true, the journey is created without a mapping config or automation; mappings are managed as advanced mappings on a lazily created automation.
2007
+ */
2008
+ newMappings?: boolean;
2009
+ templateId?: string | null;
2010
+ targetedCustomer?: string;
2011
+ description?: string | null;
2012
+ publicToken?: string | null;
2013
+ runtimeEntities?: ("ORDER" | "OPPORTUNITY")[];
2014
+ filePurposes?: string[];
2015
+ entityTags?: string[];
2016
+ /**
2017
+ * @deprecated Use addressSuggestionsFileId instead
2018
+ */
2019
+ addressSuggestionsFileUrl?: string | null;
2020
+ addressSuggestionsFileId?: string | null;
2021
+ /**
2022
+ * Country code for address format (e.g. DE, AT, CH, LU)
2023
+ */
2024
+ addressSuggestionsCountryCode?: string | null;
2025
+ /**
2026
+ * Whether address auto-complete is enabled
2027
+ */
2028
+ addressSuggestionsEnableAutoComplete?: boolean;
2029
+ /**
2030
+ * Sources for address auto-complete (e.g. deutschePostService, customAddressesFile)
2031
+ */
2032
+ addressSuggestionsSource?: string[];
2033
+ /**
2034
+ * Whether free text input is allowed when auto-complete is on
2035
+ */
2036
+ addressSuggestionsEnableFreeText?: boolean;
2037
+ /**
2038
+ * This property is deprecated and will be removed in a future version
2039
+ */
2040
+ useNewDesign?: boolean;
2041
+ /**
2042
+ * If false, third-party cookies are disabled to comply with GDPR regulations without asking for consent.
2043
+ */
2044
+ thirdPartyCookies?: boolean;
2045
+ accessMode?: "PUBLIC" | "PRIVATE";
2046
+ /**
2047
+ * Steps after this step require an authenticated session (auth gate)
2048
+ */
2049
+ authGate?: {
2050
+ /**
2051
+ * The step containing the Login & Registration block
2052
+ */
2053
+ stepId: string;
2054
+ };
2055
+ /**
2056
+ * If true, the journey shows an icon to toggle dark mode
2057
+ */
2058
+ enableDarkMode?: boolean;
2059
+ /**
2060
+ * If true, some journey input labels are in Austrian format
2061
+ */
2062
+ useAustrianLabels?: boolean;
2063
+ /**
2064
+ * Whether the journey is active (accessible to end customers)
2065
+ */
2066
+ isActive: boolean;
2067
+ savingProgress?: {
2068
+ mode?: "auto" | "local" | "remote" | "none";
2069
+ supportedRevision?: number;
2070
+ };
2071
+ };
2072
+ validationRules?: /**
2073
+ * References to validation rules organized by blocks and fields.
2074
+ * Maps block IDs to either one or more ordered rule IDs (for block-level rules)
2075
+ * or rule references (for field-level rules).
2076
+ *
2077
+ * example:
2078
+ * {
2079
+ * "block1": "rule123",
2080
+ * "block2": [
2081
+ * "rule456",
2082
+ * "rule789"
2083
+ * ],
2084
+ * "block3": {
2085
+ * "field1": "rule101",
2086
+ * "field2": [
2087
+ * "rule102",
2088
+ * "rule103"
2089
+ * ]
2090
+ * }
2091
+ * }
2092
+ */
2093
+ Components.Schemas.ValidationRuleRef;
2094
+ /**
2095
+ * Manifest/Blueprint ID used to create/update the entity
2096
+ */
2097
+ _manifest?: string /* uuid */[];
2098
+ }
1384
2099
  }
1385
2100
  }
1386
2101
  namespace GetJourneysByOrgId {
@@ -1588,6 +2303,16 @@ export interface OperationMethods {
1588
2303
  data?: any,
1589
2304
  config?: AxiosRequestConfig
1590
2305
  ): OperationResponse<any>
2306
+ /**
2307
+ * getJourneyEnvironment - getJourneyEnvironment
2308
+ *
2309
+ * Resolve the environment variables referenced by this journey. Only browser-safe value types are returned.
2310
+ */
2311
+ 'getJourneyEnvironment'(
2312
+ parameters?: Parameters<Paths.GetJourneyEnvironment.PathParameters> | null,
2313
+ data?: any,
2314
+ config?: AxiosRequestConfig
2315
+ ): OperationResponse<Paths.GetJourneyEnvironment.Responses.$200>
1591
2316
  /**
1592
2317
  * getJourneyProducts - getJourneyProducts
1593
2318
  *
@@ -1766,6 +2491,18 @@ export interface PathsDictionary {
1766
2491
  config?: AxiosRequestConfig
1767
2492
  ): OperationResponse<any>
1768
2493
  }
2494
+ ['/v1/journey/configuration/{id}/environment']: {
2495
+ /**
2496
+ * getJourneyEnvironment - getJourneyEnvironment
2497
+ *
2498
+ * Resolve the environment variables referenced by this journey. Only browser-safe value types are returned.
2499
+ */
2500
+ 'get'(
2501
+ parameters?: Parameters<Paths.GetJourneyEnvironment.PathParameters> | null,
2502
+ data?: any,
2503
+ config?: AxiosRequestConfig
2504
+ ): OperationResponse<Paths.GetJourneyEnvironment.Responses.$200>
2505
+ }
1769
2506
  ['/v1/journey/products/{id}']: {
1770
2507
  /**
1771
2508
  * getJourneyProducts - getJourneyProducts
@@ -1929,14 +2666,18 @@ export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
1929
2666
 
1930
2667
 
1931
2668
  export type ButtonOption = Components.Schemas.ButtonOption;
2669
+ export type EnvironmentMap = Components.Schemas.EnvironmentMap;
2670
+ export type EnvironmentMapEntry = Components.Schemas.EnvironmentMapEntry;
1932
2671
  export type GenerateDocumentRequest = Components.Schemas.GenerateDocumentRequest;
1933
2672
  export type GenerateDocumentResponse = Components.Schemas.GenerateDocumentResponse;
1934
2673
  export type GetJourneysResponse = Components.Schemas.GetJourneysResponse;
1935
2674
  export type GetSettingsForJourney = Components.Schemas.GetSettingsForJourney;
1936
2675
  export type Journey = Components.Schemas.Journey;
2676
+ export type JourneyActivationGuarantee = Components.Schemas.JourneyActivationGuarantee;
1937
2677
  export type JourneyAuditInfo = Components.Schemas.JourneyAuditInfo;
1938
2678
  export type JourneyCreationRequest = Components.Schemas.JourneyCreationRequest;
1939
2679
  export type JourneyCreationRequestV2 = Components.Schemas.JourneyCreationRequestV2;
2680
+ export type JourneyEnvironmentResponse = Components.Schemas.JourneyEnvironmentResponse;
1940
2681
  export type JourneyFeatureFlags = Components.Schemas.JourneyFeatureFlags;
1941
2682
  export type JourneyProductsResponse = Components.Schemas.JourneyProductsResponse;
1942
2683
  export type JourneyResponse = Components.Schemas.JourneyResponse;
package/package.json CHANGED
@@ -1,9 +1,19 @@
1
1
  {
2
2
  "name": "@epilot/journey-client",
3
- "version": "0.5.3",
3
+ "version": "0.6.0-alpha.0",
4
4
  "description": "API Client for epilot Journey API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "test": "vitest",
9
+ "typescript": "tsc",
10
+ "bundle-definition": "webpack",
11
+ "openapi": "node ../../scripts/update-openapi.js https://docs.api.epilot.io/journey-config.yaml",
12
+ "typegen": "openapi typegen src/openapi.json --client > src/openapi.d.ts",
13
+ "build": "npm run openapi && npm run typegen && npm run typescript && npm run bundle-definition",
14
+ "eslint": "../node_modules/.bin/eslint -c ../.eslintrc.yml",
15
+ "prepublishOnly": "npm run build"
16
+ },
7
17
  "files": [
8
18
  "*.js",
9
19
  "*.d.ts",
@@ -47,14 +57,5 @@
47
57
  "vitest": "^1.6.0",
48
58
  "webpack": "^5.91.0",
49
59
  "webpack-cli": "^5.1.4"
50
- },
51
- "scripts": {
52
- "test": "vitest",
53
- "typescript": "tsc",
54
- "bundle-definition": "webpack",
55
- "openapi": "node ../../scripts/update-openapi.js https://docs.api.epilot.io/journey-config.yaml",
56
- "typegen": "openapi typegen src/openapi.json --client > src/openapi.d.ts",
57
- "build": "npm run openapi && npm run typegen && npm run typescript && npm run bundle-definition",
58
- "eslint": "../node_modules/.bin/eslint -c ../.eslintrc.yml"
59
60
  }
60
- }
61
+ }