@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
@@ -0,0 +1,68 @@
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 { ObjectLiteralKeys, ProcessStatus } from '@privateaim/kit';
9
+ import type { ComponentMetadata } from '@privateaim/server-kit';
10
+ import type { Progress } from 'docken';
11
+ import type { AnalysisBuilderCommand, AnalysisBuilderEvent } from './constants';
12
+
13
+ export type AnalysisBuilderBasePayload = {
14
+ id: string,
15
+ error?: Error
16
+ };
17
+
18
+ export type AnalysisBuilderExecutePayload = AnalysisBuilderBasePayload;
19
+
20
+ export type AnalysisBuilderExecutionFinishedPayload = AnalysisBuilderBasePayload & {
21
+ /**
22
+ * sha
23
+ */
24
+ hash?: string,
25
+ /**
26
+ * image size in bytes
27
+ */
28
+ size?: number,
29
+ /**
30
+ * operating system (windows, linux, ...)
31
+ */
32
+ os?: string
33
+ };
34
+
35
+ export type AnalysisBuilderExecutionProgressPayload = AnalysisBuilderBasePayload & {
36
+ progress: Progress
37
+ };
38
+
39
+ export type AnalysisBuilderCheckPayload = AnalysisBuilderBasePayload;
40
+
41
+ export type AnalysisBuilderCheckFinishedPayload = AnalysisBuilderBasePayload & {
42
+ status?: `${ProcessStatus}`,
43
+ /**
44
+ * sha
45
+ */
46
+ hash?: string,
47
+ /**
48
+ * image size in bytes
49
+ */
50
+ size?: number,
51
+ /**
52
+ * operating system (windows, linux, ...)
53
+ */
54
+ os?: string
55
+ };
56
+
57
+ export type AnalysisBuilderEventMap = ObjectLiteralKeys<{
58
+ [AnalysisBuilderCommand.EXECUTE]: [AnalysisBuilderExecutePayload, ComponentMetadata],
59
+ [AnalysisBuilderEvent.EXECUTION_FAILED]: [AnalysisBuilderExecutePayload, ComponentMetadata],
60
+ [AnalysisBuilderEvent.EXECUTION_STARTED]: [AnalysisBuilderExecutePayload, ComponentMetadata],
61
+ [AnalysisBuilderEvent.EXECUTION_PROGRESS]: [AnalysisBuilderExecutionProgressPayload, ComponentMetadata],
62
+ [AnalysisBuilderEvent.EXECUTION_FINISHED]: [AnalysisBuilderExecutionFinishedPayload, ComponentMetadata],
63
+
64
+ [AnalysisBuilderCommand.CHECK]: [AnalysisBuilderCheckPayload, ComponentMetadata],
65
+ [AnalysisBuilderEvent.CHECK_STARTED]: [AnalysisBuilderCheckPayload, ComponentMetadata],
66
+ [AnalysisBuilderEvent.CHECK_FAILED]: [AnalysisBuilderCheckPayload, ComponentMetadata],
67
+ [AnalysisBuilderEvent.CHECK_FINISHED]: [AnalysisBuilderCheckFinishedPayload, ComponentMetadata],
68
+ }>;
@@ -0,0 +1,34 @@
1
+ /*
2
+ * Copyright (c) 2025.
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 AnalysisDistributorEvent {
11
+ EXECUTION_STARTED = 'executionStarted',
12
+ EXECUTION_PROGRESS = 'executionProgress',
13
+ EXECUTION_FINISHED = 'executionFinished',
14
+ EXECUTION_FAILED = 'executionFailed',
15
+
16
+ CHECK_STARTED = 'checkStarted',
17
+ CHECK_FINISHED = 'checkFinished',
18
+ CHECK_FAILED = 'checkFailed',
19
+ }
20
+
21
+ export enum AnalysisDistributorCommand {
22
+ EXECUTE = 'execute',
23
+ CHECK = 'check',
24
+ }
25
+
26
+ export const AnalysisDistributorEventQueueRouterRouting = {
27
+ type: QueueRouterRoutingType.PUB_SUB,
28
+ key: 'analysisDistributorEvents',
29
+ };
30
+
31
+ export const AnalysisDistributorTaskQueueRouterRouting = {
32
+ type: QueueRouterRoutingType.WORK,
33
+ key: 'analysisDistributorCommands',
34
+ };
@@ -0,0 +1,10 @@
1
+ /*
2
+ * Copyright (c) 2025.
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 './constants';
9
+ export * from './module';
10
+ export * from './types';
@@ -0,0 +1,33 @@
1
+ /*
2
+ * Copyright (c) 2025.
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 { ComponentMetadata } from '@privateaim/server-kit';
9
+ import {
10
+ QueueDispatchComponentCaller,
11
+ } from '@privateaim/server-kit';
12
+ import { AnalysisDistributorCommand, AnalysisDistributorTaskQueueRouterRouting } from './constants';
13
+ import type {
14
+ AnalysisDistributorCheckPayload,
15
+ AnalysisDistributorEventMap,
16
+ AnalysisDistributorExecutePayload,
17
+ } from './types';
18
+
19
+ export class AnalysisDistributorComponentCaller extends QueueDispatchComponentCaller<AnalysisDistributorEventMap> {
20
+ constructor() {
21
+ super({
22
+ queue: AnalysisDistributorTaskQueueRouterRouting,
23
+ });
24
+ }
25
+
26
+ async callExecute(payload: AnalysisDistributorExecutePayload, metadata: ComponentMetadata = {}) {
27
+ return this.call(AnalysisDistributorCommand.EXECUTE, payload, metadata);
28
+ }
29
+
30
+ async callCheck(payload: AnalysisDistributorCheckPayload, metadata: ComponentMetadata = {}) {
31
+ return this.call(AnalysisDistributorCommand.CHECK, payload, metadata);
32
+ }
33
+ }
@@ -0,0 +1,41 @@
1
+ /*
2
+ * Copyright (c) 2025.
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 { ObjectLiteralKeys, ProcessStatus } from '@privateaim/kit';
9
+ import type { ComponentMetadata } from '@privateaim/server-kit';
10
+ import type { Progress } from 'docken';
11
+ import type { AnalysisDistributorCommand, AnalysisDistributorEvent } from './constants';
12
+
13
+ export type AnalysisDistributorBasePayload = {
14
+ id: string,
15
+ error?: Error
16
+ };
17
+
18
+ export type AnalysisDistributorExecutePayload = AnalysisDistributorBasePayload;
19
+
20
+ export type AnalysisDistributorExecutionProgressPayload = AnalysisDistributorBasePayload & {
21
+ progress: Progress
22
+ };
23
+
24
+ export type AnalysisDistributorCheckPayload = AnalysisDistributorBasePayload;
25
+
26
+ export type AnalysisDistributorCheckFinishedPayload = AnalysisDistributorBasePayload & {
27
+ status?: `${ProcessStatus}`
28
+ };
29
+
30
+ export type AnalysisDistributorEventMap = ObjectLiteralKeys<{
31
+ [AnalysisDistributorCommand.EXECUTE]: [AnalysisDistributorExecutePayload, ComponentMetadata],
32
+ [AnalysisDistributorEvent.EXECUTION_FAILED]: [AnalysisDistributorExecutePayload, ComponentMetadata],
33
+ [AnalysisDistributorEvent.EXECUTION_STARTED]: [AnalysisDistributorExecutePayload, ComponentMetadata],
34
+ [AnalysisDistributorEvent.EXECUTION_PROGRESS]: [AnalysisDistributorExecutionProgressPayload, ComponentMetadata],
35
+ [AnalysisDistributorEvent.EXECUTION_FINISHED]: [AnalysisDistributorExecutePayload, ComponentMetadata],
36
+
37
+ [AnalysisDistributorCommand.CHECK]: [AnalysisDistributorCheckPayload, ComponentMetadata],
38
+ [AnalysisDistributorEvent.CHECK_STARTED]: [AnalysisDistributorCheckPayload, ComponentMetadata],
39
+ [AnalysisDistributorEvent.CHECK_FAILED]: [AnalysisDistributorCheckPayload, ComponentMetadata],
40
+ [AnalysisDistributorEvent.CHECK_FINISHED]: [AnalysisDistributorCheckFinishedPayload, ComponentMetadata],
41
+ }>;
@@ -5,6 +5,7 @@
5
5
  * view the LICENSE file that was distributed with this source code.
6
6
  */
