@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,23 +1,12 @@
1
- import { vendors, mergeSettings, connections } from './connections/index.cjs';
1
+ import { a0 as vendors, F as mergeSettings, x as connections } from './index-qY18QITf.cjs';
2
2
  import { decrypt, encrypt } from './encrypt.cjs';
3
3
  import { slugify } from './slugify.cjs';
4
+ import './usage.cjs';
4
5
  import './connections/oauth.cjs';
5
6
  import 'node:crypto';
6
7
  import './phone.cjs';
7
8
  import 'libphonenumber-js';
8
9
  import './http.cjs';
9
- import './pricing.cjs';
10
- import './billing.cjs';
11
- import './transactions.cjs';
12
- import '@drawbridge/drawbridge-telemetry';
13
- import './usage.cjs';
14
- import './plans.cjs';
15
- import './features.cjs';
16
- import './index.cjs';
17
- import 'currency-codes';
18
- import './color.cjs';
19
- import 'tinycolor2';
20
- import './nanoid.cjs';
21
10
  import 'nanoid';
22
11
  import './email.cjs';
23
12
  import './safe-http.cjs';
@@ -74,10 +63,10 @@ const providerFields = ( slug ) => (
74
63
 
75
64
  // The vendors an admin can configure, in a stable order.
76
65
  //
77
- // DERIVED FROM WHO DECLARES A VENDOR, not from the catalog: `webhook` is a
78
- // connection with no vendor behind it nothing to authenticate against and
79
- // nothing to typeso it must not appear on a screen whose whole purpose is
80
- // entering credentials.
66
+ // FROM THE VENDOR DIRECTORY, not from the connection catalog. It used to be
67
+ // derived from which manifests declared a vendor, which meant a vendor could not
68
+ // exist without a connection Stripe needs credentials and has no manifest. A
69
+ // connection with no vendor behind it, like `webhook`, simply names none.
81
70
  const providerSlugs = () => Object.keys( vendors ).sort();
82
71
 
83
72
  // LIVE IS DERIVED, never stored. A stored flag is a second thing to keep in
@@ -236,7 +225,7 @@ const vendorEnabled = async ({ controller, vendor }) => (
236
225
  // lookups inside the window.
237
226
  const vendorSettings = async ({ controller, slug }) => {
238
227
 
239
- const declared = Object.hasOwn( connections, slug ) ? Object.keys( connections[ slug ].provider?.vendors || {} ) : [];
228
+ const declared = Object.hasOwn( connections, slug ) ? ( connections[ slug ].vendors || [] ) : [];
240
229
 
241
230
  let merged = {};
242
231
 
@@ -262,7 +251,7 @@ const vendorSettings = async ({ controller, slug }) => {
262
251
  // three, or the two would disagree about which vendors a connection depends on.
263
252
  const vendorsEnabled = async ({ controller, slug }) => {
264
253
 
265
- const declared = Object.hasOwn( connections, slug ) ? Object.keys( connections[ slug ].provider?.vendors || {} ) : [];
254
+ const declared = Object.hasOwn( connections, slug ) ? ( connections[ slug ].vendors || [] ) : [];
266
255
 
267
256
  for( const vendor of declared ){
268
257
 
@@ -1,23 +1,12 @@
1
- import { vendors, mergeSettings, connections } from './connections/index.js';
1
+ import { a0 as vendors, F as mergeSettings, x as connections } from './index-B8JhYfvU.js';
2
2
  import { decrypt, encrypt } from './encrypt.js';
3
3
  import { slugify } from './slugify.js';
4
+ import './usage.js';
4
5
  import './connections/oauth.js';
5
6
  import 'node:crypto';
6
7
  import './phone.js';
7
8
  import 'libphonenumber-js';
8
9
  import './http.js';
9
- import './pricing.js';
10
- import './billing.js';
11
- import './transactions.js';
12
- import '@drawbridge/drawbridge-telemetry';
13
- import './usage.js';
14
- import './plans.js';
15
- import './features.js';
16
- import './index.js';
17
- import 'currency-codes';
18
- import './color.js';
19
- import 'tinycolor2';
20
- import './nanoid.js';
21
10
  import 'nanoid';
22
11
  import './email.js';
23
12
  import './safe-http.js';
@@ -74,10 +63,10 @@ const providerFields = ( slug ) => (
74
63
 
75
64
  // The vendors an admin can configure, in a stable order.
76
65
  //
77
- // DERIVED FROM WHO DECLARES A VENDOR, not from the catalog: `webhook` is a
78
- // connection with no vendor behind it nothing to authenticate against and
79
- // nothing to typeso it must not appear on a screen whose whole purpose is
80
- // entering credentials.
66
+ // FROM THE VENDOR DIRECTORY, not from the connection catalog. It used to be
67
+ // derived from which manifests declared a vendor, which meant a vendor could not
68
+ // exist without a connection Stripe needs credentials and has no manifest. A
69
+ // connection with no vendor behind it, like `webhook`, simply names none.
81
70
  const providerSlugs = () => Object.keys( vendors ).sort();
82
71
 
83
72
  // LIVE IS DERIVED, never stored. A stored flag is a second thing to keep in
@@ -236,7 +225,7 @@ const vendorEnabled = async ({ controller, vendor }) => (
236
225
  // lookups inside the window.
237
226
  const vendorSettings = async ({ controller, slug }) => {
238
227
 
239
- const declared = Object.hasOwn( connections, slug ) ? Object.keys( connections[ slug ].provider?.vendors || {} ) : [];
228
+ const declared = Object.hasOwn( connections, slug ) ? ( connections[ slug ].vendors || [] ) : [];
240
229
 
241
230
  let merged = {};
242
231
 
@@ -262,7 +251,7 @@ const vendorSettings = async ({ controller, slug }) => {
262
251
  // three, or the two would disagree about which vendors a connection depends on.
263
252
  const vendorsEnabled = async ({ controller, slug }) => {
264
253
 
265
- const declared = Object.hasOwn( connections, slug ) ? Object.keys( connections[ slug ].provider?.vendors || {} ) : [];
254
+ const declared = Object.hasOwn( connections, slug ) ? ( connections[ slug ].vendors || [] ) : [];
266
255
 
267
256
  for( const vendor of declared ){
268
257