@versori/run 0.5.9 → 0.6.0-alpha.1

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.
Files changed (133) hide show
  1. package/esm/src/connection/internal/CredentialHolder.js +1 -1
  2. package/esm/src/connection/internal/FetchBuilder.d.ts +9 -2
  3. package/esm/src/connection/internal/FetchBuilder.d.ts.map +1 -1
  4. package/esm/src/connection/internal/FetchBuilder.js +124 -3
  5. package/esm/src/context/Context.d.ts +5 -0
  6. package/esm/src/context/Context.d.ts.map +1 -1
  7. package/esm/src/context/Context.js +6 -0
  8. package/esm/src/dsl/Workflow.d.ts.map +1 -1
  9. package/esm/src/dsl/Workflow.js +2 -0
  10. package/esm/src/dsl/http/types.d.ts +2 -0
  11. package/esm/src/dsl/http/types.d.ts.map +1 -1
  12. package/esm/src/dsl/http/versori/configloader.d.ts.map +1 -1
  13. package/esm/src/dsl/http/versori/configloader.js +1 -1
  14. package/esm/src/dsl/http/versori/cronapi.d.ts +2 -3
  15. package/esm/src/dsl/http/versori/cronapi.d.ts.map +1 -1
  16. package/esm/src/dsl/http/versori/cronapi.js +14 -15
  17. package/esm/src/dsl/http/versori/kvapi/core/OpenAPI.js +1 -1
  18. package/esm/src/dsl/triggers/WebhookTrigger.d.ts.map +1 -1
  19. package/esm/src/dsl/triggers/WebhookTrigger.js +3 -1
  20. package/esm/src/internal/constants.d.ts +3 -0
  21. package/esm/src/internal/constants.d.ts.map +1 -1
  22. package/esm/src/internal/constants.js +3 -0
  23. package/esm/src/internal/supervisor.d.ts +23 -0
  24. package/esm/src/internal/supervisor.d.ts.map +1 -0
  25. package/esm/src/internal/supervisor.js +267 -0
  26. package/esm/src/interpreter/durable/DurableInterpreter.d.ts +9 -2
  27. package/esm/src/interpreter/durable/DurableInterpreter.d.ts.map +1 -1
  28. package/esm/src/interpreter/durable/DurableInterpreter.js +57 -13
  29. package/esm/src/interpreter/durable/ObservableCompiler.d.ts +6 -1
  30. package/esm/src/interpreter/durable/ObservableCompiler.d.ts.map +1 -1
  31. package/esm/src/interpreter/durable/Queue.js +1 -1
  32. package/esm/src/interpreter/durable/compilers/catch.d.ts.map +1 -1
  33. package/esm/src/interpreter/durable/compilers/catch.js +3 -1
  34. package/esm/src/interpreter/durable/compilers/fn.d.ts.map +1 -1
  35. package/esm/src/interpreter/durable/compilers/fn.js +29 -6
  36. package/esm/src/interpreter/durable/compilers/http.d.ts.map +1 -1
  37. package/esm/src/interpreter/durable/compilers/http.js +45 -11
  38. package/esm/src/interpreter/durable/compilers/schedule.d.ts.map +1 -1
  39. package/esm/src/interpreter/durable/compilers/schedule.js +4 -3
  40. package/esm/src/interpreter/durable/compilers/webhook.d.ts.map +1 -1
  41. package/esm/src/interpreter/durable/compilers/webhook.js +2 -0
  42. package/esm/src/interpreter/memory/MemoryInterpreter.d.ts +8 -1
  43. package/esm/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
  44. package/esm/src/interpreter/memory/MemoryInterpreter.js +56 -12
  45. package/esm/src/interpreter/memory/ObservableCompiler.d.ts +6 -1
  46. package/esm/src/interpreter/memory/ObservableCompiler.d.ts.map +1 -1
  47. package/esm/src/interpreter/memory/compilers/catch.d.ts.map +1 -1
  48. package/esm/src/interpreter/memory/compilers/catch.js +5 -0
  49. package/esm/src/interpreter/memory/compilers/fn.d.ts.map +1 -1
  50. package/esm/src/interpreter/memory/compilers/fn.js +29 -18
  51. package/esm/src/interpreter/memory/compilers/http.d.ts.map +1 -1
  52. package/esm/src/interpreter/memory/compilers/http.js +44 -10
  53. package/esm/src/interpreter/memory/compilers/schedule.d.ts.map +1 -1
  54. package/esm/src/interpreter/memory/compilers/schedule.js +61 -4
  55. package/esm/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
  56. package/esm/src/interpreter/memory/compilers/webhook.js +9 -3
  57. package/esm/src/interpreter/vanilla/VanillaInterpreter.d.ts +1 -0
  58. package/esm/src/interpreter/vanilla/VanillaInterpreter.d.ts.map +1 -1
  59. package/esm/src/interpreter/vanilla/VanillaInterpreter.js +30 -6
  60. package/esm/src/interpreter/vanilla/compilers/schedule.js +1 -1
  61. package/esm/src/issues/Issues.d.ts.map +1 -1
  62. package/esm/src/issues/Issues.js +6 -1
  63. package/esm/src/observability/logging/ConsoleLogger.d.ts.map +1 -1
  64. package/package.json +3 -1
  65. package/script/src/connection/internal/CredentialHolder.js +1 -1
  66. package/script/src/connection/internal/FetchBuilder.d.ts +9 -2
  67. package/script/src/connection/internal/FetchBuilder.d.ts.map +1 -1
  68. package/script/src/connection/internal/FetchBuilder.js +147 -3
  69. package/script/src/context/Context.d.ts +5 -0
  70. package/script/src/context/Context.d.ts.map +1 -1
  71. package/script/src/context/Context.js +6 -0
  72. package/script/src/dsl/Workflow.d.ts.map +1 -1
  73. package/script/src/dsl/Workflow.js +2 -0
  74. package/script/src/dsl/http/types.d.ts +2 -0
  75. package/script/src/dsl/http/types.d.ts.map +1 -1
  76. package/script/src/dsl/http/versori/configloader.d.ts.map +1 -1
  77. package/script/src/dsl/http/versori/configloader.js +1 -1
  78. package/script/src/dsl/http/versori/cronapi.d.ts +2 -3
  79. package/script/src/dsl/http/versori/cronapi.d.ts.map +1 -1
  80. package/script/src/dsl/http/versori/cronapi.js +14 -15
  81. package/script/src/dsl/http/versori/kvapi/core/OpenAPI.js +1 -1
  82. package/script/src/dsl/triggers/WebhookTrigger.d.ts.map +1 -1
  83. package/script/src/dsl/triggers/WebhookTrigger.js +3 -1
  84. package/script/src/internal/constants.d.ts +3 -0
  85. package/script/src/internal/constants.d.ts.map +1 -1
  86. package/script/src/internal/constants.js +4 -1
  87. package/script/src/internal/supervisor.d.ts +23 -0
  88. package/script/src/internal/supervisor.d.ts.map +1 -0
  89. package/script/src/internal/supervisor.js +275 -0
  90. package/script/src/interpreter/durable/DurableInterpreter.d.ts +9 -2
  91. package/script/src/interpreter/durable/DurableInterpreter.d.ts.map +1 -1
  92. package/script/src/interpreter/durable/DurableInterpreter.js +62 -18
  93. package/script/src/interpreter/durable/ObservableCompiler.d.ts +6 -1
  94. package/script/src/interpreter/durable/ObservableCompiler.d.ts.map +1 -1
  95. package/script/src/interpreter/durable/Queue.js +1 -1
  96. package/script/src/interpreter/durable/compilers/catch.d.ts.map +1 -1
  97. package/script/src/interpreter/durable/compilers/catch.js +3 -1
  98. package/script/src/interpreter/durable/compilers/fn.d.ts.map +1 -1
  99. package/script/src/interpreter/durable/compilers/fn.js +28 -5
  100. package/script/src/interpreter/durable/compilers/http.d.ts.map +1 -1
  101. package/script/src/interpreter/durable/compilers/http.js +45 -11
  102. package/script/src/interpreter/durable/compilers/schedule.d.ts.map +1 -1
  103. package/script/src/interpreter/durable/compilers/schedule.js +4 -3
  104. package/script/src/interpreter/durable/compilers/webhook.d.ts.map +1 -1
  105. package/script/src/interpreter/durable/compilers/webhook.js +2 -0
  106. package/script/src/interpreter/memory/MemoryInterpreter.d.ts +8 -1
  107. package/script/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
  108. package/script/src/interpreter/memory/MemoryInterpreter.js +55 -11
  109. package/script/src/interpreter/memory/ObservableCompiler.d.ts +6 -1
  110. package/script/src/interpreter/memory/ObservableCompiler.d.ts.map +1 -1
  111. package/script/src/interpreter/memory/compilers/catch.d.ts.map +1 -1
  112. package/script/src/interpreter/memory/compilers/catch.js +5 -0
  113. package/script/src/interpreter/memory/compilers/fn.d.ts.map +1 -1
  114. package/script/src/interpreter/memory/compilers/fn.js +28 -17
  115. package/script/src/interpreter/memory/compilers/http.d.ts.map +1 -1
  116. package/script/src/interpreter/memory/compilers/http.js +44 -10
  117. package/script/src/interpreter/memory/compilers/schedule.d.ts.map +1 -1
  118. package/script/src/interpreter/memory/compilers/schedule.js +61 -4
  119. package/script/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
  120. package/script/src/interpreter/memory/compilers/webhook.js +9 -3
  121. package/script/src/interpreter/vanilla/VanillaInterpreter.d.ts +1 -0
  122. package/script/src/interpreter/vanilla/VanillaInterpreter.d.ts.map +1 -1
  123. package/script/src/interpreter/vanilla/VanillaInterpreter.js +30 -6
  124. package/script/src/interpreter/vanilla/compilers/schedule.js +1 -1
  125. package/script/src/issues/Issues.d.ts.map +1 -1
  126. package/script/src/issues/Issues.js +6 -1
  127. package/script/src/observability/logging/ConsoleLogger.d.ts.map +1 -1
  128. package/esm/src/dsl/http/versori/constants.d.ts +0 -21
  129. package/esm/src/dsl/http/versori/constants.d.ts.map +0 -1
  130. package/esm/src/dsl/http/versori/constants.js +0 -38
  131. package/script/src/dsl/http/versori/constants.d.ts +0 -21
  132. package/script/src/dsl/http/versori/constants.d.ts.map +0 -1
  133. package/script/src/dsl/http/versori/constants.js +0 -41
