@naturalcycles/js-lib 14.98.1 → 14.98.2

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/dist/index.d.ts CHANGED
@@ -51,7 +51,7 @@ export * from './string/string.util';
51
51
  import { JsonStringifyFunction, StringifyAnyOptions, _stringifyAny } from './string/stringifyAny';
52
52
  export * from './time/time.util';
53
53
  import { Class, ConditionalExcept, ConditionalPick, Merge, Promisable, ReadonlyDeep, Simplify } from './typeFest';
54
- import { AsyncMapper, AsyncPredicate, BaseDBEntity, CreatedUpdated, CreatedUpdatedId, ObjectWithId, AnyObjectWithId, Saved, Unsaved, BatchResult, InstanceId, IsoDate, IsoDateString, IsoDateTimeString, KeyValueTuple, Mapper, ObjectMapper, ObjectPredicate, Predicate, PromiseMap, AnyObject, AnyFunction, Reviver, SavedDBEntity, StringMap, UnixTimestampNumber, UnixTimestamp, Integer, ValueOf, ValuesOf, AbortableMapper, AbortableAsyncPredicate, AbortableAsyncMapper, AbortablePredicate, END, SKIP, _noop, _objectKeys, _passNothingPredicate, _passthroughMapper, _passthroughPredicate, _passUndefinedMapper, _stringMapEntries, _stringMapValues } from './types';
54
+ import { AsyncMapper, AsyncPredicate, BaseDBEntity, CreatedUpdated, CreatedUpdatedId, ObjectWithId, AnyObjectWithId, Saved, Unsaved, UnsavedId, BatchResult, InstanceId, IsoDate, IsoDateString, IsoDateTimeString, KeyValueTuple, Mapper, ObjectMapper, ObjectPredicate, Predicate, PromiseMap, AnyObject, AnyFunction, Reviver, SavedDBEntity, StringMap, UnixTimestampNumber, UnixTimestamp, Integer, ValueOf, ValuesOf, AbortableMapper, AbortableAsyncPredicate, AbortableAsyncMapper, AbortablePredicate, END, SKIP, _noop, _objectKeys, _passNothingPredicate, _passthroughMapper, _passthroughPredicate, _passUndefinedMapper, _stringMapEntries, _stringMapValues } from './types';
55
55
  export * from './unit/size.util';
56
56
  import { is } from './vendor/is';
57
57
  import { CommonLogLevel, CommonLogFunction, CommonLogger, commonLoggerMinLevel, commonLoggerNoop, commonLogLevelNumber, commonLoggerPipe, commonLoggerPrefix, CommonLogWithLevelFunction, commonLoggerCreate } from './log/commonLogger';
@@ -68,5 +68,5 @@ import { LocalDateConfig, LocalDateUnit, Inclusiveness } from './datetime/localD
68
68
  import { LocalTimeConfig, LocalTimeUnit, LocalTimeComponents } from './datetime/localTime';
69
69
  import { DateIntervalConfig, DateIntervalString } from './datetime/dateInterval';
70
70
  import { TimeIntervalConfig, TimeIntervalString } from './datetime/timeInterval';
