@shipfox/api-integration-core 2.0.0
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/.turbo/turbo-build.log +2 -0
- package/.turbo/turbo-type$colon$emit.log +1 -0
- package/.turbo/turbo-type.log +1 -0
- package/CHANGELOG.md +264 -0
- package/LICENSE +21 -0
- package/dist/config.d.ts +9 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +29 -0
- package/dist/config.js.map +1 -0
- package/dist/core/agent-tool-selection.d.ts +15 -0
- package/dist/core/agent-tool-selection.d.ts.map +1 -0
- package/dist/core/agent-tool-selection.js +48 -0
- package/dist/core/agent-tool-selection.js.map +1 -0
- package/dist/core/entities/connection.d.ts +2 -0
- package/dist/core/entities/connection.d.ts.map +1 -0
- package/dist/core/entities/connection.js +3 -0
- package/dist/core/entities/connection.js.map +1 -0
- package/dist/core/entities/provider.d.ts +6 -0
- package/dist/core/entities/provider.d.ts.map +1 -0
- package/dist/core/entities/provider.js +3 -0
- package/dist/core/entities/provider.js.map +1 -0
- package/dist/core/errors.d.ts +29 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +40 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/providers/agent-tools.d.ts +2 -0
- package/dist/core/providers/agent-tools.d.ts.map +1 -0
- package/dist/core/providers/agent-tools.js +3 -0
- package/dist/core/providers/agent-tools.js.map +1 -0
- package/dist/core/providers/redact-checkout-spec.d.ts +9 -0
- package/dist/core/providers/redact-checkout-spec.d.ts.map +1 -0
- package/dist/core/providers/redact-checkout-spec.js +25 -0
- package/dist/core/providers/redact-checkout-spec.js.map +1 -0
- package/dist/core/providers/registry.d.ts +9 -0
- package/dist/core/providers/registry.d.ts.map +1 -0
- package/dist/core/providers/registry.js +52 -0
- package/dist/core/providers/registry.js.map +1 -0
- package/dist/core/providers/source-control.d.ts +2 -0
- package/dist/core/providers/source-control.d.ts.map +1 -0
- package/dist/core/providers/source-control.js +3 -0
- package/dist/core/providers/source-control.js.map +1 -0
- package/dist/core/source-control-service.d.ts +46 -0
- package/dist/core/source-control-service.d.ts.map +1 -0
- package/dist/core/source-control-service.js +84 -0
- package/dist/core/source-control-service.js.map +1 -0
- package/dist/db/connections.d.ts +67 -0
- package/dist/db/connections.d.ts.map +1 -0
- package/dist/db/connections.js +130 -0
- package/dist/db/connections.js.map +1 -0
- package/dist/db/db.d.ts +865 -0
- package/dist/db/db.d.ts.map +1 -0
- package/dist/db/db.js +22 -0
- package/dist/db/db.js.map +1 -0
- package/dist/db/migrations.d.ts +2 -0
- package/dist/db/migrations.d.ts.map +1 -0
- package/dist/db/migrations.js +5 -0
- package/dist/db/migrations.js.map +1 -0
- package/dist/db/schema/common.d.ts +2 -0
- package/dist/db/schema/common.d.ts.map +1 -0
- package/dist/db/schema/common.js +4 -0
- package/dist/db/schema/common.js.map +1 -0
- package/dist/db/schema/connections.d.ts +165 -0
- package/dist/db/schema/connections.d.ts.map +1 -0
- package/dist/db/schema/connections.js +37 -0
- package/dist/db/schema/connections.js.map +1 -0
- package/dist/db/schema/outbox.d.ts +195 -0
- package/dist/db/schema/outbox.d.ts.map +1 -0
- package/dist/db/schema/outbox.js +5 -0
- package/dist/db/schema/outbox.js.map +1 -0
- package/dist/db/schema/webhook-deliveries.d.ts +76 -0
- package/dist/db/schema/webhook-deliveries.d.ts.map +1 -0
- package/dist/db/schema/webhook-deliveries.js +22 -0
- package/dist/db/schema/webhook-deliveries.js.map +1 -0
- package/dist/db/webhook-deliveries.d.ts +55 -0
- package/dist/db/webhook-deliveries.d.ts.map +1 -0
- package/dist/db/webhook-deliveries.js +132 -0
- package/dist/db/webhook-deliveries.js.map +1 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +105 -0
- package/dist/index.js.map +1 -0
- package/dist/metrics/index.d.ts +2 -0
- package/dist/metrics/index.d.ts.map +1 -0
- package/dist/metrics/index.js +3 -0
- package/dist/metrics/index.js.map +1 -0
- package/dist/metrics/instance.d.ts +8 -0
- package/dist/metrics/instance.d.ts.map +1 -0
- package/dist/metrics/instance.js +17 -0
- package/dist/metrics/instance.js.map +1 -0
- package/dist/presentation/dto/integrations.d.ts +36 -0
- package/dist/presentation/dto/integrations.d.ts.map +1 -0
- package/dist/presentation/dto/integrations.js +26 -0
- package/dist/presentation/dto/integrations.js.map +1 -0
- package/dist/presentation/routes/agent-tools-gateway/audit.d.ts +24 -0
- package/dist/presentation/routes/agent-tools-gateway/audit.d.ts.map +1 -0
- package/dist/presentation/routes/agent-tools-gateway/audit.js +52 -0
- package/dist/presentation/routes/agent-tools-gateway/audit.js.map +1 -0
- package/dist/presentation/routes/agent-tools-gateway/dispatch.d.ts +7 -0
- package/dist/presentation/routes/agent-tools-gateway/dispatch.d.ts.map +1 -0
- package/dist/presentation/routes/agent-tools-gateway/dispatch.js +108 -0
- package/dist/presentation/routes/agent-tools-gateway/dispatch.js.map +1 -0
- package/dist/presentation/routes/agent-tools-gateway/index.d.ts +12 -0
- package/dist/presentation/routes/agent-tools-gateway/index.d.ts.map +1 -0
- package/dist/presentation/routes/agent-tools-gateway/index.js +46 -0
- package/dist/presentation/routes/agent-tools-gateway/index.js.map +1 -0
- package/dist/presentation/routes/agent-tools-gateway/mcp-server.d.ts +17 -0
- package/dist/presentation/routes/agent-tools-gateway/mcp-server.d.ts.map +1 -0
- package/dist/presentation/routes/agent-tools-gateway/mcp-server.js +126 -0
- package/dist/presentation/routes/agent-tools-gateway/mcp-server.js.map +1 -0
- package/dist/presentation/routes/agent-tools-gateway/resolve-authorized-tools.d.ts +37 -0
- package/dist/presentation/routes/agent-tools-gateway/resolve-authorized-tools.d.ts.map +1 -0
- package/dist/presentation/routes/agent-tools-gateway/resolve-authorized-tools.js +145 -0
- package/dist/presentation/routes/agent-tools-gateway/resolve-authorized-tools.js.map +1 -0
- package/dist/presentation/routes/errors.d.ts +2 -0
- package/dist/presentation/routes/errors.d.ts.map +1 -0
- package/dist/presentation/routes/errors.js +53 -0
- package/dist/presentation/routes/errors.js.map +1 -0
- package/dist/presentation/routes/index.d.ts +14 -0
- package/dist/presentation/routes/index.d.ts.map +1 -0
- package/dist/presentation/routes/index.js +26 -0
- package/dist/presentation/routes/index.js.map +1 -0
- package/dist/presentation/routes/list-connections.d.ts +3 -0
- package/dist/presentation/routes/list-connections.d.ts.map +1 -0
- package/dist/presentation/routes/list-connections.js +58 -0
- package/dist/presentation/routes/list-connections.js.map +1 -0
- package/dist/presentation/routes/list-providers.d.ts +3 -0
- package/dist/presentation/routes/list-providers.d.ts.map +1 -0
- package/dist/presentation/routes/list-providers.js +27 -0
- package/dist/presentation/routes/list-providers.js.map +1 -0
- package/dist/presentation/routes/list-repositories.d.ts +3 -0
- package/dist/presentation/routes/list-repositories.d.ts.map +1 -0
- package/dist/presentation/routes/list-repositories.js +41 -0
- package/dist/presentation/routes/list-repositories.js.map +1 -0
- package/dist/presentation/routes/manage-connections.d.ts +4 -0
- package/dist/presentation/routes/manage-connections.d.ts.map +1 -0
- package/dist/presentation/routes/manage-connections.js +81 -0
- package/dist/presentation/routes/manage-connections.js.map +1 -0
- package/dist/providers/connection-slug.d.ts +2 -0
- package/dist/providers/connection-slug.d.ts.map +1 -0
- package/dist/providers/connection-slug.js +19 -0
- package/dist/providers/connection-slug.js.map +1 -0
- package/dist/providers/cron.d.ts +3 -0
- package/dist/providers/cron.d.ts.map +1 -0
- package/dist/providers/cron.js +13 -0
- package/dist/providers/cron.js.map +1 -0
- package/dist/providers/gitea.d.ts +3 -0
- package/dist/providers/gitea.d.ts.map +1 -0
- package/dist/providers/gitea.js +75 -0
- package/dist/providers/gitea.js.map +1 -0
- package/dist/providers/github.d.ts +3 -0
- package/dist/providers/github.d.ts.map +1 -0
- package/dist/providers/github.js +109 -0
- package/dist/providers/github.js.map +1 -0
- package/dist/providers/linear.d.ts +3 -0
- package/dist/providers/linear.d.ts.map +1 -0
- package/dist/providers/linear.js +134 -0
- package/dist/providers/linear.js.map +1 -0
- package/dist/providers/modules.d.ts +3 -0
- package/dist/providers/modules.d.ts.map +1 -0
- package/dist/providers/modules.js +26 -0
- package/dist/providers/modules.js.map +1 -0
- package/dist/providers/sentry.d.ts +3 -0
- package/dist/providers/sentry.d.ts.map +1 -0
- package/dist/providers/sentry.js +83 -0
- package/dist/providers/sentry.js.map +1 -0
- package/dist/providers/types.d.ts +58 -0
- package/dist/providers/types.d.ts.map +1 -0
- package/dist/providers/types.js +3 -0
- package/dist/providers/types.js.map +1 -0
- package/dist/providers/webhook.d.ts +3 -0
- package/dist/providers/webhook.d.ts.map +1 -0
- package/dist/providers/webhook.js +24 -0
- package/dist/providers/webhook.js.map +1 -0
- package/dist/temporal/activities/index.d.ts +5 -0
- package/dist/temporal/activities/index.d.ts.map +1 -0
- package/dist/temporal/activities/index.js +8 -0
- package/dist/temporal/activities/index.js.map +1 -0
- package/dist/temporal/activities/prune-webhook-deliveries.d.ts +4 -0
- package/dist/temporal/activities/prune-webhook-deliveries.d.ts.map +1 -0
- package/dist/temporal/activities/prune-webhook-deliveries.js +11 -0
- package/dist/temporal/activities/prune-webhook-deliveries.js.map +1 -0
- package/dist/temporal/constants.d.ts +3 -0
- package/dist/temporal/constants.d.ts.map +1 -0
- package/dist/temporal/constants.js +4 -0
- package/dist/temporal/constants.js.map +1 -0
- package/dist/temporal/workflows/index.d.ts +2 -0
- package/dist/temporal/workflows/index.d.ts.map +1 -0
- package/dist/temporal/workflows/index.js +3 -0
- package/dist/temporal/workflows/index.js.map +1 -0
- package/dist/temporal/workflows/prune-webhook-deliveries-cron.d.ts +2 -0
- package/dist/temporal/workflows/prune-webhook-deliveries-cron.d.ts.map +1 -0
- package/dist/temporal/workflows/prune-webhook-deliveries-cron.js +14 -0
- package/dist/temporal/workflows/prune-webhook-deliveries-cron.js.map +1 -0
- package/dist/tsconfig.test.tsbuildinfo +1 -0
- package/drizzle/0000_initial.sql +41 -0
- package/drizzle/meta/0001_snapshot.json +341 -0
- package/drizzle/meta/_journal.json +13 -0
- package/drizzle.config.ts +7 -0
- package/package.json +85 -0
- package/src/config.test.ts +32 -0
- package/src/config.ts +28 -0
- package/src/core/agent-tool-selection.test.ts +137 -0
- package/src/core/agent-tool-selection.ts +80 -0
- package/src/core/entities/connection.ts +4 -0
- package/src/core/entities/provider.ts +21 -0
- package/src/core/errors.ts +55 -0
- package/src/core/providers/agent-tools.ts +10 -0
- package/src/core/providers/redact-checkout-spec.test.ts +78 -0
- package/src/core/providers/redact-checkout-spec.ts +20 -0
- package/src/core/providers/registry.test.ts +138 -0
- package/src/core/providers/registry.ts +90 -0
- package/src/core/providers/source-control.ts +17 -0
- package/src/core/source-control-service.test.ts +230 -0
- package/src/core/source-control-service.ts +161 -0
- package/src/db/connections.test.ts +296 -0
- package/src/db/connections.ts +262 -0
- package/src/db/db.ts +22 -0
- package/src/db/migrations.ts +4 -0
- package/src/db/schema/common.ts +3 -0
- package/src/db/schema/connections.ts +49 -0
- package/src/db/schema/outbox.ts +4 -0
- package/src/db/schema/webhook-deliveries.ts +19 -0
- package/src/db/webhook-deliveries.test.ts +267 -0
- package/src/db/webhook-deliveries.ts +207 -0
- package/src/index.ts +212 -0
- package/src/metrics/index.ts +1 -0
- package/src/metrics/instance.ts +35 -0
- package/src/presentation/dto/integrations.ts +39 -0
- package/src/presentation/routes/agent-tools-gateway/agent-tools-gateway.route.test.ts +371 -0
- package/src/presentation/routes/agent-tools-gateway/audit.test.ts +86 -0
- package/src/presentation/routes/agent-tools-gateway/audit.ts +90 -0
- package/src/presentation/routes/agent-tools-gateway/dispatch.ts +139 -0
- package/src/presentation/routes/agent-tools-gateway/index.ts +62 -0
- package/src/presentation/routes/agent-tools-gateway/mcp-server.test.ts +308 -0
- package/src/presentation/routes/agent-tools-gateway/mcp-server.ts +155 -0
- package/src/presentation/routes/agent-tools-gateway/resolve-authorized-tools.test.ts +181 -0
- package/src/presentation/routes/agent-tools-gateway/resolve-authorized-tools.ts +245 -0
- package/src/presentation/routes/errors.ts +63 -0
- package/src/presentation/routes/index.ts +53 -0
- package/src/presentation/routes/list-connections.test.ts +227 -0
- package/src/presentation/routes/list-connections.ts +56 -0
- package/src/presentation/routes/list-providers.test.ts +113 -0
- package/src/presentation/routes/list-providers.ts +28 -0
- package/src/presentation/routes/list-repositories.test.ts +150 -0
- package/src/presentation/routes/list-repositories.ts +47 -0
- package/src/presentation/routes/manage-connections.test.ts +125 -0
- package/src/presentation/routes/manage-connections.ts +77 -0
- package/src/providers/connection-slug.ts +19 -0
- package/src/providers/cron.ts +13 -0
- package/src/providers/gitea.ts +103 -0
- package/src/providers/github.ts +150 -0
- package/src/providers/linear.ts +179 -0
- package/src/providers/modules.test.ts +40 -0
- package/src/providers/modules.ts +32 -0
- package/src/providers/sentry.ts +113 -0
- package/src/providers/types.ts +52 -0
- package/src/providers/webhook.ts +30 -0
- package/src/temporal/activities/index.ts +7 -0
- package/src/temporal/activities/prune-webhook-deliveries.test.ts +39 -0
- package/src/temporal/activities/prune-webhook-deliveries.ts +9 -0
- package/src/temporal/constants.ts +3 -0
- package/src/temporal/workflows/index.ts +1 -0
- package/src/temporal/workflows/prune-webhook-deliveries-cron.ts +15 -0
- package/test/agent-tools-gateway-helpers.ts +210 -0
- package/test/env.ts +23 -0
- package/test/factories/connection.ts +21 -0
- package/test/globalSetup.ts +22 -0
- package/test/index.ts +1 -0
- package/test/route-utils.ts +104 -0
- package/test/setup.ts +19 -0
- package/tsconfig.build.json +9 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +3 -0
- package/tsconfig.test.json +8 -0
- package/vitest.config.ts +13 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../src/db/db.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,cAAc,EAAC,MAAM,uBAAuB,CAAC;AAMnE,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIlB,CAAC;AAIF,wBAAgB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAGjB;AAED,wBAAgB,OAAO,IAAI,IAAI,CAE9B"}
|
package/dist/db/db.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { drizzle } from '@shipfox/node-drizzle';
|
|
2
|
+
import { pgClient } from '@shipfox/node-postgres';
|
|
3
|
+
import { integrationConnections } from './schema/connections.js';
|
|
4
|
+
import { integrationsOutbox } from './schema/outbox.js';
|
|
5
|
+
import { integrationsWebhookDeliveries } from './schema/webhook-deliveries.js';
|
|
6
|
+
export const schema = {
|
|
7
|
+
integrationConnections,
|
|
8
|
+
integrationsOutbox,
|
|
9
|
+
integrationsWebhookDeliveries
|
|
10
|
+
};
|
|
11
|
+
let _db;
|
|
12
|
+
export function db() {
|
|
13
|
+
if (!_db) _db = drizzle(pgClient(), {
|
|
14
|
+
schema
|
|
15
|
+
});
|
|
16
|
+
return _db;
|
|
17
|
+
}
|
|
18
|
+
export function closeDb() {
|
|
19
|
+
_db = undefined;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=db.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/db/db.ts"],"sourcesContent":["import {drizzle, type NodePgDatabase} from '@shipfox/node-drizzle';\nimport {pgClient} from '@shipfox/node-postgres';\nimport {integrationConnections} from './schema/connections.js';\nimport {integrationsOutbox} from './schema/outbox.js';\nimport {integrationsWebhookDeliveries} from './schema/webhook-deliveries.js';\n\nexport const schema = {\n integrationConnections,\n integrationsOutbox,\n integrationsWebhookDeliveries,\n};\n\nlet _db: NodePgDatabase<typeof schema> | undefined;\n\nexport function db() {\n if (!_db) _db = drizzle(pgClient(), {schema});\n return _db;\n}\n\nexport function closeDb(): void {\n _db = undefined;\n}\n"],"names":["drizzle","pgClient","integrationConnections","integrationsOutbox","integrationsWebhookDeliveries","schema","_db","db","closeDb","undefined"],"mappings":"AAAA,SAAQA,OAAO,QAA4B,wBAAwB;AACnE,SAAQC,QAAQ,QAAO,yBAAyB;AAChD,SAAQC,sBAAsB,QAAO,0BAA0B;AAC/D,SAAQC,kBAAkB,QAAO,qBAAqB;AACtD,SAAQC,6BAA6B,QAAO,iCAAiC;AAE7E,OAAO,MAAMC,SAAS;IACpBH;IACAC;IACAC;AACF,EAAE;AAEF,IAAIE;AAEJ,OAAO,SAASC;IACd,IAAI,CAACD,KAAKA,MAAMN,QAAQC,YAAY;QAACI;IAAM;IAC3C,OAAOC;AACT;AAEA,OAAO,SAASE;IACdF,MAAMG;AACR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../src/db/migrations.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc,QAAoE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/db/migrations.ts"],"sourcesContent":["import {dirname, resolve} from 'node:path';\nimport {fileURLToPath} from 'node:url';\n\nexport const migrationsPath = resolve(dirname(fileURLToPath(import.meta.url)), '../../drizzle');\n"],"names":["dirname","resolve","fileURLToPath","migrationsPath","url"],"mappings":"AAAA,SAAQA,OAAO,EAAEC,OAAO,QAAO,YAAY;AAC3C,SAAQC,aAAa,QAAO,WAAW;AAEvC,OAAO,MAAMC,iBAAiBF,QAAQD,QAAQE,cAAc,YAAYE,GAAG,IAAI,iBAAiB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/db/schema/common.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,oDAAmD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/db/schema/common.ts"],"sourcesContent":["import {pgTableCreator} from 'drizzle-orm/pg-core';\n\nexport const pgTable = pgTableCreator((name) => `integrations_${name}`);\n"],"names":["pgTableCreator","pgTable","name"],"mappings":"AAAA,SAAQA,cAAc,QAAO,sBAAsB;AAEnD,OAAO,MAAMC,UAAUD,eAAe,CAACE,OAAS,CAAC,aAAa,EAAEA,MAAM,EAAE"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import type { IntegrationConnection } from '#core/entities/connection.js';
|
|
2
|
+
export declare const integrationConnections: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
3
|
+
name: "connections";
|
|
4
|
+
schema: undefined;
|
|
5
|
+
columns: {
|
|
6
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
7
|
+
name: "id";
|
|
8
|
+
tableName: "connections";
|
|
9
|
+
dataType: "string";
|
|
10
|
+
columnType: "PgUUID";
|
|
11
|
+
data: string;
|
|
12
|
+
driverParam: string;
|
|
13
|
+
notNull: true;
|
|
14
|
+
hasDefault: true;
|
|
15
|
+
isPrimaryKey: true;
|
|
16
|
+
isAutoincrement: false;
|
|
17
|
+
hasRuntimeDefault: false;
|
|
18
|
+
enumValues: undefined;
|
|
19
|
+
baseColumn: never;
|
|
20
|
+
identity: undefined;
|
|
21
|
+
generated: undefined;
|
|
22
|
+
}, {}, {}>;
|
|
23
|
+
workspaceId: import("drizzle-orm/pg-core").PgColumn<{
|
|
24
|
+
name: "workspace_id";
|
|
25
|
+
tableName: "connections";
|
|
26
|
+
dataType: "string";
|
|
27
|
+
columnType: "PgUUID";
|
|
28
|
+
data: string;
|
|
29
|
+
driverParam: string;
|
|
30
|
+
notNull: true;
|
|
31
|
+
hasDefault: false;
|
|
32
|
+
isPrimaryKey: false;
|
|
33
|
+
isAutoincrement: false;
|
|
34
|
+
hasRuntimeDefault: false;
|
|
35
|
+
enumValues: undefined;
|
|
36
|
+
baseColumn: never;
|
|
37
|
+
identity: undefined;
|
|
38
|
+
generated: undefined;
|
|
39
|
+
}, {}, {}>;
|
|
40
|
+
provider: import("drizzle-orm/pg-core").PgColumn<{
|
|
41
|
+
name: "provider";
|
|
42
|
+
tableName: "connections";
|
|
43
|
+
dataType: "string";
|
|
44
|
+
columnType: "PgText";
|
|
45
|
+
data: string;
|
|
46
|
+
driverParam: string;
|
|
47
|
+
notNull: true;
|
|
48
|
+
hasDefault: false;
|
|
49
|
+
isPrimaryKey: false;
|
|
50
|
+
isAutoincrement: false;
|
|
51
|
+
hasRuntimeDefault: false;
|
|
52
|
+
enumValues: [string, ...string[]];
|
|
53
|
+
baseColumn: never;
|
|
54
|
+
identity: undefined;
|
|
55
|
+
generated: undefined;
|
|
56
|
+
}, {}, {}>;
|
|
57
|
+
externalAccountId: import("drizzle-orm/pg-core").PgColumn<{
|
|
58
|
+
name: "external_account_id";
|
|
59
|
+
tableName: "connections";
|
|
60
|
+
dataType: "string";
|
|
61
|
+
columnType: "PgText";
|
|
62
|
+
data: string;
|
|
63
|
+
driverParam: string;
|
|
64
|
+
notNull: true;
|
|
65
|
+
hasDefault: false;
|
|
66
|
+
isPrimaryKey: false;
|
|
67
|
+
isAutoincrement: false;
|
|
68
|
+
hasRuntimeDefault: false;
|
|
69
|
+
enumValues: [string, ...string[]];
|
|
70
|
+
baseColumn: never;
|
|
71
|
+
identity: undefined;
|
|
72
|
+
generated: undefined;
|
|
73
|
+
}, {}, {}>;
|
|
74
|
+
slug: import("drizzle-orm/pg-core").PgColumn<{
|
|
75
|
+
name: "slug";
|
|
76
|
+
tableName: "connections";
|
|
77
|
+
dataType: "string";
|
|
78
|
+
columnType: "PgText";
|
|
79
|
+
data: string;
|
|
80
|
+
driverParam: string;
|
|
81
|
+
notNull: true;
|
|
82
|
+
hasDefault: false;
|
|
83
|
+
isPrimaryKey: false;
|
|
84
|
+
isAutoincrement: false;
|
|
85
|
+
hasRuntimeDefault: false;
|
|
86
|
+
enumValues: [string, ...string[]];
|
|
87
|
+
baseColumn: never;
|
|
88
|
+
identity: undefined;
|
|
89
|
+
generated: undefined;
|
|
90
|
+
}, {}, {}>;
|
|
91
|
+
displayName: import("drizzle-orm/pg-core").PgColumn<{
|
|
92
|
+
name: "display_name";
|
|
93
|
+
tableName: "connections";
|
|
94
|
+
dataType: "string";
|
|
95
|
+
columnType: "PgText";
|
|
96
|
+
data: string;
|
|
97
|
+
driverParam: string;
|
|
98
|
+
notNull: true;
|
|
99
|
+
hasDefault: false;
|
|
100
|
+
isPrimaryKey: false;
|
|
101
|
+
isAutoincrement: false;
|
|
102
|
+
hasRuntimeDefault: false;
|
|
103
|
+
enumValues: [string, ...string[]];
|
|
104
|
+
baseColumn: never;
|
|
105
|
+
identity: undefined;
|
|
106
|
+
generated: undefined;
|
|
107
|
+
}, {}, {}>;
|
|
108
|
+
lifecycleStatus: import("drizzle-orm/pg-core").PgColumn<{
|
|
109
|
+
name: "lifecycle_status";
|
|
110
|
+
tableName: "connections";
|
|
111
|
+
dataType: "string";
|
|
112
|
+
columnType: "PgText";
|
|
113
|
+
data: string;
|
|
114
|
+
driverParam: string;
|
|
115
|
+
notNull: true;
|
|
116
|
+
hasDefault: true;
|
|
117
|
+
isPrimaryKey: false;
|
|
118
|
+
isAutoincrement: false;
|
|
119
|
+
hasRuntimeDefault: false;
|
|
120
|
+
enumValues: [string, ...string[]];
|
|
121
|
+
baseColumn: never;
|
|
122
|
+
identity: undefined;
|
|
123
|
+
generated: undefined;
|
|
124
|
+
}, {}, {}>;
|
|
125
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
126
|
+
name: "created_at";
|
|
127
|
+
tableName: "connections";
|
|
128
|
+
dataType: "date";
|
|
129
|
+
columnType: "PgTimestamp";
|
|
130
|
+
data: Date;
|
|
131
|
+
driverParam: string;
|
|
132
|
+
notNull: true;
|
|
133
|
+
hasDefault: true;
|
|
134
|
+
isPrimaryKey: false;
|
|
135
|
+
isAutoincrement: false;
|
|
136
|
+
hasRuntimeDefault: false;
|
|
137
|
+
enumValues: undefined;
|
|
138
|
+
baseColumn: never;
|
|
139
|
+
identity: undefined;
|
|
140
|
+
generated: undefined;
|
|
141
|
+
}, {}, {}>;
|
|
142
|
+
updatedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
143
|
+
name: "updated_at";
|
|
144
|
+
tableName: "connections";
|
|
145
|
+
dataType: "date";
|
|
146
|
+
columnType: "PgTimestamp";
|
|
147
|
+
data: Date;
|
|
148
|
+
driverParam: string;
|
|
149
|
+
notNull: true;
|
|
150
|
+
hasDefault: true;
|
|
151
|
+
isPrimaryKey: false;
|
|
152
|
+
isAutoincrement: false;
|
|
153
|
+
hasRuntimeDefault: false;
|
|
154
|
+
enumValues: undefined;
|
|
155
|
+
baseColumn: never;
|
|
156
|
+
identity: undefined;
|
|
157
|
+
generated: undefined;
|
|
158
|
+
}, {}, {}>;
|
|
159
|
+
};
|
|
160
|
+
dialect: "pg";
|
|
161
|
+
}>;
|
|
162
|
+
export type IntegrationConnectionDb = typeof integrationConnections.$inferSelect;
|
|
163
|
+
export type IntegrationConnectionCreateDb = typeof integrationConnections.$inferInsert;
|
|
164
|
+
export declare function toIntegrationConnection(row: IntegrationConnectionDb): IntegrationConnection;
|
|
165
|
+
//# sourceMappingURL=connections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connections.d.ts","sourceRoot":"","sources":["../../../src/db/schema/connections.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,qBAAqB,EAEtB,MAAM,8BAA8B,CAAC;AAItC,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsBlC,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,OAAO,sBAAsB,CAAC,YAAY,CAAC;AACjF,MAAM,MAAM,6BAA6B,GAAG,OAAO,sBAAsB,CAAC,YAAY,CAAC;AAEvF,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,uBAAuB,GAAG,qBAAqB,CAY3F"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { uuidv7PrimaryKey } from '@shipfox/node-drizzle';
|
|
2
|
+
import { index, text, timestamp, uniqueIndex, uuid } from 'drizzle-orm/pg-core';
|
|
3
|
+
import { pgTable } from './common.js';
|
|
4
|
+
export const integrationConnections = pgTable('connections', {
|
|
5
|
+
id: uuidv7PrimaryKey(),
|
|
6
|
+
workspaceId: uuid('workspace_id').notNull(),
|
|
7
|
+
provider: text('provider').notNull(),
|
|
8
|
+
externalAccountId: text('external_account_id').notNull(),
|
|
9
|
+
slug: text('slug').notNull(),
|
|
10
|
+
displayName: text('display_name').notNull(),
|
|
11
|
+
lifecycleStatus: text('lifecycle_status').notNull().default('active'),
|
|
12
|
+
createdAt: timestamp('created_at', {
|
|
13
|
+
withTimezone: true
|
|
14
|
+
}).notNull().defaultNow(),
|
|
15
|
+
updatedAt: timestamp('updated_at', {
|
|
16
|
+
withTimezone: true
|
|
17
|
+
}).notNull().defaultNow()
|
|
18
|
+
}, (table)=>[
|
|
19
|
+
uniqueIndex('integrations_connections_workspace_external_unique').on(table.workspaceId, table.provider, table.externalAccountId),
|
|
20
|
+
uniqueIndex('integrations_connections_workspace_slug_unique').on(table.workspaceId, table.slug),
|
|
21
|
+
index('integrations_connections_workspace_id_idx').on(table.workspaceId)
|
|
22
|
+
]);
|
|
23
|
+
export function toIntegrationConnection(row) {
|
|
24
|
+
return {
|
|
25
|
+
id: row.id,
|
|
26
|
+
workspaceId: row.workspaceId,
|
|
27
|
+
provider: row.provider,
|
|
28
|
+
externalAccountId: row.externalAccountId,
|
|
29
|
+
slug: row.slug,
|
|
30
|
+
displayName: row.displayName,
|
|
31
|
+
lifecycleStatus: row.lifecycleStatus,
|
|
32
|
+
createdAt: row.createdAt,
|
|
33
|
+
updatedAt: row.updatedAt
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=connections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/db/schema/connections.ts"],"sourcesContent":["import {uuidv7PrimaryKey} from '@shipfox/node-drizzle';\nimport {index, text, timestamp, uniqueIndex, uuid} from 'drizzle-orm/pg-core';\nimport type {\n IntegrationConnection,\n IntegrationConnectionLifecycleStatus,\n} from '#core/entities/connection.js';\nimport type {IntegrationProviderKind} from '#core/entities/provider.js';\nimport {pgTable} from './common.js';\n\nexport const integrationConnections = pgTable(\n 'connections',\n {\n id: uuidv7PrimaryKey(),\n workspaceId: uuid('workspace_id').notNull(),\n provider: text('provider').notNull(),\n externalAccountId: text('external_account_id').notNull(),\n slug: text('slug').notNull(),\n displayName: text('display_name').notNull(),\n lifecycleStatus: text('lifecycle_status').notNull().default('active'),\n createdAt: timestamp('created_at', {withTimezone: true}).notNull().defaultNow(),\n updatedAt: timestamp('updated_at', {withTimezone: true}).notNull().defaultNow(),\n },\n (table) => [\n uniqueIndex('integrations_connections_workspace_external_unique').on(\n table.workspaceId,\n table.provider,\n table.externalAccountId,\n ),\n uniqueIndex('integrations_connections_workspace_slug_unique').on(table.workspaceId, table.slug),\n index('integrations_connections_workspace_id_idx').on(table.workspaceId),\n ],\n);\n\nexport type IntegrationConnectionDb = typeof integrationConnections.$inferSelect;\nexport type IntegrationConnectionCreateDb = typeof integrationConnections.$inferInsert;\n\nexport function toIntegrationConnection(row: IntegrationConnectionDb): IntegrationConnection {\n return {\n id: row.id,\n workspaceId: row.workspaceId,\n provider: row.provider as IntegrationProviderKind,\n externalAccountId: row.externalAccountId,\n slug: row.slug,\n displayName: row.displayName,\n lifecycleStatus: row.lifecycleStatus as IntegrationConnectionLifecycleStatus,\n createdAt: row.createdAt,\n updatedAt: row.updatedAt,\n };\n}\n"],"names":["uuidv7PrimaryKey","index","text","timestamp","uniqueIndex","uuid","pgTable","integrationConnections","id","workspaceId","notNull","provider","externalAccountId","slug","displayName","lifecycleStatus","default","createdAt","withTimezone","defaultNow","updatedAt","table","on","toIntegrationConnection","row"],"mappings":"AAAA,SAAQA,gBAAgB,QAAO,wBAAwB;AACvD,SAAQC,KAAK,EAAEC,IAAI,EAAEC,SAAS,EAAEC,WAAW,EAAEC,IAAI,QAAO,sBAAsB;AAM9E,SAAQC,OAAO,QAAO,cAAc;AAEpC,OAAO,MAAMC,yBAAyBD,QACpC,eACA;IACEE,IAAIR;IACJS,aAAaJ,KAAK,gBAAgBK,OAAO;IACzCC,UAAUT,KAAK,YAAYQ,OAAO;IAClCE,mBAAmBV,KAAK,uBAAuBQ,OAAO;IACtDG,MAAMX,KAAK,QAAQQ,OAAO;IAC1BI,aAAaZ,KAAK,gBAAgBQ,OAAO;IACzCK,iBAAiBb,KAAK,oBAAoBQ,OAAO,GAAGM,OAAO,CAAC;IAC5DC,WAAWd,UAAU,cAAc;QAACe,cAAc;IAAI,GAAGR,OAAO,GAAGS,UAAU;IAC7EC,WAAWjB,UAAU,cAAc;QAACe,cAAc;IAAI,GAAGR,OAAO,GAAGS,UAAU;AAC/E,GACA,CAACE,QAAU;QACTjB,YAAY,sDAAsDkB,EAAE,CAClED,MAAMZ,WAAW,EACjBY,MAAMV,QAAQ,EACdU,MAAMT,iBAAiB;QAEzBR,YAAY,kDAAkDkB,EAAE,CAACD,MAAMZ,WAAW,EAAEY,MAAMR,IAAI;QAC9FZ,MAAM,6CAA6CqB,EAAE,CAACD,MAAMZ,WAAW;KACxE,EACD;AAKF,OAAO,SAASc,wBAAwBC,GAA4B;IAClE,OAAO;QACLhB,IAAIgB,IAAIhB,EAAE;QACVC,aAAae,IAAIf,WAAW;QAC5BE,UAAUa,IAAIb,QAAQ;QACtBC,mBAAmBY,IAAIZ,iBAAiB;QACxCC,MAAMW,IAAIX,IAAI;QACdC,aAAaU,IAAIV,WAAW;QAC5BC,iBAAiBS,IAAIT,eAAe;QACpCE,WAAWO,IAAIP,SAAS;QACxBG,WAAWI,IAAIJ,SAAS;IAC1B;AACF"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
export declare const integrationsOutbox: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
2
|
+
name: "outbox";
|
|
3
|
+
schema: undefined;
|
|
4
|
+
columns: {
|
|
5
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
6
|
+
name: "id";
|
|
7
|
+
tableName: "outbox";
|
|
8
|
+
dataType: "string";
|
|
9
|
+
columnType: "PgUUID";
|
|
10
|
+
data: string;
|
|
11
|
+
driverParam: string;
|
|
12
|
+
notNull: true;
|
|
13
|
+
hasDefault: true;
|
|
14
|
+
isPrimaryKey: true;
|
|
15
|
+
isAutoincrement: false;
|
|
16
|
+
hasRuntimeDefault: false;
|
|
17
|
+
enumValues: undefined;
|
|
18
|
+
baseColumn: never;
|
|
19
|
+
identity: undefined;
|
|
20
|
+
generated: undefined;
|
|
21
|
+
}, {}, {}>;
|
|
22
|
+
eventType: import("drizzle-orm/pg-core").PgColumn<{
|
|
23
|
+
name: "event_type";
|
|
24
|
+
tableName: "outbox";
|
|
25
|
+
dataType: "string";
|
|
26
|
+
columnType: "PgText";
|
|
27
|
+
data: string;
|
|
28
|
+
driverParam: string;
|
|
29
|
+
notNull: true;
|
|
30
|
+
hasDefault: false;
|
|
31
|
+
isPrimaryKey: false;
|
|
32
|
+
isAutoincrement: false;
|
|
33
|
+
hasRuntimeDefault: false;
|
|
34
|
+
enumValues: [string, ...string[]];
|
|
35
|
+
baseColumn: never;
|
|
36
|
+
identity: undefined;
|
|
37
|
+
generated: undefined;
|
|
38
|
+
}, {}, {}>;
|
|
39
|
+
orderingKey: import("drizzle-orm/pg-core").PgColumn<{
|
|
40
|
+
name: "ordering_key";
|
|
41
|
+
tableName: "outbox";
|
|
42
|
+
dataType: "string";
|
|
43
|
+
columnType: "PgText";
|
|
44
|
+
data: string;
|
|
45
|
+
driverParam: string;
|
|
46
|
+
notNull: false;
|
|
47
|
+
hasDefault: false;
|
|
48
|
+
isPrimaryKey: false;
|
|
49
|
+
isAutoincrement: false;
|
|
50
|
+
hasRuntimeDefault: false;
|
|
51
|
+
enumValues: [string, ...string[]];
|
|
52
|
+
baseColumn: never;
|
|
53
|
+
identity: undefined;
|
|
54
|
+
generated: undefined;
|
|
55
|
+
}, {}, {}>;
|
|
56
|
+
payload: import("drizzle-orm/pg-core").PgColumn<{
|
|
57
|
+
name: "payload";
|
|
58
|
+
tableName: "outbox";
|
|
59
|
+
dataType: "json";
|
|
60
|
+
columnType: "PgJsonb";
|
|
61
|
+
data: unknown;
|
|
62
|
+
driverParam: unknown;
|
|
63
|
+
notNull: true;
|
|
64
|
+
hasDefault: false;
|
|
65
|
+
isPrimaryKey: false;
|
|
66
|
+
isAutoincrement: false;
|
|
67
|
+
hasRuntimeDefault: false;
|
|
68
|
+
enumValues: undefined;
|
|
69
|
+
baseColumn: never;
|
|
70
|
+
identity: undefined;
|
|
71
|
+
generated: undefined;
|
|
72
|
+
}, {}, {}>;
|
|
73
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
74
|
+
name: "created_at";
|
|
75
|
+
tableName: "outbox";
|
|
76
|
+
dataType: "date";
|
|
77
|
+
columnType: "PgTimestamp";
|
|
78
|
+
data: Date;
|
|
79
|
+
driverParam: string;
|
|
80
|
+
notNull: true;
|
|
81
|
+
hasDefault: true;
|
|
82
|
+
isPrimaryKey: false;
|
|
83
|
+
isAutoincrement: false;
|
|
84
|
+
hasRuntimeDefault: false;
|
|
85
|
+
enumValues: undefined;
|
|
86
|
+
baseColumn: never;
|
|
87
|
+
identity: undefined;
|
|
88
|
+
generated: undefined;
|
|
89
|
+
}, {}, {}>;
|
|
90
|
+
dispatchedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
91
|
+
name: "dispatched_at";
|
|
92
|
+
tableName: "outbox";
|
|
93
|
+
dataType: "date";
|
|
94
|
+
columnType: "PgTimestamp";
|
|
95
|
+
data: Date;
|
|
96
|
+
driverParam: string;
|
|
97
|
+
notNull: false;
|
|
98
|
+
hasDefault: false;
|
|
99
|
+
isPrimaryKey: false;
|
|
100
|
+
isAutoincrement: false;
|
|
101
|
+
hasRuntimeDefault: false;
|
|
102
|
+
enumValues: undefined;
|
|
103
|
+
baseColumn: never;
|
|
104
|
+
identity: undefined;
|
|
105
|
+
generated: undefined;
|
|
106
|
+
}, {}, {}>;
|
|
107
|
+
dispatchAttempts: import("drizzle-orm/pg-core").PgColumn<{
|
|
108
|
+
name: "dispatch_attempts";
|
|
109
|
+
tableName: "outbox";
|
|
110
|
+
dataType: "number";
|
|
111
|
+
columnType: "PgInteger";
|
|
112
|
+
data: number;
|
|
113
|
+
driverParam: string | number;
|
|
114
|
+
notNull: true;
|
|
115
|
+
hasDefault: true;
|
|
116
|
+
isPrimaryKey: false;
|
|
117
|
+
isAutoincrement: false;
|
|
118
|
+
hasRuntimeDefault: false;
|
|
119
|
+
enumValues: undefined;
|
|
120
|
+
baseColumn: never;
|
|
121
|
+
identity: undefined;
|
|
122
|
+
generated: undefined;
|
|
123
|
+
}, {}, {}>;
|
|
124
|
+
nextDispatchAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
125
|
+
name: "next_dispatch_at";
|
|
126
|
+
tableName: "outbox";
|
|
127
|
+
dataType: "date";
|
|
128
|
+
columnType: "PgTimestamp";
|
|
129
|
+
data: Date;
|
|
130
|
+
driverParam: string;
|
|
131
|
+
notNull: true;
|
|
132
|
+
hasDefault: true;
|
|
133
|
+
isPrimaryKey: false;
|
|
134
|
+
isAutoincrement: false;
|
|
135
|
+
hasRuntimeDefault: false;
|
|
136
|
+
enumValues: undefined;
|
|
137
|
+
baseColumn: never;
|
|
138
|
+
identity: undefined;
|
|
139
|
+
generated: undefined;
|
|
140
|
+
}, {}, {}>;
|
|
141
|
+
lastDispatchError: import("drizzle-orm/pg-core").PgColumn<{
|
|
142
|
+
name: "last_dispatch_error";
|
|
143
|
+
tableName: "outbox";
|
|
144
|
+
dataType: "json";
|
|
145
|
+
columnType: "PgJsonb";
|
|
146
|
+
data: unknown;
|
|
147
|
+
driverParam: unknown;
|
|
148
|
+
notNull: false;
|
|
149
|
+
hasDefault: false;
|
|
150
|
+
isPrimaryKey: false;
|
|
151
|
+
isAutoincrement: false;
|
|
152
|
+
hasRuntimeDefault: false;
|
|
153
|
+
enumValues: undefined;
|
|
154
|
+
baseColumn: never;
|
|
155
|
+
identity: undefined;
|
|
156
|
+
generated: undefined;
|
|
157
|
+
}, {}, {}>;
|
|
158
|
+
lastDispatchFailedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
159
|
+
name: "last_dispatch_failed_at";
|
|
160
|
+
tableName: "outbox";
|
|
161
|
+
dataType: "date";
|
|
162
|
+
columnType: "PgTimestamp";
|
|
163
|
+
data: Date;
|
|
164
|
+
driverParam: string;
|
|
165
|
+
notNull: false;
|
|
166
|
+
hasDefault: false;
|
|
167
|
+
isPrimaryKey: false;
|
|
168
|
+
isAutoincrement: false;
|
|
169
|
+
hasRuntimeDefault: false;
|
|
170
|
+
enumValues: undefined;
|
|
171
|
+
baseColumn: never;
|
|
172
|
+
identity: undefined;
|
|
173
|
+
generated: undefined;
|
|
174
|
+
}, {}, {}>;
|
|
175
|
+
deadLetteredAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
176
|
+
name: "dead_lettered_at";
|
|
177
|
+
tableName: "outbox";
|
|
178
|
+
dataType: "date";
|
|
179
|
+
columnType: "PgTimestamp";
|
|
180
|
+
data: Date;
|
|
181
|
+
driverParam: string;
|
|
182
|
+
notNull: false;
|
|
183
|
+
hasDefault: false;
|
|
184
|
+
isPrimaryKey: false;
|
|
185
|
+
isAutoincrement: false;
|
|
186
|
+
hasRuntimeDefault: false;
|
|
187
|
+
enumValues: undefined;
|
|
188
|
+
baseColumn: never;
|
|
189
|
+
identity: undefined;
|
|
190
|
+
generated: undefined;
|
|
191
|
+
}, {}, {}>;
|
|
192
|
+
};
|
|
193
|
+
dialect: "pg";
|
|
194
|
+
}>;
|
|
195
|
+
//# sourceMappingURL=outbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outbox.d.ts","sourceRoot":"","sources":["../../../src/db/schema/outbox.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA6B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/db/schema/outbox.ts"],"sourcesContent":["import {createOutboxTable} from '@shipfox/node-outbox';\nimport {pgTable} from './common.js';\n\nexport const integrationsOutbox = createOutboxTable(pgTable);\n"],"names":["createOutboxTable","pgTable","integrationsOutbox"],"mappings":"AAAA,SAAQA,iBAAiB,QAAO,uBAAuB;AACvD,SAAQC,OAAO,QAAO,cAAc;AAEpC,OAAO,MAAMC,qBAAqBF,kBAAkBC,SAAS"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export declare const integrationsWebhookDeliveries: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
2
|
+
name: "webhook_deliveries";
|
|
3
|
+
schema: undefined;
|
|
4
|
+
columns: {
|
|
5
|
+
provider: import("drizzle-orm/pg-core").PgColumn<{
|
|
6
|
+
name: "provider";
|
|
7
|
+
tableName: "webhook_deliveries";
|
|
8
|
+
dataType: "string";
|
|
9
|
+
columnType: "PgText";
|
|
10
|
+
data: string;
|
|
11
|
+
driverParam: string;
|
|
12
|
+
notNull: true;
|
|
13
|
+
hasDefault: false;
|
|
14
|
+
isPrimaryKey: false;
|
|
15
|
+
isAutoincrement: false;
|
|
16
|
+
hasRuntimeDefault: false;
|
|
17
|
+
enumValues: [string, ...string[]];
|
|
18
|
+
baseColumn: never;
|
|
19
|
+
identity: undefined;
|
|
20
|
+
generated: undefined;
|
|
21
|
+
}, {}, {}>;
|
|
22
|
+
dedupScope: import("drizzle-orm/pg-core").PgColumn<{
|
|
23
|
+
name: "dedup_scope";
|
|
24
|
+
tableName: "webhook_deliveries";
|
|
25
|
+
dataType: "string";
|
|
26
|
+
columnType: "PgText";
|
|
27
|
+
data: string;
|
|
28
|
+
driverParam: string;
|
|
29
|
+
notNull: true;
|
|
30
|
+
hasDefault: false;
|
|
31
|
+
isPrimaryKey: false;
|
|
32
|
+
isAutoincrement: false;
|
|
33
|
+
hasRuntimeDefault: false;
|
|
34
|
+
enumValues: [string, ...string[]];
|
|
35
|
+
baseColumn: never;
|
|
36
|
+
identity: undefined;
|
|
37
|
+
generated: undefined;
|
|
38
|
+
}, {}, {}>;
|
|
39
|
+
deliveryId: import("drizzle-orm/pg-core").PgColumn<{
|
|
40
|
+
name: "delivery_id";
|
|
41
|
+
tableName: "webhook_deliveries";
|
|
42
|
+
dataType: "string";
|
|
43
|
+
columnType: "PgText";
|
|
44
|
+
data: string;
|
|
45
|
+
driverParam: string;
|
|
46
|
+
notNull: true;
|
|
47
|
+
hasDefault: false;
|
|
48
|
+
isPrimaryKey: false;
|
|
49
|
+
isAutoincrement: false;
|
|
50
|
+
hasRuntimeDefault: false;
|
|
51
|
+
enumValues: [string, ...string[]];
|
|
52
|
+
baseColumn: never;
|
|
53
|
+
identity: undefined;
|
|
54
|
+
generated: undefined;
|
|
55
|
+
}, {}, {}>;
|
|
56
|
+
receivedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
57
|
+
name: "received_at";
|
|
58
|
+
tableName: "webhook_deliveries";
|
|
59
|
+
dataType: "date";
|
|
60
|
+
columnType: "PgTimestamp";
|
|
61
|
+
data: Date;
|
|
62
|
+
driverParam: string;
|
|
63
|
+
notNull: true;
|
|
64
|
+
hasDefault: true;
|
|
65
|
+
isPrimaryKey: false;
|
|
66
|
+
isAutoincrement: false;
|
|
67
|
+
hasRuntimeDefault: false;
|
|
68
|
+
enumValues: undefined;
|
|
69
|
+
baseColumn: never;
|
|
70
|
+
identity: undefined;
|
|
71
|
+
generated: undefined;
|
|
72
|
+
}, {}, {}>;
|
|
73
|
+
};
|
|
74
|
+
dialect: "pg";
|
|
75
|
+
}>;
|
|
76
|
+
//# sourceMappingURL=webhook-deliveries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook-deliveries.d.ts","sourceRoot":"","sources":["../../../src/db/schema/webhook-deliveries.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAezC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { index, primaryKey, text, timestamp } from 'drizzle-orm/pg-core';
|
|
2
|
+
import { pgTable } from './common.js';
|
|
3
|
+
export const integrationsWebhookDeliveries = pgTable('webhook_deliveries', {
|
|
4
|
+
provider: text('provider').notNull(),
|
|
5
|
+
dedupScope: text('dedup_scope').notNull(),
|
|
6
|
+
deliveryId: text('delivery_id').notNull(),
|
|
7
|
+
receivedAt: timestamp('received_at', {
|
|
8
|
+
withTimezone: true
|
|
9
|
+
}).notNull().defaultNow()
|
|
10
|
+
}, (table)=>[
|
|
11
|
+
primaryKey({
|
|
12
|
+
name: 'integrations_webhook_deliveries_dedup_pk',
|
|
13
|
+
columns: [
|
|
14
|
+
table.provider,
|
|
15
|
+
table.dedupScope,
|
|
16
|
+
table.deliveryId
|
|
17
|
+
]
|
|
18
|
+
}),
|
|
19
|
+
index('integrations_webhook_deliveries_received_at_idx').on(table.receivedAt)
|
|
20
|
+
]);
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=webhook-deliveries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/db/schema/webhook-deliveries.ts"],"sourcesContent":["import {index, primaryKey, text, timestamp} from 'drizzle-orm/pg-core';\nimport {pgTable} from './common.js';\n\nexport const integrationsWebhookDeliveries = pgTable(\n 'webhook_deliveries',\n {\n provider: text('provider').notNull(),\n dedupScope: text('dedup_scope').notNull(),\n deliveryId: text('delivery_id').notNull(),\n receivedAt: timestamp('received_at', {withTimezone: true}).notNull().defaultNow(),\n },\n (table) => [\n primaryKey({\n name: 'integrations_webhook_deliveries_dedup_pk',\n columns: [table.provider, table.dedupScope, table.deliveryId],\n }),\n index('integrations_webhook_deliveries_received_at_idx').on(table.receivedAt),\n ],\n);\n"],"names":["index","primaryKey","text","timestamp","pgTable","integrationsWebhookDeliveries","provider","notNull","dedupScope","deliveryId","receivedAt","withTimezone","defaultNow","table","name","columns","on"],"mappings":"AAAA,SAAQA,KAAK,EAAEC,UAAU,EAAEC,IAAI,EAAEC,SAAS,QAAO,sBAAsB;AACvE,SAAQC,OAAO,QAAO,cAAc;AAEpC,OAAO,MAAMC,gCAAgCD,QAC3C,sBACA;IACEE,UAAUJ,KAAK,YAAYK,OAAO;IAClCC,YAAYN,KAAK,eAAeK,OAAO;IACvCE,YAAYP,KAAK,eAAeK,OAAO;IACvCG,YAAYP,UAAU,eAAe;QAACQ,cAAc;IAAI,GAAGJ,OAAO,GAAGK,UAAU;AACjF,GACA,CAACC,QAAU;QACTZ,WAAW;YACTa,MAAM;YACNC,SAAS;gBAACF,MAAMP,QAAQ;gBAAEO,MAAML,UAAU;gBAAEK,MAAMJ,UAAU;aAAC;QAC/D;QACAT,MAAM,mDAAmDgB,EAAE,CAACH,MAAMH,UAAU;KAC7E,EACD"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type IntegrationEventReceivedEvent, type SourcePushPayload } from '@shipfox/api-integration-core-dto';
|
|
2
|
+
import { db } from './db.js';
|
|
3
|
+
type IntegrationDb = ReturnType<typeof db>;
|
|
4
|
+
type IntegrationTx = Parameters<Parameters<IntegrationDb['transaction']>[0]>[0];
|
|
5
|
+
type Executor = IntegrationDb | IntegrationTx;
|
|
6
|
+
export interface PublishIntegrationEventReceivedParams {
|
|
7
|
+
tx: Executor;
|
|
8
|
+
event: IntegrationEventReceivedEvent;
|
|
9
|
+
}
|
|
10
|
+
export interface PublishIntegrationEventReceivedResult {
|
|
11
|
+
published: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function publishIntegrationEventReceived(params: PublishIntegrationEventReceivedParams): Promise<PublishIntegrationEventReceivedResult>;
|
|
14
|
+
export interface PublishSourcePushParams {
|
|
15
|
+
tx: IntegrationTx;
|
|
16
|
+
provider: string;
|
|
17
|
+
source: string;
|
|
18
|
+
workspaceId: string;
|
|
19
|
+
connectionId: string;
|
|
20
|
+
connectionName: string;
|
|
21
|
+
deliveryId: string;
|
|
22
|
+
receivedAt: string;
|
|
23
|
+
rawPayload: unknown;
|
|
24
|
+
push: SourcePushPayload;
|
|
25
|
+
}
|
|
26
|
+
export declare function publishSourcePush(params: PublishSourcePushParams): Promise<{
|
|
27
|
+
published: boolean;
|
|
28
|
+
}>;
|
|
29
|
+
export interface PublishSourceCommitPushedParams {
|
|
30
|
+
provider: string;
|
|
31
|
+
workspaceId: string;
|
|
32
|
+
connectionId: string;
|
|
33
|
+
deliveryId: string;
|
|
34
|
+
receivedAt: string;
|
|
35
|
+
push: SourcePushPayload;
|
|
36
|
+
}
|
|
37
|
+
export declare function publishSourceCommitPushed(params: PublishSourceCommitPushedParams): Promise<void>;
|
|
38
|
+
export interface RecordDeliveryOnlyParams {
|
|
39
|
+
tx: Executor;
|
|
40
|
+
provider: string;
|
|
41
|
+
deliveryId: string;
|
|
42
|
+
}
|
|
43
|
+
export declare function recordDeliveryOnly(params: RecordDeliveryOnlyParams): Promise<void>;
|
|
44
|
+
export interface PruneWebhookDeliveriesParams {
|
|
45
|
+
olderThan: Date;
|
|
46
|
+
}
|
|
47
|
+
export declare function pruneWebhookDeliveries(params: PruneWebhookDeliveriesParams): Promise<{
|
|
48
|
+
deleted: number;
|
|
49
|
+
}>;
|
|
50
|
+
export type PublishIntegrationEventReceivedFn = typeof publishIntegrationEventReceived;
|
|
51
|
+
export type PublishSourcePushFn = typeof publishSourcePush;
|
|
52
|
+
export type PublishSourceCommitPushedFn = typeof publishSourceCommitPushed;
|
|
53
|
+
export type RecordDeliveryOnlyFn = typeof recordDeliveryOnly;
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=webhook-deliveries.d.ts.map
|