nucleus-core-ts 0.9.781 → 0.9.783
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.
- package/dist/client.js +1 -1
- package/dist/fe/components/IntegrationsPage/components/ConnectionAuthFields.d.ts +2 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionAuthFields.js +85 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionBasicFields.d.ts +2 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionBasicFields.js +165 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionForm.d.ts +10 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionForm.js +112 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionList.d.ts +9 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionList.js +184 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionOauthFields.d.ts +2 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionOauthFields.js +131 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionSettingsTab.d.ts +21 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionSettingsTab.js +49 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionTabs.d.ts +12 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionTabs.js +95 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionTest.d.ts +9 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionTest.js +116 -0
- package/dist/fe/components/IntegrationsPage/components/CredentialFields.d.ts +9 -0
- package/dist/fe/components/IntegrationsPage/components/CredentialFields.js +171 -0
- package/dist/fe/components/IntegrationsPage/components/CredentialSlotRow.d.ts +13 -0
- package/dist/fe/components/IntegrationsPage/components/CredentialSlotRow.js +63 -0
- package/dist/fe/components/IntegrationsPage/components/EndpointForm.d.ts +11 -0
- package/dist/fe/components/IntegrationsPage/components/EndpointForm.js +166 -0
- package/dist/fe/components/IntegrationsPage/components/EndpointFormFields.d.ts +19 -0
- package/dist/fe/components/IntegrationsPage/components/EndpointFormFields.js +162 -0
- package/dist/fe/components/IntegrationsPage/components/EndpointList.d.ts +12 -0
- package/dist/fe/components/IntegrationsPage/components/EndpointList.js +205 -0
- package/dist/fe/components/IntegrationsPage/components/EndpointSample.d.ts +6 -0
- package/dist/fe/components/IntegrationsPage/components/EndpointSample.js +204 -0
- package/dist/fe/components/IntegrationsPage/components/EndpointsTab.d.ts +5 -0
- package/dist/fe/components/IntegrationsPage/components/EndpointsTab.js +101 -0
- package/dist/fe/components/IntegrationsPage/components/FieldMappingRow.d.ts +17 -0
- package/dist/fe/components/IntegrationsPage/components/FieldMappingRow.js +179 -0
- package/dist/fe/components/IntegrationsPage/components/FieldMappingRows.d.ts +11 -0
- package/dist/fe/components/IntegrationsPage/components/FieldMappingRows.js +115 -0
- package/dist/fe/components/IntegrationsPage/components/IntegrationsPage.d.ts +2 -0
- package/dist/fe/components/IntegrationsPage/components/IntegrationsPage.js +175 -0
- package/dist/fe/components/IntegrationsPage/components/MappingEditor.d.ts +15 -0
- package/dist/fe/components/IntegrationsPage/components/MappingEditor.js +193 -0
- package/dist/fe/components/IntegrationsPage/components/MappingList.d.ts +11 -0
- package/dist/fe/components/IntegrationsPage/components/MappingList.js +191 -0
- package/dist/fe/components/IntegrationsPage/components/MappingWriteModeFields.d.ts +19 -0
- package/dist/fe/components/IntegrationsPage/components/MappingWriteModeFields.js +150 -0
- package/dist/fe/components/IntegrationsPage/components/MappingsTab.d.ts +5 -0
- package/dist/fe/components/IntegrationsPage/components/MappingsTab.js +154 -0
- package/dist/fe/components/IntegrationsPage/components/PaginationFields.d.ts +9 -0
- package/dist/fe/components/IntegrationsPage/components/PaginationFields.js +218 -0
- package/dist/fe/components/IntegrationsPage/components/ParamBindingRow.d.ts +24 -0
- package/dist/fe/components/IntegrationsPage/components/ParamBindingRow.js +180 -0
- package/dist/fe/components/IntegrationsPage/components/ParamBindingRows.d.ts +33 -0
- package/dist/fe/components/IntegrationsPage/components/ParamBindingRows.js +100 -0
- package/dist/fe/components/IntegrationsPage/components/Primitives.d.ts +65 -0
- package/dist/fe/components/IntegrationsPage/components/Primitives.js +94 -0
- package/dist/fe/components/IntegrationsPage/components/RunConfirmStep.d.ts +10 -0
- package/dist/fe/components/IntegrationsPage/components/RunConfirmStep.js +48 -0
- package/dist/fe/components/IntegrationsPage/components/RunHistory.d.ts +10 -0
- package/dist/fe/components/IntegrationsPage/components/RunHistory.js +124 -0
- package/dist/fe/components/IntegrationsPage/components/RunHistoryRow.d.ts +7 -0
- package/dist/fe/components/IntegrationsPage/components/RunHistoryRow.js +129 -0
- package/dist/fe/components/IntegrationsPage/components/RunPanel.d.ts +9 -0
- package/dist/fe/components/IntegrationsPage/components/RunPanel.js +160 -0
- package/dist/fe/components/IntegrationsPage/components/RunPlanIssues.d.ts +5 -0
- package/dist/fe/components/IntegrationsPage/components/RunPlanIssues.js +43 -0
- package/dist/fe/components/IntegrationsPage/components/RunPlanSummary.d.ts +5 -0
- package/dist/fe/components/IntegrationsPage/components/RunPlanSummary.js +92 -0
- package/dist/fe/components/IntegrationsPage/components/RunProgressBar.d.ts +8 -0
- package/dist/fe/components/IntegrationsPage/components/RunProgressBar.js +77 -0
- package/dist/fe/components/IntegrationsPage/components/RunRevertConflicts.d.ts +13 -0
- package/dist/fe/components/IntegrationsPage/components/RunRevertConflicts.js +65 -0
- package/dist/fe/components/IntegrationsPage/components/RunsTab.d.ts +13 -0
- package/dist/fe/components/IntegrationsPage/components/RunsTab.js +39 -0
- package/dist/fe/components/IntegrationsPage/components/Skeletons.d.ts +9 -0
- package/dist/fe/components/IntegrationsPage/components/Skeletons.js +139 -0
- package/dist/fe/components/IntegrationsPage/components/authOptions.d.ts +29 -0
- package/dist/fe/components/IntegrationsPage/components/authOptions.js +71 -0
- package/dist/fe/components/IntegrationsPage/components/connectionDraft.d.ts +64 -0
- package/dist/fe/components/IntegrationsPage/components/connectionDraft.js +112 -0
- package/dist/fe/components/IntegrationsPage/components/credentialSlots.d.ts +25 -0
- package/dist/fe/components/IntegrationsPage/components/credentialSlots.js +67 -0
- package/dist/fe/components/IntegrationsPage/components/fieldMappingOptions.d.ts +16 -0
- package/dist/fe/components/IntegrationsPage/components/fieldMappingOptions.js +41 -0
- package/dist/fe/components/IntegrationsPage/components/formSupport.d.ts +19 -0
- package/dist/fe/components/IntegrationsPage/components/formSupport.js +25 -0
- package/dist/fe/components/IntegrationsPage/components/mappingDraft.d.ts +40 -0
- package/dist/fe/components/IntegrationsPage/components/mappingDraft.js +44 -0
- package/dist/fe/components/IntegrationsPage/components/pathParams.d.ts +9 -0
- package/dist/fe/components/IntegrationsPage/components/pathParams.js +15 -0
- package/dist/fe/components/IntegrationsPage/components/runFormat.d.ts +33 -0
- package/dist/fe/components/IntegrationsPage/components/runFormat.js +85 -0
- package/dist/fe/components/IntegrationsPage/components/useInfiniteList.d.ts +40 -0
- package/dist/fe/components/IntegrationsPage/components/useInfiniteList.js +110 -0
- package/dist/fe/components/IntegrationsPage/index.d.ts +18 -0
- package/dist/fe/components/IntegrationsPage/index.js +11 -0
- package/dist/fe/components/IntegrationsPage/store/index.d.ts +2 -0
- package/dist/fe/components/IntegrationsPage/store/index.js +124 -0
- package/dist/fe/components/IntegrationsPage/store/state.d.ts +80 -0
- package/dist/fe/components/IntegrationsPage/store/state.js +32 -0
- package/dist/fe/components/IntegrationsPage/theme/index.d.ts +103 -0
- package/dist/fe/components/IntegrationsPage/theme/index.js +113 -0
- package/dist/fe/components/IntegrationsPage/types/actions.d.ts +91 -0
- package/dist/fe/components/IntegrationsPage/types/actions.js +1 -0
- package/dist/fe/components/IntegrationsPage/types/index.d.ts +3 -0
- package/dist/fe/components/IntegrationsPage/types/index.js +3 -0
- package/dist/fe/components/IntegrationsPage/types/records.d.ts +139 -0
- package/dist/fe/components/IntegrationsPage/types/records.js +11 -0
- package/dist/fe/components/IntegrationsPage/types/results.d.ts +52 -0
- package/dist/fe/components/IntegrationsPage/types/results.js +4 -0
- package/dist/fe/index.d.ts +2 -0
- package/dist/fe/index.js +1 -0
- package/dist/index.js +14 -14
- package/dist/src/Client/ApiCaller/system-tables.d.ts +505 -0
- package/dist/src/Client/Proxy/wsProxy.js +25 -1
- package/dist/src/ElysiaPlugin/routes/backup/types.d.ts +3 -1
- package/dist/src/ElysiaPlugin/routes/integrations/index.d.ts +49 -0
- package/dist/src/ElysiaPlugin/routes/integrations/inspect.d.ts +87 -0
- package/dist/src/ElysiaPlugin/routes/integrations/inspectRoutes.d.ts +41 -0
- package/dist/src/ElysiaPlugin/routes/integrations/repository.d.ts +88 -0
- package/dist/src/ElysiaPlugin/routes/integrations/types.d.ts +22 -0
- package/dist/src/ElysiaPlugin/routes/pubsub/frame.d.ts +37 -0
- package/dist/src/ElysiaPlugin/routes/pubsub/frame.test.d.ts +1 -0
- package/dist/src/Services/Backup/BackupService.d.ts +16 -8
- package/dist/src/Services/Backup/types.d.ts +25 -0
- package/dist/src/Services/Integrations/bindings.d.ts +116 -0
- package/dist/src/Services/Integrations/bindings.test.d.ts +1 -0
- package/dist/src/Services/Integrations/collect.d.ts +68 -0
- package/dist/src/Services/Integrations/collect.test.d.ts +1 -0
- package/dist/src/Services/Integrations/fetcher.d.ts +100 -0
- package/dist/src/Services/Integrations/fetcher.test.d.ts +1 -0
- package/dist/src/Services/Integrations/lock.d.ts +77 -0
- package/dist/src/Services/Integrations/lock.test.d.ts +1 -0
- package/dist/src/Services/Integrations/mapping.d.ts +63 -0
- package/dist/src/Services/Integrations/mapping.test.d.ts +1 -0
- package/dist/src/Services/Integrations/oauth.d.ts +89 -0
- package/dist/src/Services/Integrations/oauth.test.d.ts +1 -0
- package/dist/src/Services/Integrations/pagination.d.ts +97 -0
- package/dist/src/Services/Integrations/pagination.test.d.ts +1 -0
- package/dist/src/Services/Integrations/plan.d.ts +74 -0
- package/dist/src/Services/Integrations/plan.test.d.ts +1 -0
- package/dist/src/Services/Integrations/revert.d.ts +78 -0
- package/dist/src/Services/Integrations/revert.test.d.ts +1 -0
- package/dist/src/Services/Integrations/runner.d.ts +126 -0
- package/dist/src/Services/Integrations/runner.test.d.ts +1 -0
- package/dist/src/Services/Integrations/types.d.ts +208 -0
- package/dist/src/Services/Integrations/writer.d.ts +105 -0
- package/dist/src/Services/Integrations/writer.test.d.ts +1 -0
- package/dist/src/Utils/cron.d.ts +65 -0
- package/dist/src/Utils/cron.test.d.ts +1 -0
- package/dist/src/types.d.ts +67 -1
- package/package.json +1 -1
- package/schemas/config.nucleus.json +43 -0
- package/schemas/table.schema.json +2 -1
- package/scripts/generate-schema.test.ts +78 -0
- package/scripts/generate-schema.ts +43 -5
- package/src/system.tables.json +362 -0
|
@@ -72,6 +72,7 @@ interface Config {
|
|
|
72
72
|
payment?: { enabled?: boolean }
|
|
73
73
|
backup?: { enabled?: boolean }
|
|
74
74
|
secrets?: { enabled?: boolean }
|
|
75
|
+
integrations?: { enabled?: boolean }
|
|
75
76
|
monitoring?: { enabled?: boolean; persistence?: { enabled?: boolean } }
|
|
76
77
|
domains?: { enabled?: boolean }
|
|
77
78
|
'multi-tenant'?: { enabled?: boolean }
|
|
@@ -153,6 +154,7 @@ function getEnabledFeatures(config: Config): Set<string> {
|
|
|
153
154
|
if (config.domains?.enabled) features.add('domains')
|
|
154
155
|
if (config.backup?.enabled) features.add('backup')
|
|
155
156
|
if (config.secrets?.enabled) features.add('secrets')
|
|
157
|
+
if (config.integrations?.enabled) features.add('integrations')
|
|
156
158
|
if (config.monitoring?.enabled && config.monitoring?.persistence?.enabled !== false)
|
|
157
159
|
features.add('monitoring')
|
|
158
160
|
const isMultiTenant = config['multi-tenant']?.enabled || config.database?.isMultiTenant
|
|
@@ -166,6 +168,38 @@ function isTableEnabled(table: TableDef, enabledFeatures: Set<string>): boolean
|
|
|
166
168
|
return table.feature_set.every((f) => enabledFeatures.has(f))
|
|
167
169
|
}
|
|
168
170
|
|
|
171
|
+
/**
|
|
172
|
+
* Which merged tables end up in the generated schema.
|
|
173
|
+
*
|
|
174
|
+
* A config entity is always emitted. A system table is emitted only when its
|
|
175
|
+
* feature is on.
|
|
176
|
+
*
|
|
177
|
+
* ⚠️ The trap this closes: "config entity" used to be inferred as "no system
|
|
178
|
+
* table has this name", and those stopped being the same thing the moment a new
|
|
179
|
+
* feature shipped a table under a name an app already used. Adding
|
|
180
|
+
* `integration_sources` to the built-ins made the generator drop the identically
|
|
181
|
+
* named table an app had defined for ITSELF, because that app has not switched
|
|
182
|
+
* the new feature on — and on a deployment with `allowDataLoss` the next schema
|
|
183
|
+
* push then drops the real table and everything in it.
|
|
184
|
+
*
|
|
185
|
+
* Exported for the regression test; the shape is a pure set operation.
|
|
186
|
+
*/
|
|
187
|
+
export function selectEmittedTables<T extends { table_name: string }>(
|
|
188
|
+
allTables: readonly T[],
|
|
189
|
+
sets: {
|
|
190
|
+
systemTableNames: ReadonlySet<string>
|
|
191
|
+
enabledTableNames: ReadonlySet<string>
|
|
192
|
+
customTableNames: ReadonlySet<string>
|
|
193
|
+
}
|
|
194
|
+
): T[] {
|
|
195
|
+
return allTables.filter(
|
|
196
|
+
(t) =>
|
|
197
|
+
sets.customTableNames.has(t.table_name) ||
|
|
198
|
+
!sets.systemTableNames.has(t.table_name) ||
|
|
199
|
+
sets.enabledTableNames.has(t.table_name)
|
|
200
|
+
)
|
|
201
|
+
}
|
|
202
|
+
|
|
169
203
|
function generateColumnCode(col: Column, allTables: string[], currentTable?: string): string {
|
|
170
204
|
const drizzleType = TYPE_MAP[col.type] || 'text'
|
|
171
205
|
let code = ''
|
|
@@ -585,10 +619,11 @@ function main() {
|
|
|
585
619
|
process.exit(1)
|
|
586
620
|
}
|
|
587
621
|
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
622
|
+
const emittedTables = selectEmittedTables(allTables, {
|
|
623
|
+
systemTableNames,
|
|
624
|
+
enabledTableNames,
|
|
625
|
+
customTableNames: new Set(customTables.map((t) => t.table_name)),
|
|
626
|
+
})
|
|
592
627
|
|
|
593
628
|
if (!fs.existsSync(outputDir)) {
|
|
594
629
|
fs.mkdirSync(outputDir, { recursive: true })
|
|
@@ -603,4 +638,7 @@ function main() {
|
|
|
603
638
|
console.log(`Generated: ${path.join(outputDir, 'relations.ts')}`)
|
|
604
639
|
}
|
|
605
640
|
|
|
606
|
-
|
|
641
|
+
// Only when run as a command. Without this guard, importing anything from this
|
|
642
|
+
// file — a test, or another script reusing a helper — executes the CLI, which
|
|
643
|
+
// exits the process on missing arguments.
|
|
644
|
+
if (import.meta.main) main()
|
package/src/system.tables.json
CHANGED
|
@@ -5101,6 +5101,368 @@
|
|
|
5101
5101
|
{ "name": "last_used_at", "type": "timestamptz" }
|
|
5102
5102
|
],
|
|
5103
5103
|
"indexes": [{ "columns": ["scope", "key"], "unique": true }, { "columns": ["scope"] }]
|
|
5104
|
+
},
|
|
5105
|
+
{
|
|
5106
|
+
"table_name": "integration_sources",
|
|
5107
|
+
"feature_set": ["integrations"],
|
|
5108
|
+
"add_base_columns": true,
|
|
5109
|
+
"is_form_data": false,
|
|
5110
|
+
"available_app_ids": ["default_be"],
|
|
5111
|
+
"available_schemas": ["*"],
|
|
5112
|
+
"excluded_schemas": [],
|
|
5113
|
+
"excluded_methods": [],
|
|
5114
|
+
"bulk_endpoints_enabled": false,
|
|
5115
|
+
"group_name": "Integrations",
|
|
5116
|
+
"columns": [
|
|
5117
|
+
{ "name": "name", "type": "varchar", "length": 150, "notNull": true },
|
|
5118
|
+
{
|
|
5119
|
+
"name": "slug",
|
|
5120
|
+
"type": "varchar",
|
|
5121
|
+
"length": 150,
|
|
5122
|
+
"notNull": true,
|
|
5123
|
+
"comment": "Stable machine name; referenced by exports and by operators in logs"
|
|
5124
|
+
},
|
|
5125
|
+
{
|
|
5126
|
+
"name": "base_url",
|
|
5127
|
+
"type": "varchar",
|
|
5128
|
+
"length": 500,
|
|
5129
|
+
"notNull": true,
|
|
5130
|
+
"comment": "Any scheme, host and port — https, plain http, in-cluster DNS, IP. HTTPS is NOT required and must never be enforced: reaching a service inside the same cluster over http is a legitimate deployment."
|
|
5131
|
+
},
|
|
5132
|
+
{ "name": "description", "type": "text" },
|
|
5133
|
+
{ "name": "enabled", "type": "boolean", "default": true },
|
|
5134
|
+
{
|
|
5135
|
+
"name": "auth_type",
|
|
5136
|
+
"type": "varchar",
|
|
5137
|
+
"length": 20,
|
|
5138
|
+
"notNull": true,
|
|
5139
|
+
"default": "none",
|
|
5140
|
+
"enumValues": ["none", "bearer", "api_key", "basic", "oauth2"]
|
|
5141
|
+
},
|
|
5142
|
+
{
|
|
5143
|
+
"name": "auth_token_encrypted",
|
|
5144
|
+
"type": "text",
|
|
5145
|
+
"sensitive": true,
|
|
5146
|
+
"comment": "Static credential (bearer / api key / basic blob), encrypted at rest"
|
|
5147
|
+
},
|
|
5148
|
+
{ "name": "auth_token_hint", "type": "varchar", "length": 24 },
|
|
5149
|
+
{ "name": "auth_header_name", "type": "varchar", "length": 80, "default": "Authorization" },
|
|
5150
|
+
{
|
|
5151
|
+
"name": "auth_query_param",
|
|
5152
|
+
"type": "varchar",
|
|
5153
|
+
"length": 80,
|
|
5154
|
+
"comment": "When set, an api_key credential travels as this query parameter instead of a header"
|
|
5155
|
+
},
|
|
5156
|
+
{ "name": "extra_headers", "type": "jsonb", "default": {} },
|
|
5157
|
+
{ "name": "token_url", "type": "varchar", "length": 500 },
|
|
5158
|
+
{
|
|
5159
|
+
"name": "oauth_grant_type",
|
|
5160
|
+
"type": "varchar",
|
|
5161
|
+
"length": 40,
|
|
5162
|
+
"default": "password",
|
|
5163
|
+
"enumValues": ["password", "client_credentials"]
|
|
5164
|
+
},
|
|
5165
|
+
{ "name": "oauth_client_id", "type": "varchar", "length": 200 },
|
|
5166
|
+
{ "name": "oauth_client_secret_encrypted", "type": "text", "sensitive": true },
|
|
5167
|
+
{ "name": "oauth_client_secret_hint", "type": "varchar", "length": 24 },
|
|
5168
|
+
{ "name": "oauth_username", "type": "varchar", "length": 200 },
|
|
5169
|
+
{ "name": "oauth_password_encrypted", "type": "text", "sensitive": true },
|
|
5170
|
+
{ "name": "oauth_password_hint", "type": "varchar", "length": 24 },
|
|
5171
|
+
{ "name": "oauth_scope", "type": "varchar", "length": 300 },
|
|
5172
|
+
{
|
|
5173
|
+
"name": "oauth_client_auth",
|
|
5174
|
+
"type": "varchar",
|
|
5175
|
+
"length": 20,
|
|
5176
|
+
"default": "basic",
|
|
5177
|
+
"enumValues": ["basic", "body"]
|
|
5178
|
+
},
|
|
5179
|
+
{
|
|
5180
|
+
"name": "tls_verify",
|
|
5181
|
+
"type": "boolean",
|
|
5182
|
+
"notNull": true,
|
|
5183
|
+
"default": true,
|
|
5184
|
+
"comment": "Per-source certificate verification. Turning it off applies to THIS source's connections only — never to the process, which is what a NODE_TLS_REJECT_UNAUTHORIZED toggle would do."
|
|
5185
|
+
},
|
|
5186
|
+
{ "name": "timeout_ms", "type": "integer", "notNull": true, "default": 30000 },
|
|
5187
|
+
{
|
|
5188
|
+
"name": "spec_url",
|
|
5189
|
+
"type": "varchar",
|
|
5190
|
+
"length": 500,
|
|
5191
|
+
"comment": "Optional API description document (OpenAPI/Swagger/Postman/Bruno). Discovery is a convenience: every endpoint can always be defined by hand instead."
|
|
5192
|
+
},
|
|
5193
|
+
{
|
|
5194
|
+
"name": "spec_format",
|
|
5195
|
+
"type": "varchar",
|
|
5196
|
+
"length": 20,
|
|
5197
|
+
"default": "manual",
|
|
5198
|
+
"enumValues": ["manual", "openapi", "swagger", "postman", "bruno", "har"]
|
|
5199
|
+
}
|
|
5200
|
+
],
|
|
5201
|
+
"constraints": {
|
|
5202
|
+
"unique": [{ "name": "uniq_integration_source_slug", "columns": ["slug"] }]
|
|
5203
|
+
},
|
|
5204
|
+
"indexes": [{ "columns": ["enabled"] }]
|
|
5205
|
+
},
|
|
5206
|
+
{
|
|
5207
|
+
"table_name": "integration_endpoints",
|
|
5208
|
+
"feature_set": ["integrations"],
|
|
5209
|
+
"add_base_columns": true,
|
|
5210
|
+
"is_form_data": false,
|
|
5211
|
+
"available_app_ids": ["default_be"],
|
|
5212
|
+
"available_schemas": ["*"],
|
|
5213
|
+
"excluded_schemas": [],
|
|
5214
|
+
"excluded_methods": [],
|
|
5215
|
+
"bulk_endpoints_enabled": false,
|
|
5216
|
+
"group_name": "Integrations",
|
|
5217
|
+
"columns": [
|
|
5218
|
+
{
|
|
5219
|
+
"name": "source_id",
|
|
5220
|
+
"type": "uuid",
|
|
5221
|
+
"notNull": true,
|
|
5222
|
+
"references": { "table": "integrationSources", "column": "id", "onDelete": "cascade" }
|
|
5223
|
+
},
|
|
5224
|
+
{ "name": "tag", "type": "varchar", "length": 120, "notNull": true },
|
|
5225
|
+
{ "name": "name", "type": "varchar", "length": 200 },
|
|
5226
|
+
{
|
|
5227
|
+
"name": "method",
|
|
5228
|
+
"type": "varchar",
|
|
5229
|
+
"length": 10,
|
|
5230
|
+
"notNull": true,
|
|
5231
|
+
"default": "GET",
|
|
5232
|
+
"enumValues": ["GET", "POST", "PUT", "PATCH", "DELETE"]
|
|
5233
|
+
},
|
|
5234
|
+
{
|
|
5235
|
+
"name": "path",
|
|
5236
|
+
"type": "varchar",
|
|
5237
|
+
"length": 500,
|
|
5238
|
+
"notNull": true,
|
|
5239
|
+
"comment": "Appended to the source base URL. May carry {brace} or :colon path tokens, whose values come from param_bindings."
|
|
5240
|
+
},
|
|
5241
|
+
{ "name": "description", "type": "text" },
|
|
5242
|
+
{ "name": "query_params", "type": "jsonb", "default": {} },
|
|
5243
|
+
{ "name": "request_body", "type": "jsonb", "default": {} },
|
|
5244
|
+
{
|
|
5245
|
+
"name": "param_bindings",
|
|
5246
|
+
"type": "jsonb",
|
|
5247
|
+
"default": [],
|
|
5248
|
+
"comment": "Where each path/query parameter comes from: a static value, another endpoint's records (fan-out), or a column of one of our own tables."
|
|
5249
|
+
},
|
|
5250
|
+
{
|
|
5251
|
+
"name": "pagination",
|
|
5252
|
+
"type": "jsonb",
|
|
5253
|
+
"default": {},
|
|
5254
|
+
"comment": "Explicitly chosen paging profile (none/page_number/offset/cursor/link_header). Never guessed — a wrong guess silently imports one page."
|
|
5255
|
+
},
|
|
5256
|
+
{ "name": "response_root_path", "type": "varchar", "length": 200 },
|
|
5257
|
+
{
|
|
5258
|
+
"name": "sample_response",
|
|
5259
|
+
"type": "jsonb",
|
|
5260
|
+
"default": {},
|
|
5261
|
+
"comment": "A few real records captured by a live test, so the mapping screen still shows fields when the source is unreachable"
|
|
5262
|
+
},
|
|
5263
|
+
{ "name": "enabled", "type": "boolean", "default": true }
|
|
5264
|
+
],
|
|
5265
|
+
"indexes": [{ "columns": ["source_id"] }, { "columns": ["source_id", "tag"] }]
|
|
5266
|
+
},
|
|
5267
|
+
{
|
|
5268
|
+
"table_name": "integration_mappings",
|
|
5269
|
+
"feature_set": ["integrations"],
|
|
5270
|
+
"add_base_columns": true,
|
|
5271
|
+
"is_form_data": false,
|
|
5272
|
+
"available_app_ids": ["default_be"],
|
|
5273
|
+
"available_schemas": ["*"],
|
|
5274
|
+
"excluded_schemas": [],
|
|
5275
|
+
"excluded_methods": [],
|
|
5276
|
+
"bulk_endpoints_enabled": false,
|
|
5277
|
+
"group_name": "Integrations",
|
|
5278
|
+
"columns": [
|
|
5279
|
+
{
|
|
5280
|
+
"name": "endpoint_id",
|
|
5281
|
+
"type": "uuid",
|
|
5282
|
+
"notNull": true,
|
|
5283
|
+
"references": { "table": "integrationEndpoints", "column": "id", "onDelete": "cascade" }
|
|
5284
|
+
},
|
|
5285
|
+
{ "name": "name", "type": "varchar", "length": 200, "notNull": true },
|
|
5286
|
+
{
|
|
5287
|
+
"name": "target_entity",
|
|
5288
|
+
"type": "varchar",
|
|
5289
|
+
"length": 120,
|
|
5290
|
+
"notNull": true,
|
|
5291
|
+
"comment": "snake_case table name this mapping writes into"
|
|
5292
|
+
},
|
|
5293
|
+
{ "name": "field_mappings", "type": "jsonb", "notNull": true, "default": [] },
|
|
5294
|
+
{ "name": "dedup_source_field", "type": "varchar", "length": 200 },
|
|
5295
|
+
{
|
|
5296
|
+
"name": "dedup_target_field",
|
|
5297
|
+
"type": "varchar",
|
|
5298
|
+
"length": 200,
|
|
5299
|
+
"comment": "Target column that identifies the same record across runs. Without it nothing can be matched and every run appends."
|
|
5300
|
+
},
|
|
5301
|
+
{
|
|
5302
|
+
"name": "write_mode",
|
|
5303
|
+
"type": "varchar",
|
|
5304
|
+
"length": 20,
|
|
5305
|
+
"notNull": true,
|
|
5306
|
+
"default": "upsert",
|
|
5307
|
+
"enumValues": ["upsert", "append", "replace"],
|
|
5308
|
+
"comment": "replace is the destructive wipe-and-rewrite; it is no longer the default and is gated by the completeness check."
|
|
5309
|
+
},
|
|
5310
|
+
{
|
|
5311
|
+
"name": "missing_record_policy",
|
|
5312
|
+
"type": "varchar",
|
|
5313
|
+
"length": 20,
|
|
5314
|
+
"notNull": true,
|
|
5315
|
+
"default": "ignore",
|
|
5316
|
+
"enumValues": ["ignore", "deactivate", "delete"],
|
|
5317
|
+
"comment": "What happens to a row that exists here but no longer in the source. deactivate is the right answer for most HR data and could not be expressed before."
|
|
5318
|
+
},
|
|
5319
|
+
{ "name": "missing_record_column", "type": "varchar", "length": 120 },
|
|
5320
|
+
{ "name": "missing_record_value", "type": "varchar", "length": 200 },
|
|
5321
|
+
{ "name": "schedule_cron", "type": "varchar", "length": 120 },
|
|
5322
|
+
{
|
|
5323
|
+
"name": "schedule_timezone",
|
|
5324
|
+
"type": "varchar",
|
|
5325
|
+
"length": 64,
|
|
5326
|
+
"comment": "IANA zone the cron expression is read in. Without it a nightly job drifts with the container's clock."
|
|
5327
|
+
},
|
|
5328
|
+
{ "name": "schedule_enabled", "type": "boolean", "notNull": true, "default": false },
|
|
5329
|
+
{ "name": "last_run_at", "type": "timestamptz" },
|
|
5330
|
+
{ "name": "enabled", "type": "boolean", "default": true }
|
|
5331
|
+
],
|
|
5332
|
+
"indexes": [
|
|
5333
|
+
{ "columns": ["endpoint_id"] },
|
|
5334
|
+
{ "columns": ["target_entity"] },
|
|
5335
|
+
{ "columns": ["schedule_enabled"] }
|
|
5336
|
+
]
|
|
5337
|
+
},
|
|
5338
|
+
{
|
|
5339
|
+
"table_name": "integration_runs",
|
|
5340
|
+
"feature_set": ["integrations"],
|
|
5341
|
+
"add_base_columns": true,
|
|
5342
|
+
"is_form_data": false,
|
|
5343
|
+
"available_app_ids": ["default_be"],
|
|
5344
|
+
"available_schemas": ["*"],
|
|
5345
|
+
"excluded_schemas": [],
|
|
5346
|
+
"excluded_methods": ["POST", "PUT", "PATCH", "DELETE"],
|
|
5347
|
+
"bulk_endpoints_enabled": false,
|
|
5348
|
+
"group_name": "Integrations",
|
|
5349
|
+
"columns": [
|
|
5350
|
+
{
|
|
5351
|
+
"name": "mapping_id",
|
|
5352
|
+
"type": "uuid",
|
|
5353
|
+
"references": { "table": "integrationMappings", "column": "id", "onDelete": "set null" },
|
|
5354
|
+
"comment": "Nullable and NOT cascaded: deleting a mapping must not erase the record that it once rewrote a table."
|
|
5355
|
+
},
|
|
5356
|
+
{ "name": "target_entity", "type": "varchar", "length": 120 },
|
|
5357
|
+
{
|
|
5358
|
+
"name": "write_mode",
|
|
5359
|
+
"type": "varchar",
|
|
5360
|
+
"length": 20,
|
|
5361
|
+
"enumValues": ["upsert", "append", "replace"]
|
|
5362
|
+
},
|
|
5363
|
+
{
|
|
5364
|
+
"name": "status",
|
|
5365
|
+
"type": "varchar",
|
|
5366
|
+
"length": 20,
|
|
5367
|
+
"notNull": true,
|
|
5368
|
+
"default": "queued",
|
|
5369
|
+
"enumValues": [
|
|
5370
|
+
"queued",
|
|
5371
|
+
"running",
|
|
5372
|
+
"succeeded",
|
|
5373
|
+
"failed",
|
|
5374
|
+
"cancelled",
|
|
5375
|
+
"reverted"
|
|
5376
|
+
],
|
|
5377
|
+
"comment": "There is deliberately no 'partial': a run either applied in full or not at all."
|
|
5378
|
+
},
|
|
5379
|
+
{
|
|
5380
|
+
"name": "trigger",
|
|
5381
|
+
"type": "varchar",
|
|
5382
|
+
"length": 20,
|
|
5383
|
+
"notNull": true,
|
|
5384
|
+
"default": "manual",
|
|
5385
|
+
"enumValues": ["manual", "schedule", "api"]
|
|
5386
|
+
},
|
|
5387
|
+
{ "name": "total_fetched", "type": "integer", "notNull": true, "default": 0 },
|
|
5388
|
+
{
|
|
5389
|
+
"name": "source_reported_total",
|
|
5390
|
+
"type": "integer",
|
|
5391
|
+
"comment": "What the source said it had. When this and total_fetched disagree, a destructive run refuses to start."
|
|
5392
|
+
},
|
|
5393
|
+
{ "name": "created_count", "type": "integer", "notNull": true, "default": 0 },
|
|
5394
|
+
{ "name": "updated_count", "type": "integer", "notNull": true, "default": 0 },
|
|
5395
|
+
{ "name": "skipped_count", "type": "integer", "notNull": true, "default": 0 },
|
|
5396
|
+
{ "name": "deleted_count", "type": "integer", "notNull": true, "default": 0 },
|
|
5397
|
+
{ "name": "deactivated_count", "type": "integer", "notNull": true, "default": 0 },
|
|
5398
|
+
{ "name": "error_count", "type": "integer", "notNull": true, "default": 0 },
|
|
5399
|
+
{ "name": "external_call_count", "type": "integer", "notNull": true, "default": 0 },
|
|
5400
|
+
{ "name": "issues", "type": "jsonb", "default": [] },
|
|
5401
|
+
{ "name": "errors", "type": "jsonb", "default": [] },
|
|
5402
|
+
{
|
|
5403
|
+
"name": "cancel_requested",
|
|
5404
|
+
"type": "boolean",
|
|
5405
|
+
"notNull": true,
|
|
5406
|
+
"default": false,
|
|
5407
|
+
"comment": "Set by the cancel endpoint; the engine checks it at every batch boundary. A dropped HTTP connection is NOT a cancellation."
|
|
5408
|
+
},
|
|
5409
|
+
{ "name": "started_at", "type": "timestamptz" },
|
|
5410
|
+
{ "name": "finished_at", "type": "timestamptz" },
|
|
5411
|
+
{
|
|
5412
|
+
"name": "pre_images_expire_at",
|
|
5413
|
+
"type": "timestamptz",
|
|
5414
|
+
"comment": "After this, the run can no longer be reverted and the UI says so rather than offering a button that quietly does nothing."
|
|
5415
|
+
},
|
|
5416
|
+
{ "name": "reverted_at", "type": "timestamptz" },
|
|
5417
|
+
{ "name": "reverted_by", "type": "uuid", "references": { "table": "users", "column": "id" } },
|
|
5418
|
+
{ "name": "reverted_run_id", "type": "uuid" }
|
|
5419
|
+
],
|
|
5420
|
+
"indexes": [
|
|
5421
|
+
{ "columns": ["mapping_id"] },
|
|
5422
|
+
{ "columns": ["status"] },
|
|
5423
|
+
{ "columns": ["target_entity"] },
|
|
5424
|
+
{ "columns": ["created_at"] }
|
|
5425
|
+
]
|
|
5426
|
+
},
|
|
5427
|
+
{
|
|
5428
|
+
"table_name": "integration_run_items",
|
|
5429
|
+
"feature_set": ["integrations"],
|
|
5430
|
+
"add_base_columns": true,
|
|
5431
|
+
"is_form_data": false,
|
|
5432
|
+
"available_app_ids": ["default_be"],
|
|
5433
|
+
"available_schemas": ["*"],
|
|
5434
|
+
"excluded_schemas": [],
|
|
5435
|
+
"excluded_methods": ["POST", "PUT", "PATCH", "DELETE"],
|
|
5436
|
+
"bulk_endpoints_enabled": false,
|
|
5437
|
+
"group_name": "Integrations",
|
|
5438
|
+
"columns": [
|
|
5439
|
+
{
|
|
5440
|
+
"name": "run_id",
|
|
5441
|
+
"type": "uuid",
|
|
5442
|
+
"notNull": true,
|
|
5443
|
+
"references": { "table": "integrationRuns", "column": "id", "onDelete": "cascade" }
|
|
5444
|
+
},
|
|
5445
|
+
{ "name": "target_entity", "type": "varchar", "length": 120, "notNull": true },
|
|
5446
|
+
{ "name": "row_id", "type": "uuid" },
|
|
5447
|
+
{
|
|
5448
|
+
"name": "action",
|
|
5449
|
+
"type": "varchar",
|
|
5450
|
+
"length": 20,
|
|
5451
|
+
"notNull": true,
|
|
5452
|
+
"enumValues": ["create", "update", "delete", "deactivate"]
|
|
5453
|
+
},
|
|
5454
|
+
{
|
|
5455
|
+
"name": "before",
|
|
5456
|
+
"type": "jsonb",
|
|
5457
|
+
"comment": "The row as it stood before this run touched it. This is what makes a successful run reversible; the bulk delete path already produced these rows and threw them away."
|
|
5458
|
+
},
|
|
5459
|
+
{ "name": "after", "type": "jsonb" }
|
|
5460
|
+
],
|
|
5461
|
+
"indexes": [
|
|
5462
|
+
{ "columns": ["run_id"] },
|
|
5463
|
+
{ "columns": ["run_id", "action"] },
|
|
5464
|
+
{ "columns": ["target_entity", "row_id"] }
|
|
5465
|
+
]
|
|
5104
5466
|
}
|
|
5105
5467
|
]
|
|
5106
5468
|
}
|