@trigger.dev/core 0.0.0-v3-deploy-fix-20240506100153 → 0.0.0-v3-prerelease-20240513155118

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.
@@ -4,8 +4,8 @@ export { TracingDiagnosticLogLevel, recordSpanException } from '../otel/index.js
4
4
  import { p as TaskRunExecution, T as TaskRunExecutionResult } from '../../manager-WNMVbgHf.js';
5
5
  export { R as RuntimeManager } from '../../manager-WNMVbgHf.js';
6
6
  import { B as BackgroundWorkerProperties } from '../../messages-vq7Bk4Ap.js';
7
- import { f as TriggerTracer, p as Config, G as ProjectConfig, B as HandleErrorFunction, c as TaskMetadataWithFunctions, C as Clock, a as ClockTime, b as TaskCatalog, d as TaskFileMetadata, e as TaskMetadataWithFilePath } from '../../catalog-akmn1vqt.js';
8
- export { O as OtelTaskLogger, J as logLevels } from '../../catalog-akmn1vqt.js';
7
+ import { f as TriggerTracer, p as Config, G as ProjectConfig, B as HandleErrorFunction, c as TaskMetadataWithFunctions, C as Clock, a as ClockTime, b as TaskCatalog, d as TaskFileMetadata, e as TaskMetadataWithFilePath } from '../../catalog-KbyTBoap.js';
8
+ export { O as OtelTaskLogger, J as logLevels } from '../../catalog-KbyTBoap.js';
9
9
  import { PreciseDate } from '@google-cloud/precise-date';
10
10
  import { LogRecordProcessor, LogRecord } from '@opentelemetry/sdk-logs';
11
11
  import { SpanProcessor, Span } from '@opentelemetry/sdk-trace-base';
@@ -11,7 +11,6 @@ var sdkTraceNode = require('@opentelemetry/sdk-trace-node');
11
11
  var semanticConventions = require('@opentelemetry/semantic-conventions');
12
12
  var zod = require('zod');
13
13
  var zodValidationError = require('zod-validation-error');
14
- var async_hooks = require('async_hooks');
15
14
  var preciseDate = require('@google-cloud/precise-date');
16
15
  var util = require('util');
17
16
 
@@ -942,7 +941,8 @@ zod.z.object({
942
941
  variables: zod.z.record(zod.z.string())
943
942
  });
944
943
  zod.z.object({
945
- imageReference: zod.z.string()
944
+ imageReference: zod.z.string(),
945
+ selfHosted: zod.z.boolean().optional()
946
946
  });
