@cloudflare/workers-types 0.20230115.0 → 0.20230307.0

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.
package/index.ts CHANGED
@@ -281,6 +281,7 @@ export declare const self: ServiceWorkerGlobalScope;
281
281
  export declare const crypto: Crypto;
282
282
  export declare const caches: CacheStorage;
283
283
  export declare const scheduler: Scheduler;
284
+ export interface TestController {}
284
285
  export interface ExecutionContext {
285
286
  waitUntil(promise: Promise<any>): void;
286
287
  passThroughOnException(): void;
@@ -305,10 +306,16 @@ export type ExportedHandlerQueueHandler<Env = unknown, Message = unknown> = (
305
306
  env: Env,
306
307
  ctx: ExecutionContext
307
308
  ) => void | Promise<void>;
309
+ export type ExportedHandlerTestHandler<Env = unknown> = (
310
+ controller: TestController,
311
+ env: Env,
312
+ ctx: ExecutionContext
313
+ ) => void | Promise<void>;
308
314
  export interface ExportedHandler<Env = unknown, QueueMessage = unknown> {
309
315
  fetch?: ExportedHandlerFetchHandler<Env>;
310
316
  trace?: ExportedHandlerTraceHandler<Env>;
311
317
  scheduled?: ExportedHandlerScheduledHandler<Env>;
318
+ test?: ExportedHandlerTestHandler<Env>;
312
319
  queue?: ExportedHandlerQueueHandler<Env, QueueMessage>;
313
320
  }
314
321
  export interface StructuredSerializeOptions {
@@ -1006,6 +1013,10 @@ export declare class Request<CfHostMetadata = unknown> extends Body {
1006
1013
  /** Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler. */
1007
1014
  readonly signal: AbortSignal;
1008
1015
  readonly cf?: IncomingRequestCfProperties<CfHostMetadata>;
1016
+ /** Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI] */
1017
+ readonly integrity: string;
1018
+ /** Returns a boolean indicating whether or not request can outlive the global in which it was created. */
1019
+ readonly keepalive: boolean;
1009
1020
  }
1010
1021
  export interface RequestInit<
1011
1022
  CfType = IncomingRequestCfProperties | RequestInitCfProperties
@@ -1020,6 +1031,8 @@ export interface RequestInit<
1020
1031
  redirect?: string;
1021
1032
  fetcher?: Fetcher | null;
1022
1033
  cf?: CfType;
1034
+ /** A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */
1035
+ integrity?: string;
1023
1036
  /** An AbortSignal to set request's signal. */
1024
1037
  signal?: AbortSignal | null;
1025
1038
  }
@@ -1071,11 +1084,11 @@ export interface KVNamespace<Key extends string = string> {
1071
1084
  get(
1072
1085
  key: Key,
1073
1086
  options?: KVNamespaceGetOptions<"arrayBuffer">
1074
- ): Promise<string | null>;
1087
+ ): Promise<ArrayBuffer | null>;
1075
1088
  get(
1076
1089
  key: Key,
1077
1090
  options?: KVNamespaceGetOptions<"stream">
1078
- ): Promise<string | null>;
1091
+ ): Promise<ReadableStream | null>;
1079
1092
  list<Metadata = unknown>(
1080
1093
  options?: KVNamespaceListOptions
1081
1094
  ): Promise<KVNamespaceListResult<Metadata, Key>>;
@@ -1521,13 +1534,13 @@ export declare class CompressionStream extends TransformStream<
1521
1534
  ArrayBuffer | ArrayBufferView,
1522
1535
  Uint8Array
1523
1536
  > {
1524
- constructor(format: "gzip" | "deflate");
1537
+ constructor(format: "gzip" | "deflate" | "deflate-raw");
1525
1538
  }
1526
1539
  export declare class DecompressionStream extends TransformStream<
1527
1540
  ArrayBuffer | ArrayBufferView,
1528
1541
  Uint8Array
1529
1542
  > {
1530
- constructor(format: "gzip" | "deflate");
1543
+ constructor(format: "gzip" | "deflate" | "deflate-raw");
1531
1544
  }
1532
1545
  export declare class TextEncoderStream extends TransformStream<
1533
1546
  string,
@@ -1659,6 +1672,7 @@ export declare class URLSearchParams {
1659
1672
  | Record<string, string>
1660
1673
  | [key: string, value: string][]
1661
1674
  );