@@ -25,7 +25,8 @@ const rxjs_1 = require("rxjs");
25
25
  const VanillaConnectionFactory_js_1 = require("../../connection/VanillaConnectionFactory.js");
26
26
  const VanillaContext_js_1 = require("../../context/VanillaContext.js");
27
27
  const configloader_js_1 = require("../../dsl/http/versori/configloader.js");
28
- const constants_js_1 = require("../../dsl/http/versori/constants.js");
28
+ const constants_js_1 = require("../../internal/constants.js");
29
+ const supervisor_js_1 = require("../../internal/supervisor.js");
29
30
  const cronapi_js_1 = require("../../dsl/http/versori/cronapi.js");
30
31
  const Workflow_js_1 = require("../../dsl/Workflow.js");
31
32
  const Issues_js_1 = require("../../issues/Issues.js");
@@ -34,8 +35,8 @@ const SDKKeyValueProvider_js_1 = require("../../kv/sdk/SDKKeyValueProvider.js");
34
35
  const ConsoleLogger_js_1 = require("../../observability/logging/ConsoleLogger.js");
35
36
  const Queue_js_1 = require("../durable/Queue.js");
36
37
  const ObservableCompiler_js_1 = require("./ObservableCompiler.js");
37
- function getKVProvider(runLocal) {
38
- if (runLocal) {
38
+ function getKVProvider() {
39
+ if (supervisor_js_1.enabled) {
39
40
  return Promise.resolve(new MemoryKeyValueProvider_js_1.MemoryKeyValueProvider());
40
41
  }
41
42
  return SDKKeyValueProvider_js_1.SDKKeyValueProvider.fromEnv();
@@ -167,6 +168,13 @@ class VanillaInterpreter {
167
168
  writable: true,
168
169
  value: false
169
170
  });
171
+ // Workflow registration promises only used when supervisor is enabled
172
+ Object.defineProperty(this, "wfRegistration", {
173
+ enumerable: true,
174
+ configurable: true,
175
+ writable: true,
176
+ value: []
177
+ });
170
178
  if (typeof this.log === 'undefined') {
171
179
  throw new Error('VanillaInterpreter should not be instantiated directly. Use VanillaInterpreter.newInstance() instead.');
172
180
  }
@@ -183,7 +191,6 @@ class VanillaInterpreter {
183
191
  const otelTracesURL = Deno.env.get(constants_js_1.envVarOtelTracesURL);
184
192
  let otelSDK;
185
193
  const configReader = configloader_js_1.VersoriConfigReader.fromEnv(log);
186
- const runLocal = Deno.env.get(constants_js_1.envVarLocalRun) === 'true';
187
194
  await waitForReady(log);
188
195
  // Do NOT change these attributes, they are used by the API to filter on
189
196
  const resource = (0, resources_1.resourceFromAttributes)({
@@ -205,6 +212,15 @@ class VanillaInterpreter {
205
212
  log.info('Starting OpenTelemetry SDK');
206
213
  otelSDK.start();
207
214
  }
215
+ else if (supervisor_js_1.enabled) {
216
+ otelSDK = new sdk_node_1.NodeSDK({
217
+ traceExporter: new supervisor_js_1.Fake(),
218
+ serviceName: serviceName,
219
+ resource: resource,
220
+ });
221
+ log.info('Starting Testing OpenTelemetry SDK');
222
+ otelSDK.start();
223
+ }
208
224
  const tracer = api_1.default.trace.getTracer(serviceName, version);
209
225
  const queueProvider = await Queue_js_1.QueueImpl.fromEnv(log);
210
226
  const connectionFactory = new VanillaConnectionFactory_js_1.DefaultConnectionFactory();
@@ -212,7 +228,7 @@ class VanillaInterpreter {
212
228
  if (options.contextProvider) {
213
229
  return new VanillaInterpreter(log, compiler, options.contextProvider, express_1.default.Router(), express_1.default.Router(), new Map(), connectionFactory, cronapi_js_1.CronAPIClient.fromEnv(), tracer, configReader, queueProvider, otelSDK);
214
230
  }
215
- const kvp = await getKVProvider(runLocal);
231
+ const kvp = await getKVProvider();
216
232
  const organisationId = Deno.env.get(constants_js_1.envVarOrgId) || 'development';
217
233
  const environmentId = Deno.env.get(constants_js_1.envVarEnvId) || 'development';
218
234
  const ctxProvider = new VanillaContext_js_1.VanillaContextProvider(log, kvp, organisationId, environmentId, issuesProvider, queueProvider);
@@ -255,9 +271,12 @@ class VanillaInterpreter {
255
271
  },
256
272
  };
257
273
  this.registeredWorkflows.push(registration);
274
+ if (supervisor_js_1.enabled) {
275
+ this.wfRegistration.push((0, supervisor_js_1.registerWorkflow)(workflow));
276
+ }
258
277
  return registration;
259
278
  }
260
- start() {
279
+ async start() {
261
280
  const port = Deno.env.get('PORT') || 3000;
262
281
  const cronPort = Deno.env.get('CRON_PORT') || 3001;
263
282
  const webhookApp = (0, express_1.default)();
@@ -366,6 +385,7 @@ class VanillaInterpreter {
366
385
  if (this.cronServer) {
367
386
  this.cronServer.close();
368
387
  }
388
+ this.otelSDK?.shutdown();
369
389
  for (const registration of this.registeredWorkflows) {
370
390
  Deno.removeSignalListener('SIGINT', registration.sigintListener);
371
391
  if (registration.subscription) {
@@ -378,6 +398,10 @@ class VanillaInterpreter {
378
398
  }
379
399
  };
380
400
  Deno.addSignalListener('SIGINT', this.shutdownServer);
401
+ if (supervisor_js_1.enabled) {
402
+ await Promise.all(this.wfRegistration);
403
+ await (0, supervisor_js_1.signalReady)();
404
+ }
381
405
  return new Promise((resolve) => {
382
406
  let serversClosed = 0;
383
407
  const totalServers = [this.webhookServer, this.cronServer].filter(Boolean).length;
@@ -14,7 +14,7 @@
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.scheduleCompiler = void 0;
16
16
  const rxjs_1 = require("rxjs");
17
- const constants_js_1 = require("../../../dsl/http/versori/constants.js");
17
+ const constants_js_1 = require("../../../internal/constants.js");
18
18
  const ScheduleTrigger_js_1 = require("../../../dsl/triggers/ScheduleTrigger.js");
19
19
  const ObservableCompiler_js_1 = require("../ObservableCompiler.js");
20
20
  function compileSchedule(ctx, trigger, signal) {
@@ -1 +1 @@
1
- {"version":3,"file":"Issues.d.ts","sourceR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AC7B;AAED,qBAAa,SAAU,YAAW,QAAQ;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IAExC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAS;IAC3C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAS;IAClC,OAAO,CAAC,GAAG,CAAS;gBAER,GAAG,EAAE,MAAM;IA2BjB,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAQpD,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE;QACtC,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,cAAc,CAAC,EAAE,MAAM,CAAC;KAC3B,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;YAWX,MAAM;CAiEvB;AAED,qBAAa,UAAW,YAAW,QAAQ;IACvC,WAAW,CAAC,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1C,WAAW,CAAC,CAAC,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE;QACnC,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,cAAc,CAAC,EAAE,MAAM,CAAC;KAC3B,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;CAG5B"}
@@ -14,7 +14,8 @@
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.MockIssues = exports.IssueImpl = void 0;
16
16
  const node_crypto_1 = require("node:crypto");
17
- const constants_js_1 = require("../dsl/http/versori/constants.js");
17
+ const constants_js_1 = require("../internal/constants.js");
18
+ const supervisor_js_1 = require("../internal/supervisor.js");
18
19
  class IssueImpl {
19
20
  constructor(log) {
20
21
  Object.defineProperty(this, "baseUrl", {
@@ -110,6 +111,10 @@ class IssueImpl {
110
111
  issue.annotations['environmentId'] = this.environmentId;
111
112
  issue.annotations['organisationId'] = this.organisationId;
112
113
  try {
114
+ if (supervisor_js_1.enabled) {
115
+ this.log.info('Issue to be submitted', { issue: issue });
116
+ return Promise.resolve(null);
117
+ }
113
118
  const response = await fetch(`${this.baseUrl}/v1/issues/submit`, {
114
119
  method: 'POST',
115
120
  headers: {
@@ -1 +1 @@
1
- {"version":3,"file":"ConsoleLogger.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/logging/ConsoleLogger.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,GAAG,MAAM,+CAA+C,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAmN/C;;;;;GAKG;AACH,qBAAa,aAAc,YAAW,MAAM;IACxC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC;IAEhB,KAAK,EAAE,QAAQ,CAAC;IAEhB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAEpB,KAAK,GAAE,QAAqD,EAAE,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM;IAO9G,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAO9D,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAO7D,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAO7D,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,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AAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAsB9D,KAAK,CAAC,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,aAAa;IAOvD,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI;CAIlC"}
@@ -1,21 +0,0 @@
1
- export declare const envVarOrgId = "RUN_ORGANISATION_ID";
2
- export declare const envVarEnvId = "RUN_ENVIRONMENT_ID";
3
- export declare const envVarEnvironmentName = "RUN_ENVIRONMENT";
4
- export declare const envVarProjectId = "RUN_SERVICE_ID";
5
- export declare const envVarOrgSlug = "RUN_ORGANISATION_SLUG";
6
- export declare const envVarPlatformApiBaseURL = "RUN_PLATFORM_API_INTERNAL_URL";
7
- export declare const envVarCronApiBaseURL = "RUN_CRON_API_INTERNAL_URL";
8
- export declare const envVarSDKApiBaseURL = "RUN_SDK_API_URL";
9
- export declare const envVarSelfRefURL = "RUN_SELF_REF_URL";
10
- export declare const envVarCredsBaseURL = "RUN_CREDENTIALS_SERVICE_INTERNAL_URL";
11
- export declare const envVarOtelTracesURL = "RUN_OTEL_TRACES_URL";
12
- export declare const envVarVersion = "RUN_SERVICE_VERSION";
13
- export declare const envVarConfigFile = "RUN_CONFIG_FILE";
14
- export declare const envVarClientId = "RUN_CLIENT_ID";
15
- export declare const envVarClientSecret = "RUN_CLIENT_SECRET";
16
- export declare const envVarTokenEndpoint = "RUN_TOKEN_ENDPOINT";
17
- export declare const envVarInternalToken = "RUN_INTERNAL_TOKEN";
18
- export declare const envVarJwt = "RUN_VERSORI_JWT";
19
- export declare const envVarLocalRun = "RUN_LOCAL";
20
- export declare const cronPort = 3001;
21
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/constants.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,WAAW,wBAAwB,CAAC;AACjD,eAAO,MAAM,WAAW,uBAAuB,CAAC;AAChD,eAAO,MAAM,qBAAqB,oBAAoB,CAAC;AACvD,eAAO,MAAM,eAAe,mBAAmB,CAAC;AAChD,eAAO,MAAM,aAAa,0BAA0B,CAAC;AACrD,eAAO,MAAM,wBAAwB,kCAAkC,CAAC;AACxE,eAAO,MAAM,oBAAoB,8BAA8B,CAAC;AAChE,eAAO,MAAM,mBAAmB,oBAAoB,CAAC;AACrD,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AACnD,eAAO,MAAM,kBAAkB,yCAAyC,CAAC;AACzE,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AACzD,eAAO,MAAM,aAAa,wBAAwB,CAAC;AAEnD,eAAO,MAAM,gBAAgB,oBAAoB,CAAC;AAGlD,eAAO,MAAM,cAAc,kBAAkB,CAAC;AAC9C,eAAO,MAAM,kBAAkB,sBAAsB,CAAC;AACtD,eAAO,MAAM,mBAAmB,uBAAuB,CAAC;AACxD,eAAO,MAAM,mBAAmB,uBAAuB,CAAC;AACxD,eAAO,MAAM,SAAS,oBAAoB,CAAC;AAG3C,eAAO,MAAM,cAAc,cAAc,CAAC;AAG1C,eAAO,MAAM,QAAQ,OAAO,CAAC"}
@@ -1,38 +0,0 @@
1
- /*
2
- * Copyright (c) 2025 Versori Group Inc
3
- *
4
- * Use of this software is governed by the Business Source License 1.1
5
- * included in the LICENSE file at the root of this repository.
6
- *
7
- * Change Date: 2029-01-01
8
- * Change License: Apache License, Version 2.0
9
- *
10
- * As of the Change Date, in accordance with the Business Source License,
11
- * use of this software will be governed by the Apache License, Version 2.0.
12
- */
13
- //TODO(@teo): remove this file, it is implemented in the src/internal/constants.ts directory now.
14
- // This file contains constants used in the Versori DSL HTTP client.
15
- export const envVarOrgId = 'RUN_ORGANISATION_ID';
16
- export const envVarEnvId = 'RUN_ENVIRONMENT_ID';
17
- export const envVarEnvironmentName = 'RUN_ENVIRONMENT';
18
- export const envVarProjectId = 'RUN_SERVICE_ID';
19
- export const envVarOrgSlug = 'RUN_ORGANISATION_SLUG';
20
- export const envVarPlatformApiBaseURL = 'RUN_PLATFORM_API_INTERNAL_URL';
21
- export const envVarCronApiBaseURL = 'RUN_CRON_API_INTERNAL_URL';
22
- export const envVarSDKApiBaseURL = 'RUN_SDK_API_URL';
23
- export const envVarSelfRefURL = 'RUN_SELF_REF_URL';
24
- export const envVarCredsBaseURL = 'RUN_CREDENTIALS_SERVICE_INTERNAL_URL';
25
- export const envVarOtelTracesURL = 'RUN_OTEL_TRACES_URL';
26
- export const envVarVersion = 'RUN_SERVICE_VERSION';
27
- // The following environment variables are used for the config file
28
- export const envVarConfigFile = 'RUN_CONFIG_FILE';
29
- // The following environment variables are used for internal authentication
30
- export const envVarClientId = 'RUN_CLIENT_ID';
31
- export const envVarClientSecret = 'RUN_CLIENT_SECRET';
32
- export const envVarTokenEndpoint = 'RUN_TOKEN_ENDPOINT';
33
- export const envVarInternalToken = 'RUN_INTERNAL_TOKEN';
34
- export const envVarJwt = 'RUN_VERSORI_JWT';
35
- // The following are for running locally
36
- export const envVarLocalRun = 'RUN_LOCAL';
37
- // please no changerino
38
- export const cronPort = 3001; // The port on which the cron API communicates with the service
@@ -1,21 +0,0 @@
1
- export declare const envVarOrgId = "RUN_ORGANISATION_ID";
2
- export declare const envVarEnvId = "RUN_ENVIRONMENT_ID";
3
- export declare const envVarEnvironmentName = "RUN_ENVIRONMENT";
4
- export declare const envVarProjectId = "RUN_SERVICE_ID";
5
- export declare const envVarOrgSlug = "RUN_ORGANISATION_SLUG";
6
- export declare const envVarPlatformApiBaseURL = "RUN_PLATFORM_API_INTERNAL_URL";
7
- export declare const envVarCronApiBaseURL = "RUN_CRON_API_INTERNAL_URL";
8
- export declare const envVarSDKApiBaseURL = "RUN_SDK_API_URL";
9
- export declare const envVarSelfRefURL = "RUN_SELF_REF_URL";
10
- export declare const envVarCredsBaseURL = "RUN_CREDENTIALS_SERVICE_INTERNAL_URL";
11
- export declare const envVarOtelTracesURL = "RUN_OTEL_TRACES_URL";
12
- export declare const envVarVersion = "RUN_SERVICE_VERSION";
13
- export declare const envVarConfigFile = "RUN_CONFIG_FILE";
14
- export declare const envVarClientId = "RUN_CLIENT_ID";
15
- export declare const envVarClientSecret = "RUN_CLIENT_SECRET";
16
- export declare const envVarTokenEndpoint = "RUN_TOKEN_ENDPOINT";
17
- export declare const envVarInternalToken = "RUN_INTERNAL_TOKEN";
18
- export declare const envVarJwt = "RUN_VERSORI_JWT";
19
- export declare const envVarLocalRun = "RUN_LOCAL";
20
- export declare const cronPort = 3001;
21
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/constants.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,WAAW,wBAAwB,CAAC;AACjD,eAAO,MAAM,WAAW,uBAAuB,CAAC;AAChD,eAAO,MAAM,qBAAqB,oBAAoB,CAAC;AACvD,eAAO,MAAM,eAAe,mBAAmB,CAAC;AAChD,eAAO,MAAM,aAAa,0BAA0B,CAAC;AACrD,eAAO,MAAM,wBAAwB,kCAAkC,CAAC;AACxE,eAAO,MAAM,oBAAoB,8BAA8B,CAAC;AAChE,eAAO,MAAM,mBAAmB,oBAAoB,CAAC;AACrD,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AACnD,eAAO,MAAM,kBAAkB,yCAAyC,CAAC;AACzE,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AACzD,eAAO,MAAM,aAAa,wBAAwB,CAAC;AAEnD,eAAO,MAAM,gBAAgB,oBAAoB,CAAC;AAGlD,eAAO,MAAM,cAAc,kBAAkB,CAAC;AAC9C,eAAO,MAAM,kBAAkB,sBAAsB,CAAC;AACtD,eAAO,MAAM,mBAAmB,uBAAuB,CAAC;AACxD,eAAO,MAAM,mBAAmB,uBAAuB,CAAC;AACxD,eAAO,MAAM,SAAS,oBAAoB,CAAC;AAG3C,eAAO,MAAM,cAAc,cAAc,CAAC;AAG1C,eAAO,MAAM,QAAQ,OAAO,CAAC"}
@@ -1,41 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright (c) 2025 Versori Group Inc
4
- *
5
- * Use of this software is governed by the Business Source License 1.1
6
- * included in the LICENSE file at the root of this repository.
7
- *
8
- * Change Date: 2029-01-01
9
- * Change License: Apache License, Version 2.0
10
- *
11
- * As of the Change Date, in accordance with the Business Source License,
12
- * use of this software will be governed by the Apache License, Version 2.0.
13
- */
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.cronPort = exports.envVarLocalRun = exports.envVarJwt = exports.envVarInternalToken = exports.envVarTokenEndpoint = exports.envVarClientSecret = exports.envVarClientId = exports.envVarConfigFile = exports.envVarVersion = exports.envVarOtelTracesURL = exports.envVarCredsBaseURL = exports.envVarSelfRefURL = exports.envVarSDKApiBaseURL = exports.envVarCronApiBaseURL = exports.envVarPlatformApiBaseURL = exports.envVarOrgSlug = exports.envVarProjectId = exports.envVarEnvironmentName = exports.envVarEnvId = exports.envVarOrgId = void 0;
16
- //TODO(@teo): remove this file, it is implemented in the src/internal/constants.ts directory now.
17
- // This file contains constants used in the Versori DSL HTTP client.
18
- exports.envVarOrgId = 'RUN_ORGANISATION_ID';
19
- exports.envVarEnvId = 'RUN_ENVIRONMENT_ID';
20
- exports.envVarEnvironmentName = 'RUN_ENVIRONMENT';
21
- exports.envVarProjectId = 'RUN_SERVICE_ID';
22
- exports.envVarOrgSlug = 'RUN_ORGANISATION_SLUG';
23
- exports.envVarPlatformApiBaseURL = 'RUN_PLATFORM_API_INTERNAL_URL';
24
- exports.envVarCronApiBaseURL = 'RUN_CRON_API_INTERNAL_URL';
25
- exports.envVarSDKApiBaseURL = 'RUN_SDK_API_URL';
26
- exports.envVarSelfRefURL = 'RUN_SELF_REF_URL';
27
- exports.envVarCredsBaseURL = 'RUN_CREDENTIALS_SERVICE_INTERNAL_URL';
28
- exports.envVarOtelTracesURL = 'RUN_OTEL_TRACES_URL';
29
- exports.envVarVersion = 'RUN_SERVICE_VERSION';
30
- // The following environment variables are used for the config file
31
- exports.envVarConfigFile = 'RUN_CONFIG_FILE';
32
- // The following environment variables are used for internal authentication
33
- exports.envVarClientId = 'RUN_CLIENT_ID';
34
- exports.envVarClientSecret = 'RUN_CLIENT_SECRET';
35
- exports.envVarTokenEndpoint = 'RUN_TOKEN_ENDPOINT';
36
- exports.envVarInternalToken = 'RUN_INTERNAL_TOKEN';
37
- exports.envVarJwt = 'RUN_VERSORI_JWT';
38
- // The following are for running locally
39
- exports.envVarLocalRun = 'RUN_LOCAL';
40
- // please no changerino
41
- exports.cronPort = 3001; // The port on which the cron API communicates with the service