diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e894fd6..5eb41ee 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1 @@ -{".":"1.7.0"} +{".":"1.8.0"} diff --git a/CHANGELOG.md b/CHANGELOG.md index d8cd522..4f9c263 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.8.0](https://github.com/MapColonies/schemas/compare/v1.7.0...v1.8.0) (2025-05-07) + + +### Features + +* **opala:** added tracing config to opala cron ([#94](https://github.com/MapColonies/schemas/issues/94)) ([6d86a6c](https://github.com/MapColonies/schemas/commit/6d86a6cfca86c27a2f2dd44a1a94e149e3c362e7)) + ## [1.7.0](https://github.com/MapColonies/schemas/compare/v1.6.0...v1.7.0) (2025-04-29) diff --git a/package-lock.json b/package-lock.json index b4bd269..f84faf8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@map-colonies/schemas", - "version": "1.7.0", + "version": "1.8.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@map-colonies/schemas", - "version": "1.7.0", + "version": "1.8.0", "license": "MIT", "devDependencies": { "@actions/core": "^1.10.1", diff --git a/package.json b/package.json index b6f1683..a672fff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@map-colonies/schemas", - "version": "1.7.0", + "version": "1.8.0", "description": "Package for all of MapColonies config schemas", "main": "./build/schemas/index.js", "repository": { diff --git a/schemas/infra/opala/cron/v1.configs.json b/schemas/infra/opala/cron/v2.configs.json similarity index 78% rename from schemas/infra/opala/cron/v1.configs.json rename to schemas/infra/opala/cron/v2.configs.json index 7fbcf58..3d9abf8 100644 --- a/schemas/infra/opala/cron/v1.configs.json +++ b/schemas/infra/opala/cron/v2.configs.json @@ -6,7 +6,11 @@ "logger": { "level": "info", "prettyPrint": false - } + }, + "tracing": { + "$ref": { "configName": "common-tracing", "version": "latest" } + }, + "shared": {} }, "db": { "$ref": { "configName": "infra-opala-db", "version": "latest" } diff --git a/schemas/infra/opala/cron/v2.schema.json b/schemas/infra/opala/cron/v2.schema.json new file mode 100644 index 0000000..d50aa1c --- /dev/null +++ b/schemas/infra/opala/cron/v2.schema.json @@ -0,0 +1,101 @@ +{ + "$id": "https://mapcolonies.com/infra/opala/cron/v2", + "description": "The opala cron service schema", + "title": "opalaCronSchemaV2", + "type": "object", + "allOf": [ + { + "type": "object", + "required": ["telemetry", "cron", "db"], + "properties": { + "telemetry": { + "$ref": "#/definitions/telemetry" + }, + "db": { + "$ref": "https://mapcolonies.com/common/db/full/v1" + }, + "cron": { + "$ref": "#/definitions/crons" + } + } + } + ], + "definitions": { + "crons": { + "type": "object", + "additionalProperties": false, + "anyOf": [ + { + "required": ["np"] + }, + { + "required": ["stage"] + }, + { + "required": ["prod"] + } + ], + "properties": { + "np": { + "$ref": "#/definitions/cron" + }, + "prod": { + "$ref": "#/definitions/cron" + }, + "stage": { + "$ref": "#/definitions/cron" + } + } + }, + "cron": { + "type": "object", + "required": ["pattern", "s3"], + "properties": { + "pattern": { + "type": "string", + "description": "The cron timing spec", + "examples": ["*/1 * * * *"] + }, + "s3": { + "type": "object", + "allOf": [ + { + "$ref": "https://mapcolonies.com/common/s3/partial/v1" + }, + { + "type": "object", + "required": ["key", "bucket"], + "properties": { + "key": { + "type": "string", + "description": "specific key of bundle inside s3", + "x-env-value": "S3_KEY" + }, + "bucket": { + "type": "string", + "description": "specific bucket name inside s3", + "x-env-value": "S3_BUCKET" + } + } + } + ] + } + } + }, + "telemetry": { + "type": "object", + "required": ["logger", "tracing", "shared"], + "properties": { + "logger": { + "$ref": "https://mapcolonies.com/common/telemetry/logger/v1" + }, + "tracing": { + "$ref": "https://mapcolonies.com/common/telemetry/tracing/v1" + }, + "shared": { + "$ref": "https://mapcolonies.com/common/telemetry/base/v1" + } + } + } + } +} diff --git a/schemas/vector/osmSyncTracker/v1.configs.json b/schemas/vector/osmSyncTracker/v1.configs.json new file mode 100644 index 0000000..d2a397e --- /dev/null +++ b/schemas/vector/osmSyncTracker/v1.configs.json @@ -0,0 +1,152 @@ +[ + { + "name": "osm-sync-tracker", + "value": { + "openapiConfig": { + "filePath": "./openapi3.yaml", + "basePath": "/docs", + "rawPath": "/api", + "uiPath": "/api" + }, + "telemetry": { + "tracing": { + "isEnabled": false + }, + "shared": {}, + "logger": { + "level": "info", + "prettyPrint": false + } + }, + "server": { + "port": 8080, + "request": { + "payload": { + "limit": "1mb" + } + }, + "response": { + "compression": { + "enabled": true, + "options": null + } + } + }, + "db": { + "type": "postgres", + "host": "localhost", + "port": 5432, + "username": "postgres", + "password": "postgres", + "enableSslAuth": false, + "sslPaths": { + "ca": "", + "key": "", + "cert": "" + }, + "database": "postgres", + "schema": "osm_sync_tracker" + }, + "redis": { + "host": "localhost", + "port": 6379, + "username": "", + "password": "", + "enableSslAuth": false, + "sslPaths": { + "ca": "", + "key": "", + "cert": "" + }, + "db": 0 + }, + "closure": { + "uiPath": "/closure", + "queues": { + "changesets": { + "queueOptions": { + "enabledBatchJobs": true, + "maxBatchSize": 10 + }, + "jobOptions": { + "attempts": 10, + "delay": 60000, + "backoff": { + "type": "fixed", + "delay": 60000 + } + }, + "workerOptions": { + "concurrency": 1, + "removeOnComplete": { + "age": 604800 + }, + "removeOnFail": { + "age": 2419200 + }, + "transactionIsolationLevel": "SERIALIZABLE", + "transactionFailureDelay": { + "minimum": 10000, + "maximum": 10000 + } + } + }, + "files": { + "queueOptions": { + "enabledBatchJobs": false + }, + "jobOptions": { + "attempts": 10, + "delay": 60000, + "backoff": { + "type": "fixed", + "delay": 60000 + } + }, + "workerOptions": { + "concurrency": 1, + "removeOnComplete": { + "age": 604800 + }, + "removeOnFail": { + "age": 2419200 + }, + "transactionIsolationLevel": "SERIALIZABLE", + "transactionFailureDelay": { + "minimum": 10000, + "maximum": 10000 + } + } + }, + "syncs": { + "queueOptions": { + "enabledBatchJobs": false + }, + "jobOptions": { + "attempts": 10, + "delay": 60000, + "backoff": { + "type": "fixed", + "delay": 60000 + } + }, + "workerOptions": { + "concurrency": 1, + "removeOnComplete": { + "age": 604800 + }, + "removeOnFail": { + "age": 2419200 + }, + "transactionIsolationLevel": "SERIALIZABLE", + "transactionFailureDelay": { + "minimum": 10000, + "maximum": 10000 + } + } + } + } + } + } + } +] diff --git a/schemas/vector/osmSyncTracker/v1.schema.json b/schemas/vector/osmSyncTracker/v1.schema.json new file mode 100644 index 0000000..61be2a9 --- /dev/null +++ b/schemas/vector/osmSyncTracker/v1.schema.json @@ -0,0 +1,697 @@ +{ + "$id": "https://mapcolonies.com/vector/osmSyncTracker/v1", + "type": "object", + "title": "VectorOsmSyncTrackerSchemaV1", + "description": "osm-sync-tracker schema", + "allOf": [ + { + "$ref": "https://mapcolonies.com/common/boilerplate/v2" + }, + { + "properties": { + "telemetry": { + "$ref": "#/definitions/metrics" + } + } + }, + { + "type": "object", + "required": ["db"], + "properties": { + "db": { + "$ref": "https://mapcolonies.com/common/db/full/v2" + } + } + }, + { + "type": "object", + "required": ["redis"], + "properties": { + "redis": { + "$ref": "https://mapcolonies.com/common/redis/v1" + } + } + }, + { + "type": "object", + "required": ["closure"], + "properties": { + "closure": { + "$ref": "#/definitions/closure" + } + } + } + ], + "definitions": { + "metrics": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "x-env-value": "TELEMETRY_METRICS_ENABLED", + "default": false + }, + "url": { + "type": "string", + "x-env-value": "TELEMETRY_METRICS_URL", + "description": "The URL of the metrics server. could be http or https", + "pattern": "^https?:\/\/.*" + }, + "interval": { + "type": "integer", + "x-env-value": "TELEMETRY_METRICS_INTERVAL", + "description": "The interval in seconds to send metrics" + } + }, + "if": { + "properties": { + "enabled": { + "const": true + } + } + }, + "then": { + "required": ["url", "interval"] + }, + "else": { + "properties": { + "enabled": { + "const": false + } + } + } + }, + "closure": { + "type": "object", + "required": ["uiPath", "queues"], + "properties": { + "uiPath": { + "type": "string", + "description": "The path to the closure UI", + "default": "/closure", + "pattern": "^/.*", + "x-env-value": "CLOSURE_UI_PATH" + }, + "queues": { + "type": "object", + "required": ["changesets", "files", "syncs"], + "additionalProperties": false, + "properties": { + "changesets": { + "type": "object", + "required": ["queueOptions", "jobOptions", "workerOptions"], + "properties": { + "queueOptions": { + "$ref": "#/definitions/changesetsQueueOptions" + }, + "jobOptions": { + "$ref": "#/definitions/changesetsJobOptions" + }, + "workerOptions": { + "$ref": "#/definitions/changesetsWorkerOptions" + } + } + }, + "files": { + "type": "object", + "required": ["queueOptions", "jobOptions", "workerOptions"], + "properties": { + "queueOptions": { + "$ref": "#/definitions/filesQueueOptions" + }, + "jobOptions": { + "$ref": "#/definitions/filesJobOptions" + }, + "workerOptions": { + "$ref": "#/definitions/filesWorkerOptions" + } + } + }, + "syncs": { + "type": "object", + "required": ["queueOptions", "jobOptions", "workerOptions"], + "properties": { + "queueOptions": { + "$ref": "#/definitions/syncsQueueOptions" + }, + "jobOptions": { + "$ref": "#/definitions/syncsJobOptions" + }, + "workerOptions": { + "$ref": "#/definitions/syncsWorkerOptions" + } + } + } + } + } + } + }, + "changesetsQueueOptions": { + "allOf": [ + { + "$ref": "#/definitions/queueOptions" + }, + { + "type": "object", + "properties": { + "enabledBatchJobs": { + "x-env-value": "CHANGESETS_QUEUE_ENABLED_BATCH_JOBS", + "default": true + }, + "maxBatchSize": { + "x-env-value": "CHANGESETS_QUEUE_MAX_BATCH_SIZE", + "default": 10 + } + } + } + ] + }, + "filesQueueOptions": { + "allOf": [ + { + "$ref": "#/definitions/queueOptions" + }, + { + "type": "object", + "properties": { + "enabledBatchJobs": { + "x-env-value": "FILES_QUEUE_ENABLED_BATCH_JOBS", + "default": false + }, + "maxBatchSize": { + "x-env-value": "FILES_QUEUE_MAX_BATCH_SIZE", + "default": 10 + } + } + } + ] + }, + "syncsQueueOptions": { + "allOf": [ + { + "$ref": "#/definitions/queueOptions" + }, + { + "type": "object", + "properties": { + "enabledBatchJobs": { + "x-env-value": "SYNCS_QUEUE_ENABLED_BATCH_JOBS", + "default": false + }, + "maxBatchSize": { + "x-env-value": "SYNCS_QUEUE_MAX_BATCH_SIZE", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + } + } + } + ] + }, + "changesetsJobOptions": { + "allOf": [ + { + "$ref": "#/definitions/jobOptions" + }, + { + "type": "object", + "properties": { + "attempts": { + "x-env-value": "CHANGESETS_QUEUE_JOB_ATTEMPTS", + "default": 10 + }, + "delay": { + "x-env-value": "CHANGESETS_QUEUE_JOB_DELAY", + "default": 60000 + }, + "deduplicationDelay": { + "x-env-value": "CHANGESETS_QUEUE_JOB_DEDUPLICATION_DELAY", + "default": 0 + }, + "deduplicationTtl": { + "x-env-value": "CHANGESETS_QUEUE_JOB_DEDUPLICATION_TTL", + "default": 0 + }, + "backoff": { + "type": "object", + "properties": { + "type": { + "x-env-value": "CHANGESETS_QUEUE_JOB_BACKOFF_TYPE", + "default": "fixed" + }, + "delay": { + "x-env-value": "CHANGESETS_QUEUE_JOB_BACKOFF_DELAY", + "default": 60000 + } + } + } + } + } + ] + }, + "filesJobOptions": { + "allOf": [ + { + "$ref": "#/definitions/jobOptions" + }, + { + "type": "object", + "properties": { + "attempts": { + "x-env-value": "FILES_QUEUE_JOB_ATTEMPTS", + "default": 10 + }, + "delay": { + "x-env-value": "FILES_QUEUE_JOB_DELAY", + "default": 60000 + }, + "deduplicationDelay": { + "x-env-value": "FILES_QUEUE_JOB_DEDUPLICATION_DELAY", + "default": 0 + }, + "deduplicationTtl": { + "x-env-value": "FILES_QUEUE_JOB_DEDUPLICATION_TTL", + "default": 0 + }, + "backoff": { + "type": "object", + "properties": { + "type": { + "x-env-value": "FILES_QUEUE_JOB_BACKOFF_TYPE", + "default": "fixed" + }, + "delay": { + "x-env-value": "FILES_QUEUE_JOB_BACKOFF_DELAY", + "default": 60000 + } + } + } + } + } + ] + }, + "syncsJobOptions": { + "allOf": [ + { + "$ref": "#/definitions/jobOptions" + }, + { + "type": "object", + "properties": { + "attempts": { + "x-env-value": "SYNCS_QUEUE_JOB_ATTEMPTS", + "default": 10 + }, + "delay": { + "x-env-value": "SYNCS_QUEUE_JOB_DELAY", + "default": 60000 + }, + "deduplicationDelay": { + "x-env-value": "SYNCS_QUEUE_JOB_DEDUPLICATION_DELAY", + "default": 0 + }, + "deduplicationTtl": { + "x-env-value": "SYNCS_QUEUE_JOB_DEDUPLICATION_TTL", + "default": 0 + }, + "backoff": { + "type": "object", + "properties": { + "type": { + "x-env-value": "SYNCS_QUEUE_JOB_BACKOFF_TYPE", + "default": "fixed" + }, + "delay": { + "x-env-value": "SYNCS_QUEUE_JOB_BACKOFF_DELAY", + "default": 60000 + } + } + } + } + } + ] + }, + "changesetsWorkerOptions": { + "allOf": [ + { + "$ref": "#/definitions/workerOptions" + }, + { + "type": "object", + "properties": { + "concurrency": { + "x-env-value": "CHANGESETS_QUEUE_WORKER_CONCURRENCY", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + }, + "limiter": { + "type": "object", + "properties": { + "max": { + "x-env-value": "CHANGESETS_QUEUE_WORKER_LIMITER_MAX", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + }, + "duration": { + "x-env-value": "CHANGESETS_QUEUE_WORKER_LIMITER_DURATION", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + } + } + }, + "maxStalledCount": { + "x-env-value": "CHANGESETS_QUEUE_WORKER_MAX_STALLED_COUNT", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + }, + "stalledInterval": { + "x-env-value": "CHANGESETS_QUEUE_WORKER_STALLED_INTERVAL", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + }, + "removeOnComplete": { + "type": "object", + "properties": { + "age": { + "x-env-value": "CHANGESETS_QUEUE_WORKER_REMOVE_ON_COMPLETE_AGE", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + }, + "count": { + "x-env-value": "CHANGESETS_QUEUE_WORKER_REMOVE_ON_COMPLETE_COUNT", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + } + } + }, + "removeOnFail": { + "type": "object", + "properties": { + "age": { + "x-env-value": "CHANGESETS_QUEUE_WORKER_REMOVE_ON_FAIL_AGE", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + }, + "count": { + "x-env-value": "CHANGESETS_QUEUE_WORKER_REMOVE_ON_FAIL_COUNT", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + } + } + }, + "transactionIsolationLevel": { + "x-env-value": "CHANGESETS_QUEUE_WORKER_TRANSACTION_ISOLATION_LEVEL", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + }, + "transactionFailureDelay": { + "type": "object", + "properties": { + "minimum": { + "x-env-value": "CHANGESETS_QUEUE_WORKER_TRANSACTION_FAILURE_DELAY_MIN", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + }, + "maximum": { + "x-env-value": "CHANGESETS_QUEUE_WORKER_TRANSACTION_FAILURE_DELAY_MAX", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + } + } + } + } + } + ] + }, + "filesWorkerOptions": { + "allOf": [ + { + "$ref": "#/definitions/workerOptions" + }, + { + "type": "object", + "properties": { + "concurrency": { + "x-env-value": "FILES_QUEUE_WORKER_CONCURRENCY", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + }, + "limiter": { + "type": "object", + "properties": { + "max": { + "x-env-value": "FILES_QUEUE_WORKER_LIMITER_MAX", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + }, + "duration": { + "x-env-value": "FILES_QUEUE_WORKER_LIMITER_DURATION", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + } + } + }, + "maxStalledCount": { + "x-env-value": "FILES_QUEUE_WORKER_MAX_STALLED_COUNT", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + }, + "stalledInterval": { + "x-env-value": "FILES_QUEUE_WORKER_STALLED_INTERVAL", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + }, + "removeOnComplete": { + "type": "object", + "properties": { + "age": { + "x-env-value": "FILES_QUEUE_WORKER_REMOVE_ON_COMPLETE_AGE", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + }, + "count": { + "x-env-value": "FILES_QUEUE_WORKER_REMOVE_ON_COMPLETE_COUNT", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + } + } + }, + "removeOnFail": { + "type": "object", + "properties": { + "age": { + "x-env-value": "FILES_QUEUE_WORKER_REMOVE_ON_FAIL_AGE", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + }, + "count": { + "x-env-value": "FILES_QUEUE_WORKER_REMOVE_ON_FAIL_COUNT", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + } + } + }, + "transactionIsolationLevel": { + "x-env-value": "FILES_QUEUE_WORKER_TRANSACTION_ISOLATION_LEVEL", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + }, + "transactionFailureDelay": { + "type": "object", + "properties": { + "minimum": { + "x-env-value": "FILES_QUEUE_WORKER_TRANSACTION_FAILURE_DELAY_MIN", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + }, + "maximum": { + "x-env-value": "FILES_QUEUE_WORKER_TRANSACTION_FAILURE_DELAY_MAX", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + } + } + } + } + } + ] + }, + "syncsWorkerOptions": { + "allOf": [ + { + "$ref": "#/definitions/workerOptions" + }, + { + "type": "object", + "properties": { + "concurrency": { + "x-env-value": "SYNCS_QUEUE_WORKER_CONCURRENCY", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + }, + "limiter": { + "type": "object", + "properties": { + "max": { + "x-env-value": "SYNCS_QUEUE_WORKER_LIMITER_MAX", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + }, + "duration": { + "x-env-value": "SYNCS_QUEUE_WORKER_LIMITER_DURATION", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + } + } + }, + "maxStalledCount": { + "x-env-value": "SYNCS_QUEUE_WORKER_MAX_STALLED_COUNT", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + }, + "stalledInterval": { + "x-env-value": "SYNCS_QUEUE_WORKER_STALLED_INTERVAL", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + }, + "removeOnComplete": { + "type": "object", + "properties": { + "age": { + "x-env-value": "SYNCS_QUEUE_WORKER_REMOVE_ON_COMPLETE_AGE", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + }, + "count": { + "x-env-value": "SYNCS_QUEUE_WORKER_REMOVE_ON_COMPLETE_COUNT", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + } + } + }, + "removeOnFail": { + "type": "object", + "properties": { + "age": { + "x-env-value": "SYNCS_QUEUE_WORKER_REMOVE_ON_FAIL_AGE", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + }, + "count": { + "x-env-value": "SYNCS_QUEUE_WORKER_REMOVE_ON_FAIL_COUNT", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + } + } + }, + "transactionIsolationLevel": { + "x-env-value": "SYNCS_QUEUE_WORKER_TRANSACTION_ISOLATION_LEVEL", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + }, + "transactionFailureDelay": { + "type": "object", + "properties": { + "minimum": { + "x-env-value": "SYNCS_QUEUE_WORKER_TRANSACTION_FAILURE_DELAY_MIN", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + }, + "maximum": { + "x-env-value": "SYNCS_QUEUE_WORKER_TRANSACTION_FAILURE_DELAY_MAX", + "$comment": "Must add some comment. See this issue for more details: https://github.com/MapColonies/schemas/issues/96" + } + } + } + } + } + ] + }, + "queueOptions": { + "type": "object", + "properties": { + "enabledBatchJobs": { + "type": "boolean", + "default": false + }, + "maxBatchSize": { + "type": "integer" + } + }, + "if": { + "properties": { + "enabledBatchJobs": { + "const": true + } + } + }, + "then": { + "required": ["maxBatchSize"] + }, + "else": { + "properties": { + "enabledBatchJobs": { + "const": false + } + } + } + }, + "jobOptions": { + "type": "object", + "properties": { + "attempts": { + "type": "integer" + }, + "delay": { + "type": "integer" + }, + "deduplicationDelay": { + "type": "integer" + }, + "deduplicationTtl": { + "type": "integer" + }, + "backoff": { + "type": "object", + "properties": { + "type": { + "enum": ["fixed", "exponential"] + }, + "delay": { + "type": "integer" + } + } + } + } + }, + "workerOptions": { + "type": "object", + "required": ["transactionFailureDelay"], + "properties": { + "concurrency": { + "type": "integer" + }, + "limiter": { + "type": "object", + "required": ["max", "duration"], + "properties": { + "max": { + "type": "integer" + }, + "duration": { + "type": "integer" + } + } + }, + "maxStalledCount": { + "type": "integer" + }, + "stalledInterval": { + "type": "integer" + }, + "removeOnComplete": { + "type": "object", + "properties": { + "age": { + "type": "integer" + }, + "count": { + "type": "integer" + } + } + }, + "removeOnFail": { + "type": "object", + "properties": { + "age": { + "type": "integer" + }, + "count": { + "type": "integer" + } + } + }, + "transactionIsolationLevel": { + "type": "string", + "enum": ["READ UNCOMMITTED", "READ COMMITTED", "REPEATABLE READ", "SERIALIZABLE"], + "default": "SERIALIZABLE" + }, + "transactionFailureDelay": { + "type": "object", + "properties": { + "minimum": { + "type": "integer", + "default": "10000" + }, + "maximum": { + "type": "integer", + "default": "10000" + } + } + } + } + } + } +}