1675
+ get size(): number;
1662
1676
  append(name: string, value: string): void;
1663
1677
  delete(name: string): void;
1664
1678
  get(name: string): string | null;
@@ -2147,6 +2161,10 @@ export interface IncomingRequestCfPropertiesBotManagementBase {
2147
2161
  * A boolean value that's true if the request matches [file extensions](https://developers.cloudflare.com/bots/reference/static-resources/) for many types of static resources.
2148
2162
  */
2149
2163
  staticResource: boolean;
2164
+ /**
2165
+ * List of IDs that correlate to the Bot Management heuristic detections made on a request (you can have multiple heuristic detections on the same request).
2166
+ */
2167
+ detectionIds: number[];
2150
2168
  }
2151
2169
  export interface IncomingRequestCfPropertiesBotManagement {
2152
2170
  /**
@@ -2729,7 +2747,7 @@ export declare abstract class D1PreparedStatement {
2729
2747
  /**
2730
2748
  * A email message that is sent to a consumer Worker.
2731
2749
  */
2732
- export interface EmailMessage<Body = unknown> {
2750
+ export interface EmailMessage {
2733
2751
  /**
2734
2752
  * Envelope From attribute of the email message.
2735
2753
  */
@@ -2815,6 +2833,40 @@ export type PagesPluginFunction<
2815
2833
  > = (
2816
2834
  context: EventPluginContext<Env, Params, Data, PluginArgs>
2817
2835
  ) => Response | Promise<Response>;
2836
+ // https://developers.cloudflare.com/pub-sub/
2837
+ // PubSubMessage represents an incoming PubSub message.
2838
+ // The message includes metadata about the broker, the client, and the payload
2839
+ // itself.
2840
+ export interface PubSubMessage {
2841
+ // Message ID
2842
+ readonly mid: number;
2843
+ // MQTT broker FQDN in the form mqtts://BROKER.NAMESPACE.cloudflarepubsub.com:PORT
2844
+ readonly broker: string;
2845
+ // The MQTT topic the message was sent on.
2846
+ readonly topic: string;
2847
+ // The client ID of the client that published this message.
2848
+ readonly clientId: string;
2849
+ // The unique identifier (JWT ID) used by the client to authenticate, if token
2850
+ // auth was used.
2851
+ readonly jti?: string;
2852
+ // A Unix timestamp (seconds from Jan 1, 1970), set when the Pub/Sub Broker
2853
+ // received the message from the client.
2854
+ readonly receivedAt: number;
2855
+ // An (optional) string with the MIME type of the payload, if set by the
2856
+ // client.
2857
+ readonly contentType: string;
2858
+ // Set to 1 when the payload is a UTF-8 string
2859
+ // https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901063
2860
+ readonly payloadFormatIndicator: number;
2861
+ // Pub/Sub (MQTT) payloads can be UTF-8 strings, or byte arrays.
2862
+ // You can use payloadFormatIndicator to inspect this before decoding.
2863
+ payload: string | Uint8Array;
2864
+ }
2865
+ // JsonWebKey extended by kid parameter
2866
+ export interface JsonWebKeyWithKid extends JsonWebKey {
2867
+ // Key Identifier of the JWK
2868
+ readonly kid: string;
2869
+ }
2818
2870
  /**
2819
2871
  * A message that is sent to a consumer Worker.
2820
2872
  */
@@ -2831,6 +2883,14 @@ export interface Message<Body = unknown> {
2831
2883
  * The body of the message.
2832
2884
  */
2833
2885
  readonly body: Body;
2886
+ /**
2887
+ * Marks message to be retried.
2888
+ */
2889
+ retry(): void;
2890
+ /**
2891
+ * Marks message acknowledged.
2892
+ */
2893
+ ack(): void;
2834
2894
  }
2835
2895
  /**
2836
2896
  * A batch of messages that are sent to a consumer Worker.
@@ -2848,6 +2908,10 @@ export interface MessageBatch<Body = unknown> {
2848
2908
  * Marks every message to be retried in the next batch.
2849
2909
  */
2850
2910
  retryAll(): void;
2911
+ /**
2912
+ * Marks every message acknowledged in the batch.
2913
+ */
2914
+ ackAll(): void;
2851
2915
  }
2852
2916
  /**
2853
2917
  * A wrapper class used to structure message batches.
package/oldest/index.d.ts CHANGED
@@ -279,6 +279,7 @@ declare const self: ServiceWorkerGlobalScope;
279
279
  declare const crypto: Crypto;
280
280
  declare const caches: CacheStorage;
281
281
  declare const scheduler: Scheduler;
282
+ declare interface TestController {}
282
283
  declare interface ExecutionContext {
283
284
  waitUntil(promise: Promise<any>): void;
284
285
  passThroughOnException(): void;
@@ -303,10 +304,16 @@ declare type ExportedHandlerQueueHandler<Env = unknown, Message = unknown> = (
303
304
  env: Env,
304
305
  ctx: ExecutionContext
305
306
  ) => void | Promise<void>;
307
+ declare type ExportedHandlerTestHandler<Env = unknown> = (
308
+ controller: TestController,
309
+ env: Env,
310
+ ctx: ExecutionContext
311
+ ) => void | Promise<void>;
306
312
  declare interface ExportedHandler<Env = unknown, QueueMessage = unknown> {
307
313
  fetch?: ExportedHandlerFetchHandler<Env>;
308
314
  trace?: ExportedHandlerTraceHandler<Env>;
309
315
  scheduled?: ExportedHandlerScheduledHandler<Env>;
316
+ test?: ExportedHandlerTestHandler<Env>;
310
317
  queue?: ExportedHandlerQueueHandler<Env, QueueMessage>;
311
318
  }
312
319
  declare interface StructuredSerializeOptions {
@@ -1004,6 +1011,10 @@ declare class Request<CfHostMetadata = unknown> extends Body {
1004
1011
  /** Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler. */
1005
1012
  readonly signal: AbortSignal;
1006
1013
  readonly cf?: IncomingRequestCfProperties<CfHostMetadata>;
1014
+ /** Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI] */
1015
+ readonly integrity: string;
1016
+ /** Returns a boolean indicating whether or not request can outlive the global in which it was created. */
1017
+ readonly keepalive: boolean;
1007
1018
  }
1008
1019
  declare interface RequestInit<
1009
1020
  CfType = IncomingRequestCfProperties | RequestInitCfProperties
@@ -1018,6 +1029,8 @@ declare interface RequestInit<
1018
1029
  redirect?: string;
1019
1030
  fetcher?: Fetcher | null;
1020
1031
  cf?: CfType;
1032
+ /** A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */
1033
+ integrity?: string;
1021
1034
  /** An AbortSignal to set request's signal. */
1022
1035
  signal?: AbortSignal | null;
1023
1036
  }