7
7
 
8
- export * from './builder';
9
- export * from './core';
10
- export * from './master-images';
8
+ export * from './analysis-distributor';
9
+ export * from './analysis-builder';
10
+ export * from './master-image-builder';
11
+ export * from './master-image-synchronizer';
@@ -0,0 +1,29 @@
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 MasterImageBuilderEvent {
11
+ EXECUTION_FAILED = 'executionFailed',
12
+ EXECUTION_STARTED = 'executionStarted',
13
+ EXECUTION_PROGRESS = 'executionProgress',
14
+ EXECUTION_FINISHED = 'executionFinished',
15
+ }
16
+
17
+ export enum MasterImageBuilderCommand {
18
+ EXECUTE = 'execute',
19
+ }
20
+
21
+ export const MasterImageBuilderEventQueueRouterRouting = {
22
+ type: QueueRouterRoutingType.PUB_SUB,
23
+ key: 'masterImageBuilderEvents',
24
+ };
25
+
26
+ export const MasterImageBuilderTaskQueueRouterRouting = {
27
+ type: QueueRouterRoutingType.WORK,
28
+ key: 'masterImageBuilderTasks',
29
+ };
@@ -6,5 +6,5 @@
6
6
  */
7
7
 
8
8
  export * from './constants';
9
- export * from './queue';
9
+ export * from './module';
10
10
  export * from './types';
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Copyright (c) 2025.
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 { ComponentMetadata } from '@privateaim/server-kit';
9
+ import {
10
+ QueueDispatchComponentCaller,
11
+ } from '@privateaim/server-kit';
12
+ import { MasterImageBuilderCommand, MasterImageBuilderTaskQueueRouterRouting } from './constants';
13
+ import type { MasterImageBuilderExecutePayload } from './types';
14
+
15
+ export class MasterImageBuilderComponentCaller extends QueueDispatchComponentCaller {
16
+ constructor() {
17
+ super({
18
+ queue: MasterImageBuilderTaskQueueRouterRouting,
19
+ });
20
+ }
21
+
22
+ async callExecute(payload: MasterImageBuilderExecutePayload, metadata: ComponentMetadata = {}) {
23
+ return this.call(MasterImageBuilderCommand.EXECUTE, payload, metadata);
24
+ }
25
+ }
@@ -0,0 +1,29 @@
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 { ObjectLiteralKeys } from '@privateaim/kit';
9
+ import type { ComponentMetadata } from '@privateaim/server-kit';
10
+ import type { Progress } from 'docken';
11
+ import type { MasterImageBuilderCommand, MasterImageBuilderEvent } from './constants';
12
+
13
+ export type MasterImageBuilderBasePayload = {
14
+ id: string,
15
+ error?: Error
16
+ };
17
+
18
+ export type MasterImageBuilderExecutePayload = MasterImageBuilderBasePayload;
19
+ export type MasterImageBuilderExecutionProgressPayload = MasterImageBuilderBasePayload & {
20
+ progress: Progress
21
+ };
22
+
23
+ export type MasterImageBuilderEventMap = ObjectLiteralKeys<{
24
+ [MasterImageBuilderCommand.EXECUTE]: [MasterImageBuilderExecutePayload, ComponentMetadata],
25
+ [MasterImageBuilderEvent.EXECUTION_STARTED]: [MasterImageBuilderExecutePayload, ComponentMetadata],
26
+ [MasterImageBuilderEvent.EXECUTION_PROGRESS]: [MasterImageBuilderExecutionProgressPayload, ComponentMetadata],
27
+ [MasterImageBuilderEvent.EXECUTION_FINISHED]: [MasterImageBuilderBasePayload, ComponentMetadata],
28
+ [MasterImageBuilderEvent.EXECUTION_FAILED]: [MasterImageBuilderBasePayload, ComponentMetadata],
29
+ }>;
@@ -0,0 +1,29 @@
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 MasterImageSynchronizerEvent {
11
+ EXECUTION_FAILED = 'executionFailed',
12
+ EXECUTION_STARTED = 'executionStarted',
13
+ EXECUTION_FINISHED = 'executionFinished',
14
+
15
+ }
16
+
17
+ export enum MasterImageSynchronizerCommand {
18
+ EXECUTE = 'execute',
19
+ }
20
+
21
+ export const MasterImageSynchronizerEventQueueRouterRouting = {
22
+ type: QueueRouterRoutingType.PUB_SUB,
23
+ key: 'masterImageSynchronizerEvents',
24
+ };
25
+
26
+ export const MasterImageSynchronizerTaskQueueRouterRouting = {
27
+ type: QueueRouterRoutingType.WORK,
28
+ key: 'masterImageSynchronizerTasks',
29
+ };
@@ -5,5 +5,6 @@
5
5
  * view the LICENSE file that was distributed with this source code.
