@trigger.dev/core 0.0.0-v3-prerelease-20240705100038 → 0.0.0-v3-prerelease-20240708165959

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.
@@ -408,6 +408,7 @@ declare const SerializedError: z.ZodObject<{
408
408
  }>;
409
409
  type SerializedError = z.infer<typeof SerializedError>;
410
410
  declare function createJsonErrorObject(error: TaskRunError): SerializedError;
411
+ declare function sanitizeError(error: TaskRunError): TaskRunError;
411
412
  declare function correctErrorStackTrace(stackTrace: string, projectDir?: string, options?: {
412
413
  removeFirstLine?: boolean;
413
414
  isDev?: boolean;
@@ -661,4 +662,4 @@ declare function createPacketAttributes(packet: IOPacket, dataKey: string, dataT
661
662
  declare function createPacketAttributesAsJson(data: any, dataType: string): Promise<Attributes>;
662
663
  declare function prettyPrintPacket(rawData: any, dataType?: string): Promise<string>;
663
664
 
664
- export { AbortTaskRunError, Accessory, ApiClient, type ApiClientConfiguration, ApiPromise, ApiRequestOptions, BackgroundWorkerProperties, BatchTaskRunExecutionResult, BatchTriggerTaskRequestBody, type CreateEnvironmentVariableParams, CreateEnvironmentVariableRequestBody, CreateScheduleOptions, CursorPageParams, CursorPagePromise, type IOPacket, type ImportEnvironmentVariablesParams, type ListProjectRunsQueryParams, ListRunResponseItem, type ListRunsQueryParams, ListScheduleOptions, NULL_SENTINEL, OFFLOAD_IO_PACKET_LENGTH_LIMIT, OTEL_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, OTEL_ATTRIBUTE_PER_LINK_COUNT_LIMIT, OTEL_LINK_COUNT_LIMIT, OTEL_LOG_ATTRIBUTE_COUNT_LIMIT, OTEL_LOG_ATTRIBUTE_VALUE_LENGTH_LIMIT, OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT, OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT, OTEL_SPAN_EVENT_COUNT_LIMIT, OffsetLimitPagePromise, RescheduleRunRequestBody, RetryOptions, RunStatus, SemanticInternalAttributes, SerializedError, TaskFileMetadata, TaskMetadataWithFilePath, TaskMetadataWithFunctions, TaskRunContext, TaskRunError, TaskRunExecutionResult, type TriggerOptions, TriggerTaskRequestBody, TriggerTracer, type UpdateEnvironmentVariableParams, UpdateEnvironmentVariableRequestBody, UpdateScheduleOptions, accessoryAttributes, apiClientManager, calculateNextRetryDelay, calculateResetAt, clock, conditionallyExportPacket, conditionallyImportPacket, correctErrorStackTrace, createErrorTaskError, createJsonErrorObject, createPacketAttributes, createPacketAttributesAsJson, defaultFetchRetryOptions, defaultRetryOptions, detectDependencyVersion, flattenAttributes, groupTaskMetadataIssuesByTask, imposeAttributeLimits, logger, mergeRequestOptions, omit, packetRequiresOffloading, parseError, parsePacket, prettyPrintPacket, primitiveValueOrflattenedAttributes, runtime, stringifyIO, taskCatalog, taskContext, unflattenAttributes };
665
+ export { AbortTaskRunError, Accessory, ApiClient, type ApiClientConfiguration, ApiPromise, ApiRequestOptions, BackgroundWorkerProperties, BatchTaskRunExecutionResult, BatchTriggerTaskRequestBody, type CreateEnvironmentVariableParams, CreateEnvironmentVariableRequestBody, CreateScheduleOptions, CursorPageParams, CursorPagePromise, type IOPacket, type ImportEnvironmentVariablesParams, type ListProjectRunsQueryParams, ListRunResponseItem, type ListRunsQueryParams, ListScheduleOptions, NULL_SENTINEL, OFFLOAD_IO_PACKET_LENGTH_LIMIT, OTEL_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, OTEL_ATTRIBUTE_PER_LINK_COUNT_LIMIT, OTEL_LINK_COUNT_LIMIT, OTEL_LOG_ATTRIBUTE_COUNT_LIMIT, OTEL_LOG_ATTRIBUTE_VALUE_LENGTH_LIMIT, OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT, OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT, OTEL_SPAN_EVENT_COUNT_LIMIT, OffsetLimitPagePromise, RescheduleRunRequestBody, RetryOptions, RunStatus, SemanticInternalAttributes, SerializedError, TaskFileMetadata, TaskMetadataWithFilePath, TaskMetadataWithFunctions, TaskRunContext, TaskRunError, TaskRunExecutionResult, type TriggerOptions, TriggerTaskRequestBody, TriggerTracer, type UpdateEnvironmentVariableParams, UpdateEnvironmentVariableRequestBody, UpdateScheduleOptions, accessoryAttributes, apiClientManager, calculateNextRetryDelay, calculateResetAt, clock, conditionallyExportPacket, conditionallyImportPacket, correctErrorStackTrace, createErrorTaskError, createJsonErrorObject, createPacketAttributes, createPacketAttributesAsJson, defaultFetchRetryOptions, defaultRetryOptions, detectDependencyVersion, flattenAttributes, groupTaskMetadataIssuesByTask, imposeAttributeLimits, logger, mergeRequestOptions, omit, packetRequiresOffloading, parseError, parsePacket, prettyPrintPacket, primitiveValueOrflattenedAttributes, runtime, sanitizeError, stringifyIO, taskCatalog, taskContext, unflattenAttributes };
@@ -408,6 +408,7 @@ declare const SerializedError: z.ZodObject<{
408
408
  }>;
409
409
  type SerializedError = z.infer<typeof SerializedError>;
410
410
  declare function createJsonErrorObject(error: TaskRunError): SerializedError;
411
+ declare function sanitizeError(error: TaskRunError): TaskRunError;
411
412
  declare function correctErrorStackTrace(stackTrace: string, projectDir?: string, options?: {
412
413
  removeFirstLine?: boolean;
413
414
  isDev?: boolean;
@@ -661,4 +662,4 @@ declare function createPacketAttributes(packet: IOPacket, dataKey: string, dataT
661
662
  declare function createPacketAttributesAsJson(data: any, dataType: string): Promise<Attributes>;
662
663
  declare function prettyPrintPacket(rawData: any, dataType?: string): Promise<string>;
663
664
 
664
- export { AbortTaskRunError, Accessory, ApiClient, type ApiClientConfiguration, ApiPromise, ApiRequestOptions, BackgroundWorkerProperties, BatchTaskRunExecutionResult, BatchTriggerTaskRequestBody, type CreateEnvironmentVariableParams, CreateEnvironmentVariableRequestBody, CreateScheduleOptions, CursorPageParams, CursorPagePromise, type IOPacket, type ImportEnvironmentVariablesParams, type ListProjectRunsQueryParams, ListRunResponseItem, type ListRunsQueryParams, ListScheduleOptions, NULL_SENTINEL, OFFLOAD_IO_PACKET_LENGTH_LIMIT, OTEL_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, OTEL_ATTRIBUTE_PER_LINK_COUNT_LIMIT, OTEL_LINK_COUNT_LIMIT, OTEL_LOG_ATTRIBUTE_COUNT_LIMIT, OTEL_LOG_ATTRIBUTE_VALUE_LENGTH_LIMIT, OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT, OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT, OTEL_SPAN_EVENT_COUNT_LIMIT, OffsetLimitPagePromise, RescheduleRunRequestBody, RetryOptions, RunStatus, SemanticInternalAttributes, SerializedError, TaskFileMetadata, TaskMetadataWithFilePath, TaskMetadataWithFunctions, TaskRunContext, TaskRunError, TaskRunExecutionResult, type TriggerOptions, TriggerTaskRequestBody, TriggerTracer, type UpdateEnvironmentVariableParams, UpdateEnvironmentVariableRequestBody, UpdateScheduleOptions, accessoryAttributes, apiClientManager, calculateNextRetryDelay, calculateResetAt, clock, conditionallyExportPacket, conditionallyImportPacket, correctErrorStackTrace, createErrorTaskError, createJsonErrorObject, createPacketAttributes, createPacketAttributesAsJson, defaultFetchRetryOptions, defaultRetryOptions, detectDependencyVersion, flattenAttributes, groupTaskMetadataIssuesByTask, imposeAttributeLimits, logger, mergeRequestOptions, omit, packetRequiresOffloading, parseError, parsePacket, prettyPrintPacket, primitiveValueOrflattenedAttributes, runtime, stringifyIO, taskCatalog, taskContext, unflattenAttributes };
665
+ export { AbortTaskRunError, Accessory, ApiClient, type ApiClientConfiguration, ApiPromise, ApiRequestOptions, BackgroundWorkerProperties, BatchTaskRunExecutionResult, BatchTriggerTaskRequestBody, type CreateEnvironmentVariableParams, CreateEnvironmentVariableRequestBody, CreateScheduleOptions, CursorPageParams, CursorPagePromise, type IOPacket, type ImportEnvironmentVariablesParams, type ListProjectRunsQueryParams, ListRunResponseItem, type ListRunsQueryParams, ListScheduleOptions, NULL_SENTINEL, OFFLOAD_IO_PACKET_LENGTH_LIMIT, OTEL_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, OTEL_ATTRIBUTE_PER_LINK_COUNT_LIMIT, OTEL_LINK_COUNT_LIMIT, OTEL_LOG_ATTRIBUTE_COUNT_LIMIT, OTEL_LOG_ATTRIBUTE_VALUE_LENGTH_LIMIT, OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT, OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT, OTEL_SPAN_EVENT_COUNT_LIMIT, OffsetLimitPagePromise, RescheduleRunRequestBody, RetryOptions, RunStatus, SemanticInternalAttributes, SerializedError, TaskFileMetadata, TaskMetadataWithFilePath, TaskMetadataWithFunctions, TaskRunContext, TaskRunError, TaskRunExecutionResult, type TriggerOptions, TriggerTaskRequestBody, TriggerTracer, type UpdateEnvironmentVariableParams, UpdateEnvironmentVariableRequestBody, UpdateScheduleOptions, accessoryAttributes, apiClientManager, calculateNextRetryDelay, calculateResetAt, clock, conditionallyExportPacket, conditionallyImportPacket, correctErrorStackTrace, createErrorTaskError, createJsonErrorObject, createPacketAttributes, createPacketAttributesAsJson, defaultFetchRetryOptions, defaultRetryOptions, detectDependencyVersion, flattenAttributes, groupTaskMetadataIssuesByTask, imposeAttributeLimits, logger, mergeRequestOptions, omit, packetRequiresOffloading, parseError, parsePacket, prettyPrintPacket, primitiveValueOrflattenedAttributes, runtime, sanitizeError, stringifyIO, taskCatalog, taskContext, unflattenAttributes };
package/dist/v3/index.js CHANGED
@@ -33,7 +33,7 @@ var __privateMethod = (obj, member, method) => {
33
33
  };
34
34
 
35
35
  // package.json
36
- var version = "0.0.0-v3-prerelease-20240705100038";
36
+ var version = "0.0.0-v3-prerelease-20240708165959";
37
37
  var dependencies = {
38
38
  "@google-cloud/precise-date": "^4.0.0",
39
39
  "@opentelemetry/api": "^1.8.0",
@@ -574,6 +574,39 @@ function createJsonErrorObject(error) {
574
574
  }
575
575
  }
576
576
  __name(createJsonErrorObject, "createJsonErrorObject");
577
+ function sanitizeError(error) {
578
+ switch (error.type) {
579
+ case "BUILT_IN_ERROR": {
580
+ return {
581
+ type: "BUILT_IN_ERROR",
582
+ message: error.message?.replace(/\0/g, ""),
583
+ name: error.name?.replace(/\0/g, ""),
584
+ stackTrace: error.stackTrace?.replace(/\0/g, "")
585
+ };
586
+ }
587
+ case "STRING_ERROR": {
588
+ return {
589
+ type: "STRING_ERROR",
590
+ raw: error.raw.replace(/\0/g, "")
591
+ };
592
+ }
593
+ case "CUSTOM_ERROR": {
594
+ return {
595
+ type: "CUSTOM_ERROR",
596
+ raw: error.raw.replace(/\0/g, "")
597
+ };
598
+ }
599
+ case "INTERNAL_ERROR": {
600
+ return {
601
+ type: "INTERNAL_ERROR",
602
+ code: error.code,
603
+ message: error.message?.replace(/\0/g, ""),
604
+ stackTrace: error.stackTrace?.replace(/\0/g, "")
605
+ };
606
+ }
607
+ }
608
+ }
609
+ __name(sanitizeError, "sanitizeError");
577
610
  function correctErrorStackTrace(stackTrace, projectDir, options) {
578
611
  const [errorLine, ...traceLines] = stackTrace.split("\n");
579
612
  return [
@@ -2817,7 +2850,11 @@ async function _doZodFetch(schema, url, requestInit, options) {
2817
2850
  requestInit: $requestInit,
2818
2851
  options
2819
2852
  }, async (span) => {
2820
- return await _doZodFetchWithRetries(schema, url, $requestInit, options);
2853
+ const result = await _doZodFetchWithRetries(schema, url, $requestInit, options);
2854
+ if (options?.onResponseBody && span) {
2855
+ options.onResponseBody(result.data, span);
2856
+ }
2857
+ return result;
2821
2858
  });
2822
2859
  }
2823
2860
  __name(_doZodFetch, "_doZodFetch");
@@ -4626,6 +4663,7 @@ exports.parsePacket = parsePacket;
4626
4663
  exports.prettyPrintPacket = prettyPrintPacket;
4627
4664
  exports.primitiveValueOrflattenedAttributes = primitiveValueOrflattenedAttributes;
4628
4665
  exports.runtime = runtime;
4666
+ exports.sanitizeError = sanitizeError;
4629
4667
  exports.serverWebsocketMessages = serverWebsocketMessages;
4630
4668
  exports.stringPatternMatchers = stringPatternMatchers;
4631
4669
  exports.stringifyIO = stringifyIO;