Skip to content

Commit 0781d51

Browse files
authored
Merge pull request #97 from vodyani/beta
Beta
2 parents 6d21991 + ef10b1f commit 0781d51

9 files changed

Lines changed: 63 additions & 20 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## [8.6.6-beta.1](https://github.com/vodyani/core/compare/v8.6.5...v8.6.6-beta.1) (2022-09-02)
2+
3+
4+
### Bug Fixes
5+
6+
* centralize common top-level interfaces ([0b20742](https://github.com/vodyani/core/commit/0b207424e320aa7093ef2ee7afad8c6b92d4c530))
7+
18
## [8.6.5](https://github.com/vodyani/core/compare/v8.6.4...v8.6.5) (2022-09-01)
29

310

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@vodyani/core",
33
"license": "MIT",
4-
"version": "8.6.5",
4+
"version": "8.6.6-beta.1",
55
"author": "ChoGathK",
66
"description": "👩🏻‍🚀 core is the top-level design package for vodyani scaffolding, providing a single responsibility module registrar for the different tiers.",
77
"homepage": "https://github.com/vodyani/core#readme",

src/common/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export * from './declare';
21
export * from './interface';
2+
export * from './declare';
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { FactoryProvider } from '../declare';
2+
3+
/**
4+
* Asynchronous provider factory for creating
5+
*
6+
* @see: [factory provider objects](https://docs.nestjs.com/fundamentals/custom-providers#factory-providers-usefactory)
7+
*/
8+
export interface AsyncProviderFactory {
9+
/**
10+
* Create a factory provider by specifying the creation parameters externally.
11+
*
12+
* @returns FactoryProvider
13+
*
14+
* @publicApi
15+
*/
16+
create: (...args: any[]) => FactoryProvider;
17+
}

src/common/interface/client.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
export interface Client<T = any> {
2+
getInstance: () => T;
3+
close: (...args: any[]) => void;
4+
}
5+
6+
export interface AsyncClient<T = any> {
7+
getInstance: () => T;
8+
close: (...args: any[]) => Promise<void>;
9+
}
10+
11+
export interface ClientAdapter<T = any, O = any> {
12+
getClient: (key: string) => Client<T>;
13+
create: (options: O) => Client<T>;
14+
}
15+
16+
export interface AsyncClientAdapter<T = any, O = any> {
17+
getClient: (key: string) => AsyncClient<T>;
18+
create: (options: O) => Promise<AsyncClient<T>>;
19+
}

src/common/interface/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export * from './async-provider';
2+
export * from './client';
3+
export * from './module';
4+
export * from './remote-config';
Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FactoryProvider, ModuleMetadata } from './declare';
1+
import { ModuleMetadata } from '../declare';
22

33
/**
44
* Infrastructure module registration options.
@@ -88,18 +88,3 @@ export interface ContainerRegisterOptions {
8888
*/
8989
aop?: ModuleMetadata['providers'];
9090
}
91-
/**
92-
* Asynchronous provider factory for creating
93-
*
94-
* @see: [factory provider objects](https://docs.nestjs.com/fundamentals/custom-providers#factory-providers-usefactory)
95-
*/
96-
export interface AsyncProviderFactory {
97-
/**
98-
* Create a factory provider by specifying the creation parameters externally.
99-
*
100-
* @returns FactoryProvider
101-
*
102-
* @publicApi
103-
*/
104-
create: (...args: any[]) => FactoryProvider;
105-
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export interface RemoteConfigClient {
2+
init: (...args: any[]) => Promise<any>;
3+
close: (...args: any[]) => Promise<void>;
4+
sync: (...args: any[]) => Promise<any>;
5+
subscribe?: (key: string, callback: (value: any) => any) => Promise<void>;
6+
}
7+
8+
export interface RemoteConfigInfo<T = any> {
9+
key: string;
10+
value?: T;
11+
}

0 commit comments

Comments
 (0)