@cloudflare/workers-types 4.20230801.0 → 4.20230814.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.
@@ -1279,8 +1279,10 @@ declare abstract class R2Bucket {
1279
1279
  | string
1280
1280
  | null
1281
1281
  | Blob,
1282
- options?: R2PutOptions
1283
- ): Promise<R2Object>;
1282
+ options?: R2PutOptions & {
1283
+ onlyIf: R2Conditional | Headers;
1284
+ }
1285
+ ): Promise<R2Object | null>;
1284
1286
  put(
1285
1287
  key: string,
1286
1288
  value:
@@ -1290,10 +1292,8 @@ declare abstract class R2Bucket {
1290
1292
  | string
1291
1293
  | null
1292
1294
  | Blob,
1293
- options?: R2PutOptions & {
1294
- onlyIf: R2Conditional | Headers;
1295
- }
1296
- ): Promise<R2Object | null>;
1295
+ options?: R2PutOptions
1296
+ ): Promise<R2Object>;
1297
1297
  createMultipartUpload(
1298
1298
  key: string,
1299
1299
  options?: R2MultipartOptions
@@ -1281,8 +1281,10 @@ export declare abstract class R2Bucket {
1281
1281
  | string
1282
1282
  | null
1283
1283
  | Blob,
1284
- options?: R2PutOptions
1285
- ): Promise<R2Object>;
1284
+ options?: R2PutOptions & {
1285
+ onlyIf: R2Conditional | Headers;
1286
+ }
1287
+ ): Promise<R2Object | null>;
1286
1288
  put(
1287
1289
  key: string,
1288
1290
  value:
@@ -1292,10 +1294,8 @@ export declare abstract class R2Bucket {
1292
1294
  | string
1293
1295
  | null
1294
1296
  | Blob,
1295
- options?: R2PutOptions & {
1296
- onlyIf: R2Conditional | Headers;
1297
- }
1298
- ): Promise<R2Object | null>;
1297
+ options?: R2PutOptions
1298
+ ): Promise<R2Object>;
1299
1299
  createMultipartUpload(
1300
1300
  key: string,
1301
1301
  options?: R2MultipartOptions
@@ -1259,8 +1259,10 @@ declare abstract class R2Bucket {
1259
1259
  | string
1260
1260
  | null
1261
1261
  | Blob,
1262
- options?: R2PutOptions
1263
- ): Promise<R2Object>;
1262
+ options?: R2PutOptions & {
1263
+ onlyIf: R2Conditional | Headers;
1264
+ }
1265
+ ): Promise<R2Object | null>;
1264
1266
  put(
1265
1267
  key: string,
1266
1268
  value:
@@ -1270,10 +1272,8 @@ declare abstract class R2Bucket {
1270
1272
  | string
1271
1273
  | null
1272
1274
  | Blob,
1273
- options?: R2PutOptions & {
1274
- onlyIf: R2Conditional | Headers;
1275
- }
1276
- ): Promise<R2Object | null>;
1275
+ options?: R2PutOptions
1276
+ ): Promise<R2Object>;
1277
1277
  createMultipartUpload(
1278
1278
  key: string,
1279
1279
  options?: R2MultipartOptions
@@ -1261,8 +1261,10 @@ export declare abstract class R2Bucket {
1261
1261
  | string
1262
1262
  | null
1263
1263
  | Blob,
1264
- options?: R2PutOptions
1265
- ): Promise<R2Object>;
1264
+ options?: R2PutOptions & {
1265
+ onlyIf: R2Conditional | Headers;
1266
+ }
1267
+ ): Promise<R2Object | null>;
1266
1268
  put(
1267
1269
  key: string,
1268
1270
  value:
@@ -1272,10 +1274,8 @@ export declare abstract class R2Bucket {
1272
1274
  | string
1273
1275
  | null
1274
1276
  | Blob,
1275
- options?: R2PutOptions & {
1276
- onlyIf: R2Conditional | Headers;
1277
- }
1278
- ): Promise<R2Object | null>;
1277
+ options?: R2PutOptions
1278
+ ): Promise<R2Object>;
1279
1279
  createMultipartUpload(
1280
1280
  key: string,
1281
1281
  options?: R2MultipartOptions
@@ -1265,8 +1265,10 @@ declare abstract class R2Bucket {
1265
1265
  | string
1266
1266
  | null
1267
1267
  | Blob,
1268
- options?: R2PutOptions
1269
- ): Promise<R2Object>;
1268
+ options?: R2PutOptions & {
1269
+ onlyIf: R2Conditional | Headers;
1270
+ }
1271
+ ): Promise<R2Object | null>;
1270
1272
  put(
1271
1273
  key: string,
1272
1274
  value:
@@ -1276,10 +1278,8 @@ declare abstract class R2Bucket {
1276
1278
  | string
1277
1279
  | null
1278
1280
  | Blob,
1279
- options?: R2PutOptions & {
1280
- onlyIf: R2Conditional | Headers;
1281
- }
1282
- ): Promise<R2Object | null>;
1281
+ options?: R2PutOptions
1282
+ ): Promise<R2Object>;
1283
1283
  createMultipartUpload(
1284
1284
  key: string,
1285
1285
  options?: R2MultipartOptions
@@ -1267,8 +1267,10 @@ export declare abstract class R2Bucket {
1267
1267
  | string
1268
1268
  | null
1269
1269
  | Blob,
1270
- options?: R2PutOptions
1271
- ): Promise<R2Object>;
1270
+ options?: R2PutOptions & {
1271
+ onlyIf: R2Conditional | Headers;
1272
+ }
1273
+ ): Promise<R2Object | null>;
1272
1274
  put(
1273
1275
  key: string,
1274
1276
  value:
@@ -1278,10 +1280,8 @@ export declare abstract class R2Bucket {
1278
1280
  | string
1279
1281
  | null
1280
1282
  | Blob,
1281
- options?: R2PutOptions & {
1282
- onlyIf: R2Conditional | Headers;
1283
- }
1284
- ): Promise<R2Object | null>;
1283
+ options?: R2PutOptions
1284
+ ): Promise<R2Object>;
1285
1285
  createMultipartUpload(
1286
1286
  key: string,
1287
1287
  options?: R2MultipartOptions
@@ -1266,8 +1266,10 @@ declare abstract class R2Bucket {
1266
1266
  | string
1267
1267
  | null
1268
1268
  | Blob,
1269
- options?: R2PutOptions
1270
- ): Promise<R2Object>;
1269
+ options?: R2PutOptions & {
1270
+ onlyIf: R2Conditional | Headers;
1271
+ }
1272
+ ): Promise<R2Object | null>;
1271
1273
  put(
1272
1274
  key: string,
1273
1275
  value:
@@ -1277,10 +1279,8 @@ declare abstract class R2Bucket {
1277
1279
  | string
1278
1280
  | null
1279
1281
  | Blob,
1280
- options?: R2PutOptions & {
1281
- onlyIf: R2Conditional | Headers;
1282
- }
1283
- ): Promise<R2Object | null>;
1282
+ options?: R2PutOptions
1283
+ ): Promise<R2Object>;
1284
1284
  createMultipartUpload(
1285
1285
  key: string,
1286
1286
  options?: R2MultipartOptions
@@ -1268,8 +1268,10 @@ export declare abstract class R2Bucket {
1268
1268
  | string
1269
1269
  | null
1270
1270
  | Blob,
1271
- options?: R2PutOptions
1272
- ): Promise<R2Object>;
1271
+ options?: R2PutOptions & {
1272
+ onlyIf: R2Conditional | Headers;
1273
+ }
1274
+ ): Promise<R2Object | null>;
1273
1275
  put(
1274
1276
  key: string,
1275
1277
  value:
@@ -1279,10 +1281,8 @@ export declare abstract class R2Bucket {
1279
1281
  | string
1280
1282
  | null
1281
1283
  | Blob,
1282
- options?: R2PutOptions & {
1283
- onlyIf: R2Conditional | Headers;
1284
- }
1285
- ): Promise<R2Object | null>;
1284
+ options?: R2PutOptions
1285
+ ): Promise<R2Object>;
1286
1286
  createMultipartUpload(
1287
1287
  key: string,
1288
1288
  options?: R2MultipartOptions
@@ -1266,8 +1266,10 @@ declare abstract class R2Bucket {
1266
1266
  | string
1267
1267
  | null
1268
1268
  | Blob,
1269
- options?: R2PutOptions
1270
- ): Promise<R2Object>;
1269
+ options?: R2PutOptions & {
1270
+ onlyIf: R2Conditional | Headers;
1271
+ }
1272
+ ): Promise<R2Object | null>;
1271
1273
  put(
1272
1274
  key: string,
1273
1275
  value:
@@ -1277,10 +1279,8 @@ declare abstract class R2Bucket {
1277
1279
  | string
1278
1280
  | null
1279
1281
  | Blob,
1280
- options?: R2PutOptions & {
1281
- onlyIf: R2Conditional | Headers;
1282
- }
1283
- ): Promise<R2Object | null>;
1282
+ options?: R2PutOptions
1283
+ ): Promise<R2Object>;
1284
1284
  createMultipartUpload(
1285
1285
  key: string,
1286
1286
  options?: R2MultipartOptions
@@ -1268,8 +1268,10 @@ export declare abstract class R2Bucket {
1268
1268
  | string
1269
1269
  | null
1270
1270
  | Blob,
1271
- options?: R2PutOptions
1272
- ): Promise<R2Object>;
1271
+ options?: R2PutOptions & {
1272
+ onlyIf: R2Conditional | Headers;
1273
+ }
1274
+ ): Promise<R2Object | null>;
1273
1275
  put(
1274
1276
  key: string,
1275
1277
  value:
@@ -1279,10 +1281,8 @@ export declare abstract class R2Bucket {
1279
1281
  | string
1280
1282
  | null
1281
1283
  | Blob,
1282
- options?: R2PutOptions & {
1283
- onlyIf: R2Conditional | Headers;
1284
- }
1285
- ): Promise<R2Object | null>;
1284
+ options?: R2PutOptions
1285
+ ): Promise<R2Object>;
1286
1286
  createMultipartUpload(
1287
1287
  key: string,
1288
1288
  options?: R2MultipartOptions
@@ -1270,8 +1270,10 @@ declare abstract class R2Bucket {
1270
1270
  | string
1271
1271
  | null
1272
1272
  | Blob,
1273
- options?: R2PutOptions
1274
- ): Promise<R2Object>;
1273
+ options?: R2PutOptions & {
1274
+ onlyIf: R2Conditional | Headers;
1275
+ }
1276
+ ): Promise<R2Object | null>;
1275
1277
  put(
1276
1278
  key: string,
1277
1279
  value:
@@ -1281,10 +1283,8 @@ declare abstract class R2Bucket {
1281
1283
  | string
1282
1284
  | null
1283
1285
  | Blob,
1284
- options?: R2PutOptions & {
1285
- onlyIf: R2Conditional | Headers;
1286
- }
1287
- ): Promise<R2Object | null>;
1286
+ options?: R2PutOptions
1287
+ ): Promise<R2Object>;
1288
1288
  createMultipartUpload(
1289
1289
  key: string,
1290
1290
  options?: R2MultipartOptions
@@ -1272,8 +1272,10 @@ export declare abstract class R2Bucket {
1272
1272
  | string
1273
1273
  | null
1274
1274
  | Blob,
1275
- options?: R2PutOptions
1276
- ): Promise<R2Object>;
1275
+ options?: R2PutOptions & {
1276
+ onlyIf: R2Conditional | Headers;
1277
+ }
1278
+ ): Promise<R2Object | null>;
1277
1279
  put(
1278
1280
  key: string,
1279
1281
  value:
@@ -1283,10 +1285,8 @@ export declare abstract class R2Bucket {
1283
1285
  | string
1284
1286
  | null
1285
1287
  | Blob,
1286
- options?: R2PutOptions & {
1287
- onlyIf: R2Conditional | Headers;
1288
- }
1289
- ): Promise<R2Object | null>;
1288
+ options?: R2PutOptions
1289
+ ): Promise<R2Object>;
1290
1290
  createMultipartUpload(
1291
1291
  key: string,
1292
1292
  options?: R2MultipartOptions
@@ -1104,17 +1104,39 @@ declare abstract class Fetcher {
1104
1104
  queue(
1105
1105
  queueName: string,
1106
1106
  messages: ServiceBindingQueueMessage[]
1107
- ): Promise<QueueResponse>;
1107
+ ): Promise<FetcherQueueResult>;
1108
+ scheduled(options?: FetcherScheduledOptions): Promise<FetcherScheduledResult>;
1108
1109
  }
