gs2 1.3.141 → 1.3.142
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/exchange/model/IncrementalRateModel.d.ts +57 -0
- package/exchange/model/IncrementalRateModel.js +251 -0
- package/exchange/model/IncrementalRateModel.js.map +1 -0
- package/exchange/model/IncrementalRateModel.ts +264 -0
- package/exchange/model/IncrementalRateModelMaster.d.ts +69 -0
- package/exchange/model/IncrementalRateModelMaster.js +293 -0
- package/exchange/model/IncrementalRateModelMaster.js.map +1 -0
- package/exchange/model/IncrementalRateModelMaster.ts +306 -0
- package/exchange/model/index.d.ts +3 -1
- package/exchange/model/index.js +5 -1
- package/exchange/model/index.js.map +1 -1
- package/exchange/model/index.ts +4 -0
- package/exchange/request/CreateIncrementalRateModelMasterRequest.d.ts +62 -0
- package/exchange/request/CreateIncrementalRateModelMasterRequest.js +218 -0
- package/exchange/request/CreateIncrementalRateModelMasterRequest.js.map +1 -0
- package/exchange/request/CreateIncrementalRateModelMasterRequest.ts +224 -0
- package/exchange/request/DeleteIncrementalRateModelMasterRequest.d.ts +25 -0
- package/exchange/request/DeleteIncrementalRateModelMasterRequest.js +83 -0
- package/exchange/request/DeleteIncrementalRateModelMasterRequest.js.map +1 -0
- package/exchange/request/DeleteIncrementalRateModelMasterRequest.ts +90 -0
- package/exchange/request/DescribeIncrementalRateModelMastersRequest.d.ts +29 -0
- package/exchange/request/DescribeIncrementalRateModelMastersRequest.js +97 -0
- package/exchange/request/DescribeIncrementalRateModelMastersRequest.js.map +1 -0
- package/exchange/request/DescribeIncrementalRateModelMastersRequest.ts +104 -0
- package/exchange/request/DescribeIncrementalRateModelsRequest.d.ts +21 -0
- package/exchange/request/DescribeIncrementalRateModelsRequest.js +69 -0
- package/exchange/request/DescribeIncrementalRateModelsRequest.js.map +1 -0
- package/exchange/request/DescribeIncrementalRateModelsRequest.ts +76 -0
- package/exchange/request/GetIncrementalRateModelMasterRequest.d.ts +25 -0
- package/exchange/request/GetIncrementalRateModelMasterRequest.js +83 -0
- package/exchange/request/GetIncrementalRateModelMasterRequest.js.map +1 -0
- package/exchange/request/GetIncrementalRateModelMasterRequest.ts +90 -0
- package/exchange/request/GetIncrementalRateModelRequest.d.ts +25 -0
- package/exchange/request/GetIncrementalRateModelRequest.js +83 -0
- package/exchange/request/GetIncrementalRateModelRequest.js.map +1 -0
- package/exchange/request/GetIncrementalRateModelRequest.ts +90 -0
- package/exchange/request/IncrementalExchangeByStampSheetRequest.d.ts +25 -0
- package/exchange/request/IncrementalExchangeByStampSheetRequest.js +83 -0
- package/exchange/request/IncrementalExchangeByStampSheetRequest.js.map +1 -0
- package/exchange/request/IncrementalExchangeByStampSheetRequest.ts +90 -0
- package/exchange/request/IncrementalExchangeByUserIdRequest.d.ts +42 -0
- package/exchange/request/IncrementalExchangeByUserIdRequest.js +145 -0
- package/exchange/request/IncrementalExchangeByUserIdRequest.js.map +1 -0
- package/exchange/request/IncrementalExchangeByUserIdRequest.ts +155 -0
- package/exchange/request/IncrementalExchangeRequest.d.ts +42 -0
- package/exchange/request/IncrementalExchangeRequest.js +145 -0
- package/exchange/request/IncrementalExchangeRequest.js.map +1 -0
- package/exchange/request/IncrementalExchangeRequest.ts +155 -0
- package/exchange/request/UnlockIncrementalExchangeByStampSheetRequest.d.ts +25 -0
- package/exchange/request/UnlockIncrementalExchangeByStampSheetRequest.js +83 -0
- package/exchange/request/UnlockIncrementalExchangeByStampSheetRequest.js.map +1 -0
- package/exchange/request/UnlockIncrementalExchangeByStampSheetRequest.ts +90 -0
- package/exchange/request/UnlockIncrementalExchangeByUserIdRequest.d.ts +37 -0
- package/exchange/request/UnlockIncrementalExchangeByUserIdRequest.js +123 -0
- package/exchange/request/UnlockIncrementalExchangeByUserIdRequest.js.map +1 -0
- package/exchange/request/UnlockIncrementalExchangeByUserIdRequest.ts +133 -0
- package/exchange/request/UpdateIncrementalRateModelMasterRequest.d.ts +62 -0
- package/exchange/request/UpdateIncrementalRateModelMasterRequest.js +218 -0
- package/exchange/request/UpdateIncrementalRateModelMasterRequest.js.map +1 -0
- package/exchange/request/UpdateIncrementalRateModelMasterRequest.ts +224 -0
- package/exchange/request/index.d.ts +13 -1
- package/exchange/request/index.js +25 -1
- package/exchange/request/index.js.map +1 -1
- package/exchange/request/index.ts +24 -0
- package/exchange/rest.d.ts +12 -0
- package/exchange/rest.js +341 -0
- package/exchange/rest.js.map +1 -1
- package/exchange/rest.ts +389 -0
- package/exchange/result/CreateIncrementalRateModelMasterResult.d.ts +14 -0
- package/exchange/result/CreateIncrementalRateModelMasterResult.js +48 -0
- package/exchange/result/CreateIncrementalRateModelMasterResult.js.map +1 -0
- package/exchange/result/CreateIncrementalRateModelMasterResult.ts +48 -0
- package/exchange/result/DeleteIncrementalRateModelMasterResult.d.ts +14 -0
- package/exchange/result/DeleteIncrementalRateModelMasterResult.js +48 -0
- package/exchange/result/DeleteIncrementalRateModelMasterResult.js.map +1 -0
- package/exchange/result/DeleteIncrementalRateModelMasterResult.ts +48 -0
- package/exchange/result/DescribeIncrementalRateModelMastersResult.d.ts +18 -0
- package/exchange/result/DescribeIncrementalRateModelMastersResult.js +67 -0
- package/exchange/result/DescribeIncrementalRateModelMastersResult.js.map +1 -0
- package/exchange/result/DescribeIncrementalRateModelMastersResult.ts +73 -0
- package/exchange/result/DescribeIncrementalRateModelsResult.d.ts +14 -0
- package/exchange/result/DescribeIncrementalRateModelsResult.js +53 -0
- package/exchange/result/DescribeIncrementalRateModelsResult.js.map +1 -0
- package/exchange/result/DescribeIncrementalRateModelsResult.ts +56 -0
- package/exchange/result/GetIncrementalRateModelMasterResult.d.ts +14 -0
- package/exchange/result/GetIncrementalRateModelMasterResult.js +48 -0
- package/exchange/result/GetIncrementalRateModelMasterResult.js.map +1 -0
- package/exchange/result/GetIncrementalRateModelMasterResult.ts +48 -0
- package/exchange/result/GetIncrementalRateModelResult.d.ts +14 -0
- package/exchange/result/GetIncrementalRateModelResult.js +48 -0
- package/exchange/result/GetIncrementalRateModelResult.js.map +1 -0
- package/exchange/result/GetIncrementalRateModelResult.ts +48 -0
- package/exchange/result/IncrementalExchangeByStampSheetResult.d.ts +30 -0
- package/exchange/result/IncrementalExchangeByStampSheetResult.js +104 -0
- package/exchange/result/IncrementalExchangeByStampSheetResult.js.map +1 -0
- package/exchange/result/IncrementalExchangeByStampSheetResult.ts +116 -0
- package/exchange/result/IncrementalExchangeByUserIdResult.d.ts +30 -0
- package/exchange/result/IncrementalExchangeByUserIdResult.js +104 -0
- package/exchange/result/IncrementalExchangeByUserIdResult.js.map +1 -0
- package/exchange/result/IncrementalExchangeByUserIdResult.ts +116 -0
- package/exchange/result/IncrementalExchangeResult.d.ts +30 -0
- package/exchange/result/IncrementalExchangeResult.js +104 -0
- package/exchange/result/IncrementalExchangeResult.js.map +1 -0
- package/exchange/result/IncrementalExchangeResult.ts +116 -0
- package/exchange/result/UnlockIncrementalExchangeByStampSheetResult.d.ts +14 -0
- package/exchange/result/UnlockIncrementalExchangeByStampSheetResult.js +48 -0
- package/exchange/result/UnlockIncrementalExchangeByStampSheetResult.js.map +1 -0
- package/exchange/result/UnlockIncrementalExchangeByStampSheetResult.ts +48 -0
- package/exchange/result/UnlockIncrementalExchangeByUserIdResult.d.ts +14 -0
- package/exchange/result/UnlockIncrementalExchangeByUserIdResult.js +48 -0
- package/exchange/result/UnlockIncrementalExchangeByUserIdResult.js.map +1 -0
- package/exchange/result/UnlockIncrementalExchangeByUserIdResult.ts +48 -0
- package/exchange/result/UpdateIncrementalRateModelMasterResult.d.ts +14 -0
- package/exchange/result/UpdateIncrementalRateModelMasterResult.js +48 -0
- package/exchange/result/UpdateIncrementalRateModelMasterResult.js.map +1 -0
- package/exchange/result/UpdateIncrementalRateModelMasterResult.ts +48 -0
- package/exchange/result/index.d.ts +13 -1
- package/exchange/result/index.js +25 -1
- package/exchange/result/index.js.map +1 -1
- package/exchange/result/index.ts +24 -0
- package/package.json +1 -1
|
@@ -0,0 +1,293 @@
|
|
|
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 tslib_1 = require("tslib");
|
|
19
|
+
var ConsumeAction_1 = tslib_1.__importDefault(require("./ConsumeAction"));
|
|
20
|
+
var AcquireAction_1 = tslib_1.__importDefault(require("./AcquireAction"));
|
|
21
|
+
var grnFormat = "grn:gs2:{region}:{ownerId}:exchange:{namespaceName}:incremental:model:{rateName}";
|
|
22
|
+
var IncrementalRateModelMaster = /** @class */ (function () {
|
|
23
|
+
function IncrementalRateModelMaster() {
|
|
24
|
+
this.incrementalRateModelId = null;
|
|
25
|
+
this.name = null;
|
|
26
|
+
this.description = null;
|
|
27
|
+
this.metadata = null;
|
|
28
|
+
this.consumeAction = null;
|
|
29
|
+
this.calculateType = null;
|
|
30
|
+
this.baseValue = null;
|
|
31
|
+
this.coefficientValue = null;
|
|
32
|
+
this.calculateScriptId = null;
|
|
33
|
+
this.exchangeCountId = null;
|
|
34
|
+
this.acquireActions = null;
|
|
35
|
+
this.createdAt = null;
|
|
36
|
+
this.updatedAt = null;
|
|
37
|
+
}
|
|
38
|
+
IncrementalRateModelMaster.getRegion = function (grn) {
|
|
39
|
+
var match = grn.match(grnFormat
|
|
40
|
+
.replace('{region}', '(.*)')
|
|
41
|
+
.replace('{ownerId}', '.*')
|
|
42
|
+
.replace('{namespaceName}', '.*')
|
|
43
|
+
.replace('{rateName}', '.*'));
|
|
44
|
+
if (match) {
|
|
45
|
+
return match[1];
|
|
46
|
+
}
|
|
47
|
+
return null;
|
|
48
|
+
};
|
|
49
|
+
IncrementalRateModelMaster.getOwnerId = function (grn) {
|
|
50
|
+
var match = grn.match(grnFormat
|
|
51
|
+
.replace('{region}', '.*')
|
|
52
|
+
.replace('{ownerId}', '(.*)')
|
|
53
|
+
.replace('{namespaceName}', '.*')
|
|
54
|
+
.replace('{rateName}', '.*'));
|
|
55
|
+
if (match) {
|
|
56
|
+
return match[1];
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
59
|
+
};
|
|
60
|
+
IncrementalRateModelMaster.getNamespaceName = function (grn) {
|
|
61
|
+
var match = grn.match(grnFormat
|
|
62
|
+
.replace('{region}', '.*')
|
|
63
|
+
.replace('{ownerId}', '.*')
|
|
64
|
+
.replace('{namespaceName}', '(.*)')
|
|
65
|
+
.replace('{rateName}', '.*'));
|
|
66
|
+
if (match) {
|
|
67
|
+
return match[1];
|
|
68
|
+
}
|
|
69
|
+
return null;
|
|
70
|
+
};
|
|
71
|
+
IncrementalRateModelMaster.getRateName = function (grn) {
|
|
72
|
+
var match = grn.match(grnFormat
|
|
73
|
+
.replace('{region}', '.*')
|
|
74
|
+
.replace('{ownerId}', '.*')
|
|
75
|
+
.replace('{namespaceName}', '.*')
|
|
76
|
+
.replace('{rateName}', '(.*)'));
|
|
77
|
+
if (match) {
|
|
78
|
+
return match[1];
|
|
79
|
+
}
|
|
80
|
+
return null;
|
|
81
|
+
};
|
|
82
|
+
IncrementalRateModelMaster.isValid = function (grn) {
|
|
83
|
+
if (this.getRegion(grn) == null || this.getRegion(grn) === '') {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
if (this.getOwnerId(grn) == null || this.getOwnerId(grn) === '') {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
if (this.getNamespaceName(grn) == null || this.getNamespaceName(grn) === '') {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
if (this.getRateName(grn) == null || this.getRateName(grn) === '') {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
return true;
|
|
96
|
+
};
|
|
97
|
+
IncrementalRateModelMaster.createGrn = function (region, ownerId, namespaceName, rateName) {
|
|
98
|
+
return grnFormat
|
|
99
|
+
.replace('{region}', region !== null && region !== void 0 ? region : '')
|
|
100
|
+
.replace('{ownerId}', ownerId !== null && ownerId !== void 0 ? ownerId : '')
|
|
101
|
+
.replace('{namespaceName}', namespaceName !== null && namespaceName !== void 0 ? namespaceName : '')
|
|
102
|
+
.replace('{rateName}', rateName !== null && rateName !== void 0 ? rateName : '');
|
|
103
|
+
};
|
|
104
|
+
IncrementalRateModelMaster.prototype.getIncrementalRateModelId = function () {
|
|
105
|
+
return this.incrementalRateModelId;
|
|
106
|
+
};
|
|
107
|
+
IncrementalRateModelMaster.prototype.setIncrementalRateModelId = function (incrementalRateModelId) {
|
|
108
|
+
this.incrementalRateModelId = incrementalRateModelId;
|
|
109
|
+
return this;
|
|
110
|
+
};
|
|
111
|
+
IncrementalRateModelMaster.prototype.withIncrementalRateModelId = function (incrementalRateModelId) {
|
|
112
|
+
this.incrementalRateModelId = incrementalRateModelId;
|
|
113
|
+
return this;
|
|
114
|
+
};
|
|
115
|
+
IncrementalRateModelMaster.prototype.getName = function () {
|
|
116
|
+
return this.name;
|
|
117
|
+
};
|
|
118
|
+
IncrementalRateModelMaster.prototype.setName = function (name) {
|
|
119
|
+
this.name = name;
|
|
120
|
+
return this;
|
|
121
|
+
};
|
|
122
|
+
IncrementalRateModelMaster.prototype.withName = function (name) {
|
|
123
|
+
this.name = name;
|
|
124
|
+
return this;
|
|
125
|
+
};
|
|
126
|
+
IncrementalRateModelMaster.prototype.getDescription = function () {
|
|
127
|
+
return this.description;
|
|
128
|
+
};
|
|
129
|
+
IncrementalRateModelMaster.prototype.setDescription = function (description) {
|
|
130
|
+
this.description = description;
|
|
131
|
+
return this;
|
|
132
|
+
};
|
|
133
|
+
IncrementalRateModelMaster.prototype.withDescription = function (description) {
|
|
134
|
+
this.description = description;
|
|
135
|
+
return this;
|
|
136
|
+
};
|
|
137
|
+
IncrementalRateModelMaster.prototype.getMetadata = function () {
|
|
138
|
+
return this.metadata;
|
|
139
|
+
};
|
|
140
|
+
IncrementalRateModelMaster.prototype.setMetadata = function (metadata) {
|
|
141
|
+
this.metadata = metadata;
|
|
142
|
+
return this;
|
|
143
|
+
};
|
|
144
|
+
IncrementalRateModelMaster.prototype.withMetadata = function (metadata) {
|
|
145
|
+
this.metadata = metadata;
|
|
146
|
+
return this;
|
|
147
|
+
};
|
|
148
|
+
IncrementalRateModelMaster.prototype.getConsumeAction = function () {
|
|
149
|
+
return this.consumeAction;
|
|
150
|
+
};
|
|
151
|
+
IncrementalRateModelMaster.prototype.setConsumeAction = function (consumeAction) {
|
|
152
|
+
this.consumeAction = consumeAction;
|
|
153
|
+
return this;
|
|
154
|
+
};
|
|
155
|
+
IncrementalRateModelMaster.prototype.withConsumeAction = function (consumeAction) {
|
|
156
|
+
this.consumeAction = consumeAction;
|
|
157
|
+
return this;
|
|
158
|
+
};
|
|
159
|
+
IncrementalRateModelMaster.prototype.getCalculateType = function () {
|
|
160
|
+
return this.calculateType;
|
|
161
|
+
};
|
|
162
|
+
IncrementalRateModelMaster.prototype.setCalculateType = function (calculateType) {
|
|
163
|
+
this.calculateType = calculateType;
|
|
164
|
+
return this;
|
|
165
|
+
};
|
|
166
|
+
IncrementalRateModelMaster.prototype.withCalculateType = function (calculateType) {
|
|
167
|
+
this.calculateType = calculateType;
|
|
168
|
+
return this;
|
|
169
|
+
};
|
|
170
|
+
IncrementalRateModelMaster.prototype.getBaseValue = function () {
|
|
171
|
+
return this.baseValue;
|
|
172
|
+
};
|
|
173
|
+
IncrementalRateModelMaster.prototype.setBaseValue = function (baseValue) {
|
|
174
|
+
this.baseValue = baseValue;
|
|
175
|
+
return this;
|
|
176
|
+
};
|
|
177
|
+
IncrementalRateModelMaster.prototype.withBaseValue = function (baseValue) {
|
|
178
|
+
this.baseValue = baseValue;
|
|
179
|
+
return this;
|
|
180
|
+
};
|
|
181
|
+
IncrementalRateModelMaster.prototype.getCoefficientValue = function () {
|
|
182
|
+
return this.coefficientValue;
|
|
183
|
+
};
|
|
184
|
+
IncrementalRateModelMaster.prototype.setCoefficientValue = function (coefficientValue) {
|
|
185
|
+
this.coefficientValue = coefficientValue;
|
|
186
|
+
return this;
|
|
187
|
+
};
|
|
188
|
+
IncrementalRateModelMaster.prototype.withCoefficientValue = function (coefficientValue) {
|
|
189
|
+
this.coefficientValue = coefficientValue;
|
|
190
|
+
return this;
|
|
191
|
+
};
|
|
192
|
+
IncrementalRateModelMaster.prototype.getCalculateScriptId = function () {
|
|
193
|
+
return this.calculateScriptId;
|
|
194
|
+
};
|
|
195
|
+
IncrementalRateModelMaster.prototype.setCalculateScriptId = function (calculateScriptId) {
|
|
196
|
+
this.calculateScriptId = calculateScriptId;
|
|
197
|
+
return this;
|
|
198
|
+
};
|
|
199
|
+
IncrementalRateModelMaster.prototype.withCalculateScriptId = function (calculateScriptId) {
|
|
200
|
+
this.calculateScriptId = calculateScriptId;
|
|
201
|
+
return this;
|
|
202
|
+
};
|
|
203
|
+
IncrementalRateModelMaster.prototype.getExchangeCountId = function () {
|
|
204
|
+
return this.exchangeCountId;
|
|
205
|
+
};
|
|
206
|
+
IncrementalRateModelMaster.prototype.setExchangeCountId = function (exchangeCountId) {
|
|
207
|
+
this.exchangeCountId = exchangeCountId;
|
|
208
|
+
return this;
|
|
209
|
+
};
|
|
210
|
+
IncrementalRateModelMaster.prototype.withExchangeCountId = function (exchangeCountId) {
|
|
211
|
+
this.exchangeCountId = exchangeCountId;
|
|
212
|
+
return this;
|
|
213
|
+
};
|
|
214
|
+
IncrementalRateModelMaster.prototype.getAcquireActions = function () {
|
|
215
|
+
return this.acquireActions;
|
|
216
|
+
};
|
|
217
|
+
IncrementalRateModelMaster.prototype.setAcquireActions = function (acquireActions) {
|
|
218
|
+
this.acquireActions = acquireActions;
|
|
219
|
+
return this;
|
|
220
|
+
};
|
|
221
|
+
IncrementalRateModelMaster.prototype.withAcquireActions = function (acquireActions) {
|
|
222
|
+
this.acquireActions = acquireActions;
|
|
223
|
+
return this;
|
|
224
|
+
};
|
|
225
|
+
IncrementalRateModelMaster.prototype.getCreatedAt = function () {
|
|
226
|
+
return this.createdAt;
|
|
227
|
+
};
|
|
228
|
+
IncrementalRateModelMaster.prototype.setCreatedAt = function (createdAt) {
|
|
229
|
+
this.createdAt = createdAt;
|
|
230
|
+
return this;
|
|
231
|
+
};
|
|
232
|
+
IncrementalRateModelMaster.prototype.withCreatedAt = function (createdAt) {
|
|
233
|
+
this.createdAt = createdAt;
|
|
234
|
+
return this;
|
|
235
|
+
};
|
|
236
|
+
IncrementalRateModelMaster.prototype.getUpdatedAt = function () {
|
|
237
|
+
return this.updatedAt;
|
|
238
|
+
};
|
|
239
|
+
IncrementalRateModelMaster.prototype.setUpdatedAt = function (updatedAt) {
|
|
240
|
+
this.updatedAt = updatedAt;
|
|
241
|
+
return this;
|
|
242
|
+
};
|
|
243
|
+
IncrementalRateModelMaster.prototype.withUpdatedAt = function (updatedAt) {
|
|
244
|
+
this.updatedAt = updatedAt;
|
|
245
|
+
return this;
|
|
246
|
+
};
|
|
247
|
+
IncrementalRateModelMaster.fromDict = function (data) {
|
|
248
|
+
if (data == undefined || data == null) {
|
|
249
|
+
return null;
|
|
250
|
+
}
|
|
251
|
+
return new IncrementalRateModelMaster()
|
|
252
|
+
.withIncrementalRateModelId(data["incrementalRateModelId"])
|
|
253
|
+
.withName(data["name"])
|
|
254
|
+
.withDescription(data["description"])
|
|
255
|
+
.withMetadata(data["metadata"])
|
|
256
|
+
.withConsumeAction(ConsumeAction_1.default.fromDict(data["consumeAction"]))
|
|
257
|
+
.withCalculateType(data["calculateType"])
|
|
258
|
+
.withBaseValue(data["baseValue"])
|
|
259
|
+
.withCoefficientValue(data["coefficientValue"])
|
|
260
|
+
.withCalculateScriptId(data["calculateScriptId"])
|
|
261
|
+
.withExchangeCountId(data["exchangeCountId"])
|
|
262
|
+
.withAcquireActions(data.acquireActions ?
|
|
263
|
+
data.acquireActions.map(function (item) {
|
|
264
|
+
return AcquireAction_1.default.fromDict(item);
|
|
265
|
+
}) : [])
|
|
266
|
+
.withCreatedAt(data["createdAt"])
|
|
267
|
+
.withUpdatedAt(data["updatedAt"]);
|
|
268
|
+
};
|
|
269
|
+
IncrementalRateModelMaster.prototype.toDict = function () {
|
|
270
|
+
var _a;
|
|
271
|
+
return {
|
|
272
|
+
"incrementalRateModelId": this.getIncrementalRateModelId(),
|
|
273
|
+
"name": this.getName(),
|
|
274
|
+
"description": this.getDescription(),
|
|
275
|
+
"metadata": this.getMetadata(),
|
|
276
|
+
"consumeAction": (_a = this.getConsumeAction()) === null || _a === void 0 ? void 0 : _a.toDict(),
|
|
277
|
+
"calculateType": this.getCalculateType(),
|
|
278
|
+
"baseValue": this.getBaseValue(),
|
|
279
|
+
"coefficientValue": this.getCoefficientValue(),
|
|
280
|
+
"calculateScriptId": this.getCalculateScriptId(),
|
|
281
|
+
"exchangeCountId": this.getExchangeCountId(),
|
|
282
|
+
"acquireActions": this.getAcquireActions() ?
|
|
283
|
+
this.getAcquireActions().map(function (item) {
|
|
284
|
+
return item.toDict();
|
|
285
|
+
}) : [],
|
|
286
|
+
"createdAt": this.getCreatedAt(),
|
|
287
|
+
"updatedAt": this.getUpdatedAt(),
|
|
288
|
+
};
|
|
289
|
+
};
|
|
290
|
+
return IncrementalRateModelMaster;
|
|
291
|
+
}());
|
|
292
|
+
exports.default = IncrementalRateModelMaster;
|
|
293
|
+
//# sourceMappingURL=IncrementalRateModelMaster.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IncrementalRateModelMaster.js","sourceRoot":"","sources":["IncrementalRateModelMaster.ts"],"names":[],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,EAAE,CAAC,CAAC;gBACxC,IAAI,CAAC,iBAAiB,EAAG,CAAC,GAAG,CAAC,UAAC,IAAmB;oBAC9C,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;gBACzB,CAAC,CACJ,CAAC,CAAC,CAAC,EAAE;YACN,WAAW,EAAE,IAAI,CAAC,YAAY,EAAE;YAChC,WAAW,EAAE,IAAI,CAAC,YAAY,EAAE;SACnC,CAAC;IACN,CAAC;IACL,iCAAC;AAAD,CAAC,AA5RD,IA4RC"}
|
|
@@ -0,0 +1,306 @@
|
|
|
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 ConsumeAction from './ConsumeAction';
|
|
19
|
+
import AcquireAction from './AcquireAction';
|
|
20
|
+
const grnFormat: string = "grn:gs2:{region}:{ownerId}:exchange:{namespaceName}:incremental:model:{rateName}";
|
|
21
|
+
|
|
22
|
+
export default class IncrementalRateModelMaster implements IModel {
|
|
23
|
+
private incrementalRateModelId: string|null = null;
|
|
24
|
+
private name: string|null = null;
|
|
25
|
+
private description: string|null = null;
|
|
26
|
+
private metadata: string|null = null;
|
|
27
|
+
private consumeAction: ConsumeAction|null = null;
|
|
28
|
+
private calculateType: string|null = null;
|
|
29
|
+
private baseValue: number|null = null;
|
|
30
|
+
private coefficientValue: number|null = null;
|
|
31
|
+
private calculateScriptId: string|null = null;
|
|
32
|
+
private exchangeCountId: string|null = null;
|
|
33
|
+
private acquireActions: AcquireAction[]|null = null;
|
|
34
|
+
private createdAt: number|null = null;
|
|
35
|
+
private updatedAt: number|null = null;
|
|
36
|
+
|
|
37
|
+
public static getRegion(grn: string): string|null {
|
|
38
|
+
const match = grn.match(grnFormat
|
|
39
|
+
.replace('{region}', '(.*)')
|
|
40
|
+
.replace('{ownerId}', '.*')
|
|
41
|
+
.replace('{namespaceName}', '.*')
|
|
42
|
+
.replace('{rateName}', '.*')
|
|
43
|
+
);
|
|
44
|
+
if (match) {
|
|
45
|
+
return match[1];
|
|
46
|
+
}
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public static getOwnerId(grn: string): string|null {
|
|
51
|
+
const match = grn.match(grnFormat
|
|
52
|
+
.replace('{region}', '.*')
|
|
53
|
+
.replace('{ownerId}', '(.*)')
|
|
54
|
+
.replace('{namespaceName}', '.*')
|
|
55
|
+
.replace('{rateName}', '.*')
|
|
56
|
+
);
|
|
57
|
+
if (match) {
|
|
58
|
+
return match[1];
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public static getNamespaceName(grn: string): string|null {
|
|
64
|
+
const match = grn.match(grnFormat
|
|
65
|
+
.replace('{region}', '.*')
|
|
66
|
+
.replace('{ownerId}', '.*')
|
|
67
|
+
.replace('{namespaceName}', '(.*)')
|
|
68
|
+
.replace('{rateName}', '.*')
|
|
69
|
+
);
|
|
70
|
+
if (match) {
|
|
71
|
+
return match[1];
|
|
72
|
+
}
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
public static getRateName(grn: string): string|null {
|
|
77
|
+
const match = grn.match(grnFormat
|
|
78
|
+
.replace('{region}', '.*')
|
|
79
|
+
.replace('{ownerId}', '.*')
|
|
80
|
+
.replace('{namespaceName}', '.*')
|
|
81
|
+
.replace('{rateName}', '(.*)')
|
|
82
|
+
);
|
|
83
|
+
if (match) {
|
|
84
|
+
return match[1];
|
|
85
|
+
}
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
public static isValid(grn: string): boolean {
|
|
90
|
+
if (this.getRegion(grn) == null || this.getRegion(grn) === '') {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
if (this.getOwnerId(grn) == null || this.getOwnerId(grn) === '') {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
if (this.getNamespaceName(grn) == null || this.getNamespaceName(grn) === '') {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
if (this.getRateName(grn) == null || this.getRateName(grn) === '') {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
public static createGrn(
|
|
106
|
+
region: string|null,
|
|
107
|
+
ownerId: string|null,
|
|
108
|
+
namespaceName: string|null,
|
|
109
|
+
rateName: string|null,
|
|
110
|
+
): string|null {
|
|
111
|
+
return grnFormat
|
|
112
|
+
.replace('{region}', region ?? '')
|
|
113
|
+
.replace('{ownerId}', ownerId ?? '')
|
|
114
|
+
.replace('{namespaceName}', namespaceName ?? '')
|
|
115
|
+
.replace('{rateName}', rateName ?? '');
|
|
116
|
+
}
|
|
117
|
+
public getIncrementalRateModelId(): string|null {
|
|
118
|
+
return this.incrementalRateModelId;
|
|
119
|
+
}
|
|
120
|
+
public setIncrementalRateModelId(incrementalRateModelId: string|null) {
|
|
121
|
+
this.incrementalRateModelId = incrementalRateModelId;
|
|
122
|
+
return this;
|
|
123
|
+
}
|
|
124
|
+
public withIncrementalRateModelId(incrementalRateModelId: string|null): this {
|
|
125
|
+
this.incrementalRateModelId = incrementalRateModelId;
|
|
126
|
+
return this;
|
|
127
|
+
}
|
|
128
|
+
public getName(): string|null {
|
|
129
|
+
return this.name;
|
|
130
|
+
}
|
|
131
|
+
public setName(name: string|null) {
|
|
132
|
+
this.name = name;
|
|
133
|
+
return this;
|
|
134
|
+
}
|
|
135
|
+
public withName(name: string|null): this {
|
|
136
|
+
this.name = name;
|
|
137
|
+
return this;
|
|
138
|
+
}
|
|
139
|
+
public getDescription(): string|null {
|
|
140
|
+
return this.description;
|
|
141
|
+
}
|
|
142
|
+
public setDescription(description: string|null) {
|
|
143
|
+
this.description = description;
|
|
144
|
+
return this;
|
|
145
|
+
}
|
|
146
|
+
public withDescription(description: string|null): this {
|
|
147
|
+
this.description = description;
|
|
148
|
+
return this;
|
|
149
|
+
}
|
|
150
|
+
public getMetadata(): string|null {
|
|
151
|
+
return this.metadata;
|
|
152
|
+
}
|
|
153
|
+
public setMetadata(metadata: string|null) {
|
|
154
|
+
this.metadata = metadata;
|
|
155
|
+
return this;
|
|
156
|
+
}
|
|
157
|
+
public withMetadata(metadata: string|null): this {
|
|
158
|
+
this.metadata = metadata;
|
|
159
|
+
return this;
|
|
160
|
+
}
|
|
161
|
+
public getConsumeAction(): ConsumeAction|null {
|
|
162
|
+
return this.consumeAction;
|
|
163
|
+
}
|
|
164
|
+
public setConsumeAction(consumeAction: ConsumeAction|null) {
|
|
165
|
+
this.consumeAction = consumeAction;
|
|
166
|
+
return this;
|
|
167
|
+
}
|
|
168
|
+
public withConsumeAction(consumeAction: ConsumeAction|null): this {
|
|
169
|
+
this.consumeAction = consumeAction;
|
|
170
|
+
return this;
|
|
171
|
+
}
|
|
172
|
+
public getCalculateType(): string|null {
|
|
173
|
+
return this.calculateType;
|
|
174
|
+
}
|
|
175
|
+
public setCalculateType(calculateType: string|null) {
|
|
176
|
+
this.calculateType = calculateType;
|
|
177
|
+
return this;
|
|
178
|
+
}
|
|
179
|
+
public withCalculateType(calculateType: string|null): this {
|
|
180
|
+
this.calculateType = calculateType;
|
|
181
|
+
return this;
|
|
182
|
+
}
|
|
183
|
+
public getBaseValue(): number|null {
|
|
184
|
+
return this.baseValue;
|
|
185
|
+
}
|
|
186
|
+
public setBaseValue(baseValue: number|null) {
|
|
187
|
+
this.baseValue = baseValue;
|
|
188
|
+
return this;
|
|
189
|
+
}
|
|
190
|
+
public withBaseValue(baseValue: number|null): this {
|
|
191
|
+
this.baseValue = baseValue;
|
|
192
|
+
return this;
|
|
193
|
+
}
|
|
194
|
+
public getCoefficientValue(): number|null {
|
|
195
|
+
return this.coefficientValue;
|
|
196
|
+
}
|
|
197
|
+
public setCoefficientValue(coefficientValue: number|null) {
|
|
198
|
+
this.coefficientValue = coefficientValue;
|
|
199
|
+
return this;
|
|
200
|
+
}
|
|
201
|
+
public withCoefficientValue(coefficientValue: number|null): this {
|
|
202
|
+
this.coefficientValue = coefficientValue;
|
|
203
|
+
return this;
|
|
204
|
+
}
|
|
205
|
+
public getCalculateScriptId(): string|null {
|
|
206
|
+
return this.calculateScriptId;
|
|
207
|
+
}
|
|
208
|
+
public setCalculateScriptId(calculateScriptId: string|null) {
|
|
209
|
+
this.calculateScriptId = calculateScriptId;
|
|
210
|
+
return this;
|
|
211
|
+
}
|
|
212
|
+
public withCalculateScriptId(calculateScriptId: string|null): this {
|
|
213
|
+
this.calculateScriptId = calculateScriptId;
|
|
214
|
+
return this;
|
|
215
|
+
}
|
|
216
|
+
public getExchangeCountId(): string|null {
|
|
217
|
+
return this.exchangeCountId;
|
|
218
|
+
}
|
|
219
|
+
public setExchangeCountId(exchangeCountId: string|null) {
|
|
220
|
+
this.exchangeCountId = exchangeCountId;
|
|
221
|
+
return this;
|
|
222
|
+
}
|
|
223
|
+
public withExchangeCountId(exchangeCountId: string|null): this {
|
|
224
|
+
this.exchangeCountId = exchangeCountId;
|
|
225
|
+
return this;
|
|
226
|
+
}
|
|
227
|
+
public getAcquireActions(): AcquireAction[]|null {
|
|
228
|
+
return this.acquireActions;
|
|
229
|
+
}
|
|
230
|
+
public setAcquireActions(acquireActions: AcquireAction[]|null) {
|
|
231
|
+
this.acquireActions = acquireActions;
|
|
232
|
+
return this;
|
|
233
|
+
}
|
|
234
|
+
public withAcquireActions(acquireActions: AcquireAction[]|null): this {
|
|
235
|
+
this.acquireActions = acquireActions;
|
|
236
|
+
return this;
|
|
237
|
+
}
|
|
238
|
+
public getCreatedAt(): number|null {
|
|
239
|
+
return this.createdAt;
|
|
240
|
+
}
|
|
241
|
+
public setCreatedAt(createdAt: number|null) {
|
|
242
|
+
this.createdAt = createdAt;
|
|
243
|
+
return this;
|
|
244
|
+
}
|
|
245
|
+
public withCreatedAt(createdAt: number|null): this {
|
|
246
|
+
this.createdAt = createdAt;
|
|
247
|
+
return this;
|
|
248
|
+
}
|
|
249
|
+
public getUpdatedAt(): number|null {
|
|
250
|
+
return this.updatedAt;
|
|
251
|
+
}
|
|
252
|
+
public setUpdatedAt(updatedAt: number|null) {
|
|
253
|
+
this.updatedAt = updatedAt;
|
|
254
|
+
return this;
|
|
255
|
+
}
|
|
256
|
+
public withUpdatedAt(updatedAt: number|null): this {
|
|
257
|
+
this.updatedAt = updatedAt;
|
|
258
|
+
return this;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
public static fromDict(data: {[key: string]: any}): IncrementalRateModelMaster|null {
|
|
262
|
+
if (data == undefined || data == null) {
|
|
263
|
+
return null;
|
|
264
|
+
}
|
|
265
|
+
return new IncrementalRateModelMaster()
|
|
266
|
+
.withIncrementalRateModelId(data["incrementalRateModelId"])
|
|
267
|
+
.withName(data["name"])
|
|
268
|
+
.withDescription(data["description"])
|
|
269
|
+
.withMetadata(data["metadata"])
|
|
270
|
+
.withConsumeAction(ConsumeAction.fromDict(data["consumeAction"]))
|
|
271
|
+
.withCalculateType(data["calculateType"])
|
|
272
|
+
.withBaseValue(data["baseValue"])
|
|
273
|
+
.withCoefficientValue(data["coefficientValue"])
|
|
274
|
+
.withCalculateScriptId(data["calculateScriptId"])
|
|
275
|
+
.withExchangeCountId(data["exchangeCountId"])
|
|
276
|
+
.withAcquireActions(data.acquireActions ?
|
|
277
|
+
data.acquireActions.map((item: {[key: string]: any}) => {
|
|
278
|
+
return AcquireAction.fromDict(item);
|
|
279
|
+
}
|
|
280
|
+
) : [])
|
|
281
|
+
.withCreatedAt(data["createdAt"])
|
|
282
|
+
.withUpdatedAt(data["updatedAt"]);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
public toDict(): {[key: string]: any} {
|
|
286
|
+
return {
|
|
287
|
+
"incrementalRateModelId": this.getIncrementalRateModelId(),
|
|
288
|
+
"name": this.getName(),
|
|
289
|
+
"description": this.getDescription(),
|
|
290
|
+
"metadata": this.getMetadata(),
|
|
291
|
+
"consumeAction": this.getConsumeAction()?.toDict(),
|
|
292
|
+
"calculateType": this.getCalculateType(),
|
|
293
|
+
"baseValue": this.getBaseValue(),
|
|
294
|
+
"coefficientValue": this.getCoefficientValue(),
|
|
295
|
+
"calculateScriptId": this.getCalculateScriptId(),
|
|
296
|
+
"exchangeCountId": this.getExchangeCountId(),
|
|
297
|
+
"acquireActions": this.getAcquireActions() ?
|
|
298
|
+
this.getAcquireActions()!.map((item: AcquireAction) => {
|
|
299
|
+
return item.toDict();
|
|
300
|
+
}
|
|
301
|
+
) : [],
|
|
302
|
+
"createdAt": this.getCreatedAt(),
|
|
303
|
+
"updatedAt": this.getUpdatedAt(),
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import Namespace from "./Namespace";
|
|
2
2
|
import RateModel from "./RateModel";
|
|
3
3
|
import RateModelMaster from "./RateModelMaster";
|
|
4
|
+
import IncrementalRateModel from "./IncrementalRateModel";
|
|
5
|
+
import IncrementalRateModelMaster from "./IncrementalRateModelMaster";
|
|
4
6
|
import CurrentRateMaster from "./CurrentRateMaster";
|
|
5
7
|
import Await from "./Await";
|
|
6
8
|
import AcquireAction from "./AcquireAction";
|
|
@@ -10,4 +12,4 @@ import GitHubCheckoutSetting from "./GitHubCheckoutSetting";
|
|
|
10
12
|
import ScriptSetting from "./ScriptSetting";
|
|
11
13
|
import LogSetting from "./LogSetting";
|
|
12
14
|
import TransactionSetting from "./TransactionSetting";
|
|
13
|
-
export { Namespace, RateModel, RateModelMaster, CurrentRateMaster, Await, AcquireAction, ConsumeAction, Config, GitHubCheckoutSetting, ScriptSetting, LogSetting, TransactionSetting, };
|
|
15
|
+
export { Namespace, RateModel, RateModelMaster, IncrementalRateModel, IncrementalRateModelMaster, CurrentRateMaster, Await, AcquireAction, ConsumeAction, Config, GitHubCheckoutSetting, ScriptSetting, LogSetting, TransactionSetting, };
|
package/exchange/model/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TransactionSetting = exports.LogSetting = exports.ScriptSetting = exports.GitHubCheckoutSetting = exports.Config = exports.ConsumeAction = exports.AcquireAction = exports.Await = exports.CurrentRateMaster = exports.RateModelMaster = exports.RateModel = exports.Namespace = void 0;
|
|
3
|
+
exports.TransactionSetting = exports.LogSetting = exports.ScriptSetting = exports.GitHubCheckoutSetting = exports.Config = exports.ConsumeAction = exports.AcquireAction = exports.Await = exports.CurrentRateMaster = exports.IncrementalRateModelMaster = exports.IncrementalRateModel = exports.RateModelMaster = exports.RateModel = exports.Namespace = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
/*
|
|
6
6
|
Copyright 2016 Game Server Services, Inc. or its affiliates. All Rights
|
|
@@ -23,6 +23,10 @@ var RateModel_1 = tslib_1.__importDefault(require("./RateModel"));
|
|
|
23
23
|
exports.RateModel = RateModel_1.default;
|
|
24
24
|
var RateModelMaster_1 = tslib_1.__importDefault(require("./RateModelMaster"));
|
|
25
25
|
exports.RateModelMaster = RateModelMaster_1.default;
|
|
26
|
+
var IncrementalRateModel_1 = tslib_1.__importDefault(require("./IncrementalRateModel"));
|
|
27
|
+
exports.IncrementalRateModel = IncrementalRateModel_1.default;
|
|
28
|
+
var IncrementalRateModelMaster_1 = tslib_1.__importDefault(require("./IncrementalRateModelMaster"));
|
|
29
|
+
exports.IncrementalRateModelMaster = IncrementalRateModelMaster_1.default;
|
|
26
30
|
var CurrentRateMaster_1 = tslib_1.__importDefault(require("./CurrentRateMaster"));
|
|
27
31
|
exports.CurrentRateMaster = CurrentRateMaster_1.default;
|
|
28
32
|
var Await_1 = tslib_1.__importDefault(require("./Await"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;GAcG;AACH,kEAAmC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;GAcG;AACH,kEAAmC;AAgB/B,oBAhBG,mBAAS,CAgBH;AAfb,kEAAmC;AAgB/B,oBAhBG,mBAAS,CAgBH;AAfb,8EAA+C;AAgB3C,0BAhBG,yBAAe,CAgBH;AAfnB,wFAAyD;AAgBrD,+BAhBG,8BAAoB,CAgBH;AAfxB,oGAAqE;AAgBjE,qCAhBG,oCAA0B,CAgBH;AAf9B,kFAAmD;AAgB/C,4BAhBG,2BAAiB,CAgBH;AAfrB,0DAA2B;AAgBvB,gBAhBG,eAAK,CAgBH;AAfT,0EAA2C;AAgBvC,wBAhBG,uBAAa,CAgBH;AAfjB,0EAA2C;AAgBvC,wBAhBG,uBAAa,CAgBH;AAfjB,4DAA6B;AAgBzB,iBAhBG,gBAAM,CAgBH;AAfV,0FAA2D;AAgBvD,gCAhBG,+BAAqB,CAgBH;AAfzB,0EAA2C;AAgBvC,wBAhBG,uBAAa,CAgBH;AAfjB,oEAAqC;AAgBjC,qBAhBG,oBAAU,CAgBH;AAfd,oFAAqD;AAgBjD,6BAhBG,4BAAkB,CAgBH"}
|
package/exchange/model/index.ts
CHANGED
|
@@ -16,6 +16,8 @@ permissions and limitations under the License.
|
|
|
16
16
|
import Namespace from "./Namespace"
|
|
17
17
|
import RateModel from "./RateModel"
|
|
18
18
|
import RateModelMaster from "./RateModelMaster"
|
|
19
|
+
import IncrementalRateModel from "./IncrementalRateModel"
|
|
20
|
+
import IncrementalRateModelMaster from "./IncrementalRateModelMaster"
|
|
19
21
|
import CurrentRateMaster from "./CurrentRateMaster"
|
|
20
22
|
import Await from "./Await"
|
|
21
23
|
import AcquireAction from "./AcquireAction"
|
|
@@ -30,6 +32,8 @@ export {
|
|
|
30
32
|
Namespace,
|
|
31
33
|
RateModel,
|
|
32
34
|
RateModelMaster,
|
|
35
|
+
IncrementalRateModel,
|
|
36
|
+
IncrementalRateModelMaster,
|
|
33
37
|
CurrentRateMaster,
|
|
34
38
|
Await,
|
|
35
39
|
AcquireAction,
|