Socket
Socket
Sign inDemoInstall

@temporalio/common

Package Overview
Dependencies
Maintainers
8
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@temporalio/common - npm Package Compare versions

Comparing version 1.9.3 to 1.10.0

lib/internal-non-workflow/parse-host-uri.d.ts

32

lib/internal-non-workflow/data-converter-helpers.js

@@ -8,8 +8,18 @@ "use strict";

const errors_1 = require("../errors");
const isValidPayloadConverter = (converter) => typeof converter === 'object' &&
converter !== null &&
['toPayload', 'fromPayload'].every((method) => typeof converter[method] === 'function');
const isValidFailureConverter = (converter) => typeof converter === 'object' &&
converter !== null &&
['errorToFailure', 'failureToError'].every((method) => typeof converter[method] === 'function');
const isValidPayloadConverter = (converter, path) => {
const isValid = typeof converter === 'object' &&
converter !== null &&
['toPayload', 'fromPayload'].every((method) => typeof converter[method] === 'function');
if (!isValid) {
throw new errors_1.ValueError(`payloadConverter export at ${path} must be an object with toPayload and fromPayload methods`);
}
};
const isValidFailureConverter = (converter, path) => {
const isValid = typeof converter === 'object' &&
converter !== null &&
['errorToFailure', 'failureToError'].every((method) => typeof converter[method] === 'function');
if (!isValid) {
throw new errors_1.ValueError(`failureConverter export at ${path} must be an object with errorToFailure and failureToError methods`);
}
};
function requireConverter(path, type, validator) {

@@ -28,11 +38,7 @@ let module;

const converter = module[type];
if (validator(converter)) {
return converter;
}
else {
throw new errors_1.ValueError(`payloadConverter export at ${path} must be an object with toPayload and fromPayload methods`);
}
validator(converter, path);
return converter;
}
else {
throw new errors_1.ValueError(`Module ${path} does not have a \`payloadConverter\` named export`);
throw new errors_1.ValueError(`Module ${path} does not have a \`${type}\` named export`);
}

@@ -39,0 +45,0 @@ }

