@shipfox/api-integration-slack 4.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 +22 -0
- package/LICENSE +21 -0
- package/dist/api/client.d.ts +28 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +163 -0
- package/dist/api/client.js.map +1 -0
- package/dist/config.d.ts +8 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +21 -0
- package/dist/config.js.map +1 -0
- package/dist/core/agent-tools-provider.d.ts +75 -0
- package/dist/core/agent-tools-provider.d.ts.map +1 -0
- package/dist/core/agent-tools-provider.js +111 -0
- package/dist/core/agent-tools-provider.js.map +1 -0
- package/dist/core/agent-tools.d.ts +65 -0
- package/dist/core/agent-tools.d.ts.map +1 -0
- package/dist/core/agent-tools.js +177 -0
- package/dist/core/agent-tools.js.map +1 -0
- package/dist/core/disconnect.d.ts +18 -0
- package/dist/core/disconnect.d.ts.map +1 -0
- package/dist/core/disconnect.js +23 -0
- package/dist/core/disconnect.js.map +1 -0
- package/dist/core/errors.d.ts +44 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +71 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/install.d.ts +48 -0
- package/dist/core/install.d.ts.map +1 -0
- package/dist/core/install.js +88 -0
- package/dist/core/install.js.map +1 -0
- package/dist/core/scopes.d.ts +4 -0
- package/dist/core/scopes.d.ts.map +1 -0
- package/dist/core/scopes.js +24 -0
- package/dist/core/scopes.js.map +1 -0
- package/dist/core/signature.d.ts +10 -0
- package/dist/core/signature.d.ts.map +1 -0
- package/dist/core/signature.js +18 -0
- package/dist/core/signature.js.map +1 -0
- package/dist/core/state.d.ts +12 -0
- package/dist/core/state.d.ts.map +1 -0
- package/dist/core/state.js +54 -0
- package/dist/core/state.js.map +1 -0
- package/dist/core/tokens.d.ts +35 -0
- package/dist/core/tokens.d.ts.map +1 -0
- package/dist/core/tokens.js +51 -0
- package/dist/core/tokens.js.map +1 -0
- package/dist/core/webhook.d.ts +25 -0
- package/dist/core/webhook.d.ts.map +1 -0
- package/dist/core/webhook.js +160 -0
- package/dist/core/webhook.js.map +1 -0
- package/dist/db/db.d.ts +403 -0
- package/dist/db/db.d.ts.map +1 -0
- package/dist/db/db.js +18 -0
- package/dist/db/db.js.map +1 -0
- package/dist/db/installations.d.ts +40 -0
- package/dist/db/installations.d.ts.map +1 -0
- package/dist/db/installations.js +73 -0
- package/dist/db/installations.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/installations.d.ts +203 -0
- package/dist/db/schema/installations.d.ts.map +1 -0
- package/dist/db/schema/installations.js +42 -0
- package/dist/db/schema/installations.js.map +1 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +73 -0
- package/dist/index.js.map +1 -0
- package/dist/presentation/dto/integrations.d.ts +2 -0
- package/dist/presentation/dto/integrations.d.ts.map +1 -0
- package/dist/presentation/dto/integrations.js +3 -0
- package/dist/presentation/dto/integrations.js.map +1 -0
- package/dist/presentation/e2eRoutes/create-connection.d.ts +16 -0
- package/dist/presentation/e2eRoutes/create-connection.d.ts.map +1 -0
- package/dist/presentation/e2eRoutes/create-connection.js +65 -0
- package/dist/presentation/e2eRoutes/create-connection.js.map +1 -0
- package/dist/presentation/e2eRoutes/index.d.ts +5 -0
- package/dist/presentation/e2eRoutes/index.d.ts.map +1 -0
- package/dist/presentation/e2eRoutes/index.js +11 -0
- package/dist/presentation/e2eRoutes/index.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 +75 -0
- package/dist/presentation/routes/errors.js.map +1 -0
- package/dist/presentation/routes/install.d.ts +19 -0
- package/dist/presentation/routes/install.d.ts.map +1 -0
- package/dist/presentation/routes/install.js +98 -0
- package/dist/presentation/routes/install.js.map +1 -0
- package/dist/presentation/routes/webhooks.d.ts +16 -0
- package/dist/presentation/routes/webhooks.d.ts.map +1 -0
- package/dist/presentation/routes/webhooks.js +166 -0
- package/dist/presentation/routes/webhooks.js.map +1 -0
- package/dist/tsconfig.test.tsbuildinfo +1 -0
- package/drizzle/0000_calm_fantastic_four.sql +16 -0
- package/drizzle/meta/0000_snapshot.json +132 -0
- package/drizzle/meta/_journal.json +13 -0
- package/drizzle.config.ts +7 -0
- package/package.json +71 -0
- package/src/api/client.test.ts +239 -0
- package/src/api/client.ts +243 -0
- package/src/config.test.ts +32 -0
- package/src/config.ts +20 -0
- package/src/connection-external-url.test.ts +25 -0
- package/src/core/agent-tools-provider.test.ts +256 -0
- package/src/core/agent-tools-provider.ts +147 -0
- package/src/core/agent-tools.test.ts +90 -0
- package/src/core/agent-tools.ts +189 -0
- package/src/core/disconnect.ts +26 -0
- package/src/core/errors.ts +92 -0
- package/src/core/install.test.ts +155 -0
- package/src/core/install.ts +137 -0
- package/src/core/scopes.test.ts +22 -0
- package/src/core/scopes.ts +25 -0
- package/src/core/signature.test.ts +45 -0
- package/src/core/signature.ts +41 -0
- package/src/core/state.test.ts +48 -0
- package/src/core/state.ts +82 -0
- package/src/core/tokens.test.ts +163 -0
- package/src/core/tokens.ts +98 -0
- package/src/core/webhook.test.ts +269 -0
- package/src/core/webhook.ts +223 -0
- package/src/db/db.ts +16 -0
- package/src/db/installations.test.ts +93 -0
- package/src/db/installations.ts +141 -0
- package/src/db/migrations.ts +4 -0
- package/src/db/schema/common.ts +3 -0
- package/src/db/schema/installations.ts +44 -0
- package/src/index.test.ts +25 -0
- package/src/index.ts +196 -0
- package/src/presentation/dto/integrations.ts +1 -0
- package/src/presentation/e2eRoutes/create-connection.ts +82 -0
- package/src/presentation/e2eRoutes/index.test.ts +96 -0
- package/src/presentation/e2eRoutes/index.ts +11 -0
- package/src/presentation/routes/errors.ts +68 -0
- package/src/presentation/routes/install.test.ts +229 -0
- package/src/presentation/routes/install.ts +117 -0
- package/src/presentation/routes/webhooks.test.ts +266 -0
- package/src/presentation/routes/webhooks.ts +170 -0
- package/test/api-secrets.d.ts +26 -0
- package/test/env.ts +13 -0
- package/test/factories/index.ts +1 -0
- package/test/globalSetup.ts +23 -0
- package/test/index.ts +1 -0
- package/test/setup.ts +17 -0
- package/tsconfig.build.json +9 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +3 -0
- package/tsconfig.test.json +9 -0
- package/vitest.config.ts +12 -0
package/dist/db/db.d.ts
ADDED
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
import { type NodePgDatabase } from '@shipfox/node-drizzle';
|
|
2
|
+
export declare const schema: {
|
|
3
|
+
slackInstallations: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
4
|
+
name: "installations";
|
|
5
|
+
schema: undefined;
|
|
6
|
+
columns: {
|
|
7
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
8
|
+
name: "id";
|
|
9
|
+
tableName: "installations";
|
|
10
|
+
dataType: "string";
|
|
11
|
+
columnType: "PgUUID";
|
|
12
|
+
data: string;
|
|
13
|
+
driverParam: string;
|
|
14
|
+
notNull: true;
|
|
15
|
+
hasDefault: true;
|
|
16
|
+
isPrimaryKey: true;
|
|
17
|
+
isAutoincrement: false;
|
|
18
|
+
hasRuntimeDefault: false;
|
|
19
|
+
enumValues: undefined;
|
|
20
|
+
baseColumn: never;
|
|
21
|
+
identity: undefined;
|
|
22
|
+
generated: undefined;
|
|
23
|
+
}, {}, {}>;
|
|
24
|
+
connectionId: import("drizzle-orm/pg-core").PgColumn<{
|
|
25
|
+
name: "connection_id";
|
|
26
|
+
tableName: "installations";
|
|
27
|
+
dataType: "string";
|
|
28
|
+
columnType: "PgUUID";
|
|
29
|
+
data: string;
|
|
30
|
+
driverParam: string;
|
|
31
|
+
notNull: true;
|
|
32
|
+
hasDefault: false;
|
|
33
|
+
isPrimaryKey: false;
|
|
34
|
+
isAutoincrement: false;
|
|
35
|
+
hasRuntimeDefault: false;
|
|
36
|
+
enumValues: undefined;
|
|
37
|
+
baseColumn: never;
|
|
38
|
+
identity: undefined;
|
|
39
|
+
generated: undefined;
|
|
40
|
+
}, {}, {}>;
|
|
41
|
+
teamId: import("drizzle-orm/pg-core").PgColumn<{
|
|
42
|
+
name: "team_id";
|
|
43
|
+
tableName: "installations";
|
|
44
|
+
dataType: "string";
|
|
45
|
+
columnType: "PgText";
|
|
46
|
+
data: string;
|
|
47
|
+
driverParam: string;
|
|
48
|
+
notNull: true;
|
|
49
|
+
hasDefault: false;
|
|
50
|
+
isPrimaryKey: false;
|
|
51
|
+
isAutoincrement: false;
|
|
52
|
+
hasRuntimeDefault: false;
|
|
53
|
+
enumValues: [string, ...string[]];
|
|
54
|
+
baseColumn: never;
|
|
55
|
+
identity: undefined;
|
|
56
|
+
generated: undefined;
|
|
57
|
+
}, {}, {}>;
|
|
58
|
+
teamName: import("drizzle-orm/pg-core").PgColumn<{
|
|
59
|
+
name: "team_name";
|
|
60
|
+
tableName: "installations";
|
|
61
|
+
dataType: "string";
|
|
62
|
+
columnType: "PgText";
|
|
63
|
+
data: string;
|
|
64
|
+
driverParam: string;
|
|
65
|
+
notNull: true;
|
|
66
|
+
hasDefault: false;
|
|
67
|
+
isPrimaryKey: false;
|
|
68
|
+
isAutoincrement: false;
|
|
69
|
+
hasRuntimeDefault: false;
|
|
70
|
+
enumValues: [string, ...string[]];
|
|
71
|
+
baseColumn: never;
|
|
72
|
+
identity: undefined;
|
|
73
|
+
generated: undefined;
|
|
74
|
+
}, {}, {}>;
|
|
75
|
+
appId: import("drizzle-orm/pg-core").PgColumn<{
|
|
76
|
+
name: "app_id";
|
|
77
|
+
tableName: "installations";
|
|
78
|
+
dataType: "string";
|
|
79
|
+
columnType: "PgText";
|
|
80
|
+
data: string;
|
|
81
|
+
driverParam: string;
|
|
82
|
+
notNull: true;
|
|
83
|
+
hasDefault: false;
|
|
84
|
+
isPrimaryKey: false;
|
|
85
|
+
isAutoincrement: false;
|
|
86
|
+
hasRuntimeDefault: false;
|
|
87
|
+
enumValues: [string, ...string[]];
|
|
88
|
+
baseColumn: never;
|
|
89
|
+
identity: undefined;
|
|
90
|
+
generated: undefined;
|
|
91
|
+
}, {}, {}>;
|
|
92
|
+
botUserId: import("drizzle-orm/pg-core").PgColumn<{
|
|
93
|
+
name: "bot_user_id";
|
|
94
|
+
tableName: "installations";
|
|
95
|
+
dataType: "string";
|
|
96
|
+
columnType: "PgText";
|
|
97
|
+
data: string;
|
|
98
|
+
driverParam: string;
|
|
99
|
+
notNull: true;
|
|
100
|
+
hasDefault: false;
|
|
101
|
+
isPrimaryKey: false;
|
|
102
|
+
isAutoincrement: false;
|
|
103
|
+
hasRuntimeDefault: false;
|
|
104
|
+
enumValues: [string, ...string[]];
|
|
105
|
+
baseColumn: never;
|
|
106
|
+
identity: undefined;
|
|
107
|
+
generated: undefined;
|
|
108
|
+
}, {}, {}>;
|
|
109
|
+
scopes: import("drizzle-orm/pg-core").PgColumn<{
|
|
110
|
+
name: "scopes";
|
|
111
|
+
tableName: "installations";
|
|
112
|
+
dataType: "json";
|
|
113
|
+
columnType: "PgJsonb";
|
|
114
|
+
data: string[];
|
|
115
|
+
driverParam: unknown;
|
|
116
|
+
notNull: true;
|
|
117
|
+
hasDefault: false;
|
|
118
|
+
isPrimaryKey: false;
|
|
119
|
+
isAutoincrement: false;
|
|
120
|
+
hasRuntimeDefault: false;
|
|
121
|
+
enumValues: undefined;
|
|
122
|
+
baseColumn: never;
|
|
123
|
+
identity: undefined;
|
|
124
|
+
generated: undefined;
|
|
125
|
+
}, {}, {
|
|
126
|
+
$type: string[];
|
|
127
|
+
}>;
|
|
128
|
+
status: import("drizzle-orm/pg-core").PgColumn<{
|
|
129
|
+
name: "status";
|
|
130
|
+
tableName: "installations";
|
|
131
|
+
dataType: "string";
|
|
132
|
+
columnType: "PgText";
|
|
133
|
+
data: import("./installations.js").SlackInstallationStatus;
|
|
134
|
+
driverParam: string;
|
|
135
|
+
notNull: true;
|
|
136
|
+
hasDefault: false;
|
|
137
|
+
isPrimaryKey: false;
|
|
138
|
+
isAutoincrement: false;
|
|
139
|
+
hasRuntimeDefault: false;
|
|
140
|
+
enumValues: [string, ...string[]];
|
|
141
|
+
baseColumn: never;
|
|
142
|
+
identity: undefined;
|
|
143
|
+
generated: undefined;
|
|
144
|
+
}, {}, {
|
|
145
|
+
$type: import("./installations.js").SlackInstallationStatus;
|
|
146
|
+
}>;
|
|
147
|
+
tokenExpiresAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
148
|
+
name: "token_expires_at";
|
|
149
|
+
tableName: "installations";
|
|
150
|
+
dataType: "date";
|
|
151
|
+
columnType: "PgTimestamp";
|
|
152
|
+
data: Date;
|
|
153
|
+
driverParam: string;
|
|
154
|
+
notNull: false;
|
|
155
|
+
hasDefault: false;
|
|
156
|
+
isPrimaryKey: false;
|
|
157
|
+
isAutoincrement: false;
|
|
158
|
+
hasRuntimeDefault: false;
|
|
159
|
+
enumValues: undefined;
|
|
160
|
+
baseColumn: never;
|
|
161
|
+
identity: undefined;
|
|
162
|
+
generated: undefined;
|
|
163
|
+
}, {}, {}>;
|
|
164
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
165
|
+
name: "created_at";
|
|
166
|
+
tableName: "installations";
|
|
167
|
+
dataType: "date";
|
|
168
|
+
columnType: "PgTimestamp";
|
|
169
|
+
data: Date;
|
|
170
|
+
driverParam: string;
|
|
171
|
+
notNull: true;
|
|
172
|
+
hasDefault: true;
|
|
173
|
+
isPrimaryKey: false;
|
|
174
|
+
isAutoincrement: false;
|
|
175
|
+
hasRuntimeDefault: false;
|
|
176
|
+
enumValues: undefined;
|
|
177
|
+
baseColumn: never;
|
|
178
|
+
identity: undefined;
|
|
179
|
+
generated: undefined;
|
|
180
|
+
}, {}, {}>;
|
|
181
|
+
updatedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
182
|
+
name: "updated_at";
|
|
183
|
+
tableName: "installations";
|
|
184
|
+
dataType: "date";
|
|
185
|
+
columnType: "PgTimestamp";
|
|
186
|
+
data: Date;
|
|
187
|
+
driverParam: string;
|
|
188
|
+
notNull: true;
|
|
189
|
+
hasDefault: true;
|
|
190
|
+
isPrimaryKey: false;
|
|
191
|
+
isAutoincrement: false;
|
|
192
|
+
hasRuntimeDefault: false;
|
|
193
|
+
enumValues: undefined;
|
|
194
|
+
baseColumn: never;
|
|
195
|
+
identity: undefined;
|
|
196
|
+
generated: undefined;
|
|
197
|
+
}, {}, {}>;
|
|
198
|
+
};
|
|
199
|
+
dialect: "pg";
|
|
200
|
+
}>;
|
|
201
|
+
};
|
|
202
|
+
export declare function db(): NodePgDatabase<{
|
|
203
|
+
slackInstallations: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
204
|
+
name: "installations";
|
|
205
|
+
schema: undefined;
|
|
206
|
+
columns: {
|
|
207
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
208
|
+
name: "id";
|
|
209
|
+
tableName: "installations";
|
|
210
|
+
dataType: "string";
|
|
211
|
+
columnType: "PgUUID";
|
|
212
|
+
data: string;
|
|
213
|
+
driverParam: string;
|
|
214
|
+
notNull: true;
|
|
215
|
+
hasDefault: true;
|
|
216
|
+
isPrimaryKey: true;
|
|
217
|
+
isAutoincrement: false;
|
|
218
|
+
hasRuntimeDefault: false;
|
|
219
|
+
enumValues: undefined;
|
|
220
|
+
baseColumn: never;
|
|
221
|
+
identity: undefined;
|
|
222
|
+
generated: undefined;
|
|
223
|
+
}, {}, {}>;
|
|
224
|
+
connectionId: import("drizzle-orm/pg-core").PgColumn<{
|
|
225
|
+
name: "connection_id";
|
|
226
|
+
tableName: "installations";
|
|
227
|
+
dataType: "string";
|
|
228
|
+
columnType: "PgUUID";
|
|
229
|
+
data: string;
|
|
230
|
+
driverParam: string;
|
|
231
|
+
notNull: true;
|
|
232
|
+
hasDefault: false;
|
|
233
|
+
isPrimaryKey: false;
|
|
234
|
+
isAutoincrement: false;
|
|
235
|
+
hasRuntimeDefault: false;
|
|
236
|
+
enumValues: undefined;
|
|
237
|
+
baseColumn: never;
|
|
238
|
+
identity: undefined;
|
|
239
|
+
generated: undefined;
|
|
240
|
+
}, {}, {}>;
|
|
241
|
+
teamId: import("drizzle-orm/pg-core").PgColumn<{
|
|
242
|
+
name: "team_id";
|
|
243
|
+
tableName: "installations";
|
|
244
|
+
dataType: "string";
|
|
245
|
+
columnType: "PgText";
|
|
246
|
+
data: string;
|
|
247
|
+
driverParam: string;
|
|
248
|
+
notNull: true;
|
|
249
|
+
hasDefault: false;
|
|
250
|
+
isPrimaryKey: false;
|
|
251
|
+
isAutoincrement: false;
|
|
252
|
+
hasRuntimeDefault: false;
|
|
253
|
+
enumValues: [string, ...string[]];
|
|
254
|
+
baseColumn: never;
|
|
255
|
+
identity: undefined;
|
|
256
|
+
generated: undefined;
|
|
257
|
+
}, {}, {}>;
|
|
258
|
+
teamName: import("drizzle-orm/pg-core").PgColumn<{
|
|
259
|
+
name: "team_name";
|
|
260
|
+
tableName: "installations";
|
|
261
|
+
dataType: "string";
|
|
262
|
+
columnType: "PgText";
|
|
263
|
+
data: string;
|
|
264
|
+
driverParam: string;
|
|
265
|
+
notNull: true;
|
|
266
|
+
hasDefault: false;
|
|
267
|
+
isPrimaryKey: false;
|
|
268
|
+
isAutoincrement: false;
|
|
269
|
+
hasRuntimeDefault: false;
|
|
270
|
+
enumValues: [string, ...string[]];
|
|
271
|
+
baseColumn: never;
|
|
272
|
+
identity: undefined;
|
|
273
|
+
generated: undefined;
|
|
274
|
+
}, {}, {}>;
|
|
275
|
+
appId: import("drizzle-orm/pg-core").PgColumn<{
|
|
276
|
+
name: "app_id";
|
|
277
|
+
tableName: "installations";
|
|
278
|
+
dataType: "string";
|
|
279
|
+
columnType: "PgText";
|
|
280
|
+
data: string;
|
|
281
|
+
driverParam: string;
|
|
282
|
+
notNull: true;
|
|
283
|
+
hasDefault: false;
|
|
284
|
+
isPrimaryKey: false;
|
|
285
|
+
isAutoincrement: false;
|
|
286
|
+
hasRuntimeDefault: false;
|
|
287
|
+
enumValues: [string, ...string[]];
|
|
288
|
+
baseColumn: never;
|
|
289
|
+
identity: undefined;
|
|
290
|
+
generated: undefined;
|
|
291
|
+
}, {}, {}>;
|
|
292
|
+
botUserId: import("drizzle-orm/pg-core").PgColumn<{
|
|
293
|
+
name: "bot_user_id";
|
|
294
|
+
tableName: "installations";
|
|
295
|
+
dataType: "string";
|
|
296
|
+
columnType: "PgText";
|
|
297
|
+
data: string;
|
|
298
|
+
driverParam: string;
|
|
299
|
+
notNull: true;
|
|
300
|
+
hasDefault: false;
|
|
301
|
+
isPrimaryKey: false;
|
|
302
|
+
isAutoincrement: false;
|
|
303
|
+
hasRuntimeDefault: false;
|
|
304
|
+
enumValues: [string, ...string[]];
|
|
305
|
+
baseColumn: never;
|
|
306
|
+
identity: undefined;
|
|
307
|
+
generated: undefined;
|
|
308
|
+
}, {}, {}>;
|
|
309
|
+
scopes: import("drizzle-orm/pg-core").PgColumn<{
|
|
310
|
+
name: "scopes";
|
|
311
|
+
tableName: "installations";
|
|
312
|
+
dataType: "json";
|
|
313
|
+
columnType: "PgJsonb";
|
|
314
|
+
data: string[];
|
|
315
|
+
driverParam: unknown;
|
|
316
|
+
notNull: true;
|
|
317
|
+
hasDefault: false;
|
|
318
|
+
isPrimaryKey: false;
|
|
319
|
+
isAutoincrement: false;
|
|
320
|
+
hasRuntimeDefault: false;
|
|
321
|
+
enumValues: undefined;
|
|
322
|
+
baseColumn: never;
|
|
323
|
+
identity: undefined;
|
|
324
|
+
generated: undefined;
|
|
325
|
+
}, {}, {
|
|
326
|
+
$type: string[];
|
|
327
|
+
}>;
|
|
328
|
+
status: import("drizzle-orm/pg-core").PgColumn<{
|
|
329
|
+
name: "status";
|
|
330
|
+
tableName: "installations";
|
|
331
|
+
dataType: "string";
|
|
332
|
+
columnType: "PgText";
|
|
333
|
+
data: import("./installations.js").SlackInstallationStatus;
|
|
334
|
+
driverParam: string;
|
|
335
|
+
notNull: true;
|
|
336
|
+
hasDefault: false;
|
|
337
|
+
isPrimaryKey: false;
|
|
338
|
+
isAutoincrement: false;
|
|
339
|
+
hasRuntimeDefault: false;
|
|
340
|
+
enumValues: [string, ...string[]];
|
|
341
|
+
baseColumn: never;
|
|
342
|
+
identity: undefined;
|
|
343
|
+
generated: undefined;
|
|
344
|
+
}, {}, {
|
|
345
|
+
$type: import("./installations.js").SlackInstallationStatus;
|
|
346
|
+
}>;
|
|
347
|
+
tokenExpiresAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
348
|
+
name: "token_expires_at";
|
|
349
|
+
tableName: "installations";
|
|
350
|
+
dataType: "date";
|
|
351
|
+
columnType: "PgTimestamp";
|
|
352
|
+
data: Date;
|
|
353
|
+
driverParam: string;
|
|
354
|
+
notNull: false;
|
|
355
|
+
hasDefault: false;
|
|
356
|
+
isPrimaryKey: false;
|
|
357
|
+
isAutoincrement: false;
|
|
358
|
+
hasRuntimeDefault: false;
|
|
359
|
+
enumValues: undefined;
|
|
360
|
+
baseColumn: never;
|
|
361
|
+
identity: undefined;
|
|
362
|
+
generated: undefined;
|
|
363
|
+
}, {}, {}>;
|
|
364
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
365
|
+
name: "created_at";
|
|
366
|
+
tableName: "installations";
|
|
367
|
+
dataType: "date";
|
|
368
|
+
columnType: "PgTimestamp";
|
|
369
|
+
data: Date;
|
|
370
|
+
driverParam: string;
|
|
371
|
+
notNull: true;
|
|
372
|
+
hasDefault: true;
|
|
373
|
+
isPrimaryKey: false;
|
|
374
|
+
isAutoincrement: false;
|
|
375
|
+
hasRuntimeDefault: false;
|
|
376
|
+
enumValues: undefined;
|
|
377
|
+
baseColumn: never;
|
|
378
|
+
identity: undefined;
|
|
379
|
+
generated: undefined;
|
|
380
|
+
}, {}, {}>;
|
|
381
|
+
updatedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
382
|
+
name: "updated_at";
|
|
383
|
+
tableName: "installations";
|
|
384
|
+
dataType: "date";
|
|
385
|
+
columnType: "PgTimestamp";
|
|
386
|
+
data: Date;
|
|
387
|
+
driverParam: string;
|
|
388
|
+
notNull: true;
|
|
389
|
+
hasDefault: true;
|
|
390
|
+
isPrimaryKey: false;
|
|
391
|
+
isAutoincrement: false;
|
|
392
|
+
hasRuntimeDefault: false;
|
|
393
|
+
enumValues: undefined;
|
|
394
|
+
baseColumn: never;
|
|
395
|
+
identity: undefined;
|
|
396
|
+
generated: undefined;
|
|
397
|
+
}, {}, {}>;
|
|
398
|
+
};
|
|
399
|
+
dialect: "pg";
|
|
400
|
+
}>;
|
|
401
|
+
}>;
|
|
402
|
+
export declare function closeDb(): void;
|
|
403
|
+
//# sourceMappingURL=db.d.ts.map
|
|
@@ -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;AAInE,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAuB,CAAC;AAI3C,wBAAgB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAGjB;AAED,wBAAgB,OAAO,IAAI,IAAI,CAE9B"}
|
package/dist/db/db.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { drizzle } from '@shipfox/node-drizzle';
|
|
2
|
+
import { pgClient } from '@shipfox/node-postgres';
|
|
3
|
+
import { slackInstallations } from './schema/installations.js';
|
|
4
|
+
export const schema = {
|
|
5
|
+
slackInstallations
|
|
6
|
+
};
|
|
7
|
+
let database;
|
|
8
|
+
export function db() {
|
|
9
|
+
if (!database) database = drizzle(pgClient(), {
|
|
10
|
+
schema
|
|
11
|
+
});
|
|
12
|
+
return database;
|
|
13
|
+
}
|
|
14
|
+
export function closeDb() {
|
|
15
|
+
database = undefined;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//# 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 {slackInstallations} from './schema/installations.js';\n\nexport const schema = {slackInstallations};\n\nlet database: NodePgDatabase<typeof schema> | undefined;\n\nexport function db() {\n if (!database) database = drizzle(pgClient(), {schema});\n return database;\n}\n\nexport function closeDb(): void {\n database = undefined;\n}\n"],"names":["drizzle","pgClient","slackInstallations","schema","database","db","closeDb","undefined"],"mappings":"AAAA,SAAQA,OAAO,QAA4B,wBAAwB;AACnE,SAAQC,QAAQ,QAAO,yBAAyB;AAChD,SAAQC,kBAAkB,QAAO,4BAA4B;AAE7D,OAAO,MAAMC,SAAS;IAACD;AAAkB,EAAE;AAE3C,IAAIE;AAEJ,OAAO,SAASC;IACd,IAAI,CAACD,UAAUA,WAAWJ,QAAQC,YAAY;QAACE;IAAM;IACrD,OAAOC;AACT;AAEA,OAAO,SAASE;IACdF,WAAWG;AACb"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export type SlackInstallationStatus = 'installed' | 'revoked';
|
|
2
|
+
export interface SlackInstallation {
|
|
3
|
+
id: string;
|
|
4
|
+
connectionId: string;
|
|
5
|
+
teamId: string;
|
|
6
|
+
teamName: string;
|
|
7
|
+
appId: string;
|
|
8
|
+
botUserId: string;
|
|
9
|
+
scopes: string[];
|
|
10
|
+
status: SlackInstallationStatus;
|
|
11
|
+
tokenExpiresAt: Date | null;
|
|
12
|
+
createdAt: Date;
|
|
13
|
+
updatedAt: Date;
|
|
14
|
+
}
|
|
15
|
+
export interface UpsertSlackInstallationParams {
|
|
16
|
+
connectionId: string;
|
|
17
|
+
teamId: string;
|
|
18
|
+
teamName: string;
|
|
19
|
+
appId: string;
|
|
20
|
+
botUserId: string;
|
|
21
|
+
scopes: string[];
|
|
22
|
+
status: SlackInstallationStatus;
|
|
23
|
+
tokenExpiresAt?: Date | null | undefined;
|
|
24
|
+
}
|
|
25
|
+
export declare function upsertSlackInstallation(params: UpsertSlackInstallationParams, options?: {
|
|
26
|
+
tx?: unknown;
|
|
27
|
+
}): Promise<SlackInstallation>;
|
|
28
|
+
export declare function getSlackInstallationByTeamId(teamId: string, options?: {
|
|
29
|
+
tx?: unknown;
|
|
30
|
+
}): Promise<SlackInstallation | undefined>;
|
|
31
|
+
export declare function getSlackInstallationByConnectionId(connectionId: string, options?: {
|
|
32
|
+
tx?: unknown;
|
|
33
|
+
}): Promise<SlackInstallation | undefined>;
|
|
34
|
+
export declare function deleteSlackInstallationByConnectionId(connectionId: string, options?: {
|
|
35
|
+
tx?: unknown;
|
|
36
|
+
}): Promise<boolean>;
|
|
37
|
+
export declare function markSlackInstallationRevoked(connectionId: string, options?: {
|
|
38
|
+
tx?: unknown;
|
|
39
|
+
}): Promise<SlackInstallation | undefined>;
|
|
40
|
+
//# sourceMappingURL=installations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installations.d.ts","sourceRoot":"","sources":["../../src/db/installations.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,uBAAuB,GAAG,WAAW,GAAG,SAAS,CAAC;AAE9D,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,uBAAuB,CAAC;IAChC,cAAc,EAAE,IAAI,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,6BAA6B;IAC5C,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,uBAAuB,CAAC;IAChC,cAAc,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;CAC1C;AAKD,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,6BAA6B,EACrC,OAAO,GAAE;IAAC,EAAE,CAAC,EAAE,OAAO,CAAA;CAAM,GAC3B,OAAO,CAAC,iBAAiB,CAAC,CA2C5B;AAED,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,MAAM,EACd,OAAO,GAAE;IAAC,EAAE,CAAC,EAAE,OAAO,CAAA;CAAM,GAC3B,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAUxC;AAED,wBAAsB,kCAAkC,CACtD,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE;IAAC,EAAE,CAAC,EAAE,OAAO,CAAA;CAAM,GAC3B,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAUxC;AAED,wBAAsB,qCAAqC,CACzD,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE;IAAC,EAAE,CAAC,EAAE,OAAO,CAAA;CAAM,GAC3B,OAAO,CAAC,OAAO,CAAC,CAMlB;AAED,wBAAsB,4BAA4B,CAChD,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE;IAAC,EAAE,CAAC,EAAE,OAAO,CAAA;CAAM,GAC3B,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CASxC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { isUniqueViolation } from '@shipfox/node-drizzle';
|
|
2
|
+
import { eq } from 'drizzle-orm';
|
|
3
|
+
import { SlackConnectionAlreadyLinkedError, SlackInstallationAlreadyLinkedError } from '#core/errors.js';
|
|
4
|
+
import { db } from './db.js';
|
|
5
|
+
import { slackInstallations, toSlackInstallation } from './schema/installations.js';
|
|
6
|
+
export async function upsertSlackInstallation(params, options = {}) {
|
|
7
|
+
const executor = options.tx ?? db();
|
|
8
|
+
const now = new Date();
|
|
9
|
+
let row;
|
|
10
|
+
try {
|
|
11
|
+
[row] = await executor.insert(slackInstallations).values({
|
|
12
|
+
connectionId: params.connectionId,
|
|
13
|
+
teamId: params.teamId,
|
|
14
|
+
teamName: params.teamName,
|
|
15
|
+
appId: params.appId,
|
|
16
|
+
botUserId: params.botUserId,
|
|
17
|
+
scopes: params.scopes,
|
|
18
|
+
status: params.status,
|
|
19
|
+
tokenExpiresAt: params.tokenExpiresAt ?? null
|
|
20
|
+
}).onConflictDoUpdate({
|
|
21
|
+
target: slackInstallations.teamId,
|
|
22
|
+
setWhere: eq(slackInstallations.connectionId, params.connectionId),
|
|
23
|
+
set: {
|
|
24
|
+
connectionId: params.connectionId,
|
|
25
|
+
teamId: params.teamId,
|
|
26
|
+
teamName: params.teamName,
|
|
27
|
+
appId: params.appId,
|
|
28
|
+
botUserId: params.botUserId,
|
|
29
|
+
scopes: params.scopes,
|
|
30
|
+
status: params.status,
|
|
31
|
+
tokenExpiresAt: params.tokenExpiresAt ?? null,
|
|
32
|
+
updatedAt: now
|
|
33
|
+
}
|
|
34
|
+
}).returning();
|
|
35
|
+
} catch (error) {
|
|
36
|
+
if (isUniqueViolation(error, 'integrations_slack_installations_connection_unique')) {
|
|
37
|
+
throw new SlackConnectionAlreadyLinkedError(params.connectionId);
|
|
38
|
+
}
|
|
39
|
+
throw error;
|
|
40
|
+
}
|
|
41
|
+
if (!row) throw new SlackInstallationAlreadyLinkedError(params.teamId);
|
|
42
|
+
return toSlackInstallation(row);
|
|
43
|
+
}
|
|
44
|
+
export async function getSlackInstallationByTeamId(teamId, options = {}) {
|
|
45
|
+
const executor = options.tx ?? db();
|
|
46
|
+
const rows = await executor.select().from(slackInstallations).where(eq(slackInstallations.teamId, teamId)).limit(1);
|
|
47
|
+
const row = rows[0];
|
|
48
|
+
if (!row) return undefined;
|
|
49
|
+
return toSlackInstallation(row);
|
|
50
|
+
}
|
|
51
|
+
export async function getSlackInstallationByConnectionId(connectionId, options = {}) {
|
|
52
|
+
const executor = options.tx ?? db();
|
|
53
|
+
const rows = await executor.select().from(slackInstallations).where(eq(slackInstallations.connectionId, connectionId)).limit(1);
|
|
54
|
+
const row = rows[0];
|
|
55
|
+
if (!row) return undefined;
|
|
56
|
+
return toSlackInstallation(row);
|
|
57
|
+
}
|
|
58
|
+
export async function deleteSlackInstallationByConnectionId(connectionId, options = {}) {
|
|
59
|
+
const executor = options.tx ?? db();
|
|
60
|
+
const result = await executor.delete(slackInstallations).where(eq(slackInstallations.connectionId, connectionId));
|
|
61
|
+
return (result.rowCount ?? 0) > 0;
|
|
62
|
+
}
|
|
63
|
+
export async function markSlackInstallationRevoked(connectionId, options = {}) {
|
|
64
|
+
const executor = options.tx ?? db();
|
|
65
|
+
const [row] = await executor.update(slackInstallations).set({
|
|
66
|
+
status: 'revoked',
|
|
67
|
+
updatedAt: new Date()
|
|
68
|
+
}).where(eq(slackInstallations.connectionId, connectionId)).returning();
|
|
69
|
+
if (!row) return undefined;
|
|
70
|
+
return toSlackInstallation(row);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
//# sourceMappingURL=installations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/db/installations.ts"],"sourcesContent":["import {isUniqueViolation} from '@shipfox/node-drizzle';\nimport {eq} from 'drizzle-orm';\nimport {\n SlackConnectionAlreadyLinkedError,\n SlackInstallationAlreadyLinkedError,\n} from '#core/errors.js';\nimport {db} from './db.js';\nimport {slackInstallations, toSlackInstallation} from './schema/installations.js';\n\nexport type SlackInstallationStatus = 'installed' | 'revoked';\n\nexport interface SlackInstallation {\n id: string;\n connectionId: string;\n teamId: string;\n teamName: string;\n appId: string;\n botUserId: string;\n scopes: string[];\n status: SlackInstallationStatus;\n tokenExpiresAt: Date | null;\n createdAt: Date;\n updatedAt: Date;\n}\n\nexport interface UpsertSlackInstallationParams {\n connectionId: string;\n teamId: string;\n teamName: string;\n appId: string;\n botUserId: string;\n scopes: string[];\n status: SlackInstallationStatus;\n tokenExpiresAt?: Date | null | undefined;\n}\n\ntype SlackDb = ReturnType<typeof db>;\ntype SlackTx = Parameters<Parameters<SlackDb['transaction']>[0]>[0];\n\nexport async function upsertSlackInstallation(\n params: UpsertSlackInstallationParams,\n options: {tx?: unknown} = {},\n): Promise<SlackInstallation> {\n const executor = (options.tx ?? db()) as SlackDb | SlackTx;\n const now = new Date();\n let row: typeof slackInstallations.$inferSelect | undefined;\n\n try {\n [row] = await executor\n .insert(slackInstallations)\n .values({\n connectionId: params.connectionId,\n teamId: params.teamId,\n teamName: params.teamName,\n appId: params.appId,\n botUserId: params.botUserId,\n scopes: params.scopes,\n status: params.status,\n tokenExpiresAt: params.tokenExpiresAt ?? null,\n })\n .onConflictDoUpdate({\n target: slackInstallations.teamId,\n setWhere: eq(slackInstallations.connectionId, params.connectionId),\n set: {\n connectionId: params.connectionId,\n teamId: params.teamId,\n teamName: params.teamName,\n appId: params.appId,\n botUserId: params.botUserId,\n scopes: params.scopes,\n status: params.status,\n tokenExpiresAt: params.tokenExpiresAt ?? null,\n updatedAt: now,\n },\n })\n .returning();\n } catch (error) {\n if (isUniqueViolation(error, 'integrations_slack_installations_connection_unique')) {\n throw new SlackConnectionAlreadyLinkedError(params.connectionId);\n }\n throw error;\n }\n\n if (!row) throw new SlackInstallationAlreadyLinkedError(params.teamId);\n return toSlackInstallation(row);\n}\n\nexport async function getSlackInstallationByTeamId(\n teamId: string,\n options: {tx?: unknown} = {},\n): Promise<SlackInstallation | undefined> {\n const executor = (options.tx ?? db()) as SlackDb | SlackTx;\n const rows = await executor\n .select()\n .from(slackInstallations)\n .where(eq(slackInstallations.teamId, teamId))\n .limit(1);\n const row = rows[0];\n if (!row) return undefined;\n return toSlackInstallation(row);\n}\n\nexport async function getSlackInstallationByConnectionId(\n connectionId: string,\n options: {tx?: unknown} = {},\n): Promise<SlackInstallation | undefined> {\n const executor = (options.tx ?? db()) as SlackDb | SlackTx;\n const rows = await executor\n .select()\n .from(slackInstallations)\n .where(eq(slackInstallations.connectionId, connectionId))\n .limit(1);\n const row = rows[0];\n if (!row) return undefined;\n return toSlackInstallation(row);\n}\n\nexport async function deleteSlackInstallationByConnectionId(\n connectionId: string,\n options: {tx?: unknown} = {},\n): Promise<boolean> {\n const executor = (options.tx ?? db()) as SlackDb | SlackTx;\n const result = await executor\n .delete(slackInstallations)\n .where(eq(slackInstallations.connectionId, connectionId));\n return (result.rowCount ?? 0) > 0;\n}\n\nexport async function markSlackInstallationRevoked(\n connectionId: string,\n options: {tx?: unknown} = {},\n): Promise<SlackInstallation | undefined> {\n const executor = (options.tx ?? db()) as SlackDb | SlackTx;\n const [row] = await executor\n .update(slackInstallations)\n .set({status: 'revoked', updatedAt: new Date()})\n .where(eq(slackInstallations.connectionId, connectionId))\n .returning();\n if (!row) return undefined;\n return toSlackInstallation(row);\n}\n"],"names":["isUniqueViolation","eq","SlackConnectionAlreadyLinkedError","SlackInstallationAlreadyLinkedError","db","slackInstallations","toSlackInstallation","upsertSlackInstallation","params","options","executor","tx","now","Date","row","insert","values","connectionId","teamId","teamName","appId","botUserId","scopes","status","tokenExpiresAt","onConflictDoUpdate","target","setWhere","set","updatedAt","returning","error","getSlackInstallationByTeamId","rows","select","from","where","limit","undefined","getSlackInstallationByConnectionId","deleteSlackInstallationByConnectionId","result","delete","rowCount","markSlackInstallationRevoked","update"],"mappings":"AAAA,SAAQA,iBAAiB,QAAO,wBAAwB;AACxD,SAAQC,EAAE,QAAO,cAAc;AAC/B,SACEC,iCAAiC,EACjCC,mCAAmC,QAC9B,kBAAkB;AACzB,SAAQC,EAAE,QAAO,UAAU;AAC3B,SAAQC,kBAAkB,EAAEC,mBAAmB,QAAO,4BAA4B;AAgClF,OAAO,eAAeC,wBACpBC,MAAqC,EACrCC,UAA0B,CAAC,CAAC;IAE5B,MAAMC,WAAYD,QAAQE,EAAE,IAAIP;IAChC,MAAMQ,MAAM,IAAIC;IAChB,IAAIC;IAEJ,IAAI;QACF,CAACA,IAAI,GAAG,MAAMJ,SACXK,MAAM,CAACV,oBACPW,MAAM,CAAC;YACNC,cAAcT,OAAOS,YAAY;YACjCC,QAAQV,OAAOU,MAAM;YACrBC,UAAUX,OAAOW,QAAQ;YACzBC,OAAOZ,OAAOY,KAAK;YACnBC,WAAWb,OAAOa,SAAS;YAC3BC,QAAQd,OAAOc,MAAM;YACrBC,QAAQf,OAAOe,MAAM;YACrBC,gBAAgBhB,OAAOgB,cAAc,IAAI;QAC3C,GACCC,kBAAkB,CAAC;YAClBC,QAAQrB,mBAAmBa,MAAM;YACjCS,UAAU1B,GAAGI,mBAAmBY,YAAY,EAAET,OAAOS,YAAY;YACjEW,KAAK;gBACHX,cAAcT,OAAOS,YAAY;gBACjCC,QAAQV,OAAOU,MAAM;gBACrBC,UAAUX,OAAOW,QAAQ;gBACzBC,OAAOZ,OAAOY,KAAK;gBACnBC,WAAWb,OAAOa,SAAS;gBAC3BC,QAAQd,OAAOc,MAAM;gBACrBC,QAAQf,OAAOe,MAAM;gBACrBC,gBAAgBhB,OAAOgB,cAAc,IAAI;gBACzCK,WAAWjB;YACb;QACF,GACCkB,SAAS;IACd,EAAE,OAAOC,OAAO;QACd,IAAI/B,kBAAkB+B,OAAO,uDAAuD;YAClF,MAAM,IAAI7B,kCAAkCM,OAAOS,YAAY;QACjE;QACA,MAAMc;IACR;IAEA,IAAI,CAACjB,KAAK,MAAM,IAAIX,oCAAoCK,OAAOU,MAAM;IACrE,OAAOZ,oBAAoBQ;AAC7B;AAEA,OAAO,eAAekB,6BACpBd,MAAc,EACdT,UAA0B,CAAC,CAAC;IAE5B,MAAMC,WAAYD,QAAQE,EAAE,IAAIP;IAChC,MAAM6B,OAAO,MAAMvB,SAChBwB,MAAM,GACNC,IAAI,CAAC9B,oBACL+B,KAAK,CAACnC,GAAGI,mBAAmBa,MAAM,EAAEA,SACpCmB,KAAK,CAAC;IACT,MAAMvB,MAAMmB,IAAI,CAAC,EAAE;IACnB,IAAI,CAACnB,KAAK,OAAOwB;IACjB,OAAOhC,oBAAoBQ;AAC7B;AAEA,OAAO,eAAeyB,mCACpBtB,YAAoB,EACpBR,UAA0B,CAAC,CAAC;IAE5B,MAAMC,WAAYD,QAAQE,EAAE,IAAIP;IAChC,MAAM6B,OAAO,MAAMvB,SAChBwB,MAAM,GACNC,IAAI,CAAC9B,oBACL+B,KAAK,CAACnC,GAAGI,mBAAmBY,YAAY,EAAEA,eAC1CoB,KAAK,CAAC;IACT,MAAMvB,MAAMmB,IAAI,CAAC,EAAE;IACnB,IAAI,CAACnB,KAAK,OAAOwB;IACjB,OAAOhC,oBAAoBQ;AAC7B;AAEA,OAAO,eAAe0B,sCACpBvB,YAAoB,EACpBR,UAA0B,CAAC,CAAC;IAE5B,MAAMC,WAAYD,QAAQE,EAAE,IAAIP;IAChC,MAAMqC,SAAS,MAAM/B,SAClBgC,MAAM,CAACrC,oBACP+B,KAAK,CAACnC,GAAGI,mBAAmBY,YAAY,EAAEA;IAC7C,OAAO,AAACwB,CAAAA,OAAOE,QAAQ,IAAI,CAAA,IAAK;AAClC;AAEA,OAAO,eAAeC,6BACpB3B,YAAoB,EACpBR,UAA0B,CAAC,CAAC;IAE5B,MAAMC,WAAYD,QAAQE,EAAE,IAAIP;IAChC,MAAM,CAACU,IAAI,GAAG,MAAMJ,SACjBmC,MAAM,CAACxC,oBACPuB,GAAG,CAAC;QAACL,QAAQ;QAAWM,WAAW,IAAIhB;IAAM,GAC7CuB,KAAK,CAACnC,GAAGI,mBAAmBY,YAAY,EAAEA,eAC1Ca,SAAS;IACZ,IAAI,CAAChB,KAAK,OAAOwB;IACjB,OAAOhC,oBAAoBQ;AAC7B"}
|
|
@@ -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,oDAAyD,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_slack_${name}`);\n"],"names":["pgTableCreator","pgTable","name"],"mappings":"AAAA,SAAQA,cAAc,QAAO,sBAAsB;AAEnD,OAAO,MAAMC,UAAUD,eAAe,CAACE,OAAS,CAAC,mBAAmB,EAAEA,MAAM,EAAE"}
|