@@ -1069,11 +1082,11 @@ declare interface KVNamespace<Key extends string = string> {
1069
1082
  get(
1070
1083
  key: Key,
1071
1084
  options?: KVNamespaceGetOptions<"arrayBuffer">
1072
- ): Promise<string | null>;
1085
+ ): Promise<ArrayBuffer | null>;
1073
1086
  get(
1074
1087
  key: Key,
1075
1088
  options?: KVNamespaceGetOptions<"stream">
1076
- ): Promise<string | null>;
1089
+ ): Promise<ReadableStream | null>;
1077
1090
  list<Metadata = unknown>(
1078
1091
  options?: KVNamespaceListOptions
1079
1092
  ): Promise<KVNamespaceListResult<Metadata, Key>>;
@@ -1519,13 +1532,13 @@ declare class CompressionStream extends TransformStream<
1519
1532
  ArrayBuffer | ArrayBufferView,
1520
1533
  Uint8Array
1521
1534
  > {
1522
- constructor(format: "gzip" | "deflate");
1535
+ constructor(format: "gzip" | "deflate" | "deflate-raw");
1523
1536
  }
1524
1537
  declare class DecompressionStream extends TransformStream<
1525
1538
  ArrayBuffer | ArrayBufferView,
1526
1539
  Uint8Array
1527
1540
  > {
1528
- constructor(format: "gzip" | "deflate");
1541
+ constructor(format: "gzip" | "deflate" | "deflate-raw");
1529
1542
  }
