gs2 1.3.237 → 1.3.238
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/auth/model/AccessToken.d.ts +4 -0
- package/auth/model/AccessToken.js +14 -0
- package/auth/model/AccessToken.js.map +1 -1
- package/auth/model/AccessToken.ts +14 -0
- package/auth/request/FederationRequest.d.ts +37 -0
- package/auth/request/FederationRequest.js +125 -0
- package/auth/request/FederationRequest.js.map +1 -0
- package/auth/request/FederationRequest.ts +132 -0
- package/auth/request/index.d.ts +2 -1
- package/auth/request/index.js +3 -1
- package/auth/request/index.js.map +1 -1
- package/auth/request/index.ts +2 -0
- package/auth/rest.d.ts +1 -0
- package/auth/rest.js +32 -0
- package/auth/rest.js.map +1 -1
- package/auth/rest.ts +36 -0
- package/auth/result/FederationResult.d.ts +21 -0
- package/auth/result/FederationResult.js +73 -0
- package/auth/result/FederationResult.js.map +1 -0
- package/auth/result/FederationResult.ts +80 -0
- package/auth/result/index.d.ts +2 -1
- package/auth/result/index.js +3 -1
- package/auth/result/index.js.map +1 -1
- package/auth/result/index.ts +2 -0
- package/inventory/model/ReferenceOf.d.ts +2 -2
- package/inventory/model/ReferenceOf.js +13 -13
- package/inventory/model/ReferenceOf.js.map +1 -1
- package/inventory/model/ReferenceOf.ts +13 -13
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ import IModel from '../../core/interface/IModel';
|
|
|
2
2
|
export default class AccessToken implements IModel {
|
|
3
3
|
private token;
|
|
4
4
|
private userId;
|
|
5
|
+
private federationFromUserId;
|
|
5
6
|
private expire;
|
|
6
7
|
private timeOffset;
|
|
7
8
|
getToken(): string | null;
|
|
@@ -10,6 +11,9 @@ export default class AccessToken implements IModel {
|
|
|
10
11
|
getUserId(): string | null;
|
|
11
12
|
setUserId(userId: string | null): this;
|
|
12
13
|
withUserId(userId: string | null): this;
|
|
14
|
+
getFederationFromUserId(): string | null;
|
|
15
|
+
setFederationFromUserId(federationFromUserId: string | null): this;
|
|
16
|
+
withFederationFromUserId(federationFromUserId: string | null): this;
|
|
13
17
|
getExpire(): number | null;
|
|
14
18
|
setExpire(expire: number | null): this;
|
|
15
19
|
withExpire(expire: number | null): this;
|
|
@@ -19,6 +19,7 @@ var AccessToken = /** @class */ (function () {
|
|
|
19
19
|
function AccessToken() {
|
|
20
20
|
this.token = null;
|
|
21
21
|
this.userId = null;
|
|
22
|
+
this.federationFromUserId = null;
|
|
22
23
|
this.expire = null;
|
|
23
24
|
this.timeOffset = null;
|
|
24
25
|
}
|
|
@@ -44,6 +45,17 @@ var AccessToken = /** @class */ (function () {
|
|
|
44
45
|
this.userId = userId;
|
|
45
46
|
return this;
|
|
46
47
|
};
|
|
48
|
+
AccessToken.prototype.getFederationFromUserId = function () {
|
|
49
|
+
return this.federationFromUserId;
|
|
50
|
+
};
|
|
51
|
+
AccessToken.prototype.setFederationFromUserId = function (federationFromUserId) {
|
|
52
|
+
this.federationFromUserId = federationFromUserId;
|
|
53
|
+
return this;
|
|
54
|
+
};
|
|
55
|
+
AccessToken.prototype.withFederationFromUserId = function (federationFromUserId) {
|
|
56
|
+
this.federationFromUserId = federationFromUserId;
|
|
57
|
+
return this;
|
|
58
|
+
};
|
|
47
59
|
AccessToken.prototype.getExpire = function () {
|
|
48
60
|
return this.expire;
|
|
49
61
|
};
|
|
@@ -73,6 +85,7 @@ var AccessToken = /** @class */ (function () {
|
|
|
73
85
|
return new AccessToken()
|
|
74
86
|
.withToken(data["token"])
|
|
75
87
|
.withUserId(data["userId"])
|
|
88
|
+
.withFederationFromUserId(data["federationFromUserId"])
|
|
76
89
|
.withExpire(data["expire"])
|
|
77
90
|
.withTimeOffset(data["timeOffset"]);
|
|
78
91
|
};
|
|
@@ -80,6 +93,7 @@ var AccessToken = /** @class */ (function () {
|
|
|
80
93
|
return {
|
|
81
94
|
"token": this.getToken(),
|
|
82
95
|
"userId": this.getUserId(),
|
|
96
|
+
"federationFromUserId": this.getFederationFromUserId(),
|
|
83
97
|
"expire": this.getExpire(),
|
|
84
98
|
"timeOffset": this.getTimeOffset(),
|
|
85
99
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccessToken.js","sourceRoot":"","sources":["AccessToken.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAIH;IAAA;QACY,UAAK,GAAgB,IAAI,CAAC;QAC1B,WAAM,GAAgB,IAAI,CAAC;QAC3B,WAAM,GAAgB,IAAI,CAAC;QAC3B,eAAU,GAAgB,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"AccessToken.js","sourceRoot":"","sources":["AccessToken.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAIH;IAAA;QACY,UAAK,GAAgB,IAAI,CAAC;QAC1B,WAAM,GAAgB,IAAI,CAAC;QAC3B,yBAAoB,GAAgB,IAAI,CAAC;QACzC,WAAM,GAAgB,IAAI,CAAC;QAC3B,eAAU,GAAgB,IAAI,CAAC;IA8E3C,CAAC;IA7EU,8BAAQ,GAAf;QACI,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IACM,8BAAQ,GAAf,UAAgB,KAAkB;QAC9B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,OAAO,IAAI,CAAC;IAChB,CAAC;IACM,+BAAS,GAAhB,UAAiB,KAAkB;QAC/B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,OAAO,IAAI,CAAC;IAChB,CAAC;IACM,+BAAS,GAAhB;QACI,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IACM,+BAAS,GAAhB,UAAiB,MAAmB;QAChC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,OAAO,IAAI,CAAC;IAChB,CAAC;IACM,gCAAU,GAAjB,UAAkB,MAAmB;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,OAAO,IAAI,CAAC;IAChB,CAAC;IACM,6CAAuB,GAA9B;QACI,O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,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IAC5C,CAAC;IAEM,4BAAM,GAAb;QACI,OAAO;YACH,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE;YACxB,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE;YAC1B,sBAAsB,EAAE,IAAI,CAAC,uBAAuB,EAAE;YACtD,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE;YAC1B,YAAY,EAAE,IAAI,CAAC,aAAa,EAAE;SACrC,CAAC;IACN,CAAC;IACL,kBAAC;AAAD,CAAC,AAnFD,IAmFC"}
|
|
@@ -19,6 +19,7 @@ import IModel from '../../core/interface/IModel';
|
|
|
19
19
|
export default class AccessToken implements IModel {
|
|
20
20
|
private token: string|null = null;
|
|
21
21
|
private userId: string|null = null;
|
|
22
|
+
private federationFromUserId: string|null = null;
|
|
22
23
|
private expire: number|null = null;
|
|
23
24
|
private timeOffset: number|null = null;
|
|
24
25
|
public getToken(): string|null {
|
|
@@ -43,6 +44,17 @@ export default class AccessToken implements IModel {
|
|
|
43
44
|
this.userId = userId;
|
|
44
45
|
return this;
|
|
45
46
|
}
|
|
47
|
+
public getFederationFromUserId(): string|null {
|
|
48
|
+
return this.federationFromUserId;
|
|
49
|
+
}
|
|
50
|
+
public setFederationFromUserId(federationFromUserId: string|null) {
|
|
51
|
+
this.federationFromUserId = federationFromUserId;
|
|
52
|
+
return this;
|
|
53
|
+
}
|
|
54
|
+
public withFederationFromUserId(federationFromUserId: string|null): this {
|
|
55
|
+
this.federationFromUserId = federationFromUserId;
|
|
56
|
+
return this;
|
|
57
|
+
}
|
|
46
58
|
public getExpire(): number|null {
|
|
47
59
|
return this.expire;
|
|
48
60
|
}
|
|
@@ -73,6 +85,7 @@ export default class AccessToken implements IModel {
|
|
|
73
85
|
return new AccessToken()
|
|
74
86
|
.withToken(data["token"])
|
|
75
87
|
.withUserId(data["userId"])
|
|
88
|
+
.withFederationFromUserId(data["federationFromUserId"])
|
|
76
89
|
.withExpire(data["expire"])
|
|
77
90
|
.withTimeOffset(data["timeOffset"]);
|
|
78
91
|
}
|
|
@@ -81,6 +94,7 @@ export default class AccessToken implements IModel {
|
|
|
81
94
|
return {
|
|
82
95
|
"token": this.getToken(),
|
|
83
96
|
"userId": this.getUserId(),
|
|
97
|
+
"federationFromUserId": this.getFederationFromUserId(),
|
|
84
98
|
"expire": this.getExpire(),
|
|
85
99
|
"timeOffset": this.getTimeOffset(),
|
|
86
100
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import IRequest from '../../core/interface/IRequest';
|
|
2
|
+
export default class FederationRequest implements IRequest {
|
|
3
|
+
private requestId;
|
|
4
|
+
private contextStack;
|
|
5
|
+
private originalUserId;
|
|
6
|
+
private userId;
|
|
7
|
+
private policyDocument;
|
|
8
|
+
private timeOffset;
|
|
9
|
+
private timeOffsetToken;
|
|
10
|
+
getRequestId(): string | null;
|
|
11
|
+
setRequestId(requestId: string | null): this;
|
|
12
|
+
withRequestId(requestId: string | null): this;
|
|
13
|
+
getContextStack(): string | null;
|
|
14
|
+
setContextStack(contextStack: string | null): this;
|
|
15
|
+
withContextStack(contextStack: string | null): this;
|
|
16
|
+
getOriginalUserId(): string | null;
|
|
17
|
+
setOriginalUserId(originalUserId: string | null): this;
|
|
18
|
+
withOriginalUserId(originalUserId: string | null): this;
|
|
19
|
+
getUserId(): string | null;
|
|
20
|
+
setUserId(userId: string | null): this;
|
|
21
|
+
withUserId(userId: string | null): this;
|
|
22
|
+
getPolicyDocument(): string | null;
|
|
23
|
+
setPolicyDocument(policyDocument: string | null): this;
|
|
24
|
+
withPolicyDocument(policyDocument: string | null): this;
|
|
25
|
+
getTimeOffset(): number | null;
|
|
26
|
+
setTimeOffset(timeOffset: number | null): this;
|
|
27
|
+
withTimeOffset(timeOffset: number | null): this;
|
|
28
|
+
getTimeOffsetToken(): string | null;
|
|
29
|
+
setTimeOffsetToken(timeOffsetToken: string | null): this;
|
|
30
|
+
withTimeOffsetToken(timeOffsetToken: string | null): this;
|
|
31
|
+
static fromDict(data: {
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
}): FederationRequest;
|
|
34
|
+
toDict(): {
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
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 FederationRequest = /** @class */ (function () {
|
|
19
|
+
function FederationRequest() {
|
|
20
|
+
this.requestId = null;
|
|
21
|
+
this.contextStack = null;
|
|
22
|
+
this.originalUserId = null;
|
|
23
|
+
this.userId = null;
|
|
24
|
+
this.policyDocument = null;
|
|
25
|
+
this.timeOffset = null;
|
|
26
|
+
this.timeOffsetToken = null;
|
|
27
|
+
}
|
|
28
|
+
FederationRequest.prototype.getRequestId = function () {
|
|
29
|
+
return this.requestId;
|
|
30
|
+
};
|
|
31
|
+
FederationRequest.prototype.setRequestId = function (requestId) {
|
|
32
|
+
this.requestId = requestId;
|
|
33
|
+
return this;
|
|
34
|
+
};
|
|
35
|
+
FederationRequest.prototype.withRequestId = function (requestId) {
|
|
36
|
+
this.requestId = requestId;
|
|
37
|
+
return this;
|
|
38
|
+
};
|
|
39
|
+
FederationRequest.prototype.getContextStack = function () {
|
|
40
|
+
return this.contextStack;
|
|
41
|
+
};
|
|
42
|
+
FederationRequest.prototype.setContextStack = function (contextStack) {
|
|
43
|
+
this.contextStack = contextStack;
|
|
44
|
+
return this;
|
|
45
|
+
};
|
|
46
|
+
FederationRequest.prototype.withContextStack = function (contextStack) {
|
|
47
|
+
this.contextStack = contextStack;
|
|
48
|
+
return this;
|
|
49
|
+
};
|
|
50
|
+
FederationRequest.prototype.getOriginalUserId = function () {
|
|
51
|
+
return this.originalUserId;
|
|
52
|
+
};
|
|
53
|
+
FederationRequest.prototype.setOriginalUserId = function (originalUserId) {
|
|
54
|
+
this.originalUserId = originalUserId;
|
|
55
|
+
return this;
|
|
56
|
+
};
|
|
57
|
+
FederationRequest.prototype.withOriginalUserId = function (originalUserId) {
|
|
58
|
+
this.originalUserId = originalUserId;
|
|
59
|
+
return this;
|
|
60
|
+
};
|
|
61
|
+
FederationRequest.prototype.getUserId = function () {
|
|
62
|
+
return this.userId;
|
|
63
|
+
};
|
|
64
|
+
FederationRequest.prototype.setUserId = function (userId) {
|
|
65
|
+
this.userId = userId;
|
|
66
|
+
return this;
|
|
67
|
+
};
|
|
68
|
+
FederationRequest.prototype.withUserId = function (userId) {
|
|
69
|
+
this.userId = userId;
|
|
70
|
+
return this;
|
|
71
|
+
};
|
|
72
|
+
FederationRequest.prototype.getPolicyDocument = function () {
|
|
73
|
+
return this.policyDocument;
|
|
74
|
+
};
|
|
75
|
+
FederationRequest.prototype.setPolicyDocument = function (policyDocument) {
|
|
76
|
+
this.policyDocument = policyDocument;
|
|
77
|
+
return this;
|
|
78
|
+
};
|
|
79
|
+
FederationRequest.prototype.withPolicyDocument = function (policyDocument) {
|
|
80
|
+
this.policyDocument = policyDocument;
|
|
81
|
+
return this;
|
|
82
|
+
};
|
|
83
|
+
FederationRequest.prototype.getTimeOffset = function () {
|
|
84
|
+
return this.timeOffset;
|
|
85
|
+
};
|
|
86
|
+
FederationRequest.prototype.setTimeOffset = function (timeOffset) {
|
|
87
|
+
this.timeOffset = timeOffset;
|
|
88
|
+
return this;
|
|
89
|
+
};
|
|
90
|
+
FederationRequest.prototype.withTimeOffset = function (timeOffset) {
|
|
91
|
+
this.timeOffset = timeOffset;
|
|
92
|
+
return this;
|
|
93
|
+
};
|
|
94
|
+
FederationRequest.prototype.getTimeOffsetToken = function () {
|
|
95
|
+
return this.timeOffsetToken;
|
|
96
|
+
};
|
|
97
|
+
FederationRequest.prototype.setTimeOffsetToken = function (timeOffsetToken) {
|
|
98
|
+
this.timeOffsetToken = timeOffsetToken;
|
|
99
|
+
return this;
|
|
100
|
+
};
|
|
101
|
+
FederationRequest.prototype.withTimeOffsetToken = function (timeOffsetToken) {
|
|
102
|
+
this.timeOffsetToken = timeOffsetToken;
|
|
103
|
+
return this;
|
|
104
|
+
};
|
|
105
|
+
FederationRequest.fromDict = function (data) {
|
|
106
|
+
return new FederationRequest()
|
|
107
|
+
.withOriginalUserId(data["originalUserId"])
|
|
108
|
+
.withUserId(data["userId"])
|
|
109
|
+
.withPolicyDocument(data["policyDocument"])
|
|
110
|
+
.withTimeOffset(data["timeOffset"])
|
|
111
|
+
.withTimeOffsetToken(data["timeOffsetToken"]);
|
|
112
|
+
};
|
|
113
|
+
FederationRequest.prototype.toDict = function () {
|
|
114
|
+
return {
|
|
115
|
+
"originalUserId": this.getOriginalUserId(),
|
|
116
|
+
"userId": this.getUserId(),
|
|
117
|
+
"policyDocument": this.getPolicyDocument(),
|
|
118
|
+
"timeOffset": this.getTimeOffset(),
|
|
119
|
+
"timeOffsetToken": this.getTimeOffsetToken(),
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
return FederationRequest;
|
|
123
|
+
}());
|
|
124
|
+
exports.default = FederationRequest;
|
|
125
|
+
//# sourceMappingURL=FederationRequest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FederationRequest.js","sourceRoot":"","sources":["FederationRequest.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAc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AAC,QAAQ,CAAC,CAAC;aAC1B,kBAAkB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;aAC1C,cAAc,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;aAClC,mBAAmB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACtD,CAAC;IAEM,kCAAM,GAAb;QACI,OAAO;YACH,gBAAgB,EAAE,IAAI,CAAC,iBAAiB,EAAE;YAC1C,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE;YAC1B,gBAAgB,EAAE,IAAI,CAAC,iBAAiB,EAAE;YAC1C,YAAY,EAAE,IAAI,CAAC,aAAa,EAAE;YAClC,iBAAiB,EAAE,IAAI,CAAC,kBAAkB,EAAE;SAC/C,CAAC;IACN,CAAC;IACL,wBAAC;AAAD,CAAC,AA/GD,IA+GC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
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 Gs2Auth from '../model'
|
|
20
|
+
|
|
21
|
+
export default class FederationRequest implements IRequest {
|
|
22
|
+
|
|
23
|
+
private requestId: string|null = null;
|
|
24
|
+
private contextStack: string|null = null;
|
|
25
|
+
private originalUserId: string|null = null;
|
|
26
|
+
private userId: string|null = null;
|
|
27
|
+
private policyDocument: string|null = null;
|
|
28
|
+
private timeOffset: number|null = null;
|
|
29
|
+
private timeOffsetToken: string|null = null;
|
|
30
|
+
|
|
31
|
+
public getRequestId(): string|null {
|
|
32
|
+
return this.requestId;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
public setRequestId(requestId: string|null) {
|
|
36
|
+
this.requestId = requestId;
|
|
37
|
+
return this;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
public withRequestId(requestId: string|null): this {
|
|
41
|
+
this.requestId = requestId;
|
|
42
|
+
return this;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public getContextStack(): string|null {
|
|
46
|
+
return this.contextStack;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public setContextStack(contextStack: string|null) {
|
|
50
|
+
this.contextStack = contextStack;
|
|
51
|
+
return this;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public withContextStack(contextStack: string|null): this {
|
|
55
|
+
this.contextStack = contextStack;
|
|
56
|
+
return this;
|
|
57
|
+
}
|
|
58
|
+
public getOriginalUserId(): string|null {
|
|
59
|
+
return this.originalUserId;
|
|
60
|
+
}
|
|
61
|
+
public setOriginalUserId(originalUserId: string|null) {
|
|
62
|
+
this.originalUserId = originalUserId;
|
|
63
|
+
return this;
|
|
64
|
+
}
|
|
65
|
+
public withOriginalUserId(originalUserId: string|null): this {
|
|
66
|
+
this.originalUserId = originalUserId;
|
|
67
|
+
return this;
|
|
68
|
+
}
|
|
69
|
+
public getUserId(): string|null {
|
|
70
|
+
return this.userId;
|
|
71
|
+
}
|
|
72
|
+
public setUserId(userId: string|null) {
|
|
73
|
+
this.userId = userId;
|
|
74
|
+
return this;
|
|
75
|
+
}
|
|
76
|
+
public withUserId(userId: string|null): this {
|
|
77
|
+
this.userId = userId;
|
|
78
|
+
return this;
|
|
79
|
+
}
|
|
80
|
+
public getPolicyDocument(): string|null {
|
|
81
|
+
return this.policyDocument;
|
|
82
|
+
}
|
|
83
|
+
public setPolicyDocument(policyDocument: string|null) {
|
|
84
|
+
this.policyDocument = policyDocument;
|
|
85
|
+
return this;
|
|
86
|
+
}
|
|
87
|
+
public withPolicyDocument(policyDocument: string|null): this {
|
|
88
|
+
this.policyDocument = policyDocument;
|
|
89
|
+
return this;
|
|
90
|
+
}
|
|
91
|
+
public getTimeOffset(): number|null {
|
|
92
|
+
return this.timeOffset;
|
|
93
|
+
}
|
|
94
|
+
public setTimeOffset(timeOffset: number|null) {
|
|
95
|
+
this.timeOffset = timeOffset;
|
|
96
|
+
return this;
|
|
97
|
+
}
|
|
98
|
+
public withTimeOffset(timeOffset: number|null): this {
|
|
99
|
+
this.timeOffset = timeOffset;
|
|
100
|
+
return this;
|
|
101
|
+
}
|
|
102
|
+
public getTimeOffsetToken(): string|null {
|
|
103
|
+
return this.timeOffsetToken;
|
|
104
|
+
}
|
|
105
|
+
public setTimeOffsetToken(timeOffsetToken: string|null) {
|
|
106
|
+
this.timeOffsetToken = timeOffsetToken;
|
|
107
|
+
return this;
|
|
108
|
+
}
|
|
109
|
+
public withTimeOffsetToken(timeOffsetToken: string|null): this {
|
|
110
|
+
this.timeOffsetToken = timeOffsetToken;
|
|
111
|
+
return this;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
public static fromDict(data: {[key: string]: any}): FederationRequest {
|
|
115
|
+
return new FederationRequest()
|
|
116
|
+
.withOriginalUserId(data["originalUserId"])
|
|
117
|
+
.withUserId(data["userId"])
|
|
118
|
+
.withPolicyDocument(data["policyDocument"])
|
|
119
|
+
.withTimeOffset(data["timeOffset"])
|
|
120
|
+
.withTimeOffsetToken(data["timeOffsetToken"]);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
public toDict(): {[key: string]: any} {
|
|
124
|
+
return {
|
|
125
|
+
"originalUserId": this.getOriginalUserId(),
|
|
126
|
+
"userId": this.getUserId(),
|
|
127
|
+
"policyDocument": this.getPolicyDocument(),
|
|
128
|
+
"timeOffset": this.getTimeOffset(),
|
|
129
|
+
"timeOffsetToken": this.getTimeOffsetToken(),
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
}
|
package/auth/request/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import LoginRequest from "./LoginRequest";
|
|
2
2
|
import LoginBySignatureRequest from "./LoginBySignatureRequest";
|
|
3
|
+
import FederationRequest from "./FederationRequest";
|
|
3
4
|
import IssueTimeOffsetTokenByUserIdRequest from "./IssueTimeOffsetTokenByUserIdRequest";
|
|
4
|
-
export { LoginRequest, LoginBySignatureRequest, IssueTimeOffsetTokenByUserIdRequest, };
|
|
5
|
+
export { LoginRequest, LoginBySignatureRequest, FederationRequest, IssueTimeOffsetTokenByUserIdRequest, };
|
package/auth/request/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IssueTimeOffsetTokenByUserIdRequest = exports.LoginBySignatureRequest = exports.LoginRequest = void 0;
|
|
3
|
+
exports.IssueTimeOffsetTokenByUserIdRequest = exports.FederationRequest = exports.LoginBySignatureRequest = exports.LoginRequest = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
/*
|
|
6
6
|
Copyright 2016 Game Server Services, Inc. or its affiliates. All Rights
|
|
@@ -21,6 +21,8 @@ var LoginRequest_1 = tslib_1.__importDefault(require("./LoginRequest"));
|
|
|
21
21
|
exports.LoginRequest = LoginRequest_1.default;
|
|
22
22
|
var LoginBySignatureRequest_1 = tslib_1.__importDefault(require("./LoginBySignatureRequest"));
|
|
23
23
|
exports.LoginBySignatureRequest = LoginBySignatureRequest_1.default;
|
|
24
|
+
var FederationRequest_1 = tslib_1.__importDefault(require("./FederationRequest"));
|
|
25
|
+
exports.FederationRequest = FederationRequest_1.default;
|
|
24
26
|
var IssueTimeOffsetTokenByUserIdRequest_1 = tslib_1.__importDefault(require("./IssueTimeOffsetTokenByUserIdRequest"));
|
|
25
27
|
exports.IssueTimeOffsetTokenByUserIdRequest = IssueTimeOffsetTokenByUserIdRequest_1.default;
|
|
26
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;GAcG;AACH,wEAAyC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;GAcG;AACH,wEAAyC;AAMrC,uBANG,sBAAY,CAMH;AALhB,8FAA+D;AAM3D,kCANG,iCAAuB,CAMH;AAL3B,kFAAmD;AAM/C,4BANG,2BAAiB,CAMH;AALrB,sHAAuF;AAMnF,8CANG,6CAAmC,CAMH"}
|
package/auth/request/index.ts
CHANGED
|
@@ -15,10 +15,12 @@ permissions and limitations under the License.
|
|
|
15
15
|
*/
|
|
16
16
|
import LoginRequest from "./LoginRequest"
|
|
17
17
|
import LoginBySignatureRequest from "./LoginBySignatureRequest"
|
|
18
|
+
import FederationRequest from "./FederationRequest"
|
|
18
19
|
import IssueTimeOffsetTokenByUserIdRequest from "./IssueTimeOffsetTokenByUserIdRequest"
|
|
19
20
|
|
|
20
21
|
export {
|
|
21
22
|
LoginRequest,
|
|
22
23
|
LoginBySignatureRequest,
|
|
24
|
+
FederationRequest,
|
|
23
25
|
IssueTimeOffsetTokenByUserIdRequest,
|
|
24
26
|
};
|
package/auth/rest.d.ts
CHANGED
|
@@ -6,5 +6,6 @@ export default class Gs2AuthRestClient extends AbstractGs2RestClient {
|
|
|
6
6
|
constructor(session: Gs2RestSession);
|
|
7
7
|
login(request: Request.LoginRequest): Promise<Result.LoginResult>;
|
|
8
8
|
loginBySignature(request: Request.LoginBySignatureRequest): Promise<Result.LoginBySignatureResult>;
|
|
9
|
+
federation(request: Request.FederationRequest): Promise<Result.FederationResult>;
|
|
9
10
|
issueTimeOffsetTokenByUserId(request: Request.IssueTimeOffsetTokenByUserIdRequest): Promise<Result.IssueTimeOffsetTokenByUserIdResult>;
|
|
10
11
|
}
|
package/auth/rest.js
CHANGED
|
@@ -83,6 +83,38 @@ var Gs2AuthRestClient = /** @class */ (function (_super) {
|
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
};
|
|
86
|
+
Gs2AuthRestClient.prototype.federation = function (request) {
|
|
87
|
+
var _a, _b, _c, _d, _e, _f;
|
|
88
|
+
var url = (model_1.Gs2Constant.ENDPOINT_HOST + '/federation')
|
|
89
|
+
.replace('{service}', 'auth')
|
|
90
|
+
.replace('{region}', this.session.region);
|
|
91
|
+
var headers = this.createAuthorizedHeaders();
|
|
92
|
+
if (request.getRequestId()) {
|
|
93
|
+
headers['X-GS2-REQUEST-ID'] = request.getRequestId();
|
|
94
|
+
}
|
|
95
|
+
if (request.getTimeOffsetToken()) {
|
|
96
|
+
headers['X-GS2-TIME-OFFSET-TOKEN'] = (_a = request.getTimeOffsetToken()) !== null && _a !== void 0 ? _a : null;
|
|
97
|
+
}
|
|
98
|
+
var body = {
|
|
99
|
+
'contextStack': (_b = request.getContextStack()) !== null && _b !== void 0 ? _b : null,
|
|
100
|
+
'originalUserId': (_c = request.getOriginalUserId()) !== null && _c !== void 0 ? _c : null,
|
|
101
|
+
'userId': (_d = request.getUserId()) !== null && _d !== void 0 ? _d : null,
|
|
102
|
+
'policyDocument': (_e = request.getPolicyDocument()) !== null && _e !== void 0 ? _e : null,
|
|
103
|
+
'timeOffset': (_f = request.getTimeOffset()) !== null && _f !== void 0 ? _f : null,
|
|
104
|
+
};
|
|
105
|
+
return axios_1.default.post(url, body, {
|
|
106
|
+
headers: headers,
|
|
107
|
+
}).then(function (response) {
|
|
108
|
+
return Result.FederationResult.fromDict(response.data);
|
|
109
|
+
}).catch(function (error) {
|
|
110
|
+
if (error.response) {
|
|
111
|
+
throw JSON.parse(error.response.data.message);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
throw [];
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
};
|
|
86
118
|
Gs2AuthRestClient.prototype.issueTimeOffsetTokenByUserId = function (request) {
|
|
87
119
|
var _a, _b, _c, _d;
|
|
88
120
|
var url = (model_1.Gs2Constant.ENDPOINT_HOST + '/timeoffset/token')
|
package/auth/rest.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rest.js","sourceRoot":"","sources":["rest.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,gGAAkE;AAClE,uCAA4D;AAE5D,uDAAmC;AAEnC,wDAA0B;AAE1B;IAA+C,6CAAqB;IAEhE,2BAAY,OAAuB;eAC/B,kBAAM,OAAO,CAAC;IAClB,CAAC;IAEM,iCAAK,GAAZ,UAAa,OAA6B;;QACtC,IAAM,GAAG,GAAG,CAAC,mBAAW,CAAC,aAAa,GAAG,QAAQ,CAAC;aAC7C,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC;aAC5B,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAE9C,IAAM,OAAO,GAAG,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAC/C,IAAI,OAAO,CAAC,YAAY,EAAE,EAAE;YACxB,OAAO,CAAC,kBAAkB,CAAC,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;SACxD;QACD,IAAI,OAAO,CAAC,kBAAkB,EAAE,EAAE;YAC9B,OAAO,CAAC,yBAAyB,CAAC,GAAG,MAAA,OAAO,CAAC,kBAAkB,EAAE,mCAAI,IAAI,CAAC;SAC7E;QACD,IAAM,IAAI,GAAyB;YAC/B,cAAc,EAAE,MAAA,OAAO,CAAC,eAAe,EAAE,mCAAI,IAAI;YACjD,QAAQ,EAAE,MAAA,OAAO,CAAC,SAAS,EAAE,mCAAI,IAAI;YACrC,YAAY,EAAE,MAAA,OAAO,CAAC,aAAa,EAAE,mCAAI,IA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,IAAI;YACjD,QAAQ,EAAE,MAAA,OAAO,CAAC,SAAS,EAAE,mCAAI,IAAI;YACrC,YAAY,EAAE,MAAA,OAAO,CAAC,aAAa,EAAE,mCAAI,IAAI;SAChD,CAAC;QACF,OAAO,eAAK,CAAC,IAAI,CACb,GAAG,EACH,IAAI,EACJ;YACI,OAAO,SAAA;SACV,CACJ,CAAC,IAAI,CAAC,UAAC,QAAa;YACjB,OAAO,MAAM,CAAC,kCAAkC,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC7E,CAAC,CAAC,CAAC,KAAK,CAAC,UAAC,KAAU;YAChB,IAAI,KAAK,CAAC,QAAQ,EAAE;gBAChB,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aACjD;iBAAM;gBACH,MAAM,EAAE,CAAC;aACZ;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IACL,wBAAC;AAAD,CAAC,AA7ID,CAA+C,+BAAqB,GA6InE"}
|
package/auth/rest.ts
CHANGED
|
@@ -93,6 +93,42 @@ export default class Gs2AuthRestClient extends AbstractGs2RestClient {
|
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
public federation(request: Request.FederationRequest): Promise<Result.FederationResult> {
|
|
97
|
+
const url = (Gs2Constant.ENDPOINT_HOST + '/federation')
|
|
98
|
+
.replace('{service}', 'auth')
|
|
99
|
+
.replace('{region}', this.session.region);
|
|
100
|
+
|
|
101
|
+
const headers = this.createAuthorizedHeaders();
|
|
102
|
+
if (request.getRequestId()) {
|
|
103
|
+
headers['X-GS2-REQUEST-ID'] = request.getRequestId();
|
|
104
|
+
}
|
|
105
|
+
if (request.getTimeOffsetToken()) {
|
|
106
|
+
headers['X-GS2-TIME-OFFSET-TOKEN'] = request.getTimeOffsetToken() ?? null;
|
|
107
|
+
}
|
|
108
|
+
const body: {[key: string]: any} = {
|
|
109
|
+
'contextStack': request.getContextStack() ?? null,
|
|
110
|
+
'originalUserId': request.getOriginalUserId() ?? null,
|
|
111
|
+
'userId': request.getUserId() ?? null,
|
|
112
|
+
'policyDocument': request.getPolicyDocument() ?? null,
|
|
113
|
+
'timeOffset': request.getTimeOffset() ?? null,
|
|
114
|
+
};
|
|
115
|
+
return axios.post(
|
|
116
|
+
url,
|
|
117
|
+
body,
|
|
118
|
+
{
|
|
119
|
+
headers,
|
|
120
|
+
},
|
|
121
|
+
).then((response: any) => {
|
|
122
|
+
return Result.FederationResult.fromDict(response.data);
|
|
123
|
+
}).catch((error: any) => {
|
|
124
|
+
if (error.response) {
|
|
125
|
+
throw JSON.parse(error.response.data.message);
|
|
126
|
+
} else {
|
|
127
|
+
throw [];
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
|
|
96
132
|
public issueTimeOffsetTokenByUserId(request: Request.IssueTimeOffsetTokenByUserIdRequest): Promise<Result.IssueTimeOffsetTokenByUserIdResult> {
|
|
97
133
|
const url = (Gs2Constant.ENDPOINT_HOST + '/timeoffset/token')
|
|
98
134
|
.replace('{service}', 'auth')
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import IResult from '../../core/interface/IResult';
|
|
2
|
+
export default class FederationResult implements IResult {
|
|
3
|
+
private token;
|
|
4
|
+
private userId;
|
|
5
|
+
private expire;
|
|
6
|
+
getToken(): string | null;
|
|
7
|
+
setToken(token: string | null): this;
|
|
8
|
+
withToken(token: string | null): this;
|
|
9
|
+
getUserId(): string | null;
|
|
10
|
+
setUserId(userId: string | null): this;
|
|
11
|
+
withUserId(userId: string | null): this;
|
|
12
|
+
getExpire(): number | null;
|
|
13
|
+
setExpire(expire: number | null): this;
|
|
14
|
+
withExpire(expire: number | null): this;
|
|
15
|
+
static fromDict(data: {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}): FederationResult;
|
|
18
|
+
toDict(): {
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
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 FederationResult = /** @class */ (function () {
|
|
19
|
+
function FederationResult() {
|
|
20
|
+
this.token = null;
|
|
21
|
+
this.userId = null;
|
|
22
|
+
this.expire = null;
|
|
23
|
+
}
|
|
24
|
+
FederationResult.prototype.getToken = function () {
|
|
25
|
+
return this.token;
|
|
26
|
+
};
|
|
27
|
+
FederationResult.prototype.setToken = function (token) {
|
|
28
|
+
this.token = token;
|
|
29
|
+
return this;
|
|
30
|
+
};
|
|
31
|
+
FederationResult.prototype.withToken = function (token) {
|
|
32
|
+
this.token = token;
|
|
33
|
+
return this;
|
|
34
|
+
};
|
|
35
|
+
FederationResult.prototype.getUserId = function () {
|
|
36
|
+
return this.userId;
|
|
37
|
+
};
|
|
38
|
+
FederationResult.prototype.setUserId = function (userId) {
|
|
39
|
+
this.userId = userId;
|
|
40
|
+
return this;
|
|
41
|
+
};
|
|
42
|
+
FederationResult.prototype.withUserId = function (userId) {
|
|
43
|
+
this.userId = userId;
|
|
44
|
+
return this;
|
|
45
|
+
};
|
|
46
|
+
FederationResult.prototype.getExpire = function () {
|
|
47
|
+
return this.expire;
|
|
48
|
+
};
|
|
49
|
+
FederationResult.prototype.setExpire = function (expire) {
|
|
50
|
+
this.expire = expire;
|
|
51
|
+
return this;
|
|
52
|
+
};
|
|
53
|
+
FederationResult.prototype.withExpire = function (expire) {
|
|
54
|
+
this.expire = expire;
|
|
55
|
+
return this;
|
|
56
|
+
};
|
|
57
|
+
FederationResult.fromDict = function (data) {
|
|
58
|
+
return new FederationResult()
|
|
59
|
+
.withToken(data["token"])
|
|
60
|
+
.withUserId(data["userId"])
|
|
61
|
+
.withExpire(data["expire"]);
|
|
62
|
+
};
|
|
63
|
+
FederationResult.prototype.toDict = function () {
|
|
64
|
+
return {
|
|
65
|
+
"token": this.getToken(),
|
|
66
|
+
"userId": this.getUserId(),
|
|
67
|
+
"expire": this.getExpire(),
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
return FederationResult;
|
|
71
|
+
}());
|
|
72
|
+
exports.default = FederationResult;
|
|
73
|
+
//# sourceMappingURL=FederationResult.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FederationResult.js","sourceRoot":"","sources":["FederationResult.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAIH;IAAA;QACY,UAAK,GAAgB,IAAI,CAAC;QAC1B,WAAM,GAAgB,IAAI,CAAC;QAC3B,WAAM,GAAgB,IAAI,CAAC;IA0DvC,CAAC;IAxDU,mCAAQ,GAAf;QACI,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAEM,mCAAQ,GAAf,UAAgB,KAAkB;QAC9B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,oCAAS,GAAhB,UAAiB,KAAkB;QAC/B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,oCAAS,GAAhB;QACI,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAEM,oCAAS,GAAhB,UAAiB,MAAmB;QAChC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,qCAAU,GAAjB,UAAkB,MAAmB;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,oCAAS,GAAhB;QACI,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAEM,oCAAS,GAAhB,UAAiB,MAAmB;QAChC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,qCAAU,GAAjB,UAAkB,MAAmB;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,OAAO,IAAI,CAAC;IAChB,CAAC;IAEa,yBAAQ,GAAtB,UAAuB,IAA0B;QAC7C,OAAO,IAAI,gBAAgB,EAAE;aACxB,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aACxB,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aAC1B,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IACpC,CAAC;IAEM,iCAAM,GAAb;QACI,OAAO;YACH,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE;YACxB,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE;YAC1B,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE;SAC7B,CAAC;IACN,CAAC;IACL,uBAAC;AAAD,CAAC,AA7DD,IA6DC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
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
|
+
export default class FederationResult implements IResult {
|
|
20
|
+
private token: string|null = null;
|
|
21
|
+
private userId: string|null = null;
|
|
22
|
+
private expire: number|null = null;
|
|
23
|
+
|
|
24
|
+
public getToken(): string|null {
|
|
25
|
+
return this.token;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public setToken(token: string|null) {
|
|
29
|
+
this.token = token;
|
|
30
|
+
return this;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public withToken(token: string|null): this {
|
|
34
|
+
this.token = token;
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public getUserId(): string|null {
|
|
39
|
+
return this.userId;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
public setUserId(userId: string|null) {
|
|
43
|
+
this.userId = userId;
|
|
44
|
+
return this;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public withUserId(userId: string|null): this {
|
|
48
|
+
this.userId = userId;
|
|
49
|
+
return this;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
public getExpire(): number|null {
|
|
53
|
+
return this.expire;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
public setExpire(expire: number|null) {
|
|
57
|
+
this.expire = expire;
|
|
58
|
+
return this;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public withExpire(expire: number|null): this {
|
|
62
|
+
this.expire = expire;
|
|
63
|
+
return this;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
public static fromDict(data: {[key: string]: any}): FederationResult {
|
|
67
|
+
return new FederationResult()
|
|
68
|
+
.withToken(data["token"])
|
|
69
|
+
.withUserId(data["userId"])
|
|
70
|
+
.withExpire(data["expire"]);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
public toDict(): {[key: string]: any} {
|
|
74
|
+
return {
|
|
75
|
+
"token": this.getToken(),
|
|
76
|
+
"userId": this.getUserId(),
|
|
77
|
+
"expire": this.getExpire(),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
package/auth/result/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import LoginResult from "./LoginResult";
|
|
2
2
|
import LoginBySignatureResult from "./LoginBySignatureResult";
|
|
3
|
+
import FederationResult from "./FederationResult";
|
|
3
4
|
import IssueTimeOffsetTokenByUserIdResult from "./IssueTimeOffsetTokenByUserIdResult";
|
|
4
|
-
export { LoginResult, LoginBySignatureResult, IssueTimeOffsetTokenByUserIdResult, };
|
|
5
|
+
export { LoginResult, LoginBySignatureResult, FederationResult, IssueTimeOffsetTokenByUserIdResult, };
|
package/auth/result/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IssueTimeOffsetTokenByUserIdResult = exports.LoginBySignatureResult = exports.LoginResult = void 0;
|
|
3
|
+
exports.IssueTimeOffsetTokenByUserIdResult = exports.FederationResult = exports.LoginBySignatureResult = exports.LoginResult = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
/*
|
|
6
6
|
Copyright 2016 Game Server Services, Inc. or its affiliates. All Rights
|
|
@@ -21,6 +21,8 @@ var LoginResult_1 = tslib_1.__importDefault(require("./LoginResult"));
|
|
|
21
21
|
exports.LoginResult = LoginResult_1.default;
|
|
22
22
|
var LoginBySignatureResult_1 = tslib_1.__importDefault(require("./LoginBySignatureResult"));
|
|
23
23
|
exports.LoginBySignatureResult = LoginBySignatureResult_1.default;
|
|
24
|
+
var FederationResult_1 = tslib_1.__importDefault(require("./FederationResult"));
|
|
25
|
+
exports.FederationResult = FederationResult_1.default;
|
|
24
26
|
var IssueTimeOffsetTokenByUserIdResult_1 = tslib_1.__importDefault(require("./IssueTimeOffsetTokenByUserIdResult"));
|
|
25
27
|
exports.IssueTimeOffsetTokenByUserIdResult = IssueTimeOffsetTokenByUserIdResult_1.default;
|
|
26
28
|
//# sourceMappingURL=index.js.map
|
package/auth/result/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;GAcG;AACH,sEAAuC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;GAcG;AACH,sEAAuC;AAMnC,sBANG,qBAAW,CAMH;AALf,4FAA6D;AAMzD,iCANG,gCAAsB,CAMH;AAL1B,gFAAiD;AAM7C,2BANG,0BAAgB,CAMH;AALpB,oHAAqF;AAMjF,6CANG,4CAAkC,CAMH"}
|
package/auth/result/index.ts
CHANGED
|
@@ -15,10 +15,12 @@ permissions and limitations under the License.
|
|
|
15
15
|
*/
|
|
16
16
|
import LoginResult from "./LoginResult"
|
|
17
17
|
import LoginBySignatureResult from "./LoginBySignatureResult"
|
|
18
|
+
import FederationResult from "./FederationResult"
|
|
18
19
|
import IssueTimeOffsetTokenByUserIdResult from "./IssueTimeOffsetTokenByUserIdResult"
|
|
19
20
|
|
|
20
21
|
export {
|
|
21
22
|
LoginResult,
|
|
22
23
|
LoginBySignatureResult,
|
|
24
|
+
FederationResult,
|
|
23
25
|
IssueTimeOffsetTokenByUserIdResult,
|
|
24
26
|
};
|
|
@@ -9,9 +9,9 @@ export default class ReferenceOf implements IModel {
|
|
|
9
9
|
static getInventoryName(grn: string): string | null;
|
|
10
10
|
static getItemName(grn: string): string | null;
|
|
11
11
|
static getItemSetName(grn: string): string | null;
|
|
12
|
-
static
|
|
12
|
+
static getReferenceOf(grn: string): string | null;
|
|
13
13
|
static isValid(grn: string): boolean;
|
|
14
|
-
static createGrn(region: string | null, ownerId: string | null, namespaceName: string | null, userId: string | null, inventoryName: string | null, itemName: string | null, itemSetName: string | null,
|
|
14
|
+
static createGrn(region: string | null, ownerId: string | null, namespaceName: string | null, userId: string | null, inventoryName: string | null, itemName: string | null, itemSetName: string | null, referenceOf: string | null): string | null;
|
|
15
15
|
getReferenceOfId(): string | null;
|
|
16
16
|
setReferenceOfId(referenceOfId: string | null): this;
|
|
17
17
|
withReferenceOfId(referenceOfId: string | null): this;
|
|
@@ -15,7 +15,7 @@ express or implied. See the License for the specific language governing
|
|
|
15
15
|
permissions and limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
var grnFormat = "grn:gs2:{region}:{ownerId}:inventory:{namespaceName}:user:{userId}:inventory:{inventoryName}:item:{itemName}:itemSet:{itemSetName}:referenceOf:{
|
|
18
|
+
var grnFormat = "grn:gs2:{region}:{ownerId}:inventory:{namespaceName}:user:{userId}:inventory:{inventoryName}:item:{itemName}:itemSet:{itemSetName}:referenceOf:{referenceOf}";
|
|
19
19
|
var ReferenceOf = /** @class */ (function () {
|
|
20
20
|
function ReferenceOf() {
|
|
21
21
|
this.referenceOfId = null;
|
|
@@ -30,7 +30,7 @@ var ReferenceOf = /** @class */ (function () {
|
|
|
30
30
|
.replace('{inventoryName}', '.*')
|
|
31
31
|
.replace('{itemName}', '.*')
|
|
32
32
|
.replace('{itemSetName}', '.*')
|
|
33
|
-
.replace('{
|
|
33
|
+
.replace('{referenceOf}', '.*'));
|
|
34
34
|
if (match) {
|
|
35
35
|
return match[1];
|
|
36
36
|
}
|
|
@@ -45,7 +45,7 @@ var ReferenceOf = /** @class */ (function () {
|
|
|
45
45
|
.replace('{inventoryName}', '.*')
|
|
46
46
|
.replace('{itemName}', '.*')
|
|
47
47
|
.replace('{itemSetName}', '.*')
|
|
48
|
-
.replace('{
|
|
48
|
+
.replace('{referenceOf}', '.*'));
|
|
49
49
|
if (match) {
|
|
50
50
|
return match[1];
|
|
51
51
|
}
|
|
@@ -60,7 +60,7 @@ var ReferenceOf = /** @class */ (function () {
|
|
|
60
60
|
.replace('{inventoryName}', '.*')
|
|
61
61
|
.replace('{itemName}', '.*')
|
|
62
62
|
.replace('{itemSetName}', '.*')
|
|
63
|
-
.replace('{
|
|
63
|
+
.replace('{referenceOf}', '.*'));
|
|
64
64
|
if (match) {
|
|
65
65
|
return match[1];
|
|
66
66
|
}
|
|
@@ -75,7 +75,7 @@ var ReferenceOf = /** @class */ (function () {
|
|
|
75
75
|
.replace('{inventoryName}', '.*')
|
|
76
76
|
.replace('{itemName}', '.*')
|
|
77
77
|
.replace('{itemSetName}', '.*')
|
|
78
|
-
.replace('{
|
|
78
|
+
.replace('{referenceOf}', '.*'));
|
|
79
79
|
if (match) {
|
|
80
80
|
return match[1];
|
|
81
81
|
}
|
|
@@ -90,7 +90,7 @@ var ReferenceOf = /** @class */ (function () {
|
|
|
90
90
|
.replace('{inventoryName}', '(.*)')
|
|
91
91
|
.replace('{itemName}', '.*')
|
|
92
92
|
.replace('{itemSetName}', '.*')
|
|
93
|
-
.replace('{
|
|
93
|
+
.replace('{referenceOf}', '.*'));
|
|
94
94
|
if (match) {
|
|
95
95
|
return match[1];
|
|
96
96
|
}
|
|
@@ -105,7 +105,7 @@ var ReferenceOf = /** @class */ (function () {
|
|
|
105
105
|
.replace('{inventoryName}', '.*')
|
|
106
106
|
.replace('{itemName}', '(.*)')
|
|
107
107
|
.replace('{itemSetName}', '.*')
|
|
108
|
-
.replace('{
|
|
108
|
+
.replace('{referenceOf}', '.*'));
|
|
109
109
|
if (match) {
|
|
110
110
|
return match[1];
|
|
111
111
|
}
|
|
@@ -120,13 +120,13 @@ var ReferenceOf = /** @class */ (function () {
|
|
|
120
120
|
.replace('{inventoryName}', '.*')
|
|
121
121
|
.replace('{itemName}', '.*')
|
|
122
122
|
.replace('{itemSetName}', '(.*)')
|
|
123
|
-
.replace('{
|
|
123
|
+
.replace('{referenceOf}', '.*'));
|
|
124
124
|
if (match) {
|
|
125
125
|
return match[1];
|
|
126
126
|
}
|
|
127
127
|
return null;
|
|
128
128
|
};
|
|
129
|
-
ReferenceOf.
|
|
129
|
+
ReferenceOf.getReferenceOf = function (grn) {
|
|
130
130
|
var match = grn.match(grnFormat
|
|
131
131
|
.replace('{region}', '.*')
|
|
132
132
|
.replace('{ownerId}', '.*')
|
|
@@ -135,7 +135,7 @@ var ReferenceOf = /** @class */ (function () {
|
|
|
135
135
|
.replace('{inventoryName}', '.*')
|
|
136
136
|
.replace('{itemName}', '.*')
|
|
137
137
|
.replace('{itemSetName}', '.*')
|
|
138
|
-
.replace('{
|
|
138
|
+
.replace('{referenceOf}', '(.*)'));
|
|
139
139
|
if (match) {
|
|
140
140
|
return match[1];
|
|
141
141
|
}
|
|
@@ -163,12 +163,12 @@ var ReferenceOf = /** @class */ (function () {
|
|
|
163
163
|
if (this.getItemSetName(grn) == null || this.getItemSetName(grn) === '') {
|
|
164
164
|
return false;
|
|
165
165
|
}
|
|
166
|
-
if (this.
|
|
166
|
+
if (this.getReferenceOf(grn) == null || this.getReferenceOf(grn) === '') {
|
|
167
167
|
return false;
|
|
168
168
|
}
|
|
169
169
|
return true;
|
|
170
170
|
};
|
|
171
|
-
ReferenceOf.createGrn = function (region, ownerId, namespaceName, userId, inventoryName, itemName, itemSetName,
|
|
171
|
+
ReferenceOf.createGrn = function (region, ownerId, namespaceName, userId, inventoryName, itemName, itemSetName, referenceOf) {
|
|
172
172
|
return grnFormat
|
|
173
173
|
.replace('{region}', region !== null && region !== void 0 ? region : '')
|
|
174
174
|
.replace('{ownerId}', ownerId !== null && ownerId !== void 0 ? ownerId : '')
|
|
@@ -177,7 +177,7 @@ var ReferenceOf = /** @class */ (function () {
|
|
|
177
177
|
.replace('{inventoryName}', inventoryName !== null && inventoryName !== void 0 ? inventoryName : '')
|
|
178
178
|
.replace('{itemName}', itemName !== null && itemName !== void 0 ? itemName : '')
|
|
179
179
|
.replace('{itemSetName}', itemSetName !== null && itemSetName !== void 0 ? itemSetName : '')
|
|
180
|
-
.replace('{
|
|
180
|
+
.replace('{referenceOf}', referenceOf !== null && referenceOf !== void 0 ? referenceOf : '');
|
|
181
181
|
};
|
|
182
182
|
ReferenceOf.prototype.getReferenceOfId = function () {
|
|
183
183
|
return this.referenceOfId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReferenceOf.js","sourceRoot":"","sources":["ReferenceOf.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAGH,IAAM,SAAS,GAAW,
|
|
1
|
+
{"version":3,"file":"ReferenceOf.js","sourceRoot":"","sources":["ReferenceOf.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAGH,IAAM,SAAS,GAAW,8JAA8J,CAAC;AAEzL;IAAA;QACY,kBAAa,GAAgB,IAAI,CAAC;QAClC,SAAI,GAAgB,IAAI,CAAC;IAgOrC,CAAC;IA9NiB,qBAAS,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,UAAU,EAAE,IAAI,CAAC;aACzB,OAAO,CAAC,iBAAiB,EAAE,IAAI,CAAC;aAChC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC;aAC3B,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC;aAC9B,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC,CAClC,CAAC;QACF,IAAI,KAAK,EAAE;YACP,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;SACnB;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAEa,sBAAU,G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,aAAa,GAAG,aAAa,CAAC;QACnC,OAAO,IAAI,CAAC;IAChB,CAAC;IACM,6BAAO,GAAd;QACI,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IACM,6BAAO,GAAd,UAAe,IAAiB;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,OAAO,IAAI,CAAC;IAChB,CAAC;IACM,8BAAQ,GAAf,UAAgB,IAAiB;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,OAAO,IAAI,CAAC;IAChB,CAAC;IAEa,oBAAQ,GAAtB,UAAuB,IAA0B;QAC7C,IAAI,IAAI,IAAI,SAAS,IAAI,IAAI,IAAI,IAAI,EAAE;YACnC,OAAO,IAAI,CAAC;SACf;QACD,OAAO,IAAI,WAAW,EAAE;aACnB,iBAAiB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;aACxC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAChC,CAAC;IAEM,4BAAM,GAAb;QACI,OAAO;YACH,eAAe,EAAE,IAAI,CAAC,gBAAgB,EAAE;YACxC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE;SACzB,CAAC;IACN,CAAC;IACL,kBAAC;AAAD,CAAC,AAlOD,IAkOC"}
|
|
@@ -15,7 +15,7 @@ permissions and limitations under the License.
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import IModel from '../../core/interface/IModel';
|
|
18
|
-
const grnFormat: string = "grn:gs2:{region}:{ownerId}:inventory:{namespaceName}:user:{userId}:inventory:{inventoryName}:item:{itemName}:itemSet:{itemSetName}:referenceOf:{
|
|
18
|
+
const grnFormat: string = "grn:gs2:{region}:{ownerId}:inventory:{namespaceName}:user:{userId}:inventory:{inventoryName}:item:{itemName}:itemSet:{itemSetName}:referenceOf:{referenceOf}";
|
|
19
19
|
|
|
20
20
|
export default class ReferenceOf implements IModel {
|
|
21
21
|
private referenceOfId: string|null = null;
|
|
@@ -30,7 +30,7 @@ export default class ReferenceOf implements IModel {
|
|
|
30
30
|
.replace('{inventoryName}', '.*')
|
|
31
31
|
.replace('{itemName}', '.*')
|
|
32
32
|
.replace('{itemSetName}', '.*')
|
|
33
|
-
.replace('{
|
|
33
|
+
.replace('{referenceOf}', '.*')
|
|
34
34
|
);
|
|
35
35
|
if (match) {
|
|
36
36
|
return match[1];
|
|
@@ -47,7 +47,7 @@ export default class ReferenceOf implements IModel {
|
|
|
47
47
|
.replace('{inventoryName}', '.*')
|
|
48
48
|
.replace('{itemName}', '.*')
|
|
49
49
|
.replace('{itemSetName}', '.*')
|
|
50
|
-
.replace('{
|
|
50
|
+
.replace('{referenceOf}', '.*')
|
|
51
51
|
);
|
|
52
52
|
if (match) {
|
|
53
53
|
return match[1];
|
|
@@ -64,7 +64,7 @@ export default class ReferenceOf implements IModel {
|
|
|
64
64
|
.replace('{inventoryName}', '.*')
|
|
65
65
|
.replace('{itemName}', '.*')
|
|
66
66
|
.replace('{itemSetName}', '.*')
|
|
67
|
-
.replace('{
|
|
67
|
+
.replace('{referenceOf}', '.*')
|
|
68
68
|
);
|
|
69
69
|
if (match) {
|
|
70
70
|
return match[1];
|
|
@@ -81,7 +81,7 @@ export default class ReferenceOf implements IModel {
|
|
|
81
81
|
.replace('{inventoryName}', '.*')
|
|
82
82
|
.replace('{itemName}', '.*')
|
|
83
83
|
.replace('{itemSetName}', '.*')
|
|
84
|
-
.replace('{
|
|
84
|
+
.replace('{referenceOf}', '.*')
|
|
85
85
|
);
|
|
86
86
|
if (match) {
|
|
87
87
|
return match[1];
|
|
@@ -98,7 +98,7 @@ export default class ReferenceOf implements IModel {
|
|
|
98
98
|
.replace('{inventoryName}', '(.*)')
|
|
99
99
|
.replace('{itemName}', '.*')
|
|
100
100
|
.replace('{itemSetName}', '.*')
|
|
101
|
-
.replace('{
|
|
101
|
+
.replace('{referenceOf}', '.*')
|
|
102
102
|
);
|
|
103
103
|
if (match) {
|
|
104
104
|
return match[1];
|
|
@@ -115,7 +115,7 @@ export default class ReferenceOf implements IModel {
|
|
|
115
115
|
.replace('{inventoryName}', '.*')
|
|
116
116
|
.replace('{itemName}', '(.*)')
|
|
117
117
|
.replace('{itemSetName}', '.*')
|
|
118
|
-
.replace('{
|
|
118
|
+
.replace('{referenceOf}', '.*')
|
|
119
119
|
);
|
|
120
120
|
if (match) {
|
|
121
121
|
return match[1];
|
|
@@ -132,7 +132,7 @@ export default class ReferenceOf implements IModel {
|
|
|
132
132
|
.replace('{inventoryName}', '.*')
|
|
133
133
|
.replace('{itemName}', '.*')
|
|
134
134
|
.replace('{itemSetName}', '(.*)')
|
|
135
|
-
.replace('{
|
|
135
|
+
.replace('{referenceOf}', '.*')
|
|
136
136
|
);
|
|
137
137
|
if (match) {
|
|
138
138
|
return match[1];
|
|
@@ -140,7 +140,7 @@ export default class ReferenceOf implements IModel {
|
|
|
140
140
|
return null;
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
public static
|
|
143
|
+
public static getReferenceOf(grn: string): string|null {
|
|
144
144
|
const match = grn.match(grnFormat
|
|
145
145
|
.replace('{region}', '.*')
|
|
146
146
|
.replace('{ownerId}', '.*')
|
|
@@ -149,7 +149,7 @@ export default class ReferenceOf implements IModel {
|
|
|
149
149
|
.replace('{inventoryName}', '.*')
|
|
150
150
|
.replace('{itemName}', '.*')
|
|
151
151
|
.replace('{itemSetName}', '.*')
|
|
152
|
-
.replace('{
|
|
152
|
+
.replace('{referenceOf}', '(.*)')
|
|
153
153
|
);
|
|
154
154
|
if (match) {
|
|
155
155
|
return match[1];
|
|
@@ -179,7 +179,7 @@ export default class ReferenceOf implements IModel {
|
|
|
179
179
|
if (this.getItemSetName(grn) == null || this.getItemSetName(grn) === '') {
|
|
180
180
|
return false;
|
|
181
181
|
}
|
|
182
|
-
if (this.
|
|
182
|
+
if (this.getReferenceOf(grn) == null || this.getReferenceOf(grn) === '') {
|
|
183
183
|
return false;
|
|
184
184
|
}
|
|
185
185
|
return true;
|
|
@@ -193,7 +193,7 @@ export default class ReferenceOf implements IModel {
|
|
|
193
193
|
inventoryName: string|null,
|
|
194
194
|
itemName: string|null,
|
|
195
195
|
itemSetName: string|null,
|
|
196
|
-
|
|
196
|
+
referenceOf: string|null,
|
|
197
197
|
): string|null {
|
|
198
198
|
return grnFormat
|
|
199
199
|
.replace('{region}', region ?? '')
|
|
@@ -203,7 +203,7 @@ export default class ReferenceOf implements IModel {
|
|
|
203
203
|
.replace('{inventoryName}', inventoryName ?? '')
|
|
204
204
|
.replace('{itemName}', itemName ?? '')
|
|
205
205
|
.replace('{itemSetName}', itemSetName ?? '')
|
|
206
|
-
.replace('{
|
|
206
|
+
.replace('{referenceOf}', referenceOf ?? '');
|
|
207
207
|
}
|
|
208
208
|
public getReferenceOfId(): string|null {
|
|
209
209
|
return this.referenceOfId;
|