@ludeo/cloud-common 1.2.178-beta → 1.2.178-beta.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.
@@ -0,0 +1,7 @@
1
+ export declare class ClientGeoData {
2
+ latitude?: number;
3
+ longitude?: number;
4
+ continent?: string;
5
+ country?: string;
6
+ city?: string;
7
+ }
@@ -0,0 +1,42 @@
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.ClientGeoData = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ class ClientGeoData {
15
+ }
16
+ exports.ClientGeoData = ClientGeoData;
17
+ __decorate([
18
+ (0, class_validator_1.IsOptional)(),
19
+ (0, class_validator_1.IsNumber)(),
20
+ __metadata("design:type", Number)
21
+ ], ClientGeoData.prototype, "latitude", void 0);
22
+ __decorate([
23
+ (0, class_validator_1.IsOptional)(),
24
+ (0, class_validator_1.IsNumber)(),
25
+ __metadata("design:type", Number)
26
+ ], ClientGeoData.prototype, "longitude", void 0);
27
+ __decorate([
28
+ (0, class_validator_1.IsOptional)(),
29
+ (0, class_validator_1.IsString)(),
30
+ __metadata("design:type", String)
31
+ ], ClientGeoData.prototype, "continent", void 0);
32
+ __decorate([
33
+ (0, class_validator_1.IsOptional)(),
34
+ (0, class_validator_1.IsString)(),
35
+ __metadata("design:type", String)
36
+ ], ClientGeoData.prototype, "country", void 0);
37
+ __decorate([
38
+ (0, class_validator_1.IsOptional)(),
39
+ (0, class_validator_1.IsString)(),
40
+ __metadata("design:type", String)
41
+ ], ClientGeoData.prototype, "city", void 0);
42
+ //# sourceMappingURL=client-geo-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-geo-data.js","sourceRoot":"","sources":["../../../src/v4/contexts/client-geo-data.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAiE;AAEjE,MAAa,aAAa;CAoBvB;AApBH,sCAoBG;AAjBC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;+CACO;AAIlB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;gDACQ;AAInB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;gDACQ;AAInB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;8CACM;AAIjB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;2CACG"}
@@ -1,4 +1,5 @@
1
1
  import { CloudProvider } from "../types";
2
+ import { ClientGeoData } from "./client-geo-data";
2
3
  export declare class CloudSessionContext {
3
4
  allocationRequestId?: string;
4
5
  clientRequestId?: string;
@@ -24,9 +25,5 @@ export declare class CloudSessionContext {
24
25
  roomId?: string;
25
26
  gameplayId?: string;
26
27
  atpId?: string;
27
- userLatitude?: number;
28
- userLongitude?: number;
29
- userContinent?: string;
30
- userCountry?: string;
31
- userCity?: string;
28
+ clientGeoData?: ClientGeoData;
32
29
  }
@@ -11,7 +11,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.CloudSessionContext = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
+ const class_transformer_1 = require("class-transformer");
14
15
  const types_1 = require("../types");
16
+ const client_geo_data_1 = require("./client-geo-data");
15
17
  class CloudSessionContext {
16
18
  }
17
19
  exports.CloudSessionContext = CloudSessionContext;
@@ -128,27 +130,8 @@ __decorate([
128
130
  ], CloudSessionContext.prototype, "atpId", void 0);
129
131
  __decorate([
130
132
  (0, class_validator_1.IsOptional)(),
131
- (0, class_validator_1.IsNumber)(),
132
- __metadata("design:type", Number)
133
- ], CloudSessionContext.prototype, "userLatitude", void 0);
134
- __decorate([
135
- (0, class_validator_1.IsOptional)(),
136
- (0, class_validator_1.IsNumber)(),
137
- __metadata("design:type", Number)
138
- ], CloudSessionContext.prototype, "userLongitude", void 0);
139
- __decorate([
140
- (0, class_validator_1.IsOptional)(),
141
- (0, class_validator_1.IsString)(),
142
- __metadata("design:type", String)
143
- ], CloudSessionContext.prototype, "userContinent", void 0);
144
- __decorate([
145
- (0, class_validator_1.IsOptional)(),
146
- (0, class_validator_1.IsString)(),
147
- __metadata("design:type", String)
148
- ], CloudSessionContext.prototype, "userCountry", void 0);
149
- __decorate([
150
- (0, class_validator_1.IsOptional)(),
151
- (0, class_validator_1.IsString)(),
152
- __metadata("design:type", String)
153
- ], CloudSessionContext.prototype, "userCity", void 0);
133
+ (0, class_validator_1.ValidateNested)(),
134
+ (0, class_transformer_1.Type)(() => client_geo_data_1.ClientGeoData),
135
+ __metadata("design:type", client_geo_data_1.ClientGeoData)
136
+ ], CloudSessionContext.prototype, "clientGeoData", void 0);
154
137
  //# sourceMappingURL=cloud-session-context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cloud-session-context.js","sourceRoot":"","sources":["../../../src/v4/contexts/cloud-session-context.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAiF;AACjF,oCAAyC;AAEzC,MAAa,mBAAmB;CA2G/B;AA3GD,kDA2GC;AAxGC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;gEACoB;AAG7B;IADC,IAAA,4BAAU,GAAE;;4DACY;AAGzB;IADC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AFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;yDACW;AAItB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;0DACY;AAIvB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;0DACY;AAIvB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;wDACU;AAIrB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;qDACO"}