71
- export type { DateIntervalConfig, DateIntervalString, TimeIntervalConfig, TimeIntervalString, LocalDateConfig, LocalDateUnit, Inclusiveness, LocalTimeConfig, LocalTimeUnit, LocalTimeComponents, AbortableMapper, AbortablePredicate, AbortableAsyncPredicate, AbortableAsyncMapper, PQueueCfg, MemoCache, AsyncMemoCache, PromiseDecoratorCfg, PromiseDecoratorResp, ErrorData, ErrorObject, HttpErrorData, HttpErrorResponse, Admin401ErrorData, Admin403ErrorData, StringMap, PromiseMap, AnyObject, AnyFunction, ValuesOf, ValueOf, KeyValueTuple, ObjectMapper, ObjectPredicate, InstanceId, IsoDate, IsoDateString, IsoDateTimeString, Reviver, PMapOptions, Mapper, AsyncMapper, Predicate, AsyncPredicate, BatchResult, DeferredPromise, PRetryOptions, PTimeoutOptions, TryCatchOptions, StringifyAnyOptions, JsonStringifyFunction, Merge, ReadonlyDeep, Promisable, Simplify, ConditionalPick, ConditionalExcept, Class, UnixTimestampNumber, UnixTimestamp, Integer, BaseDBEntity, SavedDBEntity, Saved, Unsaved, CreatedUpdated, CreatedUpdatedId, ObjectWithId, AnyObjectWithId, JsonSchema, JsonSchemaAny, JsonSchemaOneOf, JsonSchemaAllOf, JsonSchemaAnyOf, JsonSchemaNot, JsonSchemaRef, JsonSchemaConst, JsonSchemaEnum, JsonSchemaString, JsonSchemaNumber, JsonSchemaBoolean, JsonSchemaNull, JsonSchemaRootObject, JsonSchemaObject, JsonSchemaArray, JsonSchemaTuple, JsonSchemaBuilder, CommonLogLevel, CommonLogWithLevelFunction, CommonLogFunction, CommonLogger, };
71
+ export type { DateIntervalConfig, DateIntervalString, TimeIntervalConfig, TimeIntervalString, LocalDateConfig, LocalDateUnit, Inclusiveness, LocalTimeConfig, LocalTimeUnit, LocalTimeComponents, AbortableMapper, AbortablePredicate, AbortableAsyncPredicate, AbortableAsyncMapper, PQueueCfg, MemoCache, AsyncMemoCache, PromiseDecoratorCfg, PromiseDecoratorResp, ErrorData, ErrorObject, HttpErrorData, HttpErrorResponse, Admin401ErrorData, Admin403ErrorData, StringMap, PromiseMap, AnyObject, AnyFunction, ValuesOf, ValueOf, KeyValueTuple, ObjectMapper, ObjectPredicate, InstanceId, IsoDate, IsoDateString, IsoDateTimeString, Reviver, PMapOptions, Mapper, AsyncMapper, Predicate, AsyncPredicate, BatchResult, DeferredPromise, PRetryOptions, PTimeoutOptions, TryCatchOptions, StringifyAnyOptions, JsonStringifyFunction, Merge, ReadonlyDeep, Promisable, Simplify, ConditionalPick, ConditionalExcept, Class, UnixTimestampNumber, UnixTimestamp, Integer, BaseDBEntity, SavedDBEntity, Saved, Unsaved, UnsavedId, CreatedUpdated, CreatedUpdatedId, ObjectWithId, AnyObjectWithId, JsonSchema, JsonSchemaAny, JsonSchemaOneOf, JsonSchemaAllOf, JsonSchemaAnyOf, JsonSchemaNot, JsonSchemaRef, JsonSchemaConst, JsonSchemaEnum, JsonSchemaString, JsonSchemaNumber, JsonSchemaBoolean, JsonSchemaNull, JsonSchemaRootObject, JsonSchemaObject, JsonSchemaArray, JsonSchemaTuple, JsonSchemaBuilder, CommonLogLevel, CommonLogWithLevelFunction, CommonLogFunction, CommonLogger, };
72
72
  export { is, _createPromiseDecorator, _stringMapValues, _stringMapEntries, _objectKeys, pMap, _passthroughMapper, _passUndefinedMapper, _passthroughPredicate, _passNothingPredicate, _noop, ErrorMode, pDefer, AggregatedError, pRetry, pRetryFn, pTimeout, pTimeoutFn, _tryCatch, _TryCatch, _stringifyAny, jsonSchema, JsonSchemaAnyBuilder, commonLoggerMinLevel, commonLoggerNoop, commonLogLevelNumber, commonLoggerPipe, commonLoggerPrefix, commonLoggerCreate, PQueue, END, SKIP, };
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Merge, Promisable } from './typeFest';
1
+ import { Except, Merge, Promisable } from './typeFest';
2
2
  /**
3
3
  * Map from String to String (or <T>).
4
4
  *
@@ -54,7 +54,10 @@ export interface SavedDBEntity<ID extends string | number = string> {
54
54
  */
55
55
  export declare type BaseDBEntity<ID extends string | number = string> = Partial<SavedDBEntity<ID>>;
56
56
  export declare type Saved<T extends Partial<ObjectWithId>> = Merge<T, SavedDBEntity<Exclude<T['id'], undefined>>>;
57
- export declare type Unsaved<T extends ObjectWithId> = Merge<T, BaseDBEntity<T['id']>>;
57
+ export declare type Unsaved<T extends Partial<ObjectWithId>> = Merge<T, BaseDBEntity<Exclude<T['id'], undefined>>>;
58
+ export declare type UnsavedId<T extends Partial<ObjectWithId>> = Except<T, 'id'> & {
59
+ id: Exclude<T['id'], undefined>;
60
+ };
58
61
  /**
59
62
  * Convenience type shorthand.
60
63
  * Because `Function` type is discouraged by eslint.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/js-lib",
3
- "version": "14.98.1",
3
+ "version": "14.98.2",
4
4
  "scripts": {
5
5
  "prepare": "husky install",
6
6
  "build-prod": "build-prod-esm-cjs",
package/src/index.ts CHANGED
@@ -102,6 +102,7 @@ import {
102
102
  AnyObjectWithId,
103
103
  Saved,
104
104
  Unsaved,
105
+ UnsavedId,
105
106
  BatchResult,
106
107
  InstanceId,
107
108
  IsoDate,
@@ -232,6 +233,7 @@ export type {
232
233
  SavedDBEntity,
233
234
  Saved,
234
235
  Unsaved,
236
+ UnsavedId,
235
237
  CreatedUpdated,
236
238
  CreatedUpdatedId,
237
239
  ObjectWithId,
package/src/types.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Merge, Promisable } from './typeFest'
1
+ import { Except, Merge, Promisable } from './typeFest'
2
2
 
3
3
  /**
4
4
  * Map from String to String (or <T>).
@@ -72,7 +72,14 @@ export type Saved<T extends Partial<ObjectWithId>> = Merge<
72
72
  SavedDBEntity<Exclude<T['id'], undefined>>
73
73
  >
74
74
 
75
- export type Unsaved<T extends ObjectWithId> = Merge<T, BaseDBEntity<T['id']>>
75
+ export type Unsaved<T extends Partial<ObjectWithId>> = Merge<
76
+ T,
77
+ BaseDBEntity<Exclude<T['id'], undefined>>
78
+ >
79
+
80
+ export type UnsavedId<T extends Partial<ObjectWithId>> = Except<T, 'id'> & {
81
+ id: Exclude<T['id'], undefined>
82
+ }
76
83
 
77
84
  /**
78
85
  * Convenience type shorthand.