Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions cf-proxy/src/db/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface Accelerometer {
in_stock: number | null
is_basic: number | null
is_preferred: number | null
is_extended_promotional: number | null
lcsc: Generated<number | null>
mfr: string | null
operating_temp_max: number | null
Expand Down Expand Up @@ -86,6 +87,7 @@ export interface BatteryHolder {
in_stock: number | null
is_basic: number | null
is_preferred: number | null
is_extended_promotional: number | null
lcsc: Generated<number | null>
mfr: string | null
operating_temp_max: number | null
Expand Down Expand Up @@ -120,6 +122,7 @@ export interface BoostConverter {
input_voltage_min: number | null
is_basic: number | null
is_preferred: number | null
is_extended_promotional: number | null
is_synchronous: number | null
lcsc: Generated<number | null>
mfr: string | null
Expand All @@ -142,6 +145,7 @@ export interface BuckBoostConverter {
input_voltage_min: number | null
is_basic: number | null
is_preferred: number | null
is_extended_promotional: number | null
is_synchronous: number | null
lcsc: Generated<number | null>
mfr: string | null
Expand All @@ -166,6 +170,7 @@ export interface Capacitor {
is_basic: number | null
is_polarized: number | null
is_preferred: number | null
is_extended_promotional: number | null
is_surface_mount: number | null
lcsc: Generated<number | null>
lifetime_hours: number | null
Expand Down Expand Up @@ -233,6 +238,7 @@ export interface FpcConnector {
in_stock: number | null
is_basic: number | null
is_preferred: number | null
is_extended_promotional: number | null
lcsc: Generated<number | null>
locking_feature: string | null
mfr: string | null
Expand All @@ -249,6 +255,7 @@ export interface Fpga {
in_stock: number | null
is_basic: number | null
is_preferred: number | null
is_extended_promotional: number | null
lcsc: Generated<number | null>
logic_array_blocks: number | null
logic_elements: number | null
Expand Down Expand Up @@ -288,6 +295,7 @@ export interface GasSensor {
in_stock: number | null
is_basic: number | null
is_preferred: number | null
is_extended_promotional: number | null
lcsc: Generated<number | null>
measures_air_quality: number | null
measures_carbon_monoxide: number | null
Expand Down Expand Up @@ -317,6 +325,7 @@ export interface Gyroscope {
in_stock: number | null
is_basic: number | null
is_preferred: number | null
is_extended_promotional: number | null
lcsc: Generated<number | null>
mfr: string | null
operating_temp_max: number | null
Expand Down Expand Up @@ -386,6 +395,7 @@ export interface JstConnector {
in_stock: number | null
is_basic: number | null
is_preferred: number | null
is_extended_promotional: number | null
lcsc: Generated<number | null>
mfr: string | null
num_pins: number | null
Expand Down Expand Up @@ -421,6 +431,7 @@ export interface Ldo {
is_basic: number | null
is_positive: number | null
is_preferred: number | null
is_extended_promotional: number | null
lcsc: Generated<number | null>
mfr: string | null
operating_temp_max: number | null
Expand Down Expand Up @@ -599,6 +610,7 @@ export interface PcieM2Connector {
in_stock: number | null
is_basic: number | null
is_preferred: number | null
is_extended_promotional: number | null
is_right_angle: number | null
key: string | null
lcsc: Generated<number | null>
Expand Down Expand Up @@ -630,6 +642,7 @@ export interface Relay {
in_stock: number | null
is_basic: number | null
is_preferred: number | null
is_extended_promotional: number | null
lcsc: Generated<number | null>
max_switching_current: number | null
max_switching_voltage: number | null
Expand All @@ -649,6 +662,7 @@ export interface Resistor {
is_multi_resistor_chip: number | null
is_potentiometer: number | null
is_preferred: number | null
is_extended_promotional: number | null
is_surface_mount: number | null
lcsc: Generated<number | null>
max_overload_voltage: number | null
Expand All @@ -669,6 +683,7 @@ export interface ResistorArray {
in_stock: number | null
is_basic: number | null
is_preferred: number | null
is_extended_promotional: number | null
is_surface_mount: number | null
lcsc: Generated<number | null>
mfr: string | null
Expand All @@ -693,6 +708,7 @@ export interface Switch {
is_basic: number | null
is_latching: number | null
is_preferred: number | null
is_extended_promotional: number | null
lcsc: Generated<number | null>
length_mm: number | null
mfr: string | null
Expand All @@ -717,6 +733,7 @@ export interface UsbCConnector {
in_stock: number | null
is_basic: number | null
is_preferred: number | null
is_extended_promotional: number | null
lcsc: Generated<number | null>
mfr: string | null
mounting_style: string | null
Expand Down Expand Up @@ -789,6 +806,7 @@ export interface WireToBoardConnector {
in_stock: number | null
is_basic: number | null
is_preferred: number | null
is_extended_promotional: number | null
is_smd: number | null
lcsc: Generated<number | null>
mfr: string | null
Expand Down
8 changes: 8 additions & 0 deletions cf-proxy/src/handlers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ export const TABLE_CONFIGS: Record<string, TableConfig> = {
package: { field: "package", type: "string" },
is_basic: { field: "is_basic", type: "boolean" },
is_preferred: { field: "is_preferred", type: "boolean" },
is_extended_promotional: {
field: "is_extended_promotional",
type: "boolean",
},
resistance: { field: "resistance", type: "number_tolerance" },
},
},
Expand All @@ -117,6 +121,10 @@ export const TABLE_CONFIGS: Record<string, TableConfig> = {
package: { field: "package", type: "string" },
is_basic: { field: "is_basic", type: "boolean" },
is_preferred: { field: "is_preferred", type: "boolean" },
is_extended_promotional: {
field: "is_extended_promotional",
type: "boolean",
},
capacitance: { field: "capacitance_farads", type: "number_tolerance" },
},
},
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/accelerometer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const accelerometerTableSpec: DerivedTableSpec<Accelerometer> = {
{ name: "has_uart", type: "boolean" },
{ name: "is_basic", type: "boolean" },
{ name: "is_preferred", type: "boolean" },
{ name: "is_extended_promotional", type: "boolean" },
],
listCandidateComponents: (db) =>
db
Expand Down Expand Up @@ -102,6 +103,7 @@ export const accelerometerTableSpec: DerivedTableSpec<Accelerometer> = {
in_stock: c.stock > 0,
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: Boolean(c.extended_promotional),
package: c.package || "",
supply_voltage_min: voltageMin,
supply_voltage_max: voltageMax,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/adc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const adcTableSpec: DerivedTableSpec<Adc> = {
{ name: "operating_temp_max", type: "real" },
{ name: "is_basic", type: "boolean" },
{ name: "is_preferred", type: "boolean" },
{ name: "is_extended_promotional", type: "boolean" },
],
listCandidateComponents: (db) =>
db
Expand Down Expand Up @@ -115,6 +116,7 @@ export const adcTableSpec: DerivedTableSpec<Adc> = {
in_stock: c.stock > 0,
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: Boolean(c.extended_promotional),
package: c.package || "",
resolution_bits: resolution,
sampling_rate_hz: samplingRate,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/analog_multiplexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const analogMultiplexerTableSpec: DerivedTableSpec<AnalogMultiplexer> = {
{ name: "channel_type", type: "text" },
{ name: "is_basic", type: "boolean" },
{ name: "is_preferred", type: "boolean" },
{ name: "is_extended_promotional", type: "boolean" },
],
listCandidateComponents: (db) =>
db
Expand Down Expand Up @@ -144,6 +145,7 @@ export const analogMultiplexerTableSpec: DerivedTableSpec<AnalogMultiplexer> = {
in_stock: c.stock > 0,
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: Boolean(c.extended_promotional),
package: c.package || "",
num_channels: numChannels,
num_bits: numBits,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/battery_holder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const batteryHolderTableSpec: DerivedTableSpec<BatteryHolder> = {
{ name: "operating_temp_max", type: "real" },
{ name: "is_basic", type: "boolean" },
{ name: "is_preferred", type: "boolean" },
{ name: "is_extended_promotional", type: "boolean" },
],
listCandidateComponents(db: KyselyDatabaseInstance) {
return db
Expand Down Expand Up @@ -74,6 +75,7 @@ export const batteryHolderTableSpec: DerivedTableSpec<BatteryHolder> = {
in_stock: Boolean((c.stock || 0) > 0),
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: Boolean(c.extended_promotional),
package: String(c.package || ""),
connector_type: attrs["Connector Type"] || null,
Comment on lines 76 to 80
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new is_extended_promotional field line is mis-indented compared to the surrounding object literal. bun run format:check (Biome) will fail unless the file is formatted; please run the formatter (or fix indentation) before merging.

Copilot uses AI. Check for mistakes.
battery_type: attrs["Battery Type"] || null,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/bjt_transistor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const bjtTransistorTableSpec: DerivedTableSpec<BJTTransistor> = {
{ name: "temperature_range", type: "text" },
{ name: "is_basic", type: "boolean" },
{ name: "is_preferred", type: "boolean" },
{ name: "is_extended_promotional", type: "boolean" },
],
listCandidateComponents(db: KyselyDatabaseInstance) {
return db
Expand Down Expand Up @@ -74,6 +75,7 @@ export const bjtTransistorTableSpec: DerivedTableSpec<BJTTransistor> = {
in_stock: Boolean((c.stock || 0) > 0),
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: Boolean(c.extended_promotional),
package: c.package || "",
current_gain: current_gain,
Comment on lines 75 to 80
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new is_extended_promotional field line is mis-indented relative to the surrounding return object. Biome formatting check will fail unless the file is formatted; please run bun run format (or fix indentation) before merging.

Copilot uses AI. Check for mistakes.
collector_current: collector_current,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/boost_converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const boostConverterTableSpec: DerivedTableSpec<BoostConverter> = {
{ name: "number_of_outputs", type: "integer" },
{ name: "is_basic", type: "boolean" },
{ name: "is_preferred", type: "boolean" },
{ name: "is_extended_promotional", type: "boolean" },
],
listCandidateComponents: (db) =>
db
Expand Down Expand Up @@ -117,6 +118,7 @@ export const boostConverterTableSpec: DerivedTableSpec<BoostConverter> = {
in_stock: c.stock > 0,
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: Boolean(c.extended_promotional),
package: c.package || "",
input_voltage_min: inputMin,
Comment on lines 119 to 123
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inserted is_extended_promotional property is mis-indented in this returned object. This will trip bun run format:check (Biome); please run the formatter or correct indentation.

Copilot uses AI. Check for mistakes.
input_voltage_max: inputMax,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/buck_boost_converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const buckBoostConverterTableSpec: DerivedTableSpec<BuckBoostConverter> =
{ name: "number_of_outputs", type: "integer" },
{ name: "is_basic", type: "boolean" },
{ name: "is_preferred", type: "boolean" },
{ name: "is_extended_promotional", type: "boolean" },
],
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The newly added is_extended_promotional entry in extraColumns is mis-indented, which will cause bun run format:check (Biome) to fail. Please format this file (or fix indentation) before merging.

Suggested change
],
],

Copilot uses AI. Check for mistakes.
listCandidateComponents: (db) =>
db
Expand Down Expand Up @@ -121,6 +122,7 @@ export const buckBoostConverterTableSpec: DerivedTableSpec<BuckBoostConverter> =
in_stock: c.stock > 0,
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: Boolean(c.extended_promotional),
package: c.package || "",
input_voltage_min: inputMin,
input_voltage_max: inputMax,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/capacitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const capacitorTableSpec: DerivedTableSpec<Capacitor> = {
{ name: "capacitor_type", type: "text" },
{ name: "is_basic", type: "boolean" },
{ name: "is_preferred", type: "boolean" },
{ name: "is_extended_promotional", type: "boolean" },
],
listCandidateComponents: (db) =>
db
Expand Down Expand Up @@ -115,6 +116,7 @@ export const capacitorTableSpec: DerivedTableSpec<Capacitor> = {
in_stock: c.stock > 0,
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: Boolean(c.extended_promotional),
capacitance_farads: capacitance,
tolerance_fraction: tolerance,
voltage_rating: voltage,
Expand Down
1 change: 1 addition & 0 deletions lib/db/derivedtables/component-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ export interface BaseComponent {
in_stock: boolean
is_basic: boolean
is_preferred: boolean
is_extended_promotional: boolean
attributes: Record<string, string>
}
2 changes: 2 additions & 0 deletions lib/db/derivedtables/dac.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const dacTableSpec: DerivedTableSpec<Dac> = {
{ name: "nonlinearity_lsb", type: "real" },
{ name: "is_basic", type: "boolean" },
{ name: "is_preferred", type: "boolean" },
{ name: "is_extended_promotional", type: "boolean" },
],
listCandidateComponents: (db) =>
db
Expand Down Expand Up @@ -129,6 +130,7 @@ export const dacTableSpec: DerivedTableSpec<Dac> = {
in_stock: c.stock > 0,
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: Boolean(c.extended_promotional),
package: c.package || "",
resolution_bits: resolution,
num_channels: numChannels,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/diode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const diodeTableSpec: DerivedTableSpec<Diode> = {
{ name: "configuration", type: "text" },
{ name: "is_basic", type: "boolean" },
{ name: "is_preferred", type: "boolean" },
{ name: "is_extended_promotional", type: "boolean" },
],
listCandidateComponents: (db) =>
db
Expand Down Expand Up @@ -159,6 +160,7 @@ export const diodeTableSpec: DerivedTableSpec<Diode> = {
in_stock: c.stock > 0,
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: Boolean(c.extended_promotional),
package: c.package || "",
forward_voltage: forwardVoltage,
reverse_voltage: reverseVoltage,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/fpc_connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const fpcConnectorTableSpec: DerivedTableSpec<FpcConnector> = {
{ name: "locking_feature", type: "text" },
{ name: "is_basic", type: "boolean" },
{ name: "is_preferred", type: "boolean" },
{ name: "is_extended_promotional", type: "boolean" },
],
listCandidateComponents(db: KyselyDatabaseInstance) {
return db
Expand Down Expand Up @@ -55,6 +56,7 @@ export const fpcConnectorTableSpec: DerivedTableSpec<FpcConnector> = {
in_stock: Boolean((c.stock || 0) > 0),
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: Boolean(c.extended_promotional),
pitch_mm: parseNum(attrs["Pitch"]),
number_of_contacts: isNaN(contacts) ? null : contacts,
contact_type: attrs["Contact Type"] || null,
Comment on lines 57 to 62
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inserted is_extended_promotional line in the returned object is mis-indented vs surrounding fields. This will fail the repo’s Biome format check; please run the formatter or fix indentation.

Copilot uses AI. Check for mistakes.
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/fpga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const fpgaTableSpec: DerivedTableSpec<FPGA> = {
{ name: "logic_gates", type: "real" },
{ name: "is_basic", type: "boolean" },
{ name: "is_preferred", type: "boolean" },
{ name: "is_extended_promotional", type: "boolean" },
],
listCandidateComponents: (db) =>
db
Expand Down Expand Up @@ -99,6 +100,7 @@ export const fpgaTableSpec: DerivedTableSpec<FPGA> = {
in_stock: Boolean((c.stock ?? 0) > 0),
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: Boolean(c.extended_promotional),
package: extra?.package ?? c.package ?? "",
type: attrs["Type"] ?? null,
Comment on lines 101 to 105
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The added is_extended_promotional property is mis-indented in the returned object literal. This should be formatted to satisfy bun run format:check (Biome).

Copilot uses AI. Check for mistakes.
logic_array_blocks: parseNumericValue(attrs["Logic Array Blocks"]),
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/fuse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const fuseTableSpec: DerivedTableSpec<Fuse> = {
{ name: "is_resettable", type: "boolean" },
{ name: "is_basic", type: "boolean" },
{ name: "is_preferred", type: "boolean" },
{ name: "is_extended_promotional", type: "boolean" },
],
listCandidateComponents(db: KyselyDatabaseInstance) {
return db
Expand Down Expand Up @@ -90,6 +91,7 @@ export const fuseTableSpec: DerivedTableSpec<Fuse> = {
in_stock: Boolean((c.stock || 0) > 0),
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: Boolean(c.extended_promotional),
current_rating: current_rating as number,
voltage_rating: voltage_rating as number,
response_time,
Comment on lines 92 to 97
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new is_extended_promotional line in this return object is mis-indented. Please run Biome formatting (or fix indentation) so bun run format:check passes.

Copilot uses AI. Check for mistakes.
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/gas_sensor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const gasSensorTableSpec: DerivedTableSpec<GasSensor> = {
{ name: "measures_explosive_gases", type: "boolean" },
{ name: "is_basic", type: "boolean" },
{ name: "is_preferred", type: "boolean" },
{ name: "is_extended_promotional", type: "boolean" },
],
listCandidateComponents(db) {
return db
Expand Down Expand Up @@ -82,6 +83,7 @@ export const gasSensorTableSpec: DerivedTableSpec<GasSensor> = {
in_stock: c.stock > 0,
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: Boolean(c.extended_promotional),
package: c.package || "",
sensor_type: sensorType,
measures_air_quality: measuresAirQuality,
Expand Down
Loading
Loading