@commandgarden/cli 2.2.0 → 2.4.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.
Files changed (58) hide show
  1. package/dist/main.js +1 -0
  2. package/node_modules/@commandgarden/app/dist/client/assets/index--IDuJWmP.js +397 -0
  3. package/node_modules/@commandgarden/app/dist/client/assets/index-qunCIeG9.css +1 -0
  4. package/node_modules/@commandgarden/app/dist/client/index.html +19 -19
  5. package/node_modules/@commandgarden/app/dist/server/daemon-client.test.js +47 -0
  6. package/node_modules/@commandgarden/app/dist/server/routes/index.js +2 -0
  7. package/node_modules/@commandgarden/app/dist/server/routes/routes.test.js +137 -0
  8. package/node_modules/@commandgarden/app/dist/server/routes/trusted-peers-cache.d.ts +3 -0
  9. package/node_modules/@commandgarden/app/dist/server/routes/trusted-peers-cache.js +17 -0
  10. package/node_modules/@commandgarden/app/dist/server/store.d.ts +5 -0
  11. package/node_modules/@commandgarden/app/dist/server/store.js +50 -31
  12. package/node_modules/@commandgarden/app/dist/server/store.test.js +59 -0
  13. package/node_modules/@commandgarden/app/package.json +42 -42
  14. package/node_modules/@commandgarden/chrome/dist/content-script.js.map +1 -1
  15. package/node_modules/@commandgarden/chrome/dist/fetch-interceptor.js +44 -0
  16. package/node_modules/@commandgarden/chrome/dist/manifest.json +16 -16
  17. package/node_modules/@commandgarden/chrome/dist/popup.html +218 -218
  18. package/node_modules/@commandgarden/chrome/dist/popup.js.map +1 -1
  19. package/node_modules/@commandgarden/chrome/dist/service-worker.js +2 -1
  20. package/node_modules/@commandgarden/chrome/dist/service-worker.js.map +2 -2
  21. package/node_modules/@commandgarden/chrome/package.json +25 -25
  22. package/node_modules/@commandgarden/daemon/connectors/ado-git-commits.eval.js +143 -143
  23. package/node_modules/@commandgarden/daemon/connectors/ado-git-commits.yaml +70 -70
  24. package/node_modules/@commandgarden/daemon/connectors/gcs-kb-content.yaml +58 -58
  25. package/node_modules/@commandgarden/daemon/connectors/gcs-kb-pages.yaml +47 -47
  26. package/node_modules/@commandgarden/daemon/connectors/jira-my-tickets.eval.js +115 -115
  27. package/node_modules/@commandgarden/daemon/connectors/jira-my-tickets.yaml +54 -54
  28. package/node_modules/@commandgarden/daemon/connectors/lib/msal-token.js +20 -20
  29. package/node_modules/@commandgarden/daemon/connectors/outlook-my-meetings.eval.js +186 -186
  30. package/node_modules/@commandgarden/daemon/connectors/outlook-my-meetings.yaml +41 -41
  31. package/node_modules/@commandgarden/daemon/connectors/saba-pending-training.eval.js +94 -94
  32. package/node_modules/@commandgarden/daemon/connectors/saba-pending-training.yaml +34 -34
  33. package/node_modules/@commandgarden/daemon/connectors/socket-security-news.yaml +63 -63
  34. package/node_modules/@commandgarden/daemon/connectors/teams-room-availability.eval.js +342 -341
  35. package/node_modules/@commandgarden/daemon/connectors/teams-room-availability.yaml +47 -46
  36. package/node_modules/@commandgarden/daemon/connectors/teams-rooms-availability.eval.js +439 -0
  37. package/node_modules/@commandgarden/daemon/connectors/teams-rooms-availability.yaml +48 -0
  38. package/node_modules/@commandgarden/daemon/connectors/timetracking-projects.eval.js +52 -52
  39. package/node_modules/@commandgarden/daemon/connectors/timetracking-projects.yaml +42 -42
  40. package/node_modules/@commandgarden/daemon/connectors/timetracking-report.eval.js +81 -81
  41. package/node_modules/@commandgarden/daemon/connectors/timetracking-report.yaml +52 -52
  42. package/node_modules/@commandgarden/daemon/connectors/tldrsec-newsletter.eval.js +27 -27
  43. package/node_modules/@commandgarden/daemon/connectors/tldrsec-newsletter.yaml +38 -38
  44. package/node_modules/@commandgarden/daemon/connectors/tokenmaster-clients-list.yaml +55 -55
  45. package/node_modules/@commandgarden/daemon/dist/audit-store.js +8 -8
  46. package/node_modules/@commandgarden/daemon/dist/cdp-client.d.ts +24 -0
  47. package/node_modules/@commandgarden/daemon/dist/cdp-client.d.ts.map +1 -0
  48. package/node_modules/@commandgarden/daemon/dist/cdp-client.js +150 -0
  49. package/node_modules/@commandgarden/daemon/dist/cdp-client.js.map +1 -0
  50. package/node_modules/@commandgarden/daemon/package.json +32 -32
  51. package/node_modules/@commandgarden/shared/dist/connector.d.ts +3 -0
  52. package/node_modules/@commandgarden/shared/dist/connector.d.ts.map +1 -1
  53. package/node_modules/@commandgarden/shared/dist/connector.js +1 -0
  54. package/node_modules/@commandgarden/shared/dist/connector.js.map +1 -1
  55. package/node_modules/@commandgarden/shared/package.json +32 -32
  56. package/package.json +58 -58
  57. package/node_modules/@commandgarden/app/dist/client/assets/index-Cglxej9D.css +0 -1
  58. package/node_modules/@commandgarden/app/dist/client/assets/index-Cju0_G1Y.js +0 -397
