gs2 1.3.56 → 1.3.57
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/account/model/DataOwner.d.ts +2 -1
- package/account/model/DataOwner.js +26 -6
- package/account/model/DataOwner.js.map +1 -1
- package/account/model/DataOwner.ts +24 -1
- package/enhance/model/Progress.d.ts +11 -1
- package/enhance/model/Progress.js +119 -3
- package/enhance/model/Progress.js.map +1 -1
- package/enhance/model/Progress.ts +139 -2
- package/enhance/request/DeleteProgressByUserIdRequest.d.ts +8 -0
- package/enhance/request/DeleteProgressByUserIdRequest.js +29 -1
- package/enhance/request/DeleteProgressByUserIdRequest.js.map +1 -1
- package/enhance/request/DeleteProgressByUserIdRequest.ts +35 -1
- package/enhance/request/DeleteProgressRequest.d.ts +8 -0
- package/enhance/request/DeleteProgressRequest.js +29 -1
- package/enhance/request/DeleteProgressRequest.js.map +1 -1
- package/enhance/request/DeleteProgressRequest.ts +35 -1
- package/enhance/request/EndByUserIdRequest.d.ts +8 -0
- package/enhance/request/EndByUserIdRequest.js +28 -0
- package/enhance/request/EndByUserIdRequest.js.map +1 -1
- package/enhance/request/EndByUserIdRequest.ts +34 -0
- package/enhance/request/EndRequest.d.ts +8 -0
- package/enhance/request/EndRequest.js +28 -0
- package/enhance/request/EndRequest.js.map +1 -1
- package/enhance/request/EndRequest.ts +34 -0
- package/enhance/request/GetProgressByUserIdRequest.d.ts +8 -0
- package/enhance/request/GetProgressByUserIdRequest.js +29 -1
- package/enhance/request/GetProgressByUserIdRequest.js.map +1 -1
- package/enhance/request/GetProgressByUserIdRequest.ts +35 -1
- package/enhance/request/GetProgressRequest.d.ts +8 -0
- package/enhance/request/GetProgressRequest.js +29 -1
- package/enhance/request/GetProgressRequest.js.map +1 -1
- package/enhance/request/GetProgressRequest.ts +35 -1
- package/enhance/rest.js +43 -31
- package/enhance/rest.js.map +1 -1
- package/enhance/rest.ts +24 -12
- package/package.json +1 -1
- package/watch/model/BillingActivity.js +1 -1
- package/watch/model/BillingActivity.js.map +1 -1
- package/watch/model/BillingActivity.ts +1 -1
|
@@ -8,8 +8,9 @@ export default class DataOwner implements IModel {
|
|
|
8
8
|
static getOwnerId(grn: string): string | null;
|
|
9
9
|
static getNamespaceName(grn: string): string | null;
|
|
10
10
|
static getUserId(grn: string): string | null;
|
|
11
|
+
static getDataOwnerName(grn: string): string | null;
|
|
11
12
|
static isValid(grn: string): boolean;
|
|
12
|
-
static createGrn(region: string | null, ownerId: string | null, namespaceName: string | null, userId: string | null): string | null;
|
|
13
|
+
static createGrn(region: string | null, ownerId: string | null, namespaceName: string | null, userId: string | null, dataOwnerName: string | null): string | null;
|
|
13
14
|
getDataOwnerId(): string | null;
|
|
14
15
|
setDataOwnerId(dataOwnerId: string | null): this;
|
|
15
16
|
withDataOwnerId(dataOwnerId: string | null): this;
|
|
@@ -28,7 +28,8 @@ var DataOwner = /** @class */ (function () {
|
|
|
28
28
|
.replace('{region}', '(.*)')
|
|
29
29
|
.replace('{ownerId}', '.*')
|
|
30
30
|
.replace('{namespaceName}', '.*')
|
|
31
|
-
.replace('{userId}', '.*')
|
|
31
|
+
.replace('{userId}', '.*')
|
|
32
|
+
.replace('{dataOwnerName}', '.*'));
|
|
32
33
|
if (match) {
|
|
33
34
|
return match[1];
|
|
34
35
|
}
|
|
@@ -39,7 +40,8 @@ var DataOwner = /** @class */ (function () {
|
|
|
39
40
|
.replace('{region}', '.*')
|
|
40
41
|
.replace('{ownerId}', '(.*)')
|
|
41
42
|
.replace('{namespaceName}', '.*')
|
|
42
|
-
.replace('{userId}', '.*')
|
|
43
|
+
.replace('{userId}', '.*')
|
|
44
|
+
.replace('{dataOwnerName}', '.*'));
|
|
43
45
|
if (match) {
|
|
44
46
|
return match[1];
|
|
45
47
|
}
|
|
@@ -50,7 +52,8 @@ var DataOwner = /** @class */ (function () {
|
|
|
50
52
|
.replace('{region}', '.*')
|
|
51
53
|
.replace('{ownerId}', '.*')
|
|
52
54
|
.replace('{namespaceName}', '(.*)')
|
|
53
|
-
.replace('{userId}', '.*')
|
|
55
|
+
.replace('{userId}', '.*')
|
|
56
|
+
.replace('{dataOwnerName}', '.*'));
|
|
54
57
|
if (match) {
|
|
55
58
|
return match[1];
|
|
56
59
|
}
|
|
@@ -61,7 +64,20 @@ var DataOwner = /** @class */ (function () {
|
|
|
61
64
|
.replace('{region}', '.*')
|
|
62
65
|
.replace('{ownerId}', '.*')
|
|
63
66
|
.replace('{namespaceName}', '.*')
|
|
64
|
-
.replace('{userId}', '(.*)')
|
|
67
|
+
.replace('{userId}', '(.*)')
|
|
68
|
+
.replace('{dataOwnerName}', '.*'));
|
|
69
|
+
if (match) {
|
|
70
|
+
return match[1];
|
|
71
|
+
}
|
|
72
|
+
return null;
|
|
73
|
+
};
|
|
74
|
+
DataOwner.getDataOwnerName = function (grn) {
|
|
75
|
+
var match = grn.match(grnFormat
|
|
76
|
+
.replace('{region}', '.*')
|
|
77
|
+
.replace('{ownerId}', '.*')
|
|
78
|
+
.replace('{namespaceName}', '.*')
|
|
79
|
+
.replace('{userId}', '.*')
|
|
80
|
+
.replace('{dataOwnerName}', '(.*)'));
|
|
65
81
|
if (match) {
|
|
66
82
|
return match[1];
|
|
67
83
|
}
|
|
@@ -80,14 +96,18 @@ var DataOwner = /** @class */ (function () {
|
|
|
80
96
|
if (this.getUserId(grn) == null || this.getUserId(grn) === '') {
|
|
81
97
|
return false;
|
|
82
98
|
}
|
|
99
|
+
if (this.getDataOwnerName(grn) == null || this.getDataOwnerName(grn) === '') {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
83
102
|
return true;
|
|
84
103
|
};
|
|
85
|
-
DataOwner.createGrn = function (region, ownerId, namespaceName, userId) {
|
|
104
|
+
DataOwner.createGrn = function (region, ownerId, namespaceName, userId, dataOwnerName) {
|
|
86
105
|
return grnFormat
|
|
87
106
|
.replace('{region}', region !== null && region !== void 0 ? region : '')
|
|
88
107
|
.replace('{ownerId}', ownerId !== null && ownerId !== void 0 ? ownerId : '')
|
|
89
108
|
.replace('{namespaceName}', namespaceName !== null && namespaceName !== void 0 ? namespaceName : '')
|
|
90
|
-
.replace('{userId}', userId !== null && userId !== void 0 ? userId : '')
|
|
109
|
+
.replace('{userId}', userId !== null && userId !== void 0 ? userId : '')
|
|
110
|
+
.replace('{dataOwnerName}', dataOwnerName !== null && dataOwnerName !== void 0 ? dataOwnerName : '');
|
|
91
111
|
};
|
|
92
112
|
DataOwner.prototype.getDataOwnerId = function () {
|
|
93
113
|
return this.dataOwnerId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataOwner.js","sourceRoot":"","sources":["DataOwner.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAGH,IAAM,SAAS,GAAW,+FAA+F,CAAC;AAE1H;IAAA;QACY,gBAAW,GAAgB,IAAI,CAAC;QAChC,WAAM,GAAgB,IAAI,CAAC;QAC3B,SAAI,GAAgB,IAAI,CAAC;QACzB,cAAS,GAAgB,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"DataOwner.js","sourceRoot":"","sources":["DataOwner.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAGH,IAAM,SAAS,GAAW,+FAA+F,CAAC;AAE1H;IAAA;QACY,gBAAW,GAAgB,IAAI,CAAC;QAChC,WAAM,GAAgB,IAAI,CAAC;QAC3B,SAAI,GAAgB,IAAI,CAAC;QACzB,cAAS,GAAgB,IAAI,CAAC;IAqL1C,CAAC;IAnLiB,mBAAS,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,I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AC;IACN,CAAC;IACL,gBAAC;AAAD,CAAC,AAzLD,IAyLC"}
|
|
@@ -29,6 +29,7 @@ export default class DataOwner implements IModel {
|
|
|
29
29
|
.replace('{ownerId}', '.*')
|
|
30
30
|
.replace('{namespaceName}', '.*')
|
|
31
31
|
.replace('{userId}', '.*')
|
|
32
|
+
.replace('{dataOwnerName}', '.*')
|
|
32
33
|
);
|
|
33
34
|
if (match) {
|
|
34
35
|
return match[1];
|
|
@@ -42,6 +43,7 @@ export default class DataOwner implements IModel {
|
|
|
42
43
|
.replace('{ownerId}', '(.*)')
|
|
43
44
|
.replace('{namespaceName}', '.*')
|
|
44
45
|
.replace('{userId}', '.*')
|
|
46
|
+
.replace('{dataOwnerName}', '.*')
|
|
45
47
|
);
|
|
46
48
|
if (match) {
|
|
47
49
|
return match[1];
|
|
@@ -55,6 +57,7 @@ export default class DataOwner implements IModel {
|
|
|
55
57
|
.replace('{ownerId}', '.*')
|
|
56
58
|
.replace('{namespaceName}', '(.*)')
|
|
57
59
|
.replace('{userId}', '.*')
|
|
60
|
+
.replace('{dataOwnerName}', '.*')
|
|
58
61
|
);
|
|
59
62
|
if (match) {
|
|
60
63
|
return match[1];
|
|
@@ -68,6 +71,21 @@ export default class DataOwner implements IModel {
|
|
|
68
71
|
.replace('{ownerId}', '.*')
|
|
69
72
|
.replace('{namespaceName}', '.*')
|
|
70
73
|
.replace('{userId}', '(.*)')
|
|
74
|
+
.replace('{dataOwnerName}', '.*')
|
|
75
|
+
);
|
|
76
|
+
if (match) {
|
|
77
|
+
return match[1];
|
|
78
|
+
}
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
public static getDataOwnerName(grn: string): string|null {
|
|
83
|
+
const match = grn.match(grnFormat
|
|
84
|
+
.replace('{region}', '.*')
|
|
85
|
+
.replace('{ownerId}', '.*')
|
|
86
|
+
.replace('{namespaceName}', '.*')
|
|
87
|
+
.replace('{userId}', '.*')
|
|
88
|
+
.replace('{dataOwnerName}', '(.*)')
|
|
71
89
|
);
|
|
72
90
|
if (match) {
|
|
73
91
|
return match[1];
|
|
@@ -88,6 +106,9 @@ export default class DataOwner implements IModel {
|
|
|
88
106
|
if (this.getUserId(grn) == null || this.getUserId(grn) === '') {
|
|
89
107
|
return false;
|
|
90
108
|
}
|
|
109
|
+
if (this.getDataOwnerName(grn) == null || this.getDataOwnerName(grn) === '') {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
91
112
|
return true;
|
|
92
113
|
}
|
|
93
114
|
|
|
@@ -96,12 +117,14 @@ export default class DataOwner implements IModel {
|
|
|
96
117
|
ownerId: string|null,
|
|
97
118
|
namespaceName: string|null,
|
|
98
119
|
userId: string|null,
|
|
120
|
+
dataOwnerName: string|null,
|
|
99
121
|
): string|null {
|
|
100
122
|
return grnFormat
|
|
101
123
|
.replace('{region}', region ?? '')
|
|
102
124
|
.replace('{ownerId}', ownerId ?? '')
|
|
103
125
|
.replace('{namespaceName}', namespaceName ?? '')
|
|
104
|
-
.replace('{userId}', userId ?? '')
|
|
126
|
+
.replace('{userId}', userId ?? '')
|
|
127
|
+
.replace('{dataOwnerName}', dataOwnerName ?? '');
|
|
105
128
|
}
|
|
106
129
|
|
|
107
130
|
public getDataOwnerId(): string|null {
|
|
@@ -3,13 +3,20 @@ export default class Progress implements IModel {
|
|
|
3
3
|
private progressId;
|
|
4
4
|
private userId;
|
|
5
5
|
private rateName;
|
|
6
|
+
private name;
|
|
6
7
|
private propertyId;
|
|
7
8
|
private experienceValue;
|
|
8
9
|
private rate;
|
|
9
10
|
private createdAt;
|
|
10
11
|
private updatedAt;
|
|
12
|
+
static getRegion(grn: string): string | null;
|
|
13
|
+
static getOwnerId(grn: string): string | null;
|
|
14
|
+
static getNamespaceName(grn: string): string | null;
|
|
15
|
+
static getUserId(grn: string): string | null;
|
|
16
|
+
static getRateName(grn: string): string | null;
|
|
17
|
+
static getProgressName(grn: string): string | null;
|
|
11
18
|
static isValid(grn: string): boolean;
|
|
12
|
-
static createGrn(): string | null;
|
|
19
|
+
static createGrn(region: string | null, ownerId: string | null, namespaceName: string | null, userId: string | null, rateName: string | null, progressName: string | null): string | null;
|
|
13
20
|
getProgressId(): string | null;
|
|
14
21
|
setProgressId(progressId: string | null): this;
|
|
15
22
|
withProgressId(progressId: string | null): this;
|
|
@@ -19,6 +26,9 @@ export default class Progress implements IModel {
|
|
|
19
26
|
getRateName(): string | null;
|
|
20
27
|
setRateName(rateName: string | null): this;
|
|
21
28
|
withRateName(rateName: string | null): this;
|
|
29
|
+
getName(): string | null;
|
|
30
|
+
setName(name: string | null): this;
|
|
31
|
+
withName(name: string | null): this;
|
|
22
32
|
getPropertyId(): string | null;
|
|
23
33
|
setPropertyId(propertyId: string | null): this;
|
|
24
34
|
withPropertyId(propertyId: string | null): this;
|
|
@@ -15,23 +15,126 @@ 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 = "";
|
|
18
|
+
var grnFormat = "grn:gs2:{region}:{ownerId}:enhance:{namespaceName}:user:{userId}:rate:{rateName}:progress:{progressName}";
|
|
19
19
|
var Progress = /** @class */ (function () {
|
|
20
20
|
function Progress() {
|
|
21
21
|
this.progressId = null;
|
|
22
22
|
this.userId = null;
|
|
23
23
|
this.rateName = null;
|
|
24
|
+
this.name = null;
|
|
24
25
|
this.propertyId = null;
|
|
25
26
|
this.experienceValue = null;
|
|
26
27
|
this.rate = null;
|
|
27
28
|
this.createdAt = null;
|
|
28
29
|
this.updatedAt = null;
|
|
29
30
|
}
|
|
31
|
+
Progress.getRegion = function (grn) {
|
|
32
|
+
var match = grn.match(grnFormat
|
|
33
|
+
.replace('{region}', '(.*)')
|
|
34
|
+
.replace('{ownerId}', '.*')
|
|
35
|
+
.replace('{namespaceName}', '.*')
|
|
36
|
+
.replace('{userId}', '.*')
|
|
37
|
+
.replace('{rateName}', '.*')
|
|
38
|
+
.replace('{progressName}', '.*'));
|
|
39
|
+
if (match) {
|
|
40
|
+
return match[1];
|
|
41
|
+
}
|
|
42
|
+
return null;
|
|
43
|
+
};
|
|
44
|
+
Progress.getOwnerId = function (grn) {
|
|
45
|
+
var match = grn.match(grnFormat
|
|
46
|
+
.replace('{region}', '.*')
|
|
47
|
+
.replace('{ownerId}', '(.*)')
|
|
48
|
+
.replace('{namespaceName}', '.*')
|
|
49
|
+
.replace('{userId}', '.*')
|
|
50
|
+
.replace('{rateName}', '.*')
|
|
51
|
+
.replace('{progressName}', '.*'));
|
|
52
|
+
if (match) {
|
|
53
|
+
return match[1];
|
|
54
|
+
}
|
|
55
|
+
return null;
|
|
56
|
+
};
|
|
57
|
+
Progress.getNamespaceName = function (grn) {
|
|
58
|
+
var match = grn.match(grnFormat
|
|
59
|
+
.replace('{region}', '.*')
|
|
60
|
+
.replace('{ownerId}', '.*')
|
|
61
|
+
.replace('{namespaceName}', '(.*)')
|
|
62
|
+
.replace('{userId}', '.*')
|
|
63
|
+
.replace('{rateName}', '.*')
|
|
64
|
+
.replace('{progressName}', '.*'));
|
|
65
|
+
if (match) {
|
|
66
|
+
return match[1];
|
|
67
|
+
}
|
|
68
|
+
return null;
|
|
69
|
+
};
|
|
70
|
+
Progress.getUserId = function (grn) {
|
|
71
|
+
var match = grn.match(grnFormat
|
|
72
|
+
.replace('{region}', '.*')
|
|
73
|
+
.replace('{ownerId}', '.*')
|
|
74
|
+
.replace('{namespaceName}', '.*')
|
|
75
|
+
.replace('{userId}', '(.*)')
|
|
76
|
+
.replace('{rateName}', '.*')
|
|
77
|
+
.replace('{progressName}', '.*'));
|
|
78
|
+
if (match) {
|
|
79
|
+
return match[1];
|
|
80
|
+
}
|
|
81
|
+
return null;
|
|
82
|
+
};
|
|
83
|
+
Progress.getRateName = function (grn) {
|
|
84
|
+
var match = grn.match(grnFormat
|
|
85
|
+
.replace('{region}', '.*')
|
|
86
|
+
.replace('{ownerId}', '.*')
|
|
87
|
+
.replace('{namespaceName}', '.*')
|
|
88
|
+
.replace('{userId}', '.*')
|
|
89
|
+
.replace('{rateName}', '(.*)')
|
|
90
|
+
.replace('{progressName}', '.*'));
|
|
91
|
+
if (match) {
|
|
92
|
+
return match[1];
|
|
93
|
+
}
|
|
94
|
+
return null;
|
|
95
|
+
};
|
|
96
|
+
Progress.getProgressName = function (grn) {
|
|
97
|
+
var match = grn.match(grnFormat
|
|
98
|
+
.replace('{region}', '.*')
|
|
99
|
+
.replace('{ownerId}', '.*')
|
|
100
|
+
.replace('{namespaceName}', '.*')
|
|
101
|
+
.replace('{userId}', '.*')
|
|
102
|
+
.replace('{rateName}', '.*')
|
|
103
|
+
.replace('{progressName}', '(.*)'));
|
|
104
|
+
if (match) {
|
|
105
|
+
return match[1];
|
|
106
|
+
}
|
|
107
|
+
return null;
|
|
108
|
+
};
|
|
30
109
|
Progress.isValid = function (grn) {
|
|
110
|
+
if (this.getRegion(grn) == null || this.getRegion(grn) === '') {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
if (this.getOwnerId(grn) == null || this.getOwnerId(grn) === '') {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
if (this.getNamespaceName(grn) == null || this.getNamespaceName(grn) === '') {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
if (this.getUserId(grn) == null || this.getUserId(grn) === '') {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
if (this.getRateName(grn) == null || this.getRateName(grn) === '') {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
if (this.getProgressName(grn) == null || this.getProgressName(grn) === '') {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
31
128
|
return true;
|
|
32
129
|
};
|
|
33
|
-
Progress.createGrn = function () {
|
|
34
|
-
return grnFormat
|
|
130
|
+
Progress.createGrn = function (region, ownerId, namespaceName, userId, rateName, progressName) {
|
|
131
|
+
return grnFormat
|
|
132
|
+
.replace('{region}', region !== null && region !== void 0 ? region : '')
|
|
133
|
+
.replace('{ownerId}', ownerId !== null && ownerId !== void 0 ? ownerId : '')
|
|
134
|
+
.replace('{namespaceName}', namespaceName !== null && namespaceName !== void 0 ? namespaceName : '')
|
|
135
|
+
.replace('{userId}', userId !== null && userId !== void 0 ? userId : '')
|
|
136
|
+
.replace('{rateName}', rateName !== null && rateName !== void 0 ? rateName : '')
|
|
137
|
+
.replace('{progressName}', progressName !== null && progressName !== void 0 ? progressName : '');
|
|
35
138
|
};
|
|
36
139
|
Progress.prototype.getProgressId = function () {
|
|
37
140
|
return this.progressId;
|
|
@@ -66,6 +169,17 @@ var Progress = /** @class */ (function () {
|
|
|
66
169
|
this.rateName = rateName;
|
|
67
170
|
return this;
|
|
68
171
|
};
|
|
172
|
+
Progress.prototype.getName = function () {
|
|
173
|
+
return this.name;
|
|
174
|
+
};
|
|
175
|
+
Progress.prototype.setName = function (name) {
|
|
176
|
+
this.name = name;
|
|
177
|
+
return this;
|
|
178
|
+
};
|
|
179
|
+
Progress.prototype.withName = function (name) {
|
|
180
|
+
this.name = name;
|
|
181
|
+
return this;
|
|
182
|
+
};
|
|
69
183
|
Progress.prototype.getPropertyId = function () {
|
|
70
184
|
return this.propertyId;
|
|
71
185
|
};
|
|
@@ -129,6 +243,7 @@ var Progress = /** @class */ (function () {
|
|
|
129
243
|
.withProgressId(data["progressId"])
|
|
130
244
|
.withUserId(data["userId"])
|
|
131
245
|
.withRateName(data["rateName"])
|
|
246
|
+
.withName(data["name"])
|
|
132
247
|
.withPropertyId(data["propertyId"])
|
|
133
248
|
.withExperienceValue(data["experienceValue"])
|
|
134
249
|
.withRate(data["rate"])
|
|
@@ -140,6 +255,7 @@ var Progress = /** @class */ (function () {
|
|
|
140
255
|
"progressId": this.getProgressId(),
|
|
141
256
|
"userId": this.getUserId(),
|
|
142
257
|
"rateName": this.getRateName(),
|
|
258
|
+
"name": this.getName(),
|
|
143
259
|
"propertyId": this.getPropertyId(),
|
|
144
260
|
"experienceValue": this.getExperienceValue(),
|
|
145
261
|
"rate": this.getRate(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Progress.js","sourceRoot":"","sources":["Progress.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAGH,IAAM,SAAS,GAAW,
|
|
1
|
+
{"version":3,"file":"Progress.js","sourceRoot":"","sources":["Progress.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAGH,IAAM,SAAS,GAAW,0GAA0G,CAAC;AAErI;IAAA;QACY,eAAU,GAAgB,IAAI,CAAC;QAC/B,WAAM,GAAgB,IAAI,CAAC;QAC3B,aAAQ,GAAgB,IAAI,CAAC;QAC7B,SAAI,GAAgB,IAAI,CAAC;QACzB,eAAU,GAAgB,IAAI,CAAC;QAC/B,oBAAe,GAAgB,IAAI,CAAC;QACpC,SAAI,GAAgB,IAAI,CAAC;QACzB,cAAS,GAAgB,IAAI,CAAC;QAC9B,cAAS,GAAgB,IAAI,CAAC;IA8R1C,CAAC;IA5RiB,kBAAS,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,YAAY,EAAE,IAAI,CAAC;aAC3B,OAAO,CAAC,gBAAgB,EAAE,IAAI,CAAC,CACnC,CAAC;QACF,IAAI,KAAK,EAAE;YACP,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;SACnB;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAEa,mBAAU,GAAxB,UAAyB,GAAW;QAChC,IAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,SAAS;aAC5B,OAAO,CAAC,UAAU,EAAE,IAAI,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C,OAAO,EAAE;YACtB,WAAW,EAAE,IAAI,CAAC,YAAY,EAAE;YAChC,WAAW,EAAE,IAAI,CAAC,YAAY,EAAE;SACnC,CAAC;IACN,CAAC;IACL,eAAC;AAAD,CAAC,AAvSD,IAuSC"}
|
|
@@ -15,25 +15,146 @@ permissions and limitations under the License.
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import IModel from '../../core/interface/IModel';
|
|
18
|
-
const grnFormat: string = "";
|
|
18
|
+
const grnFormat: string = "grn:gs2:{region}:{ownerId}:enhance:{namespaceName}:user:{userId}:rate:{rateName}:progress:{progressName}";
|
|
19
19
|
|
|
20
20
|
export default class Progress implements IModel {
|
|
21
21
|
private progressId: string|null = null;
|
|
22
22
|
private userId: string|null = null;
|
|
23
23
|
private rateName: string|null = null;
|
|
24
|
+
private name: string|null = null;
|
|
24
25
|
private propertyId: string|null = null;
|
|
25
26
|
private experienceValue: number|null = null;
|
|
26
27
|
private rate: number|null = null;
|
|
27
28
|
private createdAt: number|null = null;
|
|
28
29
|
private updatedAt: number|null = null;
|
|
29
30
|
|
|
31
|
+
public static getRegion(grn: string): string|null {
|
|
32
|
+
const match = grn.match(grnFormat
|
|
33
|
+
.replace('{region}', '(.*)')
|
|
34
|
+
.replace('{ownerId}', '.*')
|
|
35
|
+
.replace('{namespaceName}', '.*')
|
|
36
|
+
.replace('{userId}', '.*')
|
|
37
|
+
.replace('{rateName}', '.*')
|
|
38
|
+
.replace('{progressName}', '.*')
|
|
39
|
+
);
|
|
40
|
+
if (match) {
|
|
41
|
+
return match[1];
|
|
42
|
+
}
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public static getOwnerId(grn: string): string|null {
|
|
47
|
+
const match = grn.match(grnFormat
|
|
48
|
+
.replace('{region}', '.*')
|
|
49
|
+
.replace('{ownerId}', '(.*)')
|
|
50
|
+
.replace('{namespaceName}', '.*')
|
|
51
|
+
.replace('{userId}', '.*')
|
|
52
|
+
.replace('{rateName}', '.*')
|
|
53
|
+
.replace('{progressName}', '.*')
|
|
54
|
+
);
|
|
55
|
+
if (match) {
|
|
56
|
+
return match[1];
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public static getNamespaceName(grn: string): string|null {
|
|
62
|
+
const match = grn.match(grnFormat
|
|
63
|
+
.replace('{region}', '.*')
|
|
64
|
+
.replace('{ownerId}', '.*')
|
|
65
|
+
.replace('{namespaceName}', '(.*)')
|
|
66
|
+
.replace('{userId}', '.*')
|
|
67
|
+
.replace('{rateName}', '.*')
|
|
68
|
+
.replace('{progressName}', '.*')
|
|
69
|
+
);
|
|
70
|
+
if (match) {
|
|
71
|
+
return match[1];
|
|
72
|
+
}
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
public static getUserId(grn: string): string|null {
|
|
77
|
+
const match = grn.match(grnFormat
|
|
78
|
+
.replace('{region}', '.*')
|
|
79
|
+
.replace('{ownerId}', '.*')
|
|
80
|
+
.replace('{namespaceName}', '.*')
|
|
81
|
+
.replace('{userId}', '(.*)')
|
|
82
|
+
.replace('{rateName}', '.*')
|
|
83
|
+
.replace('{progressName}', '.*')
|
|
84
|
+
);
|
|
85
|
+
if (match) {
|
|
86
|
+
return match[1];
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
public static getRateName(grn: string): string|null {
|
|
92
|
+
const match = grn.match(grnFormat
|
|
93
|
+
.replace('{region}', '.*')
|
|
94
|
+
.replace('{ownerId}', '.*')
|
|
95
|
+
.replace('{namespaceName}', '.*')
|
|
96
|
+
.replace('{userId}', '.*')
|
|
97
|
+
.replace('{rateName}', '(.*)')
|
|
98
|
+
.replace('{progressName}', '.*')
|
|
99
|
+
);
|
|
100
|
+
if (match) {
|
|
101
|
+
return match[1];
|
|
102
|
+
}
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
public static getProgressName(grn: string): string|null {
|
|
107
|
+
const match = grn.match(grnFormat
|
|
108
|
+
.replace('{region}', '.*')
|
|
109
|
+
.replace('{ownerId}', '.*')
|
|
110
|
+
.replace('{namespaceName}', '.*')
|
|
111
|
+
.replace('{userId}', '.*')
|
|
112
|
+
.replace('{rateName}', '.*')
|
|
113
|
+
.replace('{progressName}', '(.*)')
|
|
114
|
+
);
|
|
115
|
+
if (match) {
|
|
116
|
+
return match[1];
|
|
117
|
+
}
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
|
|
30
121
|
public static isValid(grn: string): boolean {
|
|
122
|
+
if (this.getRegion(grn) == null || this.getRegion(grn) === '') {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
if (this.getOwnerId(grn) == null || this.getOwnerId(grn) === '') {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
if (this.getNamespaceName(grn) == null || this.getNamespaceName(grn) === '') {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
if (this.getUserId(grn) == null || this.getUserId(grn) === '') {
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
if (this.getRateName(grn) == null || this.getRateName(grn) === '') {
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
if (this.getProgressName(grn) == null || this.getProgressName(grn) === '') {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
31
140
|
return true;
|
|
32
141
|
}
|
|
33
142
|
|
|
34
143
|
public static createGrn(
|
|
144
|
+
region: string|null,
|
|
145
|
+
ownerId: string|null,
|
|
146
|
+
namespaceName: string|null,
|
|
147
|
+
userId: string|null,
|
|
148
|
+
rateName: string|null,
|
|
149
|
+
progressName: string|null,
|
|
35
150
|
): string|null {
|
|
36
|
-
return grnFormat
|
|
151
|
+
return grnFormat
|
|
152
|
+
.replace('{region}', region ?? '')
|
|
153
|
+
.replace('{ownerId}', ownerId ?? '')
|
|
154
|
+
.replace('{namespaceName}', namespaceName ?? '')
|
|
155
|
+
.replace('{userId}', userId ?? '')
|
|
156
|
+
.replace('{rateName}', rateName ?? '')
|
|
157
|
+
.replace('{progressName}', progressName ?? '');
|
|
37
158
|
}
|
|
38
159
|
|
|
39
160
|
public getProgressId(): string|null {
|
|
@@ -78,6 +199,20 @@ export default class Progress implements IModel {
|
|
|
78
199
|
return this;
|
|
79
200
|
}
|
|
80
201
|
|
|
202
|
+
public getName(): string|null {
|
|
203
|
+
return this.name;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
public setName(name: string|null) {
|
|
207
|
+
this.name = name;
|
|
208
|
+
return this;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
public withName(name: string|null): this {
|
|
212
|
+
this.name = name;
|
|
213
|
+
return this;
|
|
214
|
+
}
|
|
215
|
+
|
|
81
216
|
public getPropertyId(): string|null {
|
|
82
217
|
return this.propertyId;
|
|
83
218
|
}
|
|
@@ -156,6 +291,7 @@ export default class Progress implements IModel {
|
|
|
156
291
|
.withProgressId(data["progressId"])
|
|
157
292
|
.withUserId(data["userId"])
|
|
158
293
|
.withRateName(data["rateName"])
|
|
294
|
+
.withName(data["name"])
|
|
159
295
|
.withPropertyId(data["propertyId"])
|
|
160
296
|
.withExperienceValue(data["experienceValue"])
|
|
161
297
|
.withRate(data["rate"])
|
|
@@ -168,6 +304,7 @@ export default class Progress implements IModel {
|
|
|
168
304
|
"progressId": this.getProgressId(),
|
|
169
305
|
"userId": this.getUserId(),
|
|
170
306
|
"rateName": this.getRateName(),
|
|
307
|
+
"name": this.getName(),
|
|
171
308
|
"propertyId": this.getPropertyId(),
|
|
172
309
|
"experienceValue": this.getExperienceValue(),
|
|
173
310
|
"rate": this.getRate(),
|
|
@@ -4,6 +4,8 @@ export default class DeleteProgressByUserIdRequest implements IRequest {
|
|
|
4
4
|
private contextStack;
|
|
5
5
|
private namespaceName;
|
|
6
6
|
private userId;
|
|
7
|
+
private rateName;
|
|
8
|
+
private progressName;
|
|
7
9
|
private duplicationAvoider;
|
|
8
10
|
getRequestId(): string | null;
|
|
9
11
|
setRequestId(requestId: string | null): this;
|
|
@@ -17,6 +19,12 @@ export default class DeleteProgressByUserIdRequest implements IRequest {
|
|
|
17
19
|
getUserId(): string | null;
|
|
18
20
|
setUserId(userId: string | null): this;
|
|
19
21
|
withUserId(userId: string | null): this;
|
|
22
|
+
getRateName(): string | null;
|
|
23
|
+
setRateName(rateName: string | null): this;
|
|
24
|
+
withRateName(rateName: string | null): this;
|
|
25
|
+
getProgressName(): string | null;
|
|
26
|
+
setProgressName(progressName: string | null): this;
|
|
27
|
+
withProgressName(progressName: string | null): this;
|
|
20
28
|
getDuplicationAvoider(): string | null;
|
|
21
29
|
setDuplicationAvoider(duplicationAvoider: string | null): this;
|
|
22
30
|
withDuplicationAvoider(duplicationAvoider: string | null): this;
|
|
@@ -21,6 +21,8 @@ var DeleteProgressByUserIdRequest = /** @class */ (function () {
|
|
|
21
21
|
this.contextStack = null;
|
|
22
22
|
this.namespaceName = null;
|
|
23
23
|
this.userId = null;
|
|
24
|
+
this.rateName = null;
|
|
25
|
+
this.progressName = null;
|
|
24
26
|
this.duplicationAvoider = null;
|
|
25
27
|
}
|
|
26
28
|
DeleteProgressByUserIdRequest.prototype.getRequestId = function () {
|
|
@@ -67,6 +69,28 @@ var DeleteProgressByUserIdRequest = /** @class */ (function () {
|
|
|
67
69
|
this.userId = userId;
|
|
68
70
|
return this;
|
|
69
71
|
};
|
|
72
|
+
DeleteProgressByUserIdRequest.prototype.getRateName = function () {
|
|
73
|
+
return this.rateName;
|
|
74
|
+
};
|
|
75
|
+
DeleteProgressByUserIdRequest.prototype.setRateName = function (rateName) {
|
|
76
|
+
this.rateName = rateName;
|
|
77
|
+
return this;
|
|
78
|
+
};
|
|
79
|
+
DeleteProgressByUserIdRequest.prototype.withRateName = function (rateName) {
|
|
80
|
+
this.rateName = rateName;
|
|
81
|
+
return this;
|
|
82
|
+
};
|
|
83
|
+
DeleteProgressByUserIdRequest.prototype.getProgressName = function () {
|
|
84
|
+
return this.progressName;
|
|
85
|
+
};
|
|
86
|
+
DeleteProgressByUserIdRequest.prototype.setProgressName = function (progressName) {
|
|
87
|
+
this.progressName = progressName;
|
|
88
|
+
return this;
|
|
89
|
+
};
|
|
90
|
+
DeleteProgressByUserIdRequest.prototype.withProgressName = function (progressName) {
|
|
91
|
+
this.progressName = progressName;
|
|
92
|
+
return this;
|
|
93
|
+
};
|
|
70
94
|
DeleteProgressByUserIdRequest.prototype.getDuplicationAvoider = function () {
|
|
71
95
|
return this.duplicationAvoider;
|
|
72
96
|
};
|
|
@@ -81,12 +105,16 @@ var DeleteProgressByUserIdRequest = /** @class */ (function () {
|
|
|
81
105
|
DeleteProgressByUserIdRequest.fromDict = function (data) {
|
|
82
106
|
return new DeleteProgressByUserIdRequest()
|
|
83
107
|
.withNamespaceName(data["namespaceName"])
|
|
84
|
-
.withUserId(data["userId"])
|
|
108
|
+
.withUserId(data["userId"])
|
|
109
|
+
.withRateName(data["rateName"])
|
|
110
|
+
.withProgressName(data["progressName"]);
|
|
85
111
|
};
|
|
86
112
|
DeleteProgressByUserIdRequest.prototype.toDict = function () {
|
|
87
113
|
return {
|
|
88
114
|
"namespaceName": this.getNamespaceName(),
|
|
89
115
|
"userId": this.getUserId(),
|
|
116
|
+
"rateName": this.getRateName(),
|
|
117
|
+
"progressName": this.getProgressName(),
|
|
90
118
|
};
|
|
91
119
|
};
|
|
92
120
|
return DeleteProgressByUserIdRequest;
|