gs2 1.3.260 → 1.3.261

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 (116) hide show
  1. package/account/model/PlatformId.d.ts +40 -0
  2. package/account/model/PlatformId.js +205 -0
  3. package/account/model/PlatformId.js.map +1 -0
  4. package/account/model/PlatformId.ts +221 -0
  5. package/account/model/PlatformUser.d.ts +21 -0
  6. package/account/model/PlatformUser.js +76 -0
  7. package/account/model/PlatformUser.js.map +1 -0
  8. package/account/model/PlatformUser.ts +74 -0
  9. package/account/model/index.d.ts +3 -1
  10. package/account/model/index.js +5 -1
  11. package/account/model/index.js.map +1 -1
  12. package/account/model/index.ts +4 -0
  13. package/account/request/CreatePlatformIdByUserIdRequest.d.ts +41 -0
  14. package/account/request/CreatePlatformIdByUserIdRequest.js +137 -0
  15. package/account/request/CreatePlatformIdByUserIdRequest.js.map +1 -0
  16. package/account/request/CreatePlatformIdByUserIdRequest.ts +147 -0
  17. package/account/request/CreatePlatformIdRequest.d.ts +37 -0
  18. package/account/request/CreatePlatformIdRequest.js +123 -0
  19. package/account/request/CreatePlatformIdRequest.js.map +1 -0
  20. package/account/request/CreatePlatformIdRequest.ts +133 -0
  21. package/account/request/DeletePlatformIdByUserIdRequest.d.ts +37 -0
  22. package/account/request/DeletePlatformIdByUserIdRequest.js +123 -0
  23. package/account/request/DeletePlatformIdByUserIdRequest.js.map +1 -0
  24. package/account/request/DeletePlatformIdByUserIdRequest.ts +133 -0
  25. package/account/request/DeletePlatformIdByUserIdentifierRequest.d.ts +33 -0
  26. package/account/request/DeletePlatformIdByUserIdentifierRequest.js +109 -0
  27. package/account/request/DeletePlatformIdByUserIdentifierRequest.js.map +1 -0
  28. package/account/request/DeletePlatformIdByUserIdentifierRequest.ts +119 -0
  29. package/account/request/DeletePlatformIdRequest.d.ts +37 -0
  30. package/account/request/DeletePlatformIdRequest.js +123 -0
  31. package/account/request/DeletePlatformIdRequest.js.map +1 -0
  32. package/account/request/DeletePlatformIdRequest.ts +133 -0
  33. package/account/request/DescribePlatformIdsByUserIdRequest.d.ts +37 -0
  34. package/account/request/DescribePlatformIdsByUserIdRequest.js +125 -0
  35. package/account/request/DescribePlatformIdsByUserIdRequest.js.map +1 -0
  36. package/account/request/DescribePlatformIdsByUserIdRequest.ts +132 -0
  37. package/account/request/DescribePlatformIdsRequest.d.ts +33 -0
  38. package/account/request/DescribePlatformIdsRequest.js +111 -0
  39. package/account/request/DescribePlatformIdsRequest.js.map +1 -0
  40. package/account/request/DescribePlatformIdsRequest.ts +118 -0
  41. package/account/request/FindPlatformIdByUserIdRequest.d.ts +41 -0
  42. package/account/request/FindPlatformIdByUserIdRequest.js +137 -0
  43. package/account/request/FindPlatformIdByUserIdRequest.js.map +1 -0
  44. package/account/request/FindPlatformIdByUserIdRequest.ts +147 -0
  45. package/account/request/FindPlatformIdRequest.d.ts +37 -0
  46. package/account/request/FindPlatformIdRequest.js +123 -0
  47. package/account/request/FindPlatformIdRequest.js.map +1 -0
  48. package/account/request/FindPlatformIdRequest.ts +133 -0
  49. package/account/request/GetPlatformIdByUserIdRequest.d.ts +33 -0
  50. package/account/request/GetPlatformIdByUserIdRequest.js +111 -0
  51. package/account/request/GetPlatformIdByUserIdRequest.js.map +1 -0
  52. package/account/request/GetPlatformIdByUserIdRequest.ts +118 -0
  53. package/account/request/GetPlatformIdRequest.d.ts +29 -0
  54. package/account/request/GetPlatformIdRequest.js +97 -0
  55. package/account/request/GetPlatformIdRequest.js.map +1 -0
  56. package/account/request/GetPlatformIdRequest.ts +104 -0
  57. package/account/request/index.d.ts +12 -1
  58. package/account/request/index.js +23 -1
  59. package/account/request/index.js.map +1 -1
  60. package/account/request/index.ts +22 -0
  61. package/account/rest.d.ts +11 -0
  62. package/account/rest.js +325 -0
  63. package/account/rest.js.map +1 -1
  64. package/account/rest.ts +369 -0
  65. package/account/result/CreatePlatformIdByUserIdResult.d.ts +14 -0
  66. package/account/result/CreatePlatformIdByUserIdResult.js +48 -0
  67. package/account/result/CreatePlatformIdByUserIdResult.js.map +1 -0
  68. package/account/result/CreatePlatformIdByUserIdResult.ts +47 -0
  69. package/account/result/CreatePlatformIdResult.d.ts +14 -0
  70. package/account/result/CreatePlatformIdResult.js +48 -0
  71. package/account/result/CreatePlatformIdResult.js.map +1 -0
  72. package/account/result/CreatePlatformIdResult.ts +47 -0
  73. package/account/result/DeletePlatformIdByUserIdResult.d.ts +14 -0
  74. package/account/result/DeletePlatformIdByUserIdResult.js +48 -0
  75. package/account/result/DeletePlatformIdByUserIdResult.js.map +1 -0
  76. package/account/result/DeletePlatformIdByUserIdResult.ts +47 -0
  77. package/account/result/DeletePlatformIdByUserIdentifierResult.d.ts +14 -0
  78. package/account/result/DeletePlatformIdByUserIdentifierResult.js +48 -0
  79. package/account/result/DeletePlatformIdByUserIdentifierResult.js.map +1 -0
  80. package/account/result/DeletePlatformIdByUserIdentifierResult.ts +47 -0
  81. package/account/result/DeletePlatformIdResult.d.ts +14 -0
  82. package/account/result/DeletePlatformIdResult.js +48 -0
  83. package/account/result/DeletePlatformIdResult.js.map +1 -0
  84. package/account/result/DeletePlatformIdResult.ts +47 -0
  85. package/account/result/DescribePlatformIdsByUserIdResult.d.ts +18 -0
  86. package/account/result/DescribePlatformIdsByUserIdResult.js +67 -0
  87. package/account/result/DescribePlatformIdsByUserIdResult.js.map +1 -0
  88. package/account/result/DescribePlatformIdsByUserIdResult.ts +72 -0
  89. package/account/result/DescribePlatformIdsResult.d.ts +18 -0
  90. package/account/result/DescribePlatformIdsResult.js +67 -0
  91. package/account/result/DescribePlatformIdsResult.js.map +1 -0
  92. package/account/result/DescribePlatformIdsResult.ts +72 -0
  93. package/account/result/FindPlatformIdByUserIdResult.d.ts +14 -0
  94. package/account/result/FindPlatformIdByUserIdResult.js +48 -0
  95. package/account/result/FindPlatformIdByUserIdResult.js.map +1 -0
  96. package/account/result/FindPlatformIdByUserIdResult.ts +47 -0
  97. package/account/result/FindPlatformIdResult.d.ts +14 -0
  98. package/account/result/FindPlatformIdResult.js +48 -0
  99. package/account/result/FindPlatformIdResult.js.map +1 -0
  100. package/account/result/FindPlatformIdResult.ts +47 -0
  101. package/account/result/GetPlatformIdByUserIdResult.d.ts +14 -0
  102. package/account/result/GetPlatformIdByUserIdResult.js +48 -0
  103. package/account/result/GetPlatformIdByUserIdResult.js.map +1 -0
  104. package/account/result/GetPlatformIdByUserIdResult.ts +47 -0
  105. package/account/result/GetPlatformIdResult.d.ts +14 -0
  106. package/account/result/GetPlatformIdResult.js +48 -0
  107. package/account/result/GetPlatformIdResult.js.map +1 -0
  108. package/account/result/GetPlatformIdResult.ts +47 -0
  109. package/account/result/index.d.ts +12 -1
  110. package/account/result/index.js +23 -1
  111. package/account/result/index.js.map +1 -1
  112. package/account/result/index.ts +22 -0
  113. package/identifier/request/LoginRequest.js +2 -2
  114. package/identifier/request/LoginRequest.js.map +1 -1
  115. package/identifier/request/LoginRequest.ts +2 -2
  116. package/package.json +1 -1
