@nymphjs/nymph 1.0.0-beta.116 → 1.0.0-beta.118

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,7 +1,7 @@
1
1
  import { dirname } from 'node:path';
2
2
  import { fileURLToPath } from 'node:url';
3
3
  import fs from 'node:fs';
4
- import strtotime from 'locutus/php/datetime/strtotime.js';
4
+ import { strtotime } from 'locutus/php/datetime/index';
5
5
  import { guid } from '@nymphjs/guid';
6
6
 
7
7
  import type Nymph from '../Nymph.js';
@@ -60,7 +60,7 @@ export function EntitiesTest(
60
60
 
61
61
  const entityReferenceTest: TestModelClass & TestModelData = new TestModel();
62
62
  entityReferenceTest.string = 'wrong';
63
- entityReferenceTest.timestamp = strtotime('-2 days') * 1000;
63
+ entityReferenceTest.timestamp = (strtotime('-2 days') || 0) * 1000;
64
64
  expect(await entityReferenceTest.$save()).toEqual(true);
65
65
  refGuid = entityReferenceTest.guid as string;
66
66
  testEntity.reference = entityReferenceTest;
@@ -2477,7 +2477,9 @@ export function ExportImportTest(
2477
2477
  expect(model.match).toEqual(matchValue);
2478
2478
  expect(model.number).toEqual(30);
2479
2479
  expect(model.numberString).toEqual('30');
2480
- expect(model.timestamp).toBeGreaterThanOrEqual(strtotime('-2 minutes'));
2480
+ expect(model.timestamp).toBeGreaterThanOrEqual(
2481
+ strtotime('-2 minutes') || 0,
2482
+ );
2481
2483
  expect(model.index).toMatch(/^\d+a$/);
2482
2484
 
2483
2485
  await model.reference?.$wake();
package/tsconfig.json CHANGED
@@ -2,10 +2,11 @@
2
2
  "extends": "@tsconfig/recommended/tsconfig.json",
3
3
 
4
4
  "compilerOptions": {
5
- "module": "ES2022",
6
- "moduleResolution": "node",
7
- "lib": ["ES2022"],
8
- "target": "ES2022",
5
+ "types": ["node", "jest"],
6
+ "module": "nodenext",
7
+ "moduleResolution": "nodenext",
8
+ "lib": ["es2023"],
9
+ "target": "es2023",
9
10
  "noImplicitAny": true,
10
11
  "removeComments": false,
11
12
  "sourceMap": true,
package/dist/conf/d.d.ts DELETED
@@ -1,49 +0,0 @@
1
- /**
2
- * Nymph Config
3
- */
4
- export interface Config {
5
- /**
6
- * Cache recently retrieved entities to speed up database queries. Uses more
7
- * memory.
8
- */
9
- cache: boolean;
10
- /**
11
- * Cache entities after they're accessed this many times.
12
- */
13
- cacheThreshold: number;
14
- /**
15
- * The number of recently retrieved entities to cache. If you're running out
16
- * of memory, try lowering this value. 0 means unlimited.
17
- */
18
- cacheLimit: number;
19
- /**
20
- * When querying for multiple entities with NymphREST, if the list is empty,
21
- * return a 404 error.
22
- */
23
- emptyListError: boolean;
24
- /**
25
- * Whether to update the mdate property when saving an entity.
26
- *
27
- * You should probably only set this to false if you're doing migrations. Some
28
- * things depend on having updated mdates (like conflict detection to avoid
29
- * lost updates).
30
- *
31
- * If you set this to a number, that amount of milliseconds will be added to
32
- * the mdate on any entities that are saved. This should solve the lost update
33
- * problem when set to a small number (~1000), and keep mdates relatively
34
- * unchanged.
35
- */
36
- updateMDate: boolean | number;
37
- /**
38
- * A function to log info messages. By default, uses the `debug` package.
39
- */
40
- debugInfo: (source: string, message: string) => void;
41
- /**
42
- * A function to log debug messages. By default, uses the `debug` package.
43
- */
44
- debugLog: (source: string, message: string) => void;
45
- /**
46
- * A function to log error messages. By default, uses the `debug` package.
47
- */
48
- debugError: (source: string, message: string) => void;
49
- }
package/dist/conf/d.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"d.js","sourceRoot":"","sources":["../../src/conf/d.ts"],"names":[],"mappings":""}
package/src/conf/d.ts DELETED
@@ -1,49 +0,0 @@
1
- /**
2
- * Nymph Config
3
- */
4
- export interface Config {
5
- /**
6
- * Cache recently retrieved entities to speed up database queries. Uses more
7
- * memory.
8
- */
9
- cache: boolean;
10
- /**
11
- * Cache entities after they're accessed this many times.
12
- */
13
- cacheThreshold: number;
14
- /**
15
- * The number of recently retrieved entities to cache. If you're running out
16
- * of memory, try lowering this value. 0 means unlimited.
17
- */
18
- cacheLimit: number;
19
- /**
20
- * When querying for multiple entities with NymphREST, if the list is empty,
21
- * return a 404 error.
22
- */
23
- emptyListError: boolean;
24
- /**
25
- * Whether to update the mdate property when saving an entity.
26
- *
27
- * You should probably only set this to false if you're doing migrations. Some
28
- * things depend on having updated mdates (like conflict detection to avoid
29
- * lost updates).
30
- *
31
- * If you set this to a number, that amount of milliseconds will be added to
32
- * the mdate on any entities that are saved. This should solve the lost update
33
- * problem when set to a small number (~1000), and keep mdates relatively
34
- * unchanged.
35
- */
36
- updateMDate: boolean | number;
37
- /**
38
- * A function to log info messages. By default, uses the `debug` package.
39
- */
40
- debugInfo: (source: string, message: string) => void;
41
- /**
42
- * A function to log debug messages. By default, uses the `debug` package.
43
- */
44
- debugLog: (source: string, message: string) => void;
45
- /**
46
- * A function to log error messages. By default, uses the `debug` package.
47
- */
48
- debugError: (source: string, message: string) => void;
49
- }
@@ -1,3 +0,0 @@
1
- declare module 'locutus/php/datetime/strtotime.js' {
2
- export default function (str: string, now?: number): number;
3
- }