From b64162c3cba1286507829f6c6a18d41bbc1ced52 Mon Sep 17 00:00:00 2001 From: Andy Ford Date: Fri, 17 May 2024 09:25:33 +0100 Subject: [PATCH 1/2] types/capability: allow wildcard capability when presented in object form At the moment, it's not possible to specify a capability as `{"resource": ["*"]}` - which is still valid. This change also allows the explicit specification of a wildcard. format: quotes --- ably.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ably.d.ts b/ably.d.ts index 2f6adef4e..05293a76a 100644 --- a/ably.d.ts +++ b/ably.d.ts @@ -684,6 +684,7 @@ export type capabilityOp = | 'channel-metadata' | 'push-subscribe' | 'push-admin'; + /** * Capabilities which are available for use within {@link TokenParams}. */ @@ -698,7 +699,7 @@ export interface TokenParams { * * @defaultValue `'{"*":["*"]}'` */ - capability?: { [key: string]: capabilityOp[] } | string; + capability?: { [key: string]: capabilityOp[] | ['*'] } | string; /** * A client ID, used for identifying this client when publishing messages or for presence purposes. The `clientId` can be any non-empty string, except it cannot contain a `*`. This option is primarily intended to be used in situations where the library is instantiated with a key. Note that a `clientId` may also be implicit in a token used to instantiate the library. An error is raised if a `clientId` specified here conflicts with the `clientId` implicit in the token. Find out more about [identified clients](https://ably.com/docs/core-features/authentication#identified-clients). */ From f19c8da099feccc98478c75052275f460d82dbe6 Mon Sep 17 00:00:00 2001 From: Andy Ford Date: Fri, 17 May 2024 13:04:45 +0100 Subject: [PATCH 2/2] add privileged headers capability --- ably.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ably.d.ts b/ably.d.ts index 05293a76a..256123209 100644 --- a/ably.d.ts +++ b/ably.d.ts @@ -683,7 +683,8 @@ export type capabilityOp = | 'stats' | 'channel-metadata' | 'push-subscribe' - | 'push-admin'; + | 'push-admin' + | 'privileged-headers'; /** * Capabilities which are available for use within {@link TokenParams}.