Skip to content

Commit 0f0648f

Browse files
committed
test(contracts): fix types in contracts
1 parent 96e10ff commit 0f0648f

File tree

16 files changed

+755
-9746
lines changed

16 files changed

+755
-9746
lines changed

lib/core/components/base64_codec.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
* @internal
66
*/
77
Object.defineProperty(exports, "__esModule", { value: true });
8-
exports.encode = exports.decode = void 0;
8+
exports.decode = decode;
9+
exports.encode = encode;
910
const BASE64_CHARMAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
1011
/**
1112
* Decode a Base64 encoded string.
@@ -54,7 +55,6 @@ function decode(paddedInput) {
5455
}
5556
return data;
5657
}
57-
exports.decode = decode;
5858
/**
5959
* Encode `ArrayBuffer` as a Base64 encoded string.
6060
*
@@ -102,4 +102,3 @@ function encode(input) {
102102
}
103103
return base64;
104104
}
105-
exports.encode = encode;

lib/core/components/stringify_buffer_keys.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @internal
66
*/
77
Object.defineProperty(exports, "__esModule", { value: true });
8-
exports.stringifyBufferKeys = void 0;
8+
exports.stringifyBufferKeys = stringifyBufferKeys;
99
/**
1010
* Re-map CBOR object keys from potentially C buffer strings to actual strings.
1111
*
@@ -39,4 +39,3 @@ function stringifyBufferKeys(obj) {
3939
});
4040
return normalizedObject;
4141
}
42-
exports.stringifyBufferKeys = stringifyBufferKeys;

lib/core/components/token_manager.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ class TokenManager {
110110
* @param permissions - Bit-encoded resource permissions.
111111
*
112112
* @returns Human-readable resource permissions.
113+
*
114+
* @internal
113115
*/
114116
extractPermissions(permissions) {
115117
const permissionsResult = {

lib/errors/pubnub-error.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
66
return (mod && mod.__esModule) ? mod : { "default": mod };
77
};
88
Object.defineProperty(exports, "__esModule", { value: true });
9-
exports.createValidationError = exports.PubNubError = void 0;
9+
exports.PubNubError = void 0;
10+
exports.createValidationError = createValidationError;
1011
const categories_1 = __importDefault(require("../core/constants/categories"));
1112
/**
1213
* PubNub operation error.
@@ -60,4 +61,3 @@ function createError(errorPayload) {
6061
function createValidationError(message, statusCode) {
6162
return createError(Object.assign({ message }, (statusCode !== undefined ? { statusCode } : {})));
6263
}
63-
exports.createValidationError = createValidationError;

lib/event-engine/core/types.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
* @internal
66
*/
77
Object.defineProperty(exports, "__esModule", { value: true });
8-
exports.createManagedEffect = exports.createEffect = exports.createEvent = void 0;
8+
exports.createEvent = createEvent;
9+
exports.createEffect = createEffect;
10+
exports.createManagedEffect = createManagedEffect;
911
/**
1012
* Create and configure event engine event.
1113
*
@@ -21,7 +23,6 @@ function createEvent(type, fn) {
2123
creator.type = type;
2224
return creator;
2325
}
24-
exports.createEvent = createEvent;
2526
/**
2627
* Create and configure short-term effect invocation.
2728
*
@@ -34,7 +35,6 @@ function createEffect(type, fn) {
3435
creator.type = type;
3536
return creator;
3637
}
37-
exports.createEffect = createEffect;
3838
/**
3939
* Create and configure long-running effect invocation.
4040
*
@@ -48,4 +48,3 @@ function createManagedEffect(type, fn) {
4848
creator.cancel = { type: 'CANCEL', payload: type, managed: false };
4949
return creator;
5050
}
51-
exports.createManagedEffect = createManagedEffect;

lib/event-engine/dispatcher.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class EventEngineDispatcher extends core_1.Dispatcher {
7070
}
7171
}
7272
})));
73-
this.on(effects.receiveMessages.type, (0, core_1.asyncHandler)((payload_2, abortSignal_2, _b) => __awaiter(this, [payload_2, abortSignal_2, _b], void 0, function* (payload, abortSignal, { receiveMessages, config }) {
73+
this.on(effects.receiveMessages.type, (0, core_1.asyncHandler)((payload_1, abortSignal_1, _a) => __awaiter(this, [payload_1, abortSignal_1, _a], void 0, function* (payload, abortSignal, { receiveMessages, config }) {
7474
abortSignal.throwIfAborted();
7575
try {
7676
const result = yield receiveMessages({
@@ -92,15 +92,15 @@ class EventEngineDispatcher extends core_1.Dispatcher {
9292
}
9393
}
9494
})));
95-
this.on(effects.emitMessages.type, (0, core_1.asyncHandler)((payload_3, _1, _c) => __awaiter(this, [payload_3, _1, _c], void 0, function* (payload, _, { emitMessages }) {
95+
this.on(effects.emitMessages.type, (0, core_1.asyncHandler)((payload_1, _1, _a) => __awaiter(this, [payload_1, _1, _a], void 0, function* (payload, _, { emitMessages }) {
9696
if (payload.length > 0) {
9797
emitMessages(payload);
9898
}
9999
})));
100-
this.on(effects.emitStatus.type, (0, core_1.asyncHandler)((payload_4, _2, _d) => __awaiter(this, [payload_4, _2, _d], void 0, function* (payload, _, { emitStatus }) {
100+
this.on(effects.emitStatus.type, (0, core_1.asyncHandler)((payload_1, _1, _a) => __awaiter(this, [payload_1, _1, _a], void 0, function* (payload, _, { emitStatus }) {
101101
emitStatus(payload);
102102
})));
103-
this.on(effects.receiveReconnect.type, (0, core_1.asyncHandler)((payload_5, abortSignal_3, _e) => __awaiter(this, [payload_5, abortSignal_3, _e], void 0, function* (payload, abortSignal, { receiveMessages, delay, config }) {
103+
this.on(effects.receiveReconnect.type, (0, core_1.asyncHandler)((payload_1, abortSignal_1, _a) => __awaiter(this, [payload_1, abortSignal_1, _a], void 0, function* (payload, abortSignal, { receiveMessages, delay, config }) {
104104
if (config.retryConfiguration && config.retryConfiguration.shouldRetry(payload.reason, payload.attempts)) {
105105
abortSignal.throwIfAborted();
106106
yield delay(config.retryConfiguration.getDelay(payload.attempts, payload.reason));
@@ -130,7 +130,7 @@ class EventEngineDispatcher extends core_1.Dispatcher {
130130
: 'Unable to complete subscribe messages receive.')));
131131
}
132132
})));
133-
this.on(effects.handshakeReconnect.type, (0, core_1.asyncHandler)((payload_6, abortSignal_4, _f) => __awaiter(this, [payload_6, abortSignal_4, _f], void 0, function* (payload, abortSignal, { handshake, delay, presenceState, config }) {
133+
this.on(effects.handshakeReconnect.type, (0, core_1.asyncHandler)((payload_1, abortSignal_1, _a) => __awaiter(this, [payload_1, abortSignal_1, _a], void 0, function* (payload, abortSignal, { handshake, delay, presenceState, config }) {
134134
if (config.retryConfiguration && config.retryConfiguration.shouldRetry(payload.reason, payload.attempts)) {
135135
abortSignal.throwIfAborted();
136136
yield delay(config.retryConfiguration.getDelay(payload.attempts, payload.reason));

lib/event-engine/presence/dispatcher.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class PresenceEventEngineDispatcher extends core_1.Dispatcher {
7070
}
7171
}
7272
})));
73-
this.on(effects.leave.type, (0, core_1.asyncHandler)((payload_2, _2, _b) => __awaiter(this, [payload_2, _2, _b], void 0, function* (payload, _, { leave, config }) {
73+
this.on(effects.leave.type, (0, core_1.asyncHandler)((payload_1, _1, _a) => __awaiter(this, [payload_1, _1, _a], void 0, function* (payload, _, { leave, config }) {
7474
if (!config.suppressLeaveEvents) {
7575
try {
7676
leave({
@@ -81,13 +81,13 @@ class PresenceEventEngineDispatcher extends core_1.Dispatcher {
8181
catch (e) { }
8282
}
8383
})));
84-
this.on(effects.wait.type, (0, core_1.asyncHandler)((_3, abortSignal_1, _c) => __awaiter(this, [_3, abortSignal_1, _c], void 0, function* (_, abortSignal, { heartbeatDelay }) {
84+
this.on(effects.wait.type, (0, core_1.asyncHandler)((_1, abortSignal_1, _a) => __awaiter(this, [_1, abortSignal_1, _a], void 0, function* (_, abortSignal, { heartbeatDelay }) {
8585
abortSignal.throwIfAborted();
8686
yield heartbeatDelay();
8787
abortSignal.throwIfAborted();
8888
return engine.transition(events.timesUp());
8989
})));
90-
this.on(effects.delayedHeartbeat.type, (0, core_1.asyncHandler)((payload_3, abortSignal_2, _d) => __awaiter(this, [payload_3, abortSignal_2, _d], void 0, function* (payload, abortSignal, { heartbeat, retryDelay, presenceState, config }) {
90+
this.on(effects.delayedHeartbeat.type, (0, core_1.asyncHandler)((payload_1, abortSignal_1, _a) => __awaiter(this, [payload_1, abortSignal_1, _a], void 0, function* (payload, abortSignal, { heartbeat, retryDelay, presenceState, config }) {
9191
if (config.retryConfiguration && config.retryConfiguration.shouldRetry(payload.reason, payload.attempts)) {
9292
abortSignal.throwIfAborted();
9393
yield retryDelay(config.retryConfiguration.getDelay(payload.attempts, payload.reason));
@@ -108,9 +108,9 @@ class PresenceEventEngineDispatcher extends core_1.Dispatcher {
108108
return engine.transition(events.heartbeatGiveup());
109109
}
110110
})));
111-
this.on(effects.emitStatus.type, (0, core_1.asyncHandler)((payload_4, _4, _e) => __awaiter(this, [payload_4, _4, _e], void 0, function* (payload, _, { emitStatus, config }) {
112-
var _f;
113-
if (config.announceFailedHeartbeats && ((_f = payload === null || payload === void 0 ? void 0 : payload.status) === null || _f === void 0 ? void 0 : _f.error) === true) {
111+
this.on(effects.emitStatus.type, (0, core_1.asyncHandler)((payload_1, _1, _a) => __awaiter(this, [payload_1, _1, _a], void 0, function* (payload, _, { emitStatus, config }) {
112+
var _b;
113+
if (config.announceFailedHeartbeats && ((_b = payload === null || payload === void 0 ? void 0 : payload.status) === null || _b === void 0 ? void 0 : _b.error) === true) {
114114
emitStatus(payload.status);
115115
}
116116
else if (config.announceSuccessfulHeartbeats && payload.statusCode === 200) {

0 commit comments

Comments
 (0)