@privateaim/server-core-worker-kit 0.7.21 → 0.7.23

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.
Files changed (117) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/dist/components/analysis-builder/constants.d.ts +28 -0
  3. package/dist/components/analysis-builder/constants.d.ts.map +1 -0
  4. package/dist/components/analysis-builder/index.d.ts +4 -0
  5. package/dist/components/analysis-builder/index.d.ts.map +1 -0
  6. package/dist/components/analysis-builder/module.d.ts +9 -0
  7. package/dist/components/analysis-builder/module.d.ts.map +1 -0
  8. package/dist/components/analysis-builder/types.d.ts +54 -0
  9. package/dist/components/analysis-builder/types.d.ts.map +1 -0
  10. package/dist/components/analysis-distributor/constants.d.ts +23 -0
  11. package/dist/components/analysis-distributor/constants.d.ts.map +1 -0
  12. package/dist/components/analysis-distributor/index.d.ts +4 -0
  13. package/dist/components/analysis-distributor/index.d.ts.map +1 -0
  14. package/dist/components/analysis-distributor/module.d.ts +9 -0
  15. package/dist/components/analysis-distributor/module.d.ts.map +1 -0
  16. package/dist/components/analysis-distributor/types.d.ts +28 -0
  17. package/dist/components/analysis-distributor/types.d.ts.map +1 -0
  18. package/dist/components/index.d.ts +4 -3
  19. package/dist/components/index.d.ts.map +1 -1
  20. package/dist/components/master-image-builder/constants.d.ts +19 -0
  21. package/dist/components/master-image-builder/constants.d.ts.map +1 -0
  22. package/dist/components/master-image-builder/index.d.ts +4 -0
  23. package/dist/components/master-image-builder/index.d.ts.map +1 -0
  24. package/dist/components/master-image-builder/module.d.ts +8 -0
  25. package/dist/components/master-image-builder/module.d.ts.map +1 -0
  26. package/dist/components/master-image-builder/types.d.ts +20 -0
  27. package/dist/components/master-image-builder/types.d.ts.map +1 -0
  28. package/dist/components/master-image-synchronizer/constants.d.ts +18 -0
  29. package/dist/components/master-image-synchronizer/constants.d.ts.map +1 -0
  30. package/dist/components/master-image-synchronizer/index.d.ts +4 -0
  31. package/dist/components/master-image-synchronizer/index.d.ts.map +1 -0
  32. package/dist/components/master-image-synchronizer/module.d.ts +8 -0
  33. package/dist/components/master-image-synchronizer/module.d.ts.map +1 -0
  34. package/dist/components/master-image-synchronizer/types.d.ts +35 -0
  35. package/dist/components/master-image-synchronizer/types.d.ts.map +1 -0
  36. package/dist/constants.d.ts +3 -3
  37. package/dist/constants.d.ts.map +1 -1
  38. package/dist/index.mjs +113 -212
  39. package/dist/index.mjs.map +1 -1
  40. package/package.json +8 -8
  41. package/rollup.config.mjs +1 -1
  42. package/src/components/{builder → analysis-builder}/constants.ts +12 -18
  43. package/src/components/{builder → analysis-builder}/index.ts +1 -1
  44. package/src/components/analysis-builder/module.ts +29 -0
  45. package/src/components/analysis-builder/types.ts +68 -0
  46. package/src/components/analysis-distributor/constants.ts +34 -0
  47. package/src/components/analysis-distributor/index.ts +10 -0
  48. package/src/components/analysis-distributor/module.ts +33 -0
  49. package/src/components/analysis-distributor/types.ts +41 -0
  50. package/src/components/index.ts +4 -3
  51. package/src/components/master-image-builder/constants.ts +29 -0
  52. package/src/components/{core → master-image-builder}/index.ts +1 -1
  53. package/src/components/master-image-builder/module.ts +25 -0
  54. package/src/components/master-image-builder/types.ts +29 -0
  55. package/src/components/master-image-synchronizer/constants.ts +29 -0
  56. package/src/components/{master-images/service → master-image-synchronizer}/index.ts +2 -1
  57. package/src/components/master-image-synchronizer/module.ts +28 -0
  58. package/src/components/master-image-synchronizer/types.ts +45 -0
  59. package/src/constants.ts +4 -3
  60. package/dist/components/builder/constants.d.ts +0 -32
  61. package/dist/components/builder/constants.d.ts.map +0 -1
  62. package/dist/components/builder/index.d.ts +0 -4
  63. package/dist/components/builder/index.d.ts.map +0 -1
  64. package/dist/components/builder/queue.d.ts +0 -5
  65. package/dist/components/builder/queue.d.ts.map +0 -1
  66. package/dist/components/builder/types.d.ts +0 -35
  67. package/dist/components/builder/types.d.ts.map +0 -1
  68. package/dist/components/core/constants.d.ts +0 -24
  69. package/dist/components/core/constants.d.ts.map +0 -1
  70. package/dist/components/core/index.d.ts +0 -4
  71. package/dist/components/core/index.d.ts.map +0 -1
  72. package/dist/components/core/queue.d.ts +0 -5
  73. package/dist/components/core/queue.d.ts.map +0 -1
  74. package/dist/components/core/types.d.ts +0 -41
  75. package/dist/components/core/types.d.ts.map +0 -1
  76. package/dist/components/master-images/build/index.d.ts +0 -2
  77. package/dist/components/master-images/build/index.d.ts.map +0 -1
  78. package/dist/components/master-images/build/types.d.ts +0 -18
  79. package/dist/components/master-images/build/types.d.ts.map +0 -1
  80. package/dist/components/master-images/constants.d.ts +0 -26
  81. package/dist/components/master-images/constants.d.ts.map +0 -1
  82. package/dist/components/master-images/index.d.ts +0 -7
  83. package/dist/components/master-images/index.d.ts.map +0 -1
  84. package/dist/components/master-images/push/index.d.ts +0 -2
  85. package/dist/components/master-images/push/index.d.ts.map +0 -1
  86. package/dist/components/master-images/push/types.d.ts +0 -17
  87. package/dist/components/master-images/push/types.d.ts.map +0 -1
  88. package/dist/components/master-images/service/index.d.ts +0 -3
  89. package/dist/components/master-images/service/index.d.ts.map +0 -1
  90. package/dist/components/master-images/service/module.d.ts +0 -16
  91. package/dist/components/master-images/service/module.d.ts.map +0 -1
  92. package/dist/components/master-images/service/singleton.d.ts +0 -3
  93. package/dist/components/master-images/service/singleton.d.ts.map +0 -1
  94. package/dist/components/master-images/synchronize/index.d.ts +0 -2
  95. package/dist/components/master-images/synchronize/index.d.ts.map +0 -1
  96. package/dist/components/master-images/synchronize/types.d.ts +0 -26
  97. package/dist/components/master-images/synchronize/types.d.ts.map +0 -1
  98. package/dist/components/master-images/types.d.ts +0 -40
  99. package/dist/components/master-images/types.d.ts.map +0 -1
  100. package/dist/index.cjs +0 -287
  101. package/dist/index.cjs.map +0 -1
  102. package/src/components/builder/queue.ts +0 -39
  103. package/src/components/builder/types.ts +0 -57
  104. package/src/components/core/constants.ts +0 -38
  105. package/src/components/core/queue.ts +0 -36
  106. package/src/components/core/types.ts +0 -66
  107. package/src/components/master-images/build/index.ts +0 -8
  108. package/src/components/master-images/build/types.ts +0 -28
  109. package/src/components/master-images/constants.ts +0 -38
  110. package/src/components/master-images/index.ts +0 -14
  111. package/src/components/master-images/push/index.ts +0 -8
  112. package/src/components/master-images/push/types.ts +0 -25
  113. package/src/components/master-images/service/module.ts +0 -125
  114. package/src/components/master-images/service/singleton.ts +0 -18
  115. package/src/components/master-images/synchronize/index.ts +0 -8
  116. package/src/components/master-images/synchronize/types.ts +0 -37
  117. package/src/components/master-images/types.ts +0 -67
