wrangler 3.3.0 → 3.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wrangler",
3
- "version": "3.3.0",
3
+ "version": "3.4.0",
4
4
  "description": "Command-line interface for all things Cloudflare Workers",
5
5
  "keywords": [
6
6
  "wrangler",
@@ -103,7 +103,7 @@
103
103
  "blake3-wasm": "^2.1.5",
104
104
  "chokidar": "^3.5.3",
105
105
  "esbuild": "0.16.3",
106
- "miniflare": "3.20230717.0",
106
+ "miniflare": "3.20230724.0",
107
107
  "nanoid": "^3.3.3",
108
108
  "path-to-regexp": "^6.2.0",
109
109
  "selfsigned": "^2.0.1",
@@ -114,7 +114,7 @@
114
114
  "@cloudflare/eslint-config-worker": "*",
115
115
  "@cloudflare/types": "^6.18.4",
116
116
  "@cloudflare/workers-tsconfig": "*",
117
- "@cloudflare/workers-types": "^4.20230717.0",
117
+ "@cloudflare/workers-types": "^4.20230724.0",
118
118
  "@iarna/toml": "^3.0.0",
119
119
  "@microsoft/api-extractor": "^7.28.3",
120
120
  "@types/better-sqlite3": "^7.6.0",
@@ -5,9 +5,10 @@ import { ConnectionOptions } from 'tls';
5
5
  import { Duplex } from 'stream';
6
6
  import { EventEmitter } from 'events';
7
7
  import { IpcNetConnectOpts } from 'net';
8
+ import type { Json } from 'miniflare';
8
9
  import { Readable } from 'stream';
9
- import { ReadableStream } from 'stream/web';
10
- import { Socket } from 'net';
10
+ import { ReadableStream as ReadableStream_2 } from 'stream/web';
11
+ import { Socket as Socket_2 } from 'net';
11
12
  import { TcpNetConnectOpts } from 'net';
12
13
  import { TlsOptions } from 'tls';
13
14
  import { TLSSocket } from 'tls';
@@ -22,11 +23,11 @@ declare interface BlobPropertyBag {
22
23
  endings?: 'native' | 'transparent'
23
24
  }
24
25
 
25
- declare type BodyInit =
26
+ declare type BodyInit_2 =
26
27
  | ArrayBuffer
27
28
  | AsyncIterable<Uint8Array>
28
29
  | Blob_2
29
- | FormData
30
+ | FormData_2
30
31
  | Iterable<Uint8Array>
31
32
  | NodeJS.ArrayBufferView
32
33
  | URLSearchParams_2
@@ -34,12 +35,12 @@ declare type BodyInit =
34
35
  | string
35
36
 
36
37
  declare interface BodyMixin {
37
- readonly body: ReadableStream | null
38
+ readonly body: ReadableStream_2 | null
38
39
  readonly bodyUsed: boolean
39
40
 
40
41
  readonly arrayBuffer: () => Promise<ArrayBuffer>
41
42
  readonly blob: () => Promise<Blob_2>
42
- readonly formData: () => Promise<FormData>
43
+ readonly formData: () => Promise<FormData_2>
43
44
  readonly json: () => Promise<unknown>
44
45
  readonly text: () => Promise<string>
45
46
  }
@@ -120,16 +121,16 @@ declare namespace buildConnector {
120
121
  port: string
121
122
  servername?: string
122
123
  localAddress?: string | null
123
- httpSocket?: Socket
124
+ httpSocket?: Socket_2
124
125
  }
125
126
 
126
127
  type Callback = (...args: CallbackArgs) => void
127
- type CallbackArgs = [null, Socket | TLSSocket] | [Error, null]
128
+ type CallbackArgs = [null, Socket_2 | TLSSocket] | [Error, null]
128
129
 
129
130
  type connector = connectorAsync | connectorSync
130
131
 
131
132
  interface connectorSync {
132
- (options: buildConnector.Options): Socket | TLSSocket
133
+ (options: buildConnector.Options): Socket_2 | TLSSocket
133
134
  }
134
135
 
135
136
  interface connectorAsync {
@@ -249,10 +250,10 @@ export declare function deleteMTlsCertificate(accountId: string, certificateId:
249
250
  * variable set
250
251
  */
251
252
  declare function deploy({ directory, accountId, projectName, branch, skipCaching, commitMessage, commitHash, commitDirty, functionsDirectory: customFunctionsDirectory, bundle, }: PagesDeployOptions): Promise<{
253
+ url: string;
252
254
  environment: "production" | "preview";
253
255
  id: string;
254
256
  project_id: string;
255
- url: string;
256
257
  project_name: string;
257
258
  build_config: {
258
259
  build_command: string;
@@ -265,12 +266,12 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
265
266
  created_on: string;
266
267
  production_branch: string;
267
268
  deployment_trigger: {
268
- type: string;
269
269
  metadata: {
270
270
  branch: string;
271
271
  commit_hash: string;
272
272
  commit_message: string;
273
273
  };
274
+ type: string;
274
275
  };
275
276
  latest_stage: {
276
277
  name: "build" | "deploy" | "queued" | "initialize" | "clone_repo";
@@ -429,7 +430,7 @@ declare namespace Dispatcher {
429
430
  path: string;
430
431
  method: HttpMethod;
431
432
  /** Default: `null` */
432
- body?: string | Buffer | Uint8Array | Readable | null | FormData;
433
+ body?: string | Buffer | Uint8Array | Readable | null | FormData_2;
433
434
  /** Default: `null` */
434
435
  headers?: IncomingHttpHeaders | string[] | null;
435
436
  /** Query string params to be embedded in the request URL. Default: `null` */
@@ -794,15 +795,12 @@ declare interface EnvironmentInheritable {
794
795
  */
795
796
  zone_id?: string;
796
797
  /**
797
- * Specify a compiled capnp schema to use
798
- * Then add a binding per field in the top level message that you will send to logfwdr
798
+ * List of bindings that you will send to logfwdr
799
799
  *
800
- * @default `{schema:undefined,bindings:[]}`
800
+ * @default `{bindings:[]}`
801
801
  * @inheritable
802
802
  */
803
803
  logfwdr: {
804
- /** capnp schema filename */
805
- schema: string | undefined;
806
804
  bindings: {
807
805
  /** The binding name used to refer to logfwdr */
808
806
  name: string;
@@ -858,9 +856,7 @@ declare interface EnvironmentNonInheritable {
858
856
  * @default `{}`
859
857
  * @nonInheritable
860
858
  */
861
- vars: {
862
- [key: string]: unknown;
863
- };
859
+ vars: Record<string, string | Json>;
864
860
  /**
865
861
  * A list of durable objects that your worker should be bound to.
866
862
  *
@@ -1068,6 +1064,18 @@ declare interface EnvironmentNonInheritable {
1068
1064
  metadata?: {
1069
1065
  [key: string]: string;
1070
1066
  };
1067
+ /**
1068
+ * Used for internal capnp uploads for the Workers runtime
1069
+ */
1070
+ capnp?: {
1071
+ base_path: string;
1072
+ source_schemas: string[];
1073
+ compiled_schema?: never;
1074
+ } | {
1075
+ base_path?: never;
1076
+ source_schemas?: never;
1077
+ compiled_schema: string;
1078
+ };
1071
1079
  };
1072
1080
  mtls_certificates: {
1073
1081
  /** The binding name used to refer to the certificate in the worker */
@@ -1193,7 +1201,7 @@ declare namespace Errors {
1193
1201
  }
1194
1202
  }
1195
1203
 
1196
- declare class File extends Blob_2 {
1204
+ declare class File_2 extends Blob_2 {
1197
1205
  /**
1198
1206
  * Creates a new File instance.
1199
1207
  *
@@ -1226,7 +1234,7 @@ declare interface FilePropertyBag extends BlobPropertyBag {
1226
1234
  /**
1227
1235
  * Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using fetch().
1228
1236
  */
1229
- declare class FormData {
1237
+ declare class FormData_2 {
1230
1238
  /**
1231
1239
  * Appends a new value onto an existing key inside a FormData object,
1232
1240
  * or adds the key if it does not already exist.
@@ -1291,7 +1299,7 @@ declare class FormData {
1291
1299
  * Executes given callback function for each field of the FormData instance
1292
1300
  */
1293
1301
  forEach: (
1294
- callbackfn: (value: FormDataEntryValue, key: string, iterable: FormData) => void,
1302
+ callbackfn: (value: FormDataEntryValue, key: string, iterable: FormData_2) => void,
1295
1303
  thisArg?: unknown
1296
1304
  ) => void
1297
1305
 
@@ -1324,7 +1332,7 @@ declare class FormData {
1324
1332
  /**
1325
1333
  * A `string` or `File` that represents a single value from a set of `FormData` key-value pairs.
1326
1334
  */
1327
- declare type FormDataEntryValue = string | File
1335
+ declare type FormDataEntryValue = string | File_2
1328
1336
 
1329
1337
  /**
1330
1338
  * fetches an mTLS certificate from the account mTLS certificate store by ID
@@ -1336,8 +1344,8 @@ export declare function getMTlsCertificate(accountId: string, id: string): Promi
1336
1344
  */
1337
1345
  export declare function getMTlsCertificateByName(accountId: string, name: string): Promise<MTlsCertificateResponse>;
1338
1346
 
1339
- declare class Headers implements SpecIterable<[string, string]> {
1340
- constructor (init?: HeadersInit)
1347
+ declare class Headers_2 implements SpecIterable<[string, string]> {
1348
+ constructor (init?: HeadersInit_2)
1341
1349
  readonly append: (name: string, value: string) => void
1342
1350
  readonly delete: (name: string) => void
1343
1351
  readonly get: (name: string) => string | null
@@ -1345,7 +1353,7 @@ declare class Headers implements SpecIterable<[string, string]> {
1345
1353
  readonly set: (name: string, value: string) => void
1346
1354
  readonly getSetCookie: () => string[]
1347
1355
  readonly forEach: (
1348
- callbackfn: (value: string, key: string, iterable: Headers) => void,
1356
+ callbackfn: (value: string, key: string, iterable: Headers_2) => void,
1349
1357
  thisArg?: unknown
1350
1358
  ) => void
1351
1359
 
@@ -1355,7 +1363,7 @@ declare class Headers implements SpecIterable<[string, string]> {
1355
1363
  readonly [Symbol.iterator]: () => SpecIterator<[string, string]>
1356
1364
  }
1357
1365
 
1358
- declare type HeadersInit = string[][] | Record<string, string | ReadonlyArray<string>> | Headers
1366
+ declare type HeadersInit_2 = string[][] | Record<string, string | ReadonlyArray<string>> | Headers_2
1359
1367
 
1360
1368
  /**
1361
1369
  * The header type declaration of `undici`.
@@ -1466,13 +1474,13 @@ declare type ReferrerPolicy =
1466
1474
  | 'strict-origin-when-cross-origin'
1467
1475
  | 'unsafe-url';
1468
1476
 
1469
- declare class Request implements BodyMixin {
1470
- constructor (input: RequestInfo, init?: RequestInit)
1477
+ declare class Request_2 implements BodyMixin {
1478
+ constructor (input: RequestInfo_2, init?: RequestInit_2)
1471
1479
 
1472
1480
  readonly cache: RequestCache
1473
1481
  readonly credentials: RequestCredentials
1474
1482
  readonly destination: RequestDestination
1475
- readonly headers: Headers
1483
+ readonly headers: Headers_2
1476
1484
  readonly integrity: string
1477
1485
  readonly method: string
1478
1486
  readonly mode: RequestMode
@@ -1484,16 +1492,16 @@ declare class Request implements BodyMixin {
1484
1492
  readonly signal: AbortSignal
1485
1493
  readonly duplex: RequestDuplex
1486
1494
 
1487
- readonly body: ReadableStream | null
1495
+ readonly body: ReadableStream_2 | null
1488
1496
  readonly bodyUsed: boolean
1489
1497
 
1490
1498
  readonly arrayBuffer: () => Promise<ArrayBuffer>
1491
1499
  readonly blob: () => Promise<Blob_2>
1492
- readonly formData: () => Promise<FormData>
1500
+ readonly formData: () => Promise<FormData_2>
1493
1501
  readonly json: () => Promise<unknown>
1494
1502
  readonly text: () => Promise<string>
1495
1503
 
1496
- readonly clone: () => Request
1504
+ readonly clone: () => Request_2
1497
1505
  }
1498
1506
 
1499
1507
  declare type RequestCache =
@@ -1528,13 +1536,13 @@ declare type RequestDestination =
1528
1536
 
1529
1537
  declare type RequestDuplex = 'half'
1530
1538
 
1531
- declare type RequestInfo = string | URL_2 | Request
1539
+ declare type RequestInfo_2 = string | URL_2 | Request_2
1532
1540
 
1533
- declare interface RequestInit {
1541
+ declare interface RequestInit_2 {
1534
1542
  method?: string
1535
1543
  keepalive?: boolean
1536
- headers?: HeadersInit
1537
- body?: BodyInit
1544
+ headers?: HeadersInit_2
1545
+ body?: BodyInit_2
1538
1546
  redirect?: RequestRedirect
1539
1547
  integrity?: string
1540
1548
  signal?: AbortSignal
@@ -1551,10 +1559,10 @@ declare type RequestMode = 'cors' | 'navigate' | 'no-cors' | 'same-origin'
1551
1559
 
1552
1560
  declare type RequestRedirect = 'error' | 'follow' | 'manual'
1553
1561
 
1554
- declare class Response implements BodyMixin {
1555
- constructor (body?: BodyInit, init?: ResponseInit)
1562
+ declare class Response_2 implements BodyMixin {
1563
+ constructor (body?: BodyInit_2, init?: ResponseInit_2)
1556
1564
 
1557
- readonly headers: Headers
1565
+ readonly headers: Headers_2
1558
1566
  readonly ok: boolean
1559
1567
  readonly status: number
1560
1568
  readonly statusText: string
@@ -1562,26 +1570,26 @@ declare class Response implements BodyMixin {
1562
1570
  readonly url: string
1563
1571
  readonly redirected: boolean
1564
1572
 
1565
- readonly body: ReadableStream | null
1573
+ readonly body: ReadableStream_2 | null
1566
1574
  readonly bodyUsed: boolean
1567
1575
 
1568
1576
  readonly arrayBuffer: () => Promise<ArrayBuffer>
1569
1577
  readonly blob: () => Promise<Blob_2>
1570
- readonly formData: () => Promise<FormData>
1578
+ readonly formData: () => Promise<FormData_2>
1571
1579
  readonly json: () => Promise<unknown>
1572
1580
  readonly text: () => Promise<string>
1573
1581
 
1574
- readonly clone: () => Response
1582
+ readonly clone: () => Response_2
1575
1583
 
1576
- static error (): Response
1577
- static json(data: any, init?: ResponseInit): Response
1578
- static redirect (url: string | URL_2, status: ResponseRedirectStatus): Response
1584
+ static error (): Response_2
1585
+ static json(data: any, init?: ResponseInit_2): Response_2
1586
+ static redirect (url: string | URL_2, status: ResponseRedirectStatus): Response_2
1579
1587
  }
1580
1588
 
1581
- declare interface ResponseInit {
1589
+ declare interface ResponseInit_2 {
1582
1590
  readonly status?: number
1583
1591
  readonly statusText?: string
1584
- readonly headers?: HeadersInit
1592
+ readonly headers?: HeadersInit_2
1585
1593
  }
1586
1594
 
1587
1595
  declare type ResponseRedirectStatus = 301 | 302 | 303 | 307 | 308
@@ -1652,9 +1660,7 @@ export declare interface UnstableDevOptions {
1652
1660
  compatibilityFlags?: string[];
1653
1661
  persist?: boolean;
1654
1662
  persistTo?: string;
1655
- vars?: {
1656
- [key: string]: unknown;
1657
- };
1663
+ vars?: Record<string, string | Json>;
1658
1664
  kv?: {
1659
1665
  binding: string;
1660
1666
  id: string;
@@ -1697,7 +1703,7 @@ export declare interface UnstableDevWorker {
1697
1703
  port: number;
1698
1704
  address: string;
1699
1705
  stop: () => Promise<void>;
1700
- fetch: (input?: RequestInfo, init?: RequestInit) => Promise<Response>;
1706
+ fetch: (input?: RequestInfo_2, init?: RequestInit_2) => Promise<Response_2>;
1701
1707
  waitUntilExit: () => Promise<void>;
1702
1708
  }
1703
1709