@actdim/utico 1.1.3 → 1.1.5
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/README.md +476 -63
- package/dist/cache/memoryCache.d.ts +2 -3
- package/dist/cache/memoryCache.d.ts.map +1 -1
- package/dist/cache/memoryCache.es.js +2 -4
- package/dist/cache/memoryCache.es.js.map +1 -1
- package/dist/cache/persistentCache.d.ts +4 -2
- package/dist/cache/persistentCache.d.ts.map +1 -1
- package/dist/cache/persistentCache.es.js +25 -26
- package/dist/cache/persistentCache.es.js.map +1 -1
- package/dist/dataFormats.d.ts +1 -1
- package/dist/dateTimeDataFormat.d.ts +13 -12
- package/dist/dateTimeDataFormat.d.ts.map +1 -1
- package/dist/dateTimeDataFormat.es.js +62 -68
- package/dist/dateTimeDataFormat.es.js.map +1 -1
- package/dist/i18n/enUsCulture.d.ts.map +1 -1
- package/dist/i18n/enUsCulture.es.js +17 -18
- package/dist/i18n/enUsCulture.es.js.map +1 -1
- package/dist/store/storeContracts.d.ts +2 -0
- package/dist/store/storeContracts.d.ts.map +1 -1
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -8,10 +8,15 @@ A modern foundation toolkit for complex TypeScript apps.
|
|
|
8
8
|
- [Modules](#modules)
|
|
9
9
|
- [typeCore — Expressive Type Composition](#typecore--expressive-type-composition)
|
|
10
10
|
- [typeUtils — Runtime Type Utilities](#typeutils--runtime-type-utilities)
|
|
11
|
+
- [stringCore — Locale-Aware String Utilities](#stringcore--locale-aware-string-utilities)
|
|
12
|
+
- [metadata — Property Metadata](#metadata--property-metadata)
|
|
13
|
+
- [decorators — Property Decorators](#decorators--property-decorators)
|
|
14
|
+
- [dateTimeDataFormat — Date/Time Serialisation](#datetimedataformat--datetime-serialisation)
|
|
11
15
|
- [StructEvent — Typed DOM Events](#structevent--typed-dom-events)
|
|
12
16
|
- [watchable — Promise & Function Tracking](#watchable--promise--function-tracking)
|
|
13
17
|
- [asyncMutex — Async Mutual Exclusion](#asyncmutex--async-mutual-exclusion)
|
|
14
18
|
- [store — Structured Persistence](#store--structured-persistence)
|
|
19
|
+
- [cache — Persistent Cache](#cache--persistent-cache)
|
|
15
20
|
- [License](#license)
|
|
16
21
|
|
|
17
22
|
---
|
|
@@ -27,10 +32,10 @@ pnpm add @actdim/utico
|
|
|
27
32
|
**Peer dependencies** (install only what you use):
|
|
28
33
|
|
|
29
34
|
```bash
|
|
30
|
-
pnpm add dexie uuid
|
|
35
|
+
pnpm add dexie uuid luxon
|
|
31
36
|
```
|
|
32
37
|
|
|
33
|
-
> `dexie` and `uuid` are required for the `store` module. `
|
|
38
|
+
> `dexie` and `uuid` are required for the `store` module. `luxon` is required for the `dateTimeDataFormat` module.
|
|
34
39
|
|
|
35
40
|
---
|
|
36
41
|
|
|
@@ -196,7 +201,7 @@ generic class without repeating its type arguments everywhere.
|
|
|
196
201
|
(see [StructEvent](#structevent--typed-dom-events)).
|
|
197
202
|
Inside `PersistentCache` you want to work with
|
|
198
203
|
`StructEvent<PersistentCacheEventStruct, PersistentCache>` as if it were its own named type.
|
|
199
|
-
TypeScript offers four ways to achieve this; each has different trade-offs.
|
|
204
|
+
TypeScript offers four ways to achieve this; each has different trade-offs — see the [full comparison](#comparison-4-ways-to-bind-a-generic-constructor) at the end of this section.
|
|
200
205
|
|
|
201
206
|
---
|
|
202
207
|
|
|
@@ -248,63 +253,6 @@ const evt = PersistentCacheEvent("evict", { detail: { records }, target: this })
|
|
|
248
253
|
|
|
249
254
|
---
|
|
250
255
|
|
|
251
|
-
#### Comparison: 4 ways to bind a generic constructor
|
|
252
|
-
|
|
253
|
-
All four examples produce a bound alias for `StructEvent<PersistentCacheEventStruct, PersistentCache>`.
|
|
254
|
-
|
|
255
|
-
**1. Subclass**
|
|
256
|
-
|
|
257
|
-
```ts
|
|
258
|
-
class PersistentCacheEvent
|
|
259
|
-
extends StructEvent<PersistentCacheEventStruct, PersistentCache> {}
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
**2. Manual cast**
|
|
263
|
-
|
|
264
|
-
```ts
|
|
265
|
-
type PersistentCacheEvent = StructEvent<PersistentCacheEventStruct, PersistentCache>;
|
|
266
|
-
const PersistentCacheEvent = StructEvent as new (
|
|
267
|
-
...args: ConstructorParameters<typeof StructEvent<PersistentCacheEventStruct, PersistentCache>>
|
|
268
|
-
) => PersistentCacheEvent;
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
**3. `typed()` + Instantiation Expression** *(recommended)*
|
|
272
|
-
|
|
273
|
-
```ts
|
|
274
|
-
const PersistentCacheEvent = typed(StructEvent<PersistentCacheEventStruct, PersistentCache>);
|
|
275
|
-
const evt = new PersistentCacheEvent("evict", { detail: { records }, target: this });
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
**4. `createConstructor()` — callable without `new`**
|
|
279
|
-
|
|
280
|
-
```ts
|
|
281
|
-
const PersistentCacheEvent = createConstructor(StructEvent<PersistentCacheEventStruct, PersistentCache>);
|
|
282
|
-
const evt = PersistentCacheEvent("evict", { detail: { records }, target: this }); // no new
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
---
|
|
286
|
-
|
|
287
|
-
**Feature comparison**
|
|
288
|
-
|
|
289
|
-
| | Subclass | Manual cast | `typed()` | `createConstructor()` |
|
|
290
|
-
|---|:---:|:---:|:---:|:---:|
|
|
291
|
-
| Runtime overhead | new class | none | **none** | wrapper function |
|
|
292
|
-
| `new` required | yes | yes | yes | **no** |
|
|
293
|
-
| `instanceof` | **yes** | no | no | no |
|
|
294
|
-
| Can add methods | **yes** | no | no | no |
|
|
295
|
-
| Verbosity | medium | **high** | **low** | **low** |
|
|
296
|
-
| Requires TS | any | any | **4.7+** | **4.7+** |
|
|
297
|
-
|
|
298
|
-
**When to choose:**
|
|
299
|
-
|
|
300
|
-
- **Subclass** — when you need `instanceof` checks, want to add methods, or need a distinct runtime type.
|
|
301
|
-
- **Manual cast** — when TS < 4.7 is required, or you prefer zero dependencies (verbose but explicit).
|
|
302
|
-
- **`typed()`** — the default choice: concise, zero runtime cost. Requires TS 4.7+.
|
|
303
|
-
- **`createConstructor()`** — same as `typed()`, but the constructor must be callable without `new`
|
|
304
|
-
(e.g. factory patterns, functional-style code).
|
|
305
|
-
|
|
306
|
-
---
|
|
307
|
-
|
|
308
256
|
#### Object / Key Utilities
|
|
309
257
|
|
|
310
258
|
| Function | Description |
|
|
@@ -313,6 +261,7 @@ const evt = PersistentCacheEvent("evict", { detail: { records }, target: this })
|
|
|
313
261
|
| `keyOf<T>(key)` | Returns a property name literal narrowed to `keyof T`. No object required — useful for building typed key references |
|
|
314
262
|
| `nameOf<T>(f)` | Extracts a property name from a lambda `x => x.prop` at runtime via `Proxy` |
|
|
315
263
|
| `entry(obj, name, caseInsensitive?)` | Looks up a key (optionally case-insensitive) and returns `[resolvedKey, value]` |
|
|
264
|
+
| `getPrototypes(obj)` | Returns the prototype chain as an array, from the object's direct prototype up to (but not including) `null` |
|
|
316
265
|
|
|
317
266
|
```ts
|
|
318
267
|
keysOf({ a: 1, b: 2 }) // => ["a", "b"] typed as ("a" | "b")[]
|
|
@@ -370,6 +319,35 @@ combinePropertyPath(["server", "port"]) // => '["server"]["port"]'
|
|
|
370
319
|
| `toReadOnly<T>(obj, throwOnSet?)` | Deep read-only proxy; silently ignores writes (or throws if `throwOnSet: true`). Toggle with the `[$lock]` symbol |
|
|
371
320
|
| `createDeepProxy<T>(target, handler)` | Deep-change proxy: `handler.set` and `handler.deleteProperty` receive the full `DeepPropertyKey` path |
|
|
372
321
|
|
|
322
|
+
```ts
|
|
323
|
+
// proxify — lazy proxy that re-evaluates source on every get/set
|
|
324
|
+
let config = { theme: 'dark' };
|
|
325
|
+
const proxy = proxify(() => config);
|
|
326
|
+
proxy.theme; // => 'dark'
|
|
327
|
+
config = { theme: 'light' };
|
|
328
|
+
proxy.theme; // => 'light' — picks up the new object
|
|
329
|
+
|
|
330
|
+
// toReadOnly — deep read-only proxy (writes silently ignored by default)
|
|
331
|
+
const opts = toReadOnly({ server: { port: 3000 } });
|
|
332
|
+
opts.server.port; // => 3000
|
|
333
|
+
opts.server.port = 80; // silently ignored
|
|
334
|
+
// pass true as second arg to throw on write attempts instead
|
|
335
|
+
|
|
336
|
+
// createDeepProxy — intercept deep mutations with the full property path
|
|
337
|
+
const state = createDeepProxy({ user: { name: 'Alice' } }, {
|
|
338
|
+
set(target, path, value) {
|
|
339
|
+
console.log('set', path.map(String).join('.'), '=', value);
|
|
340
|
+
return true;
|
|
341
|
+
},
|
|
342
|
+
deleteProperty(target, path) {
|
|
343
|
+
console.log('deleted', path.map(String).join('.'));
|
|
344
|
+
return true;
|
|
345
|
+
},
|
|
346
|
+
});
|
|
347
|
+
state.user.name = 'Bob'; // logs: "set user.name = Bob"
|
|
348
|
+
delete state.user.name; // logs: "deleted user.name"
|
|
349
|
+
```
|
|
350
|
+
|
|
373
351
|
---
|
|
374
352
|
|
|
375
353
|
#### JSON Utilities
|
|
@@ -405,6 +383,299 @@ getEnumValue(Color, "Purple", Color.Red) // => 0 (default)
|
|
|
405
383
|
|
|
406
384
|
---
|
|
407
385
|
|
|
386
|
+
#### Comparison: 4 ways to bind a generic constructor
|
|
387
|
+
|
|
388
|
+
All four examples produce a bound alias for `StructEvent<PersistentCacheEventStruct, PersistentCache>`.
|
|
389
|
+
|
|
390
|
+
**1. Subclass**
|
|
391
|
+
|
|
392
|
+
```ts
|
|
393
|
+
class PersistentCacheEvent
|
|
394
|
+
extends StructEvent<PersistentCacheEventStruct, PersistentCache> {}
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
**2. Manual cast**
|
|
398
|
+
|
|
399
|
+
```ts
|
|
400
|
+
type PersistentCacheEvent = StructEvent<PersistentCacheEventStruct, PersistentCache>;
|
|
401
|
+
const PersistentCacheEvent = StructEvent as new (
|
|
402
|
+
...args: ConstructorParameters<typeof StructEvent<PersistentCacheEventStruct, PersistentCache>>
|
|
403
|
+
) => PersistentCacheEvent;
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
**3. `typed()` + Instantiation Expression** *(recommended)*
|
|
407
|
+
|
|
408
|
+
```ts
|
|
409
|
+
const PersistentCacheEvent = typed(StructEvent<PersistentCacheEventStruct, PersistentCache>);
|
|
410
|
+
const evt = new PersistentCacheEvent("evict", { detail: { records }, target: this });
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
**4. `createConstructor()` — callable without `new`**
|
|
414
|
+
|
|
415
|
+
```ts
|
|
416
|
+
const PersistentCacheEvent = createConstructor(StructEvent<PersistentCacheEventStruct, PersistentCache>);
|
|
417
|
+
const evt = PersistentCacheEvent("evict", { detail: { records }, target: this }); // no new
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
---
|
|
421
|
+
|
|
422
|
+
**Feature comparison**
|
|
423
|
+
|
|
424
|
+
| | Subclass | Manual cast | `typed()` | `createConstructor()` |
|
|
425
|
+
|---|:---:|:---:|:---:|:---:|
|
|
426
|
+
| Runtime overhead | new class | none | **none** | wrapper function |
|
|
427
|
+
| `new` required | yes | yes | yes | **no** |
|
|
428
|
+
| `instanceof` | **yes** | no | no | no |
|
|
429
|
+
| Can add methods | **yes** | no | no | no |
|
|
430
|
+
| Verbosity | medium | **high** | **low** | **low** |
|
|
431
|
+
| Requires TS | any | any | **4.7+** | **4.7+** |
|
|
432
|
+
|
|
433
|
+
**When to choose:**
|
|
434
|
+
|
|
435
|
+
- **Subclass** — when you need `instanceof` checks, want to add methods, or need a distinct runtime type.
|
|
436
|
+
- **Manual cast** — when TS < 4.7 is required, or you prefer zero dependencies (verbose but explicit).
|
|
437
|
+
- **`typed()`** — the default choice: concise, zero runtime cost. Requires TS 4.7+.
|
|
438
|
+
- **`createConstructor()`** — same as `typed()`, but the constructor must be callable without `new`
|
|
439
|
+
(e.g. factory patterns, functional-style code).
|
|
440
|
+
|
|
441
|
+
---
|
|
442
|
+
|
|
443
|
+
### stringCore — Locale-Aware String Utilities
|
|
444
|
+
|
|
445
|
+
**Import:** `@actdim/utico/stringCore`
|
|
446
|
+
|
|
447
|
+
Locale-aware string comparison and search utilities built on `Intl.Collator`. All functions accept an optional `locale` parameter (defaults to `navigator.language`). Non-string inputs fall back to reference equality or a default collator instead of throwing.
|
|
448
|
+
|
|
449
|
+
#### Functions
|
|
450
|
+
|
|
451
|
+
| Function | Description |
|
|
452
|
+
|----------|-------------|
|
|
453
|
+
| `equals(strA, strB, ignoreCase?, locale?)` | Returns `true` when strings are equal. Case-sensitive by default. Uses `Intl.Collator` for locale-correct comparison. |
|
|
454
|
+
| `compare(strA, strB, ignoreCase?, locale?)` | Returns a negative, zero, or positive number — same contract as `Array.prototype.sort`. |
|
|
455
|
+
| `ciCompare(strA, strB, locale?)` | Case-insensitive `compare`. Uses `sensitivity: "accent"` when available, falls back to `toLocaleUpperCase`. |
|
|
456
|
+
| `ciStartsWith(str, searchStr, locale?)` | Case-insensitive `String.prototype.startsWith`. Returns `false` for non-string inputs. |
|
|
457
|
+
| `ciEndsWith(str, searchStr, locale?)` | Case-insensitive `String.prototype.endsWith`. Returns `false` for non-string inputs. |
|
|
458
|
+
| `ciIndexOf(str, searchStr, locale?)` | Case-insensitive `String.prototype.indexOf`. Returns `-1` for non-string inputs or no match. |
|
|
459
|
+
| `ciIncludes(str, searchStr, locale?)` | Case-insensitive `String.prototype.includes`. Returns `false` for non-string inputs. |
|
|
460
|
+
|
|
461
|
+
#### Usage Examples
|
|
462
|
+
|
|
463
|
+
```typescript
|
|
464
|
+
import { equals, compare, ciCompare, ciStartsWith, ciEndsWith, ciIndexOf, ciIncludes } from '@actdim/utico/stringCore';
|
|
465
|
+
|
|
466
|
+
// equals
|
|
467
|
+
equals('Hello', 'hello') // false (case-sensitive)
|
|
468
|
+
equals('Hello', 'hello', true) // true (case-insensitive)
|
|
469
|
+
equals('café', 'CAFÉ', true, 'fr') // true (locale-aware)
|
|
470
|
+
|
|
471
|
+
// compare — for sorting
|
|
472
|
+
['banana', 'Apple', 'cherry'].sort((a, b) => compare(a, b, true));
|
|
473
|
+
// => ['Apple', 'banana', 'cherry']
|
|
474
|
+
|
|
475
|
+
// ciStartsWith / ciEndsWith
|
|
476
|
+
ciStartsWith('Hello World', 'hello') // true
|
|
477
|
+
ciEndsWith('Hello World', 'WORLD') // true
|
|
478
|
+
|
|
479
|
+
// ciIndexOf / ciIncludes
|
|
480
|
+
ciIndexOf('Hello World', 'WORLD') // 6
|
|
481
|
+
ciIncludes('Hello World', 'WORLD') // true
|
|
482
|
+
ciIncludes('Hello World', 'xyz') // false
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
---
|
|
486
|
+
|
|
487
|
+
### metadata — Property Metadata
|
|
488
|
+
|
|
489
|
+
**Import:** `@actdim/utico/metadata`
|
|
490
|
+
|
|
491
|
+
A lightweight property metadata system backed by `WeakMap`. Attach arbitrary named slots of metadata to class properties via the `@metadata` decorator or the imperative API. Metadata is resolved through the prototype chain, so subclasses automatically inherit base-class metadata.
|
|
492
|
+
|
|
493
|
+
#### Functions
|
|
494
|
+
|
|
495
|
+
| Function | Description |
|
|
496
|
+
|----------|-------------|
|
|
497
|
+
| `metadata(value, slotName)` | Property decorator factory. Attaches `value` to the `slotName` slot of the decorated property. |
|
|
498
|
+
| `getPropertyMetadata<T>(target, propertyName, slotName?)` | Reads metadata for a property. If `slotName` is omitted, returns all slots for that property. Walks the prototype chain. |
|
|
499
|
+
| `updatePropertyMetadata(target, propertyName, value, slotName)` | Imperative equivalent of `@metadata`. |
|
|
500
|
+
| `getPropertyMetadataItem(metadata, obj)` | Low-level: resolves a `WeakMap` entry for `obj` by walking its prototype chain. |
|
|
501
|
+
|
|
502
|
+
#### Usage Examples
|
|
503
|
+
|
|
504
|
+
```typescript
|
|
505
|
+
import { metadata, getPropertyMetadata, updatePropertyMetadata } from '@actdim/utico/metadata';
|
|
506
|
+
|
|
507
|
+
// --- Decorator API ---
|
|
508
|
+
|
|
509
|
+
class Article {
|
|
510
|
+
@metadata('Title of the article', 'label')
|
|
511
|
+
@metadata(true, 'required')
|
|
512
|
+
title: string;
|
|
513
|
+
|
|
514
|
+
@metadata('Publication date', 'label')
|
|
515
|
+
publishedAt: number;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
const article = new Article();
|
|
519
|
+
|
|
520
|
+
getPropertyMetadata(article, 'title', 'label') // => 'Title of the article'
|
|
521
|
+
getPropertyMetadata(article, 'title', 'required') // => true
|
|
522
|
+
getPropertyMetadata(article, 'title') // => { label: '...', required: true }
|
|
523
|
+
|
|
524
|
+
// --- Imperative API ---
|
|
525
|
+
|
|
526
|
+
class Product {
|
|
527
|
+
price: number;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
updatePropertyMetadata(Product.prototype, 'price', 'EUR price in cents', 'label');
|
|
531
|
+
getPropertyMetadata(new Product(), 'price', 'label'); // => 'EUR price in cents'
|
|
532
|
+
|
|
533
|
+
// --- Prototype chain inheritance ---
|
|
534
|
+
|
|
535
|
+
class SpecialArticle extends Article {}
|
|
536
|
+
|
|
537
|
+
// SpecialArticle inherits metadata from Article.prototype
|
|
538
|
+
getPropertyMetadata(new SpecialArticle(), 'title', 'label'); // => 'Title of the article'
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
---
|
|
542
|
+
|
|
543
|
+
### decorators — Property Decorators
|
|
544
|
+
|
|
545
|
+
**Import:** `@actdim/utico/decorators`
|
|
546
|
+
|
|
547
|
+
| Decorator | Description |
|
|
548
|
+
|-----------|-------------|
|
|
549
|
+
| `@nonEnumerable` | Makes a class property non-enumerable: it is hidden from `Object.keys`, `for...in`, `JSON.stringify`, and spread (`{...obj}`), while remaining fully readable and writable via direct access. |
|
|
550
|
+
|
|
551
|
+
#### Usage Examples
|
|
552
|
+
|
|
553
|
+
```typescript
|
|
554
|
+
import { nonEnumerable } from '@actdim/utico/decorators';
|
|
555
|
+
|
|
556
|
+
class User {
|
|
557
|
+
name: string;
|
|
558
|
+
|
|
559
|
+
@nonEnumerable
|
|
560
|
+
passwordHash: string;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
const user = new User();
|
|
564
|
+
user.name = 'Alice';
|
|
565
|
+
user.passwordHash = 'abc123';
|
|
566
|
+
|
|
567
|
+
Object.keys(user) // => ['name'] — passwordHash is hidden
|
|
568
|
+
JSON.stringify(user) // => '{"name":"Alice"}'
|
|
569
|
+
user.passwordHash // => 'abc123' — still directly accessible
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
> **How it works:** the decorator replaces the property with an accessor on the prototype. On the first assignment, the accessor redefines the property as a non-enumerable own value on the specific instance, so subsequent reads are direct (no getter overhead).
|
|
573
|
+
|
|
574
|
+
---
|
|
575
|
+
|
|
576
|
+
### dateTimeDataFormat — Date/Time Serialisation
|
|
577
|
+
|
|
578
|
+
**Import:** `@actdim/utico/dateTimeDataFormat`
|
|
579
|
+
|
|
580
|
+
**Peer dependency:** `luxon ^3`
|
|
581
|
+
|
|
582
|
+
UTC-first date/time utilities built on [Luxon](https://moment.github.io/luxon/). Provides a canonical wire format (`yyyy-MM-dd'T'HH:mm:ss.SSS`), serialisation/deserialisation, display formatting, and helpers for OLE Automation and numeric timestamps.
|
|
583
|
+
|
|
584
|
+
#### Types
|
|
585
|
+
|
|
586
|
+
| Type | Description |
|
|
587
|
+
|------|-------------|
|
|
588
|
+
| `DateTimeDataFormat` | Interface for the default export: `serialize`, `deserialize`, `tryDeserialize`, `normalize`, `isValid`, `serializationFormat` |
|
|
589
|
+
| `DateValueFormats` | `{ string?: string; number?: DateNumberFormat }` — format hints passed to `toDateTime` |
|
|
590
|
+
|
|
591
|
+
#### Enum: `DateNumberFormat`
|
|
592
|
+
|
|
593
|
+
| Member | Description |
|
|
594
|
+
|--------|-------------|
|
|
595
|
+
| `UnixTimeMilliseconds` | Default — milliseconds since Unix epoch |
|
|
596
|
+
| `UnixTimeSeconds` | Seconds since Unix epoch |
|
|
597
|
+
| `OADate` | Microsoft OLE Automation date (fractional days since 1899-12-30) |
|
|
598
|
+
|
|
599
|
+
#### Functions
|
|
600
|
+
|
|
601
|
+
| Function | Description |
|
|
602
|
+
|----------|-------------|
|
|
603
|
+
| `toDateTime(source, formats?)` | Converts `string \| number \| Date \| DateTime` -> `DateTime` (UTC). Accepts optional `DateValueFormats` hints |
|
|
604
|
+
| `fromLocalDate(date)` | Reads the local time parts of a `Date` (e.g. from `normalize()`) and places them in UTC. Use to serialize a normalized `Date` back to the wire format |
|
|
605
|
+
| `formatDate(date, format?)` | Formats a `Date` or `DateTime` using a Luxon format string. Auto-selects a locale format when `format` is omitted |
|
|
606
|
+
| `getDateFromNumber(value, fmt?)` | Converts a numeric timestamp to a `Date` according to `DateNumberFormat` |
|
|
607
|
+
| `getDateFromOADate(oaDate)` | Converts a Microsoft OADate number to `Date` |
|
|
608
|
+
| `getOADateFromDate(date)` | Converts a `Date` to a Microsoft OADate string |
|
|
609
|
+
|
|
610
|
+
#### Default export — `dateTimeFormat`
|
|
611
|
+
|
|
612
|
+
| Method / Property | Signature | Description |
|
|
613
|
+
|-------------------|-----------|-------------|
|
|
614
|
+
| `serializationFormat` | `string` | `"yyyy-MM-dd'T'HH:mm:ss.SSS"` — the canonical wire format |
|
|
615
|
+
| `serialize(source)` | `-> string \| null` | Formats any supported source to the wire format |
|
|
616
|
+
| `deserialize(value)` | `-> DateTime` | Parses a wire-format string; throws on invalid input |
|
|
617
|
+
| `tryDeserialize(value)` | `-> DateTime \| null` | Like `deserialize` but returns `null` instead of throwing |
|
|
618
|
+
| `isValid(source)` | `-> boolean` | `true` for `null`, a valid wire-format string, or any `Date` |
|
|
619
|
+
| `normalize(source)` | `-> Date \| null` | Converts any supported source to a native `Date`. The local accessors (`getHours()`, etc.) reflect the original UTC values |
|
|
620
|
+
|
|
621
|
+
#### Usage Examples
|
|
622
|
+
|
|
623
|
+
```typescript
|
|
624
|
+
import dateTimeFormat, { toDateTime, fromLocalDate, formatDate, DateNumberFormat } from '@actdim/utico/dateTimeDataFormat';
|
|
625
|
+
import { DateTime } from 'luxon';
|
|
626
|
+
|
|
627
|
+
// Deserialize a wire-format string -> Luxon DateTime (UTC)
|
|
628
|
+
const dt = dateTimeFormat.deserialize("2024-03-15T10:30:45.123");
|
|
629
|
+
dt.year; // 2024
|
|
630
|
+
dt.hour; // 10
|
|
631
|
+
dt.zoneName; // "UTC"
|
|
632
|
+
|
|
633
|
+
// Serialize back to wire format
|
|
634
|
+
dateTimeFormat.serialize(dt); // "2024-03-15T10:30:45.123"
|
|
635
|
+
dateTimeFormat.serialize(new Date(...)); // same format
|
|
636
|
+
|
|
637
|
+
// Safe parse — returns null instead of throwing
|
|
638
|
+
dateTimeFormat.tryDeserialize("bad"); // null
|
|
639
|
+
|
|
640
|
+
// isValid
|
|
641
|
+
dateTimeFormat.isValid("2024-03-15T10:30:45.000"); // true
|
|
642
|
+
dateTimeFormat.isValid("not-a-date"); // false
|
|
643
|
+
dateTimeFormat.isValid(null); // true (no value is OK)
|
|
644
|
+
|
|
645
|
+
// normalize — native Date whose getHours() reflects the UTC hour
|
|
646
|
+
const date = dateTimeFormat.normalize("2024-03-15T10:30:45.000");
|
|
647
|
+
date.getHours(); // 10 — regardless of local timezone
|
|
648
|
+
|
|
649
|
+
// toDateTime — flexible conversion
|
|
650
|
+
toDateTime("2024-03-15T10:30:45.000"); // from s11n string
|
|
651
|
+
toDateTime(new Date()); // from Date
|
|
652
|
+
toDateTime(1710496245000, { number: DateNumberFormat.UnixTimeMilliseconds });
|
|
653
|
+
toDateTime(1710496245, { number: DateNumberFormat.UnixTimeSeconds });
|
|
654
|
+
toDateTime("03/15/2024", { string: "MM/dd/yyyy" }); // custom format
|
|
655
|
+
|
|
656
|
+
// formatDate — display formatting
|
|
657
|
+
formatDate(dt, "yyyy-MM-dd"); // "2024-03-15"
|
|
658
|
+
formatDate(dt); // auto-selected locale format
|
|
659
|
+
|
|
660
|
+
// fromLocalDate — serialize a normalize()'d Date back to the wire format
|
|
661
|
+
//
|
|
662
|
+
// normalize() produces a Date whose getHours() equals the original UTC hour.
|
|
663
|
+
// toDateTime(date) reads the epoch as UTC, which gives the wrong result for
|
|
664
|
+
// such Dates. fromLocalDate() reads the local time parts instead.
|
|
665
|
+
//
|
|
666
|
+
const normalized = dateTimeFormat.normalize("2024-03-15T10:30:45.123");
|
|
667
|
+
normalized.getHours(); // 10 — correct for display in <input>
|
|
668
|
+
dateTimeFormat.serialize(fromLocalDate(normalized)); // "2024-03-15T10:30:45.123" ✓
|
|
669
|
+
|
|
670
|
+
// Typical <input type="datetime-local"> round-trip:
|
|
671
|
+
// input.valueAsDate = dateTimeFormat.normalize(serverValue)
|
|
672
|
+
// ...user edits...
|
|
673
|
+
// const saved = dateTimeFormat.serialize(input.value); // simplest
|
|
674
|
+
// const saved = dateTimeFormat.serialize(fromLocalDate(input.valueAsDate)); // via Date
|
|
675
|
+
```
|
|
676
|
+
|
|
677
|
+
---
|
|
678
|
+
|
|
408
679
|
### StructEvent — Typed DOM Events
|
|
409
680
|
|
|
410
681
|
**Import:** `@actdim/utico/structEvent`
|
|
@@ -502,8 +773,8 @@ const PersistentCacheEvent = typed(StructEvent<PersistentCacheEventStruct, Persi
|
|
|
502
773
|
const cache = await PersistentCache.open("my-cache");
|
|
503
774
|
|
|
504
775
|
cache.addEventListener("evict", (e) => {
|
|
505
|
-
// e.detail
|
|
506
|
-
// e.target
|
|
776
|
+
// e.detail -> { records: CacheMetadataRecord[] } (typed)
|
|
777
|
+
// e.target -> PersistentCache (typed)
|
|
507
778
|
console.log("Evicted records:", e.detail.records);
|
|
508
779
|
});
|
|
509
780
|
```
|
|
@@ -525,9 +796,17 @@ Track the execution state of promises and functions — useful for loading indic
|
|
|
525
796
|
| Type | Description |
|
|
526
797
|
| ------------------------- | ---------------------------------------------------------------- |
|
|
527
798
|
| `PromiseStatus` | `"pending" \| "fulfilled" \| "rejected"` |
|
|
528
|
-
| `WatchablePromise<T>` | `PromiseLike<T>`
|
|
799
|
+
| `WatchablePromise<T>` | `PromiseLike<T>` with observable state fields (see below) |
|
|
529
800
|
| `WatchableFunc<TArgs, T>` | Function extended with an `executing` flag |
|
|
530
801
|
|
|
802
|
+
`WatchablePromise<T>` adds three read-only fields to the underlying promise:
|
|
803
|
+
|
|
804
|
+
| Field | Type | Description |
|
|
805
|
+
| ---------- | --------------- | --------------------------------------------------------------------------- |
|
|
806
|
+
| `status` | `PromiseStatus` | `"pending"` immediately; becomes `"fulfilled"` or `"rejected"` when settled |
|
|
807
|
+
| `settled` | `boolean` | Computed getter — `true` once `status` is no longer `"pending"` |
|
|
808
|
+
| `result` | `T \| undefined`| The resolved value after fulfillment; `undefined` after rejection |
|
|
809
|
+
|
|
531
810
|
#### Functions
|
|
532
811
|
|
|
533
812
|
| Function | Signature | Description |
|
|
@@ -714,6 +993,8 @@ The main entry point for structured persistence. Key features:
|
|
|
714
993
|
| `getOrSet<TValue>(metadata, factory)` | Get existing or create via factory |
|
|
715
994
|
| `bulkGet<TValue>(keys)` | Get multiple items |
|
|
716
995
|
| `bulkSet<TValue>(metadataRecords, dataRecords)` | Insert multiple items |
|
|
996
|
+
| `update<TValue>(key, metadataChanges, valueChanges?)` | Patch fields of a single item by key; returns count of records modified (0 if key not found) |
|
|
997
|
+
| `bulkUpdate(metadataChangeSets, dataChangeSets?)` | Patch fields of multiple items; each change set is `{ key, changes: KeyPathValueMap<T> }` |
|
|
717
998
|
| `delete(key)` | Delete an item |
|
|
718
999
|
| `bulkDelete(keys)` | Delete multiple items |
|
|
719
1000
|
| `clear()` | Delete all items |
|
|
@@ -788,6 +1069,15 @@ const items = await store.bulkGet<{ x: number }>(['item:1', 'item:2']);
|
|
|
788
1069
|
await store.delete('user:42');
|
|
789
1070
|
await store.bulkDelete(['item:1', 'item:2']);
|
|
790
1071
|
await store.clear();
|
|
1072
|
+
|
|
1073
|
+
// Patch individual fields without rewriting the whole record
|
|
1074
|
+
await store.update('user:42', { tags: ['admin', 'verified'] });
|
|
1075
|
+
|
|
1076
|
+
// Patch multiple records in one transaction
|
|
1077
|
+
await store.bulkUpdate([
|
|
1078
|
+
{ key: 'item:1', changes: { tags: ['sale'] } },
|
|
1079
|
+
{ key: 'item:2', changes: { tags: ['new'] } },
|
|
1080
|
+
]);
|
|
791
1081
|
```
|
|
792
1082
|
|
|
793
1083
|
```typescript
|
|
@@ -833,6 +1123,129 @@ const page = await store
|
|
|
833
1123
|
|
|
834
1124
|
---
|
|
835
1125
|
|
|
1126
|
+
### cache — Persistent Cache
|
|
1127
|
+
|
|
1128
|
+
**Imports:**
|
|
1129
|
+
|
|
1130
|
+
- `@actdim/utico/cache/persistentCache` — `PersistentCache`, `CacheOptions`, `PersistentCacheOptions`
|
|
1131
|
+
- `@actdim/utico/cache/cacheContracts` — `CacheMetadataRecord`
|
|
1132
|
+
|
|
1133
|
+
Built on top of the `store` module. Adds expiration semantics (TTL, absolute expiration, sliding expiration) and a background cleanup job that evicts expired entries automatically.
|
|
1134
|
+
|
|
1135
|
+
#### Types
|
|
1136
|
+
|
|
1137
|
+
| Type | Description |
|
|
1138
|
+
|------|-------------|
|
|
1139
|
+
| `CacheMetadataRecord` | Extends `MetadataRecord` with `slidingExpiration`, `absoluteExpiration`, and `expiresAt` |
|
|
1140
|
+
| `CacheOptions` | Per-entry expiration options (see below) |
|
|
1141
|
+
| `PersistentCacheOptions` | Cache-level options: `cleanupTimeout` (ms between background cleanup runs) |
|
|
1142
|
+
| `CacheEvictionEvent` | `{ records: CacheMetadataRecord[] }` — payload of the `"evict"` event |
|
|
1143
|
+
|
|
1144
|
+
#### `CacheOptions`
|
|
1145
|
+
|
|
1146
|
+
| Field | Type | Description |
|
|
1147
|
+
|-------|------|-------------|
|
|
1148
|
+
| `slidingExpiration` | `number` (ms) | Extends `expiresAt` by this duration on every `get()`. Recommended: combined with `absoluteExpiration` as a cap. |
|
|
1149
|
+
| `absoluteExpiration` | `Date \| number` | Hard deadline — `expiresAt` is never pushed past this value. |
|
|
1150
|
+
| `ttl` | `number \| { seconds?, minutes?, hours? }` | Sets `absoluteExpiration` relative to the creation time. |
|
|
1151
|
+
|
|
1152
|
+
#### Static Methods
|
|
1153
|
+
|
|
1154
|
+
| Method | Description |
|
|
1155
|
+
|--------|-------------|
|
|
1156
|
+
| `PersistentCache.open(name, options?)` | Open or create a named cache. Returns a `PersistentCache` instance. |
|
|
1157
|
+
| `PersistentCache.exists(name)` | Check if a named cache database exists. |
|
|
1158
|
+
| `PersistentCache.delete(name)` | Delete a named cache database. |
|
|
1159
|
+
|
|
1160
|
+
#### Instance Methods
|
|
1161
|
+
|
|
1162
|
+
| Method | Description |
|
|
1163
|
+
|--------|-------------|
|
|
1164
|
+
| `get<TValue>(key)` | Get an item and update `accessedAt` (and `expiresAt` if `slidingExpiration` is set). |
|
|
1165
|
+
| `set(metadata, value, options)` | Create or overwrite an item with expiration options. Auto-generates a UUID key if `metadata.key` is absent. |
|
|
1166
|
+
| `getOrSet(metadata, factory, options)` | Return the existing item or create it via `factory`. `metadata.key` is required. |
|
|
1167
|
+
| `bulkGet<TValue>(keys)` | Get multiple items by key. |
|
|
1168
|
+
| `bulkSet(metadataRecords, dataRecords, optionsProvider)` | Insert multiple items. `optionsProvider` is called per-record to produce `CacheOptions`. |
|
|
1169
|
+
| `contains(key)` | Check if a key exists. |
|
|
1170
|
+
| `getKeys()` | Return all stored keys. |
|
|
1171
|
+
| `delete(key)` | Delete a single item. |
|
|
1172
|
+
| `bulkDelete(keys)` | Delete multiple items. |
|
|
1173
|
+
| `clear()` | Delete all items. |
|
|
1174
|
+
| `deleteExpired(ts?)` | Evict entries whose `expiresAt < ts` (defaults to `Date.now()`). Fires the `"evict"` event if anything was removed. |
|
|
1175
|
+
| `[Symbol.dispose]()` | Cancel the background cleanup timer and close the database. |
|
|
1176
|
+
|
|
1177
|
+
#### Events
|
|
1178
|
+
|
|
1179
|
+
`PersistentCache` extends `StructEventTarget`. Subscribe with `addEventListener`.
|
|
1180
|
+
|
|
1181
|
+
| Event | Detail type | Description |
|
|
1182
|
+
|-------|-------------|-------------|
|
|
1183
|
+
| `"evict"` | `{ records: CacheMetadataRecord[] }` | Fired after `deleteExpired` removes at least one entry. |
|
|
1184
|
+
|
|
1185
|
+
#### Usage Examples
|
|
1186
|
+
|
|
1187
|
+
```typescript
|
|
1188
|
+
import { PersistentCache } from '@actdim/utico/cache/persistentCache';
|
|
1189
|
+
|
|
1190
|
+
// --- Open a cache ---
|
|
1191
|
+
|
|
1192
|
+
const cache = await PersistentCache.open('my-cache');
|
|
1193
|
+
|
|
1194
|
+
// --- set / get ---
|
|
1195
|
+
|
|
1196
|
+
await cache.set({ key: 'user:42' }, { name: 'Alice' }, {});
|
|
1197
|
+
|
|
1198
|
+
const item = await cache.get<{ name: string }>('user:42');
|
|
1199
|
+
item.metadata.key // 'user:42'
|
|
1200
|
+
item.metadata.createdAt // timestamp set automatically
|
|
1201
|
+
item.data.value.name // 'Alice'
|
|
1202
|
+
|
|
1203
|
+
// --- Auto-generated key ---
|
|
1204
|
+
|
|
1205
|
+
const meta = {}; // no key provided
|
|
1206
|
+
await cache.set(meta, { x: 1 }, {});
|
|
1207
|
+
meta.key; // UUID filled in by set()
|
|
1208
|
+
|
|
1209
|
+
// --- getOrSet ---
|
|
1210
|
+
|
|
1211
|
+
const item2 = await cache.getOrSet(
|
|
1212
|
+
{ key: 'session:abc' },
|
|
1213
|
+
() => ({ token: crypto.randomUUID() }),
|
|
1214
|
+
{}
|
|
1215
|
+
);
|
|
1216
|
+
|
|
1217
|
+
// --- Sliding expiration (renewed on every get) ---
|
|
1218
|
+
|
|
1219
|
+
await cache.set({ key: 'live' }, 'data', { slidingExpiration: 30_000 });
|
|
1220
|
+
// expiresAt = now + 30 s; reset to now + 30 s on each get()
|
|
1221
|
+
|
|
1222
|
+
// --- Sliding expiration with absolute cap ---
|
|
1223
|
+
|
|
1224
|
+
await cache.set({ key: 'bounded' }, 'data', {
|
|
1225
|
+
slidingExpiration: 5 * 60_000, // renew up to 5 min on each get
|
|
1226
|
+
absoluteExpiration: Date.now() + 3_600_000, // but never past 1 hour from now
|
|
1227
|
+
});
|
|
1228
|
+
|
|
1229
|
+
// --- Manual eviction ---
|
|
1230
|
+
|
|
1231
|
+
await cache.deleteExpired(); // uses Date.now()
|
|
1232
|
+
await cache.deleteExpired(Date.now() + 60_000); // treat everything expiring in the next minute as expired
|
|
1233
|
+
|
|
1234
|
+
// --- Eviction event ---
|
|
1235
|
+
|
|
1236
|
+
cache.addEventListener('evict', (e) => {
|
|
1237
|
+
console.log('Evicted:', e.detail.records.map(r => r.key));
|
|
1238
|
+
});
|
|
1239
|
+
|
|
1240
|
+
// --- Cleanup ---
|
|
1241
|
+
|
|
1242
|
+
cache[Symbol.dispose](); // stops background timer, closes DB
|
|
1243
|
+
// or:
|
|
1244
|
+
using c = await PersistentCache.open('temp'); // auto-disposed at block exit (TS 5.2+)
|
|
1245
|
+
```
|
|
1246
|
+
|
|
1247
|
+
---
|
|
1248
|
+
|
|
836
1249
|
## License
|
|
837
1250
|
|
|
838
1251
|
Proprietary — © Pavel Borodaev
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type IMemoryCache<TKey = any, TValue = any> = {
|
|
2
2
|
get keys(): Iterable<TKey>;
|
|
3
3
|
getKeys: () => Iterable<TKey>;
|
|
4
4
|
get: (key: TKey) => TValue;
|
|
@@ -11,7 +11,7 @@ export interface IMemoryCache<TKey = any, TValue = any> {
|
|
|
11
11
|
clear: () => void;
|
|
12
12
|
get entries(): Iterable<[TKey, TValue]>;
|
|
13
13
|
getEntries: () => Iterable<[TKey, TValue]>;
|
|
14
|
-
}
|
|
14
|
+
};
|
|
15
15
|
export declare class MemoryCache<TKey = any, TValue = any> implements IMemoryCache {
|
|
16
16
|
private map;
|
|
17
17
|
constructor();
|
|
@@ -29,5 +29,4 @@ export declare class MemoryCache<TKey = any, TValue = any> implements IMemoryCac
|
|
|
29
29
|
getEntries(): MapIterator<[TKey, TValue]>;
|
|
30
30
|
get entries(): MapIterator<[TKey, TValue]>;
|
|
31
31
|
}
|
|
32
|
-
export declare const globalMemoryCache: MemoryCache<any, any>;
|
|
33
32
|
//# sourceMappingURL=memoryCache.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memoryCache.d.ts","sourceRoot":"","sources":["../../src/cache/memoryCache.ts"],"names":[],"mappings":"AAAA,MAAM,
|
|
1
|
+
{"version":3,"file":"memoryCache.d.ts","sourceRoot":"","sources":["../../src/cache/memoryCache.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,CAAC,IAAI,GAAG,GAAG,EAAE,MAAM,GAAG,GAAG,IAAI;IACjD,IAAI,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC3B,OAAO,EAAE,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC9B,GAAG,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,MAAM,CAAC;IAC3B,QAAQ,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,OAAO,CAAC;IACjC,MAAM,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,IAAI,CAAC;IAC5B,GAAG,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,KAAK,IAAI,CAAC;IACvE,IAAI,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/B,SAAS,EAAE,MAAM,QAAQ,CAAC,MAAM,CAAC,CAAC;IAClC,QAAQ,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,KAAK,MAAM,CAAC;IAC9E,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,OAAO,IAAI,QAAQ,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IACxC,UAAU,EAAE,MAAM,QAAQ,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;CAC9C,CAAC;AAEF,qBAAa,WAAW,CAAC,IAAI,GAAG,GAAG,EAAE,MAAM,GAAG,GAAG,CAAE,YAAW,YAAY;IACtE,OAAO,CAAC,GAAG,CAAoB;;IAM/B,IAAI,IAAI,sBAEP;IAED,OAAO;IAIP,GAAG,CAAC,GAAG,EAAE,IAAI;IAIb,QAAQ,CAAC,GAAG,EAAE,IAAI;IAIlB,MAAM,CAAC,GAAG,EAAE,IAAI;IAIhB,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC;IAQ3D,IAAI,MAAM,QAET;IAED,SAAS;IAIT,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC;IAahE,KAAK;IAIL,IAAI,IAAI,WAEP;IAED,UAAU;IAIV,IAAI,OAAO,gCAEV;CACJ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class i {
|
|
2
2
|
map;
|
|
3
3
|
constructor() {
|
|
4
4
|
this.map = /* @__PURE__ */ new Map();
|
|
@@ -43,9 +43,7 @@ class s {
|
|
|
43
43
|
return this.map.entries();
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
const n = new s();
|
|
47
46
|
export {
|
|
48
|
-
|
|
49
|
-
n as globalMemoryCache
|
|
47
|
+
i as MemoryCache
|
|
50
48
|
};
|
|
51
49
|
//# sourceMappingURL=memoryCache.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memoryCache.es.js","sources":["D:/Src/my/actdim/public/utico/src/cache/memoryCache.ts"],"sourcesContent":null,"names":["MemoryCache","key","valueOrValueFactory"
|
|
1
|
+
{"version":3,"file":"memoryCache.es.js","sources":["D:/Src/my/actdim/public/utico/src/cache/memoryCache.ts"],"sourcesContent":null,"names":["MemoryCache","key","valueOrValueFactory"],"mappings":"AAeO,MAAMA,EAA8D;AAAA,EAC/D;AAAA,EAER,cAAc;AACV,SAAK,0BAAU,IAAA;AAAA,EACnB;AAAA,EAEA,IAAI,OAAO;AACP,WAAO,KAAK,IAAI,KAAA;AAAA,EACpB;AAAA,EAEA,UAAU;AACN,WAAO,KAAK;AAAA,EAChB;AAAA,EAEA,IAAIC,GAAW;AACX,WAAO,KAAK,IAAI,IAAIA,CAAG;AAAA,EAC3B;AAAA,EAEA,SAASA,GAAW;AAChB,WAAO,KAAK,IAAI,IAAIA,CAAG;AAAA,EAC3B;AAAA,EAEA,OAAOA,GAAW;AACd,SAAK,IAAI,OAAOA,CAAG;AAAA,EACvB;AAAA,EAEA,IAAIA,GAAWC,GAA8C;AACzD,IAAIA,aAA+B,WAC/B,KAAK,IAAI,IAAID,GAAKC,EAAA,CAAqB,IAEvC,KAAK,IAAI,IAAID,GAAKC,CAAmB;AAAA,EAE7C;AAAA,EAEA,IAAI,SAAS;AACT,WAAO,KAAK,UAAA;AAAA,EAChB;AAAA,EAEA,YAAY;AACR,WAAO,KAAK;AAAA,EAChB;AAAA,EAEA,SAASD,GAAWC,GAA8C;AAC9D,WAAK,KAAK,SAASD,CAAG,MAEdC,aAA+B,WAE/B,KAAK,IAAI,IAAID,GAAKC,EAAA,CAAqB,IAEvC,KAAK,IAAI,IAAID,GAAKC,CAAmB,IAGtC,KAAK,IAAID,CAAG;AAAA,EACvB;AAAA,EAEA,QAAQ;AACJ,SAAK,IAAI,MAAA;AAAA,EACb;AAAA,EAEA,IAAI,OAAO;AACP,WAAO,KAAK,IAAI;AAAA,EACpB;AAAA,EAEA,aAAa;AACT,WAAO,KAAK;AAAA,EAChB;AAAA,EAEA,IAAI,UAAU;AACV,WAAO,KAAK,IAAI,QAAA;AAAA,EACpB;AACJ;"}
|
|
@@ -39,12 +39,14 @@ export declare class PersistentCache extends StructEventTarget<PersistentCacheEv
|
|
|
39
39
|
bulkDelete(keys: string[]): Promise<void>;
|
|
40
40
|
clear(): Promise<void>;
|
|
41
41
|
private onGetMetadata;
|
|
42
|
-
scheduleServiceJob
|
|
42
|
+
private scheduleServiceJob;
|
|
43
43
|
deleteExpired(ts?: number): Promise<string[]>;
|
|
44
|
+
private getInternal;
|
|
44
45
|
get<TValue = any>(key: string): Promise<StoreItem<CacheMetadataRecord, TValue>>;
|
|
45
46
|
private onCreateMetadata;
|
|
47
|
+
private setInternal;
|
|
46
48
|
set<TValue = any>(metadataRecord: CacheMetadataRecord, value: TValue, options: CacheOptions): Promise<string>;
|
|
47
|
-
getOrSet<TValue = any>(metadataRecord: CacheMetadataRecord, factory: (metadataRecord: CacheMetadataRecord) => TValue, options: CacheOptions): Promise<StoreItem<CacheMetadataRecord,
|
|
49
|
+
getOrSet<TValue = any>(metadataRecord: CacheMetadataRecord, factory: (metadataRecord: CacheMetadataRecord) => TValue, options: CacheOptions): Promise<StoreItem<CacheMetadataRecord, TValue>>;
|
|
48
50
|
bulkGet<TValue = any>(keys: string[]): Promise<StoreItem<CacheMetadataRecord, TValue>[]>;
|
|
49
51
|
bulkSet<TValue = any>(metadataRecords: CacheMetadataRecord[], dataRecords: DataRecord<TValue>[], optionsProvider: (record: MetadataRecord) => CacheOptions): Promise<string[]>;
|
|
50
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persistentCache.d.ts","sourceRoot":"","sources":["../../src/cache/persistentCache.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE/D,OAAO,EAAE,UAAU,EAAY,cAAc,EAAE,SAAS,EAAmB,MAAM,wBAAwB,CAAC;AAC1G,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,KAAK,QAAQ,GAAG,MAAM,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhF,MAAM,MAAM,sBAAsB,GAAG;IACjC,cAAc,EAA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IAqBrB,OAAO,CAAC,kBAAkB;IAmBpB,aAAa,CAAC,EAAE,CAAC,EAAE,MAAM;YA0BjB,WAAW;IAWzB,GAAG,CAAC,MAAM,GAAG,GAAG,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IAI/E,OAAO,CAAC,gBAAgB;YAuBV,WAAW;IAOnB,GAAG,CAAC,MAAM,GAAG,GAAG,EAAE,cAAc,EAAE,mBAAmB,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY;IAY3F,QAAQ,CAAC,MAAM,GAAG,GAAG,EAAE,cAAc,EAAE,mBAAmB,EAAE,OAAO,EAAE,CAAC,cAAc,EAAE,mBAAmB,KAAK,MAAM,EAAE,OAAO,EAAE,YAAY;IAgBjJ,OAAO,CAAC,MAAM,GAAG,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE;IAwB9B,OAAO,CAAC,MAAM,GAAG,GAAG,EAAE,eAAe,EAAE,mBAAmB,EAAE,EAAE,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,EAAE,eAAe,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,YAAY;CA4BnK"}
|
|
@@ -4,7 +4,7 @@ import { v4 as o } from "uuid";
|
|
|
4
4
|
import { StoreDb as n } from "../store/storeDb.es.js";
|
|
5
5
|
const p = {
|
|
6
6
|
cleanupTimeout: 1e3
|
|
7
|
-
}, c = ["&key", "createdAt", "updatedAt", "tags", "accessedAt", "expiresAt"],
|
|
7
|
+
}, c = ["&key", "createdAt", "updatedAt", "tags", "accessedAt", "expiresAt"], f = d(b);
|
|
8
8
|
class l extends h {
|
|
9
9
|
_db;
|
|
10
10
|
_isDisposed;
|
|
@@ -23,10 +23,10 @@ class l extends h {
|
|
|
23
23
|
constructor(t, e) {
|
|
24
24
|
if (super(), !t)
|
|
25
25
|
throw new Error("Name cannot be empty.");
|
|
26
|
-
this._options = { ...
|
|
26
|
+
this._options = { ...p, ...e }, this._db = new n(t, c), this._jobTimerId = null, this.scheduleServiceJob();
|
|
27
27
|
}
|
|
28
28
|
[Symbol.dispose]() {
|
|
29
|
-
this._isDisposed || this._jobTimerId && (
|
|
29
|
+
this._isDisposed || (this._isDisposed = !0, this._jobTimerId && (clearTimeout(this._jobTimerId), this._jobTimerId = null)), this._db?.[Symbol.dispose](), this._db = null;
|
|
30
30
|
}
|
|
31
31
|
open() {
|
|
32
32
|
return this._db.open();
|
|
@@ -54,7 +54,7 @@ class l extends h {
|
|
|
54
54
|
onGetMetadata(t) {
|
|
55
55
|
const e = Date.now();
|
|
56
56
|
t.accessedAt = e;
|
|
57
|
-
let i = t.expiresAt ?? e;
|
|
57
|
+
let i = t.expiresAt ?? t.absoluteExpiration ?? e;
|
|
58
58
|
typeof t.slidingExpiration == "number" && t.slidingExpiration > 0 && (i = e + t.slidingExpiration), typeof t.absoluteExpiration == "number" && t.absoluteExpiration > 0 && i > t.absoluteExpiration && (i = t.absoluteExpiration), t.expiresAt = i;
|
|
59
59
|
}
|
|
60
60
|
scheduleServiceJob() {
|
|
@@ -65,10 +65,10 @@ class l extends h {
|
|
|
65
65
|
} catch (e) {
|
|
66
66
|
console.error("Cache cleanup failed:", e);
|
|
67
67
|
} finally {
|
|
68
|
-
setTimeout(t, this._options.cleanupTimeout);
|
|
68
|
+
this._isDisposed || (this._jobTimerId = setTimeout(t, this._options.cleanupTimeout));
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
|
-
setTimeout(t, this._options.cleanupTimeout);
|
|
71
|
+
this._jobTimerId = setTimeout(t, this._options.cleanupTimeout);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
// evictExpiredAsync/clearExpiredAsync
|
|
@@ -79,9 +79,9 @@ class l extends h {
|
|
|
79
79
|
if (await this.exec(async () => {
|
|
80
80
|
i = await this._db.metadata.where(u("expiresAt")).below(t).toArray();
|
|
81
81
|
const s = i.map((a) => a.key);
|
|
82
|
-
await this.bulkDelete(s);
|
|
82
|
+
e.push(...s), await this._db.bulkDelete(s);
|
|
83
83
|
}, "rw"), i?.length) {
|
|
84
|
-
const s = new
|
|
84
|
+
const s = new f("evict", {
|
|
85
85
|
detail: {
|
|
86
86
|
records: i
|
|
87
87
|
},
|
|
@@ -92,40 +92,39 @@ class l extends h {
|
|
|
92
92
|
}
|
|
93
93
|
return e;
|
|
94
94
|
}
|
|
95
|
+
async getInternal(t) {
|
|
96
|
+
const e = await this._db.metadata.get(t);
|
|
97
|
+
this.onGetMetadata(e), await this._db.metadata.put(e);
|
|
98
|
+
const i = await this._db.data.get(t);
|
|
99
|
+
return {
|
|
100
|
+
metadata: e,
|
|
101
|
+
data: i
|
|
102
|
+
};
|
|
103
|
+
}
|
|
95
104
|
get(t) {
|
|
96
|
-
return this.exec(
|
|
97
|
-
const e = await this._db.metadata.get(t);
|
|
98
|
-
this.onGetMetadata(e), await this._db.metadata.put(e);
|
|
99
|
-
const i = await this._db.data.get(t);
|
|
100
|
-
return {
|
|
101
|
-
metadata: e,
|
|
102
|
-
data: i
|
|
103
|
-
};
|
|
104
|
-
}, "rw");
|
|
105
|
+
return this.exec(() => this.getInternal(t), "rw");
|
|
105
106
|
}
|
|
106
107
|
onCreateMetadata(t, e) {
|
|
107
108
|
const i = Date.now();
|
|
108
109
|
t.createdAt = i, t.updatedAt = i, t.accessedAt = i, t.slidingExpiration = e.slidingExpiration, typeof e.absoluteExpiration == "number" ? t.absoluteExpiration = e.absoluteExpiration : e.absoluteExpiration instanceof Date && (t.absoluteExpiration = e.absoluteExpiration.getTime()), typeof e.ttl == "number" && (t.absoluteExpiration = i + e.ttl), t.absoluteExpiration == null && (t.absoluteExpiration = 1 / 0), this.onGetMetadata(t);
|
|
109
110
|
}
|
|
111
|
+
async setInternal(t, e) {
|
|
112
|
+
const i = await this._db.metadata.put(t);
|
|
113
|
+
return await this._db.data.put({ key: t.key, value: e }), i;
|
|
114
|
+
}
|
|
110
115
|
// upsert
|
|
111
116
|
async set(t, e, i) {
|
|
112
117
|
if (e === void 0)
|
|
113
118
|
throw new Error('Invalid parameter: "value".');
|
|
114
|
-
return t.key || (t.key = o()), this.onCreateMetadata(t, i), this.exec(
|
|
115
|
-
const s = await this._db.metadata.put(t);
|
|
116
|
-
return await this._db.data.put({
|
|
117
|
-
key: t.key,
|
|
118
|
-
value: e
|
|
119
|
-
}), s;
|
|
120
|
-
}, "rw");
|
|
119
|
+
return t.key || (t.key = o()), this.onCreateMetadata(t, i), this.exec(() => this.setInternal(t, e), "rw");
|
|
121
120
|
}
|
|
122
121
|
// getOrAdd
|
|
123
122
|
async getOrSet(t, e, i) {
|
|
124
123
|
if (!t.key)
|
|
125
124
|
throw new Error('Key cannot be empty. Parameter: "metadataRecord".');
|
|
126
125
|
return this.exec(async () => {
|
|
127
|
-
const s = await this.
|
|
128
|
-
return s || (await this.
|
|
126
|
+
const s = await this.getInternal(t.key);
|
|
127
|
+
return s || (this.onCreateMetadata(t, i), await this.setInternal(t, e(t)), this.getInternal(t.key));
|
|
129
128
|
}, "rw");
|
|
130
129
|
}
|
|
131
130
|
// getMany
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persistentCache.es.js","sources":["D:/Src/my/actdim/public/utico/src/cache/persistentCache.ts"],"sourcesContent":null,"names":["defaultPersistentCacheOptions","metadataFieldDefTemplate","PersistentCacheEvent","typed","StructEvent","PersistentCache","StructEventTarget","name","StoreDb","options","action","transactionMode","key","keys","record","now","newExpiresAt","doWork","err","ts","result","metadataRecords","keyOf","x","evt","metadataRecord","dataRecord","value","uuid","factory","existingStoreItem","map","dataRecords","item","optionsProvider","index","mKeys"],"mappings":";;;;AAaA,MAAMA,IAAgC;AAAA,EAClC,gBAAgB;AACpB,GAkBMC,IAA2B,CAAC,QAAQ,aAAa,aAAa,QAAQ,cAAc,WAAW,GAa/FC,IAAuBC,EAAMC,CAAwD;AAOpF,MAAMC,UAAwBC,EAA8C;AAAA,EAErE;AAAA,EAEA;AAAA,EAEF;AAAA,EAES;AAAA,EAEjB,OAAO,OAAOC,GAAc;AACxB,WAAOC,EAAQ,OAAOD,CAAI;AAAA,EAC9B;AAAA,EAEA,OAAO,OAAOA,GAAc;AACxB,WAAOC,EAAQ,OAAOD,CAAI;AAAA,EAC9B;AAAA,EAEA,OAAO,KAAKA,GAAcE,GAAkC;AACxD,WAAOD,EAAQ,KAAKD,GAAM,MAAM,IAAIF,EAAgBE,GAAME,CAAO,CAAC;AAAA,EACtE;AAAA;AAAA,EAGA,YAAYF,GAAcE,GAAiC;AAEvD,QADA,MAAA,GACI,CAACF;AACD,YAAM,IAAI,MAAM,uBAAuB;AAE3C,SAAK,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"persistentCache.es.js","sources":["D:/Src/my/actdim/public/utico/src/cache/persistentCache.ts"],"sourcesContent":null,"names":["defaultPersistentCacheOptions","metadataFieldDefTemplate","PersistentCacheEvent","typed","StructEvent","PersistentCache","StructEventTarget","name","StoreDb","options","action","transactionMode","key","keys","record","now","newExpiresAt","doWork","err","ts","result","metadataRecords","keyOf","x","evt","metadataRecord","dataRecord","value","uuid","factory","existingStoreItem","map","dataRecords","item","optionsProvider","index","mKeys"],"mappings":";;;;AAaA,MAAMA,IAAgC;AAAA,EAClC,gBAAgB;AACpB,GAkBMC,IAA2B,CAAC,QAAQ,aAAa,aAAa,QAAQ,cAAc,WAAW,GAa/FC,IAAuBC,EAAMC,CAAwD;AAOpF,MAAMC,UAAwBC,EAA8C;AAAA,EAErE;AAAA,EAEA;AAAA,EAEF;AAAA,EAES;AAAA,EAEjB,OAAO,OAAOC,GAAc;AACxB,WAAOC,EAAQ,OAAOD,CAAI;AAAA,EAC9B;AAAA,EAEA,OAAO,OAAOA,GAAc;AACxB,WAAOC,EAAQ,OAAOD,CAAI;AAAA,EAC9B;AAAA,EAEA,OAAO,KAAKA,GAAcE,GAAkC;AACxD,WAAOD,EAAQ,KAAKD,GAAM,MAAM,IAAIF,EAAgBE,GAAME,CAAO,CAAC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mB,CAACW;AACrB,YAAM,IAAI,MAAM,mBAAmB;AAEvC,eAAWP,KAAkBJ;AACzB,MAAKI,EAAe,QAChBA,EAAe,MAAMG,EAAA,IAEzB,KAAK,iBAAiBH,GAAgBS,EAAgBT,CAAc,CAAC;AAEzE,WAAO,KAAK,KAAK,YAAY;AACzB,UAAIW;AACJ,aAAIf,MACAe,IAAQ,MAAM,KAAK,IAAI,SAAS,QAAQf,GAAiB,QAAW,EAAE,SAAS,IAAM,IAErFW,KACQ,MAAM,KAAK,IAAI,KAAK,QAAQA,GAAa,QAAW,EAAE,SAAS,IAAM,GAE1EI;AAAA,IACX,GAAG,IAAI;AAAA,EACX;AACJ;"}
|
package/dist/dataFormats.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
1
|
+
import { DateTime } from 'luxon';
|
|
2
|
+
export type DateTimeDataFormat = {
|
|
3
3
|
serializationFormat: string;
|
|
4
|
-
normalize: (source: string | number | Date) => Date;
|
|
5
|
-
serialize: (source: string | number | Date |
|
|
6
|
-
deserialize: (value: string) =>
|
|
7
|
-
tryDeserialize: (value: string) =>
|
|
8
|
-
isValid: (source: string |
|
|
9
|
-
}
|
|
4
|
+
normalize: (source: string | number | Date) => Date | null;
|
|
5
|
+
serialize: (source: string | number | Date | DateTime) => string | null;
|
|
6
|
+
deserialize: (value: string) => DateTime;
|
|
7
|
+
tryDeserialize: (value: string) => DateTime | null;
|
|
8
|
+
isValid: (source: string | Date) => boolean;
|
|
9
|
+
};
|
|
10
10
|
export declare enum DateNumberFormat {
|
|
11
11
|
UnixTimeMilliseconds = 0,
|
|
12
12
|
UnixTimeSeconds = 1,
|
|
@@ -14,13 +14,14 @@ export declare enum DateNumberFormat {
|
|
|
14
14
|
}
|
|
15
15
|
export declare function getDateFromOADate(oaDate: number): Date;
|
|
16
16
|
export declare function getOADateFromDate(date: Date): string;
|
|
17
|
-
export declare function getDateFromNumber(value: number, dateNumberFormat?: DateNumberFormat): Date;
|
|
17
|
+
export declare function getDateFromNumber(value: number, dateNumberFormat?: DateNumberFormat): Date | null;
|
|
18
|
+
export declare function fromLocalDate(date: Date): DateTime | null;
|
|
18
19
|
export type DateValueFormats = {
|
|
19
20
|
string?: string;
|
|
20
21
|
number?: DateNumberFormat;
|
|
21
22
|
};
|
|
22
|
-
export declare function
|
|
23
|
-
export declare function formatDate(date: Date |
|
|
24
|
-
declare const dateTimeFormat:
|
|
23
|
+
export declare function toDateTime(source: any, formats?: DateValueFormats): DateTime | null;
|
|
24
|
+
export declare function formatDate(date: Date | DateTime, format?: string): string;
|
|
25
|
+
declare const dateTimeFormat: DateTimeDataFormat;
|
|
25
26
|
export default dateTimeFormat;
|
|
26
27
|
//# sourceMappingURL=dateTimeDataFormat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateTimeDataFormat.d.ts","sourceRoot":"","sources":["../src/dateTimeDataFormat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"dateTimeDataFormat.d.ts","sourceRoot":"","sources":["../src/dateTimeDataFormat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAOjC,MAAM,MAAM,kBAAkB,GAAG;IAC7B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,KAAK,IAAI,GAAG,IAAI,CAAC;IAC3D,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,QAAQ,KAAK,MAAM,GAAG,IAAI,CAAC;IACxE,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,QAAQ,CAAC;IACzC,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,QAAQ,GAAG,IAAI,CAAC;IACnD,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,OAAO,CAAC;CAC/C,CAAC;AAEF,oBAAY,gBAAgB;IACxB,oBAAoB,IAAA;IACpB,eAAe,IAAA;IACf,MAAM,IAAA;CACT;AAWD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAOtD;AAOD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAQpD;AAED,wBAAgB,iBAAiB,CAC7B,KAAK,EAAE,MAAM,EACb,gBAAgB,mBAAwC,GACzD,IAAI,GAAG,IAAI,CAUb;AAKD,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,QAAQ,GAAG,IAAI,CAGzD;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC7B,CAAC;AAkBF,wBAAgB,UAAU,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,QAAQ,GAAG,IAAI,CAenF;AAGD,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,QAAQ,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAazE;AAED,QAAA,MAAM,cAAc,EAAE,kBA2CrB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1,97 +1,91 @@
|
|
|
1
|
-
import r from "
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
var
|
|
5
|
-
const
|
|
6
|
-
function
|
|
1
|
+
import { DateTime as r } from "luxon";
|
|
2
|
+
import f from "./i18n/cultures.es.js";
|
|
3
|
+
const o = f.invariant.dateTime.formats;
|
|
4
|
+
var c = /* @__PURE__ */ ((t) => (t[t.UnixTimeMilliseconds = 0] = "UnixTimeMilliseconds", t[t.UnixTimeSeconds = 1] = "UnixTimeSeconds", t[t.OADate = 2] = "OADate", t))(c || {});
|
|
5
|
+
const i = "yyyy-MM-dd'T'HH:mm:ss.SSS";
|
|
6
|
+
function m(t) {
|
|
7
7
|
const e = Math.floor(t), n = Math.abs((t - e) * 864e5);
|
|
8
8
|
return new Date(1899, 11, 30 + e, 0, 0, 0, n);
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
const e = new Date(t), n = new Date(1899, 11, 30),
|
|
12
|
-
return
|
|
10
|
+
function y(t) {
|
|
11
|
+
const e = new Date(t), n = new Date(1899, 11, 30), s = Math.round((e.setHours(0, 0, 0, 0) - n.getTime()) / 864e5), u = (Math.abs((t.getTime() - e.getTime()) % 864e5) / 864e5).toFixed(10);
|
|
12
|
+
return s + u.slice(1);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
if (t == null)
|
|
16
|
-
return null;
|
|
14
|
+
function d(t, e = 0) {
|
|
15
|
+
if (t == null) return null;
|
|
17
16
|
switch (e) {
|
|
18
17
|
case 0:
|
|
19
18
|
return new Date(t);
|
|
20
19
|
case 1:
|
|
21
20
|
return new Date(t * 1e3);
|
|
22
21
|
case 2:
|
|
23
|
-
return
|
|
22
|
+
return m(t);
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
return null;
|
|
29
|
-
let n;
|
|
30
|
-
if (typeof t == "string")
|
|
31
|
-
n = o(t, e?.string);
|
|
32
|
-
else if (typeof t == "number")
|
|
33
|
-
n = r(M(t, e?.number));
|
|
34
|
-
else if (t instanceof Date)
|
|
35
|
-
n = r(t);
|
|
36
|
-
else {
|
|
37
|
-
if (!r.isMoment(t))
|
|
38
|
-
throw new Error("Unsupported Moment Source");
|
|
39
|
-
n = t;
|
|
40
|
-
}
|
|
41
|
-
return n;
|
|
25
|
+
function h(t) {
|
|
26
|
+
return t == null ? null : r.fromJSDate(t).setZone("utc", { keepLocalTime: !0 });
|
|
42
27
|
}
|
|
43
|
-
function
|
|
44
|
-
if (t == null)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
console.warn(a);
|
|
51
|
-
}
|
|
52
|
-
if (!n.isValid())
|
|
53
|
-
throw new Error(`Assertion. Invalid datetime format: ${t}. Expected format: ${e || i}.`);
|
|
28
|
+
function a(t, e) {
|
|
29
|
+
if (t == null) return null;
|
|
30
|
+
const n = e ? r.fromFormat(t, e, { zone: "utc" }) : r.fromISO(t, { zone: "utc" });
|
|
31
|
+
if (!n.isValid)
|
|
32
|
+
throw new Error(
|
|
33
|
+
`Assertion. Invalid datetime format: ${t}. Expected format: ${e ?? i}.`
|
|
34
|
+
);
|
|
54
35
|
return n;
|
|
55
36
|
}
|
|
56
|
-
function
|
|
57
|
-
if (t == null)
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
37
|
+
function l(t, e) {
|
|
38
|
+
if (t == null) return null;
|
|
39
|
+
if (typeof t == "string")
|
|
40
|
+
return a(t, e?.string);
|
|
41
|
+
if (typeof t == "number")
|
|
42
|
+
return r.fromJSDate(d(t, e?.number), { zone: "utc" });
|
|
43
|
+
if (t instanceof Date)
|
|
44
|
+
return r.fromJSDate(t, { zone: "utc" });
|
|
45
|
+
if (r.isDateTime(t))
|
|
46
|
+
return t;
|
|
47
|
+
throw new Error("Unsupported DateTime source");
|
|
61
48
|
}
|
|
62
|
-
|
|
49
|
+
function w(t, e) {
|
|
50
|
+
if (t == null) return "";
|
|
51
|
+
const n = l(t);
|
|
52
|
+
return e == null && (!n.hour && !n.minute && !n.second ? e = o.dateShort : n.millisecond ? e = o.dateTime24 : e = o.dateTime24Short), n.toFormat(e);
|
|
53
|
+
}
|
|
54
|
+
const D = {
|
|
63
55
|
serializationFormat: i,
|
|
64
|
-
isValid: (t) =>
|
|
65
|
-
|
|
66
|
-
if (t == null)
|
|
67
|
-
return null;
|
|
56
|
+
isValid: (t) => {
|
|
57
|
+
if (t == null) return !0;
|
|
68
58
|
if (typeof t == "string")
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
59
|
+
try {
|
|
60
|
+
return a(t), !0;
|
|
61
|
+
} catch {
|
|
62
|
+
return !1;
|
|
63
|
+
}
|
|
64
|
+
return t instanceof Date;
|
|
65
|
+
},
|
|
66
|
+
normalize: (t) => {
|
|
67
|
+
if (t == null) return null;
|
|
68
|
+
const e = l(t);
|
|
69
|
+
return new Date(e.toFormat(i));
|
|
77
70
|
},
|
|
78
|
-
serialize: (t, e) => t == null ? null :
|
|
79
|
-
deserialize: (t) =>
|
|
71
|
+
serialize: (t, e) => t == null ? null : l(t, e).toFormat(i),
|
|
72
|
+
deserialize: (t) => a(t),
|
|
80
73
|
tryDeserialize: (t) => {
|
|
81
74
|
try {
|
|
82
|
-
return
|
|
75
|
+
return D.deserialize(t);
|
|
83
76
|
} catch (e) {
|
|
84
77
|
return console.error(e), null;
|
|
85
78
|
}
|
|
86
79
|
}
|
|
87
80
|
};
|
|
88
81
|
export {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
82
|
+
c as DateNumberFormat,
|
|
83
|
+
D as default,
|
|
84
|
+
w as formatDate,
|
|
85
|
+
h as fromLocalDate,
|
|
86
|
+
d as getDateFromNumber,
|
|
87
|
+
m as getDateFromOADate,
|
|
88
|
+
y as getOADateFromDate,
|
|
89
|
+
l as toDateTime
|
|
96
90
|
};
|
|
97
91
|
//# sourceMappingURL=dateTimeDataFormat.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateTimeDataFormat.es.js","sources":["D:/Src/my/actdim/public/utico/src/dateTimeDataFormat.ts"],"sourcesContent":null,"names":["dtFormats","cultures","DateNumberFormat","
|
|
1
|
+
{"version":3,"file":"dateTimeDataFormat.es.js","sources":["D:/Src/my/actdim/public/utico/src/dateTimeDataFormat.ts"],"sourcesContent":null,"names":["dtFormats","cultures","DateNumberFormat","s11nFormat","getDateFromOADate","oaDate","days","ms","getOADateFromDate","date","temp","stDate","partDay","getDateFromNumber","value","dateNumberFormat","fromLocalDate","DateTime","parse","format","dt","toDateTime","source","formats","formatDate","dateTimeFormat","err"],"mappings":";;AAKA,MAAMA,IAAYC,EAAS,UAAU,SAAS;AAWvC,IAAKC,sBAAAA,OACRA,EAAAA,EAAA,uBAAA,CAAA,IAAA,wBACAA,EAAAA,EAAA,kBAAA,CAAA,IAAA,mBACAA,EAAAA,EAAA,SAAA,CAAA,IAAA,UAHQA,IAAAA,KAAA,CAAA,CAAA;AAOZ,MAAMC,IAAa;AAQZ,SAASC,EAAkBC,GAAsB;AAEpD,QAAMC,IAAO,KAAK,MAAMD,CAAM,GAExBE,IAAK,KAAK,KAAKF,IAASC,KAAQ,KAAM;AAE5C,SAAO,IAAI,KAAK,MAAM,IAAI,KAAKA,GAAM,GAAG,GAAG,GAAGC,CAAE;AACpD;AAOO,SAASC,EAAkBC,GAAoB;AAClD,QAAMC,IAAO,IAAI,KAAKD,CAAI,GAEpBE,IAAS,IAAI,KAAK,MAAM,IAAI,EAAE,GAC9BL,IAAO,KAAK,OAAOI,EAAK,SAAS,GAAG,GAAG,GAAG,CAAC,IAAIC,EAAO,QAAA,KAAa,KAAM,GAEzEC,KAAW,KAAK,KAAKH,EAAK,QAAA,IAAYC,EAAK,QAAA,KAAa,KAAM,IAAI,OAAQ,QAAQ,EAAE;AAC1F,SAAOJ,IAAOM,EAAQ,MAAM,CAAC;AACjC;AAEO,SAASC,EACZC,GACAC,IAAmB,GACR;AACX,MAAID,KAAS,KAAM,QAAO;AAC1B,UAAQC,GAAA;AAAA,IACJ,KAAK;AACD,aAAO,IAAI,KAAKD,CAAK;AAAA,IACzB,KAAK;AACD,aAAO,IAAI,KAAKA,IAAQ,GAAI;AAAA,IAChC,KAAK;AACD,aAAOV,EAAkBU,CAAK;AAAA,EAAA;AAE1C;AAKO,SAASE,EAAcP,GAA6B;AACvD,SAAIA,KAAQ,OAAa,OAClBQ,EAAS,WAAWR,CA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ACX,QAAQ;AACJ,eAAO;AAAA,MACX;AAEJ,WAAIA,aAAkB;AAAA,EAE1B;AAAA,EAEA,WAAW,CAACA,MAAW;AACnB,QAAIA,KAAU,KAAM,QAAO;AAC3B,UAAMF,IAAKC,EAAWC,CAAM;AAI5B,WAAO,IAAI,KAAKF,EAAG,SAASjB,CAAU,CAAC;AAAA,EAE3C;AAAA,EAEA,WAAW,CAACmB,GAAQC,MACZD,KAAU,OAAa,OAChBD,EAAWC,GAAQC,CAAO,EAC3B,SAASpB,CAAU;AAAA,EAGjC,aAAa,CAACW,MAAUI,EAAMJ,CAAK;AAAA,EAEnC,gBAAgB,CAACA,MAAU;AACvB,QAAI;AACA,aAAOW,EAAe,YAAYX,CAAK;AAAA,IAC3C,SAASY,GAAK;AACV,qBAAQ,MAAMA,CAAG,GACV;AAAA,IACX;AAAA,EACJ;AACJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enUsCulture.d.ts","sourceRoot":"","sources":["../../src/i18n/enUsCulture.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"enUsCulture.d.ts","sourceRoot":"","sources":["../../src/i18n/enUsCulture.ts"],"names":[],"mappings":"AAqCA,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwChB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -3,33 +3,32 @@ const m = {
|
|
|
3
3
|
formats: {
|
|
4
4
|
// The leading zero is more commonly used with the 24-hour notation
|
|
5
5
|
// especially in computer applications because it can help to maintain column alignment in tables and correct sorting order
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
dateShort: "M/D/YYYY",
|
|
6
|
+
// a = AM/PM (Luxon), yyyy = 4-digit year, dd = 2-digit day
|
|
7
|
+
dateTime: "MM/dd/yyyy hh:mm:ss.SSS a",
|
|
8
|
+
dateTime24: "MM/dd/yyyy HH:mm:ss.SSS",
|
|
9
|
+
dateTimeShort: "M/d/yyyy h:mm:ss a",
|
|
10
|
+
dateTime24Short: "M/d/yyyy HH:mm:ss",
|
|
11
|
+
dataTimeHM: "MM/dd/yyyy hh:mm a",
|
|
12
|
+
dataTimeH24M: "MM/dd/yyyy HH:mm",
|
|
13
|
+
dataTimeHMShort: "MM/dd/yyyy h:mm a",
|
|
14
|
+
dataTimeH24MShort: "MM/dd/yyyy H:mm",
|
|
15
|
+
date: "MM/dd/yyyy",
|
|
16
|
+
dateShort: "M/d/yyyy",
|
|
18
17
|
// timeHMSS
|
|
19
|
-
time: "hh:mm:ss.SSS
|
|
18
|
+
time: "hh:mm:ss.SSS a",
|
|
20
19
|
// timeH24MSS
|
|
21
20
|
time24: "HH:mm:ss.SSS",
|
|
22
21
|
// timeHMSSShort
|
|
23
|
-
timeShort: "h:mm:ss.SSS
|
|
22
|
+
timeShort: "h:mm:ss.SSS a",
|
|
24
23
|
// timeH24MSSShort
|
|
25
24
|
time24Short: "H:mm:ss.SSS",
|
|
26
|
-
timeHM: "hh:mm
|
|
25
|
+
timeHM: "hh:mm a",
|
|
27
26
|
timeH24M: "HH:mm",
|
|
28
|
-
timeHMShort: "h:mm
|
|
27
|
+
timeHMShort: "h:mm a",
|
|
29
28
|
timeH24MShort: "H:mm",
|
|
30
|
-
timeHMS: "hh:mm:ss
|
|
29
|
+
timeHMS: "hh:mm:ss a",
|
|
31
30
|
timeH24MS: "HH:mm:ss",
|
|
32
|
-
timeHMSShort: "h:mm:ss
|
|
31
|
+
timeHMSShort: "h:mm:ss a",
|
|
33
32
|
timeH24MSShort: "H:mm:ss"
|
|
34
33
|
}
|
|
35
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enUsCulture.es.js","sources":["D:/Src/my/actdim/public/utico/src/i18n/enUsCulture.ts"],"sourcesContent":null,"names":["enUsCulture"],"mappings":"
|
|
1
|
+
{"version":3,"file":"enUsCulture.es.js","sources":["D:/Src/my/actdim/public/utico/src/i18n/enUsCulture.ts"],"sourcesContent":null,"names":["enUsCulture"],"mappings":"AAqCA,MAAMA,IAAc;AAAA,EAChB,UAAU;AAAA,IACN,SAAS;AAAA;AAAA;AAAA;AAAA,MAKL,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,eAAe;AAAA,MACf,iBAAiB;AAAA,MAEjB,YAAY;AAAA,MACZ,cAAc;AAAA,MACd,iBAAiB;AAAA,MACjB,mBAAmB;AAAA,MAEnB,MAAM;AAAA,MACN,WAAW;AAAA;AAAA,MAGX,MAAM;AAAA;AAAA,MAEN,QAAQ;AAAA;AAAA,MAER,WAAW;AAAA;AAAA,MAEX,aAAa;AAAA,MAEb,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,aAAa;AAAA,MACb,eAAe;AAAA,MAEf,SAAS;AAAA,MACT,WAAW;AAAA,MACX,cAAc;AAAA,MACd,gBAAgB;AAAA,IAAA;AAAA,EACpB;AAER;"}
|
|
@@ -81,6 +81,8 @@ export interface IPersistentStore<T extends MetadataRecord = MetadataRecord> {
|
|
|
81
81
|
distinct(field: keyof T): IStoreCollection<T>;
|
|
82
82
|
query<TValue = unknown>(): IStoreCollection<T, TValue>;
|
|
83
83
|
where<K extends keyof T, TValue = unknown>(field: K extends string ? K : never): WhereFilter<T[K] extends IndexableType ? T[K] : never, IStoreCollection<T, TValue>>;
|
|
84
|
+
update<TValue = unknown>(key: string, metadataChanges: KeyPathValueMap<T>, valueChanges?: KeyPathValueMap<TValue>, transactionMode?: TransactionMode): Promise<number>;
|
|
85
|
+
bulkUpdate(metadataChangeSets: ChangeSet<T>[], dataChangeSets?: ChangeSet<DataRecord>[], transactionMode?: TransactionMode): Promise<number>;
|
|
84
86
|
[Symbol.dispose]: () => void;
|
|
85
87
|
}
|
|
86
88
|
//# sourceMappingURL=storeContracts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{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AAE,KAAK,EAAE,CAAC,SAAS,MAAM,GAAG,CAAC,GAAG,KAAK,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,aAAa,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,gBAAgB,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IAErK,MAAM,CAAC,MAAM,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,eAAe,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEvK,UAAU,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,cAAc,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,EAAE,EAAE,eAAe,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE7I,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CAChC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@actdim/utico",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "A modern foundation toolkit for complex TypeScript apps",
|
|
5
5
|
"author": "Pavel Borodaev",
|
|
6
6
|
"license": "Proprietary",
|
|
@@ -67,10 +67,11 @@
|
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"dexie": "^4.2.0",
|
|
70
|
-
"
|
|
71
|
-
"
|
|
70
|
+
"uuid": "^13.0.0",
|
|
71
|
+
"luxon": "^3.7.2"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
+
"luxon": "^3.7.2",
|
|
74
75
|
"@eslint/js": "^9.39.2",
|
|
75
76
|
"@types/chai": "^5.2.3",
|
|
76
77
|
"@types/mocha": "^10.0.10",
|
|
@@ -96,5 +97,6 @@
|
|
|
96
97
|
"vite-plugin-dts": "^4.5.4",
|
|
97
98
|
"vite-tsconfig-paths": "^5.1.4",
|
|
98
99
|
"vitest": "^4.0.8"
|
|
99
|
-
}
|
|
100
|
+
},
|
|
101
|
+
"dependencies": {}
|
|
100
102
|
}
|