@@ -1,38 +0,0 @@
1
- /*
2
- * Copyright (c) 2023-2024.
3
- * Author Peter Placzek (tada5hi)
4
- * For the full copyright and license information,
5
- * view the LICENSE file that was distributed with this source code.
6
- */
7
-
8
- import { QueueRouterRoutingType } from '@privateaim/server-kit';
9
-
10
- export enum CoreEvent {
11
- BUCKET_CREATED = 'bucketCreated',
12
- BUCKET_DELETED = 'bucketDeleted',
13
-
14
- CONFIGURING = 'configuring',
15
- CONFIGURED = 'configured',
16
-
17
- DESTROYING = 'destroying',
18
- DESTROYED = 'destroyed',
19
-
20
- FAILED = 'failed',
21
-
22
- NONE = 'none',
23
- }
24
-
25
- export enum CoreCommand {
26
- CONFIGURE = 'configure',
27
- DESTROY = 'destroy',
28
- }
29
-
30
- export const CoreEventQueueRouterRouting = {
31
- type: QueueRouterRoutingType.PUB_SUB,
32
- key: 'analysisCoreEvents',
33
- };
34
-
35
- export const CoreTaskQueueRouterRouting = {
36
- type: QueueRouterRoutingType.WORK,
37
- key: 'analysisCoreCommands',
38
- };
@@ -1,36 +0,0 @@
1
- /*
2
- * Copyright (c) 2023-2024.
3
- * Author Peter Placzek (tada5hi)
4
- * For the full copyright and license information,
5
- * view the LICENSE file that was distributed with this source code.
6
- */
7
-
8
- import type { QueueRouterPayload } from '@privateaim/server-kit';
9
- import { buildQueueRouterPublishPayload } from '@privateaim/server-kit';
10
- import { cleanupPayload } from '../../utils';
11
- import { CoreEventQueueRouterRouting, CoreTaskQueueRouterRouting } from './constants';
12
- import type { CoreCommandContext, CoreEventContext } from './types';
13
-
14
- export function buildCoreTaskQueueRouterPayload(
15
- context: CoreCommandContext,
16
- ) : QueueRouterPayload {
17
- return buildQueueRouterPublishPayload({
18
- type: context.command,
19
- data: cleanupPayload(context.data),
20
- metadata: {
21
- routing: CoreTaskQueueRouterRouting,
22
- },
23
- });
24
- }
25
-
26
- export function buildCoreEventQueueRouterPayload(
27
- context: CoreEventContext,
28
- ) : QueueRouterPayload {
29
- return buildQueueRouterPublishPayload({
30
- type: context.event,
31
- data: cleanupPayload(context.data),
32
- metadata: {
33
- routing: CoreEventQueueRouterRouting,
34
- },
35
- });
36
- }
@@ -1,66 +0,0 @@
1
- /*
2
- * Copyright (c) 2023-2024.
3
- * Author Peter Placzek (tada5hi)
4
- * For the full copyright and license information,
5
- * view the LICENSE file that was distributed with this source code.
6
- */
7
-
8
- import type { AnalysisBucketType } from '@privateaim/core-kit';
9
- import type { CoreCommand, CoreEvent } from './constants';
10
-
11
- export type CoreBasePayload = {
12
- error?: Error
13
- };
14
-
15
- export type CoreConfigurePayload = CoreBasePayload & {
16
- id: string
17
- };
18
-
19
- export type CoreDestroyPayload = CoreBasePayload & {
20
- id: string
21
- };
22
-
23
- export type CoreConfigureCommandContext = {
24
- command: `${CoreCommand.CONFIGURE}`,
25
- data: CoreConfigurePayload,
26
- };
27
-
28
- export type CoreDestroyCommandContext = {
29
- command: `${CoreCommand.DESTROY}`,
30
- data: CoreDestroyPayload
31
- };
32
-
33
- export type CoreConfigureEventContext = CoreConfigureCommandContext & {
34
- event: `${CoreEvent.FAILED}` |
35
- `${CoreEvent.CONFIGURED}` |
36
- `${CoreEvent.CONFIGURING}`;
37
- };
38
-
39
- export type CoreDestroyEventContext = CoreDestroyCommandContext & {
40
- event: `${CoreEvent.FAILED}` |
41
- `${CoreEvent.DESTROYED}` |
42
- `${CoreEvent.DESTROYING}` |
43
- `${CoreEvent.NONE}`;
44
- };
45
-
46
- export type CoreBucketEventPayload = {
47
- id: string,
48
- bucketType: `${AnalysisBucketType}`,
49
- bucketId: string
50
- };
51
-
52
- export type CoreBucketCreatedEventContext = {
53
- event: `${CoreEvent.BUCKET_CREATED}`,
54
- data: CoreBucketEventPayload
55
- };
56
-
57
- export type CoreBucketDeletedEventContext = {
58
- event: `${CoreEvent.BUCKET_DELETED}`,
59
- data: CoreBucketEventPayload
60
- };
61
-
62
- export type CoreCommandContext = CoreDestroyCommandContext | CoreConfigureCommandContext;
63
- export type CoreEventContext = CoreDestroyEventContext |
64
- CoreConfigureEventContext |
65
- CoreBucketCreatedEventContext |
66
- CoreBucketDeletedEventContext;
@@ -1,8 +0,0 @@
1
- /*
2
- * Copyright (c) 2024.
3
- * Author Peter Placzek (tada5hi)
4
- * For the full copyright and license information,
5
- * view the LICENSE file that was distributed with this source code.
6
- */
7
-
8
- export * from './types';
@@ -1,28 +0,0 @@
1
- /*
2
- * Copyright (c) 2024.
3
- * Author Peter Placzek (tada5hi)
4
- * For the full copyright and license information,
5
- * view the LICENSE file that was distributed with this source code.
6
- */
7
-
8
- import type { MasterImagesPushCommandPayloadTag } from '../push';
9
-
10
- export type MasterImagesBuildCommandPayload = {
11
- id: string,
12
- path: string,
13
- virtualPath: string
14
- };
15
-
16
- export type MasterImagesBuildFailedEventPayload = {
17
- id: string,
18
- error: Error
19
- };
20
-
21
- export type MasterImagesBuildingEventPayload = {
22
- id: string
23
- };
24
-
25
- export type MasterImagesBuiltEventPayload = {
26
- id: string,
27
- tags: MasterImagesPushCommandPayloadTag[]
28
- };
@@ -1,38 +0,0 @@
1
- /*
2
- * Copyright (c) 2023-2024.
3
- * Author Peter Placzek (tada5hi)
4
- * For the full copyright and license information,
5
- * view the LICENSE file that was distributed with this source code.
6
- */
7
-
8
- import { QueueRouterRoutingType } from '@privateaim/server-kit';
9
-
10
- export enum MasterImagesEvent {
11
- SYNCHRONIZING = 'synchronizing',
12
- SYNCHRONIZED = 'synchronized',
13
- SYNCHRONIZATION_FAILED = 'synchronizationFailed',
14
-
15
- BUILDING = 'building',
16
- BUILT = 'built',
17
- BUILD_FAILED = 'buildFailed',
18
-
19
- PUSHING = 'pushing',
20
- PUSHED = 'pushed',
21
- PUSH_FAILED = 'pushFailed',
22
- }
23
-
24
- export enum MasterImagesCommand {
25
- SYNCHRONIZE = 'synchronize',
26
- BUILD = 'build',
27
- PUSH = 'push',
28
- }
29
-
30
- export const MasterImagesEventQueueRouterRouting = {
31
- type: QueueRouterRoutingType.PUB_SUB,
32
- key: 'analysisMasterImagesEvents',
33
- };
34
-
35
- export const MasterImagesTaskQueueRouterRouting = {
36
- type: QueueRouterRoutingType.WORK,
37
- key: 'analysisMasterImagesCommands',
38
- };
@@ -1,14 +0,0 @@
1
- /*
2
- * Copyright (c) 2024.
3
- * Author Peter Placzek (tada5hi)
4
- * For the full copyright and license information,
5
- * view the LICENSE file that was distributed with this source code.
6
- */
7
-
8
- export * from './build';
9
- export * from './push';
10
- export * from './synchronize';
11
- export * from './service';
12
-
13
- export * from './constants';
14
- export * from './types';
@@ -1,8 +0,0 @@
1
- /*
2
- * Copyright (c) 2024.
3
- * Author Peter Placzek (tada5hi)
4
- * For the full copyright and license information,
5
- * view the LICENSE file that was distributed with this source code.
6
- */
7
-
8
- export * from './types';
@@ -1,25 +0,0 @@
1
- /*
2
- * Copyright (c) 2024.
3
- * Author Peter Placzek (tada5hi)
4
- * For the full copyright and license information,
5
- * view the LICENSE file that was distributed with this source code.
6
- */
7
-
8
- export type MasterImagesPushCommandPayloadTag = {
9
- name: string,
10
- registryId: string
11
- };
12
- export type MasterImagesPushCommandPayload = {
13
- id: string,
14
- tags: MasterImagesPushCommandPayloadTag[]
15
- };
16
-
17
- export type MasterImagesPushFailedEventPayload = {
18
- id: string,
19
- error: Error
20
- };
21
-
22
- export type MasterImagesPushEventPayload = {
23
- id: string,
24
- tags: MasterImagesPushCommandPayloadTag[]
25
- };
@@ -1,125 +0,0 @@
1
- /*
2
- * Copyright (c) 2024.
3
- * Author Peter Placzek (tada5hi)
4
- * For the full copyright and license information,
5
- * view the LICENSE file that was distributed with this source code.
6
- */
7
-
8
- import type { Cache, QueueRouter, QueueRouterHandlers } from '@privateaim/server-kit';
9
- import { buildQueueRouterPublishPayload, useCache, useQueueRouter } from '@privateaim/server-kit';
10
- import { cleanupPayload } from '../../../utils';
11
- import {
12
- MasterImagesCommand,
13
- MasterImagesEventQueueRouterRouting,
14
- MasterImagesTaskQueueRouterRouting,
15
- } from '../constants';
16
- import type {
17
- MasterImagesCommandContext,
18
- MasterImagesCommandMap,
19
- MasterImagesEventContext,
20
- MasterImagesEventMap,
21
- } from '../types';
22
-
23
- export class MasterImageQueueService {
24
- protected cache : Cache;
25
-
26
- protected queueRouter : QueueRouter;
27
-
28
- constructor() {
29
- this.cache = useCache();
30
- this.queueRouter = useQueueRouter();
31
- }
32
-
33
- // -------------------------------------------------
34
-
35
- async publishCommand(ctx: MasterImagesCommandContext) {
36
- const isLocked = await this.isCommandLocked(ctx.command);
37
- if (isLocked) {
38
- throw new Error('The command is locked and can therefore not be executed.');
39
- }
40
-
41
- const routerPayload = this.buildRouterPayloadForCommand(ctx);
42
- await this.queueRouter.publish(routerPayload);
43
-
44
- if (ctx.command === MasterImagesCommand.SYNCHRONIZE) {
45
- await this.setCommandLock(ctx.command);
46
- }
47
- }
48
-
49
- async consumeCommands(
50
- handlers: QueueRouterHandlers<Partial<MasterImagesCommandMap>>,
51
- ) {
52
- await this.queueRouter.consume(MasterImagesTaskQueueRouterRouting, {
53
- $any: async (message) => {
54
- if (handlers[message.type]) {
55
- await handlers[message.type](message, this);
56
- }
57
-
58
- if (handlers.$any) {
59
- await handlers.$any(message);
60
- }
61
- },
62
- });
63
- }
64
-
65
- // -------------------------------------------------
66
-
67
- async publishEvent(ctx: MasterImagesEventContext) {
68
- const routerPayload = this.buildRouterPayloadForEvent(ctx);
69
- await this.queueRouter.publish(routerPayload);
70
- }
71
-
72
- async consumeEvents(
73
- handlers: QueueRouterHandlers<Partial<MasterImagesEventMap>>,
74
- ) {
75
- await this.queueRouter.consume(MasterImagesEventQueueRouterRouting, {
76
- $any: async (message) => {
77
- await this.setCommandLock(MasterImagesCommand.SYNCHRONIZE);
78
-
79
- if (handlers[message.type]) {
80
- await handlers[message.type](message);
81
- }
82
-
83
- if (handlers.$any) {
84
- await handlers.$any(message);
85
- }
86
- },
87
- });
88
- }
89
-
90
- // -------------------------------------------------
91
-
92
- protected async setCommandLock(command: string) {
93
- await this.cache.set(`master-images-command:${command}`, true, {
94
- ttl: 1000 * 60,
95
- });
96
- }
97
-
98
- protected async isCommandLocked(command: string) {
99
- const isActive = await this.cache.get(`master-images-command:${command}`);
100
-
101
- return !!isActive;
102
- }
103
-
104
- // -------------------------------------------------
105
-
106
- protected buildRouterPayloadForEvent(context: MasterImagesEventContext) {
107
- return buildQueueRouterPublishPayload({
108
- type: context.event,
109
- data: cleanupPayload(context.data),
110
- metadata: {
111
- routing: MasterImagesEventQueueRouterRouting,
112
- },
113
- });
114
- }
115
-
116
- protected buildRouterPayloadForCommand(context: MasterImagesCommandContext) {
117
- return buildQueueRouterPublishPayload({
118
- type: context.command,
119
- data: cleanupPayload(context.data),
120
- metadata: {
121
- routing: MasterImagesTaskQueueRouterRouting,
122
- },
123
- });
124
- }
125
- }
@@ -1,18 +0,0 @@
1
- /*
2
- * Copyright (c) 2024.
3
- * Author Peter Placzek (tada5hi)
4
- * For the full copyright and license information,
5
- * view the LICENSE file that was distributed with this source code.
6
- */
7
-
8
- import { singa } from 'singa';
9
- import { MasterImageQueueService } from './module';
10
-
11
- const instance = singa<MasterImageQueueService>({
12
- name: 'masterImageQueue',
13
- factory: () => new MasterImageQueueService(),
14
- });
15
-
16
- export function useMasterImageQueueService() {
17
- return instance.use();
18
- }
@@ -1,8 +0,0 @@
1
- /*
2
- * Copyright (c) 2024.
3
- * Author Peter Placzek (tada5hi)
4
- * For the full copyright and license information,
5
- * view the LICENSE file that was distributed with this source code.
6
- */
7
-
8
- export * from './types';
@@ -1,37 +0,0 @@
1
- /*
2
- * Copyright (c) 2024.
3
- * Author Peter Placzek (tada5hi)
4
- * For the full copyright and license information,
5
- * view the LICENSE file that was distributed with this source code.
6
- */
7
-
8
- import type { MasterImageCommandArgument } from '@privateaim/core-kit';
9
-
10
- export type MasterImageSyncData = {
11
- name: string,
12
- path: string,
13
- virtualPath: string,
14
- command: string,
15
- commandArguments?: MasterImageCommandArgument[]
16
- };
17
-
18
- export type MasterImageGroupSyncData = {
19
- name: string,
20
- path: string,
21
- virtualPath: string,
22
- };
23
-
24
- export type MasterImagesSynchronizeCommandPayload = {
25
- owner: string,
26
- repository: string,
27
- branch: string
28
- };
29
-
30
- export type MasterImagesSynchronizationFailedEventPayload = {
31
- error: Error
32
- };
33
-
34
- export type MaterImagesSynchronizedEventPayload = {
35
- images: MasterImageSyncData[],
36
- groups: MasterImageGroupSyncData[]
37
- };
@@ -1,67 +0,0 @@
1
- /*
2
- * Copyright (c) 2023-2024.
3
- * Author Peter Placzek (tada5hi)
4
- * For the full copyright and license information,
5
- * view the LICENSE file that was distributed with this source code.
6
- */
7
-
8
- import type {
9
- MasterImagesBuildCommandPayload, MasterImagesBuildFailedEventPayload,
10
- MasterImagesBuildingEventPayload,
11
- MasterImagesBuiltEventPayload,
12
- } from './build';
13
- import type { MasterImagesCommand, MasterImagesEvent } from './constants';
14
- import type {
15
- MasterImagesPushCommandPayload,
16
- MasterImagesPushEventPayload, MasterImagesPushFailedEventPayload,
17
- } from './push';
18
- import type {
19
- MasterImagesSynchronizationFailedEventPayload, MasterImagesSynchronizeCommandPayload,
20
- MaterImagesSynchronizedEventPayload,
21
- } from './synchronize';
22
-
23
- //-----------------------------------------------------------------------
24
-
25
- type MasterImagesCommandMapRaw = {
26
- [MasterImagesCommand.BUILD]: MasterImagesBuildCommandPayload,
27
- [MasterImagesCommand.PUSH]: MasterImagesPushCommandPayload,
28
- [MasterImagesCommand.SYNCHRONIZE]: MasterImagesSynchronizeCommandPayload,
29
- };
30
-
31
- export type MasterImagesCommandMap = {
32
- [K in keyof MasterImagesCommandMapRaw as `${K}`]: MasterImagesCommandMapRaw[K]
33
- };
34
-
35
- export type MasterImagesCommandContext = {
36
- [K in keyof MasterImagesCommandMap]: {
37
- command: K,
38
- data: MasterImagesCommandMap[K]
39
- }
40
- }[keyof MasterImagesCommandMap];
41
-
42
- //-----------------------------------------------------------------------
43
-
44
- type MasterImagesEventMapRaw = {
45
- [MasterImagesEvent.BUILDING]: MasterImagesBuildingEventPayload,
46
- [MasterImagesEvent.BUILT]: MasterImagesBuiltEventPayload,
47
- [MasterImagesEvent.BUILD_FAILED]: MasterImagesBuildFailedEventPayload,
48
-
49
- [MasterImagesEvent.PUSHING]: MasterImagesPushEventPayload,
50
- [MasterImagesEvent.PUSHED]: MasterImagesPushEventPayload,
51
- [MasterImagesEvent.PUSH_FAILED]: MasterImagesPushFailedEventPayload,
52
-
53
- [MasterImagesEvent.SYNCHRONIZING]: Record<string, any>,
54
- [MasterImagesEvent.SYNCHRONIZED]: MaterImagesSynchronizedEventPayload,
55
- [MasterImagesEvent.SYNCHRONIZATION_FAILED]: MasterImagesSynchronizationFailedEventPayload
56
- };
57
-
58
- export type MasterImagesEventMap = {
59
- [K in keyof MasterImagesEventMapRaw as `${K}`]: MasterImagesEventMapRaw[K]
60
- };
61
-
62
- export type MasterImagesEventContext = {
63
- [K in keyof MasterImagesEventMap]: {
64
- event: K,
65
- data: MasterImagesEventMap[K]
66
- }
67
- }[keyof MasterImagesEventMap];