@forzalabs/remora 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/Constants.js +8 -0
  2. package/actions/automap.js +73 -0
  3. package/actions/compile.js +57 -0
  4. package/actions/debug.js +61 -0
  5. package/actions/deploy.js +95 -0
  6. package/actions/discover.js +36 -0
  7. package/actions/init.js +78 -0
  8. package/actions/run.js +51 -0
  9. package/auth/AdminManager.js +48 -0
  10. package/auth/ApiKeysManager.js +45 -0
  11. package/auth/JWTManager.js +56 -0
  12. package/core/Affirm.js +42 -0
  13. package/core/Algo.js +155 -0
  14. package/core/dste/DSTE.js +113 -0
  15. package/core/logger/DebugLogService.js +48 -0
  16. package/core/logger/DevelopmentLogService.js +70 -0
  17. package/core/logger/LocalLogService.js +70 -0
  18. package/core/logger/Logger.js +54 -0
  19. package/database/DatabaseEngine.js +119 -0
  20. package/database/DatabaseInitializer.js +80 -0
  21. package/database/DatabaseStructure.js +27 -0
  22. package/definitions/agents/DestinationDriver.js +2 -0
  23. package/definitions/agents/SourceDriver.js +2 -0
  24. package/definitions/cli.js +2 -0
  25. package/definitions/database/ApiKeys.js +2 -0
  26. package/definitions/database/Stored.js +7 -0
  27. package/definitions/database/UsageStat.js +2 -0
  28. package/definitions/database/User.js +2 -0
  29. package/definitions/json_schemas/consumer-schema.json +423 -0
  30. package/definitions/json_schemas/producer-schema.json +236 -0
  31. package/definitions/json_schemas/project-schema.json +59 -0
  32. package/definitions/json_schemas/source-schema.json +109 -0
  33. package/definitions/requests/ConsumerRequest.js +2 -0
  34. package/definitions/requests/Developer.js +2 -0
  35. package/definitions/requests/Mapping.js +2 -0
  36. package/definitions/requests/ProducerRequest.js +2 -0
  37. package/definitions/requests/Request.js +2 -0
  38. package/definitions/resources/Compiled.js +2 -0
  39. package/definitions/resources/Consumer.js +2 -0
  40. package/definitions/resources/Environment.js +2 -0
  41. package/definitions/resources/Library.js +2 -0
  42. package/definitions/resources/Producer.js +2 -0
  43. package/definitions/resources/Project.js +2 -0
  44. package/definitions/resources/Schema.js +2 -0
  45. package/definitions/resources/Source.js +2 -0
  46. package/documentation/README.md +123 -0
  47. package/documentation/default_resources/consumer.json +52 -0
  48. package/documentation/default_resources/producer.json +32 -0
  49. package/documentation/default_resources/project.json +14 -0
  50. package/documentation/default_resources/schema.json +36 -0
  51. package/documentation/default_resources/source.json +15 -0
  52. package/drivers/DriverFactory.js +56 -0
  53. package/drivers/LocalDriver.js +122 -0
  54. package/drivers/RedshiftDriver.js +179 -0
  55. package/drivers/S3Driver.js +47 -0
  56. package/drivers/S3SourceDriver.js +127 -0
  57. package/engines/CryptoEngine.js +46 -0
  58. package/engines/Environment.js +139 -0
  59. package/engines/ParseManager.js +38 -0
  60. package/engines/ProducerEngine.js +150 -0
  61. package/engines/UsageManager.js +61 -0
  62. package/engines/UserManager.js +43 -0
  63. package/engines/Validator.js +154 -0
  64. package/engines/ai/AutoMapperEngine.js +37 -0
  65. package/engines/ai/DeveloperEngine.js +70 -0
  66. package/engines/ai/LLM.js +299 -0
  67. package/engines/consumer/ConsumerEngine.js +204 -0
  68. package/engines/consumer/ConsumerManager.js +155 -0
  69. package/engines/consumer/PostProcessor.js +143 -0
  70. package/engines/deployment/DeploymentPlanner.js +46 -0
  71. package/engines/execution/ExecutionEnvironment.js +114 -0
  72. package/engines/execution/ExecutionPlanner.js +92 -0
  73. package/engines/execution/RequestExecutor.js +100 -0
  74. package/engines/file/FileCompiler.js +28 -0
  75. package/engines/file/FileExporter.js +116 -0
  76. package/engines/schema/SchemaEngine.js +33 -0
  77. package/engines/schema/SchemaValidator.js +67 -0
  78. package/engines/sql/SQLBuilder.js +96 -0
  79. package/engines/sql/SQLCompiler.js +140 -0
  80. package/engines/sql/SQLUtils.js +22 -0
  81. package/engines/validation/Validator.js +151 -0
  82. package/helper/Helper.js +64 -0
  83. package/helper/Settings.js +13 -0
  84. package/index.js +63 -0
  85. package/package.json +77 -0
