@privateaim/server-core-worker-kit 0.7.17
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/CHANGELOG.md +472 -0
- package/LICENSE +202 -0
- package/dist/components/builder/constants.d.ts +32 -0
- package/dist/components/builder/constants.d.ts.map +1 -0
- package/dist/components/builder/index.d.ts +4 -0
- package/dist/components/builder/index.d.ts.map +1 -0
- package/dist/components/builder/queue.d.ts +5 -0
- package/dist/components/builder/queue.d.ts.map +1 -0
- package/dist/components/builder/types.d.ts +35 -0
- package/dist/components/builder/types.d.ts.map +1 -0
- package/dist/components/core/constants.d.ts +24 -0
- package/dist/components/core/constants.d.ts.map +1 -0
- package/dist/components/core/index.d.ts +4 -0
- package/dist/components/core/index.d.ts.map +1 -0
- package/dist/components/core/queue.d.ts +5 -0
- package/dist/components/core/queue.d.ts.map +1 -0
- package/dist/components/core/types.d.ts +41 -0
- package/dist/components/core/types.d.ts.map +1 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/master-images/build/index.d.ts +2 -0
- package/dist/components/master-images/build/index.d.ts.map +1 -0
- package/dist/components/master-images/build/types.d.ts +18 -0
- package/dist/components/master-images/build/types.d.ts.map +1 -0
- package/dist/components/master-images/constants.d.ts +26 -0
- package/dist/components/master-images/constants.d.ts.map +1 -0
- package/dist/components/master-images/index.d.ts +7 -0
- package/dist/components/master-images/index.d.ts.map +1 -0
- package/dist/components/master-images/push/index.d.ts +2 -0
- package/dist/components/master-images/push/index.d.ts.map +1 -0
- package/dist/components/master-images/push/types.d.ts +17 -0
- package/dist/components/master-images/push/types.d.ts.map +1 -0
- package/dist/components/master-images/service/index.d.ts +3 -0
- package/dist/components/master-images/service/index.d.ts.map +1 -0
- package/dist/components/master-images/service/module.d.ts +16 -0
- package/dist/components/master-images/service/module.d.ts.map +1 -0
- package/dist/components/master-images/service/singleton.d.ts +3 -0
- package/dist/components/master-images/service/singleton.d.ts.map +1 -0
- package/dist/components/master-images/synchronize/index.d.ts +2 -0
- package/dist/components/master-images/synchronize/index.d.ts.map +1 -0
- package/dist/components/master-images/synchronize/types.d.ts +26 -0
- package/dist/components/master-images/synchronize/types.d.ts.map +1 -0
- package/dist/components/master-images/types.d.ts +40 -0
- package/dist/components/master-images/types.d.ts.map +1 -0
- package/dist/constants.d.ts +12 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/index.cjs +287 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +265 -0
- package/dist/index.mjs.map +1 -0
- package/dist/utils.d.ts +2 -0
- package/dist/utils.d.ts.map +1 -0
- package/package.json +41 -0
- package/rollup.config.mjs +14 -0
- package/src/components/builder/constants.ts +46 -0
- package/src/components/builder/index.ts +10 -0
- package/src/components/builder/queue.ts +39 -0
- package/src/components/builder/types.ts +57 -0
- package/src/components/core/constants.ts +38 -0
- package/src/components/core/index.ts +10 -0
- package/src/components/core/queue.ts +36 -0
- package/src/components/core/types.ts +66 -0
- package/src/components/index.ts +10 -0
- package/src/components/master-images/build/index.ts +8 -0
- package/src/components/master-images/build/types.ts +28 -0
- package/src/components/master-images/constants.ts +38 -0
- package/src/components/master-images/index.ts +14 -0
- package/src/components/master-images/push/index.ts +8 -0
- package/src/components/master-images/push/types.ts +25 -0
- package/src/components/master-images/service/index.ts +9 -0
- package/src/components/master-images/service/module.ts +125 -0
- package/src/components/master-images/service/singleton.ts +18 -0
- package/src/components/master-images/synchronize/index.ts +8 -0
- package/src/components/master-images/synchronize/types.ts +37 -0
- package/src/components/master-images/types.ts +67 -0
- package/src/constants.ts +19 -0
- package/src/index.ts +9 -0
- package/src/utils.ts +20 -0
- package/tsconfig.build.json +11 -0
- package/tsconfig.json +10 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../src/components/builder/constants.ts","../src/utils.ts","../src/components/builder/queue.ts","../src/components/core/constants.ts","../src/components/core/queue.ts","../src/components/master-images/constants.ts","../src/components/master-images/service/module.ts","../src/components/master-images/service/singleton.ts","../src/constants.ts"],"sourcesContent":["/*\n * Copyright (c) 2023-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { QueueRouterRoutingType } from '@privateaim/server-kit';\n\nexport enum BuilderEvent {\n BUILD_FAILED = 'buildFailed',\n BUILDING = 'building',\n BUILT = 'built',\n\n PUSH_FAILED = 'pushFailed',\n PUSHING = 'pushing',\n PUSHED = 'pushed',\n\n CHECK_FAILED = 'checkFailed',\n CHECKING = 'checking',\n CHECKED = 'checked',\n\n NONE = 'none',\n}\n\nexport enum BuilderCommand {\n BUILD = 'build',\n CHECK = 'check',\n PUSH = 'push',\n}\n\nexport enum BuilderErrorCode {\n ENTRYPOINT_NOT_FOUND = 'entrypointNotFound',\n MASTER_IMAGE_NOT_FOUND = 'masterImageNotFound',\n UNKNOWN = 'unknown',\n}\n\nexport const BuilderEventQueueRouterRouting = {\n type: QueueRouterRoutingType.PUB_SUB,\n key: 'analysisBuilderEvents',\n};\n\nexport const BuilderTaskQueueRouterRouting = {\n type: QueueRouterRoutingType.WORK,\n key: 'analysisBuilderCommands',\n};\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { hasOwnProperty } from '@privateaim/kit';\n\nexport function cleanupPayload<T extends Record<string, any>>(payload: T): T {\n if (hasOwnProperty(payload, 'entity')) {\n delete payload.entity;\n }\n\n if (hasOwnProperty(payload, 'registry')) {\n delete payload.registry;\n }\n\n return payload;\n}\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { QueueRouterPayload } from '@privateaim/server-kit';\nimport { buildQueueRouterPublishPayload } from '@privateaim/server-kit';\nimport { cleanupPayload } from '../../utils';\nimport {\n BuilderEventQueueRouterRouting,\n BuilderTaskQueueRouterRouting,\n} from './constants';\nimport type { BuilderCommandContext, BuilderEventContext } from './types';\n\nexport function buildBuilderTaskQueueRouterPayload(\n context: BuilderCommandContext,\n) : QueueRouterPayload {\n return buildQueueRouterPublishPayload({\n type: context.command,\n data: cleanupPayload(context.data),\n metadata: {\n routing: BuilderTaskQueueRouterRouting,\n },\n });\n}\n\nexport function buildBuilderEventQueueRouterPayload(\n context: BuilderEventContext,\n) : QueueRouterPayload {\n return buildQueueRouterPublishPayload({\n type: context.event,\n data: cleanupPayload(context.data),\n metadata: {\n routing: BuilderEventQueueRouterRouting,\n },\n });\n}\n","/*\n * Copyright (c) 2023-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { QueueRouterRoutingType } from '@privateaim/server-kit';\n\nexport enum CoreEvent {\n BUCKET_CREATED = 'bucketCreated',\n BUCKET_DELETED = 'bucketDeleted',\n\n CONFIGURING = 'configuring',\n CONFIGURED = 'configured',\n\n DESTROYING = 'destroying',\n DESTROYED = 'destroyed',\n\n FAILED = 'failed',\n\n NONE = 'none',\n}\n\nexport enum CoreCommand {\n CONFIGURE = 'configure',\n DESTROY = 'destroy',\n}\n\nexport const CoreEventQueueRouterRouting = {\n type: QueueRouterRoutingType.PUB_SUB,\n key: 'analysisCoreEvents',\n};\n\nexport const CoreTaskQueueRouterRouting = {\n type: QueueRouterRoutingType.WORK,\n key: 'analysisCoreCommands',\n};\n","/*\n * Copyright (c) 2023-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { QueueRouterPayload } from '@privateaim/server-kit';\nimport { buildQueueRouterPublishPayload } from '@privateaim/server-kit';\nimport { cleanupPayload } from '../../utils';\nimport { CoreEventQueueRouterRouting, CoreTaskQueueRouterRouting } from './constants';\nimport type { CoreCommandContext, CoreEventContext } from './types';\n\nexport function buildCoreTaskQueueRouterPayload(\n context: CoreCommandContext,\n) : QueueRouterPayload {\n return buildQueueRouterPublishPayload({\n type: context.command,\n data: cleanupPayload(context.data),\n metadata: {\n routing: CoreTaskQueueRouterRouting,\n },\n });\n}\n\nexport function buildCoreEventQueueRouterPayload(\n context: CoreEventContext,\n) : QueueRouterPayload {\n return buildQueueRouterPublishPayload({\n type: context.event,\n data: cleanupPayload(context.data),\n metadata: {\n routing: CoreEventQueueRouterRouting,\n },\n });\n}\n","/*\n * Copyright (c) 2023-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { QueueRouterRoutingType } from '@privateaim/server-kit';\n\nexport enum MasterImagesEvent {\n SYNCHRONIZING = 'synchronizing',\n SYNCHRONIZED = 'synchronized',\n SYNCHRONIZATION_FAILED = 'synchronizationFailed',\n\n BUILDING = 'building',\n BUILT = 'built',\n BUILD_FAILED = 'buildFailed',\n\n PUSHING = 'pushing',\n PUSHED = 'pushed',\n PUSH_FAILED = 'pushFailed',\n}\n\nexport enum MasterImagesCommand {\n SYNCHRONIZE = 'synchronize',\n BUILD = 'build',\n PUSH = 'push',\n}\n\nexport const MasterImagesEventQueueRouterRouting = {\n type: QueueRouterRoutingType.PUB_SUB,\n key: 'analysisMasterImagesEvents',\n};\n\nexport const MasterImagesTaskQueueRouterRouting = {\n type: QueueRouterRoutingType.WORK,\n key: 'analysisMasterImagesCommands',\n};\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { Cache, QueueRouter, QueueRouterHandlers } from '@privateaim/server-kit';\nimport { buildQueueRouterPublishPayload, useCache, useQueueRouter } from '@privateaim/server-kit';\nimport { cleanupPayload } from '../../../utils';\nimport {\n MasterImagesCommand,\n MasterImagesEventQueueRouterRouting,\n MasterImagesTaskQueueRouterRouting,\n} from '../constants';\nimport type {\n MasterImagesCommandContext,\n MasterImagesCommandMap,\n MasterImagesEventContext,\n MasterImagesEventMap,\n} from '../types';\n\nexport class MasterImageQueueService {\n protected cache : Cache;\n\n protected queueRouter : QueueRouter;\n\n constructor() {\n this.cache = useCache();\n this.queueRouter = useQueueRouter();\n }\n\n // -------------------------------------------------\n\n async publishCommand(ctx: MasterImagesCommandContext) {\n const isLocked = await this.isCommandLocked(ctx.command);\n if (isLocked) {\n throw new Error('The command is locked and can therefore not be executed.');\n }\n\n const routerPayload = this.buildRouterPayloadForCommand(ctx);\n await this.queueRouter.publish(routerPayload);\n\n if (ctx.command === MasterImagesCommand.SYNCHRONIZE) {\n await this.setCommandLock(ctx.command);\n }\n }\n\n async consumeCommands(\n handlers: QueueRouterHandlers<Partial<MasterImagesCommandMap>>,\n ) {\n await this.queueRouter.consume(MasterImagesTaskQueueRouterRouting, {\n $any: async (message) => {\n if (handlers[message.type]) {\n await handlers[message.type](message, this);\n }\n\n if (handlers.$any) {\n await handlers.$any(message);\n }\n },\n });\n }\n\n // -------------------------------------------------\n\n async publishEvent(ctx: MasterImagesEventContext) {\n const routerPayload = this.buildRouterPayloadForEvent(ctx);\n await this.queueRouter.publish(routerPayload);\n }\n\n async consumeEvents(\n handlers: QueueRouterHandlers<Partial<MasterImagesEventMap>>,\n ) {\n await this.queueRouter.consume(MasterImagesEventQueueRouterRouting, {\n $any: async (message) => {\n await this.setCommandLock(MasterImagesCommand.SYNCHRONIZE);\n\n if (handlers[message.type]) {\n await handlers[message.type](message);\n }\n\n if (handlers.$any) {\n await handlers.$any(message);\n }\n },\n });\n }\n\n // -------------------------------------------------\n\n protected async setCommandLock(command: string) {\n await this.cache.set(`master-images-command:${command}`, true, {\n ttl: 1000 * 60,\n });\n }\n\n protected async isCommandLocked(command: string) {\n const isActive = await this.cache.get(`master-images-command:${command}`);\n\n return !!isActive;\n }\n\n // -------------------------------------------------\n\n protected buildRouterPayloadForEvent(context: MasterImagesEventContext) {\n return buildQueueRouterPublishPayload({\n type: context.event,\n data: cleanupPayload(context.data),\n metadata: {\n routing: MasterImagesEventQueueRouterRouting,\n },\n });\n }\n\n protected buildRouterPayloadForCommand(context: MasterImagesCommandContext) {\n return buildQueueRouterPublishPayload({\n type: context.command,\n data: cleanupPayload(context.data),\n metadata: {\n routing: MasterImagesTaskQueueRouterRouting,\n },\n });\n }\n}\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { singa } from 'singa';\nimport { MasterImageQueueService } from './module';\n\nconst instance = singa<MasterImageQueueService>({\n name: 'masterImageQueue',\n factory: () => new MasterImageQueueService(),\n});\n\nexport function useMasterImageQueueService() {\n return instance.use();\n}\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport enum ComponentName {\n BUILDER = 'builder',\n CORE = 'core',\n MASTER_IMAGES = 'masterImages',\n}\n\nexport enum ErrorCode {\n NOT_FOUND = 'notFound',\n REGISTRY_NOT_FOUND = 'registryNotFound',\n REGISTRY_PROJECT_NOT_FOUND = 'registryProjectNotFound',\n NONE = 'none',\n}\n"],"names":["BuilderEvent","BuilderCommand","BuilderErrorCode","BuilderEventQueueRouterRouting","type","QueueRouterRoutingType","PUB_SUB","key","BuilderTaskQueueRouterRouting","WORK","cleanupPayload","payload","hasOwnProperty","entity","registry","buildBuilderTaskQueueRouterPayload","context","buildQueueRouterPublishPayload","command","data","metadata","routing","buildBuilderEventQueueRouterPayload","event","CoreEvent","CoreCommand","CoreEventQueueRouterRouting","CoreTaskQueueRouterRouting","buildCoreTaskQueueRouterPayload","buildCoreEventQueueRouterPayload","MasterImagesEvent","MasterImagesCommand","MasterImagesEventQueueRouterRouting","MasterImagesTaskQueueRouterRouting","MasterImageQueueService","publishCommand","ctx","isLocked","isCommandLocked","Error","routerPayload","buildRouterPayloadForCommand","queueRouter","publish","SYNCHRONIZE","setCommandLock","consumeCommands","handlers","consume","$any","message","publishEvent","buildRouterPayloadForEvent","consumeEvents","cache","set","ttl","isActive","get","useCache","useQueueRouter","instance","singa","name","factory","useMasterImageQueueService","use","ComponentName","ErrorCode"],"mappings":";;;;AASO,IAAA,YAAKA,iBAAAA,SAAAA,YAAAA,EAAAA;;;;;;;;;;;AAAAA,IAAAA,OAAAA,YAAAA;AAcX,CAAA,CAAA,EAAA;AAEM,IAAA,cAAKC,iBAAAA,SAAAA,cAAAA,EAAAA;;;;AAAAA,IAAAA,OAAAA,cAAAA;AAIX,CAAA,CAAA,EAAA;AAEM,IAAA,gBAAKC,iBAAAA,SAAAA,gBAAAA,EAAAA;;;;AAAAA,IAAAA,OAAAA,gBAAAA;AAIX,CAAA,CAAA,EAAA;MAEYC,8BAAAA,GAAiC;AAC1CC,IAAAA,IAAAA,EAAMC,uBAAuBC,OAAO;IACpCC,GAAAA,EAAK;AACT;MAEaC,6BAAAA,GAAgC;AACzCJ,IAAAA,IAAAA,EAAMC,uBAAuBI,IAAI;IACjCF,GAAAA,EAAK;AACT;;ACpCO,SAASG,eAA8CC,OAAU,EAAA;IACpE,IAAIC,cAAAA,CAAeD,SAAS,QAAA,CAAA,EAAW;AACnC,QAAA,OAAOA,QAAQE,MAAM;AACzB,IAAA;IAEA,IAAID,cAAAA,CAAeD,SAAS,UAAA,CAAA,EAAa;AACrC,QAAA,OAAOA,QAAQG,QAAQ;AAC3B,IAAA;IAEA,OAAOH,OAAAA;AACX;;ACHO,SAASI,mCACZC,OAA8B,EAAA;AAE9B,IAAA,OAAOC,8BAAAA,CAA+B;AAClCb,QAAAA,IAAAA,EAAMY,QAAQE,OAAO;QACrBC,IAAAA,EAAMT,cAAAA,CAAeM,QAAQG,IAAI,CAAA;QACjCC,QAAAA,EAAU;YACNC,OAAAA,EAASb;AACb;AACJ,KAAA,CAAA;AACJ;AAEO,SAASc,oCACZN,OAA4B,EAAA;AAE5B,IAAA,OAAOC,8BAAAA,CAA+B;AACl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AAAA,OAAAA,SAAAA;AAKX,CAAA,CAAA,EAAA;;;;"}
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AASA,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAU3E"}
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@privateaim/server-core-worker-kit",
|
|
3
|
+
"version": "0.7.17",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"description": "",
|
|
6
|
+
"exports": {
|
|
7
|
+
"./package.json": "./package.json",
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.mjs",
|
|
11
|
+
"require": "./dist/index.cjs"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"main": "./dist/index.cjs",
|
|
15
|
+
"module": "./dist/index.mjs",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"author": {
|
|
18
|
+
"name": "Peter Placzek",
|
|
19
|
+
"email": "admin@tada5hi.net",
|
|
20
|
+
"url": "https://github.com/tada5hi"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build:types": "tsc --emitDeclarationOnly -p tsconfig.build.json",
|
|
24
|
+
"build:js": "rollup -c",
|
|
25
|
+
"build": "rimraf ./dist && cross-env NODE_ENV=production npm run build:js && npm run build:types",
|
|
26
|
+
"build-watch": "rimraf ./dist && tsc -p tsconfig.build.json --watch"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@privateaim/core-kit": "^0.8.16",
|
|
30
|
+
"@privateaim/kit": "^0.8.16",
|
|
31
|
+
"@privateaim/server-kit": "^0.8.16",
|
|
32
|
+
"singa": "^1.0.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"docken": "^1.1.1"
|
|
36
|
+
},
|
|
37
|
+
"gitHead": "5d3b6f4ce1edf2383bdfbf66e913a08c8a3a2e40",
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2022-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 fs from 'node:fs';
|
|
9
|
+
|
|
10
|
+
import { createConfig } from '../../rollup.config.mjs';
|
|
11
|
+
|
|
12
|
+
export default createConfig({
|
|
13
|
+
pkg: JSON.parse(fs.readFileSync(new URL('./package.json', import.meta.url), {encoding: 'utf-8'})),
|
|
14
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
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 BuilderEvent {
|
|
11
|
+
BUILD_FAILED = 'buildFailed',
|
|
12
|
+
BUILDING = 'building',
|
|
13
|
+
BUILT = 'built',
|
|
14
|
+
|
|
15
|
+
PUSH_FAILED = 'pushFailed',
|
|
16
|
+
PUSHING = 'pushing',
|
|
17
|
+
PUSHED = 'pushed',
|
|
18
|
+
|
|
19
|
+
CHECK_FAILED = 'checkFailed',
|
|
20
|
+
CHECKING = 'checking',
|
|
21
|
+
CHECKED = 'checked',
|
|
22
|
+
|
|
23
|
+
NONE = 'none',
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export enum BuilderCommand {
|
|
27
|
+
BUILD = 'build',
|
|
28
|
+
CHECK = 'check',
|
|
29
|
+
PUSH = 'push',
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export enum BuilderErrorCode {
|
|
33
|
+
ENTRYPOINT_NOT_FOUND = 'entrypointNotFound',
|
|
34
|
+
MASTER_IMAGE_NOT_FOUND = 'masterImageNotFound',
|
|
35
|
+
UNKNOWN = 'unknown',
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const BuilderEventQueueRouterRouting = {
|
|
39
|
+
type: QueueRouterRoutingType.PUB_SUB,
|
|
40
|
+
key: 'analysisBuilderEvents',
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const BuilderTaskQueueRouterRouting = {
|
|
44
|
+
type: QueueRouterRoutingType.WORK,
|
|
45
|
+
key: 'analysisBuilderCommands',
|
|
46
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
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 './constants';
|
|
9
|
+
export * from './queue';
|
|
10
|
+
export * from './types';
|
|
@@ -0,0 +1,39 @@
|
|
|
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 { QueueRouterPayload } from '@privateaim/server-kit';
|
|
9
|
+
import { buildQueueRouterPublishPayload } from '@privateaim/server-kit';
|
|
10
|
+
import { cleanupPayload } from '../../utils';
|
|
11
|
+
import {
|
|
12
|
+
BuilderEventQueueRouterRouting,
|
|
13
|
+
BuilderTaskQueueRouterRouting,
|
|
14
|
+
} from './constants';
|
|
15
|
+
import type { BuilderCommandContext, BuilderEventContext } from './types';
|
|
16
|
+
|
|
17
|
+
export function buildBuilderTaskQueueRouterPayload(
|
|
18
|
+
context: BuilderCommandContext,
|
|
19
|
+
) : QueueRouterPayload {
|
|
20
|
+
return buildQueueRouterPublishPayload({
|
|
21
|
+
type: context.command,
|
|
22
|
+
data: cleanupPayload(context.data),
|
|
23
|
+
metadata: {
|
|
24
|
+
routing: BuilderTaskQueueRouterRouting,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function buildBuilderEventQueueRouterPayload(
|
|
30
|
+
context: BuilderEventContext,
|
|
31
|
+
) : QueueRouterPayload {
|
|
32
|
+
return buildQueueRouterPublishPayload({
|
|
33
|
+
type: context.event,
|
|
34
|
+
data: cleanupPayload(context.data),
|
|
35
|
+
metadata: {
|
|
36
|
+
routing: BuilderEventQueueRouterRouting,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
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 { BuilderCommand, BuilderEvent } from './constants';
|
|
9
|
+
|
|
10
|
+
export type BuilderBasePayload = {
|
|
11
|
+
id: string,
|
|
12
|
+
error?: Error
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type BuilderBuildPayload = BuilderBasePayload;
|
|
16
|
+
export type BuilderPushPayload = BuilderBasePayload;
|
|
17
|
+
export type BuilderCheckPayload = BuilderBasePayload;
|
|
18
|
+
|
|
19
|
+
export type BuilderBuildCommandContext = {
|
|
20
|
+
command: `${BuilderCommand.BUILD}`,
|
|
21
|
+
data: BuilderBuildPayload,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type BuilderPushCommandContext = {
|
|
25
|
+
command: `${BuilderCommand.PUSH}`,
|
|
26
|
+
data: BuilderPushPayload
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type BuilderCheckCommandContext = {
|
|
30
|
+
command: `${BuilderCommand.CHECK}`,
|
|
31
|
+
data: BuilderCheckPayload
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type BuilderBuildEventContext = {
|
|
35
|
+
data: BuilderBuildPayload;
|
|
36
|
+
event: `${BuilderEvent.BUILD_FAILED}` |
|
|
37
|
+
`${BuilderEvent.BUILT}` |
|
|
38
|
+
`${BuilderEvent.BUILDING}`;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type BuilderPushEventContext = {
|
|
42
|
+
data: BuilderPushPayload,
|
|
43
|
+
event: `${BuilderEvent.PUSH_FAILED}` |
|
|
44
|
+
`${BuilderEvent.PUSHED}` |
|
|
45
|
+
`${BuilderEvent.PUSHING}`;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export type BuilderCheckEventContext = {
|
|
49
|
+
data: BuilderCheckPayload,
|
|
50
|
+
event: `${BuilderEvent.CHECK_FAILED}` |
|
|
51
|
+
`${BuilderEvent.CHECKED}` |
|
|
52
|
+
`${BuilderEvent.CHECKING}` |
|
|
53
|
+
`${BuilderEvent.NONE}`;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export type BuilderCommandContext = BuilderCheckCommandContext | BuilderBuildCommandContext | BuilderPushCommandContext;
|
|
57
|
+
export type BuilderEventContext = BuilderCheckEventContext | BuilderBuildEventContext | BuilderPushEventContext;
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
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 './constants';
|
|
9
|
+
export * from './queue';
|
|
10
|
+
export * from './types';
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
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;
|
|
@@ -0,0 +1,10 @@
|
|
|
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 './builder';
|
|
9
|
+
export * from './core';
|
|
10
|
+
export * from './master-images';
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
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';
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
};
|