Skip to content

Commit fb499ee

Browse files
committed
update types/generated-snapshots
Run: bazel build //types:types && rm -rf types/generated-snapshot && cp -r bazel-bin/types/definitions types/generated-snapshot
1 parent 0b7242c commit fb499ee

File tree

20 files changed

+740
-20
lines changed

20 files changed

+740
-20
lines changed

types/generated-snapshot/2021-11-03/index.d.ts

+37-1
Original file line numberDiff line numberDiff line change
@@ -5400,11 +5400,47 @@ interface D1ExecResult {
54005400
count: number;
54015401
duration: number;
54025402
}
5403+
type D1SessionConstraint =
5404+
// Indicates that the first query should go to the primary, and the rest queries
5405+
// using the same D1DatabaseSession will go to any replica that is consistent with
5406+
// the bookmark maintained by the session (returned by the first query).
5407+
| "first-primary"
5408+
// Indicates that the first query can go anywhere (primary or replica), and the rest queries
5409+
// using the same D1DatabaseSession will go to any replica that is consistent with
5410+
// the bookmark maintained by the session (returned by the first query).
5411+
| "first-unconstrained";
5412+
type D1SessionBookmark = string;
54035413
declare abstract class D1Database {
54045414
prepare(query: string): D1PreparedStatement;
5405-
dump(): Promise<ArrayBuffer>;
54065415
batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>;
54075416
exec(query: string): Promise<D1ExecResult>;
5417+
/**
5418+
* Creates a new D1 Session anchored at the given constraint or the bookmark.
5419+
* All queries executed using the created session will have sequential consistency,
5420+
* meaning that all writes done through the session will be visible in subsequent reads.
5421+
*
5422+
* @param constraintOrBookmark Either the session constraint or the explicit bookmark to anchor the created session.
5423+
*/
5424+
withSession(
5425+
constraintOrBookmark:
5426+
| D1SessionBookmark
5427+
| D1SessionConstraint
5428+
| null
5429+
| undefined,
5430+
): D1DatabaseSession;
5431+
/**
5432+
* @deprecated dump() will be removed soon, only applies to deprecated alpha v1 databases.
5433+
*/
5434+
dump(): Promise<ArrayBuffer>;
5435+
}
5436+
declare abstract class D1DatabaseSession {
5437+
prepare(query: string): D1PreparedStatement;
5438+
batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>;
5439+
/**
5440+
* @returns The latest session bookmark across all executed queries on the session.
5441+
* If no query has been executed yet, `null` is returned.
5442+
*/
5443+
getBookmark(): D1SessionBookmark | null;
54085444
}
54095445
declare abstract class D1PreparedStatement {
54105446
bind(...values: unknown[]): D1PreparedStatement;

types/generated-snapshot/2021-11-03/index.ts

+37-1
Original file line numberDiff line numberDiff line change
@@ -5426,11 +5426,47 @@ export interface D1ExecResult {
54265426
count: number;
54275427
duration: number;
54285428
}
5429+
export type D1SessionConstraint =
5430+
// Indicates that the first query should go to the primary, and the rest queries
5431+
// using the same D1DatabaseSession will go to any replica that is consistent with
5432+
// the bookmark maintained by the session (returned by the first query).
5433+
| "first-primary"
5434+
// Indicates that the first query can go anywhere (primary or replica), and the rest queries
5435+
// using the same D1DatabaseSession will go to any replica that is consistent with
5436+
// the bookmark maintained by the session (returned by the first query).
5437+
| "first-unconstrained";
5438+
export type D1SessionBookmark = string;
54295439
export declare abstract class D1Database {
54305440
prepare(query: string): D1PreparedStatement;
5431-
dump(): Promise<ArrayBuffer>;
54325441
batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>;
54335442
exec(query: string): Promise<D1ExecResult>;
5443+
/**
5444+
* Creates a new D1 Session anchored at the given constraint or the bookmark.
5445+
* All queries executed using the created session will have sequential consistency,
5446+
* meaning that all writes done through the session will be visible in subsequent reads.
5447+
*
5448+
* @param constraintOrBookmark Either the session constraint or the explicit bookmark to anchor the created session.
5449+
*/
5450+
withSession(
5451+
constraintOrBookmark:
5452+
| D1SessionBookmark
5453+
| D1SessionConstraint
5454+
| null
5455+
| undefined,
5456+
): D1DatabaseSession;
5457+
/**
5458+
* @deprecated dump() will be removed soon, only applies to deprecated alpha v1 databases.
5459+
*/
5460+
dump(): Promise<ArrayBuffer>;
5461+
}
5462+
export declare abstract class D1DatabaseSession {
5463+
prepare(query: string): D1PreparedStatement;
5464+
batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>;
5465+
/**
5466+
* @returns The latest session bookmark across all executed queries on the session.
5467+
* If no query has been executed yet, `null` is returned.
5468+
*/
5469+
getBookmark(): D1SessionBookmark | null;
54345470
}
54355471
export declare abstract class D1PreparedStatement {
54365472
bind(...values: unknown[]): D1PreparedStatement;

types/generated-snapshot/2022-01-31/index.d.ts

+37-1
Original file line numberDiff line numberDiff line change
@@ -5426,11 +5426,47 @@ interface D1ExecResult {
54265426
count: number;
54275427
duration: number;
54285428
}
5429+
type D1SessionConstraint =
5430+
// Indicates that the first query should go to the primary, and the rest queries
5431+
// using the same D1DatabaseSession will go to any replica that is consistent with
5432+
// the bookmark maintained by the session (returned by the first query).
5433+
| "first-primary"
5434+
// Indicates that the first query can go anywhere (primary or replica), and the rest queries
5435+
// using the same D1DatabaseSession will go to any replica that is consistent with
5436+
// the bookmark maintained by the session (returned by the first query).
5437+
| "first-unconstrained";
5438+
type D1SessionBookmark = string;
54295439
declare abstract class D1Database {
54305440
prepare(query: string): D1PreparedStatement;
5431-
dump(): Promise<ArrayBuffer>;
54325441
batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>;
54335442
exec(query: string): Promise<D1ExecResult>;
5443+
/**
5444+
* Creates a new D1 Session anchored at the given constraint or the bookmark.
5445+
* All queries executed using the created session will have sequential consistency,
5446+
* meaning that all writes done through the session will be visible in subsequent reads.
5447+
*
5448+
* @param constraintOrBookmark Either the session constraint or the explicit bookmark to anchor the created session.
5449+
*/
5450+
withSession(
5451+
constraintOrBookmark:
5452+
| D1SessionBookmark
5453+
| D1SessionConstraint
5454+
| null
5455+
| undefined,
5456+
): D1DatabaseSession;
5457+
/**
5458+
* @deprecated dump() will be removed soon, only applies to deprecated alpha v1 databases.
5459+
*/
5460+
dump(): Promise<ArrayBuffer>;
5461+
}
5462+
declare abstract class D1DatabaseSession {
5463+
prepare(query: string): D1PreparedStatement;
5464+
batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>;
5465+
/**
5466+
* @returns The latest session bookmark across all executed queries on the session.
5467+
* If no query has been executed yet, `null` is returned.
5468+
*/
5469+
getBookmark(): D1SessionBookmark | null;
54345470
}
54355471
declare abstract class D1PreparedStatement {
54365472
bind(...values: unknown[]): D1PreparedStatement;

types/generated-snapshot/2022-01-31/index.ts

+37-1
Original file line numberDiff line numberDiff line change
@@ -5452,11 +5452,47 @@ export interface D1ExecResult {
54525452
count: number;
54535453
duration: number;
54545454
}
5455+
export type D1SessionConstraint =
5456+
// Indicates that the first query should go to the primary, and the rest queries
5457+
// using the same D1DatabaseSession will go to any replica that is consistent with
5458+
// the bookmark maintained by the session (returned by the first query).
5459+
| "first-primary"
5460+
// Indicates that the first query can go anywhere (primary or replica), and the rest queries
5461+
// using the same D1DatabaseSession will go to any replica that is consistent with
5462+
// the bookmark maintained by the session (returned by the first query).
5463+
| "first-unconstrained";
5464+
export type D1SessionBookmark = string;
54555465
export declare abstract class D1Database {
54565466
prepare(query: string): D1PreparedStatement;
5457-
dump(): Promise<ArrayBuffer>;
54585467
batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>;
54595468
exec(query: string): Promise<D1ExecResult>;
5469+
/**
5470+
* Creates a new D1 Session anchored at the given constraint or the bookmark.
5471+
* All queries executed using the created session will have sequential consistency,
5472+
* meaning that all writes done through the session will be visible in subsequent reads.
5473+
*
5474+
* @param constraintOrBookmark Either the session constraint or the explicit bookmark to anchor the created session.
5475+
*/
5476+
withSession(
5477+
constraintOrBookmark:
5478+
| D1SessionBookmark
5479+
| D1SessionConstraint
5480+
| null
5481+
| undefined,
5482+
): D1DatabaseSession;
5483+
/**
5484+
* @deprecated dump() will be removed soon, only applies to deprecated alpha v1 databases.
5485+
*/
5486+
dump(): Promise<ArrayBuffer>;
5487+
}
5488+
export declare abstract class D1DatabaseSession {
5489+
prepare(query: string): D1PreparedStatement;
5490+
batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>;
5491+
/**
5492+
* @returns The latest session bookmark across all executed queries on the session.
5493+
* If no query has been executed yet, `null` is returned.
5494+
*/
5495+
getBookmark(): D1SessionBookmark | null;
54605496
}
54615497
export declare abstract class D1PreparedStatement {
54625498
bind(...values: unknown[]): D1PreparedStatement;

types/generated-snapshot/2022-03-21/index.d.ts

+37-1
Original file line numberDiff line numberDiff line change
@@ -5451,11 +5451,47 @@ interface D1ExecResult {
54515451
count: number;
54525452
duration: number;
54535453
}
5454+
type D1SessionConstraint =
5455+
// Indicates that the first query should go to the primary, and the rest queries
5456+
// using the same D1DatabaseSession will go to any replica that is consistent with
5457+
// the bookmark maintained by the session (returned by the first query).
5458+
| "first-primary"
5459+
// Indicates that the first query can go anywhere (primary or replica), and the rest queries
5460+
// using the same D1DatabaseSession will go to any replica that is consistent with
5461+
// the bookmark maintained by the session (returned by the first query).
5462+
| "first-unconstrained";
5463+
type D1SessionBookmark = string;
54545464
declare abstract class D1Database {
54555465
prepare(query: string): D1PreparedStatement;
5456-
dump(): Promise<ArrayBuffer>;
54575466
batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>;
54585467
exec(query: string): Promise<D1ExecResult>;
5468+
/**
5469+
* Creates a new D1 Session anchored at the given constraint or the bookmark.
5470+
* All queries executed using the created session will have sequential consistency,
5471+
* meaning that all writes done through the session will be visible in subsequent reads.
5472+
*
5473+
* @param constraintOrBookmark Either the session constraint or the explicit bookmark to anchor the created session.
5474+
*/
5475+
withSession(
5476+
constraintOrBookmark:
5477+
| D1SessionBookmark
5478+
| D1SessionConstraint
5479+
| null
5480+
| undefined,
5481+
): D1DatabaseSession;
5482+
/**
5483+
* @deprecated dump() will be removed soon, only applies to deprecated alpha v1 databases.
5484+
*/
5485+
dump(): Promise<ArrayBuffer>;
5486+
}
5487+
declare abstract class D1DatabaseSession {
5488+
prepare(query: string): D1PreparedStatement;
5489+
batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>;
5490+
/**
5491+
* @returns The latest session bookmark across all executed queries on the session.
5492+
* If no query has been executed yet, `null` is returned.
5493+
*/
5494+
getBookmark(): D1SessionBookmark | null;
54595495
}
54605496
declare abstract class D1PreparedStatement {
54615497
bind(...values: unknown[]): D1PreparedStatement;

types/generated-snapshot/2022-03-21/index.ts

+37-1
Original file line numberDiff line numberDiff line change
@@ -5477,11 +5477,47 @@ export interface D1ExecResult {
54775477
count: number;
54785478
duration: number;
54795479
}
5480+
export type D1SessionConstraint =
5481+
// Indicates that the first query should go to the primary, and the rest queries
5482+
// using the same D1DatabaseSession will go to any replica that is consistent with
5483+
// the bookmark maintained by the session (returned by the first query).
5484+
| "first-primary"
5485+
// Indicates that the first query can go anywhere (primary or replica), and the rest queries
5486+
// using the same D1DatabaseSession will go to any replica that is consistent with
5487+
// the bookmark maintained by the session (returned by the first query).
5488+
| "first-unconstrained";
5489+
export type D1SessionBookmark = string;
54805490
export declare abstract class D1Database {
54815491
prepare(query: string): D1PreparedStatement;
5482-
dump(): Promise<ArrayBuffer>;
54835492
batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>;
54845493
exec(query: string): Promise<D1ExecResult>;
5494+
/**
5495+
* Creates a new D1 Session anchored at the given constraint or the bookmark.
5496+
* All queries executed using the created session will have sequential consistency,
5497+
* meaning that all writes done through the session will be visible in subsequent reads.
5498+
*
5499+
* @param constraintOrBookmark Either the session constraint or the explicit bookmark to anchor the created session.
5500+
*/
5501+
withSession(
5502+
constraintOrBookmark:
5503+
| D1SessionBookmark
5504+
| D1SessionConstraint
5505+
| null
5506+
| undefined,
5507+
): D1DatabaseSession;
5508+
/**
5509+
* @deprecated dump() will be removed soon, only applies to deprecated alpha v1 databases.
5510+
*/
5511+
dump(): Promise<ArrayBuffer>;
5512+
}
5513+
export declare abstract class D1DatabaseSession {
5514+
prepare(query: string): D1PreparedStatement;
5515+
batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>;
5516+
/**
5517+
* @returns The latest session bookmark across all executed queries on the session.
5518+
* If no query has been executed yet, `null` is returned.
5519+
*/
5520+
getBookmark(): D1SessionBookmark | null;
54855521
}
54865522
export declare abstract class D1PreparedStatement {
54875523
bind(...values: unknown[]): D1PreparedStatement;

types/generated-snapshot/2022-08-04/index.d.ts

+37-1
Original file line numberDiff line numberDiff line change
@@ -5452,11 +5452,47 @@ interface D1ExecResult {
54525452
count: number;
54535453
duration: number;
54545454
}
5455+
type D1SessionConstraint =
5456+
// Indicates that the first query should go to the primary, and the rest queries
5457+
// using the same D1DatabaseSession will go to any replica that is consistent with
5458+
// the bookmark maintained by the session (returned by the first query).
5459+
| "first-primary"
5460+
// Indicates that the first query can go anywhere (primary or replica), and the rest queries
5461+
// using the same D1DatabaseSession will go to any replica that is consistent with
5462+
// the bookmark maintained by the session (returned by the first query).
5463+
| "first-unconstrained";
5464+
type D1SessionBookmark = string;
54555465
declare abstract class D1Database {
54565466
prepare(query: string): D1PreparedStatement;
5457-
dump(): Promise<ArrayBuffer>;
54585467
batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>;
54595468
exec(query: string): Promise<D1ExecResult>;
5469+
/**
5470+
* Creates a new D1 Session anchored at the given constraint or the bookmark.
5471+
* All queries executed using the created session will have sequential consistency,
5472+
* meaning that all writes done through the session will be visible in subsequent reads.
5473+
*
5474+
* @param constraintOrBookmark Either the session constraint or the explicit bookmark to anchor the created session.
5475+
*/
5476+
withSession(
5477+
constraintOrBookmark:
5478+
| D1SessionBookmark
5479+
| D1SessionConstraint
5480+
| null
5481+
| undefined,
5482+
): D1DatabaseSession;
5483+
/**
5484+
* @deprecated dump() will be removed soon, only applies to deprecated alpha v1 databases.
5485+
*/
5486+
dump(): Promise<ArrayBuffer>;
5487+
}
5488+
declare abstract class D1DatabaseSession {
5489+
prepare(query: string): D1PreparedStatement;
5490+
batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>;
5491+
/**
5492+
* @returns The latest session bookmark across all executed queries on the session.
5493+
* If no query has been executed yet, `null` is returned.
5494+
*/
5495+
getBookmark(): D1SessionBookmark | null;
54605496
}
54615497
declare abstract class D1PreparedStatement {
54625498
bind(...values: unknown[]): D1PreparedStatement;

types/generated-snapshot/2022-08-04/index.ts

+37-1
Original file line numberDiff line numberDiff line change
@@ -5478,11 +5478,47 @@ export interface D1ExecResult {
54785478
count: number;
54795479
duration: number;
54805480
}
5481+
export type D1SessionConstraint =
5482+
// Indicates that the first query should go to the primary, and the rest queries
5483+
// using the same D1DatabaseSession will go to any replica that is consistent with
5484+
// the bookmark maintained by the session (returned by the first query).
5485+
| "first-primary"
5486+
// Indicates that the first query can go anywhere (primary or replica), and the rest queries
5487+
// using the same D1DatabaseSession will go to any replica that is consistent with
5488+
// the bookmark maintained by the session (returned by the first query).
5489+
| "first-unconstrained";
5490+
export type D1SessionBookmark = string;
54815491
export declare abstract class D1Database {
54825492
prepare(query: string): D1PreparedStatement;
5483-
dump(): Promise<ArrayBuffer>;
54845493
batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>;
54855494
exec(query: string): Promise<D1ExecResult>;
5495+
/**
5496+
* Creates a new D1 Session anchored at the given constraint or the bookmark.
5497+
* All queries executed using the created session will have sequential consistency,
5498+
* meaning that all writes done through the session will be visible in subsequent reads.
5499+
*
5500+
* @param constraintOrBookmark Either the session constraint or the explicit bookmark to anchor the created session.
5501+
*/
5502+
withSession(
5503+
constraintOrBookmark:
5504+
| D1SessionBookmark
5505+
| D1SessionConstraint
5506+
| null
5507+
| undefined,
5508+
): D1DatabaseSession;
5509+
/**
5510+
* @deprecated dump() will be removed soon, only applies to deprecated alpha v1 databases.
5511+
*/
5512+
dump(): Promise<ArrayBuffer>;
5513+
}
5514+
export declare abstract class D1DatabaseSession {
5515+
prepare(query: string): D1PreparedStatement;
5516+
batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>;
5517+
/**
5518+
* @returns The latest session bookmark across all executed queries on the session.
5519+
* If no query has been executed yet, `null` is returned.
5520+
*/
5521+
getBookmark(): D1SessionBookmark | null;
54865522
}
54875523
export declare abstract class D1PreparedStatement {
54885524
bind(...values: unknown[]): D1PreparedStatement;

0 commit comments

Comments
 (0)