From 67b0eab89dbeff800e1c3090592294d0e6d67827 Mon Sep 17 00:00:00 2001 From: Thomas Raffray Date: Mon, 15 Apr 2024 10:23:27 +0200 Subject: [PATCH] feat(specs): update shopify source and task inputs (#2987) --- specs/ingestion/common/schemas/source.yml | 71 +++++++++++++++++++++++ specs/ingestion/common/schemas/task.yml | 55 ++++++++++++++++++ 2 files changed, 126 insertions(+) diff --git a/specs/ingestion/common/schemas/source.yml b/specs/ingestion/common/schemas/source.yml index 24fa87cc19..2e9e8a5a37 100644 --- a/specs/ingestion/common/schemas/source.yml +++ b/specs/ingestion/common/schemas/source.yml @@ -414,6 +414,7 @@ SourceInput: - $ref: '#/SourceBigQuery' - $ref: '#/SourceGA4BigQueryExport' - $ref: '#/SourceDocker' + - $ref: '#/SourceShopify' SourceUpdateCommercetools: type: object @@ -449,7 +450,77 @@ SourceUpdateInput: - $ref: '#/SourceBigQuery' - $ref: '#/SourceGA4BigQueryExport' - $ref: '#/SourceUpdateDocker' + - $ref: '#/SourceUpdateShopify' DockerSourceStream: type: object description: Stream definition (see the Singer specification for details). + +SourceUpdateShopify: + title: Shopify + type: object + additionalProperties: false + properties: + collectionIDIndexing: + type: boolean + default: false + description: | + Whether to index collection IDs. + + If your store has `has_collection_search_page` set to true, + collection IDs will be indexed even if `collectionIDIndexing` is false. + increaseProductCollectionLimit: + type: boolean + default: false + description: | + Whether to increase the number of indexed collections per product. + If true, Algolia indexes 200 collections per product. + If false, 100 collections per product are indexed. + defaultPriceRatioAsOne: + type: boolean + default: true + description: | + Whether to set the default price ratio to 1 if no sale price is present. + + The price ratio is determined by the ratio: `sale_price` / `regular_price`. + If no sale price is present, the price ratio would be 0. + If `defaultPriceRatioAsOne` is true, the price ratio is indexed as 1 instead. + excludeOOSVariantsForPriceAtTRS: + type: boolean + default: true + description: | + Whether to exclude out-of-stock variants when determining the `max_variant_price` and `min_variant_price` attributes. + includeVariantsInventory: + type: boolean + default: true + description: | + Whether to include an inventory with every variant for every product record. + hasCollectionSearchPage: + type: boolean + default: false + description: | + Whether to include collection IDs and handles in the product records. + productNamedTags: + type: boolean + default: false + description: | + Whether to convert tags on products to named tags. + + To learn more, see [Named tags](https://www.algolia.com/doc/integration/shopify/sending-and-managing-data/named-tags). + +SourceShopify: + allOf: + - $ref: '#/SourceUpdateShopify' + - $ref: '#/sourceShopifyBase' + +sourceShopifyBase: + type: object + additionalProperties: false + properties: + shopURL: + type: string + description: URL of the Shopify store. + required: + - shopURL + x-discriminator-fields: + - shopURL diff --git a/specs/ingestion/common/schemas/task.yml b/specs/ingestion/common/schemas/task.yml index 8f8ea4f869..fc1f8ec568 100644 --- a/specs/ingestion/common/schemas/task.yml +++ b/specs/ingestion/common/schemas/task.yml @@ -145,6 +145,7 @@ TaskInput: - $ref: '#/OnDemandDateUtilsInput' - $ref: '#/ScheduleDateUtilsInput' - $ref: '#/StreamingUtilsInput' + - $ref: '#/ShopifyInput' TriggerInput: type: object @@ -410,3 +411,57 @@ failureThreshold: minimum: 0 maximum: 100 description: Maximum accepted percentage of failures for a task run to finish successfully. + +ShopifyInput: + title: Shopify input + type: object + additionalProperties: false + description: Represents the required elements of the task input when using a `shopify` source. + properties: + metafields: + type: array + items: + $ref: '#/ShopifyMetafield' + market: + $ref: '#/ShopifyMarket' + required: + - metafields + - market + +ShopifyMetafield: + type: object + additionalProperties: false + description: Represents a metafield in Shopify. + properties: + namespace: + type: string + key: + type: string + value: + type: string + required: + - namespace + - key + - value + +ShopifyMarket: + type: object + additionalProperties: false + description: Represents a market in Shopify. + properties: + countries: + type: array + items: + type: string + currencies: + type: array + items: + type: string + locales: + type: array + items: + type: string + required: + - countries + - currencies + - locales