gs2 1.3.236 → 1.3.237
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.
|
@@ -9,8 +9,9 @@ export default class ReferenceOf implements IModel {
|
|
|
9
9
|
static getInventoryName(grn: string): string | null;
|
|
10
10
|
static getItemName(grn: string): string | null;
|
|
11
11
|
static getItemSetName(grn: string): string | null;
|
|
12
|
+
static getReferenceOfName(grn: string): string | null;
|
|
12
13
|
static isValid(grn: string): boolean;
|
|
13
|
-
static createGrn(region: string | null, ownerId: string | null, namespaceName: string | null, userId: string | null, inventoryName: string | null, itemName: string | null, itemSetName: string | null): string | null;
|
|
14
|
+
static createGrn(region: string | null, ownerId: string | null, namespaceName: string | null, userId: string | null, inventoryName: string | null, itemName: string | null, itemSetName: string | null, referenceOfName: string | null): string | null;
|
|
14
15
|
getReferenceOfId(): string | null;
|
|
15
16
|
setReferenceOfId(referenceOfId: string | null): this;
|
|
16
17
|
withReferenceOfId(referenceOfId: string | null): this;
|
|
@@ -15,7 +15,7 @@ express or implied. See the License for the specific language governing
|
|
|
15
15
|
permissions and limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
var grnFormat = "grn:gs2:{region}:{ownerId}:inventory:{namespaceName}:user:{userId}:inventory:{inventoryName}:item:{itemName}:itemSet:{itemSetName}:referenceOf";
|
|
18
|
+
var grnFormat = "grn:gs2:{region}:{ownerId}:inventory:{namespaceName}:user:{userId}:inventory:{inventoryName}:item:{itemName}:itemSet:{itemSetName}:referenceOf:{referenceOfName}";
|
|
19
19
|
var ReferenceOf = /** @class */ (function () {
|
|
20
20
|
function ReferenceOf() {
|
|
21
21
|
this.referenceOfId = null;
|
|
@@ -29,7 +29,8 @@ var ReferenceOf = /** @class */ (function () {
|
|
|
29
29
|
.replace('{userId}', '.*')
|
|
30
30
|
.replace('{inventoryName}', '.*')
|
|
31
31
|
.replace('{itemName}', '.*')
|
|
32
|
-
.replace('{itemSetName}', '.*')
|
|
32
|
+
.replace('{itemSetName}', '.*')
|
|
33
|
+
.replace('{referenceOfName}', '.*'));
|
|
33
34
|
if (match) {
|
|
34
35
|
return match[1];
|
|
35
36
|
}
|
|
@@ -43,7 +44,8 @@ var ReferenceOf = /** @class */ (function () {
|
|
|
43
44
|
.replace('{userId}', '.*')
|
|
44
45
|
.replace('{inventoryName}', '.*')
|
|
45
46
|
.replace('{itemName}', '.*')
|
|
46
|
-
.replace('{itemSetName}', '.*')
|
|
47
|
+
.replace('{itemSetName}', '.*')
|
|
48
|
+
.replace('{referenceOfName}', '.*'));
|
|
47
49
|
if (match) {
|
|
48
50
|
return match[1];
|
|
49
51
|
}
|
|
@@ -57,7 +59,8 @@ var ReferenceOf = /** @class */ (function () {
|
|
|
57
59
|
.replace('{userId}', '.*')
|
|
58
60
|
.replace('{inventoryName}', '.*')
|
|
59
61
|
.replace('{itemName}', '.*')
|
|
60
|
-
.replace('{itemSetName}', '.*')
|
|
62
|
+
.replace('{itemSetName}', '.*')
|
|
63
|
+
.replace('{referenceOfName}', '.*'));
|
|
61
64
|
if (match) {
|
|
62
65
|
return match[1];
|
|
63
66
|
}
|
|
@@ -71,7 +74,8 @@ var ReferenceOf = /** @class */ (function () {
|
|
|
71
74
|
.replace('{userId}', '(.*)')
|
|
72
75
|
.replace('{inventoryName}', '.*')
|
|
73
76
|
.replace('{itemName}', '.*')
|
|
74
|
-
.replace('{itemSetName}', '.*')
|
|
77
|
+
.replace('{itemSetName}', '.*')
|
|
78
|
+
.replace('{referenceOfName}', '.*'));
|
|
75
79
|
if (match) {
|
|
76
80
|
return match[1];
|
|
77
81
|
}
|
|
@@ -85,7 +89,8 @@ var ReferenceOf = /** @class */ (function () {
|
|
|
85
89
|
.replace('{userId}', '.*')
|
|
86
90
|
.replace('{inventoryName}', '(.*)')
|
|
87
91
|
.replace('{itemName}', '.*')
|
|
88
|
-
.replace('{itemSetName}', '.*')
|
|
92
|
+
.replace('{itemSetName}', '.*')
|
|
93
|
+
.replace('{referenceOfName}', '.*'));
|
|
89
94
|
if (match) {
|
|
90
95
|
return match[1];
|
|
91
96
|
}
|
|
@@ -99,7 +104,8 @@ var ReferenceOf = /** @class */ (function () {
|
|
|
99
104
|
.replace('{userId}', '.*')
|
|
100
105
|
.replace('{inventoryName}', '.*')
|
|
101
106
|
.replace('{itemName}', '(.*)')
|
|
102
|
-
.replace('{itemSetName}', '.*')
|
|
107
|
+
.replace('{itemSetName}', '.*')
|
|
108
|
+
.replace('{referenceOfName}', '.*'));
|
|
103
109
|
if (match) {
|
|
104
110
|
return match[1];
|
|
105
111
|
}
|
|
@@ -113,7 +119,23 @@ var ReferenceOf = /** @class */ (function () {
|
|
|
113
119
|
.replace('{userId}', '.*')
|
|
114
120
|
.replace('{inventoryName}', '.*')
|
|
115
121
|
.replace('{itemName}', '.*')
|
|
116
|
-
.replace('{itemSetName}', '(.*)')
|
|
122
|
+
.replace('{itemSetName}', '(.*)')
|
|
123
|
+
.replace('{referenceOfName}', '.*'));
|
|
124
|
+
if (match) {
|
|
125
|
+
return match[1];
|
|
126
|
+
}
|
|
127
|
+
return null;
|
|
128
|
+
};
|
|
129
|
+
ReferenceOf.getReferenceOfName = function (grn) {
|
|
130
|
+
var match = grn.match(grnFormat
|
|
131
|
+
.replace('{region}', '.*')
|
|
132
|
+
.replace('{ownerId}', '.*')
|
|
133
|
+
.replace('{namespaceName}', '.*')
|
|
134
|
+
.replace('{userId}', '.*')
|
|
135
|
+
.replace('{inventoryName}', '.*')
|
|
136
|
+
.replace('{itemName}', '.*')
|
|
137
|
+
.replace('{itemSetName}', '.*')
|
|
138
|
+
.replace('{referenceOfName}', '(.*)'));
|
|
117
139
|
if (match) {
|
|
118
140
|
return match[1];
|
|
119
141
|
}
|
|
@@ -141,9 +163,12 @@ var ReferenceOf = /** @class */ (function () {
|
|
|
141
163
|
if (this.getItemSetName(grn) == null || this.getItemSetName(grn) === '') {
|
|
142
164
|
return false;
|
|
143
165
|
}
|
|
166
|
+
if (this.getReferenceOfName(grn) == null || this.getReferenceOfName(grn) === '') {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
144
169
|
return true;
|
|
145
170
|
};
|
|
146
|
-
ReferenceOf.createGrn = function (region, ownerId, namespaceName, userId, inventoryName, itemName, itemSetName) {
|
|
171
|
+
ReferenceOf.createGrn = function (region, ownerId, namespaceName, userId, inventoryName, itemName, itemSetName, referenceOfName) {
|
|
147
172
|
return grnFormat
|
|
148
173
|
.replace('{region}', region !== null && region !== void 0 ? region : '')
|
|
149
174
|
.replace('{ownerId}', ownerId !== null && ownerId !== void 0 ? ownerId : '')
|
|
@@ -151,7 +176,8 @@ var ReferenceOf = /** @class */ (function () {
|
|
|
151
176
|
.replace('{userId}', userId !== null && userId !== void 0 ? userId : '')
|
|
152
177
|
.replace('{inventoryName}', inventoryName !== null && inventoryName !== void 0 ? inventoryName : '')
|
|
153
178
|
.replace('{itemName}', itemName !== null && itemName !== void 0 ? itemName : '')
|
|
154
|
-
.replace('{itemSetName}', itemSetName !== null && itemSetName !== void 0 ? itemSetName : '')
|
|
179
|
+
.replace('{itemSetName}', itemSetName !== null && itemSetName !== void 0 ? itemSetName : '')
|
|
180
|
+
.replace('{referenceOfName}', referenceOfName !== null && referenceOfName !== void 0 ? referenceOfName : '');
|
|
155
181
|
};
|
|
156
182
|
ReferenceOf.prototype.getReferenceOfId = function () {
|
|
157
183
|
return this.referenceOfId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReferenceOf.js","sourceRoot":"","sources":["ReferenceOf.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAGH,IAAM,SAAS,GAAW,
|
|
1
|
+
{"version":3,"file":"ReferenceOf.js","sourceRoot":"","sources":["ReferenceOf.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAGH,IAAM,SAAS,GAAW,kKAAkK,CAAC;AAE7L;IAAA;QACY,kBAAa,GAAgB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AC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAChC,CAAC;IAEM,4BAAM,GAAb;QACI,OAAO;YACH,eAAe,EAAE,IAAI,CAAC,gBAAgB,EAAE;YACxC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE;SACzB,CAAC;IACN,CAAC;IACL,kBAAC;AAAD,CAAC,AAlOD,IAkOC"}
|
|
@@ -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}:inventory:{namespaceName}:user:{userId}:inventory:{inventoryName}:item:{itemName}:itemSet:{itemSetName}:referenceOf";
|
|
18
|
+
const grnFormat: string = "grn:gs2:{region}:{ownerId}:inventory:{namespaceName}:user:{userId}:inventory:{inventoryName}:item:{itemName}:itemSet:{itemSetName}:referenceOf:{referenceOfName}";
|
|
19
19
|
|
|
20
20
|
export default class ReferenceOf implements IModel {
|
|
21
21
|
private referenceOfId: string|null = null;
|
|
@@ -30,6 +30,7 @@ export default class ReferenceOf implements IModel {
|
|
|
30
30
|
.replace('{inventoryName}', '.*')
|
|
31
31
|
.replace('{itemName}', '.*')
|
|
32
32
|
.replace('{itemSetName}', '.*')
|
|
33
|
+
.replace('{referenceOfName}', '.*')
|
|
33
34
|
);
|
|
34
35
|
if (match) {
|
|
35
36
|
return match[1];
|
|
@@ -46,6 +47,7 @@ export default class ReferenceOf implements IModel {
|
|
|
46
47
|
.replace('{inventoryName}', '.*')
|
|
47
48
|
.replace('{itemName}', '.*')
|
|
48
49
|
.replace('{itemSetName}', '.*')
|
|
50
|
+
.replace('{referenceOfName}', '.*')
|
|
49
51
|
);
|
|
50
52
|
if (match) {
|
|
51
53
|
return match[1];
|
|
@@ -62,6 +64,7 @@ export default class ReferenceOf implements IModel {
|
|
|
62
64
|
.replace('{inventoryName}', '.*')
|
|
63
65
|
.replace('{itemName}', '.*')
|
|
64
66
|
.replace('{itemSetName}', '.*')
|
|
67
|
+
.replace('{referenceOfName}', '.*')
|
|
65
68
|
);
|
|
66
69
|
if (match) {
|
|
67
70
|
return match[1];
|
|
@@ -78,6 +81,7 @@ export default class ReferenceOf implements IModel {
|
|
|
78
81
|
.replace('{inventoryName}', '.*')
|
|
79
82
|
.replace('{itemName}', '.*')
|
|
80
83
|
.replace('{itemSetName}', '.*')
|
|
84
|
+
.replace('{referenceOfName}', '.*')
|
|
81
85
|
);
|
|
82
86
|
if (match) {
|
|
83
87
|
return match[1];
|
|
@@ -94,6 +98,7 @@ export default class ReferenceOf implements IModel {
|
|
|
94
98
|
.replace('{inventoryName}', '(.*)')
|
|
95
99
|
.replace('{itemName}', '.*')
|
|
96
100
|
.replace('{itemSetName}', '.*')
|
|
101
|
+
.replace('{referenceOfName}', '.*')
|
|
97
102
|
);
|
|
98
103
|
if (match) {
|
|
99
104
|
return match[1];
|
|
@@ -110,6 +115,7 @@ export default class ReferenceOf implements IModel {
|
|
|
110
115
|
.replace('{inventoryName}', '.*')
|
|
111
116
|
.replace('{itemName}', '(.*)')
|
|
112
117
|
.replace('{itemSetName}', '.*')
|
|
118
|
+
.replace('{referenceOfName}', '.*')
|
|
113
119
|
);
|
|
114
120
|
if (match) {
|
|
115
121
|
return match[1];
|
|
@@ -126,6 +132,24 @@ export default class ReferenceOf implements IModel {
|
|
|
126
132
|
.replace('{inventoryName}', '.*')
|
|
127
133
|
.replace('{itemName}', '.*')
|
|
128
134
|
.replace('{itemSetName}', '(.*)')
|
|
135
|
+
.replace('{referenceOfName}', '.*')
|
|
136
|
+
);
|
|
137
|
+
if (match) {
|
|
138
|
+
return match[1];
|
|
139
|
+
}
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
public static getReferenceOfName(grn: string): string|null {
|
|
144
|
+
const match = grn.match(grnFormat
|
|
145
|
+
.replace('{region}', '.*')
|
|
146
|
+
.replace('{ownerId}', '.*')
|
|
147
|
+
.replace('{namespaceName}', '.*')
|
|
148
|
+
.replace('{userId}', '.*')
|
|
149
|
+
.replace('{inventoryName}', '.*')
|
|
150
|
+
.replace('{itemName}', '.*')
|
|
151
|
+
.replace('{itemSetName}', '.*')
|
|
152
|
+
.replace('{referenceOfName}', '(.*)')
|
|
129
153
|
);
|
|
130
154
|
if (match) {
|
|
131
155
|
return match[1];
|
|
@@ -155,6 +179,9 @@ export default class ReferenceOf implements IModel {
|
|
|
155
179
|
if (this.getItemSetName(grn) == null || this.getItemSetName(grn) === '') {
|
|
156
180
|
return false;
|
|
157
181
|
}
|
|
182
|
+
if (this.getReferenceOfName(grn) == null || this.getReferenceOfName(grn) === '') {
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
158
185
|
return true;
|
|
159
186
|
}
|
|
160
187
|
|
|
@@ -166,6 +193,7 @@ export default class ReferenceOf implements IModel {
|
|
|
166
193
|
inventoryName: string|null,
|
|
167
194
|
itemName: string|null,
|
|
168
195
|
itemSetName: string|null,
|
|
196
|
+
referenceOfName: string|null,
|
|
169
197
|
): string|null {
|
|
170
198
|
return grnFormat
|
|
171
199
|
.replace('{region}', region ?? '')
|
|
@@ -174,7 +202,8 @@ export default class ReferenceOf implements IModel {
|
|
|
174
202
|
.replace('{userId}', userId ?? '')
|
|
175
203
|
.replace('{inventoryName}', inventoryName ?? '')
|
|
176
204
|
.replace('{itemName}', itemName ?? '')
|
|
177
|
-
.replace('{itemSetName}', itemSetName ?? '')
|
|
205
|
+
.replace('{itemSetName}', itemSetName ?? '')
|
|
206
|
+
.replace('{referenceOfName}', referenceOfName ?? '');
|
|
178
207
|
}
|
|
179
208
|
public getReferenceOfId(): string|null {
|
|
180
209
|
return this.referenceOfId;
|