Skip to content

Commit f1b5d9d

Browse files
committed
feat: add a type to provider
1 parent fa75a27 commit f1b5d9d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/providers/BaseProvider.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ import {
66
PluginContext,
77
} from "kuzzle";
88

9+
export enum ProviderType {
10+
EMAIL = "email",
11+
SMS = "sms",
12+
}
13+
914
export interface BaseAccount<T> {
1015
provider: T;
1116

@@ -19,6 +24,7 @@ export abstract class BaseProvider<T> {
1924
protected context: PluginContext;
2025

2126
protected name: string;
27+
protected type: ProviderType;
2228

2329
protected accounts = new Map<string, T>();
2430

@@ -35,8 +41,9 @@ export abstract class BaseProvider<T> {
3541
return this.context.accessors.cluster;
3642
}
3743

38-
constructor(name: string, jsonSchema: JSONObject) {
44+
constructor(name: string, type: ProviderType, jsonSchema: JSONObject) {
3945
this.name = name;
46+
this.type = type;
4047
this.jsonSchema = jsonSchema;
4148

4249
this.EVENT_ACCOUNT_ADD = `${this.name}:account:add`;

0 commit comments

Comments
 (0)