@art-ws/common 2.0.8 → 2.0.10

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.
@@ -1,4 +1,4 @@
1
- import type { ICancellationToken, ICancellationTokenSource, OnCancelCallback } from "./interfaces";
1
+ import type { ICancellationToken, ICancellationTokenSource, OnCancelCallback } from "./interfaces.js";
2
2
  export declare class CancellationTokenSource implements ICancellationTokenSource {
3
3
  private _token;
4
4
  isCancellationRequested: boolean;
@@ -1,5 +1,5 @@
1
1
  import { EventEmitter } from "events";
2
- import { CancellationToken } from "./cancellation-token";
2
+ import { CancellationToken } from "./cancellation-token.js";
3
3
  const ON_CANCEL = "ON_CANCEL";
4
4
  export class CancellationTokenSource {
5
5
  _token = null;
@@ -1,4 +1,4 @@
1
- import type { ICancellationToken, ICancellationTokenSource, OnCancelCallback } from "./interfaces";
1
+ import type { ICancellationToken, ICancellationTokenSource, OnCancelCallback } from "./interfaces.js";
2
2
  export declare class CancellationToken implements ICancellationToken {
3
3
  private readonly source;
4
4
  constructor(source: ICancellationTokenSource);
@@ -1,4 +1,4 @@
1
- import { ErrorCancelled } from "./interfaces";
1
+ import { ErrorCancelled } from "./interfaces.js";
2
2
  export class CancellationToken {
3
3
  source;
4
4
  constructor(source) {
@@ -1,3 +1,3 @@
1
- export * from "./cancellation-token-source";
2
- export * from "./cancellation-token";
3
- export * from "./interfaces";
1
+ export * from "./cancellation-token-source.js";
2
+ export * from "./cancellation-token.js";
3
+ export * from "./interfaces.js";
@@ -1,4 +1,4 @@
1
1
  // created from 'create-ts-index'
2
- export * from "./cancellation-token-source";
3
- export * from "./cancellation-token";
4
- export * from "./interfaces";
2
+ export * from "./cancellation-token-source.js";
3
+ export * from "./cancellation-token.js";
4
+ export * from "./interfaces.js";
@@ -1,4 +1,4 @@
1
- import type { HeartBeat } from "./heart-beat.types";
1
+ import type { HeartBeat } from "./heart-beat.types.js";
2
2
  export declare class HeartBeatBase implements HeartBeat.IHeartBeat {
3
3
  logger: import("@art-ws/slf").Logger;
4
4
  private id;
@@ -1,2 +1,2 @@
1
- export * from "./heart-beat.class";
2
- export * from "./heart-beat.types";
1
+ export * from "./heart-beat.class.js";
2
+ export * from "./heart-beat.types.js";
@@ -1,3 +1,3 @@
1
1
  // created from 'create-ts-index'
2
- export * from "./heart-beat.class";
3
- export * from "./heart-beat.types";
2
+ export * from "./heart-beat.class.js";
3
+ export * from "./heart-beat.types.js";
@@ -1,11 +1,11 @@
1
- export * from "./cancellation";
2
- export * from "./heart-beat";
3
- export * from "./hr-time";
4
- export * from "./interpolate";
5
- export * from "./json-file-loader";
6
- export * from "./json-refs-resolver";
7
- export * from "./managed-pool";
8
- export * from "./managed-promise";
9
- export * from "./mem-cache";
10
- export * from "./object-hash";
11
- export * from "./shared";
1
+ export * from "./cancellation/index.js";
2
+ export * from "./heart-beat/index.js";
3
+ export * from "./hr-time.js";
4
+ export * from "./interpolate.js";
5
+ export * from "./json-file-loader.js";
6
+ export * from "./json-refs-resolver.js";
7
+ export * from "./managed-pool/index.js";
8
+ export * from "./managed-promise.js";
9
+ export * from "./mem-cache/index.js";
10
+ export * from "./object-hash/index.js";
11
+ export * from "./shared/index.js";
package/dist/es/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  // created from 'create-ts-index'
2
- export * from "./cancellation";
3
- export * from "./heart-beat";
4
- export * from "./hr-time";
5
- export * from "./interpolate";
6
- export * from "./json-file-loader";
7
- export * from "./json-refs-resolver";
8
- export * from "./managed-pool";
9
- export * from "./managed-promise";
10
- export * from "./mem-cache";
11
- export * from "./object-hash";
12
- export * from "./shared";
2
+ export * from "./cancellation/index.js";
3
+ export * from "./heart-beat/index.js";
4
+ export * from "./hr-time.js";
5
+ export * from "./interpolate.js";
6
+ export * from "./json-file-loader.js";
7
+ export * from "./json-refs-resolver.js";
8
+ export * from "./managed-pool/index.js";
9
+ export * from "./managed-promise.js";
10
+ export * from "./mem-cache/index.js";
11
+ export * from "./object-hash/index.js";
12
+ export * from "./shared/index.js";
@@ -1,5 +1,5 @@
1
- import type { ResolveVarFunction } from "./interpolate";
2
- import type { DeReferenceOptions } from "./json-refs-resolver";
1
+ import type { ResolveVarFunction } from "./interpolate.js";
2
+ import type { DeReferenceOptions } from "./json-refs-resolver.js";
3
3
  export declare const YAML_EXT: string[];
4
4
  export declare const JSON_EXT: string[];
5
5
  export declare const JS_EXT: string[];
@@ -15,6 +15,8 @@ export declare function lookupAndLoadJsonableFile<T>(cwd: string, candidates: st
15
15
  data: T;
16
16
  }>;
17
17
  export interface JsonableDataDeReferenceOptions extends DeReferenceOptions {
18
+ data: Record<string, any>;
19
+ baseUrl: string;
18
20
  resolveVar?: ResolveVarFunction;
19
21
  }
20
22
  export declare function resolveJsonableData<T>(args: JsonableDataDeReferenceOptions): Promise<T>;
@@ -3,8 +3,8 @@ import yaml from "js-yaml";
3
3
  import JSON5 from "json5";
4
4
  import _ from "lodash";
5
5
  import path from "path";
6
- import { iterpolateObjectAsync } from "./interpolate";
7
- import { resolveJsonRefs } from "./json-refs-resolver";
6
+ import { iterpolateObjectAsync } from "./interpolate.js";
7
+ import { resolveJsonRefs } from "./json-refs-resolver.js";
8
8
  export const YAML_EXT = ["yaml", "yml"];
9
9
  export const JSON_EXT = ["json", "json5"];
10
10
  export const JS_EXT = ["js"];
@@ -43,7 +43,7 @@ export async function doDereference(args) {
43
43
  const { data, baseUrl = "" } = args;
44
44
  if ((baseUrl && SUPPORTED_EXTENSIONS.find((x) => baseUrl.includes(x))) ||
45
45
  baseUrl === "") {
46
- const rp = new $RefParser();
46
+ const rp = $RefParser;
47
47
  if (data) {
48
48
  return await rp.dereference(baseUrl, data, {});
49
49
  }
@@ -1 +1 @@
1
- export * from "./managed-pool";
1
+ export * from "./managed-pool.js";
@@ -1,2 +1,2 @@
1
1
  // created from 'create-ts-index'
2
- export * from "./managed-pool";
2
+ export * from "./managed-pool.js";
@@ -1,4 +1,4 @@
1
- import { MemoryCacheBase } from "../mem-cache";
1
+ import { MemoryCacheBase } from "../mem-cache/index.js";
2
2
  export interface IManagedPoolAdapter<T, A, C> {
3
3
  create: (args: A) => Promise<T>;
4
4
  canDestroy: (item: T) => boolean;
@@ -1,4 +1,4 @@
1
- import { MemoryCacheBase } from "../mem-cache";
1
+ import { MemoryCacheBase } from "../mem-cache/index.js";
2
2
  import { getLogger } from "@art-ws/slf";
3
3
  export const DEFAULT_TIME_TO_IDLE = 2 * 60 * 1000;
4
4
  export class ManagedPool {
@@ -1,2 +1,2 @@
1
- export * from "./cache-stat";
2
- export * from "./memory-cache";
1
+ export * from "./cache-stat.js";
2
+ export * from "./memory-cache.js";
@@ -1,3 +1,3 @@
1
1
  // created from 'create-ts-index'
2
- export * from "./cache-stat";
3
- export * from "./memory-cache";
2
+ export * from "./cache-stat.js";
3
+ export * from "./memory-cache.js";
@@ -1,5 +1,5 @@
1
- import type { HeartBeat } from "../heart-beat";
2
- import { CacheStat } from "./cache-stat";
1
+ import type { HeartBeat } from "../heart-beat/index.js";
2
+ import { CacheStat } from "./cache-stat.js";
3
3
  export type CacheCanRemoveCallback = (value?: unknown, key?: string) => boolean;
4
4
  export type CacheOnRemoveCallback = (value?: unknown, key?: string) => void;
5
5
  export interface CacheItemOptions {
@@ -1,6 +1,6 @@
1
1
  import { getLogger } from "@art-ws/slf";
2
- import { synchronized } from "../shared/promise-race";
3
- import { CacheStat } from "./cache-stat";
2
+ import { synchronized } from "../shared/promise-race.js";
3
+ import { CacheStat } from "./cache-stat.js";
4
4
  function now() {
5
5
  return new Date().valueOf();
6
6
  }
@@ -1 +1 @@
1
- export * from "./object-hash";
1
+ export * from "./object-hash.js";
@@ -1,2 +1,2 @@
1
1
  // created from 'create-ts-index'
2
- export * from "./object-hash";
2
+ export * from "./object-hash.js";
@@ -1,5 +1,5 @@
1
1
  import "reflect-metadata";
2
- import type { IApiClientRequestOptions as RequestOptions, TApiClientConstructor } from "./api-client.interface";
2
+ import type { IApiClientRequestOptions as RequestOptions, TApiClientConstructor } from "./api-client.interface.js";
3
3
  export declare function ApiGet(url?: string, options?: Partial<RequestOptions>): (target: any, property: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
4
4
  export declare function ApiPost(url?: string, options?: Partial<RequestOptions>): (target: any, property: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
5
5
  export declare function ApiPut(url?: string, options?: Partial<RequestOptions>): (target: any, property: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
@@ -1,5 +1,5 @@
1
1
  import "reflect-metadata";
2
- import { makeUrl } from "./make-url";
2
+ import { makeUrl } from "./make-url.js";
3
3
  function getDecorator(method, url, options) {
4
4
  return function (target, property, descriptor) {
5
5
  if (descriptor === undefined) {
@@ -1,2 +1,2 @@
1
- export * from "./api-client.interface";
2
- export * from "./decorators";
1
+ export * from "./api-client.interface.js";
2
+ export * from "./decorators.js";
@@ -1,3 +1,3 @@
1
1
  // created from 'create-ts-index'
2
- export * from "./api-client.interface";
3
- export * from "./decorators";
2
+ export * from "./api-client.interface.js";
3
+ export * from "./decorators.js";
@@ -1,8 +1,8 @@
1
- export * from "./api-client";
2
- export * from "./assert-dsl";
3
- export * from "./await-if-async";
4
- export * from "./disposable";
5
- export * from "./optional";
6
- export * from "./promise-race";
7
- export * from "./runnable";
8
- export * from "./safe-call";
1
+ export * from "./api-client/index.js";
2
+ export * from "./assert-dsl.js";
3
+ export * from "./await-if-async.js";
4
+ export * from "./disposable.js";
5
+ export * from "./optional.js";
6
+ export * from "./promise-race.js";
7
+ export * from "./runnable.js";
8
+ export * from "./safe-call.js";
@@ -1,9 +1,9 @@
1
1
  // created from 'create-ts-index'
2
- export * from "./api-client";
3
- export * from "./assert-dsl";
4
- export * from "./await-if-async";
5
- export * from "./disposable";
6
- export * from "./optional";
7
- export * from "./promise-race";
8
- export * from "./runnable";
9
- export * from "./safe-call";
2
+ export * from "./api-client/index.js";
3
+ export * from "./assert-dsl.js";
4
+ export * from "./await-if-async.js";
5
+ export * from "./disposable.js";
6
+ export * from "./optional.js";
7
+ export * from "./promise-race.js";
8
+ export * from "./runnable.js";
9
+ export * from "./safe-call.js";
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@art-ws/common",
3
- "version": "2.0.8",
3
+ "version": "2.0.10",
4
4
  "description": "common",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
7
- "main": "dist/index.js",
8
- "types": "dist/es",
7
+ "main": "dist/es/index.js",
8
+ "types": "dist/es/index.d.ts",
9
9
  "files": [
10
10
  "dist"
11
11
  ],
@@ -20,7 +20,7 @@
20
20
  "reflect-metadata": "^0.2.2",
21
21
  "rxjs": "^7.8.2",
22
22
  "tslib": "^2.8.1",
23
- "@art-ws/slf": "2.0.2"
23
+ "@art-ws/slf": "2.0.4"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/bluebird": "^3.5.42",