@temporalio/common 1.8.2 → 1.8.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.
package/lib/index.d.ts CHANGED
@@ -16,7 +16,7 @@ export { Headers, Next } from './interceptors';
16
16
  export * from './interfaces';
17
17
  export * from './logger';
18
18
  export * from './retry-policy';
19
- export { type Timestamp, Duration, StringValue } from './time';
19
+ export type { Timestamp, Duration, StringValue } from './time';
20
20
  export * from './workflow-handle';
21
21
  export * from './workflow-options';
22
22
  export * from './versioning-intent';
@@ -0,0 +1,12 @@
1
+ import type { VersioningIntent as VersioningIntentString } from './versioning-intent';
2
+ /**
3
+ * Protobuf enum representation of {@link VersioningIntentString}.
4
+ *
5
+ * @experimental
6
+ */
7
+ export declare enum VersioningIntent {
8
+ UNSPECIFIED = 0,
9
+ COMPATIBLE = 1,
10
+ DEFAULT = 2
11
+ }
12
+ export declare function versioningIntentToProto(intent: VersioningIntentString | undefined): VersioningIntent;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.versioningIntentToProto = exports.VersioningIntent = void 0;
4
+ const type_helpers_1 = require("./type-helpers");
5
+ // Avoid importing the proto implementation to reduce workflow bundle size
6
+ // Copied from coresdk.common.VersioningIntent
7
+ /**
8
+ * Protobuf enum representation of {@link VersioningIntentString}.
9
+ *
10
+ * @experimental
11
+ */
12
+ var VersioningIntent;
13
+ (function (VersioningIntent) {
14
+ VersioningIntent[VersioningIntent["UNSPECIFIED"] = 0] = "UNSPECIFIED";
15
+ VersioningIntent[VersioningIntent["COMPATIBLE"] = 1] = "COMPATIBLE";
16
+ VersioningIntent[VersioningIntent["DEFAULT"] = 2] = "DEFAULT";
17
+ })(VersioningIntent = exports.VersioningIntent || (exports.VersioningIntent = {}));
18
+ (0, type_helpers_1.checkExtends)();
19
+ (0, type_helpers_1.checkExtends)();
20
+ function versioningIntentToProto(intent) {
21
+ switch (intent) {
22
+ case 'DEFAULT':
23
+ return VersioningIntent.DEFAULT;
24
+ case 'COMPATIBLE':
25
+ return VersioningIntent.COMPATIBLE;
26
+ case undefined:
27
+ return VersioningIntent.UNSPECIFIED;
28
+ default:
29
+ (0, type_helpers_1.assertNever)('Unexpected VersioningIntent', intent);
30
+ }
31
+ }
32
+ exports.versioningIntentToProto = versioningIntentToProto;
33
+ //# sourceMappingURL=versioning-intent-enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versioning-intent-enum.js","sourceRoot":"","sources":["../src/versioning-intent-enum.ts"],"names":[],"mappings":";;;AAEA,iDAA2D;AAE3D,0EAA0E;AAC1E,8CAA8C;AAC9C;;;;GAIG;AACH,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,qEAAe,CAAA;IACf,mEAAc,CAAA;IACd,6DAAW,CAAA;AACb,CAAC,EAJW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAI3B;AAED,IAAA,2BAAY,GAAqD,CAAC;AAClE,IAAA,2BAAY,GAAqD,CAAC;AAElE,SAAgB,uBAAuB,CAAC,MAA0C;IAChF,QAAQ,MAAM,EAAE;QACd,KAAK,SAAS;YACZ,OAAO,gBAAgB,CAAC,OAAO,CAAC;QAClC,KAAK,YAAY;YACf,OAAO,gBAAgB,CAAC,UAAU,CAAC;QACrC,KAAK,SAAS;YACZ,OAAO,gBAAgB,CAAC,WAAW,CAAC;QACtC;YACE,IAAA,0BAAW,EAAC,6BAA6B,EAAE,MAAM,CAAC,CAAC;KACtD;AACH,CAAC;AAXD,0DAWC"}
@@ -41,7 +41,7 @@ export interface BaseWorkflowOptions {
41
41
  *
42
42
  * *Note: A Workflow can never be started with a Workflow Id of a Running Workflow.*
43
43
  *
44
- * @default {@link WorkflowIdReusePolicy.WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY}
44
+ * @default {@link WorkflowIdReusePolicy.WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE}
45
45
  */
46
46
  workflowIdReusePolicy?: WorkflowIdReusePolicy;
47
47
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@temporalio/common",
3
- "version": "1.8.2",
3
+ "version": "1.8.3",
4
4
  "description": "Common library for code that's used across the Client, Worker, and/or Workflow",
5
5
  "main": "lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -13,7 +13,7 @@
13
13
  "license": "MIT",
14
14
  "dependencies": {
15
15
  "@opentelemetry/api": "^1.4.1",
16
- "@temporalio/proto": "1.8.2",
16
+ "@temporalio/proto": "1.8.3",
17
17
  "long": "^5.2.0",
18
18
  "ms": "^3.0.0-canary.1",
19
19
  "proto3-json-serializer": "^1.0.3",
@@ -35,5 +35,5 @@
35
35
  "src",
36
36
  "lib"
37
37
  ],
38
- "gitHead": "d85bf54da757741b438f8d39a0e7265b80d4f0d6"
38
+ "gitHead": "7d1c0ec969b897b4f32bd5a8eda9819a03bd2f83"
39
39
  }
