gs2 1.3.138 → 1.3.140
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/idle/index.d.ts +5 -0
- package/idle/index.js +28 -0
- package/idle/index.js.map +1 -0
- package/idle/index.ts +27 -0
- package/idle/model/AcquireAction.d.ts +17 -0
- package/idle/model/AcquireAction.js +62 -0
- package/idle/model/AcquireAction.js.map +1 -0
- package/idle/model/AcquireAction.ts +60 -0
- package/idle/model/AcquireActionList.d.ts +14 -0
- package/idle/model/AcquireActionList.js +56 -0
- package/idle/model/AcquireActionList.js.map +1 -0
- package/idle/model/AcquireActionList.ts +55 -0
- package/idle/model/CategoryModel.d.ts +48 -0
- package/idle/model/CategoryModel.js +221 -0
- package/idle/model/CategoryModel.js.map +1 -0
- package/idle/model/CategoryModel.ts +236 -0
- package/idle/model/CategoryModelMaster.d.ts +60 -0
- package/idle/model/CategoryModelMaster.js +263 -0
- package/idle/model/CategoryModelMaster.js.map +1 -0
- package/idle/model/CategoryModelMaster.ts +278 -0
- package/idle/model/Config.d.ts +17 -0
- package/idle/model/Config.js +62 -0
- package/idle/model/Config.js.map +1 -0
- package/idle/model/Config.ts +60 -0
- package/idle/model/CurrentCategoryMaster.d.ts +22 -0
- package/idle/model/CurrentCategoryMaster.js +111 -0
- package/idle/model/CurrentCategoryMaster.js.map +1 -0
- package/idle/model/CurrentCategoryMaster.ts +121 -0
- package/idle/model/GitHubCheckoutSetting.d.ts +37 -0
- package/idle/model/GitHubCheckoutSetting.js +132 -0
- package/idle/model/GitHubCheckoutSetting.js.map +1 -0
- package/idle/model/GitHubCheckoutSetting.ts +130 -0
- package/idle/model/LogSetting.d.ts +13 -0
- package/idle/model/LogSetting.js +48 -0
- package/idle/model/LogSetting.js.map +1 -0
- package/idle/model/LogSetting.ts +46 -0
- package/idle/model/Namespace.d.ts +49 -0
- package/idle/model/Namespace.js +200 -0
- package/idle/model/Namespace.js.map +1 -0
- package/idle/model/Namespace.ts +208 -0
- package/idle/model/ScriptSetting.d.ts +25 -0
- package/idle/model/ScriptSetting.js +90 -0
- package/idle/model/ScriptSetting.js.map +1 -0
- package/idle/model/ScriptSetting.ts +88 -0
- package/idle/model/Status.d.ts +48 -0
- package/idle/model/Status.js +233 -0
- package/idle/model/Status.js.map +1 -0
- package/idle/model/Status.ts +249 -0
- package/idle/model/TransactionSetting.d.ts +25 -0
- package/idle/model/TransactionSetting.js +90 -0
- package/idle/model/TransactionSetting.js.map +1 -0
- package/idle/model/TransactionSetting.ts +88 -0
- package/idle/model/index.d.ts +13 -0
- package/idle/model/index.js +44 -0
- package/idle/model/index.js.map +1 -0
- package/idle/model/index.ts +42 -0
- package/idle/request/CreateCategoryModelMasterRequest.d.ts +54 -0
- package/idle/request/CreateCategoryModelMasterRequest.js +189 -0
- package/idle/request/CreateCategoryModelMasterRequest.js.map +1 -0
- package/idle/request/CreateCategoryModelMasterRequest.ts +196 -0
- package/idle/request/CreateNamespaceRequest.d.ts +38 -0
- package/idle/request/CreateNamespaceRequest.js +128 -0
- package/idle/request/CreateNamespaceRequest.js.map +1 -0
- package/idle/request/CreateNamespaceRequest.ts +132 -0
- package/idle/request/DeleteCategoryModelMasterRequest.d.ts +25 -0
- package/idle/request/DeleteCategoryModelMasterRequest.js +83 -0
- package/idle/request/DeleteCategoryModelMasterRequest.js.map +1 -0
- package/idle/request/DeleteCategoryModelMasterRequest.ts +90 -0
- package/idle/request/DeleteNamespaceRequest.d.ts +21 -0
- package/idle/request/DeleteNamespaceRequest.js +69 -0
- package/idle/request/DeleteNamespaceRequest.js.map +1 -0
- package/idle/request/DeleteNamespaceRequest.ts +76 -0
- package/idle/request/DescribeCategoryModelMastersRequest.d.ts +29 -0
- package/idle/request/DescribeCategoryModelMastersRequest.js +97 -0
- package/idle/request/DescribeCategoryModelMastersRequest.js.map +1 -0
- package/idle/request/DescribeCategoryModelMastersRequest.ts +104 -0
- package/idle/request/DescribeCategoryModelsRequest.d.ts +21 -0
- package/idle/request/DescribeCategoryModelsRequest.js +69 -0
- package/idle/request/DescribeCategoryModelsRequest.js.map +1 -0
- package/idle/request/DescribeCategoryModelsRequest.ts +76 -0
- package/idle/request/DescribeNamespacesRequest.d.ts +25 -0
- package/idle/request/DescribeNamespacesRequest.js +83 -0
- package/idle/request/DescribeNamespacesRequest.js.map +1 -0
- package/idle/request/DescribeNamespacesRequest.ts +90 -0
- package/idle/request/DescribeStatusesByUserIdRequest.d.ts +37 -0
- package/idle/request/DescribeStatusesByUserIdRequest.js +125 -0
- package/idle/request/DescribeStatusesByUserIdRequest.js.map +1 -0
- package/idle/request/DescribeStatusesByUserIdRequest.ts +132 -0
- package/idle/request/DescribeStatusesRequest.d.ts +37 -0
- package/idle/request/DescribeStatusesRequest.js +125 -0
- package/idle/request/DescribeStatusesRequest.js.map +1 -0
- package/idle/request/DescribeStatusesRequest.ts +132 -0
- package/idle/request/ExportMasterRequest.d.ts +21 -0
- package/idle/request/ExportMasterRequest.js +69 -0
- package/idle/request/ExportMasterRequest.js.map +1 -0
- package/idle/request/ExportMasterRequest.ts +76 -0
- package/idle/request/GetCategoryModelMasterRequest.d.ts +25 -0
- package/idle/request/GetCategoryModelMasterRequest.js +83 -0
- package/idle/request/GetCategoryModelMasterRequest.js.map +1 -0
- package/idle/request/GetCategoryModelMasterRequest.ts +90 -0
- package/idle/request/GetCategoryModelRequest.d.ts +25 -0
- package/idle/request/GetCategoryModelRequest.js +83 -0
- package/idle/request/GetCategoryModelRequest.js.map +1 -0
- package/idle/request/GetCategoryModelRequest.ts +90 -0
- package/idle/request/GetCurrentIdleMasterRequest.d.ts +21 -0
- package/idle/request/GetCurrentIdleMasterRequest.js +69 -0
- package/idle/request/GetCurrentIdleMasterRequest.js.map +1 -0
- package/idle/request/GetCurrentIdleMasterRequest.ts +76 -0
- package/idle/request/GetNamespaceRequest.d.ts +21 -0
- package/idle/request/GetNamespaceRequest.js +69 -0
- package/idle/request/GetNamespaceRequest.js.map +1 -0
- package/idle/request/GetNamespaceRequest.ts +76 -0
- package/idle/request/GetNamespaceStatusRequest.d.ts +21 -0
- package/idle/request/GetNamespaceStatusRequest.js +69 -0
- package/idle/request/GetNamespaceStatusRequest.js.map +1 -0
- package/idle/request/GetNamespaceStatusRequest.ts +76 -0
- package/idle/request/GetStatusByUserIdRequest.d.ts +29 -0
- package/idle/request/GetStatusByUserIdRequest.js +97 -0
- package/idle/request/GetStatusByUserIdRequest.js.map +1 -0
- package/idle/request/GetStatusByUserIdRequest.ts +104 -0
- package/idle/request/GetStatusRequest.d.ts +29 -0
- package/idle/request/GetStatusRequest.js +97 -0
- package/idle/request/GetStatusRequest.js.map +1 -0
- package/idle/request/GetStatusRequest.ts +104 -0
- package/idle/request/IncreaseMaximumIdleMinutesByStampSheetRequest.d.ts +25 -0
- package/idle/request/IncreaseMaximumIdleMinutesByStampSheetRequest.js +83 -0
- package/idle/request/IncreaseMaximumIdleMinutesByStampSheetRequest.js.map +1 -0
- package/idle/request/IncreaseMaximumIdleMinutesByStampSheetRequest.ts +90 -0
- package/idle/request/IncreaseMaximumIdleMinutesByUserIdRequest.d.ts +37 -0
- package/idle/request/IncreaseMaximumIdleMinutesByUserIdRequest.js +123 -0
- package/idle/request/IncreaseMaximumIdleMinutesByUserIdRequest.js.map +1 -0
- package/idle/request/IncreaseMaximumIdleMinutesByUserIdRequest.ts +133 -0
- package/idle/request/PredictionByUserIdRequest.d.ts +33 -0
- package/idle/request/PredictionByUserIdRequest.js +109 -0
- package/idle/request/PredictionByUserIdRequest.js.map +1 -0
- package/idle/request/PredictionByUserIdRequest.ts +119 -0
- package/idle/request/PredictionRequest.d.ts +33 -0
- package/idle/request/PredictionRequest.js +109 -0
- package/idle/request/PredictionRequest.js.map +1 -0
- package/idle/request/PredictionRequest.ts +119 -0
- package/idle/request/ReceiveByUserIdRequest.d.ts +38 -0
- package/idle/request/ReceiveByUserIdRequest.js +131 -0
- package/idle/request/ReceiveByUserIdRequest.js.map +1 -0
- package/idle/request/ReceiveByUserIdRequest.ts +141 -0
- package/idle/request/ReceiveRequest.d.ts +38 -0
- package/idle/request/ReceiveRequest.js +131 -0
- package/idle/request/ReceiveRequest.js.map +1 -0
- package/idle/request/ReceiveRequest.ts +141 -0
- package/idle/request/UpdateCategoryModelMasterRequest.d.ts +54 -0
- package/idle/request/UpdateCategoryModelMasterRequest.js +189 -0
- package/idle/request/UpdateCategoryModelMasterRequest.js.map +1 -0
- package/idle/request/UpdateCategoryModelMasterRequest.ts +196 -0
- package/idle/request/UpdateCurrentIdleMasterFromGitHubRequest.d.ts +26 -0
- package/idle/request/UpdateCurrentIdleMasterFromGitHubRequest.js +86 -0
- package/idle/request/UpdateCurrentIdleMasterFromGitHubRequest.js.map +1 -0
- package/idle/request/UpdateCurrentIdleMasterFromGitHubRequest.ts +90 -0
- package/idle/request/UpdateCurrentIdleMasterRequest.d.ts +25 -0
- package/idle/request/UpdateCurrentIdleMasterRequest.js +83 -0
- package/idle/request/UpdateCurrentIdleMasterRequest.js.map +1 -0
- package/idle/request/UpdateCurrentIdleMasterRequest.ts +90 -0
- package/idle/request/UpdateNamespaceRequest.d.ts +38 -0
- package/idle/request/UpdateNamespaceRequest.js +128 -0
- package/idle/request/UpdateNamespaceRequest.js.map +1 -0
- package/idle/request/UpdateNamespaceRequest.ts +132 -0
- package/idle/request/index.d.ts +28 -0
- package/idle/request/index.js +74 -0
- package/idle/request/index.js.map +1 -0
- package/idle/request/index.ts +72 -0
- package/idle/rest.d.ts +34 -0
- package/idle/rest.js +754 -0
- package/idle/rest.js.map +1 -0
- package/idle/rest.ts +860 -0
- package/idle/result/CreateCategoryModelMasterResult.d.ts +14 -0
- package/idle/result/CreateCategoryModelMasterResult.js +48 -0
- package/idle/result/CreateCategoryModelMasterResult.js.map +1 -0
- package/idle/result/CreateCategoryModelMasterResult.ts +48 -0
- package/idle/result/CreateNamespaceResult.d.ts +14 -0
- package/idle/result/CreateNamespaceResult.js +48 -0
- package/idle/result/CreateNamespaceResult.js.map +1 -0
- package/idle/result/CreateNamespaceResult.ts +48 -0
- package/idle/result/DeleteCategoryModelMasterResult.d.ts +14 -0
- package/idle/result/DeleteCategoryModelMasterResult.js +48 -0
- package/idle/result/DeleteCategoryModelMasterResult.js.map +1 -0
- package/idle/result/DeleteCategoryModelMasterResult.ts +48 -0
- package/idle/result/DeleteNamespaceResult.d.ts +14 -0
- package/idle/result/DeleteNamespaceResult.js +48 -0
- package/idle/result/DeleteNamespaceResult.js.map +1 -0
- package/idle/result/DeleteNamespaceResult.ts +48 -0
- package/idle/result/DescribeCategoryModelMastersResult.d.ts +18 -0
- package/idle/result/DescribeCategoryModelMastersResult.js +67 -0
- package/idle/result/DescribeCategoryModelMastersResult.js.map +1 -0
- package/idle/result/DescribeCategoryModelMastersResult.ts +73 -0
- package/idle/result/DescribeCategoryModelsResult.d.ts +14 -0
- package/idle/result/DescribeCategoryModelsResult.js +53 -0
- package/idle/result/DescribeCategoryModelsResult.js.map +1 -0
- package/idle/result/DescribeCategoryModelsResult.ts +56 -0
- package/idle/result/DescribeNamespacesResult.d.ts +18 -0
- package/idle/result/DescribeNamespacesResult.js +67 -0
- package/idle/result/DescribeNamespacesResult.js.map +1 -0
- package/idle/result/DescribeNamespacesResult.ts +73 -0
- package/idle/result/DescribeStatusesByUserIdResult.d.ts +18 -0
- package/idle/result/DescribeStatusesByUserIdResult.js +67 -0
- package/idle/result/DescribeStatusesByUserIdResult.js.map +1 -0
- package/idle/result/DescribeStatusesByUserIdResult.ts +73 -0
- package/idle/result/DescribeStatusesResult.d.ts +18 -0
- package/idle/result/DescribeStatusesResult.js +67 -0
- package/idle/result/DescribeStatusesResult.js.map +1 -0
- package/idle/result/DescribeStatusesResult.ts +73 -0
- package/idle/result/ExportMasterResult.d.ts +14 -0
- package/idle/result/ExportMasterResult.js +48 -0
- package/idle/result/ExportMasterResult.js.map +1 -0
- package/idle/result/ExportMasterResult.ts +48 -0
- package/idle/result/GetCategoryModelMasterResult.d.ts +14 -0
- package/idle/result/GetCategoryModelMasterResult.js +48 -0
- package/idle/result/GetCategoryModelMasterResult.js.map +1 -0
- package/idle/result/GetCategoryModelMasterResult.ts +48 -0
- package/idle/result/GetCategoryModelResult.d.ts +14 -0
- package/idle/result/GetCategoryModelResult.js +48 -0
- package/idle/result/GetCategoryModelResult.js.map +1 -0
- package/idle/result/GetCategoryModelResult.ts +48 -0
- package/idle/result/GetCurrentIdleMasterResult.d.ts +14 -0
- package/idle/result/GetCurrentIdleMasterResult.js +48 -0
- package/idle/result/GetCurrentIdleMasterResult.js.map +1 -0
- package/idle/result/GetCurrentIdleMasterResult.ts +48 -0
- package/idle/result/GetNamespaceResult.d.ts +14 -0
- package/idle/result/GetNamespaceResult.js +48 -0
- package/idle/result/GetNamespaceResult.js.map +1 -0
- package/idle/result/GetNamespaceResult.ts +48 -0
- package/idle/result/GetNamespaceStatusResult.d.ts +13 -0
- package/idle/result/GetNamespaceStatusResult.js +45 -0
- package/idle/result/GetNamespaceStatusResult.js.map +1 -0
- package/idle/result/GetNamespaceStatusResult.ts +48 -0
- package/idle/result/GetStatusByUserIdResult.d.ts +14 -0
- package/idle/result/GetStatusByUserIdResult.js +48 -0
- package/idle/result/GetStatusByUserIdResult.js.map +1 -0
- package/idle/result/GetStatusByUserIdResult.ts +48 -0
- package/idle/result/GetStatusResult.d.ts +14 -0
- package/idle/result/GetStatusResult.js +48 -0
- package/idle/result/GetStatusResult.js.map +1 -0
- package/idle/result/GetStatusResult.ts +48 -0
- package/idle/result/IncreaseMaximumIdleMinutesByStampSheetResult.d.ts +14 -0
- package/idle/result/IncreaseMaximumIdleMinutesByStampSheetResult.js +48 -0
- package/idle/result/IncreaseMaximumIdleMinutesByStampSheetResult.js.map +1 -0
- package/idle/result/IncreaseMaximumIdleMinutesByStampSheetResult.ts +48 -0
- package/idle/result/IncreaseMaximumIdleMinutesByUserIdResult.d.ts +14 -0
- package/idle/result/IncreaseMaximumIdleMinutesByUserIdResult.js +48 -0
- package/idle/result/IncreaseMaximumIdleMinutesByUserIdResult.js.map +1 -0
- package/idle/result/IncreaseMaximumIdleMinutesByUserIdResult.ts +48 -0
- package/idle/result/PredictionByUserIdResult.d.ts +18 -0
- package/idle/result/PredictionByUserIdResult.js +68 -0
- package/idle/result/PredictionByUserIdResult.js.map +1 -0
- package/idle/result/PredictionByUserIdResult.ts +73 -0
- package/idle/result/PredictionResult.d.ts +18 -0
- package/idle/result/PredictionResult.js +68 -0
- package/idle/result/PredictionResult.js.map +1 -0
- package/idle/result/PredictionResult.ts +73 -0
- package/idle/result/ReceiveByUserIdResult.d.ts +30 -0
- package/idle/result/ReceiveByUserIdResult.js +109 -0
- package/idle/result/ReceiveByUserIdResult.js.map +1 -0
- package/idle/result/ReceiveByUserIdResult.ts +124 -0
- package/idle/result/ReceiveResult.d.ts +30 -0
- package/idle/result/ReceiveResult.js +109 -0
- package/idle/result/ReceiveResult.js.map +1 -0
- package/idle/result/ReceiveResult.ts +124 -0
- package/idle/result/UpdateCategoryModelMasterResult.d.ts +14 -0
- package/idle/result/UpdateCategoryModelMasterResult.js +48 -0
- package/idle/result/UpdateCategoryModelMasterResult.js.map +1 -0
- package/idle/result/UpdateCategoryModelMasterResult.ts +48 -0
- package/idle/result/UpdateCurrentIdleMasterFromGitHubResult.d.ts +14 -0
- package/idle/result/UpdateCurrentIdleMasterFromGitHubResult.js +48 -0
- package/idle/result/UpdateCurrentIdleMasterFromGitHubResult.js.map +1 -0
- package/idle/result/UpdateCurrentIdleMasterFromGitHubResult.ts +48 -0
- package/idle/result/UpdateCurrentIdleMasterResult.d.ts +14 -0
- package/idle/result/UpdateCurrentIdleMasterResult.js +48 -0
- package/idle/result/UpdateCurrentIdleMasterResult.js.map +1 -0
- package/idle/result/UpdateCurrentIdleMasterResult.ts +48 -0
- package/idle/result/UpdateNamespaceResult.d.ts +14 -0
- package/idle/result/UpdateNamespaceResult.js +48 -0
- package/idle/result/UpdateNamespaceResult.js.map +1 -0
- package/idle/result/UpdateNamespaceResult.ts +48 -0
- package/idle/result/index.d.ts +28 -0
- package/idle/result/index.js +74 -0
- package/idle/result/index.js.map +1 -0
- package/idle/result/index.ts +72 -0
- package/index.d.ts +2 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/index.ts +2 -0
- package/package.json +1 -1
- package/schedule/result/GetEventByUserIdResult.d.ts +8 -4
- package/schedule/result/GetEventByUserIdResult.js +28 -14
- package/schedule/result/GetEventByUserIdResult.js.map +1 -1
- package/schedule/result/GetEventByUserIdResult.ts +32 -15
- package/schedule/result/GetEventResult.d.ts +8 -4
- package/schedule/result/GetEventResult.js +28 -14
- package/schedule/result/GetEventResult.js.map +1 -1
- package/schedule/result/GetEventResult.ts +32 -15
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2016 Game Server Services, Inc. or its affiliates. All Rights
|
|
3
|
+
Reserved.
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License").
|
|
6
|
+
You may not use this file except in compliance with the License.
|
|
7
|
+
A copy of the License is located at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
or in the "license" file accompanying this file. This file is distributed
|
|
12
|
+
on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
|
13
|
+
express or implied. See the License for the specific language governing
|
|
14
|
+
permissions and limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import IModel from '../../core/interface/IModel';
|
|
18
|
+
import AcquireAction from './AcquireAction';
|
|
19
|
+
import AcquireActionList from './AcquireActionList';
|
|
20
|
+
const grnFormat: string = "grn:gs2:{region}:{ownerId}:idle:{namespaceName}:model:{categoryName}";
|
|
21
|
+
|
|
22
|
+
export default class CategoryModelMaster implements IModel {
|
|
23
|
+
private categoryModelId: string|null = null;
|
|
24
|
+
private name: string|null = null;
|
|
25
|
+
private description: string|null = null;
|
|
26
|
+
private metadata: string|null = null;
|
|
27
|
+
private rewardIntervalMinutes: number|null = null;
|
|
28
|
+
private defaultMaximumIdleMinutes: number|null = null;
|
|
29
|
+
private acquireActions: AcquireActionList[]|null = null;
|
|
30
|
+
private idlePeriodScheduleId: string|null = null;
|
|
31
|
+
private receivePeriodScheduleId: string|null = null;
|
|
32
|
+
private createdAt: number|null = null;
|
|
33
|
+
private updatedAt: number|null = null;
|
|
34
|
+
|
|
35
|
+
public static getRegion(grn: string): string|null {
|
|
36
|
+
const match = grn.match(grnFormat
|
|
37
|
+
.replace('{region}', '(.*)')
|
|
38
|
+
.replace('{ownerId}', '.*')
|
|
39
|
+
.replace('{namespaceName}', '.*')
|
|
40
|
+
.replace('{categoryName}', '.*')
|
|
41
|
+
);
|
|
42
|
+
if (match) {
|
|
43
|
+
return match[1];
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public static getOwnerId(grn: string): string|null {
|
|
49
|
+
const match = grn.match(grnFormat
|
|
50
|
+
.replace('{region}', '.*')
|
|
51
|
+
.replace('{ownerId}', '(.*)')
|
|
52
|
+
.replace('{namespaceName}', '.*')
|
|
53
|
+
.replace('{categoryName}', '.*')
|
|
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('{categoryName}', '.*')
|
|
67
|
+
);
|
|
68
|
+
if (match) {
|
|
69
|
+
return match[1];
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public static getCategoryName(grn: string): string|null {
|
|
75
|
+
const match = grn.match(grnFormat
|
|
76
|
+
.replace('{region}', '.*')
|
|
77
|
+
.replace('{ownerId}', '.*')
|
|
78
|
+
.replace('{namespaceName}', '.*')
|
|
79
|
+
.replace('{categoryName}', '(.*)')
|
|
80
|
+
);
|
|
81
|
+
if (match) {
|
|
82
|
+
return match[1];
|
|
83
|
+
}
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
public static isValid(grn: string): boolean {
|
|
88
|
+
if (this.getRegion(grn) == null || this.getRegion(grn) === '') {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
if (this.getOwnerId(grn) == null || this.getOwnerId(grn) === '') {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
if (this.getNamespaceName(grn) == null || this.getNamespaceName(grn) === '') {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
if (this.getCategoryName(grn) == null || this.getCategoryName(grn) === '') {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
public static createGrn(
|
|
104
|
+
region: string|null,
|
|
105
|
+
ownerId: string|null,
|
|
106
|
+
namespaceName: string|null,
|
|
107
|
+
categoryName: string|null,
|
|
108
|
+
): string|null {
|
|
109
|
+
return grnFormat
|
|
110
|
+
.replace('{region}', region ?? '')
|
|
111
|
+
.replace('{ownerId}', ownerId ?? '')
|
|
112
|
+
.replace('{namespaceName}', namespaceName ?? '')
|
|
113
|
+
.replace('{categoryName}', categoryName ?? '');
|
|
114
|
+
}
|
|
115
|
+
public getCategoryModelId(): string|null {
|
|
116
|
+
return this.categoryModelId;
|
|
117
|
+
}
|
|
118
|
+
public setCategoryModelId(categoryModelId: string|null) {
|
|
119
|
+
this.categoryModelId = categoryModelId;
|
|
120
|
+
return this;
|
|
121
|
+
}
|
|
122
|
+
public withCategoryModelId(categoryModelId: string|null): this {
|
|
123
|
+
this.categoryModelId = categoryModelId;
|
|
124
|
+
return this;
|
|
125
|
+
}
|
|
126
|
+
public getName(): string|null {
|
|
127
|
+
return this.name;
|
|
128
|
+
}
|
|
129
|
+
public setName(name: string|null) {
|
|
130
|
+
this.name = name;
|
|
131
|
+
return this;
|
|
132
|
+
}
|
|
133
|
+
public withName(name: string|null): this {
|
|
134
|
+
this.name = name;
|
|
135
|
+
return this;
|
|
136
|
+
}
|
|
137
|
+
public getDescription(): string|null {
|
|
138
|
+
return this.description;
|
|
139
|
+
}
|
|
140
|
+
public setDescription(description: string|null) {
|
|
141
|
+
this.description = description;
|
|
142
|
+
return this;
|
|
143
|
+
}
|
|
144
|
+
public withDescription(description: string|null): this {
|
|
145
|
+
this.description = description;
|
|
146
|
+
return this;
|
|
147
|
+
}
|
|
148
|
+
public getMetadata(): string|null {
|
|
149
|
+
return this.metadata;
|
|
150
|
+
}
|
|
151
|
+
public setMetadata(metadata: string|null) {
|
|
152
|
+
this.metadata = metadata;
|
|
153
|
+
return this;
|
|
154
|
+
}
|
|
155
|
+
public withMetadata(metadata: string|null): this {
|
|
156
|
+
this.metadata = metadata;
|
|
157
|
+
return this;
|
|
158
|
+
}
|
|
159
|
+
public getRewardIntervalMinutes(): number|null {
|
|
160
|
+
return this.rewardIntervalMinutes;
|
|
161
|
+
}
|
|
162
|
+
public setRewardIntervalMinutes(rewardIntervalMinutes: number|null) {
|
|
163
|
+
this.rewardIntervalMinutes = rewardIntervalMinutes;
|
|
164
|
+
return this;
|
|
165
|
+
}
|
|
166
|
+
public withRewardIntervalMinutes(rewardIntervalMinutes: number|null): this {
|
|
167
|
+
this.rewardIntervalMinutes = rewardIntervalMinutes;
|
|
168
|
+
return this;
|
|
169
|
+
}
|
|
170
|
+
public getDefaultMaximumIdleMinutes(): number|null {
|
|
171
|
+
return this.defaultMaximumIdleMinutes;
|
|
172
|
+
}
|
|
173
|
+
public setDefaultMaximumIdleMinutes(defaultMaximumIdleMinutes: number|null) {
|
|
174
|
+
this.defaultMaximumIdleMinutes = defaultMaximumIdleMinutes;
|
|
175
|
+
return this;
|
|
176
|
+
}
|
|
177
|
+
public withDefaultMaximumIdleMinutes(defaultMaximumIdleMinutes: number|null): this {
|
|
178
|
+
this.defaultMaximumIdleMinutes = defaultMaximumIdleMinutes;
|
|
179
|
+
return this;
|
|
180
|
+
}
|
|
181
|
+
public getAcquireActions(): AcquireActionList[]|null {
|
|
182
|
+
return this.acquireActions;
|
|
183
|
+
}
|
|
184
|
+
public setAcquireActions(acquireActions: AcquireActionList[]|null) {
|
|
185
|
+
this.acquireActions = acquireActions;
|
|
186
|
+
return this;
|
|
187
|
+
}
|
|
188
|
+
public withAcquireActions(acquireActions: AcquireActionList[]|null): this {
|
|
189
|
+
this.acquireActions = acquireActions;
|
|
190
|
+
return this;
|
|
191
|
+
}
|
|
192
|
+
public getIdlePeriodScheduleId(): string|null {
|
|
193
|
+
return this.idlePeriodScheduleId;
|
|
194
|
+
}
|
|
195
|
+
public setIdlePeriodScheduleId(idlePeriodScheduleId: string|null) {
|
|
196
|
+
this.idlePeriodScheduleId = idlePeriodScheduleId;
|
|
197
|
+
return this;
|
|
198
|
+
}
|
|
199
|
+
public withIdlePeriodScheduleId(idlePeriodScheduleId: string|null): this {
|
|
200
|
+
this.idlePeriodScheduleId = idlePeriodScheduleId;
|
|
201
|
+
return this;
|
|
202
|
+
}
|
|
203
|
+
public getReceivePeriodScheduleId(): string|null {
|
|
204
|
+
return this.receivePeriodScheduleId;
|
|
205
|
+
}
|
|
206
|
+
public setReceivePeriodScheduleId(receivePeriodScheduleId: string|null) {
|
|
207
|
+
this.receivePeriodScheduleId = receivePeriodScheduleId;
|
|
208
|
+
return this;
|
|
209
|
+
}
|
|
210
|
+
public withReceivePeriodScheduleId(receivePeriodScheduleId: string|null): this {
|
|
211
|
+
this.receivePeriodScheduleId = receivePeriodScheduleId;
|
|
212
|
+
return this;
|
|
213
|
+
}
|
|
214
|
+
public getCreatedAt(): number|null {
|
|
215
|
+
return this.createdAt;
|
|
216
|
+
}
|
|
217
|
+
public setCreatedAt(createdAt: number|null) {
|
|
218
|
+
this.createdAt = createdAt;
|
|
219
|
+
return this;
|
|
220
|
+
}
|
|
221
|
+
public withCreatedAt(createdAt: number|null): this {
|
|
222
|
+
this.createdAt = createdAt;
|
|
223
|
+
return this;
|
|
224
|
+
}
|
|
225
|
+
public getUpdatedAt(): number|null {
|
|
226
|
+
return this.updatedAt;
|
|
227
|
+
}
|
|
228
|
+
public setUpdatedAt(updatedAt: number|null) {
|
|
229
|
+
this.updatedAt = updatedAt;
|
|
230
|
+
return this;
|
|
231
|
+
}
|
|
232
|
+
public withUpdatedAt(updatedAt: number|null): this {
|
|
233
|
+
this.updatedAt = updatedAt;
|
|
234
|
+
return this;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
public static fromDict(data: {[key: string]: any}): CategoryModelMaster|null {
|
|
238
|
+
if (data == undefined || data == null) {
|
|
239
|
+
return null;
|
|
240
|
+
}
|
|
241
|
+
return new CategoryModelMaster()
|
|
242
|
+
.withCategoryModelId(data["categoryModelId"])
|
|
243
|
+
.withName(data["name"])
|
|
244
|
+
.withDescription(data["description"])
|
|
245
|
+
.withMetadata(data["metadata"])
|
|
246
|
+
.withRewardIntervalMinutes(data["rewardIntervalMinutes"])
|
|
247
|
+
.withDefaultMaximumIdleMinutes(data["defaultMaximumIdleMinutes"])
|
|
248
|
+
.withAcquireActions(data.acquireActions ?
|
|
249
|
+
data.acquireActions.map((item: {[key: string]: any}) => {
|
|
250
|
+
return AcquireActionList.fromDict(item);
|
|
251
|
+
}
|
|
252
|
+
) : [])
|
|
253
|
+
.withIdlePeriodScheduleId(data["idlePeriodScheduleId"])
|
|
254
|
+
.withReceivePeriodScheduleId(data["receivePeriodScheduleId"])
|
|
255
|
+
.withCreatedAt(data["createdAt"])
|
|
256
|
+
.withUpdatedAt(data["updatedAt"]);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
public toDict(): {[key: string]: any} {
|
|
260
|
+
return {
|
|
261
|
+
"categoryModelId": this.getCategoryModelId(),
|
|
262
|
+
"name": this.getName(),
|
|
263
|
+
"description": this.getDescription(),
|
|
264
|
+
"metadata": this.getMetadata(),
|
|
265
|
+
"rewardIntervalMinutes": this.getRewardIntervalMinutes(),
|
|
266
|
+
"defaultMaximumIdleMinutes": this.getDefaultMaximumIdleMinutes(),
|
|
267
|
+
"acquireActions": this.getAcquireActions() ?
|
|
268
|
+
this.getAcquireActions()!.map((item: AcquireActionList) => {
|
|
269
|
+
return item.toDict();
|
|
270
|
+
}
|
|
271
|
+
) : [],
|
|
272
|
+
"idlePeriodScheduleId": this.getIdlePeriodScheduleId(),
|
|
273
|
+
"receivePeriodScheduleId": this.getReceivePeriodScheduleId(),
|
|
274
|
+
"createdAt": this.getCreatedAt(),
|
|
275
|
+
"updatedAt": this.getUpdatedAt(),
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import IModel from '../../core/interface/IModel';
|
|
2
|
+
export default class Config implements IModel {
|
|
3
|
+
private key;
|
|
4
|
+
private value;
|
|
5
|
+
getKey(): string | null;
|
|
6
|
+
setKey(key: string | null): this;
|
|
7
|
+
withKey(key: string | null): this;
|
|
8
|
+
getValue(): string | null;
|
|
9
|
+
setValue(value: string | null): this;
|
|
10
|
+
withValue(value: string | null): this;
|
|
11
|
+
static fromDict(data: {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}): Config | null;
|
|
14
|
+
toDict(): {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
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 Config = /** @class */ (function () {
|
|
19
|
+
function Config() {
|
|
20
|
+
this.key = null;
|
|
21
|
+
this.value = null;
|
|
22
|
+
}
|
|
23
|
+
Config.prototype.getKey = function () {
|
|
24
|
+
return this.key;
|
|
25
|
+
};
|
|
26
|
+
Config.prototype.setKey = function (key) {
|
|
27
|
+
this.key = key;
|
|
28
|
+
return this;
|
|
29
|
+
};
|
|
30
|
+
Config.prototype.withKey = function (key) {
|
|
31
|
+
this.key = key;
|
|
32
|
+
return this;
|
|
33
|
+
};
|
|
34
|
+
Config.prototype.getValue = function () {
|
|
35
|
+
return this.value;
|
|
36
|
+
};
|
|
37
|
+
Config.prototype.setValue = function (value) {
|
|
38
|
+
this.value = value;
|
|
39
|
+
return this;
|
|
40
|
+
};
|
|
41
|
+
Config.prototype.withValue = function (value) {
|
|
42
|
+
this.value = value;
|
|
43
|
+
return this;
|
|
44
|
+
};
|
|
45
|
+
Config.fromDict = function (data) {
|
|
46
|
+
if (data == undefined || data == null) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
return new Config()
|
|
50
|
+
.withKey(data["key"])
|
|
51
|
+
.withValue(data["value"]);
|
|
52
|
+
};
|
|
53
|
+
Config.prototype.toDict = function () {
|
|
54
|
+
return {
|
|
55
|
+
"key": this.getKey(),
|
|
56
|
+
"value": this.getValue(),
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
return Config;
|
|
60
|
+
}());
|
|
61
|
+
exports.default = Config;
|
|
62
|
+
//# sourceMappingURL=Config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Config.js","sourceRoot":"","sources":["Config.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAIH;IAAA;QACY,QAAG,GAAgB,IAAI,CAAC;QACxB,UAAK,GAAgB,IAAI,CAAC;IAuCtC,CAAC;IAtCU,uBAAM,GAAb;QACI,OAAO,IAAI,CAAC,GAAG,CAAC;IACpB,CAAC;IACM,uBAAM,GAAb,UAAc,GAAgB;QAC1B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,OAAO,IAAI,CAAC;IAChB,CAAC;IACM,wBAAO,GAAd,UAAe,GAAgB;QAC3B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,OAAO,IAAI,CAAC;IAChB,CAAC;IACM,yBAAQ,GAAf;QACI,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IACM,yBAAQ,GAAf,UAAgB,KAAkB;QAC9B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,OAAO,IAAI,CAAC;IAChB,CAAC;IACM,0BAAS,GAAhB,UAAiB,KAAkB;QAC/B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,OAAO,IAAI,CAAC;IAChB,CAAC;IAEa,eAAQ,GAAtB,UAAuB,IAA0B;QAC7C,IAAI,IAAI,IAAI,SAAS,IAAI,IAAI,IAAI,IAAI,EAAE;YACnC,OAAO,IAAI,CAAC;SACf;QACD,OAAO,IAAI,MAAM,EAAE;aACd,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aACpB,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAClC,CAAC;IAEM,uBAAM,GAAb;QACI,OAAO;YACH,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE;YACpB,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE;SAC3B,CAAC;IACN,CAAC;IACL,aAAC;AAAD,CAAC,AAzCD,IAyCC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2016 Game Server Services, Inc. or its affiliates. All Rights
|
|
3
|
+
Reserved.
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License").
|
|
6
|
+
You may not use this file except in compliance with the License.
|
|
7
|
+
A copy of the License is located at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
or in the "license" file accompanying this file. This file is distributed
|
|
12
|
+
on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
|
13
|
+
express or implied. See the License for the specific language governing
|
|
14
|
+
permissions and limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import IModel from '../../core/interface/IModel';
|
|
18
|
+
|
|
19
|
+
export default class Config implements IModel {
|
|
20
|
+
private key: string|null = null;
|
|
21
|
+
private value: string|null = null;
|
|
22
|
+
public getKey(): string|null {
|
|
23
|
+
return this.key;
|
|
24
|
+
}
|
|
25
|
+
public setKey(key: string|null) {
|
|
26
|
+
this.key = key;
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
29
|
+
public withKey(key: string|null): this {
|
|
30
|
+
this.key = key;
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
public getValue(): string|null {
|
|
34
|
+
return this.value;
|
|
35
|
+
}
|
|
36
|
+
public setValue(value: string|null) {
|
|
37
|
+
this.value = value;
|
|
38
|
+
return this;
|
|
39
|
+
}
|
|
40
|
+
public withValue(value: string|null): this {
|
|
41
|
+
this.value = value;
|
|
42
|
+
return this;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public static fromDict(data: {[key: string]: any}): Config|null {
|
|
46
|
+
if (data == undefined || data == null) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
return new Config()
|
|
50
|
+
.withKey(data["key"])
|
|
51
|
+
.withValue(data["value"]);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public toDict(): {[key: string]: any} {
|
|
55
|
+
return {
|
|
56
|
+
"key": this.getKey(),
|
|
57
|
+
"value": this.getValue(),
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import IModel from '../../core/interface/IModel';
|
|
2
|
+
export default class CurrentCategoryMaster implements IModel {
|
|
3
|
+
private namespaceId;
|
|
4
|
+
private settings;
|
|
5
|
+
static getRegion(grn: string): string | null;
|
|
6
|
+
static getOwnerId(grn: string): string | null;
|
|
7
|
+
static getNamespaceName(grn: string): string | null;
|
|
8
|
+
static isValid(grn: string): boolean;
|
|
9
|
+
static createGrn(region: string | null, ownerId: string | null, namespaceName: string | null): string | null;
|
|
10
|
+
getNamespaceId(): string | null;
|
|
11
|
+
setNamespaceId(namespaceId: string | null): this;
|
|
12
|
+
withNamespaceId(namespaceId: string | null): this;
|
|
13
|
+
getSettings(): string | null;
|
|
14
|
+
setSettings(settings: string | null): this;
|
|
15
|
+
withSettings(settings: string | null): this;
|
|
16
|
+
static fromDict(data: {
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
}): CurrentCategoryMaster | null;
|
|
19
|
+
toDict(): {
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
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 grnFormat = "grn:gs2:{region}:{ownerId}:idle:{namespaceName}";
|
|
19
|
+
var CurrentCategoryMaster = /** @class */ (function () {
|
|
20
|
+
function CurrentCategoryMaster() {
|
|
21
|
+
this.namespaceId = null;
|
|
22
|
+
this.settings = null;
|
|
23
|
+
}
|
|
24
|
+
CurrentCategoryMaster.getRegion = function (grn) {
|
|
25
|
+
var match = grn.match(grnFormat
|
|
26
|
+
.replace('{region}', '(.*)')
|
|
27
|
+
.replace('{ownerId}', '.*')
|
|
28
|
+
.replace('{namespaceName}', '.*'));
|
|
29
|
+
if (match) {
|
|
30
|
+
return match[1];
|
|
31
|
+
}
|
|
32
|
+
return null;
|
|
33
|
+
};
|
|
34
|
+
CurrentCategoryMaster.getOwnerId = function (grn) {
|
|
35
|
+
var match = grn.match(grnFormat
|
|
36
|
+
.replace('{region}', '.*')
|
|
37
|
+
.replace('{ownerId}', '(.*)')
|
|
38
|
+
.replace('{namespaceName}', '.*'));
|
|
39
|
+
if (match) {
|
|
40
|
+
return match[1];
|
|
41
|
+
}
|
|
42
|
+
return null;
|
|
43
|
+
};
|
|
44
|
+
CurrentCategoryMaster.getNamespaceName = function (grn) {
|
|
45
|
+
var match = grn.match(grnFormat
|
|
46
|
+
.replace('{region}', '.*')
|
|
47
|
+
.replace('{ownerId}', '.*')
|
|
48
|
+
.replace('{namespaceName}', '(.*)'));
|
|
49
|
+
if (match) {
|
|
50
|
+
return match[1];
|
|
51
|
+
}
|
|
52
|
+
return null;
|
|
53
|
+
};
|
|
54
|
+
CurrentCategoryMaster.isValid = function (grn) {
|
|
55
|
+
if (this.getRegion(grn) == null || this.getRegion(grn) === '') {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
if (this.getOwnerId(grn) == null || this.getOwnerId(grn) === '') {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
if (this.getNamespaceName(grn) == null || this.getNamespaceName(grn) === '') {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
return true;
|
|
65
|
+
};
|
|
66
|
+
CurrentCategoryMaster.createGrn = function (region, ownerId, namespaceName) {
|
|
67
|
+
return grnFormat
|
|
68
|
+
.replace('{region}', region !== null && region !== void 0 ? region : '')
|
|
69
|
+
.replace('{ownerId}', ownerId !== null && ownerId !== void 0 ? ownerId : '')
|
|
70
|
+
.replace('{namespaceName}', namespaceName !== null && namespaceName !== void 0 ? namespaceName : '');
|
|
71
|
+
};
|
|
72
|
+
CurrentCategoryMaster.prototype.getNamespaceId = function () {
|
|
73
|
+
return this.namespaceId;
|
|
74
|
+
};
|
|
75
|
+
CurrentCategoryMaster.prototype.setNamespaceId = function (namespaceId) {
|
|
76
|
+
this.namespaceId = namespaceId;
|
|
77
|
+
return this;
|
|
78
|
+
};
|
|
79
|
+
CurrentCategoryMaster.prototype.withNamespaceId = function (namespaceId) {
|
|
80
|
+
this.namespaceId = namespaceId;
|
|
81
|
+
return this;
|
|
82
|
+
};
|
|
83
|
+
CurrentCategoryMaster.prototype.getSettings = function () {
|
|
84
|
+
return this.settings;
|
|
85
|
+
};
|
|
86
|
+
CurrentCategoryMaster.prototype.setSettings = function (settings) {
|
|
87
|
+
this.settings = settings;
|
|
88
|
+
return this;
|
|
89
|
+
};
|
|
90
|
+
CurrentCategoryMaster.prototype.withSettings = function (settings) {
|
|
91
|
+
this.settings = settings;
|
|
92
|
+
return this;
|
|
93
|
+
};
|
|
94
|
+
CurrentCategoryMaster.fromDict = function (data) {
|
|
95
|
+
if (data == undefined || data == null) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
return new CurrentCategoryMaster()
|
|
99
|
+
.withNamespaceId(data["namespaceId"])
|
|
100
|
+
.withSettings(data["settings"]);
|
|
101
|
+
};
|
|
102
|
+
CurrentCategoryMaster.prototype.toDict = function () {
|
|
103
|
+
return {
|
|
104
|
+
"namespaceId": this.getNamespaceId(),
|
|
105
|
+
"settings": this.getSettings(),
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
return CurrentCategoryMaster;
|
|
109
|
+
}());
|
|
110
|
+
exports.default = CurrentCategoryMaster;
|
|
111
|
+
//# sourceMappingURL=CurrentCategoryMaster.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CurrentCategoryMaster.js","sourceRoot":"","sources":["CurrentCategoryMaster.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2016 Game Server Services, Inc. or its affiliates. All Rights
|
|
3
|
+
Reserved.
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License").
|
|
6
|
+
You may not use this file except in compliance with the License.
|
|
7
|
+
A copy of the License is located at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
or in the "license" file accompanying this file. This file is distributed
|
|
12
|
+
on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
|
13
|
+
express or implied. See the License for the specific language governing
|
|
14
|
+
permissions and limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import IModel from '../../core/interface/IModel';
|
|
18
|
+
const grnFormat: string = "grn:gs2:{region}:{ownerId}:idle:{namespaceName}";
|
|
19
|
+
|
|
20
|
+
export default class CurrentCategoryMaster implements IModel {
|
|
21
|
+
private namespaceId: string|null = null;
|
|
22
|
+
private settings: string|null = null;
|
|
23
|
+
|
|
24
|
+
public static getRegion(grn: string): string|null {
|
|
25
|
+
const match = grn.match(grnFormat
|
|
26
|
+
.replace('{region}', '(.*)')
|
|
27
|
+
.replace('{ownerId}', '.*')
|
|
28
|
+
.replace('{namespaceName}', '.*')
|
|
29
|
+
);
|
|
30
|
+
if (match) {
|
|
31
|
+
return match[1];
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
public static getOwnerId(grn: string): string|null {
|
|
37
|
+
const match = grn.match(grnFormat
|
|
38
|
+
.replace('{region}', '.*')
|
|
39
|
+
.replace('{ownerId}', '(.*)')
|
|
40
|
+
.replace('{namespaceName}', '.*')
|
|
41
|
+
);
|
|
42
|
+
if (match) {
|
|
43
|
+
return match[1];
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public static getNamespaceName(grn: string): string|null {
|
|
49
|
+
const match = grn.match(grnFormat
|
|
50
|
+
.replace('{region}', '.*')
|
|
51
|
+
.replace('{ownerId}', '.*')
|
|
52
|
+
.replace('{namespaceName}', '(.*)')
|
|
53
|
+
);
|
|
54
|
+
if (match) {
|
|
55
|
+
return match[1];
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
public static isValid(grn: string): boolean {
|
|
61
|
+
if (this.getRegion(grn) == null || this.getRegion(grn) === '') {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
if (this.getOwnerId(grn) == null || this.getOwnerId(grn) === '') {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
if (this.getNamespaceName(grn) == null || this.getNamespaceName(grn) === '') {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
public static createGrn(
|
|
74
|
+
region: string|null,
|
|
75
|
+
ownerId: string|null,
|
|
76
|
+
namespaceName: string|null,
|
|
77
|
+
): string|null {
|
|
78
|
+
return grnFormat
|
|
79
|
+
.replace('{region}', region ?? '')
|
|
80
|
+
.replace('{ownerId}', ownerId ?? '')
|
|
81
|
+
.replace('{namespaceName}', namespaceName ?? '');
|
|
82
|
+
}
|
|
83
|
+
public getNamespaceId(): string|null {
|
|
84
|
+
return this.namespaceId;
|
|
85
|
+
}
|
|
86
|
+
public setNamespaceId(namespaceId: string|null) {
|
|
87
|
+
this.namespaceId = namespaceId;
|
|
88
|
+
return this;
|
|
89
|
+
}
|
|
90
|
+
public withNamespaceId(namespaceId: string|null): this {
|
|
91
|
+
this.namespaceId = namespaceId;
|
|
92
|
+
return this;
|
|
93
|
+
}
|
|
94
|
+
public getSettings(): string|null {
|
|
95
|
+
return this.settings;
|
|
96
|
+
}
|
|
97
|
+
public setSettings(settings: string|null) {
|
|
98
|
+
this.settings = settings;
|
|
99
|
+
return this;
|
|
100
|
+
}
|
|
101
|
+
public withSettings(settings: string|null): this {
|
|
102
|
+
this.settings = settings;
|
|
103
|
+
return this;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
public static fromDict(data: {[key: string]: any}): CurrentCategoryMaster|null {
|
|
107
|
+
if (data == undefined || data == null) {
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
return new CurrentCategoryMaster()
|
|
111
|
+
.withNamespaceId(data["namespaceId"])
|
|
112
|
+
.withSettings(data["settings"]);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
public toDict(): {[key: string]: any} {
|
|
116
|
+
return {
|
|
117
|
+
"namespaceId": this.getNamespaceId(),
|
|
118
|
+
"settings": this.getSettings(),
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
}
|