@workers-community/workers-types 4.20250705.0 → 4.20250708.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/index.d.ts +30 -28
- package/index.ts +30 -28
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -408,7 +408,7 @@ type ExportedHandlerTraceHandler<Env = unknown> = (
|
|
|
408
408
|
ctx: ExecutionContext,
|
|
409
409
|
) => void | Promise<void>;
|
|
410
410
|
type ExportedHandlerTailStreamHandler<Env = unknown> = (
|
|
411
|
-
event: TailStream.TailEvent
|
|
411
|
+
event: TailStream.TailEvent<TailStream.Onset>,
|
|
412
412
|
env: Env,
|
|
413
413
|
ctx: ExecutionContext,
|
|
414
414
|
) => TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>;
|
|
@@ -8088,38 +8088,40 @@ declare namespace TailStream {
|
|
|
8088
8088
|
readonly type: "attributes";
|
|
8089
8089
|
readonly info: Attribute[];
|
|
8090
8090
|
}
|
|
8091
|
-
|
|
8092
|
-
|
|
8091
|
+
type EventType =
|
|
8092
|
+
| Onset
|
|
8093
|
+
| Outcome
|
|
8094
|
+
| Hibernate
|
|
8095
|
+
| SpanOpen
|
|
8096
|
+
| SpanClose
|
|
8097
|
+
| DiagnosticChannelEvent
|
|
8098
|
+
| Exception
|
|
8099
|
+
| Log
|
|
8100
|
+
| Return
|
|
8101
|
+
| Link
|
|
8102
|
+
| Attributes;
|
|
8103
|
+
interface TailEvent<Event extends EventType> {
|
|
8093
8104
|
readonly invocationId: string;
|
|
8094
8105
|
readonly spanId: string;
|
|
8095
8106
|
readonly timestamp: Date;
|
|
8096
8107
|
readonly sequence: number;
|
|
8097
|
-
readonly event:
|
|
8098
|
-
| Onset
|
|
8099
|
-
| Outcome
|
|
8100
|
-
| Hibernate
|
|
8101
|
-
| SpanOpen
|
|
8102
|
-
| SpanClose
|
|
8103
|
-
| DiagnosticChannelEvent
|
|
8104
|
-
| Exception
|
|
8105
|
-
| Log
|
|
8106
|
-
| Return
|
|
8107
|
-
| Link
|
|
8108
|
-
| Attributes;
|
|
8108
|
+
readonly event: Event;
|
|
8109
8109
|
}
|
|
8110
|
-
type TailEventHandler
|
|
8111
|
-
|
|
8112
|
-
|
|
8113
|
-
|
|
8114
|
-
|
|
8115
|
-
|
|
8116
|
-
|
|
8117
|
-
|
|
8118
|
-
|
|
8119
|
-
|
|
8120
|
-
|
|
8121
|
-
|
|
8122
|
-
|
|
8110
|
+
type TailEventHandler<Event extends EventType = EventType> = (
|
|
8111
|
+
event: TailEvent<Event>,
|
|
8112
|
+
) => void | Promise<void>;
|
|
8113
|
+
type TailEventHandlerObject = {
|
|
8114
|
+
outcome?: TailEventHandler<Outcome>;
|
|
8115
|
+
hibernate?: TailEventHandler<Hibernate>;
|
|
8116
|
+
spanOpen?: TailEventHandler<SpanOpen>;
|
|
8117
|
+
spanClose?: TailEventHandler<SpanClose>;
|
|
8118
|
+
diagnosticChannel?: TailEventHandler<DiagnosticChannelEvent>;
|
|
8119
|
+
exception?: TailEventHandler<Exception>;
|
|
8120
|
+
log?: TailEventHandler<Log>;
|
|
8121
|
+
return?: TailEventHandler<Return>;
|
|
8122
|
+
link?: TailEventHandler<Link>;
|
|
8123
|
+
attributes?: TailEventHandler<Attributes>;
|
|
8124
|
+
};
|
|
8123
8125
|
type TailEventHandlerType = TailEventHandler | TailEventHandlerObject;
|
|
8124
8126
|
}
|
|
8125
8127
|
// Copyright (c) 2022-2023 Cloudflare, Inc.
|
package/index.ts
CHANGED
|
@@ -413,7 +413,7 @@ export type ExportedHandlerTraceHandler<Env = unknown> = (
|
|
|
413
413
|
ctx: ExecutionContext,
|
|
414
414
|
) => void | Promise<void>;
|
|
415
415
|
export type ExportedHandlerTailStreamHandler<Env = unknown> = (
|
|
416
|
-
event: TailStream.TailEvent
|
|
416
|
+
event: TailStream.TailEvent<TailStream.Onset>,
|
|
417
417
|
env: Env,
|
|
418
418
|
ctx: ExecutionContext,
|
|
419
419
|
) => TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>;
|
|
@@ -7951,38 +7951,40 @@ export declare namespace TailStream {
|
|
|
7951
7951
|
readonly type: "attributes";
|
|
7952
7952
|
readonly info: Attribute[];
|
|
7953
7953
|
}
|
|
7954
|
-
|
|
7955
|
-
|
|
7954
|
+
type EventType =
|
|
7955
|
+
| Onset
|
|
7956
|
+
| Outcome
|
|
7957
|
+
| Hibernate
|
|
7958
|
+
| SpanOpen
|
|
7959
|
+
| SpanClose
|
|
7960
|
+
| DiagnosticChannelEvent
|
|
7961
|
+
| Exception
|
|
7962
|
+
| Log
|
|
7963
|
+
| Return
|
|
7964
|
+
| Link
|
|
7965
|
+
| Attributes;
|
|
7966
|
+
interface TailEvent<Event extends EventType> {
|
|
7956
7967
|
readonly invocationId: string;
|
|
7957
7968
|
readonly spanId: string;
|
|
7958
7969
|
readonly timestamp: Date;
|
|
7959
7970
|
readonly sequence: number;
|
|
7960
|
-
readonly event:
|
|
7961
|
-
| Onset
|
|
7962
|
-
| Outcome
|
|
7963
|
-
| Hibernate
|
|
7964
|
-
| SpanOpen
|
|
7965
|
-
| SpanClose
|
|
7966
|
-
| DiagnosticChannelEvent
|
|
7967
|
-
| Exception
|
|
7968
|
-
| Log
|
|
7969
|
-
| Return
|
|
7970
|
-
| Link
|
|
7971
|
-
| Attributes;
|
|
7971
|
+
readonly event: Event;
|
|
7972
7972
|
}
|
|
7973
|
-
type TailEventHandler
|
|
7974
|
-
|
|
7975
|
-
|
|
7976
|
-
|
|
7977
|
-
|
|
7978
|
-
|
|
7979
|
-
|
|
7980
|
-
|
|
7981
|
-
|
|
7982
|
-
|
|
7983
|
-
|
|
7984
|
-
|
|
7985
|
-
|
|
7973
|
+
type TailEventHandler<Event extends EventType = EventType> = (
|
|
7974
|
+
event: TailEvent<Event>,
|
|
7975
|
+
) => void | Promise<void>;
|
|
7976
|
+
type TailEventHandlerObject = {
|
|
7977
|
+
outcome?: TailEventHandler<Outcome>;
|
|
7978
|
+
hibernate?: TailEventHandler<Hibernate>;
|
|
7979
|
+
spanOpen?: TailEventHandler<SpanOpen>;
|
|
7980
|
+
spanClose?: TailEventHandler<SpanClose>;
|
|
7981
|
+
diagnosticChannel?: TailEventHandler<DiagnosticChannelEvent>;
|
|
7982
|
+
exception?: TailEventHandler<Exception>;
|
|
7983
|
+
log?: TailEventHandler<Log>;
|
|
7984
|
+
return?: TailEventHandler<Return>;
|
|
7985
|
+
link?: TailEventHandler<Link>;
|
|
7986
|
+
attributes?: TailEventHandler<Attributes>;
|
|
7987
|
+
};
|
|
7986
7988
|
type TailEventHandlerType = TailEventHandler | TailEventHandlerObject;
|
|
7987
7989
|
}
|
|
7988
7990
|
// Copyright (c) 2022-2023 Cloudflare, Inc.
|