@dealcrawl/sdk 2.0.3 → 2.1.1
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/dist/{sdk/src/client.d.ts → client.d.ts} +5 -5
- package/dist/client.d.ts.map +1 -0
- package/dist/{sdk/src/client.js → client.js} +7 -7
- package/dist/client.js.map +1 -0
- package/dist/{sdk/src/error.d.ts → error.d.ts} +3 -2
- package/dist/error.d.ts.map +1 -0
- package/dist/{sdk/src/error.js → error.js} +15 -2
- package/dist/error.js.map +1 -0
- package/dist/{sdk/src/index.d.ts → index.d.ts} +3 -3
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/account.d.ts.map +1 -0
- package/dist/resources/account.js.map +1 -0
- package/dist/{sdk/src/resources → resources}/crawl.d.ts +19 -5
- package/dist/resources/crawl.d.ts.map +1 -0
- package/dist/{sdk/src/resources → resources}/crawl.js +44 -15
- package/dist/resources/crawl.js.map +1 -0
- package/dist/{sdk/src/resources → resources}/data.d.ts +2 -2
- package/dist/resources/data.d.ts.map +1 -0
- package/dist/{sdk/src/resources → resources}/data.js +6 -0
- package/dist/resources/data.js.map +1 -0
- package/dist/resources/dork.d.ts.map +1 -0
- package/dist/{sdk/src/resources → resources}/dork.js +6 -6
- package/dist/resources/dork.js.map +1 -0
- package/dist/resources/extract.d.ts.map +1 -0
- package/dist/resources/extract.js.map +1 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/keys.d.ts.map +1 -0
- package/dist/resources/keys.js.map +1 -0
- package/dist/resources/scrape.d.ts.map +1 -0
- package/dist/resources/scrape.js.map +1 -0
- package/dist/resources/status.d.ts.map +1 -0
- package/dist/resources/status.js.map +1 -0
- package/dist/resources/webhooks.d.ts.map +1 -0
- package/dist/resources/webhooks.js.map +1 -0
- package/dist/{sdk/src/types → types}/config.d.ts +1 -1
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js.map +1 -0
- package/dist/{sdk/src/types → types}/options.d.ts +40 -1
- package/dist/types/options.d.ts.map +1 -0
- package/dist/types/options.js.map +1 -0
- package/dist/{sdk/src/types → types}/responses.d.ts +38 -1
- package/dist/types/responses.d.ts.map +1 -0
- package/dist/types/responses.js.map +1 -0
- package/dist/types/shared.d.ts +234 -0
- package/dist/types/shared.d.ts.map +1 -0
- package/dist/{shared/src/constants/errors.js → types/shared.js} +8 -10
- package/dist/types/shared.js.map +1 -0
- package/dist/utils/polling.d.ts.map +1 -0
- package/dist/utils/polling.js.map +1 -0
- package/dist/{sdk/src/utils → utils}/request.d.ts +1 -1
- package/dist/utils/request.d.ts.map +1 -0
- package/dist/{sdk/src/utils → utils}/request.js +39 -8
- package/dist/utils/request.js.map +1 -0
- package/package.json +2 -1
- package/dist/sdk/src/client.d.ts.map +0 -1
- package/dist/sdk/src/client.js.map +0 -1
- package/dist/sdk/src/error.d.ts.map +0 -1
- package/dist/sdk/src/error.js.map +0 -1
- package/dist/sdk/src/index.d.ts.map +0 -1
- package/dist/sdk/src/index.js.map +0 -1
- package/dist/sdk/src/resources/account.d.ts.map +0 -1
- package/dist/sdk/src/resources/account.js.map +0 -1
- package/dist/sdk/src/resources/crawl.d.ts.map +0 -1
- package/dist/sdk/src/resources/crawl.js.map +0 -1
- package/dist/sdk/src/resources/data.d.ts.map +0 -1
- package/dist/sdk/src/resources/data.js.map +0 -1
- package/dist/sdk/src/resources/dork.d.ts.map +0 -1
- package/dist/sdk/src/resources/dork.js.map +0 -1
- package/dist/sdk/src/resources/extract.d.ts.map +0 -1
- package/dist/sdk/src/resources/extract.js.map +0 -1
- package/dist/sdk/src/resources/index.d.ts.map +0 -1
- package/dist/sdk/src/resources/index.js.map +0 -1
- package/dist/sdk/src/resources/keys.d.ts.map +0 -1
- package/dist/sdk/src/resources/keys.js.map +0 -1
- package/dist/sdk/src/resources/scrape.d.ts.map +0 -1
- package/dist/sdk/src/resources/scrape.js.map +0 -1
- package/dist/sdk/src/resources/status.d.ts.map +0 -1
- package/dist/sdk/src/resources/status.js.map +0 -1
- package/dist/sdk/src/resources/webhooks.d.ts.map +0 -1
- package/dist/sdk/src/resources/webhooks.js.map +0 -1
- package/dist/sdk/src/types/config.d.ts.map +0 -1
- package/dist/sdk/src/types/config.js.map +0 -1
- package/dist/sdk/src/types/index.d.ts.map +0 -1
- package/dist/sdk/src/types/index.js.map +0 -1
- package/dist/sdk/src/types/options.d.ts.map +0 -1
- package/dist/sdk/src/types/options.js.map +0 -1
- package/dist/sdk/src/types/responses.d.ts.map +0 -1
- package/dist/sdk/src/types/responses.js.map +0 -1
- package/dist/sdk/src/utils/polling.d.ts.map +0 -1
- package/dist/sdk/src/utils/polling.js.map +0 -1
- package/dist/sdk/src/utils/request.d.ts.map +0 -1
- package/dist/sdk/src/utils/request.js.map +0 -1
- package/dist/shared/src/constants/errors.d.ts +0 -26
- package/dist/shared/src/constants/errors.d.ts.map +0 -1
- package/dist/shared/src/constants/errors.js.map +0 -1
- package/dist/shared/src/constants/http.d.ts +0 -26
- package/dist/shared/src/constants/http.d.ts.map +0 -1
- package/dist/shared/src/constants/http.js +0 -26
- package/dist/shared/src/constants/http.js.map +0 -1
- package/dist/shared/src/constants/index.d.ts +0 -4
- package/dist/shared/src/constants/index.d.ts.map +0 -1
- package/dist/shared/src/constants/index.js +0 -5
- package/dist/shared/src/constants/index.js.map +0 -1
- package/dist/shared/src/constants/limits.d.ts +0 -52
- package/dist/shared/src/constants/limits.d.ts.map +0 -1
- package/dist/shared/src/constants/limits.js +0 -43
- package/dist/shared/src/constants/limits.js.map +0 -1
- package/dist/shared/src/index.d.ts +0 -5
- package/dist/shared/src/index.d.ts.map +0 -1
- package/dist/shared/src/index.js +0 -11
- package/dist/shared/src/index.js.map +0 -1
- package/dist/shared/src/lib/index.d.ts +0 -2
- package/dist/shared/src/lib/index.d.ts.map +0 -1
- package/dist/shared/src/lib/index.js +0 -2
- package/dist/shared/src/lib/index.js.map +0 -1
- package/dist/shared/src/lib/redis.d.ts +0 -14
- package/dist/shared/src/lib/redis.d.ts.map +0 -1
- package/dist/shared/src/lib/redis.js +0 -60
- package/dist/shared/src/lib/redis.js.map +0 -1
- package/dist/shared/src/types/api-key.types.d.ts +0 -94
- package/dist/shared/src/types/api-key.types.d.ts.map +0 -1
- package/dist/shared/src/types/api-key.types.js +0 -30
- package/dist/shared/src/types/api-key.types.js.map +0 -1
- package/dist/shared/src/types/api.types.d.ts +0 -38
- package/dist/shared/src/types/api.types.d.ts.map +0 -1
- package/dist/shared/src/types/api.types.js +0 -2
- package/dist/shared/src/types/api.types.js.map +0 -1
- package/dist/shared/src/types/client.types.d.ts +0 -73
- package/dist/shared/src/types/client.types.d.ts.map +0 -1
- package/dist/shared/src/types/client.types.js +0 -9
- package/dist/shared/src/types/client.types.js.map +0 -1
- package/dist/shared/src/types/crawl.types.d.ts +0 -65
- package/dist/shared/src/types/crawl.types.d.ts.map +0 -1
- package/dist/shared/src/types/crawl.types.js +0 -2
- package/dist/shared/src/types/crawl.types.js.map +0 -1
- package/dist/shared/src/types/deal.types.d.ts +0 -210
- package/dist/shared/src/types/deal.types.d.ts.map +0 -1
- package/dist/shared/src/types/deal.types.js +0 -6
- package/dist/shared/src/types/deal.types.js.map +0 -1
- package/dist/shared/src/types/dork.types.d.ts +0 -29
- package/dist/shared/src/types/dork.types.d.ts.map +0 -1
- package/dist/shared/src/types/dork.types.js +0 -2
- package/dist/shared/src/types/dork.types.js.map +0 -1
- package/dist/shared/src/types/index.d.ts +0 -8
- package/dist/shared/src/types/index.d.ts.map +0 -1
- package/dist/shared/src/types/index.js +0 -9
- package/dist/shared/src/types/index.js.map +0 -1
- package/dist/shared/src/types/scrape.types.d.ts +0 -151
- package/dist/shared/src/types/scrape.types.d.ts.map +0 -1
- package/dist/shared/src/types/scrape.types.js +0 -2
- package/dist/shared/src/types/scrape.types.js.map +0 -1
- package/dist/shared/src/utils/date.d.ts +0 -7
- package/dist/shared/src/utils/date.d.ts.map +0 -1
- package/dist/shared/src/utils/date.js +0 -25
- package/dist/shared/src/utils/date.js.map +0 -1
- package/dist/shared/src/utils/hash.d.ts +0 -4
- package/dist/shared/src/utils/hash.d.ts.map +0 -1
- package/dist/shared/src/utils/hash.js +0 -21
- package/dist/shared/src/utils/hash.js.map +0 -1
- package/dist/shared/src/utils/index.d.ts +0 -7
- package/dist/shared/src/utils/index.d.ts.map +0 -1
- package/dist/shared/src/utils/index.js +0 -8
- package/dist/shared/src/utils/index.js.map +0 -1
- package/dist/shared/src/utils/logger.d.ts +0 -66
- package/dist/shared/src/utils/logger.d.ts.map +0 -1
- package/dist/shared/src/utils/logger.js +0 -268
- package/dist/shared/src/utils/logger.js.map +0 -1
- package/dist/shared/src/utils/retry.d.ts +0 -11
- package/dist/shared/src/utils/retry.d.ts.map +0 -1
- package/dist/shared/src/utils/retry.js +0 -36
- package/dist/shared/src/utils/retry.js.map +0 -1
- package/dist/shared/src/utils/url-validator.d.ts +0 -37
- package/dist/shared/src/utils/url-validator.d.ts.map +0 -1
- package/dist/shared/src/utils/url-validator.js +0 -179
- package/dist/shared/src/utils/url-validator.js.map +0 -1
- package/dist/shared/src/utils/url.d.ts +0 -6
- package/dist/shared/src/utils/url.d.ts.map +0 -1
- package/dist/shared/src/utils/url.js +0 -56
- package/dist/shared/src/utils/url.js.map +0 -1
- /package/dist/{sdk/src/index.js → index.js} +0 -0
- /package/dist/{sdk/src/resources → resources}/account.d.ts +0 -0
- /package/dist/{sdk/src/resources → resources}/account.js +0 -0
- /package/dist/{sdk/src/resources → resources}/dork.d.ts +0 -0
- /package/dist/{sdk/src/resources → resources}/extract.d.ts +0 -0
- /package/dist/{sdk/src/resources → resources}/extract.js +0 -0
- /package/dist/{sdk/src/resources → resources}/index.d.ts +0 -0
- /package/dist/{sdk/src/resources → resources}/index.js +0 -0
- /package/dist/{sdk/src/resources → resources}/keys.d.ts +0 -0
- /package/dist/{sdk/src/resources → resources}/keys.js +0 -0
- /package/dist/{sdk/src/resources → resources}/scrape.d.ts +0 -0
- /package/dist/{sdk/src/resources → resources}/scrape.js +0 -0
- /package/dist/{sdk/src/resources → resources}/status.d.ts +0 -0
- /package/dist/{sdk/src/resources → resources}/status.js +0 -0
- /package/dist/{sdk/src/resources → resources}/webhooks.d.ts +0 -0
- /package/dist/{sdk/src/resources → resources}/webhooks.js +0 -0
- /package/dist/{sdk/src/types → types}/config.js +0 -0
- /package/dist/{sdk/src/types → types}/index.d.ts +0 -0
- /package/dist/{sdk/src/types → types}/index.js +0 -0
- /package/dist/{sdk/src/types → types}/options.js +0 -0
- /package/dist/{sdk/src/types → types}/responses.js +0 -0
- /package/dist/{sdk/src/utils → utils}/polling.d.ts +0 -0
- /package/dist/{sdk/src/utils → utils}/polling.js +0 -0
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Available scopes for API keys
|
|
3
|
-
*/
|
|
4
|
-
export type ApiKeyScope = "scrape" | "crawl" | "dork" | "extract" | "status" | "data:read" | "data:export" | "keys:manage" | "webhooks:manage";
|
|
5
|
-
/**
|
|
6
|
-
* All available scopes
|
|
7
|
-
*/
|
|
8
|
-
export declare const ALL_API_KEY_SCOPES: ApiKeyScope[];
|
|
9
|
-
/**
|
|
10
|
-
* Default scopes for new keys
|
|
11
|
-
*/
|
|
12
|
-
export declare const DEFAULT_API_KEY_SCOPES: ApiKeyScope[];
|
|
13
|
-
/**
|
|
14
|
-
* API Key information (without the actual key)
|
|
15
|
-
*/
|
|
16
|
-
export interface ApiKeyInfo {
|
|
17
|
-
id: string;
|
|
18
|
-
name: string;
|
|
19
|
-
keyPrefix: string;
|
|
20
|
-
scopes: ApiKeyScope[];
|
|
21
|
-
isActive: boolean;
|
|
22
|
-
expiresAt: string | null;
|
|
23
|
-
lastUsedAt: string | null;
|
|
24
|
-
usageCount: number;
|
|
25
|
-
createdAt: string;
|
|
26
|
-
revokedAt: string | null;
|
|
27
|
-
revokedReason: string | null;
|
|
28
|
-
ipAllowlist: string[] | null;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Newly created API key (includes raw key - only shown once!)
|
|
32
|
-
*/
|
|
33
|
-
export interface CreatedApiKey {
|
|
34
|
-
id: string;
|
|
35
|
-
rawKey: string;
|
|
36
|
-
keyPrefix: string;
|
|
37
|
-
name: string;
|
|
38
|
-
scopes: ApiKeyScope[];
|
|
39
|
-
expiresAt: string | null;
|
|
40
|
-
createdAt: string;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Request to create a new API key
|
|
44
|
-
*/
|
|
45
|
-
export interface CreateApiKeyRequest {
|
|
46
|
-
name: string;
|
|
47
|
-
scopes?: ApiKeyScope[];
|
|
48
|
-
expiresInDays?: number;
|
|
49
|
-
ipAllowlist?: string[];
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Request to rotate an API key
|
|
53
|
-
*/
|
|
54
|
-
export interface RotateApiKeyRequest {
|
|
55
|
-
newName?: string;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* API key validation result from database
|
|
59
|
-
*/
|
|
60
|
-
export interface ApiKeyValidation {
|
|
61
|
-
clientId: string;
|
|
62
|
-
clientName: string;
|
|
63
|
-
clientTier: string;
|
|
64
|
-
keyId: string;
|
|
65
|
-
keyName: string;
|
|
66
|
-
scopes: ApiKeyScope[];
|
|
67
|
-
quotas: Record<string, number>;
|
|
68
|
-
usage: Record<string, number>;
|
|
69
|
-
isValid: boolean;
|
|
70
|
-
errorMessage: string | null;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* API key usage statistics
|
|
74
|
-
*/
|
|
75
|
-
export interface ApiKeyStats {
|
|
76
|
-
totalRequests: number;
|
|
77
|
-
successfulRequests: number;
|
|
78
|
-
failedRequests: number;
|
|
79
|
-
avgDurationMs: number;
|
|
80
|
-
endpointsUsed: Record<string, number>;
|
|
81
|
-
requestsByDay: Record<string, number>;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Context from validated API key (attached to request)
|
|
85
|
-
*/
|
|
86
|
-
export interface ApiKeyContext {
|
|
87
|
-
keyId: string;
|
|
88
|
-
keyName: string;
|
|
89
|
-
scopes: ApiKeyScope[];
|
|
90
|
-
clientId: string;
|
|
91
|
-
clientName: string;
|
|
92
|
-
clientTier: string;
|
|
93
|
-
}
|
|
94
|
-
//# sourceMappingURL=api-key.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api-key.types.d.ts","sourceRoot":"","sources":["../../../../../shared/src/types/api-key.types.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,OAAO,GACP,MAAM,GACN,SAAS,GACT,QAAQ,GACR,WAAW,GACX,aAAa,GACb,aAAa,GACb,iBAAiB,CAAC;AAEtB;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAAW,EAU3C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,WAAW,EAO/C,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,WAAW,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,MA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,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// ============================================
|
|
2
|
-
// API KEY TYPES
|
|
3
|
-
// Multi-key management with scopes and expiration
|
|
4
|
-
// ============================================
|
|
5
|
-
/**
|
|
6
|
-
* All available scopes
|
|
7
|
-
*/
|
|
8
|
-
export const ALL_API_KEY_SCOPES = [
|
|
9
|
-
"scrape",
|
|
10
|
-
"crawl",
|
|
11
|
-
"dork",
|
|
12
|
-
"extract",
|
|
13
|
-
"status",
|
|
14
|
-
"data:read",
|
|
15
|
-
"data:export",
|
|
16
|
-
"keys:manage",
|
|
17
|
-
"webhooks:manage",
|
|
18
|
-
];
|
|
19
|
-
/**
|
|
20
|
-
* Default scopes for new keys
|
|
21
|
-
*/
|
|
22
|
-
export const DEFAULT_API_KEY_SCOPES = [
|
|
23
|
-
"scrape",
|
|
24
|
-
"crawl",
|
|
25
|
-
"dork",
|
|
26
|
-
"extract",
|
|
27
|
-
"status",
|
|
28
|
-
"data:read",
|
|
29
|
-
];
|
|
30
|
-
//# sourceMappingURL=api-key.types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api-key.types.js","sourceRoot":"","sources":["../../../../../shared/src/types/api-key.types.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,gBAAgB;AAChB,kDAAkD;AAClD,+CAA+C;AAgB/C;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAkB;IAC/C,QAAQ;IACR,OAAO;IACP,MAAM;IACN,SAAS;IACT,QAAQ;IACR,WAAW;IACX,aAAa;IACb,aAAa;IACb,iBAAiB;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAkB;IACnD,QAAQ;IACR,OAAO;IACP,MAAM;IACN,SAAS;IACT,QAAQ;IACR,WAAW;CACZ,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export interface ApiResponse<T = unknown> {
|
|
2
|
-
success: boolean;
|
|
3
|
-
data?: T;
|
|
4
|
-
error?: ApiError;
|
|
5
|
-
meta?: ResponseMeta;
|
|
6
|
-
}
|
|
7
|
-
export interface ApiError {
|
|
8
|
-
code: string;
|
|
9
|
-
message: string;
|
|
10
|
-
details?: Record<string, unknown>;
|
|
11
|
-
}
|
|
12
|
-
export interface ResponseMeta {
|
|
13
|
-
requestId: string;
|
|
14
|
-
timestamp: string;
|
|
15
|
-
duration?: number;
|
|
16
|
-
}
|
|
17
|
-
export interface JobResponse {
|
|
18
|
-
jobId: string;
|
|
19
|
-
status: JobStatus;
|
|
20
|
-
statusUrl: string;
|
|
21
|
-
estimatedTime?: string;
|
|
22
|
-
}
|
|
23
|
-
export type JobStatus = "pending" | "active" | "completed" | "failed" | "delayed" | "paused";
|
|
24
|
-
export interface PaginatedResponse<T> {
|
|
25
|
-
data: T[];
|
|
26
|
-
pagination: {
|
|
27
|
-
page: number;
|
|
28
|
-
limit: number;
|
|
29
|
-
total: number;
|
|
30
|
-
hasMore: boolean;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
export interface RateLimitInfo {
|
|
34
|
-
limit: number;
|
|
35
|
-
remaining: number;
|
|
36
|
-
reset: number;
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=api.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.types.d.ts","sourceRoot":"","sources":["../../../../../shared/src/types/api.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,OAAO;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,IAAI,CAAC,EAAE,YAAY,CAAC;CACrB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,QAAQ,GACR,WAAW,GACX,QAAQ,GACR,SAAS,GACT,QAAQ,CAAC;AAEb,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,UAAU,EAAE;QACV,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;CACH;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.types.js","sourceRoot":"","sources":["../../../../../shared/src/types/api.types.ts"],"names":[],"mappings":""}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
export type ClientTier = "free" | "pro" | "enterprise";
|
|
2
|
-
export interface ClientQuotas {
|
|
3
|
-
crawls: number;
|
|
4
|
-
scrapes: number;
|
|
5
|
-
dorks: number;
|
|
6
|
-
}
|
|
7
|
-
export interface ClientUsage {
|
|
8
|
-
crawls: number;
|
|
9
|
-
scrapes: number;
|
|
10
|
-
dorks: number;
|
|
11
|
-
lastResetAt?: string;
|
|
12
|
-
}
|
|
13
|
-
export interface ClientRateLimitOverride {
|
|
14
|
-
requests?: number;
|
|
15
|
-
windowMs?: number;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* API Client (account) - can have multiple API keys
|
|
19
|
-
* Updated for multi-key system
|
|
20
|
-
*/
|
|
21
|
-
export interface ApiClient {
|
|
22
|
-
id: string;
|
|
23
|
-
name: string;
|
|
24
|
-
email: string | null;
|
|
25
|
-
tier: ClientTier;
|
|
26
|
-
isActive: boolean;
|
|
27
|
-
organizationId?: string | null;
|
|
28
|
-
quotas: ClientQuotas;
|
|
29
|
-
usage: ClientUsage;
|
|
30
|
-
rateLimitOverride?: ClientRateLimitOverride | null;
|
|
31
|
-
dealPreferences?: Record<string, unknown> | null;
|
|
32
|
-
metadata?: Record<string, unknown>;
|
|
33
|
-
description?: string | null;
|
|
34
|
-
createdAt: string;
|
|
35
|
-
updatedAt: string;
|
|
36
|
-
/** @deprecated Use api_keys table for multi-key support */
|
|
37
|
-
apiKey?: string;
|
|
38
|
-
}
|
|
39
|
-
export interface ClientContext {
|
|
40
|
-
client: ApiClient;
|
|
41
|
-
requestId: string;
|
|
42
|
-
ipAddress?: string;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Request to create a new API client
|
|
46
|
-
*/
|
|
47
|
-
export interface CreateApiClientRequest {
|
|
48
|
-
name: string;
|
|
49
|
-
email?: string;
|
|
50
|
-
tier?: ClientTier;
|
|
51
|
-
organizationId?: string;
|
|
52
|
-
description?: string;
|
|
53
|
-
quotas?: Partial<ClientQuotas>;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Request to update an API client
|
|
57
|
-
*/
|
|
58
|
-
export interface UpdateApiClientRequest {
|
|
59
|
-
name?: string;
|
|
60
|
-
email?: string;
|
|
61
|
-
tier?: ClientTier;
|
|
62
|
-
isActive?: boolean;
|
|
63
|
-
description?: string;
|
|
64
|
-
quotas?: Partial<ClientQuotas>;
|
|
65
|
-
rateLimitOverride?: ClientRateLimitOverride | null;
|
|
66
|
-
dealPreferences?: Record<string, unknown>;
|
|
67
|
-
metadata?: Record<string, unknown>;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Key limits by tier
|
|
71
|
-
*/
|
|
72
|
-
export declare const API_KEY_LIMITS_BY_TIER: Record<ClientTier, number>;
|
|
73
|
-
//# sourceMappingURL=client.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.types.d.ts","sourceRoot":"","sources":["../../../../../shared/src/types/client.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,KAAK,GAAG,YAAY,CAAC;AAEvD,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,MAAM,EAAE,YAAY,CAAC;IACrB,KAAK,EAAE,WAAW,CAAC;IACnB,iBAAiB,CAAC,EAAE,uBAAu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,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAI7D,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.types.js","sourceRoot":"","sources":["../../../../../shared/src/types/client.types.ts"],"names":[],"mappings":"AA8EA;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAA+B;IAChE,IAAI,EAAE,CAAC;IACP,GAAG,EAAE,EAAE;IACP,UAAU,EAAE,EAAE;CACf,CAAC"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { ParsedPage } from "./scrape.types";
|
|
2
|
-
import type { ScoredUrl, UrlScoreFactors } from "./deal.types";
|
|
3
|
-
export type { ScoredUrl, UrlScoreFactors };
|
|
4
|
-
export interface CrawlOptions {
|
|
5
|
-
startUrl: string;
|
|
6
|
-
prompt?: string;
|
|
7
|
-
maxDepth?: number;
|
|
8
|
-
maxPages?: number;
|
|
9
|
-
delayMs?: number;
|
|
10
|
-
detectSignals?: boolean;
|
|
11
|
-
extractWithAI?: boolean;
|
|
12
|
-
followExternalLinks?: boolean;
|
|
13
|
-
allowedDomains?: string[];
|
|
14
|
-
excludePatterns?: string[];
|
|
15
|
-
/** Use SmartFrontier for deal-prioritized crawling (default: true) */
|
|
16
|
-
prioritizeDealPages?: boolean;
|
|
17
|
-
/** Minimum deal score to keep a page result (0-100) */
|
|
18
|
-
minDealScore?: number;
|
|
19
|
-
}
|
|
20
|
-
export interface CrawlResult {
|
|
21
|
-
startUrl: string;
|
|
22
|
-
pagesFound: number;
|
|
23
|
-
pages: ParsedPage[];
|
|
24
|
-
crawledAt: string;
|
|
25
|
-
duration?: number;
|
|
26
|
-
errors?: CrawlError[];
|
|
27
|
-
/** Statistics about the crawl when using SmartFrontier */
|
|
28
|
-
stats?: CrawlStats;
|
|
29
|
-
}
|
|
30
|
-
export interface CrawlStats {
|
|
31
|
-
/** Total URLs discovered during crawl */
|
|
32
|
-
totalUrlsDiscovered?: number;
|
|
33
|
-
/** URLs skipped (duplicates, filtered, etc.) */
|
|
34
|
-
urlsSkipped?: number;
|
|
35
|
-
/** Average deal score across all pages */
|
|
36
|
-
avgDealScore?: number;
|
|
37
|
-
/** Pages with deal score > 70 */
|
|
38
|
-
highValuePages?: number;
|
|
39
|
-
/** Total pages scraped */
|
|
40
|
-
pagesScraped?: number;
|
|
41
|
-
/** Total pages found including unprocessed/unvisited pages */
|
|
42
|
-
totalPagesFound?: number;
|
|
43
|
-
/** Total links discovered */
|
|
44
|
-
linksFound?: number;
|
|
45
|
-
/** Current crawl depth */
|
|
46
|
-
depth?: number;
|
|
47
|
-
/** Number of errors encountered */
|
|
48
|
-
errors?: number;
|
|
49
|
-
}
|
|
50
|
-
export interface CrawlError {
|
|
51
|
-
url: string;
|
|
52
|
-
error: string;
|
|
53
|
-
timestamp: string;
|
|
54
|
-
}
|
|
55
|
-
export interface CrawlProgress {
|
|
56
|
-
jobId: string;
|
|
57
|
-
status: "pending" | "running" | "completed" | "failed";
|
|
58
|
-
progress: number;
|
|
59
|
-
pagesScraped: number;
|
|
60
|
-
pagesTotal: number;
|
|
61
|
-
currentUrl?: string;
|
|
62
|
-
startedAt?: string;
|
|
63
|
-
estimatedCompletion?: string;
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=crawl.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"crawl.types.d.ts","sourceRoot":"","sources":["../../../../../shared/src/types/crawl.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAU,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/D,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;AAE3C,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ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C;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IACvD,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"crawl.types.js","sourceRoot":"","sources":["../../../../../shared/src/types/crawl.types.ts"],"names":[],"mappings":""}
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Deal-specific types for DealUp integration
|
|
3
|
-
* Part of the Ultimate Crawl feature set
|
|
4
|
-
*/
|
|
5
|
-
import type { Signal } from "./scrape.types";
|
|
6
|
-
export interface DealSignal extends Signal {
|
|
7
|
-
type: "price" | "original_price" | "discount" | "discount_amount" | "sale_indicator" | "deal_score" | "urgency_level" | "is_legit_deal";
|
|
8
|
-
}
|
|
9
|
-
export interface PriceSignal extends DealSignal {
|
|
10
|
-
type: "price" | "original_price";
|
|
11
|
-
metadata: {
|
|
12
|
-
currency: string;
|
|
13
|
-
raw: string;
|
|
14
|
-
source: "json-ld" | "og-meta" | "microdata" | "regex" | "css-selector";
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
export interface DiscountSignal extends DealSignal {
|
|
18
|
-
type: "discount" | "discount_amount";
|
|
19
|
-
metadata: {
|
|
20
|
-
percent?: number;
|
|
21
|
-
amount?: number;
|
|
22
|
-
currency?: string;
|
|
23
|
-
raw?: string;
|
|
24
|
-
calculated?: boolean;
|
|
25
|
-
source: string;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
export interface DealScoreSignal extends DealSignal {
|
|
29
|
-
type: "deal_score";
|
|
30
|
-
metadata: {
|
|
31
|
-
breakdown: DealScoreBreakdown;
|
|
32
|
-
reasoning: string[];
|
|
33
|
-
quality: "excellent" | "good" | "average" | "poor" | "very_poor";
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
export interface DealScoreBreakdown {
|
|
37
|
-
discount: number;
|
|
38
|
-
urgency: number;
|
|
39
|
-
legitimacy: number;
|
|
40
|
-
priceClarity: number;
|
|
41
|
-
productInfo: number;
|
|
42
|
-
}
|
|
43
|
-
export interface ExtractedDeal {
|
|
44
|
-
/** Unique identifier for deduplication */
|
|
45
|
-
id: string;
|
|
46
|
-
/** Source URL where the deal was found */
|
|
47
|
-
sourceUrl: string;
|
|
48
|
-
/** Product Information */
|
|
49
|
-
product: {
|
|
50
|
-
name: string;
|
|
51
|
-
brand?: string;
|
|
52
|
-
category?: string;
|
|
53
|
-
description?: string;
|
|
54
|
-
imageUrl?: string;
|
|
55
|
-
sku?: string;
|
|
56
|
-
};
|
|
57
|
-
/** Pricing Information */
|
|
58
|
-
pricing: {
|
|
59
|
-
currentPrice: number;
|
|
60
|
-
originalPrice?: number;
|
|
61
|
-
discountPercent?: number;
|
|
62
|
-
savedAmount?: number;
|
|
63
|
-
currency: string;
|
|
64
|
-
priceConfidence: number;
|
|
65
|
-
};
|
|
66
|
-
/** Deal Quality Assessment */
|
|
67
|
-
quality: {
|
|
68
|
-
dealScore: number;
|
|
69
|
-
urgencyLevel: UrgencyLevel;
|
|
70
|
-
isLegitDeal: boolean;
|
|
71
|
-
legitimacyScore: number;
|
|
72
|
-
};
|
|
73
|
-
/** Metadata */
|
|
74
|
-
merchant: string;
|
|
75
|
-
affiliateEligible?: boolean;
|
|
76
|
-
expiresAt?: string;
|
|
77
|
-
crawledAt: string;
|
|
78
|
-
/** Raw signals for debugging */
|
|
79
|
-
rawSignals?: Signal[];
|
|
80
|
-
}
|
|
81
|
-
export type UrgencyLevel = "none" | "low" | "medium" | "high" | "critical";
|
|
82
|
-
export interface CrawledDeal {
|
|
83
|
-
id: string;
|
|
84
|
-
job_id: string;
|
|
85
|
-
source_url: string;
|
|
86
|
-
product_name: string;
|
|
87
|
-
product_brand?: string;
|
|
88
|
-
product_category?: string;
|
|
89
|
-
product_description?: string;
|
|
90
|
-
product_image_url?: string;
|
|
91
|
-
current_price: number;
|
|
92
|
-
original_price?: number;
|
|
93
|
-
discount_percent?: number;
|
|
94
|
-
currency: string;
|
|
95
|
-
deal_score: number;
|
|
96
|
-
urgency_level: UrgencyLevel;
|
|
97
|
-
is_legit_deal: boolean;
|
|
98
|
-
synced_to_dealup: boolean;
|
|
99
|
-
dealup_deal_id?: string;
|
|
100
|
-
merchant: string;
|
|
101
|
-
affiliate_eligible?: boolean;
|
|
102
|
-
raw_signals?: Signal[];
|
|
103
|
-
ai_extraction?: Record<string, unknown>;
|
|
104
|
-
created_at: string;
|
|
105
|
-
updated_at: string;
|
|
106
|
-
}
|
|
107
|
-
export interface DealCrawlOptions {
|
|
108
|
-
/** Starting URL for the crawl */
|
|
109
|
-
startUrl: string;
|
|
110
|
-
/** Optional prompt for AI extraction guidance */
|
|
111
|
-
prompt?: string;
|
|
112
|
-
/** Maximum crawl depth (default: 3) */
|
|
113
|
-
maxDepth?: number;
|
|
114
|
-
/** Maximum pages to crawl (default: 100) */
|
|
115
|
-
maxPages?: number;
|
|
116
|
-
/** Delay between requests in ms (default: 1000) */
|
|
117
|
-
delayMs?: number;
|
|
118
|
-
/** Minimum deal score to include (default: 30) */
|
|
119
|
-
minDealScore?: number;
|
|
120
|
-
/** Categories to focus on */
|
|
121
|
-
targetCategories?: string[];
|
|
122
|
-
/** Price range filter */
|
|
123
|
-
priceRange?: {
|
|
124
|
-
min?: number;
|
|
125
|
-
max?: number;
|
|
126
|
-
currency?: string;
|
|
127
|
-
};
|
|
128
|
-
/** Minimum discount percentage to include */
|
|
129
|
-
minDiscountPercent?: number;
|
|
130
|
-
/** Sync found deals directly to DealUp */
|
|
131
|
-
syncToDealup?: boolean;
|
|
132
|
-
/** Webhook URL to notify when deals are found */
|
|
133
|
-
webhookUrl?: string;
|
|
134
|
-
}
|
|
135
|
-
export interface DealCrawlResult {
|
|
136
|
-
startUrl: string;
|
|
137
|
-
pagesScraped: number;
|
|
138
|
-
dealsFound: number;
|
|
139
|
-
deals: ExtractedDeal[];
|
|
140
|
-
crawledAt: string;
|
|
141
|
-
duration: number;
|
|
142
|
-
/** Statistics */
|
|
143
|
-
stats: {
|
|
144
|
-
avgDealScore: number;
|
|
145
|
-
topCategories: {
|
|
146
|
-
category: string;
|
|
147
|
-
count: number;
|
|
148
|
-
}[];
|
|
149
|
-
priceRange: {
|
|
150
|
-
min: number;
|
|
151
|
-
max: number;
|
|
152
|
-
};
|
|
153
|
-
discountRange: {
|
|
154
|
-
min: number;
|
|
155
|
-
max: number;
|
|
156
|
-
};
|
|
157
|
-
};
|
|
158
|
-
/** Errors encountered */
|
|
159
|
-
errors?: {
|
|
160
|
-
url: string;
|
|
161
|
-
error: string;
|
|
162
|
-
}[];
|
|
163
|
-
}
|
|
164
|
-
export interface SiteConfig {
|
|
165
|
-
/** Which scraping engine to use */
|
|
166
|
-
engine: "static" | "dynamic" | "stealth";
|
|
167
|
-
/** CSS selectors for data extraction */
|
|
168
|
-
selectors?: {
|
|
169
|
-
price?: string;
|
|
170
|
-
originalPrice?: string;
|
|
171
|
-
title?: string;
|
|
172
|
-
description?: string;
|
|
173
|
-
image?: string;
|
|
174
|
-
discount?: string;
|
|
175
|
-
rating?: string;
|
|
176
|
-
reviewCount?: string;
|
|
177
|
-
};
|
|
178
|
-
/** For dynamic scraper: element to wait for */
|
|
179
|
-
waitFor?: string;
|
|
180
|
-
/** Rate limiting configuration */
|
|
181
|
-
rateLimit?: {
|
|
182
|
-
requests: number;
|
|
183
|
-
perSeconds: number;
|
|
184
|
-
};
|
|
185
|
-
/** Custom headers to send */
|
|
186
|
-
headers?: Record<string, string>;
|
|
187
|
-
/** Patterns to prioritize when crawling this site */
|
|
188
|
-
priorityPatterns?: string[];
|
|
189
|
-
/** Patterns to exclude */
|
|
190
|
-
excludePatterns?: string[];
|
|
191
|
-
}
|
|
192
|
-
export interface ScoredUrl {
|
|
193
|
-
url: string;
|
|
194
|
-
depth: number;
|
|
195
|
-
score: number;
|
|
196
|
-
reason?: string;
|
|
197
|
-
}
|
|
198
|
-
export interface UrlScoreFactors {
|
|
199
|
-
/** Base score for this URL pattern */
|
|
200
|
-
baseScore: number;
|
|
201
|
-
/** Boost for deal-related paths */
|
|
202
|
-
dealPathBoost: number;
|
|
203
|
-
/** Boost for product-related paths */
|
|
204
|
-
productPathBoost: number;
|
|
205
|
-
/** Penalty for non-content paths */
|
|
206
|
-
nonContentPenalty: number;
|
|
207
|
-
/** Depth penalty per level */
|
|
208
|
-
depthPenalty: number;
|
|
209
|
-
}
|
|
210
|
-
//# sourceMappingURL=deal.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deal.types.d.ts","sourceRoot":"","sources":["../../../../../shared/src/types/deal.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAc,MAAM,gBAAgB,CAAC;AAMzD,MAAM,WAAW,UAAW,SAAQ,MAAM;IACxC,IAAI,EACA,OAAO,GACP,gBAAgB,GAChB,UAAU,GACV,iBAAiB,GACjB,gBAAgB,GAChB,YAAY,GACZ,eAAe,GACf,eAAe,CAAC;CACrB;AAED,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,IAAI,EAAE,OAAO,GAAG,gBAAgB,CAAC;IACjC,QAAQ,EAAE;QACR,QAAQ,EAAE,MAAM,CAAC;QACjB,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,cAAc,CAAC;KACxE,CAAC;CACH;AAED,MAAM,WAAW,cAAe,SAAQ,UAAU;IAChD,IAAI,EAAE,UAAU,GAA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K,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAElB,mCAAmC;IACnC,aAAa,EAAE,MAAM,CAAC;IAEtB,sCAAsC;IACtC,gBAAgB,EAAE,MAAM,CAAC;IAEzB,oCAAoC;IACpC,iBAAiB,EAAE,MAAM,CAAC;IAE1B,8BAA8B;IAC9B,YAAY,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deal.types.js","sourceRoot":"","sources":["../../../../../shared/src/types/deal.types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export interface DorkOptions {
|
|
2
|
-
query: string;
|
|
3
|
-
site?: string;
|
|
4
|
-
fileType?: string;
|
|
5
|
-
inUrl?: string;
|
|
6
|
-
inTitle?: string;
|
|
7
|
-
maxResults?: number;
|
|
8
|
-
region?: string;
|
|
9
|
-
}
|
|
10
|
-
export interface DorkResult {
|
|
11
|
-
query: string;
|
|
12
|
-
site?: string;
|
|
13
|
-
results: DorkSearchResult[];
|
|
14
|
-
totalResults?: number;
|
|
15
|
-
searchedAt: string;
|
|
16
|
-
}
|
|
17
|
-
export interface DorkSearchResult {
|
|
18
|
-
url: string;
|
|
19
|
-
title: string;
|
|
20
|
-
snippet: string;
|
|
21
|
-
position: number;
|
|
22
|
-
metadata?: Record<string, unknown>;
|
|
23
|
-
}
|
|
24
|
-
export type DorkOperator = "site" | "filetype" | "inurl" | "intitle" | "intext" | "cache" | "related" | "info";
|
|
25
|
-
export interface DorkQuery {
|
|
26
|
-
operator: DorkOperator;
|
|
27
|
-
value: string;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=dork.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dork.types.d.ts","sourceRoot":"","sources":["../../../../../shared/src/types/dork.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,UAAU,GACV,OAAO,GACP,SAAS,GACT,QAAQ,GACR,OAAO,GACP,SAAS,GACT,MAAM,CAAC;AAEX,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,YAAY,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dork.types.js","sourceRoot":"","sources":["../../../../../shared/src/types/dork.types.ts"],"names":[],"mappings":""}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from "./scrape.types";
|
|
2
|
-
export * from "./crawl.types";
|
|
3
|
-
export * from "./dork.types";
|
|
4
|
-
export * from "./api.types";
|
|
5
|
-
export * from "./client.types";
|
|
6
|
-
export * from "./deal.types";
|
|
7
|
-
export * from "./api-key.types";
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../shared/src/types/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// Type exports
|
|
2
|
-
export * from "./scrape.types";
|
|
3
|
-
export * from "./crawl.types";
|
|
4
|
-
export * from "./dork.types";
|
|
5
|
-
export * from "./api.types";
|
|
6
|
-
export * from "./client.types";
|
|
7
|
-
export * from "./deal.types";
|
|
8
|
-
export * from "./api-key.types";
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../shared/src/types/index.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC"}
|