@kumori/aurora-interfaces 1.0.13 → 1.0.15

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.
@@ -0,0 +1,41 @@
1
+ export enum AccountStatus {
2
+ /** Waiting for credentials validation (initial / transient state) */
3
+ PENDING = "pending",
4
+
5
+ /** Backend confirmed credentials are valid */
6
+ ACTIVE = "active",
7
+
8
+ /** Backend rejected credentials (strategy-service path) */
9
+ INVALID_CREDENTIALS_SNAKE = "invalid_credentials",
10
+
11
+ /** Backend rejected credentials (backend-event path) */
12
+ INVALID_CREDENTIALS = "InvalidCredentials",
13
+
14
+ /** Account is currently being deleted */
15
+ DELETING = "deleting",
16
+
17
+ /** Generic backend error */
18
+ ERROR = "error",
19
+
20
+ /** Generic backend failure */
21
+ FAILED = "failed",
22
+
23
+ /** waitForAccountStatus gave up after MAX_WAIT_MS */
24
+ TIMEOUT = "timeout",
25
+ }
26
+
27
+ export const ACCOUNT_STATUS_NON_ERROR: ReadonlySet<string> = new Set([
28
+ AccountStatus.PENDING,
29
+ AccountStatus.ACTIVE,
30
+ AccountStatus.DELETING,
31
+ ]);
32
+
33
+ export function isAccountError(status: string): boolean {
34
+ return (
35
+ status === AccountStatus.INVALID_CREDENTIALS ||
36
+ status === AccountStatus.INVALID_CREDENTIALS_SNAKE ||
37
+ status === AccountStatus.ERROR ||
38
+ status === AccountStatus.FAILED ||
39
+ status === AccountStatus.TIMEOUT
40
+ );
41
+ }
@@ -0,0 +1,536 @@
1
+ export type NotificationMessage = {
2
+ subtype: string;
3
+ title: string;
4
+ description: string;
5
+ };
6
+
7
+ export const errors = {
8
+ tenant: {
9
+ created: {
10
+ subtype: "tenant-created",
11
+ title: "Tenant Created!",
12
+ description: "The tenant {name} has been successfully created.",
13
+ },
14
+ creationError: {
15
+ subtype: "tenant-creation-error",
16
+ title: "Error creating tenant",
17
+ description:
18
+ "There was an error creating the tenant {name}. Please try again.",
19
+ },
20
+ deleting: {
21
+ subtype: "tenant-deleting",
22
+ title: "Deleting Tenant",
23
+ description:
24
+ "The tenant {name} is being deleted. This process may take a few minutes.",
25
+ },
26
+ deleted: {
27
+ subtype: "tenant-deleted",
28
+ title: "Tenant Deleted",
29
+ description: "The tenant {name} has been successfully deleted.",
30
+ },
31
+ deletionError: {
32
+ subtype: "tenant-deletion-error",
33
+ title: "Error deleting tenant",
34
+ description:
35
+ "There was an error deleting the tenant {name}. Please try again.",
36
+ },
37
+ updated: {
38
+ subtype: "tenant-updated",
39
+ title: "Tenant Updated",
40
+ description: "The tenant {name} has been successfully updated.",
41
+ },
42
+ updateError: {
43
+ subtype: "tenant-update-error",
44
+ title: "Error updating tenant",
45
+ description:
46
+ "There was an error updating the tenant {name}. Please try again.",
47
+ },
48
+ userInvited: {
49
+ subtype: "tenant-user-invited",
50
+ title: "User Invited to Tenant",
51
+ description: "{email} has been invited to tenant {tenant}{role}.",
52
+ },
53
+ userInviteError: {
54
+ subtype: "tenant-user-invite-error",
55
+ title: "Error inviting user to tenant",
56
+ description:
57
+ "There was an error inviting {email} to tenant {tenant}. Please try again.",
58
+ },
59
+ userRemoved: {
60
+ subtype: "tenant-user-removed",
61
+ title: "User Removed from Tenant",
62
+ description: "{user} has been removed from tenant {tenant}.",
63
+ },
64
+ userRemovedError: {
65
+ subtype: "tenant-user-removed-error",
66
+ title: "Error removing user from tenant",
67
+ description:
68
+ "There was an error removing {user} from tenant {tenant}. Please try again.",
69
+ },
70
+ accessRevoked: {
71
+ subtype: "user-removed-from-tenant",
72
+ title: "Access Revoked",
73
+ description: "You no longer have access to tenant {name}.",
74
+ },
75
+ roleChanged: {
76
+ subtype: "tenant-role-changed",
77
+ title: "Role Updated",
78
+ description:
79
+ "Your role in tenant {tenant} has been changed from {oldRole} to {newRole}.",
80
+ },
81
+ roleUpdated: {
82
+ subtype: "user-role-updated",
83
+ title: "User Role Updated",
84
+ description: "{user} role has been updated in tenant {tenant}.",
85
+ },
86
+ roleUpdateError: {
87
+ subtype: "user-role-updated-error",
88
+ title: "Error updating user role",
89
+ description:
90
+ "There was an error updating {user} role in tenant {tenant}. Please try again.",
91
+ },
92
+ inviteAccepted: {
93
+ subtype: "tenant-invite-accepted",
94
+ title: "Invite Accepted",
95
+ description: "The invite to tenant {name} has been accepted.",
96
+ },
97
+ inviteAcceptError: {
98
+ subtype: "tenant-invite-accepted-error",
99
+ title: "Error accepting invite",
100
+ description:
101
+ "There was an error accepting the invite to tenant {name}. Please try again.",
102
+ },
103
+ inviteRejected: {
104
+ subtype: "tenant-invite-rejected",
105
+ title: "Invite Declined",
106
+ description: "The invite to tenant {name} has been declined.",
107
+ },
108
+ inviteRejectError: {
109
+ subtype: "tenant-invite-rejected-error",
110
+ title: "Error declining invite",
111
+ description:
112
+ "There was an error declining the invite to tenant {name}. Please try again.",
113
+ },
114
+ leave: {
115
+ subtype: "tenant-leave",
116
+ title: "Left Tenant",
117
+ description:
118
+ "You have left the tenant {name}. The process may take a few minutes.",
119
+ },
120
+ validation: {
121
+ nameRequired: "Tenant name is required",
122
+ nameTooLong: "Tenant name must be {max} characters or less",
123
+ nameInvalidChars:
124
+ "Tenant name can only contain lowercase letters, numbers and hyphens (-).",
125
+ npmUrlInvalid: "Please enter a valid HTTP/HTTPS URL",
126
+ },
127
+ ui: {
128
+ fixNameCreate: "Please fix the tenant name errors before creating",
129
+ fixNameUpdate: "Please fix the tenant name errors before updating",
130
+ errorUpdating: "Error updating tenant",
131
+ failedToUpdatePlan: "Failed to update tenant plan",
132
+ },
133
+ },
134
+ account: {
135
+ created: {
136
+ subtype: "account-created",
137
+ title: "Account Created!",
138
+ description: "{account} has been successfully created.",
139
+ },
140
+ creationError: {
141
+ subtype: "account-creation-error",
142
+ title: "Error creating your account",
143
+ description:
144
+ "There was an error creating {name} account. Please try again.",
145
+ },
146
+ deleting: {
147
+ subtype: "account-deleting",
148
+ title: "Account Deleting",
149
+ description:
150
+ "The account {name} is being deleted. This process may take a few minutes.",
151
+ },
152
+ deleted: {
153
+ subtype: "account-deleted",
154
+ title: "Account Deleted",
155
+ description: "The account {name} has been successfully deleted.",
156
+ },
157
+ deletionError: {
158
+ subtype: "account-deletion-error",
159
+ title: "Error deleting your account",
160
+ description:
161
+ "There was an error deleting {name} account. Please try again.",
162
+ },
163
+ cleaned: {
164
+ subtype: "account-cleaned",
165
+ title: "Account Cleaned",
166
+ description: "The account {name} has been successfully cleaned.",
167
+ },
168
+ cleanError: {
169
+ subtype: "account-clean-error",
170
+ title: "Error cleaning your account",
171
+ description:
172
+ "There was an error cleaning {name} account. Please try again.",
173
+ },
174
+ updated: {
175
+ subtype: "account-updated",
176
+ title: "Account Updated",
177
+ description: "The account {name} has been successfully updated.",
178
+ },
179
+ updateError: {
180
+ subtype: "account-update-error",
181
+ title: "Error updating your account",
182
+ description:
183
+ "There was an error updating {name} account. Please try again.",
184
+ },
185
+ validation: {
186
+ nameTooLong: "Account name must be less than {max} characters",
187
+ nameInvalidChars:
188
+ "Account name can only contain lowercase letters, numbers, hyphens (-), and must start and end with a letter or number",
189
+ nameDuplicate: "An account with this name already exists in this tenant",
190
+ },
191
+ },
192
+ environment: {
193
+ created: {
194
+ subtype: "environment-created",
195
+ title: "Environment Created",
196
+ description: "The environment {name} has been successfully created.",
197
+ },
198
+ creationError: {
199
+ subtype: "environment-creation-error",
200
+ title: "Error creating environment",
201
+ description:
202
+ "There was an error creating the environment {name}. Please try again.",
203
+ },
204
+ deleting: {
205
+ subtype: "environment-deleting",
206
+ title: "Deleting Environment",
207
+ description:
208
+ "The environment {name} is being deleted. This process may take a few minutes.",
209
+ },
210
+ deleted: {
211
+ subtype: "environment-deleted",
212
+ title: "Environment Deleted",
213
+ description: "The environment {name} has been successfully deleted.",
214
+ },
215
+ deletionError: {
216
+ subtype: "environment-deletion-error",
217
+ title: "Error deleting environment",
218
+ description:
219
+ "There was an error deleting the environment {name}. Please try again.",
220
+ },
221
+ purging: {
222
+ subtype: "environment-cleaning",
223
+ title: "Purging Environment",
224
+ description:
225
+ "The environment {name} is being purged. This process may take a few minutes.",
226
+ },
227
+ purged: {
228
+ subtype: "environment-cleaned",
229
+ title: "Environment Purged",
230
+ description: "The environment {name} has been purged successfully.",
231
+ },
232
+ purgeError: {
233
+ subtype: "environment-cleaning-error",
234
+ title: "Error purging environment",
235
+ description:
236
+ "There was an error cleaning the environment {name}. Please try again.",
237
+ },
238
+ updated: {
239
+ subtype: "environment-updated",
240
+ title: "Environment Updated",
241
+ description: "The environment {name} has been successfully updated.",
242
+ },
243
+ updateError: {
244
+ subtype: "environment-update-error",
245
+ title: "Error updating environment",
246
+ description:
247
+ "There was an error updating the environment {name}. Please try again.",
248
+ },
249
+ scaled: {
250
+ subtype: "environment-scaled",
251
+ title: "Environment Scaled",
252
+ description: "The environment {name} has been successfully scaled.",
253
+ },
254
+ scaleError: {
255
+ subtype: "environment-scale-error",
256
+ title: "Error scaling environment",
257
+ description:
258
+ "There was an error scaling the environment {name}. Please try again.",
259
+ },
260
+ validation: {
261
+ nameRequired: "Environment name is required",
262
+ nameTooLong: "Environment name must be {max} characters or less",
263
+ nameInvalidChars:
264
+ "Environment name can only contain lowercase letters, numbers and hyphens (-)",
265
+ nameDuplicate:
266
+ "An environment with this name already exists in this account",
267
+ },
268
+ },
269
+ deployment: {
270
+ success: {
271
+ subtype: "deployment-success",
272
+ title: "Deployment Succeeded",
273
+ description:
274
+ "The service {service} has been successfully deployed in tenant {tenant}.",
275
+ },
276
+ error: {
277
+ subtype: "deployment-error",
278
+ title: "Deployment Failed",
279
+ description:
280
+ "There was an error deploying the service {service} in tenant {tenant}. Please try again.",
281
+ },
282
+ inProgress: {
283
+ subtype: "deployment-in-progress",
284
+ title: "Deployment In Progress",
285
+ description:
286
+ "The service {service} is being deployed in tenant {tenant}. This process may take a few minutes.",
287
+ },
288
+ updated: {
289
+ subtype: "deployment-updated",
290
+ title: "Deployment Updated",
291
+ description:
292
+ "The deployment of service {service} has been successfully updated in tenant {tenant}.",
293
+ },
294
+ deleted: {
295
+ subtype: "deployment-deleted",
296
+ title: "Deployment Deleted",
297
+ description:
298
+ "The deployment of service {service} has been successfully deleted from tenant {tenant}.",
299
+ },
300
+ deleting: {
301
+ subtype: "deployment-deleting",
302
+ title: "Deployment Deleting",
303
+ description:
304
+ "The service {service} is being deleted from tenant {tenant}. This process may take a few minutes.",
305
+ },
306
+ revisionUpdated: {
307
+ subtype: "revision-updated",
308
+ title: "Revision Updated",
309
+ description: "The revision of the service {name} has been changed.",
310
+ },
311
+ revisionUpdateError: {
312
+ subtype: "error-revision-update",
313
+ title: "Error updating revision",
314
+ description:
315
+ "There was an error changing the service {name} revision. Please try again.",
316
+ },
317
+ instanceRestarted: {
318
+ subtype: "instance-restarted",
319
+ title: "Instance Restarted",
320
+ description:
321
+ "The instance of the service {name} has been successfully restarted.",
322
+ },
323
+ instanceUpdateError: {
324
+ subtype: "error-instance-update",
325
+ title: "Error Updating Instance",
326
+ description:
327
+ "There was an error updating the instance of service {name}. Please try again or contact support.",
328
+ fallbackError:
329
+ "There was an error updating the instance. Please try again or contact support.",
330
+ },
331
+ validation: {
332
+ negativeValuesNotAllowed: "Negative values are not allowed.",
333
+ exceedsEnvironmentMax:
334
+ "This number exceeds the maximum allowed for the environment.",
335
+ minReplicasGtZero: "Minimum replicas must be greater than 0",
336
+ hysteresisGtZero: "Hysteresis must be greater than 0",
337
+ },
338
+ ui: {
339
+ fillRequiredBeforeDeploy:
340
+ "Please fill in all required parameters and resources before deploying.",
341
+ channelRestriction:
342
+ "In deployment mode, you can only connect channels of the service being deployed.",
343
+ gatewayResourceRequired:
344
+ "A {type} resource is required to enable the Gateway.",
345
+ },
346
+ },
347
+ service: {
348
+ linked: {
349
+ subtype: "service-linked",
350
+ title: "Service link created",
351
+ description: "The service {name} has been successfully linked.",
352
+ },
353
+ unlinked: {
354
+ subtype: "service-unlinked",
355
+ title: "Service link removed",
356
+ description: "The service {name} has been successfully unlinked.",
357
+ },
358
+ unlinking: {
359
+ subtype: "service-unlinking",
360
+ title: "Unlinking Service",
361
+ description:
362
+ "The service {name} is being unlinked. This process may take a few minutes.",
363
+ },
364
+ linkError: {
365
+ subtype: "error-service-link",
366
+ title: "Error linking service",
367
+ description:
368
+ "There was an error linking the service {name}. Please try again.",
369
+ },
370
+ unlinkError: {
371
+ subtype: "service-unlink-error",
372
+ title: "Error unlinking service",
373
+ description:
374
+ "There was an error unlinking the service {name}. Please try again.",
375
+ },
376
+ updated: {
377
+ subtype: "service-updated",
378
+ title: "Service updated",
379
+ description:
380
+ "Service {name} configuration has been successfully updated.",
381
+ },
382
+ updateError: {
383
+ subtype: "service-update-error",
384
+ title: "Error updating service link",
385
+ description:
386
+ "There was an error updating the service {name} configuration. Please try again.",
387
+ },
388
+ validation: {
389
+ nameRequired: "Service name is required",
390
+ nameTooLong: "Service name must be {max} characters or less",
391
+ nameInvalidFormat:
392
+ "Service name must start with a lowercase letter and can only contain lowercase letters, numbers and hyphens (-).",
393
+ nameDuplicate: "A service with this name already exists",
394
+ pathMustStartWithSlash: "Path must start with /",
395
+ },
396
+ },
397
+ resource: {
398
+ created: {
399
+ subtype: "resource-created",
400
+ title: "Resource Created!",
401
+ description: "The resource {name} has been successfully created.",
402
+ },
403
+ creationError: {
404
+ subtype: "resource-creation-error",
405
+ title: "Error creating resource",
406
+ description:
407
+ "There was an error creating the resource {name}. Please try again.",
408
+ },
409
+ deleting: {
410
+ subtype: "resource-deleting",
411
+ title: "Deleting resource",
412
+ description:
413
+ "The resource {name} is being deleted. This process may take a few minutes.",
414
+ },
415
+ deleted: {
416
+ subtype: "resource-deleted",
417
+ title: "Resource Deleted",
418
+ description: "The resource {name} has been successfully deleted.",
419
+ },
420
+ deletionError: {
421
+ subtype: "resource-deletion-error",
422
+ title: "Error deleting resource",
423
+ description:
424
+ "There was an error deleting the resource {name}. Please try again.",
425
+ },
426
+ updated: {
427
+ subtype: "resource-updated",
428
+ title: "Resource Updated",
429
+ description: "The resource {name} has been successfully updated.",
430
+ },
431
+ updateError: {
432
+ subtype: "resource-update-error",
433
+ title: "Error updating resource",
434
+ description:
435
+ "There was an error updating the resource {name}. Please try again.",
436
+ },
437
+ validation: {
438
+ nameTooLong: "Name must be {max} characters or less",
439
+ nameInvalidFormat:
440
+ "Name must start with a lowercase letter and contain only lowercase letters, numbers, hyphens, and underscores",
441
+ domainInvalidFormat: "Invalid domain format",
442
+ },
443
+ },
444
+ registry: {
445
+ created: {
446
+ subtype: "registry-created",
447
+ title: "Registry Created!",
448
+ description: "The registry {name} has been successfully created.",
449
+ },
450
+ creationError: {
451
+ subtype: "registry-creation-error",
452
+ title: "Error creating registry",
453
+ description:
454
+ "There was an error creating the registry {name}. Please try again.",
455
+ },
456
+ updated: {
457
+ subtype: "registry-updated",
458
+ title: "Registry Updated",
459
+ description: "The registry {name} has been successfully updated.",
460
+ },
461
+ updateError: {
462
+ subtype: "registry-update-error",
463
+ title: "Error updating registry",
464
+ description:
465
+ "There was an error updating the registry {name}. Please try again.",
466
+ },
467
+ deleted: {
468
+ subtype: "registry-deleted",
469
+ title: "Registry Deleted",
470
+ description: "The registry {name} has been successfully deleted.",
471
+ },
472
+ deletionError: {
473
+ subtype: "registry-deletion-error",
474
+ title: "Error deleting registry",
475
+ description:
476
+ "There was an error deleting the registry {name}. Please try again.",
477
+ },
478
+ },
479
+ user: {
480
+ updated: {
481
+ subtype: "user-updated",
482
+ title: "User Updated",
483
+ description: "Your user has been successfully updated.",
484
+ },
485
+ updateError: {
486
+ subtype: "user-update-error",
487
+ title: "Error updating user",
488
+ description: "There was an error updating your user. Please try again.",
489
+ },
490
+ deleted: {
491
+ subtype: "user-deleted",
492
+ title: "User Deleted",
493
+ description: "The user {name} has been successfully deleted.",
494
+ },
495
+ deleteError: {
496
+ subtype: "user-delete-error",
497
+ title: "User Delete Error",
498
+ description:
499
+ "There was an error deleting the user. Please try again or contact support.",
500
+ },
501
+ planUpgraded: {
502
+ subtype: "plan-upgrade",
503
+ title: "Plan Upgraded",
504
+ description: "Your plan has been successfully upgraded to {name}.",
505
+ },
506
+ planDowngraded: {
507
+ subtype: "plan-downgrade",
508
+ title: "Plan Downgraded",
509
+ description: "Your plan has been successfully downgraded to {name}.",
510
+ },
511
+ tokenCreated: {
512
+ subtype: "token-created",
513
+ title: "Token Created",
514
+ description: "The token {name} has been successfully created.",
515
+ },
516
+ tokenDeleted: {
517
+ subtype: "token-deleted",
518
+ title: "Token Deleted",
519
+ description: "The token {name} has been successfully deleted.",
520
+ },
521
+ },
522
+ register: {
523
+ userAlreadyExists:
524
+ "The user already exists. Try reloading the page or contact the support team.",
525
+ userCreationError:
526
+ "There was an error on the register process. Please try again or contact the support team.",
527
+ beingCreated: "The user is being created.",
528
+ },
529
+ } as const;
530
+
531
+ export function interpolate(
532
+ template: string,
533
+ vars: Record<string, string>,
534
+ ): string {
535
+ return template.replace(/\{(\w+)\}/g, (_, k: string) => vars[k] ?? "");
536
+ }
@@ -1,5 +1,5 @@
1
- import { Account } from "@interfaces/account-interface";
2
- import { Environment } from "@interfaces/environment-interface";
1
+ import { Environment } from './../interfaces/environment-interface';
2
+ import { Account } from './../interfaces/account-interface';
3
3
 
4
4
  export enum ResourceType {
5
5
  CPU = "cpu",
@@ -19,4 +19,5 @@ export * from './interfaces/usage-interface';
19
19
  export * from './interfaces/user-interface';
20
20
  export * from './enums/providerNameEnum';
21
21
  export * from './enums/resourceTypeEnum';
22
- export * from './enums/tenantRoleEnum';
22
+ export * from './enums/tenantRoleEnum';
23
+ export * from './enums/errorsEnum';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kumori/aurora-interfaces",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "description": "aurora interfaces",
5
5
  "main": "export-interfaces.ts",
6
6
  "repository": {