@temporalio/workflow 1.14.2 → 1.15.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 (50) hide show
  1. package/lib/cancellation-scope.d.ts +2 -6
  2. package/lib/cancellation-scope.js +2 -9
  3. package/lib/cancellation-scope.js.map +1 -1
  4. package/lib/flags.js +1 -1
  5. package/lib/flags.js.map +1 -1
  6. package/lib/global-attributes.d.ts +17 -5
  7. package/lib/global-attributes.js +9 -17
  8. package/lib/global-attributes.js.map +1 -1
  9. package/lib/global-overrides.js +6 -6
  10. package/lib/global-overrides.js.map +1 -1
  11. package/lib/index.d.ts +4 -4
  12. package/lib/index.js +2 -1
  13. package/lib/index.js.map +1 -1
  14. package/lib/interceptors.d.ts +16 -1
  15. package/lib/interfaces.d.ts +73 -30
  16. package/lib/interfaces.js +54 -14
  17. package/lib/interfaces.js.map +1 -1
  18. package/lib/internals.d.ts +3 -1
  19. package/lib/internals.js +25 -7
  20. package/lib/internals.js.map +1 -1
  21. package/lib/metrics.js +4 -0
  22. package/lib/metrics.js.map +1 -1
  23. package/lib/nexus.d.ts +51 -0
  24. package/lib/nexus.js +68 -8
  25. package/lib/nexus.js.map +1 -1
  26. package/lib/stack-helpers.js +1 -1
  27. package/lib/stack-helpers.js.map +1 -1
  28. package/lib/update-scope.d.ts +0 -4
  29. package/lib/update-scope.js +0 -7
  30. package/lib/update-scope.js.map +1 -1
  31. package/lib/worker-interface.d.ts +2 -1
  32. package/lib/worker-interface.js +59 -10
  33. package/lib/worker-interface.js.map +1 -1
  34. package/lib/workflow.js +11 -11
  35. package/lib/workflow.js.map +1 -1
  36. package/package.json +4 -4
  37. package/src/cancellation-scope.ts +3 -10
  38. package/src/flags.ts +1 -1
  39. package/src/global-attributes.ts +34 -16
  40. package/src/global-overrides.ts +6 -6
  41. package/src/index.ts +11 -6
  42. package/src/interceptors.ts +18 -1
  43. package/src/interfaces.ts +84 -38
  44. package/src/internals.ts +30 -8
  45. package/src/metrics.ts +7 -0
  46. package/src/nexus.ts +84 -8
  47. package/src/stack-helpers.ts +2 -3
  48. package/src/update-scope.ts +1 -8
  49. package/src/worker-interface.ts +60 -13
  50. package/src/workflow.ts +11 -11
package/src/workflow.ts CHANGED
@@ -202,7 +202,7 @@ function scheduleActivityNextHandler({ options, args, headers, seq, activityType
202
202
  headers,
203
203
  cancellationType: encodeActivityCancellationType(options.cancellationType),
204
204
  doNotEagerlyExecute: !(options.allowEagerDispatch ?? true),
205
- versioningIntent: versioningIntentToProto(options.versioningIntent), // eslint-disable-line deprecation/deprecation
205
+ versioningIntent: versioningIntentToProto(options.versioningIntent), // eslint-disable-line @typescript-eslint/no-deprecated
206
206
  priority: options.priority ? compilePriority(options.priority) : undefined,
207
207
  },
208
208
  userMetadata: userMetadataToPayload(activator.payloadConverter, options.summary, undefined),
@@ -401,11 +401,11 @@ function startChildWorkflowExecutionNextHandler({
401
401
  parentClosePolicy: encodeParentClosePolicy(options.parentClosePolicy),
402
402
  cronSchedule: options.cronSchedule,
403
403
  searchAttributes:
404
- options.searchAttributes || options.typedSearchAttributes // eslint-disable-line deprecation/deprecation
405
- ? encodeUnifiedSearchAttributes(options.searchAttributes, options.typedSearchAttributes) // eslint-disable-line deprecation/deprecation
404
+ options.searchAttributes || options.typedSearchAttributes // eslint-disable-line @typescript-eslint/no-deprecated
405
+ ? encodeUnifiedSearchAttributes(options.searchAttributes, options.typedSearchAttributes) // eslint-disable-line @typescript-eslint/no-deprecated
406
406
  : undefined,
407
407
  memo: options.memo && mapToPayloads(activator.payloadConverter, options.memo),
408
- versioningIntent: versioningIntentToProto(options.versioningIntent), // eslint-disable-line deprecation/deprecation
408
+ versioningIntent: versioningIntentToProto(options.versioningIntent), // eslint-disable-line @typescript-eslint/no-deprecated
409
409
  priority: options.priority ? compilePriority(options.priority) : undefined,
410
410
  },
411
411
  userMetadata: userMetadataToPayload(activator.payloadConverter, options?.staticSummary, options?.staticDetails),
@@ -1018,12 +1018,12 @@ export function makeContinueAsNewFunc<F extends Workflow>(
1018
1018
  taskQueue: options.taskQueue,
1019
1019
  memo: options.memo && mapToPayloads(activator.payloadConverter, options.memo),
1020
1020
  searchAttributes:
1021
- options.searchAttributes || options.typedSearchAttributes // eslint-disable-line deprecation/deprecation
1022
- ? encodeUnifiedSearchAttributes(options.searchAttributes, options.typedSearchAttributes) // eslint-disable-line deprecation/deprecation
1021
+ options.searchAttributes || options.typedSearchAttributes // eslint-disable-line @typescript-eslint/no-deprecated
1022
+ ? encodeUnifiedSearchAttributes(options.searchAttributes, options.typedSearchAttributes) // eslint-disable-line @typescript-eslint/no-deprecated
1023
1023
  : undefined,
1024
1024
  workflowRunTimeout: msOptionalToTs(options.workflowRunTimeout),
1025
1025
  workflowTaskTimeout: msOptionalToTs(options.workflowTaskTimeout),
1026
- versioningIntent: versioningIntentToProto(options.versioningIntent), // eslint-disable-line deprecation/deprecation
1026
+ versioningIntent: versioningIntentToProto(options.versioningIntent), // eslint-disable-line @typescript-eslint/no-deprecated
1027
1027
  });
1028
1028
  });
1029
1029
  return fn({
@@ -1509,7 +1509,7 @@ export function setDefaultQueryHandler(handler: DefaultQueryHandler | undefined)
1509
1509
  * If using SearchAttributeUpdatePair[] (preferred), set a value to null to remove the search attribute.
1510
1510
  * If using SearchAttributes (deprecated), set a value to undefined or an empty list to remove the search attribute.
1511
1511
  */
1512
- // eslint-disable-next-line deprecation/deprecation
1512
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
1513
1513
  export function upsertSearchAttributes(searchAttributes: SearchAttributes | SearchAttributeUpdatePair[]): void {
1514
1514
  const activator = assertInWorkflowContext(
1515
1515
  'Workflow.upsertSearchAttributes(...) may only be used from a Workflow Execution.'
@@ -1529,7 +1529,7 @@ export function upsertSearchAttributes(searchAttributes: SearchAttributes | Sear
1529
1529
 
1530
1530
  activator.mutateWorkflowInfo((info: WorkflowInfo): WorkflowInfo => {
1531
1531
  // Create a copy of the current state.
1532
- const newSearchAttributes: SearchAttributes = { ...info.searchAttributes }; // eslint-disable-line deprecation/deprecation
1532
+ const newSearchAttributes: SearchAttributes = { ...info.searchAttributes }; // eslint-disable-line @typescript-eslint/no-deprecated
1533
1533
  for (const pair of searchAttributes) {
1534
1534
  if (pair.value == null) {
1535
1535
  // If the value is null, remove the search attribute.
@@ -1538,7 +1538,7 @@ export function upsertSearchAttributes(searchAttributes: SearchAttributes | Sear
1538
1538
  } else {
1539
1539
  newSearchAttributes[pair.key.name] = Array.isArray(pair.value)
1540
1540
  ? pair.value
1541
- : ([pair.value] as SearchAttributeValue); // eslint-disable-line deprecation/deprecation
1541
+ : ([pair.value] as SearchAttributeValue); // eslint-disable-line @typescript-eslint/no-deprecated
1542
1542
  }
1543
1543
  }
1544
1544
  return {
@@ -1559,7 +1559,7 @@ export function upsertSearchAttributes(searchAttributes: SearchAttributes | Sear
1559
1559
  activator.mutateWorkflowInfo((info: WorkflowInfo): WorkflowInfo => {
1560
1560
  // Create a new copy of the current state.
1561
1561
  let typedSearchAttributes = info.typedSearchAttributes.updateCopy([]);
1562
- const newSearchAttributes: SearchAttributes = { ...info.searchAttributes }; // eslint-disable-line deprecation/deprecation
1562
+ const newSearchAttributes: SearchAttributes = { ...info.searchAttributes }; // eslint-disable-line @typescript-eslint/no-deprecated
1563
1563
 
1564
1564
  // Upsert legacy search attributes into typedSearchAttributes.
1565
1565
  for (const [k, v] of Object.entries(searchAttributes)) {