@dataparade/cli 0.0.3 → 0.0.4

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 (67) hide show
  1. package/README.md +24 -0
  2. package/dist/package.json +85 -0
  3. package/dist/src/ai-enrichment/agent-orchestrator.d.ts +2 -0
  4. package/dist/src/ai-enrichment/agent-orchestrator.js +8 -5
  5. package/dist/src/ai-enrichment/providers/hosted-worker-infer-provider.d.ts +10 -0
  6. package/dist/src/ai-enrichment/providers/hosted-worker-infer-provider.js +47 -0
  7. package/dist/src/cli.js +85 -1
  8. package/dist/src/config/env.js +2 -0
  9. package/dist/src/config/resolve.js +3 -0
  10. package/dist/src/config/scan-env.d.ts +1 -0
  11. package/dist/src/config/scan-env.js +5 -0
  12. package/dist/src/config/types.d.ts +1 -0
  13. package/dist/src/config/upload-env.d.ts +1 -0
  14. package/dist/src/config/upload-env.js +10 -0
  15. package/dist/src/config/validate-scan-ai.d.ts +1 -1
  16. package/dist/src/config/validate-scan-ai.js +5 -0
  17. package/dist/src/core/pipeline/ai-orchestrator-options.js +5 -0
  18. package/dist/src/core/schema/scan-config.schema.d.ts +2 -0
  19. package/dist/src/core/schema/scan-config.schema.js +2 -1
  20. package/dist/src/core/types/config.d.ts +3 -1
  21. package/dist/src/observability/scan-sentry.d.ts +1 -1
  22. package/dist/src/platform-api/dataparade-app-base-url.d.ts +7 -0
  23. package/dist/src/platform-api/dataparade-app-base-url.js +14 -0
  24. package/dist/src/platform-api/upload-client.d.ts +3 -0
  25. package/dist/src/platform-api/upload-client.js +38 -0
  26. package/dist/src/platform-api/upload.types.d.ts +10 -0
  27. package/dist/src/platform-api/upload.types.js +2 -0
  28. package/dist/src/upload/build-preview-url.d.ts +1 -0
  29. package/dist/src/upload/build-preview-url.js +10 -0
  30. package/dist/src/upload/run-upload.d.ts +2 -0
  31. package/dist/src/upload/run-upload.js +18 -0
  32. package/dist/src/upload/types.d.ts +11 -0
  33. package/dist/src/upload/types.js +2 -0
  34. package/dist/tests/unit/cli/scan-quota-flow.spec.js +2 -0
  35. package/dist/tests/unit/config/upload-env.spec.d.ts +1 -0
  36. package/dist/tests/unit/config/upload-env.spec.js +12 -0
  37. package/dist/tests/unit/config/validate-scan-ai.spec.js +8 -0
  38. package/dist/tests/unit/platform-api/dataparade-app-base-url.spec.d.ts +1 -0
  39. package/dist/tests/unit/platform-api/dataparade-app-base-url.spec.js +13 -0
  40. package/dist/tests/unit/platform-api/upload-client.spec.d.ts +1 -0
  41. package/dist/tests/unit/platform-api/upload-client.spec.js +40 -0
  42. package/dist/tests/unit/publish-manifest.spec.d.ts +1 -0
  43. package/dist/tests/unit/publish-manifest.spec.js +18 -0
  44. package/dist/tests/unit/upload/build-preview-url.spec.d.ts +1 -0
  45. package/dist/tests/unit/upload/build-preview-url.spec.js +19 -0
  46. package/package.json +4 -3
  47. package/patterns/README.md +322 -0
  48. package/patterns/actor.patterns.yaml +51 -0
  49. package/patterns/aws-terraform-catalog.snapshot.json +1760 -0
  50. package/patterns/aws-terraform-service-hints.generated.json +1446 -0
  51. package/patterns/azure-terraform-catalog.snapshot.json +1195 -0
  52. package/patterns/azure-terraform-service-hints.generated.json +864 -0
  53. package/patterns/classifier/actors.classifier.yaml +17 -0
  54. package/patterns/classifier/components.classifier.yaml +110 -0
  55. package/patterns/classifier/third-party.classifier.yaml +169 -0
  56. package/patterns/kubernetes-terraform-catalog.snapshot.json +94 -0
  57. package/patterns/kubernetes-terraform-service-hints.generated.json +258 -0
  58. package/patterns/non-pii-signals.rules.yaml +84 -0
  59. package/patterns/pii-signals.rules.yaml +115 -0
  60. package/patterns/property.patterns.yaml +431 -0
  61. package/patterns/provider-topology.rules.yaml +765 -0
  62. package/patterns/python.md +211 -0
  63. package/patterns/python.patterns.yaml +160 -0
  64. package/patterns/terraform.md +37 -0
  65. package/patterns/terraform.patterns.yaml +495 -0
  66. package/patterns/third-party.patterns.yaml +167 -0
  67. package/patterns/typescript.patterns.yaml +139 -0