@@ -9,3 +9,5 @@ /**

export * from './data-converter-helpers';
export * from './parse-host-uri';
export * from './proxy-config';
export * from './tls-config';
export * from './utils';

@@ -25,4 +25,6 @@ "use strict";

__exportStar(require("./data-converter-helpers"), exports);
__exportStar(require("./parse-host-uri"), exports);
__exportStar(require("./proxy-config"), exports);
__exportStar(require("./tls-config"), exports);
__exportStar(require("./utils"), exports);
//# sourceMappingURL=index.js.map

@@ -14,1 +14,37 @@ export type LogLevel = 'TRACE' | 'DEBUG' | 'INFO' | 'WARN' | 'ERROR';

}
/**
* Possible values of the `sdkComponent` meta attributes on log messages. This
* attribute indicates which subsystem emitted the log message; this may for
* example be used to implement fine-grained filtering of log messages.
*
* Note that there is no guarantee that this list will remain stable in the
* future; values may be added or removed, and messages that are currently
* emitted with some `sdkComponent` value may use a different value in the future.
*/
export declare enum SdkComponent {
/**
* Component name for messages emited from Workflow code, using the {@link Workflow context logger|workflow.log}.
* The SDK itself never publishes messages with this component name.
*/
workflow = "workflow",
/**
* Component name for messages emited from an activity, using the {@link activity context logger|Context.log}.
* The SDK itself never publishes messages with this component name.
*/
activity = "activity",
/**
* Component name for messages emited from a Temporal Worker instance.
*
* This notably includes:
* - Issues with Worker or runtime configuration, or the JS execution environment;
* - Worker's, Activity's, and Workflow's lifecycle events;
* - Workflow Activation and Activity Task processing events;
* - Workflow bundling messages;
* - Sink processing issues.
*/
worker = "worker",
/**
* Component name for all messages emitted by the Rust Core SDK library.
*/
core = "core"
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SdkComponent = void 0;
/**
* Possible values of the `sdkComponent` meta attributes on log messages. This
* attribute indicates which subsystem emitted the log message; this may for
* example be used to implement fine-grained filtering of log messages.
*
* Note that there is no guarantee that this list will remain stable in the
* future; values may be added or removed, and messages that are currently
* emitted with some `sdkComponent` value may use a different value in the future.
*/
var SdkComponent;
(function (SdkComponent) {
/**
* Component name for messages emited from Workflow code, using the {@link Workflow context logger|workflow.log}.
* The SDK itself never publishes messages with this component name.
*/
SdkComponent["workflow"] = "workflow";
/**
* Component name for messages emited from an activity, using the {@link activity context logger|Context.log}.
* The SDK itself never publishes messages with this component name.
*/
SdkComponent["activity"] = "activity";
/**
* Component name for messages emited from a Temporal Worker instance.
*
* This notably includes:
* - Issues with Worker or runtime configuration, or the JS execution environment;
* - Worker's, Activity's, and Workflow's lifecycle events;
* - Workflow Activation and Activity Task processing events;
* - Workflow bundling messages;
* - Sink processing issues.
*/
SdkComponent["worker"] = "worker";
/**
* Component name for all messages emitted by the Rust Core SDK library.
*/
SdkComponent["core"] = "core";
})(SdkComponent || (exports.SdkComponent = SdkComponent = {}));
//# sourceMappingURL=logger.js.map
{
"name": "@temporalio/common",
"version": "1.9.3",
"version": "1.10.0",
"description": "Common library for code that's used across the Client, Worker, and/or Workflow",

@@ -15,3 +15,3 @@ "main": "lib/index.js",

"dependencies": {
"@temporalio/proto": "1.9.3",
"@temporalio/proto": "1.10.0",
"long": "^5.2.3",

@@ -40,3 +40,3 @@ "ms": "^3.0.0-canary.1",

],
"gitHead": "e7e46639c1ba23b86f367a051fb54d736c5f21ce"
"gitHead": "39d702af7ae5d7e33ee90651292aa77fa07d33ca"
}

@@ -7,15 +7,33 @@ import { PayloadConverter, defaultPayloadConverter } from '../converter/payload-converter';

const isValidPayloadConverter = (converter: unknown): converter is PayloadConverter =>
typeof converter === 'object' &&
converter !== null &&
['toPayload', 'fromPayload'].every((method) => typeof (converter as Record<string, unknown>)[method] === 'function');
const isValidPayloadConverter = (converter: unknown, path: string): asserts converter is PayloadConverter => {
const isValid =
typeof converter === 'object' &&
converter !== null &&
['toPayload', 'fromPayload'].every(
(method) => typeof (converter as Record<string, unknown>)[method] === 'function'
);
if (!isValid) {
throw new ValueError(`payloadConverter export at ${path} must be an object with toPayload and fromPayload methods`);
}
};
const isValidFailureConverter = (converter: unknown): converter is FailureConverter =>
typeof converter === 'object' &&
converter !== null &&
['errorToFailure', 'failureToError'].every(
(method) => typeof (converter as Record<string, unknown>)[method] === 'function'
);
const isValidFailureConverter = (converter: unknown, path: string): asserts converter is FailureConverter => {
const isValid =
typeof converter === 'object' &&
converter !== null &&
['errorToFailure', 'failureToError'].every(
(method) => typeof (converter as Record<string, unknown>)[method] === 'function'
);
if (!isValid) {
throw new ValueError(
`failureConverter export at ${path} must be an object with errorToFailure and failureToError methods`
);
}
};
function requireConverter<T>(path: string, type: string, validator: (converter: unknown) => converter is T): T {
function requireConverter<T>(
path: string,
type: string,
validator: (converter: unknown, path: string) => asserts converter is T
): T {
let module;

@@ -33,11 +51,6 @@ try {

const converter = module[type];
if (validator(converter)) {
return converter;
} else {
throw new ValueError(
`payloadConverter export at ${path} must be an object with toPayload and fromPayload methods`
);
}
validator(converter, path);
return converter;
} else {
throw new ValueError(`Module ${path} does not have a \`payloadConverter\` named export`);
throw new ValueError(`Module ${path} does not have a \`${type}\` named export`);
}

@@ -44,0 +57,0 @@ }

@@ -9,3 +9,5 @@ /**

export * from './data-converter-helpers';
export * from './parse-host-uri';
export * from './proxy-config';
export * from './tls-config';
export * from './utils';

@@ -16,1 +16,41 @@ export type LogLevel = 'TRACE' | 'DEBUG' | 'INFO' | 'WARN' | 'ERROR';

}
/**
* Possible values of the `sdkComponent` meta attributes on log messages. This
* attribute indicates which subsystem emitted the log message; this may for
* example be used to implement fine-grained filtering of log messages.
*
* Note that there is no guarantee that this list will remain stable in the
* future; values may be added or removed, and messages that are currently
* emitted with some `sdkComponent` value may use a different value in the future.
*/
export enum SdkComponent {
/**
* Component name for messages emited from Workflow code, using the {@link Workflow context logger|workflow.log}.
* The SDK itself never publishes messages with this component name.
*/
workflow = 'workflow',
/**
* Component name for messages emited from an activity, using the {@link activity context logger|Context.log}.
* The SDK itself never publishes messages with this component name.
*/
activity = 'activity',
/**
* Component name for messages emited from a Temporal Worker instance.
*
* This notably includes:
* - Issues with Worker or runtime configuration, or the JS execution environment;
* - Worker's, Activity's, and Workflow's lifecycle events;
* - Workflow Activation and Activity Task processing events;
* - Workflow bundling messages;
* - Sink processing issues.
*/
worker = 'worker',
/**
* Component name for all messages emitted by the Rust Core SDK library.
*/
core = 'core',
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc