@ductape/sdk 0.2.2 → 0.2.3

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.
@@ -384,9 +384,9 @@ export default class ProcessorService implements IProcessorService {
384
384
  runBrokerPublish(data: IStepEvent, additional_logs?: Partial<ILogData>): Promise<{
385
385
  published: boolean;
386
386
  }>;
387
- processStorageRequest(data: IStepEvent, input: IStorageRequest, storageEnv: IProductStorageEnvs, additional_logs: Partial<ILogData>, decryptionKey?: string): Promise<{
387
+ processStorageRequest(data: IStepEvent, input: IStorageRequest, storageEnv: IProductStorageEnvs, additional_logs: Partial<ILogData>, decryptionKey?: string): Promise<IProcessingFailure | {
388
388
  url: string;
389
- } | IProcessingFailure>;
389
+ }>;
390
390
  writeResult(status: LogEventStatus, retryable?: boolean): Promise<void>;
391
391
  /**
392
392
  * Separate credentials into prefixed (e.g., 'headers:Authorization') and non-prefixed (e.g., 'api_key').
@@ -2053,7 +2053,7 @@ class ProcessorService {
2053
2053
  start: startedAt,
2054
2054
  end: completedAt,
2055
2055
  });
2056
- await this.logService.publish();
2056
+ void this.logService.publish().catch(() => { });
2057
2057
  }
2058
2058
  return result;
2059
2059
  }
@@ -2163,7 +2163,7 @@ class ProcessorService {
2163
2163
  start: startedAt,
2164
2164
  end: failedAt,
2165
2165
  });
2166
- await this.logService.publish();
2166
+ void this.logService.publish().catch(() => { });
2167
2167
  }
2168
2168
  throw error;
2169
2169
  }
@@ -3080,7 +3080,7 @@ class ProcessorService {
3080
3080
  this.processingOutput.success.push({ event, output });
3081
3081
  if (this.checkIsSuccessful() && this.doneWithProcessing) {
3082
3082
  this.logService.add(Object.assign(Object.assign(Object.assign({}, this.baseLogs), additional_logs), { successful_execution: true, message: 'Process event - success', data: {}, status: types_1.LogEventStatus.SUCCESS }));
3083
- await this.logService.publish();
3083
+ void this.logService.publish().catch(() => { });
3084
3084
  this.end = Date.now();
3085
3085
  await this.writeResult(types_1.LogEventStatus.SUCCESS);
3086
3086
  }
@@ -3165,7 +3165,7 @@ class ProcessorService {
3165
3165
  //throw new Error("Run out of retries")
3166
3166
  this.end = Date.now();
3167
3167
  await this.writeResult(types_1.LogEventStatus.FAIL, retryable);
3168
- await this.logService.publish();
3168
+ void this.logService.publish().catch(() => { });
3169
3169
  //throw new Error("Terminate Process")
3170
3170
  }
3171
3171
  return output;
@@ -3309,7 +3309,7 @@ class ProcessorService {
3309
3309
  if (this.logService) {
3310
3310
  this.logService.add(Object.assign(Object.assign(Object.assign({}, this.baseLogs), additional_logs), { message: 'Storing file - success', data: { input: this.clone, result }, status: types_1.LogEventStatus.SUCCESS }));
3311
3311
  await this.writeResult(types_1.LogEventStatus.SUCCESS);
3312
- await this.logService.publish();
3312
+ void this.logService.publish().catch(() => { });
3313
3313
  }
3314
3314
  return { process_id: this.process_id, output: result !== null && result !== void 0 ? result : {} };
3315
3315
  }
@@ -3323,7 +3323,7 @@ class ProcessorService {
3323
3323
  this.end = Date.now();
3324
3324
  if (this.logService) {
3325
3325
  this.logService.add(Object.assign(Object.assign(Object.assign({}, this.baseLogs), additional_logs), { message, data: { e, reason }, status: types_1.LogEventStatus.FAIL }));
3326
- await this.logService.publish();
3326
+ void this.logService.publish().catch(() => { });
3327
3327
  }
3328
3328
  // Rethrow so the feature step is marked failed and the executor can persist the error reason
3329
3329
  throw e;
@@ -3368,13 +3368,15 @@ class ProcessorService {
3368
3368
  this.end = Date.now();
3369
3369
  this.logService.add(Object.assign(Object.assign(Object.assign({}, this.baseLogs), additional_logs), { message: 'Subscribe to topic - success', data: { input: this.clone, result }, status: types_1.LogEventStatus.SUCCESS }));
3370
3370
  await this.writeResult(types_1.LogEventStatus.SUCCESS);
3371
- await this.logService.publish();
3371
+ // The action result is authoritative; telemetry delivery must not add the
3372
+ // Logs API timeout to caller latency.
3373
+ void this.logService.publish().catch(() => { });
3372
3374
  return result;
3373
3375
  }
3374
3376
  catch (e) {
3375
3377
  this.logService.add(Object.assign(Object.assign(Object.assign({}, this.baseLogs), additional_logs), { message: 'Subscribe to topic - failed', data: { e }, status: types_1.LogEventStatus.FAIL }));
3376
3378
  this.end = Date.now();
3377
- await this.logService.publish();
3379
+ void this.logService.publish().catch(() => { });
3378
3380
  return { process_id: this.process_id };
3379
3381
  }
3380
3382
  }
@@ -3454,7 +3456,7 @@ class ProcessorService {
3454
3456
  this.logService.add(Object.assign(Object.assign(Object.assign({}, this.baseLogs), additional_logs), { message: 'Produce to topic - success', data: { input: this.clone, result: result !== null && result !== void 0 ? result : {} }, status: types_1.LogEventStatus.SUCCESS }));
3455
3457
  await this.writeResult(types_1.LogEventStatus.SUCCESS);
3456
3458
  // Fire-and-forget so step latency isn't dominated by log upload (20–50x slower otherwise)
3457
- this.logService.publish().catch(() => { });
3459
+ void this.logService.publish().catch(() => { });
3458
3460
  return { process_id: this.process_id, output: Object.assign(Object.assign({}, (result !== null && result !== void 0 ? result : {})), { published: true }) };
3459
3461
  }
3460
3462
  catch (e) {
@@ -3464,7 +3466,7 @@ class ProcessorService {
3464
3466
  const message = `Publishing to topic - failed: ${reason}`;
3465
3467
  this.logService.add(Object.assign(Object.assign(Object.assign({}, this.baseLogs), additional_logs), { message, data: { e, reason }, status: types_1.LogEventStatus.FAIL }));
3466
3468
  this.end = Date.now();
3467
- await this.logService.publish();
3469
+ void this.logService.publish().catch(() => { });
3468
3470
  // Rethrow so the feature step is marked failed and the executor can persist the error reason
3469
3471
  throw e;
3470
3472
  }
@@ -3788,7 +3790,7 @@ class ProcessorService {
3788
3790
  },
3789
3791
  status: types_1.LogEventStatus.SUCCESS,
3790
3792
  });
3791
- await this.logService.publish();
3793
+ void this.logService.publish().catch(() => { });
3792
3794
  }
3793
3795
  return {
3794
3796
  job_id: jobId,
@@ -4269,7 +4271,7 @@ class ProcessorService {
4269
4271
  if (this.lastNotificationFailureType != null) {
4270
4272
  this.logService.add(Object.assign(Object.assign(Object.assign({}, this.baseLogs), additional_logs), { type: this.lastNotificationFailureType, failed_execution: true, message: 'Attempt notification - failed', data: { e: e.toString() }, status: types_1.LogEventStatus.FAIL }));
4271
4273
  }
4272
- //await this.logService.publish();
4274
+ //void this.logService.publish().catch(() => {});
4273
4275
  throw e;
4274
4276
  }
4275
4277
  }
@@ -4364,7 +4366,7 @@ class ProcessorService {
4364
4366
  data: e,
4365
4367
  status: LogEventStatus.FAIL,
4366
4368
  });
4367
- await this.logService.publish();
4369
+ void this.logService.publish().catch(() => {});
4368
4370
  }
4369
4371
  }*/
4370
4372
  async runStorage(data, additional_logs = {}, bootstrapData) {
@@ -4902,7 +4904,7 @@ class ProcessorService {
4902
4904
  const result = JSON.parse(cachedResult);
4903
4905
  this.logService.add(Object.assign(Object.assign(Object.assign({}, this.baseLogs), additional_logs), { message: 'Action response from cache (early check)', data: { result }, status: types_1.LogEventStatus.SUCCESS, cache_tag: cache, action: event }));
4904
4906
  this.end = Date.now();
4905
- await this.logService.publish();
4907
+ void this.logService.publish().catch(() => { });
4906
4908
  return result;
4907
4909
  }
4908
4910
  }
@@ -5021,7 +5023,9 @@ class ProcessorService {
5021
5023
  this.end = Date.now();
5022
5024
  this.logService.add(Object.assign(Object.assign(Object.assign({}, this.baseLogs), additional_logs), { message: 'Execute action - success', data: { input, result }, status: types_1.LogEventStatus.SUCCESS }));
5023
5025
  await this.writeResult(types_1.LogEventStatus.SUCCESS);
5024
- await this.logService.publish();
5026
+ // The action result is authoritative; telemetry delivery must not add the
5027
+ // Logs API timeout to caller latency.
5028
+ void this.logService.publish().catch(() => { });
5025
5029
  return result;
5026
5030
  }
5027
5031
  catch (e) {
@@ -5031,7 +5035,9 @@ class ProcessorService {
5031
5035
  if (!(e === null || e === void 0 ? void 0 : e.processorFailureRecorded)) {
5032
5036
  await this.writeResult(types_1.LogEventStatus.FAIL);
5033
5037
  }
5034
- await this.logService.publish();
5038
+ // Preserve and return the provider error immediately. LogsService keeps
5039
+ // unsent entries queued when delivery fails.
5040
+ void this.logService.publish().catch(() => { });
5035
5041
  }
5036
5042
  throw e;
5037
5043
  }
@@ -5175,7 +5181,7 @@ class ProcessorService {
5175
5181
  }*/
5176
5182
  await this.writeResult(types_1.LogEventStatus.SUCCESS);
5177
5183
  // Fire-and-forget so step latency isn't dominated by log upload
5178
- this.logService.publish().catch(() => { });
5184
+ void this.logService.publish().catch(() => { });
5179
5185
  // Per-channel message logs are emitted inside runNotification (type: email | push | sms | callback).
5180
5186
  return { process_id, output: { sent: true } };
5181
5187
  }
@@ -5191,7 +5197,7 @@ class ProcessorService {
5191
5197
  this.logService.add(Object.assign(Object.assign(Object.assign({}, this.baseLogs), additional_logs), { type: this.lastNotificationFailureType, message: 'Send notification - failed', data: { e: e.toString() }, status: types_1.LogEventStatus.FAIL }));
5192
5198
  }
5193
5199
  this.end = Date.now();
5194
- this.logService.publish().catch(() => { });
5200
+ void this.logService.publish().catch(() => { });
5195
5201
  }
5196
5202
  // Fire-and-forget: log failed notification for reprocessing (only when we have productId from bootstrap). Use actual channel type when known.
5197
5203
  if (this.productId && this.workspace_id) {