@drawbridge/drawbridge-utils 0.0.124 → 0.0.125

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.
@@ -893,9 +893,13 @@ var attentive_default2 = {
893
893
  }
894
894
  },
895
895
  // WHY, in the merchant's words, and what to do about it.
896
+ // ONLY FOR A LIVE GRANT. A disconnected or errored connection's next step
897
+ // is reconnecting — prompting "choose a segment" there asks the merchant to
898
+ // configure a grant that no longer exists. `pending` is exactly this task's
899
+ // moment: the grant is good and the segment is the missing half.
896
900
  tasks: (data2) => {
897
901
  var _a;
898
- return ((_a = data2 == null ? void 0 : data2.settings) == null ? void 0 : _a.segment) ? [] : [
902
+ return !["active", "pending"].includes(data2 == null ? void 0 : data2.status) || ((_a = data2 == null ? void 0 : data2.settings) == null ? void 0 : _a.segment) ? [] : [
899
903
  {
900
904
  message: "Choose which Attentive segment your contacts should sync into. Until you do, nothing is being synced.",
901
905
  title: "Choose a segment"
@@ -2752,9 +2756,13 @@ var klaviyo_default2 = {
2752
2756
  }
2753
2757
  },
2754
2758
  // WHY, in the merchant's words, and what to do about it.
2759
+ // ONLY FOR A LIVE GRANT. A disconnected or errored connection's next step
2760
+ // is reconnecting — prompting "choose a list" there asks the merchant to
2761
+ // configure a grant that no longer exists. `pending` is exactly this task's
2762
+ // moment: the grant is good and the list is the missing half.
2755
2763
  tasks: (data2) => {
2756
2764
  var _a;
2757
- return ((_a = data2 == null ? void 0 : data2.settings) == null ? void 0 : _a.list) ? [] : [
2765
+ return !["active", "pending"].includes(data2 == null ? void 0 : data2.status) || ((_a = data2 == null ? void 0 : data2.settings) == null ? void 0 : _a.list) ? [] : [
2758
2766
  {
2759
2767
  message: "Choose which Klaviyo list your contacts should sync into. Until you do, nothing is being synced.",
2760
2768
  title: "Choose a list"
@@ -2839,7 +2847,7 @@ var mailchimp_default2 = {
2839
2847
  content: {
2840
2848
  confirm: "Disconnecting removes Drawbridge's stored Mailchimp access. You can also remove Drawbridge from the Authorized Apps page in your Mailchimp account. Your contacts stay in both Drawbridge and Mailchimp \u2014 neither list is deleted.",
2841
2849
  description: [
2842
- "Drawbridge no longer sends email through Mailchimp. Notification email now sends from Drawbridge itself, and verifying a domain under Networking in your organization settings puts your own brand in the from line.",
2850
+ "Drawbridge no longer sends email through Mailchimp. Notification email now sends from Drawbridge itself, and verifying a domain under Messaging in your organization settings puts your own brand in the from line.",
2843
2851
  "Connecting Mailchimp lets Drawbridge sync the contacts your campaigns collect into a Mailchimp audience, so the people who enter a giveaway can be marketed to alongside the rest of your list.",
2844
2852
  "Anyone who has opted out in Drawbridge is synced as unsubscribed rather than omitted, so a person who asked not to be contacted stays suppressed in both systems instead of quietly reappearing.",
2845
2853
  "Someone who unsubscribed inside Mailchimp keeps that choice: a resync only sets the status of a subscriber Mailchimp has never seen before."
@@ -3067,9 +3075,13 @@ var mailchimp_default2 = {
3067
3075
  }
3068
3076
  },
3069
3077
  // WHY, in the merchant's words, and what to do about it.
3078
+ // ONLY FOR A LIVE GRANT. A disconnected or errored connection's next step
3079
+ // is reconnecting — prompting "choose a audience" there asks the merchant to
3080
+ // configure a grant that no longer exists. `pending` is exactly this task's
3081
+ // moment: the grant is good and the audience is the missing half.
3070
3082
  tasks: (data2) => {
3071
3083
  var _a;
3072
- return ((_a = data2 == null ? void 0 : data2.settings) == null ? void 0 : _a.audience) ? [] : [
3084
+ return !["active", "pending"].includes(data2 == null ? void 0 : data2.status) || ((_a = data2 == null ? void 0 : data2.settings) == null ? void 0 : _a.audience) ? [] : [
3073
3085
  {
3074
3086
  message: "Choose which Mailchimp audience your contacts should sync into. Until you do, nothing is being synced.",
3075
3087
  title: "Choose an audience"
@@ -4407,7 +4419,10 @@ var webhook_default = {
4407
4419
  // pressing Connect will do; afterwards it states the verification the
4408
4420
  // merchant's own endpoint has to perform, because a signed payload nobody
4409
4421
  // checks is an unsigned payload.
4410
- tasks: ({ settings }) => (settings == null ? void 0 : settings.secret) ? [
4422
+ // The connect prompt only where connecting is not already the card's whole
4423
+ // story: a disconnected or errored document renders a Connect action itself,
4424
+ // and a task repeating it talks over the button.
4425
+ tasks: ({ settings, status } = {}) => ["disconnected", "error"].includes(status) ? [] : (settings == null ? void 0 : settings.secret) ? [
4411
4426
  {
4412
4427
  message: "Compute HMAC-SHA256( secret, body ) and compare against the X-Drawbridge-Signature header to confirm each payload.",
4413
4428
  title: "Requests must be verified",
@@ -1233,7 +1233,11 @@ var attentive = {
1233
1233
 
1234
1234
  },
1235
1235
  // WHY, in the merchant's words, and what to do about it.
1236
- tasks : ( data ) => ( data?.settings?.segment
1236
+ // ONLY FOR A LIVE GRANT. A disconnected or errored connection's next step
1237
+ // is reconnecting — prompting "choose a segment" there asks the merchant to
1238
+ // configure a grant that no longer exists. `pending` is exactly this task's
1239
+ // moment: the grant is good and the segment is the missing half.
1240
+ tasks : ( data ) => ( ! [ 'active', 'pending' ].includes( data?.status ) || data?.settings?.segment
1237
1241
  ? []
1238
1242
  : [
1239
1243
  {
@@ -2959,7 +2963,11 @@ var klaviyo = {
2959
2963
 
2960
2964
  },
2961
2965
  // WHY, in the merchant's words, and what to do about it.
2962
- tasks : ( data ) => ( data?.settings?.list
2966
+ // ONLY FOR A LIVE GRANT. A disconnected or errored connection's next step
2967
+ // is reconnecting — prompting "choose a list" there asks the merchant to
2968
+ // configure a grant that no longer exists. `pending` is exactly this task's
2969
+ // moment: the grant is good and the list is the missing half.
2970
+ tasks : ( data ) => ( ! [ 'active', 'pending' ].includes( data?.status ) || data?.settings?.list
2963
2971
  ? []
2964
2972
  : [
2965
2973
  {
@@ -3089,7 +3097,7 @@ var mailchimp = {
3089
3097
  content : {
3090
3098
  confirm : 'Disconnecting removes Drawbridge\'s stored Mailchimp access. You can also remove Drawbridge from the Authorized Apps page in your Mailchimp account. Your contacts stay in both Drawbridge and Mailchimp — neither list is deleted.',
3091
3099
  description : [
3092
- 'Drawbridge no longer sends email through Mailchimp. Notification email now sends from Drawbridge itself, and verifying a domain under Networking in your organization settings puts your own brand in the from line.',
3100
+ 'Drawbridge no longer sends email through Mailchimp. Notification email now sends from Drawbridge itself, and verifying a domain under Messaging in your organization settings puts your own brand in the from line.',
3093
3101
  'Connecting Mailchimp lets Drawbridge sync the contacts your campaigns collect into a Mailchimp audience, so the people who enter a giveaway can be marketed to alongside the rest of your list.',
3094
3102
  'Anyone who has opted out in Drawbridge is synced as unsubscribed rather than omitted, so a person who asked not to be contacted stays suppressed in both systems instead of quietly reappearing.',
3095
3103
  'Someone who unsubscribed inside Mailchimp keeps that choice: a resync only sets the status of a subscriber Mailchimp has never seen before.'
@@ -3392,7 +3400,11 @@ var mailchimp = {
3392
3400
 
3393
3401
  },
3394
3402
  // WHY, in the merchant's words, and what to do about it.
3395
- tasks : ( data ) => ( data?.settings?.audience
3403
+ // ONLY FOR A LIVE GRANT. A disconnected or errored connection's next step
3404
+ // is reconnecting — prompting "choose a audience" there asks the merchant to
3405
+ // configure a grant that no longer exists. `pending` is exactly this task's
3406
+ // moment: the grant is good and the audience is the missing half.
3407
+ tasks : ( data ) => ( ! [ 'active', 'pending' ].includes( data?.status ) || data?.settings?.audience
3396
3408
  ? []
3397
3409
  : [
3398
3410
  {
@@ -5003,7 +5015,12 @@ var webhook = {
5003
5015
  // pressing Connect will do; afterwards it states the verification the
5004
5016
  // merchant's own endpoint has to perform, because a signed payload nobody
5005
5017
  // checks is an unsigned payload.
5006
- tasks : ( { settings } ) => ( settings?.secret
5018
+ // The connect prompt only where connecting is not already the card's whole
5019
+ // story: a disconnected or errored document renders a Connect action itself,
5020
+ // and a task repeating it talks over the button.
5021
+ tasks : ( { settings, status } = {} ) => ( [ 'disconnected', 'error' ].includes( status )
5022
+ ? []
5023
+ : settings?.secret
5007
5024
  ? [
5008
5025
  {
5009
5026
  message : 'Compute HMAC-SHA256( secret, body ) and compare against the X-Drawbridge-Signature header to confirm each payload.',
@@ -5017,7 +5034,7 @@ var webhook = {
5017
5034
  title : 'Webhook signing'
5018
5035
  }
5019
5036
  ]
5020
- ),
5037
+ ),
5021
5038
  title : 'Webhooks'
5022
5039
  };
5023
5040
 
@@ -1233,7 +1233,11 @@ var attentive = {
1233
1233
 
1234
1234
  },
1235
1235
  // WHY, in the merchant's words, and what to do about it.
1236
- tasks : ( data ) => ( data?.settings?.segment
1236
+ // ONLY FOR A LIVE GRANT. A disconnected or errored connection's next step
1237
+ // is reconnecting — prompting "choose a segment" there asks the merchant to
1238
+ // configure a grant that no longer exists. `pending` is exactly this task's
1239
+ // moment: the grant is good and the segment is the missing half.
1240
+ tasks : ( data ) => ( ! [ 'active', 'pending' ].includes( data?.status ) || data?.settings?.segment
1237
1241
  ? []
1238
1242
  : [
1239
1243
  {
@@ -2959,7 +2963,11 @@ var klaviyo = {
2959
2963
 
2960
2964
  },
2961
2965
  // WHY, in the merchant's words, and what to do about it.
2962
- tasks : ( data ) => ( data?.settings?.list
2966
+ // ONLY FOR A LIVE GRANT. A disconnected or errored connection's next step
2967
+ // is reconnecting — prompting "choose a list" there asks the merchant to
2968
+ // configure a grant that no longer exists. `pending` is exactly this task's
2969
+ // moment: the grant is good and the list is the missing half.
2970
+ tasks : ( data ) => ( ! [ 'active', 'pending' ].includes( data?.status ) || data?.settings?.list
2963
2971
  ? []
2964
2972
  : [
2965
2973
  {
@@ -3089,7 +3097,7 @@ var mailchimp = {
3089
3097
  content : {
3090
3098
  confirm : 'Disconnecting removes Drawbridge\'s stored Mailchimp access. You can also remove Drawbridge from the Authorized Apps page in your Mailchimp account. Your contacts stay in both Drawbridge and Mailchimp — neither list is deleted.',
3091
3099
  description : [
3092
- 'Drawbridge no longer sends email through Mailchimp. Notification email now sends from Drawbridge itself, and verifying a domain under Networking in your organization settings puts your own brand in the from line.',
3100
+ 'Drawbridge no longer sends email through Mailchimp. Notification email now sends from Drawbridge itself, and verifying a domain under Messaging in your organization settings puts your own brand in the from line.',
3093
3101
  'Connecting Mailchimp lets Drawbridge sync the contacts your campaigns collect into a Mailchimp audience, so the people who enter a giveaway can be marketed to alongside the rest of your list.',
3094
3102
  'Anyone who has opted out in Drawbridge is synced as unsubscribed rather than omitted, so a person who asked not to be contacted stays suppressed in both systems instead of quietly reappearing.',
3095
3103
  'Someone who unsubscribed inside Mailchimp keeps that choice: a resync only sets the status of a subscriber Mailchimp has never seen before.'
@@ -3392,7 +3400,11 @@ var mailchimp = {
3392
3400
 
3393
3401
  },
3394
3402
  // WHY, in the merchant's words, and what to do about it.
3395
- tasks : ( data ) => ( data?.settings?.audience
3403
+ // ONLY FOR A LIVE GRANT. A disconnected or errored connection's next step
3404
+ // is reconnecting — prompting "choose a audience" there asks the merchant to
3405
+ // configure a grant that no longer exists. `pending` is exactly this task's
3406
+ // moment: the grant is good and the audience is the missing half.
3407
+ tasks : ( data ) => ( ! [ 'active', 'pending' ].includes( data?.status ) || data?.settings?.audience
3396
3408
  ? []
3397
3409
  : [
3398
3410
  {
@@ -5003,7 +5015,12 @@ var webhook = {
5003
5015
  // pressing Connect will do; afterwards it states the verification the
5004
5016
  // merchant's own endpoint has to perform, because a signed payload nobody
5005
5017
  // checks is an unsigned payload.
5006
- tasks : ( { settings } ) => ( settings?.secret
5018
+ // The connect prompt only where connecting is not already the card's whole
5019
+ // story: a disconnected or errored document renders a Connect action itself,
5020
+ // and a task repeating it talks over the button.
5021
+ tasks : ( { settings, status } = {} ) => ( [ 'disconnected', 'error' ].includes( status )
5022
+ ? []
5023
+ : settings?.secret
5007
5024
  ? [
5008
5025
  {
5009
5026
  message : 'Compute HMAC-SHA256( secret, body ) and compare against the X-Drawbridge-Signature header to confirm each payload.',
@@ -5017,7 +5034,7 @@ var webhook = {
5017
5034
  title : 'Webhook signing'
5018
5035
  }
5019
5036
  ]
5020
- ),
5037
+ ),
5021
5038
  title : 'Webhooks'
5022
5039
  };
5023
5040
 
@@ -819,9 +819,13 @@ var attentive_default2 = {
819
819
  }
820
820
  },
821
821
  // WHY, in the merchant's words, and what to do about it.
822
+ // ONLY FOR A LIVE GRANT. A disconnected or errored connection's next step
823
+ // is reconnecting — prompting "choose a segment" there asks the merchant to
824
+ // configure a grant that no longer exists. `pending` is exactly this task's
825
+ // moment: the grant is good and the segment is the missing half.
822
826
  tasks: (data2) => {
823
827
  var _a;
824
- return ((_a = data2 == null ? void 0 : data2.settings) == null ? void 0 : _a.segment) ? [] : [
828
+ return !["active", "pending"].includes(data2 == null ? void 0 : data2.status) || ((_a = data2 == null ? void 0 : data2.settings) == null ? void 0 : _a.segment) ? [] : [
825
829
  {
826
830
  message: "Choose which Attentive segment your contacts should sync into. Until you do, nothing is being synced.",
827
831
  title: "Choose a segment"
@@ -2678,9 +2682,13 @@ var klaviyo_default2 = {
2678
2682
  }
2679
2683
  },
2680
2684
  // WHY, in the merchant's words, and what to do about it.
2685
+ // ONLY FOR A LIVE GRANT. A disconnected or errored connection's next step
2686
+ // is reconnecting — prompting "choose a list" there asks the merchant to
2687
+ // configure a grant that no longer exists. `pending` is exactly this task's
2688
+ // moment: the grant is good and the list is the missing half.
2681
2689
  tasks: (data2) => {
2682
2690
  var _a;
2683
- return ((_a = data2 == null ? void 0 : data2.settings) == null ? void 0 : _a.list) ? [] : [
2691
+ return !["active", "pending"].includes(data2 == null ? void 0 : data2.status) || ((_a = data2 == null ? void 0 : data2.settings) == null ? void 0 : _a.list) ? [] : [
2684
2692
  {
2685
2693
  message: "Choose which Klaviyo list your contacts should sync into. Until you do, nothing is being synced.",
2686
2694
  title: "Choose a list"
@@ -2765,7 +2773,7 @@ var mailchimp_default2 = {
2765
2773
  content: {
2766
2774
  confirm: "Disconnecting removes Drawbridge's stored Mailchimp access. You can also remove Drawbridge from the Authorized Apps page in your Mailchimp account. Your contacts stay in both Drawbridge and Mailchimp \u2014 neither list is deleted.",
2767
2775
  description: [
2768
- "Drawbridge no longer sends email through Mailchimp. Notification email now sends from Drawbridge itself, and verifying a domain under Networking in your organization settings puts your own brand in the from line.",
2776
+ "Drawbridge no longer sends email through Mailchimp. Notification email now sends from Drawbridge itself, and verifying a domain under Messaging in your organization settings puts your own brand in the from line.",
2769
2777
  "Connecting Mailchimp lets Drawbridge sync the contacts your campaigns collect into a Mailchimp audience, so the people who enter a giveaway can be marketed to alongside the rest of your list.",
2770
2778
  "Anyone who has opted out in Drawbridge is synced as unsubscribed rather than omitted, so a person who asked not to be contacted stays suppressed in both systems instead of quietly reappearing.",
2771
2779
  "Someone who unsubscribed inside Mailchimp keeps that choice: a resync only sets the status of a subscriber Mailchimp has never seen before."
@@ -2993,9 +3001,13 @@ var mailchimp_default2 = {
2993
3001
  }
2994
3002
  },
2995
3003
  // WHY, in the merchant's words, and what to do about it.
3004
+ // ONLY FOR A LIVE GRANT. A disconnected or errored connection's next step
3005
+ // is reconnecting — prompting "choose a audience" there asks the merchant to
3006
+ // configure a grant that no longer exists. `pending` is exactly this task's
3007
+ // moment: the grant is good and the audience is the missing half.
2996
3008
  tasks: (data2) => {
2997
3009
  var _a;
2998
- return ((_a = data2 == null ? void 0 : data2.settings) == null ? void 0 : _a.audience) ? [] : [
3010
+ return !["active", "pending"].includes(data2 == null ? void 0 : data2.status) || ((_a = data2 == null ? void 0 : data2.settings) == null ? void 0 : _a.audience) ? [] : [
2999
3011
  {
3000
3012
  message: "Choose which Mailchimp audience your contacts should sync into. Until you do, nothing is being synced.",
3001
3013
  title: "Choose an audience"
@@ -4333,7 +4345,10 @@ var webhook_default = {
4333
4345
  // pressing Connect will do; afterwards it states the verification the
4334
4346
  // merchant's own endpoint has to perform, because a signed payload nobody
4335
4347
  // checks is an unsigned payload.
4336
- tasks: ({ settings }) => (settings == null ? void 0 : settings.secret) ? [
4348
+ // The connect prompt only where connecting is not already the card's whole
4349
+ // story: a disconnected or errored document renders a Connect action itself,
4350
+ // and a task repeating it talks over the button.
4351
+ tasks: ({ settings, status } = {}) => ["disconnected", "error"].includes(status) ? [] : (settings == null ? void 0 : settings.secret) ? [
4337
4352
  {
4338
4353
  message: "Compute HMAC-SHA256( secret, body ) and compare against the X-Drawbridge-Signature header to confirm each payload.",
4339
4354
  title: "Requests must be verified",
@@ -799,9 +799,13 @@ var attentive_default2 = {
799
799
  }
800
800
  },
801
801
  // WHY, in the merchant's words, and what to do about it.
802
+ // ONLY FOR A LIVE GRANT. A disconnected or errored connection's next step
803
+ // is reconnecting — prompting "choose a segment" there asks the merchant to
804
+ // configure a grant that no longer exists. `pending` is exactly this task's
805
+ // moment: the grant is good and the segment is the missing half.
802
806
  tasks: (data2) => {
803
807
  var _a;
804
- return ((_a = data2 == null ? void 0 : data2.settings) == null ? void 0 : _a.segment) ? [] : [
808
+ return !["active", "pending"].includes(data2 == null ? void 0 : data2.status) || ((_a = data2 == null ? void 0 : data2.settings) == null ? void 0 : _a.segment) ? [] : [
805
809
  {
806
810
  message: "Choose which Attentive segment your contacts should sync into. Until you do, nothing is being synced.",
807
811
  title: "Choose a segment"
@@ -2658,9 +2662,13 @@ var klaviyo_default2 = {
2658
2662
  }
2659
2663
  },
2660
2664
  // WHY, in the merchant's words, and what to do about it.
2665
+ // ONLY FOR A LIVE GRANT. A disconnected or errored connection's next step
2666
+ // is reconnecting — prompting "choose a list" there asks the merchant to
2667
+ // configure a grant that no longer exists. `pending` is exactly this task's
2668
+ // moment: the grant is good and the list is the missing half.
2661
2669
  tasks: (data2) => {
2662
2670
  var _a;
2663
- return ((_a = data2 == null ? void 0 : data2.settings) == null ? void 0 : _a.list) ? [] : [
2671
+ return !["active", "pending"].includes(data2 == null ? void 0 : data2.status) || ((_a = data2 == null ? void 0 : data2.settings) == null ? void 0 : _a.list) ? [] : [
2664
2672
  {
2665
2673
  message: "Choose which Klaviyo list your contacts should sync into. Until you do, nothing is being synced.",
2666
2674
  title: "Choose a list"
@@ -2745,7 +2753,7 @@ var mailchimp_default2 = {
2745
2753
  content: {
2746
2754
  confirm: "Disconnecting removes Drawbridge's stored Mailchimp access. You can also remove Drawbridge from the Authorized Apps page in your Mailchimp account. Your contacts stay in both Drawbridge and Mailchimp \u2014 neither list is deleted.",
2747
2755
  description: [
2748
- "Drawbridge no longer sends email through Mailchimp. Notification email now sends from Drawbridge itself, and verifying a domain under Networking in your organization settings puts your own brand in the from line.",
2756
+ "Drawbridge no longer sends email through Mailchimp. Notification email now sends from Drawbridge itself, and verifying a domain under Messaging in your organization settings puts your own brand in the from line.",
2749
2757
  "Connecting Mailchimp lets Drawbridge sync the contacts your campaigns collect into a Mailchimp audience, so the people who enter a giveaway can be marketed to alongside the rest of your list.",
2750
2758
  "Anyone who has opted out in Drawbridge is synced as unsubscribed rather than omitted, so a person who asked not to be contacted stays suppressed in both systems instead of quietly reappearing.",
2751
2759
  "Someone who unsubscribed inside Mailchimp keeps that choice: a resync only sets the status of a subscriber Mailchimp has never seen before."
@@ -2973,9 +2981,13 @@ var mailchimp_default2 = {
2973
2981
  }
2974
2982
  },
2975
2983
  // WHY, in the merchant's words, and what to do about it.
2984
+ // ONLY FOR A LIVE GRANT. A disconnected or errored connection's next step
2985
+ // is reconnecting — prompting "choose a audience" there asks the merchant to
2986
+ // configure a grant that no longer exists. `pending` is exactly this task's
2987
+ // moment: the grant is good and the audience is the missing half.
2976
2988
  tasks: (data2) => {
2977
2989
  var _a;
2978
- return ((_a = data2 == null ? void 0 : data2.settings) == null ? void 0 : _a.audience) ? [] : [
2990
+ return !["active", "pending"].includes(data2 == null ? void 0 : data2.status) || ((_a = data2 == null ? void 0 : data2.settings) == null ? void 0 : _a.audience) ? [] : [
2979
2991
  {
2980
2992
  message: "Choose which Mailchimp audience your contacts should sync into. Until you do, nothing is being synced.",
2981
2993
  title: "Choose an audience"
@@ -4313,7 +4325,10 @@ var webhook_default = {
4313
4325
  // pressing Connect will do; afterwards it states the verification the
4314
4326
  // merchant's own endpoint has to perform, because a signed payload nobody
4315
4327
  // checks is an unsigned payload.
4316
- tasks: ({ settings }) => (settings == null ? void 0 : settings.secret) ? [
4328
+ // The connect prompt only where connecting is not already the card's whole
4329
+ // story: a disconnected or errored document renders a Connect action itself,
4330
+ // and a task repeating it talks over the button.
4331
+ tasks: ({ settings, status } = {}) => ["disconnected", "error"].includes(status) ? [] : (settings == null ? void 0 : settings.secret) ? [
4317
4332
  {
4318
4333
  message: "Compute HMAC-SHA256( secret, body ) and compare against the X-Drawbridge-Signature header to confirm each payload.",
4319
4334
  title: "Requests must be verified",
package/dist/providers.js CHANGED
@@ -755,9 +755,13 @@ var attentive_default2 = {
755
755
  }
756
756
  },
757
757
  // WHY, in the merchant's words, and what to do about it.
758
+ // ONLY FOR A LIVE GRANT. A disconnected or errored connection's next step
759
+ // is reconnecting — prompting "choose a segment" there asks the merchant to
760
+ // configure a grant that no longer exists. `pending` is exactly this task's
761
+ // moment: the grant is good and the segment is the missing half.
758
762
  tasks: (data2) => {
759
763
  var _a;
760
- return ((_a = data2 == null ? void 0 : data2.settings) == null ? void 0 : _a.segment) ? [] : [
764
+ return !["active", "pending"].includes(data2 == null ? void 0 : data2.status) || ((_a = data2 == null ? void 0 : data2.settings) == null ? void 0 : _a.segment) ? [] : [
761
765
  {
762
766
  message: "Choose which Attentive segment your contacts should sync into. Until you do, nothing is being synced.",
763
767
  title: "Choose a segment"
@@ -2614,9 +2618,13 @@ var klaviyo_default2 = {
2614
2618
  }
2615
2619
  },
2616
2620
  // WHY, in the merchant's words, and what to do about it.
2621
+ // ONLY FOR A LIVE GRANT. A disconnected or errored connection's next step
2622
+ // is reconnecting — prompting "choose a list" there asks the merchant to
2623
+ // configure a grant that no longer exists. `pending` is exactly this task's
2624
+ // moment: the grant is good and the list is the missing half.
2617
2625
  tasks: (data2) => {
2618
2626
  var _a;
2619
- return ((_a = data2 == null ? void 0 : data2.settings) == null ? void 0 : _a.list) ? [] : [
2627
+ return !["active", "pending"].includes(data2 == null ? void 0 : data2.status) || ((_a = data2 == null ? void 0 : data2.settings) == null ? void 0 : _a.list) ? [] : [
2620
2628
  {
2621
2629
  message: "Choose which Klaviyo list your contacts should sync into. Until you do, nothing is being synced.",
2622
2630
  title: "Choose a list"
@@ -2701,7 +2709,7 @@ var mailchimp_default2 = {
2701
2709
  content: {
2702
2710
  confirm: "Disconnecting removes Drawbridge's stored Mailchimp access. You can also remove Drawbridge from the Authorized Apps page in your Mailchimp account. Your contacts stay in both Drawbridge and Mailchimp \u2014 neither list is deleted.",
2703
2711
  description: [
2704
- "Drawbridge no longer sends email through Mailchimp. Notification email now sends from Drawbridge itself, and verifying a domain under Networking in your organization settings puts your own brand in the from line.",
2712
+ "Drawbridge no longer sends email through Mailchimp. Notification email now sends from Drawbridge itself, and verifying a domain under Messaging in your organization settings puts your own brand in the from line.",
2705
2713
  "Connecting Mailchimp lets Drawbridge sync the contacts your campaigns collect into a Mailchimp audience, so the people who enter a giveaway can be marketed to alongside the rest of your list.",
2706
2714
  "Anyone who has opted out in Drawbridge is synced as unsubscribed rather than omitted, so a person who asked not to be contacted stays suppressed in both systems instead of quietly reappearing.",
2707
2715
  "Someone who unsubscribed inside Mailchimp keeps that choice: a resync only sets the status of a subscriber Mailchimp has never seen before."
@@ -2929,9 +2937,13 @@ var mailchimp_default2 = {
2929
2937
  }
2930
2938
  },
2931
2939
  // WHY, in the merchant's words, and what to do about it.
2940
+ // ONLY FOR A LIVE GRANT. A disconnected or errored connection's next step
2941
+ // is reconnecting — prompting "choose a audience" there asks the merchant to
2942
+ // configure a grant that no longer exists. `pending` is exactly this task's
2943
+ // moment: the grant is good and the audience is the missing half.
2932
2944
  tasks: (data2) => {
2933
2945
  var _a;
2934
- return ((_a = data2 == null ? void 0 : data2.settings) == null ? void 0 : _a.audience) ? [] : [
2946
+ return !["active", "pending"].includes(data2 == null ? void 0 : data2.status) || ((_a = data2 == null ? void 0 : data2.settings) == null ? void 0 : _a.audience) ? [] : [
2935
2947
  {
2936
2948
  message: "Choose which Mailchimp audience your contacts should sync into. Until you do, nothing is being synced.",
2937
2949
  title: "Choose an audience"
@@ -4269,7 +4281,10 @@ var webhook_default = {
4269
4281
  // pressing Connect will do; afterwards it states the verification the
4270
4282
  // merchant's own endpoint has to perform, because a signed payload nobody
4271
4283
  // checks is an unsigned payload.
4272
- tasks: ({ settings }) => (settings == null ? void 0 : settings.secret) ? [
4284
+ // The connect prompt only where connecting is not already the card's whole
4285
+ // story: a disconnected or errored document renders a Connect action itself,
4286
+ // and a task repeating it talks over the button.
4287
+ tasks: ({ settings, status } = {}) => ["disconnected", "error"].includes(status) ? [] : (settings == null ? void 0 : settings.secret) ? [
4273
4288
  {
4274
4289
  message: "Compute HMAC-SHA256( secret, body ) and compare against the X-Drawbridge-Signature header to confirm each payload.",
4275
4290
  title: "Requests must be verified",
package/package.json CHANGED
@@ -215,5 +215,5 @@
215
215
  "test": ". \"$HOME/.nvm/nvm.sh\" && nvm use && node --test"
216
216
  },
217
217
  "types": "dist/index.d.ts",
218
- "version": "0.0.124"
218
+ "version": "0.0.125"
219
219
  }