@sprucelabs/mercury-client 42.0.554 → 42.0.556

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.
Files changed (143) hide show
  1. package/build/.spruce/errors/errors.types.js.map +1 -0
  2. package/build/.spruce/errors/mercuryClient/connectionFailed.schema.js.map +1 -0
  3. package/build/.spruce/errors/mercuryClient/invalidEventSignature.schema.js.map +1 -0
  4. package/build/.spruce/errors/mercuryClient/invalidPayload.schema.js.map +1 -0
  5. package/build/.spruce/errors/mercuryClient/invalidProtocol.schema.js.map +1 -0
  6. package/build/.spruce/errors/mercuryClient/missingTestCacheDir.schema.js.map +1 -0
  7. package/build/.spruce/errors/mercuryClient/mustCreateEvent.schema.js.map +1 -0
  8. package/build/.spruce/errors/mercuryClient/mustHandleLocally.schema.js.map +1 -0
  9. package/build/.spruce/errors/mercuryClient/notConnected.schema.js.map +1 -0
  10. package/build/.spruce/errors/mercuryClient/timeout.schema.js.map +1 -0
  11. package/build/.spruce/errors/mercuryClient/unauthorizedAccess.schema.js.map +1 -0
  12. package/build/.spruce/errors/mercuryClient/unauthorizedTarget.schema.js.map +1 -0
  13. package/build/.spruce/errors/mercuryClient/unexpectedPayload.schema.js.map +1 -0
  14. package/build/.spruce/errors/mercuryClient/unknownError.schema.js.map +1 -0
  15. package/build/.spruce/errors/options.types.js.map +1 -0
  16. package/build/.spruce/event-cache.json +1 -0
  17. package/build/.spruce/schemas/fields/fieldClassMap.js.map +1 -0
  18. package/build/.spruce/schemas/fields/fields.types.js.map +1 -0
  19. package/build/.spruce/schemas/schemas.types.js.map +1 -0
  20. package/build/__tests__/behavioral/AuthenticatingAndReauthenticating.test.d.ts +21 -0
  21. package/build/__tests__/behavioral/AuthenticatingAndReauthenticating.test.js +287 -0
  22. package/build/__tests__/behavioral/AuthenticatingAndReauthenticating.test.js.map +1 -0
  23. package/build/__tests__/behavioral/DisablingPermissionChecksWhenEmittingLocally.test.d.ts +7 -0
  24. package/build/__tests__/behavioral/DisablingPermissionChecksWhenEmittingLocally.test.js +49 -0
  25. package/build/__tests__/behavioral/DisablingPermissionChecksWhenEmittingLocally.test.js.map +1 -0
  26. package/build/__tests__/behavioral/EmittingAndFlatteningResponses.test.d.ts +52 -0
  27. package/build/__tests__/behavioral/EmittingAndFlatteningResponses.test.js +123 -0
  28. package/build/__tests__/behavioral/EmittingAndFlatteningResponses.test.js.map +1 -0
  29. package/build/__tests__/behavioral/EmittingConnectionChangeInTests.test.d.ts +9 -0
  30. package/build/__tests__/behavioral/EmittingConnectionChangeInTests.test.js +103 -0
  31. package/build/__tests__/behavioral/EmittingConnectionChangeInTests.test.js.map +1 -0
  32. package/build/__tests__/behavioral/LocallyHandlingAuthenticateDelaysConnect.test.d.ts +7 -0
  33. package/build/__tests__/behavioral/LocallyHandlingAuthenticateDelaysConnect.test.js +91 -0
  34. package/build/__tests__/behavioral/LocallyHandlingAuthenticateDelaysConnect.test.js.map +1 -0
  35. package/build/__tests__/behavioral/MercuryClientFactory.test.d.ts +7 -0
  36. package/build/__tests__/behavioral/MercuryClientFactory.test.js +85 -0
  37. package/build/__tests__/behavioral/MercuryClientFactory.test.js.map +1 -0
  38. package/build/__tests__/behavioral/ProxyingEvents.test.d.ts +11 -0
  39. package/build/__tests__/behavioral/ProxyingEvents.test.js +99 -0
  40. package/build/__tests__/behavioral/ProxyingEvents.test.js.map +1 -0
  41. package/build/__tests__/behavioral/ReconnectingAutomatically.test.d.ts +33 -0
  42. package/build/__tests__/behavioral/ReconnectingAutomatically.test.js +390 -0
  43. package/build/__tests__/behavioral/ReconnectingAutomatically.test.js.map +1 -0
  44. package/build/__tests__/behavioral/RequiringLocalListeners.test.d.ts +7 -0
  45. package/build/__tests__/behavioral/RequiringLocalListeners.test.js +65 -0
  46. package/build/__tests__/behavioral/RequiringLocalListeners.test.js.map +1 -0
  47. package/build/__tests__/behavioral/SettingNamespacesThatMustBeHandledLocally.test.d.ts +9 -0
  48. package/build/__tests__/behavioral/SettingNamespacesThatMustBeHandledLocally.test.js +66 -0
  49. package/build/__tests__/behavioral/SettingNamespacesThatMustBeHandledLocally.test.js.map +1 -0
  50. package/build/__tests__/behavioral/SimulatingEventsForTesting.test.d.ts +51 -0
  51. package/build/__tests__/behavioral/SimulatingEventsForTesting.test.js +821 -0
  52. package/build/__tests__/behavioral/SimulatingEventsForTesting.test.js.map +1 -0
  53. package/build/__tests__/behavioral/TestClientSpeedTests.test.d.ts +7 -0
  54. package/build/__tests__/behavioral/TestClientSpeedTests.test.js +44 -0
  55. package/build/__tests__/behavioral/TestClientSpeedTests.test.js.map +1 -0
  56. package/build/__tests__/behavioral/TestingWithDefaultContracts.test.d.ts +7 -0
  57. package/build/__tests__/behavioral/TestingWithDefaultContracts.test.js +56 -0
  58. package/build/__tests__/behavioral/TestingWithDefaultContracts.test.js.map +1 -0
  59. package/build/__tests__/behavioral/TurningOffAListener.test.d.ts +16 -0
  60. package/build/__tests__/behavioral/TurningOffAListener.test.js +126 -0
  61. package/build/__tests__/behavioral/TurningOffAListener.test.js.map +1 -0
  62. package/build/__tests__/behavioral/UsingMercuryClient.test.d.ts +45 -0
  63. package/build/__tests__/behavioral/UsingMercuryClient.test.js +662 -0
  64. package/build/__tests__/behavioral/UsingMercuryClient.test.js.map +1 -0
  65. package/build/clients/MercuryClientFactory.js.map +1 -0
  66. package/build/clients/MercurySocketIoClient.js.map +1 -0
  67. package/build/clients/MercuryTestClient.js +2 -2
  68. package/build/clients/MercuryTestClient.js.map +1 -0
  69. package/build/clients/MutableContractClient.js.map +1 -0
  70. package/build/clients/statusChangePayloadSchema.js.map +1 -0
  71. package/build/constants.js.map +1 -0
  72. package/build/errors/SpruceError.js +1 -1
  73. package/build/errors/SpruceError.js.map +1 -0
  74. package/build/errors/connectionFailed.builder.js.map +1 -0
  75. package/build/errors/invalidEventSignature.builder.js.map +1 -0
  76. package/build/errors/invalidPayload.builder.js.map +1 -0
  77. package/build/errors/invalidProtocol.builder.js.map +1 -0
  78. package/build/errors/missingTestCacheDir.builder.js.map +1 -0
  79. package/build/errors/mustCreateEvent.builder.js.map +1 -0
  80. package/build/errors/mustHandleLocally.builder.js.map +1 -0
  81. package/build/errors/notConnected.builder.js.map +1 -0
  82. package/build/errors/timeout.builder.js.map +1 -0
  83. package/build/errors/unauthorizedAccess.builder.js.map +1 -0
  84. package/build/errors/unexpectedPayload.builder.js.map +1 -0
  85. package/build/errors/unknownError.builder.js.map +1 -0
  86. package/build/index.js.map +1 -0
  87. package/build/tests/AbstractClientTest.js.map +1 -0
  88. package/build/tests/constants.js.map +1 -0
  89. package/build/types/client.types.js.map +1 -0
  90. package/build/utilities/socketIoEventUtil.utility.js.map +1 -0
  91. package/package.json +16 -17
  92. package/build/esm/.spruce/errors/errors.types.d.ts +0 -324
  93. package/build/esm/.spruce/errors/errors.types.js +0 -1
  94. package/build/esm/.spruce/errors/options.types.d.ts +0 -40
  95. package/build/esm/.spruce/errors/options.types.js +0 -1
  96. package/build/esm/clients/MercuryClientFactory.d.ts +0 -26
  97. package/build/esm/clients/MercuryClientFactory.js +0 -96
  98. package/build/esm/clients/MercurySocketIoClient.d.ts +0 -89
  99. package/build/esm/clients/MercurySocketIoClient.js +0 -605
  100. package/build/esm/clients/MercuryTestClient.d.ts +0 -57
  101. package/build/esm/clients/MercuryTestClient.js +0 -389
  102. package/build/esm/clients/MutableContractClient.d.ts +0 -10
  103. package/build/esm/clients/MutableContractClient.js +0 -43
  104. package/build/esm/clients/statusChangePayloadSchema.d.ts +0 -103
  105. package/build/esm/clients/statusChangePayloadSchema.js +0 -45
  106. package/build/esm/constants.d.ts +0 -1
  107. package/build/esm/constants.js +0 -1
  108. package/build/esm/errors/SpruceError.d.ts +0 -5
  109. package/build/esm/errors/SpruceError.js +0 -66
  110. package/build/esm/errors/connectionFailed.builder.d.ts +0 -16
  111. package/build/esm/errors/connectionFailed.builder.js +0 -16
  112. package/build/esm/errors/invalidEventSignature.builder.d.ts +0 -15
  113. package/build/esm/errors/invalidEventSignature.builder.js +0 -15
  114. package/build/esm/errors/invalidPayload.builder.d.ts +0 -12
  115. package/build/esm/errors/invalidPayload.builder.js +0 -12
  116. package/build/esm/errors/invalidProtocol.builder.d.ts +0 -12
  117. package/build/esm/errors/invalidProtocol.builder.js +0 -12
  118. package/build/esm/errors/missingTestCacheDir.builder.d.ts +0 -7
  119. package/build/esm/errors/missingTestCacheDir.builder.js +0 -7
  120. package/build/esm/errors/mustCreateEvent.builder.d.ts +0 -11
  121. package/build/esm/errors/mustCreateEvent.builder.js +0 -11
  122. package/build/esm/errors/mustHandleLocally.builder.d.ts +0 -11
  123. package/build/esm/errors/mustHandleLocally.builder.js +0 -11
  124. package/build/esm/errors/notConnected.builder.d.ts +0 -16
  125. package/build/esm/errors/notConnected.builder.js +0 -16
  126. package/build/esm/errors/timeout.builder.d.ts +0 -22
  127. package/build/esm/errors/timeout.builder.js +0 -22
  128. package/build/esm/errors/unauthorizedAccess.builder.d.ts +0 -57
  129. package/build/esm/errors/unauthorizedAccess.builder.js +0 -39
  130. package/build/esm/errors/unexpectedPayload.builder.d.ts +0 -12
  131. package/build/esm/errors/unexpectedPayload.builder.js +0 -12
  132. package/build/esm/errors/unknownError.builder.d.ts +0 -6
  133. package/build/esm/errors/unknownError.builder.js +0 -6
  134. package/build/esm/index.d.ts +0 -6
  135. package/build/esm/index.js +0 -6
  136. package/build/esm/tests/AbstractClientTest.d.ts +0 -31
  137. package/build/esm/tests/AbstractClientTest.js +0 -212
  138. package/build/esm/tests/constants.d.ts +0 -9
  139. package/build/esm/tests/constants.js +0 -11
  140. package/build/esm/types/client.types.d.ts +0 -30
  141. package/build/esm/types/client.types.js +0 -1
  142. package/build/esm/utilities/socketIoEventUtil.utility.d.ts +0 -5
  143. package/build/esm/utilities/socketIoEventUtil.utility.js +0 -9
