From 45f55ace55ac1624eeceb2ee2f35b4b01398487a Mon Sep 17 00:00:00 2001 From: Chas DeVeas Date: Sun, 18 Sep 2022 13:11:02 -0400 Subject: [PATCH 1/6] Add ubiquiti and dream machine. --- src/config.ts | 2 ++ src/store/model/index.ts | 2 ++ src/store/model/store.ts | 5 ++++- src/store/model/ubiquiti.ts | 26 ++++++++++++++++++++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 src/store/model/ubiquiti.ts diff --git a/src/config.ts b/src/config.ts index a46f7fe5cb..c9a7ffd408 100644 --- a/src/config.ts +++ b/src/config.ts @@ -428,6 +428,7 @@ const store = { sonyps5c: envOrNumber(process.env.MAX_PRICE_SERIES_SONYPS5C), sonyps5de: envOrNumber(process.env.MAX_PRICE_SERIES_SONYPS5DE), 'test:series': envOrNumber(process.env.MAX_PRICE_SERIES_TEST), + 'udm-us': -1, xboxss: envOrNumber(process.env.MAX_PRICE_SERIES_XBOXSS), xboxsx: envOrNumber(process.env.MAX_PRICE_SERIES_XBOXSX), }, @@ -460,6 +461,7 @@ const store = { 'sf', 'sonyps5c', 'sonyps5de', + 'udm-us', 'xboxss', 'xboxsx', ]), diff --git a/src/store/model/index.ts b/src/store/model/index.ts index 08a65a9768..f7a653fe8b 100644 --- a/src/store/model/index.ts +++ b/src/store/model/index.ts @@ -154,6 +154,7 @@ import {TescoIE} from './tesco-ie'; import {TheWarehouse} from './thewarehouse'; import {TopAchat} from './topachat'; import {ToysRUs} from './toysrus'; +import {Ubiquiti} from './ubiquiti'; import {Umart} from './umart'; import {Unieuro} from './unieuro'; import {Very} from './very'; @@ -328,6 +329,7 @@ export const storeList = new Map([ [TopAchat.name, TopAchat], [ToysRUs.name, ToysRUs], [Umart.name, Umart], + [Ubiquiti.name, Ubiquiti], [Unieuro.name, Unieuro], [UltimaInformatica.name, UltimaInformatica], [Very.name, Very], diff --git a/src/store/model/store.ts b/src/store/model/store.ts index c23820062c..3b4cf5330a 100644 --- a/src/store/model/store.ts +++ b/src/store/model/store.ts @@ -30,10 +30,11 @@ export type Brand = | 'nvidia' | 'palit' | 'pny' + | 'powercolor' | 'sapphire' | 'sony' + | 'ubiquiti' | 'xfx' - | 'powercolor' | 'zotac'; export type Series = @@ -59,6 +60,7 @@ export type Series = | 'sonyps5c' | 'sonyps5de' | 'sf' + | 'udm-us' | 'xboxsx' | 'xboxss'; @@ -91,6 +93,7 @@ export type Model = | 'challenger pro' | 'challenger pro oc' | 'crosshair viii' + | 'dream machine' | 'dual fan' | 'dual oc' | 'dual' diff --git a/src/store/model/ubiquiti.ts b/src/store/model/ubiquiti.ts new file mode 100644 index 0000000000..ac4b66623b --- /dev/null +++ b/src/store/model/ubiquiti.ts @@ -0,0 +1,26 @@ +import {Store} from './store'; + +export const Ubiquiti: Store = { + currency: '$', + labels: { + inStock: { + container: '.titleInStockBadge', + text: ['In Stock'], + }, + outOfStock: [ + { + container: '.titleSoldOutBadge', + text: ['Sold Out'], + }, + ], + }, + links: [ + { + brand: 'ubiquiti', + model: 'dream machine', + series: 'udm-us', + url: 'https://store.ui.com/collections/unifi-network-unifi-os-consoles/products/udm-us', + }, + ], + name: 'ubiquiti', +}; From 191f16f89ff35692ecb513ae2d945f24c1bac378 Mon Sep 17 00:00:00 2001 From: Chas DeVeas Date: Sun, 18 Sep 2022 17:03:37 -0400 Subject: [PATCH 2/6] Add udm-pro. --- src/config.ts | 2 ++ src/store/model/store.ts | 2 ++ src/store/model/ubiquiti.ts | 16 ++++++++++++---- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/config.ts b/src/config.ts index c9a7ffd408..8a588b3769 100644 --- a/src/config.ts +++ b/src/config.ts @@ -428,6 +428,7 @@ const store = { sonyps5c: envOrNumber(process.env.MAX_PRICE_SERIES_SONYPS5C), sonyps5de: envOrNumber(process.env.MAX_PRICE_SERIES_SONYPS5DE), 'test:series': envOrNumber(process.env.MAX_PRICE_SERIES_TEST), + 'udm-pro': -1, 'udm-us': -1, xboxss: envOrNumber(process.env.MAX_PRICE_SERIES_XBOXSS), xboxsx: envOrNumber(process.env.MAX_PRICE_SERIES_XBOXSX), @@ -461,6 +462,7 @@ const store = { 'sf', 'sonyps5c', 'sonyps5de', + 'udm-pro', 'udm-us', 'xboxss', 'xboxsx', diff --git a/src/store/model/store.ts b/src/store/model/store.ts index 3b4cf5330a..4f89983650 100644 --- a/src/store/model/store.ts +++ b/src/store/model/store.ts @@ -60,6 +60,7 @@ export type Series = | 'sonyps5c' | 'sonyps5de' | 'sf' + | 'udm-pro' | 'udm-us' | 'xboxsx' | 'xboxss'; @@ -94,6 +95,7 @@ export type Model = | 'challenger pro oc' | 'crosshair viii' | 'dream machine' + | 'dream machine pro' | 'dual fan' | 'dual oc' | 'dual' diff --git a/src/store/model/ubiquiti.ts b/src/store/model/ubiquiti.ts index ac4b66623b..c461a92635 100644 --- a/src/store/model/ubiquiti.ts +++ b/src/store/model/ubiquiti.ts @@ -3,10 +3,12 @@ import {Store} from './store'; export const Ubiquiti: Store = { currency: '$', labels: { - inStock: { - container: '.titleInStockBadge', - text: ['In Stock'], - }, + inStock: [ + { + container: '#titleInStockBadge', + text: ['In Stock'], + } + ], outOfStock: [ { container: '.titleSoldOutBadge', @@ -21,6 +23,12 @@ export const Ubiquiti: Store = { series: 'udm-us', url: 'https://store.ui.com/collections/unifi-network-unifi-os-consoles/products/udm-us', }, + { + brand: 'ubiquiti', + model: 'dream machine pro', + series: 'udm-pro', + url: 'https://store.ui.com/collections/unifi-network-unifi-os-consoles/products/udm-pro', + }, ], name: 'ubiquiti', }; From b65a74fd60b84236b66685d58c757b0c846a50e2 Mon Sep 17 00:00:00 2001 From: Chas DeVeas Date: Sun, 25 Sep 2022 15:46:24 -0400 Subject: [PATCH 3/6] Add dream router. --- src/config.ts | 2 ++ src/store/model/store.ts | 2 ++ src/store/model/ubiquiti.ts | 10 ++++++++++ 3 files changed, 14 insertions(+) diff --git a/src/config.ts b/src/config.ts index 8a588b3769..290bcb982e 100644 --- a/src/config.ts +++ b/src/config.ts @@ -430,6 +430,7 @@ const store = { 'test:series': envOrNumber(process.env.MAX_PRICE_SERIES_TEST), 'udm-pro': -1, 'udm-us': -1, + 'udr-us': -1, xboxss: envOrNumber(process.env.MAX_PRICE_SERIES_XBOXSS), xboxsx: envOrNumber(process.env.MAX_PRICE_SERIES_XBOXSX), }, @@ -464,6 +465,7 @@ const store = { 'sonyps5de', 'udm-pro', 'udm-us', + 'udr-us', 'xboxss', 'xboxsx', ]), diff --git a/src/store/model/store.ts b/src/store/model/store.ts index 4f89983650..2975567d3f 100644 --- a/src/store/model/store.ts +++ b/src/store/model/store.ts @@ -62,6 +62,7 @@ export type Series = | 'sf' | 'udm-pro' | 'udm-us' + | 'udr-us' | 'xboxsx' | 'xboxss'; @@ -96,6 +97,7 @@ export type Model = | 'crosshair viii' | 'dream machine' | 'dream machine pro' + | 'dream router' | 'dual fan' | 'dual oc' | 'dual' diff --git a/src/store/model/ubiquiti.ts b/src/store/model/ubiquiti.ts index c461a92635..70272e9974 100644 --- a/src/store/model/ubiquiti.ts +++ b/src/store/model/ubiquiti.ts @@ -14,6 +14,10 @@ export const Ubiquiti: Store = { container: '.titleSoldOutBadge', text: ['Sold Out'], }, + { + container: '#titleSoldOutBadge', + text: ['Sold Out'], + }, ], }, links: [ @@ -29,6 +33,12 @@ export const Ubiquiti: Store = { series: 'udm-pro', url: 'https://store.ui.com/collections/unifi-network-unifi-os-consoles/products/udm-pro', }, + { + brand: 'ubiquiti', + model: 'dream router', + series: 'udr-us', + url: 'https://store.ui.com/collections/unifi-network-unifi-os-consoles/products/dream-router', + }, ], name: 'ubiquiti', }; From d48d72041f29e9e29f51479379464145262c3fc6 Mon Sep 17 00:00:00 2001 From: Jef LeCompte Date: Thu, 20 Oct 2022 15:19:21 -0700 Subject: [PATCH 4/6] chore: use env vars for max prices --- src/config.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/config.ts b/src/config.ts index 290bcb982e..c862ce9bd9 100644 --- a/src/config.ts +++ b/src/config.ts @@ -428,9 +428,9 @@ const store = { sonyps5c: envOrNumber(process.env.MAX_PRICE_SERIES_SONYPS5C), sonyps5de: envOrNumber(process.env.MAX_PRICE_SERIES_SONYPS5DE), 'test:series': envOrNumber(process.env.MAX_PRICE_SERIES_TEST), - 'udm-pro': -1, - 'udm-us': -1, - 'udr-us': -1, + 'udm-pro': envOrNumber(process.env.MAX_PRICE_SERIES_UDM_PRO), + 'udm-us': envOrNumber(process.env.MAX_PRICE_SERIES_UDM_US), + 'udr-us': envOrNumber(process.env.MAX_PRICE_SERIES_UDR_US), xboxss: envOrNumber(process.env.MAX_PRICE_SERIES_XBOXSS), xboxsx: envOrNumber(process.env.MAX_PRICE_SERIES_XBOXSX), }, From a378fc17b9ee20f56fb6ec4733219688422bc2ed Mon Sep 17 00:00:00 2001 From: Jef LeCompte Date: Thu, 20 Oct 2022 15:20:13 -0700 Subject: [PATCH 5/6] chore: add example in dotenv --- dotenv-example | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dotenv-example b/dotenv-example index f19d598ecb..9f3ca6c410 100644 --- a/dotenv-example +++ b/dotenv-example @@ -73,6 +73,9 @@ MAX_PRICE_SERIES_SONYPS5DE= MAX_PRICE_SERIES_XBOXSS= MAX_PRICE_SERIES_XBOXSX= MAX_PRICE_SERIES_TEST= +MAX_PRICE_SERIES_UDM_PRO= +MAX_PRICE_SERIES_UDM_US= +MAX_PRICE_SERIES_UDR_US= MICROCENTER_LOCATION= MQTT_BROKER_ADDRESS= MQTT_BROKER_PORT= From d3c59f089e2bf2b188e5ef547d8e9cec6062504d Mon Sep 17 00:00:00 2001 From: Jef LeCompte Date: Thu, 20 Oct 2022 15:26:09 -0700 Subject: [PATCH 6/6] style: linting --- src/store/model/ubiquiti.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/model/ubiquiti.ts b/src/store/model/ubiquiti.ts index 70272e9974..57d0c83974 100644 --- a/src/store/model/ubiquiti.ts +++ b/src/store/model/ubiquiti.ts @@ -7,7 +7,7 @@ export const Ubiquiti: Store = { { container: '#titleInStockBadge', text: ['In Stock'], - } + }, ], outOfStock: [ {