1530
1543
  declare class TextEncoderStream extends TransformStream<string, Uint8Array> {
1531
1544
  constructor();
@@ -1654,6 +1667,7 @@ declare class URLSearchParams {
1654
1667
  | Record<string, string>
1655
1668
  | [key: string, value: string][]
1656
1669
  );
1670
+ get size(): number;
1657
1671
  append(name: string, value: string): void;
1658
1672
  delete(name: string): void;
1659
1673
  get(name: string): string | null;
@@ -2142,6 +2156,10 @@ declare interface IncomingRequestCfPropertiesBotManagementBase {
2142
2156
  * A boolean value that's true if the request matches [file extensions](https://developers.cloudflare.com/bots/reference/static-resources/) for many types of static resources.
2143
2157
  */
2144
2158
  staticResource: boolean;
2159
+ /**
2160
+ * List of IDs that correlate to the Bot Management heuristic detections made on a request (you can have multiple heuristic detections on the same request).
2161
+ */
2162
+ detectionIds: number[];
2145
2163
  }
2146
2164
  declare interface IncomingRequestCfPropertiesBotManagement {
2147
2165
  /**
@@ -2724,7 +2742,7 @@ declare abstract class D1PreparedStatement {
2724
2742
  /**
2725
2743
  * A email message that is sent to a consumer Worker.
2726
2744
  */
2727
- declare interface EmailMessage<Body = unknown> {
2745
+ declare interface EmailMessage {
2728
2746
  /**
2729
2747
  * Envelope From attribute of the email message.
2730
2748
  */
@@ -2813,6 +2831,40 @@ declare type PagesPluginFunction<
2813
2831
  declare module "assets:*" {
2814
2832
  export const onRequest: PagesFunction;
2815
2833
  }
2834
+ // https://developers.cloudflare.com/pub-sub/
2835
+ // PubSubMessage represents an incoming PubSub message.
2836
+ // The message includes metadata about the broker, the client, and the payload
2837
+ // itself.
2838
+ declare interface PubSubMessage {
2839
+ // Message ID
2840
+ readonly mid: number;
2841
+ // MQTT broker FQDN in the form mqtts://BROKER.NAMESPACE.cloudflarepubsub.com:PORT
2842
+ readonly broker: string;
2843
+ // The MQTT topic the message was sent on.
2844
+ readonly topic: string;
2845
+ // The client ID of the client that published this message.
2846
+ readonly clientId: string;
2847
+ // The unique identifier (JWT ID) used by the client to authenticate, if token
2848
+ // auth was used.
2849
+ readonly jti?: string;
2850
+ // A Unix timestamp (seconds from Jan 1, 1970), set when the Pub/Sub Broker
2851
+ // received the message from the client.
2852
+ readonly receivedAt: number;
2853
+ // An (optional) string with the MIME type of the payload, if set by the
2854
+ // client.
2855
+ readonly contentType: string;
2856
+ // Set to 1 when the payload is a UTF-8 string
2857
+ // https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901063
2858
+ readonly payloadFormatIndicator: number;
2859
+ // Pub/Sub (MQTT) payloads can be UTF-8 strings, or byte arrays.
2860
+ // You can use payloadFormatIndicator to inspect this before decoding.
2861
+ payload: string | Uint8Array;
2862
+ }
2863
+ // JsonWebKey extended by kid parameter
2864
+ declare interface JsonWebKeyWithKid extends JsonWebKey {
2865
+ // Key Identifier of the JWK
2866
+ readonly kid: string;
2867
+ }
2816
2868
  /**
2817
2869
  * A message that is sent to a consumer Worker.
2818
2870
  */
@@ -2829,6 +2881,14 @@ declare interface Message<Body = unknown> {
2829
2881
  * The body of the message.
2830
2882
  */
2831
2883
  readonly body: Body;
2884
+ /**
2885
+ * Marks message to be retried.
2886
+ */
2887
+ retry(): void;
2888
+ /**
2889
+ * Marks message acknowledged.
2890
+ */
2891
+ ack(): void;
2832
2892
  }
2833
2893
  /**
2834
2894
  * A batch of messages that are sent to a consumer Worker.
@@ -2846,6 +2906,10 @@ declare interface MessageBatch<Body = unknown> {
2846
2906
  * Marks every message to be retried in the next batch.
2847
2907
  */
2848
2908
  retryAll(): void;
2909
+ /**
2910
+ * Marks every message acknowledged in the batch.
2911
+ */
2912
+ ackAll(): void;
2849
2913
  }
2850
2914
  /**
2851
2915
  * A wrapper class used to structure message batches.
package/oldest/index.ts CHANGED
@@ -281,6 +281,7 @@ export declare const self: ServiceWorkerGlobalScope;
281
281
  export declare const crypto: Crypto;
282
282
  export declare const caches: CacheStorage;
283
283
  export declare const scheduler: Scheduler;
284
+ export interface TestController {}
284
285
  export interface ExecutionContext {
285
286
  waitUntil(promise: Promise<any>): void;
286
287
  passThroughOnException(): void;
@@ -305,10 +306,16 @@ export type ExportedHandlerQueueHandler<Env = unknown, Message = unknown> = (
305
306
  env: Env,
306
307
  ctx: ExecutionContext
307
308
  ) => void | Promise<void>;
309
+ export type ExportedHandlerTestHandler<Env = unknown> = (
310
+ controller: TestController,
311
+ env: Env,
312
+ ctx: ExecutionContext
313
+ ) => void | Promise<void>;
308
314
  export interface ExportedHandler<Env = unknown, QueueMessage = unknown> {
309
315
  fetch?: ExportedHandlerFetchHandler<Env>;
310
316
  trace?: ExportedHandlerTraceHandler<Env>;
311
317
  scheduled?: ExportedHandlerScheduledHandler<Env>;
318
+ test?: ExportedHandlerTestHandler<Env>;
312
319
  queue?: ExportedHandlerQueueHandler<Env, QueueMessage>;
313
320
  }
314
321
  export interface StructuredSerializeOptions {
@@ -1006,6 +1013,10 @@ export declare class Request<CfHostMetadata = unknown> extends Body {
1006
1013
  /** Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler. */
1007
1014
  readonly signal: AbortSignal;
1008
1015
  readonly cf?: IncomingRequestCfProperties<CfHostMetadata>;
1016
+ /** Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI] */
1017
+ readonly integrity: string;
1018
+ /** Returns a boolean indicating whether or not request can outlive the global in which it was created. */
1019
+ readonly keepalive: boolean;
1009
1020
  }
1010
1021
  export interface RequestInit<
1011
1022
  CfType = IncomingRequestCfProperties | RequestInitCfProperties
@@ -1020,6 +1031,8 @@ export interface RequestInit<
1020
1031
  redirect?: string;
1021
1032
  fetcher?: Fetcher | null;
1022
1033
  cf?: CfType;
1034
+ /** A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */
1035
+ integrity?: string;
1023
1036
  /** An AbortSignal to set request's signal. */
1024
1037
  signal?: AbortSignal | null;
1025
1038
  }
@@ -1071,11 +1084,11 @@ export interface KVNamespace<Key extends string = string> {
1071
1084
  get(
1072
1085
  key: Key,
1073
1086
  options?: KVNamespaceGetOptions<"arrayBuffer">
1074
- ): Promise<string | null>;
1087
+ ): Promise<ArrayBuffer | null>;
1075
1088
  get(
1076
1089
  key: Key,
1077
1090
  options?: KVNamespaceGetOptions<"stream">
1078
- ): Promise<string | null>;
1091
+ ): Promise<ReadableStream | null>;
1079
1092
  list<Metadata = unknown>(
1080
1093
  options?: KVNamespaceListOptions
1081
1094
  ): Promise<KVNamespaceListResult<Metadata, Key>>;