@@ -0,0 +1,40 @@
1
+ import IModel from '../../core/interface/IModel';
2
+ export default class PlatformId implements IModel {
3
+ private platformId;
4
+ private userId;
5
+ private type;
6
+ private userIdentifier;
7
+ private createdAt;
8
+ private revision;
9
+ static getRegion(grn: string): string | null;
10
+ static getOwnerId(grn: string): string | null;
11
+ static getNamespaceName(grn: string): string | null;
12
+ static getType(grn: string): string | null;
13
+ static getUserIdentifier(grn: string): string | null;
14
+ static isValid(grn: string): boolean;
15
+ static createGrn(region: string | null, ownerId: string | null, namespaceName: string | null, type: string | null, userIdentifier: string | null): string | null;
16
+ getPlatformId(): string | null;
17
+ setPlatformId(platformId: string | null): this;
18
+ withPlatformId(platformId: string | null): this;
19
+ getUserId(): string | null;
20
+ setUserId(userId: string | null): this;
21
+ withUserId(userId: string | null): this;
22
+ getType(): number | null;
23
+ setType(type: number | null): this;
24
+ withType(type: number | null): this;
25
+ getUserIdentifier(): string | null;
26
+ setUserIdentifier(userIdentifier: string | null): this;
27
+ withUserIdentifier(userIdentifier: string | null): this;
28
+ getCreatedAt(): number | null;
29
+ setCreatedAt(createdAt: number | null): this;
30
+ withCreatedAt(createdAt: number | null): this;
31
+ getRevision(): number | null;
32
+ setRevision(revision: number | null): this;
33
+ withRevision(revision: number | null): this;
34
+ static fromDict(data: {
35
+ [key: string]: any;
36
+ }): PlatformId | null;
37
+ toDict(): {
38
+ [key: string]: any;
39
+ };
40
+ }
@@ -0,0 +1,205 @@
1
+ "use strict";
2
+ /*
3
+ Copyright 2016 Game Server Services, Inc. or its affiliates. All Rights
4
+ Reserved.
5
+
6
+ Licensed under the Apache License, Version 2.0 (the "License").
7
+ You may not use this file except in compliance with the License.
8
+ A copy of the License is located at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ or in the "license" file accompanying this file. This file is distributed
13
+ on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
14
+ express or implied. See the License for the specific language governing
15
+ permissions and limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ var grnFormat = "grn:gs2:{region}:{ownerId}:account:{namespaceName}:platformId:{type}:{userIdentifier}";
19
+ var PlatformId = /** @class */ (function () {
20
+ function PlatformId() {
21
+ this.platformId = null;
22
+ this.userId = null;
23
+ this.type = null;
24
+ this.userIdentifier = null;
25
+ this.createdAt = null;
26
+ this.revision = null;
27
+ }
28
+ PlatformId.getRegion = function (grn) {
29
+ var match = grn.match(grnFormat
30
+ .replace('{region}', '(.*)')
31
+ .replace('{ownerId}', '.*')
32
+ .replace('{namespaceName}', '.*')
33
+ .replace('{type}', '.*')
34
+ .replace('{userIdentifier}', '.*'));
35
+ if (match) {
36
+ return match[1];
37
+ }
38
+ return null;
39
+ };
40
+ PlatformId.getOwnerId = function (grn) {
41
+ var match = grn.match(grnFormat
42
+ .replace('{region}', '.*')
43
+ .replace('{ownerId}', '(.*)')
44
+ .replace('{namespaceName}', '.*')
45
+ .replace('{type}', '.*')
46
+ .replace('{userIdentifier}', '.*'));
47
+ if (match) {
48
+ return match[1];
49
+ }
50
+ return null;
51
+ };
52
+ PlatformId.getNamespaceName = function (grn) {
53
+ var match = grn.match(grnFormat
54
+ .replace('{region}', '.*')
55
+ .replace('{ownerId}', '.*')
56
+ .replace('{namespaceName}', '(.*)')
57
+ .replace('{type}', '.*')
58
+ .replace('{userIdentifier}', '.*'));
59
+ if (match) {
60
+ return match[1];
61
+ }
62
+ return null;
63
+ };
64
+ PlatformId.getType = function (grn) {
65
+ var match = grn.match(grnFormat
66
+ .replace('{region}', '.*')
67
+ .replace('{ownerId}', '.*')
68
+ .replace('{namespaceName}', '.*')
69
+ .replace('{type}', '(.*)')
70
+ .replace('{userIdentifier}', '.*'));
71
+ if (match) {
72
+ return match[1];
73
+ }
74
+ return null;
75
+ };
76
+ PlatformId.getUserIdentifier = function (grn) {
77
+ var match = grn.match(grnFormat
78
+ .replace('{region}', '.*')
79
+ .replace('{ownerId}', '.*')
80
+ .replace('{namespaceName}', '.*')
81
+ .replace('{type}', '.*')
82
+ .replace('{userIdentifier}', '(.*)'));
83
+ if (match) {
84
+ return match[1];
85
+ }
86
+ return null;
87
+ };
88
+ PlatformId.isValid = function (grn) {
89
+ if (this.getRegion(grn) == null || this.getRegion(grn) === '') {
90
+ return false;
91
+ }
92
+ if (this.getOwnerId(grn) == null || this.getOwnerId(grn) === '') {
93
+ return false;
94
+ }
95
+ if (this.getNamespaceName(grn) == null || this.getNamespaceName(grn) === '') {
96
+ return false;
97
+ }
98
+ if (this.getType(grn) == null || this.getType(grn) === '') {
99
+ return false;
100
+ }
101
+ if (this.getUserIdentifier(grn) == null || this.getUserIdentifier(grn) === '') {
102
+ return false;
103
+ }
104
+ return true;
105
+ };
106
+ PlatformId.createGrn = function (region, ownerId, namespaceName, type, userIdentifier) {
107
+ return grnFormat
108
+ .replace('{region}', region !== null && region !== void 0 ? region : '')
109
+ .replace('{ownerId}', ownerId !== null && ownerId !== void 0 ? ownerId : '')
110
+ .replace('{namespaceName}', namespaceName !== null && namespaceName !== void 0 ? namespaceName : '')
111
+ .replace('{type}', type !== null && type !== void 0 ? type : '')
112
+ .replace('{userIdentifier}', userIdentifier !== null && userIdentifier !== void 0 ? userIdentifier : '');
113
+ };
114
+ PlatformId.prototype.getPlatformId = function () {
115
+ return this.platformId;
116
+ };
117
+ PlatformId.prototype.setPlatformId = function (platformId) {
118
+ this.platformId = platformId;
119
+ return this;
120
+ };
121
+ PlatformId.prototype.withPlatformId = function (platformId) {
122
+ this.platformId = platformId;
123
+ return this;
124
+ };
125
+ PlatformId.prototype.getUserId = function () {
126
+ return this.userId;
127
+ };
128
+ PlatformId.prototype.setUserId = function (userId) {
129
+ this.userId = userId;
130
+ return this;
131
+ };
132
+ PlatformId.prototype.withUserId = function (userId) {
133
+ this.userId = userId;
134
+ return this;
135
+ };
136
+ PlatformId.prototype.getType = function () {
137
+ return this.type;
138
+ };
139
+ PlatformId.prototype.setType = function (type) {
140
+ this.type = type;
141
+ return this;
142
+ };
143
+ PlatformId.prototype.withType = function (type) {
144
+ this.type = type;
145
+ return this;
146
+ };
147
+ PlatformId.prototype.getUserIdentifier = function () {
148
+ return this.userIdentifier;
149
+ };
150
+ PlatformId.prototype.setUserIdentifier = function (userIdentifier) {
151
+ this.userIdentifier = userIdentifier;
152
+ return this;
153
+ };
154
+ PlatformId.prototype.withUserIdentifier = function (userIdentifier) {
155
+ this.userIdentifier = userIdentifier;
156
+ return this;
157
+ };
158
+ PlatformId.prototype.getCreatedAt = function () {
159
+ return this.createdAt;
160
+ };
161
+ PlatformId.prototype.setCreatedAt = function (createdAt) {
162
+ this.createdAt = createdAt;
163
+ return this;
164
+ };
165
+ PlatformId.prototype.withCreatedAt = function (createdAt) {
166
+ this.createdAt = createdAt;
167
+ return this;
168
+ };
169
+ PlatformId.prototype.getRevision = function () {
170
+ return this.revision;
171
+ };
172
+ PlatformId.prototype.setRevision = function (revision) {
173
+ this.revision = revision;
174
+ return this;
175
+ };
176
+ PlatformId.prototype.withRevision = function (revision) {
177
+ this.revision = revision;
178
+ return this;
179
+ };
180
+ PlatformId.fromDict = function (data) {
181
+ if (data == undefined || data == null) {
182
+ return null;
183
+ }
184
+ return new PlatformId()
185
+ .withPlatformId(data["platformId"])
186
+ .withUserId(data["userId"])
187
+ .withType(data["type"])
188
+ .withUserIdentifier(data["userIdentifier"])
189
+ .withCreatedAt(data["createdAt"])
190
+ .withRevision(data["revision"]);
191
+ };
192
+ PlatformId.prototype.toDict = function () {
193
+ return {
194
+ "platformId": this.getPlatformId(),
195
+ "userId": this.getUserId(),
196
+ "type": this.getType(),
197
+ "userIdentifier": this.getUserIdentifier(),
198
+ "createdAt": this.getCreatedAt(),
199
+ "revision": this.getRevision(),
200
+ };
201
+ };
202
+ return PlatformId;
203
+ }());
204
+ exports.default = PlatformId;
205
+ //# sourceMappingURL=PlatformId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlatformId.js","sourceRoot":"","sources":["PlatformId.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAGH,IAAM,SAAS,GAAW,uFAAuF,CAAC;AAElH;IAAA;QACY,eAAU,GAAgB,IAAI,CAAC;QAC/B,WAAM,GAAgB,IAAI,CAAC;QAC3B,SAAI,GAAgB,IAAI,CAAC;QACzB,mBAAc,GAAgB,IAAI,CAAC;QACnC,cAAS,GAAgB,IAAI,CAAC;QAC9B,aAAQ,GAAgB,IAAI,CAAC;IAmMzC,CAAC;IAjMiB,oBAAS,GAAvB,UAAwB,GAAW;QAC/B,IAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,SAAS;aAC5B,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC;aAC3B,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC;aAC1B,OAAO,CAAC,iBAAiB,EAAE,IAAI,CAAC;aAChC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC;aACvB,OAAO,CAAC,kBAAkB,EAAE,IAAI,CAAC,CACrC,CAAC;QACF,IAA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IAA0B;QAC7C,IAAI,IAAI,IAAI,SAAS,IAAI,IAAI,IAAI,IAAI,EAAE;YACnC,OAAO,IAAI,CAAC;SACf;QACD,OAAO,IAAI,UAAU,EAAE;aAClB,cAAc,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;aAClC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aAC1B,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aACtB,kBAAkB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;aAC1C,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;aAChC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IACxC,CAAC;IAEM,2BAAM,GAAb;QACI,OAAO;YACH,YAAY,EAAE,IAAI,CAAC,aAAa,EAAE;YAClC,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE;YAC1B,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE;YACtB,gBAAgB,EAAE,IAAI,CAAC,iBAAiB,EAAE;YAC1C,WAAW,EAAE,IAAI,CAAC,YAAY,EAAE;YAChC,UAAU,EAAE,IAAI,CAAC,WAAW,EAAE;SACjC,CAAC;IACN,CAAC;IACL,iBAAC;AAAD,CAAC,AAzMD,IAyMC"}
@@ -0,0 +1,221 @@
1
+ /*
2
+ Copyright 2016 Game Server Services, Inc. or its affiliates. All Rights
3
+ Reserved.
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License").
6
+ You may not use this file except in compliance with the License.
7
+ A copy of the License is located at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ or in the "license" file accompanying this file. This file is distributed
12
+ on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13
+ express or implied. See the License for the specific language governing
14
+ permissions and limitations under the License.
15
+ */
16
+
17
+ import IModel from '../../core/interface/IModel';
18
+ const grnFormat: string = "grn:gs2:{region}:{ownerId}:account:{namespaceName}:platformId:{type}:{userIdentifier}";
19
+
20
+ export default class PlatformId implements IModel {
21
+ private platformId: string|null = null;
22
+ private userId: string|null = null;
23
+ private type: number|null = null;
24
+ private userIdentifier: string|null = null;
25
+ private createdAt: number|null = null;
26
+ private revision: number|null = null;
27
+
28
+ public static getRegion(grn: string): string|null {
29
+ const match = grn.match(grnFormat
30
+ .replace('{region}', '(.*)')
31
+ .replace('{ownerId}', '.*')
32
+ .replace('{namespaceName}', '.*')
33
+ .replace('{type}', '.*')
34
+ .replace('{userIdentifier}', '.*')
35
+ );
36
+ if (match) {
37
+ return match[1];
38
+ }
39
+ return null;
40
+ }
41
+
42
+ public static getOwnerId(grn: string): string|null {
43
+ const match = grn.match(grnFormat
44
+ .replace('{region}', '.*')
45
+ .replace('{ownerId}', '(.*)')
46
+ .replace('{namespaceName}', '.*')
47
+ .replace('{type}', '.*')
48
+ .replace('{userIdentifier}', '.*')
49
+ );
50
+ if (match) {
51
+ return match[1];
52
+ }
53
+ return null;
54
+ }
55
+
56
+ public static getNamespaceName(grn: string): string|null {
57
+ const match = grn.match(grnFormat
58
+ .replace('{region}', '.*')
59
+ .replace('{ownerId}', '.*')
60
+ .replace('{namespaceName}', '(.*)')
61
+ .replace('{type}', '.*')
62
+ .replace('{userIdentifier}', '.*')
63
+ );
64
+ if (match) {
65
+ return match[1];
66
+ }
67
+ return null;
68
+ }
69
+
70
+ public static getType(grn: string): string|null {
71
+ const match = grn.match(grnFormat
72
+ .replace('{region}', '.*')
73
+ .replace('{ownerId}', '.*')
74
+ .replace('{namespaceName}', '.*')
75
+ .replace('{type}', '(.*)')
76
+ .replace('{userIdentifier}', '.*')
77
+ );
78
+ if (match) {
79
+ return match[1];
80
+ }
81
+ return null;
82
+ }
83
+
84
+ public static getUserIdentifier(grn: string): string|null {
85
+ const match = grn.match(grnFormat
86
+ .replace('{region}', '.*')
87
+ .replace('{ownerId}', '.*')
88
+ .replace('{namespaceName}', '.*')
89
+ .replace('{type}', '.*')
90
+ .replace('{userIdentifier}', '(.*)')
91
+ );
92
+ if (match) {
93
+ return match[1];
94
+ }
95
+ return null;
96
+ }
97
+
98
+ public static isValid(grn: string): boolean {
99
+ if (this.getRegion(grn) == null || this.getRegion(grn) === '') {
100
+ return false;
101
+ }
102
+ if (this.getOwnerId(grn) == null || this.getOwnerId(grn) === '') {
103
+ return false;
104
+ }
105
+ if (this.getNamespaceName(grn) == null || this.getNamespaceName(grn) === '') {
106
+ return false;
107
+ }
108
+ if (this.getType(grn) == null || this.getType(grn) === '') {
109
+ return false;
110
+ }
111
+ if (this.getUserIdentifier(grn) == null || this.getUserIdentifier(grn) === '') {
112
+ return false;
113
+ }
114
+ return true;
115
+ }
116
+
117
+ public static createGrn(
118
+ region: string|null,
119
+ ownerId: string|null,
120
+ namespaceName: string|null,
121
+ type: string|null,
122
+ userIdentifier: string|null,
123
+ ): string|null {
124
+ return grnFormat
125
+ .replace('{region}', region ?? '')
126
+ .replace('{ownerId}', ownerId ?? '')
127
+ .replace('{namespaceName}', namespaceName ?? '')
128
+ .replace('{type}', type ?? '')
129
+ .replace('{userIdentifier}', userIdentifier ?? '');
130
+ }
131
+ public getPlatformId(): string|null {
132
+ return this.platformId;
133
+ }
134
+ public setPlatformId(platformId: string|null) {
135
+ this.platformId = platformId;
136
+ return this;
137
+ }
138
+ public withPlatformId(platformId: string|null): this {
139
+ this.platformId = platformId;
140
+ return this;
141
+ }
142
+ public getUserId(): string|null {
143
+ return this.userId;
144
+ }
145
+ public setUserId(userId: string|null) {
146
+ this.userId = userId;
147
+ return this;
148
+ }
149
+ public withUserId(userId: string|null): this {
150
+ this.userId = userId;
151
+ return this;
152
+ }
153
+ public getType(): number|null {
154
+ return this.type;
155
+ }
156
+ public setType(type: number|null) {
157
+ this.type = type;
158
+ return this;
159
+ }
160
+ public withType(type: number|null): this {
161
+ this.type = type;
162
+ return this;
163
+ }
164
+ public getUserIdentifier(): string|null {
165
+ return this.userIdentifier;
166
+ }
167
+ public setUserIdentifier(userIdentifier: string|null) {
168
+ this.userIdentifier = userIdentifier;
169
+ return this;
170
+ }
171
+ public withUserIdentifier(userIdentifier: string|null): this {
172
+ this.userIdentifier = userIdentifier;
173
+ return this;
174
+ }
175
+ public getCreatedAt(): number|null {
176
+ return this.createdAt;
177
+ }
178
+ public setCreatedAt(createdAt: number|null) {
179
+ this.createdAt = createdAt;
180
+ return this;
181
+ }
182
+ public withCreatedAt(createdAt: number|null): this {
183
+ this.createdAt = createdAt;
184
+ return this;
185
+ }
186
+ public getRevision(): number|null {
187
+ return this.revision;
188
+ }
189
+ public setRevision(revision: number|null) {
190
+ this.revision = revision;
191
+ return this;
192
+ }
193
+ public withRevision(revision: number|null): this {
194
+ this.revision = revision;
195
+ return this;
196
+ }
197
+
198
+ public static fromDict(data: {[key: string]: any}): PlatformId|null {
199
+ if (data == undefined || data == null) {
200
+ return null;
201
+ }
202
+ return new PlatformId()
203
+ .withPlatformId(data["platformId"])
204
+ .withUserId(data["userId"])
205
+ .withType(data["type"])
206
+ .withUserIdentifier(data["userIdentifier"])
207
+ .withCreatedAt(data["createdAt"])
208
+ .withRevision(data["revision"]);
209
+ }
210
+
211
+ public toDict(): {[key: string]: any} {
212
+ return {
213
+ "platformId": this.getPlatformId(),
214
+ "userId": this.getUserId(),
215
+ "type": this.getType(),
216
+ "userIdentifier": this.getUserIdentifier(),
217
+ "createdAt": this.getCreatedAt(),
218
+ "revision": this.getRevision(),
219
+ };
220
+ }
221
+ }
@@ -0,0 +1,21 @@
1
+ import IModel from '../../core/interface/IModel';
2
+ export default class PlatformUser implements IModel {
3
+ private type;
4
+ private userIdentifier;
5
+ private userId;
6
+ getType(): number | null;
7
+ setType(type: number | null): this;
8
+ withType(type: number | null): this;
9
+ getUserIdentifier(): string | null;
10
+ setUserIdentifier(userIdentifier: string | null): this;
11
+ withUserIdentifier(userIdentifier: string | null): this;
12
+ getUserId(): string | null;
13
+ setUserId(userId: string | null): this;
14
+ withUserId(userId: string | null): this;
15
+ static fromDict(data: {
16
+ [key: string]: any;
17
+ }): PlatformUser | null;
18
+ toDict(): {
19
+ [key: string]: any;
20
+ };
21
+ }
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ /*
3
+ Copyright 2016 Game Server Services, Inc. or its affiliates. All Rights
4
+ Reserved.
5
+
6
+ Licensed under the Apache License, Version 2.0 (the "License").
7
+ You may not use this file except in compliance with the License.
8
+ A copy of the License is located at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ or in the "license" file accompanying this file. This file is distributed
13
+ on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
14
+ express or implied. See the License for the specific language governing
15
+ permissions and limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ var PlatformUser = /** @class */ (function () {
19
+ function PlatformUser() {
20
+ this.type = null;
21
+ this.userIdentifier = null;
22
+ this.userId = null;
23
+ }
24
+ PlatformUser.prototype.getType = function () {
25
+ return this.type;
26
+ };
27
+ PlatformUser.prototype.setType = function (type) {
28
+ this.type = type;
29
+ return this;
30
+ };
31
+ PlatformUser.prototype.withType = function (type) {
32
+ this.type = type;
33
+ return this;
34
+ };
35
+ PlatformUser.prototype.getUserIdentifier = function () {
36
+ return this.userIdentifier;
37
+ };
38
+ PlatformUser.prototype.setUserIdentifier = function (userIdentifier) {
39
+ this.userIdentifier = userIdentifier;
40
+ return this;
41
+ };
42
+ PlatformUser.prototype.withUserIdentifier = function (userIdentifier) {
43
+ this.userIdentifier = userIdentifier;
44
+ return this;
45
+ };
46
+ PlatformUser.prototype.getUserId = function () {
47
+ return this.userId;
48
+ };
49
+ PlatformUser.prototype.setUserId = function (userId) {
50
+ this.userId = userId;
51
+ return this;
52
+ };
53
+ PlatformUser.prototype.withUserId = function (userId) {
54
+ this.userId = userId;
55
+ return this;
56
+ };
57
+ PlatformUser.fromDict = function (data) {
58
+ if (data == undefined || data == null) {
59
+ return null;
60
+ }
61
+ return new PlatformUser()
62
+ .withType(data["type"])
63
+ .withUserIdentifier(data["userIdentifier"])
64
+ .withUserId(data["userId"]);
65
+ };
66
+ PlatformUser.prototype.toDict = function () {
67
+ return {
68
+ "type": this.getType(),
69
+ "userIdentifier": this.getUserIdentifier(),
70
+ "userId": this.getUserId(),
71
+ };
72
+ };
73
+ return PlatformUser;
74
+ }());
75
+ exports.default = PlatformUser;
76
+ //# sourceMappingURL=PlatformUser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlatformUser.js","sourceRoot":"","sources":["PlatformUser.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAIH;IAAA;QACY,SAAI,GAAgB,IAAI,CAAC;QACzB,mBAAc,GAAgB,IAAI,CAAC;QACnC,WAAM,GAAgB,IAAI,CAAC;IAoDvC,CAAC;IAnDU,8BAAO,GAAd;QACI,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IACM,8BAAO,GAAd,UAAe,IAAiB;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,OAAO,IAAI,CAAC;IAChB,CAAC;IACM,+BAAQ,GAAf,UAAgB,IAAiB;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,OAAO,IAAI,CAAC;IAChB,CAAC;IACM,wCAAiB,GAAxB;QACI,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IACM,wCAAiB,GAAxB,UAAyB,cAA2B;QAChD,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,OAAO,IAAI,CAAC;IAChB,CAAC;IACM,yCAAkB,GAAzB,UAA0B,cAA2B;QACjD,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,OAAO,IAAI,CAAC;IAChB,CAAC;IACM,gCAAS,GAAhB;QACI,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IACM,gCAAS,GAAhB,UAAiB,MAAmB;QAChC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,OAAO,IAAI,CAAC;IAChB,CAAC;IACM,iCAAU,GAAjB,UAAkB,MAAmB;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,OAAO,IAAI,CAAC;IAChB,CAAC;IAEa,qBAAQ,GAAtB,UAAuB,IAA0B;QAC7C,IAAI,IAAI,IAAI,SAAS,IAAI,IAAI,IAAI,IAAI,EAAE;YACnC,OAAO,IAAI,CAAC;SACf;QACD,OAAO,IAAI,YAAY,EAAE;aACpB,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aACtB,kBAAkB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;aAC1C,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IACpC,CAAC;IAEM,6BAAM,GAAb;QACI,OAAO;YACH,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE;YACtB,gBAAgB,EAAE,IAAI,CAAC,iBAAiB,EAAE;YAC1C,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE;SAC7B,CAAC;IACN,CAAC;IACL,mBAAC;AAAD,CAAC,AAvDD,IAuDC"}
@@ -0,0 +1,74 @@
1
+ /*
2
+ Copyright 2016 Game Server Services, Inc. or its affiliates. All Rights
3
+ Reserved.
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License").
6
+ You may not use this file except in compliance with the License.
7
+ A copy of the License is located at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ or in the "license" file accompanying this file. This file is distributed
12
+ on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13
+ express or implied. See the License for the specific language governing
14
+ permissions and limitations under the License.
15
+ */
16
+
17
+ import IModel from '../../core/interface/IModel';
18
+
19
+ export default class PlatformUser implements IModel {
20
+ private type: number|null = null;
21
+ private userIdentifier: string|null = null;
22
+ private userId: string|null = null;
23
+ public getType(): number|null {
24
+ return this.type;
25
+ }
26
+ public setType(type: number|null) {
27
+ this.type = type;
28
+ return this;
29
+ }
30
+ public withType(type: number|null): this {
31
+ this.type = type;
32
+ return this;
33
+ }
34
+ public getUserIdentifier(): string|null {
35
+ return this.userIdentifier;
36
+ }
37
+ public setUserIdentifier(userIdentifier: string|null) {
38
+ this.userIdentifier = userIdentifier;
39
+ return this;
40
+ }
41
+ public withUserIdentifier(userIdentifier: string|null): this {
42
+ this.userIdentifier = userIdentifier;
43
+ return this;
44
+ }
45
+ public getUserId(): string|null {
46
+ return this.userId;
47
+ }
48
+ public setUserId(userId: string|null) {
49
+ this.userId = userId;
50
+ return this;
51
+ }
52
+ public withUserId(userId: string|null): this {
53
+ this.userId = userId;
54
+ return this;
55
+ }
56
+
57
+ public static fromDict(data: {[key: string]: any}): PlatformUser|null {
58
+ if (data == undefined || data == null) {
59
+ return null;
60
+ }
61
+ return new PlatformUser()
62
+ .withType(data["type"])
63
+ .withUserIdentifier(data["userIdentifier"])
64
+ .withUserId(data["userId"]);
65
+ }
66
+
67
+ public toDict(): {[key: string]: any} {
68
+ return {
69
+ "type": this.getType(),
70
+ "userIdentifier": this.getUserIdentifier(),
71
+ "userId": this.getUserId(),
72
+ };
73
+ }
74
+ }
@@ -1,8 +1,10 @@
1
1
  import Namespace from "./Namespace";
2
2
  import Account from "./Account";
3
3
  import TakeOver from "./TakeOver";
4
+ import PlatformId from "./PlatformId";
4
5
  import DataOwner from "./DataOwner";
6
+ import PlatformUser from "./PlatformUser";
5
7
  import BanStatus from "./BanStatus";
6
8
  import ScriptSetting from "./ScriptSetting";
7
9
  import LogSetting from "./LogSetting";
8
- export { Namespace, Account, TakeOver, DataOwner, BanStatus, ScriptSetting, LogSetting, };
10
+ export { Namespace, Account, TakeOver, PlatformId, DataOwner, PlatformUser, BanStatus, ScriptSetting, LogSetting, };