@getlatedev/node 0.2.1773 → 0.2.1774

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/dist/index.js CHANGED
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(index_exports);
36
36
  // package.json
37
37
  var package_default = {
38
38
  name: "@getlatedev/node",
39
- version: "0.2.1773",
39
+ version: "0.2.1774",
40
40
  description: "The official Node.js library for the Zernio API",
41
41
  main: "dist/index.js",
42
42
  module: "dist/index.mjs",
package/dist/index.mjs CHANGED
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
5
5
  // package.json
6
6
  var package_default = {
7
7
  name: "@getlatedev/node",
8
- version: "0.2.1773",
8
+ version: "0.2.1774",
9
9
  description: "The official Node.js library for the Zernio API",
10
10
  main: "dist/index.js",
11
11
  module: "dist/index.mjs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getlatedev/node",
3
- "version": "0.2.1773",
3
+ "version": "0.2.1774",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -5046,6 +5046,49 @@ export type AutomationControls = {
5046
5046
  */
5047
5047
  export type AutomationDefinition = AdRuleAutomationDefinition | EventAutomationDefinition | ScheduledAutomationDefinition | SequenceAutomationDefinition | CommentAutomationDefinition | FlowAutomationDefinition;
5048
5048
 
5049
+ /**
5050
+ * A step of an event automation that acts on its own. `messages.send`, `contacts.tag` and `sequences.enroll` need an event about a conversation or a call: they act on that person.
5051
+ *
5052
+ * `workflows.start` also takes an order event, reaching its customer by the phone the store holds. A step that does not fit its event is refused at its `type`.
5053
+ *
5054
+ * Only `webhook.call` and `notify.send` run on `message.sent` and `message.failed`, which an automation's own messages fire.
5055
+ *
5056
+ */
5057
+ export type AutomationEventActionStep = {
5058
+ id?: string;
5059
+ type: "messages.send";
5060
+ text: string;
5061
+ } | {
5062
+ id?: string;
5063
+ type: "workflows.start";
5064
+ workflowId: string;
5065
+ } | {
5066
+ id?: string;
5067
+ type: "sequences.enroll";
5068
+ sequenceId: string;
5069
+ } | {
5070
+ id?: string;
5071
+ type: "webhook.call";
5072
+ url: string;
5073
+ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
5074
+ headers?: {
5075
+ [key: string]: (string);
5076
+ };
5077
+ /**
5078
+ * May read `{{event.<fact>}}`.
5079
+ */
5080
+ body?: string;
5081
+ } | {
5082
+ id?: string;
5083
+ type: "contacts.tag";
5084
+ action: 'add' | 'remove';
5085
+ tag: string;
5086
+ };
5087
+
5088
+ export type method2 = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
5089
+
5090
+ export type action = 'add' | 'remove';
5091
+
5049
5092
  /**
5050
5093
  * The limits of an event or scheduled automation.
5051
5094
  */
@@ -5383,7 +5426,7 @@ export type AutomationRunDetail = AutomationRun & {
5383
5426
  };
5384
5427
 
5385
5428
  export type AutomationRunResult = {
5386
- type: 'notify.send' | 'ads.boost_post';
5429
+ type: 'notify.send' | 'ads.boost_post' | 'messages.send' | 'workflows.start' | 'sequences.enroll' | 'webhook.call' | 'contacts.tag';
5387
5430
  /**
5388
5431
  * `unknown` when the platform never answered, so the outcome is not known.
5389
5432
  */
@@ -5391,7 +5434,7 @@ export type AutomationRunResult = {
5391
5434
  reason: (string) | null;
5392
5435
  };
5393
5436
 
5394
- export type type7 = 'notify.send' | 'ads.boost_post';
5437
+ export type type7 = 'notify.send' | 'ads.boost_post' | 'messages.send' | 'workflows.start' | 'sequences.enroll' | 'webhook.call' | 'contacts.tag';
5395
5438
 
5396
5439
  /**
5397
5440
  * When an ad rule runs: `every` an interval or at set weekly `times` (send one), optionally only between `startsAt` and `endsAt` and never inside `quietHours`. Times and quiet hours are in the ad account timezone.
@@ -8544,7 +8587,7 @@ export type CommerceDiscount = {
8544
8587
 
8545
8588
  export type platform7 = 'shopify';
8546
8589
 
8547
- export type method2 = 'code' | 'automatic';
8590
+ export type method3 = 'code' | 'automatic';
8548
8591
 
8549
8592
  export type type14 = 'percentage' | 'fixed_amount' | 'free_shipping' | 'buy_x_get_y' | 'app';
8550
8593
 
@@ -13326,12 +13369,15 @@ export type EventAutomationCheck = {
13326
13369
  [key: string]: unknown;
13327
13370
  } | null;
13328
13371
  filter: Array<AutomationFactResult>;
13372
+ /**
13373
+ * One per step, in order, with what it did. A step refused for good, such as a closed WhatsApp window, is `skipped` with its reason.
13374
+ */
13329
13375
  actions: Array<AutomationRunResult>;
13330
13376
  error: (string) | null;
13331
13377
  };
13332
13378
 
13333
13379
  /**
13334
- * Runs when something happens in Zernio, such as a post failing, and notifies. Unknown fields are refused.
13380
+ * Runs when something happens in Zernio, such as a post failing or a call missed: it notifies, messages the person, starts a flow, and more. Unknown fields are refused.
13335
13381
  */
13336
13382
  export type EventAutomationDefinition = {
13337
13383
  name: string;
@@ -13343,7 +13389,7 @@ export type EventAutomationDefinition = {
13343
13389
  /**
13344
13390
  * May be empty: an automation with no steps only records each event it matches as a check with outcome `triggered` and no action. `limits.cooldown` and `limits.maxChangesPerDay` count actions, so they do nothing for it.
13345
13391
  */
13346
- steps: Array<AutomationNotifyStep>;
13392
+ steps: Array<(AutomationNotifyStep | AutomationEventActionStep)>;
13347
13393
  limits?: AutomationEventLimits;
13348
13394
  };
13349
13395
 
@@ -19377,7 +19423,7 @@ export type PayoutBatch = {
19377
19423
  */
19378
19424
  export type status50 = 'awaiting_payment' | 'paying' | 'paid' | 'partially_failed' | 'failed' | 'expired';
19379
19425
 
19380
- export type method3 = 'card';
19426
+ export type method4 = 'card';
19381
19427
 
19382
19428
  export type PayoutBatchItem = {
19383
19429
  id: string;
@@ -22186,7 +22232,7 @@ export type StorePixelInstall = {
22186
22232
  /**
22187
22233
  * WordPress only.
22188
22234
  */
22189
- export type method4 = 'wordpress_widget';
22235
+ export type method5 = 'wordpress_widget';
22190
22236
 
22191
22237
  export type StripeSettings = {
22192
22238
  /**
@@ -23239,7 +23285,7 @@ export type status60 = 'active' | 'paused' | 'removing';
23239
23285
  /**
23240
23286
  * How the tag is installed. `snippet` means you paste it.
23241
23287
  */
23242
- export type method5 = 'shopify' | 'wordpress' | 'wix' | 'webflow' | 'snippet';
23288
+ export type method6 = 'shopify' | 'wordpress' | 'wix' | 'webflow' | 'snippet';
23243
23289
 
23244
23290
  export type type32 = 'CNAME';
23245
23291
 
@@ -23637,7 +23683,7 @@ export type TreasuryTopup = {
23637
23683
  bonusCents?: (number) | null;
23638
23684
  };
23639
23685
 
23640
- export type method6 = 'card' | 'bank_transfer';
23686
+ export type method7 = 'card' | 'bank_transfer';
23641
23687
 
23642
23688
  /**
23643
23689
  * `balance` funds your balance; `payout_batch` is the card payment of one payout batch, which pays its creators directly.
@@ -30169,7 +30215,7 @@ export type WebhookPayloadReaction = {
30169
30215
 
30170
30216
  export type event81 = 'reaction.received';
30171
30217
 
30172
- export type action = 'added' | 'removed';
30218
+ export type action2 = 'added' | 'removed';
30173
30219
 
30174
30220
  /**
30175
30221
  * Webhook payload for referral received events (Instagram, Facebook Messenger)
@@ -31442,7 +31488,7 @@ export type WorkflowExecutionEvent = {
31442
31488
  at?: string;
31443
31489
  };
31444
31490
 
31445
- export type action2 = 'execution_started' | 'execution_completed' | 'execution_exited' | 'execution_paused' | 'execution_resumed' | 'node_started' | 'node_completed' | 'node_failed' | 'node_skipped';
31491
+ export type action3 = 'execution_started' | 'execution_completed' | 'execution_exited' | 'execution_paused' | 'execution_resumed' | 'node_started' | 'node_completed' | 'node_failed' | 'node_skipped';
31446
31492
 
31447
31493
  export type status76 = 'success' | 'failed' | 'pending';
31448
31494
 
@@ -67349,6 +67395,9 @@ export type GetAutomationCatalogResponse = ({
67349
67395
  [key: string]: unknown;
67350
67396
  };
67351
67397
  filterOperators?: Array<(string)>;
67398
+ /**
67399
+ * The step types the trigger takes. For an event, only those its subject can reach.
67400
+ */
67352
67401
  steps?: Array<(string)>;
67353
67402
  /**
67354
67403
  * Scheduled trigger only: the platforms, goals, most days and most boosts a day of `ads.boost_post`.