@fjell/lib-sequelize 4.4.84 → 4.4.85
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/LICENSE +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +2 -2
- package/guide/index.md +30 -0
- package/guide/integration.md +32 -0
- package/guide/usage.md +43 -0
- package/package.json +10 -9
package/guide/index.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# @fjell/lib-sequelize - Agentic Guide
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Sequelize-backed Fjell library implementation for relational database persistence.
|
|
6
|
+
|
|
7
|
+
This guide is optimized for AI-assisted code generation and integration workflows.
|
|
8
|
+
|
|
9
|
+
## Documentation
|
|
10
|
+
|
|
11
|
+
- **[Usage Guide](./usage.md)** - API-oriented usage patterns and model-safe examples
|
|
12
|
+
- **[Integration Guide](./integration.md)** - Architecture placement, composition rules, and implementation guidance
|
|
13
|
+
|
|
14
|
+
## Key Capabilities
|
|
15
|
+
|
|
16
|
+
- Implements primary and contained operations on Sequelize models
|
|
17
|
+
- Provides definition and coordinate helpers for relational mappings
|
|
18
|
+
- Includes reference builder and Sequelize instance wrapper utilities
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install @fjell/lib-sequelize
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Public API Highlights
|
|
27
|
+
|
|
28
|
+
- `SequelizeLibrary` and `SequelizeLibraryFactory`
|
|
29
|
+
- `createCoordinate`, `SCOPE_SEQUELIZE`, and definition/options exports
|
|
30
|
+
- `ReferenceBuilder` and `SequelizeInstanceWrapper` utilities
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Integration Guide
|
|
2
|
+
|
|
3
|
+
Guide for integrating `@fjell/lib-sequelize` into larger Fjell-based systems.
|
|
4
|
+
|
|
5
|
+
## Where It Fits
|
|
6
|
+
|
|
7
|
+
Sequelize-backed Fjell library implementation for relational database persistence.
|
|
8
|
+
|
|
9
|
+
## Recommended Integration Pattern
|
|
10
|
+
|
|
11
|
+
- Coordinate Sequelize model definitions with Fjell key conventions before first deployment
|
|
12
|
+
- Use transaction boundaries around multi-step provider operations
|
|
13
|
+
- Tune eager/lazy loading and indexing for predictable query performance
|
|
14
|
+
|
|
15
|
+
## System Composition Checklist
|
|
16
|
+
|
|
17
|
+
- Define package boundaries: schema/types, transport, operations, adapters, and UI.
|
|
18
|
+
- Keep contracts stable by sharing @fjell/types interfaces where applicable.
|
|
19
|
+
- Centralize retries/timeouts/logging around infrastructure-facing operations.
|
|
20
|
+
- Validate inputs at API boundaries before invoking persistence or provider layers.
|
|
21
|
+
- Add contract and integration tests for every generated workflow.
|
|
22
|
+
|
|
23
|
+
## Cross-Library Pairings
|
|
24
|
+
|
|
25
|
+
- Pair with @fjell/types for shared contracts.
|
|
26
|
+
- Pair with @fjell/validation for input and schema checks.
|
|
27
|
+
- Pair with @fjell/logging for observability in integration flows.
|
|
28
|
+
- Pair with storage/router/provider packages based on your runtime architecture.
|
|
29
|
+
|
|
30
|
+
## Integration Example Shape
|
|
31
|
+
|
|
32
|
+
Use this package behind an application service layer that exposes stable domain methods. Generated code should call those service methods, not raw infrastructure primitives, unless your architecture intentionally keeps infrastructure at the edge.
|
package/guide/usage.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Usage Guide
|
|
2
|
+
|
|
3
|
+
Comprehensive usage guidance for `@fjell/lib-sequelize`.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @fjell/lib-sequelize
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## API Highlights
|
|
12
|
+
|
|
13
|
+
- `SequelizeLibrary` and `SequelizeLibraryFactory`
|
|
14
|
+
- `createCoordinate`, `SCOPE_SEQUELIZE`, and definition/options exports
|
|
15
|
+
- `ReferenceBuilder` and `SequelizeInstanceWrapper` utilities
|
|
16
|
+
|
|
17
|
+
## Quick Example
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { SequelizeLibraryFactory } from "@fjell/lib-sequelize";
|
|
21
|
+
|
|
22
|
+
const factory = new SequelizeLibraryFactory({
|
|
23
|
+
sequelize,
|
|
24
|
+
tablePrefix: "fjell",
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const library = factory.createPrimaryLibrary();
|
|
28
|
+
await library.save({ pri: { pk: "widget#1", sk: "meta" }, name: "Widget One" });
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Model Consumption Rules
|
|
32
|
+
|
|
33
|
+
1. Import from the package root (`@fjell/lib-sequelize`) instead of deep-internal paths unless explicitly documented.
|
|
34
|
+
2. Keep usage aligned with exported public symbols listed in this guide.
|
|
35
|
+
3. Prefer explicit typing at package boundaries so generated code remains robust during upgrades.
|
|
36
|
+
4. Keep error handling deterministic and map infrastructure failures into domain-level errors.
|
|
37
|
+
5. Co-locate integration wrappers in your app so model-generated code has one canonical entry point.
|
|
38
|
+
|
|
39
|
+
## Best Practices
|
|
40
|
+
|
|
41
|
+
- Keep examples and abstractions consistent with existing Fjell package conventions.
|
|
42
|
+
- Favor composable wrappers over one-off inline integration logic.
|
|
43
|
+
- Add targeted tests around generated integration code paths.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fjell/lib-sequelize",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.85",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"library",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
"files": [
|
|
28
|
-
"dist"
|
|
28
|
+
"dist",
|
|
29
|
+
"guide"
|
|
29
30
|
],
|
|
30
31
|
"scripts": {
|
|
31
32
|
"build": "npm run lint && node build.js",
|
|
@@ -41,12 +42,12 @@
|
|
|
41
42
|
"docs:test": "cd docs && npm run test"
|
|
42
43
|
},
|
|
43
44
|
"dependencies": {
|
|
44
|
-
"@fjell/core": "^4.4.
|
|
45
|
-
"@fjell/lib": "^4.4.
|
|
46
|
-
"@fjell/logging": "^4.4.
|
|
47
|
-
"@fjell/registry": "^4.4.
|
|
48
|
-
"@fjell/types": "^4.4.
|
|
49
|
-
"@fjell/validation": "^4.4.
|
|
45
|
+
"@fjell/core": "^4.4.79",
|
|
46
|
+
"@fjell/lib": "^4.4.89",
|
|
47
|
+
"@fjell/logging": "^4.4.72",
|
|
48
|
+
"@fjell/registry": "^4.4.86",
|
|
49
|
+
"@fjell/types": "^4.4.9",
|
|
50
|
+
"@fjell/validation": "^4.4.6",
|
|
50
51
|
"dayjs": "^1.11.13",
|
|
51
52
|
"deepmerge": "^4.3.1",
|
|
52
53
|
"sequelize": "^6.37.7",
|
|
@@ -55,7 +56,7 @@
|
|
|
55
56
|
"devDependencies": {
|
|
56
57
|
"@eslint/eslintrc": "^3.3.1",
|
|
57
58
|
"@eslint/js": "^9.32.0",
|
|
58
|
-
"@fjell/common-config": "^1.1.
|
|
59
|
+
"@fjell/common-config": "^1.1.38",
|
|
59
60
|
"@swc/core": "^1.13.2",
|
|
60
61
|
"@tsconfig/recommended": "^1.0.10",
|
|
61
62
|
"@types/node": "^24.1.0",
|