@zernio/node 0.2.518 → 0.2.520

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.d.mts CHANGED
@@ -47,6 +47,12 @@ interface ClientOptions {
47
47
  */
48
48
  declare class Zernio {
49
49
  private _options;
50
+ /**
51
+ * HTTP client owned by this instance. Every namespace method below is bound
52
+ * to it, so two Zernio instances in the same process never see each other's
53
+ * credentials.
54
+ */
55
+ private _client;
50
56
  /**
51
57
  * API key used for authentication.
52
58
  */
@@ -55,6 +61,13 @@ declare class Zernio {
55
61
  * Base URL for API requests.
56
62
  */
57
63
  baseURL: string;
64
+ /**
65
+ * Routes a generated operation through this instance's client, preserving the
66
+ * operation's own signature. Reads `_client` when the method is called, not
67
+ * when it is bound, because class fields initialize before the constructor
68
+ * body runs.
69
+ */
70
+ private _bind;
58
71
  /**
59
72
  * validate API
60
73
  */
@@ -2785,6 +2798,15 @@ type ConversionEvent = {
2785
2798
  * Meta advanced matching (ge). 'f' or 'm'; hashed server-side. Meta only.
2786
2799
  */
2787
2800
  gender?: string;
2801
+ /**
2802
+ * Meta lead ID from a Lead Ad submission, as a string. Required
2803
+ * for Conversion Leads CRM events: send it with
2804
+ * `actionSource: 'crm'` and
2805
+ * `platformData: { event_source: 'crm', lead_event_source: '<CRM name>' }`.
2806
+ * Forwarded unhashed to Meta's `user_data.lead_id`. Meta only.
2807
+ *
2808
+ */
2809
+ leadId?: string;
2788
2810
  /**
2789
2811
  * Platform click identifiers captured from the originating ad click.
2790
2812
  */
@@ -2840,7 +2862,13 @@ type ConversionEvent = {
2840
2862
  */
2841
2863
  actionSource?: 'web' | 'app' | 'offline' | 'crm' | 'phone_call' | 'system_generated';
2842
2864
  /**
2843
- * Escape hatch for platform-specific fields we haven't normalized. Forwarded as-is.
2865
+ * Escape hatch for platform-specific fields we haven't normalized.
2866
+ * On Meta, keys are shallow-merged into `custom_data` only: fields
2867
+ * Zernio already builds (`value`, `currency`, `contents`,
2868
+ * `num_items`) always win on collision, and `user_data` (hashed
2869
+ * match keys) is never touched. Use first-class fields (e.g.
2870
+ * `user.leadId`) for anything that must reach `user_data`.
2871
+ *
2844
2872
  */
2845
2873
  platformData?: {
2846
2874
  [key: string]: unknown;
@@ -25132,6 +25160,14 @@ type ListCommentAutomationsResponse = ({
25132
25160
  * Tag applied to a contact when they click a tracked link.
25133
25161
  */
25134
25162
  clickTag?: string;
25163
+ /**
25164
+ * Seconds waited after the trigger before the DM is sent. Absent when the DM goes out immediately.
25165
+ */
25166
+ dmDelaySeconds?: number;
25167
+ /**
25168
+ * Seconds waited before the public reply is posted. Absent when it follows the DM immediately.
25169
+ */
25170
+ commentReplyDelaySeconds?: number;
25135
25171
  isActive?: boolean;
25136
25172
  stats?: {
25137
25173
  triggered?: number;
@@ -25236,6 +25272,14 @@ type CreateCommentAutomationData = {
25236
25272
  * Optional tag applied to a contact when they click a tracked link (requires linkTracking). Lets you segment clickers for broadcasts/sequences.
25237
25273
  */
25238
25274
  clickTag?: string;
25275
+ /**
25276
+ * Seconds to wait after the trigger before sending the DM. Omit or send 0 to reply immediately (the default). Max 86400 (24h). The trigger is still matched and deduplicated the moment the comment arrives, so a delay only moves when the response is sent.
25277
+ */
25278
+ dmDelaySeconds?: number;
25279
+ /**
25280
+ * Seconds to wait before posting the public comment reply. Omit or send 0 to post it right after the DM (the default). The reply never goes out before the DM, so a value below dmDelaySeconds is raised to it. Ignored when trigger=story_reply, which has no public reply.
25281
+ */
25282
+ commentReplyDelaySeconds?: number;
25239
25283
  audience?: CommentAutomationAudience;
25240
25284
  followGate?: CommentAutomationFollowGate;
25241
25285
  };
@@ -25277,6 +25321,14 @@ type CreateCommentAutomationResponse = ({
25277
25321
  commentReplyVariations?: Array<(string)>;
25278
25322
  linkTracking?: boolean;
25279
25323
  clickTag?: string;
25324
+ /**
25325
+ * Seconds waited after the trigger before the DM is sent. Absent when the DM goes out immediately.
25326
+ */
25327
+ dmDelaySeconds?: number;
25328
+ /**
25329
+ * Seconds waited before the public reply is posted. Absent when it follows the DM immediately.
25330
+ */
25331
+ commentReplyDelaySeconds?: number;
25280
25332
  audience?: CommentAutomationAudience;
25281
25333
  followGate?: CommentAutomationFollowGate;
25282
25334
  isActive?: boolean;
@@ -25336,6 +25388,14 @@ type GetCommentAutomationResponse = ({
25336
25388
  commentReplyVariations?: Array<(string)>;
25337
25389
  linkTracking?: boolean;
25338
25390
  clickTag?: string;
25391
+ /**
25392
+ * Seconds waited after the trigger before the DM is sent. Absent when the DM goes out immediately.
25393
+ */
25394
+ dmDelaySeconds?: number;
25395
+ /**
25396
+ * Seconds waited before the public reply is posted. Absent when it follows the DM immediately.
25397
+ */
25398
+ commentReplyDelaySeconds?: number;
25339
25399
  audience?: CommentAutomationAudience;
25340
25400
  followGate?: CommentAutomationFollowGate;
25341
25401
  isActive?: boolean;
@@ -25354,9 +25414,9 @@ type GetCommentAutomationResponse = ({
25354
25414
  commenterName?: string;
25355
25415
  commentText?: string;
25356
25416
  /**
25357
- * DM outcome. 'gated' = the follow-gate confirmation DM went out and we are waiting for the tap; it flips to 'sent' or 'skipped' when they tap.
25417
+ * DM outcome. 'pending' = the automation has a dmDelaySeconds and the response is queued but not sent yet. 'gated' = the follow-gate confirmation DM went out and we are waiting for the tap; it flips to 'sent' or 'skipped' when they tap.
25358
25418
  */
25359
- status?: 'sent' | 'failed' | 'skipped' | 'gated';
25419
+ status?: 'pending' | 'sent' | 'failed' | 'skipped' | 'gated';
25360
25420
  /**
25361
25421
  * How the audience rule resolved. Absent on automations without one.
25362
25422
  */
@@ -25378,6 +25438,10 @@ type GetCommentAutomationResponse = ({
25378
25438
  * Public-reply error message if commentReplyStatus is failed
25379
25439
  */
25380
25440
  commentReplyError?: string;
25441
+ /**
25442
+ * When the next queued send fires. Present only while something is still pending.
25443
+ */
25444
+ nextDueAt?: string;
25381
25445
  createdAt?: string;
25382
25446
  }>;
25383
25447
  });
@@ -25426,6 +25490,14 @@ type UpdateCommentAutomationData = {
25426
25490
  * Tag applied to a contact when they click a tracked link (requires linkTracking). Empty string clears it.
25427
25491
  */
25428
25492
  clickTag?: string;
25493
+ /**
25494
+ * Seconds to wait after the trigger before sending the DM. Send 0 to clear the delay and reply immediately.
25495
+ */
25496
+ dmDelaySeconds?: number;
25497
+ /**
25498
+ * Seconds to wait before posting the public comment reply. Send 0 to clear it. The reply never goes out before the DM.
25499
+ */
25500
+ commentReplyDelaySeconds?: number;
25429
25501
  audience?: CommentAutomationAudience;
25430
25502
  followGate?: CommentAutomationFollowGate;
25431
25503
  isActive?: boolean;
@@ -25494,7 +25566,7 @@ type ListCommentAutomationLogsData = {
25494
25566
  /**
25495
25567
  * Filter by result status
25496
25568
  */
25497
- status?: 'sent' | 'failed' | 'skipped' | 'gated';
25569
+ status?: 'pending' | 'sent' | 'failed' | 'skipped' | 'gated';
25498
25570
  };
25499
25571
  };
25500
25572
  type ListCommentAutomationLogsResponse = ({
@@ -25506,9 +25578,9 @@ type ListCommentAutomationLogsResponse = ({
25506
25578
  commenterName?: string;
25507
25579
  commentText?: string;
25508
25580
  /**
25509
- * DM outcome. 'gated' = the follow-gate confirmation DM went out and we are waiting for the tap; it flips to 'sent' or 'skipped' when they tap.
25581
+ * DM outcome. 'pending' = the automation has a dmDelaySeconds and the response is queued but not sent yet. 'gated' = the follow-gate confirmation DM went out and we are waiting for the tap; it flips to 'sent' or 'skipped' when they tap.
25510
25582
  */
25511
- status?: 'sent' | 'failed' | 'skipped' | 'gated';
25583
+ status?: 'pending' | 'sent' | 'failed' | 'skipped' | 'gated';
25512
25584
  /**
25513
25585
  * How the audience rule resolved. Absent on automations without one.
25514
25586
  */
@@ -25530,6 +25602,10 @@ type ListCommentAutomationLogsResponse = ({
25530
25602
  * Public-reply error message if commentReplyStatus is failed
25531
25603
  */
25532
25604
  commentReplyError?: string;
25605
+ /**
25606
+ * When the next queued send fires. Present only while something is still pending.
25607
+ */
25608
+ nextDueAt?: string;
25533
25609
  createdAt?: string;
25534
25610
  }>;
25535
25611
  pagination?: {
package/dist/index.d.ts CHANGED
@@ -47,6 +47,12 @@ interface ClientOptions {
47
47
  */
48
48
  declare class Zernio {
49
49
  private _options;
50
+ /**
51
+ * HTTP client owned by this instance. Every namespace method below is bound
52
+ * to it, so two Zernio instances in the same process never see each other's
53
+ * credentials.
54
+ */
55
+ private _client;
50
56
  /**
51
57
  * API key used for authentication.
52
58
  */
@@ -55,6 +61,13 @@ declare class Zernio {
55
61
  * Base URL for API requests.
56
62
  */
57
63
  baseURL: string;
64
+ /**
65
+ * Routes a generated operation through this instance's client, preserving the
66
+ * operation's own signature. Reads `_client` when the method is called, not
67
+ * when it is bound, because class fields initialize before the constructor
68
+ * body runs.
69
+ */
70
+ private _bind;
58
71
  /**
59
72
  * validate API
60
73
  */
@@ -2785,6 +2798,15 @@ type ConversionEvent = {
2785
2798
  * Meta advanced matching (ge). 'f' or 'm'; hashed server-side. Meta only.
2786
2799
  */
2787
2800
  gender?: string;
2801
+ /**
2802
+ * Meta lead ID from a Lead Ad submission, as a string. Required
2803
+ * for Conversion Leads CRM events: send it with
2804
+ * `actionSource: 'crm'` and
2805
+ * `platformData: { event_source: 'crm', lead_event_source: '<CRM name>' }`.
2806
+ * Forwarded unhashed to Meta's `user_data.lead_id`. Meta only.
2807
+ *
2808
+ */
2809
+ leadId?: string;
2788
2810
  /**
2789
2811
  * Platform click identifiers captured from the originating ad click.
2790
2812
  */
@@ -2840,7 +2862,13 @@ type ConversionEvent = {
2840
2862
  */
2841
2863
  actionSource?: 'web' | 'app' | 'offline' | 'crm' | 'phone_call' | 'system_generated';
2842
2864
  /**
2843
- * Escape hatch for platform-specific fields we haven't normalized. Forwarded as-is.
2865
+ * Escape hatch for platform-specific fields we haven't normalized.
2866
+ * On Meta, keys are shallow-merged into `custom_data` only: fields
2867
+ * Zernio already builds (`value`, `currency`, `contents`,
2868
+ * `num_items`) always win on collision, and `user_data` (hashed
2869
+ * match keys) is never touched. Use first-class fields (e.g.
2870
+ * `user.leadId`) for anything that must reach `user_data`.
2871
+ *
2844
2872
  */
2845
2873
  platformData?: {
2846
2874
  [key: string]: unknown;
@@ -25132,6 +25160,14 @@ type ListCommentAutomationsResponse = ({
25132
25160
  * Tag applied to a contact when they click a tracked link.
25133
25161
  */
25134
25162
  clickTag?: string;
25163
+ /**
25164
+ * Seconds waited after the trigger before the DM is sent. Absent when the DM goes out immediately.
25165
+ */
25166
+ dmDelaySeconds?: number;
25167
+ /**
25168
+ * Seconds waited before the public reply is posted. Absent when it follows the DM immediately.
25169
+ */
25170
+ commentReplyDelaySeconds?: number;
25135
25171
  isActive?: boolean;
25136
25172
  stats?: {
25137
25173
  triggered?: number;
@@ -25236,6 +25272,14 @@ type CreateCommentAutomationData = {
25236
25272
  * Optional tag applied to a contact when they click a tracked link (requires linkTracking). Lets you segment clickers for broadcasts/sequences.
25237
25273
  */
25238
25274
  clickTag?: string;
25275
+ /**
25276
+ * Seconds to wait after the trigger before sending the DM. Omit or send 0 to reply immediately (the default). Max 86400 (24h). The trigger is still matched and deduplicated the moment the comment arrives, so a delay only moves when the response is sent.
25277
+ */
25278
+ dmDelaySeconds?: number;
25279
+ /**
25280
+ * Seconds to wait before posting the public comment reply. Omit or send 0 to post it right after the DM (the default). The reply never goes out before the DM, so a value below dmDelaySeconds is raised to it. Ignored when trigger=story_reply, which has no public reply.
25281
+ */
25282
+ commentReplyDelaySeconds?: number;
25239
25283
  audience?: CommentAutomationAudience;
25240
25284
  followGate?: CommentAutomationFollowGate;
25241
25285
  };
@@ -25277,6 +25321,14 @@ type CreateCommentAutomationResponse = ({
25277
25321
  commentReplyVariations?: Array<(string)>;
25278
25322
  linkTracking?: boolean;
25279
25323
  clickTag?: string;
25324
+ /**
25325
+ * Seconds waited after the trigger before the DM is sent. Absent when the DM goes out immediately.
25326
+ */
25327
+ dmDelaySeconds?: number;
25328
+ /**
25329
+ * Seconds waited before the public reply is posted. Absent when it follows the DM immediately.
25330
+ */
25331
+ commentReplyDelaySeconds?: number;
25280
25332
  audience?: CommentAutomationAudience;
25281
25333
  followGate?: CommentAutomationFollowGate;
25282
25334
  isActive?: boolean;
@@ -25336,6 +25388,14 @@ type GetCommentAutomationResponse = ({
25336
25388
  commentReplyVariations?: Array<(string)>;
25337
25389
  linkTracking?: boolean;
25338
25390
  clickTag?: string;
25391
+ /**
25392
+ * Seconds waited after the trigger before the DM is sent. Absent when the DM goes out immediately.
25393
+ */
25394
+ dmDelaySeconds?: number;
25395
+ /**
25396
+ * Seconds waited before the public reply is posted. Absent when it follows the DM immediately.
25397
+ */
25398
+ commentReplyDelaySeconds?: number;
25339
25399
  audience?: CommentAutomationAudience;
25340
25400
  followGate?: CommentAutomationFollowGate;
25341
25401
  isActive?: boolean;
@@ -25354,9 +25414,9 @@ type GetCommentAutomationResponse = ({
25354
25414
  commenterName?: string;
25355
25415
  commentText?: string;
25356
25416
  /**
25357
- * DM outcome. 'gated' = the follow-gate confirmation DM went out and we are waiting for the tap; it flips to 'sent' or 'skipped' when they tap.
25417
+ * DM outcome. 'pending' = the automation has a dmDelaySeconds and the response is queued but not sent yet. 'gated' = the follow-gate confirmation DM went out and we are waiting for the tap; it flips to 'sent' or 'skipped' when they tap.
25358
25418
  */
25359
- status?: 'sent' | 'failed' | 'skipped' | 'gated';
25419
+ status?: 'pending' | 'sent' | 'failed' | 'skipped' | 'gated';
25360
25420
  /**
25361
25421
  * How the audience rule resolved. Absent on automations without one.
25362
25422
  */
@@ -25378,6 +25438,10 @@ type GetCommentAutomationResponse = ({
25378
25438
  * Public-reply error message if commentReplyStatus is failed
25379
25439
  */
25380
25440
  commentReplyError?: string;
25441
+ /**
25442
+ * When the next queued send fires. Present only while something is still pending.
25443
+ */
25444
+ nextDueAt?: string;
25381
25445
  createdAt?: string;
25382
25446
  }>;
25383
25447
  });
@@ -25426,6 +25490,14 @@ type UpdateCommentAutomationData = {
25426
25490
  * Tag applied to a contact when they click a tracked link (requires linkTracking). Empty string clears it.
25427
25491
  */
25428
25492
  clickTag?: string;
25493
+ /**
25494
+ * Seconds to wait after the trigger before sending the DM. Send 0 to clear the delay and reply immediately.
25495
+ */
25496
+ dmDelaySeconds?: number;
25497
+ /**
25498
+ * Seconds to wait before posting the public comment reply. Send 0 to clear it. The reply never goes out before the DM.
25499
+ */
25500
+ commentReplyDelaySeconds?: number;
25429
25501
  audience?: CommentAutomationAudience;
25430
25502
  followGate?: CommentAutomationFollowGate;
25431
25503
  isActive?: boolean;
@@ -25494,7 +25566,7 @@ type ListCommentAutomationLogsData = {
25494
25566
  /**
25495
25567
  * Filter by result status
25496
25568
  */
25497
- status?: 'sent' | 'failed' | 'skipped' | 'gated';
25569
+ status?: 'pending' | 'sent' | 'failed' | 'skipped' | 'gated';
25498
25570
  };
25499
25571
  };
25500
25572
  type ListCommentAutomationLogsResponse = ({
@@ -25506,9 +25578,9 @@ type ListCommentAutomationLogsResponse = ({
25506
25578
  commenterName?: string;
25507
25579
  commentText?: string;
25508
25580
  /**
25509
- * DM outcome. 'gated' = the follow-gate confirmation DM went out and we are waiting for the tap; it flips to 'sent' or 'skipped' when they tap.
25581
+ * DM outcome. 'pending' = the automation has a dmDelaySeconds and the response is queued but not sent yet. 'gated' = the follow-gate confirmation DM went out and we are waiting for the tap; it flips to 'sent' or 'skipped' when they tap.
25510
25582
  */
25511
- status?: 'sent' | 'failed' | 'skipped' | 'gated';
25583
+ status?: 'pending' | 'sent' | 'failed' | 'skipped' | 'gated';
25512
25584
  /**
25513
25585
  * How the audience rule resolved. Absent on automations without one.
25514
25586
  */
@@ -25530,6 +25602,10 @@ type ListCommentAutomationLogsResponse = ({
25530
25602
  * Public-reply error message if commentReplyStatus is failed
25531
25603
  */
25532
25604
  commentReplyError?: string;
25605
+ /**
25606
+ * When the next queued send fires. Present only while something is still pending.
25607
+ */
25608
+ nextDueAt?: string;
25533
25609
  createdAt?: string;
25534
25610
  }>;
25535
25611
  pagination?: {