@travetto/model 8.0.0-alpha.15 → 8.0.0-alpha.18
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/README.md +15 -3
- package/package.json +7 -7
- package/src/types/basic.ts +1 -1
- package/src/types/bulk.ts +1 -1
- package/src/types/crud.ts +1 -1
- package/src/types/expiry.ts +1 -1
- package/src/types/storage.ts +1 -1
- package/support/cli.model_export.ts +4 -1
- package/support/cli.model_install.ts +4 -1
package/README.md
CHANGED
|
@@ -76,7 +76,7 @@ export interface ModelBasicSupport<C = unknown> {
|
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
### CRUD
|
|
79
|
-
The [CRUD](https://github.com/travetto/travetto/tree/main/module/model/src/types/crud.ts#L11) contract, builds upon the basic contract, and is built around the idea of simple data retrieval and storage, to create a foundation for other services that need only basic support. The model extension in [Authentication](https://github.com/travetto/travetto/tree/main/module/auth#readme "Authentication
|
|
79
|
+
The [CRUD](https://github.com/travetto/travetto/tree/main/module/model/src/types/crud.ts#L11) contract, builds upon the basic contract, and is built around the idea of simple data retrieval and storage, to create a foundation for other services that need only basic support. The model extension in [Authentication](https://github.com/travetto/travetto/tree/main/module/auth#readme "Authentication support for the Travetto framework"), is an example of a module that only needs create, read and delete, and so any implementation of [Data Modeling Support](https://github.com/travetto/travetto/tree/main/module/model#readme "Datastore abstraction for core operations.") that honors this contract, can be used with the [Authentication](https://github.com/travetto/travetto/tree/main/module/auth#readme "Authentication support for the Travetto framework") model extension.
|
|
80
80
|
|
|
81
81
|
**Code: Crud Contract**
|
|
82
82
|
```typescript
|
|
@@ -312,12 +312,18 @@ export abstract class BaseModelSuite<T> {
|
|
|
312
312
|
## CLI - model:export
|
|
313
313
|
The module provides the ability to generate an export of the model structure from all the various [@Model](https://github.com/travetto/travetto/tree/main/module/model/src/registry/decorator.ts#L14)s within the application. This is useful for being able to generate the appropriate files to manually create the data schemas in production.
|
|
314
314
|
|
|
315
|
-
**Terminal:
|
|
315
|
+
**Terminal: Help for model:export**
|
|
316
316
|
```bash
|
|
317
317
|
$ trv model:export --help
|
|
318
318
|
|
|
319
319
|
Usage: model:export [options] <provider:string> <models...:string>
|
|
320
320
|
|
|
321
|
+
Export model definitions for a selected provider and model set.
|
|
322
|
+
|
|
323
|
+
The command resolves candidate models and delegates to provider-specific
|
|
324
|
+
export logic to produce schema/install artifacts.
|
|
325
|
+
Example Usage:
|
|
326
|
+
|
|
321
327
|
Options:
|
|
322
328
|
-p, --profile <string> Application profiles
|
|
323
329
|
-m, --module <module> Module to run for
|
|
@@ -335,12 +341,18 @@ Models
|
|
|
335
341
|
## CLI - model:install
|
|
336
342
|
The module provides the ability to install all the various [@Model](https://github.com/travetto/travetto/tree/main/module/model/src/registry/decorator.ts#L14)s within the application given the current configuration being targeted. This is useful for being able to prepare the datastore manually.
|
|
337
343
|
|
|
338
|
-
**Terminal:
|
|
344
|
+
**Terminal: Help for model:install**
|
|
339
345
|
```bash
|
|
340
346
|
$ trv model:install --help
|
|
341
347
|
|
|
342
348
|
Usage: model:install [options] <provider:string> <models...:string>
|
|
343
349
|
|
|
350
|
+
Install or update model definitions for a selected provider.
|
|
351
|
+
|
|
352
|
+
The command resolves candidate models and applies provider install/upsert
|
|
353
|
+
operations so backing stores are prepared for runtime usage.
|
|
354
|
+
Example Usage:
|
|
355
|
+
|
|
344
356
|
Options:
|
|
345
357
|
-p, --profile <string> Application profiles
|
|
346
358
|
-m, --module <module> Module to run for
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/model",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Datastore abstraction for core operations.",
|
|
6
6
|
"keywords": [
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
"directory": "module/model"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@travetto/config": "^8.0.0-alpha.
|
|
31
|
-
"@travetto/di": "^8.0.0-alpha.
|
|
32
|
-
"@travetto/registry": "^8.0.0-alpha.
|
|
33
|
-
"@travetto/schema": "^8.0.0-alpha.
|
|
30
|
+
"@travetto/config": "^8.0.0-alpha.18",
|
|
31
|
+
"@travetto/di": "^8.0.0-alpha.17",
|
|
32
|
+
"@travetto/registry": "^8.0.0-alpha.17",
|
|
33
|
+
"@travetto/schema": "^8.0.0-alpha.18"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@travetto/cli": "^8.0.0-alpha.
|
|
37
|
-
"@travetto/test": "^8.0.0-alpha.
|
|
36
|
+
"@travetto/cli": "^8.0.0-alpha.23",
|
|
37
|
+
"@travetto/test": "^8.0.0-alpha.17"
|
|
38
38
|
},
|
|
39
39
|
"peerDependenciesMeta": {
|
|
40
40
|
"@travetto/cli": {
|
package/src/types/basic.ts
CHANGED
package/src/types/bulk.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { type Class, RuntimeError } from '@travetto/runtime';
|
|
|
2
2
|
import type { ValidationError, ValidationResultError } from '@travetto/schema';
|
|
3
3
|
|
|
4
4
|
import type { ModelCrudSupport } from './crud.ts';
|
|
5
|
-
import type { ModelType, OptionalId } from '
|
|
5
|
+
import type { ModelType, OptionalId } from './model.ts';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Bulk operation. Each operation has a single action and payload
|
package/src/types/crud.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Class } from '@travetto/runtime';
|
|
2
2
|
|
|
3
|
-
import type { ModelListOptions, ModelType, OptionalId } from '
|
|
3
|
+
import type { ModelListOptions, ModelType, OptionalId } from './model.ts';
|
|
4
4
|
|
|
5
5
|
import type { ModelBasicSupport } from './basic.ts';
|
|
6
6
|
|
package/src/types/expiry.ts
CHANGED
package/src/types/storage.ts
CHANGED
|
@@ -6,7 +6,10 @@ import { ModelExportUtil } from './bin/export.ts';
|
|
|
6
6
|
import { ModelCandidateUtil } from './bin/candidate.ts';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Export model definitions for a selected provider and model set.
|
|
10
|
+
*
|
|
11
|
+
* The command resolves candidate models and delegates to provider-specific
|
|
12
|
+
* export logic to produce schema/install artifacts.
|
|
10
13
|
*/
|
|
11
14
|
@CliCommand()
|
|
12
15
|
export class ModelExportCommand extends BaseModelCommand {
|
|
@@ -6,7 +6,10 @@ import { ModelInstallUtil } from './bin/install.ts';
|
|
|
6
6
|
import { ModelCandidateUtil } from './bin/candidate.ts';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Install or update model definitions for a selected provider.
|
|
10
|
+
*
|
|
11
|
+
* The command resolves candidate models and applies provider install/upsert
|
|
12
|
+
* operations so backing stores are prepared for runtime usage.
|
|
10
13
|
*/
|
|
11
14
|
@CliCommand()
|
|
12
15
|
export class ModelInstallCommand extends BaseModelCommand {
|