1109
1110
  declare interface FetcherPutOptions {
1110
1111
  expiration?: number;
1111
1112
  expirationTtl?: number;
1112
1113
  }
1113
- declare interface ServiceBindingQueueMessage<Body = unknown> {
1114
+ declare interface FetcherScheduledOptions {
1115
+ scheduledTime?: Date;
1116
+ cron?: string;
1117
+ }
1118
+ declare interface FetcherScheduledResult {
1119
+ outcome: string;
1120
+ noRetry: boolean;
1121
+ }
1122
+ declare interface FetcherQueueResult {
1123
+ outcome: string;
1124
+ retryAll: boolean;
1125
+ ackAll: boolean;
1126
+ explicitRetries: string[];
1127
+ explicitAcks: string[];
1128
+ }
1129
+ declare type ServiceBindingQueueMessage<Body = unknown> = {
1114
1130
  id: string;
1115
1131
  timestamp: Date;
1116
- body: Body;
1117
- }
1132
+ } & (
1133
+ | {
1134
+ body: Body;
1135
+ }
1136
+ | {
1137
+ serializedBody: ArrayBuffer | ArrayBufferView;
1138
+ }
1139
+ );
1118
1140
  declare interface KVNamespaceListKey<Metadata, Key extends string = string> {
1119
1141
  name: Key;
1120
1142
  expiration?: number;
@@ -1237,13 +1259,6 @@ declare interface MessageSendRequest<Body = unknown> {
1237
1259
  body: Body;
1238
1260
  contentType?: QueueContentType;
1239
1261
  }
1240
- declare interface QueueResponse {
1241
- outcome: number;
1242
- retryAll: boolean;
1243
- ackAll: boolean;
1244
- explicitRetries: string[];
1245
- explicitAcks: string[];
1246
- }
1247
1262
  declare interface Message<Body = unknown> {
1248
1263
  readonly id: string;
1249
1264
  readonly timestamp: Date;
@@ -1296,8 +1311,10 @@ declare abstract class R2Bucket {
1296
1311
  | string
1297
1312
  | null
1298
1313
  | Blob,
1299
- options?: R2PutOptions
1300
- ): Promise<R2Object>;
1314
+ options?: R2PutOptions & {
1315
+ onlyIf: R2Conditional | Headers;
1316
+ }
1317
+ ): Promise<R2Object | null>;
1301
1318
  put(
1302
1319
  key: string,
1303
1320
  value:
@@ -1307,10 +1324,8 @@ declare abstract class R2Bucket {
1307
1324
  | string
1308
1325
  | null
1309
1326
  | Blob,
1310
- options?: R2PutOptions & {
1311
- onlyIf: R2Conditional | Headers;
1312
- }
1313
- ): Promise<R2Object | null>;
1327
+ options?: R2PutOptions
1328
+ ): Promise<R2Object>;
1314
1329
  createMultipartUpload(
1315
1330
  key: string,
1316
1331
  options?: R2MultipartOptions
@@ -1938,6 +1953,8 @@ declare abstract class SqlStorageStatement {}
1938
1953
  declare abstract class SqlStorageCursor {
1939
1954
  raw(): IterableIterator<((ArrayBuffer | string | number) | null)[]>;
1940
1955
  get columnNames(): string[];
1956
+ get rowsRead(): number;
1957
+ get rowsWritten(): number;
1941
1958
  [Symbol.iterator](): IterableIterator<
1942
1959
  Record<string, (ArrayBuffer | string | number) | null>
1943
1960
  >;
@@ -1106,17 +1106,39 @@ export declare abstract class Fetcher {
1106
1106
  queue(
1107
1107
  queueName: string,
1108
1108
  messages: ServiceBindingQueueMessage[]
1109
- ): Promise<QueueResponse>;
1109
+ ): Promise<FetcherQueueResult>;
1110
+ scheduled(options?: FetcherScheduledOptions): Promise<FetcherScheduledResult>;
1110
1111
  }
1111
1112
  export interface FetcherPutOptions {
1112
1113
  expiration?: number;
1113
1114
  expirationTtl?: number;
1114
1115
  }
1115
- export interface ServiceBindingQueueMessage<Body = unknown> {
1116
+ export interface FetcherScheduledOptions {
1117
+ scheduledTime?: Date;
1118
+ cron?: string;
1119
+ }
1120
+ export interface FetcherScheduledResult {
1121
+ outcome: string;
1122
+ noRetry: boolean;
1123
+ }
1124
+ export interface FetcherQueueResult {
1125
+ outcome: string;
1126
+ retryAll: boolean;
1127
+ ackAll: boolean;
1128
+ explicitRetries: string[];
1129
+ explicitAcks: string[];
1130
+ }
1131
+ export type ServiceBindingQueueMessage<Body = unknown> = {
1116
1132
  id: string;
1117
1133
  timestamp: Date;
1118
- body: Body;
1119
- }
1134
+ } & (
1135
+ | {
1136
+ body: Body;
1137
+ }
1138
+ | {
1139
+ serializedBody: ArrayBuffer | ArrayBufferView;
1140
+ }
1141
+ );
1120
1142
  export interface KVNamespaceListKey<Metadata, Key extends string = string> {
1121
1143
  name: Key;
1122
1144
  expiration?: number;
@@ -1239,13 +1261,6 @@ export interface MessageSendRequest<Body = unknown> {
1239
1261
  body: Body;
1240
1262
  contentType?: QueueContentType;
1241
1263
  }
1242
- export interface QueueResponse {
1243
- outcome: number;
1244
- retryAll: boolean;
1245
- ackAll: boolean;
1246
- explicitRetries: string[];
1247
- explicitAcks: string[];
1248
- }
1249
1264
  export interface Message<Body = unknown> {
1250
1265
  readonly id: string;
1251
1266
  readonly timestamp: Date;
@@ -1298,8 +1313,10 @@ export declare abstract class R2Bucket {
1298
1313
  | string
1299
1314
  | null
1300
1315
  | Blob,
1301
- options?: R2PutOptions
1302
- ): Promise<R2Object>;
1316
+ options?: R2PutOptions & {
1317
+ onlyIf: R2Conditional | Headers;
1318
+ }
1319
+ ): Promise<R2Object | null>;
1303
1320
  put(
1304
1321
  key: string,
1305
1322
  value:
@@ -1309,10 +1326,8 @@ export declare abstract class R2Bucket {
1309
1326
  | string
1310
1327
  | null
1311
1328
  | Blob,
1312
- options?: R2PutOptions & {
1313
- onlyIf: R2Conditional | Headers;
1314
- }
1315
- ): Promise<R2Object | null>;
1329
+ options?: R2PutOptions
1330
+ ): Promise<R2Object>;
1316
1331
  createMultipartUpload(
1317
1332
  key: string,
1318
1333
  options?: R2MultipartOptions
@@ -1943,6 +1958,8 @@ export declare abstract class SqlStorageStatement {}
1943
1958
  export declare abstract class SqlStorageCursor {
1944
1959
  raw(): IterableIterator<((ArrayBuffer | string | number) | null)[]>;
1945
1960
  get columnNames(): string[];
1961
+ get rowsRead(): number;
1962
+ get rowsWritten(): number;
1946
1963
  [Symbol.iterator](): IterableIterator<
1947
1964
  Record<string, (ArrayBuffer | string | number) | null>
1948
1965
  >;
package/index.d.ts CHANGED
@@ -1279,8 +1279,10 @@ declare abstract class R2Bucket {
1279
1279
  | string
1280
1280
  | null
1281
1281
  | Blob,
1282
- options?: R2PutOptions
1283
- ): Promise<R2Object>;
1282
+ options?: R2PutOptions & {
1283
+ onlyIf: R2Conditional | Headers;
1284
+ }
1285
+ ): Promise<R2Object | null>;
1284
1286
  put(
1285
1287
  key: string,
1286
1288
  value:
@@ -1290,10 +1292,8 @@ declare abstract class R2Bucket {
1290
1292
  | string
1291
1293
  | null
1292
1294
  | Blob,
1293
- options?: R2PutOptions & {
1294
- onlyIf: R2Conditional | Headers;
1295
- }
1296
- ): Promise<R2Object | null>;
1295
+ options?: R2PutOptions
1296
+ ): Promise<R2Object>;
1297
1297
  createMultipartUpload(
1298
1298
  key: string,
1299
1299
  options?: R2MultipartOptions
package/index.ts CHANGED
@@ -1281,8 +1281,10 @@ export declare abstract class R2Bucket {
1281
1281
  | string
1282
1282
  | null
1283
1283
  | Blob,
1284
- options?: R2PutOptions
1285
- ): Promise<R2Object>;
1284
+ options?: R2PutOptions & {
1285
+ onlyIf: R2Conditional | Headers;
1286
+ }
1287
+ ): Promise<R2Object | null>;
1286
1288
  put(
1287
1289
  key: string,
1288
1290
  value:
@@ -1292,10 +1294,8 @@ export declare abstract class R2Bucket {
1292
1294
  | string
1293
1295
  | null
1294
1296
  | Blob,
1295
- options?: R2PutOptions & {
1296
- onlyIf: R2Conditional | Headers;
1297
- }
1298
- ): Promise<R2Object | null>;
1297
+ options?: R2PutOptions
1298
+ ): Promise<R2Object>;
1299
1299
  createMultipartUpload(
1300
1300
  key: string,
1301
1301
  options?: R2MultipartOptions
package/oldest/index.d.ts CHANGED
@@ -1279,8 +1279,10 @@ declare abstract class R2Bucket {
1279
1279
  | string
1280
1280
  | null
1281
1281
  | Blob,
1282
- options?: R2PutOptions
1283
- ): Promise<R2Object>;
1282
+ options?: R2PutOptions & {
1283
+ onlyIf: R2Conditional | Headers;
1284
+ }
1285
+ ): Promise<R2Object | null>;
1284
1286
  put(
1285
1287
  key: string,
1286
1288
  value:
@@ -1290,10 +1292,8 @@ declare abstract class R2Bucket {
1290
1292
  | string
1291
1293
  | null
1292
1294
  | Blob,
1293
- options?: R2PutOptions & {
1294
- onlyIf: R2Conditional | Headers;
1295
- }
1296
- ): Promise<R2Object | null>;
1295
+ options?: R2PutOptions
1296
+ ): Promise<R2Object>;
1297
1297
  createMultipartUpload(
1298
1298
  key: string,
1299
1299
  options?: R2MultipartOptions
package/oldest/index.ts CHANGED
@@ -1281,8 +1281,10 @@ export declare abstract class R2Bucket {
1281
1281
  | string
1282
1282
  | null
1283
1283
  | Blob,
1284
- options?: R2PutOptions
1285
- ): Promise<R2Object>;
1284
+ options?: R2PutOptions & {
1285
+ onlyIf: R2Conditional | Headers;
1286
+ }
1287
+ ): Promise<R2Object | null>;
1286
1288
  put(
1287
1289
  key: string,
1288
1290
  value:
@@ -1292,10 +1294,8 @@ export declare abstract class R2Bucket {
1292
1294
  | string
1293
1295
  | null
1294
1296
  | Blob,
1295
- options?: R2PutOptions & {
1296
- onlyIf: R2Conditional | Headers;
1297
- }
1298
- ): Promise<R2Object | null>;
1297
+ options?: R2PutOptions
1298
+ ): Promise<R2Object>;
1299
1299
  createMultipartUpload(
1300
1300
  key: string,
1301
1301
  options?: R2MultipartOptions
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": "4.20230801.0"
10
+ "version": "4.20230814.0"
11
11
  }