6
6
  */
7
7
 
8
+ export * from './constants';
8
9
  export * from './module';
9
- export * from './singleton';
10
+ export * from './types';
@@ -0,0 +1,28 @@
1
+ /*
2
+ * Copyright (c) 2025.
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 { ComponentMetadata } from '@privateaim/server-kit';
9
+ import {
10
+ QueueDispatchComponentCaller,
11
+ } from '@privateaim/server-kit';
12
+ import {
13
+ MasterImageSynchronizerCommand,
14
+ MasterImageSynchronizerTaskQueueRouterRouting,
15
+ } from './constants';
16
+ import type { MasterImageSynchronizerEventMap, MasterImageSynchronizerExecutePayload } from './types';
17
+
18
+ export class MasterImageSynchronizerComponentCaller extends QueueDispatchComponentCaller<MasterImageSynchronizerEventMap> {
19
+ constructor() {
20
+ super({
21
+ queue: MasterImageSynchronizerTaskQueueRouterRouting,
22
+ });
23
+ }
24
+
25
+ async callExecute(payload: MasterImageSynchronizerExecutePayload, metadata: ComponentMetadata = {}) {
26
+ return this.call(MasterImageSynchronizerCommand.EXECUTE, payload, metadata);
27
+ }
28
+ }
@@ -0,0 +1,45 @@
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 { MasterImageCommandArgument } from '@privateaim/core-kit';
9
+ import type { ObjectLiteralKeys } from '@privateaim/kit';
10
+ import type { ComponentMetadata } from '@privateaim/server-kit';
11
+ import type { MasterImageSynchronizerCommand, MasterImageSynchronizerEvent } from './constants';
12
+
13
+ export type MasterImageSynchronizerImage = {
14
+ name: string,
15
+ path: string,
16
+ virtualPath: string,
17
+ command: string,
18
+ commandArguments?: MasterImageCommandArgument[]
19
+ };
20
+ export type MasterImageSynchronizerGroup = {
21
+ name: string,
22
+ path: string,
23
+ virtualPath: string,
24
+ };
25
+ export type MasterImageSynchronizerExecutePayload = {
26
+ owner: string,
27
+ repository: string,
28
+ branch: string
29
+ };
30
+
31
+ export type MasterImageSynchronizerFailedEventPayload = {
32
+ error: Error
33
+ };
34
+
35
+ export type MasterImageSynchronizerExecutionFinishedPayload = {
36
+ images: MasterImageSynchronizerImage[],
37
+ groups: MasterImageSynchronizerGroup[]
38
+ };
39
+
40
+ export type MasterImageSynchronizerEventMap = ObjectLiteralKeys<{
41
+ [MasterImageSynchronizerCommand.EXECUTE]: [MasterImageSynchronizerExecutePayload, ComponentMetadata],
42
+ [MasterImageSynchronizerEvent.EXECUTION_STARTED]: [MasterImageSynchronizerExecutePayload, ComponentMetadata],
43
+ [MasterImageSynchronizerEvent.EXECUTION_FAILED]: [MasterImageSynchronizerFailedEventPayload, ComponentMetadata],
44
+ [MasterImageSynchronizerEvent.EXECUTION_FINISHED]: [MasterImageSynchronizerExecutionFinishedPayload, ComponentMetadata],
45
+ }>;
package/src/constants.ts CHANGED
@@ -6,9 +6,10 @@
6
6
  */
