Skip to content

Commit

Permalink
Merge pull request #88 from Nosto/ci-tests
Browse files Browse the repository at this point in the history
Include tests in CI
  • Loading branch information
timowestnosto authored Jul 22, 2024
2 parents 8784911 + 13b7be8 commit 2712282
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ jobs:

- name: Run build
run: npm run build

- name: Run tests
run: npm test
73 changes: 72 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,85 @@ export interface NostoClient {
*/
export interface Recommendation {
result_id: string
products: Product[]
products: PushedProduct[]
result_type: string
title: string
div_id: string
source_product_ids: string[]
params: unknown
}

export interface PushedProduct {
age_group?: string
alternate_image_urls: string[]
availability: string
brand?: string
category: string[]
category_id: string[]
condition?: string
custom_fields: { [index: string]: string }
date_published?: Date
description?: string
gender?: string
google_category?: string
gtin?: string
image_url?: string
inventory_level?: number
list_price?: number
name: string
parent_category_id: string[]
price: number
price_currency_code: string
product_id: string
rating_value?: number
review_count?: number
skus: PushedProductSKU[]
source_updated?: Date
supplier_cost?: number
tags1: string[]
tags2: string[]
tags3: string[]
thumb_url?: string
unit_pricing_base_measure?: number
unit_pricing_measure?: number
unit_pricing_unit?: string
update_received?: Date
url: string
variation_id?: string
variations: { [index: string]: PushedVariation }
}

export interface PushedProductSKU extends NostoSku { }

export interface PushedVariation extends NostoVariant { }


export interface NostoSku extends Sku {
inventory_level?: number
}

export interface NostoVariant {
availability: string
available: boolean
discounted: boolean
list_price?: number
price: number
price_currency_code: string
price_text?: string
}

export interface Sku {
availability: string
custom_fields: { [index: string]: string }
gtin?: string
id: string
image_url?: string
list_price?: number
name: string
price: number
url?: string
}

// copied from client script d.ts export
declare const eventTypes: readonly ["vp", "lp", "dp", "rp", "bp", "vc", "or", "is", "cp", "ec", "es", "gc", "src", "cpr", "pl", "cc", "con"]
declare type EventType = typeof eventTypes[number]
Expand Down

0 comments on commit 2712282

Please sign in to comment.