@ludeo/cloud-common 1.2.225 → 1.2.226-beta-yahil-1

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.
@@ -1 +1,2 @@
1
1
  export * from "./provisioning-ended";
2
+ export * from "./supported-sites";
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./provisioning-ended"), exports);
18
+ __exportStar(require("./supported-sites"), exports);
18
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/v4/events/provisioner/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/v4/events/provisioner/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,oDAAkC"}
@@ -0,0 +1,19 @@
1
+ import { LudeoEvent } from "../../../infra";
2
+ export interface SupportedSiteRegionData {
3
+ ip: string;
4
+ latitude: number;
5
+ longitude: number;
6
+ city: string;
7
+ country: string;
8
+ region: string;
9
+ }
10
+ export declare class SupportedSitesPayload {
11
+ sites: Record<string, SupportedSiteRegionData>;
12
+ updatedAt: number;
13
+ }
14
+ export declare class SupportedSites extends LudeoEvent {
15
+ static readonly EVENT_NAME = "provisioner.supported-sites";
16
+ constructor(payload: SupportedSitesPayload, context: never);
17
+ payload: SupportedSitesPayload;
18
+ context: never;
19
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SupportedSites = exports.SupportedSitesPayload = void 0;
13
+ const infra_1 = require("../../../infra");
14
+ const decorators_1 = require("../../../decorators");
15
+ const class_validator_1 = require("class-validator");
16
+ class SupportedSitesPayload {
17
+ }
18
+ exports.SupportedSitesPayload = SupportedSitesPayload;
19
+ __decorate([
20
+ (0, class_validator_1.IsObject)(),
21
+ __metadata("design:type", Object)
22
+ ], SupportedSitesPayload.prototype, "sites", void 0);
23
+ __decorate([
24
+ (0, class_validator_1.IsNumber)(),
25
+ __metadata("design:type", Number)
26
+ ], SupportedSitesPayload.prototype, "updatedAt", void 0);
27
+ class SupportedSites extends infra_1.LudeoEvent {
28
+ constructor(payload, context) {
29
+ super(SupportedSites.EVENT_NAME);
30
+ this.payload = payload;
31
+ this.context = context;
32
+ }
33
+ }
34
+ exports.SupportedSites = SupportedSites;
35
+ SupportedSites.EVENT_NAME = "provisioner.supported-sites";
36
+ __decorate([
37
+ (0, decorators_1.ValidateNestedType)(() => SupportedSitesPayload),
38
+ __metadata("design:type", SupportedSitesPayload)
39
+ ], SupportedSites.prototype, "payload", void 0);
40
+ //# sourceMappingURL=supported-sites.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supported-sites.js","sourceRoot":"","sources":["../../../../src/v4/events/provisioner/supported-sites.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4C;AAC5C,oDAAyD;AACzD,qDAAqD;AAgBrD,MAAa,qBAAqB;CAOjC;AAPD,sDAOC;AAJC;IADC,IAAA,0BAAQ,GAAE;;oDACoC;AAG/C;IADC,IAAA,0BAAQ,GAAE;;wDACO;AAGpB,MAAa,cAAe,SAAQ,kBAAU;IAG5C,YAAY,OAA8B,EAAE,OAAc;QACxD,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QACjC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;;AAPH,wCAaC;AAZiB,yBAAU,GAAG,6BAA6B,CAAC;AAS3D;IADC,IAAA,+BAAkB,EAAC,GAAG,EAAE,CAAC,qBAAqB,CAAC;8BACvC,qBAAqB;+CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludeo/cloud-common",
3
- "version": "1.2.225",
3
+ "version": "1.2.226-beta-yahil-1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "author": "Yahil Didi",
@@ -1 +1,2 @@
1
1
  export * from "./provisioning-ended";
2
+ export * from "./supported-sites";
@@ -0,0 +1,41 @@
1
+ import { LudeoEvent } from "../../../infra";
2
+ import { ValidateNestedType } from "../../../decorators";
3
+ import { IsNumber, IsObject } from "class-validator";
4
+
5
+ /**
6
+ * Region metadata for a supported site (LudeoCast v2 / GCP).
7
+ * Used for geographic distance calculations and matchmaking.
8
+ * Each site has: ip, latitude, longitude, city, country, region.
9
+ */
10
+ export interface SupportedSiteRegionData {
11
+ ip: string;
12
+ latitude: number;
13
+ longitude: number;
14
+ city: string;
15
+ country: string;
16
+ region: string;
17
+ }
18
+
19
+ export class SupportedSitesPayload {
20
+ /** Map of site name -> region metadata (ip, lat, lng, city, country, region) */
21
+ @IsObject()
22
+ sites: Record<string, SupportedSiteRegionData>;
23
+
24
+ @IsNumber()
25
+ updatedAt: number;
26
+ }
27
+
28
+ export class SupportedSites extends LudeoEvent {
29
+ static readonly EVENT_NAME = "provisioner.supported-sites";
30
+
31
+ constructor(payload: SupportedSitesPayload, context: never) {
32
+ super(SupportedSites.EVENT_NAME);
33
+ this.payload = payload;
34
+ this.context = context;
35
+ }
36
+
37
+ @ValidateNestedType(() => SupportedSitesPayload)
38
+ payload: SupportedSitesPayload;
39
+
40
+ context: never;
41
+ }