@drawbridge/drawbridge-utils 0.0.173 → 0.0.175

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.
@@ -74,10 +74,10 @@ const providerFields = ( slug ) => (
74
74
 
75
75
  // The vendors an admin can configure, in a stable order.
76
76
  //
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.
77
+ // FROM THE VENDOR DIRECTORY, not from the connection catalog. It used to be
78
+ // derived from which manifests declared a vendor, which meant a vendor could not
79
+ // exist without a connection Stripe needs credentials and has no manifest. A
80
+ // connection with no vendor behind it, like `webhook`, simply names none.
81
81
  const providerSlugs = () => Object.keys( vendors ).sort();
82
82
 
83
83
  // LIVE IS DERIVED, never stored. A stored flag is a second thing to keep in
@@ -236,7 +236,7 @@ const vendorEnabled = async ({ controller, vendor }) => (
236
236
  // lookups inside the window.
237
237
  const vendorSettings = async ({ controller, slug }) => {
238
238
 
239
- const declared = Object.hasOwn( connections, slug ) ? Object.keys( connections[ slug ].provider?.vendors || {} ) : [];
239
+ const declared = Object.hasOwn( connections, slug ) ? ( connections[ slug ].vendors || [] ) : [];
240
240
 
241
241
  let merged = {};
242
242
 
@@ -262,7 +262,7 @@ const vendorSettings = async ({ controller, slug }) => {
262
262
  // three, or the two would disagree about which vendors a connection depends on.
263
263
  const vendorsEnabled = async ({ controller, slug }) => {
264
264
 
265
- const declared = Object.hasOwn( connections, slug ) ? Object.keys( connections[ slug ].provider?.vendors || {} ) : [];
265
+ const declared = Object.hasOwn( connections, slug ) ? ( connections[ slug ].vendors || [] ) : [];
266
266
 
267
267
  for( const vendor of declared ){
268
268
 
@@ -74,10 +74,10 @@ const providerFields = ( slug ) => (
74
74
 
75
75
  // The vendors an admin can configure, in a stable order.
76
76
  //
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.
77
+ // FROM THE VENDOR DIRECTORY, not from the connection catalog. It used to be
78
+ // derived from which manifests declared a vendor, which meant a vendor could not
79
+ // exist without a connection Stripe needs credentials and has no manifest. A
80
+ // connection with no vendor behind it, like `webhook`, simply names none.
81
81
  const providerSlugs = () => Object.keys( vendors ).sort();
82
82
 
83
83
  // LIVE IS DERIVED, never stored. A stored flag is a second thing to keep in
@@ -236,7 +236,7 @@ const vendorEnabled = async ({ controller, vendor }) => (
236
236
  // lookups inside the window.
237
237
  const vendorSettings = async ({ controller, slug }) => {
238
238
 
239
- const declared = Object.hasOwn( connections, slug ) ? Object.keys( connections[ slug ].provider?.vendors || {} ) : [];
239
+ const declared = Object.hasOwn( connections, slug ) ? ( connections[ slug ].vendors || [] ) : [];
240
240
 
241
241
  let merged = {};
242
242
 
@@ -262,7 +262,7 @@ const vendorSettings = async ({ controller, slug }) => {
262
262
  // three, or the two would disagree about which vendors a connection depends on.
263
263
  const vendorsEnabled = async ({ controller, slug }) => {
264
264
 
265
- const declared = Object.hasOwn( connections, slug ) ? Object.keys( connections[ slug ].provider?.vendors || {} ) : [];
265
+ const declared = Object.hasOwn( connections, slug ) ? ( connections[ slug ].vendors || [] ) : [];
266
266
 
267
267
  for( const vendor of declared ){
268
268