@icebreakers/monorepo-templates 1.0.13 → 1.0.15
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/assets/.changeset/publish-versioned-packages.md +5 -0
- package/assets/.github/workflows/ci.yml +1 -1
- package/assets/.github/workflows/release.yml +62 -6
- package/assets/package.json +15 -13
- package/assets/renovate.json +11 -0
- package/dist/cli.d.mts +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +0 -1
- package/dist/index.mjs +1 -1
- package/dist/{prepare-BBSJX9-U.mjs → prepare-CNCmvco-.mjs} +2 -2
- package/package.json +1 -1
- package/templates/cli/package.json +1 -1
- package/templates/client/package.json +21 -21
- package/templates/client/tsconfig.app.json +0 -1
- package/templates/client/worker-configuration.d.ts +190 -27
- package/templates/server/package.json +6 -6
- package/templates/server/src/app.ts +3 -1
- package/templates/server/tsconfig.json +5 -4
- package/templates/server/tsconfig.worker.json +16 -0
- package/templates/server/worker-configuration.d.ts +190 -27
- package/templates/vitepress/monorepo/publish.md +10 -9
- package/templates/vitepress/package.json +6 -6
- package/templates/vue-lib/package.json +5 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
// Generated by Wrangler by running `wrangler types` (hash: bf05258867cf7490d4c96f4ea30bd0ef)
|
|
3
|
-
// Runtime types generated with workerd@1.
|
|
3
|
+
// Runtime types generated with workerd@1.20260811.1 2025-10-16 nodejs_compat
|
|
4
4
|
interface __BaseEnv_Env {
|
|
5
5
|
}
|
|
6
6
|
declare namespace Cloudflare {
|
|
@@ -435,6 +435,7 @@ interface ExecutionContext<Props = unknown> {
|
|
|
435
435
|
cache?: CacheContext;
|
|
436
436
|
readonly access?: CloudflareAccessContext;
|
|
437
437
|
tracing: Tracing;
|
|
438
|
+
abort(reason?: any): void;
|
|
438
439
|
}
|
|
439
440
|
type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown, Props = unknown> = (request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: Env, ctx: ExecutionContext<Props>) => Response | Promise<Response>;
|
|
440
441
|
type ExportedHandlerConnectHandler<Env = unknown, Props = unknown> = (socket: Socket, env: Env, ctx: ExecutionContext<Props>) => void | Promise<void>;
|
|
@@ -523,7 +524,7 @@ declare abstract class DurableObjectNamespace<T extends Rpc.DurableObjectBranded
|
|
|
523
524
|
getByName(name: string, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub<T>;
|
|
524
525
|
jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace<T>;
|
|
525
526
|
}
|
|
526
|
-
type DurableObjectJurisdiction = "eu" | "fedramp" | "fedramp-high";
|
|
527
|
+
type DurableObjectJurisdiction = "eu" | "fedramp" | "fedramp-high" | "us";
|
|
527
528
|
interface DurableObjectNamespaceNewUniqueIdOptions {
|
|
528
529
|
jurisdiction?: DurableObjectJurisdiction;
|
|
529
530
|
}
|
|
@@ -2767,6 +2768,12 @@ interface TraceLog {
|
|
|
2767
2768
|
readonly timestamp: number;
|
|
2768
2769
|
readonly level: string;
|
|
2769
2770
|
readonly message: any;
|
|
2771
|
+
readonly errorInfo?: (TraceLogErrorInfo | null)[];
|
|
2772
|
+
}
|
|
2773
|
+
interface TraceLogErrorInfo {
|
|
2774
|
+
name: string;
|
|
2775
|
+
message: string;
|
|
2776
|
+
stack?: string;
|
|
2770
2777
|
}
|
|
2771
2778
|
interface TraceException {
|
|
2772
2779
|
readonly timestamp: number;
|
|
@@ -3307,18 +3314,26 @@ interface ContainerExecOptions {
|
|
|
3307
3314
|
cwd?: string;
|
|
3308
3315
|
env?: Record<string, string>;
|
|
3309
3316
|
user?: string;
|
|
3317
|
+
signal?: AbortSignal;
|
|
3318
|
+
pty?: boolean | ContainerExecPtyOptions;
|
|
3310
3319
|
stdin?: ReadableStream | "pipe";
|
|
3311
3320
|
stdout?: "pipe" | "ignore";
|
|
3312
3321
|
stderr?: "pipe" | "ignore" | "combined";
|
|
3313
3322
|
}
|
|
3323
|
+
interface ContainerExecPtyOptions {
|
|
3324
|
+
cols?: number;
|
|
3325
|
+
rows?: number;
|
|
3326
|
+
}
|
|
3314
3327
|
interface ExecProcess {
|
|
3315
3328
|
readonly stdin: WritableStream | null;
|
|
3316
3329
|
readonly stdout: ReadableStream | null;
|
|
3317
3330
|
readonly stderr: ReadableStream | null;
|
|
3318
3331
|
readonly pid: number;
|
|
3332
|
+
readonly isPty: boolean;
|
|
3319
3333
|
readonly exitCode: Promise<number>;
|
|
3320
3334
|
output(): Promise<ExecOutput>;
|
|
3321
3335
|
kill(signal?: number): void;
|
|
3336
|
+
resize(cols: number, rows: number): void;
|
|
3322
3337
|
}
|
|
3323
3338
|
interface Container {
|
|
3324
3339
|
get running(): boolean;
|
|
@@ -3365,6 +3380,11 @@ interface ContainerStartupOptions {
|
|
|
3365
3380
|
directorySnapshots?: ContainerDirectorySnapshotRestoreParams[];
|
|
3366
3381
|
containerSnapshot?: ContainerSnapshot;
|
|
3367
3382
|
}
|
|
3383
|
+
interface ContainerStartResources {
|
|
3384
|
+
vcpu: number;
|
|
3385
|
+
memoryMib: number;
|
|
3386
|
+
diskMb: number;
|
|
3387
|
+
}
|
|
3368
3388
|
/**
|
|
3369
3389
|
* The **`MessagePort`** interface of the Channel Messaging API represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other.
|
|
3370
3390
|
*
|
|
@@ -3505,11 +3525,13 @@ declare abstract class Performance {
|
|
|
3505
3525
|
interface Tracing {
|
|
3506
3526
|
enterSpan<T, A extends unknown[]>(name: string, callback: (span: Span, ...args: A) => T, ...args: A): T;
|
|
3507
3527
|
startActiveSpan<T, A extends unknown[]>(name: string, callback: (span: Span, ...args: A) => T, ...args: A): T;
|
|
3528
|
+
startSpan(name: string): Span;
|
|
3508
3529
|
Span: typeof Span;
|
|
3509
3530
|
}
|
|
3510
3531
|
declare abstract class Span {
|
|
3511
3532
|
get isTraced(): boolean;
|
|
3512
|
-
setAttribute(key: string, value
|
|
3533
|
+
setAttribute(key: string, value: boolean | number | string): this;
|
|
3534
|
+
setAttributes(attributes: Record<string, boolean | number | string | undefined>): this;
|
|
3513
3535
|
end(): void;
|
|
3514
3536
|
}
|
|
3515
3537
|
/**
|
|
@@ -4149,6 +4171,13 @@ type AiSearchListItemsParams = {
|
|
|
4149
4171
|
source?: string;
|
|
4150
4172
|
/** JSON-encoded Vectorize filter for metadata filtering. */
|
|
4151
4173
|
metadata_filter?: string;
|
|
4174
|
+
/** Filter items by their unique ID. Returns at most one item. */
|
|
4175
|
+
item_id?: string;
|
|
4176
|
+
/**
|
|
4177
|
+
* Filter items by their exact key (object key / filename). Keys are unique
|
|
4178
|
+
* per source, so combine with `source` to disambiguate across data sources.
|
|
4179
|
+
*/
|
|
4180
|
+
key?: string;
|
|
4152
4181
|
};
|
|
4153
4182
|
type AiSearchListItemsResponse = {
|
|
4154
4183
|
result: AiSearchItemInfo[];
|
|
@@ -12217,6 +12246,13 @@ interface ForwardableEmailMessage extends EmailMessage {
|
|
|
12217
12246
|
* @returns A promise that resolves when the email message is replied.
|
|
12218
12247
|
*/
|
|
12219
12248
|
reply(message: EmailMessage): Promise<EmailSendResult>;
|
|
12249
|
+
/**
|
|
12250
|
+
* Reply to the sender of this email message with a message built from the given
|
|
12251
|
+
* fields. Threading headers (In-Reply-To/References) are set automatically.
|
|
12252
|
+
* @param builder The reply message contents.
|
|
12253
|
+
* @returns A promise that resolves when the email message is replied.
|
|
12254
|
+
*/
|
|
12255
|
+
reply(builder: EmailReplyMessageBuilder): Promise<EmailSendResult>;
|
|
12220
12256
|
}
|
|
12221
12257
|
/** A file attachment for an email message */
|
|
12222
12258
|
type EmailAttachment = {
|
|
@@ -12237,23 +12273,46 @@ interface EmailAddress {
|
|
|
12237
12273
|
name: string;
|
|
12238
12274
|
email: string;
|
|
12239
12275
|
}
|
|
12276
|
+
/**
|
|
12277
|
+
* Recipient fields for `SendEmail.send()`. At least one of `to`, `cc`, or
|
|
12278
|
+
* `bcc` must be provided.
|
|
12279
|
+
*/
|
|
12280
|
+
type EmailDestinations = {
|
|
12281
|
+
to?: string | EmailAddress | (string | EmailAddress)[];
|
|
12282
|
+
cc?: string | EmailAddress | (string | EmailAddress)[];
|
|
12283
|
+
bcc?: string | EmailAddress | (string | EmailAddress)[];
|
|
12284
|
+
} & ({
|
|
12285
|
+
to: string | EmailAddress | (string | EmailAddress)[];
|
|
12286
|
+
} | {
|
|
12287
|
+
cc: string | EmailAddress | (string | EmailAddress)[];
|
|
12288
|
+
} | {
|
|
12289
|
+
bcc: string | EmailAddress | (string | EmailAddress)[];
|
|
12290
|
+
});
|
|
12291
|
+
/**
|
|
12292
|
+
* Fields shared by all composed emails (no recipients). Used directly by
|
|
12293
|
+
* `ForwardableEmailMessage.reply()`, which always replies to the original
|
|
12294
|
+
* sender, and extended by `EmailMessageBuilder` for `SendEmail.send()`.
|
|
12295
|
+
*/
|
|
12296
|
+
interface EmailReplyMessageBuilder {
|
|
12297
|
+
from: string | EmailAddress;
|
|
12298
|
+
subject: string;
|
|
12299
|
+
replyTo?: string | EmailAddress;
|
|
12300
|
+
headers?: Record<string, string>;
|
|
12301
|
+
text?: string;
|
|
12302
|
+
html?: string;
|
|
12303
|
+
attachments?: EmailAttachment[];
|
|
12304
|
+
}
|
|
12305
|
+
/**
|
|
12306
|
+
* Fields for composing an email without constructing raw MIME, for
|
|
12307
|
+
* `SendEmail.send()`. Requires at least one of `to`, `cc`, or `bcc`.
|
|
12308
|
+
*/
|
|
12309
|
+
type EmailMessageBuilder = EmailReplyMessageBuilder & EmailDestinations;
|
|
12240
12310
|
/**
|
|
12241
12311
|
* A binding that allows a Worker to send email messages.
|
|
12242
12312
|
*/
|
|
12243
12313
|
interface SendEmail {
|
|
12244
12314
|
send(message: EmailMessage): Promise<EmailSendResult>;
|
|
12245
|
-
send(builder:
|
|
12246
|
-
from: string | EmailAddress;
|
|
12247
|
-
to: string | EmailAddress | (string | EmailAddress)[];
|
|
12248
|
-
subject: string;
|
|
12249
|
-
replyTo?: string | EmailAddress;
|
|
12250
|
-
cc?: string | EmailAddress | (string | EmailAddress)[];
|
|
12251
|
-
bcc?: string | EmailAddress | (string | EmailAddress)[];
|
|
12252
|
-
headers?: Record<string, string>;
|
|
12253
|
-
text?: string;
|
|
12254
|
-
html?: string;
|
|
12255
|
-
attachments?: EmailAttachment[];
|
|
12256
|
-
}): Promise<EmailSendResult>;
|
|
12315
|
+
send(builder: EmailMessageBuilder): Promise<EmailSendResult>;
|
|
12257
12316
|
}
|
|
12258
12317
|
declare abstract class EmailEvent extends ExtendableEvent {
|
|
12259
12318
|
readonly message: ForwardableEmailMessage;
|
|
@@ -12407,6 +12466,15 @@ interface Hyperdrive {
|
|
|
12407
12466
|
* for your database.
|
|
12408
12467
|
*/
|
|
12409
12468
|
readonly host: string;
|
|
12469
|
+
/*
|
|
12470
|
+
* A synthetic IPv4 address (in the reserved 240.0.0.0/4 range) that, like the
|
|
12471
|
+
* host field, is only valid within the context of the currently running
|
|
12472
|
+
* Worker and, when passed into the `connect()` function from the
|
|
12473
|
+
* "cloudflare:sockets" module, will connect to the Hyperdrive instance for
|
|
12474
|
+
* your database. This is provided for database drivers that require the host
|
|
12475
|
+
* to be an IP literal rather than a hostname.
|
|
12476
|
+
*/
|
|
12477
|
+
readonly ip: string;
|
|
12410
12478
|
/*
|
|
12411
12479
|
* The port that must be paired the the host field when connecting.
|
|
12412
12480
|
*/
|
|
@@ -13075,6 +13143,11 @@ declare namespace CloudflareWorkersModule {
|
|
|
13075
13143
|
export type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
|
13076
13144
|
export type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number;
|
|
13077
13145
|
export type WorkflowDelayDuration = WorkflowSleepDuration;
|
|
13146
|
+
export type WorkflowDynamicDelayContext = {
|
|
13147
|
+
ctx: WorkflowStepContext<WorkflowDelayFunction>;
|
|
13148
|
+
error: Error;
|
|
13149
|
+
};
|
|
13150
|
+
export type WorkflowDelayFunction = (input: WorkflowDynamicDelayContext) => WorkflowDelayDuration | Promise<WorkflowDelayDuration>;
|
|
13078
13151
|
export type WorkflowTimeoutDuration = WorkflowSleepDuration;
|
|
13079
13152
|
export type WorkflowRetentionDuration = WorkflowSleepDuration;
|
|
13080
13153
|
export type WorkflowBackoff = 'constant' | 'linear' | 'exponential';
|
|
@@ -13082,12 +13155,32 @@ declare namespace CloudflareWorkersModule {
|
|
|
13082
13155
|
export type WorkflowStepConfig = {
|
|
13083
13156
|
retries?: {
|
|
13084
13157
|
limit: number;
|
|
13085
|
-
delay: WorkflowDelayDuration | number;
|
|
13158
|
+
delay: WorkflowDelayDuration | number | WorkflowDelayFunction;
|
|
13086
13159
|
backoff?: WorkflowBackoff;
|
|
13087
13160
|
};
|
|
13088
13161
|
timeout?: WorkflowTimeoutDuration | number;
|
|
13089
13162
|
sensitive?: WorkflowStepSensitivity;
|
|
13090
13163
|
};
|
|
13164
|
+
// Internal discriminators used only for `WorkflowStep.do` overload
|
|
13165
|
+
// resolution. They mirror `WorkflowStepConfig` but pin `retries.delay` to a
|
|
13166
|
+
// single kind so the callback context can be narrowed based on the shape of
|
|
13167
|
+
// the config argument (rather than on an inferred type parameter, which is
|
|
13168
|
+
// lost when the caller supplies an explicit return-type argument). Not
|
|
13169
|
+
// exported: they must not widen the public type surface.
|
|
13170
|
+
type WorkflowStepConfigWithStaticDelay = Omit<WorkflowStepConfig, 'retries'> & {
|
|
13171
|
+
retries?: {
|
|
13172
|
+
limit: number;
|
|
13173
|
+
delay: WorkflowDelayDuration | number;
|
|
13174
|
+
backoff?: WorkflowBackoff;
|
|
13175
|
+
};
|
|
13176
|
+
};
|
|
13177
|
+
type WorkflowStepConfigWithDelayFunction = Omit<WorkflowStepConfig, 'retries'> & {
|
|
13178
|
+
retries: {
|
|
13179
|
+
limit: number;
|
|
13180
|
+
delay: WorkflowDelayFunction;
|
|
13181
|
+
backoff?: WorkflowBackoff;
|
|
13182
|
+
};
|
|
13183
|
+
};
|
|
13091
13184
|
export type WorkflowStepRollbackConfig = Pick<WorkflowStepConfig, 'retries' | 'timeout'>;
|
|
13092
13185
|
export type WorkflowCronSchedule = {
|
|
13093
13186
|
/** Cron expression that triggered this event. */
|
|
@@ -13108,28 +13201,51 @@ declare namespace CloudflareWorkersModule {
|
|
|
13108
13201
|
type: string;
|
|
13109
13202
|
sensitive?: WorkflowStepSensitivity;
|
|
13110
13203
|
};
|
|
13111
|
-
export type WorkflowStepContext = {
|
|
13204
|
+
export type WorkflowStepContext<Delay = WorkflowDelayDuration | number> = {
|
|
13112
13205
|
step: {
|
|
13113
13206
|
name: string;
|
|
13114
13207
|
count: number;
|
|
13115
13208
|
};
|
|
13116
13209
|
attempt: number;
|
|
13117
|
-
config:
|
|
13210
|
+
config: {
|
|
13211
|
+
retries?: {
|
|
13212
|
+
limit: number;
|
|
13213
|
+
backoff?: WorkflowBackoff;
|
|
13214
|
+
} & (Delay extends WorkflowDelayFunction ? {} : {
|
|
13215
|
+
delay: WorkflowDelayDuration | number;
|
|
13216
|
+
});
|
|
13217
|
+
timeout?: WorkflowTimeoutDuration | number;
|
|
13218
|
+
sensitive?: WorkflowStepSensitivity;
|
|
13219
|
+
};
|
|
13118
13220
|
};
|
|
13119
|
-
|
|
13120
|
-
|
|
13221
|
+
// The rollback handler receives the step context, so it mirrors the same
|
|
13222
|
+
// delay discriminant as the step callback: when the step was configured with
|
|
13223
|
+
// a dynamic delay function the resolved `config.retries.delay` is omitted,
|
|
13224
|
+
// otherwise it is present. `Delay` is threaded from the `WorkflowStep.do`
|
|
13225
|
+
// overload that matched the step config.
|
|
13226
|
+
export type WorkflowRollbackContext<T = unknown, Delay = WorkflowDelayDuration | number> = {
|
|
13227
|
+
ctx: WorkflowStepContext<Delay>;
|
|
13121
13228
|
error: Error;
|
|
13122
13229
|
output: T | undefined;
|
|
13123
13230
|
/** @deprecated Use `ctx.step.name` and `ctx.step.count` instead. */
|
|
13124
13231
|
stepName: string;
|
|
13125
13232
|
};
|
|
13126
|
-
export type WorkflowRollbackHandler<T = unknown> = (ctx: WorkflowRollbackContext<T>) => Promise<void>;
|
|
13127
|
-
export type WorkflowStepRollbackOptions<T = unknown> = {
|
|
13128
|
-
rollback: WorkflowRollbackHandler<T>;
|
|
13233
|
+
export type WorkflowRollbackHandler<T = unknown, Delay = WorkflowDelayDuration | number> = (ctx: WorkflowRollbackContext<T, Delay>) => Promise<void>;
|
|
13234
|
+
export type WorkflowStepRollbackOptions<T = unknown, Delay = WorkflowDelayDuration | number> = {
|
|
13235
|
+
rollback: WorkflowRollbackHandler<T, Delay>;
|
|
13129
13236
|
rollbackConfig?: WorkflowStepRollbackConfig;
|
|
13130
13237
|
};
|
|
13131
13238
|
export abstract class WorkflowStep {
|
|
13132
13239
|
do<T extends Rpc.Serializable<T>>(name: string, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
|
|
13240
|
+
// The config overloads discriminate on the shape of `config.retries.delay`
|
|
13241
|
+
// so the callback context reflects whether the resolved delay is present
|
|
13242
|
+
// (static delay) or omitted (dynamic delay function). Each has a single
|
|
13243
|
+
// type parameter, so an explicit return-type argument (`do<T>(...)`) still
|
|
13244
|
+
// resolves here. ORDERING IS LOAD-BEARING: the broad `WorkflowStepConfig`
|
|
13245
|
+
// fallback MUST remain last, otherwise it shadows the discriminating
|
|
13246
|
+
// overloads and narrowing is silently lost.
|
|
13247
|
+
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfigWithDelayFunction, callback: (ctx: WorkflowStepContext<WorkflowDelayFunction>) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T, WorkflowDelayFunction>): Promise<T>;
|
|
13248
|
+
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfigWithStaticDelay, callback: (ctx: WorkflowStepContext<WorkflowDelayDuration | number>) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T, WorkflowDelayDuration | number>): Promise<T>;
|
|
13133
13249
|
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfig, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
|
|
13134
13250
|
sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
|
|
13135
13251
|
sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
|
|
@@ -13905,11 +14021,12 @@ type MarkdownDocument = {
|
|
|
13905
14021
|
name: string;
|
|
13906
14022
|
blob: Blob;
|
|
13907
14023
|
};
|
|
14024
|
+
type OutputFormat = 'markdown' | 'text';
|
|
13908
14025
|
type ConversionResponse = {
|
|
13909
14026
|
id: string;
|
|
13910
14027
|
name: string;
|
|
13911
14028
|
mimeType: string;
|
|
13912
|
-
format:
|
|
14029
|
+
format: OutputFormat;
|
|
13913
14030
|
tokens: number;
|
|
13914
14031
|
data: string;
|
|
13915
14032
|
} | {
|
|
@@ -13926,7 +14043,11 @@ type EmbeddedImageConversionOptions = ImageConversionOptions & {
|
|
|
13926
14043
|
convert?: boolean;
|
|
13927
14044
|
maxConvertedImages?: number;
|
|
13928
14045
|
};
|
|
14046
|
+
type ConversionOutputOptions = {
|
|
14047
|
+
format?: OutputFormat;
|
|
14048
|
+
};
|
|
13929
14049
|
type ConversionOptions = {
|
|
14050
|
+
output?: ConversionOutputOptions;
|
|
13930
14051
|
html?: {
|
|
13931
14052
|
images?: EmbeddedImageConversionOptions & {
|
|
13932
14053
|
convertOGImage?: boolean;
|
|
@@ -14040,6 +14161,7 @@ declare namespace TailStream {
|
|
|
14040
14161
|
readonly dispatchNamespace?: string;
|
|
14041
14162
|
readonly entrypoint?: string;
|
|
14042
14163
|
readonly executionModel: string;
|
|
14164
|
+
readonly durableObjectId?: string;
|
|
14043
14165
|
readonly scriptName?: string;
|
|
14044
14166
|
readonly scriptTags?: string[];
|
|
14045
14167
|
readonly scriptVersion?: ScriptVersion;
|
|
@@ -14074,11 +14196,22 @@ declare namespace TailStream {
|
|
|
14074
14196
|
readonly message: string;
|
|
14075
14197
|
readonly stack?: string;
|
|
14076
14198
|
}
|
|
14077
|
-
interface
|
|
14199
|
+
interface TailStreamErrorInfo {
|
|
14200
|
+
readonly name: string;
|
|
14201
|
+
readonly message: string;
|
|
14202
|
+
readonly stack?: string;
|
|
14203
|
+
}
|
|
14204
|
+
type Log = {
|
|
14078
14205
|
readonly type: "log";
|
|
14079
14206
|
readonly level: "debug" | "error" | "info" | "log" | "warn";
|
|
14207
|
+
readonly errorInfo?: readonly (TailStreamErrorInfo | null)[];
|
|
14208
|
+
} & ({
|
|
14080
14209
|
readonly message: object;
|
|
14081
|
-
|
|
14210
|
+
readonly truncated?: false;
|
|
14211
|
+
} | {
|
|
14212
|
+
readonly message: string;
|
|
14213
|
+
readonly truncated: true;
|
|
14214
|
+
});
|
|
14082
14215
|
interface DroppedEventsDiagnostic {
|
|
14083
14216
|
readonly diagnosticsType: "droppedEvents";
|
|
14084
14217
|
readonly count: number;
|
|
@@ -14556,7 +14689,25 @@ declare abstract class Workflow<PARAMS = unknown> {
|
|
|
14556
14689
|
* @returns A promise that resolves with a list of handles for the created instances.
|
|
14557
14690
|
*/
|
|
14558
14691
|
public createBatch(batch: WorkflowInstanceCreateOptions<PARAMS>[]): Promise<WorkflowInstance[]>;
|
|
14692
|
+
/**
|
|
14693
|
+
* Delete a batch of Workflow instances and their stored state.
|
|
14694
|
+
* `deleteBatch` is limited to 100 instances at a time. Duplicate IDs are deleted once.
|
|
14695
|
+
* The result contains one entry for each input position; IDs that do not exist are returned as per-instance errors.
|
|
14696
|
+
* @param instanceIds IDs of the Workflow instances to delete
|
|
14697
|
+
* @returns A promise that resolves with the successfully deleted instances and any per-instance errors.
|
|
14698
|
+
*/
|
|
14699
|
+
public deleteBatch(instanceIds: string[]): Promise<WorkflowBatchDeleteResult>;
|
|
14559
14700
|
}
|
|
14701
|
+
type WorkflowBatchDeleteResult = {
|
|
14702
|
+
deleted: {
|
|
14703
|
+
id: string;
|
|
14704
|
+
}[];
|
|
14705
|
+
errors: {
|
|
14706
|
+
id: string;
|
|
14707
|
+
code: number;
|
|
14708
|
+
message: string;
|
|
14709
|
+
}[];
|
|
14710
|
+
};
|
|
14560
14711
|
type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
|
14561
14712
|
type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number;
|
|
14562
14713
|
type WorkflowRetentionDuration = WorkflowSleepDuration;
|
|
@@ -14594,6 +14745,13 @@ interface WorkflowError {
|
|
|
14594
14745
|
code?: number;
|
|
14595
14746
|
message: string;
|
|
14596
14747
|
}
|
|
14748
|
+
interface WorkflowInstanceTerminateOptions {
|
|
14749
|
+
/**
|
|
14750
|
+
* If true, run registered rollback handlers before terminating the instance.
|
|
14751
|
+
* Only steps that registered rollback handlers are rolled back.
|
|
14752
|
+
*/
|
|
14753
|
+
rollback?: boolean;
|
|
14754
|
+
}
|
|
14597
14755
|
interface WorkflowInstanceRestartOptions {
|
|
14598
14756
|
/**
|
|
14599
14757
|
* Restart from a specific step. If omitted, the instance restarts from the beginning.
|
|
@@ -14627,14 +14785,19 @@ declare abstract class WorkflowInstance {
|
|
|
14627
14785
|
public resume(): Promise<void>;
|
|
14628
14786
|
/**
|
|
14629
14787
|
* Terminate the instance. If it is errored, terminated or complete, an error will be thrown.
|
|
14788
|
+
* @param options Options for termination, including whether registered rollback handlers should run.
|
|
14630
14789
|
*/
|
|
14631
|
-
public terminate(): Promise<void>;
|
|
14790
|
+
public terminate(options?: WorkflowInstanceTerminateOptions): Promise<void>;
|
|
14632
14791
|
/**
|
|
14633
14792
|
* Restart the instance. Optionally restart from a specific step, preserving
|
|
14634
14793
|
* cached results for all steps before it.
|
|
14635
14794
|
* @param options Options for the restart, including an optional step to restart from.
|
|
14636
14795
|
*/
|
|
14637
14796
|
public restart(options?: WorkflowInstanceRestartOptions): Promise<void>;
|
|
14797
|
+
/**
|
|
14798
|
+
* Delete the instance and its stored state.
|
|
14799
|
+
*/
|
|
14800
|
+
public delete(): Promise<void>;
|
|
14638
14801
|
/**
|
|
14639
14802
|
* Returns the current status of the instance.
|
|
14640
14803
|
*/
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"lint:fix": "eslint . --fix",
|
|
39
39
|
"deploy": "wrangler deploy",
|
|
40
40
|
"cf-typegen": "wrangler types",
|
|
41
|
-
"
|
|
42
|
-
"typecheck": "tsc -p tsconfig.json"
|
|
41
|
+
"cf-typegen:check": "wrangler types --check",
|
|
42
|
+
"typecheck": "pnpm cf-typegen:check && tsc -p tsconfig.json && tsc -p tsconfig.worker.json"
|
|
43
43
|
},
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"exports": {
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
"types": "./dist/index.d.ts"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@hono/node-server": "^2.0
|
|
57
|
+
"@hono/node-server": "^2.1.0",
|
|
58
58
|
"consola": "^3.4.2",
|
|
59
|
-
"hono": "^4.
|
|
60
|
-
"tsdown": "0.22.
|
|
61
|
-
"wrangler": "^4.
|
|
59
|
+
"hono": "^4.13.1",
|
|
60
|
+
"tsdown": "0.22.14",
|
|
61
|
+
"wrangler": "^4.122.0",
|
|
62
62
|
"zod": "^4.4.3"
|
|
63
63
|
}
|
|
64
64
|
}
|
|
@@ -136,7 +136,9 @@ function toCSSGradient(hour: number): string {
|
|
|
136
136
|
const app = new Hono()
|
|
137
137
|
|
|
138
138
|
app.get('*', async (c) => {
|
|
139
|
-
const request = c.req.raw
|
|
139
|
+
const request = c.req.raw as Request & {
|
|
140
|
+
cf?: { timezone?: string }
|
|
141
|
+
}
|
|
140
142
|
|
|
141
143
|
// Base HTML style
|
|
142
144
|
let html_style = `
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
"extends": "../../tsconfig.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"lib": [
|
|
5
|
-
"ES2022"
|
|
6
|
-
"WebWorker"
|
|
5
|
+
"ES2022"
|
|
7
6
|
],
|
|
8
7
|
"paths": {
|
|
9
8
|
"@/*": [
|
|
@@ -12,12 +11,14 @@
|
|
|
12
11
|
},
|
|
13
12
|
"types": [
|
|
14
13
|
"node",
|
|
15
|
-
"vitest/globals"
|
|
16
|
-
"./worker-configuration.d.ts"
|
|
14
|
+
"vitest/globals"
|
|
17
15
|
]
|
|
18
16
|
},
|
|
19
17
|
"include": [
|
|
20
18
|
"src",
|
|
21
19
|
"test"
|
|
20
|
+
],
|
|
21
|
+
"exclude": [
|
|
22
|
+
"src/fetch-entry.ts"
|
|
22
23
|
]
|
|
23
24
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.worker.tsbuildinfo",
|
|
5
|
+
"types": [
|
|
6
|
+
"./worker-configuration.d.ts"
|
|
7
|
+
]
|
|
8
|
+
},
|
|
9
|
+
"include": [
|
|
10
|
+
"src"
|
|
11
|
+
],
|
|
12
|
+
"exclude": [
|
|
13
|
+
"src/node-entry.ts",
|
|
14
|
+
"test"
|
|
15
|
+
]
|
|
16
|
+
}
|