@@ -1521,13 +1534,13 @@ export declare class CompressionStream extends TransformStream<
1521
1534
  ArrayBuffer | ArrayBufferView,
1522
1535
  Uint8Array
1523
1536
  > {
1524
- constructor(format: "gzip" | "deflate");
1537
+ constructor(format: "gzip" | "deflate" | "deflate-raw");
1525
1538
  }
1526
1539
  export declare class DecompressionStream extends TransformStream<
1527
1540
  ArrayBuffer | ArrayBufferView,
1528
1541
  Uint8Array
1529
1542
  > {
1530
- constructor(format: "gzip" | "deflate");
1543
+ constructor(format: "gzip" | "deflate" | "deflate-raw");
1531
1544
  }
1532
1545
  export declare class TextEncoderStream extends TransformStream<
1533
1546
  string,
@@ -1659,6 +1672,7 @@ export declare class URLSearchParams {
1659
1672
  | Record<string, string>
1660
1673
  | [key: string, value: string][]
1661
1674
  );
1675
+ get size(): number;
1662
1676
  append(name: string, value: string): void;
1663
1677
  delete(name: string): void;
1664
1678
  get(name: string): string | null;
@@ -2147,6 +2161,10 @@ export interface IncomingRequestCfPropertiesBotManagementBase {
2147
2161
  * A boolean value that's true if the request matches [file extensions](https://developers.cloudflare.com/bots/reference/static-resources/) for many types of static resources.
2148
2162
  */
2149
2163
  staticResource: boolean;
2164
+ /**
2165
+ * List of IDs that correlate to the Bot Management heuristic detections made on a request (you can have multiple heuristic detections on the same request).
2166
+ */
2167
+ detectionIds: number[];
2150
2168
  }