package/src/index.ts CHANGED
@@ -20,7 +20,7 @@ export { Headers, Next } from './interceptors';
20
20
  export * from './interfaces';
21
21
  export * from './logger';
22
22
  export * from './retry-policy';
23
- export { type Timestamp, Duration, StringValue } from './time';
23
+ export type { Timestamp, Duration, StringValue } from './time';
24
24
  export * from './workflow-handle';
25
25
  export * from './workflow-options';
26
26
  export * from './versioning-intent';
@@ -0,0 +1,32 @@
1
+ import type { coresdk } from '@temporalio/proto';
2
+ import type { VersioningIntent as VersioningIntentString } from './versioning-intent';
3
+ import { assertNever, checkExtends } from './type-helpers';
4
+
5
+ // Avoid importing the proto implementation to reduce workflow bundle size
6
+ // Copied from coresdk.common.VersioningIntent
7
+ /**
8
+ * Protobuf enum representation of {@link VersioningIntentString}.
9
+ *
10
+ * @experimental
11
+ */
12
+ export enum VersioningIntent {
13
+ UNSPECIFIED = 0,
14
+ COMPATIBLE = 1,
15
+ DEFAULT = 2,
16
+ }
17
+
18
+ checkExtends<coresdk.common.VersioningIntent, VersioningIntent>();
19
+ checkExtends<VersioningIntent, coresdk.common.VersioningIntent>();
20
+
21
+ export function versioningIntentToProto(intent: VersioningIntentString | undefined): VersioningIntent {
22
+ switch (intent) {
23
+ case 'DEFAULT':
24
+ return VersioningIntent.DEFAULT;
25
+ case 'COMPATIBLE':
26
+ return VersioningIntent.COMPATIBLE;
27
+ case undefined:
28
+ return VersioningIntent.UNSPECIFIED;
29
+ default:
30
+ assertNever('Unexpected VersioningIntent', intent);
31
+ }
32
+ }
@@ -52,7 +52,7 @@ export interface BaseWorkflowOptions {
52
52
  *
53
53
  * *Note: A Workflow can never be started with a Workflow Id of a Running Workflow.*
54
54
  *
55
- * @default {@link WorkflowIdReusePolicy.WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY}
55
+ * @default {@link WorkflowIdReusePolicy.WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE}
56
56
  */
57
57
  workflowIdReusePolicy?: WorkflowIdReusePolicy;
58
58