Skip to content

Instantly share code, notes, and snippets.

@darksunlight
Last active August 28, 2022 04:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darksunlight/92cd7771c08728fa50dd72f3210171f8 to your computer and use it in GitHub Desktop.
Save darksunlight/92cd7771c08728fa50dd72f3210171f8 to your computer and use it in GitHub Desktop.
Impulse API Updates (Jul 2022)

Impulse Backend Changes (Jul 2022)

This backend update introduces significant changes to the gateway. There are no changes to the HTTP API.

The official web client has been updated to accomodate these changes.

Gateway

Breaking changes

  • Gateway events have been reorganised
  • _SUCCESS and _ERROR events have been removed in favour of GatewayMessages' success property
  • Gateway error messages are no longer human readable; this should be handled client-side
  • Gateway now closes the connection if a client does not respond to pings from the server in 30 seconds

Reorganised events

enum GatewayEvent {
	WELCOME,

	AUTHENTICATE,

	APP_LOGIN_AUTHENTICATE,
	APP_LOGIN,

	SYSTEM_ANNOUNCEMENT,

	GROUPS_GET,
	GROUP_NEW,
	GROUP_UPDATE,
	GROUP_REMOVE,

	CHANNELS_GET,
	CHANNEL_CREATE,
	CHANNEL_UPDATE,
	CHANNEL_REMOVE,
	CHANNEL_DISCONNECT,
	CHANNEL_HISTORY,
	CHANNEL_JOIN,

	MEMBER_CREATE,
	MEMBER_UPDATE,
	MEMBER_REMOVE,

	GROUP_BAN_CREATE,
	GROUP_BAN_UPDATE,

	MESSAGE_SEND,
	MESSAGE_CREATE,
	MESSAGE_UPDATE,
	MESSAGE_REMOVE,

	ROLE_UPDATE,
	ROLE_REMOVE,

	MEMBER_LIST,
	MEMBER_LIST_UPDATE,

	PING = 9001
}

Updated GatewayMessage type

export class GatewayMessage<T> {
	success: boolean;
	event: GatewayEvent;
	data: T;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment