Skip to content

Commit

Permalink
feat: add ubiquiti store and dream machine model. (#3034)
Browse files Browse the repository at this point in the history
Co-authored-by: Jef LeCompte <[email protected]>
  • Loading branch information
chasdevs and jef authored Oct 20, 2022
1 parent 04fbdc1 commit 87301fe
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 1 deletion.
3 changes: 3 additions & 0 deletions dotenv-example
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
6 changes: 6 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +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': 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),
},
Expand Down Expand Up @@ -460,6 +463,9 @@ const store = {
'sf',
'sonyps5c',
'sonyps5de',
'udm-pro',
'udm-us',
'udr-us',
'xboxss',
'xboxsx',
]),
Expand Down
2 changes: 2 additions & 0 deletions src/store/model/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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],
Expand Down
9 changes: 8 additions & 1 deletion src/store/model/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ export type Brand =
| 'nvidia'
| 'palit'
| 'pny'
| 'powercolor'
| 'sapphire'
| 'sony'
| 'ubiquiti'
| 'xfx'
| 'powercolor'
| 'zotac';

export type Series =
Expand All @@ -59,6 +60,9 @@ export type Series =
| 'sonyps5c'
| 'sonyps5de'
| 'sf'
| 'udm-pro'
| 'udm-us'
| 'udr-us'
| 'xboxsx'
| 'xboxss';

Expand Down Expand Up @@ -91,6 +95,9 @@ export type Model =
| 'challenger pro'
| 'challenger pro oc'
| 'crosshair viii'
| 'dream machine'
| 'dream machine pro'
| 'dream router'
| 'dual fan'
| 'dual oc'
| 'dual'
Expand Down
44 changes: 44 additions & 0 deletions src/store/model/ubiquiti.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import {Store} from './store';

export const Ubiquiti: Store = {
currency: '$',
labels: {
inStock: [
{
container: '#titleInStockBadge',
text: ['In Stock'],
},
],
outOfStock: [
{
container: '.titleSoldOutBadge',
text: ['Sold Out'],
},
{
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',
},
{
brand: 'ubiquiti',
model: 'dream machine pro',
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',
};

0 comments on commit 87301fe

Please sign in to comment.