@@ -0,0 +1,139 @@
1
+ # TypeScript/JS pattern config. All entries share: patternId, optional confidence (default 0.8).
2
+ # Regex lists: use "regexes" for db_clients, httpClients, and auth; routes use specific keys.
3
+
4
+ routes:
5
+ frameworks:
6
+ - id: express
7
+ patternId: express_route
8
+ imports:
9
+ - express
10
+ routeCallRegexes:
11
+ - "\\b(app|router)\\.(get|post|put|delete|patch|options|head)\\(\\s*[\"'`]([^\"'`]+)[\"'`]"
12
+ confidence: 0.9
13
+ - id: nest
14
+ patternId: express_route
15
+ imports:
16
+ - "@nestjs/common"
17
+ - "@nestjs/core"
18
+ controllerDecoratorRegexes:
19
+ - "@Controller\\(\\s*[\"'`]([^\"'`]*)[\"'`]? "
20
+ routeDecoratorRegexes:
21
+ - "@(Get|Post|Put|Delete|Patch|Options|Head)\\(\\s*[\"'`]([^\"'`]*)[\"'`]? "
22
+ confidence: 0.85
23
+
24
+ db_clients:
25
+ - id: pg
26
+ patternId: database_connection
27
+ databaseType: postgres
28
+ importModules:
29
+ - pg
30
+ regexes:
31
+ - "\\bnew\\s+Pool\\s*\\("
32
+ - "\\bnew\\s+Client\\s*\\("
33
+ confidence: 0.9
34
+ - id: mysql2
35
+ patternId: database_connection
36
+ databaseType: mysql
37
+ importModules:
38
+ - mysql2
39
+ regexes:
40
+ - "\\bcreateConnection\\s*\\("
41
+ confidence: 0.9
42
+ - id: prisma
43
+ patternId: database_connection
44
+ databaseType: unknown
45
+ importModules:
46
+ - "@prisma/client"
47
+ regexes:
48
+ - "\\bnew\\s+PrismaClient\\s*\\("
49
+ confidence: 0.9
50
+ - id: mongoose
51
+ patternId: database_connection
52
+ databaseType: mongo
53
+ importModules:
54
+ - mongoose
55
+ regexes:
56
+ - "\\bmongoose\\.connect\\s*\\("
57
+ confidence: 0.9
58
+ - id: redis
59
+ patternId: database_connection
60
+ databaseType: redis
61
+ importModules:
62
+ - redis
63
+ regexes:
64
+ - "\\bcreateClient\\s*\\("
65
+ confidence: 0.9
66
+ - id: supabase
67
+ patternId: database_connection
68
+ databaseType: postgres
69
+ importModules:
70
+ - "@supabase/supabase-js"
71
+ regexes:
72
+ - "\\bcreateClient\\s*\\("
73
+ confidence: 0.9
74
+
75
+ auth:
76
+ libraries:
77
+ - id: passport
78
+ patternId: auth_middleware
79
+ importFragments:
80
+ - passport
81
+ regexes:
82
+ - "passport\\.authenticate\\(\\s*[\"'`]([^\"'`]+)[\"'`]"
83
+ confidence: 0.9
84
+ - id: jsonwebtoken
85
+ patternId: auth_middleware
86
+ importFragments:
87
+ - jsonwebtoken
88
+ confidence: 0.8
89
+ - id: nest_auth
90
+ patternId: auth_middleware
91
+ importFragments:
92
+ - "@nestjs/passport"
93
+ confidence: 0.85
94
+
95
+ # Heuristics: all generic detection regexes (process.env, raw SQL, route handlers, config.key).
96
+ heuristics:
97
+ processEnv:
98
+ regex: "process\\.env\\.([A-Z0-9_]+)"
99
+ confidence: 0.95
100
+ sqlKeyword:
101
+ regex: "\\bSELECT\\b|\\bINSERT\\b|\\bUPDATE\\b|\\bDELETE\\b"
102
+ patternId: database_connection
103
+ confidence: 0.6
104
+ nextRouteHandler:
105
+ regex: "\\b(export\\s+(async\\s+)?function\\s+|export\\s+default\\s+async\\s+function\\s+|export\\s+const\\s+\\w+\\s*=\\s*async\\s*)\\w*\\s*\\("
106
+ confidence: 0.75
107
+ # Matches config.<identifier>; key names and confidence come from config_keys.keys.
108
+ configKeyAccess:
109
+ regex: "\\bconfig\\.([a-zA-Z0-9_]+)\\b"
110
+
111
+ env_variables:
112
+ importantKeys:
113
+ - DATABASE_URL
114
+ - DB_URL
115
+ - API_KEY
116
+
117
+ config_keys:
118
+ keys:
119
+ - name: database
120
+ patternId: config_file
121
+ confidence: 0.8
122
+ - name: db
123
+ patternId: config_file
124
+ confidence: 0.8
125
+ - name: apiKey
126
+ patternId: config_file
127
+ confidence: 0.8
128
+ - name: api_key
129
+ patternId: config_file
130
+ confidence: 0.8
131
+ - name: auth
132
+ patternId: config_file
133
+ confidence: 0.8
134
+ - name: redis
135
+ patternId: config_file
136
+ confidence: 0.8
137
+
138
+ # Property-detection regexes and rules live in shared patterns/property.patterns.yaml
139
+ # so all language analyzers (TS, Python, etc.) use the same config.