homey-api 3.0.14 → 3.0.16
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.
|
@@ -3911,6 +3911,8 @@ export class AthomStoreAPI {
|
|
|
3911
3911
|
subscriptionQuantity?: number;
|
|
3912
3912
|
|
|
3913
3913
|
subscriptionDuration?: string;
|
|
3914
|
+
|
|
3915
|
+
maxRedeems?: number;
|
|
3914
3916
|
}): Promise<any>;
|
|
3915
3917
|
|
|
3916
3918
|
redeemCoupon(opts: { couponCode: string }): Promise<any>;
|
|
@@ -4111,6 +4113,8 @@ export class AthomStoreAPI {
|
|
|
4111
4113
|
subscriptionQuantity?: number;
|
|
4112
4114
|
|
|
4113
4115
|
subscriptionDuration?: string;
|
|
4116
|
+
|
|
4117
|
+
maxRedeems?: number;
|
|
4114
4118
|
}): Promise<any>;
|
|
4115
4119
|
|
|
4116
4120
|
redeemCoupon(opts: { couponCode: string }): Promise<any>;
|
|
@@ -6931,6 +6935,8 @@ export class AthomStoreAPI {
|
|
|
6931
6935
|
subscriptionQuantity?: number;
|
|
6932
6936
|
|
|
6933
6937
|
subscriptionDuration?: string;
|
|
6938
|
+
|
|
6939
|
+
maxRedeems?: number;
|
|
6934
6940
|
}): Promise<any>;
|
|
6935
6941
|
|
|
6936
6942
|
redeemCoupon(opts: { couponCode: string }): Promise<any>;
|
|
@@ -7131,6 +7137,8 @@ export class AthomStoreAPI {
|
|
|
7131
7137
|
subscriptionQuantity?: number;
|
|
7132
7138
|
|
|
7133
7139
|
subscriptionDuration?: string;
|
|
7140
|
+
|
|
7141
|
+
maxRedeems?: number;
|
|
7134
7142
|
}): Promise<any>;
|
|
7135
7143
|
|
|
7136
7144
|
redeemCoupon(opts: { couponCode: string }): Promise<any>;
|
|
@@ -189,19 +189,22 @@ class Manager extends EventEmitter {
|
|
|
189
189
|
path = `${path}?${queryString}`;
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
+
const pendingCallId = `${operationId}::${path}`
|
|
193
|
+
|
|
192
194
|
if (
|
|
193
195
|
operation.method.toLowerCase() === 'get' &&
|
|
194
196
|
$cache === true &&
|
|
195
|
-
this.__pendingCalls[
|
|
197
|
+
this.__pendingCalls[pendingCallId] != null &&
|
|
196
198
|
Object.keys(body).length === 0
|
|
197
199
|
) {
|
|
198
|
-
this.__debug(`Reusing pending call ${
|
|
199
|
-
|
|
200
|
+
this.__debug(`Reusing pending call ${pendingCallId}`);
|
|
201
|
+
|
|
202
|
+
const result = await this.__pendingCalls[pendingCallId];
|
|
200
203
|
|
|
201
204
|
return result;
|
|
202
205
|
}
|
|
203
206
|
|
|
204
|
-
|
|
207
|
+
const pendingCall = (async () => {
|
|
205
208
|
const result = await this.__request({
|
|
206
209
|
$validate,
|
|
207
210
|
$cache,
|
|
@@ -217,11 +220,21 @@ class Manager extends EventEmitter {
|
|
|
217
220
|
});
|
|
218
221
|
|
|
219
222
|
return result;
|
|
220
|
-
})()
|
|
221
|
-
|
|
222
|
-
|
|
223
|
+
})();
|
|
224
|
+
|
|
225
|
+
if (
|
|
226
|
+
operation.method.toLowerCase() === 'get' &&
|
|
227
|
+
$cache === true &&
|
|
228
|
+
this.__pendingCalls[pendingCallId] == null &&
|
|
229
|
+
Object.keys(body).length === 0
|
|
230
|
+
) {
|
|
231
|
+
this.__pendingCalls[pendingCallId] = pendingCall;
|
|
232
|
+
this.__pendingCalls[pendingCallId].finally(() => {
|
|
233
|
+
delete this.__pendingCalls[pendingCallId];
|
|
234
|
+
});
|
|
235
|
+
}
|
|
223
236
|
|
|
224
|
-
const result = await
|
|
237
|
+
const result = await pendingCall;
|
|
225
238
|
|
|
226
239
|
return result;
|
|
227
240
|
},
|