@objectstack/driver-memory 0.3.3 → 0.4.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @objectstack/driver-memory
2
2
 
3
+ ## 0.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Version synchronization and dependency updates
8
+
9
+ - Synchronized plugin-msw version to 0.4.1
10
+ - Updated runtime peer dependency versions to ^0.4.1
11
+ - Fixed internal dependency version mismatches
12
+
13
+ - Updated dependencies
14
+ - @objectstack/spec@0.4.1
15
+
16
+ ## 0.4.0
17
+
18
+ ### Minor Changes
19
+
20
+ - Release version 0.4.0
21
+
3
22
  ## 0.3.3
4
23
 
5
24
  ### Patch Changes
@@ -1,3 +1,3 @@
1
- import { ObjectStackManifest } from '@objectstack/spec/kernel';
1
+ import { ObjectStackManifest } from '@objectstack/spec/system';
2
2
  declare const MemoryDriverPlugin: ObjectStackManifest;
3
3
  export default MemoryDriverPlugin;
@@ -1,5 +1,5 @@
1
1
  import { QueryInput } from '@objectstack/spec/data';
2
- import { DriverInterface, DriverOptions } from '@objectstack/spec/driver';
2
+ import { DriverInterface, DriverOptions } from '@objectstack/spec/system';
3
3
  /**
4
4
  * Example: In-Memory Driver
5
5
  *
@@ -39,18 +39,18 @@ export declare class InMemoryDriver implements DriverInterface {
39
39
  findStream(object: string, query: QueryInput, options?: DriverOptions): AsyncGenerator<any, void, unknown>;
40
40
  findOne(object: string, query: QueryInput, options?: DriverOptions): Promise<any>;
41
41
  create(object: string, data: Record<string, any>, options?: DriverOptions): Promise<{
42
- created_at: Date;
43
- updated_at: Date;
44
- id: string;
42
+ created_at: any;
43
+ updated_at: any;
44
+ id: any;
45
45
  }>;
46
46
  update(object: string, id: string | number, data: Record<string, any>, options?: DriverOptions): Promise<any>;
47
47
  upsert(object: string, data: Record<string, any>, conflictKeys?: string[], options?: DriverOptions): Promise<any>;
48
48
  delete(object: string, id: string | number, options?: DriverOptions): Promise<boolean>;
49
49
  count(object: string, query?: QueryInput, options?: DriverOptions): Promise<number>;
50
50
  bulkCreate(object: string, dataArray: Record<string, any>[], options?: DriverOptions): Promise<{
51
- created_at: Date;
52
- updated_at: Date;
53
- id: string;
51
+ created_at: any;
52
+ updated_at: any;
53
+ id: any;
54
54
  }[]>;
55
55
  bulkUpdate(object: string, updates: {
56
56
  id: string | number;
@@ -85,10 +85,10 @@ export class InMemoryDriver {
85
85
  const table = this.getTable(object);
86
86
  // COMPATIBILITY: Driver must return 'id' as string
87
87
  const newRecord = {
88
- id: this.generateId(),
88
+ id: data.id || this.generateId(),
89
89
  ...data,
90
- created_at: new Date(),
91
- updated_at: new Date(),
90
+ created_at: data.created_at || new Date(),
91
+ updated_at: data.updated_at || new Date(),
92
92
  };
93
93
  table.push(newRecord);
94
94
  return newRecord;
@@ -1,4 +1,4 @@
1
- import { ObjectStackManifest } from '@objectstack/spec/kernel';
1
+ import { ObjectStackManifest } from '@objectstack/spec/system';
2
2
 
3
3
  const MemoryDriverPlugin: ObjectStackManifest = {
4
4
  id: 'com.objectstack.driver.memory',
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@objectstack/driver-memory",
3
- "version": "0.3.3",
3
+ "version": "0.4.1",
4
4
  "description": "In-Memory Driver for ObjectStack (Reference Implementation)",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
7
7
  "dependencies": {
8
- "@objectstack/spec": "0.3.3"
8
+ "@objectstack/spec": "0.4.1"
9
9
  },
10
10
  "devDependencies": {
11
11
  "typescript": "^5.0.0"
@@ -1,5 +1,5 @@
1
1
  import { QueryAST, QueryInput } from '@objectstack/spec/data';
2
- import { DriverInterface, DriverOptions } from '@objectstack/spec/driver';
2
+ import { DriverInterface, DriverOptions } from '@objectstack/spec/system';
3
3
 
4
4
  /**
5
5
  * Example: In-Memory Driver
@@ -110,10 +110,10 @@ export class InMemoryDriver implements DriverInterface {
110
110
 
111
111
  // COMPATIBILITY: Driver must return 'id' as string
112
112
  const newRecord = {
113
- id: this.generateId(),
113
+ id: data.id || this.generateId(),
114
114
  ...data,
115
- created_at: new Date(),
116
- updated_at: new Date(),
115
+ created_at: data.created_at || new Date(),
116
+ updated_at: data.updated_at || new Date(),
117
117
  };
118
118
 
119
119
  table.push(newRecord);