@temporalio/testing 1.3.0 → 1.3.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@temporalio/testing",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Temporal.io SDK Testing sub-package",
5
5
  "main": "lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -13,10 +13,10 @@
13
13
  "license": "MIT",
14
14
  "dependencies": {
15
15
  "@grpc/grpc-js": "^1.6.7",
16
- "@temporalio/activity": "^1.3.0",
17
- "@temporalio/client": "^1.3.0",
18
- "@temporalio/common": "^1.3.0",
19
- "@temporalio/worker": "^1.3.0",
16
+ "@temporalio/activity": "~1.3.1",
17
+ "@temporalio/client": "~1.3.1",
18
+ "@temporalio/common": "~1.3.1",
19
+ "@temporalio/worker": "~1.3.1",
20
20
  "abort-controller": "^3.0.0",
21
21
  "ms": "^2.1.3"
22
22
  },
@@ -31,5 +31,5 @@
31
31
  "publishConfig": {
32
32
  "access": "public"
33
33
  },
34
- "gitHead": "966d51d3545a5e84102190f5b762160b9dfe99c2"
34
+ "gitHead": "b85b35aed41932dbfb9e158a1c35943c072f95a8"
35
35
  }
@@ -1,16 +0,0 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- import { ChildProcess } from 'child_process';
4
- export declare class ChildProcessError extends Error {
5
- readonly code: number | null;
6
- readonly signal: NodeJS.Signals | null;
7
- readonly name = "ChildProcessError";
8
- constructor(message: string, code: number | null, signal: NodeJS.Signals | null);
9
- }
10
- export interface WaitOptions {
11
- validReturnCodes: number[];
12
- }
13
- export declare function waitOnChild(child: ChildProcess, opts?: WaitOptions): Promise<void>;
14
- export declare function kill(child: ChildProcess, signal?: NodeJS.Signals, opts?: WaitOptions): Promise<void>;
15
- export declare function killIfExists(child: ChildProcess, signal?: NodeJS.Signals, opts?: WaitOptions): Promise<void>;
16
- export declare const shell: boolean;
@@ -1,57 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.shell = exports.killIfExists = exports.kill = exports.waitOnChild = exports.ChildProcessError = void 0;
4
- class ChildProcessError extends Error {
5
- constructor(message, code, signal) {
6
- super(message);
7
- this.code = code;
8
- this.signal = signal;
9
- this.name = 'ChildProcessError';
10
- }
11
- }
12
- exports.ChildProcessError = ChildProcessError;
13
- async function waitOnChild(child, opts) {
14
- return new Promise((resolve, reject) => {
15
- child.on('exit', (code, signal) => {
16
- if (code !== null && (opts?.validReturnCodes ?? [0]).includes(code)) {
17
- resolve();
18
- }
19
- else {
20
- reject(new ChildProcessError('Process failed', code, signal));
21
- }
22
- });
23
- child.on('error', reject);
24
- });
25
- }
26
- exports.waitOnChild = waitOnChild;
27
- async function kill(child, signal = 'SIGINT', opts) {
28
- if (child.pid === undefined) {
29
- throw new TypeError('Expected child with pid');
30
- }
31
- process.kill(child.pid, signal);
32
- try {
33
- await waitOnChild(child, opts);
34
- }
35
- catch (err) {
36
- // Should error if the error is not a child process error or it is a child
37
- // process and either the platform is Windows or the signal matches.
38
- const shouldError = !(err instanceof ChildProcessError) || (process.platform !== 'win32' && err.signal !== signal);
39
- if (shouldError) {
40
- throw err;
41
- }
42
- }
43
- }
44
- exports.kill = kill;
45
- async function killIfExists(child, signal = 'SIGINT', opts) {
46
- try {
47
- await kill(child, signal, opts);
48
- }
49
- catch (err) {
50
- if (err.code !== 'ESRCH') {
51
- throw err;
52
- }
53
- }
54
- }
55
- exports.killIfExists = killIfExists;
56
- exports.shell = process.platform === 'win32';
57
- //# sourceMappingURL=child-process.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"child-process.js","sourceRoot":"","sources":["../src/child-process.ts"],"names":[],"mappings":";;;AAGA,MAAa,iBAAkB,SAAQ,KAAK;IAG1C,YAAY,OAAe,EAAkB,IAAmB,EAAkB,MAA6B;QAC7G,KAAK,CAAC,OAAO,CAAC,CAAC;QAD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AC,CAAC;QACnH,IAAI,WAAW,EAAE;YACf,MAAM,GAAG,CAAC;SACX;KACF;AACH,CAAC;AAfD,oBAeC;AAEM,KAAK,UAAU,YAAY,CAChC,KAAmB,EACnB,SAAyB,QAAQ,EACjC,IAAkB;IAElB,IAAI;QACF,MAAM,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;KACjC;IAAC,OAAO,GAAQ,EAAE;QACjB,IAAI,GAAG,CAAC,IAAI,KAAK,OAAO,EAAE;YACxB,MAAM,GAAG,CAAC;SACX;KACF;AACH,CAAC;AAZD,oCAYC;AAEY,QAAA,KAAK,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC"}
@@ -1 +0,0 @@
1
- export * as testing from './index';
@@ -1,29 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.testing = void 0;
27
- // Reexports the contents of this package under the "testing" namespace for better docs generation
28
- exports.testing = __importStar(require("./index"));
29
- //# sourceMappingURL=index-for-docs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-for-docs.js","sourceRoot":"","sources":["../src/index-for-docs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kGAAkG;AAClG,mDAAmC"}
@@ -1,21 +0,0 @@
1
- import * as grpc from '@grpc/grpc-js';
2
- import { Connection as BaseConnection, ConnectionOptions } from '@temporalio/client';
3
- import { ConnectionCtorOptions as BaseConnectionCtorOptions } from '@temporalio/client/lib/connection';
4
- import { temporal } from '../generated-protos';
5
- export declare type TestService = temporal.api.testservice.v1.TestService;
6
- export declare const TestService: typeof temporal.api.testservice.v1.TestService;
7
- interface ConnectionCtorOptions extends BaseConnectionCtorOptions {
8
- testService: TestService;
9
- }
10
- /**
11
- * A Connection class that can be used to interact with both the test server's TestService and WorkflowService
12
- */
13
- export declare class Connection extends BaseConnection {
14
- static readonly TestServiceClient: grpc.ServiceClientConstructor;
15
- readonly testService: TestService;
16
- protected static createCtorOptions(options?: ConnectionOptions): ConnectionCtorOptions;
17
- static lazy(options?: ConnectionOptions): Connection;
18
- static connect(options?: ConnectionOptions): Promise<Connection>;
19
- protected constructor(options: ConnectionCtorOptions);
20
- }
21
- export {};
@@ -1,62 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.Connection = exports.TestService = void 0;
27
- const grpc = __importStar(require("@grpc/grpc-js"));
28
- const client_1 = require("@temporalio/client");
29
- const generated_protos_1 = require("../generated-protos");
30
- exports.TestService = generated_protos_1.temporal.api.testservice.v1.TestService;
31
- /**
32
- * A Connection class that can be used to interact with both the test server's TestService and WorkflowService
33
- */
34
- class Connection extends client_1.Connection {
35
- constructor(options) {
36
- super(options);
37
- this.testService = options.testService;
38
- }
39
- static createCtorOptions(options) {
40
- const ctorOptions = client_1.Connection.createCtorOptions(options);
41
- const rpcImpl = this.generateRPCImplementation({
42
- serviceName: 'temporal.api.testservice.v1.TestService',
43
- client: ctorOptions.client,
44
- callContextStorage: ctorOptions.callContextStorage,
45
- interceptors: ctorOptions.options.interceptors,
46
- });
47
- const testService = exports.TestService.create(rpcImpl, false, false);
48
- return { ...ctorOptions, testService };
49
- }
50
- static lazy(options) {
51
- const ctorOptions = this.createCtorOptions(options);
52
- return new this(ctorOptions);
53
- }
54
- static async connect(options) {
55
- const ret = this.lazy(options);
56
- await ret.ensureConnected();
57
- return ret;
58
- }
59
- }
60
- exports.Connection = Connection;
61
- Connection.TestServiceClient = grpc.makeGenericClientConstructor({}, 'TestService', {});
62
- //# sourceMappingURL=test-service-client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test-service-client.js","sourceRoot":"","sources":["../src/test-service-client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AACtC,+CAAqF;AAErF,0DAA+C;AAGhC,mBAAW,GAAK,2BAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,aAAC;AAM3D;;GAEG;AACH,MAAa,UAAW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