@kumori/aurora-backend-handler 1.0.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/.gitlab-ci.yml +57 -0
- package/README.md +352 -0
- package/api/account-api-service.ts +1092 -0
- package/api/deploy-service-helper.ts +1611 -0
- package/api/environment-api-service.ts +542 -0
- package/api/marketplace-api-service.ts +1031 -0
- package/api/organizations-api-service.ts +0 -0
- package/api/planProvider-api-service.ts +24 -0
- package/api/reporting-api-service.ts +35 -0
- package/api/resources-api-service.ts +821 -0
- package/api/service-api-service.ts +796 -0
- package/api/tenant-api-service.ts +1260 -0
- package/api/user-api-service.ts +1161 -0
- package/backend-handler.ts +1127 -0
- package/environment.ts +7 -0
- package/event-helper.ts +577 -0
- package/event-names.ts +152 -0
- package/helpers/account-helper.ts +331 -0
- package/helpers/environment-helper.ts +289 -0
- package/helpers/link-helper.ts +114 -0
- package/helpers/plan-helper.ts +104 -0
- package/helpers/registry-helper.ts +134 -0
- package/helpers/resource-helper.ts +387 -0
- package/helpers/revision-helper.ts +899 -0
- package/helpers/service-helper.ts +627 -0
- package/helpers/tenant-helper.ts +191 -0
- package/helpers/token-helper.ts +107 -0
- package/helpers/user-helper.ts +140 -0
- package/jest.config.ts +40 -0
- package/jest.setup.js +4 -0
- package/package.json +50 -0
- package/test/backend-handler.test.ts +792 -0
- package/test/deploy-service-helper.test.ts +518 -0
- package/test/event-helper.test.ts +152 -0
- package/tsconfig.json +26 -0
- package/utils/utils.ts +78 -0
- package/websocket-manager.ts +1833 -0
package/environment.ts
ADDED
package/event-helper.ts
ADDED
|
@@ -0,0 +1,577 @@
|
|
|
1
|
+
import { Account, Environment, Link, MarketplaceItem, MarketplaceService, Organization, PlanProvider, Registry, Tenant, tenantRole, User, Service, Notification, Resource } from "@hestekumori/aurora-interfaces";
|
|
2
|
+
import { EventNames } from "./event-names";
|
|
3
|
+
export interface RegistryUpdatePayload {
|
|
4
|
+
tenant: Tenant;
|
|
5
|
+
registry: Registry;
|
|
6
|
+
}
|
|
7
|
+
export class EventHelper {
|
|
8
|
+
globalEventHandler: any;
|
|
9
|
+
|
|
10
|
+
constructor(eventHandler: any) {
|
|
11
|
+
this.globalEventHandler = eventHandler;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
private createEvent<T>(eventName: string) {
|
|
15
|
+
if (!this.globalEventHandler) {
|
|
16
|
+
console.error("globalEventHandler es undefined al crear el evento:", eventName);
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
publish: (data: T) => this.globalEventHandler.publish(eventName, data),
|
|
20
|
+
subscribe: (callback: (payload: T) => void) => {
|
|
21
|
+
if (!this.globalEventHandler.subscribe) {
|
|
22
|
+
console.error("subscribe no existe para", eventName);
|
|
23
|
+
}
|
|
24
|
+
return this.globalEventHandler.subscribe(eventName, callback);
|
|
25
|
+
},
|
|
26
|
+
unsubscribe: (callback: (payload: T) => void) =>
|
|
27
|
+
this.globalEventHandler.unsubscribe(eventName, callback),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
// * Tenant
|
|
33
|
+
get tenant() {
|
|
34
|
+
return {
|
|
35
|
+
publish: {
|
|
36
|
+
creation: this.createEvent<Tenant>(EventNames.CreateTenant).publish,
|
|
37
|
+
created: this.createEvent<Tenant>(EventNames.TenantCreated).publish,
|
|
38
|
+
creationError: this.createEvent<Tenant>(EventNames.TenantCreationError).publish,
|
|
39
|
+
update: this.createEvent<Tenant>(EventNames.UpdateTenant).publish,
|
|
40
|
+
updated: this.createEvent<Tenant>(EventNames.TenantUpdated).publish,
|
|
41
|
+
updateError: this.createEvent<Tenant>(EventNames.TenantUpdateError).publish,
|
|
42
|
+
delete: this.createEvent<Tenant>(EventNames.DeleteTenant).publish,
|
|
43
|
+
deleted: this.createEvent<Tenant>(EventNames.TenantDeleted).publish,
|
|
44
|
+
deletionError: this.createEvent<Tenant>(EventNames.TenantDeletionError).publish,
|
|
45
|
+
createRegistry: this.createEvent<RegistryUpdatePayload>(EventNames.CreateRegistry).publish,
|
|
46
|
+
registryCreated: this.createEvent<RegistryUpdatePayload>(EventNames.RegistryCreated).publish,
|
|
47
|
+
registryCreationError: this.createEvent<RegistryUpdatePayload>(EventNames.RegistryCreationError).publish,
|
|
48
|
+
updateRegistry: this.createEvent<RegistryUpdatePayload>(EventNames.UpdateRegistry).publish,
|
|
49
|
+
registryUpdated: this.createEvent<RegistryUpdatePayload>(EventNames.RegistryUpdated).publish,
|
|
50
|
+
registryUpdateError: this.createEvent<RegistryUpdatePayload>(EventNames.RegistryUpdateError).publish,
|
|
51
|
+
deleteRegistry: this.createEvent<RegistryUpdatePayload>(EventNames.DeleteRegistry).publish,
|
|
52
|
+
registryDeleted: this.createEvent<RegistryUpdatePayload>(EventNames.RegistryDeleted).publish,
|
|
53
|
+
registryDeletionError: this.createEvent<RegistryUpdatePayload>(EventNames.RegistryDeletionError).publish,
|
|
54
|
+
inviteUser: this.createEvent<{ tenant: string; user: string; role: tenantRole; }>(EventNames.InviteUser).publish,
|
|
55
|
+
userInvited: this.createEvent<{ tenant: string; user: string; role: tenantRole; }>(EventNames.UserInvited).publish,
|
|
56
|
+
inviteError: this.createEvent<{ tenant: string; user: string; role: tenantRole; }>(EventNames.UserInviteError).publish,
|
|
57
|
+
removeUser: this.createEvent<{ user: string; tenant: string; }>(EventNames.RemoveUserFromTenant).publish,
|
|
58
|
+
userRemoved: this.createEvent<{ user: string; tenant: string; }>(EventNames.UserRemovedFromTenant).publish,
|
|
59
|
+
removeUserError: this.createEvent<{ user: string; tenant: string; }>(EventNames.UserRemovalFromTenantError).publish,
|
|
60
|
+
acceptInvite: this.createEvent<{ tenant: string; }>(EventNames.AcceptInvite).publish,
|
|
61
|
+
inviteAccepted: this.createEvent<{ user: string; tenant: string; }>(EventNames.InviteAccepted).publish,
|
|
62
|
+
acceptInviteError: this.createEvent<{ tenant: string; }>(EventNames.InviteAcceptError).publish,
|
|
63
|
+
updateInvite: this.createEvent<{ tenant: string; user: string; role: tenantRole; }>(EventNames.UpdateInvite).publish,
|
|
64
|
+
inviteUpdated: this.createEvent<{ tenant: string; user: string; role: tenantRole; }>(EventNames.InviteUpdated).publish,
|
|
65
|
+
inviteUpdateError: this.createEvent<{ tenant: string; user: string; role: tenantRole; }>(EventNames.InviteUpdateError).publish,
|
|
66
|
+
rejectInvite: this.createEvent<{ tenant: string; }>(EventNames.RejectInvite).publish,
|
|
67
|
+
inviteRejected: this.createEvent<{ user: string; tenant: string; }>(EventNames.InviteRejected).publish,
|
|
68
|
+
inviteRejectError: this.createEvent<{ tenant: string; }>(EventNames.InviteRejectError).publish,
|
|
69
|
+
createToken: this.createEvent<{ tenant: string; expiration: string; description: string }>(EventNames.CreateToken).publish,
|
|
70
|
+
tokenCreated: this.createEvent<{ tenant: string; token: string; expiration: string; description: string }>(EventNames.TokenCreated).publish,
|
|
71
|
+
tokenCreationError: this.createEvent<{ tenant: string; expiration: string; description: string }>(EventNames.TokenCreationError).publish,
|
|
72
|
+
deleteToken: this.createEvent<{ tenant: string; token: string }>(EventNames.DeleteToken).publish,
|
|
73
|
+
tokenDeleted: this.createEvent<{ tenant: string; token: string }>(EventNames.TokenDeleted).publish,
|
|
74
|
+
tokenDeletionError: this.createEvent<{ tenant: string; token: string }>(EventNames.TokenDeletionError).publish,
|
|
75
|
+
},
|
|
76
|
+
subscribe: {
|
|
77
|
+
creation: this.createEvent<Tenant>(EventNames.CreateTenant).subscribe,
|
|
78
|
+
created: this.createEvent<Tenant>(EventNames.TenantCreated).subscribe,
|
|
79
|
+
creationError: this.createEvent<Tenant>(EventNames.TenantCreationError).subscribe,
|
|
80
|
+
update: this.createEvent<Tenant>(EventNames.UpdateTenant).subscribe,
|
|
81
|
+
updated: this.createEvent<Tenant>(EventNames.TenantUpdated).subscribe,
|
|
82
|
+
updateError: this.createEvent<Tenant>(EventNames.TenantUpdateError).subscribe,
|
|
83
|
+
delete: this.createEvent<Tenant>(EventNames.DeleteTenant).subscribe,
|
|
84
|
+
deleted: this.createEvent<Tenant>(EventNames.TenantDeleted).subscribe,
|
|
85
|
+
deletionError: this.createEvent<Tenant>(EventNames.TenantDeletionError).subscribe,
|
|
86
|
+
createRegistry: this.createEvent<RegistryUpdatePayload>(EventNames.CreateRegistry).subscribe,
|
|
87
|
+
registryCreated: this.createEvent<RegistryUpdatePayload>(EventNames.RegistryCreated).subscribe,
|
|
88
|
+
registryCreationError: this.createEvent<RegistryUpdatePayload>(EventNames.RegistryCreationError).subscribe,
|
|
89
|
+
updateRegistry: this.createEvent<RegistryUpdatePayload>(EventNames.UpdateRegistry).subscribe,
|
|
90
|
+
registryUpdated: this.createEvent<RegistryUpdatePayload>(EventNames.RegistryUpdated).subscribe,
|
|
91
|
+
registryUpdateError: this.createEvent<RegistryUpdatePayload>(EventNames.RegistryUpdateError).subscribe,
|
|
92
|
+
deleteRegistry: this.createEvent<RegistryUpdatePayload>(EventNames.DeleteRegistry).subscribe,
|
|
93
|
+
registryDeleted: this.createEvent<RegistryUpdatePayload>(EventNames.RegistryDeleted).subscribe,
|
|
94
|
+
registryDeletionError: this.createEvent<RegistryUpdatePayload>(EventNames.RegistryDeletionError).subscribe,
|
|
95
|
+
inviteUser: this.createEvent<{ tenant: string; user: string; role: tenantRole; }>(EventNames.InviteUser).subscribe,
|
|
96
|
+
userInvited: this.createEvent<{ tenant: string; user: string; role: tenantRole; }>(EventNames.UserInvited).subscribe,
|
|
97
|
+
inviteError: this.createEvent<{ tenant: string; user: string; role: tenantRole; }>(EventNames.UserInviteError).subscribe,
|
|
98
|
+
removeUser: this.createEvent<{ user: string; tenant: string; }>(EventNames.RemoveUserFromTenant).subscribe,
|
|
99
|
+
userRemoved: this.createEvent<{ user: string; tenant: string; }>(EventNames.UserRemovedFromTenant).subscribe,
|
|
100
|
+
removeUserError: this.createEvent<{ user: string; tenant: string; }>(EventNames.UserRemovalFromTenantError).subscribe,
|
|
101
|
+
acceptInvite: this.createEvent<{ tenant: string; }>(EventNames.AcceptInvite).subscribe,
|
|
102
|
+
inviteAccepted: this.createEvent<{ user: string; tenant: string; }>(EventNames.InviteAccepted).subscribe,
|
|
103
|
+
acceptInviteError: this.createEvent<{ tenant: string; }>(EventNames.InviteAcceptError).subscribe,
|
|
104
|
+
updateInvite: this.createEvent<{ tenant: string; user: string; role: tenantRole; }>(EventNames.UpdateInvite).subscribe,
|
|
105
|
+
inviteUpdated: this.createEvent<{ tenant: string; user: string; role: tenantRole; }>(EventNames.InviteUpdated).subscribe,
|
|
106
|
+
inviteUpdateError: this.createEvent<{ tenant: string; user: string; role: tenantRole; }>(EventNames.InviteUpdateError).subscribe,
|
|
107
|
+
rejectInvite: this.createEvent<{ tenant: string; }>(EventNames.RejectInvite).subscribe,
|
|
108
|
+
inviteRejected: this.createEvent<{ user: string; tenant: string; }>(EventNames.InviteRejected).subscribe,
|
|
109
|
+
inviteRejectError: this.createEvent<{ tenant: string; }>(EventNames.InviteRejectError).subscribe,
|
|
110
|
+
createToken: this.createEvent<{ tenant: string; expiration: string; description: string }>(EventNames.CreateToken).subscribe,
|
|
111
|
+
tokenCreated: this.createEvent<{ tenant: string; token: string; expiration: string; description: string }>(EventNames.TokenCreated).subscribe,
|
|
112
|
+
tokenCreationError: this.createEvent<{ tenant: string; expiration: string; description: string }>(EventNames.TokenCreationError).subscribe,
|
|
113
|
+
deleteToken: this.createEvent<{ tenant: string; token: string }>(EventNames.DeleteToken).subscribe,
|
|
114
|
+
tokenDeleted: this.createEvent<{ tenant: string; token: string }>(EventNames.TokenDeleted).subscribe,
|
|
115
|
+
tokenDeletionError: this.createEvent<{ tenant: string; token: string }>(EventNames.TokenDeletionError).subscribe,
|
|
116
|
+
},
|
|
117
|
+
unsubscribe: {
|
|
118
|
+
creation: this.createEvent<Tenant>(EventNames.CreateTenant).unsubscribe,
|
|
119
|
+
created: this.createEvent<Tenant>(EventNames.TenantCreated).unsubscribe,
|
|
120
|
+
creationError: this.createEvent<Tenant>(EventNames.TenantCreationError).unsubscribe,
|
|
121
|
+
update: this.createEvent<Tenant>(EventNames.UpdateTenant).unsubscribe,
|
|
122
|
+
updated: this.createEvent<Tenant>(EventNames.TenantUpdated).unsubscribe,
|
|
123
|
+
updateError: this.createEvent<Tenant>(EventNames.TenantUpdateError).unsubscribe,
|
|
124
|
+
delete: this.createEvent<Tenant>(EventNames.DeleteTenant).unsubscribe,
|
|
125
|
+
deleted: this.createEvent<Tenant>(EventNames.TenantDeleted).unsubscribe,
|
|
126
|
+
deletionError: this.createEvent<Tenant>(EventNames.TenantDeletionError).unsubscribe,
|
|
127
|
+
createRegistry: this.createEvent<RegistryUpdatePayload>(EventNames.CreateRegistry).unsubscribe,
|
|
128
|
+
registryCreated: this.createEvent<RegistryUpdatePayload>(EventNames.RegistryCreated).unsubscribe,
|
|
129
|
+
registryCreationError: this.createEvent<RegistryUpdatePayload>(EventNames.RegistryCreationError).unsubscribe,
|
|
130
|
+
updateRegistry: this.createEvent<RegistryUpdatePayload>(EventNames.UpdateRegistry).unsubscribe,
|
|
131
|
+
registryUpdated: this.createEvent<RegistryUpdatePayload>(EventNames.RegistryUpdated).unsubscribe,
|
|
132
|
+
registryUpdateError: this.createEvent<RegistryUpdatePayload>(EventNames.RegistryUpdateError).unsubscribe,
|
|
133
|
+
deleteRegistry: this.createEvent<RegistryUpdatePayload>(EventNames.DeleteRegistry).unsubscribe,
|
|
134
|
+
registryDeleted: this.createEvent<RegistryUpdatePayload>(EventNames.RegistryDeleted).unsubscribe,
|
|
135
|
+
registryDeletionError: this.createEvent<RegistryUpdatePayload>(EventNames.RegistryDeletionError).unsubscribe,
|
|
136
|
+
inviteUser: this.createEvent<{ tenant: string; user: string; role: tenantRole; }>(EventNames.InviteUser).unsubscribe,
|
|
137
|
+
userInvited: this.createEvent<{tenant: string; user: string; role: tenantRole; }>(EventNames.UserInvited).unsubscribe,
|
|
138
|
+
inviteError: this.createEvent<{ tenant: string; user: string; role: tenantRole; }>(EventNames.UserInviteError).unsubscribe,
|
|
139
|
+
removeUser: this.createEvent<{ user: string; tenant: string; }>(EventNames.RemoveUserFromTenant).unsubscribe,
|
|
140
|
+
userRemoved: this.createEvent<{ user: string; tenant: string; }>(EventNames.UserRemovedFromTenant).unsubscribe,
|
|
141
|
+
removeUserError: this.createEvent<{ user: string; tenant: string; }>(EventNames.UserRemovalFromTenantError).unsubscribe,
|
|
142
|
+
acceptInvite: this.createEvent<{ tenant: string; }>(EventNames.AcceptInvite).unsubscribe,
|
|
143
|
+
inviteAccepted: this.createEvent<{ user: string; tenant: string; }>(EventNames.InviteAccepted).unsubscribe,
|
|
144
|
+
acceptInviteError: this.createEvent<{ tenant: string; }>(EventNames.InviteAcceptError).unsubscribe,
|
|
145
|
+
updateInvite: this.createEvent<{ tenant: string; user: string; role: tenantRole; }>(EventNames.UpdateInvite).unsubscribe,
|
|
146
|
+
inviteUpdated: this.createEvent<{ tenant: string; user: string; role: tenantRole; }>(EventNames.InviteUpdated).unsubscribe,
|
|
147
|
+
inviteUpdateError: this.createEvent<{ tenant: string; user: string; role: tenantRole; }>(EventNames.InviteUpdateError).unsubscribe,
|
|
148
|
+
rejectInvite: this.createEvent<{ tenant: string; }>(EventNames.RejectInvite).unsubscribe,
|
|
149
|
+
inviteRejected: this.createEvent<{ user: string; tenant: string; }>(EventNames.InviteRejected).unsubscribe,
|
|
150
|
+
inviteRejectError: this.createEvent<{ tenant: string; }>(EventNames.InviteRejectError).unsubscribe,
|
|
151
|
+
createToken: this.createEvent<{ tenant: string; expiration: string; description: string }>(EventNames.CreateToken).unsubscribe,
|
|
152
|
+
tokenCreated: this.createEvent<{ tenant: string; token: string; expiration: string; description: string }>(EventNames.TokenCreated).unsubscribe,
|
|
153
|
+
tokenCreationError: this.createEvent<{ tenant: string; expiration: string; description: string }>(EventNames.TokenCreationError).unsubscribe,
|
|
154
|
+
deleteToken: this.createEvent<{ tenant: string; token: string }>(EventNames.DeleteToken).unsubscribe,
|
|
155
|
+
tokenDeleted: this.createEvent<{ tenant: string; token: string }>(EventNames.TokenDeleted).unsubscribe,
|
|
156
|
+
tokenDeletionError: this.createEvent<{ tenant: string; token: string }>(EventNames.TokenDeletionError).unsubscribe,
|
|
157
|
+
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// * User
|
|
163
|
+
get user() {
|
|
164
|
+
return {
|
|
165
|
+
publish: {
|
|
166
|
+
creation: this.createEvent<User>(EventNames.CreateUser).publish,
|
|
167
|
+
created: this.createEvent<User>(EventNames.UserCreated).publish,
|
|
168
|
+
creationError: this.createEvent<User>(EventNames.UserCreationError).publish,
|
|
169
|
+
update: this.createEvent<User>(EventNames.UpdateUser).publish,
|
|
170
|
+
updated: this.createEvent<User>(EventNames.UserUpdated).publish,
|
|
171
|
+
updateError: this.createEvent<User>(EventNames.UserUpdateError).publish,
|
|
172
|
+
load: this.createEvent<User>(EventNames.LoadUser).publish,
|
|
173
|
+
loaded: this.createEvent<User>(EventNames.UserLoaded).publish,
|
|
174
|
+
loadError: this.createEvent<User>(EventNames.UserLoadError).publish,
|
|
175
|
+
delete: this.createEvent<User>(EventNames.DeleteUser).publish,
|
|
176
|
+
deleted: this.createEvent<User>(EventNames.UserDeleted).publish,
|
|
177
|
+
deletionError: this.createEvent<User>(EventNames.UserDeletionError).publish,
|
|
178
|
+
authError: this.createEvent<User>(EventNames.AuthError).publish,
|
|
179
|
+
},
|
|
180
|
+
subscribe: {
|
|
181
|
+
creation: this.createEvent<User>(EventNames.CreateUser).subscribe,
|
|
182
|
+
created: this.createEvent<User>(EventNames.UserCreated).subscribe,
|
|
183
|
+
creationError: this.createEvent<User>(EventNames.UserCreationError).subscribe,
|
|
184
|
+
update: this.createEvent<User>(EventNames.UpdateUser).subscribe,
|
|
185
|
+
updated: this.createEvent<User>(EventNames.UserUpdated).subscribe,
|
|
186
|
+
updateError: this.createEvent<User>(EventNames.UserUpdateError).subscribe,
|
|
187
|
+
load: this.createEvent<User>(EventNames.LoadUser).subscribe,
|
|
188
|
+
loaded: this.createEvent<User>(EventNames.UserLoaded).subscribe,
|
|
189
|
+
loadError: this.createEvent<User>(EventNames.UserLoadError).subscribe,
|
|
190
|
+
delete: this.createEvent<User>(EventNames.DeleteUser).subscribe,
|
|
191
|
+
deleted: this.createEvent<User>(EventNames.UserDeleted).subscribe,
|
|
192
|
+
deletionError: this.createEvent<User>(EventNames.UserDeletionError).subscribe,
|
|
193
|
+
authError: this.createEvent<User>(EventNames.AuthError).subscribe,
|
|
194
|
+
},
|
|
195
|
+
unsubscribe: {
|
|
196
|
+
creation: this.createEvent<User>(EventNames.CreateUser).unsubscribe,
|
|
197
|
+
created: this.createEvent<User>(EventNames.UserCreated).unsubscribe,
|
|
198
|
+
creationError: this.createEvent<User>(EventNames.UserCreationError).unsubscribe,
|
|
199
|
+
update: this.createEvent<User>(EventNames.UpdateUser).unsubscribe,
|
|
200
|
+
updated: this.createEvent<User>(EventNames.UserUpdated).unsubscribe,
|
|
201
|
+
updateError: this.createEvent<User>(EventNames.UserUpdateError).unsubscribe,
|
|
202
|
+
load: this.createEvent<User>(EventNames.LoadUser).unsubscribe,
|
|
203
|
+
loaded: this.createEvent<User>(EventNames.UserLoaded).unsubscribe,
|
|
204
|
+
loadError: this.createEvent<User>(EventNames.UserLoadError).unsubscribe,
|
|
205
|
+
delete: this.createEvent<User>(EventNames.DeleteUser).unsubscribe,
|
|
206
|
+
deleted: this.createEvent<User>(EventNames.UserDeleted).unsubscribe,
|
|
207
|
+
deletionError: this.createEvent<User>(EventNames.UserDeletionError).unsubscribe,
|
|
208
|
+
authError: this.createEvent<User>(EventNames.AuthError).unsubscribe,
|
|
209
|
+
},
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// * Account
|
|
214
|
+
get account() {
|
|
215
|
+
return {
|
|
216
|
+
publish: {
|
|
217
|
+
creation: this.createEvent<Account>(EventNames.CreateAccount).publish,
|
|
218
|
+
created: this.createEvent<Account>(EventNames.AccountCreated).publish,
|
|
219
|
+
creationError: this.createEvent<Account>(EventNames.AccountCreationError).publish,
|
|
220
|
+
update: this.createEvent<Account>(EventNames.UpdateAccount).publish,
|
|
221
|
+
updated: this.createEvent<Account>(EventNames.AccountUpdated).publish,
|
|
222
|
+
updateError: this.createEvent<Account>(EventNames.AccountUpdateError).publish,
|
|
223
|
+
delete: this.createEvent<Account>(EventNames.DeleteAccount).publish,
|
|
224
|
+
deleted: this.createEvent<Account>(EventNames.AccountDeleted).publish,
|
|
225
|
+
deletionError: this.createEvent<Account>(EventNames.AccountDeletionError).publish,
|
|
226
|
+
clean: this.createEvent<Account>(EventNames.CleanAccount).publish,
|
|
227
|
+
cleaned: this.createEvent<Account>(EventNames.AccountCleaned).publish,
|
|
228
|
+
cleanError: this.createEvent<Account>(EventNames.AccountCleanError).publish,
|
|
229
|
+
},
|
|
230
|
+
subscribe: {
|
|
231
|
+
creation: this.createEvent<Account>(EventNames.CreateAccount).subscribe,
|
|
232
|
+
created: this.createEvent<Account>(EventNames.AccountCreated).subscribe,
|
|
233
|
+
creationError: this.createEvent<Account>(EventNames.AccountCreationError).subscribe,
|
|
234
|
+
update: this.createEvent<Account>(EventNames.UpdateAccount).subscribe,
|
|
235
|
+
updated: this.createEvent<Account>(EventNames.AccountUpdated).subscribe,
|
|
236
|
+
updateError: this.createEvent<Account>(EventNames.AccountUpdateError).subscribe,
|
|
237
|
+
delete: this.createEvent<Account>(EventNames.DeleteAccount).subscribe,
|
|
238
|
+
deleted: this.createEvent<Account>(EventNames.AccountDeleted).subscribe,
|
|
239
|
+
deletionError: this.createEvent<Account>(EventNames.AccountDeletionError).subscribe,
|
|
240
|
+
clean: this.createEvent<Account>(EventNames.CleanAccount).subscribe,
|
|
241
|
+
cleaned: this.createEvent<Account>(EventNames.AccountCleaned).subscribe,
|
|
242
|
+
cleanError: this.createEvent<Account>(EventNames.AccountCleanError).subscribe,
|
|
243
|
+
},
|
|
244
|
+
unsubscribe: {
|
|
245
|
+
creation: this.createEvent<Account>(EventNames.CreateAccount).unsubscribe,
|
|
246
|
+
created: this.createEvent<Account>(EventNames.AccountCreated).unsubscribe,
|
|
247
|
+
creationError: this.createEvent<Account>(EventNames.AccountCreationError).unsubscribe,
|
|
248
|
+
update: this.createEvent<Account>(EventNames.UpdateAccount).unsubscribe,
|
|
249
|
+
updated: this.createEvent<Account>(EventNames.AccountUpdated).unsubscribe,
|
|
250
|
+
updateError: this.createEvent<Account>(EventNames.AccountUpdateError).unsubscribe,
|
|
251
|
+
delete: this.createEvent<Account>(EventNames.DeleteAccount).unsubscribe,
|
|
252
|
+
deleted: this.createEvent<Account>(EventNames.AccountDeleted).unsubscribe,
|
|
253
|
+
deletionError: this.createEvent<Account>(EventNames.AccountDeletionError).unsubscribe,
|
|
254
|
+
clean: this.createEvent<Account>(EventNames.CleanAccount).unsubscribe,
|
|
255
|
+
cleaned: this.createEvent<Account>(EventNames.AccountCleaned).unsubscribe,
|
|
256
|
+
cleanError: this.createEvent<Account>(EventNames.AccountCleanError).unsubscribe,
|
|
257
|
+
},
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// * Environment
|
|
262
|
+
get environment() {
|
|
263
|
+
return {
|
|
264
|
+
publish: {
|
|
265
|
+
creation: this.createEvent<Environment>(EventNames.CreateEnvironment).publish,
|
|
266
|
+
created: this.createEvent<Environment>(EventNames.EnvironmentCreated).publish,
|
|
267
|
+
creationError: this.createEvent<Environment>(EventNames.EnvironmentCreationError).publish,
|
|
268
|
+
update: this.createEvent<Environment>(EventNames.UpdateEnvironment).publish,
|
|
269
|
+
updated: this.createEvent<Environment>(EventNames.EnvironmentUpdated).publish,
|
|
270
|
+
updateError: this.createEvent<Environment>(EventNames.EnvironmentUpdateError).publish,
|
|
271
|
+
delete: this.createEvent<Environment>(EventNames.DeleteEnvironment).publish,
|
|
272
|
+
deleted: this.createEvent<Environment>(EventNames.EnvironmentDeleted).publish,
|
|
273
|
+
deletionError: this.createEvent<Environment>(EventNames.EvironmentDeletionError).publish,
|
|
274
|
+
clean: this.createEvent<Environment>(EventNames.CleanEnvironment).publish,
|
|
275
|
+
cleaned: this.createEvent<Environment>(EventNames.EnvironmentCleaned).publish,
|
|
276
|
+
cleanError: this.createEvent<Environment>(EventNames.EnvironmentCleanError).publish,
|
|
277
|
+
scale: this.createEvent<Environment>(EventNames.ScaleEnvironment).publish,
|
|
278
|
+
scaled: this.createEvent<Environment>(EventNames.EnvironmentScaled).publish,
|
|
279
|
+
scaleError: this.createEvent<Environment>(EventNames.EnvironmentScaleError).publish,
|
|
280
|
+
},
|
|
281
|
+
subscribe: {
|
|
282
|
+
creation: this.createEvent<Environment>(EventNames.CreateEnvironment).subscribe,
|
|
283
|
+
created: this.createEvent<Environment>(EventNames.EnvironmentCreated).subscribe,
|
|
284
|
+
creationError: this.createEvent<Environment>(EventNames.EnvironmentCreationError).subscribe,
|
|
285
|
+
update: this.createEvent<Environment>(EventNames.UpdateEnvironment).subscribe,
|
|
286
|
+
updated: this.createEvent<Environment>(EventNames.EnvironmentUpdated).subscribe,
|
|
287
|
+
updateError: this.createEvent<Environment>(EventNames.EnvironmentUpdateError).subscribe,
|
|
288
|
+
delete: this.createEvent<Environment>(EventNames.DeleteEnvironment).subscribe,
|
|
289
|
+
deleted: this.createEvent<Environment>(EventNames.EnvironmentDeleted).subscribe,
|
|
290
|
+
deletionError: this.createEvent<Environment>(EventNames.EvironmentDeletionError).subscribe,
|
|
291
|
+
clean: this.createEvent<Environment>(EventNames.CleanEnvironment).subscribe,
|
|
292
|
+
cleaned: this.createEvent<Environment>(EventNames.EnvironmentCleaned).subscribe,
|
|
293
|
+
cleanError: this.createEvent<Environment>(EventNames.EnvironmentCleanError).subscribe,
|
|
294
|
+
scale: this.createEvent<Environment>(EventNames.ScaleEnvironment).subscribe,
|
|
295
|
+
scaled: this.createEvent<Environment>(EventNames.EnvironmentScaled).subscribe,
|
|
296
|
+
scaleError: this.createEvent<Environment>(EventNames.EnvironmentScaleError).subscribe,
|
|
297
|
+
},
|
|
298
|
+
unsubscribe: {
|
|
299
|
+
creation: this.createEvent<Environment>(EventNames.CreateEnvironment).unsubscribe,
|
|
300
|
+
created: this.createEvent<Environment>(EventNames.EnvironmentCreated).unsubscribe,
|
|
301
|
+
creationError: this.createEvent<Environment>(EventNames.EnvironmentCreationError).unsubscribe,
|
|
302
|
+
update: this.createEvent<Environment>(EventNames.UpdateEnvironment).unsubscribe,
|
|
303
|
+
updated: this.createEvent<Environment>(EventNames.EnvironmentUpdated).unsubscribe,
|
|
304
|
+
updateError: this.createEvent<Environment>(EventNames.EnvironmentUpdateError).unsubscribe,
|
|
305
|
+
delete: this.createEvent<Environment>(EventNames.DeleteEnvironment).unsubscribe,
|
|
306
|
+
deleted: this.createEvent<Environment>(EventNames.EnvironmentDeleted).unsubscribe,
|
|
307
|
+
deletionError: this.createEvent<Environment>(EventNames.EvironmentDeletionError).unsubscribe,
|
|
308
|
+
clean: this.createEvent<Environment>(EventNames.CleanEnvironment).unsubscribe,
|
|
309
|
+
cleaned: this.createEvent<Environment>(EventNames.EnvironmentCleaned).unsubscribe,
|
|
310
|
+
cleanError: this.createEvent<Environment>(EventNames.EnvironmentCleanError).unsubscribe,
|
|
311
|
+
scale: this.createEvent<Environment>(EventNames.ScaleEnvironment).unsubscribe,
|
|
312
|
+
scaled: this.createEvent<Environment>(EventNames.EnvironmentScaled).unsubscribe,
|
|
313
|
+
scaleError: this.createEvent<Environment>(EventNames.EnvironmentScaleError).unsubscribe,
|
|
314
|
+
},
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
// * Service
|
|
319
|
+
get service() {
|
|
320
|
+
return {
|
|
321
|
+
publish: {
|
|
322
|
+
deploy: this.createEvent<Service>(EventNames.DeployService).publish,
|
|
323
|
+
deployed: this.createEvent<Service>(EventNames.ServiceDeployed).publish,
|
|
324
|
+
deploymentError: this.createEvent<Service>(EventNames.ServiceDeploymentError).publish,
|
|
325
|
+
update: this.createEvent<Service>(EventNames.UpdateService).publish,
|
|
326
|
+
updated: this.createEvent<Service>(EventNames.ServiceUpdated).publish,
|
|
327
|
+
updateError: this.createEvent<Service>(EventNames.ServiceUpdateError).publish,
|
|
328
|
+
delete: this.createEvent<Service>(EventNames.DeleteService).publish,
|
|
329
|
+
deleted: this.createEvent<Service>(EventNames.ServiceDeleted).publish,
|
|
330
|
+
deletionError: this.createEvent<Service>(EventNames.ServiceDeletionError).publish,
|
|
331
|
+
requestLogs: this.createEvent<Service>(EventNames.RequestLogs).publish,
|
|
332
|
+
restart: this.createEvent<Service>(EventNames.RestartService).publish,
|
|
333
|
+
restarted: this.createEvent<Service>(EventNames.ServiceRestarted).publish,
|
|
334
|
+
restartError: this.createEvent<Service>(EventNames.ServiceRestartError).publish,
|
|
335
|
+
requestRevisionData : this.createEvent<Service>(EventNames.RequestRevisionData).publish,
|
|
336
|
+
updateServiceLinks : this.createEvent<Link>(EventNames.updateServiceLinks).publish,
|
|
337
|
+
changeRevision: this.createEvent<Service>(EventNames.ChangeRevision).publish,
|
|
338
|
+
revisionChanged: this.createEvent<Service>(EventNames.RevisionChanged).publish,
|
|
339
|
+
revisionChangeError: this.createEvent<Service>(EventNames.RevisionChangeError).publish
|
|
340
|
+
},
|
|
341
|
+
subscribe: {
|
|
342
|
+
deploy: this.createEvent<Service>(EventNames.DeployService).subscribe,
|
|
343
|
+
deployed: this.createEvent<Service>(EventNames.ServiceDeployed).subscribe,
|
|
344
|
+
deploymentError: this.createEvent<Service>(EventNames.ServiceDeploymentError).subscribe,
|
|
345
|
+
update: this.createEvent<Service>(EventNames.UpdateService).subscribe,
|
|
346
|
+
updated: this.createEvent<Service>(EventNames.ServiceUpdated).subscribe,
|
|
347
|
+
updateError: this.createEvent<Service>(EventNames.ServiceUpdateError).subscribe,
|
|
348
|
+
delete: this.createEvent<Service>(EventNames.DeleteService).subscribe,
|
|
349
|
+
deleted: this.createEvent<Service>(EventNames.ServiceDeleted).subscribe,
|
|
350
|
+
deletionError: this.createEvent<Service>(EventNames.ServiceDeletionError).subscribe,
|
|
351
|
+
requestLogs: this.createEvent<Service>(EventNames.RequestLogs).subscribe,
|
|
352
|
+
restart: this.createEvent<Service>(EventNames.RestartService).subscribe,
|
|
353
|
+
restarted: this.createEvent<Service>(EventNames.ServiceRestarted).subscribe,
|
|
354
|
+
restartError: this.createEvent<Service>(EventNames.ServiceRestartError).subscribe,
|
|
355
|
+
requestRevisionData : this.createEvent<Service>(EventNames.RequestRevisionData).subscribe,
|
|
356
|
+
updateServiceLinks : this.createEvent<Link>(EventNames.updateServiceLinks).subscribe,
|
|
357
|
+
changeRevision: this.createEvent<Service>(EventNames.ChangeRevision).subscribe,
|
|
358
|
+
revisionChanged: this.createEvent<Service>(EventNames.RevisionChanged).subscribe,
|
|
359
|
+
revisionChangeError: this.createEvent<Service>(EventNames.RevisionChangeError).subscribe
|
|
360
|
+
},
|
|
361
|
+
unsubscribe: {
|
|
362
|
+
deploy: this.createEvent<Service>(EventNames.DeployService).unsubscribe,
|
|
363
|
+
deployed: this.createEvent<Service>(EventNames.ServiceDeployed).unsubscribe,
|
|
364
|
+
deploymentError: this.createEvent<Service>(EventNames.ServiceDeploymentError).unsubscribe,
|
|
365
|
+
update: this.createEvent<Service>(EventNames.UpdateService).unsubscribe,
|
|
366
|
+
updated: this.createEvent<Service>(EventNames.ServiceUpdated).unsubscribe,
|
|
367
|
+
updateError: this.createEvent<Service>(EventNames.ServiceUpdateError).unsubscribe,
|
|
368
|
+
delete: this.createEvent<Service>(EventNames.DeleteService).unsubscribe,
|
|
369
|
+
deleted: this.createEvent<Service>(EventNames.ServiceDeleted).unsubscribe,
|
|
370
|
+
deletionError: this.createEvent<Service>(EventNames.ServiceDeletionError).unsubscribe,
|
|
371
|
+
requestLogs: this.createEvent<Service>(EventNames.RequestLogs).unsubscribe,
|
|
372
|
+
restart: this.createEvent<Service>(EventNames.RestartService).unsubscribe,
|
|
373
|
+
restarted: this.createEvent<Service>(EventNames.ServiceRestarted).unsubscribe,
|
|
374
|
+
restartError: this.createEvent<Service>(EventNames.ServiceRestartError).unsubscribe,
|
|
375
|
+
requestRevisionData : this.createEvent<Service>(EventNames.RequestRevisionData).unsubscribe,
|
|
376
|
+
updateServiceLinks : this.createEvent<Link>(EventNames.updateServiceLinks).unsubscribe,
|
|
377
|
+
changeRevision: this.createEvent<Service>(EventNames.ChangeRevision).unsubscribe,
|
|
378
|
+
revisionChanged: this.createEvent<Service>(EventNames.RevisionChanged).unsubscribe,
|
|
379
|
+
revisionChangeError: this.createEvent<Service>(EventNames.RevisionChangeError).unsubscribe
|
|
380
|
+
},
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
// * Marketplace
|
|
385
|
+
get marketplace() {
|
|
386
|
+
return {
|
|
387
|
+
publish: {
|
|
388
|
+
deployItem: this.createEvent<MarketplaceService>(EventNames.DeployMarketplaceItem).publish,
|
|
389
|
+
itemDeployed: this.createEvent<Service>(EventNames.MarketplaceItemDeployed).publish,
|
|
390
|
+
deploymentError: this.createEvent<Service>(EventNames.MarketplaceItemDeploymentError).publish,
|
|
391
|
+
updateItem: this.createEvent<Service>(EventNames.UpdateMarketplaceItem).publish,
|
|
392
|
+
itemUpdated: this.createEvent<Service>(EventNames.MarketplaceItemUpdated).publish,
|
|
393
|
+
updateError: this.createEvent<Service>(EventNames.MarketplaceItemUpdateError).publish,
|
|
394
|
+
deleteItem: this.createEvent<Service>(EventNames.DeleteMarketplaceItem).publish,
|
|
395
|
+
itemDeleted: this.createEvent<Service>(EventNames.MarketplaceItemDeleted).publish,
|
|
396
|
+
deletionError: this.createEvent<Service>(EventNames.MarketplaceItemDeletionError).publish,
|
|
397
|
+
loadItems: this.createEvent<string[]>(EventNames.LoadMarketplaceItems).publish,
|
|
398
|
+
itemsLoaded: this.createEvent<MarketplaceItem[]>(EventNames.MarketplaceItemsLoaded).publish,
|
|
399
|
+
},
|
|
400
|
+
subscribe: {
|
|
401
|
+
deployItem: this.createEvent<MarketplaceService>(EventNames.DeployMarketplaceItem).subscribe,
|
|
402
|
+
itemDeployed: this.createEvent<Service>(EventNames.MarketplaceItemDeployed).subscribe,
|
|
403
|
+
deploymentError: this.createEvent<Service>(EventNames.MarketplaceItemDeploymentError).subscribe,
|
|
404
|
+
updateItem: this.createEvent<Service>(EventNames.UpdateMarketplaceItem).subscribe,
|
|
405
|
+
itemUpdated: this.createEvent<Service>(EventNames.MarketplaceItemUpdated).subscribe,
|
|
406
|
+
updateError: this.createEvent<Service>(EventNames.MarketplaceItemUpdateError).subscribe,
|
|
407
|
+
deleteItem: this.createEvent<Service>(EventNames.DeleteMarketplaceItem).subscribe,
|
|
408
|
+
itemDeleted: this.createEvent<Service>(EventNames.MarketplaceItemDeleted).subscribe,
|
|
409
|
+
deletionError: this.createEvent<Service>(EventNames.MarketplaceItemDeletionError).subscribe,
|
|
410
|
+
loadItems: this.createEvent<string[]>(EventNames.LoadMarketplaceItems).subscribe,
|
|
411
|
+
itemsLoaded: this.createEvent<MarketplaceItem[]>(EventNames.MarketplaceItemsLoaded).subscribe,
|
|
412
|
+
},
|
|
413
|
+
unsubscribe: {
|
|
414
|
+
deployItem: this.createEvent<MarketplaceService>(EventNames.DeployMarketplaceItem).unsubscribe,
|
|
415
|
+
itemDeployed: this.createEvent<Service>(EventNames.MarketplaceItemDeployed).unsubscribe,
|
|
416
|
+
deploymentError: this.createEvent<Service>(EventNames.MarketplaceItemDeploymentError).unsubscribe,
|
|
417
|
+
updateItem: this.createEvent<Service>(EventNames.UpdateMarketplaceItem).unsubscribe,
|
|
418
|
+
itemUpdated: this.createEvent<Service>(EventNames.MarketplaceItemUpdated).unsubscribe,
|
|
419
|
+
updateError: this.createEvent<Service>(EventNames.MarketplaceItemUpdateError).unsubscribe,
|
|
420
|
+
deleteItem: this.createEvent<Service>(EventNames.DeleteMarketplaceItem).unsubscribe,
|
|
421
|
+
itemDeleted: this.createEvent<Service>(EventNames.MarketplaceItemDeleted).unsubscribe,
|
|
422
|
+
deletionError: this.createEvent<Service>(EventNames.MarketplaceItemDeletionError).unsubscribe,
|
|
423
|
+
loadItems: this.createEvent<string[]>(EventNames.LoadMarketplaceItems).unsubscribe,
|
|
424
|
+
itemsLoaded: this.createEvent<MarketplaceItem[]>(EventNames.MarketplaceItemsLoaded).unsubscribe,
|
|
425
|
+
},
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
// * Resource
|
|
430
|
+
get resource() {
|
|
431
|
+
return {
|
|
432
|
+
publish: {
|
|
433
|
+
creation: this.createEvent<Resource>(EventNames.CreateResource).publish,
|
|
434
|
+
created: this.createEvent<Resource>(EventNames.ResourceCreated).publish,
|
|
435
|
+
creationError: this.createEvent<Resource>(EventNames.ResourceCreationError).publish,
|
|
436
|
+
update: this.createEvent<Resource>(EventNames.UpdateResource).publish,
|
|
437
|
+
updated: this.createEvent<Resource>(EventNames.ResourceUpdated).publish,
|
|
438
|
+
updateError: this.createEvent<Resource>(EventNames.ResourceUpdateError).publish,
|
|
439
|
+
delete: this.createEvent<Resource>(EventNames.DeleteResource).publish,
|
|
440
|
+
deleted: this.createEvent<Resource>(EventNames.ResourceDeleted).publish,
|
|
441
|
+
deletionError: this.createEvent<Resource>(EventNames.ResourceDeletionError).publish,
|
|
442
|
+
},
|
|
443
|
+
subscribe: {
|
|
444
|
+
creation: this.createEvent<Resource>(EventNames.CreateResource).subscribe,
|
|
445
|
+
created: this.createEvent<Resource>(EventNames.ResourceCreated).subscribe,
|
|
446
|
+
creationError: this.createEvent<Resource>(EventNames.ResourceCreationError).subscribe,
|
|
447
|
+
update: this.createEvent<Resource>(EventNames.UpdateResource).subscribe,
|
|
448
|
+
updated: this.createEvent<Resource>(EventNames.ResourceUpdated).subscribe,
|
|
449
|
+
updateError: this.createEvent<Resource>(EventNames.ResourceUpdateError).subscribe,
|
|
450
|
+
delete: this.createEvent<Resource>(EventNames.DeleteResource).subscribe,
|
|
451
|
+
deleted: this.createEvent<Resource>(EventNames.ResourceDeleted).subscribe,
|
|
452
|
+
deletionError: this.createEvent<Resource>(EventNames.ResourceDeletionError).subscribe,
|
|
453
|
+
},
|
|
454
|
+
unsubscribe: {
|
|
455
|
+
creation: this.createEvent<Resource>(EventNames.CreateResource).unsubscribe,
|
|
456
|
+
created: this.createEvent<Resource>(EventNames.ResourceCreated).unsubscribe,
|
|
457
|
+
creationError: this.createEvent<Resource>(EventNames.ResourceCreationError).unsubscribe,
|
|
458
|
+
update: this.createEvent<Resource>(EventNames.UpdateResource).unsubscribe,
|
|
459
|
+
updated: this.createEvent<Resource>(EventNames.ResourceUpdated).unsubscribe,
|
|
460
|
+
updateError: this.createEvent<Resource>(EventNames.ResourceUpdateError).unsubscribe,
|
|
461
|
+
delete: this.createEvent<Resource>(EventNames.DeleteResource).unsubscribe,
|
|
462
|
+
deleted: this.createEvent<Resource>(EventNames.ResourceDeleted).unsubscribe,
|
|
463
|
+
deletionError: this.createEvent<Resource>(EventNames.ResourceDeletionError).unsubscribe,
|
|
464
|
+
},
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
// * Plan (payload tipo string)
|
|
469
|
+
get plan() {
|
|
470
|
+
return {
|
|
471
|
+
publish: {
|
|
472
|
+
upgrade: this.createEvent<string>(EventNames.UpdatePlan).publish,
|
|
473
|
+
upgraded: this.createEvent<string>(EventNames.PlanUpdated).publish,
|
|
474
|
+
upgradeError: this.createEvent<string>(EventNames.PlanUpdateError).publish,
|
|
475
|
+
downgrade: this.createEvent<string>(EventNames.DowngradePlan).publish,
|
|
476
|
+
downgraded: this.createEvent<string>(EventNames.PlanDowngraded).publish,
|
|
477
|
+
downgradeError: this.createEvent<string>(EventNames.PlanDowngradeError).publish,
|
|
478
|
+
},
|
|
479
|
+
subscribe: {
|
|
480
|
+
upgrade: this.createEvent<string>(EventNames.UpdatePlan).subscribe,
|
|
481
|
+
upgraded: this.createEvent<string>(EventNames.PlanUpdated).subscribe,
|
|
482
|
+
upgradeError: this.createEvent<string>(EventNames.PlanUpdateError).subscribe,
|
|
483
|
+
downgrade: this.createEvent<string>(EventNames.DowngradePlan).subscribe,
|
|
484
|
+
downgraded: this.createEvent<string>(EventNames.PlanDowngraded).subscribe,
|
|
485
|
+
downgradeError: this.createEvent<string>(EventNames.PlanDowngradeError).subscribe,
|
|
486
|
+
},
|
|
487
|
+
unsubscribe: {
|
|
488
|
+
upgrade: this.createEvent<string>(EventNames.UpdatePlan).unsubscribe,
|
|
489
|
+
upgraded: this.createEvent<string>(EventNames.PlanUpdated).unsubscribe,
|
|
490
|
+
upgradeError: this.createEvent<string>(EventNames.PlanUpdateError).unsubscribe,
|
|
491
|
+
downgrade: this.createEvent<string>(EventNames.DowngradePlan).unsubscribe,
|
|
492
|
+
downgraded: this.createEvent<string>(EventNames.PlanDowngraded).unsubscribe,
|
|
493
|
+
downgradeError: this.createEvent<string>(EventNames.PlanDowngradeError).unsubscribe,
|
|
494
|
+
},
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
// * Organization
|
|
499
|
+
get organization() {
|
|
500
|
+
return {
|
|
501
|
+
publish: {
|
|
502
|
+
creation: this.createEvent<Organization>(EventNames.CreateOrganization).publish,
|
|
503
|
+
created: this.createEvent<Organization>(EventNames.OrganizationCreated).publish,
|
|
504
|
+
creationError: this.createEvent<Organization>(EventNames.OrganizationCreationError).publish,
|
|
505
|
+
update: this.createEvent<Organization>(EventNames.UpdateOrganization).publish,
|
|
506
|
+
updated: this.createEvent<Organization>(EventNames.OrganizationUpdated).publish,
|
|
507
|
+
updateError: this.createEvent<Organization>(EventNames.OrganizationUpdateError).publish,
|
|
508
|
+
delete: this.createEvent<Organization>(EventNames.DeleteOrganization).publish,
|
|
509
|
+
deleted: this.createEvent<Organization>(EventNames.OrganizationDeleted).publish,
|
|
510
|
+
deletionError: this.createEvent<Organization>(EventNames.OrganizationDeletionError).publish,
|
|
511
|
+
},
|
|
512
|
+
subscribe: {
|
|
513
|
+
creation: this.createEvent<Organization>(EventNames.CreateOrganization).subscribe,
|
|
514
|
+
created: this.createEvent<Organization>(EventNames.OrganizationCreated).subscribe,
|
|
515
|
+
creationError: this.createEvent<Organization>(EventNames.OrganizationCreationError).subscribe,
|
|
516
|
+
update: this.createEvent<Organization>(EventNames.UpdateOrganization).subscribe,
|
|
517
|
+
updated: this.createEvent<Organization>(EventNames.OrganizationUpdated).subscribe,
|
|
518
|
+
updateError: this.createEvent<Organization>(EventNames.OrganizationUpdateError).subscribe,
|
|
519
|
+
delete: this.createEvent<Organization>(EventNames.DeleteOrganization).subscribe,
|
|
520
|
+
deleted: this.createEvent<Organization>(EventNames.OrganizationDeleted).subscribe,
|
|
521
|
+
deletionError: this.createEvent<Organization>(EventNames.OrganizationDeletionError).subscribe,
|
|
522
|
+
},
|
|
523
|
+
unsubscribe: {
|
|
524
|
+
creation: this.createEvent<Organization>(EventNames.CreateOrganization).unsubscribe,
|
|
525
|
+
created: this.createEvent<Organization>(EventNames.OrganizationCreated).unsubscribe,
|
|
526
|
+
creationError: this.createEvent<Organization>(EventNames.OrganizationCreationError).unsubscribe,
|
|
527
|
+
update: this.createEvent<Organization>(EventNames.UpdateOrganization).unsubscribe,
|
|
528
|
+
updated: this.createEvent<Organization>(EventNames.OrganizationUpdated).unsubscribe,
|
|
529
|
+
updateError: this.createEvent<Organization>(EventNames.OrganizationUpdateError).unsubscribe,
|
|
530
|
+
delete: this.createEvent<Organization>(EventNames.DeleteOrganization).unsubscribe,
|
|
531
|
+
deleted: this.createEvent<Organization>(EventNames.OrganizationDeleted).unsubscribe,
|
|
532
|
+
deletionError: this.createEvent<Organization>(EventNames.OrganizationDeletionError).unsubscribe,
|
|
533
|
+
},
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
// * Notification
|
|
537
|
+
get notification(){
|
|
538
|
+
return{
|
|
539
|
+
publish: {
|
|
540
|
+
creation: this.createEvent<Notification>(EventNames.CreateNotification).publish,
|
|
541
|
+
deletion: this.createEvent<Notification>(EventNames.DeleteNotification).publish,
|
|
542
|
+
read: this.createEvent<Notification>(EventNames.NotificationRead).publish
|
|
543
|
+
},
|
|
544
|
+
subscribe: {
|
|
545
|
+
creation: this.createEvent<Notification>(EventNames.CreateNotification).subscribe,
|
|
546
|
+
deletion: this.createEvent<Notification>(EventNames.DeleteNotification).subscribe,
|
|
547
|
+
read: this.createEvent<Notification>(EventNames.NotificationRead).subscribe
|
|
548
|
+
},
|
|
549
|
+
unsubscribe: {
|
|
550
|
+
creation: this.createEvent<Notification>(EventNames.CreateNotification).unsubscribe,
|
|
551
|
+
deletion: this.createEvent<Notification>(EventNames.DeleteNotification).unsubscribe,
|
|
552
|
+
read: this.createEvent<Notification>(EventNames.NotificationRead).unsubscribe
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
get planProviders() {
|
|
557
|
+
return {
|
|
558
|
+
publish: {
|
|
559
|
+
loadPlans: this.createEvent<void>(EventNames.LoadPlanProviders).publish,
|
|
560
|
+
plansLoaded: this.createEvent<PlanProvider[]>(EventNames.PlanProvidersLoaded).publish,
|
|
561
|
+
loadError: this.createEvent<void>(EventNames.PlanProvidersLoadError).publish
|
|
562
|
+
},
|
|
563
|
+
subscribe: {
|
|
564
|
+
loadPlans: this.createEvent<void>(EventNames.LoadPlanProviders).subscribe,
|
|
565
|
+
plansLoaded: this.createEvent<PlanProvider[]>(EventNames.PlanProvidersLoaded).subscribe,
|
|
566
|
+
loadError: this.createEvent<void>(EventNames.PlanProvidersLoadError).subscribe
|
|
567
|
+
},
|
|
568
|
+
unsubscribe: {
|
|
569
|
+
loadPlans: this.createEvent<void>(EventNames.LoadPlanProviders).unsubscribe,
|
|
570
|
+
plansLoaded: this.createEvent<PlanProvider[]>(EventNames.PlanProvidersLoaded).unsubscribe,
|
|
571
|
+
loadError: this.createEvent<void>(EventNames.PlanProvidersLoadError).unsubscribe
|
|
572
|
+
},
|
|
573
|
+
};
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
export default EventHelper;
|