@@ -1,40 +0,0 @@
1
- import { SpruceErrors } from "./errors.types";
2
- import { ErrorOptions as ISpruceErrorOptions } from "@sprucelabs/error";
3
- export interface UnknownErrorErrorOptions extends SpruceErrors.MercuryClient.UnknownError, ISpruceErrorOptions {
4
- code: 'UNKNOWN_ERROR';
5
- }
6
- export interface UnexpectedPayloadErrorOptions extends SpruceErrors.MercuryClient.UnexpectedPayload, ISpruceErrorOptions {
7
- code: 'UNEXPECTED_PAYLOAD';
8
- }
9
- export interface UnauthorizedAccessErrorOptions extends SpruceErrors.MercuryClient.UnauthorizedAccess, ISpruceErrorOptions {
10
- code: 'UNAUTHORIZED_ACCESS';
11
- }
12
- export interface TimeoutErrorOptions extends SpruceErrors.MercuryClient.Timeout, ISpruceErrorOptions {
13
- code: 'TIMEOUT';
14
- }
15
- export interface NotConnectedErrorOptions extends SpruceErrors.MercuryClient.NotConnected, ISpruceErrorOptions {
16
- code: 'NOT_CONNECTED';
17
- }
18
- export interface MustHandleLocallyErrorOptions extends SpruceErrors.MercuryClient.MustHandleLocally, ISpruceErrorOptions {
19
- code: 'MUST_HANDLE_LOCALLY';
20
- }
21
- export interface MustCreateEventErrorOptions extends SpruceErrors.MercuryClient.MustCreateEvent, ISpruceErrorOptions {
22
- code: 'MUST_CREATE_EVENT';
23
- }
24
- export interface MissingTestCacheDirErrorOptions extends SpruceErrors.MercuryClient.MissingTestCacheDir, ISpruceErrorOptions {
25
- code: 'MISSING_TEST_CACHE_DIR';
26
- }
27
- export interface InvalidProtocolErrorOptions extends SpruceErrors.MercuryClient.InvalidProtocol, ISpruceErrorOptions {
28
- code: 'INVALID_PROTOCOL';
29
- }
30
- export interface InvalidPayloadErrorOptions extends SpruceErrors.MercuryClient.InvalidPayload, ISpruceErrorOptions {
31
- code: 'INVALID_PAYLOAD';
32
- }
33
- export interface InvalidEventSignatureErrorOptions extends SpruceErrors.MercuryClient.InvalidEventSignature, ISpruceErrorOptions {
34
- code: 'INVALID_EVENT_SIGNATURE';
35
- }
36
- export interface ConnectionFailedErrorOptions extends SpruceErrors.MercuryClient.ConnectionFailed, ISpruceErrorOptions {
37
- code: 'CONNECTION_FAILED';
38
- }
39
- type ErrorOptions = UnknownErrorErrorOptions | UnexpectedPayloadErrorOptions | UnauthorizedAccessErrorOptions | TimeoutErrorOptions | NotConnectedErrorOptions | MustHandleLocallyErrorOptions | MustCreateEventErrorOptions | MissingTestCacheDirErrorOptions | InvalidProtocolErrorOptions | InvalidPayloadErrorOptions | InvalidEventSignatureErrorOptions | ConnectionFailedErrorOptions;
40
- export default ErrorOptions;
@@ -1 +0,0 @@
1
- export {};
@@ -1,26 +0,0 @@
1
- import { EventContract, SkillEventContract } from '@sprucelabs/mercury-types';
2
- import { ConnectionOptions, MercuryClient } from '../types/client.types';
3
- import MutableContractClient from './MutableContractClient';
4
- export default class MercuryClientFactory {
5
- private static isTestMode;
6
- private static defaultContract;
7
- private static timeoutMs;
8
- private static totalClients;
9
- private static clients;
10
- static ClientClass: new (...args: any[]) => MutableContractClient<EventContract>;
11
- static Client<Contract extends SkillEventContract = SkillEventContract>(connectionOptions?: ConnectionOptions): Promise<Client<Contract>>;
12
- static isInTestMode(): boolean;
13
- static setIsTestMode(isTestMode: boolean): void;
14
- static setDefaultContract(contract: EventContract): void;
15
- static hasDefaultContract(): boolean;
16
- static clearDefaultContract(): void;
17
- private static resetTestClient;
18
- static setDefaultTimeoutMs(ms: number): void;
19
- static getTotalClients(): number;
20
- static reset(): void;
21
- static getClients(): Client<import("@sprucelabs/mercury-types").SpruceSchemas.Mercury.v2020_12_25.EventContract>[];
22
- }
23
- export type Client<Contract extends EventContract> = MercuryClient<Contract> & {
24
- doesHandleEvent(eventName: string): boolean;
25
- mixinContract(eventContract: EventContract): void;
26
- };
@@ -1,96 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { SchemaError } from '@sprucelabs/schema';
11
- import { eventContractUtil } from '@sprucelabs/spruce-event-utils';
12
- import { DEFAULT_HOST } from '../constants.js';
13
- import SpruceError from '../errors/SpruceError.js';
14
- import MutableContractClient from './MutableContractClient.js';
15
- class MercuryClientFactory {
16
- static Client(connectionOptions) {
17
- return __awaiter(this, void 0, void 0, function* () {
18
- var _a;
19
- const { host: hostOption, contracts, reconnectDelayMs, allowSelfSignedCrt, emitTimeoutMs = this.timeoutMs, shouldReconnect, maxEmitRetries, connectionRetries, } = connectionOptions || {};
20
- const host = hostOption !== null && hostOption !== void 0 ? hostOption : DEFAULT_HOST;
21
- if (host.substr(0, 4) !== 'http') {
22
- throw new SpruceError({ code: 'INVALID_PROTOCOL', uri: host });
23
- }
24
- if (contracts && !Array.isArray(contracts)) {
25
- throw new SchemaError({
26
- code: 'INVALID_PARAMETERS',
27
- parameters: ['contracts'],
28
- });
29
- }
30
- const eventContract = !contracts && this.defaultContract
31
- ? this.defaultContract
32
- : //@ts-ignore
33
- eventContractUtil.unifyContracts(contracts !== null && contracts !== void 0 ? contracts : []);
34
- let Client = MutableContractClient;
35
- if (this.isTestMode) {
36
- //TODO, make this something fitxures sets to make the test client available
37
- Client = require('../clients/MercuryTestClient.js').default;
38
- }
39
- const client = new ((_a = MercuryClientFactory.ClientClass) !== null && _a !== void 0 ? _a :
40
- //@ts-ignore
41
- Client)({
42
- host,
43
- reconnection: false,
44
- reconnectDelayMs,
45
- rejectUnauthorized: !allowSelfSignedCrt,
46
- eventContract,
47
- emitTimeoutMs,
48
- shouldReconnect,
49
- maxEmitRetries,
50
- connectionRetries,
51
- });
52
- yield client.connect();
53
- this.totalClients++;
54
- this.clients.push(client);
55
- return client;
56
- });
57
- }
58
- static isInTestMode() {
59
- return this.isTestMode;
60
- }
61
- static setIsTestMode(isTestMode) {
62
- this.isTestMode = isTestMode;
63
- }
64
- static setDefaultContract(contract) {
65
- this.defaultContract = contract;
66
- }
67
- static hasDefaultContract() {
68
- return !!this.defaultContract;
69
- }
70
- static clearDefaultContract() {
71
- this.defaultContract = undefined;
72
- }
73
- static resetTestClient() {
74
- const Client = require('../clients/MercuryTestClient.js').default;
75
- Client.reset();
76
- }
77
- static setDefaultTimeoutMs(ms) {
78
- this.timeoutMs = ms;
79
- }
80
- static getTotalClients() {
81
- return this.totalClients;
82
- }
83
- static reset() {
84
- this.totalClients = 0;
85
- this.clients = [];
86
- this.resetTestClient();
87
- }
88
- static getClients() {
89
- return this.clients;
90
- }
91
- }
92
- MercuryClientFactory.isTestMode = false;
93
- MercuryClientFactory.timeoutMs = 30000;
94
- MercuryClientFactory.totalClients = 0;
95
- MercuryClientFactory.clients = [];
96
- export default MercuryClientFactory;
@@ -1,89 +0,0 @@
1
- import { EmitCallback, EventContract, EventName, EventSignature, MercuryAggregateResponse, SpruceSchemas } from '@sprucelabs/mercury-types';
2
- import { Schema, SchemaValues } from '@sprucelabs/schema';
3
- import { io, SocketOptions, ManagerOptions } from 'socket.io-client';
4
- import { ConnectionOptions, MercuryClient } from '../types/client.types';
5
- export default class MercurySocketIoClient<Contract extends EventContract> implements MercuryClient<Contract> {
6
- protected _eventContract?: Contract;
7
- protected get eventContract(): Contract;
8
- protected set eventContract(contract: Contract);
9
- static io: typeof io;
10
- private log;
11
- private host;
12
- private ioOptions;
13
- private socket?;
14
- private proxyToken;
15
- private emitTimeoutMs;
16
- private reconnectDelayMs;
17
- private listenerMap;
18
- private isReAuthing;
19
- private reconnectPromise;
20
- protected lastAuthOptions?: {
21
- skillId?: string | undefined;
22
- apiKey?: string | undefined;
23
- token?: string | undefined;
24
- };
25
- private shouldReconnect;
26
- private connectionRetriesRemaining;
27
- private connectionRetries;
28
- private registeredListeners;
29
- private allowNextEventToBeAuthenticate;
30
- protected auth?: {
31
- skill?: SpruceSchemas.Spruce.v2020_07_22.Skill;
32
- person?: SpruceSchemas.Spruce.v2020_07_22.Person;
33
- };
34
- private shouldAutoRegisterListeners;
35
- private isManuallyDisconnected;
36
- private isReconnecting;
37
- private id;
38
- private skipWaitIfReconnecting;
39
- private maxEmitRetries;
40
- private authRawResults?;
41
- protected authPromise?: any;
42
- protected shouldRegisterProxyOnReconnect: boolean;
43
- private reconnectKey?;
44
- constructor(options: {
45
- host: string;
46
- eventContract?: Contract;
47
- } & IoOptions);
48
- connect(): Promise<void>;
49
- private emitStatusChange;
50
- private attachConnectError;
51
- private attemptReconnectAfterDelay;
52
- protected reconnect(resolve: any, reject: any, retriesLeft: number): Promise<void>;
53
- protected waitIfReconnecting(): Promise<void>;
54
- private reRegisterAllListeners;
55
- private mapSocketErrorToSpruceError;
56
- emit<Name extends EventName<Contract>, IEventSignature extends EventSignature = Contract['eventSignatures'][EventName], EmitSchema extends Schema = IEventSignature['emitPayloadSchema'] extends Schema ? IEventSignature['emitPayloadSchema'] : never, ResponseSchema extends Schema = IEventSignature['responsePayloadSchema'] extends Schema ? IEventSignature['responsePayloadSchema'] : never, ResponsePayload = ResponseSchema extends Schema ? SchemaValues<ResponseSchema> : never>(eventName: Name, targetAndPayload?: (EmitSchema extends Schema ? SchemaValues<EmitSchema> : never) | EmitCallback<Contract, Name>, cb?: EmitCallback<Contract, Name>): Promise<MercuryAggregateResponse<ResponsePayload>>;
57
- private handleLocalEmit;
58
- emitAndFlattenResponses<Name extends EventName<Contract>, IEventSignature extends EventSignature = Contract['eventSignatures'][EventName], EmitSchema extends Schema = IEventSignature['emitPayloadSchema'] extends Schema ? IEventSignature['emitPayloadSchema'] : never, ResponseSchema extends Schema = IEventSignature['responsePayloadSchema'] extends Schema ? IEventSignature['responsePayloadSchema'] : never, ResponsePayload = ResponseSchema extends Schema ? SchemaValues<ResponseSchema> : never>(eventName: Name, payload?: (EmitSchema extends Schema ? SchemaValues<EmitSchema> : never) | EmitCallback<Contract, Name>, cb?: EmitCallback<Contract, Name>): Promise<ResponsePayload[]>;
59
- private _emit;
60
- protected assertValidEmitTargetAndPayload<Name extends EventName<Contract>>(eventName: Name, payload: any): void;
61
- private handleConfirmPinResponse;
62
- protected getEventSignatureByName<Name extends EventName<Contract>>(eventName: Name): SpruceSchemas.Mercury.v2020_12_25.EventSignature;
63
- setShouldAutoRegisterListeners(should: boolean): void;
64
- on<Name extends EventName<Contract>, IEventSignature extends EventSignature = Contract['eventSignatures'][EventName], EmitSchema extends Schema = IEventSignature['emitPayloadSchema'] extends Schema ? IEventSignature['emitPayloadSchema'] : never>(eventName: Name, cb: (payload: EmitSchema extends Schema ? SchemaValues<EmitSchema> : never) => IEventSignature['responsePayloadSchema'] extends Schema ? Promise<SchemaValues<IEventSignature['responsePayloadSchema']>> | SchemaValues<IEventSignature['responsePayloadSchema']> : Promise<void> | void): Promise<void>;
65
- private isEventLocal;
66
- off(eventName: EventName<Contract>, cb?: () => void): Promise<number>;
67
- private removeLocalListener;
68
- getId(): string;
69
- disconnect(): Promise<void>;
70
- authenticate(options: AuthenticateOptions): Promise<{
71
- skill: any;
72
- person: any;
73
- }>;
74
- isAuthenticated(): boolean;
75
- isConnected(): boolean;
76
- private isSocketConnected;
77
- getProxyToken(): string | null;
78
- setProxyToken(token: string): void;
79
- registerProxyToken(): Promise<any>;
80
- getIsTestClient(): boolean;
81
- }
82
- type IoOptions = Partial<ManagerOptions & SocketOptions & ConnectionOptions>;
83
- export declare const authenticateFqen = "authenticate::v2020_12_25";
84
- export interface AuthenticateOptions {
85
- skillId?: string;
86
- apiKey?: string;
87
- token?: string;
88
- }
89
- export {};