@drawbridge/drawbridge-utils 0.0.126 → 0.0.127
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/connections/index.cjs +4 -4
- package/dist/connections/index.d.cts +4 -4
- package/dist/connections/index.d.ts +4 -4
- package/dist/connections/index.js +4 -4
- package/dist/providers.cjs +6 -5
- package/dist/providers.d.cts +10 -1
- package/dist/providers.d.ts +10 -1
- package/dist/providers.js +6 -5
- package/package.json +1 -1
|
@@ -1104,14 +1104,14 @@ var contacts = {
|
|
|
1104
1104
|
|
|
1105
1105
|
// lib/connections/icons/drawbridge.js
|
|
1106
1106
|
var drawbridge_default = `<svg width="500" height="500" viewBox="0 0 500 500" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1107
|
-
<rect width="500" height="500" fill="#
|
|
1107
|
+
<rect width="500" height="500" fill="#0D1314"/>
|
|
1108
1108
|
<g clip-path="url(#clip0_2115_2832)">
|
|
1109
|
-
<path d="
|
|
1110
|
-
<path d="
|
|
1109
|
+
<path d="M153.198 142.241L183.69 196.065V303.852L153 357.676L184.82 375.028L220.116 313.163V186.865L185.046 125L153.198 142.241Z" fill="#BAEC5F"/>
|
|
1110
|
+
<path d="M347.002 142.186L314.984 125.249L280.818 187.058V313.025L314.306 374.779L346.465 358.091L317.216 304.156V196.066L347.002 142.186Z" fill="#BAEC5F"/>
|
|
1111
1111
|
</g>
|
|
1112
1112
|
<defs>
|
|
1113
1113
|
<clipPath id="clip0_2115_2832">
|
|
1114
|
-
<rect width="
|
|
1114
|
+
<rect width="194" height="250" fill="white" transform="translate(153 125)"/>
|
|
1115
1115
|
</clipPath>
|
|
1116
1116
|
</defs>
|
|
1117
1117
|
</svg>`;
|
|
@@ -1567,14 +1567,14 @@ const contacts = {
|
|
|
1567
1567
|
// lib/ directly. A bare .svg import would need a bundler loader and force the
|
|
1568
1568
|
// tests onto dist/, which is a worse trade than one line of wrapper.
|
|
1569
1569
|
var icon$3 = `<svg width="500" height="500" viewBox="0 0 500 500" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1570
|
-
<rect width="500" height="500" fill="#
|
|
1570
|
+
<rect width="500" height="500" fill="#0D1314"/>
|
|
1571
1571
|
<g clip-path="url(#clip0_2115_2832)">
|
|
1572
|
-
<path d="
|
|
1573
|
-
<path d="
|
|
1572
|
+
<path d="M153.198 142.241L183.69 196.065V303.852L153 357.676L184.82 375.028L220.116 313.163V186.865L185.046 125L153.198 142.241Z" fill="#BAEC5F"/>
|
|
1573
|
+
<path d="M347.002 142.186L314.984 125.249L280.818 187.058V313.025L314.306 374.779L346.465 358.091L317.216 304.156V196.066L347.002 142.186Z" fill="#BAEC5F"/>
|
|
1574
1574
|
</g>
|
|
1575
1575
|
<defs>
|
|
1576
1576
|
<clipPath id="clip0_2115_2832">
|
|
1577
|
-
<rect width="
|
|
1577
|
+
<rect width="194" height="250" fill="white" transform="translate(153 125)"/>
|
|
1578
1578
|
</clipPath>
|
|
1579
1579
|
</defs>
|
|
1580
1580
|
</svg>`;
|
|
@@ -1567,14 +1567,14 @@ const contacts = {
|
|
|
1567
1567
|
// lib/ directly. A bare .svg import would need a bundler loader and force the
|
|
1568
1568
|
// tests onto dist/, which is a worse trade than one line of wrapper.
|
|
1569
1569
|
var icon$3 = `<svg width="500" height="500" viewBox="0 0 500 500" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1570
|
-
<rect width="500" height="500" fill="#
|
|
1570
|
+
<rect width="500" height="500" fill="#0D1314"/>
|
|
1571
1571
|
<g clip-path="url(#clip0_2115_2832)">
|
|
1572
|
-
<path d="
|
|
1573
|
-
<path d="
|
|
1572
|
+
<path d="M153.198 142.241L183.69 196.065V303.852L153 357.676L184.82 375.028L220.116 313.163V186.865L185.046 125L153.198 142.241Z" fill="#BAEC5F"/>
|
|
1573
|
+
<path d="M347.002 142.186L314.984 125.249L280.818 187.058V313.025L314.306 374.779L346.465 358.091L317.216 304.156V196.066L347.002 142.186Z" fill="#BAEC5F"/>
|
|
1574
1574
|
</g>
|
|
1575
1575
|
<defs>
|
|
1576
1576
|
<clipPath id="clip0_2115_2832">
|
|
1577
|
-
<rect width="
|
|
1577
|
+
<rect width="194" height="250" fill="white" transform="translate(153 125)"/>
|
|
1578
1578
|
</clipPath>
|
|
1579
1579
|
</defs>
|
|
1580
1580
|
</svg>`;
|
|
@@ -1030,14 +1030,14 @@ var contacts = {
|
|
|
1030
1030
|
|
|
1031
1031
|
// lib/connections/icons/drawbridge.js
|
|
1032
1032
|
var drawbridge_default = `<svg width="500" height="500" viewBox="0 0 500 500" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1033
|
-
<rect width="500" height="500" fill="#
|
|
1033
|
+
<rect width="500" height="500" fill="#0D1314"/>
|
|
1034
1034
|
<g clip-path="url(#clip0_2115_2832)">
|
|
1035
|
-
<path d="
|
|
1036
|
-
<path d="
|
|
1035
|
+
<path d="M153.198 142.241L183.69 196.065V303.852L153 357.676L184.82 375.028L220.116 313.163V186.865L185.046 125L153.198 142.241Z" fill="#BAEC5F"/>
|
|
1036
|
+
<path d="M347.002 142.186L314.984 125.249L280.818 187.058V313.025L314.306 374.779L346.465 358.091L317.216 304.156V196.066L347.002 142.186Z" fill="#BAEC5F"/>
|
|
1037
1037
|
</g>
|
|
1038
1038
|
<defs>
|
|
1039
1039
|
<clipPath id="clip0_2115_2832">
|
|
1040
|
-
<rect width="
|
|
1040
|
+
<rect width="194" height="250" fill="white" transform="translate(153 125)"/>
|
|
1041
1041
|
</clipPath>
|
|
1042
1042
|
</defs>
|
|
1043
1043
|
</svg>`;
|
package/dist/providers.cjs
CHANGED
|
@@ -1010,14 +1010,14 @@ var contacts = {
|
|
|
1010
1010
|
|
|
1011
1011
|
// lib/connections/icons/drawbridge.js
|
|
1012
1012
|
var drawbridge_default = `<svg width="500" height="500" viewBox="0 0 500 500" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1013
|
-
<rect width="500" height="500" fill="#
|
|
1013
|
+
<rect width="500" height="500" fill="#0D1314"/>
|
|
1014
1014
|
<g clip-path="url(#clip0_2115_2832)">
|
|
1015
|
-
<path d="
|
|
1016
|
-
<path d="
|
|
1015
|
+
<path d="M153.198 142.241L183.69 196.065V303.852L153 357.676L184.82 375.028L220.116 313.163V186.865L185.046 125L153.198 142.241Z" fill="#BAEC5F"/>
|
|
1016
|
+
<path d="M347.002 142.186L314.984 125.249L280.818 187.058V313.025L314.306 374.779L346.465 358.091L317.216 304.156V196.066L347.002 142.186Z" fill="#BAEC5F"/>
|
|
1017
1017
|
</g>
|
|
1018
1018
|
<defs>
|
|
1019
1019
|
<clipPath id="clip0_2115_2832">
|
|
1020
|
-
<rect width="
|
|
1020
|
+
<rect width="194" height="250" fill="white" transform="translate(153 125)"/>
|
|
1021
1021
|
</clipPath>
|
|
1022
1022
|
</defs>
|
|
1023
1023
|
</svg>`;
|
|
@@ -4740,9 +4740,10 @@ var saveProviderSettings = async ({ authenticated, clear, controller, settings,
|
|
|
4740
4740
|
query: { slug }
|
|
4741
4741
|
});
|
|
4742
4742
|
const stored = (existing == null ? void 0 : existing.settings) ? decrypt(existing.settings) : {};
|
|
4743
|
+
const pasted = (value) => typeof value === "string" ? value.trim().replace(/^['"]+|['"]+$/g, "") : value;
|
|
4743
4744
|
const merged = mergeSettings({
|
|
4744
4745
|
existing: stored,
|
|
4745
|
-
incoming: Object.fromEntries(fields2.map((field2) => [field2.key, settings == null ? void 0 : settings[field2.key]]))
|
|
4746
|
+
incoming: Object.fromEntries(fields2.map((field2) => [field2.key, pasted(settings == null ? void 0 : settings[field2.key])]))
|
|
4746
4747
|
});
|
|
4747
4748
|
for (const key of Array.isArray(clear) ? clear : []) {
|
|
4748
4749
|
if (fields2.some((field2) => field2.key === key)) delete merged[key];
|
package/dist/providers.d.cts
CHANGED
|
@@ -191,6 +191,15 @@ const saveProviderSettings = async ({ authenticated, clear, controller, settings
|
|
|
191
191
|
|
|
192
192
|
const stored = existing?.settings ? decrypt( existing.settings ) : {};
|
|
193
193
|
|
|
194
|
+
// A CREDENTIAL ARRIVES BY PASTE, and a paste from a shell line or a password
|
|
195
|
+
// manager brings wrapping quotes and whitespace with it. One stray trailing
|
|
196
|
+
// `'` on a SendGrid key turned every sign-in email into a silent 401 — no
|
|
197
|
+
// legitimate credential begins or ends with a quote or a space, so stripping
|
|
198
|
+
// them here loses nothing and ends the failure mode for every field at once.
|
|
199
|
+
const pasted = ( value ) => typeof value === 'string'
|
|
200
|
+
? value.trim().replace( /^['"]+|['"]+$/g, '' )
|
|
201
|
+
: value;
|
|
202
|
+
|
|
194
203
|
// mergeSettings is the blank-keeps rule, already used for merchant
|
|
195
204
|
// connection settings in route/organization-connection.js — same behaviour,
|
|
196
205
|
// one implementation. The declared-field allowlist is the part that is ours:
|
|
@@ -198,7 +207,7 @@ const saveProviderSettings = async ({ authenticated, clear, controller, settings
|
|
|
198
207
|
// not declare reaching the document.
|
|
199
208
|
const merged = mergeSettings({
|
|
200
209
|
existing : stored,
|
|
201
|
-
incoming : Object.fromEntries( fields.map( ( field ) => [ field.key, settings?.[ field.key ] ] ) )
|
|
210
|
+
incoming : Object.fromEntries( fields.map( ( field ) => [ field.key, pasted( settings?.[ field.key ] ) ] ) )
|
|
202
211
|
});
|
|
203
212
|
|
|
204
213
|
// CLEARING IS EXPLICIT, because blank already means keep and the two cannot
|
package/dist/providers.d.ts
CHANGED
|
@@ -191,6 +191,15 @@ const saveProviderSettings = async ({ authenticated, clear, controller, settings
|
|
|
191
191
|
|
|
192
192
|
const stored = existing?.settings ? decrypt( existing.settings ) : {};
|
|
193
193
|
|
|
194
|
+
// A CREDENTIAL ARRIVES BY PASTE, and a paste from a shell line or a password
|
|
195
|
+
// manager brings wrapping quotes and whitespace with it. One stray trailing
|
|
196
|
+
// `'` on a SendGrid key turned every sign-in email into a silent 401 — no
|
|
197
|
+
// legitimate credential begins or ends with a quote or a space, so stripping
|
|
198
|
+
// them here loses nothing and ends the failure mode for every field at once.
|
|
199
|
+
const pasted = ( value ) => typeof value === 'string'
|
|
200
|
+
? value.trim().replace( /^['"]+|['"]+$/g, '' )
|
|
201
|
+
: value;
|
|
202
|
+
|
|
194
203
|
// mergeSettings is the blank-keeps rule, already used for merchant
|
|
195
204
|
// connection settings in route/organization-connection.js — same behaviour,
|
|
196
205
|
// one implementation. The declared-field allowlist is the part that is ours:
|
|
@@ -198,7 +207,7 @@ const saveProviderSettings = async ({ authenticated, clear, controller, settings
|
|
|
198
207
|
// not declare reaching the document.
|
|
199
208
|
const merged = mergeSettings({
|
|
200
209
|
existing : stored,
|
|
201
|
-
incoming : Object.fromEntries( fields.map( ( field ) => [ field.key, settings?.[ field.key ] ] ) )
|
|
210
|
+
incoming : Object.fromEntries( fields.map( ( field ) => [ field.key, pasted( settings?.[ field.key ] ) ] ) )
|
|
202
211
|
});
|
|
203
212
|
|
|
204
213
|
// CLEARING IS EXPLICIT, because blank already means keep and the two cannot
|
package/dist/providers.js
CHANGED
|
@@ -966,14 +966,14 @@ var contacts = {
|
|
|
966
966
|
|
|
967
967
|
// lib/connections/icons/drawbridge.js
|
|
968
968
|
var drawbridge_default = `<svg width="500" height="500" viewBox="0 0 500 500" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
969
|
-
<rect width="500" height="500" fill="#
|
|
969
|
+
<rect width="500" height="500" fill="#0D1314"/>
|
|
970
970
|
<g clip-path="url(#clip0_2115_2832)">
|
|
971
|
-
<path d="
|
|
972
|
-
<path d="
|
|
971
|
+
<path d="M153.198 142.241L183.69 196.065V303.852L153 357.676L184.82 375.028L220.116 313.163V186.865L185.046 125L153.198 142.241Z" fill="#BAEC5F"/>
|
|
972
|
+
<path d="M347.002 142.186L314.984 125.249L280.818 187.058V313.025L314.306 374.779L346.465 358.091L317.216 304.156V196.066L347.002 142.186Z" fill="#BAEC5F"/>
|
|
973
973
|
</g>
|
|
974
974
|
<defs>
|
|
975
975
|
<clipPath id="clip0_2115_2832">
|
|
976
|
-
<rect width="
|
|
976
|
+
<rect width="194" height="250" fill="white" transform="translate(153 125)"/>
|
|
977
977
|
</clipPath>
|
|
978
978
|
</defs>
|
|
979
979
|
</svg>`;
|
|
@@ -4696,9 +4696,10 @@ var saveProviderSettings = async ({ authenticated, clear, controller, settings,
|
|
|
4696
4696
|
query: { slug }
|
|
4697
4697
|
});
|
|
4698
4698
|
const stored = (existing == null ? void 0 : existing.settings) ? decrypt(existing.settings) : {};
|
|
4699
|
+
const pasted = (value) => typeof value === "string" ? value.trim().replace(/^['"]+|['"]+$/g, "") : value;
|
|
4699
4700
|
const merged = mergeSettings({
|
|
4700
4701
|
existing: stored,
|
|
4701
|
-
incoming: Object.fromEntries(fields2.map((field2) => [field2.key, settings == null ? void 0 : settings[field2.key]]))
|
|
4702
|
+
incoming: Object.fromEntries(fields2.map((field2) => [field2.key, pasted(settings == null ? void 0 : settings[field2.key])]))
|
|
4702
4703
|
});
|
|
4703
4704
|
for (const key of Array.isArray(clear) ? clear : []) {
|
|
4704
4705
|
if (fields2.some((field2) => field2.key === key)) delete merged[key];
|
package/package.json
CHANGED