@cloudflare/workers-types 5.20261103.1 → 5.20261106.1

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.
@@ -674,12 +674,6 @@ type DurableObjectJurisdiction = "eu" | "fedramp" | "fedramp-high" | "us";
674
674
  interface DurableObjectNamespaceNewUniqueIdOptions {
675
675
  jurisdiction?: DurableObjectJurisdiction;
676
676
  }
677
- interface DurableObjectClass<
678
- _T extends Rpc.DurableObjectBranded | undefined = undefined,
679
- > {}
680
- interface DurableObjectNamespaceGetDurableObjectOptionsVersionOptions {
681
- cohort?: string;
682
- }
683
677
  type DurableObjectLocationHint =
684
678
  | "wnam"
685
679
  | "enam"
@@ -701,6 +695,12 @@ interface DurableObjectNamespaceGetDurableObjectOptions {
701
695
  };
702
696
  retry?: DurableObjectRetryOptions;
703
697
  }
698
+ interface DurableObjectClass<
699
+ _T extends Rpc.DurableObjectBranded | undefined = undefined,
700
+ > {}
701
+ interface DurableObjectNamespaceGetDurableObjectOptionsVersionOptions {
702
+ cohort?: string;
703
+ }
704
704
  interface DurableObjectRetryOptions {
705
705
  maxRetries?: number;
706
706
  timeoutMs?: number;
@@ -3418,6 +3418,7 @@ interface TraceItem {
3418
3418
  | TraceItemConnectEventInfo
3419
3419
  | TraceItemScheduledEventInfo
3420
3420
  | TraceItemAlarmEventInfo
3421
+ | TraceItemOnHibernateEventInfo
3421
3422
  | TraceItemQueueEventInfo
3422
3423
  | TraceItemEmailEventInfo
3423
3424
  | TraceItemTailEventInfo
@@ -3484,6 +3485,9 @@ interface TraceItemFetchEventInfoResponse {
3484
3485
  interface TraceItemJsRpcEventInfo {
3485
3486
  readonly rpcMethod: string;
3486
3487
  }
3488
+ interface TraceItemOnHibernateEventInfo {
3489
+ readonly reason: "inactive" | "codeUpdated" | "system" | (string & {});
3490
+ }
3487
3491
  interface TraceItemHibernatableWebSocketEventInfo {
3488
3492
  readonly getWebSocketEvent:
3489
3493
  | TraceItemHibernatableWebSocketEventInfoMessage
@@ -4944,6 +4948,11 @@ interface Tracing {
4944
4948
  ): T;
4945
4949
  startSpan(name: string): Span;
4946
4950
  getActiveSpan(): Span | undefined;
4951
+ withActiveSpan<T, A extends unknown[]>(
4952
+ span: Span,
4953
+ callback: (...args: A) => T,
4954
+ ...args: A
4955
+ ): T;
4947
4956
  Span: typeof Span;
4948
4957
  }
4949
4958
  declare abstract class Span {
@@ -16552,6 +16561,12 @@ interface JsonWebKeyWithKid extends JsonWebKey {
16552
16561
  }
16553
16562
  interface RateLimitOptions {
16554
16563
  key: string;
16564
+ /**
16565
+ * Amount to add to the counter for this call. Must be a positive integer;
16566
+ * defaults to `1`. The call is allowed while the counter is below the limit,
16567
+ * even if `delta` takes it past the limit.
16568
+ */
16569
+ delta?: number;
16555
16570
  }
16556
16571
  interface RateLimitOutcome {
16557
16572
  success: boolean;
@@ -17901,6 +17916,10 @@ declare namespace TailStream {
17901
17916
  readonly type: "alarm";
17902
17917
  readonly scheduledTime: Date;
17903
17918
  }
17919
+ interface OnHibernateEventInfo {
17920
+ readonly type: "onHibernate";
17921
+ readonly reason: "inactive" | "codeUpdated" | "system" | (string & {});
17922
+ }
17904
17923
  interface QueueEventInfo {
17905
17924
  readonly type: "queue";
17906
17925
  readonly queueName: string;
@@ -17988,6 +18007,7 @@ declare namespace TailStream {
17988
18007
  | JsRpcEventInfo
17989
18008
  | ScheduledEventInfo
17990
18009
  | AlarmEventInfo
18010
+ | OnHibernateEventInfo
17991
18011
  | QueueEventInfo
17992
18012
  | EmailEventInfo
17993
18013
  | TraceEventInfo
@@ -677,12 +677,6 @@ export type DurableObjectJurisdiction =
677
677
  export interface DurableObjectNamespaceNewUniqueIdOptions {
678
678
  jurisdiction?: DurableObjectJurisdiction;
679
679
  }
680
- export interface DurableObjectClass<
681
- _T extends Rpc.DurableObjectBranded | undefined = undefined,
682
- > {}
683
- export interface DurableObjectNamespaceGetDurableObjectOptionsVersionOptions {
684
- cohort?: string;
685
- }
686
680
  export type DurableObjectLocationHint =
687
681
  | "wnam"
688
682
  | "enam"
@@ -704,6 +698,12 @@ export interface DurableObjectNamespaceGetDurableObjectOptions {
704
698
  };
705
699
  retry?: DurableObjectRetryOptions;
706
700
  }
701
+ export interface DurableObjectClass<
702
+ _T extends Rpc.DurableObjectBranded | undefined = undefined,
703
+ > {}
704
+ export interface DurableObjectNamespaceGetDurableObjectOptionsVersionOptions {
705
+ cohort?: string;
706
+ }
707
707
  export interface DurableObjectRetryOptions {
708
708
  maxRetries?: number;
709
709
  timeoutMs?: number;
@@ -3424,6 +3424,7 @@ export interface TraceItem {
3424
3424
  | TraceItemConnectEventInfo
3425
3425
  | TraceItemScheduledEventInfo
3426
3426
  | TraceItemAlarmEventInfo
3427
+ | TraceItemOnHibernateEventInfo
3427
3428
  | TraceItemQueueEventInfo
3428
3429
  | TraceItemEmailEventInfo
3429
3430
  | TraceItemTailEventInfo
@@ -3490,6 +3491,9 @@ export interface TraceItemFetchEventInfoResponse {
3490
3491
  export interface TraceItemJsRpcEventInfo {
3491
3492
  readonly rpcMethod: string;
3492
3493
  }
3494
+ export interface TraceItemOnHibernateEventInfo {
3495
+ readonly reason: "inactive" | "codeUpdated" | "system" | (string & {});
3496
+ }
3493
3497
  export interface TraceItemHibernatableWebSocketEventInfo {
3494
3498
  readonly getWebSocketEvent:
3495
3499
  | TraceItemHibernatableWebSocketEventInfoMessage
@@ -4950,6 +4954,11 @@ export interface Tracing {
4950
4954
  ): T;
4951
4955
  startSpan(name: string): Span;
4952
4956
  getActiveSpan(): Span | undefined;
4957
+ withActiveSpan<T, A extends unknown[]>(
4958
+ span: Span,
4959
+ callback: (...args: A) => T,
4960
+ ...args: A
4961
+ ): T;
4953
4962
  Span: typeof Span;
4954
4963
  }
4955
4964
  export declare abstract class Span {
@@ -16462,6 +16471,12 @@ export interface JsonWebKeyWithKid extends JsonWebKey {
16462
16471
  }
16463
16472
  export interface RateLimitOptions {
16464
16473
  key: string;
16474
+ /**
16475
+ * Amount to add to the counter for this call. Must be a positive integer;
16476
+ * defaults to `1`. The call is allowed while the counter is below the limit,
16477
+ * even if `delta` takes it past the limit.
16478
+ */
16479
+ delta?: number;
16465
16480
  }
16466
16481
  export interface RateLimitOutcome {
16467
16482
  success: boolean;
@@ -17801,6 +17816,10 @@ export declare namespace TailStream {
17801
17816
  readonly type: "alarm";
17802
17817
  readonly scheduledTime: Date;
17803
17818
  }
17819
+ interface OnHibernateEventInfo {
17820
+ readonly type: "onHibernate";
17821
+ readonly reason: "inactive" | "codeUpdated" | "system" | (string & {});
17822
+ }
17804
17823
  interface QueueEventInfo {
17805
17824
  readonly type: "queue";
17806
17825
  readonly queueName: string;
@@ -17888,6 +17907,7 @@ export declare namespace TailStream {
17888
17907
  | JsRpcEventInfo
17889
17908
  | ScheduledEventInfo
17890
17909
  | AlarmEventInfo
17910
+ | OnHibernateEventInfo
17891
17911
  | QueueEventInfo
17892
17912
  | EmailEventInfo
17893
17913
  | TraceEventInfo
package/index.d.ts CHANGED
@@ -690,10 +690,15 @@ type DurableObjectRoutingMode = "primary-only";
690
690
  interface DurableObjectNamespaceGetDurableObjectOptions {
691
691
  locationHint?: DurableObjectLocationHint;
692
692
  routingMode?: DurableObjectRoutingMode;
693
+ retry?: DurableObjectRetryOptions;
693
694
  }
694
695
  interface DurableObjectClass<
695
696
  _T extends Rpc.DurableObjectBranded | undefined = undefined,
696
697
  > {}
698
+ interface DurableObjectRetryOptions {
699
+ maxRetries?: number;
700
+ timeoutMs?: number;
701
+ }
697
702
  interface DurableObjectState<Props = unknown> {
698
703
  waitUntil(promise: Promise<any>): void;
699
704
  readonly exports: Cloudflare.Exports;
@@ -3258,6 +3263,7 @@ interface TraceItem {
3258
3263
  | TraceItemConnectEventInfo
3259
3264
  | TraceItemScheduledEventInfo
3260
3265
  | TraceItemAlarmEventInfo
3266
+ | TraceItemOnHibernateEventInfo
3261
3267
  | TraceItemQueueEventInfo
3262
3268
  | TraceItemEmailEventInfo
3263
3269
  | TraceItemTailEventInfo
@@ -3324,6 +3330,9 @@ interface TraceItemFetchEventInfoResponse {
3324
3330
  interface TraceItemJsRpcEventInfo {
3325
3331
  readonly rpcMethod: string;
3326
3332
  }
3333
+ interface TraceItemOnHibernateEventInfo {
3334
+ readonly reason: "inactive" | "codeUpdated" | "system" | (string & {});
3335
+ }
3327
3336
  interface TraceItemHibernatableWebSocketEventInfo {
3328
3337
  readonly getWebSocketEvent:
3329
3338
  | TraceItemHibernatableWebSocketEventInfoMessage
@@ -4578,6 +4587,11 @@ interface Tracing {
4578
4587
  ): T;
4579
4588
  startSpan(name: string): Span;
4580
4589
  getActiveSpan(): Span | undefined;
4590
+ withActiveSpan<T, A extends unknown[]>(
4591
+ span: Span,
4592
+ callback: (...args: A) => T,
4593
+ ...args: A
4594
+ ): T;
4581
4595
  Span: typeof Span;
4582
4596
  }
4583
4597
  declare abstract class Span {
@@ -16186,6 +16200,12 @@ interface JsonWebKeyWithKid extends JsonWebKey {
16186
16200
  }
16187
16201
  interface RateLimitOptions {
16188
16202
  key: string;
16203
+ /**
16204
+ * Amount to add to the counter for this call. Must be a positive integer;
16205
+ * defaults to `1`. The call is allowed while the counter is below the limit,
16206
+ * even if `delta` takes it past the limit.
16207
+ */
16208
+ delta?: number;
16189
16209
  }
16190
16210
  interface RateLimitOutcome {
16191
16211
  success: boolean;
@@ -17535,6 +17555,10 @@ declare namespace TailStream {
17535
17555
  readonly type: "alarm";
17536
17556
  readonly scheduledTime: Date;
17537
17557
  }
17558
+ interface OnHibernateEventInfo {
17559
+ readonly type: "onHibernate";
17560
+ readonly reason: "inactive" | "codeUpdated" | "system" | (string & {});
17561
+ }
17538
17562
  interface QueueEventInfo {
17539
17563
  readonly type: "queue";
17540
17564
  readonly queueName: string;
@@ -17622,6 +17646,7 @@ declare namespace TailStream {
17622
17646
  | JsRpcEventInfo
17623
17647
  | ScheduledEventInfo
17624
17648
  | AlarmEventInfo
17649
+ | OnHibernateEventInfo
17625
17650
  | QueueEventInfo
17626
17651
  | EmailEventInfo
17627
17652
  | TraceEventInfo
package/index.ts CHANGED
@@ -693,10 +693,15 @@ export type DurableObjectRoutingMode = "primary-only";
693
693
  export interface DurableObjectNamespaceGetDurableObjectOptions {
694
694
  locationHint?: DurableObjectLocationHint;
695
695
  routingMode?: DurableObjectRoutingMode;
696
+ retry?: DurableObjectRetryOptions;
696
697
  }
697
698
  export interface DurableObjectClass<
698
699
  _T extends Rpc.DurableObjectBranded | undefined = undefined,
699
700
  > {}
701
+ export interface DurableObjectRetryOptions {
702
+ maxRetries?: number;
703
+ timeoutMs?: number;
704
+ }
700
705
  export interface DurableObjectState<Props = unknown> {
701
706
  waitUntil(promise: Promise<any>): void;
702
707
  readonly exports: Cloudflare.Exports;
@@ -3267,6 +3272,7 @@ export interface TraceItem {
3267
3272
  | TraceItemConnectEventInfo
3268
3273
  | TraceItemScheduledEventInfo
3269
3274
  | TraceItemAlarmEventInfo
3275
+ | TraceItemOnHibernateEventInfo
3270
3276
  | TraceItemQueueEventInfo
3271
3277
  | TraceItemEmailEventInfo
3272
3278
  | TraceItemTailEventInfo
@@ -3333,6 +3339,9 @@ export interface TraceItemFetchEventInfoResponse {
3333
3339
  export interface TraceItemJsRpcEventInfo {
3334
3340
  readonly rpcMethod: string;
3335
3341
  }
3342
+ export interface TraceItemOnHibernateEventInfo {
3343
+ readonly reason: "inactive" | "codeUpdated" | "system" | (string & {});
3344
+ }
3336
3345
  export interface TraceItemHibernatableWebSocketEventInfo {
3337
3346
  readonly getWebSocketEvent:
3338
3347
  | TraceItemHibernatableWebSocketEventInfoMessage
@@ -4587,6 +4596,11 @@ export interface Tracing {
4587
4596
  ): T;
4588
4597
  startSpan(name: string): Span;
4589
4598
  getActiveSpan(): Span | undefined;
4599
+ withActiveSpan<T, A extends unknown[]>(
4600
+ span: Span,
4601
+ callback: (...args: A) => T,
4602
+ ...args: A
4603
+ ): T;
4590
4604
  Span: typeof Span;
4591
4605
  }
4592
4606
  export declare abstract class Span {
@@ -16099,6 +16113,12 @@ export interface JsonWebKeyWithKid extends JsonWebKey {
16099
16113
  }
16100
16114
  export interface RateLimitOptions {
16101
16115
  key: string;
16116
+ /**
16117
+ * Amount to add to the counter for this call. Must be a positive integer;
16118
+ * defaults to `1`. The call is allowed while the counter is below the limit,
16119
+ * even if `delta` takes it past the limit.
16120
+ */
16121
+ delta?: number;
16102
16122
  }
16103
16123
  export interface RateLimitOutcome {
16104
16124
  success: boolean;
@@ -17438,6 +17458,10 @@ export declare namespace TailStream {
17438
17458
  readonly type: "alarm";
17439
17459
  readonly scheduledTime: Date;
17440
17460
  }
17461
+ interface OnHibernateEventInfo {
17462
+ readonly type: "onHibernate";
17463
+ readonly reason: "inactive" | "codeUpdated" | "system" | (string & {});
17464
+ }
17441
17465
  interface QueueEventInfo {
17442
17466
  readonly type: "queue";
17443
17467
  readonly queueName: string;
@@ -17525,6 +17549,7 @@ export declare namespace TailStream {
17525
17549
  | JsRpcEventInfo
17526
17550
  | ScheduledEventInfo
17527
17551
  | AlarmEventInfo
17552
+ | OnHibernateEventInfo
17528
17553
  | QueueEventInfo
17529
17554
  | EmailEventInfo
17530
17555
  | TraceEventInfo
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": "5.20261103.1"
10
+ "version": "5.20261106.1"
11
11
  }