@@ -1,42 +1,42 @@
1
- site: timetracking
2
- name: projects
3
- version: "1.0"
4
- description: "List all available projects and activities for the current user"
5
- access: read
6
-
7
- domains:
8
- - "timetracking.mercedes-benz-techinnovation.com"
9
- - "mbti-bam-wzde-prd-ejdchtb0g9afexhr.a01.azurefd.net"
10
- capabilities:
11
- - navigate
12
- - js_evaluate
13
-
14
- args:
15
- - name: month
16
- type: string
17
- required: false
18
- help: "Month in YYYY-MM format (default: current month)"
19
- pattern: "^\\d{4}-\\d{2}$"
20
-
21
- columns:
22
- - name: projectId
23
- type: string
24
- - name: projectName
25
- type: string
26
- - name: activityNumber
27
- type: string
28
- - name: activityName
29
- type: string
30
- - name: category
31
- type: string
32
- - name: linePropertyId
33
- type: string
34
-
35
- pipeline:
36
- - step: navigate
37
- url: "https://timetracking.mercedes-benz-techinnovation.com/"
38
- - step: wait
39
- selector: "body"
40
- timeout: 10000
41
- - step: js_evaluate
42
- file: timetracking-projects.eval.js
1
+ site: timetracking
2
+ name: projects
3
+ version: "1.0"
4
+ description: "List all available projects and activities for the current user"
5
+ access: read
6
+
7
+ domains:
8
+ - "timetracking.mercedes-benz-techinnovation.com"
9
+ - "mbti-bam-wzde-prd-ejdchtb0g9afexhr.a01.azurefd.net"
10
+ capabilities:
11
+ - navigate
12
+ - js_evaluate
13
+
14
+ args:
15
+ - name: month
16
+ type: string
17
+ required: false
18
+ help: "Month in YYYY-MM format (default: current month)"
19
+ pattern: "^\\d{4}-\\d{2}$"
20
+
21
+ columns:
22
+ - name: projectId
23
+ type: string
24
+ - name: projectName
25
+ type: string
26
+ - name: activityNumber
27
+ type: string
28
+ - name: activityName
29
+ type: string
30
+ - name: category
31
+ type: string
32
+ - name: linePropertyId
33
+ type: string
34
+
35
+ pipeline:
36
+ - step: navigate
37
+ url: "https://timetracking.mercedes-benz-techinnovation.com/"
38
+ - step: wait
39
+ selector: "body"
40
+ timeout: 10000
41
+ - step: js_evaluate
42
+ file: timetracking-projects.eval.js
@@ -1,81 +1,81 @@
1
- // Runs in page context via js_evaluate step.
2
- // Reads the MSAL access token from sessionStorage, fetches the ReportFAK API,
3
- // and flattens day objects into one row per booking line.
4
- //
5
- // SSO/MFA: polls sessionStorage for up to 60s, giving the user time to
6
- // complete login and get redirected back to the app.
7
- //
8
- // Template variables interpolated before execution:
9
- // ${{ args.month | default("") }}
10
-
11
- // Poll for MSAL token (handles SSO redirects + MFA)
12
- // Canonical source: connectors/lib/msal-token.js
13
- const __deadline = Date.now() + 60000;
14
- let token;
15
- while (Date.now() < __deadline) {
16
- const k = Object.keys(sessionStorage).find(x => x.includes('accesstoken'));
17
- if (k) {
18
- try {
19
- const tokenData = JSON.parse(sessionStorage.getItem(k));
20
- if (Number(tokenData.expiresOn) > Math.floor(Date.now() / 1000) + 30) {
21
- token = tokenData.secret;
22
- break;
23
- }
24
- } catch (_) {}
25
- }
26
- await new Promise(r => setTimeout(r, 1000));
27
- }
28
- if (!token) throw new Error('No valid MSAL access token after 60s — log in and retry');
29
-
30
- let month = '${{ args.month | default("") }}';
31
- if (!month) {
32
- const now = new Date();
33
- month = now.getFullYear() + '-' + String(now.getMonth() + 1).padStart(2, '0');
34
- }
35
-
36
- const apiBase = 'https://mbti-bam-wzde-prd-ejdchtb0g9afexhr.a01.azurefd.net/api/';
37
- const authHeaders = { Authorization: 'Bearer ' + token, Accept: 'application/json' };
38
-
39
- const [resp, projResp] = await Promise.all([
40
- fetch(apiBase + 'ReportFAK?date=' + month + '-01', { headers: authHeaders }),
41
- fetch(apiBase + 'Projects?date=' + month + '-01', { headers: authHeaders }).catch(() => null),
42
- ]);
43
- if (!resp.ok) throw new Error('ReportFAK returned HTTP ' + resp.status);
44
-
45
- const projectNames = new Map();
46
- const activityNames = new Map(); // key: "projectId\0activityNumber" → description
47
- if (projResp && projResp.ok) {
48
- for (const p of await projResp.json()) {
49
- projectNames.set(p.mserp_projectid, p.mserp_projectname);
50
- for (const act of p.activities || []) {
51
- if (act.mserp_activitynumber && act.mserp_description) {
52
- activityNames.set(act.mserp_projectid + '\0' + act.mserp_activitynumber, act.mserp_description);
53
- }
54
- }
55
- }
56
- }
57
-
58
- const days = await resp.json();
59
- const rows = [];
60
- for (const day of days) {
61
- const header = day.calendarHeader || {};
62
- const dayDate = (day.date || '').slice(0, 10);
63
- for (const line of day.calendarLines || []) {
64
- const pid = line.mserp_projectid || null;
65
- const actNum = line.mserp_activitynumber || null;
66
- rows.push({
67
- month: month,
68
- date: dayDate,
69
- projectId: pid,
70
- projectName: projectNames.get(pid) || null,
71
- category: line.mserp_category || null,
72
- activity: actNum,
73
- activityName: (pid && actNum) ? (activityNames.get(pid + '\0' + actNum) || null) : null,
74
- hours: typeof line.mserp_hours === 'number' ? line.mserp_hours : null,
75
- status: header.status || null,
76
- journalId: line.mserp_journalid || null,
77
- lineNumber: typeof line.mserp_linenumber === 'number' ? line.mserp_linenumber : null,
78
- });
79
- }
80
- }
81
- return rows;
1
+ // Runs in page context via js_evaluate step.
2
+ // Reads the MSAL access token from sessionStorage, fetches the ReportFAK API,
3
+ // and flattens day objects into one row per booking line.
4
+ //
5
+ // SSO/MFA: polls sessionStorage for up to 60s, giving the user time to
6
+ // complete login and get redirected back to the app.
7
+ //
8
+ // Template variables interpolated before execution:
9
+ // ${{ args.month | default("") }}
10
+
11
+ // Poll for MSAL token (handles SSO redirects + MFA)
12
+ // Canonical source: connectors/lib/msal-token.js
13
+ const __deadline = Date.now() + 60000;
14
+ let token;
15
+ while (Date.now() < __deadline) {
16
+ const k = Object.keys(sessionStorage).find(x => x.includes('accesstoken'));
17
+ if (k) {
18
+ try {
19
+ const tokenData = JSON.parse(sessionStorage.getItem(k));
20
+ if (Number(tokenData.expiresOn) > Math.floor(Date.now() / 1000) + 30) {
21
+ token = tokenData.secret;
22
+ break;
23
+ }
24
+ } catch (_) {}
25
+ }
26
+ await new Promise(r => setTimeout(r, 1000));
27
+ }
28
+ if (!token) throw new Error('No valid MSAL access token after 60s — log in and retry');
29
+
30
+ let month = '${{ args.month | default("") }}';
31
+ if (!month) {
32
+ const now = new Date();
33
+ month = now.getFullYear() + '-' + String(now.getMonth() + 1).padStart(2, '0');
34
+ }
35
+
36
+ const apiBase = 'https://mbti-bam-wzde-prd-ejdchtb0g9afexhr.a01.azurefd.net/api/';
37
+ const authHeaders = { Authorization: 'Bearer ' + token, Accept: 'application/json' };
38
+
39
+ const [resp, projResp] = await Promise.all([
40
+ fetch(apiBase + 'ReportFAK?date=' + month + '-01', { headers: authHeaders }),
41
+ fetch(apiBase + 'Projects?date=' + month + '-01', { headers: authHeaders }).catch(() => null),
42
+ ]);
43
+ if (!resp.ok) throw new Error('ReportFAK returned HTTP ' + resp.status);
44
+
45
+ const projectNames = new Map();
46
+ const activityNames = new Map(); // key: "projectId\0activityNumber" → description
47
+ if (projResp && projResp.ok) {
48
+ for (const p of await projResp.json()) {
49
+ projectNames.set(p.mserp_projectid, p.mserp_projectname);
50
+ for (const act of p.activities || []) {
51
+ if (act.mserp_activitynumber && act.mserp_description) {
52
+ activityNames.set(act.mserp_projectid + '\0' + act.mserp_activitynumber, act.mserp_description);
53
+ }
54
+ }
55
+ }
56
+ }
57
+
58
+ const days = await resp.json();
59
+ const rows = [];
60
+ for (const day of days) {
61
+ const header = day.calendarHeader || {};
62
+ const dayDate = (day.date || '').slice(0, 10);
63
+ for (const line of day.calendarLines || []) {
64
+ const pid = line.mserp_projectid || null;
65
+ const actNum = line.mserp_activitynumber || null;
66
+ rows.push({
67
+ month: month,
68
+ date: dayDate,
69
+ projectId: pid,
70
+ projectName: projectNames.get(pid) || null,
71
+ category: line.mserp_category || null,
72
+ activity: actNum,
73
+ activityName: (pid && actNum) ? (activityNames.get(pid + '\0' + actNum) || null) : null,
74
+ hours: typeof line.mserp_hours === 'number' ? line.mserp_hours : null,
75
+ status: header.status || null,
76
+ journalId: line.mserp_journalid || null,
77
+ lineNumber: typeof line.mserp_linenumber === 'number' ? line.mserp_linenumber : null,
78
+ });
79
+ }
80
+ }
81
+ return rows;
@@ -1,52 +1,52 @@
1
- site: timetracking
2
- name: report
3
- version: "1.0"
4
- description: "MBTI Time Tracking monthly report — one row per booking line"
5
- access: read
6
-
7
- domains:
8
- - "timetracking.mercedes-benz-techinnovation.com"
9
- - "mbti-bam-wzde-prd-ejdchtb0g9afexhr.a01.azurefd.net"
10
- capabilities:
11
- - navigate
12
- - js_evaluate
13
-
14
- args:
15
- - name: month
16
- type: string
17
- required: false
18
- help: "Month in YYYY-MM format (default: current month)"
19
- pattern: "^\\d{4}-\\d{2}$"
20
-
21
- columns:
22
- - name: month
23
- type: string
24
- - name: date
25
- type: string
26
- - name: projectId
27
- type: string
28
- - name: projectName
29
- type: string
30
- - name: category
31
- type: string
32
- - name: activity
33
- type: string
34
- - name: activityName
35
- type: string
36
- - name: hours
37
- type: number
38
- - name: status
39
- type: string
40
- - name: journalId
41
- type: string
42
- - name: lineNumber
43
- type: number
44
-
45
- pipeline:
46
- - step: navigate
47
- url: "https://timetracking.mercedes-benz-techinnovation.com/"
48
- - step: wait
49
- selector: "body"
50
- timeout: 10000
51
- - step: js_evaluate
52
- file: timetracking-report.eval.js
1
+ site: timetracking
2
+ name: report
3
+ version: "1.0"
4
+ description: "MBTI Time Tracking monthly report — one row per booking line"
5
+ access: read
6
+
7
+ domains:
8
+ - "timetracking.mercedes-benz-techinnovation.com"
9
+ - "mbti-bam-wzde-prd-ejdchtb0g9afexhr.a01.azurefd.net"
10
+ capabilities:
11
+ - navigate
12
+ - js_evaluate
13
+
14
+ args:
15
+ - name: month
16
+ type: string
17
+ required: false
18
+ help: "Month in YYYY-MM format (default: current month)"
19
+ pattern: "^\\d{4}-\\d{2}$"
20
+
21
+ columns:
22
+ - name: month
23
+ type: string
24
+ - name: date
25
+ type: string
26
+ - name: projectId
27
+ type: string
28
+ - name: projectName
29
+ type: string
30
+ - name: category
31
+ type: string
32
+ - name: activity
33
+ type: string
34
+ - name: activityName
35
+ type: string
36
+ - name: hours
37
+ type: number
38
+ - name: status
39
+ type: string
40
+ - name: journalId
41
+ type: string
42
+ - name: lineNumber
43
+ type: number
44
+
45
+ pipeline:
46
+ - step: navigate
47
+ url: "https://timetracking.mercedes-benz-techinnovation.com/"
48
+ - step: wait
49
+ selector: "body"
50
+ timeout: 10000
51
+ - step: js_evaluate
52
+ file: timetracking-report.eval.js
@@ -1,27 +1,27 @@
1
- // tldrsec-newsletter.eval.js
2
- // Extracts newsletter posts from Remix's __remixContext embedded JSON.
3
- // Returns an array of flattened post objects for the pipeline.
4
- // NOTE: No IIFE — evaluateInPage wraps this in AsyncFunction already.
5
-
6
- const ctx = window.__remixContext;
7
- if (!ctx) throw new Error('__remixContext not found');
8
-
9
- const loaderData = ctx.state?.loaderData;
10
- if (!loaderData) throw new Error('loaderData not found in __remixContext');
11
-
12
- // The route key for the tag/category page
13
- const categoryData = loaderData['routes/t/$category'];
14
- if (!categoryData) throw new Error('routes/t/$category loader data not found');
15
-
16
- const posts = categoryData.paginatedPosts?.posts;
17
- if (!Array.isArray(posts)) throw new Error('paginatedPosts.posts is not an array');
18
-
19
- return posts.map((p) => ({
20
- title: p.web_title || p.meta_default_title || '',
21
- slug: p.slug || '',
22
- url: 'https://tldrsec.com/p/' + (p.slug || ''),
23
- publishedAt: p.override_scheduled_at || p.created_at || '',
24
- excerpt: p.web_subtitle || p.meta_default_description || '',
25
- authors: (p.authors || []).map((a) => a.name).join(', '),
26
- tags: (p.content_tags || []).map((t) => t.display).join(', '),
27
- }));
1
+ // tldrsec-newsletter.eval.js
2
+ // Extracts newsletter posts from Remix's __remixContext embedded JSON.
3
+ // Returns an array of flattened post objects for the pipeline.
4
+ // NOTE: No IIFE — evaluateInPage wraps this in AsyncFunction already.
5
+
6
+ const ctx = window.__remixContext;
7
+ if (!ctx) throw new Error('__remixContext not found');
8
+
9
+ const loaderData = ctx.state?.loaderData;
10
+ if (!loaderData) throw new Error('loaderData not found in __remixContext');
11
+
12
+ // The route key for the tag/category page
13
+ const categoryData = loaderData['routes/t/$category'];
14
+ if (!categoryData) throw new Error('routes/t/$category loader data not found');
15
+
16
+ const posts = categoryData.paginatedPosts?.posts;
17
+ if (!Array.isArray(posts)) throw new Error('paginatedPosts.posts is not an array');
18
+
19
+ return posts.map((p) => ({
20
+ title: p.web_title || p.meta_default_title || '',
21
+ slug: p.slug || '',
22
+ url: 'https://tldrsec.com/p/' + (p.slug || ''),
23
+ publishedAt: p.override_scheduled_at || p.created_at || '',
24
+ excerpt: p.web_subtitle || p.meta_default_description || '',
25
+ authors: (p.authors || []).map((a) => a.name).join(', '),
26
+ tags: (p.content_tags || []).map((t) => t.display).join(', '),
27
+ }));
@@ -1,38 +1,38 @@
1
- site: tldrsec
2
- name: newsletter
3
- version: "1.0"
4
- description: "Latest newsletter issues from tl;dr sec — titles, summaries, authors, tags, and publish dates"
5
- access: read
6
-
7
- domains:
8
- - "tldrsec.com"
9
- capabilities:
10
- - navigate
11
- - js_evaluate
12
-
13
- args: []
14
-
15
- columns:
16
- - name: title
17
- type: string
18
- - name: slug
19
- type: string
20
- - name: url
21
- type: string
22
- - name: publishedAt
23
- type: string
24
- - name: excerpt
25
- type: string
26
- - name: authors
27
- type: string
28
- - name: tags
29
- type: string
30
-
31
- pipeline:
32
- - step: navigate
33
- url: "https://tldrsec.com/t/Newsletter"
34
- - step: wait
35
- selector: "body"
36
- timeout: 15000
37
- - step: js_evaluate
38
- file: tldrsec-newsletter.eval.js
1
+ site: tldrsec
2
+ name: newsletter
3
+ version: "1.0"
4
+ description: "Latest newsletter issues from tl;dr sec — titles, summaries, authors, tags, and publish dates"
5
+ access: read
6
+
7
+ domains:
8
+ - "tldrsec.com"
9
+ capabilities:
10
+ - navigate
11
+ - js_evaluate
12
+
13
+ args: []
14
+
15
+ columns:
16
+ - name: title
17
+ type: string
18
+ - name: slug
19
+ type: string
20
+ - name: url
21
+ type: string
22
+ - name: publishedAt
23
+ type: string
24
+ - name: excerpt
25
+ type: string
26
+ - name: authors
27
+ type: string
28
+ - name: tags
29
+ type: string
30
+
31
+ pipeline:
32
+ - step: navigate
33
+ url: "https://tldrsec.com/t/Newsletter"
34
+ - step: wait
35
+ selector: "body"
36
+ timeout: 15000
37
+ - step: js_evaluate
38
+ file: tldrsec-newsletter.eval.js
@@ -1,55 +1,55 @@
1
- site: tokenmaster
2
- name: clients-list
3
- version: "2.0"
4
- description: "List the clients managed by the current user in TokenMaster"
5
- access: read
6
-
7
- vars:
8
- domains:
9
- emea: tma.query.api.dvb.corpinter.net
10
- amap: tma.query.api.am.dvb.corpinter.net
11
- cn: tma.query.api.dvb.corpinter.net.cn
12
-
13
- args:
14
- - name: region
15
- type: string
16
- required: false
17
- default: "all"
18
- enum: [emea, amap, cn]
19
- help: "Region to query (emea, amap, cn, or 'all' for fan-out). Default: all"
20
-
21
- domains:
22
- - "tma.query.api.dvb.corpinter.net"
23
- - "tma.query.api.am.dvb.corpinter.net"
24
- - "tma.query.api.dvb.corpinter.net.cn"
25
- capabilities:
26
- - navigate
27
- - cookie_read
28
-
29
- columns:
30
- - name: id
31
- type: string
32
- - name: name
33
- type: string
34
- - name: status
35
- type: string
36
- - name: admins
37
- type: string
38
-
39
- pipeline:
40
- - step: navigate
41
- url: "https://${{ args.region | lookup(vars.domains) }}/v1/clients"
42
- - step: wait
43
- selector: "body"
44
- timeout: 30000
45
- - step: fetch
46
- url: "https://${{ args.region | lookup(vars.domains) }}/v1/clients"
47
- method: "GET"
48
- headers:
49
- Accept: "application/json"
50
- - step: map
51
- fields:
52
- id: "${{ row.id }}"
53
- name: "${{ row.name }}"
54
- status: "${{ row.status }}"
55
- admins: "${{ row.admins }}"
1
+ site: tokenmaster
2
+ name: clients-list
3
+ version: "2.0"
4
+ description: "List the clients managed by the current user in TokenMaster"
5
+ access: read
6
+
7
+ vars:
8
+ domains:
9
+ emea: tma.query.api.dvb.corpinter.net
10
+ amap: tma.query.api.am.dvb.corpinter.net
11
+ cn: tma.query.api.dvb.corpinter.net.cn
12
+
13
+ args:
14
+ - name: region
15
+ type: string
16
+ required: false
17
+ default: "all"
18
+ enum: [emea, amap, cn]
19
+ help: "Region to query (emea, amap, cn, or 'all' for fan-out). Default: all"
20
+
21
+ domains:
22
+ - "tma.query.api.dvb.corpinter.net"
23
+ - "tma.query.api.am.dvb.corpinter.net"
24
+ - "tma.query.api.dvb.corpinter.net.cn"
25
+ capabilities:
26
+ - navigate
27
+ - cookie_read
28
+
29
+ columns:
30
+ - name: id
31
+ type: string
32
+ - name: name
33
+ type: string
34
+ - name: status
35
+ type: string
36
+ - name: admins
37
+ type: string
38
+
39
+ pipeline:
40
+ - step: navigate
41
+ url: "https://${{ args.region | lookup(vars.domains) }}/v1/clients"
42
+ - step: wait
43
+ selector: "body"
44
+ timeout: 30000
45
+ - step: fetch
46
+ url: "https://${{ args.region | lookup(vars.domains) }}/v1/clients"
47
+ method: "GET"
48
+ headers:
49
+ Accept: "application/json"
50
+ - step: map
51
+ fields:
52
+ id: "${{ row.id }}"
53
+ name: "${{ row.name }}"
54
+ status: "${{ row.status }}"
55
+ admins: "${{ row.admins }}"
@@ -19,11 +19,11 @@ export class AuditStore {
19
19
  else {
20
20
  db = new SQL.Database();
21
21
  }
22
- db.run(`CREATE TABLE IF NOT EXISTS audit_events (
23
- id TEXT PRIMARY KEY, timestamp TEXT NOT NULL, type TEXT NOT NULL,
24
- user TEXT NOT NULL, connector TEXT NOT NULL, args TEXT NOT NULL,
25
- domains TEXT NOT NULL, capabilities TEXT NOT NULL, row_count INTEGER,
26
- columns TEXT, duration_ms INTEGER NOT NULL, error TEXT, denial_reason TEXT
22
+ db.run(`CREATE TABLE IF NOT EXISTS audit_events (
23
+ id TEXT PRIMARY KEY, timestamp TEXT NOT NULL, type TEXT NOT NULL,
24
+ user TEXT NOT NULL, connector TEXT NOT NULL, args TEXT NOT NULL,
25
+ domains TEXT NOT NULL, capabilities TEXT NOT NULL, row_count INTEGER,
26
+ columns TEXT, duration_ms INTEGER NOT NULL, error TEXT, denial_reason TEXT
27
27
  )`);
28
28
  const store = new AuditStore(db, dbPath);
29
29
  store.migrate();
@@ -77,9 +77,9 @@ export class AuditStore {
77
77
  }
78
78
  }
79
79
  insert(event) {
80
- this.db.run(`INSERT INTO audit_events (id, timestamp, type, user, connector, args, domains,
81
- capabilities, row_count, columns, duration_ms, error, denial_reason,
82
- correlation_id, connector_hash, steps, source, previous_value, new_value)
80
+ this.db.run(`INSERT INTO audit_events (id, timestamp, type, user, connector, args, domains,
81
+ capabilities, row_count, columns, duration_ms, error, denial_reason,
82
+ correlation_id, connector_hash, steps, source, previous_value, new_value)
83
83
  VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)`, [
84
84
  event.id, event.timestamp, event.type, event.user, event.connector,
85
85
  JSON.stringify(event.args), JSON.stringify(event.domains),
@@ -0,0 +1,24 @@
1
+ export declare class CdpClient {
2
+ private port;
3
+ private ws;
4
+ private msgId;
5
+ private pending;
6
+ private sessionIds;
7
+ constructor(port: number);
8
+ /** Connect to Chrome's browser-level CDP endpoint. */
9
+ connect(): Promise<void>;
10
+ /** Send a CDP command to the browser target. */
11
+ private send;
12
+ /** Send a CDP command to a specific session (tab). */
13
+ private sendToSession;
14
+ /**
15
+ * Enable Network domain on all matching tabs and future tabs.
16
+ * Uses Target.setAutoAttach to automatically attach to new targets
17
+ * (tabs created by the extension) and enable Network on them.
18
+ */
19
+ enableNetworkCapture(urlPattern?: string): Promise<void>;
20
+ /** Disconnect from CDP. */
21
+ disconnect(): void;
22
+ get connected(): boolean;
23
+ }
24
+ //# sourceMappingURL=cdp-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cdp-client.d.ts","sourceRoot":"","sources":["../src/cdp-client.ts"],"names":[],"mappings":"AA6BA,qBAAa,SAAS;IAMR,OAAO,CAAC,IAAI;IALxB,OAAO,CAAC,EAAE,CAA0B;IACpC,OAAO,CAAC,KAAK,CAAK;IAClB,OAAO,CAAC,OAAO,CAAoF;IACnG,OAAO,CAAC,UAAU,CAAqB;gBAEnB,IAAI,EAAE,MAAM;IAEhC,sDAAsD;IAChD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAkD9B,gDAAgD;IAChD,OAAO,CAAC,IAAI;IAgBZ,sDAAsD;IACtD,OAAO,CAAC,aAAa;IAgBrB;;;;OAIG;IACG,oBAAoB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAyB9D,2BAA2B;IAC3B,UAAU,IAAI,IAAI;IAYlB,IAAI,SAAS,IAAI,OAAO,CAA6B;CACtD"}