-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add vector standard schema #149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
3c7a474
feat: add ivs schema
63728f5
fix: require db
4092180
fix: add db type to schema
bd09eb5
chore: add spacing
eyalr1100 d600d37
feat: add schemas for all packages
eyalr1100 c0b5366
fix: fix id in schemas
eyalr1100 0230482
feat: add cron variable to synchronizer
eyalr1100 0e647c6
fix: make schedule work with right
eyalr1100 358239f
fix: require schedule
eyalr1100 ad9b75a
feat: add index name format
eyalr1100 b561bc1
feat: add actual env variables for both dest and source db
eyalr1100 397bc09
chore: change name to vector standard
eyalr1100 9330739
fix: fix db config names
eyalr1100 8bda453
fix: copy ssl correctly
eyalr1100 d490393
fix: fix env var in synchronizer index
eyalr1100 732b9eb
feat: add enrichment settings
511a479
feat: add s3 config
eyalr1100 5b1a764
feat: configure lua file variable
eyalr1100 6cc3906
feat: add layers file path
eyalr1100 af0ef4c
feat: add aliases file path
eyalr1100 aa83dd9
feat: require files path
eyalr1100 022a967
Merge remote-tracking branch 'origin/master' into feat/create-ivs-api…
eyalr1100 16e57b6
feat: make db ca optional
eyalr1100 b8abd62
feat: make enrichment required
07a4942
Merge remote-tracking branch 'origin/master' into feat/create-ivs-api…
eyalr1100 6aa12a5
chore: fix description
eyalr1100 989c2d5
chore: remove dead schema definition
eyalr1100 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,40 @@ | ||
| { | ||
| "$id": "https://mapcolonies.com/vector/vectorStandard/api/v1", | ||
| "type": "object", | ||
| "title": "vectorStandardApiSchemaV1", | ||
| "description": "Vector's standard API schema", | ||
| "allOf": [ | ||
| { | ||
| "$ref": "https://mapcolonies.com/common/boilerplate/v2" | ||
| }, | ||
| { | ||
| "$ref": "#/definitions/databases" | ||
| } | ||
| ], | ||
| "definitions": { | ||
| "databases": { | ||
| "type": "object", | ||
| "required": ["db"], | ||
| "properties": { | ||
| "db": { | ||
| "allOf": [ | ||
| { | ||
| "$ref": "https://mapcolonies.com/common/db/full/v3" | ||
| }, | ||
| { | ||
| "type": "object", | ||
| "properties": { | ||
| "type": { | ||
| "type": "string", | ||
| "x-env-value": "DB_TYPE", | ||
| "default": "postgres" | ||
| } | ||
| }, | ||
| "required": ["type"] | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or 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,37 @@ | ||
| { | ||
| "$id": "https://mapcolonies.com/vector/vectorStandard/common/v1", | ||
| "type": "object", | ||
| "title": "vectorStandardCommonSchemaV1", | ||
| "description": "Vector's standard common DB schema", | ||
| "allOf": [ | ||
| { | ||
| "$ref": "#/definitions/databases" | ||
| } | ||
| ], | ||
|
Powfu2 marked this conversation as resolved.
|
||
| "definitions": { | ||
| "databases": { | ||
| "type": "object", | ||
| "required": ["db"], | ||
| "properties": { | ||
| "db": { | ||
| "allOf": [ | ||
| { | ||
| "$ref": "https://mapcolonies.com/common/db/full/v3" | ||
| }, | ||
| { | ||
| "type": "object", | ||
| "properties": { | ||
| "type": { | ||
| "type": "string", | ||
| "x-env-value": "DB_TYPE", | ||
| "default": "postgres" | ||
| } | ||
| }, | ||
| "required": ["type"] | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
Powfu2 marked this conversation as resolved.
|
||
247 changes: 247 additions & 0 deletions
247
schemas/vector/vectorStandard/synchronizer/v1.schema.json
This file contains hidden or 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,247 @@ | ||
| { | ||
| "$id": "https://mapcolonies.com/vector/vectorStandard/synchronizer/v1", | ||
| "type": "object", | ||
| "title": "vectorStandardSynchronizerSchemaV1", | ||
| "description": "Vector's standard synchronizer schema", | ||
| "allOf": [ | ||
| { "$ref": "https://mapcolonies.com/common/boilerplate/v2" }, | ||
| { | ||
| "type": "object", | ||
| "required": ["dbs", "schedule", "enrichment"], | ||
| "properties": { | ||
| "dbs": { | ||
| "type": "object", | ||
| "required": ["source", "destination", "s3"], | ||
| "properties": { | ||
| "source": { "$ref": "#/definitions/sourceDb" }, | ||
| "destination": { "$ref": "#/definitions/destinationDb" }, | ||
| "s3": { "$ref": "#/definitions/s3" } | ||
| } | ||
| }, | ||
| "schedule": { "$ref": "#/definitions/schedule" }, | ||
| "indexNameFormat": { "$ref": "#/definitions/indexNameFormat" }, | ||
| "layersFile": { "$ref": "#/definitions/layersFile" }, | ||
| "aliasesFile": { "$ref": "#/definitions/aliasesFile" }, | ||
| "enrichment": { "$ref": "#/definitions/enrichment" } | ||
| } | ||
| } | ||
| ], | ||
| "definitions": { | ||
| "sourceDb": { | ||
| "type": "object", | ||
| "required": ["database", "ssl", "type"], | ||
| "properties": { | ||
| "host": { "type": "string", "description": "the host of the database", "default": "localhost", "x-env-value": "SOURCE_DB_HOST" }, | ||
| "port": { "type": "integer", "description": "the port of the database", "default": 5432, "x-env-value": "SOURCE_DB_PORT" }, | ||
| "username": { | ||
| "type": "string", | ||
| "description": "the username of the database", | ||
| "default": "postgres", | ||
| "maxLength": 63, | ||
| "x-env-value": "SOURCE_DB_USERNAME" | ||
| }, | ||
| "password": { "type": "string", "description": "the password of the database", "default": "postgres", "x-env-value": "SOURCE_DB_PASSWORD" }, | ||
| "schema": { "type": "string", "description": "the schema name of the database", "default": "public", "x-env-value": "SOURCE_DB_SCHEMA" }, | ||
| "database": { "type": "string", "description": "the database name", "maxLength": 63, "x-env-value": "SOURCE_DB_NAME" }, | ||
| "type": { "type": "string", "description": "the type of the database", "default": "postgres", "x-env-value": "SOURCE_DB_TYPE" }, | ||
| "ssl": { | ||
| "type": "object", | ||
| "description": "ssl configuration", | ||
| "properties": { | ||
| "enabled": { | ||
| "type": "boolean", | ||
| "description": "enable ssl", | ||
| "default": false, | ||
| "x-env-value": "SOURCE_DB_ENABLE_SSL_AUTH" | ||
| }, | ||
| "ca": { | ||
| "type": "string", | ||
| "description": "the path to the ca file", | ||
| "x-env-value": "SOURCE_DB_CA_PATH" | ||
| }, | ||
| "cert": { | ||
| "type": "string", | ||
| "description": "the path to the cert file", | ||
| "x-env-value": "SOURCE_DB_CERT_PATH" | ||
| }, | ||
| "key": { | ||
| "type": "string", | ||
| "description": "the path to the key file", | ||
| "x-env-value": "SOURCE_DB_KEY_PATH" | ||
| } | ||
| }, | ||
| "unevaluatedProperties": false, | ||
| "if": { | ||
| "properties": { | ||
| "enabled": { | ||
| "const": true | ||
| } | ||
| } | ||
| }, | ||
| "then": { | ||
| "required": ["cert", "key"] | ||
| }, | ||
| "else": { | ||
| "properties": { | ||
| "enabled": { | ||
| "const": false | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "destinationDb": { | ||
| "type": "object", | ||
| "required": ["database", "ssl", "type"], | ||
| "properties": { | ||
| "host": { "type": "string", "description": "the host of the database", "default": "localhost", "x-env-value": "DEST_DB_HOST" }, | ||
| "port": { "type": "integer", "description": "the port of the database", "default": 5432, "x-env-value": "DEST_DB_PORT" }, | ||
| "username": { | ||
| "type": "string", | ||
| "description": "the username of the database", | ||
| "default": "postgres", | ||
| "maxLength": 63, | ||
| "x-env-value": "DEST_DB_USERNAME" | ||
| }, | ||
| "password": { "type": "string", "description": "the password of the database", "default": "postgres", "x-env-value": "DEST_DB_PASSWORD" }, | ||
| "schema": { "type": "string", "description": "the schema name of the database", "default": "public", "x-env-value": "DEST_DB_SCHEMA" }, | ||
| "database": { "type": "string", "description": "the database name", "maxLength": 63, "x-env-value": "DEST_DB_NAME" }, | ||
| "type": { "type": "string", "description": "the type of the database", "default": "postgres", "x-env-value": "DEST_DB_TYPE" }, | ||
| "ssl": { | ||
| "type": "object", | ||
| "description": "ssl configuration", | ||
| "properties": { | ||
| "enabled": { | ||
| "type": "boolean", | ||
| "description": "enable ssl", | ||
| "default": false, | ||
| "x-env-value": "DEST_DB_ENABLE_SSL_AUTH" | ||
| }, | ||
| "ca": { | ||
| "type": "string", | ||
| "description": "the path to the ca file", | ||
| "x-env-value": "DEST_DB_CA_PATH" | ||
| }, | ||
| "cert": { | ||
| "type": "string", | ||
| "description": "the path to the cert file", | ||
| "x-env-value": "DEST_DB_CERT_PATH" | ||
| }, | ||
| "key": { | ||
| "type": "string", | ||
| "description": "the path to the key file", | ||
| "x-env-value": "DEST_DB_KEY_PATH" | ||
| } | ||
| }, | ||
| "unevaluatedProperties": false, | ||
| "if": { | ||
| "properties": { | ||
| "enabled": { | ||
| "const": true | ||
| } | ||
| } | ||
| }, | ||
| "then": { | ||
| "required": ["cert", "key"] | ||
| }, | ||
| "else": { | ||
| "properties": { | ||
| "enabled": { | ||
| "const": false | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "s3": { | ||
| "allOf": [ | ||
| { | ||
| "$ref": "https://mapcolonies.com/common/s3/full/v2" | ||
| }, | ||
| { | ||
| "type": "object", | ||
| "required": ["fileName"], | ||
| "properties": { | ||
| "fileName": { | ||
| "type": "string", | ||
| "description": "Lua file name", | ||
| "x-env-value": "S3_FILE_NAME" | ||
| }, | ||
| "layersVariable": { | ||
| "type": "string", | ||
| "description": "Lua layers variable name", | ||
| "x-env-value": "S3_LAYERS_VARIABLE" | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| }, | ||
| "schedule": { | ||
| "type": "string", | ||
| "description": "The cron timing spec", | ||
| "default": "0 0 * * *", | ||
| "examples": ["*/1 * * * *"], | ||
| "x-env-value": "SYNC_FIELDS_CRON" | ||
| }, | ||
| "indexNameFormat": { | ||
| "type": "string", | ||
| "description": "The indexes' names in the source DB", | ||
| "default": "{layerName}_{column}_idx", | ||
| "examples": ["{layerName}_{column}_idx"], | ||
| "x-env-value": "INDEX_NAME_FORMAT" | ||
| }, | ||
| "layersFile": { | ||
| "type": "string", | ||
| "description": "The path to the layers file", | ||
| "default": "./config/layers.json", | ||
| "x-env-value": "LAYERS_FILE_PATH" | ||
| }, | ||
| "aliasesFile": { | ||
| "type": "string", | ||
| "description": "The path to the aliases file", | ||
| "default": "./config/aliases.json", | ||
| "x-env-value": "ALIASES_FILE_PATH" | ||
| }, | ||
| "enrichment": { | ||
| "type": "object", | ||
| "description": "Enrichment configuration", | ||
| "required": ["enabled"], | ||
| "properties": { | ||
| "enabled": { | ||
| "type": "boolean", | ||
| "description": "enable enrichment", | ||
| "default": false, | ||
| "x-env-value": "ENRICHMENT_ENABLED" | ||
| }, | ||
| "api": { | ||
| "type": "string", | ||
| "description": "Property alias name API", | ||
| "x-env-value": "ENRICHMENT_API_URL", | ||
| "default": "https://example.com/layers/{layerName}" | ||
| }, | ||
| "propertiesPath": { | ||
| "type": "string", | ||
| "default": "{layerName}.properties", | ||
| "x-env-value": "ENRICHMENT_PROPERTIES_PATH" | ||
| }, | ||
| "aliasField": { | ||
| "type": "string", | ||
| "default": "alias", | ||
| "x-env-value": "ENRICHMENT_ALIAS_FIELD" | ||
| } | ||
| }, | ||
| "unevaluatedProperties": false, | ||
| "if": { | ||
| "properties": { "enabled": { "const": true } } | ||
| }, | ||
| "then": { | ||
| "required": ["api", "propertiesPath", "aliasField"] | ||
| }, | ||
| "else": { | ||
| "properties": { "enabled": { "const": false } } | ||
| } | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.