@@ -0,0 +1,236 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Producer Schema",
4
+ "description": "Schema for defining data producers",
5
+ "type": "object",
6
+ "properties": {
7
+ "$schema": {
8
+ "type": "string",
9
+ "format": "uri"
10
+ },
11
+ "name": {
12
+ "type": "string",
13
+ "description": "The name of the producer"
14
+ },
15
+ "description": {
16
+ "type": "string",
17
+ "description": "Optional description of the producer"
18
+ },
19
+ "source": {
20
+ "type": "string",
21
+ "description": "The name of the Source"
22
+ },
23
+ "dimensions": {
24
+ "type": "array",
25
+ "description": "Dimensions for the producer",
26
+ "items": {
27
+ "type": "object",
28
+ "properties": {
29
+ "name": {
30
+ "type": "string",
31
+ "description": "The name of the dimension"
32
+ },
33
+ "description": {
34
+ "type": "string",
35
+ "description": "Optional description of the dimension"
36
+ },
37
+ "type": {
38
+ "type": "string",
39
+ "enum": [
40
+ "string",
41
+ "number",
42
+ "datetime"
43
+ ],
44
+ "description": "The data type of the dimension"
45
+ },
46
+ "alias": {
47
+ "type": "string",
48
+ "description": "The SQL column or field key that corresponds to this dimension. If left empty, the column name is assumed to be the same as the dimension name"
49
+ },
50
+ "pk": {
51
+ "type": "boolean",
52
+ "description": "Whether this is a primary key column or not"
53
+ },
54
+ "classification": {
55
+ "type": "array",
56
+ "items": {
57
+ "type": "string",
58
+ "enum": [
59
+ "PHI",
60
+ "PII",
61
+ "GDPR"
62
+ ],
63
+ "description": "Classification categories for this dimension"
64
+ }
65
+ },
66
+ "mask": {
67
+ "type": "string",
68
+ "enum": [
69
+ "hash",
70
+ "mask",
71
+ "crypt"
72
+ ],
73
+ "description": "Masking type to apply to this dimension"
74
+ }
75
+ },
76
+ "required": [
77
+ "name",
78
+ "type"
79
+ ],
80
+ "additionalProperties": false
81
+ },
82
+ "minItems": 1
83
+ },
84
+ "measures": {
85
+ "type": "array",
86
+ "description": "Optional measures for the producer",
87
+ "items": {
88
+ "type": "object",
89
+ "properties": {
90
+ "name": {
91
+ "type": "string",
92
+ "description": "The name of the measure"
93
+ },
94
+ "description": {
95
+ "type": "string",
96
+ "description": "Optional description of the measure"
97
+ },
98
+ "sql": {
99
+ "type": "string",
100
+ "description": "SQL command used to create a metric"
101
+ }
102
+ },
103
+ "required": [
104
+ "name",
105
+ "sql"
106
+ ],
107
+ "additionalProperties": false
108
+ }
109
+ },
110
+ "settings": {
111
+ "type": "object",
112
+ "description": "Settings for the producer",
113
+ "properties": {
114
+ "sqlTable": {
115
+ "type": "string",
116
+ "description": "The SQL table name, which is a concise way of setting the sql property to 'SELECT * FROM <sql table name>'"
117
+ },
118
+ "direct": {
119
+ "type": "boolean",
120
+ "description": "If true, no view is created on the producer side due to permission limitations"
121
+ },
122
+ "sql": {
123
+ "type": "string",
124
+ "description": "The name of the file that has the SQL statement to run to create this producer"
125
+ },
126
+ "fileKey": {
127
+ "type": "string",
128
+ "description": "If the source is a bucket, this is the file key that identifies the file to read"
129
+ },
130
+ "fileType": {
131
+ "type": "string",
132
+ "enum": [
133
+ "JSON",
134
+ "JSONL",
135
+ "CSV"
136
+ ],
137
+ "description": "The type of file to read"
138
+ }
139
+ },
140
+ "additionalProperties": false
141
+ },
142
+ "_version": {
143
+ "type": "number",
144
+ "description": "Version number of the producer configuration"
145
+ }
146
+ },
147
+ "required": [
148
+ "name",
149
+ "source",
150
+ "dimensions",
151
+ "settings",
152
+ "_version"
153
+ ],
154
+ "additionalProperties": false,
155
+ "examples": [
156
+ {
157
+ "name": "CustomerData",
158
+ "description": "Producer for customer data from the main database",
159
+ "source": "Production PostgreSQL Database",
160
+ "dimensions": [
161
+ {
162
+ "name": "customer_id",
163
+ "type": "string",
164
+ "pk": true
165
+ },
166
+ {
167
+ "name": "full_name",
168
+ "type": "string",
169
+ "classification": [
170
+ "PII",
171
+ "GDPR"
172
+ ],
173
+ "mask": "hash"
174
+ },
175
+ {
176
+ "name": "email",
177
+ "type": "string",
178
+ "classification": [
179
+ "PII",
180
+ "GDPR"
181
+ ],
182
+ "mask": "mask"
183
+ },
184
+ {
185
+ "name": "signup_date",
186
+ "type": "datetime"
187
+ }
188
+ ],
189
+ "measures": [
190
+ {
191
+ "name": "total_orders",
192
+ "description": "Total number of orders by this customer",
193
+ "sql": "COUNT(order_id)"
194
+ },
195
+ {
196
+ "name": "total_spent",
197
+ "description": "Total amount spent by this customer",
198
+ "sql": "SUM(order_amount)"
199
+ }
200
+ ],
201
+ "settings": {
202
+ "sqlTable": "customers"
203
+ },
204
+ "_version": 1
205
+ },
206
+ {
207
+ "name": "SalesData",
208
+ "description": "Producer for sales data from S3 bucket",
209
+ "source": "Data Lake",
210
+ "dimensions": [
211
+ {
212
+ "name": "transaction_id",
213
+ "type": "string",
214
+ "pk": true
215
+ },
216
+ {
217
+ "name": "product_id",
218
+ "type": "string"
219
+ },
220
+ {
221
+ "name": "sale_amount",
222
+ "type": "number"
223
+ },
224
+ {
225
+ "name": "sale_date",
226
+ "type": "datetime"
227
+ }
228
+ ],
229
+ "settings": {
230
+ "fileKey": "sales/daily_sales.csv",
231
+ "fileType": "CSV"
232
+ },
233
+ "_version": 2
234
+ }
235
+ ]
236
+ }
@@ -0,0 +1,59 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "type": "object",
4
+ "required": ["name", "version", "consumers", "producers", "sources", "schemas", "settings"],
5
+ "properties": {
6
+ "name": {
7
+ "type": "string",
8
+ "description": "Name of the remora project"
9
+ },
10
+ "version": {
11
+ "type": "string",
12
+ "pattern": "^\\d+\\.\\d+\\.\\d+$",
13
+ "description": "Version of the project in semver format"
14
+ },
15
+ "consumers": {
16
+ "type": "array",
17
+ "items": {
18
+ "type": "string",
19
+ "pattern": "^/"
20
+ },
21
+ "description": "Array of consumer paths"
22
+ },
23
+ "producers": {
24
+ "type": "array",
25
+ "items": {
26
+ "type": "string",
27
+ "pattern": "^/"
28
+ },
29
+ "description": "Array of producer paths"
30
+ },
31
+ "sources": {
32
+ "type": "array",
33
+ "items": {
34
+ "type": "string",
35
+ "pattern": "^/"
36
+ },
37
+ "description": "Array of source paths"
38
+ },
39
+ "schemas": {
40
+ "type": "array",
41
+ "items": {
42
+ "type": "string",
43
+ "pattern": "^/"
44
+ },
45
+ "description": "Array of schema paths"
46
+ },
47
+ "settings": {
48
+ "type": "object",
49
+ "required": ["SQL_MAX_QUERY_ROWS"],
50
+ "properties": {
51
+ "SQL_MAX_QUERY_ROWS": {
52
+ "type": "integer",
53
+ "minimum": 1,
54
+ "description": "Maximum number of rows for SQL queries"
55
+ }
56
+ }
57
+ }
58
+ }
59
+ }
@@ -0,0 +1,109 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Source Schema",
4
+ "description": "Schema for defining data sources and their authentication methods",
5
+ "type": "object",
6
+ "properties": {
7
+ "$schema": {
8
+ "type": "string",
9
+ "format": "uri"
10
+ },
11
+ "name": {
12
+ "type": "string",
13
+ "description": "The name of the data source"
14
+ },
15
+ "description": {
16
+ "type": "string",
17
+ "description": "Optional description of the data source"
18
+ },
19
+ "engine": {
20
+ "type": "string",
21
+ "enum": [
22
+ "aws-redshift",
23
+ "aws-dynamodb",
24
+ "aws-s3",
25
+ "postgres",
26
+ "local"
27
+ ],
28
+ "description": "The type of data engine"
29
+ },
30
+ "authentication": {
31
+ "type": "object",
32
+ "description": "Authentication details for connecting to the data source",
33
+ "properties": {
34
+ "method": {
35
+ "type": "string",
36
+ "enum": [
37
+ "iam",
38
+ "username-password",
39
+ "access-secret-key",
40
+ "arn",
41
+ "implicit"
42
+ ],
43
+ "description": "The authentication method to use"
44
+ }
45
+ },
46
+ "required": [
47
+ "method"
48
+ ],
49
+ "additionalProperties": {
50
+ "type": "string"
51
+ }
52
+ },
53
+ "_version": {
54
+ "type": "number",
55
+ "description": "Version number of the source configuration"
56
+ }
57
+ },
58
+ "required": [
59
+ "name",
60
+ "engine",
61
+ "authentication",
62
+ "_version"
63
+ ],
64
+ "additionalProperties": false,
65
+ "examples": [
66
+ {
67
+ "name": "Production PostgreSQL Database",
68
+ "description": "Main production database for customer data",
69
+ "engine": "postgres",
70
+ "authentication": {
71
+ "method": "username-password",
72
+ "host": "prod-db.example.com",
73
+ "user": "app_user",
74
+ "password": "password123",
75
+ "dbName": "customers",
76
+ "schema": "public",
77
+ "port": "5432"
78
+ },
79
+ "_version": 1
80
+ },
81
+ {
82
+ "name": "Data Lake",
83
+ "description": "AWS S3 bucket containing analytics data",
84
+ "engine": "aws-s3",
85
+ "authentication": {
86
+ "method": "access-secret-key",
87
+ "accessKey": "AKIAIOSFODNN7EXAMPLE",
88
+ "secretKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
89
+ "region": "us-east-1",
90
+ "bucket": "analytics-data"
91
+ },
92
+ "_version": 2
93
+ },
94
+ {
95
+ "name": "Redshift Data Warehouse",
96
+ "engine": "aws-redshift",
97
+ "authentication": {
98
+ "method": "iam",
99
+ "host": "redshift-cluster.region.redshift.amazonaws.com",
100
+ "dbName": "analytics",
101
+ "port": "5439",
102
+ "iamProfile": "redshift-access-role",
103
+ "region": "us-west-2",
104
+ "clusterId": "analytics-cluster"
105
+ },
106
+ "_version": 1
107
+ }
108
+ ]
109
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,123 @@
1
+ # Configuration Guide
2
+
3
+ This README explains the available configurations for each resource type in the project.
4
+ Each section details the expected values for different keys in the JSON files.
5
+
6
+ ## Remora Configuration
7
+
8
+ The main project configuration file.
9
+
10
+ | Key | Description | Possible Values |
11
+ |-----|-------------|----------------|
12
+ | `name` | Project identifier | Any string |
13
+ | `version` | Project version number | Semantic version (e.g., `1.0.0`) |
14
+ | `description` | Project purpose | Any descriptive text |
15
+ | `consumers` | Path to consumer definitions | Directory path as string |
16
+ | `producers` | Path to producer definitions | Directory path as string |
17
+ | `sources` | Path to source definitions | Directory path as string |
18
+ | `schemas` | Path to schema definitions | Directory path as string |
19
+ | `settings.SQL_MAX_QUERY_ROWS` | Maximum rows in query results | Positive integer |
20
+ | `settings.DEFAULT_TIMEOUT_SECONDS` | Maximum query execution time | Positive integer (seconds) |
21
+ | `settings.LOG_LEVEL` | Logging detail level | `DEBUG`, `INFO`, `WARNING`, `ERROR` |
22
+
23
+ ## Source Configuration
24
+
25
+ Sources define the connection to your data storage systems.
26
+
27
+ | Key | Description | Possible Values |
28
+ |-----|-------------|----------------|
29
+ | `name` | Unique identifier for the source | Any string without spaces |
30
+ | `description` | Explanation of what this source represents | Any descriptive text |
31
+ | `_version` | Version number for tracking changes | Positive integer |
32
+ | `engine` | Type of data storage system | `aws-redshift`, `aws-dynamodb`, `aws-s3`, `postgres`, `local` |
33
+ | `authentication.method` | Authentication method for connecting to the source | `iam`, `username-password`, `access-secret-key`, `arn`, `implicit` |
34
+ | `authentication.schema` | Database schema to use | Schema name as string |
35
+ | `authentication.bucketName` | Bucket s3 name | Bucket name as string |
36
+ | `authentication.accessKey` | AWS access key | String (preferably environment variable) |
37
+ | `authentication.secretKey` | AWS secret key | String (preferably environment variable) |
38
+ | `authentication.region` | AWS region | AWS region code (e.g., `us-east-1`) |
39
+ | `authentication.database` | Database name | String |
40
+ | `authentication.workgroup` | AWS workgroup | String |
41
+ | `authentication.host` | Database host (for username-password method) | Hostname or IP address |
42
+ | `authentication.user` | Database username (for username-password method) | String |
43
+ | `authentication.password` | Database password (for username-password method) | String (preferably environment variable) |
44
+ | `authentication.port` | Database port (for username-password method) | Integer |
45
+
46
+ ## Producer Configuration
47
+
48
+ Producers extract data from sources and define the structure of the data.
49
+
50
+ | Key | Description | Possible Values |
51
+ |-----|-------------|----------------|
52
+ | `name` | Unique identifier for the producer | Any string without spaces |
53
+ | `description` | Explanation of what this producer represents | Any descriptive text |
54
+ | `source` | Name of the source this producer uses | Must match a source `name` |
55
+ | `_version` | Version number for tracking changes | Positive integer |
56
+ | `dimensions[].name` | Name of the field/column | Any string without spaces |
57
+ | `dimensions[].type` | Data type of the field | `string`, `number`, `datetime` |
58
+ | `dimensions[].pk` | Whether this is a primary key | `true`, `false` |
59
+ | `dimensions[].description` | Description of the field | Any descriptive text |
60
+ | `dimensions[].alias` | Alternative name for the column in the source | String |
61
+ | `dimensions[].classification` | Data privacy classification | Array containing: `PII`, `PHI`, `GDPR` |
62
+ | `dimensions[].mask` | How to protect sensitive data | `hash`, `mask`, `crypt` |
63
+ | `measures[].name` | Name of calculated measure | Any string without spaces |
64
+ | `measures[].description` | Description of the measure | Any descriptive text |
65
+ | `measures[].sql` | SQL expression to calculate the measure | Valid SQL expression (e.g., `SUM(field_name)`) |
66
+ | `settings.sqlTable` | Source table name | Table name as string |
67
+ | `settings.direct` | Whether to query directly without creating views | `true`, `false` |
68
+ | `settings.sql` | Custom SQL for this producer | SQL query string |
69
+ | `settings.fileKey` | File key for S3 sources | S3 file path |
70
+ | `settings.fileType` | File format for file-based sources | `JSON`, `JSONL`, `CSV` |
71
+
72
+ ## Consumer Configuration
73
+
74
+ Consumers transform and combine data from producers for specific use cases.
75
+
76
+ | Key | Description | Possible Values |
77
+ |-----|-------------|----------------|
78
+ | `name` | Unique identifier for the consumer | Any string without spaces |
79
+ | `description` | Explanation of what this consumer represents | Any descriptive text |
80
+ | `_version` | Version number for tracking changes | Positive integer |
81
+ | `producers[].name` | Name of a producer this consumer uses | Must match a producer `name` |
82
+ | `producers[].joins[].otherName` | Name of another producer to join with | Must match a producer `name` |
83
+ | `producers[].joins[].relationship` | Type of relationship for the join | `one-to-one`, `one-to-many`, `many-to-one` |
84
+ | `producers[].joins[].sql` | SQL expression for the join | Valid SQL join condition |
85
+ | `producers[].custom.language` | Language for custom transformations | `js`, `python` |
86
+ | `producers[].custom.code` | Code for custom transformations | Valid code in the specified language |
87
+ | `fields[].key` | Field name from producer or `*` for all fields | Field name or `*` |
88
+ | `fields[].alias` | New name for the field in the output | Any string without spaces |
89
+ | `fields[].from` | Producer to get the field from | Must match a producer `name` |
90
+ | `fields[].grouping.groupingKey` | Field to group by | Any string without spaces |
91
+ | `fields[].grouping.subFields` | Fields to include in each group | Array of field objects |
92
+ | `filters[].sql` | SQL condition for filtering | SQL WHERE condition |
93
+ | `filters[].rule.member` | Field to filter on | Field name |
94
+ | `filters[].rule.operator` | Comparison operator | `eq`, `neq`, `gt`, `gte`, `lt`, `lte`, `contains`, `not_contains` |
95
+ | `filters[].rule.values` | Values to compare against | Array of strings |
96
+ | `outputs[].format` | Output format | `SQL`, `API`, `CSV`, `PARQUET`, `JSON` |
97
+ | `outputs[].accellerated` | Whether to materialize for performance | `true`, `false` |
98
+ | `outputs[].direct` | Whether to query directly without creating views | `true`, `false` |
99
+ | `outputs[].exportDestination` | Where to export data | Must match a source `name` |
100
+ | `outputs[].trigger.type` | How to trigger exports | `CRON`, `API` |
101
+ | `outputs[].trigger.value` | Trigger expression | CRON expression (e.g., `0 0 * * *`) or endpoint path |
102
+ | `metadata` | Custom tags | Object with string keys and values |
103
+ | `project` | Project grouping | String |
104
+ | `schema` | JSON schema to validate against | Must match a schema `title` |
105
+
106
+ ## Schema Configuration
107
+
108
+ Schemas define the structure and validation rules for data.
109
+
110
+ | Key | Description | Possible Values |
111
+ |-----|-------------|----------------|
112
+ | `$schema` | JSON Schema specification version | URL (e.g., `http://json-schema.org/draft-07/schema#`) |
113
+ | `title` | Name of this schema | Any string |
114
+ | `type` | Data structure type | `object` |
115
+ | `version` | Schema version number | Positive integer |
116
+ | `description` | Explanation of this schema | Any descriptive text |
117
+ | `properties` | Field definitions | Object with field names as keys |
118
+ | `properties.*.type` | Data type of field | `string`, `number`, `integer`, `boolean`, `array`, `object` |
119
+ | `properties.*.format` | Format specification | `date-time`, `email`, `uri`, etc. |
120
+ | `properties.*.description` | Description of field | Any descriptive text |
121
+ | `properties.*.enum` | Allowed values | Array of values |
122
+ | `required` | Fields that must be present | Array of field names |
123
+ | `additionalProperties` | Whether undefined fields are allowed | `true`, `false` |
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "<consumer name>",
3
+ "description": "<consumer description>",
4
+ "producers": [
5
+ {
6
+ "name": "<primary producer name>"
7
+ },
8
+ {
9
+ "name": "<secondary producer name>",
10
+ "joins": [
11
+ {
12
+ "otherName": "<primary producer name>",
13
+ "relationship": "<one-to-one | one-to-many | many-to-one>",
14
+ "sql": "<join condition>"
15
+ }
16
+ ]
17
+ }
18
+ ],
19
+ "fields": [
20
+ { "key": "<producer field name>", "from": "<producer name>" },
21
+ { "key": "<original field name>", "from": "<producer name>", "alias": "<new field name>" },
22
+ { "key": "<secondary producer field name>", "from": "<secondary producer name>" },
23
+ { "key": "<another field name>", "from": "<producer name>" }
24
+ ],
25
+ "filters": [
26
+ {
27
+ "sql": "<filter condition>"
28
+ }
29
+ ],
30
+ "outputs": [
31
+ { "format": "<api | json | csv | parquet | sql>" },
32
+ {
33
+ "format": "<json | csv | parquet | sql>",
34
+ "exportDestination": "<export destination>"
35
+ },
36
+ {
37
+ "format": "<csv>",
38
+ "exportDestination": "<export destination>",
39
+ "trigger": {
40
+ "type": "<cron | api>",
41
+ "value": "<cron expression or endpoint path>"
42
+ }
43
+ }
44
+ ],
45
+ "metadata": {
46
+ "<metadata tag key>": "<metadata tag value>",
47
+ "owner_email": "<owner email>"
48
+ },
49
+ "project": "<project name>",
50
+ "schema": "<schema name>",
51
+ "_version": 1
52
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "<producer name>",
3
+ "description": "<producer description>",
4
+ "source": "<source name>",
5
+ "dimensions": [
6
+ {
7
+ "name": "<primary key field name>",
8
+ "type": "<number | string | datetime>",
9
+ "pk": true,
10
+ "description": "<field description>"
11
+ },
12
+ {
13
+ "name": "<sensitive field name>",
14
+ "type": "<number | string | datetime>",
15
+ "classification": ["<'PHI' | 'PII' | 'GDPR'>"],
16
+ "mask": "<hash | mask | crypt>",
17
+ "description": "<field description>"
18
+ }
19
+ ],
20
+ "measures": [
21
+ {
22
+ "name": "<calculated measure name>",
23
+ "description": "<measure description>",
24
+ "sql": "<sql expression>"
25
+ }
26
+ ],
27
+ "settings": {
28
+ "sqlTable": "<source table name>",
29
+ "direct": true
30
+ },
31
+ "_version": 1
32
+ }