-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- adding cart-discounts stream - adding helper script for refreshing catalog and schemas with some basic checks.
- Loading branch information
1 parent
6decd17
commit 996c81a
Showing
4 changed files
with
296 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
226 changes: 226 additions & 0 deletions
226
...grations/connectors/source-commercetools/source_commercetools/schemas/cart-discounts.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,226 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"additionalProperties": true, | ||
"properties": { | ||
"cartPredicate": { | ||
"type": "string" | ||
}, | ||
"createdAt": { | ||
"type": "string" | ||
}, | ||
"createdBy": { | ||
"additionalProperties": true, | ||
"properties": { | ||
"clientId": { | ||
"type": "string" | ||
}, | ||
"isPlatformClient": { | ||
"type": "boolean" | ||
}, | ||
"user": { | ||
"additionalProperties": true, | ||
"properties": { | ||
"id": { | ||
"type": "string" | ||
}, | ||
"typeId": { | ||
"type": "string" | ||
} | ||
}, | ||
"type": "object" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"description": { | ||
"additionalProperties": true, | ||
"properties": { | ||
"en-CA": { | ||
"type": "string" | ||
}, | ||
"en-US": { | ||
"type": "string" | ||
}, | ||
"es-MX": { | ||
"type": "string" | ||
}, | ||
"fr-CA": { | ||
"type": "string" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"id": { | ||
"type": "string" | ||
}, | ||
"isActive": { | ||
"type": "boolean" | ||
}, | ||
"key": { | ||
"type": "string" | ||
}, | ||
"lastMessageSequenceNumber": { | ||
"type": "integer" | ||
}, | ||
"lastModifiedAt": { | ||
"type": "string" | ||
}, | ||
"lastModifiedBy": { | ||
"additionalProperties": true, | ||
"properties": { | ||
"clientId": { | ||
"type": "string" | ||
}, | ||
"isPlatformClient": { | ||
"type": "boolean" | ||
}, | ||
"user": { | ||
"additionalProperties": true, | ||
"properties": { | ||
"id": { | ||
"type": "string" | ||
}, | ||
"typeId": { | ||
"type": "string" | ||
} | ||
}, | ||
"type": "object" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"name": { | ||
"additionalProperties": true, | ||
"properties": { | ||
"en-CA": { | ||
"type": "string" | ||
}, | ||
"en-US": { | ||
"type": "string" | ||
}, | ||
"es-MX": { | ||
"type": "string" | ||
}, | ||
"fr-CA": { | ||
"type": "string" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"references": { | ||
"type": "array" | ||
}, | ||
"requiresDiscountCode": { | ||
"type": "boolean" | ||
}, | ||
"sortOrder": { | ||
"type": "string" | ||
}, | ||
"stackingMode": { | ||
"type": "string" | ||
}, | ||
"stores": { | ||
"items": { | ||
"additionalProperties": true, | ||
"properties": { | ||
"key": { | ||
"type": "string" | ||
}, | ||
"typeId": { | ||
"type": "string" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"type": "array" | ||
}, | ||
"target": { | ||
"additionalProperties": true, | ||
"properties": { | ||
"predicate": { | ||
"type": "string" | ||
}, | ||
"type": { | ||
"type": "string" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"validFrom": { | ||
"type": "string" | ||
}, | ||
"validUntil": { | ||
"type": "string" | ||
}, | ||
"value": { | ||
"additionalProperties": true, | ||
"properties": { | ||
"applicationMode": { | ||
"type": "string" | ||
}, | ||
"money": { | ||
"items": { | ||
"additionalProperties": true, | ||
"properties": { | ||
"centAmount": { | ||
"type": "integer" | ||
}, | ||
"currencyCode": { | ||
"type": "string" | ||
}, | ||
"fractionDigits": { | ||
"type": "integer" | ||
}, | ||
"type": { | ||
"type": "string" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"type": "array" | ||
}, | ||
"permyriad": { | ||
"type": "integer" | ||
}, | ||
"product": { | ||
"additionalProperties": true, | ||
"properties": { | ||
"id": { | ||
"type": "string" | ||
}, | ||
"typeId": { | ||
"type": "string" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"supplyChannel": { | ||
"additionalProperties": true, | ||
"properties": { | ||
"id": { | ||
"type": "string" | ||
}, | ||
"typeId": { | ||
"type": "string" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"type": { | ||
"type": "string" | ||
}, | ||
"variantId": { | ||
"type": "integer" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"version": { | ||
"type": "integer" | ||
}, | ||
"versionModifiedAt": { | ||
"type": "string" | ||
} | ||
}, | ||
"type": "object" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env bash | ||
|
||
which schema_generator > /dev/null | ||
if [ $? != 0 ];then | ||
echo "schema_generator is not installed. See https://github.com/airbytehq/airbyte/tree/master/tools/schema_generator/ for installation instructions" | ||
fi | ||
root=$(git rev-parse --show-toplevel 2>> /dev/null) | ||
source=$1 | ||
airbyte_config=$2 | ||
source_root="${root}/airbyte-integrations/connectors/source-${source}" | ||
if [ ! --d "${source_root}" ];then | ||
echo "Invalid source specified . Source folder not found at ${source_root}" | ||
exit 1 | ||
fi | ||
|
||
if [ -z "${airbyte_config}" ];then | ||
echo "airbyte config must be provided" | ||
exit 1 | ||
fi | ||
if [ ! -f "${airbyte_config}" ];then | ||
echo "${airbyte_config} is not a valid path" | ||
exit 1 | ||
fi | ||
pushd $PWD > /dev/null | ||
cd $source_root | ||
echo "refreshing catalog for source" | ||
python main.py discover --config $airbyte_config | schema_generator --configure-catalog | ||
|
||
|
||
echo "refreshing schemas for source. (note: This is fetching live data using the provided credentials. it may take a while." | ||
cd source_commercetools | ||
python ../main.py read --config $airbyte_config --catalog ../integration_tests/configured_catalog.json | schema_generator --infer-schemas | ||
echo "Finished refreshing schemas. NOTE: Some schemas have been tweaked and standardized by hand. You probably only want to check in the new schema for the no stream that was added." | ||
echo "$source_root/integration_tests/configured_catalog.json should be checked in along with any new schemas found at $source_root/source_${source}/schemas/" | ||
popd > /dev/null |