@vforsh/argus-watcher 0.5.29 → 0.5.30

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,7 @@
1
- import { storageRequestSchema } from '@vforsh/argus-core';
2
- import { executeStorage } from '../../cdp/storage.js';
1
+ import { DEFAULT_RELOAD_TIMEOUT_MS, indexedDbRequestSchema, storageClearOriginRequestSchema, storageRequestSchema } from '@vforsh/argus-core';
2
+ import { readNavigationBaseline } from '../../cdp/documentIdentity.js';
3
+ import { executeIndexedDb } from '../../cdp/indexedDb.js';
4
+ import { clearOriginStorage, executeStorage } from '../../cdp/storage.js';
3
5
  import { defineJsonRoute } from './defineRoute.js';
4
6
  const endpointByArea = {
5
7
  local: 'storage/local',
@@ -13,5 +15,28 @@ const createStorageRoute = (area) => defineJsonRoute({
13
15
  endpoint: endpointByArea[area],
14
16
  handle: ({ ctx, body: payload }) => executeStorage(ctx.cdpSession, area, payload),
15
17
  });
16
- export const storageRoutes = [createStorageRoute('local'), createStorageRoute('session')];
18
+ const indexedDbRoute = defineJsonRoute({
19
+ method: 'POST',
20
+ path: '/storage/indexeddb',
21
+ bodySchema: indexedDbRequestSchema,
22
+ endpoint: 'storage/indexeddb',
23
+ handle: ({ ctx, body: payload }) => executeIndexedDb(ctx.cdpSession, payload),
24
+ });
25
+ const clearOriginRoute = defineJsonRoute({
26
+ method: 'POST',
27
+ path: '/storage/clear',
28
+ bodySchema: storageClearOriginRequestSchema,
29
+ endpoint: 'storage/clear',
30
+ handle: async ({ ctx, body: payload }) => {
31
+ // Clear is scoped to the selected target's origin; the reload, like `/reload`, is page-scoped.
32
+ const { origin, storageKey, types } = await clearOriginStorage(ctx.cdpSession, payload);
33
+ if (!payload.reload) {
34
+ return { ok: true, origin, storageKey, types, reloaded: false };
35
+ }
36
+ const navigatedFrom = await readNavigationBaseline({ page: ctx.pageCdpSession, target: ctx.cdpSession });
37
+ await ctx.pageCdpSession.sendAndWait('Page.reload', { ignoreCache: false }, { timeoutMs: DEFAULT_RELOAD_TIMEOUT_MS });
38
+ return { ok: true, origin, storageKey, types, reloaded: true, navigatedFrom };
39
+ },
40
+ });
41
+ export const storageRoutes = [createStorageRoute('local'), createStorageRoute('session'), indexedDbRoute, clearOriginRoute];
17
42
  //# sourceMappingURL=storage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"storage.js","sourceRoot":"","sources":["../../../src/http/routes/storage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAElD,MAAM,cAAc,GAA6D;IAChF,KAAK,EAAE,eAAe;IACtB,OAAO,EAAE,iBAAiB;CAC1B,CAAA;AAED,0CAA0C;AAC1C,MAAM,kBAAkB,GAAG,CAAC,IAAiB,EAA0B,EAAE,CACxE,eAAe,CAAiB;IAC/B,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,YAAY,IAAI,EAAE;IACxB,UAAU,EAAE,oBAAoB;IAChC,QAAQ,EAAE,cAAc,CAAC,IAAI,CAAC;IAC9B,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,CAAC;CACjF,CAAC,CAAA;AAEH,MAAM,CAAC,MAAM,aAAa,GAA6B,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"storage.js","sourceRoot":"","sources":["../../../src/http/routes/storage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,+BAA+B,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAE7I,OAAO,EAAE,sBAAsB,EA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UAAU,EAAE,KAAK,EAAE,GAAG,MAAM,kBAAkB,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;QACvF,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;YACrB,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAA;QAChE,CAAC;QACD,MAAM,aAAa,GAAG,MAAM,sBAAsB,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,CAAC,UAAU,EAAE,CAAC,CAAA;QACxG,MAAM,GAAG,CAAC,cAAc,CAAC,WAAW,CAAC,aAAa,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,yBAAyB,EAAE,CAAC,CAAA;QACrH,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAE,CAAA;IAC9E,CAAC;CACD,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,aAAa,GAA6B,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC,SAAS,CAAC,EAAE,cAAc,EAAE,gBAAgB,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vforsh/argus-watcher",
3
- "version": "0.5.29",
3
+ "version": "0.5.30",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/vforsh/argus.git",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@jridgewell/trace-mapping": "^0.3.31",
30
- "@vforsh/argus-core": "^0.5.22",
30
+ "@vforsh/argus-core": "^0.5.23",
31
31
  "emittery": "^1.2.0"
32
32
  },
33
33
  "scripts": {