@solidxai/core 0.1.13-beta.6 → 0.1.13-beta.7
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/CHANGELOG.md +528 -0
- package/dist/controllers/media.controller.d.ts +1 -1
- package/dist/controllers/media.controller.js +1 -1
- package/dist/seeders/seed-data/solid-core-metadata.json +28 -2
- package/dist/services/media.service.d.ts +1 -1
- package/dist/services/media.service.d.ts.map +1 -1
- package/dist/services/media.service.js +16 -27
- package/dist/services/media.service.js.map +1 -1
- package/dist-tests/api/authenticate.spec.js +119 -0
- package/dist-tests/api/authenticate.spec.js.map +1 -0
- package/dist-tests/api/crud-service.findOne.cityMaster.spec.js +97 -0
- package/dist-tests/api/crud-service.findOne.cityMaster.spec.js.map +1 -0
- package/dist-tests/api/ping.spec.js +21 -0
- package/dist-tests/api/ping.spec.js.map +1 -0
- package/dist-tests/helpers/auth.js +41 -0
- package/dist-tests/helpers/auth.js.map +1 -0
- package/dist-tests/helpers/env.js +11 -0
- package/dist-tests/helpers/env.js.map +1 -0
- package/docs/agent-builder/notebook-lm-prompt-for-agent-builder.md +136 -0
- package/docs/agent-builder/team-ready-note-agent-builder.md +305 -0
- package/docs/agent-hub-grooming.md +301 -0
- package/docs/dashboards/AGENTIC_DASHBOARD_IMPLEMENTATION_PLAN.md +438 -0
- package/docs/dashboards/dashboard-curl-smoke-tests.txt +146 -0
- package/docs/dashboards/delete-legacy-dashboard-metadata.sql +172 -0
- package/docs/datasource-introspection-ddl-analysis.md +326 -0
- package/docs/datasource-introspection-implementation-plan.md +306 -0
- package/docs/grouping-enhancements.md +89 -0
- package/docs/java-spring/README.md +3 -0
- package/docs/java-spring/solid-core-module-deep-dive-report.md +1317 -0
- package/docs/module-package-import-handoff.md +691 -0
- package/docs/seed-changes.md +65 -0
- package/docs/test-data-workflow.md +200 -0
- package/docs/type-declaration-import-issue.md +24 -0
- package/docs/workflow/business-automation-example-notes.md +309 -0
- package/docs/workflow/control-flow-node-addition-sop.md +324 -0
- package/docs/workflow/data-engineering-pipeline-example-notes.md +330 -0
- package/docs/workflow/foreach-example-notes.md +187 -0
- package/docs/workflow/hello-world-example-notes.md +271 -0
- package/docs/workflow/kestra-concepts-plugins-blueprints.md +315 -0
- package/docs/workflow/loop-until-example-notes.md +198 -0
- package/docs/workflow/microservices-and-apis-example-notes.md +264 -0
- package/docs/workflow/samples.md +25 -0
- package/docs/workflow/what-is-kestra.md +79 -0
- package/docs/workflow/workflow-core-module-handoff-summary.md +191 -0
- package/docs/workflow/workflow-module-brd.md +185 -0
- package/docs/workflow/workflow-module-domain-model.md +252 -0
- package/docs/workflow/workflow-module-metadata-dsl.md +302 -0
- package/docs/workflow/workflow-module-technical-spec.md +293 -0
- package/docs/workflow/workflow-node-type-contracts.md +635 -0
- package/docs/workflow/workflow-node-ui-metadata-contract.md +1262 -0
- package/docs/workflow/workflow-solidx-model-field-spec.md +284 -0
- package/package.json +1 -1
- package/src/seeders/seed-data/solid-core-metadata.json +28 -2
- package/src/services/media.service.ts +19 -33
- package/.claude/settings.local.json +0 -16
- package/CLAUDE.md +0 -26
- package/src/services/1.js +0 -6
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
# Workflow SolidX Model Field Specification
|
|
2
|
+
|
|
3
|
+
This document translates the agreed workflow-management domain model into SolidX model and field definitions.
|
|
4
|
+
|
|
5
|
+
It is intended as the final field-level design pass before using the SolidX model MCP tools.
|
|
6
|
+
|
|
7
|
+
## SolidX Field Types
|
|
8
|
+
|
|
9
|
+
The local `@solidxai/core` package defines these field types in `SolidFieldType`:
|
|
10
|
+
|
|
11
|
+
- `int`
|
|
12
|
+
- `bigint`
|
|
13
|
+
- `decimal`
|
|
14
|
+
- `shortText`
|
|
15
|
+
- `longText`
|
|
16
|
+
- `richText`
|
|
17
|
+
- `json`
|
|
18
|
+
- `boolean`
|
|
19
|
+
- `date`
|
|
20
|
+
- `datetime`
|
|
21
|
+
- `time`
|
|
22
|
+
- `relation`
|
|
23
|
+
- `mediaSingle`
|
|
24
|
+
- `mediaMultiple`
|
|
25
|
+
- `email`
|
|
26
|
+
- `password`
|
|
27
|
+
- `selectionStatic`
|
|
28
|
+
- `selectionDynamic`
|
|
29
|
+
- `computed`
|
|
30
|
+
- `uuid`
|
|
31
|
+
|
|
32
|
+
Useful relation metadata:
|
|
33
|
+
|
|
34
|
+
- `relationType`: `many-to-one`, `one-to-many`, `many-to-many`
|
|
35
|
+
- `relationCascade`: `set null`, `restrict`, `cascade`
|
|
36
|
+
|
|
37
|
+
## Modeling Philosophy
|
|
38
|
+
|
|
39
|
+
- Workflow definitions store their canonical DSL in YAML text.
|
|
40
|
+
- Workflow definitions are metadata-backed: manually created workflows should also be persisted back to the module metadata JSON so developers can commit and share them.
|
|
41
|
+
- Workflow execution data is normalized enough to support monitoring, filtering, and debugging.
|
|
42
|
+
- Workflow version history is not a separate model in v1.
|
|
43
|
+
- `definitionVersion` and `definitionChecksum` live on both definition and execution records.
|
|
44
|
+
- `WorkflowBlueprint` is intentionally deferred for now.
|
|
45
|
+
|
|
46
|
+
## Model: `workflowDefinition`
|
|
47
|
+
|
|
48
|
+
Purpose: stores the current reusable workflow definition.
|
|
49
|
+
|
|
50
|
+
Suggested table name: `wm_workflow_definition`
|
|
51
|
+
|
|
52
|
+
| Field | SolidX Type | Required | Notes |
|
|
53
|
+
| --- | --- | --- | --- |
|
|
54
|
+
| `key` | `shortText` | Yes | Stable workflow key. Should be unique. |
|
|
55
|
+
| `moduleMetadata` | `relation` | Yes | Many-to-one to SolidX `moduleMetadata`; identifies the owning module/package for metadata persistence. |
|
|
56
|
+
| `displayName` | `shortText` | Yes | Human-facing name. |
|
|
57
|
+
| `namespace` | `shortText` | No | Dot-path grouping, e.g. `ops.monitoring`. |
|
|
58
|
+
| `description` | `longText` | No | Workflow description. |
|
|
59
|
+
| `status` | `selectionStatic` | Yes | `draft`, `active`, `inactive`, `archived`. |
|
|
60
|
+
| `definitionVersion` | `shortText` | No | Human-managed or seed-managed version string. |
|
|
61
|
+
| `definitionChecksum` | `shortText` | No | Hash of canonical `definitionYaml`. |
|
|
62
|
+
| `definitionYaml` | `longText` | Yes | Canonical workflow DSL YAML used for sharing, seeding, validation, and execution. |
|
|
63
|
+
| `tags` | `json` | No | Array of tags. |
|
|
64
|
+
|
|
65
|
+
Recommended indexes/search fields:
|
|
66
|
+
|
|
67
|
+
- `key`
|
|
68
|
+
- `moduleMetadata`
|
|
69
|
+
- `displayName`
|
|
70
|
+
- `namespace`
|
|
71
|
+
- `status`
|
|
72
|
+
- `definitionChecksum`
|
|
73
|
+
|
|
74
|
+
Recommended user key:
|
|
75
|
+
|
|
76
|
+
- `key`
|
|
77
|
+
|
|
78
|
+
Metadata persistence notes:
|
|
79
|
+
|
|
80
|
+
- `key` acts as the workflow user key and metadata identity.
|
|
81
|
+
- A TypeORM subscriber or workflow persistence service should synchronize workflow definition changes back to the owning module metadata JSON.
|
|
82
|
+
- Since UI-created workflows are also metadata-backed, separate `sourceType`, `seedSource`, `seedKey`, `seedVersion`, and `isSeeded` fields are not needed.
|
|
83
|
+
|
|
84
|
+
## Model: `workflowExecution`
|
|
85
|
+
|
|
86
|
+
Purpose: stores one run of a workflow definition.
|
|
87
|
+
|
|
88
|
+
Suggested table name: `wm_workflow_execution`
|
|
89
|
+
|
|
90
|
+
| Field | SolidX Type | Required | Notes |
|
|
91
|
+
| --- | --- | --- | --- |
|
|
92
|
+
| `executionIdentifier` | `computed` | Yes | System-generated readable execution id. Recommended provider: `SequenceNumComputedFieldProvider`. |
|
|
93
|
+
| `workflowDefinition` | `relation` | Yes | Many-to-one to `workflowDefinition`. |
|
|
94
|
+
| `workflowKey` | `shortText` | Yes | Snapshot of definition key for easier querying. |
|
|
95
|
+
| `workflowDisplayName` | `shortText` | No | Snapshot of display name. |
|
|
96
|
+
| `status` | `selectionStatic` | Yes | `created`, `running`, `success`, `failed`, `cancelled`. |
|
|
97
|
+
| `triggerType` | `selectionStatic` | Yes | `manual`, `schedule`, `webhook`, `flow`, `polling`, `event`. |
|
|
98
|
+
| `triggerExecution` | `relation` | No | Many-to-one to `workflowTriggerExecution`; nullable for manual runs. |
|
|
99
|
+
| `startedAt` | `datetime` | No | Execution start time. |
|
|
100
|
+
| `finishedAt` | `datetime` | No | Execution end time. |
|
|
101
|
+
| `durationMs` | `bigint` | No | Runtime duration. |
|
|
102
|
+
| `inputPayload` | `json` | No | Runtime inputs supplied to the execution. |
|
|
103
|
+
| `outputPayload` | `json` | No | Flow-level outputs. |
|
|
104
|
+
| `definitionVersion` | `shortText` | No | Version used by this execution. |
|
|
105
|
+
| `definitionChecksum` | `shortText` | No | Checksum used by this execution. |
|
|
106
|
+
| `definitionSnapshot` | `longText` | Yes | Exact workflow YAML used for this run. |
|
|
107
|
+
| `errorSummary` | `longText` | No | Human-readable failure summary. |
|
|
108
|
+
| `errorDetails` | `json` | No | Structured error payload. |
|
|
109
|
+
| `requestedByUserId` | `bigint` | No | User id or actor id if available. |
|
|
110
|
+
|
|
111
|
+
Recommended indexes/search fields:
|
|
112
|
+
|
|
113
|
+
- `executionIdentifier`
|
|
114
|
+
- `workflowKey`
|
|
115
|
+
- `status`
|
|
116
|
+
- `triggerType`
|
|
117
|
+
- `startedAt`
|
|
118
|
+
- `finishedAt`
|
|
119
|
+
- `definitionChecksum`
|
|
120
|
+
|
|
121
|
+
Recommended computed field configuration:
|
|
122
|
+
|
|
123
|
+
- `type`: `computed`
|
|
124
|
+
- `computedFieldValueProvider`: `SequenceNumComputedFieldProvider`
|
|
125
|
+
- `computedFieldValueProviderCtxt`: `{"sequenceName":"workflowExecution","mode":"counter"}`
|
|
126
|
+
- `computedFieldValueType`: `string`
|
|
127
|
+
- `computedFieldTriggerConfig`: after insert for `workflowExecution`
|
|
128
|
+
|
|
129
|
+
Recommended model sequence:
|
|
130
|
+
|
|
131
|
+
- `sequenceName`: `workflowExecution`
|
|
132
|
+
- `prefix`: `WFE`
|
|
133
|
+
- `separator`: `-`
|
|
134
|
+
- `padding`: `8`
|
|
135
|
+
- Example output: `WFE-00000001`
|
|
136
|
+
|
|
137
|
+
## Model: `workflowStepExecution`
|
|
138
|
+
|
|
139
|
+
Purpose: stores runtime state for one workflow node execution.
|
|
140
|
+
|
|
141
|
+
Suggested table name: `wm_workflow_step_execution`
|
|
142
|
+
|
|
143
|
+
| Field | SolidX Type | Required | Notes |
|
|
144
|
+
| --- | --- | --- | --- |
|
|
145
|
+
| `workflowExecution` | `relation` | Yes | Many-to-one to `workflowExecution`. |
|
|
146
|
+
| `parentStepExecution` | `relation` | No | Self many-to-one for nested/control execution. |
|
|
147
|
+
| `nodeId` | `shortText` | Yes | Node id from workflow YAML. |
|
|
148
|
+
| `nodeName` | `shortText` | No | Snapshot of node name. |
|
|
149
|
+
| `nodeKind` | `selectionStatic` | Yes | `task`, `control`, `subflow`. |
|
|
150
|
+
| `nodeType` | `shortText` | Yes | e.g. `http.request`, `if`. |
|
|
151
|
+
| `status` | `selectionStatic` | Yes | `pending`, `running`, `success`, `failed`, `skipped`. |
|
|
152
|
+
| `attemptNumber` | `int` | Yes | Defaults to 1. |
|
|
153
|
+
| `branchId` | `shortText` | No | For `parallel` branch context. |
|
|
154
|
+
| `iterationIndex` | `int` | No | For `forEach` context. |
|
|
155
|
+
| `startedAt` | `datetime` | No | Step start time. |
|
|
156
|
+
| `finishedAt` | `datetime` | No | Step end time. |
|
|
157
|
+
| `durationMs` | `bigint` | No | Step runtime duration. |
|
|
158
|
+
| `inputContext` | `json` | No | Resolved node input context. |
|
|
159
|
+
| `outputPayload` | `json` | No | Node outputs. |
|
|
160
|
+
| `errorSummary` | `longText` | No | Human-readable failure summary. |
|
|
161
|
+
| `errorDetails` | `json` | No | Structured error payload. |
|
|
162
|
+
|
|
163
|
+
Recommended indexes/search fields:
|
|
164
|
+
|
|
165
|
+
- `workflowExecution`
|
|
166
|
+
- `nodeId`
|
|
167
|
+
- `nodeType`
|
|
168
|
+
- `status`
|
|
169
|
+
- `startedAt`
|
|
170
|
+
|
|
171
|
+
## Model: `workflowExecutionLog`
|
|
172
|
+
|
|
173
|
+
Purpose: stores execution and step logs as queryable records.
|
|
174
|
+
|
|
175
|
+
Suggested table name: `wm_workflow_execution_log`
|
|
176
|
+
|
|
177
|
+
| Field | SolidX Type | Required | Notes |
|
|
178
|
+
| --- | --- | --- | --- |
|
|
179
|
+
| `workflowExecution` | `relation` | Yes | Many-to-one to `workflowExecution`. |
|
|
180
|
+
| `workflowStepExecution` | `relation` | No | Many-to-one to `workflowStepExecution`; nullable for execution-level logs. |
|
|
181
|
+
| `level` | `selectionStatic` | Yes | `debug`, `info`, `warn`, `error`. |
|
|
182
|
+
| `message` | `longText` | Yes | Log message. |
|
|
183
|
+
| `metadata` | `json` | No | Structured log metadata. |
|
|
184
|
+
| `loggedAt` | `datetime` | Yes | Timestamp of log event. |
|
|
185
|
+
|
|
186
|
+
Recommended indexes/search fields:
|
|
187
|
+
|
|
188
|
+
- `workflowExecution`
|
|
189
|
+
- `workflowStepExecution`
|
|
190
|
+
- `level`
|
|
191
|
+
- `loggedAt`
|
|
192
|
+
|
|
193
|
+
## Model: `workflowExecutionArtifact`
|
|
194
|
+
|
|
195
|
+
Purpose: stores references to files or large artifacts produced during execution.
|
|
196
|
+
|
|
197
|
+
Suggested table name: `wm_workflow_execution_artifact`
|
|
198
|
+
|
|
199
|
+
| Field | SolidX Type | Required | Notes |
|
|
200
|
+
| --- | --- | --- | --- |
|
|
201
|
+
| `workflowExecution` | `relation` | Yes | Many-to-one to `workflowExecution`. |
|
|
202
|
+
| `workflowStepExecution` | `relation` | No | Many-to-one to `workflowStepExecution`. |
|
|
203
|
+
| `artifactKey` | `shortText` | Yes | Stable artifact key within the execution. |
|
|
204
|
+
| `displayName` | `shortText` | No | Human-facing name. |
|
|
205
|
+
| `artifactType` | `selectionStatic` | Yes | `file`, `json`, `text`, `binary`, `uri`. |
|
|
206
|
+
| `media` | `mediaSingle` | No | SolidX media attachment for stored file artifacts. |
|
|
207
|
+
| `uri` | `longText` | No | External artifact URI if not stored in media. |
|
|
208
|
+
| `contentType` | `shortText` | No | MIME type if known. |
|
|
209
|
+
| `sizeBytes` | `bigint` | No | Artifact size. |
|
|
210
|
+
| `metadata` | `json` | No | Structured artifact metadata. |
|
|
211
|
+
| `createdAtRuntime` | `datetime` | No | Runtime artifact creation timestamp. |
|
|
212
|
+
|
|
213
|
+
Recommended indexes/search fields:
|
|
214
|
+
|
|
215
|
+
- `workflowExecution`
|
|
216
|
+
- `workflowStepExecution`
|
|
217
|
+
- `artifactKey`
|
|
218
|
+
- `artifactType`
|
|
219
|
+
|
|
220
|
+
## Model: `workflowTriggerExecution`
|
|
221
|
+
|
|
222
|
+
Purpose: records trigger events that started or attempted to start workflow executions.
|
|
223
|
+
|
|
224
|
+
Suggested table name: `wm_workflow_trigger_execution`
|
|
225
|
+
|
|
226
|
+
| Field | SolidX Type | Required | Notes |
|
|
227
|
+
| --- | --- | --- | --- |
|
|
228
|
+
| `workflowDefinition` | `relation` | Yes | Many-to-one to `workflowDefinition`. |
|
|
229
|
+
| `triggerId` | `shortText` | Yes | Trigger id from workflow YAML. |
|
|
230
|
+
| `triggerType` | `selectionStatic` | Yes | `schedule`, `webhook`, `flow`, `polling`, `event`. |
|
|
231
|
+
| `status` | `selectionStatic` | Yes | `received`, `accepted`, `ignored`, `failed`. |
|
|
232
|
+
| `firedAt` | `datetime` | Yes | Trigger fire time. |
|
|
233
|
+
| `inputPayload` | `json` | No | Inputs supplied by trigger. |
|
|
234
|
+
| `triggerPayload` | `json` | No | Raw trigger/event payload. |
|
|
235
|
+
| `workflowExecution` | `relation` | No | Many-to-one to `workflowExecution`; nullable if ignored/failed before execution creation. |
|
|
236
|
+
| `errorSummary` | `longText` | No | Human-readable failure summary. |
|
|
237
|
+
| `errorDetails` | `json` | No | Structured error payload. |
|
|
238
|
+
|
|
239
|
+
Recommended indexes/search fields:
|
|
240
|
+
|
|
241
|
+
- `workflowDefinition`
|
|
242
|
+
- `triggerId`
|
|
243
|
+
- `triggerType`
|
|
244
|
+
- `status`
|
|
245
|
+
- `firedAt`
|
|
246
|
+
|
|
247
|
+
## Deferred Model: `workflowBlueprint`
|
|
248
|
+
|
|
249
|
+
`WorkflowBlueprint` is intentionally ignored for now.
|
|
250
|
+
|
|
251
|
+
When reintroduced, it should likely include:
|
|
252
|
+
|
|
253
|
+
- `key`
|
|
254
|
+
- `displayName`
|
|
255
|
+
- `description`
|
|
256
|
+
- `tags`
|
|
257
|
+
- `definitionYaml`
|
|
258
|
+
- `source`
|
|
259
|
+
- `sourceVersion`
|
|
260
|
+
|
|
261
|
+
## Relation Summary
|
|
262
|
+
|
|
263
|
+
- `workflowDefinition` has many `workflowExecution`
|
|
264
|
+
- `workflowDefinition` has many `workflowTriggerExecution`
|
|
265
|
+
- `moduleMetadata` has many `workflowDefinition`
|
|
266
|
+
- `workflowExecution` has many `workflowStepExecution`
|
|
267
|
+
- `workflowExecution` has many `workflowExecutionLog`
|
|
268
|
+
- `workflowExecution` has many `workflowExecutionArtifact`
|
|
269
|
+
- `workflowTriggerExecution` may link to one created `workflowExecution`
|
|
270
|
+
- `workflowStepExecution` may have many child `workflowStepExecution` records via `parentStepExecution`
|
|
271
|
+
- `workflowStepExecution` has many `workflowExecutionLog`
|
|
272
|
+
- `workflowStepExecution` has many `workflowExecutionArtifact`
|
|
273
|
+
|
|
274
|
+
## MCP Modeling Readiness Checklist
|
|
275
|
+
|
|
276
|
+
Before calling the SolidX model MCP tools, confirm:
|
|
277
|
+
|
|
278
|
+
- Use `workflow-builder` as the module key.
|
|
279
|
+
- Use the six active models above.
|
|
280
|
+
- Use `longText` for `definitionYaml` and `definitionSnapshot`; parse them as YAML in the workflow services to keep the workflow engine DB agnostic.
|
|
281
|
+
- Use `selectionStatic` for status/type enum fields.
|
|
282
|
+
- Use `relation` fields for cross-model links.
|
|
283
|
+
- Add a many-to-one relation from `workflowDefinition` to SolidX `moduleMetadata`.
|
|
284
|
+
- Keep `WorkflowBlueprint` deferred.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidxai/core",
|
|
3
|
-
"version": "0.1.13-beta.
|
|
3
|
+
"version": "0.1.13-beta.7",
|
|
4
4
|
"description": "This module is a NestJS module containing all the required core providers required by a Solid application",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -7850,6 +7850,8 @@
|
|
|
7850
7850
|
"FieldMetadataController.getSelectionDynamicValues",
|
|
7851
7851
|
"FieldMetadataController.getSelectionDynamicValue",
|
|
7852
7852
|
"FieldMetadataController.findFieldDefaultMetaData",
|
|
7853
|
+
"MediaController.create",
|
|
7854
|
+
"MediaController.upload",
|
|
7853
7855
|
"MediaController.findMany",
|
|
7854
7856
|
"MediaController.findOne",
|
|
7855
7857
|
"MediaController.download",
|
|
@@ -8090,6 +8092,19 @@
|
|
|
8090
8092
|
"moduleUserKey": "solid-core",
|
|
8091
8093
|
"modelUserKey": "media"
|
|
8092
8094
|
},
|
|
8095
|
+
{
|
|
8096
|
+
"displayName": "Media Upload Action",
|
|
8097
|
+
"name": "media-upload-action",
|
|
8098
|
+
"type": "custom",
|
|
8099
|
+
"domain": "",
|
|
8100
|
+
"context": "",
|
|
8101
|
+
"customComponent": "/admin/core/solid-core/media/upload",
|
|
8102
|
+
"customIsModal": false,
|
|
8103
|
+
"serverEndpoint": "",
|
|
8104
|
+
"viewUserKey": "media-list-view",
|
|
8105
|
+
"moduleUserKey": "solid-core",
|
|
8106
|
+
"modelUserKey": "media"
|
|
8107
|
+
},
|
|
8093
8108
|
{
|
|
8094
8109
|
"displayName": "Solid Media Storage Provider Model List Action",
|
|
8095
8110
|
"name": "mediaStorageProviderMetadata-list-action",
|
|
@@ -11565,7 +11580,8 @@
|
|
|
11565
11580
|
50
|
|
11566
11581
|
],
|
|
11567
11582
|
"enableGlobalSearch": true,
|
|
11568
|
-
"create":
|
|
11583
|
+
"create": true,
|
|
11584
|
+
"createAction": "media-upload-action",
|
|
11569
11585
|
"edit": false,
|
|
11570
11586
|
"delete": true,
|
|
11571
11587
|
"allowedViews": [
|
|
@@ -11603,6 +11619,15 @@
|
|
|
11603
11619
|
"sortable": false
|
|
11604
11620
|
}
|
|
11605
11621
|
},
|
|
11622
|
+
{
|
|
11623
|
+
"type": "field",
|
|
11624
|
+
"attrs": {
|
|
11625
|
+
"name": "relativeUri",
|
|
11626
|
+
"viewWidget": "MediaRelativeUriListWidget",
|
|
11627
|
+
"isSearchable": true,
|
|
11628
|
+
"sortable": false
|
|
11629
|
+
}
|
|
11630
|
+
},
|
|
11606
11631
|
{
|
|
11607
11632
|
"type": "field",
|
|
11608
11633
|
"attrs": {
|
|
@@ -11759,7 +11784,8 @@
|
|
|
11759
11784
|
{
|
|
11760
11785
|
"type": "field",
|
|
11761
11786
|
"attrs": {
|
|
11762
|
-
"name": "relativeUri"
|
|
11787
|
+
"name": "relativeUri",
|
|
11788
|
+
"viewWidget": "MediaRelativeUriFormViewWidget"
|
|
11763
11789
|
}
|
|
11764
11790
|
},
|
|
11765
11791
|
{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { forwardRef, Inject, Injectable, Logger, NotFoundException } from '@nestjs/common';
|
|
1
|
+
import { BadRequestException, forwardRef, Inject, Injectable, Logger, NotFoundException } from '@nestjs/common';
|
|
2
2
|
import { ModuleRef } from "@nestjs/core";
|
|
3
3
|
import { InjectEntityManager } from '@nestjs/typeorm';
|
|
4
4
|
import { EntityManager, In } from 'typeorm';
|
|
@@ -16,11 +16,12 @@ import { BasicFilterDto } from 'src/dtos/basic-filters.dto';
|
|
|
16
16
|
import { MediaStorageProviderType } from 'src/dtos/create-media-storage-provider-metadata.dto';
|
|
17
17
|
import { Media } from 'src/entities/media.entity';
|
|
18
18
|
import { MediaStorageProviderMetadata } from 'src/entities/media-storage-provider-metadata.entity';
|
|
19
|
+
import { MediaFieldCrudManager, SolidMediaType } from 'src/helpers/field-crud-managers/MediaFieldCrudManager';
|
|
19
20
|
import { FieldMetadataRepository } from 'src/repository/field-metadata.repository';
|
|
20
21
|
import { MediaStorageProviderMetadataRepository } from 'src/repository/media-storage-provider-metadata.repository';
|
|
21
22
|
import { MediaRepository } from 'src/repository/media.repository';
|
|
22
23
|
import { ModelMetadataRepository } from 'src/repository/model-metadata.repository';
|
|
23
|
-
import { buildDiskMediaPath,
|
|
24
|
+
import { buildDiskMediaPath, getEffectiveS3Region, resolveMediaIsPublic, } from 'src/services/media-storage.utils';
|
|
24
25
|
import { getMediaStorageProvider } from "./mediaStorageProviders";
|
|
25
26
|
|
|
26
27
|
@Injectable()
|
|
@@ -103,40 +104,25 @@ export class MediaService extends CRUDService<Media> {
|
|
|
103
104
|
throw new NotFoundException('Media storage provider metadata not found');
|
|
104
105
|
}
|
|
105
106
|
|
|
106
|
-
|
|
107
|
-
for (let i = 0; i < files.length; i++) {
|
|
108
|
-
const file = files[i];
|
|
109
|
-
const storageProvider = createDto.mediaStorageProviderMetadata as MediaStorageProviderMetadata;
|
|
110
|
-
const fileName = buildStoredMediaFileName(file);
|
|
107
|
+
createDto['fieldMetadata'].mediaStorageProvider = createDto['mediaStorageProviderMetadata'];
|
|
111
108
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
await this.s3FileService.write(`${bucketName}:${fileName}`, fileData, { contentType: file.mimetype, region });
|
|
109
|
+
const validator = new MediaFieldCrudManager({
|
|
110
|
+
type: createDto['fieldMetadata']?.type as SolidMediaType,
|
|
111
|
+
required: true,
|
|
112
|
+
fieldName: 'files',
|
|
113
|
+
mediaMaxSizeKb: createDto['fieldMetadata']?.mediaMaxSizeKb,
|
|
114
|
+
mediaTypes: createDto['fieldMetadata']?.mediaTypes || [],
|
|
115
|
+
isUpdate: false,
|
|
116
|
+
});
|
|
117
|
+
const validationErrors = validator.validate(createDto, files);
|
|
118
|
+
if (validationErrors.length > 0) {
|
|
119
|
+
throw new BadRequestException(validationErrors.map(error => error.error).join(', '));
|
|
120
|
+
}
|
|
125
121
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
default:
|
|
129
|
-
break;
|
|
130
|
-
}
|
|
131
|
-
// Delete temp file from disk
|
|
132
|
-
await this.diskFileService.delete(file.path);
|
|
122
|
+
const storageProviderType = createDto['mediaStorageProviderMetadata'].type as MediaStorageProviderType;
|
|
123
|
+
const storageProvider = await getMediaStorageProvider(this.moduleRef, storageProviderType);
|
|
133
124
|
|
|
134
|
-
|
|
135
|
-
const media = this.repo.create(createDto as Partial<Media>) as Media;
|
|
136
|
-
const savedMedia = await this.repo.save(media);
|
|
137
|
-
savedMedias.push(savedMedia)
|
|
138
|
-
}
|
|
139
|
-
return savedMedias
|
|
125
|
+
return storageProvider.store(files, { id: Number(createDto['entityId']) }, createDto['fieldMetadata']);
|
|
140
126
|
}
|
|
141
127
|
|
|
142
128
|
async remove(id: number) {
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"permissions": {
|
|
3
|
-
"allow": [
|
|
4
|
-
"Bash(node -e:*)",
|
|
5
|
-
"WebFetch(domain:docs.solidxai.com)",
|
|
6
|
-
"WebFetch(domain:github.com)",
|
|
7
|
-
"Read(//Users/oswald/projects/Solid_Starters/solidctl/**)",
|
|
8
|
-
"Read(//Users/oswald/projects/Solid_Starters/**)",
|
|
9
|
-
"Bash(find /Users/oswald/projects/Solid_Starters/solid-core-module -type d -name migration* -o -name *database*)",
|
|
10
|
-
"Bash(node verify-imports.js)"
|
|
11
|
-
],
|
|
12
|
-
"additionalDirectories": [
|
|
13
|
-
"/Users/oswald/projects/Solid_Starters/solidctl"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
package/CLAUDE.md
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# This is the SolidX API project.
|
|
2
|
-
This is included as a dependency in consuming projects.
|
|
3
|
-
|
|
4
|
-
# SolidX UI
|
|
5
|
-
# The corresponding UI project is at the below path:
|
|
6
|
-
/Users/oswald/projects/Solid_Starters/solid-core-ui
|
|
7
|
-
|
|
8
|
-
# SolidX Docs
|
|
9
|
-
# The documentation project is at the below path:
|
|
10
|
-
/Users/oswald/projects/solidxai-docs
|
|
11
|
-
|
|
12
|
-
# SolidX Agent
|
|
13
|
-
# The agent project which has the skills for helping users configure, build and use SolidX is at the below path:
|
|
14
|
-
/Users/oswald/projects/Solid_Starters/agent
|
|
15
|
-
|
|
16
|
-
# SolidX Control Plane Commands
|
|
17
|
-
# The control plane commands for managing SolidX instances are in the below path:
|
|
18
|
-
/Users/oswald/projects/Solid_Starters/solidctl
|
|
19
|
-
|
|
20
|
-
# Testing reference project
|
|
21
|
-
# This is the reference library management project that is used for testing and development of SolidX features. It is located at the below path:
|
|
22
|
-
/Users/oswald/projects/Solid_Starters/solid-library-management
|
|
23
|
-
|
|
24
|
-
# Code Builder project
|
|
25
|
-
# This is the project that contains the code builder which generates code based on user input and templates. It is located at the below path:
|
|
26
|
-
/Users/oswald/projects/Solid_Starters/solid-code-builder
|
package/src/services/1.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
1. Do i need to create a storeStreams method for aws service too?
|
|
2
|
-
- Handle later
|
|
3
|
-
2. queues handling -> if queues is enabled by default, i.e triggerExport(exportTransactionEntity.id).
|
|
4
|
-
- startExport should either return the data or return the transaction id
|
|
5
|
-
3. How to handle scenarios wherein, nested related exist.(do i need to only get the userkey)
|
|
6
|
-
- show the userKey
|