7
7
 
8
8
  export enum ComponentName {
9
- BUILDER = 'builder',
10
- CORE = 'core',
11
- MASTER_IMAGES = 'masterImages',
9
+ ANALYSIS_DISTRIBUTOR = 'analysisDistributor',
10
+ ANALYSIS_BUILDER = 'analysisBuilder',
11
+
12
+ MASTER_IMAGE_BUILDER = 'masterImageBuilder',
12
13
  }
13
14
 
14
15
  export enum ErrorCode {
@@ -1,32 +0,0 @@
1
- import { QueueRouterRoutingType } from '@privateaim/server-kit';
2
- export declare enum BuilderEvent {
3
- BUILD_FAILED = "buildFailed",
4
- BUILDING = "building",
5
- BUILT = "built",
6
- PUSH_FAILED = "pushFailed",
7
- PUSHING = "pushing",
8
- PUSHED = "pushed",
9
- CHECK_FAILED = "checkFailed",
10
- CHECKING = "checking",
11
- CHECKED = "checked",
12
- NONE = "none"
13
- }
14
- export declare enum BuilderCommand {
15
- BUILD = "build",
16
- CHECK = "check",
17
- PUSH = "push"
18
- }
19
- export declare enum BuilderErrorCode {
20
- ENTRYPOINT_NOT_FOUND = "entrypointNotFound",
21
- MASTER_IMAGE_NOT_FOUND = "masterImageNotFound",
22
- UNKNOWN = "unknown"
23
- }
24
- export declare const BuilderEventQueueRouterRouting: {
25
- type: QueueRouterRoutingType;
26
- key: string;
27
- };
28
- export declare const BuilderTaskQueueRouterRouting: {
29
- type: QueueRouterRoutingType;
30
- key: string;
31
- };
32
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/builder/constants.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,oBAAY,YAAY;IACpB,YAAY,gBAAgB;IAC5B,QAAQ,aAAa;IACrB,KAAK,UAAU;IAEf,WAAW,eAAe;IAC1B,OAAO,YAAY;IACnB,MAAM,WAAW;IAEjB,YAAY,gBAAgB;IAC5B,QAAQ,aAAa;IACrB,OAAO,YAAY;IAEnB,IAAI,SAAS;CAChB;AAED,oBAAY,cAAc;IACtB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,IAAI,SAAS;CAChB;AAED,oBAAY,gBAAgB;IACxB,oBAAoB,uBAAuB;IAC3C,sBAAsB,wBAAwB;IAC9C,OAAO,YAAY;CACtB;AAED,eAAO,MAAM,8BAA8B;;;CAG1C,CAAC;AAEF,eAAO,MAAM,6BAA6B;;;CAGzC,CAAC"}
@@ -1,4 +0,0 @@
1
- export * from './constants';
2
- export * from './queue';
3
- export * from './types';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/builder/index.ts"],"names":[],"mappings":"AAOA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
@@ -1,5 +0,0 @@
1
- import type { QueueRouterPayload } from '@privateaim/server-kit';
2
- import type { BuilderCommandContext, BuilderEventContext } from './types';
3
- export declare function buildBuilderTaskQueueRouterPayload(context: BuilderCommandContext): QueueRouterPayload;
4
- export declare function buildBuilderEventQueueRouterPayload(context: BuilderEventContext): QueueRouterPayload;
5
- //# sourceMappingURL=queue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../src/components/builder/queue.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAOjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE1E,wBAAgB,kCAAkC,CAC9C,OAAO,EAAE,qBAAqB,GAC9B,kBAAkB,CAQrB;AAED,wBAAgB,mCAAmC,CAC/C,OAAO,EAAE,mBAAmB,GAC5B,kBAAkB,CAQrB"}
@@ -1,35 +0,0 @@
1
- import type { BuilderCommand, BuilderEvent } from './constants';
2
- export type BuilderBasePayload = {
3
- id: string;
4
- error?: Error;
5
- };
6
- export type BuilderBuildPayload = BuilderBasePayload;
7
- export type BuilderPushPayload = BuilderBasePayload;
8
- export type BuilderCheckPayload = BuilderBasePayload;
9
- export type BuilderBuildCommandContext = {
10
- command: `${BuilderCommand.BUILD}`;
11
- data: BuilderBuildPayload;
12
- };
13
- export type BuilderPushCommandContext = {
14
- command: `${BuilderCommand.PUSH}`;
15
- data: BuilderPushPayload;
16
- };
17
- export type BuilderCheckCommandContext = {
18
- command: `${BuilderCommand.CHECK}`;
19
- data: BuilderCheckPayload;
20
- };
21
- export type BuilderBuildEventContext = {
22
- data: BuilderBuildPayload;
23
- event: `${BuilderEvent.BUILD_FAILED}` | `${BuilderEvent.BUILT}` | `${BuilderEvent.BUILDING}`;
24
- };
25
- export type BuilderPushEventContext = {
26
- data: BuilderPushPayload;
27
- event: `${BuilderEvent.PUSH_FAILED}` | `${BuilderEvent.PUSHED}` | `${BuilderEvent.PUSHING}`;
28
- };
29
- export type BuilderCheckEventContext = {
30
- data: BuilderCheckPayload;
31
- event: `${BuilderEvent.CHECK_FAILED}` | `${BuilderEvent.CHECKED}` | `${BuilderEvent.CHECKING}` | `${BuilderEvent.NONE}`;
32
- };
33
- export type BuilderCommandContext = BuilderCheckCommandContext | BuilderBuildCommandContext | BuilderPushCommandContext;
34
- export type BuilderEventContext = BuilderCheckEventContext | BuilderBuildEventContext | BuilderPushEventContext;
35
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/builder/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhE,MAAM,MAAM,kBAAkB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,KAAK,CAAA;CAChB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AACrD,MAAM,MAAM,kBAAkB,GAAG,kBAAkB,CAAC;AACpD,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAErD,MAAM,MAAM,0BAA0B,GAAG;IACrC,OAAO,EAAE,GAAG,cAAc,CAAC,KAAK,EAAE,CAAC;IACnC,IAAI,EAAE,mBAAmB,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACpC,OAAO,EAAE,GAAG,cAAc,CAAC,IAAI,EAAE,CAAC;IAClC,IAAI,EAAE,kBAAkB,CAAA;CAC3B,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACrC,OAAO,EAAE,GAAG,cAAc,CAAC,KAAK,EAAE,CAAC;IACnC,IAAI,EAAE,mBAAmB,CAAA;CAC5B,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACnC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,KAAK,EAAE,GAAG,YAAY,CAAC,YAAY,EAAE,GACjC,GAAG,YAAY,CAAC,KAAK,EAAE,GACvB,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IAClC,IAAI,EAAE,kBAAkB,CAAC;IACzB,KAAK,EAAE,GAAG,YAAY,CAAC,WAAW,EAAE,GAChC,GAAG,YAAY,CAAC,MAAM,EAAE,GACxB,GAAG,YAAY,CAAC,OAAO,EAAE,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACnC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,KAAK,EAAE,GAAG,YAAY,CAAC,YAAY,EAAE,GACjC,GAAG,YAAY,CAAC,OAAO,EAAE,GACzB,GAAG,YAAY,CAAC,QAAQ,EAAE,GAC1B,GAAG,YAAY,CAAC,IAAI,EAAE,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,0BAA0B,GAAG,0BAA0B,GAAG,yBAAyB,CAAC;AACxH,MAAM,MAAM,mBAAmB,GAAG,wBAAwB,GAAG,wBAAwB,GAAG,uBAAuB,CAAC"}
@@ -1,24 +0,0 @@
1
- import { QueueRouterRoutingType } from '@privateaim/server-kit';
2
- export declare enum CoreEvent {
3
- BUCKET_CREATED = "bucketCreated",
4
- BUCKET_DELETED = "bucketDeleted",
5
- CONFIGURING = "configuring",
6
- CONFIGURED = "configured",
7
- DESTROYING = "destroying",
8
- DESTROYED = "destroyed",
9
- FAILED = "failed",
10
- NONE = "none"
11
- }
12
- export declare enum CoreCommand {
13
- CONFIGURE = "configure",
14
- DESTROY = "destroy"
15
- }
16
- export declare const CoreEventQueueRouterRouting: {
17
- type: QueueRouterRoutingType;
18
- key: string;
19
- };
20
- export declare const CoreTaskQueueRouterRouting: {
21
- type: QueueRouterRoutingType;
22
- key: string;
23
- };
24
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/core/constants.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,oBAAY,SAAS;IACjB,cAAc,kBAAkB;IAChC,cAAc,kBAAkB;IAEhC,WAAW,gBAAgB;IAC3B,UAAU,eAAe;IAEzB,UAAU,eAAe;IACzB,SAAS,cAAc;IAEvB,MAAM,WAAW;IAEjB,IAAI,SAAS;CAChB;AAED,oBAAY,WAAW;IACnB,SAAS,cAAc;IACvB,OAAO,YAAY;CACtB;AAED,eAAO,MAAM,2BAA2B;;;CAGvC,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;CAGtC,CAAC"}
@@ -1,4 +0,0 @@
1
- export * from './constants';
2
- export * from './queue';
3
- export * from './types';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/core/index.ts"],"names":[],"mappings":"AAOA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
@@ -1,5 +0,0 @@
1
- import type { QueueRouterPayload } from '@privateaim/server-kit';
2
- import type { CoreCommandContext, CoreEventContext } from './types';
3
- export declare function buildCoreTaskQueueRouterPayload(context: CoreCommandContext): QueueRouterPayload;
4
- export declare function buildCoreEventQueueRouterPayload(context: CoreEventContext): QueueRouterPayload;
5
- //# sourceMappingURL=queue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../src/components/core/queue.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAIjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEpE,wBAAgB,+BAA+B,CAC3C,OAAO,EAAE,kBAAkB,GAC3B,kBAAkB,CAQrB;AAED,wBAAgB,gCAAgC,CAC5C,OAAO,EAAE,gBAAgB,GACzB,kBAAkB,CAQrB"}
@@ -1,41 +0,0 @@
1
- import type { AnalysisBucketType } from '@privateaim/core-kit';
2
- import type { CoreCommand, CoreEvent } from './constants';
3
- export type CoreBasePayload = {
4
- error?: Error;
5
- };
6
- export type CoreConfigurePayload = CoreBasePayload & {
7
- id: string;
8
- };
9
- export type CoreDestroyPayload = CoreBasePayload & {
10
- id: string;
11
- };
12
- export type CoreConfigureCommandContext = {
13
- command: `${CoreCommand.CONFIGURE}`;
14
- data: CoreConfigurePayload;
15
- };
16
- export type CoreDestroyCommandContext = {
17
- command: `${CoreCommand.DESTROY}`;
18
- data: CoreDestroyPayload;
19
- };
20
- export type CoreConfigureEventContext = CoreConfigureCommandContext & {
21
- event: `${CoreEvent.FAILED}` | `${CoreEvent.CONFIGURED}` | `${CoreEvent.CONFIGURING}`;
22
- };
23
- export type CoreDestroyEventContext = CoreDestroyCommandContext & {
24
- event: `${CoreEvent.FAILED}` | `${CoreEvent.DESTROYED}` | `${CoreEvent.DESTROYING}` | `${CoreEvent.NONE}`;
25
- };
26
- export type CoreBucketEventPayload = {
27
- id: string;
28
- bucketType: `${AnalysisBucketType}`;
29
- bucketId: string;
30
- };
31
- export type CoreBucketCreatedEventContext = {
32
- event: `${CoreEvent.BUCKET_CREATED}`;
33
- data: CoreBucketEventPayload;
34
- };
35
- export type CoreBucketDeletedEventContext = {
36
- event: `${CoreEvent.BUCKET_DELETED}`;
37
- data: CoreBucketEventPayload;
38
- };
39
- export type CoreCommandContext = CoreDestroyCommandContext | CoreConfigureCommandContext;
40
- export type CoreEventContext = CoreDestroyEventContext | CoreConfigureEventContext | CoreBucketCreatedEventContext | CoreBucketDeletedEventContext;
41
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/core/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE1D,MAAM,MAAM,eAAe,GAAG;IAC1B,KAAK,CAAC,EAAE,KAAK,CAAA;CAChB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,eAAe,GAAG;IACjD,EAAE,EAAE,MAAM,CAAA;CACb,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,eAAe,GAAG;IAC/C,EAAE,EAAE,MAAM,CAAA;CACb,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACtC,OAAO,EAAE,GAAG,WAAW,CAAC,SAAS,EAAE,CAAC;IACpC,IAAI,EAAE,oBAAoB,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACpC,OAAO,EAAE,GAAG,WAAW,CAAC,OAAO,EAAE,CAAC;IAClC,IAAI,EAAE,kBAAkB,CAAA;CAC3B,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,2BAA2B,GAAG;IAClE,KAAK,EAAE,GAAG,SAAS,CAAC,MAAM,EAAE,GACxB,GAAG,SAAS,CAAC,UAAU,EAAE,GACzB,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,yBAAyB,GAAG;IAC9D,KAAK,EAAE,GAAG,SAAS,CAAC,MAAM,EAAE,GACxB,GAAG,SAAS,CAAC,SAAS,EAAE,GACxB,GAAG,SAAS,CAAC,UAAU,EAAE,GACzB,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,GAAG,kBAAkB,EAAE,CAAC;IACpC,QAAQ,EAAE,MAAM,CAAA;CACnB,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IACxC,KAAK,EAAE,GAAG,SAAS,CAAC,cAAc,EAAE,CAAC;IACrC,IAAI,EAAE,sBAAsB,CAAA;CAC/B,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IACxC,KAAK,EAAE,GAAG,SAAS,CAAC,cAAc,EAAE,CAAC;IACrC,IAAI,EAAE,sBAAsB,CAAA;CAC/B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,yBAAyB,GAAG,2BAA2B,CAAC;AACzF,MAAM,MAAM,gBAAgB,GAAG,uBAAuB,GACtD,yBAAyB,GACzB,6BAA6B,GAC7B,6BAA6B,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './types';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/master-images/build/index.ts"],"names":[],"mappings":"AAOA,cAAc,SAAS,CAAC"}
@@ -1,18 +0,0 @@
1
- import type { MasterImagesPushCommandPayloadTag } from '../push';
2
- export type MasterImagesBuildCommandPayload = {
3
- id: string;
4
- path: string;
5
- virtualPath: string;
6
- };
7
- export type MasterImagesBuildFailedEventPayload = {
8
- id: string;
9
- error: Error;
10
- };
11
- export type MasterImagesBuildingEventPayload = {
12
- id: string;
13
- };
14
- export type MasterImagesBuiltEventPayload = {
15
- id: string;
16
- tags: MasterImagesPushCommandPayloadTag[];
17
- };
18
- //# sourceMappingURL=types.d.ts.map