@friggframework/core 2.0.0--canary.458.c150d9a.0 → 2.0.0--canary.459.51231dd.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/database/config.js +29 -1
- package/database/use-cases/test-encryption-use-case.js +6 -5
- package/docs/PROCESS_MANAGEMENT_QUEUE_SPEC.md +517 -0
- package/integrations/repositories/process-repository-factory.js +46 -0
- package/integrations/repositories/process-repository-interface.js +90 -0
- package/integrations/repositories/process-repository-mongo.js +190 -0
- package/integrations/repositories/process-repository-postgres.js +190 -0
- package/integrations/use-cases/create-process.js +128 -0
- package/integrations/use-cases/create-process.test.js +178 -0
- package/integrations/use-cases/get-process.js +87 -0
- package/integrations/use-cases/get-process.test.js +190 -0
- package/integrations/use-cases/index.js +8 -0
- package/integrations/use-cases/update-process-metrics.js +165 -0
- package/integrations/use-cases/update-process-metrics.test.js +308 -0
- package/integrations/use-cases/update-process-state.js +119 -0
- package/integrations/use-cases/update-process-state.test.js +256 -0
- package/package.json +5 -5
- package/prisma-mongodb/schema.prisma +44 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/core",
|
|
3
3
|
"prettier": "@friggframework/prettier-config",
|
|
4
|
-
"version": "2.0.0--canary.
|
|
4
|
+
"version": "2.0.0--canary.459.51231dd.0",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@hapi/boom": "^10.0.1",
|
|
7
7
|
"@prisma/client": "^6.16.3",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"uuid": "^9.0.1"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@friggframework/eslint-config": "2.0.0--canary.
|
|
27
|
-
"@friggframework/prettier-config": "2.0.0--canary.
|
|
28
|
-
"@friggframework/test": "2.0.0--canary.
|
|
26
|
+
"@friggframework/eslint-config": "2.0.0--canary.459.51231dd.0",
|
|
27
|
+
"@friggframework/prettier-config": "2.0.0--canary.459.51231dd.0",
|
|
28
|
+
"@friggframework/test": "2.0.0--canary.459.51231dd.0",
|
|
29
29
|
"@types/lodash": "4.17.15",
|
|
30
30
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
31
31
|
"chai": "^4.3.6",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "51231ddd4b2d47e29b81294b303d1953f768f327"
|
|
68
68
|
}
|
|
@@ -46,6 +46,7 @@ model User {
|
|
|
46
46
|
credentials Credential[]
|
|
47
47
|
entities Entity[]
|
|
48
48
|
integrations Integration[]
|
|
49
|
+
processes Process[]
|
|
49
50
|
|
|
50
51
|
@@unique([email])
|
|
51
52
|
@@unique([username])
|
|
@@ -172,6 +173,7 @@ model Integration {
|
|
|
172
173
|
associations Association[]
|
|
173
174
|
syncs Sync[]
|
|
174
175
|
mappings IntegrationMapping[]
|
|
176
|
+
processes Process[]
|
|
175
177
|
|
|
176
178
|
@@index([userId])
|
|
177
179
|
@@index([status])
|
|
@@ -206,6 +208,48 @@ model IntegrationMapping {
|
|
|
206
208
|
@@map("IntegrationMapping")
|
|
207
209
|
}
|
|
208
210
|
|
|
211
|
+
// ============================================================================
|
|
212
|
+
// PROCESS MODELS
|
|
213
|
+
// ============================================================================
|
|
214
|
+
|
|
215
|
+
/// Generic Process Model - tracks any long-running operation
|
|
216
|
+
/// Used for: CRM syncs, data migrations, bulk operations, etc.
|
|
217
|
+
model Process {
|
|
218
|
+
id String @id @default(auto()) @map("_id") @db.ObjectId
|
|
219
|
+
|
|
220
|
+
// Core references
|
|
221
|
+
userId String @db.ObjectId
|
|
222
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
223
|
+
integrationId String @db.ObjectId
|
|
224
|
+
integration Integration @relation(fields: [integrationId], references: [id], onDelete: Cascade)
|
|
225
|
+
|
|
226
|
+
// Process identification
|
|
227
|
+
name String // e.g., "zoho-crm-contact-sync", "pipedrive-lead-sync"
|
|
228
|
+
type String // e.g., "CRM_SYNC", "DATA_MIGRATION", "BULK_OPERATION"
|
|
229
|
+
|
|
230
|
+
// State machine
|
|
231
|
+
state String // Current state (integration-defined states)
|
|
232
|
+
|
|
233
|
+
// Flexible storage
|
|
234
|
+
context Json @default("{}") // Process-specific data (pagination, metadata, etc.)
|
|
235
|
+
results Json @default("{}") // Process results and metrics
|
|
236
|
+
|
|
237
|
+
// Hierarchy support
|
|
238
|
+
childProcesses String[] @db.ObjectId
|
|
239
|
+
parentProcessId String? @db.ObjectId
|
|
240
|
+
|
|
241
|
+
// Timestamps
|
|
242
|
+
createdAt DateTime @default(now())
|
|
243
|
+
updatedAt DateTime @updatedAt
|
|
244
|
+
|
|
245
|
+
@@index([userId])
|
|
246
|
+
@@index([integrationId])
|
|
247
|
+
@@index([type])
|
|
248
|
+
@@index([state])
|
|
249
|
+
@@index([name])
|
|
250
|
+
@@map("Process")
|
|
251
|
+
}
|
|
252
|
+
|
|
209
253
|
// ============================================================================
|
|
210
254
|
// SYNC MODELS
|
|
211
255
|
// ============================================================================
|