@fluentcommerce/fc-connect-sdk 0.1.48 → 0.1.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/CHANGELOG.md +506 -379
  2. package/README.md +343 -0
  3. package/dist/cjs/clients/fluent-client.js +110 -14
  4. package/dist/cjs/data-sources/s3-data-source.js +1 -1
  5. package/dist/cjs/data-sources/sftp-data-source.js +1 -1
  6. package/dist/cjs/index.d.ts +1 -1
  7. package/dist/cjs/services/extraction/extraction-orchestrator.d.ts +4 -1
  8. package/dist/cjs/services/extraction/extraction-orchestrator.js +84 -11
  9. package/dist/cjs/types/index.d.ts +79 -10
  10. package/dist/cjs/versori/fluent-versori-client.d.ts +4 -1
  11. package/dist/cjs/versori/fluent-versori-client.js +131 -13
  12. package/dist/esm/clients/fluent-client.js +110 -14
  13. package/dist/esm/data-sources/s3-data-source.js +1 -1
  14. package/dist/esm/data-sources/sftp-data-source.js +1 -1
  15. package/dist/esm/index.d.ts +1 -1
  16. package/dist/esm/services/extraction/extraction-orchestrator.d.ts +4 -1
  17. package/dist/esm/services/extraction/extraction-orchestrator.js +84 -11
  18. package/dist/esm/types/index.d.ts +79 -10
  19. package/dist/esm/versori/fluent-versori-client.d.ts +4 -1
  20. package/dist/esm/versori/fluent-versori-client.js +131 -13
  21. package/dist/tsconfig.esm.tsbuildinfo +1 -1
  22. package/dist/tsconfig.tsbuildinfo +1 -1
  23. package/dist/tsconfig.types.tsbuildinfo +1 -1
  24. package/dist/types/index.d.ts +1 -1
  25. package/dist/types/services/extraction/extraction-orchestrator.d.ts +4 -1
  26. package/dist/types/types/index.d.ts +79 -10
  27. package/dist/types/versori/fluent-versori-client.d.ts +4 -1
  28. package/docs/02-CORE-GUIDES/api-reference/event-api-input-output-reference.md +478 -18
  29. package/docs/02-CORE-GUIDES/api-reference/modules/api-reference-01-client-api.md +83 -0
  30. package/docs/02-CORE-GUIDES/api-reference/modules/api-reference-08-types.md +52 -0
  31. package/docs/02-CORE-GUIDES/api-reference/modules/api-reference-12-partial-responses.md +212 -0
  32. package/docs/02-CORE-GUIDES/api-reference/readme.md +1 -1
  33. package/docs/02-CORE-GUIDES/extraction/modules/02-core-guides-extraction-08-extraction-orchestrator.md +68 -4
  34. package/docs/02-CORE-GUIDES/mapping/modules/mapping-01-foundations.md +450 -448
  35. package/docs/02-CORE-GUIDES/mapping/modules/mapping-02-quick-start.md +476 -474
  36. package/docs/02-CORE-GUIDES/mapping/modules/mapping-03-schema-validation.md +464 -462
  37. package/docs/02-CORE-GUIDES/mapping/modules/mapping-05-advanced-patterns.md +1366 -1364
  38. package/docs/readme.md +245 -245
  39. package/package.json +17 -6
  40. package/docs/versori-apis/ACTIVATIONS-AND-VARIABLES-GUIDE.md +0 -60
  41. package/docs/versori-apis/JWT-GENERATION-GUIDE.md +0 -94
  42. package/docs/versori-apis/QUICK-WORKFLOW.md +0 -293
  43. package/docs/versori-apis/README.md +0 -73
  44. package/docs/versori-apis/VERSORI-PLATFORM-ARCHITECTURE.md +0 -880
  45. package/docs/versori-apis/Versori-Platform-API.postman_collection.json +0 -2925
  46. package/docs/versori-apis/Versori-Platform-API.postman_environment.example.json +0 -62
  47. package/docs/versori-apis/Versori-Platform-API.postman_environment.json +0 -178
