Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/integration/v2' into 2023-12-11-…
Browse files Browse the repository at this point in the history
…merge-main-into-v2
  • Loading branch information
lawrence-forooghian committed Jan 9, 2024
2 parents 5a43ef6 + e83597a commit 6138243
Show file tree
Hide file tree
Showing 18 changed files with 103 additions and 832 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- run: npm ci
- run: npm run lint
- run: npm run format:check
- run: npx tsc --noEmit ably.d.ts modules.d.ts build/ably-webworker.min.d.ts
- run: npx tsc --noEmit ably.d.ts modules.d.ts
# for some reason, this doesn't work in CI using `npx attw --pack .`
- run: npm pack
- run: npx attw ably-$(npm show ably version).tgz --summary --exclude-entrypoints 'ably/modules'
Expand Down
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,15 @@ This SDK supports the following platforms:

**Node.js:** version 8.17 or newer. (1.1.x versions work on Node.js 4.5 or newer). We do not currently provide an ESM bundle, please [contact us](https://www.ably.com/contact) if you would would like to use ably-js in a NodeJS ESM project.

**React (release candidate)** We offer a set of React Hooks which make it seamless to use ably-js in your React application. See the [React Hooks documentation](./docs/react.md) for more details.
**React (release candidate):** We offer a set of React Hooks which make it seamless to use ably-js in your React application. See the [React Hooks documentation](./docs/react.md) for more details.

**React Native:** We aim to support all platforms supported by React Native. If you find any issues please raise an issue or [contact us](https://www.ably.com/contact).

**NativeScript:** see [ably-js-nativescript](https://github.com/ably/ably-js-nativescript)

**TypeScript:** see [below](#typescript)

**WebWorkers**: We build a separate bundle which supports running in a [Web Worker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) context. You can import it like this:

```js
import Ably from 'ably/build/ably-webworker.min';
```
**WebWorkers:** The browser bundle supports running in a [Web Worker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) context. You can also use the [modular variant](#modular-tree-shakable-variant) of the library in Web Workers.

We regression-test the library against a selection of those (which will change over time, but usually consists of the versions that are supported upstream, plus old versions of IE).

Expand Down
152 changes: 10 additions & 142 deletions ably.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -751,122 +751,6 @@ declare namespace Types {
constructor(message: string, code: number, statusCode: number, cause?: string | Error | ErrorInfo);
}

/**
* Contains the aggregate counts for messages and data transferred.
*/
interface StatsMessageCount {
/**
* The count of all messages.
*/
count: number;
/**
* The total number of bytes transferred for all messages.
*/
data: number;
}

/**
* Contains a breakdown of summary stats data for different (channel vs presence) message types.
*/
interface StatsMessageTypes {
/**
* A {@link StatsMessageCount} object containing the count and byte value of messages and presence messages.
*/
all: StatsMessageCount;
/**
* A {@link StatsMessageCount} object containing the count and byte value of messages.
*/
messages: StatsMessageCount;
/**
* A {@link StatsMessageCount} object containing the count and byte value of presence messages.
*/
presence: StatsMessageCount;
}

/**
* Contains the aggregate counts for requests made.
*/
interface StatsRequestCount {
/**
* The number of requests that failed.
*/
failed: number;
/**
* The number of requests that were refused, typically as a result of permissions or a limit being exceeded.
*/
refused: number;
/**
* The number of requests that succeeded.
*/
succeeded: number;
}

/**
* Contains the aggregate data for usage of a resource in a specific scope.
*/
interface StatsResourceCount {
/**
* The average number of resources of this type used for this period.
*/
mean: number;
/**
* The minimum total resources of this type used for this period.
*/
min: number;
/**
* The total number of resources opened of this type.
*/
opened: number;
/**
* The peak number of resources of this type used for this period.
*/
peak: number;
/**
* The number of resource requests refused within this period.
*/
refused: number;
}

/**
* Contains a breakdown of summary stats data for different (TLS vs non-TLS) connection types.
*/
interface StatsConnectionTypes {
/**
* A {@link StatsResourceCount} object containing a breakdown of usage by scope over TLS connections (both TLS and non-TLS).
*/
all: StatsResourceCount;
/**
* A {@link StatsResourceCount} object containing a breakdown of usage by scope over non-TLS connections.
*/
plain: StatsResourceCount;
/**
* A {@link StatsResourceCount} object containing a breakdown of usage by scope over TLS connections.
*/
tls: StatsResourceCount;
}

/**
* Contains a breakdown of summary stats data for traffic over various transport types.
*/
interface StatsMessageTraffic {
/**
* A {@link StatsMessageTypes} object containing a breakdown of usage by message type for all messages (includes `realtime`, `rest` and `webhook` messages).
*/
all: StatsMessageTypes;
/**
* A {@link StatsMessageTypes} object containing a breakdown of usage by message type for messages transferred over a realtime transport such as WebSocket.
*/
realtime: StatsMessageTypes;
/**
* A {@link StatsMessageTypes} object containing a breakdown of usage by message type for messages transferred over a rest transport such as WebSocket.
*/
rest: StatsMessageTypes;
/**
* A {@link StatsMessageTypes} object containing a breakdown of usage by message type for messages delivered using webhooks.
*/
webhook: StatsMessageTypes;
}

/**
* Contains an Ably Token and its associated metadata.
*/
Expand Down Expand Up @@ -2563,42 +2447,26 @@ declare namespace Types {
* Contains application statistics for a specified time interval and time period.
*/
class Stats {
/**
* A {@link StatsMessageTypes} object containing the aggregate count of all message stats.
*/
all: StatsMessageTypes;
/**
* A {@link StatsRequestCount} object containing a breakdown of API Requests.
*/
apiRequests: StatsRequestCount;
/**
* A {@link StatsResourceCount} object containing a breakdown of channels.
*/
channels: StatsResourceCount;
/**
* A {@link StatsConnectionTypes} object containing a breakdown of connection related stats, such as min, mean and peak connections.
*/
connections: StatsConnectionTypes;
/**
* A {@link StatsMessageTraffic} object containing the aggregate count of inbound message stats.
*/
inbound: StatsMessageTraffic;
/**
* The UTC time at which the time period covered begins. If `unit` is set to `minute` this will be in the format `YYYY-mm-dd:HH:MM`, if `hour` it will be `YYYY-mm-dd:HH`, if `day` it will be `YYYY-mm-dd:00` and if `month` it will be `YYYY-mm-01:00`.
*/
intervalId: string;
/**
* A {@link StatsMessageTraffic} object containing the aggregate count of outbound message stats.
* For entries that are still in progress, such as the current month: the last sub-interval included in this entry (in format yyyy-mm-dd:hh:mm:ss), else undefined.
*/
inProgress?: string;
/**
* The statistics for this time interval and time period. See the JSON schema which the {@link Stats.schema | `schema`} property points to for more information.
*/
outbound: StatsMessageTraffic;
entries: Partial<Record<string, number>>;
/**
* A {@link StatsMessageTypes} object containing the aggregate count of persisted message stats.
* The URL of a [JSON Schema](https://json-schema.org/) which describes the structure of this `Stats` object.
*/
persisted: StatsMessageTypes;
schema: string;
/**
* A {@link StatsRequestCount} object containing a breakdown of Ably Token requests.
* The ID of the Ably application the statistics are for.
*/
tokenRequests: StatsRequestCount;
appId: string;
}

/**
Expand Down
Loading

0 comments on commit 6138243

Please sign in to comment.