gs2 1.3.32 → 1.3.35
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/package.json +1 -1
- package/src/account/model/DataOwner.ts +182 -0
- package/src/account/model/Namespace.ts +17 -0
- package/src/account/model/index.ts +2 -0
- package/src/account/request/CreateNamespaceRequest.ts +17 -0
- package/src/account/request/DeleteDataOwnerByUserIdRequest.ts +96 -0
- package/src/account/request/GetDataOwnerByUserIdRequest.ts +96 -0
- package/src/account/request/UpdateNamespaceRequest.ts +17 -0
- package/src/account/request/index.ts +4 -0
- package/src/account/rest.ts +56 -0
- package/src/account/result/DeleteDataOwnerByUserIdResult.ts +48 -0
- package/src/account/result/GetDataOwnerByUserIdResult.ts +48 -0
- package/src/account/result/index.ts +4 -0
package/package.json
CHANGED
|
@@ -0,0 +1,182 @@
|
|
|
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}:account:{userId}:dataOwner:{dataOwnerName}";
|
|
19
|
+
|
|
20
|
+
export default class DataOwner implements IModel {
|
|
21
|
+
private dataOwnerId: string|null = null;
|
|
22
|
+
private userId: string|null = null;
|
|
23
|
+
private name: string|null = null;
|
|
24
|
+
private createdAt: number|null = null;
|
|
25
|
+
|
|
26
|
+
public static getRegion(grn: string): string|null {
|
|
27
|
+
const match = grn.match(grnFormat
|
|
28
|
+
.replace('{region}', '(.*)')
|
|
29
|
+
.replace('{ownerId}', '.*')
|
|
30
|
+
.replace('{namespaceName}', '.*')
|
|
31
|
+
.replace('{userId}', '.*')
|
|
32
|
+
);
|
|
33
|
+
if (match) {
|
|
34
|
+
return match[1];
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public static getOwnerId(grn: string): string|null {
|
|
40
|
+
const match = grn.match(grnFormat
|
|
41
|
+
.replace('{region}', '.*')
|
|
42
|
+
.replace('{ownerId}', '(.*)')
|
|
43
|
+
.replace('{namespaceName}', '.*')
|
|
44
|
+
.replace('{userId}', '.*')
|
|
45
|
+
);
|
|
46
|
+
if (match) {
|
|
47
|
+
return match[1];
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
public static getNamespaceName(grn: string): string|null {
|
|
53
|
+
const match = grn.match(grnFormat
|
|
54
|
+
.replace('{region}', '.*')
|
|
55
|
+
.replace('{ownerId}', '.*')
|
|
56
|
+
.replace('{namespaceName}', '(.*)')
|
|
57
|
+
.replace('{userId}', '.*')
|
|
58
|
+
);
|
|
59
|
+
if (match) {
|
|
60
|
+
return match[1];
|
|
61
|
+
}
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public static getUserId(grn: string): string|null {
|
|
66
|
+
const match = grn.match(grnFormat
|
|
67
|
+
.replace('{region}', '.*')
|
|
68
|
+
.replace('{ownerId}', '.*')
|
|
69
|
+
.replace('{namespaceName}', '.*')
|
|
70
|
+
.replace('{userId}', '(.*)')
|
|
71
|
+
);
|
|
72
|
+
if (match) {
|
|
73
|
+
return match[1];
|
|
74
|
+
}
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
public static isValid(grn: string): boolean {
|
|
79
|
+
if (this.getRegion(grn) == null || this.getRegion(grn) === '') {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
if (this.getOwnerId(grn) == null || this.getOwnerId(grn) === '') {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
if (this.getNamespaceName(grn) == null || this.getNamespaceName(grn) === '') {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
if (this.getUserId(grn) == null || this.getUserId(grn) === '') {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
public static createGrn(
|
|
95
|
+
region: string|null,
|
|
96
|
+
ownerId: string|null,
|
|
97
|
+
namespaceName: string|null,
|
|
98
|
+
userId: string|null,
|
|
99
|
+
): string|null {
|
|
100
|
+
return grnFormat
|
|
101
|
+
.replace('{region}', region ?? '')
|
|
102
|
+
.replace('{ownerId}', ownerId ?? '')
|
|
103
|
+
.replace('{namespaceName}', namespaceName ?? '')
|
|
104
|
+
.replace('{userId}', userId ?? '');
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
public getDataOwnerId(): string|null {
|
|
108
|
+
return this.dataOwnerId;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
public setDataOwnerId(dataOwnerId: string|null) {
|
|
112
|
+
this.dataOwnerId = dataOwnerId;
|
|
113
|
+
return this;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
public withDataOwnerId(dataOwnerId: string|null): this {
|
|
117
|
+
this.dataOwnerId = dataOwnerId;
|
|
118
|
+
return this;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
public getUserId(): string|null {
|
|
122
|
+
return this.userId;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
public setUserId(userId: string|null) {
|
|
126
|
+
this.userId = userId;
|
|
127
|
+
return this;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
public withUserId(userId: string|null): this {
|
|
131
|
+
this.userId = userId;
|
|
132
|
+
return this;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
public getName(): string|null {
|
|
136
|
+
return this.name;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
public setName(name: string|null) {
|
|
140
|
+
this.name = name;
|
|
141
|
+
return this;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
public withName(name: string|null): this {
|
|
145
|
+
this.name = name;
|
|
146
|
+
return this;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
public getCreatedAt(): number|null {
|
|
150
|
+
return this.createdAt;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
public setCreatedAt(createdAt: number|null) {
|
|
154
|
+
this.createdAt = createdAt;
|
|
155
|
+
return this;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
public withCreatedAt(createdAt: number|null): this {
|
|
159
|
+
this.createdAt = createdAt;
|
|
160
|
+
return this;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
public static fromDict(data: {[key: string]: any}): DataOwner|null {
|
|
164
|
+
if (data == undefined || data == null) {
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
return new DataOwner()
|
|
168
|
+
.withDataOwnerId(data["dataOwnerId"])
|
|
169
|
+
.withUserId(data["userId"])
|
|
170
|
+
.withName(data["name"])
|
|
171
|
+
.withCreatedAt(data["createdAt"]);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
public toDict(): {[key: string]: any} {
|
|
175
|
+
return {
|
|
176
|
+
"dataOwnerId": this.getDataOwnerId(),
|
|
177
|
+
"userId": this.getUserId(),
|
|
178
|
+
"name": this.getName(),
|
|
179
|
+
"createdAt": this.getCreatedAt(),
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
}
|
|
@@ -24,6 +24,7 @@ export default class Namespace implements IModel {
|
|
|
24
24
|
private name: string|null = null;
|
|
25
25
|
private description: string|null = null;
|
|
26
26
|
private changePasswordIfTakeOver: boolean|null = null;
|
|
27
|
+
private differentUserIdForLoginAndDataRetention: boolean|null = null;
|
|
27
28
|
private createAccountScript: ScriptSetting|null = null;
|
|
28
29
|
private authenticationScript: ScriptSetting|null = null;
|
|
29
30
|
private createTakeOverScript: ScriptSetting|null = null;
|
|
@@ -148,6 +149,20 @@ export default class Namespace implements IModel {
|
|
|
148
149
|
return this;
|
|
149
150
|
}
|
|
150
151
|
|
|
152
|
+
public getDifferentUserIdForLoginAndDataRetention(): boolean|null {
|
|
153
|
+
return this.differentUserIdForLoginAndDataRetention;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
public setDifferentUserIdForLoginAndDataRetention(differentUserIdForLoginAndDataRetention: boolean|null) {
|
|
157
|
+
this.differentUserIdForLoginAndDataRetention = differentUserIdForLoginAndDataRetention;
|
|
158
|
+
return this;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
public withDifferentUserIdForLoginAndDataRetention(differentUserIdForLoginAndDataRetention: boolean|null): this {
|
|
162
|
+
this.differentUserIdForLoginAndDataRetention = differentUserIdForLoginAndDataRetention;
|
|
163
|
+
return this;
|
|
164
|
+
}
|
|
165
|
+
|
|
151
166
|
public getCreateAccountScript(): ScriptSetting|null {
|
|
152
167
|
return this.createAccountScript;
|
|
153
168
|
}
|
|
@@ -255,6 +270,7 @@ export default class Namespace implements IModel {
|
|
|
255
270
|
.withName(data["name"])
|
|
256
271
|
.withDescription(data["description"])
|
|
257
272
|
.withChangePasswordIfTakeOver(data["changePasswordIfTakeOver"])
|
|
273
|
+
.withDifferentUserIdForLoginAndDataRetention(data["differentUserIdForLoginAndDataRetention"])
|
|
258
274
|
.withCreateAccountScript(ScriptSetting.fromDict(data["createAccountScript"]))
|
|
259
275
|
.withAuthenticationScript(ScriptSetting.fromDict(data["authenticationScript"]))
|
|
260
276
|
.withCreateTakeOverScript(ScriptSetting.fromDict(data["createTakeOverScript"]))
|
|
@@ -270,6 +286,7 @@ export default class Namespace implements IModel {
|
|
|
270
286
|
"name": this.getName(),
|
|
271
287
|
"description": this.getDescription(),
|
|
272
288
|
"changePasswordIfTakeOver": this.getChangePasswordIfTakeOver(),
|
|
289
|
+
"differentUserIdForLoginAndDataRetention": this.getDifferentUserIdForLoginAndDataRetention(),
|
|
273
290
|
"createAccountScript": this.getCreateAccountScript()?.toDict(),
|
|
274
291
|
"authenticationScript": this.getAuthenticationScript()?.toDict(),
|
|
275
292
|
"createTakeOverScript": this.getCreateTakeOverScript()?.toDict(),
|
|
@@ -16,6 +16,7 @@ permissions and limitations under the License.
|
|
|
16
16
|
import Namespace from "./Namespace"
|
|
17
17
|
import Account from "./Account"
|
|
18
18
|
import TakeOver from "./TakeOver"
|
|
19
|
+
import DataOwner from "./DataOwner"
|
|
19
20
|
import ScriptSetting from "./ScriptSetting"
|
|
20
21
|
import LogSetting from "./LogSetting"
|
|
21
22
|
|
|
@@ -23,6 +24,7 @@ export {
|
|
|
23
24
|
Namespace,
|
|
24
25
|
Account,
|
|
25
26
|
TakeOver,
|
|
27
|
+
DataOwner,
|
|
26
28
|
ScriptSetting,
|
|
27
29
|
LogSetting,
|
|
28
30
|
};
|
|
@@ -25,6 +25,7 @@ export default class CreateNamespaceRequest implements IRequest {
|
|
|
25
25
|
private name: string|null = null;
|
|
26
26
|
private description: string|null = null;
|
|
27
27
|
private changePasswordIfTakeOver: boolean|null = null;
|
|
28
|
+
private differentUserIdForLoginAndDataRetention: boolean|null = null;
|
|
28
29
|
private createAccountScript: Gs2Account.ScriptSetting|null = null;
|
|
29
30
|
private authenticationScript: Gs2Account.ScriptSetting|null = null;
|
|
30
31
|
private createTakeOverScript: Gs2Account.ScriptSetting|null = null;
|
|
@@ -101,6 +102,20 @@ export default class CreateNamespaceRequest implements IRequest {
|
|
|
101
102
|
return this;
|
|
102
103
|
}
|
|
103
104
|
|
|
105
|
+
public getDifferentUserIdForLoginAndDataRetention(): boolean|null {
|
|
106
|
+
return this.differentUserIdForLoginAndDataRetention;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
public setDifferentUserIdForLoginAndDataRetention(differentUserIdForLoginAndDataRetention: boolean|null) {
|
|
110
|
+
this.differentUserIdForLoginAndDataRetention = differentUserIdForLoginAndDataRetention;
|
|
111
|
+
return this;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
public withDifferentUserIdForLoginAndDataRetention(differentUserIdForLoginAndDataRetention: boolean|null): this {
|
|
115
|
+
this.differentUserIdForLoginAndDataRetention = differentUserIdForLoginAndDataRetention;
|
|
116
|
+
return this;
|
|
117
|
+
}
|
|
118
|
+
|
|
104
119
|
public getCreateAccountScript(): Gs2Account.ScriptSetting|null {
|
|
105
120
|
return this.createAccountScript;
|
|
106
121
|
}
|
|
@@ -176,6 +191,7 @@ export default class CreateNamespaceRequest implements IRequest {
|
|
|
176
191
|
.withName(data["name"])
|
|
177
192
|
.withDescription(data["description"])
|
|
178
193
|
.withChangePasswordIfTakeOver(data["changePasswordIfTakeOver"])
|
|
194
|
+
.withDifferentUserIdForLoginAndDataRetention(data["differentUserIdForLoginAndDataRetention"])
|
|
179
195
|
.withCreateAccountScript(Gs2Account.ScriptSetting.fromDict(data["createAccountScript"]))
|
|
180
196
|
.withAuthenticationScript(Gs2Account.ScriptSetting.fromDict(data["authenticationScript"]))
|
|
181
197
|
.withCreateTakeOverScript(Gs2Account.ScriptSetting.fromDict(data["createTakeOverScript"]))
|
|
@@ -188,6 +204,7 @@ export default class CreateNamespaceRequest implements IRequest {
|
|
|
188
204
|
"name": this.getName(),
|
|
189
205
|
"description": this.getDescription(),
|
|
190
206
|
"changePasswordIfTakeOver": this.getChangePasswordIfTakeOver(),
|
|
207
|
+
"differentUserIdForLoginAndDataRetention": this.getDifferentUserIdForLoginAndDataRetention(),
|
|
191
208
|
"createAccountScript": this.getCreateAccountScript()?.toDict(),
|
|
192
209
|
"authenticationScript": this.getAuthenticationScript()?.toDict(),
|
|
193
210
|
"createTakeOverScript": this.getCreateTakeOverScript()?.toDict(),
|
|
@@ -0,0 +1,96 @@
|
|
|
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 IRequest from '../../core/interface/IRequest';
|
|
18
|
+
|
|
19
|
+
import * as Gs2Account from '../model'
|
|
20
|
+
|
|
21
|
+
export default class DeleteDataOwnerByUserIdRequest implements IRequest {
|
|
22
|
+
|
|
23
|
+
private requestId: string|null = null;
|
|
24
|
+
private contextStack: string|null = null;
|
|
25
|
+
private namespaceName: string|null = null;
|
|
26
|
+
private userId: string|null = null;
|
|
27
|
+
|
|
28
|
+
public getRequestId(): string|null {
|
|
29
|
+
return this.requestId;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public setRequestId(requestId: string|null) {
|
|
33
|
+
this.requestId = requestId;
|
|
34
|
+
return this;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public withRequestId(requestId: string|null): this {
|
|
38
|
+
this.requestId = requestId;
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
public getContextStack(): string|null {
|
|
43
|
+
return this.contextStack;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public setContextStack(contextStack: string|null) {
|
|
47
|
+
this.contextStack = contextStack;
|
|
48
|
+
return this;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public withContextStack(contextStack: string|null): this {
|
|
52
|
+
this.contextStack = contextStack;
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
public getNamespaceName(): string|null {
|
|
57
|
+
return this.namespaceName;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
public setNamespaceName(namespaceName: string|null) {
|
|
61
|
+
this.namespaceName = namespaceName;
|
|
62
|
+
return this;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public withNamespaceName(namespaceName: string|null): this {
|
|
66
|
+
this.namespaceName = namespaceName;
|
|
67
|
+
return this;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
public getUserId(): string|null {
|
|
71
|
+
return this.userId;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public setUserId(userId: string|null) {
|
|
75
|
+
this.userId = userId;
|
|
76
|
+
return this;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
public withUserId(userId: string|null): this {
|
|
80
|
+
this.userId = userId;
|
|
81
|
+
return this;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
public static fromDict(data: {[key: string]: any}): DeleteDataOwnerByUserIdRequest {
|
|
85
|
+
return new DeleteDataOwnerByUserIdRequest()
|
|
86
|
+
.withNamespaceName(data["namespaceName"])
|
|
87
|
+
.withUserId(data["userId"]);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
public toDict(): {[key: string]: any} {
|
|
91
|
+
return {
|
|
92
|
+
"namespaceName": this.getNamespaceName(),
|
|
93
|
+
"userId": this.getUserId(),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
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 IRequest from '../../core/interface/IRequest';
|
|
18
|
+
|
|
19
|
+
import * as Gs2Account from '../model'
|
|
20
|
+
|
|
21
|
+
export default class GetDataOwnerByUserIdRequest implements IRequest {
|
|
22
|
+
|
|
23
|
+
private requestId: string|null = null;
|
|
24
|
+
private contextStack: string|null = null;
|
|
25
|
+
private namespaceName: string|null = null;
|
|
26
|
+
private userId: string|null = null;
|
|
27
|
+
|
|
28
|
+
public getRequestId(): string|null {
|
|
29
|
+
return this.requestId;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public setRequestId(requestId: string|null) {
|
|
33
|
+
this.requestId = requestId;
|
|
34
|
+
return this;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public withRequestId(requestId: string|null): this {
|
|
38
|
+
this.requestId = requestId;
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
public getContextStack(): string|null {
|
|
43
|
+
return this.contextStack;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public setContextStack(contextStack: string|null) {
|
|
47
|
+
this.contextStack = contextStack;
|
|
48
|
+
return this;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public withContextStack(contextStack: string|null): this {
|
|
52
|
+
this.contextStack = contextStack;
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
public getNamespaceName(): string|null {
|
|
57
|
+
return this.namespaceName;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
public setNamespaceName(namespaceName: string|null) {
|
|
61
|
+
this.namespaceName = namespaceName;
|
|
62
|
+
return this;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public withNamespaceName(namespaceName: string|null): this {
|
|
66
|
+
this.namespaceName = namespaceName;
|
|
67
|
+
return this;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
public getUserId(): string|null {
|
|
71
|
+
return this.userId;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public setUserId(userId: string|null) {
|
|
75
|
+
this.userId = userId;
|
|
76
|
+
return this;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
public withUserId(userId: string|null): this {
|
|
80
|
+
this.userId = userId;
|
|
81
|
+
return this;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
public static fromDict(data: {[key: string]: any}): GetDataOwnerByUserIdRequest {
|
|
85
|
+
return new GetDataOwnerByUserIdRequest()
|
|
86
|
+
.withNamespaceName(data["namespaceName"])
|
|
87
|
+
.withUserId(data["userId"]);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
public toDict(): {[key: string]: any} {
|
|
91
|
+
return {
|
|
92
|
+
"namespaceName": this.getNamespaceName(),
|
|
93
|
+
"userId": this.getUserId(),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -25,6 +25,7 @@ export default class UpdateNamespaceRequest implements IRequest {
|
|
|
25
25
|
private namespaceName: string|null = null;
|
|
26
26
|
private description: string|null = null;
|
|
27
27
|
private changePasswordIfTakeOver: boolean|null = null;
|
|
28
|
+
private differentUserIdForLoginAndDataRetention: boolean|null = null;
|
|
28
29
|
private createAccountScript: Gs2Account.ScriptSetting|null = null;
|
|
29
30
|
private authenticationScript: Gs2Account.ScriptSetting|null = null;
|
|
30
31
|
private createTakeOverScript: Gs2Account.ScriptSetting|null = null;
|
|
@@ -101,6 +102,20 @@ export default class UpdateNamespaceRequest implements IRequest {
|
|
|
101
102
|
return this;
|
|
102
103
|
}
|
|
103
104
|
|
|
105
|
+
public getDifferentUserIdForLoginAndDataRetention(): boolean|null {
|
|
106
|
+
return this.differentUserIdForLoginAndDataRetention;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
public setDifferentUserIdForLoginAndDataRetention(differentUserIdForLoginAndDataRetention: boolean|null) {
|
|
110
|
+
this.differentUserIdForLoginAndDataRetention = differentUserIdForLoginAndDataRetention;
|
|
111
|
+
return this;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
public withDifferentUserIdForLoginAndDataRetention(differentUserIdForLoginAndDataRetention: boolean|null): this {
|
|
115
|
+
this.differentUserIdForLoginAndDataRetention = differentUserIdForLoginAndDataRetention;
|
|
116
|
+
return this;
|
|
117
|
+
}
|
|
118
|
+
|
|
104
119
|
public getCreateAccountScript(): Gs2Account.ScriptSetting|null {
|
|
105
120
|
return this.createAccountScript;
|
|
106
121
|
}
|
|
@@ -176,6 +191,7 @@ export default class UpdateNamespaceRequest implements IRequest {
|
|
|
176
191
|
.withNamespaceName(data["namespaceName"])
|
|
177
192
|
.withDescription(data["description"])
|
|
178
193
|
.withChangePasswordIfTakeOver(data["changePasswordIfTakeOver"])
|
|
194
|
+
.withDifferentUserIdForLoginAndDataRetention(data["differentUserIdForLoginAndDataRetention"])
|
|
179
195
|
.withCreateAccountScript(Gs2Account.ScriptSetting.fromDict(data["createAccountScript"]))
|
|
180
196
|
.withAuthenticationScript(Gs2Account.ScriptSetting.fromDict(data["authenticationScript"]))
|
|
181
197
|
.withCreateTakeOverScript(Gs2Account.ScriptSetting.fromDict(data["createTakeOverScript"]))
|
|
@@ -188,6 +204,7 @@ export default class UpdateNamespaceRequest implements IRequest {
|
|
|
188
204
|
"namespaceName": this.getNamespaceName(),
|
|
189
205
|
"description": this.getDescription(),
|
|
190
206
|
"changePasswordIfTakeOver": this.getChangePasswordIfTakeOver(),
|
|
207
|
+
"differentUserIdForLoginAndDataRetention": this.getDifferentUserIdForLoginAndDataRetention(),
|
|
191
208
|
"createAccountScript": this.getCreateAccountScript()?.toDict(),
|
|
192
209
|
"authenticationScript": this.getAuthenticationScript()?.toDict(),
|
|
193
210
|
"createTakeOverScript": this.getCreateTakeOverScript()?.toDict(),
|
|
@@ -36,6 +36,8 @@ import UpdateTakeOverByUserIdRequest from "./UpdateTakeOverByUserIdRequest"
|
|
|
36
36
|
import DeleteTakeOverRequest from "./DeleteTakeOverRequest"
|
|
37
37
|
import DeleteTakeOverByUserIdentifierRequest from "./DeleteTakeOverByUserIdentifierRequest"
|
|
38
38
|
import DoTakeOverRequest from "./DoTakeOverRequest"
|
|
39
|
+
import GetDataOwnerByUserIdRequest from "./GetDataOwnerByUserIdRequest"
|
|
40
|
+
import DeleteDataOwnerByUserIdRequest from "./DeleteDataOwnerByUserIdRequest"
|
|
39
41
|
|
|
40
42
|
export {
|
|
41
43
|
DescribeNamespacesRequest,
|
|
@@ -61,4 +63,6 @@ export {
|
|
|
61
63
|
DeleteTakeOverRequest,
|
|
62
64
|
DeleteTakeOverByUserIdentifierRequest,
|
|
63
65
|
DoTakeOverRequest,
|
|
66
|
+
GetDataOwnerByUserIdRequest,
|
|
67
|
+
DeleteDataOwnerByUserIdRequest,
|
|
64
68
|
};
|
package/src/account/rest.ts
CHANGED
|
@@ -68,6 +68,7 @@ export default class Gs2AccountRestClient extends AbstractGs2RestClient {
|
|
|
68
68
|
'name': request.getName() ?? null,
|
|
69
69
|
'description': request.getDescription() ?? null,
|
|
70
70
|
'changePasswordIfTakeOver': request.getChangePasswordIfTakeOver() ?? null,
|
|
71
|
+
'differentUserIdForLoginAndDataRetention': request.getDifferentUserIdForLoginAndDataRetention() ?? null,
|
|
71
72
|
'createAccountScript': request.getCreateAccountScript()?.toDict() ?? null,
|
|
72
73
|
'authenticationScript': request.getAuthenticationScript()?.toDict() ?? null,
|
|
73
74
|
'createTakeOverScript': request.getCreateTakeOverScript()?.toDict() ?? null,
|
|
@@ -157,6 +158,7 @@ export default class Gs2AccountRestClient extends AbstractGs2RestClient {
|
|
|
157
158
|
'contextStack': request.getContextStack() ?? null,
|
|
158
159
|
'description': request.getDescription() ?? null,
|
|
159
160
|
'changePasswordIfTakeOver': request.getChangePasswordIfTakeOver() ?? null,
|
|
161
|
+
'differentUserIdForLoginAndDataRetention': request.getDifferentUserIdForLoginAndDataRetention() ?? null,
|
|
160
162
|
'createAccountScript': request.getCreateAccountScript()?.toDict() ?? null,
|
|
161
163
|
'authenticationScript': request.getAuthenticationScript()?.toDict() ?? null,
|
|
162
164
|
'createTakeOverScript': request.getCreateTakeOverScript()?.toDict() ?? null,
|
|
@@ -744,4 +746,58 @@ export default class Gs2AccountRestClient extends AbstractGs2RestClient {
|
|
|
744
746
|
}
|
|
745
747
|
});
|
|
746
748
|
}
|
|
749
|
+
|
|
750
|
+
public getDataOwnerByUserId(request: Request.GetDataOwnerByUserIdRequest): Promise<Result.GetDataOwnerByUserIdResult> {
|
|
751
|
+
const url = (Gs2Constant.ENDPOINT_HOST + '/{namespaceName}/account/{userId}/dataOwner')
|
|
752
|
+
.replace('{service}', 'account')
|
|
753
|
+
.replace('{region}', this.session.region)
|
|
754
|
+
.replace('{namespaceName}', String(request.getNamespaceName() ?? 'null') === "" ? "null" : String(request.getNamespaceName() ?? 'null'))
|
|
755
|
+
.replace('{userId}', String(request.getUserId() ?? 'null') === "" ? "null" : String(request.getUserId() ?? 'null'));
|
|
756
|
+
|
|
757
|
+
const headers = this.createAuthorizedHeaders();
|
|
758
|
+
if (request.getRequestId()) {
|
|
759
|
+
headers['X-GS2-REQUEST-ID'] = request.getRequestId();
|
|
760
|
+
}
|
|
761
|
+
const params: {[key: string]: any} = {
|
|
762
|
+
'contextStack': request.getContextStack() ?? null,
|
|
763
|
+
};
|
|
764
|
+
return axios.get(
|
|
765
|
+
url,
|
|
766
|
+
{
|
|
767
|
+
params,
|
|
768
|
+
headers,
|
|
769
|
+
},
|
|
770
|
+
).then((response: any) => {
|
|
771
|
+
return Result.GetDataOwnerByUserIdResult.fromDict(response.data);
|
|
772
|
+
}).catch((error: any) => {
|
|
773
|
+
throw JSON.parse(error.response.data.message);
|
|
774
|
+
});
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
public deleteDataOwnerByUserId(request: Request.DeleteDataOwnerByUserIdRequest): Promise<Result.DeleteDataOwnerByUserIdResult> {
|
|
778
|
+
const url = (Gs2Constant.ENDPOINT_HOST + '/{namespaceName}/account/{userId}/dataOwner')
|
|
779
|
+
.replace('{service}', 'account')
|
|
780
|
+
.replace('{region}', this.session.region)
|
|
781
|
+
.replace('{namespaceName}', String(request.getNamespaceName() ?? 'null') === "" ? "null" : String(request.getNamespaceName() ?? 'null'))
|
|
782
|
+
.replace('{userId}', String(request.getUserId() ?? 'null') === "" ? "null" : String(request.getUserId() ?? 'null'));
|
|
783
|
+
|
|
784
|
+
const headers = this.createAuthorizedHeaders();
|
|
785
|
+
if (request.getRequestId()) {
|
|
786
|
+
headers['X-GS2-REQUEST-ID'] = request.getRequestId();
|
|
787
|
+
}
|
|
788
|
+
const params: {[key: string]: any} = {
|
|
789
|
+
'contextStack': request.getContextStack() ?? null,
|
|
790
|
+
};
|
|
791
|
+
return axios.delete(
|
|
792
|
+
url,
|
|
793
|
+
{
|
|
794
|
+
params,
|
|
795
|
+
headers,
|
|
796
|
+
},
|
|
797
|
+
).then((response: any) => {
|
|
798
|
+
return Result.DeleteDataOwnerByUserIdResult.fromDict(response.data);
|
|
799
|
+
}).catch((error: any) => {
|
|
800
|
+
throw JSON.parse(error.response.data.message);
|
|
801
|
+
});
|
|
802
|
+
}
|
|
747
803
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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 IResult from '../../core/interface/IResult';
|
|
18
|
+
|
|
19
|
+
import * as Gs2Account from '../model'
|
|
20
|
+
|
|
21
|
+
export default class DeleteDataOwnerByUserIdResult implements IResult {
|
|
22
|
+
private item: Gs2Account.DataOwner|null = null;
|
|
23
|
+
|
|
24
|
+
public getItem(): Gs2Account.DataOwner|null {
|
|
25
|
+
return this.item;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public setItem(item: Gs2Account.DataOwner|null) {
|
|
29
|
+
this.item = item;
|
|
30
|
+
return this;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public withItem(item: Gs2Account.DataOwner|null): this {
|
|
34
|
+
this.item = item;
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public static fromDict(data: {[key: string]: any}): DeleteDataOwnerByUserIdResult {
|
|
39
|
+
return new DeleteDataOwnerByUserIdResult()
|
|
40
|
+
.withItem(Gs2Account.DataOwner.fromDict(data["item"]));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public toDict(): {[key: string]: any} {
|
|
44
|
+
return {
|
|
45
|
+
"item": this.getItem()?.toDict(),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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 IResult from '../../core/interface/IResult';
|
|
18
|
+
|
|
19
|
+
import * as Gs2Account from '../model'
|
|
20
|
+
|
|
21
|
+
export default class GetDataOwnerByUserIdResult implements IResult {
|
|
22
|
+
private item: Gs2Account.DataOwner|null = null;
|
|
23
|
+
|
|
24
|
+
public getItem(): Gs2Account.DataOwner|null {
|
|
25
|
+
return this.item;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public setItem(item: Gs2Account.DataOwner|null) {
|
|
29
|
+
this.item = item;
|
|
30
|
+
return this;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public withItem(item: Gs2Account.DataOwner|null): this {
|
|
34
|
+
this.item = item;
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public static fromDict(data: {[key: string]: any}): GetDataOwnerByUserIdResult {
|
|
39
|
+
return new GetDataOwnerByUserIdResult()
|
|
40
|
+
.withItem(Gs2Account.DataOwner.fromDict(data["item"]));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public toDict(): {[key: string]: any} {
|
|
44
|
+
return {
|
|
45
|
+
"item": this.getItem()?.toDict(),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -36,6 +36,8 @@ import UpdateTakeOverByUserIdResult from "./UpdateTakeOverByUserIdResult"
|
|
|
36
36
|
import DeleteTakeOverResult from "./DeleteTakeOverResult"
|
|
37
37
|
import DeleteTakeOverByUserIdentifierResult from "./DeleteTakeOverByUserIdentifierResult"
|
|
38
38
|
import DoTakeOverResult from "./DoTakeOverResult"
|
|
39
|
+
import GetDataOwnerByUserIdResult from "./GetDataOwnerByUserIdResult"
|
|
40
|
+
import DeleteDataOwnerByUserIdResult from "./DeleteDataOwnerByUserIdResult"
|
|
39
41
|
|
|
40
42
|
export {
|
|
41
43
|
DescribeNamespacesResult,
|
|
@@ -61,4 +63,6 @@ export {
|
|
|
61
63
|
DeleteTakeOverResult,
|
|
62
64
|
DeleteTakeOverByUserIdentifierResult,
|
|
63
65
|
DoTakeOverResult,
|
|
66
|
+
GetDataOwnerByUserIdResult,
|
|
67
|
+
DeleteDataOwnerByUserIdResult,
|
|
64
68
|
};
|