@zernio/node 0.2.1835 → 0.2.1837

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: "@zernio/node",
39
- version: "0.2.1835",
39
+ version: "0.2.1837",
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: "@zernio/node",
8
- version: "0.2.1835",
8
+ version: "0.2.1837",
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": "@zernio/node",
3
- "version": "0.2.1835",
3
+ "version": "0.2.1837",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -14913,6 +14913,10 @@ export const listAutomations = <ThrowOnError extends boolean = false>(options?:
14913
14913
  * - **Comment to DM**: a comment door in `trigger.type`, such as `comment.keyword`, with a `graph` of the shapes `/v1/comment-automations` holds. It is on unless `status` is `paused`, and needs what `/v1/comment-automations` needs. A post that already has an active automation is a 409.
14914
14914
  * - **Flow** (`kind` is `workflow`): a flow trigger such as `inbound_message` (or a `graph` whose trigger node names it) on one account, with the builder's `graph`. It is a draft unless `status` is `active`, which needs a complete graph; `paused` is refused. It needs the inbox add-on and a full-access key.
14915
14915
  *
14916
+ * An ad rule, event, scheduled automation or sequence can instead be sent as `name`, `status` and an automation `graph` (`AutomationGraph`, the one its response carries). The graph's trigger picks the kind, and it is saved exactly as its own shape would be.
14917
+ *
14918
+ * A comment to DM or flow sent as an automation graph is refused (`not_supported`).
14919
+ *
14916
14920
  * Everything an automation cannot hold is refused at once: the 400 lists every problem with its JSON path in `details.problems`.
14917
14921
  *
14918
14922
  */
@@ -15028,6 +15032,8 @@ export const getAutomationTestSample = <ThrowOnError extends boolean = false>(op
15028
15032
  *
15029
15033
  * Event and scheduled automations cannot be previewed yet (400, `not_supported`).
15030
15034
  *
15035
+ * The draft can instead be sent as `name` and an automation `graph` (`AutomationGraph`), previewed exactly as its own shape would be. A comment to DM or flow graph is refused (`not_supported`).
15036
+ *
15031
15037
  */
15032
15038
  export const previewAutomationDraft = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<PreviewAutomationDraftData, ThrowOnError>) => {
15033
15039
  return (options?.client ?? client).post<PreviewAutomationDraftResponse, PreviewAutomationDraftError, ThrowOnError>({
@@ -15368,6 +15374,8 @@ export const rejectAutomationApproval = <ThrowOnError extends boolean = false>(o
15368
15374
  *
15369
15375
  * Only ad automations can be backtested, on at most 5,000 ads.
15370
15376
  *
15377
+ * The draft can instead be sent as `name` and an automation `graph` (`AutomationGraph`), replayed exactly as its own shape would be. A comment to DM or flow graph is refused (`not_supported`).
15378
+ *
15371
15379
  */
15372
15380
  export const backtestAutomationDraft = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<BacktestAutomationDraftData, ThrowOnError>) => {
15373
15381
  return (options?.client ?? client).post<BacktestAutomationDraftResponse, BacktestAutomationDraftError, ThrowOnError>({
@@ -4610,12 +4610,16 @@ export type adPersonalization = 'granted' | 'denied' | 'unspecified';
4610
4610
 
4611
4611
  export type Automation = (AdRuleAutomationDefinition & AutomationRecord & {
4612
4612
  kind?: "ad_rule";
4613
+ graph?: AutomationGraph;
4613
4614
  }) | (EventAutomationDefinition & AutomationRecord & {
4614
4615
  kind?: "event";
4616
+ graph?: AutomationGraph;
4615
4617
  }) | (ScheduledAutomationDefinition & AutomationRecord & {
4616
4618
  kind?: "scheduled";
4619
+ graph?: AutomationGraph;
4617
4620
  }) | (SequenceAutomationDefinition & AutomationRecord & {
4618
4621
  kind?: "sequence";
4622
+ graph?: AutomationGraph;
4619
4623
  /**
4620
4624
  * The account's platform. On `whatsapp` every step sends a template.
4621
4625
  */
@@ -5211,6 +5215,56 @@ export type AutomationFactResult = {
5211
5215
  met?: boolean;
5212
5216
  };
5213
5217
 
5218
+ /**
5219
+ * An automation's definition as one graph: the trigger that starts it, the nodes its runs walk from `entry` along `edges`, and its guardrails. Ad rules, event and scheduled automations and sequences run their nodes in one chain, a condition first where the kind has one.
5220
+ */
5221
+ export type AutomationGraph = {
5222
+ /**
5223
+ * One trigger. Its `type` is the kind's `trigger.type`; `config` holds the rest of the trigger, and `subjects` for a schedule.
5224
+ */
5225
+ triggers: Array<{
5226
+ type: string;
5227
+ config: {
5228
+ [key: string]: unknown;
5229
+ };
5230
+ entry?: Array<(string)>;
5231
+ }>;
5232
+ nodes: Array<{
5233
+ id: string;
5234
+ /**
5235
+ * A step type such as `notify.send`, `messages.send`, `delay` or `condition`.
5236
+ */
5237
+ type: string;
5238
+ config: {
5239
+ [key: string]: unknown;
5240
+ };
5241
+ position?: {
5242
+ x: number;
5243
+ y: number;
5244
+ };
5245
+ label?: string;
5246
+ }>;
5247
+ edges: Array<{
5248
+ id: string;
5249
+ source: string;
5250
+ target: string;
5251
+ /**
5252
+ * Null when followed whatever the step's outcome; `matched` after a condition.
5253
+ */
5254
+ sourceHandle: (string) | null;
5255
+ }>;
5256
+ /**
5257
+ * The node runs start at.
5258
+ */
5259
+ entry: Array<(string)>;
5260
+ limits: {
5261
+ cooldown?: string;
5262
+ maxChangesPerDay?: number;
5263
+ maxChangesPerObject?: number;
5264
+ stopOn?: Array<('reply' | 'unsubscribe')>;
5265
+ };
5266
+ };
5267
+
5214
5268
  /**
5215
5269
  * An ad rule's limits.
5216
5270
  */
@@ -15905,6 +15959,19 @@ export type GoogleTargetImpressionShare = {
15905
15959
 
15906
15960
  export type location = 'ANYWHERE_ON_PAGE' | 'TOP_OF_PAGE' | 'ABSOLUTE_TOP_OF_PAGE';
15907
15961
 
15962
+ /**
15963
+ * An ad rule, event or scheduled automation or sequence sent as an automation graph. It is saved as its own shape would be.
15964
+ */
15965
+ export type GraphAutomationDefinition = {
15966
+ name: string;
15967
+ /**
15968
+ * Sequences.
15969
+ */
15970
+ description?: string;
15971
+ status?: 'draft' | 'active' | 'paused';
15972
+ graph: AutomationGraph;
15973
+ };
15974
+
15908
15975
  export type HubSpotContactProperty = {
15909
15976
  /**
15910
15977
  * Internal property name.
@@ -68030,7 +68097,7 @@ export type ListAutomationsResponse = ({
68030
68097
  export type ListAutomationsError = (ErrorResponse);
68031
68098
 
68032
68099
  export type CreateAutomationData = {
68033
- body: AutomationDefinition;
68100
+ body: (AutomationDefinition | GraphAutomationDefinition);
68034
68101
  headers?: {
68035
68102
  /**
68036
68103
  * Optional client-generated unique key (e.g. a UUID) that makes retries safe.
@@ -68319,7 +68386,7 @@ export type GetAutomationTestSampleError = (ErrorResponse | {
68319
68386
  });
68320
68387
 
68321
68388
  export type PreviewAutomationDraftData = {
68322
- body: AutomationDefinition;
68389
+ body: (AutomationDefinition | GraphAutomationDefinition);
68323
68390
  query?: {
68324
68391
  /**
68325
68392
  * How many subjects to list, matches first. `evaluated` and `matched` always count them all.
@@ -68372,7 +68439,7 @@ export type UpdateAutomationData = {
68372
68439
  [key: string]: unknown;
68373
68440
  }>;
68374
68441
  /**
68375
- * Comment to DM and flows: the whole graph, as read.
68442
+ * Comment to DM and flows: the whole graph, as read. Ad rules, event and scheduled automations and sequences: an `AutomationGraph` that replaces the whole definition, sent without `trigger`, `subjects`, `filter`, `conditions`, `alert`, `steps` or `limits`.
68376
68443
  */
68377
68444
  graph?: {
68378
68445
  [key: string]: unknown;
@@ -68849,7 +68916,7 @@ export type RejectAutomationApprovalError = (ErrorResponse | {
68849
68916
  });
68850
68917
 
68851
68918
  export type BacktestAutomationDraftData = {
68852
- body: AutomationDefinition;
68919
+ body: (AutomationDefinition | GraphAutomationDefinition);
68853
68920
  query?: {
68854
68921
  /**
68855
68922
  * How many whole days before today to replay. Today is not replayed.