@travetto/model 2.2.0 → 2.2.1

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.
@@ -1,14 +1,18 @@
1
- import { BasePlugin } from '@travetto/cli/src/plugin-base';
1
+ import { BasePlugin, OptionConfig } from '@travetto/cli/src/plugin-base';
2
2
  import { color } from '@travetto/cli/src/color';
3
3
  import { EnvInit } from '@travetto/base/bin/init';
4
4
  import type { ModelStorageSupport } from '@travetto/model/src/service/storage';
5
5
 
6
6
  import { ModelCandidateUtil } from './candidate';
7
7
 
8
+ type Options = {
9
+ env: OptionConfig<string>;
10
+ };
11
+
8
12
  /**
9
13
  * CLI Entry point for exporting model schemas
10
14
  */
11
- export abstract class BaseModelPlugin extends BasePlugin {
15
+ export abstract class BaseModelPlugin extends BasePlugin<Options> {
12
16
 
13
17
  restoreEnv?: (err: Error) => unknown;
14
18
 
@@ -32,8 +36,7 @@ export abstract class BaseModelPlugin extends BasePlugin {
32
36
  return '[provider] [models...]';
33
37
  }
34
38
 
35
- // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
36
- getOptions() {
39
+ getOptions(): Options {
37
40
  return { env: this.option({ desc: 'Application environment' }) };
38
41
  }
39
42
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@travetto/model",
3
3
  "displayName": "Data Modeling Support",
4
- "version": "2.2.0",
4
+ "version": "2.2.1",
5
5
  "description": "Datastore abstraction for core operations.",
6
6
  "keywords": [
7
7
  "datastore",
@@ -28,13 +28,13 @@
28
28
  "directory": "module/model"
29
29
  },
30
30
  "dependencies": {
31
- "@travetto/di": "^2.2.0",
32
- "@travetto/config": "^2.2.0",
33
- "@travetto/registry": "^2.2.0",
34
- "@travetto/schema": "^2.2.0"
31
+ "@travetto/di": "^2.2.1",
32
+ "@travetto/config": "^2.2.1",
33
+ "@travetto/registry": "^2.2.1",
34
+ "@travetto/schema": "^2.2.1"
35
35
  },
36
36
  "optionalPeerDependencies": {
37
- "@travetto/cli": "^2.2.0"
37
+ "@travetto/cli": "^2.2.1"
38
38
  },
39
39
  "publishConfig": {
40
40
  "access": "public"
@@ -159,8 +159,7 @@ export abstract class ModelPolymorphismSuite extends BaseModelSuite<ModelCrudSup
159
159
  );
160
160
 
161
161
  await assert.rejects(
162
- // @ts-expect-error
163
- () => service.update(Engineer, Doctor.from({ ...doc })),
162
+ () => service.update(Engineer, Doctor.from({ ...doc }) as unknown as Engineer),
164
163
  (e: Error) => (e instanceof NotFoundError || e instanceof SubTypeNotSupportedError || e instanceof TypeMismatchError) ? undefined : e);
165
164
 
166
165
  try {