@hiliosai/sdk 0.1.6 → 0.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hiliosai/sdk",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/index.ts"
package/src/index.ts CHANGED
@@ -4,3 +4,5 @@ export * from './service/define-integration';
4
4
  export * from './types';
5
5
  export * from './configs';
6
6
  export * from './env';
7
+ export * from './datasources';
8
+ export * from './mixins';
@@ -1,23 +1,11 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
  import type {ServiceSchema} from 'moleculer';
3
- import type {BaseDatasource} from '../datasources';
3
+ import type {
4
+ DatasourceConstructorRegistry,
5
+ DatasourceInstanceRegistry,
6
+ } from '../middlewares/datasource.middleware';
4
7
  import type {AppContext} from '../types/context';
5
8
 
6
- /**
7
- * Datasource constructor registry type
8
- * All datasources should implement BaseDatasource interface
9
- */
10
- export interface DatasourceConstructorRegistry {
11
- [key: string]: new () => BaseDatasource | object;
12
- }
13
-
14
- /**
15
- * Datasource instance registry type
16
- */
17
- export interface DatasourceInstanceRegistry {
18
- [key: string]: object;
19
- }
20
-
21
9
  /**
22
10
  * Creates a Moleculer mixin for datasource injection
23
11
  * Simple mixin that just instantiates datasources and injects them into context
@@ -121,10 +109,3 @@ export function DatasourceMixin(
121
109
  },
122
110
  };
123
111
  }
124
-
125
- /**
126
- * Type helper for services that use the datasource mixin
127
- */
128
- export type ServiceWithDatasources<T extends DatasourceInstanceRegistry> = {
129
- datasources: T;
130
- };