@qulib/core 0.2.0 → 0.2.2

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.
@@ -0,0 +1,21 @@
1
+ export const BUILT_IN_OAUTH_PROVIDERS = [
2
+ { id: 'github', label: 'GitHub', patterns: [/\bgithub\b/i] },
3
+ { id: 'google', label: 'Google', patterns: [/\bgoogle\b/i, /accounts\.google\.com/i] },
4
+ { id: 'microsoft', label: 'Microsoft', patterns: [/microsoft/i, /login\.microsoftonline\.com/i] },
5
+ { id: 'apple', label: 'Apple', patterns: [/sign in with apple/i, /\bapple id\b/i] },
6
+ { id: 'facebook', label: 'Facebook', patterns: [/facebook/i] },
7
+ { id: 'twitter', label: 'Twitter/X', patterns: [/twitter\.com/i, /\bsign in with x\b/i] },
8
+ { id: 'linkedin', label: 'LinkedIn', patterns: [/linkedin/i] },
9
+ { id: 'auth0', label: 'Auth0', patterns: [/auth0/i] },
10
+ { id: 'okta', label: 'Okta', patterns: [/\bokta\b/i] },
11
+ { id: 'onelogin', label: 'OneLogin', patterns: [/onelogin/i] },
12
+ { id: 'duo', label: 'Duo Security', patterns: [/duo security/i] },
13
+ { id: 'ping', label: 'Ping Identity', patterns: [/pingidentity/i, /pingone/i] },
14
+ { id: 'workday', label: 'Workday', patterns: [/workday/i] },
15
+ { id: 'saml', label: 'SAML SSO', patterns: [/\bsaml\b/i] },
16
+ { id: 'clever', label: 'Clever', patterns: [/\bclever\b/i, /clever\.com/i] },
17
+ { id: 'classlink', label: 'ClassLink', patterns: [/classlink/i] },
18
+ { id: 'schoology', label: 'Schoology', patterns: [/schoology/i] },
19
+ { id: 'canvas', label: 'Canvas (Instructure)', patterns: [/\bcanvas lms\b/i, /instructure/i] },
20
+ { id: 'blackboard', label: 'Blackboard', patterns: [/blackboard/i] },
21
+ ];
@@ -1 +1 @@
1
- {"version":3,"file":"playwright-explorer.d.ts","sourceRoot":"","sources":["../../src/tools/playwright-explorer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EAAwB,KAAK,cAAc,EAAc,MAAM,sCAAsC,CAAC;AAC7G,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAgBjE,qBAAa,kBAAmB,YAAW,WAAW;IAC9C,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;CAqJ/E"}
1
+ {"version":3,"file":"playwright-explorer.d.ts","sourceRoot":"","sources":["../../src/tools/playwright-explorer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EAAwB,KAAK,cAAc,EAAc,MAAM,sCAAsC,CAAC;AAC7G,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAgBjE,qBAAa,kBAAmB,YAAW,WAAW;IAC9C,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;CAqJ/E"}
@@ -1,4 +1,4 @@
1
- import { chromium } from '@playwright/test';
1
+ import { launchBrowser } from './browser.js';
2
2
  import { AxeBuilder } from '@axe-core/playwright';
3
3
  import { createAuthenticatedContext } from './auth.js';
4
4
  import { RouteInventorySchema } from '../schemas/route-inventory.schema.js';
@@ -17,7 +17,7 @@ function isInternalHref(href, baseUrlStr) {
17
17
  }
18
18
  export class PlaywrightExplorer {
19
19
  async explore(baseUrl, config) {
20
- const browser = await chromium.launch({ headless: true });
20
+ const browser = await launchBrowser();
21
21
  let context;
22
22
  try {
23
23
  context = await createAuthenticatedContext(browser, config.auth, config.timeoutMs);
@@ -0,0 +1,15 @@
1
+ import type { OAuthProvider } from './oauth-providers.js';
2
+ export interface SerializedProvider {
3
+ id: string;
4
+ label: string;
5
+ patterns: string[];
6
+ }
7
+ export declare function loadUserProviders(): OAuthProvider[];
8
+ export declare function addUserProvider(input: {
9
+ id: string;
10
+ label: string;
11
+ pattern: string;
12
+ }): void;
13
+ export declare function removeUserProvider(id: string): boolean;
14
+ export declare function listUserProviders(): SerializedProvider[];
15
+ //# sourceMappingURL=user-providers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-providers.d.ts","sourceRoot":"","sources":["../../src/tools/user-providers.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAI1D,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,wBAAgB,iBAAiB,IAAI,aAAa,EAAE,CAOnD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAc3F;AAED,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAStD;AAED,wBAAgB,iBAAiB,IAAI,kBAAkB,EAAE,CAExD"}
@@ -0,0 +1,62 @@
1
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
2
+ import { dirname, join } from 'node:path';
3
+ import { homedir } from 'node:os';
4
+ const USER_PROVIDERS_PATH = join(homedir(), '.qulib', 'providers.json');
5
+ export function loadUserProviders() {
6
+ const raw = loadSerialized();
7
+ return raw.map((p) => ({
8
+ id: p.id,
9
+ label: p.label,
10
+ patterns: p.patterns.map((src) => new RegExp(src, 'i')),
11
+ }));
12
+ }
13
+ export function addUserProvider(input) {
14
+ const existing = loadSerialized();
15
+ const idx = existing.findIndex((p) => p.id === input.id);
16
+ if (idx >= 0) {
17
+ const p = existing[idx];
18
+ if (!p.patterns.includes(input.pattern)) {
19
+ p.patterns.push(input.pattern);
20
+ }
21
+ p.label = input.label;
22
+ }
23
+ else {
24
+ existing.push({ id: input.id, label: input.label, patterns: [input.pattern] });
25
+ }
26
+ ensureDir();
27
+ writeFileSync(USER_PROVIDERS_PATH, JSON.stringify(existing, null, 2), 'utf-8');
28
+ }
29
+ export function removeUserProvider(id) {
30
+ const existing = loadSerialized();
31
+ const filtered = existing.filter((p) => p.id !== id);
32
+ if (filtered.length === existing.length) {
33
+ return false;
34
+ }
35
+ ensureDir();
36
+ writeFileSync(USER_PROVIDERS_PATH, JSON.stringify(filtered, null, 2), 'utf-8');
37
+ return true;
38
+ }
39
+ export function listUserProviders() {
40
+ return loadSerialized();
41
+ }
42
+ function loadSerialized() {
43
+ if (!existsSync(USER_PROVIDERS_PATH)) {
44
+ return [];
45
+ }
46
+ try {
47
+ const parsed = JSON.parse(readFileSync(USER_PROVIDERS_PATH, 'utf-8'));
48
+ if (!Array.isArray(parsed)) {
49
+ return [];
50
+ }
51
+ return parsed;
52
+ }
53
+ catch {
54
+ return [];
55
+ }
56
+ }
57
+ function ensureDir() {
58
+ const dir = dirname(USER_PROVIDERS_PATH);
59
+ if (!existsSync(dir)) {
60
+ mkdirSync(dir, { recursive: true });
61
+ }
62
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qulib/core",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Qulib — analyze deployed web apps for honest quality gaps (CLI + programmatic API)",
5
5
  "license": "MIT",
6
6
  "author": "Tapesh Nagarwal",