@objectstack/nuxt 3.2.8 → 3.3.0

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,5 +1,5 @@
1
1
 
2
- > @objectstack/nuxt@3.2.8 build /home/runner/work/spec/spec/packages/adapters/nuxt
2
+ > @objectstack/nuxt@3.3.0 build /home/runner/work/spec/spec/packages/adapters/nuxt
3
3
  > tsup --config ../../../tsup.config.ts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -12,11 +12,11 @@
12
12
  CJS Build start
13
13
  CJS dist/index.js 6.90 KB
14
14
  CJS dist/index.js.map 12.03 KB
15
- CJS ⚡️ Build success in 64ms
15
+ CJS ⚡️ Build success in 60ms
16
16
  ESM dist/index.mjs 5.71 KB
17
17
  ESM dist/index.mjs.map 12.06 KB
18
- ESM ⚡️ Build success in 77ms
18
+ ESM ⚡️ Build success in 67ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 12620ms
20
+ DTS ⚡️ Build success in 13110ms
21
21
  DTS dist/index.d.mts 1015.00 B
22
22
  DTS dist/index.d.ts 1015.00 B
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @objectstack/nuxt
2
2
 
3
+ ## 3.3.0
4
+
5
+ ### Patch Changes
6
+
7
+ - @objectstack/runtime@3.3.0
8
+
9
+ ## 3.2.9
10
+
11
+ ### Patch Changes
12
+
13
+ - @objectstack/runtime@3.2.9
14
+
3
15
  ## 3.2.8
4
16
 
5
17
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@objectstack/nuxt",
3
- "version": "3.2.8",
3
+ "version": "3.3.0",
4
4
  "license": "Apache-2.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -12,14 +12,14 @@
12
12
  }
13
13
  },
14
14
  "peerDependencies": {
15
- "h3": "^1.15.8",
16
- "@objectstack/runtime": "^3.2.8"
15
+ "h3": "^1.15.10",
16
+ "@objectstack/runtime": "^3.3.0"
17
17
  },
18
18
  "devDependencies": {
19
- "h3": "^1.15.8",
19
+ "h3": "^1.15.10",
20
20
  "typescript": "^5.0.0",
21
21
  "vitest": "^4.1.0",
22
- "@objectstack/runtime": "3.2.8"
22
+ "@objectstack/runtime": "3.3.0"
23
23
  },
24
24
  "scripts": {
25
25
  "build": "tsup --config ../../../tsup.config.ts",
package/src/nuxt.test.ts CHANGED
@@ -7,9 +7,8 @@ const mockDispatcher = {
7
7
  getDiscoveryInfo: vi.fn().mockReturnValue({ version: '1.0', endpoints: [] }),
8
8
  handleAuth: vi.fn().mockResolvedValue({ handled: true, response: { body: { ok: true }, status: 200 } }),
9
9
  handleGraphQL: vi.fn().mockResolvedValue({ data: {} }),
10
- handleMetadata: vi.fn().mockResolvedValue({ handled: true, response: { body: { objects: [] }, status: 200 } }),
11
- handleData: vi.fn().mockResolvedValue({ handled: true, response: { body: { records: [] }, status: 200 } }),
12
10
  handleStorage: vi.fn().mockResolvedValue({ handled: true, response: { body: {}, status: 200 } }),
11
+ dispatch: vi.fn().mockResolvedValue({ handled: true, response: { body: { success: true }, status: 200 } }),
13
12
  };
14
13
 
15
14
  vi.mock('@objectstack/runtime', () => {
@@ -101,16 +100,26 @@ describe('createH3Router', () => {
101
100
  const app = createTestApp();
102
101
  const res = await makeRequest(app, '/api/meta/objects');
103
102
  expect(res.status).toBe(200);
104
- expect(res.body.objects).toBeDefined();
105
- expect(mockDispatcher.handleMetadata).toHaveBeenCalled();
103
+ expect(mockDispatcher.dispatch).toHaveBeenCalledWith(
104
+ 'GET',
105
+ '/meta/objects',
106
+ undefined,
107
+ expect.any(Object),
108
+ expect.objectContaining({ request: expect.anything() }),
109
+ );
106
110
  });
107
111
 
108
112
  it('handles data route', async () => {
109
113
  const app = createTestApp();
110
114
  const res = await makeRequest(app, '/api/data/account');
111
115
  expect(res.status).toBe(200);
112
- expect(res.body.records).toBeDefined();
113
- expect(mockDispatcher.handleData).toHaveBeenCalled();
116
+ expect(mockDispatcher.dispatch).toHaveBeenCalledWith(
117
+ 'GET',
118
+ '/data/account',
119
+ undefined,
120
+ expect.any(Object),
121
+ expect.objectContaining({ request: expect.anything() }),
122
+ );
114
123
  });
115
124
 
116
125
  it('handles storage route', async () => {
@@ -121,7 +130,7 @@ describe('createH3Router', () => {
121
130
  });
122
131
 
123
132
  it('handles errors', async () => {
124
- mockDispatcher.handleData.mockRejectedValueOnce(
133
+ mockDispatcher.dispatch.mockRejectedValueOnce(
125
134
  Object.assign(new Error('Forbidden'), { statusCode: 403 }),
126
135
  );
127
136
  const app = createTestApp();