gs2 1.3.117 → 1.3.118
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/exchange/request/AcquireByUserIdRequest.d.ts +0 -4
- package/exchange/request/AcquireByUserIdRequest.js +0 -14
- package/exchange/request/AcquireByUserIdRequest.js.map +1 -1
- package/exchange/request/AcquireByUserIdRequest.ts +0 -14
- package/exchange/request/AcquireForceByUserIdRequest.d.ts +0 -4
- package/exchange/request/AcquireForceByUserIdRequest.js +0 -14
- package/exchange/request/AcquireForceByUserIdRequest.js.map +1 -1
- package/exchange/request/AcquireForceByUserIdRequest.ts +0 -14
- package/exchange/request/AcquireRequest.d.ts +0 -4
- package/exchange/request/AcquireRequest.js +0 -14
- package/exchange/request/AcquireRequest.js.map +1 -1
- package/exchange/request/AcquireRequest.ts +0 -14
- package/exchange/request/DeleteAwaitByUserIdRequest.d.ts +0 -4
- package/exchange/request/DeleteAwaitByUserIdRequest.js +0 -14
- package/exchange/request/DeleteAwaitByUserIdRequest.js.map +1 -1
- package/exchange/request/DeleteAwaitByUserIdRequest.ts +0 -14
- package/exchange/request/DeleteAwaitRequest.d.ts +0 -4
- package/exchange/request/DeleteAwaitRequest.js +0 -14
- package/exchange/request/DeleteAwaitRequest.js.map +1 -1
- package/exchange/request/DeleteAwaitRequest.ts +0 -14
- package/exchange/request/GetAwaitByUserIdRequest.d.ts +0 -4
- package/exchange/request/GetAwaitByUserIdRequest.js +0 -14
- package/exchange/request/GetAwaitByUserIdRequest.js.map +1 -1
- package/exchange/request/GetAwaitByUserIdRequest.ts +0 -14
- package/exchange/request/GetAwaitRequest.d.ts +0 -4
- package/exchange/request/GetAwaitRequest.js +0 -14
- package/exchange/request/GetAwaitRequest.js.map +1 -1
- package/exchange/request/GetAwaitRequest.ts +0 -14
- package/exchange/request/SkipByUserIdRequest.d.ts +0 -4
- package/exchange/request/SkipByUserIdRequest.js +0 -14
- package/exchange/request/SkipByUserIdRequest.js.map +1 -1
- package/exchange/request/SkipByUserIdRequest.ts +0 -14
- package/exchange/request/SkipRequest.d.ts +0 -4
- package/exchange/request/SkipRequest.js +0 -14
- package/exchange/request/SkipRequest.js.map +1 -1
- package/exchange/request/SkipRequest.ts +0 -14
- package/exchange/rest.js +52 -61
- package/exchange/rest.js.map +1 -1
- package/exchange/rest.ts +9 -18
- package/package.json +1 -1
- package/ranking/model/SubscribeUser.d.ts +12 -0
- package/ranking/model/SubscribeUser.js +123 -0
- package/ranking/model/SubscribeUser.js.map +1 -1
- package/ranking/model/SubscribeUser.ts +144 -0
package/exchange/rest.ts
CHANGED
|
@@ -741,11 +741,10 @@ export default class Gs2ExchangeRestClient extends AbstractGs2RestClient {
|
|
|
741
741
|
}
|
|
742
742
|
|
|
743
743
|
public getAwait(request: Request.GetAwaitRequest): Promise<Result.GetAwaitResult> {
|
|
744
|
-
const url = (Gs2Constant.ENDPOINT_HOST + '/{namespaceName}/user/me/exchange/
|
|
744
|
+
const url = (Gs2Constant.ENDPOINT_HOST + '/{namespaceName}/user/me/exchange/await/{awaitName}')
|
|
745
745
|
.replace('{service}', 'exchange')
|
|
746
746
|
.replace('{region}', this.session.region)
|
|
747
747
|
.replace('{namespaceName}', String(request.getNamespaceName() ?? 'null') === "" ? "null" : String(request.getNamespaceName() ?? 'null'))
|
|
748
|
-
.replace('{rateName}', String(request.getRateName() ?? 'null') === "" ? "null" : String(request.getRateName() ?? 'null'))
|
|
749
748
|
.replace('{awaitName}', String(request.getAwaitName() ?? 'null') === "" ? "null" : String(request.getAwaitName() ?? 'null'));
|
|
750
749
|
|
|
751
750
|
const headers = this.createAuthorizedHeaders();
|
|
@@ -772,12 +771,11 @@ export default class Gs2ExchangeRestClient extends AbstractGs2RestClient {
|
|
|
772
771
|
}
|
|
773
772
|
|
|
774
773
|
public getAwaitByUserId(request: Request.GetAwaitByUserIdRequest): Promise<Result.GetAwaitByUserIdResult> {
|
|
775
|
-
const url = (Gs2Constant.ENDPOINT_HOST + '/{namespaceName}/user/{userId}/exchange/
|
|
774
|
+
const url = (Gs2Constant.ENDPOINT_HOST + '/{namespaceName}/user/{userId}/exchange/await/{awaitName}')
|
|
776
775
|
.replace('{service}', 'exchange')
|
|
777
776
|
.replace('{region}', this.session.region)
|
|
778
777
|
.replace('{namespaceName}', String(request.getNamespaceName() ?? 'null') === "" ? "null" : String(request.getNamespaceName() ?? 'null'))
|
|
779
778
|
.replace('{userId}', String(request.getUserId() ?? 'null') === "" ? "null" : String(request.getUserId() ?? 'null'))
|
|
780
|
-
.replace('{rateName}', String(request.getRateName() ?? 'null') === "" ? "null" : String(request.getRateName() ?? 'null'))
|
|
781
779
|
.replace('{awaitName}', String(request.getAwaitName() ?? 'null') === "" ? "null" : String(request.getAwaitName() ?? 'null'));
|
|
782
780
|
|
|
783
781
|
const headers = this.createAuthorizedHeaders();
|
|
@@ -801,11 +799,10 @@ export default class Gs2ExchangeRestClient extends AbstractGs2RestClient {
|
|
|
801
799
|
}
|
|
802
800
|
|
|
803
801
|
public acquire(request: Request.AcquireRequest): Promise<Result.AcquireResult> {
|
|
804
|
-
const url = (Gs2Constant.ENDPOINT_HOST + '/{namespaceName}/user/me/exchange/
|
|
802
|
+
const url = (Gs2Constant.ENDPOINT_HOST + '/{namespaceName}/user/me/exchange/await/{awaitName}')
|
|
805
803
|
.replace('{service}', 'exchange')
|
|
806
804
|
.replace('{region}', this.session.region)
|
|
807
805
|
.replace('{namespaceName}', String(request.getNamespaceName() ?? 'null') === "" ? "null" : String(request.getNamespaceName() ?? 'null'))
|
|
808
|
-
.replace('{rateName}', String(request.getRateName() ?? 'null') === "" ? "null" : String(request.getRateName() ?? 'null'))
|
|
809
806
|
.replace('{awaitName}', String(request.getAwaitName() ?? 'null') === "" ? "null" : String(request.getAwaitName() ?? 'null'));
|
|
810
807
|
|
|
811
808
|
const headers = this.createAuthorizedHeaders();
|
|
@@ -840,12 +837,11 @@ export default class Gs2ExchangeRestClient extends AbstractGs2RestClient {
|
|
|
840
837
|
}
|
|
841
838
|
|
|
842
839
|
public acquireByUserId(request: Request.AcquireByUserIdRequest): Promise<Result.AcquireByUserIdResult> {
|
|
843
|
-
const url = (Gs2Constant.ENDPOINT_HOST + '/{namespaceName}/user/{userId}/exchange/
|
|
840
|
+
const url = (Gs2Constant.ENDPOINT_HOST + '/{namespaceName}/user/{userId}/exchange/await/{awaitName}')
|
|
844
841
|
.replace('{service}', 'exchange')
|
|
845
842
|
.replace('{region}', this.session.region)
|
|
846
843
|
.replace('{namespaceName}', String(request.getNamespaceName() ?? 'null') === "" ? "null" : String(request.getNamespaceName() ?? 'null'))
|
|
847
844
|
.replace('{userId}', String(request.getUserId() ?? 'null') === "" ? "null" : String(request.getUserId() ?? 'null'))
|
|
848
|
-
.replace('{rateName}', String(request.getRateName() ?? 'null') === "" ? "null" : String(request.getRateName() ?? 'null'))
|
|
849
845
|
.replace('{awaitName}', String(request.getAwaitName() ?? 'null') === "" ? "null" : String(request.getAwaitName() ?? 'null'));
|
|
850
846
|
|
|
851
847
|
const headers = this.createAuthorizedHeaders();
|
|
@@ -877,12 +873,11 @@ export default class Gs2ExchangeRestClient extends AbstractGs2RestClient {
|
|
|
877
873
|
}
|
|
878
874
|
|
|
879
875
|
public acquireForceByUserId(request: Request.AcquireForceByUserIdRequest): Promise<Result.AcquireForceByUserIdResult> {
|
|
880
|
-
const url = (Gs2Constant.ENDPOINT_HOST + '/{namespaceName}/user/{userId}/exchange/
|
|
876
|
+
const url = (Gs2Constant.ENDPOINT_HOST + '/{namespaceName}/user/{userId}/exchange/await/{awaitName}/force')
|
|
881
877
|
.replace('{service}', 'exchange')
|
|
882
878
|
.replace('{region}', this.session.region)
|
|
883
879
|
.replace('{namespaceName}', String(request.getNamespaceName() ?? 'null') === "" ? "null" : String(request.getNamespaceName() ?? 'null'))
|
|
884
880
|
.replace('{userId}', String(request.getUserId() ?? 'null') === "" ? "null" : String(request.getUserId() ?? 'null'))
|
|
885
|
-
.replace('{rateName}', String(request.getRateName() ?? 'null') === "" ? "null" : String(request.getRateName() ?? 'null'))
|
|
886
881
|
.replace('{awaitName}', String(request.getAwaitName() ?? 'null') === "" ? "null" : String(request.getAwaitName() ?? 'null'));
|
|
887
882
|
|
|
888
883
|
const headers = this.createAuthorizedHeaders();
|
|
@@ -914,11 +909,10 @@ export default class Gs2ExchangeRestClient extends AbstractGs2RestClient {
|
|
|
914
909
|
}
|
|
915
910
|
|
|
916
911
|
public skip(request: Request.SkipRequest): Promise<Result.SkipResult> {
|
|
917
|
-
const url = (Gs2Constant.ENDPOINT_HOST + '/{namespaceName}/user/me/exchange/
|
|
912
|
+
const url = (Gs2Constant.ENDPOINT_HOST + '/{namespaceName}/user/me/exchange/await/{awaitName}/skip')
|
|
918
913
|
.replace('{service}', 'exchange')
|
|
919
914
|
.replace('{region}', this.session.region)
|
|
920
915
|
.replace('{namespaceName}', String(request.getNamespaceName() ?? 'null') === "" ? "null" : String(request.getNamespaceName() ?? 'null'))
|
|
921
|
-
.replace('{rateName}', String(request.getRateName() ?? 'null') === "" ? "null" : String(request.getRateName() ?? 'null'))
|
|
922
916
|
.replace('{awaitName}', String(request.getAwaitName() ?? 'null') === "" ? "null" : String(request.getAwaitName() ?? 'null'));
|
|
923
917
|
|
|
924
918
|
const headers = this.createAuthorizedHeaders();
|
|
@@ -953,12 +947,11 @@ export default class Gs2ExchangeRestClient extends AbstractGs2RestClient {
|
|
|
953
947
|
}
|
|
954
948
|
|
|
955
949
|
public skipByUserId(request: Request.SkipByUserIdRequest): Promise<Result.SkipByUserIdResult> {
|
|
956
|
-
const url = (Gs2Constant.ENDPOINT_HOST + '/{namespaceName}/user/{userId}/exchange/
|
|
950
|
+
const url = (Gs2Constant.ENDPOINT_HOST + '/{namespaceName}/user/{userId}/exchange/await/{awaitName}/skip')
|
|
957
951
|
.replace('{service}', 'exchange')
|
|
958
952
|
.replace('{region}', this.session.region)
|
|
959
953
|
.replace('{namespaceName}', String(request.getNamespaceName() ?? 'null') === "" ? "null" : String(request.getNamespaceName() ?? 'null'))
|
|
960
954
|
.replace('{userId}', String(request.getUserId() ?? 'null') === "" ? "null" : String(request.getUserId() ?? 'null'))
|
|
961
|
-
.replace('{rateName}', String(request.getRateName() ?? 'null') === "" ? "null" : String(request.getRateName() ?? 'null'))
|
|
962
955
|
.replace('{awaitName}', String(request.getAwaitName() ?? 'null') === "" ? "null" : String(request.getAwaitName() ?? 'null'));
|
|
963
956
|
|
|
964
957
|
const headers = this.createAuthorizedHeaders();
|
|
@@ -990,11 +983,10 @@ export default class Gs2ExchangeRestClient extends AbstractGs2RestClient {
|
|
|
990
983
|
}
|
|
991
984
|
|
|
992
985
|
public deleteAwait(request: Request.DeleteAwaitRequest): Promise<Result.DeleteAwaitResult> {
|
|
993
|
-
const url = (Gs2Constant.ENDPOINT_HOST + '/{namespaceName}/user/me/exchange/
|
|
986
|
+
const url = (Gs2Constant.ENDPOINT_HOST + '/{namespaceName}/user/me/exchange/await/{awaitName}')
|
|
994
987
|
.replace('{service}', 'exchange')
|
|
995
988
|
.replace('{region}', this.session.region)
|
|
996
989
|
.replace('{namespaceName}', String(request.getNamespaceName() ?? 'null') === "" ? "null" : String(request.getNamespaceName() ?? 'null'))
|
|
997
|
-
.replace('{rateName}', String(request.getRateName() ?? 'null') === "" ? "null" : String(request.getRateName() ?? 'null'))
|
|
998
990
|
.replace('{awaitName}', String(request.getAwaitName() ?? 'null') === "" ? "null" : String(request.getAwaitName() ?? 'null'));
|
|
999
991
|
|
|
1000
992
|
const headers = this.createAuthorizedHeaders();
|
|
@@ -1024,12 +1016,11 @@ export default class Gs2ExchangeRestClient extends AbstractGs2RestClient {
|
|
|
1024
1016
|
}
|
|
1025
1017
|
|
|
1026
1018
|
public deleteAwaitByUserId(request: Request.DeleteAwaitByUserIdRequest): Promise<Result.DeleteAwaitByUserIdResult> {
|
|
1027
|
-
const url = (Gs2Constant.ENDPOINT_HOST + '/{namespaceName}/user/{userId}/exchange/
|
|
1019
|
+
const url = (Gs2Constant.ENDPOINT_HOST + '/{namespaceName}/user/{userId}/exchange/await/{awaitName}')
|
|
1028
1020
|
.replace('{service}', 'exchange')
|
|
1029
1021
|
.replace('{region}', this.session.region)
|
|
1030
1022
|
.replace('{namespaceName}', String(request.getNamespaceName() ?? 'null') === "" ? "null" : String(request.getNamespaceName() ?? 'null'))
|
|
1031
1023
|
.replace('{userId}', String(request.getUserId() ?? 'null') === "" ? "null" : String(request.getUserId() ?? 'null'))
|
|
1032
|
-
.replace('{rateName}', String(request.getRateName() ?? 'null') === "" ? "null" : String(request.getRateName() ?? 'null'))
|
|
1033
1024
|
.replace('{awaitName}', String(request.getAwaitName() ?? 'null') === "" ? "null" : String(request.getAwaitName() ?? 'null'));
|
|
1034
1025
|
|
|
1035
1026
|
const headers = this.createAuthorizedHeaders();
|
package/package.json
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import IModel from '../../core/interface/IModel';
|
|
2
2
|
export default class SubscribeUser implements IModel {
|
|
3
|
+
private subscribeUserId;
|
|
3
4
|
private categoryName;
|
|
4
5
|
private userId;
|
|
5
6
|
private targetUserId;
|
|
7
|
+
static getRegion(grn: string): string | null;
|
|
8
|
+
static getOwnerId(grn: string): string | null;
|
|
9
|
+
static getNamespaceName(grn: string): string | null;
|
|
10
|
+
static getUserId(grn: string): string | null;
|
|
11
|
+
static getCategoryName(grn: string): string | null;
|
|
12
|
+
static getTargetUserId(grn: string): string | null;
|
|
13
|
+
static isValid(grn: string): boolean;
|
|
14
|
+
static createGrn(region: string | null, ownerId: string | null, namespaceName: string | null, userId: string | null, categoryName: string | null, targetUserId: string | null): string | null;
|
|
15
|
+
getSubscribeUserId(): string | null;
|
|
16
|
+
setSubscribeUserId(subscribeUserId: string | null): this;
|
|
17
|
+
withSubscribeUserId(subscribeUserId: string | null): this;
|
|
6
18
|
getCategoryName(): string | null;
|
|
7
19
|
setCategoryName(categoryName: string | null): this;
|
|
8
20
|
withCategoryName(categoryName: string | null): this;
|
|
@@ -15,12 +15,133 @@ 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}:ranking:{namespaceName}:user:{userId}:subscribe:category:{categoryName}:{targetUserId}";
|
|
18
19
|
var SubscribeUser = /** @class */ (function () {
|
|
19
20
|
function SubscribeUser() {
|
|
21
|
+
this.subscribeUserId = null;
|
|
20
22
|
this.categoryName = null;
|
|
21
23
|
this.userId = null;
|
|
22
24
|
this.targetUserId = null;
|
|
23
25
|
}
|
|
26
|
+
SubscribeUser.getRegion = function (grn) {
|
|
27
|
+
var match = grn.match(grnFormat
|
|
28
|
+
.replace('{region}', '(.*)')
|
|
29
|
+
.replace('{ownerId}', '.*')
|
|
30
|
+
.replace('{namespaceName}', '.*')
|
|
31
|
+
.replace('{userId}', '.*')
|
|
32
|
+
.replace('{categoryName}', '.*')
|
|
33
|
+
.replace('{targetUserId}', '.*'));
|
|
34
|
+
if (match) {
|
|
35
|
+
return match[1];
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
};
|
|
39
|
+
SubscribeUser.getOwnerId = function (grn) {
|
|
40
|
+
var match = grn.match(grnFormat
|
|
41
|
+
.replace('{region}', '.*')
|
|
42
|
+
.replace('{ownerId}', '(.*)')
|
|
43
|
+
.replace('{namespaceName}', '.*')
|
|
44
|
+
.replace('{userId}', '.*')
|
|
45
|
+
.replace('{categoryName}', '.*')
|
|
46
|
+
.replace('{targetUserId}', '.*'));
|
|
47
|
+
if (match) {
|
|
48
|
+
return match[1];
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
};
|
|
52
|
+
SubscribeUser.getNamespaceName = function (grn) {
|
|
53
|
+
var match = grn.match(grnFormat
|
|
54
|
+
.replace('{region}', '.*')
|
|
55
|
+
.replace('{ownerId}', '.*')
|
|
56
|
+
.replace('{namespaceName}', '(.*)')
|
|
57
|
+
.replace('{userId}', '.*')
|
|
58
|
+
.replace('{categoryName}', '.*')
|
|
59
|
+
.replace('{targetUserId}', '.*'));
|
|
60
|
+
if (match) {
|
|
61
|
+
return match[1];
|
|
62
|
+
}
|
|
63
|
+
return null;
|
|
64
|
+
};
|
|
65
|
+
SubscribeUser.getUserId = function (grn) {
|
|
66
|
+
var match = grn.match(grnFormat
|
|
67
|
+
.replace('{region}', '.*')
|
|
68
|
+
.replace('{ownerId}', '.*')
|
|
69
|
+
.replace('{namespaceName}', '.*')
|
|
70
|
+
.replace('{userId}', '(.*)')
|
|
71
|
+
.replace('{categoryName}', '.*')
|
|
72
|
+
.replace('{targetUserId}', '.*'));
|
|
73
|
+
if (match) {
|
|
74
|
+
return match[1];
|
|
75
|
+
}
|
|
76
|
+
return null;
|
|
77
|
+
};
|
|
78
|
+
SubscribeUser.getCategoryName = function (grn) {
|
|
79
|
+
var match = grn.match(grnFormat
|
|
80
|
+
.replace('{region}', '.*')
|
|
81
|
+
.replace('{ownerId}', '.*')
|
|
82
|
+
.replace('{namespaceName}', '.*')
|
|
83
|
+
.replace('{userId}', '.*')
|
|
84
|
+
.replace('{categoryName}', '(.*)')
|
|
85
|
+
.replace('{targetUserId}', '.*'));
|
|
86
|
+
if (match) {
|
|
87
|
+
return match[1];
|
|
88
|
+
}
|
|
89
|
+
return null;
|
|
90
|
+
};
|
|
91
|
+
SubscribeUser.getTargetUserId = function (grn) {
|
|
92
|
+
var match = grn.match(grnFormat
|
|
93
|
+
.replace('{region}', '.*')
|
|
94
|
+
.replace('{ownerId}', '.*')
|
|
95
|
+
.replace('{namespaceName}', '.*')
|
|
96
|
+
.replace('{userId}', '.*')
|
|
97
|
+
.replace('{categoryName}', '.*')
|
|
98
|
+
.replace('{targetUserId}', '(.*)'));
|
|
99
|
+
if (match) {
|
|
100
|
+
return match[1];
|
|
101
|
+
}
|
|
102
|
+
return null;
|
|
103
|
+
};
|
|
104
|
+
SubscribeUser.isValid = function (grn) {
|
|
105
|
+
if (this.getRegion(grn) == null || this.getRegion(grn) === '') {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
if (this.getOwnerId(grn) == null || this.getOwnerId(grn) === '') {
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
if (this.getNamespaceName(grn) == null || this.getNamespaceName(grn) === '') {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
if (this.getUserId(grn) == null || this.getUserId(grn) === '') {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
if (this.getCategoryName(grn) == null || this.getCategoryName(grn) === '') {
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
if (this.getTargetUserId(grn) == null || this.getTargetUserId(grn) === '') {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
return true;
|
|
124
|
+
};
|
|
125
|
+
SubscribeUser.createGrn = function (region, ownerId, namespaceName, userId, categoryName, targetUserId) {
|
|
126
|
+
return grnFormat
|
|
127
|
+
.replace('{region}', region !== null && region !== void 0 ? region : '')
|
|
128
|
+
.replace('{ownerId}', ownerId !== null && ownerId !== void 0 ? ownerId : '')
|
|
129
|
+
.replace('{namespaceName}', namespaceName !== null && namespaceName !== void 0 ? namespaceName : '')
|
|
130
|
+
.replace('{userId}', userId !== null && userId !== void 0 ? userId : '')
|
|
131
|
+
.replace('{categoryName}', categoryName !== null && categoryName !== void 0 ? categoryName : '')
|
|
132
|
+
.replace('{targetUserId}', targetUserId !== null && targetUserId !== void 0 ? targetUserId : '');
|
|
133
|
+
};
|
|
134
|
+
SubscribeUser.prototype.getSubscribeUserId = function () {
|
|
135
|
+
return this.subscribeUserId;
|
|
136
|
+
};
|
|
137
|
+
SubscribeUser.prototype.setSubscribeUserId = function (subscribeUserId) {
|
|
138
|
+
this.subscribeUserId = subscribeUserId;
|
|
139
|
+
return this;
|
|
140
|
+
};
|
|
141
|
+
SubscribeUser.prototype.withSubscribeUserId = function (subscribeUserId) {
|
|
142
|
+
this.subscribeUserId = subscribeUserId;
|
|
143
|
+
return this;
|
|
144
|
+
};
|
|
24
145
|
SubscribeUser.prototype.getCategoryName = function () {
|
|
25
146
|
return this.categoryName;
|
|
26
147
|
};
|
|
@@ -59,12 +180,14 @@ var SubscribeUser = /** @class */ (function () {
|
|
|
59
180
|
return null;
|
|
60
181
|
}
|
|
61
182
|
return new SubscribeUser()
|
|
183
|
+
.withSubscribeUserId(data["subscribeUserId"])
|
|
62
184
|
.withCategoryName(data["categoryName"])
|
|
63
185
|
.withUserId(data["userId"])
|
|
64
186
|
.withTargetUserId(data["targetUserId"]);
|
|
65
187
|
};
|
|
66
188
|
SubscribeUser.prototype.toDict = function () {
|
|
67
189
|
return {
|
|
190
|
+
"subscribeUserId": this.getSubscribeUserId(),
|
|
68
191
|
"categoryName": this.getCategoryName(),
|
|
69
192
|
"userId": this.getUserId(),
|
|
70
193
|
"targetUserId": this.getTargetUserId(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubscribeUser.js","sourceRoot":"","sources":["SubscribeUser.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;
|
|
1
|
+
{"version":3,"file":"SubscribeUser.js","sourceRoot":"","sources":["SubscribeUser.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAGH,IAAM,SAAS,GAAW,mHAAmH,CAAC;AAE9I;IAAA;QACY,oBAAe,GAAgB,IAAI,CAAC;QACpC,iBAAY,GAAgB,IAAI,CAAC;QACjC,WAAM,GAAgB,IAAI,CAAC;QAC3B,iBAAY,GAAgB,IAAI,CAAC;IAkM7C,CAAC;IAhMiB,uBAAS,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,E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M,kCAAU,GAAjB,UAAkB,MAAmB;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,OAAO,IAAI,CAAC;IAChB,CAAC;IACM,uCAAe,GAAtB;QACI,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IACM,uCAAe,GAAtB,UAAuB,YAAyB;QAC5C,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,OAAO,IAAI,CAAC;IAChB,CAAC;IACM,wCAAgB,GAAvB,UAAwB,YAAyB;QAC7C,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,OAAO,IAAI,CAAC;IAChB,CAAC;IAEa,sBAAQ,GAAtB,UAAuB,IAA0B;QAC7C,IAAI,IAAI,IAAI,SAAS,IAAI,IAAI,IAAI,IAAI,EAAE;YACnC,OAAO,IAAI,CAAC;SACf;QACD,OAAO,IAAI,aAAa,EAAE;aACrB,mBAAmB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;aAC5C,gBAAgB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;aACtC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aAC1B,gBAAgB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;IAChD,CAAC;IAEM,8BAAM,GAAb;QACI,OAAO;YACH,iBAAiB,EAAE,IAAI,CAAC,kBAAkB,EAAE;YAC5C,cAAc,EAAE,IAAI,CAAC,eAAe,EAAE;YACtC,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE;YAC1B,cAAc,EAAE,IAAI,CAAC,eAAe,EAAE;SACzC,CAAC;IACN,CAAC;IACL,oBAAC;AAAD,CAAC,AAtMD,IAsMC"}
|
|
@@ -15,11 +15,153 @@ 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}:ranking:{namespaceName}:user:{userId}:subscribe:category:{categoryName}:{targetUserId}";
|
|
18
19
|
|
|
19
20
|
export default class SubscribeUser implements IModel {
|
|
21
|
+
private subscribeUserId: string|null = null;
|
|
20
22
|
private categoryName: string|null = null;
|
|
21
23
|
private userId: string|null = null;
|
|
22
24
|
private targetUserId: string|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
|
+
.replace('{categoryName}', '.*')
|
|
33
|
+
.replace('{targetUserId}', '.*')
|
|
34
|
+
);
|
|
35
|
+
if (match) {
|
|
36
|
+
return match[1];
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public static getOwnerId(grn: string): string|null {
|
|
42
|
+
const match = grn.match(grnFormat
|
|
43
|
+
.replace('{region}', '.*')
|
|
44
|
+
.replace('{ownerId}', '(.*)')
|
|
45
|
+
.replace('{namespaceName}', '.*')
|
|
46
|
+
.replace('{userId}', '.*')
|
|
47
|
+
.replace('{categoryName}', '.*')
|
|
48
|
+
.replace('{targetUserId}', '.*')
|
|
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('{userId}', '.*')
|
|
62
|
+
.replace('{categoryName}', '.*')
|
|
63
|
+
.replace('{targetUserId}', '.*')
|
|
64
|
+
);
|
|
65
|
+
if (match) {
|
|
66
|
+
return match[1];
|
|
67
|
+
}
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
public static getUserId(grn: string): string|null {
|
|
72
|
+
const match = grn.match(grnFormat
|
|
73
|
+
.replace('{region}', '.*')
|
|
74
|
+
.replace('{ownerId}', '.*')
|
|
75
|
+
.replace('{namespaceName}', '.*')
|
|
76
|
+
.replace('{userId}', '(.*)')
|
|
77
|
+
.replace('{categoryName}', '.*')
|
|
78
|
+
.replace('{targetUserId}', '.*')
|
|
79
|
+
);
|
|
80
|
+
if (match) {
|
|
81
|
+
return match[1];
|
|
82
|
+
}
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
public static getCategoryName(grn: string): string|null {
|
|
87
|
+
const match = grn.match(grnFormat
|
|
88
|
+
.replace('{region}', '.*')
|
|
89
|
+
.replace('{ownerId}', '.*')
|
|
90
|
+
.replace('{namespaceName}', '.*')
|
|
91
|
+
.replace('{userId}', '.*')
|
|
92
|
+
.replace('{categoryName}', '(.*)')
|
|
93
|
+
.replace('{targetUserId}', '.*')
|
|
94
|
+
);
|
|
95
|
+
if (match) {
|
|
96
|
+
return match[1];
|
|
97
|
+
}
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
public static getTargetUserId(grn: string): string|null {
|
|
102
|
+
const match = grn.match(grnFormat
|
|
103
|
+
.replace('{region}', '.*')
|
|
104
|
+
.replace('{ownerId}', '.*')
|
|
105
|
+
.replace('{namespaceName}', '.*')
|
|
106
|
+
.replace('{userId}', '.*')
|
|
107
|
+
.replace('{categoryName}', '.*')
|
|
108
|
+
.replace('{targetUserId}', '(.*)')
|
|
109
|
+
);
|
|
110
|
+
if (match) {
|
|
111
|
+
return match[1];
|
|
112
|
+
}
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
public static isValid(grn: string): boolean {
|
|
117
|
+
if (this.getRegion(grn) == null || this.getRegion(grn) === '') {
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
if (this.getOwnerId(grn) == null || this.getOwnerId(grn) === '') {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
if (this.getNamespaceName(grn) == null || this.getNamespaceName(grn) === '') {
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
if (this.getUserId(grn) == null || this.getUserId(grn) === '') {
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
if (this.getCategoryName(grn) == null || this.getCategoryName(grn) === '') {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
if (this.getTargetUserId(grn) == null || this.getTargetUserId(grn) === '') {
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
return true;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
public static createGrn(
|
|
139
|
+
region: string|null,
|
|
140
|
+
ownerId: string|null,
|
|
141
|
+
namespaceName: string|null,
|
|
142
|
+
userId: string|null,
|
|
143
|
+
categoryName: string|null,
|
|
144
|
+
targetUserId: string|null,
|
|
145
|
+
): string|null {
|
|
146
|
+
return grnFormat
|
|
147
|
+
.replace('{region}', region ?? '')
|
|
148
|
+
.replace('{ownerId}', ownerId ?? '')
|
|
149
|
+
.replace('{namespaceName}', namespaceName ?? '')
|
|
150
|
+
.replace('{userId}', userId ?? '')
|
|
151
|
+
.replace('{categoryName}', categoryName ?? '')
|
|
152
|
+
.replace('{targetUserId}', targetUserId ?? '');
|
|
153
|
+
}
|
|
154
|
+
public getSubscribeUserId(): string|null {
|
|
155
|
+
return this.subscribeUserId;
|
|
156
|
+
}
|
|
157
|
+
public setSubscribeUserId(subscribeUserId: string|null) {
|
|
158
|
+
this.subscribeUserId = subscribeUserId;
|
|
159
|
+
return this;
|
|
160
|
+
}
|
|
161
|
+
public withSubscribeUserId(subscribeUserId: string|null): this {
|
|
162
|
+
this.subscribeUserId = subscribeUserId;
|
|
163
|
+
return this;
|
|
164
|
+
}
|
|
23
165
|
public getCategoryName(): string|null {
|
|
24
166
|
return this.categoryName;
|
|
25
167
|
}
|
|
@@ -59,6 +201,7 @@ export default class SubscribeUser implements IModel {
|
|
|
59
201
|
return null;
|
|
60
202
|
}
|
|
61
203
|
return new SubscribeUser()
|
|
204
|
+
.withSubscribeUserId(data["subscribeUserId"])
|
|
62
205
|
.withCategoryName(data["categoryName"])
|
|
63
206
|
.withUserId(data["userId"])
|
|
64
207
|
.withTargetUserId(data["targetUserId"]);
|
|
@@ -66,6 +209,7 @@ export default class SubscribeUser implements IModel {
|
|
|
66
209
|
|
|
67
210
|
public toDict(): {[key: string]: any} {
|
|
68
211
|
return {
|
|
212
|
+
"subscribeUserId": this.getSubscribeUserId(),
|
|
69
213
|
"categoryName": this.getCategoryName(),
|
|
70
214
|
"userId": this.getUserId(),
|
|
71
215
|
"targetUserId": this.getTargetUserId(),
|