@drawbridge/drawbridge-utils 0.0.174 → 0.0.176

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,3 +1,25 @@
1
+ import { x as connections } from './index-qY18QITf.cjs';
2
+ import './usage.cjs';
3
+ import './connections/oauth.cjs';
4
+ import 'node:crypto';
5
+ import './phone.cjs';
6
+ import 'libphonenumber-js';
7
+ import './http.cjs';
8
+ import 'nanoid';
9
+ import './email.cjs';
10
+ import './encrypt.cjs';
11
+ import 'crypto';
12
+ import './token.cjs';
13
+ import './slugify.cjs';
14
+ import 'slugify';
15
+ import './safe-http.cjs';
16
+ import 'dns';
17
+ import 'node:http';
18
+ import 'node:https';
19
+ import './axios.cjs';
20
+ import 'axios';
21
+ import 'net';
22
+
1
23
  const page = {
2
24
  qrcode : {
3
25
  key : 'page:qrcode',
@@ -67,48 +89,30 @@ const field = {
67
89
  }
68
90
  };
69
91
 
70
- const connection = {
71
- attentive : {
72
- key : 'organization:connection:attentive',
73
- error : 'Plan does not include Attentive connection',
74
- feature : 'Attentive connection'
75
- },
76
- // Klaviyo shipped without an entry here, which meant no plan GRANTED its
77
- // key and the feature gate denied every non-admin request a latent 403
78
- // found while adding Attentive. getPlanFeature answers granted:false for a
79
- // key absent from the plan's map, so a manifest feature key that appears in
80
- // no plan list is a connection only admins can manage.
81
- klaviyo : {
82
- key : 'organization:connection:klaviyo',
83
- error : 'Plan does not include Klaviyo connection',
84
- feature : 'Klaviyo connection'
85
- },
86
- mailchimp : {
87
- key : 'organization:connection:mailchimp',
88
- error : 'Plan does not include Mailchimp connection',
89
- feature : 'Mailchimp connection'
90
- },
91
- sendgrid : {
92
- key : 'organization:connection:sendgrid',
93
- error : 'Plan does not include SendGrid connection',
94
- feature : 'SendGrid connection'
95
- },
96
- shopify : {
97
- key : 'organization:connection:shopify',
98
- error : 'Plan does not include Shopify connection',
99
- feature : 'Shopify connection',
100
- },
101
- twilio : {
102
- key : 'organization:connection:twilio',
103
- error : 'Plan does not include Twilio connection',
104
- feature : 'Twilio connection'
105
- },
106
- webhook : {
107
- key : 'organization:connection:webhook',
108
- error : 'Plan does not include Webhook connection',
109
- feature : 'Webhook connection'
110
- }
111
- };
92
+ // DERIVED FROM THE REGISTRY, one entry per public connection.
93
+ //
94
+ // It was hand-written, and it had drifted in both directions at once. It carried
95
+ // SEVEN entries where five connections exist — `organization:connection:sendgrid`
96
+ // and `:twilio` name vendors that have no manifest and never had one, so two
97
+ // plan features granted access to nothing. And it had been SHORT: Klaviyo shipped
98
+ // without an entry, no plan granted its key, and the gate denied every non-admin
99
+ // request a latent 403 found by accident while adding Attentive.
100
+ //
101
+ // That is step 6 of the documented add-a-connection checklist gone: a new
102
+ // manifest brings its own feature key, its own copy, and its own plan grant.
103
+ //
104
+ // Keyed by SLUG and valued from the manifest's own `feature` and `title`, so the
105
+ // key a plan grants is byte-identical to the key the manifest declares — they
106
+ // used to be two strings that happened to match.
107
+ const connection = Object.freeze( Object.fromEntries(
108
+ Object.entries( connections )
109
+ .filter( ( [ , manifest ] ) => manifest.feature !== false )
110
+ .map( ( [ slug, manifest ] ) => [ slug, Object.freeze({
111
+ error : 'Plan does not include ' + manifest.title + ' connection',
112
+ feature : manifest.title + ' connection',
113
+ key : manifest.feature
114
+ }) ] )
115
+ ) );
112
116
 
113
117
  const integration = {
114
118
  age : {
@@ -1,3 +1,25 @@
1
+ import { x as connections } from './index-B8JhYfvU.js';
2
+ import './usage.js';
3
+ import './connections/oauth.js';
4
+ import 'node:crypto';
5
+ import './phone.js';
6
+ import 'libphonenumber-js';
7
+ import './http.js';
8
+ import 'nanoid';
9
+ import './email.js';
10
+ import './encrypt.js';
11
+ import 'crypto';
12
+ import './token.js';
13
+ import './slugify.js';
14
+ import 'slugify';
15
+ import './safe-http.js';
16
+ import 'dns';
17
+ import 'node:http';
18
+ import 'node:https';
19
+ import './axios.js';
20
+ import 'axios';
21
+ import 'net';
22
+
1
23
  const page = {
2
24
  qrcode : {
3
25
  key : 'page:qrcode',
@@ -67,48 +89,30 @@ const field = {
67
89
  }
68
90
  };
69
91
 
70
- const connection = {
71
- attentive : {
72
- key : 'organization:connection:attentive',
73
- error : 'Plan does not include Attentive connection',
74
- feature : 'Attentive connection'
75
- },
76
- // Klaviyo shipped without an entry here, which meant no plan GRANTED its
77
- // key and the feature gate denied every non-admin request a latent 403
78
- // found while adding Attentive. getPlanFeature answers granted:false for a
79
- // key absent from the plan's map, so a manifest feature key that appears in
80
- // no plan list is a connection only admins can manage.
81
- klaviyo : {
82
- key : 'organization:connection:klaviyo',
83
- error : 'Plan does not include Klaviyo connection',
84
- feature : 'Klaviyo connection'
85
- },
86
- mailchimp : {
87
- key : 'organization:connection:mailchimp',
88
- error : 'Plan does not include Mailchimp connection',
89
- feature : 'Mailchimp connection'
90
- },
91
- sendgrid : {
92
- key : 'organization:connection:sendgrid',
93
- error : 'Plan does not include SendGrid connection',
94
- feature : 'SendGrid connection'
95
- },
96
- shopify : {
97
- key : 'organization:connection:shopify',
98
- error : 'Plan does not include Shopify connection',
99
- feature : 'Shopify connection',
100
- },
101
- twilio : {
102
- key : 'organization:connection:twilio',
103
- error : 'Plan does not include Twilio connection',
104
- feature : 'Twilio connection'
105
- },
106
- webhook : {
107
- key : 'organization:connection:webhook',
108
- error : 'Plan does not include Webhook connection',
109
- feature : 'Webhook connection'
110
- }
111
- };
92
+ // DERIVED FROM THE REGISTRY, one entry per public connection.
93
+ //
94
+ // It was hand-written, and it had drifted in both directions at once. It carried
95
+ // SEVEN entries where five connections exist — `organization:connection:sendgrid`
96
+ // and `:twilio` name vendors that have no manifest and never had one, so two
97
+ // plan features granted access to nothing. And it had been SHORT: Klaviyo shipped
98
+ // without an entry, no plan granted its key, and the gate denied every non-admin
99
+ // request a latent 403 found by accident while adding Attentive.
100
+ //
101
+ // That is step 6 of the documented add-a-connection checklist gone: a new
102
+ // manifest brings its own feature key, its own copy, and its own plan grant.
103
+ //
104
+ // Keyed by SLUG and valued from the manifest's own `feature` and `title`, so the
105
+ // key a plan grants is byte-identical to the key the manifest declares — they
106
+ // used to be two strings that happened to match.
107
+ const connection = Object.freeze( Object.fromEntries(
108
+ Object.entries( connections )
109
+ .filter( ( [ , manifest ] ) => manifest.feature !== false )
110
+ .map( ( [ slug, manifest ] ) => [ slug, Object.freeze({
111
+ error : 'Plan does not include ' + manifest.title + ' connection',
112
+ feature : manifest.title + ' connection',
113
+ key : manifest.feature
114
+ }) ] )
115
+ ) );
112
116
 
113
117
  const integration = {
114
118
  age : {