2151
2169
  export interface IncomingRequestCfPropertiesBotManagement {
2152
2170
  /**
@@ -2729,7 +2747,7 @@ export declare abstract class D1PreparedStatement {
2729
2747
  /**
2730
2748
  * A email message that is sent to a consumer Worker.
2731
2749
  */
2732
- export interface EmailMessage<Body = unknown> {
2750
+ export interface EmailMessage {
2733
2751
  /**
2734
2752
  * Envelope From attribute of the email message.
2735
2753
  */
@@ -2815,6 +2833,40 @@ export type PagesPluginFunction<
2815
2833
  > = (
2816
2834
  context: EventPluginContext<Env, Params, Data, PluginArgs>
2817
2835
  ) => Response | Promise<Response>;
2836
+ // https://developers.cloudflare.com/pub-sub/
2837
+ // PubSubMessage represents an incoming PubSub message.
2838
+ // The message includes metadata about the broker, the client, and the payload
2839
+ // itself.
2840
+ export interface PubSubMessage {
2841
+ // Message ID
2842
+ readonly mid: number;
2843
+ // MQTT broker FQDN in the form mqtts://BROKER.NAMESPACE.cloudflarepubsub.com:PORT
2844
+ readonly broker: string;
2845
+ // The MQTT topic the message was sent on.
2846
+ readonly topic: string;
2847
+ // The client ID of the client that published this message.
2848
+ readonly clientId: string;
2849
+ // The unique identifier (JWT ID) used by the client to authenticate, if token
2850
+ // auth was used.
2851
+ readonly jti?: string;
2852
+ // A Unix timestamp (seconds from Jan 1, 1970), set when the Pub/Sub Broker
2853
+ // received the message from the client.
2854
+ readonly receivedAt: number;
2855
+ // An (optional) string with the MIME type of the payload, if set by the
2856
+ // client.
2857
+ readonly contentType: string;
2858
+ // Set to 1 when the payload is a UTF-8 string
2859
+ // https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901063
2860
+ readonly payloadFormatIndicator: number;
2861
+ // Pub/Sub (MQTT) payloads can be UTF-8 strings, or byte arrays.
2862
+ // You can use payloadFormatIndicator to inspect this before decoding.
2863
+ payload: string | Uint8Array;
2864
+ }
2865
+ // JsonWebKey extended by kid parameter
2866
+ export interface JsonWebKeyWithKid extends JsonWebKey {
2867
+ // Key Identifier of the JWK
2868
+ readonly kid: string;
2869
+ }
2818
2870
  /**
2819
2871
  * A message that is sent to a consumer Worker.
2820
2872
  */
@@ -2831,6 +2883,14 @@ export interface Message<Body = unknown> {
2831
2883
  * The body of the message.
2832
2884
  */
2833
2885
  readonly body: Body;
2886
+ /**
2887
+ * Marks message to be retried.
2888
+ */
2889
+ retry(): void;
2890
+ /**
2891
+ * Marks message acknowledged.
2892
+ */
2893
+ ack(): void;
2834
2894
  }
2835
2895
  /**
2836
2896
  * A batch of messages that are sent to a consumer Worker.
@@ -2848,6 +2908,10 @@ export interface MessageBatch<Body = unknown> {
2848
2908
  * Marks every message to be retried in the next batch.
2849
2909
  */
2850
2910
  retryAll(): void;
2911
+ /**
2912
+ * Marks every message acknowledged in the batch.
2913
+ */
2914
+ ackAll(): void;
2851
2915
  }
2852
2916
  /**
2853
2917
  * A wrapper class used to structure message batches.
package/package.json CHANGED
@@ -7,5 +7,5 @@
7
7
  },
8
8
  "author": "Cloudflare Workers DevProd Team <workers-devprod@cloudflare.com> (https://workers.cloudflare.com)",
9
9
  "license": "MIT OR Apache-2.0",
10
- "version": "0.20230115.0"
10
+ "version": "0.20230307.0"
11
11
  }