1
+ {"version":3,"file":"cloud-session-context.js","sourceRoot":"","sources":["../../../src/v4/contexts/cloud-session-context.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAiG;AACjG,yDAAyC;AACzC,oCAAyC;AACzC,uDAAkD;AAElD,MAAa,mBAAmB;CA6F/B;AA7FD,kDA6FC;AA1FC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;gEACoB;AAG7B;IADC,IAAA,4BAAU,GAAE;;4DACY;AAGzB;IADC,IAAA,wBAAM,GAAE;;2DACc;AAGvB;IADC,IAAA,4BAAU,GAAE;;mDACG;AAGhB;IADC,IAAA,4BAAU,GAAE;;mDACG;AAGhB;IADC,IAAA,4BAAU,GAAE;;oDACI;AAGjB;IADC,IAAA,wBAAM,EAAC,qBAAa,CAAC;;0DACO;AAI7B;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;uDACW;AAIpB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;2DACe;AAIxB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;0DACc;AAIvB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;8DACkB;AAI3B;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;0DACY;AAIvB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;4DACc;AAKzB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;mDACO;AAIhB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;uDACW;AAGpB;IADC,IAAA,4BAAU,GAAE;;yDACS;AAItB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;0DACc;AAIvB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;mDACK;AAIhB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;wDACY;AAIrB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;4DACgB;AAGzB;IADC,IAAA,4BAAU,GAAE;;yDACS;AAGtB;IADC,IAAA,4BAAU,GAAE;;mDACG;AAIhB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;uDACW;AAIpB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;kDACM;AAKf;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,gCAAc,GAAE;IAChB,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,+BAAa,CAAC;8BACV,+BAAa;0DAAC"}
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@ludeo/cloud-common",
3
- "version": "1.2.178-beta",
3
+ "version": "1.2.178-beta.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
- "author": "Niv Raviv",
6
+ "author": "Yahil Didi",
7
7
  "scripts": {
8
8
  "build": "rm -rf dist && tsc",
9
9
  "test": "jest",
@@ -0,0 +1,23 @@
1
+ import { IsNumber, IsOptional, IsString } from "class-validator";
2
+
3
+ export class ClientGeoData {
4
+ @IsOptional()
5
+ @IsNumber()
6
+ latitude?: number;
7
+
8
+ @IsOptional()
9
+ @IsNumber()
10
+ longitude?: number;
11
+
12
+ @IsOptional()
13
+ @IsString()
14
+ continent?: string;
15
+
16
+ @IsOptional()
17
+ @IsString()
18
+ country?: string;
19
+
20
+ @IsOptional()
21
+ @IsString()
22
+ city?: string;
23
+ }
@@ -1,5 +1,7 @@
1
- import { IsEnum, IsNumber, IsOptional, IsString, IsUUID } from "class-validator";
1
+ import { IsEnum, IsNumber, IsOptional, IsString, IsUUID, ValidateNested } from "class-validator";
2
+ import { Type } from "class-transformer";
2
3
  import { CloudProvider } from "../types";
4
+ import { ClientGeoData } from "./client-geo-data";
3
5
 
4
6
  export class CloudSessionContext {
5
7
  @IsOptional()
@@ -89,23 +91,9 @@ export class CloudSessionContext {
89
91
  @IsOptional()
90
92
  @IsUUID()
91
93
  atpId?: string;
92
- @IsOptional()
93
- @IsNumber()
94
- userLatitude?: number;
95
-
96
- @IsOptional()
97
- @IsNumber()
98
- userLongitude?: number;
99
-
100
- @IsOptional()
101
- @IsString()
102
- userContinent?: string;
103
94
 
104
95
  @IsOptional()
105
- @IsString()
106
- userCountry?: string;
107
-
108
- @IsOptional()
109
- @IsString()
110
- userCity?: string;
96
+ @ValidateNested()
97
+ @Type(() => ClientGeoData)
98
+ clientGeoData?: ClientGeoData;
111
99
  }