mblabs-roccato-backend-commons 1.0.8 → 1.1.0
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/bitbucket-pipelines.yml +6 -48
- package/dist/database/entities/account.d.ts +1 -2
- package/dist/database/entities/account.js +2 -7
- package/dist/database/entities/address.d.ts +2 -1
- package/dist/database/entities/address.js +6 -5
- package/dist/database/entities/company-address.d.ts +10 -0
- package/dist/database/entities/company-address.js +51 -0
- package/dist/database/entities/company.d.ts +13 -0
- package/dist/database/entities/company.js +68 -0
- package/dist/database/entities/index.d.ts +3 -1
- package/dist/database/entities/index.js +5 -1
- package/dist/database/migrations/1748448589934-CreateAccountsTable.js +1 -6
- package/dist/database/migrations/1750432386920-CreateAddressTable.js +0 -5
- package/dist/database/migrations/{1750691840822-CreateAccountDetailsTable.d.ts → 1750437883213-CreateCompanyTable.d.ts} +1 -1
- package/dist/database/migrations/{1750691840822-CreateAccountDetailsTable.js → 1750437883213-CreateCompanyTable.js} +35 -23
- package/dist/database/migrations/{1750690818577-CreateAccountAddressTable.d.ts → 1750440116105-CreateCompanyAddressTable.d.ts} +1 -1
- package/dist/database/migrations/{1750690818577-CreateAccountAddressTable.js → 1750440116105-CreateCompanyAddressTable.js} +14 -21
- package/dist/database/migrations/index.d.ts +1 -29
- package/dist/database/migrations/index.js +18 -18
- package/dist/interfaces/aws.d.ts +41 -67
- package/dist/interfaces/azure.d.ts +38 -61
- package/dist/interfaces/firebase.d.ts +3 -7
- package/dist/interfaces/gcp.d.ts +5 -11
- package/dist/interfaces/grafana.d.ts +2 -6
- package/dist/interfaces/keycloak.d.ts +4 -171
- package/dist/interfaces/nodemailer.d.ts +16 -20
- package/dist/interfaces/redis.d.ts +8 -49
- package/dist/interfaces/sendgrid.d.ts +13 -15
- package/dist/services/aws/cloudwatch.d.ts +1 -1
- package/dist/services/aws/cloudwatch.js +38 -38
- package/dist/services/aws/pinpoint.d.ts +3 -3
- package/dist/services/aws/pinpoint.js +29 -29
- package/dist/services/aws/s3.d.ts +5 -5
- package/dist/services/aws/s3.js +55 -59
- package/dist/services/aws/secret-manager.d.ts +1 -1
- package/dist/services/aws/secret-manager.js +5 -5
- package/dist/services/aws/sqs.d.ts +3 -3
- package/dist/services/aws/sqs.js +16 -16
- package/dist/services/azure/application-insights.d.ts +4 -4
- package/dist/services/azure/application-insights.js +12 -12
- package/dist/services/azure/communication.d.ts +3 -3
- package/dist/services/azure/communication.js +17 -17
- package/dist/services/azure/keyvault.d.ts +1 -1
- package/dist/services/azure/keyvault.js +3 -3
- package/dist/services/azure/storage-blob.d.ts +3 -3
- package/dist/services/azure/storage-blob.js +22 -22
- package/dist/services/firebase.d.ts +2 -2
- package/dist/services/firebase.js +10 -12
- package/dist/services/gcp/drive.d.ts +1 -1
- package/dist/services/gcp/drive.js +4 -4
- package/dist/services/gcp/secrets.d.ts +1 -1
- package/dist/services/gcp/secrets.js +8 -6
- package/dist/services/gcp/sheets.d.ts +1 -1
- package/dist/services/gcp/sheets.js +6 -6
- package/dist/services/grafana.d.ts +2 -2
- package/dist/services/grafana.js +12 -12
- package/dist/services/keycloak.d.ts +2 -14
- package/dist/services/keycloak.js +24 -300
- package/dist/services/nodemailer.d.ts +2 -2
- package/dist/services/nodemailer.js +109 -19
- package/dist/services/redis.d.ts +8 -6
- package/dist/services/redis.js +24 -53
- package/dist/services/sendgrid.d.ts +1 -1
- package/dist/services/sendgrid.js +10 -10
- package/package.json +1 -1
- package/src/database/entities/account.ts +3 -5
- package/src/database/entities/address.ts +7 -4
- package/src/database/entities/company-address.ts +27 -0
- package/src/database/entities/company.ts +36 -0
- package/src/database/entities/index.ts +4 -0
- package/src/database/migrations/1748448589934-CreateAccountsTable.ts +1 -6
- package/src/database/migrations/1750432386920-CreateAddressTable.ts +0 -5
- package/src/database/migrations/{1750691840822-CreateAccountDetailsTable.ts → 1750437883213-CreateCompanyTable.ts} +35 -21
- package/src/database/migrations/{1750690818577-CreateAccountAddressTable.ts → 1750440116105-CreateCompanyAddressTable.ts} +14 -24
- package/src/database/migrations/index.ts +6 -6
- package/src/interfaces/aws.ts +55 -81
- package/src/interfaces/azure.ts +50 -71
- package/src/interfaces/firebase.ts +6 -10
- package/src/interfaces/gcp.ts +8 -14
- package/src/interfaces/grafana.ts +5 -9
- package/src/interfaces/keycloak.ts +7 -190
- package/src/interfaces/nodemailer.ts +18 -22
- package/src/interfaces/redis.ts +8 -54
- package/src/interfaces/sendgrid.ts +14 -16
- package/src/services/aws/cloudwatch.ts +39 -39
- package/src/services/aws/pinpoint.ts +30 -30
- package/src/services/aws/s3.ts +55 -59
- package/src/services/aws/secret-manager.ts +7 -8
- package/src/services/aws/sqs.ts +17 -23
- package/src/services/azure/application-insights.ts +12 -12
- package/src/services/azure/communication.ts +18 -18
- package/src/services/azure/keyvault.ts +3 -3
- package/src/services/azure/storage-blob.ts +30 -34
- package/src/services/firebase.ts +11 -21
- package/src/services/gcp/drive.ts +5 -8
- package/src/services/gcp/secrets.ts +10 -9
- package/src/services/gcp/sheets.ts +7 -10
- package/src/services/grafana.ts +12 -18
- package/src/services/keycloak.ts +25 -381
- package/src/services/nodemailer.ts +110 -19
- package/src/services/redis.ts +22 -58
- package/src/services/sendgrid.ts +11 -11
package/src/interfaces/azure.ts
CHANGED
|
@@ -7,39 +7,31 @@ interface Credentials {
|
|
|
7
7
|
export namespace AzureApplicationInsights {
|
|
8
8
|
export namespace TrackTrace {
|
|
9
9
|
export interface Request {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
severity: string;
|
|
13
|
-
};
|
|
10
|
+
message: string;
|
|
11
|
+
severity: string;
|
|
14
12
|
credentials: Credentials;
|
|
15
13
|
}
|
|
16
14
|
}
|
|
17
15
|
|
|
18
16
|
export namespace TrackEvent {
|
|
19
17
|
export interface Request {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
properties?: { [key: string]: string };
|
|
23
|
-
};
|
|
18
|
+
name: string;
|
|
19
|
+
properties?: { [key: string]: string };
|
|
24
20
|
credentials: Credentials;
|
|
25
21
|
}
|
|
26
22
|
}
|
|
27
23
|
|
|
28
24
|
export namespace TrackException {
|
|
29
25
|
export interface Request {
|
|
30
|
-
|
|
31
|
-
error: Error;
|
|
32
|
-
};
|
|
26
|
+
error: Error;
|
|
33
27
|
credentials: Credentials;
|
|
34
28
|
}
|
|
35
29
|
}
|
|
36
30
|
|
|
37
31
|
export namespace TrackMetric {
|
|
38
32
|
export interface Request {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
value: number;
|
|
42
|
-
};
|
|
33
|
+
name: string;
|
|
34
|
+
value: number;
|
|
43
35
|
credentials: Credentials;
|
|
44
36
|
}
|
|
45
37
|
}
|
|
@@ -48,37 +40,31 @@ export namespace AzureApplicationInsights {
|
|
|
48
40
|
export namespace AzureCommunication {
|
|
49
41
|
export namespace SendMail {
|
|
50
42
|
export interface Request {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
variables?: Record<string, string | number>;
|
|
57
|
-
};
|
|
43
|
+
subject: string;
|
|
44
|
+
text: string;
|
|
45
|
+
emails: string | string[];
|
|
46
|
+
from: string;
|
|
47
|
+
variables?: Record<string, string | number>;
|
|
58
48
|
credentials: Credentials;
|
|
59
49
|
}
|
|
60
50
|
}
|
|
61
51
|
|
|
62
52
|
export namespace SendTemplateMail {
|
|
63
53
|
export interface Request {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
variables?: Record<string, string | number>;
|
|
70
|
-
};
|
|
54
|
+
subject: string;
|
|
55
|
+
template: string;
|
|
56
|
+
emails: string | string[];
|
|
57
|
+
from: string;
|
|
58
|
+
variables?: Record<string, string | number>;
|
|
71
59
|
credentials: Credentials;
|
|
72
60
|
}
|
|
73
61
|
}
|
|
74
62
|
|
|
75
63
|
export namespace SendSMS {
|
|
76
64
|
export interface Request {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
phones: string | string[];
|
|
81
|
-
};
|
|
65
|
+
sender: string;
|
|
66
|
+
text: string;
|
|
67
|
+
phones: string | string[];
|
|
82
68
|
credentials: Credentials;
|
|
83
69
|
}
|
|
84
70
|
}
|
|
@@ -87,11 +73,8 @@ export namespace AzureCommunication {
|
|
|
87
73
|
export namespace AzureKeyVault {
|
|
88
74
|
export namespace GetSecret {
|
|
89
75
|
export interface Request {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
secretName: string;
|
|
93
|
-
};
|
|
94
|
-
credentials: Credentials;
|
|
76
|
+
vault: string;
|
|
77
|
+
secretName: string;
|
|
95
78
|
}
|
|
96
79
|
|
|
97
80
|
export interface Response<T> {
|
|
@@ -103,23 +86,19 @@ export namespace AzureKeyVault {
|
|
|
103
86
|
export namespace AzureStorageBlob {
|
|
104
87
|
export namespace UploadBuffer {
|
|
105
88
|
export interface Request {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
file: Buffer;
|
|
111
|
-
};
|
|
89
|
+
storageContainer: string;
|
|
90
|
+
storageUrl: string;
|
|
91
|
+
filename: string;
|
|
92
|
+
file: Buffer;
|
|
112
93
|
credentials: Credentials;
|
|
113
94
|
}
|
|
114
95
|
}
|
|
115
96
|
|
|
116
97
|
export namespace DownloadBuffer {
|
|
117
98
|
export interface Request {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
filename: string;
|
|
122
|
-
};
|
|
99
|
+
storageContainer: string;
|
|
100
|
+
storageUrl: string;
|
|
101
|
+
filename: string;
|
|
123
102
|
credentials: Credentials;
|
|
124
103
|
}
|
|
125
104
|
|
|
@@ -130,16 +109,14 @@ export namespace AzureStorageBlob {
|
|
|
130
109
|
|
|
131
110
|
export namespace GetPreSignedUrl {
|
|
132
111
|
export interface Request {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
contentEncoding?: string;
|
|
142
|
-
};
|
|
112
|
+
filename: string;
|
|
113
|
+
storageContainer: string;
|
|
114
|
+
storageUrl: string;
|
|
115
|
+
options?: {
|
|
116
|
+
version?: string;
|
|
117
|
+
hoursToExpire?: number;
|
|
118
|
+
contentType?: string;
|
|
119
|
+
contentEncoding?: string;
|
|
143
120
|
};
|
|
144
121
|
credentials: Credentials;
|
|
145
122
|
}
|
|
@@ -151,24 +128,26 @@ export namespace AzureStorageBlob {
|
|
|
151
128
|
}
|
|
152
129
|
|
|
153
130
|
export interface IAzureApplicationInsightsService {
|
|
154
|
-
trackTrace(req: AzureApplicationInsights.TrackTrace.Request): Promise<void>;
|
|
155
|
-
trackEvent(req: AzureApplicationInsights.TrackEvent.Request): Promise<void>;
|
|
156
|
-
trackException(req: AzureApplicationInsights.TrackException.Request): Promise<void>;
|
|
157
|
-
trackMetric(req: AzureApplicationInsights.TrackMetric.Request): Promise<void>;
|
|
131
|
+
trackTrace (req: AzureApplicationInsights.TrackTrace.Request): Promise<void>;
|
|
132
|
+
trackEvent (req: AzureApplicationInsights.TrackEvent.Request): Promise<void>;
|
|
133
|
+
trackException (req: AzureApplicationInsights.TrackException.Request): Promise<void>;
|
|
134
|
+
trackMetric (req: AzureApplicationInsights.TrackMetric.Request): Promise<void>;
|
|
158
135
|
}
|
|
159
136
|
|
|
160
137
|
export interface IAzureCommunicationService {
|
|
161
|
-
sendMail(req: AzureCommunication.SendMail.Request): Promise<void>;
|
|
162
|
-
sendSMS(req: AzureCommunication.SendSMS.Request): Promise<void
|
|
163
|
-
sendTemplateMail(req: AzureCommunication.SendTemplateMail.Request): Promise<void
|
|
138
|
+
sendMail (req: AzureCommunication.SendMail.Request): Promise<void>;
|
|
139
|
+
sendSMS (req: AzureCommunication.SendSMS.Request): Promise<void>
|
|
140
|
+
sendTemplateMail (req: AzureCommunication.SendTemplateMail.Request): Promise<void>
|
|
164
141
|
}
|
|
165
142
|
|
|
166
143
|
export interface IAzureKeyVaultService {
|
|
167
|
-
getSecret<T>(req: AzureKeyVault.GetSecret.Request): Promise<AzureKeyVault.GetSecret.Response<T>>;
|
|
144
|
+
getSecret <T>(req: AzureKeyVault.GetSecret.Request): Promise<AzureKeyVault.GetSecret.Response<T>>;
|
|
168
145
|
}
|
|
169
146
|
|
|
170
147
|
export interface IAzureStorageBlobService {
|
|
171
|
-
uploadBuffer(req: AzureStorageBlob.UploadBuffer.Request): Promise<void>;
|
|
172
|
-
downloadBuffer(req: AzureStorageBlob.DownloadBuffer.Request): Promise<AzureStorageBlob.DownloadBuffer.Response>;
|
|
173
|
-
getPreSignedUrl(
|
|
148
|
+
uploadBuffer (req: AzureStorageBlob.UploadBuffer.Request): Promise<void>;
|
|
149
|
+
downloadBuffer (req: AzureStorageBlob.DownloadBuffer.Request): Promise<AzureStorageBlob.DownloadBuffer.Response>;
|
|
150
|
+
getPreSignedUrl (
|
|
151
|
+
req: AzureStorageBlob.GetPreSignedUrl.Request,
|
|
152
|
+
): Promise<AzureStorageBlob.GetPreSignedUrl.Response>;
|
|
174
153
|
}
|
|
@@ -9,25 +9,21 @@ interface Credentials {
|
|
|
9
9
|
export namespace Firebase {
|
|
10
10
|
export namespace SendNotification {
|
|
11
11
|
export interface Request {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
isTest: boolean;
|
|
15
|
-
};
|
|
12
|
+
message: FirebaseAdmin.messaging.MulticastMessage;
|
|
13
|
+
isTest: boolean;
|
|
16
14
|
credentials: Credentials;
|
|
17
15
|
}
|
|
18
16
|
}
|
|
19
17
|
|
|
20
18
|
export namespace PublishConfig {
|
|
21
19
|
export interface Request {
|
|
22
|
-
|
|
23
|
-
template: string;
|
|
24
|
-
};
|
|
20
|
+
template: string;
|
|
25
21
|
credentials: Credentials;
|
|
26
22
|
}
|
|
27
23
|
}
|
|
28
24
|
}
|
|
29
25
|
|
|
30
26
|
export interface IFirebaseService {
|
|
31
|
-
sendNotification(req: Firebase.SendNotification.Request): Promise<void>;
|
|
32
|
-
publishConfig(req: Firebase.PublishConfig.Request): Promise<void>;
|
|
33
|
-
}
|
|
27
|
+
sendNotification (req: Firebase.SendNotification.Request): Promise<void>;
|
|
28
|
+
publishConfig (req: Firebase.PublishConfig.Request): Promise<void>;
|
|
29
|
+
}
|
package/src/interfaces/gcp.ts
CHANGED
|
@@ -7,9 +7,7 @@ interface Credentials {
|
|
|
7
7
|
export namespace GoogleDrive {
|
|
8
8
|
export namespace ReadFile {
|
|
9
9
|
export interface Request {
|
|
10
|
-
|
|
11
|
-
file: string;
|
|
12
|
-
};
|
|
10
|
+
fileId: string;
|
|
13
11
|
credentials: Credentials;
|
|
14
12
|
}
|
|
15
13
|
|
|
@@ -22,10 +20,8 @@ export namespace GoogleDrive {
|
|
|
22
20
|
export namespace GoogleSheets {
|
|
23
21
|
export namespace ReadSheet {
|
|
24
22
|
export interface Request {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
tabs: string[];
|
|
28
|
-
};
|
|
23
|
+
spreadsheetId: string;
|
|
24
|
+
tabs: string[];
|
|
29
25
|
credentials: Credentials;
|
|
30
26
|
}
|
|
31
27
|
|
|
@@ -38,10 +34,8 @@ export namespace GoogleSheets {
|
|
|
38
34
|
export namespace GoogleSecrets {
|
|
39
35
|
export namespace GetSecret {
|
|
40
36
|
export interface Request {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
secret: string;
|
|
44
|
-
};
|
|
37
|
+
projectId: string;
|
|
38
|
+
secretId: string;
|
|
45
39
|
credentials: Credentials;
|
|
46
40
|
}
|
|
47
41
|
|
|
@@ -52,13 +46,13 @@ export namespace GoogleSecrets {
|
|
|
52
46
|
}
|
|
53
47
|
|
|
54
48
|
export interface IGoogleSecretsService {
|
|
55
|
-
getSecret<T>(req: GoogleSecrets.GetSecret.Request): Promise<GoogleSecrets.GetSecret.Response<T>>;
|
|
49
|
+
getSecret <T>(req: GoogleSecrets.GetSecret.Request): Promise<GoogleSecrets.GetSecret.Response<T>>;
|
|
56
50
|
}
|
|
57
51
|
|
|
58
52
|
export interface IGoogleDriveService {
|
|
59
|
-
readFile(req: GoogleDrive.ReadFile.Request): Promise<GoogleDrive.ReadFile.Response>;
|
|
53
|
+
readFile (req: GoogleDrive.ReadFile.Request): Promise<GoogleDrive.ReadFile.Response>;
|
|
60
54
|
}
|
|
61
55
|
|
|
62
56
|
export interface IGoogleSheetsService {
|
|
63
|
-
readSheet(req: GoogleSheets.ReadSheet.Request): Promise<GoogleSheets.ReadSheet.Response>;
|
|
57
|
+
readSheet (req: GoogleSheets.ReadSheet.Request): Promise<GoogleSheets.ReadSheet.Response>;
|
|
64
58
|
}
|
|
@@ -6,9 +6,7 @@ interface Credentials {
|
|
|
6
6
|
export namespace Grafana {
|
|
7
7
|
export namespace GetDashboard {
|
|
8
8
|
export interface Request {
|
|
9
|
-
|
|
10
|
-
uid: string;
|
|
11
|
-
};
|
|
9
|
+
uid: string;
|
|
12
10
|
credentials: Credentials;
|
|
13
11
|
}
|
|
14
12
|
|
|
@@ -19,9 +17,7 @@ export namespace Grafana {
|
|
|
19
17
|
|
|
20
18
|
export namespace SearchDashboard {
|
|
21
19
|
export interface Request {
|
|
22
|
-
|
|
23
|
-
query: string;
|
|
24
|
-
};
|
|
20
|
+
query: string;
|
|
25
21
|
credentials: Credentials;
|
|
26
22
|
}
|
|
27
23
|
|
|
@@ -32,6 +28,6 @@ export namespace Grafana {
|
|
|
32
28
|
}
|
|
33
29
|
|
|
34
30
|
export interface IGrafanaService {
|
|
35
|
-
getDashboard(req: Grafana.GetDashboard.Request): Promise<Grafana.GetDashboard.Response>;
|
|
36
|
-
searchDashboard(req: Grafana.SearchDashboard.Request): Promise<Grafana.SearchDashboard.Response>;
|
|
37
|
-
}
|
|
31
|
+
getDashboard (req: Grafana.GetDashboard.Request): Promise<Grafana.GetDashboard.Response>;
|
|
32
|
+
searchDashboard (req: Grafana.SearchDashboard.Request): Promise<Grafana.SearchDashboard.Response>;
|
|
33
|
+
}
|
|
@@ -1,41 +1,16 @@
|
|
|
1
1
|
interface Credentials {
|
|
2
|
-
clientId: string;
|
|
3
2
|
realm: string;
|
|
3
|
+
clientId: string;
|
|
4
4
|
clientSecret: string;
|
|
5
5
|
grantType: string;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
export interface Roles {
|
|
9
|
-
id: string;
|
|
10
|
-
name: string;
|
|
11
|
-
description: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
8
|
export namespace Keycloak {
|
|
15
9
|
export namespace Authenticate {
|
|
16
10
|
export interface Request {
|
|
17
11
|
url: string;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
password: string;
|
|
21
|
-
};
|
|
22
|
-
credentials: Credentials;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface Response {
|
|
26
|
-
access_token: string;
|
|
27
|
-
expires_in: number;
|
|
28
|
-
refresh_expires_in: number;
|
|
29
|
-
refresh_token: string;
|
|
30
|
-
token_type: string;
|
|
31
|
-
profileType?: number;
|
|
32
|
-
active?: boolean;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export namespace AuthenticateServer {
|
|
37
|
-
export interface Request {
|
|
38
|
-
url: string;
|
|
12
|
+
username: string;
|
|
13
|
+
password: string;
|
|
39
14
|
credentials: Credentials;
|
|
40
15
|
}
|
|
41
16
|
|
|
@@ -53,9 +28,7 @@ export namespace Keycloak {
|
|
|
53
28
|
export namespace RefreshAccess {
|
|
54
29
|
export interface Request {
|
|
55
30
|
url: string;
|
|
56
|
-
|
|
57
|
-
refreshToken: string;
|
|
58
|
-
};
|
|
31
|
+
refreshToken: string;
|
|
59
32
|
credentials: Credentials;
|
|
60
33
|
}
|
|
61
34
|
|
|
@@ -69,165 +42,9 @@ export namespace Keycloak {
|
|
|
69
42
|
active?: boolean;
|
|
70
43
|
}
|
|
71
44
|
}
|
|
72
|
-
|
|
73
|
-
export namespace RevokeAccess {
|
|
74
|
-
export interface Request {
|
|
75
|
-
url: string;
|
|
76
|
-
data: {
|
|
77
|
-
accessToken: string;
|
|
78
|
-
};
|
|
79
|
-
credentials: Credentials;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export namespace CreateUser {
|
|
84
|
-
export interface Request {
|
|
85
|
-
url: string;
|
|
86
|
-
data: {
|
|
87
|
-
username: string;
|
|
88
|
-
firstName: string;
|
|
89
|
-
lastName?: string;
|
|
90
|
-
email: string;
|
|
91
|
-
password: string;
|
|
92
|
-
isTemporaryPassword?: boolean;
|
|
93
|
-
groups: string[];
|
|
94
|
-
};
|
|
95
|
-
credentials: Credentials;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export namespace UpdateUser {
|
|
100
|
-
export interface Request {
|
|
101
|
-
url: string;
|
|
102
|
-
data: {
|
|
103
|
-
id: string;
|
|
104
|
-
username?: string;
|
|
105
|
-
firstName?: string;
|
|
106
|
-
lastName?: string;
|
|
107
|
-
email?: string;
|
|
108
|
-
password?: string;
|
|
109
|
-
isTemporaryPassword?: boolean;
|
|
110
|
-
groups?: string[];
|
|
111
|
-
};
|
|
112
|
-
credentials: Credentials;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export namespace GetUser {
|
|
117
|
-
export interface Request {
|
|
118
|
-
url: string;
|
|
119
|
-
data: {
|
|
120
|
-
id: string;
|
|
121
|
-
};
|
|
122
|
-
credentials: Credentials;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export interface Response {
|
|
126
|
-
id: string;
|
|
127
|
-
sub: string;
|
|
128
|
-
firstName: string;
|
|
129
|
-
lastName: string;
|
|
130
|
-
email: string;
|
|
131
|
-
enabled: boolean;
|
|
132
|
-
attributes: {
|
|
133
|
-
isFirstAccess: boolean;
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export namespace DeleteUser {
|
|
139
|
-
export interface Request {
|
|
140
|
-
url: string;
|
|
141
|
-
data: {
|
|
142
|
-
id: string;
|
|
143
|
-
};
|
|
144
|
-
credentials: Credentials;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
export namespace ChangeUserPassword {
|
|
149
|
-
export interface Request {
|
|
150
|
-
url: string;
|
|
151
|
-
data: {
|
|
152
|
-
id: string;
|
|
153
|
-
password: string;
|
|
154
|
-
isTemporaryPassword?: boolean;
|
|
155
|
-
};
|
|
156
|
-
credentials: Credentials;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export namespace AddRealm {
|
|
161
|
-
export interface Request {
|
|
162
|
-
url: string;
|
|
163
|
-
data: {
|
|
164
|
-
name: string;
|
|
165
|
-
enabled: boolean;
|
|
166
|
-
};
|
|
167
|
-
credentials: Credentials;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
export namespace AddRole {
|
|
172
|
-
export interface Request {
|
|
173
|
-
url: string;
|
|
174
|
-
data: {
|
|
175
|
-
name: string;
|
|
176
|
-
description: string;
|
|
177
|
-
};
|
|
178
|
-
credentials: Credentials;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
export namespace AssociateUserRole {
|
|
183
|
-
export interface Request {
|
|
184
|
-
url: string;
|
|
185
|
-
data: {
|
|
186
|
-
user: string;
|
|
187
|
-
role: string;
|
|
188
|
-
};
|
|
189
|
-
credentials: Credentials;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
export namespace GetRoles {
|
|
194
|
-
export interface Request {
|
|
195
|
-
url: string;
|
|
196
|
-
data: {
|
|
197
|
-
search: string;
|
|
198
|
-
};
|
|
199
|
-
credentials: Credentials;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
export interface Response {
|
|
203
|
-
roles: Roles[];
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
export namespace DeleteRole {
|
|
208
|
-
export interface Request {
|
|
209
|
-
url: string;
|
|
210
|
-
data: {
|
|
211
|
-
id: string;
|
|
212
|
-
};
|
|
213
|
-
credentials: Credentials;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
45
|
}
|
|
217
46
|
|
|
218
47
|
export interface IKeycloakService {
|
|
219
|
-
authenticate(req: Keycloak.Authenticate.Request): Promise<Keycloak.Authenticate.Response>;
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
revokeAccess(req: Keycloak.RevokeAccess.Request): Promise<void>;
|
|
223
|
-
createUser(req: Keycloak.CreateUser.Request): Promise<void>;
|
|
224
|
-
updateUser(req: Keycloak.UpdateUser.Request): Promise<void>;
|
|
225
|
-
getUser(req: Keycloak.GetUser.Request): Promise<Keycloak.GetUser.Response>;
|
|
226
|
-
deleteUser(req: Keycloak.DeleteUser.Request): Promise<void>;
|
|
227
|
-
changeUserPassword(req: Keycloak.ChangeUserPassword.Request): Promise<void>;
|
|
228
|
-
addRealm(req: Keycloak.AddRealm.Request): Promise<void>;
|
|
229
|
-
addRole(req: Keycloak.AddRole.Request): Promise<void>;
|
|
230
|
-
associateUserRole(req: Keycloak.AssociateUserRole.Request): Promise<void>;
|
|
231
|
-
getRoles(req: Keycloak.GetRoles.Request): Promise<Keycloak.GetRoles.Response>;
|
|
232
|
-
deleteRole(req: Keycloak.DeleteRole.Request): Promise<void>;
|
|
233
|
-
}
|
|
48
|
+
authenticate (req: Keycloak.Authenticate.Request): Promise<Keycloak.Authenticate.Response>;
|
|
49
|
+
refreshAccess (req: Keycloak.RefreshAccess.Request): Promise<Keycloak.RefreshAccess.Response>;
|
|
50
|
+
}
|
|
@@ -11,40 +11,36 @@ interface Credentials {
|
|
|
11
11
|
export namespace NodeMailer {
|
|
12
12
|
export namespace Send {
|
|
13
13
|
export interface Request {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
address: string;
|
|
18
|
-
};
|
|
19
|
-
to: string;
|
|
20
|
-
subject: string;
|
|
21
|
-
text: string;
|
|
14
|
+
from: {
|
|
15
|
+
name: string;
|
|
16
|
+
address: string;
|
|
22
17
|
};
|
|
18
|
+
to: string;
|
|
19
|
+
subject: string;
|
|
20
|
+
text: string;
|
|
23
21
|
credentials: Credentials;
|
|
24
22
|
}
|
|
25
23
|
}
|
|
26
24
|
|
|
27
25
|
export namespace SendWithTemplate {
|
|
28
26
|
export interface Request {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
address: string;
|
|
33
|
-
};
|
|
34
|
-
to: string;
|
|
35
|
-
subject: string;
|
|
36
|
-
html: string;
|
|
37
|
-
attachments: {
|
|
38
|
-
filename: string;
|
|
39
|
-
content: Buffer;
|
|
40
|
-
}[];
|
|
27
|
+
from: {
|
|
28
|
+
name: string;
|
|
29
|
+
address: string;
|
|
41
30
|
};
|
|
31
|
+
to: string;
|
|
32
|
+
subject: string;
|
|
33
|
+
html: string;
|
|
34
|
+
attachments: {
|
|
35
|
+
filename: string;
|
|
36
|
+
content: Buffer;
|
|
37
|
+
}[];
|
|
42
38
|
credentials: Credentials;
|
|
43
39
|
}
|
|
44
40
|
}
|
|
45
41
|
}
|
|
46
42
|
|
|
47
43
|
export interface INodeMailerService {
|
|
48
|
-
send(req: NodeMailer.Send.Request): Promise<void>;
|
|
49
|
-
sendWithTemplate(req: NodeMailer.SendWithTemplate.Request): Promise<void>;
|
|
44
|
+
send (req: NodeMailer.Send.Request): Promise<void>;
|
|
45
|
+
sendWithTemplate (req: NodeMailer.SendWithTemplate.Request): Promise<void>;
|
|
50
46
|
}
|
package/src/interfaces/redis.ts
CHANGED
|
@@ -1,60 +1,14 @@
|
|
|
1
|
-
interface Credentials {
|
|
2
|
-
host: string;
|
|
3
|
-
port: number;
|
|
4
|
-
password?: string;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
1
|
export namespace Redis {
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
value: unknown;
|
|
13
|
-
ttl?: number;
|
|
14
|
-
};
|
|
15
|
-
credentials: Credentials;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export namespace Get {
|
|
20
|
-
export interface Request {
|
|
21
|
-
data: {
|
|
22
|
-
key: string;
|
|
23
|
-
};
|
|
24
|
-
credentials: Credentials;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface Response<T>{
|
|
28
|
-
data: T;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export namespace Del {
|
|
33
|
-
export interface Request {
|
|
34
|
-
data: {
|
|
35
|
-
key: string;
|
|
36
|
-
};
|
|
37
|
-
credentials: Credentials;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export namespace Exists {
|
|
42
|
-
export interface Request {
|
|
43
|
-
data: {
|
|
44
|
-
key: string;
|
|
45
|
-
};
|
|
46
|
-
credentials: Credentials;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export interface Response {
|
|
50
|
-
exists: boolean;
|
|
51
|
-
}
|
|
2
|
+
export interface Credentials {
|
|
3
|
+
host: string;
|
|
4
|
+
port: number;
|
|
5
|
+
password?: string;
|
|
52
6
|
}
|
|
53
7
|
}
|
|
54
8
|
|
|
55
9
|
export interface IRedisService {
|
|
56
|
-
set(
|
|
57
|
-
get<T>(
|
|
58
|
-
del(
|
|
59
|
-
exists(
|
|
10
|
+
set (key: string, value: unknown, ttlInSeconds?: number): Promise<void>;
|
|
11
|
+
get <T>(key: string): Promise<T | null>;
|
|
12
|
+
del (key: string): Promise<void>;
|
|
13
|
+
exists (key: string): Promise<boolean>;
|
|
60
14
|
}
|