@constantant/openapi-resource-mocks 0.1.1 → 0.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.
- package/CHANGELOG.md +54 -1
- package/README.md +229 -29
- package/package.json +1 -1
- package/src/index.d.ts +3 -0
- package/src/index.js.map +1 -1
- package/src/lib/mock-events.d.ts +5 -0
- package/src/lib/mock-resource-bus.d.ts +12 -1
- package/src/lib/mock-resource-bus.js +57 -3
- package/src/lib/mock-resource-bus.js.map +1 -1
- package/src/lib/mock-resource-meta.d.ts +8 -0
- package/src/lib/mock-resource-meta.js +3 -0
- package/src/lib/mock-resource-meta.js.map +1 -0
- package/src/lib/mock-resource-ref.js +2 -1
- package/src/lib/mock-resource-ref.js.map +1 -1
- package/src/lib/provide-mock-resource.d.ts +14 -2
- package/src/lib/provide-mock-resource.js +55 -4
- package/src/lib/provide-mock-resource.js.map +1 -1
- package/src/lib/token-value.d.ts +3 -0
- package/src/lib/token-value.js +3 -0
- package/src/lib/token-value.js.map +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,57 @@
|
|
|
1
|
+
## 0.3.0 (2026-06-10)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **mocks:** phase 1 spec-aware mocks — MockResourceMeta through the stack ([e3a9520](https://github.com/constantant/angular-openapi-gen/commit/e3a9520))
|
|
6
|
+
- **openapi-resource-mocks:** persistent catch-mode watch list and timing fixes ([1d63b36](https://github.com/constantant/angular-openapi-gen/commit/1d63b36))
|
|
7
|
+
- **devtools-panel:** add history tab, catch mode, and CSS token migration ([d4151bc](https://github.com/constantant/angular-openapi-gen/commit/d4151bc))
|
|
8
|
+
|
|
9
|
+
### 🩹 Fixes
|
|
10
|
+
|
|
11
|
+
- **openapi-resource-mocks:** re-fire _notifyRequest when reactive thunk args change ([708a71e](https://github.com/constantant/angular-openapi-gen/commit/708a71e))
|
|
12
|
+
|
|
13
|
+
### 📖 Documentation
|
|
14
|
+
|
|
15
|
+
- align all docs with spec-aware mocks (phases 2-4) ([e7c4374](https://github.com/constantant/angular-openapi-gen/commit/e7c4374))
|
|
16
|
+
|
|
17
|
+
### ❤️ Thank You
|
|
18
|
+
|
|
19
|
+
- Claude Sonnet 4.6
|
|
20
|
+
- kk
|
|
21
|
+
|
|
22
|
+
## 0.2.0 (2026-06-09)
|
|
23
|
+
|
|
24
|
+
### 🚀 Features
|
|
25
|
+
|
|
26
|
+
- **openapi-resource-gen:** add includeMocks option to co-generate .mock.ts files ([8ebddd4](https://github.com/constantant/angular-openapi-gen/commit/8ebddd4))
|
|
27
|
+
- **openapi-resource-mocks:** expose openApiMock(key) window shorthand via MockResourceBus ([32cd5b5](https://github.com/constantant/angular-openapi-gen/commit/32cd5b5))
|
|
28
|
+
- **openapi-resource-mocks:** resolve reactive lambda args in _notifyRequest ([bf5c9af](https://github.com/constantant/angular-openapi-gen/commit/bf5c9af))
|
|
29
|
+
- **openapi-resource-mocks:** add optional delay to provideMockResource initial behavior ([e829d1e](https://github.com/constantant/angular-openapi-gen/commit/e829d1e))
|
|
30
|
+
- **openapi-resource-mocks:** export TokenValue utility type for typed mock seed data ([fafe3f3](https://github.com/constantant/angular-openapi-gen/commit/fafe3f3))
|
|
31
|
+
|
|
32
|
+
### 🩹 Fixes
|
|
33
|
+
|
|
34
|
+
- **openapi-resource-gen:** auto-register /mock path alias and fix app.config.mock.ts imports ([c65e6a6](https://github.com/constantant/angular-openapi-gen/commit/c65e6a6))
|
|
35
|
+
|
|
36
|
+
### 💅 Refactors
|
|
37
|
+
|
|
38
|
+
- **openapi-resource-mocks:** create mock ref per call in provideMockResource ([5b9c9d7](https://github.com/constantant/angular-openapi-gen/commit/5b9c9d7))
|
|
39
|
+
- **openapi-resource-mocks:** accept DeepPartial seed data in provideMockResource ([245c109](https://github.com/constantant/angular-openapi-gen/commit/245c109))
|
|
40
|
+
|
|
41
|
+
### 📖 Documentation
|
|
42
|
+
|
|
43
|
+
- **openapi-resource-mocks:** document Playwright E2E setup and mock control patterns ([aa638ca](https://github.com/constantant/angular-openapi-gen/commit/aa638ca))
|
|
44
|
+
- **openapi-resource-mocks:** align README with per-call ref creation ([2e50dc3](https://github.com/constantant/angular-openapi-gen/commit/2e50dc3))
|
|
45
|
+
|
|
46
|
+
### 🏡 Chore
|
|
47
|
+
|
|
48
|
+
- **openapi-resource-mocks:** remove stale Changelog heading left by initial setup ([281ae62](https://github.com/constantant/angular-openapi-gen/commit/281ae62))
|
|
49
|
+
|
|
50
|
+
### ❤️ Thank You
|
|
51
|
+
|
|
52
|
+
- Claude Sonnet 4.6
|
|
53
|
+
- kk
|
|
54
|
+
|
|
1
55
|
## 0.1.1 (2026-06-08)
|
|
2
56
|
|
|
3
57
|
### 🩹 Fixes
|
|
@@ -9,4 +63,3 @@
|
|
|
9
63
|
- Claude Sonnet 4.6
|
|
10
64
|
- kk
|
|
11
65
|
|
|
12
|
-
# Changelog
|
package/README.md
CHANGED
|
@@ -21,17 +21,33 @@ Peer dependencies: `@angular/core >=22`, `@angular/common >=22`.
|
|
|
21
21
|
Each mock token is registered in a `MockResourceBus`. The bus:
|
|
22
22
|
|
|
23
23
|
- Exposes `window.__openApiMocks__` — a plain object keyed by token name, accessible from Playwright's `page.evaluate()` or a Chrome Extension content script.
|
|
24
|
-
- Emits DOM events (`openapi-mock-event`) on every state change so the
|
|
25
|
-
- Listens for DOM events (`openapi-mock-control`) so the
|
|
24
|
+
- Emits DOM events (`openapi-mock-event`) on every state change so the Chrome Extension DevTools panel can observe in real time.
|
|
25
|
+
- Listens for DOM events (`openapi-mock-control`) so the DevTools panel can push data into the app.
|
|
26
26
|
|
|
27
27
|
---
|
|
28
28
|
|
|
29
29
|
## Setup
|
|
30
30
|
|
|
31
|
-
Add `provideMockResourceBus()` once, then one
|
|
31
|
+
Add `provideMockResourceBus()` once, then one mock provider per token.
|
|
32
|
+
|
|
33
|
+
**With `--includeMocks` (recommended)** — the generator emits a typed `provide{Operation}Mock()` wrapper per endpoint. Import from the `/mock` subpath so mock utilities stay out of your production bundle:
|
|
32
34
|
|
|
33
35
|
```typescript
|
|
34
36
|
// app.config.mock.ts (used in tests / E2E variant)
|
|
37
|
+
import { provideMockResourceBus } from '@constantant/openapi-resource-mocks';
|
|
38
|
+
import { provideFindPetsByStatusMock, provideUploadFileMock } from '@myapp/petstore-data-access/mock';
|
|
39
|
+
|
|
40
|
+
export const mockProviders = [
|
|
41
|
+
provideMockResourceBus(),
|
|
42
|
+
provideFindPetsByStatusMock(),
|
|
43
|
+
provideUploadFileMock(),
|
|
44
|
+
];
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Without `--includeMocks`** — use `provideMockResource()` directly with the raw token:
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
// app.config.mock.ts
|
|
35
51
|
import { provideMockResourceBus, provideMockResource } from '@constantant/openapi-resource-mocks';
|
|
36
52
|
import { FIND_PETS_BY_STATUS, UPLOAD_FILE } from '@myapp/petstore-data-access';
|
|
37
53
|
|
|
@@ -49,21 +65,27 @@ export const mockProviders = [
|
|
|
49
65
|
```typescript
|
|
50
66
|
import { TestBed } from '@angular/core/testing';
|
|
51
67
|
import { injectMockResource, provideMockResourceBus, provideMockResource } from '@constantant/openapi-resource-mocks';
|
|
52
|
-
import type { FindPetsByStatusResponse } from '@myapp/petstore-data-access';
|
|
53
68
|
|
|
54
69
|
TestBed.configureTestingModule({
|
|
70
|
+
imports: [PetsComponent],
|
|
55
71
|
providers: [
|
|
56
72
|
provideMockResourceBus(),
|
|
57
73
|
provideMockResource(FIND_PETS_BY_STATUS, 'FIND_PETS_BY_STATUS'),
|
|
58
74
|
],
|
|
59
75
|
});
|
|
60
76
|
|
|
77
|
+
// Render the component first — this calls the token factory and registers the ref
|
|
78
|
+
const fixture = TestBed.createComponent(PetsComponent);
|
|
79
|
+
fixture.detectChanges();
|
|
80
|
+
|
|
81
|
+
// Now the ref is in the bus
|
|
61
82
|
const mock = TestBed.runInInjectionContext(() =>
|
|
62
|
-
injectMockResource
|
|
83
|
+
injectMockResource('FIND_PETS_BY_STATUS'),
|
|
63
84
|
);
|
|
64
85
|
|
|
65
|
-
// Preset states
|
|
66
86
|
mock.resolve([{ id: 1, name: 'Rex', status: 'available' }]);
|
|
87
|
+
fixture.detectChanges();
|
|
88
|
+
|
|
67
89
|
mock.setLoading();
|
|
68
90
|
mock.fail(new Error('network'));
|
|
69
91
|
mock.reset();
|
|
@@ -107,19 +129,19 @@ console.log(mock.progress()); // { type: 'upload', loaded: 1_000_000, total: 4_0
|
|
|
107
129
|
```typescript
|
|
108
130
|
// Animate upload progress then resolve
|
|
109
131
|
await page.evaluate(() =>
|
|
110
|
-
|
|
132
|
+
openApiMock('UPLOAD_FILE').simulateProgress('upload', 4_000_000, 2000, { id: 'abc123' }),
|
|
111
133
|
);
|
|
112
134
|
await expect(page.locator('[data-testid="progress-bar"]')).toBeVisible();
|
|
113
135
|
|
|
114
136
|
// Manual steps
|
|
115
137
|
await page.evaluate(() =>
|
|
116
|
-
|
|
138
|
+
openApiMock('UPLOAD_FILE').setProgress('upload', 1_000_000, 4_000_000),
|
|
117
139
|
);
|
|
118
140
|
await expect(page.locator('[data-testid="progress-bar"]')).toHaveAttribute('aria-valuenow', '25');
|
|
119
141
|
|
|
120
142
|
// Fail mid-upload
|
|
121
|
-
await page.evaluate(() =>
|
|
122
|
-
const state = await page.evaluate(() =>
|
|
143
|
+
await page.evaluate(() => openApiMock('UPLOAD_FILE').fail(new Error('timeout')));
|
|
144
|
+
const state = await page.evaluate(() => openApiMock('UPLOAD_FILE').getState());
|
|
123
145
|
console.log(state.progress); // { type: 'upload', loaded: 1_000_000, total: 4_000_000 }
|
|
124
146
|
```
|
|
125
147
|
|
|
@@ -149,33 +171,145 @@ document.dispatchEvent(new CustomEvent('openapi-mock-control', {
|
|
|
149
171
|
|
|
150
172
|
## E2E tests (Playwright)
|
|
151
173
|
|
|
174
|
+
### Setup
|
|
175
|
+
|
|
176
|
+
Serve the app with mock providers on a separate port so real and mock E2E suites never collide.
|
|
177
|
+
|
|
178
|
+
**1. Mock app configuration** — swap the real providers for mock ones:
|
|
179
|
+
|
|
180
|
+
```typescript
|
|
181
|
+
// app.config.mock.ts
|
|
182
|
+
import { ApplicationConfig } from '@angular/core';
|
|
183
|
+
import { provideRouter } from '@angular/router';
|
|
184
|
+
import { provideMockResourceBus } from '@constantant/openapi-resource-mocks';
|
|
185
|
+
import { provideFindPetsByStatusMock } from '@myapp/petstore-data-access/mock';
|
|
186
|
+
import { appRoutes } from './app.routes';
|
|
187
|
+
|
|
188
|
+
export const appConfig: ApplicationConfig = {
|
|
189
|
+
providers: [
|
|
190
|
+
provideRouter(appRoutes),
|
|
191
|
+
provideMockResourceBus(),
|
|
192
|
+
provideFindPetsByStatusMock({
|
|
193
|
+
value: [{ id: 1, name: 'Rex', status: 'available', photoUrls: [] }],
|
|
194
|
+
delay: 500,
|
|
195
|
+
}),
|
|
196
|
+
],
|
|
197
|
+
};
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
If you didn't use `--includeMocks`, replace the wrapper with `provideMockResource(FIND_PETS_BY_STATUS, 'FIND_PETS_BY_STATUS', { ... })` imported from `@constantant/openapi-resource-mocks`.
|
|
201
|
+
|
|
202
|
+
**2. Separate Playwright config** — points to port 4201 and scopes `testDir` to the mock specs folder:
|
|
203
|
+
|
|
204
|
+
```typescript
|
|
205
|
+
// playwright.mock.config.ts
|
|
206
|
+
import { defineConfig, devices } from '@playwright/test';
|
|
207
|
+
import { nxE2EPreset } from '@nx/playwright/preset';
|
|
208
|
+
import { workspaceRoot } from '@nx/devkit';
|
|
209
|
+
|
|
210
|
+
export default defineConfig({
|
|
211
|
+
...nxE2EPreset(__filename, { testDir: './src/mock' }),
|
|
212
|
+
use: {
|
|
213
|
+
baseURL: 'http://localhost:4201',
|
|
214
|
+
trace: 'on-first-retry',
|
|
215
|
+
},
|
|
216
|
+
webServer: {
|
|
217
|
+
command: 'npx nx run myapp:serve --configuration=mock-e2e',
|
|
218
|
+
url: 'http://localhost:4201',
|
|
219
|
+
reuseExistingServer: true,
|
|
220
|
+
cwd: workspaceRoot,
|
|
221
|
+
},
|
|
222
|
+
projects: [{ name: 'chromium', use: { ...devices['Desktop Chrome'] } }],
|
|
223
|
+
});
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
**3. Exclude mock specs from the main config** — prevents mock specs from running against the real app:
|
|
227
|
+
|
|
228
|
+
```typescript
|
|
229
|
+
// playwright.config.ts (existing main config)
|
|
230
|
+
export default defineConfig({
|
|
231
|
+
...nxE2EPreset(__filename, { testDir: './src' }),
|
|
232
|
+
testIgnore: ['**/mock/**'],
|
|
233
|
+
// ...
|
|
234
|
+
});
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
**4. TypeScript ambient declarations** — required for `openApiMock(key)` to typecheck inside `page.evaluate()` function bodies:
|
|
238
|
+
|
|
239
|
+
```typescript
|
|
240
|
+
// src/global.d.ts
|
|
241
|
+
interface MockEntry {
|
|
242
|
+
resolve(value: unknown): void;
|
|
243
|
+
resolveAfter(ms: number, value: unknown): void;
|
|
244
|
+
setLoading(): void;
|
|
245
|
+
fail(error: unknown): void;
|
|
246
|
+
reset(): void;
|
|
247
|
+
getState(): { status: string; value: unknown; error: unknown; progress: unknown };
|
|
248
|
+
getHistory(): Array<{ type: string; args: unknown[]; ts: number }>;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
interface Window {
|
|
252
|
+
__openApiMocks__: Record<string, MockEntry>;
|
|
253
|
+
openApiMock: (key: string) => MockEntry;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// Needed for unqualified openApiMock('KEY') calls inside page.evaluate(() => ...)
|
|
257
|
+
declare function openApiMock(key: string): MockEntry;
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Also add `"types": ["node"]` to `tsconfig.json` if you use `__filename` in the Playwright config.
|
|
261
|
+
|
|
262
|
+
### Writing specs
|
|
263
|
+
|
|
264
|
+
Always wait for a page landmark in `beforeEach` before running assertions — this guarantees Angular has bootstrapped and the mock factories have been called:
|
|
265
|
+
|
|
266
|
+
```typescript
|
|
267
|
+
test.beforeEach(async ({ page }) => {
|
|
268
|
+
await page.goto('/pets');
|
|
269
|
+
await expect(page.getByRole('heading', { name: 'Pets' })).toBeVisible();
|
|
270
|
+
});
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Without this guard, assertions like `toBeHidden()` and `toHaveCount(0)` can pass immediately (before any elements render), and subsequent `page.evaluate()` calls will throw `openApiMock is not defined`.
|
|
274
|
+
|
|
275
|
+
### Controlling state
|
|
276
|
+
|
|
152
277
|
```typescript
|
|
153
278
|
// Resolve with data
|
|
154
279
|
await page.evaluate(() =>
|
|
155
|
-
|
|
156
|
-
{ id: 1, name: 'Rex', status: 'available' },
|
|
157
|
-
]),
|
|
280
|
+
openApiMock('FIND_PETS_BY_STATUS').resolve([{ id: 1, name: 'Rex', status: 'available' }]),
|
|
158
281
|
);
|
|
159
282
|
await expect(page.locator('mat-row')).toHaveCount(1);
|
|
160
283
|
|
|
161
284
|
// Test loading skeleton
|
|
162
|
-
await page.evaluate(() =>
|
|
285
|
+
await page.evaluate(() => openApiMock('FIND_PETS_BY_STATUS').setLoading());
|
|
163
286
|
await expect(page.locator('mat-progress-bar')).toBeVisible();
|
|
164
287
|
|
|
165
288
|
// Simulate slow network
|
|
166
|
-
await page.evaluate(() =>
|
|
167
|
-
window.__openApiMocks__['FIND_PETS_BY_STATUS'].resolveAfter(1000, []),
|
|
168
|
-
);
|
|
289
|
+
await page.evaluate(() => openApiMock('FIND_PETS_BY_STATUS').resolveAfter(1000, []));
|
|
169
290
|
|
|
170
291
|
// Inspect current state (includes progress if active)
|
|
171
|
-
const state = await page.evaluate(() =>
|
|
172
|
-
window.__openApiMocks__['FIND_PETS_BY_STATUS'].getState(),
|
|
173
|
-
);
|
|
292
|
+
const state = await page.evaluate(() => openApiMock('FIND_PETS_BY_STATUS').getState());
|
|
174
293
|
|
|
175
294
|
// Full event history (requests + responses + progress ticks)
|
|
176
|
-
const history = await page.evaluate(() =>
|
|
177
|
-
|
|
178
|
-
|
|
295
|
+
const history = await page.evaluate(() => openApiMock('FIND_PETS_BY_STATUS').getHistory());
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### Asserting request params
|
|
299
|
+
|
|
300
|
+
`getHistory()` records every factory invocation as a `request` entry. Function args (reactive lambdas) are resolved at call time, so `args` contains plain JSON values:
|
|
301
|
+
|
|
302
|
+
```typescript
|
|
303
|
+
const history = await page.evaluate(() => openApiMock('FIND_PETS_BY_STATUS').getHistory());
|
|
304
|
+
const req = history.find((e) => e.type === 'request');
|
|
305
|
+
expect(req?.args[0]).toEqual({ status: 'available' });
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
For tokens whose factory receives a reactive lambda (e.g. `() => query() ? { q: query() } : undefined`), `args[0]` will be the resolved value at mount time — `undefined` when suppressed, or the plain params object when active:
|
|
309
|
+
|
|
310
|
+
```typescript
|
|
311
|
+
// Confirms the resource was suppressed on init (query was empty)
|
|
312
|
+
expect(req?.args[0]).toBeUndefined();
|
|
179
313
|
```
|
|
180
314
|
|
|
181
315
|
---
|
|
@@ -213,19 +347,75 @@ document.addEventListener('openapi-mock-event', (e) => {
|
|
|
213
347
|
|
|
214
348
|
Returns `EnvironmentProviders`. Call once in your root providers or TestBed setup.
|
|
215
349
|
|
|
216
|
-
### `provideMockResource(token, key,
|
|
350
|
+
### `provideMockResource(token, key, initialBehavior?, meta?)`
|
|
351
|
+
|
|
352
|
+
Returns `FactoryProvider`. Each time a component invokes the factory function, a fresh ref is created, registered in the bus under `key`, and `initialBehavior` is applied — simulating the full request lifecycle on every mount.
|
|
353
|
+
|
|
354
|
+
The optional `meta` argument is a `MockResourceMeta` object. When provided, the DevTools panel uses it to look up response schemas and pre-populate the Respond tab's schema display. Generated `.mock.ts` files embed this automatically — you only need to pass it manually when using `provideMockResource()` directly.
|
|
217
355
|
|
|
218
|
-
|
|
356
|
+
`initialBehavior` controls how the mock behaves on each invocation:
|
|
219
357
|
|
|
220
|
-
|
|
358
|
+
| Shape | Effect |
|
|
359
|
+
|-------|--------|
|
|
360
|
+
| `{ value: T }` | Resolves immediately with value |
|
|
361
|
+
| `{ value: T, delay: ms }` | Loading for `ms` ms, then resolves |
|
|
362
|
+
| `{ loading: true }` | Stays loading indefinitely |
|
|
363
|
+
| `{ error: unknown }` | Fails immediately |
|
|
364
|
+
| `{ error: unknown, delay: ms }` | Loading for `ms` ms, then fails |
|
|
221
365
|
|
|
222
366
|
### `injectMockResource<T>(key)`
|
|
223
367
|
|
|
224
|
-
Must be called inside an injection context (e.g. `TestBed.runInInjectionContext`). Returns `MockResourceRef<T>`.
|
|
368
|
+
Must be called inside an injection context (e.g. `TestBed.runInInjectionContext`) and after the component has rendered — the ref is registered when the component first invokes the factory function, not at DI setup time. Returns `MockResourceRef<T>`.
|
|
369
|
+
|
|
370
|
+
### `ProviderInitialBehavior<T>`
|
|
371
|
+
|
|
372
|
+
Union type accepted by `provideMockResource()` and generated `provide{Operation}Mock()` wrappers. Describes the mock's state immediately after each factory invocation:
|
|
373
|
+
|
|
374
|
+
| Shape | Effect |
|
|
375
|
+
|-------|--------|
|
|
376
|
+
| `{ value: DeepPartial<T> }` | Resolves immediately with value |
|
|
377
|
+
| `{ value: DeepPartial<T>, delay: ms }` | Loading for `ms` ms, then resolves |
|
|
378
|
+
| `{ loading: true }` | Stays loading indefinitely |
|
|
379
|
+
| `{ error: unknown }` | Fails immediately |
|
|
380
|
+
| `{ error: unknown, delay: ms }` | Loading for `ms` ms, then fails |
|
|
381
|
+
|
|
382
|
+
### `MockResourceMeta`
|
|
383
|
+
|
|
384
|
+
Metadata embedded in generated `.mock.ts` files and read by the DevTools panel to show response schemas, generate example payloads, and validate responses:
|
|
385
|
+
|
|
386
|
+
```typescript
|
|
387
|
+
interface MockResourceMeta {
|
|
388
|
+
specId: string; // matches the --specId generator option (default: derived from baseUrlToken)
|
|
389
|
+
operationId: string; // OpenAPI operationId
|
|
390
|
+
path: string; // API path, e.g. '/pet/findByStatus'
|
|
391
|
+
method: string; // HTTP method, lowercase
|
|
392
|
+
tag?: string; // OpenAPI tag (omitted for untagged operations)
|
|
393
|
+
}
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
The DevTools panel resolves the response schema by looking up `specId` in its Specs store and then matching `operationId`. Import the spec (or its `mocks.manifest.json`) in the panel's **Specs** tab to enable schema-aware features.
|
|
397
|
+
|
|
398
|
+
### `DeepPartial<T>`
|
|
399
|
+
|
|
400
|
+
Recursively marks all properties of `T` as optional. Used as the value type in `ProviderInitialBehavior<T>` so you can provide partial seed data without satisfying every nested field.
|
|
401
|
+
|
|
402
|
+
### `TokenValue<Token>`
|
|
403
|
+
|
|
404
|
+
Utility type that extracts the response type `T` from a generated `InjectionToken<(...args) => ResourceRef<T>>`. Use it to type seed data without importing the response type by name:
|
|
405
|
+
|
|
406
|
+
```typescript
|
|
407
|
+
import type { TokenValue } from '@constantant/openapi-resource-mocks';
|
|
408
|
+
import { FIND_PETS_BY_STATUS } from '@myapp/petstore-data-access';
|
|
409
|
+
|
|
410
|
+
// type is FindPetsByStatusResponse — inferred from the token
|
|
411
|
+
const mockPets: TokenValue<typeof FIND_PETS_BY_STATUS> = [
|
|
412
|
+
{ id: 1, name: 'Rex', status: 'available', photoUrls: [] },
|
|
413
|
+
];
|
|
414
|
+
```
|
|
225
415
|
|
|
226
416
|
### `createMockResourceRef<T>(initialState?)`
|
|
227
417
|
|
|
228
|
-
Creates a standalone ref without the bus — useful
|
|
418
|
+
Creates a standalone ref without the bus — useful for Storybook decorators, custom test harnesses, or any scenario where you need a `MockResourceRef` outside of Angular DI.
|
|
229
419
|
|
|
230
420
|
### `MockResourceRef<T>`
|
|
231
421
|
|
|
@@ -259,6 +449,16 @@ interface MockProgress {
|
|
|
259
449
|
}
|
|
260
450
|
```
|
|
261
451
|
|
|
452
|
+
### `openApiMock(key)` / `window.__openApiMocks__[key]`
|
|
453
|
+
|
|
454
|
+
`openApiMock` is a shorthand exposed on `window` by `MockResourceBus` — equivalent to `window.__openApiMocks__[key]` but terser in `page.evaluate()` calls:
|
|
455
|
+
|
|
456
|
+
```typescript
|
|
457
|
+
// Playwright
|
|
458
|
+
const history = await page.evaluate(() => openApiMock('FIND_PETS_BY_STATUS').getHistory());
|
|
459
|
+
await page.evaluate(() => openApiMock('FIND_PETS_BY_STATUS').resolve([...]));
|
|
460
|
+
```
|
|
461
|
+
|
|
262
462
|
### `window.__openApiMocks__[key]`
|
|
263
463
|
|
|
264
464
|
| Member | Description |
|
|
@@ -278,7 +478,7 @@ interface MockProgress {
|
|
|
278
478
|
|
|
279
479
|
```typescript
|
|
280
480
|
type MockEvent =
|
|
281
|
-
| { type: 'request'; args: unknown[]; ts: number } // factory called by component
|
|
481
|
+
| { type: 'request'; args: unknown[]; ts: number } // factory called by component — function args are called and replaced with their return value
|
|
282
482
|
| { type: 'resolve'; value: unknown; ts: number }
|
|
283
483
|
| { type: 'loading'; ts: number }
|
|
284
484
|
| { type: 'error'; error: unknown; ts: number }
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -3,5 +3,8 @@ export type { MockResourceRef, MockResourceRefInternal, MockResourceState } from
|
|
|
3
3
|
export { MockResourceBus, provideMockResourceBus } from './lib/mock-resource-bus';
|
|
4
4
|
export type { WindowMockEntry } from './lib/mock-resource-bus';
|
|
5
5
|
export { provideMockResource } from './lib/provide-mock-resource';
|
|
6
|
+
export type { ProviderInitialBehavior, DeepPartial } from './lib/provide-mock-resource';
|
|
7
|
+
export type { MockResourceMeta } from './lib/mock-resource-meta';
|
|
6
8
|
export { injectMockResource } from './lib/inject-mock-resource';
|
|
7
9
|
export type { MockEvent, MockProgress } from './lib/mock-events';
|
|
10
|
+
export type { TokenValue } from './lib/token-value';
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../tools/openapi-resource-mocks/src/index.ts"],"names":[],"mappings":";;;AAAA,6DAAgE;AAAvD,0HAAA,qBAAqB,OAAA;AAE9B,6DAAkF;AAAzE,oHAAA,eAAe,OAAA;AAAE,2HAAA,sBAAsB,OAAA;AAEhD,qEAAkE;AAAzD,4HAAA,mBAAmB,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../tools/openapi-resource-mocks/src/index.ts"],"names":[],"mappings":";;;AAAA,6DAAgE;AAAvD,0HAAA,qBAAqB,OAAA;AAE9B,6DAAkF;AAAzE,oHAAA,eAAe,OAAA;AAAE,2HAAA,sBAAsB,OAAA;AAEhD,qEAAkE;AAAzD,4HAAA,mBAAmB,OAAA;AAG5B,mEAAgE;AAAvD,0HAAA,kBAAkB,OAAA"}
|
package/src/lib/mock-events.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EnvironmentProviders } from '@angular/core';
|
|
2
2
|
import type { MockResourceRef } from './mock-resource-ref';
|
|
3
3
|
import type { MockEvent } from './mock-events';
|
|
4
|
+
import type { MockResourceMeta } from './mock-resource-meta';
|
|
4
5
|
export interface WindowMockEntry {
|
|
5
6
|
resolve(value: unknown): void;
|
|
6
7
|
resolveAfter(delayMs: number, value: unknown): void;
|
|
@@ -9,24 +10,34 @@ export interface WindowMockEntry {
|
|
|
9
10
|
reset(): void;
|
|
10
11
|
setProgress(type: 'upload' | 'download', loaded: number, total?: number): void;
|
|
11
12
|
simulateProgress(type: 'upload' | 'download', totalBytes: number, durationMs: number, finalValue: unknown, steps?: number): void;
|
|
13
|
+
setCatchMode(enabled: boolean): void;
|
|
12
14
|
getState(): {
|
|
13
15
|
status: string;
|
|
14
16
|
value: unknown;
|
|
15
17
|
error: unknown;
|
|
16
18
|
progress: unknown;
|
|
17
19
|
};
|
|
20
|
+
getMeta(): MockResourceMeta | undefined;
|
|
18
21
|
getHistory(): MockEvent[];
|
|
19
22
|
onEvent(cb: (event: MockEvent) => void): () => void;
|
|
20
23
|
}
|
|
21
24
|
declare global {
|
|
22
25
|
interface Window {
|
|
23
26
|
__openApiMocks__?: Record<string, WindowMockEntry>;
|
|
27
|
+
openApiMock?: (key: string) => WindowMockEntry;
|
|
24
28
|
}
|
|
25
29
|
}
|
|
26
30
|
export declare class MockResourceBus {
|
|
27
31
|
private readonly refs;
|
|
28
|
-
|
|
32
|
+
private readonly metas;
|
|
33
|
+
private readonly catchModeKeys;
|
|
34
|
+
private _reqCount;
|
|
35
|
+
register<T>(key: string, ref: MockResourceRef<T>, meta?: MockResourceMeta): void;
|
|
29
36
|
get<T>(key: string): MockResourceRef<T> | undefined;
|
|
37
|
+
getMeta(key: string): MockResourceMeta | undefined;
|
|
38
|
+
isCatchMode(key: string): boolean;
|
|
39
|
+
setCatchMode(key: string, enabled: boolean): void;
|
|
40
|
+
private nextReqId;
|
|
30
41
|
private exposeToWindow;
|
|
31
42
|
private dispatchDomEvent;
|
|
32
43
|
constructor();
|
|
@@ -5,16 +5,46 @@ exports.provideMockResourceBus = provideMockResourceBus;
|
|
|
5
5
|
const core_1 = require("@angular/core");
|
|
6
6
|
class MockResourceBus {
|
|
7
7
|
refs = new Map();
|
|
8
|
-
|
|
8
|
+
metas = new Map();
|
|
9
|
+
catchModeKeys = new Set();
|
|
10
|
+
_reqCount = 0;
|
|
11
|
+
register(key, ref, meta) {
|
|
9
12
|
const internal = ref;
|
|
10
13
|
this.refs.set(key, internal);
|
|
14
|
+
if (meta)
|
|
15
|
+
this.metas.set(key, meta);
|
|
11
16
|
this.exposeToWindow(key, internal);
|
|
12
17
|
}
|
|
13
18
|
get(key) {
|
|
14
19
|
return this.refs.get(key);
|
|
15
20
|
}
|
|
21
|
+
getMeta(key) {
|
|
22
|
+
return this.metas.get(key);
|
|
23
|
+
}
|
|
24
|
+
isCatchMode(key) {
|
|
25
|
+
return this.catchModeKeys.has(key);
|
|
26
|
+
}
|
|
27
|
+
setCatchMode(key, enabled) {
|
|
28
|
+
if (enabled) {
|
|
29
|
+
if (this.catchModeKeys.has(key))
|
|
30
|
+
return; // idempotent — avoids duplicate caught events
|
|
31
|
+
this.catchModeKeys.add(key);
|
|
32
|
+
const ref = this.refs.get(key);
|
|
33
|
+
if (ref) {
|
|
34
|
+
ref.setLoading();
|
|
35
|
+
this.dispatchDomEvent(key, { type: 'caught', args: [], requestId: this.nextReqId(), ts: Date.now() });
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
this.catchModeKeys.delete(key);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
nextReqId() {
|
|
43
|
+
return `req-${++this._reqCount}`;
|
|
44
|
+
}
|
|
16
45
|
exposeToWindow(key, ref) {
|
|
17
46
|
window.__openApiMocks__ ??= {};
|
|
47
|
+
window.openApiMock ??= (k) => window.__openApiMocks__[k];
|
|
18
48
|
const history = [];
|
|
19
49
|
const listeners = new Set();
|
|
20
50
|
const emit = (e) => {
|
|
@@ -22,7 +52,13 @@ class MockResourceBus {
|
|
|
22
52
|
listeners.forEach((cb) => cb(e));
|
|
23
53
|
this.dispatchDomEvent(key, e);
|
|
24
54
|
};
|
|
25
|
-
ref.onRequest((args) =>
|
|
55
|
+
ref.onRequest((args) => {
|
|
56
|
+
emit({ type: 'request', args, ts: Date.now() });
|
|
57
|
+
if (this.catchModeKeys.has(key)) {
|
|
58
|
+
ref.setLoading();
|
|
59
|
+
emit({ type: 'caught', args, requestId: this.nextReqId(), ts: Date.now() });
|
|
60
|
+
}
|
|
61
|
+
});
|
|
26
62
|
window.__openApiMocks__[key] = {
|
|
27
63
|
resolve: (v) => { ref.resolve(v); emit({ type: 'resolve', value: v, ts: Date.now() }); },
|
|
28
64
|
resolveAfter: (ms, v) => { ref.resolveAfter(ms, v); },
|
|
@@ -36,6 +72,8 @@ class MockResourceBus {
|
|
|
36
72
|
simulateProgress: (pt, total, dur, v, steps) => {
|
|
37
73
|
ref.simulateProgress(pt, total, dur, v, steps);
|
|
38
74
|
},
|
|
75
|
+
setCatchMode: (enabled) => this.setCatchMode(key, enabled),
|
|
76
|
+
getMeta: () => this.getMeta(key),
|
|
39
77
|
getState: () => ({
|
|
40
78
|
status: String(ref.status()),
|
|
41
79
|
value: ref.value(),
|
|
@@ -57,6 +95,14 @@ class MockResourceBus {
|
|
|
57
95
|
document.addEventListener('openapi-mock-control', (e) => {
|
|
58
96
|
const detail = e.detail;
|
|
59
97
|
const ref = this.refs.get(detail.key);
|
|
98
|
+
switch (detail.action) {
|
|
99
|
+
case 'setCatchMode':
|
|
100
|
+
this.setCatchMode(detail.key, true);
|
|
101
|
+
return;
|
|
102
|
+
case 'clearCatchMode':
|
|
103
|
+
this.setCatchMode(detail.key, false);
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
60
106
|
if (!ref)
|
|
61
107
|
return;
|
|
62
108
|
switch (detail.action) {
|
|
@@ -72,9 +118,17 @@ class MockResourceBus {
|
|
|
72
118
|
case 'fail':
|
|
73
119
|
ref.fail(detail.value);
|
|
74
120
|
break;
|
|
75
|
-
case 'reset':
|
|
121
|
+
case 'reset': {
|
|
76
122
|
ref.reset();
|
|
123
|
+
// If catch mode is still on, immediately re-intercept the resource.
|
|
124
|
+
if (this.catchModeKeys.has(detail.key)) {
|
|
125
|
+
ref.setLoading();
|
|
126
|
+
this.dispatchDomEvent(detail.key, {
|
|
127
|
+
type: 'caught', args: [], requestId: this.nextReqId(), ts: Date.now(),
|
|
128
|
+
});
|
|
129
|
+
}
|
|
77
130
|
break;
|
|
131
|
+
}
|
|
78
132
|
case 'setProgress':
|
|
79
133
|
ref.setProgress(detail.progressType, detail.loaded, detail.total);
|
|
80
134
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock-resource-bus.js","sourceRoot":"","sources":["../../../../../tools/openapi-resource-mocks/src/lib/mock-resource-bus.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"mock-resource-bus.js","sourceRoot":"","sources":["../../../../../tools/openapi-resource-moc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b,GAAG,CAAC,KAAK,EAAE,CAAC;oBACZ,oEAAoE;oBACpE,IAAI,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;wBACvC,GAAG,CAAC,UAAU,EAAE,CAAC;wBACjB,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,GAAG,EAAE;4BAChC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE;yBACtE,CAAC,CAAC;oBACL,CAAC;oBACD,MAAM;gBACR,CAAC;gBACD,KAAK,aAAa;oBAAO,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,YAAa,EAAE,MAAM,CAAC,MAAO,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;oBAAC,MAAM;gBACpG,KAAK,kBAAkB;oBAAE,GAAG,CAAC,gBAAgB,CAClB,MAAM,CAAC,YAAa,EACpB,MAAM,CAAC,KAAM,EACb,MAAM,CAAC,OAAO,IAAI,IAAI,EACtB,MAAM,CAAC,KAAK,EACZ,MAAM,CAAC,KAAK,CACb,CAAC;oBAAsD,MAAM;YACzF,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAhJD,0CAgJC;AAED,SAAgB,sBAAsB;IACpC,OAAO,IAAA,+BAAwB,EAAC;QAC9B,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI,eAAe,EAAE,EAAE;KACtE,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-resource-meta.js","sourceRoot":"","sources":["../../../../../tools/openapi-resource-mocks/src/lib/mock-resource-meta.ts"],"names":[],"mappings":""}
|
|
@@ -82,7 +82,8 @@ function createMockResourceRef(initialState) {
|
|
|
82
82
|
requestListeners.add(cb);
|
|
83
83
|
return () => requestListeners.delete(cb);
|
|
84
84
|
},
|
|
85
|
-
_notifyRequest: (
|
|
85
|
+
_notifyRequest: (rawArgs) => {
|
|
86
|
+
const args = rawArgs.map((arg) => typeof arg === 'function' ? arg() : arg);
|
|
86
87
|
requestListeners.forEach((cb) => cb(args));
|
|
87
88
|
},
|
|
88
89
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock-resource-ref.js","sourceRoot":"","sources":["../../../../../tools/openapi-resource-mocks/src/lib/mock-resource-ref.ts"],"names":[],"mappings":";;AAyCA,
|
|
1
|
+
{"version":3,"file":"mock-resource-ref.js","sourceRoot":"","sources":["../../../../../tools/openapi-resource-mocks/src/lib/mock-resource-ref.ts"],"names":[],"mappings":";;AAyCA,sDAmGC;AA5ID,wCAAyD;AAyCzD,SAAgB,qBAAqB,CACnC,YAAmC;IAEnC,MAAM,OAAO,GAAG,IAAA,aAAM,EAAiB,MAAM,CAAC,CAAC;IAC/C,MAAM,MAAM,GAAG,IAAA,aAAM,EAAgB,SAAS,CAAC,CAAC;IAChD,MAAM,MAAM,GAAG,IAAA,aAAM,EAAU,SAAS,CAAC,CAAC;IAC1C,MAAM,SAAS,GAAG,IAAA,aAAM,EAA2B,SAAS,CAAC,CAAC;IAC9D,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAA6B,CAAC;IAE9D,IAAI,YAAY,EAAE,CAAC;QACjB,IAAI,OAAO,IAAI,YAAY,EAAE,CAAC;YAC5B,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;YAC/B,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAC1B,CAAC;aAAM,IAAI,SAAS,IAAI,YAAY,EAAE,CAAC;YACrC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACzB,CAAC;aAAM,IAAI,OAAO,IAAI,YAAY,EAAE,CAAC;YACnC,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;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AAE,GAA8C,CAAC;QAC7D,UAAU,EAAE,GAAG,EAAE,CAAC,GAAG;QACrB,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE;YAChB,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACzB,OAAO,GAAG,EAAE,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC3C,CAAC;QACD,cAAc,EAAE,CAAC,OAAO,EAAE,EAAE;YAC1B,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAC/B,OAAO,GAAG,KAAK,UAAU,CAAC,CAAC,CAAE,GAAqB,EAAE,CAAC,CAAC,CAAC,GAAG,CAC3D,CAAC;YACF,gBAAgB,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7C,CAAC;KACF,CAAC;IACF,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import { InjectionToken, FactoryProvider } from '@angular/core';
|
|
2
2
|
import { httpResource } from '@angular/common/http';
|
|
3
|
-
import {
|
|
4
|
-
export
|
|
3
|
+
import type { MockResourceMeta } from './mock-resource-meta';
|
|
4
|
+
export type DeepPartial<T> = T extends Array<infer E> ? DeepPartial<E>[] : T extends object ? {
|
|
5
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
6
|
+
} : T;
|
|
7
|
+
export type ProviderInitialBehavior<T> = {
|
|
8
|
+
value: DeepPartial<T>;
|
|
9
|
+
delay?: number;
|
|
10
|
+
} | {
|
|
11
|
+
loading: true;
|
|
12
|
+
} | {
|
|
13
|
+
error: unknown;
|
|
14
|
+
delay?: number;
|
|
15
|
+
};
|
|
16
|
+
export declare function provideMockResource<T>(token: InjectionToken<(...args: unknown[]) => ReturnType<typeof httpResource<T>>>, key: string, initialBehavior?: ProviderInitialBehavior<T>, meta?: MockResourceMeta): FactoryProvider;
|
|
@@ -4,15 +4,66 @@ exports.provideMockResource = provideMockResource;
|
|
|
4
4
|
const core_1 = require("@angular/core");
|
|
5
5
|
const mock_resource_bus_1 = require("./mock-resource-bus");
|
|
6
6
|
const mock_resource_ref_1 = require("./mock-resource-ref");
|
|
7
|
-
function
|
|
7
|
+
function applyBehavior(ref, behavior) {
|
|
8
|
+
if ('value' in behavior) {
|
|
9
|
+
if (behavior.delay) {
|
|
10
|
+
ref.resolveAfter(behavior.delay, behavior.value);
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
ref.resolve(behavior.value);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
else if ('error' in behavior) {
|
|
17
|
+
if (behavior.delay) {
|
|
18
|
+
ref.setLoading();
|
|
19
|
+
setTimeout(() => ref.fail(behavior.error), behavior.delay);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
ref.fail(behavior.error);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
ref.setLoading();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function provideMockResource(token, key, initialBehavior, meta) {
|
|
8
30
|
return {
|
|
9
31
|
provide: token,
|
|
10
32
|
useFactory: () => {
|
|
11
33
|
const bus = (0, core_1.inject)(mock_resource_bus_1.MockResourceBus);
|
|
12
|
-
const ref = (0, mock_resource_ref_1.createMockResourceRef)(initialState);
|
|
13
|
-
bus.register(key, ref);
|
|
14
34
|
return (...args) => {
|
|
15
|
-
ref.
|
|
35
|
+
const ref = (0, mock_resource_ref_1.createMockResourceRef)();
|
|
36
|
+
bus.register(key, ref, meta);
|
|
37
|
+
const internal = ref;
|
|
38
|
+
// untracked() prevents thunk signal-reads from leaking into the outer reactive
|
|
39
|
+
// context — component field initializers run during Angular change detection.
|
|
40
|
+
(0, core_1.untracked)(() => {
|
|
41
|
+
internal._notifyRequest(args);
|
|
42
|
+
// Skip initialBehavior when the bus caught the request: catch mode takes
|
|
43
|
+
// precedence and the response must come from the DevTools panel.
|
|
44
|
+
if (initialBehavior && !bus.isCatchMode(key))
|
|
45
|
+
applyBehavior(ref, initialBehavior);
|
|
46
|
+
});
|
|
47
|
+
// When any arg is a reactive thunk, track signal changes so each new set of
|
|
48
|
+
// params fires a new request event (mirroring how httpResource re-fires on
|
|
49
|
+
// reactive lambda changes). effect() is valid here because this function is
|
|
50
|
+
// always called from a component constructor / field-initializer context.
|
|
51
|
+
if (args.some((a) => typeof a === 'function')) {
|
|
52
|
+
let first = true;
|
|
53
|
+
(0, core_1.effect)(() => {
|
|
54
|
+
// Resolve thunks inside the effect body so their signals are tracked.
|
|
55
|
+
const resolved = args.map((a) => (typeof a === 'function' ? a() : a));
|
|
56
|
+
(0, core_1.untracked)(() => {
|
|
57
|
+
if (first) {
|
|
58
|
+
first = false;
|
|
59
|
+
return;
|
|
60
|
+
} // first run already handled above
|
|
61
|
+
internal._notifyRequest(resolved);
|
|
62
|
+
if (initialBehavior && !bus.isCatchMode(key))
|
|
63
|
+
applyBehavior(ref, initialBehavior);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
}
|
|
16
67
|
return ref;
|
|
17
68
|
};
|
|
18
69
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provide-mock-resource.js","sourceRoot":"","sources":["../../../../../tools/openapi-resource-mocks/src/lib/provide-mock-resource.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"provide-mock-resource.js","sourceRoot":"","sources":["../../../../../tools/openapi-resource-mocks/src/lib/provide-mock-resource.ts"],"names":[],"mappings":";;AAoCA,kDA6CC;AAjFD,wCAA2F;AAE3F,2DAAsD;AACtD,2DAAgH;AAchH,SAAS,aAAa,CAAI,GAAuB,EAAE,QAAoC;IACrF,IAAI,OAAO,IAAI,QAAQ,EAAE,CAAC;QACxB,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;YACnB,GAAG,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,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eAAe,CAAC,CAAC;gBACpF,CAAC,CAAC,CAAC;gBAEH,4EAA4E;gBAC5E,2EAA2E;gBAC3E,4EAA4E;gBAC5E,0EAA0E;gBAC1E,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,UAAU,CAAC,EAAE,CAAC;oBAC9C,IAAI,KAAK,GAAG,IAAI,CAAC;oBACjB,IAAA,aAAM,EAAC,GAAG,EAAE;wBACV,sEAAsE;wBACtE,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,UAAU,CAAC,CAAC,CAAE,CAAmB,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;wBACzF,IAAA,gBAAS,EAAC,GAAG,EAAE;4BACb,IAAI,KAAK,EAAE,CAAC;gCAAC,KAAK,GAAG,KAAK,CAAC;gCAAC,OAAO;4BAAC,CAAC,CAAC,kCAAkC;4BACxE,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;4BAClC,IAAI,eAAe,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC;gCAAE,aAAa,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;wBACpF,CAAC,CAAC,CAAC;oBACL,CAAC,CAAC,CAAC;gBACL,CAAC;gBAED,OAAO,GAAoD,CAAC;YAC9D,CAAC,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { InjectionToken, ResourceRef } from '@angular/core';
|
|
2
|
+
/** Extracts the response type T from an InjectionToken<(...args) => ResourceRef<T>>. */
|
|
3
|
+
export type TokenValue<Token extends InjectionToken<any>> = Token extends InjectionToken<(...args: any[]) => ResourceRef<infer V>> ? V : never;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-value.js","sourceRoot":"","sources":["../../../../../tools/openapi-resource-mocks/src/lib/token-value.ts"],"names":[],"mappings":""}
|