@tailor-platform/sdk 1.12.0 → 1.13.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/CHANGELOG.md +11 -0
- package/dist/cli/index.mjs +1 -1
- package/dist/cli/lib.mjs +1 -1
- package/dist/{update-B_W-UQnS.mjs → update-CUvANRhs.mjs} +37 -25
- package/dist/update-CUvANRhs.mjs.map +1 -0
- package/docs/generator/builtin.md +24 -19
- package/package.json +1 -1
- package/dist/update-B_W-UQnS.mjs.map +0 -1
|
@@ -148,16 +148,17 @@ Generates seed data configuration files for database initialization.
|
|
|
148
148
|
### Configuration
|
|
149
149
|
|
|
150
150
|
```typescript
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
151
|
+
// Basic configuration
|
|
152
|
+
["@tailor-platform/seed", { distPath: "./seed" }];
|
|
153
|
+
|
|
154
|
+
// With default machine user
|
|
155
|
+
["@tailor-platform/seed", { distPath: "./seed", machineUserName: "admin" }];
|
|
155
156
|
```
|
|
156
157
|
|
|
157
|
-
| Option | Type | Description
|
|
158
|
-
| ----------------- | -------- |
|
|
159
|
-
| `distPath` | `string` | Output directory path (required)
|
|
160
|
-
| `machineUserName` | `string` |
|
|
158
|
+
| Option | Type | Description |
|
|
159
|
+
| ----------------- | -------- | -------------------------------------------------------- |
|
|
160
|
+
| `distPath` | `string` | Output directory path (required) |
|
|
161
|
+
| `machineUserName` | `string` | Default machine user name (can be overridden at runtime) |
|
|
161
162
|
|
|
162
163
|
### Output
|
|
163
164
|
|
|
@@ -165,27 +166,31 @@ Generates a seed directory structure:
|
|
|
165
166
|
|
|
166
167
|
```
|
|
167
168
|
seed/
|
|
168
|
-
├── config.yaml # Entity dependencies configuration
|
|
169
169
|
├── data/
|
|
170
170
|
│ ├── User.jsonl # Seed data files (JSONL format)
|
|
171
|
+
│ ├── User.schema.ts # lines-db schema definitions
|
|
171
172
|
│ └── Product.jsonl
|
|
172
|
-
|
|
173
|
-
│ ├── User.graphql # GraphQL mutation files
|
|
174
|
-
│ └── Product.graphql
|
|
175
|
-
├── mapping/
|
|
176
|
-
│ ├── User.yaml # GraphQL Ingest mapping files
|
|
177
|
-
│ └── Product.yaml
|
|
178
|
-
├── schema.ts # lines-db schema definitions
|
|
179
|
-
└── exec.mjs # Executable script (if machineUserName provided)
|
|
173
|
+
└── exec.mjs # Executable script
|
|
180
174
|
```
|
|
181
175
|
|
|
182
176
|
### Usage
|
|
183
177
|
|
|
184
|
-
|
|
178
|
+
Run the generated executable script:
|
|
185
179
|
|
|
186
180
|
```bash
|
|
187
|
-
#
|
|
181
|
+
# With machine user from config
|
|
188
182
|
node seed/exec.mjs
|
|
183
|
+
|
|
184
|
+
# Specify machine user at runtime (required if not configured, or to override)
|
|
185
|
+
node seed/exec.mjs --machine-user admin
|
|
186
|
+
|
|
187
|
+
# Short form
|
|
188
|
+
node seed/exec.mjs -m admin
|
|
189
|
+
|
|
190
|
+
# With other options
|
|
191
|
+
node seed/exec.mjs -m admin --truncate --yes
|
|
189
192
|
```
|
|
190
193
|
|
|
194
|
+
The `--machine-user` option is required at runtime if `machineUserName` is not configured in the generator options.
|
|
195
|
+
|
|
191
196
|
The generated files are compatible with gql-ingest for bulk data import.
|