947
947
  zod.z.object({
948
948
  id: zod.z.string(),
@@ -1415,19 +1415,6 @@ function requestInitWithCache(requestInit) {
1415
1415
  }
1416
1416
  }
1417
1417
  __name(requestInitWithCache, "requestInitWithCache");
1418
- var _SafeAsyncLocalStorage = class _SafeAsyncLocalStorage {
1419
- constructor() {
1420
- this.storage = new async_hooks.AsyncLocalStorage();
1421
- }
1422
- runWith(context2, fn) {
1423
- return this.storage.run(context2, fn);
1424
- }
1425
- getStore() {
1426
- return this.storage.getStore();
1427
- }
1428
- };
1429
- __name(_SafeAsyncLocalStorage, "SafeAsyncLocalStorage");
1430
- var SafeAsyncLocalStorage = _SafeAsyncLocalStorage;
1431
1418
 
1432
1419
  // src/v3/apiClient/index.ts
1433
1420
  var zodFetchOptions = {
@@ -1579,19 +1566,33 @@ getHeaders_fn = /* @__PURE__ */ __name(function(spanParentAsLink) {
1579
1566
  }, "#getHeaders");
1580
1567
  __name(_ApiClient, "ApiClient");
1581
1568
  var ApiClient = _ApiClient;
1582
- var _getStore, getStore_fn;
1583
- var _ApiClientManager = class _ApiClientManager {
1569
+
1570
+ // src/v3/apiClientManager/index.ts
1571
+ var API_NAME2 = "api-client";
1572
+ var _getConfig, getConfig_fn;
1573
+ var _APIClientManagerAPI = class _APIClientManagerAPI {
1584
1574
  constructor() {
1585
- __privateAdd(this, _getStore);
1586
- __publicField(this, "_storage", new SafeAsyncLocalStorage());
1575
+ __privateAdd(this, _getConfig);
1576
+ }
1577
+ static getInstance() {
1578
+ if (!this._instance) {
1579
+ this._instance = new _APIClientManagerAPI();
1580
+ }
1581
+ return this._instance;
1582
+ }
1583
+ disable() {
1584
+ unregisterGlobal(API_NAME2);
1585
+ }
1586
+ setGlobalAPIClientConfiguration(config) {
1587
+ return registerGlobal(API_NAME2, config);
1587
1588
  }
1588
1589
  get baseURL() {
1589
- const store = __privateMethod(this, _getStore, getStore_fn).call(this);
1590
+ const store = __privateMethod(this, _getConfig, getConfig_fn).call(this);
1590
1591
  return store?.baseURL ?? getEnvVar("TRIGGER_API_URL") ?? "https://api.trigger.dev";
1591
1592
  }
1592
1593
  get accessToken() {
1593
- const store = __privateMethod(this, _getStore, getStore_fn).call(this);
1594
- return store?.accessToken ?? getEnvVar("TRIGGER_SECRET_KEY");
1594
+ const store = __privateMethod(this, _getConfig, getConfig_fn).call(this);
1595
+ return store?.secretKey ?? getEnvVar("TRIGGER_SECRET_KEY");
1595
1596
  }
1596
1597
  get client() {
1597
1598
  if (!this.baseURL || !this.accessToken) {
@@ -1599,17 +1600,16 @@ var _ApiClientManager = class _ApiClientManager {
1599
1600
  }
1600
1601
  return new ApiClient(this.baseURL, this.accessToken);
1601
1602
  }
1602
- runWith(context2, fn) {
1603
- return this._storage.runWith(context2, fn);
1604
- }
1605
1603
  };
1606
- _getStore = new WeakSet();
1607
- getStore_fn = /* @__PURE__ */ __name(function() {
1608
- return this._storage.getStore();
1609
- }, "#getStore");
1610
- __name(_ApiClientManager, "ApiClientManager");
1611
- var ApiClientManager = _ApiClientManager;
1612
- var apiClientManager = new ApiClientManager();
1604
+ _getConfig = new WeakSet();
1605
+ getConfig_fn = /* @__PURE__ */ __name(function() {
1606
+ return getGlobal(API_NAME2);
1607
+ }, "#getConfig");
1608
+ __name(_APIClientManagerAPI, "APIClientManagerAPI");
1609
+ var APIClientManagerAPI = _APIClientManagerAPI;
1610
+
1611
+ // src/v3/apiClientManager-api.ts
1612
+ var apiClientManager = APIClientManagerAPI.getInstance();
1613
1613
 
1614
1614
  // src/v3/utils/ioSerialization.ts
1615
1615
  async function parsePacket(value) {
@@ -2280,7 +2280,7 @@ __name(_SimpleClock, "SimpleClock");
2280
2280
  var SimpleClock = _SimpleClock;
2281
2281
 
2282
2282
  // src/v3/clock/index.ts
2283
- var API_NAME2 = "clock";
2283
+ var API_NAME3 = "clock";
2284
2284
  var SIMPLE_CLOCK = new SimpleClock();
2285
2285
  var _getClock, getClock_fn;
2286
2286
  var _ClockAPI = class _ClockAPI {
@@ -2294,7 +2294,7 @@ var _ClockAPI = class _ClockAPI {
2294
2294
  return this._instance;
2295
2295
  }
2296
2296
  setGlobalClock(clock2) {
2297
- return registerGlobal(API_NAME2, clock2);
2297
+ return registerGlobal(API_NAME3, clock2);
2298
2298
  }
2299
2299
  preciseNow() {
2300
2300
  return __privateMethod(this, _getClock, getClock_fn).call(this).preciseNow();
@@ -2305,7 +2305,7 @@ var _ClockAPI = class _ClockAPI {
2305
2305
  };
2306
2306
  _getClock = new WeakSet();
2307
2307
  getClock_fn = /* @__PURE__ */ __name(function() {
2308
- return getGlobal(API_NAME2) ?? SIMPLE_CLOCK;
2308
+ return getGlobal(API_NAME3) ?? SIMPLE_CLOCK;
2309
2309
  }, "#getClock");
2310
2310
  __name(_ClockAPI, "ClockAPI");
2311
2311
  var ClockAPI = _ClockAPI;