gs2 1.3.1 → 1.3.4
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/core/model.js +26 -8
- package/core/model.js.map +1 -1
- package/experience/model/Status.d.ts +4 -0
- package/experience/model/Status.js +14 -0
- package/experience/model/Status.js.map +1 -1
- package/gateway/index.js +2 -0
- package/gateway/index.js.map +1 -1
- package/identifier/result/LoginResult.js +8 -6
- package/identifier/result/LoginResult.js.map +1 -1
- package/package.json +1 -1
- package/project/request/CreateAccountRequest.d.ts +4 -0
- package/project/request/CreateAccountRequest.js +15 -1
- package/project/request/CreateAccountRequest.js.map +1 -1
- package/project/request/ForgetRequest.d.ts +4 -0
- package/project/request/ForgetRequest.js +15 -1
- package/project/request/ForgetRequest.js.map +1 -1
- package/project/rest.js +4 -2
- package/project/rest.js.map +1 -1
- package/ranking/model/Score.js +1 -1
- package/ranking/model/Score.js.map +1 -1
- package/ranking/model/Subscribe.js +1 -1
- package/ranking/model/Subscribe.js.map +1 -1
- package/showcase/model/DisplayItem.d.ts +2 -0
- package/showcase/model/DisplayItem.js +7 -0
- package/showcase/model/DisplayItem.js.map +1 -1
- package/src/core/model.ts +16 -4
- package/src/experience/model/Status.ts +17 -0
- package/src/gateway/index.ts +2 -0
- package/src/identifier/result/LoginResult.ts +8 -6
- package/src/project/request/CreateAccountRequest.ts +18 -1
- package/src/project/request/ForgetRequest.ts +18 -1
- package/src/project/rest.ts +2 -0
- package/src/ranking/model/Score.ts +1 -1
- package/src/ranking/model/Subscribe.ts +1 -1
- package/src/showcase/model/DisplayItem.ts +10 -0
- package/src/watch/model/BillingActivity.ts +130 -0
- package/src/watch/model/Chart.ts +10 -0
- package/src/watch/model/Cumulative.ts +82 -0
- package/src/watch/model/StatsEvent.ts +176 -0
- package/src/watch/model/index.ts +2 -0
- package/watch/model/BillingActivity.d.ts +8 -0
- package/watch/model/BillingActivity.js +109 -0
- package/watch/model/BillingActivity.js.map +1 -1
- package/watch/model/Chart.d.ts +2 -0
- package/watch/model/Chart.js +7 -0
- package/watch/model/Chart.js.map +1 -1
- package/watch/model/Cumulative.d.ts +6 -0
- package/watch/model/Cumulative.js +67 -0
- package/watch/model/Cumulative.js.map +1 -1
- package/watch/model/StatsEvent.d.ts +41 -0
- package/watch/model/StatsEvent.js +152 -0
- package/watch/model/StatsEvent.js.map +1 -0
- package/watch/model/index.d.ts +2 -1
- package/watch/model/index.js +3 -1
- package/watch/model/index.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Subscribe.js","sourceRoot":"","sources":["../../src/ranking/model/Subscribe.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAGH,IAAM,SAAS,GAAW,
|
|
1
|
+
{"version":3,"file":"Subscribe.js","sourceRoot":"","sources":["../../src/ranking/model/Subscribe.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAGH,IAAM,SAAS,GAAW,oGAAoG,CAAC;AAE/H;IAAA;QACY,gBAAW,GAAgB,IAAI,CAAC;QAChC,iBAAY,GAAgB,IAAI,CAAC;QACjC,WAAM,GAAgB,IAAI,CAAC;QAC3B,kBAAa,GAAkB,IAAI,CAAC;QACpC,sBAAiB,GAAkB,IAAI,CAAC;QACxC,cAAS,GAAgB,IAAI,CAAC;IAqO1C,CAAC;IAnOiB,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,gBAAgB,EAAE,IAAI,CAAC,CACnC,CAAC;QACF,IAAI,KAAK,EAAE;YACP,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;SACnB;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E,IAAI,CAAC,YAAY,EAAE;SACnC,CAAC;IACN,CAAC;IACL,gBAAC;AAAD,CAAC,AA3OD,IA2OC"}
|
|
@@ -7,6 +7,8 @@ export default class DisplayItem implements IModel {
|
|
|
7
7
|
private salesItem;
|
|
8
8
|
private salesItemGroup;
|
|
9
9
|
private salesPeriodEventId;
|
|
10
|
+
static isValid(grn: string): boolean;
|
|
11
|
+
static createGrn(): string | null;
|
|
10
12
|
getDisplayItemId(): string | null;
|
|
11
13
|
setDisplayItemId(displayItemId: string | null): this;
|
|
12
14
|
withDisplayItemId(displayItemId: string | null): this;
|
|
@@ -18,6 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
var tslib_1 = require("tslib");
|
|
19
19
|
var SalesItem_1 = (0, tslib_1.__importDefault)(require("./SalesItem"));
|
|
20
20
|
var SalesItemGroup_1 = (0, tslib_1.__importDefault)(require("./SalesItemGroup"));
|
|
21
|
+
var grnFormat = "";
|
|
21
22
|
var DisplayItem = /** @class */ (function () {
|
|
22
23
|
function DisplayItem() {
|
|
23
24
|
this.displayItemId = null;
|
|
@@ -26,6 +27,12 @@ var DisplayItem = /** @class */ (function () {
|
|
|
26
27
|
this.salesItemGroup = null;
|
|
27
28
|
this.salesPeriodEventId = null;
|
|
28
29
|
}
|
|
30
|
+
DisplayItem.isValid = function (grn) {
|
|
31
|
+
return true;
|
|
32
|
+
};
|
|
33
|
+
DisplayItem.createGrn = function () {
|
|
34
|
+
return grnFormat;
|
|
35
|
+
};
|
|
29
36
|
DisplayItem.prototype.getDisplayItemId = function () {
|
|
30
37
|
return this.displayItemId;
|
|
31
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisplayItem.js","sourceRoot":"","sources":["../../src/showcase/model/DisplayItem.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAKH,uEAAoC;AACpC,iFAA8C;
|
|
1
|
+
{"version":3,"file":"DisplayItem.js","sourceRoot":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AM,GAAb;;QACI,OAAO;YACH,eAAe,EAAE,IAAI,CAAC,gBAAgB,EAAE;YACxC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE;YACtB,WAAW,EAAE,MAAA,IAAI,CAAC,YAAY,EAAE,0CAAE,MAAM,EAAE;YAC1C,gBAAgB,EAAE,MAAA,IAAI,CAAC,iBAAiB,EAAE,0CAAE,MAAM,EAAE;YACpD,oBAAoB,EAAE,IAAI,CAAC,qBAAqB,EAAE;SACrD,CAAC;IACN,CAAC;IACL,kBAAC;AAAD,CAAC,AA3GD,IA2GC"}
|
package/src/core/model.ts
CHANGED
|
@@ -19,7 +19,7 @@ import IModel from './interface/IModel';
|
|
|
19
19
|
import axios from 'axios';
|
|
20
20
|
import waitUntil from "async-wait-until";
|
|
21
21
|
import { v4 as uuid } from 'uuid';
|
|
22
|
-
const
|
|
22
|
+
const NodeWebSocket = require('ws');
|
|
23
23
|
|
|
24
24
|
export class BasicGs2Credential implements IGs2Credential {
|
|
25
25
|
|
|
@@ -135,7 +135,11 @@ export class Gs2WebSocketSession {
|
|
|
135
135
|
this.projectToken = (this.credential as ProjectTokenGs2Credential).projectToken;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
|
|
138
|
+
if (typeof window === 'undefined'){
|
|
139
|
+
this.client = new NodeWebSocket(Gs2Constant.WS_ENDPOINT_HOST.replace('{region}', this.region));
|
|
140
|
+
} else {
|
|
141
|
+
this.client = new WebSocket(Gs2Constant.WS_ENDPOINT_HOST.replace('{region}', this.region));
|
|
142
|
+
}
|
|
139
143
|
this.client!.onopen = (event: Event): any => {
|
|
140
144
|
for (let i=0; i<this.onOpenHandlers.length; i++) {
|
|
141
145
|
this.onOpenHandlers[i]();
|
|
@@ -161,7 +165,11 @@ export class Gs2WebSocketSession {
|
|
|
161
165
|
this.onCloseHandlers[i]();
|
|
162
166
|
}
|
|
163
167
|
};
|
|
164
|
-
|
|
168
|
+
if (typeof window === 'undefined'){
|
|
169
|
+
await waitUntil(() => this.client == null || this.client.readyState == NodeWebSocket.CLOSED || this.client.readyState == NodeWebSocket.OPEN);
|
|
170
|
+
} else {
|
|
171
|
+
await waitUntil(() => this.client == null || this.client.readyState == WebSocket.CLOSED || this.client.readyState == WebSocket.OPEN);
|
|
172
|
+
}
|
|
165
173
|
}
|
|
166
174
|
|
|
167
175
|
public async send(
|
|
@@ -219,7 +227,11 @@ export class Gs2WebSocketSession {
|
|
|
219
227
|
public async disconnect(): Promise<any> {
|
|
220
228
|
if (this.client != null) {
|
|
221
229
|
this.client.close();
|
|
222
|
-
|
|
230
|
+
if (typeof window === 'undefined') {
|
|
231
|
+
await waitUntil(() => this.client == null || this.client.readyState == NodeWebSocket.CLOSED);
|
|
232
|
+
} else {
|
|
233
|
+
await waitUntil(() => this.client == null || this.client.readyState == WebSocket.CLOSED);
|
|
234
|
+
}
|
|
223
235
|
this.client = null;
|
|
224
236
|
}
|
|
225
237
|
this.projectToken = null;
|
|
@@ -25,6 +25,7 @@ export default class Status implements IModel {
|
|
|
25
25
|
private experienceValue: number|null = null;
|
|
26
26
|
private rankValue: number|null = null;
|
|
27
27
|
private rankCapValue: number|null = null;
|
|
28
|
+
private nextRankUpExperienceValue: number|null = null;
|
|
28
29
|
private createdAt: number|null = null;
|
|
29
30
|
private updatedAt: number|null = null;
|
|
30
31
|
|
|
@@ -255,6 +256,20 @@ export default class Status implements IModel {
|
|
|
255
256
|
return this;
|
|
256
257
|
}
|
|
257
258
|
|
|
259
|
+
public getNextRankUpExperienceValue(): number|null {
|
|
260
|
+
return this.nextRankUpExperienceValue;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
public setNextRankUpExperienceValue(nextRankUpExperienceValue: number|null) {
|
|
264
|
+
this.nextRankUpExperienceValue = nextRankUpExperienceValue;
|
|
265
|
+
return this;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
public withNextRankUpExperienceValue(nextRankUpExperienceValue: number|null): this {
|
|
269
|
+
this.nextRankUpExperienceValue = nextRankUpExperienceValue;
|
|
270
|
+
return this;
|
|
271
|
+
}
|
|
272
|
+
|
|
258
273
|
public getCreatedAt(): number|null {
|
|
259
274
|
return this.createdAt;
|
|
260
275
|
}
|
|
@@ -295,6 +310,7 @@ export default class Status implements IModel {
|
|
|
295
310
|
.withExperienceValue(data["experienceValue"])
|
|
296
311
|
.withRankValue(data["rankValue"])
|
|
297
312
|
.withRankCapValue(data["rankCapValue"])
|
|
313
|
+
.withNextRankUpExperienceValue(data["nextRankUpExperienceValue"])
|
|
298
314
|
.withCreatedAt(data["createdAt"])
|
|
299
315
|
.withUpdatedAt(data["updatedAt"]);
|
|
300
316
|
}
|
|
@@ -308,6 +324,7 @@ export default class Status implements IModel {
|
|
|
308
324
|
"experienceValue": this.getExperienceValue(),
|
|
309
325
|
"rankValue": this.getRankValue(),
|
|
310
326
|
"rankCapValue": this.getRankCapValue(),
|
|
327
|
+
"nextRankUpExperienceValue": this.getNextRankUpExperienceValue(),
|
|
311
328
|
"createdAt": this.getCreatedAt(),
|
|
312
329
|
"updatedAt": this.getUpdatedAt(),
|
|
313
330
|
};
|
package/src/gateway/index.ts
CHANGED
|
@@ -12,6 +12,8 @@ or in the "license" file accompanying this file. This file is distributed
|
|
|
12
12
|
on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
|
13
13
|
express or implied. See the License for the specific language governing
|
|
14
14
|
permissions and limitations under the License.
|
|
15
|
+
|
|
16
|
+
deny overwrite
|
|
15
17
|
*/
|
|
16
18
|
|
|
17
19
|
import * as model from './model';
|
|
@@ -12,6 +12,8 @@ or in the "license" file accompanying this file. This file is distributed
|
|
|
12
12
|
on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
|
13
13
|
express or implied. See the License for the specific language governing
|
|
14
14
|
permissions and limitations under the License.
|
|
15
|
+
|
|
16
|
+
deny overwrite
|
|
15
17
|
*/
|
|
16
18
|
|
|
17
19
|
import IResult from '../../core/interface/IResult';
|
|
@@ -67,16 +69,16 @@ export default class LoginResult implements IResult {
|
|
|
67
69
|
|
|
68
70
|
public static fromDict(data: {[key: string]: any}): LoginResult {
|
|
69
71
|
return new LoginResult()
|
|
70
|
-
.withAccessToken(data["
|
|
71
|
-
.withTokenType(data["
|
|
72
|
-
.withExpiresIn(data["
|
|
72
|
+
.withAccessToken(data["access_token"])
|
|
73
|
+
.withTokenType(data["token_type"])
|
|
74
|
+
.withExpiresIn(data["expires_in"]);
|
|
73
75
|
}
|
|
74
76
|
|
|
75
77
|
public toDict(): {[key: string]: any} {
|
|
76
78
|
return {
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
79
|
+
"access_token": this.getAccessToken(),
|
|
80
|
+
"token_type": this.getTokenType(),
|
|
81
|
+
"expires_in": this.getExpiresIn(),
|
|
80
82
|
};
|
|
81
83
|
}
|
|
82
84
|
}
|
|
@@ -26,6 +26,7 @@ export default class CreateAccountRequest implements IRequest {
|
|
|
26
26
|
private fullName: string|null = null;
|
|
27
27
|
private companyName: string|null = null;
|
|
28
28
|
private password: string|null = null;
|
|
29
|
+
private lang: string|null = null;
|
|
29
30
|
|
|
30
31
|
public getRequestId(): string|null {
|
|
31
32
|
return this.requestId;
|
|
@@ -111,12 +112,27 @@ export default class CreateAccountRequest implements IRequest {
|
|
|
111
112
|
return this;
|
|
112
113
|
}
|
|
113
114
|
|
|
115
|
+
public getLang(): string|null {
|
|
116
|
+
return this.lang;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
public setLang(lang: string|null) {
|
|
120
|
+
this.lang = lang;
|
|
121
|
+
return this;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
public withLang(lang: string|null): this {
|
|
125
|
+
this.lang = lang;
|
|
126
|
+
return this;
|
|
127
|
+
}
|
|
128
|
+
|
|
114
129
|
public static fromDict(data: {[key: string]: any}): CreateAccountRequest {
|
|
115
130
|
return new CreateAccountRequest()
|
|
116
131
|
.withEmail(data["email"])
|
|
117
132
|
.withFullName(data["fullName"])
|
|
118
133
|
.withCompanyName(data["companyName"])
|
|
119
|
-
.withPassword(data["password"])
|
|
134
|
+
.withPassword(data["password"])
|
|
135
|
+
.withLang(data["lang"]);
|
|
120
136
|
}
|
|
121
137
|
|
|
122
138
|
public toDict(): {[key: string]: any} {
|
|
@@ -125,6 +141,7 @@ export default class CreateAccountRequest implements IRequest {
|
|
|
125
141
|
"fullName": this.getFullName(),
|
|
126
142
|
"companyName": this.getCompanyName(),
|
|
127
143
|
"password": this.getPassword(),
|
|
144
|
+
"lang": this.getLang(),
|
|
128
145
|
};
|
|
129
146
|
}
|
|
130
147
|
}
|
|
@@ -23,6 +23,7 @@ export default class ForgetRequest implements IRequest {
|
|
|
23
23
|
private requestId: string|null = null;
|
|
24
24
|
private contextStack: string|null = null;
|
|
25
25
|
private email: string|null = null;
|
|
26
|
+
private lang: string|null = null;
|
|
26
27
|
|
|
27
28
|
public getRequestId(): string|null {
|
|
28
29
|
return this.requestId;
|
|
@@ -66,14 +67,30 @@ export default class ForgetRequest implements IRequest {
|
|
|
66
67
|
return this;
|
|
67
68
|
}
|
|
68
69
|
|
|
70
|
+
public getLang(): string|null {
|
|
71
|
+
return this.lang;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public setLang(lang: string|null) {
|
|
75
|
+
this.lang = lang;
|
|
76
|
+
return this;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
public withLang(lang: string|null): this {
|
|
80
|
+
this.lang = lang;
|
|
81
|
+
return this;
|
|
82
|
+
}
|
|
83
|
+
|
|
69
84
|
public static fromDict(data: {[key: string]: any}): ForgetRequest {
|
|
70
85
|
return new ForgetRequest()
|
|
71
|
-
.withEmail(data["email"])
|
|
86
|
+
.withEmail(data["email"])
|
|
87
|
+
.withLang(data["lang"]);
|
|
72
88
|
}
|
|
73
89
|
|
|
74
90
|
public toDict(): {[key: string]: any} {
|
|
75
91
|
return {
|
|
76
92
|
"email": this.getEmail(),
|
|
93
|
+
"lang": this.getLang(),
|
|
77
94
|
};
|
|
78
95
|
}
|
|
79
96
|
}
|
package/src/project/rest.ts
CHANGED
|
@@ -42,6 +42,7 @@ export default class Gs2ProjectRestClient extends AbstractGs2RestClient {
|
|
|
42
42
|
'fullName': request.getFullName() ?? null,
|
|
43
43
|
'companyName': request.getCompanyName() ?? null,
|
|
44
44
|
'password': request.getPassword() ?? null,
|
|
45
|
+
'lang': request.getLang() ?? null,
|
|
45
46
|
};
|
|
46
47
|
return axios.post(
|
|
47
48
|
url,
|
|
@@ -163,6 +164,7 @@ export default class Gs2ProjectRestClient extends AbstractGs2RestClient {
|
|
|
163
164
|
const body: {[key: string]: any} = {
|
|
164
165
|
'contextStack': request.getContextStack() ?? null,
|
|
165
166
|
'email': request.getEmail() ?? null,
|
|
167
|
+
'lang': request.getLang() ?? null,
|
|
166
168
|
};
|
|
167
169
|
return axios.post(
|
|
168
170
|
url,
|
|
@@ -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}:ranking:{namespaceName}:user:{userId}:
|
|
18
|
+
const grnFormat: string = "grn:gs2:{region}:{ownerId}:ranking:{namespaceName}:user:{userId}:category:{categoryName}:score:{scorerUserId}:{uniqueId}";
|
|
19
19
|
|
|
20
20
|
export default class Score implements IModel {
|
|
21
21
|
private scoreId: string|null = null;
|
|
@@ -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}:ranking:{namespaceName}:user:{userId}:subscribe:{categoryName}";
|
|
18
|
+
const grnFormat: string = "grn:gs2:{region}:{ownerId}:ranking:{namespaceName}:user:{userId}:subscribe:category:{categoryName}";
|
|
19
19
|
|
|
20
20
|
export default class Subscribe implements IModel {
|
|
21
21
|
private subscribeId: string|null = null;
|
|
@@ -19,6 +19,7 @@ import ConsumeAction from './ConsumeAction';
|
|
|
19
19
|
import AcquireAction from './AcquireAction';
|
|
20
20
|
import SalesItem from './SalesItem';
|
|
21
21
|
import SalesItemGroup from './SalesItemGroup';
|
|
22
|
+
const grnFormat: string = "";
|
|
22
23
|
|
|
23
24
|
export default class DisplayItem implements IModel {
|
|
24
25
|
private displayItemId: string|null = null;
|
|
@@ -27,6 +28,15 @@ export default class DisplayItem implements IModel {
|
|
|
27
28
|
private salesItemGroup: SalesItemGroup|null = null;
|
|
28
29
|
private salesPeriodEventId: string|null = null;
|
|
29
30
|
|
|
31
|
+
public static isValid(grn: string): boolean {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
public static createGrn(
|
|
36
|
+
): string|null {
|
|
37
|
+
return grnFormat;
|
|
38
|
+
}
|
|
39
|
+
|
|
30
40
|
public getDisplayItemId(): string|null {
|
|
31
41
|
return this.displayItemId;
|
|
32
42
|
}
|
|
@@ -15,6 +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}:watch:{year}:{month}:{service}:{activityType}";
|
|
18
19
|
|
|
19
20
|
export default class BillingActivity implements IModel {
|
|
20
21
|
private billingActivityId: string|null = null;
|
|
@@ -24,6 +25,135 @@ export default class BillingActivity implements IModel {
|
|
|
24
25
|
private activityType: string|null = null;
|
|
25
26
|
private value: number|null = null;
|
|
26
27
|
|
|
28
|
+
public static getRegion(grn: string): string|null {
|
|
29
|
+
const match = grn.match(grnFormat
|
|
30
|
+
.replace('{region}', '(.*)')
|
|
31
|
+
.replace('{ownerId}', '.*')
|
|
32
|
+
.replace('{year}', '.*')
|
|
33
|
+
.replace('{month}', '.*')
|
|
34
|
+
.replace('{service}', '.*')
|
|
35
|
+
.replace('{activityType}', '.*')
|
|
36
|
+
);
|
|
37
|
+
if (match) {
|
|
38
|
+
return match[1];
|
|
39
|
+
}
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public static getOwnerId(grn: string): string|null {
|
|
44
|
+
const match = grn.match(grnFormat
|
|
45
|
+
.replace('{region}', '.*')
|
|
46
|
+
.replace('{ownerId}', '(.*)')
|
|
47
|
+
.replace('{year}', '.*')
|
|
48
|
+
.replace('{month}', '.*')
|
|
49
|
+
.replace('{service}', '.*')
|
|
50
|
+
.replace('{activityType}', '.*')
|
|
51
|
+
);
|
|
52
|
+
if (match) {
|
|
53
|
+
return match[1];
|
|
54
|
+
}
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public static getYear(grn: string): string|null {
|
|
59
|
+
const match = grn.match(grnFormat
|
|
60
|
+
.replace('{region}', '.*')
|
|
61
|
+
.replace('{ownerId}', '.*')
|
|
62
|
+
.replace('{year}', '(.*)')
|
|
63
|
+
.replace('{month}', '.*')
|
|
64
|
+
.replace('{service}', '.*')
|
|
65
|
+
.replace('{activityType}', '.*')
|
|
66
|
+
);
|
|
67
|
+
if (match) {
|
|
68
|
+
return match[1];
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
public static getMonth(grn: string): string|null {
|
|
74
|
+
const match = grn.match(grnFormat
|
|
75
|
+
.replace('{region}', '.*')
|
|
76
|
+
.replace('{ownerId}', '.*')
|
|
77
|
+
.replace('{year}', '.*')
|
|
78
|
+
.replace('{month}', '(.*)')
|
|
79
|
+
.replace('{service}', '.*')
|
|
80
|
+
.replace('{activityType}', '.*')
|
|
81
|
+
);
|
|
82
|
+
if (match) {
|
|
83
|
+
return match[1];
|
|
84
|
+
}
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
public static getService(grn: string): string|null {
|
|
89
|
+
const match = grn.match(grnFormat
|
|
90
|
+
.replace('{region}', '.*')
|
|
91
|
+
.replace('{ownerId}', '.*')
|
|
92
|
+
.replace('{year}', '.*')
|
|
93
|
+
.replace('{month}', '.*')
|
|
94
|
+
.replace('{service}', '(.*)')
|
|
95
|
+
.replace('{activityType}', '.*')
|
|
96
|
+
);
|
|
97
|
+
if (match) {
|
|
98
|
+
return match[1];
|
|
99
|
+
}
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
public static getActivityType(grn: string): string|null {
|
|
104
|
+
const match = grn.match(grnFormat
|
|
105
|
+
.replace('{region}', '.*')
|
|
106
|
+
.replace('{ownerId}', '.*')
|
|
107
|
+
.replace('{year}', '.*')
|
|
108
|
+
.replace('{month}', '.*')
|
|
109
|
+
.replace('{service}', '.*')
|
|
110
|
+
.replace('{activityType}', '(.*)')
|
|
111
|
+
);
|
|
112
|
+
if (match) {
|
|
113
|
+
return match[1];
|
|
114
|
+
}
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
public static isValid(grn: string): boolean {
|
|
119
|
+
if (this.getRegion(grn) == null || this.getRegion(grn) === '') {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
if (this.getOwnerId(grn) == null || this.getOwnerId(grn) === '') {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
if (this.getYear(grn) == null || this.getYear(grn) === '') {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
if (this.getMonth(grn) == null || this.getMonth(grn) === '') {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
if (this.getService(grn) == null || this.getService(grn) === '') {
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
if (this.getActivityType(grn) == null || this.getActivityType(grn) === '') {
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
return true;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
public static createGrn(
|
|
141
|
+
region: string|null,
|
|
142
|
+
ownerId: string|null,
|
|
143
|
+
year: string|null,
|
|
144
|
+
month: string|null,
|
|
145
|
+
service: string|null,
|
|
146
|
+
activityType: string|null,
|
|
147
|
+
): string|null {
|
|
148
|
+
return grnFormat
|
|
149
|
+
.replace('{region}', region ?? '')
|
|
150
|
+
.replace('{ownerId}', ownerId ?? '')
|
|
151
|
+
.replace('{year}', year ?? '')
|
|
152
|
+
.replace('{month}', month ?? '')
|
|
153
|
+
.replace('{service}', service ?? '')
|
|
154
|
+
.replace('{activityType}', activityType ?? '');
|
|
155
|
+
}
|
|
156
|
+
|
|
27
157
|
public getBillingActivityId(): string|null {
|
|
28
158
|
return this.billingActivityId;
|
|
29
159
|
}
|
package/src/watch/model/Chart.ts
CHANGED
|
@@ -15,12 +15,22 @@ permissions and limitations under the License.
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import IModel from '../../core/interface/IModel';
|
|
18
|
+
const grnFormat: string = "";
|
|
18
19
|
|
|
19
20
|
export default class Chart implements IModel {
|
|
20
21
|
private chartId: string|null = null;
|
|
21
22
|
private embedId: string|null = null;
|
|
22
23
|
private html: string|null = null;
|
|
23
24
|
|
|
25
|
+
public static isValid(grn: string): boolean {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public static createGrn(
|
|
30
|
+
): string|null {
|
|
31
|
+
return grnFormat;
|
|
32
|
+
}
|
|
33
|
+
|
|
24
34
|
public getChartId(): string|null {
|
|
25
35
|
return this.chartId;
|
|
26
36
|
}
|
|
@@ -15,6 +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}:watch:{resourceGrn}:{name}";
|
|
18
19
|
|
|
19
20
|
export default class Cumulative implements IModel {
|
|
20
21
|
private cumulativeId: string|null = null;
|
|
@@ -23,6 +24,87 @@ export default class Cumulative implements IModel {
|
|
|
23
24
|
private value: number|null = null;
|
|
24
25
|
private updatedAt: number|null = null;
|
|
25
26
|
|
|
27
|
+
public static getRegion(grn: string): string|null {
|
|
28
|
+
const match = grn.match(grnFormat
|
|
29
|
+
.replace('{region}', '(.*)')
|
|
30
|
+
.replace('{ownerId}', '.*')
|
|
31
|
+
.replace('{resourceGrn}', '.*')
|
|
32
|
+
.replace('{name}', '.*')
|
|
33
|
+
);
|
|
34
|
+
if (match) {
|
|
35
|
+
return match[1];
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
public static getOwnerId(grn: string): string|null {
|
|
41
|
+
const match = grn.match(grnFormat
|
|
42
|
+
.replace('{region}', '.*')
|
|
43
|
+
.replace('{ownerId}', '(.*)')
|
|
44
|
+
.replace('{resourceGrn}', '.*')
|
|
45
|
+
.replace('{name}', '.*')
|
|
46
|
+
);
|
|
47
|
+
if (match) {
|
|
48
|
+
return match[1];
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public static getResourceGrn(grn: string): string|null {
|
|
54
|
+
const match = grn.match(grnFormat
|
|
55
|
+
.replace('{region}', '.*')
|
|
56
|
+
.replace('{ownerId}', '.*')
|
|
57
|
+
.replace('{resourceGrn}', '(.*)')
|
|
58
|
+
.replace('{name}', '.*')
|
|
59
|
+
);
|
|
60
|
+
if (match) {
|
|
61
|
+
return match[1];
|
|
62
|
+
}
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
public static getName(grn: string): string|null {
|
|
67
|
+
const match = grn.match(grnFormat
|
|
68
|
+
.replace('{region}', '.*')
|
|
69
|
+
.replace('{ownerId}', '.*')
|
|
70
|
+
.replace('{resourceGrn}', '.*')
|
|
71
|
+
.replace('{name}', '(.*)')
|
|
72
|
+
);
|
|
73
|
+
if (match) {
|
|
74
|
+
return match[1];
|
|
75
|
+
}
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
public static isValid(grn: string): boolean {
|
|
80
|
+
if (this.getRegion(grn) == null || this.getRegion(grn) === '') {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
if (this.getOwnerId(grn) == null || this.getOwnerId(grn) === '') {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
if (this.getResourceGrn(grn) == null || this.getResourceGrn(grn) === '') {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
if (this.getName(grn) == null || this.getName(grn) === '') {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
public static createGrn(
|
|
96
|
+
region: string|null,
|
|
97
|
+
ownerId: string|null,
|
|
98
|
+
resourceGrn: string|null,
|
|
99
|
+
name: string|null,
|
|
100
|
+
): string|null {
|
|
101
|
+
return grnFormat
|
|
102
|
+
.replace('{region}', region ?? '')
|
|
103
|
+
.replace('{ownerId}', ownerId ?? '')
|
|
104
|
+
.replace('{resourceGrn}', resourceGrn ?? '')
|
|
105
|
+
.replace('{name}', name ?? '');
|
|
106
|
+
}
|
|
107
|
+
|
|
26
108
|
public getCumulativeId(): string|null {
|
|
27
109
|
return this.cumulativeId;
|
|
28
110
|
}
|