@teamkeel/functions-runtime 0.450.0 → 0.451.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/dist/index.d.cts CHANGED
@@ -480,8 +480,15 @@ declare const checkBuiltInPermissions: ({ rows, permissionFns, ctx, db, function
480
480
 
481
481
  declare function getTracer(): opentelemetry.Tracer;
482
482
  declare function withSpan(name: any, fn: any): Promise<any>;
483
+ declare function withUserSpan(span: any, fn: any): any;
483
484
  declare function init(): void;
484
485
  declare function forceFlush(): Promise<void>;
486
+ declare function createTraceAPI$1(defaultSpan: any): {
487
+ readonly traceId: any;
488
+ readonly spanId: any;
489
+ setAttribute(key: any, value: any): void;
490
+ setAttributes(attributes: any): void;
491
+ };
485
492
  declare function spanNameForModelAPI(modelName: any, action: any): string;
486
493
  declare const KEEL_INTERNAL_ATTR: "keel_internal";
487
494
  declare const KEEL_INTERNAL_CHILDREN: "includeChildrenSpans";
@@ -493,8 +500,9 @@ declare const tracing_getTracer: typeof getTracer;
493
500
  declare const tracing_init: typeof init;
494
501
  declare const tracing_spanNameForModelAPI: typeof spanNameForModelAPI;
495
502
  declare const tracing_withSpan: typeof withSpan;
503
+ declare const tracing_withUserSpan: typeof withUserSpan;
496
504
  declare namespace tracing {
497
- export { tracing_KEEL_INTERNAL_ATTR as KEEL_INTERNAL_ATTR, tracing_KEEL_INTERNAL_CHILDREN as KEEL_INTERNAL_CHILDREN, tracing_forceFlush as forceFlush, tracing_getTracer as getTracer, tracing_init as init, tracing_spanNameForModelAPI as spanNameForModelAPI, tracing_withSpan as withSpan };
505
+ export { tracing_KEEL_INTERNAL_ATTR as KEEL_INTERNAL_ATTR, tracing_KEEL_INTERNAL_CHILDREN as KEEL_INTERNAL_CHILDREN, createTraceAPI$1 as createTraceAPI, tracing_forceFlush as forceFlush, tracing_getTracer as getTracer, tracing_init as init, tracing_spanNameForModelAPI as spanNameForModelAPI, tracing_withSpan as withSpan, tracing_withUserSpan as withUserSpan };
498
506
  }
499
507
 
500
508
  type MimeType = "application/json" | "application/gzip" | "application/pdf" | "application/rtf" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/vnd.ms-excel" | "application/vnd.ms-powerpoint" | "application/msword" | "application/zip" | "application/xml" | "application/x-7z-compressed" | "application/x-tar" | "image/gif" | "image/jpeg" | "image/svg+xml" | "image/png" | "text/html" | "text/csv" | "text/javascript" | "text/plain" | "text/calendar" | (string & {});
@@ -547,6 +555,16 @@ declare class Duration {
547
555
  toPostgres(): string;
548
556
  }
549
557
 
558
+ type TraceAttributePrimitive = string | number | boolean;
559
+ type TraceAttributeValue = TraceAttributePrimitive | string[] | number[] | boolean[];
560
+ type TraceAttributes = Record<string, TraceAttributeValue | undefined>;
561
+ type TraceAPI = {
562
+ readonly traceId: string;
563
+ readonly spanId: string;
564
+ setAttribute(key: string, value: TraceAttributeValue | undefined): void;
565
+ setAttributes(attributes: TraceAttributes): void;
566
+ };
567
+
550
568
  type ElementDataType$5 = string | number | boolean | Date;
551
569
  type UiElementSelectOne = <const TValue extends ElementDataType$5, N extends string, O extends boolean = false>(name: N, options?: BaseInputConfig<TValue, O> & {
552
570
  options: ({
@@ -1288,6 +1306,7 @@ interface FlowContext<C extends FlowConfig, E, S, Id, I, H extends NullableHardw
1288
1306
  now(): Date;
1289
1307
  secrets: S;
1290
1308
  identity: Id;
1309
+ trace: TraceAPI;
1291
1310
  }
1292
1311
  type NullableHardware = Hardware | undefined;
1293
1312
  type Hardware = {
@@ -1365,8 +1384,10 @@ declare function createFlowContext<C extends FlowConfig, E, S, Id, I, H extends
1365
1384
  now: () => Date;
1366
1385
  secrets: S;
1367
1386
  identity: Id;
1387
+ trace: TraceAPI;
1368
1388
  }): FlowContext<C, E, S, Id, I, H>;
1369
1389
 
1390
+ declare const createTraceAPI: typeof createTraceAPI$1;
1370
1391
  declare function ksuid(): string;
1371
1392
 
1372
1393
  type IDWhereCondition = {
@@ -1478,6 +1499,7 @@ type ContextAPI = {
1478
1499
  headers: RequestHeaders;
1479
1500
  response: Response;
1480
1501
  isAuthenticated: boolean;
1502
+ trace: TraceAPI;
1481
1503
  now(): Date;
1482
1504
  };
1483
1505
  type Response = {
@@ -1607,4 +1629,4 @@ type FlowListResult = {
1607
1629
  };
1608
1630
  };
1609
1631
 
1610
- export { type BooleanArrayQueryWhereCondition, type BooleanArrayWhereCondition, type BooleanWhereCondition, type ContextAPI, type DateArrayQueryWhereCondition, type DateArrayWhereCondition, type DateQueryInput, type DateWhereCondition, Duration, type DurationString, type DurationWhereCondition, ErrorPresets, type Errors, type ExtractStageKeys, File, type FlowConfig, type FlowConfigAPI, type FlowContext, type FlowFunction, type FlowListOptions, type FlowListResult, type FlowRun, type FlowRunStatus, type FlowRunStep, FlowsAPI, type FuncWithConfig, type FunctionConfig, type Hardware, type IDWhereCondition, InlineFile, type ListResult, ModelAPI, NonRetriableError, type NullableHardware, type NumberArrayQueryWhereCondition, type NumberArrayWhereCondition, type NumberWhereCondition, PERMISSION_STATE, type PageInfo, type PartialPageInfo, Permissions, type Printer, type RelativeDateString, RequestHeaders, type Response, RetryBackoffExponential, RetryBackoffLinear, RetryConstant, STEP_STATUS, STEP_TYPE, type SortDirection, type Step, type StringArrayQueryWhereCondition, type StringArrayWhereCondition, type StringWhereCondition, type Task, TaskAPI, type TaskCreateOptions, type TaskFlowFunction, type TaskStatus, type TimestampQueryInput, type UI, type UIApiResponses, checkBuiltInPermissions, createFlowContext, handleFlow, handleJob, handleRequest, handleRoute, handleSubscriber, ksuid, tracing, useDatabase };
1632
+ export { type BooleanArrayQueryWhereCondition, type BooleanArrayWhereCondition, type BooleanWhereCondition, type ContextAPI, type DateArrayQueryWhereCondition, type DateArrayWhereCondition, type DateQueryInput, type DateWhereCondition, Duration, type DurationString, type DurationWhereCondition, ErrorPresets, type Errors, type ExtractStageKeys, File, type FlowConfig, type FlowConfigAPI, type FlowContext, type FlowFunction, type FlowListOptions, type FlowListResult, type FlowRun, type FlowRunStatus, type FlowRunStep, FlowsAPI, type FuncWithConfig, type FunctionConfig, type Hardware, type IDWhereCondition, InlineFile, type ListResult, ModelAPI, NonRetriableError, type NullableHardware, type NumberArrayQueryWhereCondition, type NumberArrayWhereCondition, type NumberWhereCondition, PERMISSION_STATE, type PageInfo, type PartialPageInfo, Permissions, type Printer, type RelativeDateString, RequestHeaders, type Response, RetryBackoffExponential, RetryBackoffLinear, RetryConstant, STEP_STATUS, STEP_TYPE, type SortDirection, type Step, type StringArrayQueryWhereCondition, type StringArrayWhereCondition, type StringWhereCondition, type Task, TaskAPI, type TaskCreateOptions, type TaskFlowFunction, type TaskStatus, type TimestampQueryInput, type TraceAPI, type TraceAttributeValue, type TraceAttributes, type UI, type UIApiResponses, checkBuiltInPermissions, createFlowContext, createTraceAPI, handleFlow, handleJob, handleRequest, handleRoute, handleSubscriber, ksuid, tracing, useDatabase };
package/dist/index.d.ts CHANGED
@@ -480,8 +480,15 @@ declare const checkBuiltInPermissions: ({ rows, permissionFns, ctx, db, function
480
480
 
481
481
  declare function getTracer(): opentelemetry.Tracer;
482
482
  declare function withSpan(name: any, fn: any): Promise<any>;
483
+ declare function withUserSpan(span: any, fn: any): any;
483
484
  declare function init(): void;
484
485
  declare function forceFlush(): Promise<void>;
486
+ declare function createTraceAPI$1(defaultSpan: any): {
487
+ readonly traceId: any;
488
+ readonly spanId: any;
489
+ setAttribute(key: any, value: any): void;
490
+ setAttributes(attributes: any): void;
491
+ };
485
492
  declare function spanNameForModelAPI(modelName: any, action: any): string;
486
493
  declare const KEEL_INTERNAL_ATTR: "keel_internal";
487
494
  declare const KEEL_INTERNAL_CHILDREN: "includeChildrenSpans";
@@ -493,8 +500,9 @@ declare const tracing_getTracer: typeof getTracer;
493
500
  declare const tracing_init: typeof init;
494
501
  declare const tracing_spanNameForModelAPI: typeof spanNameForModelAPI;
495
502
  declare const tracing_withSpan: typeof withSpan;
503
+ declare const tracing_withUserSpan: typeof withUserSpan;
496
504
  declare namespace tracing {
497
- export { tracing_KEEL_INTERNAL_ATTR as KEEL_INTERNAL_ATTR, tracing_KEEL_INTERNAL_CHILDREN as KEEL_INTERNAL_CHILDREN, tracing_forceFlush as forceFlush, tracing_getTracer as getTracer, tracing_init as init, tracing_spanNameForModelAPI as spanNameForModelAPI, tracing_withSpan as withSpan };
505
+ export { tracing_KEEL_INTERNAL_ATTR as KEEL_INTERNAL_ATTR, tracing_KEEL_INTERNAL_CHILDREN as KEEL_INTERNAL_CHILDREN, createTraceAPI$1 as createTraceAPI, tracing_forceFlush as forceFlush, tracing_getTracer as getTracer, tracing_init as init, tracing_spanNameForModelAPI as spanNameForModelAPI, tracing_withSpan as withSpan, tracing_withUserSpan as withUserSpan };
498
506
  }
499
507
 
500
508
  type MimeType = "application/json" | "application/gzip" | "application/pdf" | "application/rtf" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/vnd.ms-excel" | "application/vnd.ms-powerpoint" | "application/msword" | "application/zip" | "application/xml" | "application/x-7z-compressed" | "application/x-tar" | "image/gif" | "image/jpeg" | "image/svg+xml" | "image/png" | "text/html" | "text/csv" | "text/javascript" | "text/plain" | "text/calendar" | (string & {});
@@ -547,6 +555,16 @@ declare class Duration {
547
555
  toPostgres(): string;
548
556
  }
549
557
 
558
+ type TraceAttributePrimitive = string | number | boolean;
559
+ type TraceAttributeValue = TraceAttributePrimitive | string[] | number[] | boolean[];
560
+ type TraceAttributes = Record<string, TraceAttributeValue | undefined>;
561
+ type TraceAPI = {
562
+ readonly traceId: string;
563
+ readonly spanId: string;
564
+ setAttribute(key: string, value: TraceAttributeValue | undefined): void;
565
+ setAttributes(attributes: TraceAttributes): void;
566
+ };
567
+
550
568
  type ElementDataType$5 = string | number | boolean | Date;
551
569
  type UiElementSelectOne = <const TValue extends ElementDataType$5, N extends string, O extends boolean = false>(name: N, options?: BaseInputConfig<TValue, O> & {
552
570
  options: ({
@@ -1288,6 +1306,7 @@ interface FlowContext<C extends FlowConfig, E, S, Id, I, H extends NullableHardw
1288
1306
  now(): Date;
1289
1307
  secrets: S;
1290
1308
  identity: Id;
1309
+ trace: TraceAPI;
1291
1310
  }
1292
1311
  type NullableHardware = Hardware | undefined;
1293
1312
  type Hardware = {
@@ -1365,8 +1384,10 @@ declare function createFlowContext<C extends FlowConfig, E, S, Id, I, H extends
1365
1384
  now: () => Date;
1366
1385
  secrets: S;
1367
1386
  identity: Id;
1387
+ trace: TraceAPI;
1368
1388
  }): FlowContext<C, E, S, Id, I, H>;
1369
1389
 
1390
+ declare const createTraceAPI: typeof createTraceAPI$1;
1370
1391
  declare function ksuid(): string;
1371
1392
 
1372
1393
  type IDWhereCondition = {
@@ -1478,6 +1499,7 @@ type ContextAPI = {
1478
1499
  headers: RequestHeaders;
1479
1500
  response: Response;
1480
1501
  isAuthenticated: boolean;
1502
+ trace: TraceAPI;
1481
1503
  now(): Date;
1482
1504
  };
1483
1505
  type Response = {
@@ -1607,4 +1629,4 @@ type FlowListResult = {
1607
1629
  };
1608
1630
  };
1609
1631
 
1610
- export { type BooleanArrayQueryWhereCondition, type BooleanArrayWhereCondition, type BooleanWhereCondition, type ContextAPI, type DateArrayQueryWhereCondition, type DateArrayWhereCondition, type DateQueryInput, type DateWhereCondition, Duration, type DurationString, type DurationWhereCondition, ErrorPresets, type Errors, type ExtractStageKeys, File, type FlowConfig, type FlowConfigAPI, type FlowContext, type FlowFunction, type FlowListOptions, type FlowListResult, type FlowRun, type FlowRunStatus, type FlowRunStep, FlowsAPI, type FuncWithConfig, type FunctionConfig, type Hardware, type IDWhereCondition, InlineFile, type ListResult, ModelAPI, NonRetriableError, type NullableHardware, type NumberArrayQueryWhereCondition, type NumberArrayWhereCondition, type NumberWhereCondition, PERMISSION_STATE, type PageInfo, type PartialPageInfo, Permissions, type Printer, type RelativeDateString, RequestHeaders, type Response, RetryBackoffExponential, RetryBackoffLinear, RetryConstant, STEP_STATUS, STEP_TYPE, type SortDirection, type Step, type StringArrayQueryWhereCondition, type StringArrayWhereCondition, type StringWhereCondition, type Task, TaskAPI, type TaskCreateOptions, type TaskFlowFunction, type TaskStatus, type TimestampQueryInput, type UI, type UIApiResponses, checkBuiltInPermissions, createFlowContext, handleFlow, handleJob, handleRequest, handleRoute, handleSubscriber, ksuid, tracing, useDatabase };
1632
+ export { type BooleanArrayQueryWhereCondition, type BooleanArrayWhereCondition, type BooleanWhereCondition, type ContextAPI, type DateArrayQueryWhereCondition, type DateArrayWhereCondition, type DateQueryInput, type DateWhereCondition, Duration, type DurationString, type DurationWhereCondition, ErrorPresets, type Errors, type ExtractStageKeys, File, type FlowConfig, type FlowConfigAPI, type FlowContext, type FlowFunction, type FlowListOptions, type FlowListResult, type FlowRun, type FlowRunStatus, type FlowRunStep, FlowsAPI, type FuncWithConfig, type FunctionConfig, type Hardware, type IDWhereCondition, InlineFile, type ListResult, ModelAPI, NonRetriableError, type NullableHardware, type NumberArrayQueryWhereCondition, type NumberArrayWhereCondition, type NumberWhereCondition, PERMISSION_STATE, type PageInfo, type PartialPageInfo, Permissions, type Printer, type RelativeDateString, RequestHeaders, type Response, RetryBackoffExponential, RetryBackoffLinear, RetryConstant, STEP_STATUS, STEP_TYPE, type SortDirection, type Step, type StringArrayQueryWhereCondition, type StringArrayWhereCondition, type StringWhereCondition, type Task, TaskAPI, type TaskCreateOptions, type TaskFlowFunction, type TaskStatus, type TimestampQueryInput, type TraceAPI, type TraceAttributeValue, type TraceAttributes, type UI, type UIApiResponses, checkBuiltInPermissions, createFlowContext, createTraceAPI, handleFlow, handleJob, handleRequest, handleRoute, handleSubscriber, ksuid, tracing, useDatabase };