@@ -1,880 +0,0 @@
1
- # Versori Platform Architecture & Data Model
2
-
3
- **Complete Guide to Understanding Versori Platform Entities and Their Relationships**
4
-
5
- ---
6
-
7
- ## Table of Contents
8
-
9
- 1. [Overview](#overview)
10
- 2. [Entity Hierarchy](#entity-hierarchy)
11
- 3. [Core Entities](#core-entities)
12
- 4. [Relationships & Dependencies](#relationships--dependencies)
13
- 5. [API Endpoints by Entity](#api-endpoints-by-entity)
14
- 6. [Common Workflows](#common-workflows)
15
- 7. [Data Flow Examples](#data-flow-examples)
16
-
17
- ---
18
-
19
- ## Overview
20
-
21
- The Versori Platform is organized around **Organisations** that contain **Projects**, **Systems**, **Connections**, **Users**, **Activations**, **Automations**, **Schedulers**, **Issues**, **Notifications**, **Metrics**, and **KV Store**. Understanding how these entities relate is crucial for building integrations.
22
-
23
- ### Key Concepts
24
-
25
- - **Organisation**: Top-level container (tenant)
26
- - **Project**: Code/workflows deployed to environments
27
- - **System**: External integration definition (Salesforce, S3, etc.)
28
- - **Connection**: Credentials linking a System to an Environment
29
- - **End User**: Your customer/user
30
- - **Activation**: Links a User to an Environment with user-specific config
31
- - **Environment**: Deployment target for a Project (production, staging, etc.)
32
- - **Automation**: Workflow automation with recording/transcription capabilities
33
- - **Scheduler**: Cron/timer-based scheduled workflow execution
34
- - **Issue**: Bug tracking and monitoring
35
- - **Notification**: Alert and notification channels
36
- - **Metrics**: Usage analytics and summaries
37
- - **KV Store**: Key-value state management and persistence
38
-
39
- ---
40
-
41
- ## Entity Hierarchy
42
-
43
- ```
44
- Organisation (Top Level)
45
-
46
- ├── Projects
47
- │ ├── Environments (created on deployment)
48
- │ ├── Variable Schema (defines allowed variables)
49
- │ ├── Files (TypeScript code/workflows)
50
- │ └── Connection Templates (predefined connection configs)
51
-
52
- ├── Systems
53
- │ ├── Actions (what you can do)
54
- │ └── Triggers (what can trigger workflows)
55
-
56
- ├── Connections
57
- │ └── Links: System + Environment
58
- │ └── Contains: Credentials + Configuration
59
-
60
- ├── End Users
61
- │ └── Identified by: externalId (immutable)
62
-
63
- ├── Activations
64
- │ └── Links: User + Environment
65
- │ └── Contains: Dynamic Variables (user-specific config)
66
- │ └── Requires: Connections for all environment systems
67
-
68
- ├── Automations
69
- │ ├── Runs (execution tracking)
70
- │ └── Recordings & Transcriptions
71
-
72
- ├── Schedulers
73
- │ └── Environment-scoped scheduled workflows
74
-
75
- ├── Issues
76
- │ └── Bug tracking and monitoring
77
-
78
- ├── Notifications
79
- │ ├── Notification Channels (organisation-scoped)
80
- │ └── Project Notifications (project-scoped)
81
-
82
- ├── Metrics
83
- │ └── Usage analytics and summaries
84
-
85
- └── KV Store
86
- └── Key-value state management
87
- ```
88
-
89
- ---
90
-
91
- ## Entity Distinctions: What's the Difference?
92
-
93
- Understanding the difference between these entities is critical. Here's a clear breakdown:
94
-
95
- ### System vs Connection vs Project vs Activation
96
-
97
- | Entity | **What It Is** | **Analogy** | **Scope** | **Contains** |
98
- |--------|---------------|-------------|-----------|--------------|
99
- | **System** | Definition of an external service (Salesforce, S3, Shopify) | The "blueprint" or "specification" | Organisation-wide (shared) | Actions, Triggers, Auth schemes |
100
- | **Connection** | Credentials + config linking a System to an Environment | The "actual login credentials" | Organisation → Environment | OAuth tokens, API keys, baseUrl |
101
- | **Project** | Your integration code/workflows | The "application" you're building | Organisation → Project | TypeScript files, Variable Schema |
102
- | **Environment** | Deployment target (prod, staging) | Where your app runs | Project → Environment | Deployed files, status, config |
103
- | **Activation** | User-specific setup linking User to Environment | Per-customer configuration | User → Environment | Dynamic variables, user's connections |
104
-
105
- ### Key Distinctions
106
-
107
- **System vs Connection:**
108
- - **System** = "What is Salesforce?" (the definition)
109
- - **Connection** = "Here are my Salesforce credentials" (the actual credentials)
110
- - One System can have many Connections (different credentials for different environments/users)
111
-
112
- **Project vs Environment:**
113
- - **Project** = Your code repository (the TypeScript files)
114
- - **Environment** = Where it's deployed (production, staging, dev)
115
- - One Project can have multiple Environments
116
-
117
- **Connection vs Activation:**
118
- - **Connection** = Credentials for a System in an Environment (can be shared)
119
- - **Activation** = User's specific setup (links User + Environment + Connections + Variables)
120
- - Connections are reusable; Activations are per-user
121
-
122
- **Example Flow:**
123
- ```
124
- 1. Create System "Salesforce" (defines what Salesforce is)
125
- 2. Create Project "Order Sync" (your code)
126
- 3. Deploy Project → Creates Environment "production"
127
- 4. Create Connection "Salesforce-Prod" (your Salesforce credentials) → Links System(Salesforce) + Environment(production)
128
- 5. Create User "customer-123"
129
- 6. Create Activation → Links User(customer-123) + Environment(production) + Connection(Salesforce-Prod) + Variables
130
- ```
131
-
132
- ---
133
-
134
- ## Core Entities
135
-
136
- ### 1. Organisation
137
-
138
- **What it is**: The top-level tenant/container for all resources.
139
-
140
- **API Path**: `/o/{organisation_id}/...`
141
-
142
- **Key Characteristics**:
143
- - All entities belong to an organisation
144
- - Organisation ID is required in all API calls
145
- - Acts as the security boundary
146
-
147
- **API Endpoints**:
148
- - No direct CRUD operations (managed by Versori)
149
- - All operations are scoped under `/o/{organisation_id}/`
150
-
151
- ---
152
-
153
- ### 2. Projects
154
-
155
- **What it is**: A collection of code/workflows (TypeScript files) that define integration logic.
156
-
157
- **API Path**: `/o/{organisation_id}/projects`
158
-
159
- **Key Characteristics**:
160
- - Contains TypeScript files (workflows, functions, schedules)
161
- - Has a **Variable Schema** that defines what dynamic variables can be set
162
- - Contains **Environments** (created when deployed)
163
- - Can be cloned, validated, and deployed
164
-
165
- **Entity Structure**:
166
- ```typescript
167
- Project {
168
- id: string
169
- name: string
170
- environments: ProjectEnvironment[] // Created on deployment
171
- dynamicVariablesSchema: DynamicVariablesSchema
172
- currentFiles: Files
173
- settings: ProjectSettings
174
- metadata: ProjectMetadata
175
- }
176
- ```
177
-
178
- **API Endpoints**:
179
- - `GET /o/{organisation_id}/projects` - List all projects
180
- - `POST /o/{organisation_id}/projects` - Create project
181
- - `GET /o/{organisation_id}/projects/{project_id}` - Get project details
182
- - `PUT /o/{organisation_id}/projects/{project_id}` - Update project
183
- - `DELETE /o/{organisation_id}/projects/{project_id}` - Delete project
184
- - `POST /o/{organisation_id}/projects/{project_id}/clone` - Clone project
185
- - `GET /o/{organisation_id}/projects/{project_id}/variables` - Get variable schema
186
- - `PUT /o/{organisation_id}/projects/{project_id}/variables` - Set variable schema
187
- - `PATCH /o/{organisation_id}/projects/{project_id}/variables` - Patch variable schema
188
- - `GET /o/{organisation_id}/projects/{project_id}/files` - Get project files
189
- - `PUT /o/{organisation_id}/projects/{project_id}/files` - Update project files
190
- - `PUT /o/{organisation_id}/projects/{project_id}/deploy` - Deploy to environment
191
- - `PUT /o/{organisation_id}/projects/{project_id}/versions/{version_id}/deploy` - Deploy specific version
192
- - `POST /o/{organisation_id}/projects/{project_id}/suspend` - Suspend project
193
- - `POST /o/{organisation_id}/projects/{project_id}/sentiment` - Add project sentiment
194
- - `POST /o/{organisation_id}/projects/{project_id}/testing/start` - Start test container
195
- - `POST /o/{organisation_id}/projects/{project_id}/testing/trigger/{trigger_name}` - Trigger workflow
196
- - `PUT /o/{organisation_id}/projects/{project_id}/validate` - Validate files
197
- - `GET /o/{organisation_id}/projects/{project_id}/logs` - Get logs
198
- - `GET /o/{organisation_id}/projects/{project_id}/traces` - List traces
199
- - `GET /o/{organisation_id}/projects/{project_id}/traces/{trace_id}` - Get trace
200
- - `GET /o/{organisation_id}/projects/{project_id}/workflows` - List integration flows
201
- - `GET /o/{organisation_id}/projects/{project_id}/workflows/{flow_name}` - Get flow
202
- - `PUT /o/{organisation_id}/projects/{project_id}/workflows/{flow_name}` - Update flow
203
- - `DELETE /o/{organisation_id}/projects/{project_id}/workflows/{flow_name}` - Delete flow
204
- - `GET /o/{organisation_id}/projects/{project_id}/connection-templates` - List connection templates
205
- - `POST /o/{organisation_id}/projects/{project_id}/connection-templates` - Create connection template
206
- - `PUT /o/{organisation_id}/projects/{project_id}/connection-templates/{template_id}` - Update template
207
- - `DELETE /o/{organisation_id}/projects/{project_id}/connection-templates/{template_id}` - Delete template
208
-
209
- ---
210
-
211
- ### 3. Environments
212
-
213
- **What it is**: A deployment target for a project (e.g., "production", "staging", "development").
214
-
215
- **API Path**: `/o/{organisation_id}/environments/{environment_id}`
216
-
217
- **Key Characteristics**:
218
- - Belongs to a Project (returned as part of Project object)
219
- - Has a status: `running`, `suspended`, `error`, or `draft`
220
- - Contains deployed files
221
- - Has configuration (infrastructure settings)
222
- - Has `lastDeployedAt` timestamp
223
-
224
- **Note**: The API documentation doesn't explicitly state that environments are created on deployment, but environments are returned as part of the Project object and deployment endpoints reference environments by name/ID.
225
-
226
- **Entity Structure**:
227
- ```typescript
228
- ProjectEnvironment {
229
- id: string
230
- name: string
231
- status: "running" | "suspended" | "error" | "draft"
232
- publicUrl: string
233
- files?: File[] // Optional array
234
- labels?: Labels
235
- config: EnvironmentConfig
236
- createdAt: string
237
- updatedAt: string
238
- lastDeployedAt: string // Required field
239
- }
240
- ```
241
-
242
- **API Endpoints**:
243
- - Environments are managed through Project endpoints
244
- - `PATCH /o/{organisation_id}/environments/{environment_id}/config` - Update environment config
245
- - `GET /o/{organisation_id}/environments/{environment_id}/activations` - List activations
246
- - `GET /o/{organisation_id}/environments/{environment_id}/schedulers` - List schedulers
247
- - `GET /o/{organisation_id}/environments/{environment_id}/schedulers/{scheduler_id}` - Get scheduler
248
- - `POST /o/{organisation_id}/environments/{environment_id}/schedulers/{scheduler_id}` - Trigger scheduler
249
-
250
- ---
251
-
252
- ### 4. Systems
253
-
254
- **What it is**: A definition of an external integration (e.g., Salesforce, S3, SFTP, Shopify).
255
-
256
- **API Path**: `/o/{organisation_id}/systems`
257
-
258
- **Key Characteristics**:
259
- - Organisation-scoped (shared across projects)
260
- - Defines **Actions** (what you can do with the system)
261
- - Defines **Triggers** (what can trigger workflows)
262
- - Can be linked to projects via actions/triggers
263
-
264
- **Note**: Connection Templates are managed under Projects, not Systems (see Projects section).
265
-
266
- **Entity Structure**:
267
- ```typescript
268
- System {
269
- id: string
270
- name: string
271
- domain: string
272
- templateBaseUrl: string
273
- authSchemeConfigs: AuthSchemeConfig[]
274
- }
275
- ```
276
-
277
- **Note**: Actions, Triggers, and Connection Templates are managed separately via their own endpoints - they are not direct properties of the System object.
278
-
279
- **API Endpoints**:
280
- - `GET /o/{organisation_id}/systems` - List systems
281
- - `POST /o/{organisation_id}/systems` - Create system
282
- - `GET /o/{organisation_id}/systems/{system_id}` - Get system
283
- - `PUT /o/{organisation_id}/systems/{system_id}` - Update system
284
- - `GET /o/{organisation_id}/systems/{system_id}/actions` - List actions
285
- - `POST /o/{organisation_id}/systems/{system_id}/actions` - Create actions
286
- - `GET /o/{organisation_id}/systems/{system_id}/actions/{action_id}` - Get action
287
- - `PUT /o/{organisation_id}/systems/{system_id}/actions/{action_id}` - Update action
288
- - `DELETE /o/{organisation_id}/systems/{system_id}/actions/{action_id}` - Delete action
289
- - `GET /o/{organisation_id}/systems/{system_id}/triggers` - List triggers
290
- - `POST /o/{organisation_id}/systems/{system_id}/triggers` - Create triggers
291
- - `POST /o/{organisation_id}/systems/{system_id}/projects/{project_id}/actions-link` - Link actions to project
292
- - `POST /o/{organisation_id}/systems/{system_id}/projects/{project_id}/triggers-link` - Link triggers to project
293
- - `POST /o/{organisation_id}/systems/{system_id}/oauth2/initialise` - Initialize OAuth2 connection
294
- - `POST /o/{organisation_id}/systems/{system_id}/oauth1/initialise` - Initialize OAuth1 connection
295
- - `PUT /o/{organisation_id}/systems/{system_id}/auth-scheme-configs/{auth_scheme_config_id}` - Upsert auth config
296
- - `DELETE /o/{organisation_id}/systems/{system_id}/auth-scheme-configs/{auth_scheme_config_id}` - Delete auth config
297
-
298
- ---
299
-
300
- ### 5. Connections
301
-
302
- **What it is**: Credentials and configuration that link a System to an Environment.
303
-
304
- **API Path**: `/o/{organisation_id}/connections`
305
-
306
- **Key Characteristics**:
307
- - Contains credentials (OAuth tokens, API keys, etc.)
308
- - Has a `systemId` reference to a System
309
- - Can be linked to environments via `LinkConnectionToEnvironment` endpoint
310
- - Required for activations (all environment systems must have connections)
311
- - Connections are created at organisation level, then linked to environments
312
- - **Important**: Connection creation requires `connectionTemplateId` (project-scoped) and `connection` object (both required fields)
313
-
314
- **Entity Structure**:
315
- ```typescript
316
- Connection {
317
- id: string
318
- name: string
319
- systemId?: string // Optional reference to System
320
- connectionTemplateId?: string // Optional reference to Connection Template
321
- credentials: ConnectionCredentials
322
- baseUrl?: string // Optional override
323
- createdAt: string
324
- updatedAt: string
325
- }
326
- ```
327
-
328
- **Note**: Connections are linked to environments via the `LinkConnectionToEnvironment` endpoint, but the Connection object itself doesn't contain an `environment` field - the relationship is managed separately.
329
-
330
- **API Endpoints**:
331
- - `GET /o/{organisation_id}/connections` - List connections (filterable by system_id, end_user_id)
332
- - `POST /o/{organisation_id}/connections` - Create connection
333
- - `GET /o/{organisation_id}/connections/{connection_id}` - Get connection
334
- - `PUT /o/{organisation_id}/connections/{connection_id}` - Update connection
335
- - **Note**: There is NO DELETE endpoint for connections in the API spec
336
- - `POST /o/{organisation_id}/connections/{connection_id}/link` - Link connection to environment
337
- - `GET /o/{organisation_id}/projects/{project_id}/connections` - List environment connections (requires env_id query parameter)
338
-
339
- ---
340
-
341
- ### 6. End Users
342
-
343
- **What it is**: Your customers/users who will use the integration.
344
-
345
- **API Path**: `/o/{organisation_id}/users`
346
-
347
- **Key Characteristics**:
348
- - Organisation-scoped
349
- - Identified by `externalId` (immutable, unique)
350
- - Can have multiple activations (one per environment)
351
- - `externalId` should NOT be an email (use a stable identifier)
352
-
353
- **Entity Structure**:
354
- ```typescript
355
- EndUser {
356
- id: string
357
- externalId: string // Immutable, unique identifier (required)
358
- displayName: string // Optional in creation, defaults to empty string if not set
359
- organisationId: string
360
- createdAt: string
361
- updatedAt: string
362
- }
363
- ```
364
-
365
- **API Endpoints**:
366
- - `GET /o/{organisation_id}/users` - List users (filterable by environment_id, activation status)
367
- - `POST /o/{organisation_id}/users` - Create user
368
- - `GET /o/{organisation_id}/users/{user_id}` - Get user (by id or externalId)
369
- - `PUT /o/{organisation_id}/users/{user_id}` - Update user
370
- - `DELETE /o/{organisation_id}/users/{user_id}` - Delete user
371
- - `GET /o/{organisation_id}/environment/{environment_id}/users/{external_user_id}/activations` - List user activations
372
-
373
- ---
374
-
375
- ### 7. Activations
376
-
377
- **What it is**: The "glue" that links a User to an Environment with user-specific configuration.
378
-
379
- **API Path**: `/o/{organisation_id}/environments/{environment_id}/activations`
380
-
381
- **Key Characteristics**:
382
- - Links a **User** to an **Environment**
383
- - Contains **Dynamic Variables** (user-specific config)
384
- - **Requires Connections** for all systems in the environment
385
- - Variables are validated against Project's Variable Schema
386
- - Can have **Static Variables** (environment-level defaults)
387
-
388
- **Entity Structure**:
389
- ```typescript
390
- Activation {
391
- id: string
392
- user: EndUser
393
- environment: ProjectEnvironment
394
- connections: Connection[] // All required connections
395
- dynamicVariables: DynamicVariables // User-specific config
396
- }
397
- ```
398
-
399
- **API Endpoints**:
400
- - `POST /o/{organisation_id}/activations` - Activate user (create activation)
401
- - `GET /o/{organisation_id}/environments/{environment_id}/activations` - List activations for environment
402
- - `GET /o/{organisation_id}/environments/{environment_id}/activations/{activation_id}` - Get activation
403
- - `DELETE /o/{organisation_id}/environments/{environment_id}/activations/{activation_id}` - Delete activation
404
- - `PATCH /o/{organisation_id}/environments/{environment_id}/activations/{activation_id}/variables` - Set dynamic variables
405
- - `PUT /o/{organisation_id}/environments/{environment_id}/activations/{activation_id}/variables/{variable_name}` - Set single variable
406
- - `PATCH /o/{organisation_id}/environments/{environment_id}/variables` - Set static variables (environment defaults)
407
- - `GET /o/{organisation_id}/environment/{environment_id}/users/{external_user_id}/activations` - List user activations
408
- - `GET /o/{organisation_id}/environment-systems/{env_system_id}/activations/{activation_id}` - Get activation connection
409
-
410
- ---
411
-
412
- ## Relationships & Dependencies
413
-
414
- ### Critical Relationships
415
-
416
- 1. **Organisation → Projects**
417
- - One-to-many
418
- - Projects belong to an organisation
419
-
420
- 2. **Project → Environments**
421
- - One-to-many
422
- - Environments belong to a Project (returned in Project.environments array)
423
- - Each environment has its own deployment status
424
-
425
- 3. **Organisation → Systems**
426
- - One-to-many
427
- - Systems are shared across all projects in an organisation
428
-
429
- 4. **System → Connection → Environment**
430
- - Many-to-many via Connection
431
- - A Connection references a System via `systemId`
432
- - Connections are linked to Environments via `LinkConnectionToEnvironment` endpoint
433
- - One System can have multiple Connections
434
-
435
- 5. **User → Activation → Environment**
436
- - Many-to-many via Activation
437
- - An Activation links a User to an Environment
438
- - One User can have multiple Activations (one per Environment)
439
-
440
- 6. **Activation → Connections**
441
- - Many-to-many
442
- - An Activation requires Connections for ALL systems in the environment
443
- - Connections are shared across activations in the same environment
444
-
445
- 7. **Project → Variable Schema**
446
- - One-to-one
447
- - Project defines what variables can be set
448
- - Activations store the actual values
449
-
450
- ### Dependency Rules
451
-
452
- 1. **Activation Creation Requires**:
453
- - User exists
454
- - Environment exists (project must be deployed)
455
- - Connections exist for ALL systems in the environment
456
- - Dynamic variables match Project's Variable Schema
457
-
458
- 2. **Connection Creation Requires**:
459
- - Connection Template exists (project-scoped, which references a System)
460
- - **Both `connectionTemplateId` and `connection` object are REQUIRED fields** for creation
461
- - Note: The relationship chain is: Connection Template (references systemId) → System → Connection
462
- - Connections are created at organisation level, then linked to environments separately
463
-
464
- 3. **Project Deployment**:
465
- - Deploys files to the specified environment
466
- - Updates the environment's deployed files
467
- - Note: Environment creation/management is not explicitly documented in the API spec
468
-
469
- 4. **Variable Validation**:
470
- - All dynamic variables must match Project's Variable Schema
471
- - Required variables must be provided
472
- - Partial updates must result in valid final state
473
-
474
- ---
475
-
476
- ## API Endpoints by Entity
477
-
478
- ### Quick Reference
479
-
480
- | Entity | List | Create | Get | Update | Delete |
481
- |--------|------|--------|-----|--------|--------|
482
- | **Projects** | ✅ | ✅ | ✅ | ✅ | ✅ |
483
- | **Environments** | ✅* | ✅* | ✅* | ✅* | ❌ |
484
- | **Systems** | ✅ | ✅ | ✅ | ✅ | ❌ |
485
- | **Connections** | ✅ | ✅ | ✅ | ✅ | ❌ |
486
- | **End Users** | ✅ | ✅ | ✅ | ✅ | ✅ |
487
- | **Activations** | ✅ | ✅ | ✅ | ❌ | ✅ |
488
- | **Automations** | ✅ | ✅ | ✅ | ✅ | ❌ |
489
- | **Schedulers** | ✅ | ❌ | ✅ | ❌ | ❌ |
490
- | **Issues** | ✅ | ✅ | ❌ | ✅ | ❌ |
491
- | **Notifications** | ✅ | ✅ | ❌ | ❌ | ✅ |
492
- | **Metrics** | ✅ | ❌ | ❌ | ❌ | ❌ |
493
- | **KV Store** | ✅ | ✅ | ✅ | ✅ | ✅ |
494
-
495
- *Environments are managed through Project endpoints (created on deployment)
496
- *Schedulers are read-only (created/managed elsewhere, can only trigger)
497
- *Metrics are read-only (no create/update/delete)
498
- *Issues have no GET by ID endpoint (only list)
499
- *Notifications: Channels are org-scoped, Project Notifications are project-scoped
500
-
501
- ---
502
-
503
- ## Common Workflows
504
-
505
- ### 1. Setting Up a New Integration
506
-
507
- **Step-by-step**:
508
-
509
- 1. **Create Project**
510
- ```http
511
- POST /o/{org_id}/projects
512
- {
513
- "name": "My Integration"
514
- }
515
- ```
516
-
517
- 2. **Set Variable Schema**
518
- ```http
519
- PUT /o/{org_id}/projects/{project_id}/variables
520
- {
521
- "properties": {
522
- "apiKey": { "type": "string" },
523
- "region": { "type": "string" }
524
- },
525
- "required": ["apiKey"]
526
- }
527
- ```
528
-
529
- 3. **Upload Files**
530
- ```http
531
- PUT /o/{org_id}/projects/{project_id}/files
532
- {
533
- "files": [
534
- { "filename": "workflow.ts", "content": "..." }
535
- ]
536
- }
537
- ```
538
-
539
- 4. **Deploy Project** (deploys to environment)
540
- ```http
541
- PUT /o/{org_id}/projects/{project_id}/deploy?environment=production
542
- {
543
- "environment": "production"
544
- }
545
- ```
546
-
547
- **Note**: The environment must already exist. The API doesn't explicitly document environment creation.
548
-
549
- 5. **Create/Use System** (if needed)
550
- ```http
551
- POST /o/{org_id}/systems
552
- {
553
- "name": "My External System"
554
- }
555
- ```
556
-
557
- 6. **Create Connection** (requires connectionTemplateId from step 1)
558
- ```http
559
- POST /o/{org_id}/connections
560
- {
561
- "connectionTemplateId": "...", // REQUIRED - from project's connection templates
562
- "connection": { // REQUIRED
563
- "name": "Production Connection",
564
- "credentials": { ... }
565
- }
566
- }
567
- ```
568
-
569
- **Note**: Both `connectionTemplateId` and `connection` are required fields. Connection templates are project-scoped, so you need a project first.
570
-
571
- 7. **Link Connection to Environment**
572
- ```http
573
- POST /o/{org_id}/connections/{connection_id}/link
574
- {
575
- "connectionTemplateId": "..."
576
- }
577
- ```
578
-
579
- ### 2. Activating a User
580
-
581
- **Step-by-step**:
582
-
583
- 1. **Create End User**
584
- ```http
585
- POST /o/{org_id}/users
586
- {
587
- "externalId": "customer-123",
588
- "displayName": "Customer ABC"
589
- }
590
- ```
591
-
592
- 2. **Activate User** (creates activation)
593
- ```http
594
- POST /o/{org_id}/activations
595
- {
596
- "userId": "customer-123",
597
- "environmentId": "{environment_id}",
598
- "connections": [
599
- {
600
- "connectionTemplateId": "...",
601
- "existingConnectionId": "{connection_id}"
602
- }
603
- ],
604
- "dynamicVariables": {
605
- "apiKey": "xyz123",
606
- "region": "us-east-1"
607
- }
608
- }
609
- ```
610
-
611
- **Important**: All systems in the environment must have connections provided.
612
-
613
- ### 3. Updating Activation Variables
614
-
615
- **Partial Update** (must include all required variables):
616
-
617
- ```http
618
- PATCH /o/{org_id}/environments/{env_id}/activations/{activation_id}/variables
619
- {
620
- "apiKey": "new-key", // Updating this
621
- "region": "us-west-1" // Must include required variables even if not changing
622
- }
623
- ```
624
-
625
- **Single Variable Update**:
626
-
627
- ```http
628
- PUT /o/{org_id}/environments/{env_id}/activations/{activation_id}/variables/apiKey
629
- "new-api-key-value"
630
- ```
631
-
632
- ### 4. Finding a User's Activation
633
-
634
- 1. **List Users** (find by externalId)
635
- ```http
636
- GET /o/{org_id}/users?search=customer-123
637
- ```
638
-
639
- 2. **List User Activations** (by external_user_id)
640
- ```http
641
- GET /o/{org_id}/environment/{env_id}/users/{external_user_id}/activations
642
- ```
643
-
644
- **OR** List all activations for an environment and filter:
645
- ```http
646
- GET /o/{org_id}/environments/{env_id}/activations
647
- ```
648
- Then filter response by `userId` or `externalId`
649
-
650
- ---
651
-
652
- ## Data Flow Examples
653
-
654
- ### Example 1: Multi-Tenant SaaS Integration
655
-
656
- **Scenario**: You're building a SaaS that integrates with Salesforce for each customer.
657
-
658
- ```
659
- Organisation: "Your SaaS Company"
660
-
661
- ├── Project: "Salesforce Integration"
662
- │ ├── Environment: "production"
663
- │ └── Variable Schema: { salesforceOrgId: string, apiVersion: string }
664
-
665
- ├── System: "Salesforce"
666
-
667
- ├── Connections (one per customer's Salesforce org):
668
- │ ├── Connection 1: "Customer A Salesforce" → System(Salesforce) + Environment(production)
669
- │ ├── Connection 2: "Customer B Salesforce" → System(Salesforce) + Environment(production)
670
- │ └── Connection 3: "Customer C Salesforce" → System(Salesforce) + Environment(production)
671
-
672
- ├── End Users (your customers):
673
- │ ├── User 1: externalId="customer-a"
674
- │ ├── User 2: externalId="customer-b"
675
- │ └── User 3: externalId="customer-c"
676
-
677
- └── Activations (one per customer):
678
- ├── Activation 1: User(customer-a) + Environment(production) + Connection(Customer A Salesforce)
679
- │ └── Variables: { salesforceOrgId: "00D...", apiVersion: "v58" }
680
- ├── Activation 2: User(customer-b) + Environment(production) + Connection(Customer B Salesforce)
681
- │ └── Variables: { salesforceOrgId: "00E...", apiVersion: "v58" }
682
- └── Activation 3: User(customer-c) + Environment(production) + Connection(Customer C Salesforce)
683
- └── Variables: { salesforceOrgId: "00F...", apiVersion: "v58" }
684
- ```
685
-
686
- ### Example 2: E-commerce Platform Integration
687
-
688
- **Scenario**: Integrating with Shopify, S3, and Fluent Commerce.
689
-
690
- ```
691
- Organisation: "E-commerce Platform"
692
-
693
- ├── Project: "Order Processing"
694
- │ ├── Environment: "production"
695
- │ └── Variable Schema: { shopifyStore: string, s3Bucket: string }
696
-
697
- ├── Systems:
698
- │ ├── System 1: "Shopify"
699
- │ ├── System 2: "AWS S3"
700
- │ └── System 3: "Fluent Commerce"
701
-
702
- ├── Connections (one per system per environment):
703
- │ ├── Connection 1: "Shopify-Prod" → System(Shopify) + Environment(production)
704
- │ ├── Connection 2: "S3-Prod" → System(AWS S3) + Environment(production)
705
- │ └── Connection 3: "Fluent-Prod" → System(Fluent Commerce) + Environment(production)
706
-
707
- ├── End Users (merchants):
708
- │ └── User 1: externalId="merchant-123"
709
-
710
- └── Activation:
711
- └── Activation 1: User(merchant-123) + Environment(production)
712
- ├── Connections: [Shopify-Prod, S3-Prod, Fluent-Prod] // All required!
713
- └── Variables: { shopifyStore: "mystore.myshopify.com", s3Bucket: "orders-prod" }
714
- ```
715
-
716
- ---
717
-
718
- ## Key Takeaways
719
-
720
- 1. **Organisation** is the top-level container
721
- 2. **Projects** contain code and define variable schemas
722
- 3. **Environments** belong to Projects (returned in Project.environments array)
723
- 4. **Systems** are shared across projects (organisation-scoped)
724
- 5. **Connections** link Systems to Environments (credentials)
725
- 6. **Activations** link Users to Environments (user-specific config)
726
- 7. **Activations require Connections** for all systems in the environment
727
- 8. **Variables** are schema-driven (Project defines schema, Activation stores values)
728
-
729
- ---
730
-
731
- ### 8. Automations
732
-
733
- **What it is**: Workflow automation system with recording and transcription capabilities for RPA/automation workflows.
734
-
735
- **API Path**: `/o/{organisation_id}/automations`
736
-
737
- **Key Characteristics**:
738
- - Organisation-scoped
739
- - Supports automation runs (execution tracking)
740
- - Includes recording and transcription features
741
- - Can be run on-demand or scheduled
742
-
743
- **API Endpoints**:
744
- - `GET /o/{organisation_id}/automations` - List automations
745
- - `POST /o/{organisation_id}/automations` - Create automation
746
- - `GET /o/{organisation_id}/automations/{automation_id}` - Get automation
747
- - `PUT /o/{organisation_id}/automations/{automation_id}` - Update automation
748
- - `POST /o/{organisation_id}/automations/{automation_id}/run` - Run automation
749
- - `GET /o/{organisation_id}/automations/{automation_id}/run` - List automation runs
750
- - `GET /o/{organisation_id}/automations/{automation_id}/runs/{run_id}` - Get automation run
751
- - `GET /o/{organisation_id}/automations/{automation_id}/recordings` - List recordings
752
- - `POST /o/{organisation_id}/automations/{automation_id}/recordings` - Create recording
753
- - `GET /o/{organisation_id}/automations/{automation_id}/recordings/{recording_id}` - Get recording
754
- - `POST /o/{organisation_id}/automations/{automation_id}/recordings/{recording_id}` - Create transcription
755
-
756
- ---
757
-
758
- ### 9. Schedulers
759
-
760
- **What it is**: Cron/timer-based scheduled workflow execution system.
761
-
762
- **API Path**: `/o/{organisation_id}/environments/{environment_id}/schedulers`
763
-
764
- **Key Characteristics**:
765
- - Environment-scoped
766
- - Can be triggered manually for testing
767
- - Used for scheduled/cron-based workflows
768
-
769
- **API Endpoints**:
770
- - `GET /o/{organisation_id}/environments/{environment_id}/schedulers` - List schedulers
771
- - `GET /o/{organisation_id}/environments/{environment_id}/schedulers/{scheduler_id}` - Get scheduler
772
- - `POST /o/{organisation_id}/environments/{environment_id}/schedulers/{scheduler_id}` - Trigger scheduler (manual execution)
773
-
774
- ---
775
-
776
- ### 10. Issues
777
-
778
- **What it is**: Bug tracking and issue management system for monitoring integration problems.
779
-
780
- **API Path**: `/o/{organisation_id}/issues`
781
-
782
- **Key Characteristics**:
783
- - Organisation-scoped
784
- - Can be filtered by status (`open`, `closed`, `acked`, `resolved`)
785
- - Can be filtered by project, environment, severity
786
- - Supports pagination with `first`, `after`, `before` parameters
787
-
788
- **API Endpoints**:
789
- - `GET /o/{organisation_id}/issues` - List issues (filterable by status, project_id, environment_id, severity)
790
- - `POST /o/{organisation_id}/issues` - Create issue
791
- - `PATCH /o/{organisation_id}/issues/{issue_id}` - Update issue
792
-
793
- ---
794
-
795
- ### 11. Notifications
796
-
797
- **What it is**: Alert and notification channel management system.
798
-
799
- **API Path**: `/o/{organisation_id}/notification_channels` and `/o/{organisation_id}/projects/{project_id}/notifications`
800
-
801
- **Key Characteristics**:
802
- - Notification Channels are organisation-scoped
803
- - Project Notifications link channels to projects
804
- - Supports multiple notification channels per organisation
805
-
806
- **API Endpoints**:
807
- - `GET /o/{organisation_id}/notification_channels` - List notification channels
808
- - `POST /o/{organisation_id}/notification_channels` - Create notification channel
809
- - `DELETE /o/{organisation_id}/notification_channels/{channel_id}` - Delete notification channel
810
- - `GET /o/{organisation_id}/projects/{project_id}/notifications` - List project notifications (requires env_id query parameter)
811
- - `POST /o/{organisation_id}/projects/{project_id}/notifications` - Create project notification
812
- - `DELETE /o/{organisation_id}/projects/{project_id}/notifications/{notification_id}` - Delete project notification
813
-
814
- **Note**: The YAML spec shows `/projects/{project_id}/notifications` without the `/o/{organisation_id}/` prefix, but the actual API requires the full path with organisation prefix.
815
-
816
- ---
817
-
818
- ### 12. Metrics
819
-
820
- **What it is**: Usage analytics and metrics summaries for organisations and projects.
821
-
822
- **API Path**: `/o/{organisation_id}/metricssummary` and `/o/{organisation_id}/projects/metricssummary`
823
-
824
- **Key Characteristics**:
825
- - Organisation-level metrics summary
826
- - Project-level metrics summary (aggregated across all projects)
827
- - Read-only (no create/update/delete operations)
828
-
829
- **API Endpoints**:
830
- - `GET /o/{organisation_id}/metricssummary` - Get organisation metrics summary
831
- - `GET /o/{organisation_id}/projects/metricssummary` - Get project metrics summary
832
-
833
- ---
834
-
835
- ### 13. KV Store
836
-
837
- **What it is**: Key-value state management and persistence system for storing integration state.
838
-
839
- **API Path**: `/o/{organisation_id}/store` (for store management) and `/store/{store}/kv` (for KV operations)
840
-
841
- **Key Characteristics**:
842
- - Organisation-scoped stores
843
- - Keys are arrays of strings (e.g., `["products", "123"]`)
844
- - Supports batch operations (get, set, delete) - all use same `/kv/batch` path with different HTTP methods
845
- - Supports listing and counting with filtering
846
- - **Important**: KV operations use `/store/{store}/kv/{key}` path pattern (no `/o/{org_id}/` prefix)
847
-
848
- **API Endpoints**:
849
- - `GET /o/{organisation_id}/store` - List stores
850
- - `POST /o/{organisation_id}/store` - Create store
851
- - `GET /store/{store}/kv/{key}` - Get KV value
852
- - `PUT /store/{store}/kv/{key}` - Set KV value
853
- - `DELETE /store/{store}/kv/{key}` - Delete KV value
854
- - `POST /store/{store}/kv/batch` - Batch get KV (multiple keys)
855
- - `PUT /store/{store}/kv/batch` - Batch set KV (multiple key-value pairs)
856
- - `DELETE /store/{store}/kv/batch` - Batch delete KV (multiple keys)
857
- - `POST /store/{store}/kv/list` - List KV entries with filtering
858
- - `POST /store/{store}/kv/count` - Count KV entries matching selector
859
-
860
- ---
861
-
862
- ## API Verification
863
-
864
- ✅ **All relationships match the API structure**:
865
-
866
- - Projects are scoped under `/o/{org_id}/projects`
867
- - Environments are accessed via `/o/{org_id}/environments/{env_id}` (created on deployment)
868
- - Systems are scoped under `/o/{org_id}/systems`
869
- - Connections are scoped under `/o/{org_id}/connections`
870
- - Users are scoped under `/o/{org_id}/users`
871
- - Activations are scoped under `/o/{org_id}/environments/{env_id}/activations`
872
- - Activation schema includes: `user`, `environment`, `connections`, `dynamicVariables`
873
-
874
- The API structure confirms the model described above.
875
-
876
- ---
877
-
878
- **Last Updated**: 2025-01-19
879
- **API Version**: 0.0.1
880
- **Base URL**: https://platform.versori.com/api/v2