@ludeo/cloud-common 1.0.0 → 1.0.2
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/dist/decorators/index.d.ts +1 -0
- package/dist/decorators/index.js +18 -0
- package/dist/decorators/index.js.map +1 -0
- package/dist/index.d.ts +3 -4
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/infra/index.d.ts +1 -0
- package/dist/infra/index.js +18 -0
- package/dist/infra/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/v2/contexts/cloud-resource-context.js.map +1 -0
- package/dist/v2/contexts/cloud-session-context.js.map +1 -0
- package/dist/v2/contexts/create-cloud-resource-request-context.js.map +1 -0
- package/dist/v2/contexts/index.js.map +1 -0
- package/dist/v2/contexts/pool-context.js.map +1 -0
- package/dist/{events → v2/events}/allocate-cloud-resource-request.event.d.ts +1 -1
- package/dist/{events → v2/events}/allocate-cloud-resource-request.event.js +2 -2
- package/dist/v2/events/allocate-cloud-resource-request.event.js.map +1 -0
- package/dist/{events → v2/events}/allocate-cloud-session-failed.event.d.ts +1 -1
- package/dist/{events → v2/events}/allocate-cloud-session-failed.event.js +2 -2
- package/dist/v2/events/allocate-cloud-session-failed.event.js.map +1 -0
- package/dist/{events → v2/events}/allocate-cloud-session-request.event.d.ts +1 -1
- package/dist/{events → v2/events}/allocate-cloud-session-request.event.js +2 -2
- package/dist/v2/events/allocate-cloud-session-request.event.js.map +1 -0
- package/dist/{events → v2/events}/allocate-pool-item-failed.event.d.ts +1 -1
- package/dist/{events → v2/events}/allocate-pool-item-failed.event.js +2 -2
- package/dist/v2/events/allocate-pool-item-failed.event.js.map +1 -0
- package/dist/{events → v2/events}/allocate-pool-item-request.event.d.ts +1 -1
- package/dist/{events → v2/events}/allocate-pool-item-request.event.js +2 -2
- package/dist/v2/events/allocate-pool-item-request.event.js.map +1 -0
- package/dist/{events → v2/events}/cloud-resource-allocated.event.d.ts +1 -1
- package/dist/{events → v2/events}/cloud-resource-allocated.event.js +2 -2
- package/dist/v2/events/cloud-resource-allocated.event.js.map +1 -0
- package/dist/{events → v2/events}/cloud-resource-created.event.d.ts +1 -1
- package/dist/{events → v2/events}/cloud-resource-created.event.js +2 -2
- package/dist/v2/events/cloud-resource-created.event.js.map +1 -0
- package/dist/{events → v2/events}/cloud-resource-creation-failed.event.d.ts +1 -1
- package/dist/{events → v2/events}/cloud-resource-creation-failed.event.js +2 -2
- package/dist/v2/events/cloud-resource-creation-failed.event.js.map +1 -0
- package/dist/{events → v2/events}/cloud-resource-status.event.d.ts +1 -1
- package/dist/{events → v2/events}/cloud-resource-status.event.js +2 -2
- package/dist/v2/events/cloud-resource-status.event.js.map +1 -0
- package/dist/{events → v2/events}/cloud-session-allocated.event.d.ts +1 -1
- package/dist/{events → v2/events}/cloud-session-allocated.event.js +2 -2
- package/dist/v2/events/cloud-session-allocated.event.js.map +1 -0
- package/dist/{events → v2/events}/cloud-session-ended.event.d.ts +1 -1
- package/dist/{events → v2/events}/cloud-session-ended.event.js +2 -2
- package/dist/v2/events/cloud-session-ended.event.js.map +1 -0
- package/dist/{events → v2/events}/create-cloud-resource-request.event.d.ts +1 -1
- package/dist/{events → v2/events}/create-cloud-resource-request.event.js +2 -2
- package/dist/v2/events/create-cloud-resource-request.event.js.map +1 -0
- package/dist/v2/events/index.js.map +1 -0
- package/dist/{events → v2/events}/monitor-pool-task.event.d.ts +1 -1
- package/dist/{events → v2/events}/monitor-pool-task.event.js +6 -1
- package/dist/v2/events/monitor-pool-task.event.js.map +1 -0
- package/dist/{events → v2/events}/pool-created.event.d.ts +1 -1
- package/dist/{events → v2/events}/pool-created.event.js +2 -2
- package/dist/v2/events/pool-created.event.js.map +1 -0
- package/dist/{events → v2/events}/pool-item-allocated.event.d.ts +1 -1
- package/dist/{events → v2/events}/pool-item-allocated.event.js +2 -2
- package/dist/v2/events/pool-item-allocated.event.js.map +1 -0
- package/dist/{events → v2/events}/pool-resize-success.event.d.ts +1 -1
- package/dist/{events → v2/events}/pool-resize-success.event.js +2 -2
- package/dist/v2/events/pool-resize-success.event.js.map +1 -0
- package/dist/{events → v2/events}/pool-status.event.d.ts +1 -1
- package/dist/{events → v2/events}/pool-status.event.js +2 -2
- package/dist/v2/events/pool-status.event.js.map +1 -0
- package/dist/{events → v2/events}/pool-updated.event.d.ts +1 -1
- package/dist/{events → v2/events}/pool-updated.event.js +2 -2
- package/dist/v2/events/pool-updated.event.js.map +1 -0
- package/dist/{events → v2/events}/remove-scheduled-task-request.event.d.ts +1 -1
- package/dist/{events → v2/events}/remove-scheduled-task-request.event.js +1 -1
- package/dist/v2/events/remove-scheduled-task-request.event.js.map +1 -0
- package/dist/{events → v2/events}/resize-pool-request.event.d.ts +1 -1
- package/dist/{events → v2/events}/resize-pool-request.event.js +2 -2
- package/dist/v2/events/resize-pool-request.event.js.map +1 -0
- package/dist/{events → v2/events}/schedule-task-request.event.d.ts +1 -1
- package/dist/{events → v2/events}/schedule-task-request.event.js +14 -2
- package/dist/v2/events/schedule-task-request.event.js.map +1 -0
- package/dist/{events → v2/events}/set-pool.event.d.ts +1 -1
- package/dist/{events → v2/events}/set-pool.event.js +2 -2
- package/dist/v2/events/set-pool.event.js.map +1 -0
- package/dist/{events → v2/events}/token-required.event.d.ts +2 -2
- package/dist/{events → v2/events}/token-required.event.js +31 -2
- package/dist/v2/events/token-required.event.js.map +1 -0
- package/dist/v2/index.d.ts +4 -0
- package/dist/v2/index.js +8 -0
- package/dist/v2/index.js.map +1 -0
- package/dist/v2/models/cloud-pool.js.map +1 -0
- package/dist/v2/models/index.js.map +1 -0
- package/dist/v2/types/index.d.ts +78 -0
- package/dist/{types → v2/types}/index.js +1 -1
- package/dist/v2/types/index.js.map +1 -0
- package/index.ts +1 -0
- package/package.json +1 -1
- package/src/decorators/index.ts +1 -0
- package/src/index.ts +3 -4
- package/src/infra/index.ts +1 -0
- package/src/{contexts → v2/contexts}/create-cloud-resource-request-context.ts +2 -0
- package/src/{events → v2/events}/allocate-cloud-resource-request.event.ts +3 -2
- package/src/{events → v2/events}/allocate-cloud-session-failed.event.ts +2 -2
- package/src/{events → v2/events}/allocate-cloud-session-request.event.ts +2 -2
- package/src/{events → v2/events}/allocate-pool-item-failed.event.ts +2 -2
- package/src/{events → v2/events}/allocate-pool-item-request.event.ts +2 -2
- package/src/{events → v2/events}/cloud-resource-allocated.event.ts +2 -2
- package/src/{events → v2/events}/cloud-resource-created.event.ts +7 -2
- package/src/{events → v2/events}/cloud-resource-creation-failed.event.ts +2 -2
- package/src/{events → v2/events}/cloud-resource-status.event.ts +2 -2
- package/src/{events → v2/events}/cloud-session-allocated.event.ts +2 -2
- package/src/{events → v2/events}/cloud-session-ended.event.ts +2 -2
- package/src/{events → v2/events}/create-cloud-resource-request.event.ts +2 -2
- package/src/{events → v2/events}/index.ts +1 -0
- package/src/{events → v2/events}/monitor-pool-task.event.ts +3 -1
- package/src/v2/events/monitor-resource-task.event.ts +29 -0
- package/src/{events → v2/events}/pool-created.event.ts +2 -2
- package/src/{events → v2/events}/pool-item-allocated.event.ts +2 -2
- package/src/{events → v2/events}/pool-resize-success.event.ts +2 -2
- package/src/{events → v2/events}/pool-status.event.ts +5 -3
- package/src/{events → v2/events}/pool-updated.event.ts +2 -2
- package/src/{events → v2/events}/remove-scheduled-task-request.event.ts +1 -1
- package/src/{events → v2/events}/resize-pool-request.event.ts +5 -2
- package/src/{events → v2/events}/schedule-task-request.event.ts +19 -3
- package/src/{events → v2/events}/set-pool.event.ts +2 -2
- package/src/{events → v2/events}/token-required.event.ts +18 -4
- package/src/v2/index.ts +4 -0
- package/src/{types → v2/types}/index.ts +4 -1
- package/dist/contexts/cloud-resource-context.js.map +0 -1
- package/dist/contexts/cloud-session-context.js.map +0 -1
- package/dist/contexts/create-cloud-resource-request-context.js.map +0 -1
- package/dist/contexts/index.js.map +0 -1
- package/dist/contexts/pool-context.js.map +0 -1
- package/dist/events/allocate-cloud-resource-request.event.js.map +0 -1
- package/dist/events/allocate-cloud-session-failed.event.js.map +0 -1
- package/dist/events/allocate-cloud-session-request.event.js.map +0 -1
- package/dist/events/allocate-pool-item-failed.event.js.map +0 -1
- package/dist/events/allocate-pool-item-request.event.js.map +0 -1
- package/dist/events/cloud-resource-allocated.event.js.map +0 -1
- package/dist/events/cloud-resource-created.event.js.map +0 -1
- package/dist/events/cloud-resource-creation-failed.event.js.map +0 -1
- package/dist/events/cloud-resource-status.event.js.map +0 -1
- package/dist/events/cloud-session-allocated.event.js.map +0 -1
- package/dist/events/cloud-session-ended.event.js.map +0 -1
- package/dist/events/create-cloud-resource-request.event.js.map +0 -1
- package/dist/events/index.js.map +0 -1
- package/dist/events/monitor-pool-task.event.js.map +0 -1
- package/dist/events/pool-created.event.js.map +0 -1
- package/dist/events/pool-item-allocated.event.js.map +0 -1
- package/dist/events/pool-resize-success.event.js.map +0 -1
- package/dist/events/pool-status.event.js.map +0 -1
- package/dist/events/pool-updated.event.js.map +0 -1
- package/dist/events/remove-scheduled-task-request.event.js.map +0 -1
- package/dist/events/resize-pool-request.event.js.map +0 -1
- package/dist/events/schedule-task-request.event.js.map +0 -1
- package/dist/events/set-pool.event.js.map +0 -1
- package/dist/events/token-required.event.js.map +0 -1
- package/dist/models/cloud-pool.js.map +0 -1
- package/dist/models/index.js.map +0 -1
- package/dist/types/index.d.ts +0 -81
- package/dist/types/index.js.map +0 -1
- /package/dist/{contexts → v2/contexts}/cloud-resource-context.d.ts +0 -0
- /package/dist/{contexts → v2/contexts}/cloud-resource-context.js +0 -0
- /package/dist/{contexts → v2/contexts}/cloud-session-context.d.ts +0 -0
- /package/dist/{contexts → v2/contexts}/cloud-session-context.js +0 -0
- /package/dist/{contexts → v2/contexts}/create-cloud-resource-request-context.d.ts +0 -0
- /package/dist/{contexts → v2/contexts}/create-cloud-resource-request-context.js +0 -0
- /package/dist/{contexts → v2/contexts}/index.d.ts +0 -0
- /package/dist/{contexts → v2/contexts}/index.js +0 -0
- /package/dist/{contexts → v2/contexts}/pool-context.d.ts +0 -0
- /package/dist/{contexts → v2/contexts}/pool-context.js +0 -0
- /package/dist/{events → v2/events}/index.d.ts +0 -0
- /package/dist/{events → v2/events}/index.js +0 -0
- /package/dist/{models → v2/models}/cloud-pool.d.ts +0 -0
- /package/dist/{models → v2/models}/cloud-pool.js +0 -0
- /package/dist/{models → v2/models}/index.d.ts +0 -0
- /package/dist/{models → v2/models}/index.js +0 -0
- /package/src/{contexts → v2/contexts}/cloud-resource-context.ts +0 -0
- /package/src/{contexts → v2/contexts}/cloud-session-context.ts +0 -0
- /package/src/{contexts → v2/contexts}/index.ts +0 -0
- /package/src/{contexts → v2/contexts}/pool-context.ts +0 -0
- /package/src/{models → v2/models}/cloud-pool.ts +0 -0
- /package/src/{models → v2/models}/index.ts +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PoolContext } from "../contexts/pool-context";
|
|
2
|
-
import { LudeoEvent } from "
|
|
2
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
3
3
|
import { CloudPoolConfiguration } from "../types";
|
|
4
4
|
export declare class SetPoolEvent extends LudeoEvent {
|
|
5
5
|
static readonly EVENT_NAME = "cloud-pools.set-pool";
|
|
@@ -11,8 +11,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.SetPoolEvent = void 0;
|
|
13
13
|
const pool_context_1 = require("../contexts/pool-context");
|
|
14
|
-
const validate_nested_type_decorator_1 = require("
|
|
15
|
-
const ludeo_event_1 = require("
|
|
14
|
+
const validate_nested_type_decorator_1 = require("../../decorators/validate-nested-type.decorator");
|
|
15
|
+
const ludeo_event_1 = require("../../infra/ludeo-event");
|
|
16
16
|
const types_1 = require("../types");
|
|
17
17
|
class SetPoolEvent extends ludeo_event_1.LudeoEvent {
|
|
18
18
|
constructor(payload, context) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-pool.event.js","sourceRoot":"","sources":["../../../src/v2/events/set-pool.event.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2DAAuD;AACvD,oGAAqF;AACrF,yDAAqD;AACrD,oCAAkD;AAElD,MAAa,YAAa,SAAQ,wBAAU;IAG1C,YAAY,OAAwC,EAAE,OAAoB;QACxE,KAAK,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;;AAPH,oCAcC;AAbiB,uBAAU,GAAG,sBAAsB,CAAC;AASpD;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,0BAAW,CAAC;8BAC7B,0BAAW;6CAAC;AAGrB;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,8BAAsB,CAAC;;6CACR"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LudeoEvent } from "
|
|
1
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
2
2
|
export declare class TokenRequiredEventData {
|
|
3
3
|
defaultUser: string;
|
|
4
4
|
authSource: string;
|
|
@@ -15,6 +15,6 @@ export declare class TokenRequiredEventPayload {
|
|
|
15
15
|
export declare class TokenRequired extends LudeoEvent {
|
|
16
16
|
static readonly EVENT_NAME = "tokens.token-required";
|
|
17
17
|
payload: TokenRequiredEventPayload;
|
|
18
|
-
context
|
|
18
|
+
context?: never;
|
|
19
19
|
constructor(payload: TokenRequiredEventPayload, context?: never);
|
|
20
20
|
}
|
|
@@ -10,14 +10,43 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.TokenRequired = exports.TokenRequiredEventPayload = exports.TokenRequiredEventData = void 0;
|
|
13
|
-
const ludeo_event_1 = require("
|
|
14
|
-
const validate_nested_type_decorator_1 = require("
|
|
13
|
+
const ludeo_event_1 = require("../../infra/ludeo-event");
|
|
14
|
+
const validate_nested_type_decorator_1 = require("../../decorators/validate-nested-type.decorator");
|
|
15
|
+
const class_validator_1 = require("class-validator");
|
|
15
16
|
class TokenRequiredEventData {
|
|
16
17
|
}
|
|
17
18
|
exports.TokenRequiredEventData = TokenRequiredEventData;
|
|
18
19
|
class TokenRequiredEventPayload {
|
|
19
20
|
}
|
|
20
21
|
exports.TokenRequiredEventPayload = TokenRequiredEventPayload;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsString)(),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], TokenRequiredEventPayload.prototype, "id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, class_validator_1.IsString)(),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], TokenRequiredEventPayload.prototype, "type", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_validator_1.IsString)(),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], TokenRequiredEventPayload.prototype, "userId", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, class_validator_1.IsNumber)(),
|
|
36
|
+
__metadata("design:type", Number)
|
|
37
|
+
], TokenRequiredEventPayload.prototype, "expireAt", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, class_validator_1.IsNumber)(),
|
|
40
|
+
__metadata("design:type", Number)
|
|
41
|
+
], TokenRequiredEventPayload.prototype, "quota", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, class_validator_1.IsBoolean)(),
|
|
44
|
+
__metadata("design:type", Boolean)
|
|
45
|
+
], TokenRequiredEventPayload.prototype, "isUnique", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, validate_nested_type_decorator_1.ValidateNestedType)(() => TokenRequiredEventData),
|
|
48
|
+
__metadata("design:type", TokenRequiredEventData)
|
|
49
|
+
], TokenRequiredEventPayload.prototype, "data", void 0);
|
|
21
50
|
class TokenRequired extends ludeo_event_1.LudeoEvent {
|
|
22
51
|
constructor(payload, context) {
|
|
23
52
|
super(TokenRequired.EVENT_NAME);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-required.event.js","sourceRoot":"","sources":["../../../src/v2/events/token-required.event.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAqD;AACrD,oGAAqF;AACrF,qDAAgE;AAEhE,MAAa,sBAAsB;CAGlC;AAHD,wDAGC;AAED,MAAa,yBAAyB;CAqBrC;AArBD,8DAqBC;AAnBC;IADC,IAAA,0BAAQ,GAAE;;qDACA;AAGX;IADC,IAAA,0BAAQ,GAAE;;uDACE;AAGb;IADC,IAAA,0BAAQ,GAAE;;yDACI;AAGf;IADC,IAAA,0BAAQ,GAAE;;2DACM;AAGjB;IADC,IAAA,0BAAQ,GAAE;;wDACG;AAGd;IADC,IAAA,2BAAS,GAAE;;2DACM;AAGlB;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,sBAAsB,CAAC;8BAC3C,sBAAsB;uDAAC;AAG/B,MAAa,aAAc,SAAQ,wBAAU;IAQ3C,YAAY,OAAkC,EAAE,OAAe;QAC7D,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAChC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;;AAZH,sCAaC;AAZiB,wBAAU,GAAG,uBAAuB,CAAC;AAGrD;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,yBAAyB,CAAC;8BAC3C,yBAAyB;8CAAC"}
|
package/dist/v2/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Types = exports.Events = exports.Models = exports.Contexts = void 0;
|
|
4
|
+
exports.Contexts = require("./contexts");
|
|
5
|
+
exports.Models = require("./models");
|
|
6
|
+
exports.Events = require("./events");
|
|
7
|
+
exports.Types = require("./types");
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v2/index.ts"],"names":[],"mappings":";;;AAAA,yCAAuC;AACvC,qCAAmC;AACnC,qCAAmC;AACnC,mCAAiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloud-pool.js","sourceRoot":"","sources":["../../../src/v2/models/cloud-pool.ts"],"names":[],"mappings":";;;AAMA,MAAa,SAAS;CAOrB;AAPD,8BAOC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v2/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { GameCast } from "@ludeo/aws-gamecast-sdk";
|
|
2
|
+
export declare class AWSRequestData {
|
|
3
|
+
signalRequest: string;
|
|
4
|
+
}
|
|
5
|
+
export type CloudProviderRequest = AWSRequestData;
|
|
6
|
+
export declare class CloudProviderRequestData {
|
|
7
|
+
authToken: string;
|
|
8
|
+
appToken: string;
|
|
9
|
+
cloudProviderRequest: CloudProviderRequest;
|
|
10
|
+
}
|
|
11
|
+
export declare enum CloudProvider {
|
|
12
|
+
AWS = "aws"
|
|
13
|
+
}
|
|
14
|
+
export declare class AWSResourceCreationConfig {
|
|
15
|
+
streamGroupId: string;
|
|
16
|
+
identifier: GameCast.Identifier;
|
|
17
|
+
additionalEnvironmentVariables?: GameCast.EnvironmentVariables;
|
|
18
|
+
protocol?: GameCast.Protocol;
|
|
19
|
+
connectionTimeoutSeconds?: GameCast.ConnectionTimeoutSeconds;
|
|
20
|
+
sessionLengthSeconds?: GameCast.SessionLengthSeconds;
|
|
21
|
+
applicationIdentifier?: GameCast.Identifier;
|
|
22
|
+
region?: string;
|
|
23
|
+
}
|
|
24
|
+
export type CloudResourceCreationConfig = AWSResourceCreationConfig;
|
|
25
|
+
export declare enum CloudResourceStatus {
|
|
26
|
+
Allocated = "allocated",
|
|
27
|
+
Available = "available",
|
|
28
|
+
Creating = "creating",
|
|
29
|
+
Allocating = "allocating",
|
|
30
|
+
Error = "error",
|
|
31
|
+
Terminated = "terminated",
|
|
32
|
+
Terminating = "terminating"
|
|
33
|
+
}
|
|
34
|
+
export declare class AllocateCloudResourceRequestData {
|
|
35
|
+
providerSettings: CloudResourceCreationConfig;
|
|
36
|
+
requestData: CloudProviderRequestData;
|
|
37
|
+
}
|
|
38
|
+
export declare class AwsAllocationData {
|
|
39
|
+
streamGroupId: string;
|
|
40
|
+
streamSessionId: string;
|
|
41
|
+
signalResponse: string;
|
|
42
|
+
}
|
|
43
|
+
export type CloudProviderAllocationData = AwsAllocationData;
|
|
44
|
+
export declare class AWSResourceProviderSettings {
|
|
45
|
+
streamSessionId: string;
|
|
46
|
+
streamGroupId: string;
|
|
47
|
+
}
|
|
48
|
+
export declare class AWSCreationResponse {
|
|
49
|
+
signalResponse?: GameCast.SignalResponse;
|
|
50
|
+
streamSessionId: string;
|
|
51
|
+
}
|
|
52
|
+
export type CreationResponse = AWSCreationResponse;
|
|
53
|
+
export declare enum CloudPoolStatus {
|
|
54
|
+
Active = "active",
|
|
55
|
+
Scaling = "scaling",
|
|
56
|
+
Terminated = "terminated"
|
|
57
|
+
}
|
|
58
|
+
export declare class CloudPoolConfiguration {
|
|
59
|
+
providerSettings?: CloudResourceCreationConfig;
|
|
60
|
+
cloudProvider: CloudProvider;
|
|
61
|
+
poolId: string;
|
|
62
|
+
poolScaleConfiguration: PoolScaleConfiguration;
|
|
63
|
+
}
|
|
64
|
+
export type CloudResourcesMap = Record<string, {
|
|
65
|
+
status: CloudResourceStatus;
|
|
66
|
+
}>;
|
|
67
|
+
export declare class PoolScaleConfiguration {
|
|
68
|
+
size: number;
|
|
69
|
+
}
|
|
70
|
+
export declare class PoolItemAllocatedPayload {
|
|
71
|
+
allocationData?: CloudProviderAllocationData;
|
|
72
|
+
}
|
|
73
|
+
export type CloudResourcesStatusMap = Record<CloudResourceStatus, number>;
|
|
74
|
+
export declare class AllocationRequestData {
|
|
75
|
+
authToken: string;
|
|
76
|
+
appToken: string;
|
|
77
|
+
cloudProviderRequest: CloudProviderRequest;
|
|
78
|
+
}
|
|
@@ -11,7 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.AllocationRequestData = exports.PoolItemAllocatedPayload = exports.PoolScaleConfiguration = exports.CloudPoolConfiguration = exports.CloudPoolStatus = exports.AWSCreationResponse = exports.AWSResourceProviderSettings = exports.AwsAllocationData = exports.AllocateCloudResourceRequestData = exports.CloudResourceStatus = exports.AWSResourceCreationConfig = exports.CloudProvider = exports.CloudProviderRequestData = exports.AWSRequestData = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
|
-
const validate_nested_type_decorator_1 = require("
|
|
14
|
+
const validate_nested_type_decorator_1 = require("../../decorators/validate-nested-type.decorator");
|
|
15
15
|
const aws_gamecast_sdk_1 = require("@ludeo/aws-gamecast-sdk");
|
|
16
16
|
class AWSRequestData {
|
|
17
17
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v2/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAQyB;AACzB,oGAAqF;AACrF,8DAAmD;AAEnD,MAAa,cAAc;CAI1B;AAJD,wCAIC;AADC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;qDACS;AAKxB,MAAa,wBAAwB;CAUpC;AAVD,4DAUC;AARC;IADC,IAAA,wBAAM,GAAE;;2DACS;AAGlB;IADC,IAAA,wBAAM,GAAE;;0DACQ;AAIjB;IAFC,IAAA,2BAAS,GAAE;IACX,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,cAAc,CAAC;;sEACE;AAG7C,IAAY,aAEX;AAFD,WAAY,aAAa;IACvB,4BAAW,CAAA;AACb,CAAC,EAFW,aAAa,6BAAb,aAAa,QAExB;AAED,MAAa,yBAAyB;CASrC;AATD,8DASC;AAID,IAAY,mBAQX;AARD,WAAY,mBAAmB;IAC7B,8CAAuB,CAAA;IACvB,8CAAuB,CAAA;IACvB,4CAAqB,CAAA;IACrB,gDAAyB,CAAA;IACzB,sCAAe,CAAA;IACf,gDAAyB,CAAA;IACzB,kDAA2B,CAAA;AAC7B,CAAC,EARW,mBAAmB,mCAAnB,mBAAmB,QAQ9B;AAED,MAAa,gCAAgC;CAG5C;AAHD,4EAGC;AAED,MAAa,iBAAiB;CAI7B;AAJD,8CAIC;AAID,MAAa,2BAA2B;CAGvC;AAHD,kEAGC;AAED,MAAa,mBAAmB;CAO/B;AAPD,kDAOC;AALC;IADC,IAAA,4BAAU,GAAE;;2DAC4B;AAIzC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;4DACW;AAK1B,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,oCAAiB,CAAA;IACjB,sCAAmB,CAAA;IACnB,4CAAyB,CAAA;AAC3B,CAAC,EAJW,eAAe,+BAAf,eAAe,QAI1B;AAED,MAAa,sBAAsB;CAOlC;AAPD,wDAOC;AAJC;IADC,IAAA,wBAAM,EAAC,aAAa,CAAC;;6DACO;AAE7B;IADC,IAAA,wBAAM,GAAE;;sDACM;AAMjB,MAAa,sBAAsB;CAGlC;AAHD,wDAGC;AADC;IADC,IAAA,0BAAQ,GAAE;;oDACE;AAGf,MAAa,wBAAwB;CAGpC;AAHD,4DAGC;AADC;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC;;gEACC;AAK/C,MAAa,qBAAqB;CAIjC;AAJD,sDAIC"}
|
package/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./src/index";
|
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./validate-nested-type.decorator";
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./types";
|
|
1
|
+
export * as V2 from "./v2";
|
|
2
|
+
export * as Decorators from "./decorators";
|
|
3
|
+
export * from "./infra";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ludeo-event";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CloudSessionContext } from "../contexts/cloud-session-context";
|
|
2
|
-
import { ValidateNestedType } from "
|
|
3
|
-
import { LudeoEvent } from "
|
|
2
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
3
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
4
4
|
import {
|
|
5
5
|
AWSResourceCreationConfig,
|
|
6
6
|
CloudProviderRequestData,
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
export class AllocateCloudResourceRequestPayload {
|
|
11
11
|
@ValidateNestedType(() => AWSResourceCreationConfig)
|
|
12
12
|
providerSettings: CloudResourceCreationConfig;
|
|
13
|
+
|
|
13
14
|
@ValidateNestedType(() => CloudProviderRequestData)
|
|
14
15
|
requestData: CloudProviderRequestData;
|
|
15
16
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IsString } from "class-validator";
|
|
2
2
|
import { CloudSessionContext } from "../contexts/cloud-session-context";
|
|
3
|
-
import { ValidateNestedType } from "
|
|
4
|
-
import { LudeoEvent } from "
|
|
3
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
4
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
5
5
|
|
|
6
6
|
export class AllocateCloudSessionFailedPayload {
|
|
7
7
|
@IsString()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CloudSessionContext } from "../contexts/cloud-session-context";
|
|
2
|
-
import { ValidateNestedType } from "
|
|
3
|
-
import { LudeoEvent } from "
|
|
2
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
3
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
4
4
|
import { AllocationRequestData } from "../types";
|
|
5
5
|
|
|
6
6
|
export class AllocateCloudSessionRequestPayload {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IsString } from "class-validator";
|
|
2
2
|
import { CloudSessionContext } from "../contexts/cloud-session-context";
|
|
3
|
-
import { ValidateNestedType } from "
|
|
4
|
-
import { LudeoEvent } from "
|
|
3
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
4
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
5
5
|
|
|
6
6
|
export class AllocatePoolItemFailedPayload {
|
|
7
7
|
@IsString()
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LudeoEvent } from "
|
|
2
|
-
import { ValidateNestedType } from "
|
|
1
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
2
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
3
3
|
import { CloudSessionContext } from "../contexts/cloud-session-context";
|
|
4
4
|
import { CloudProviderRequestData } from "../types";
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CloudSessionContext } from "../contexts/cloud-session-context";
|
|
2
|
-
import { ValidateNestedType } from "
|
|
3
|
-
import { LudeoEvent } from "
|
|
2
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
3
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
4
4
|
import { AwsAllocationData, CloudProviderAllocationData } from "../types";
|
|
5
5
|
|
|
6
6
|
export class CloudResourceAllocatedPayload {
|
|
@@ -1,22 +1,27 @@
|
|
|
1
|
-
import { LudeoEvent } from "
|
|
1
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
2
2
|
import { AWSCreationResponse, CloudProvider, CreationResponse } from "../types";
|
|
3
3
|
import { CloudSessionContext } from "../contexts/cloud-session-context";
|
|
4
4
|
import { IsEnum, IsOptional, IsString, IsUUID } from "class-validator";
|
|
5
|
-
import { ValidateNestedType } from "
|
|
5
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
6
6
|
|
|
7
7
|
export class CloudResourceCreatedPayload {
|
|
8
8
|
@IsUUID()
|
|
9
9
|
resourceId: string;
|
|
10
|
+
|
|
10
11
|
@IsUUID()
|
|
11
12
|
poolId: string;
|
|
13
|
+
|
|
12
14
|
@IsEnum(CloudProvider)
|
|
13
15
|
cloudProvider: CloudProvider;
|
|
16
|
+
|
|
14
17
|
@IsString()
|
|
15
18
|
@IsOptional()
|
|
16
19
|
clientRequestId?: string;
|
|
20
|
+
|
|
17
21
|
@IsOptional()
|
|
18
22
|
@IsString()
|
|
19
23
|
cloudSessionId?: string;
|
|
24
|
+
|
|
20
25
|
@ValidateNestedType(() => AWSCreationResponse)
|
|
21
26
|
creationResponse: CreationResponse;
|
|
22
27
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LudeoEvent } from "
|
|
1
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
2
2
|
import { CloudSessionContext } from "../contexts/cloud-session-context";
|
|
3
|
-
import { ValidateNestedType } from "
|
|
3
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
4
4
|
import {
|
|
5
5
|
IsEnum,
|
|
6
6
|
IsNotEmpty,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { IsOptional, IsString, IsUUID } from "class-validator";
|
|
2
|
-
import { LudeoEvent } from "
|
|
2
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
3
3
|
import { CloudResourceContext } from "../contexts/cloud-resource-context";
|
|
4
4
|
import { AWSResourceProviderSettings, CloudResourceStatus } from "../types";
|
|
5
|
-
import { ValidateNestedType } from "
|
|
5
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
6
6
|
|
|
7
7
|
export class CloudResourceStatusEventPayload {
|
|
8
8
|
@IsUUID()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CloudSessionContext } from "../contexts/cloud-session-context";
|
|
2
|
-
import { ValidateNestedType } from "
|
|
3
|
-
import { LudeoEvent } from "
|
|
2
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
3
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
4
4
|
import { AwsAllocationData, CloudProviderAllocationData } from "../types";
|
|
5
5
|
|
|
6
6
|
export class CloudSessionAllocatedPayload {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CloudSessionContext } from "../contexts/cloud-session-context";
|
|
2
|
-
import { ValidateNestedType } from "
|
|
3
|
-
import { LudeoEvent } from "
|
|
2
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
3
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
4
4
|
|
|
5
5
|
export class CloudSessionTerminated extends LudeoEvent {
|
|
6
6
|
static readonly EVENT_NAME = "cloud-sessions.cloud-session-terminated";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IsEnum, IsString, IsUUID } from "class-validator";
|
|
2
2
|
import { CreateCloudResourceRequestContext } from "../contexts/create-cloud-resource-request-context";
|
|
3
|
-
import { LudeoEvent } from "
|
|
4
|
-
import { ValidateNestedType } from "
|
|
3
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
4
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
5
5
|
import {
|
|
6
6
|
AWSResourceCreationConfig,
|
|
7
7
|
CloudProvider,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IsUUID } from "class-validator";
|
|
2
|
-
import { LudeoEvent } from "
|
|
2
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
3
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
3
4
|
|
|
4
5
|
export class MonitorPoolTaskEventPayload {
|
|
5
6
|
@IsUUID()
|
|
@@ -17,5 +18,6 @@ export class MonitorPoolTaskEvent extends LudeoEvent {
|
|
|
17
18
|
|
|
18
19
|
context: never;
|
|
19
20
|
|
|
21
|
+
@ValidateNestedType(() => MonitorPoolTaskEventPayload)
|
|
20
22
|
payload: MonitorPoolTaskEventPayload;
|
|
21
23
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IsString, ValidateNested } from "class-validator";
|
|
2
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
3
|
+
import { AWSResourceProviderSettings } from "../types";
|
|
4
|
+
import { ValidateNestedType } from "../../decorators";
|
|
5
|
+
|
|
6
|
+
export class MonitorResourceTaskEventPayload {
|
|
7
|
+
@IsString()
|
|
8
|
+
resourceId: string;
|
|
9
|
+
|
|
10
|
+
@IsString()
|
|
11
|
+
poolId: string;
|
|
12
|
+
|
|
13
|
+
@ValidateNested()
|
|
14
|
+
providerSettings: AWSResourceProviderSettings;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export class MonitorResourceTaskEvent extends LudeoEvent {
|
|
18
|
+
static readonly EVENT_NAME = "cloud-resources.monitor-resource-task";
|
|
19
|
+
|
|
20
|
+
constructor(payload: MonitorResourceTaskEventPayload) {
|
|
21
|
+
super(MonitorResourceTaskEvent.EVENT_NAME);
|
|
22
|
+
this.payload = payload;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
context: never;
|
|
26
|
+
|
|
27
|
+
@ValidateNestedType(() => MonitorResourceTaskEventPayload)
|
|
28
|
+
payload: MonitorResourceTaskEventPayload;
|
|
29
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LudeoEvent } from "
|
|
1
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
2
2
|
import { PoolContext } from "../contexts/pool-context";
|
|
3
|
-
import { ValidateNestedType } from "
|
|
3
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
4
4
|
import { CloudPool } from "../models/cloud-pool";
|
|
5
5
|
|
|
6
6
|
export class PoolCreatedEvent extends LudeoEvent {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CloudSessionContext } from "../contexts/cloud-session-context";
|
|
2
|
-
import { ValidateNestedType } from "
|
|
3
|
-
import { LudeoEvent } from "
|
|
2
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
3
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
4
4
|
import { PoolItemAllocatedPayload } from "../types";
|
|
5
5
|
|
|
6
6
|
export class PoolItemAllocatedEvent extends LudeoEvent {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IsUUID } from "class-validator";
|
|
2
|
-
import { LudeoEvent } from "
|
|
2
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
3
3
|
import { PoolContext } from "../contexts/pool-context";
|
|
4
|
-
import { ValidateNestedType } from "
|
|
4
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
5
5
|
|
|
6
6
|
export class PoolResizeSuccessEventPayload {
|
|
7
7
|
@IsUUID()
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { IsObject, IsString, IsUUID
|
|
1
|
+
import { IsObject, IsString, IsUUID } from "class-validator";
|
|
2
2
|
import { CloudPoolStatus, CloudResourcesStatusMap } from "../types";
|
|
3
|
-
import { LudeoEvent } from "
|
|
3
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
4
4
|
import { PoolContext } from "../contexts/pool-context";
|
|
5
|
-
import { ValidateNestedType } from "
|
|
5
|
+
import { ValidateNestedType } from "../..//decorators/validate-nested-type.decorator";
|
|
6
6
|
|
|
7
7
|
export class PoolStatusEventPayload {
|
|
8
8
|
@IsUUID()
|
|
9
9
|
poolId: string;
|
|
10
|
+
|
|
10
11
|
@IsString()
|
|
11
12
|
state: CloudPoolStatus;
|
|
13
|
+
|
|
12
14
|
@IsObject()
|
|
13
15
|
resources: CloudResourcesStatusMap;
|
|
14
16
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { LudeoEvent } from "
|
|
1
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
2
2
|
import { PoolContext } from "../contexts/pool-context";
|
|
3
3
|
import { CloudPool } from "../models/cloud-pool";
|
|
4
|
-
import { ValidateNestedType } from "
|
|
4
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
5
5
|
|
|
6
6
|
export class PoolUpdatedEvent extends LudeoEvent {
|
|
7
7
|
static readonly EVENT_NAME = "cloud-pools.pool-updated";
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { IsEnum, IsNumber, IsUUID } from "class-validator";
|
|
2
|
-
import { LudeoEvent } from "
|
|
2
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
3
3
|
import { PoolContext } from "../contexts/pool-context";
|
|
4
|
-
import { ValidateNestedType } from "
|
|
4
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
5
5
|
import { CloudPoolConfiguration, CloudProvider } from "../types";
|
|
6
6
|
|
|
7
7
|
export class ResizePoolRequestEventPayload extends CloudPoolConfiguration {
|
|
8
8
|
providerSettings: any;
|
|
9
|
+
|
|
9
10
|
@IsEnum(CloudProvider)
|
|
10
11
|
cloudProvider: CloudProvider;
|
|
12
|
+
|
|
11
13
|
@IsUUID()
|
|
12
14
|
poolId: string;
|
|
15
|
+
|
|
13
16
|
@IsNumber()
|
|
14
17
|
desiredSize: number;
|
|
15
18
|
}
|
|
@@ -1,9 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
IsEnum,
|
|
3
|
+
IsNumber,
|
|
4
|
+
IsOptional,
|
|
5
|
+
IsString,
|
|
6
|
+
ValidateNested,
|
|
7
|
+
} from "class-validator";
|
|
8
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
3
9
|
|
|
4
10
|
export class SchedulingData {
|
|
11
|
+
@IsNumber()
|
|
5
12
|
repeat?: number; // number of times to repeat the task. null - no repeat, 0 (endless), 1, 2...
|
|
13
|
+
|
|
14
|
+
@IsNumber()
|
|
6
15
|
interval?: number; // the time interval between repeats in milliseconds
|
|
16
|
+
|
|
17
|
+
@IsNumber()
|
|
7
18
|
retries?: number; // number of retries in case of failure. default 3
|
|
8
19
|
}
|
|
9
20
|
|
|
@@ -14,12 +25,14 @@ export enum JobType {
|
|
|
14
25
|
export class KafkaEventJobData {
|
|
15
26
|
@IsString()
|
|
16
27
|
eventTopic: string;
|
|
28
|
+
|
|
17
29
|
eventData: any;
|
|
18
30
|
}
|
|
19
31
|
|
|
20
32
|
export class Job {
|
|
21
|
-
@
|
|
33
|
+
@IsEnum(JobType)
|
|
22
34
|
type: JobType;
|
|
35
|
+
|
|
23
36
|
@ValidateNested()
|
|
24
37
|
jobData: KafkaEventJobData;
|
|
25
38
|
}
|
|
@@ -27,10 +40,13 @@ export class Job {
|
|
|
27
40
|
class ScheduleTaskRequestEventData {
|
|
28
41
|
@IsString()
|
|
29
42
|
key: string;
|
|
43
|
+
|
|
30
44
|
@IsOptional()
|
|
31
45
|
sourceService?: string;
|
|
46
|
+
|
|
32
47
|
@ValidateNested()
|
|
33
48
|
scheduling: SchedulingData;
|
|
49
|
+
|
|
34
50
|
@ValidateNested()
|
|
35
51
|
job: Job;
|
|
36
52
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PoolContext } from "../contexts/pool-context";
|
|
2
|
-
import { ValidateNestedType } from "
|
|
3
|
-
import { LudeoEvent } from "
|
|
2
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
3
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
4
4
|
import { CloudPoolConfiguration } from "../types";
|
|
5
5
|
|
|
6
6
|
export class SetPoolEvent extends LudeoEvent {
|