@miranda0808/maya-codex 0.1.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.
- package/README.md +30 -0
- package/bin/maya-codex.js +36 -0
- package/package.json +19 -0
- package/payload/.agents/skills/ab-test-setup/SKILL.md +266 -0
- package/payload/.agents/skills/ab-test-setup/evals/evals.json +105 -0
- package/payload/.agents/skills/ab-test-setup/references/sample-size-guide.md +263 -0
- package/payload/.agents/skills/ab-test-setup/references/test-templates.md +277 -0
- package/payload/.agents/skills/ad-creative/SKILL.md +362 -0
- package/payload/.agents/skills/ad-creative/evals/evals.json +90 -0
- package/payload/.agents/skills/ad-creative/references/generative-tools.md +637 -0
- package/payload/.agents/skills/ad-creative/references/platform-specs.md +213 -0
- package/payload/.agents/skills/ai-seo/SKILL.md +398 -0
- package/payload/.agents/skills/ai-seo/evals/evals.json +90 -0
- package/payload/.agents/skills/ai-seo/references/content-patterns.md +285 -0
- package/payload/.agents/skills/ai-seo/references/platform-ranking-factors.md +152 -0
- package/payload/.agents/skills/analytics-tracking/SKILL.md +309 -0
- package/payload/.agents/skills/analytics-tracking/evals/evals.json +90 -0
- package/payload/.agents/skills/analytics-tracking/references/event-library.md +260 -0
- package/payload/.agents/skills/analytics-tracking/references/ga4-implementation.md +300 -0
- package/payload/.agents/skills/analytics-tracking/references/gtm-implementation.md +390 -0
- package/payload/.agents/skills/churn-prevention/SKILL.md +424 -0
- package/payload/.agents/skills/churn-prevention/evals/evals.json +93 -0
- package/payload/.agents/skills/churn-prevention/references/cancel-flow-patterns.md +316 -0
- package/payload/.agents/skills/churn-prevention/references/dunning-playbook.md +408 -0
- package/payload/.agents/skills/cold-email/SKILL.md +158 -0
- package/payload/.agents/skills/cold-email/evals/evals.json +94 -0
- package/payload/.agents/skills/cold-email/references/benchmarks.md +83 -0
- package/payload/.agents/skills/cold-email/references/follow-up-sequences.md +81 -0
- package/payload/.agents/skills/cold-email/references/frameworks.md +90 -0
- package/payload/.agents/skills/cold-email/references/personalization.md +79 -0
- package/payload/.agents/skills/cold-email/references/subject-lines.md +53 -0
- package/payload/.agents/skills/competitor-alternatives/SKILL.md +256 -0
- package/payload/.agents/skills/competitor-alternatives/evals/evals.json +93 -0
- package/payload/.agents/skills/competitor-alternatives/references/content-architecture.md +271 -0
- package/payload/.agents/skills/competitor-alternatives/references/templates.md +223 -0
- package/payload/.agents/skills/content-strategy/SKILL.md +359 -0
- package/payload/.agents/skills/content-strategy/evals/evals.json +90 -0
- package/payload/.agents/skills/copy-editing/SKILL.md +447 -0
- package/payload/.agents/skills/copy-editing/evals/evals.json +89 -0
- package/payload/.agents/skills/copy-editing/references/plain-english-alternatives.md +394 -0
- package/payload/.agents/skills/copywriting/SKILL.md +252 -0
- package/payload/.agents/skills/copywriting/evals/evals.json +111 -0
- package/payload/.agents/skills/copywriting/references/copy-frameworks.md +344 -0
- package/payload/.agents/skills/copywriting/references/natural-transitions.md +272 -0
- package/payload/.agents/skills/email-sequence/SKILL.md +309 -0
- package/payload/.agents/skills/email-sequence/evals/evals.json +93 -0
- package/payload/.agents/skills/email-sequence/references/copy-guidelines.md +113 -0
- package/payload/.agents/skills/email-sequence/references/email-types.md +515 -0
- package/payload/.agents/skills/email-sequence/references/sequence-templates.md +168 -0
- package/payload/.agents/skills/form-cro/SKILL.md +429 -0
- package/payload/.agents/skills/form-cro/evals/evals.json +90 -0
- package/payload/.agents/skills/free-tool-strategy/SKILL.md +178 -0
- package/payload/.agents/skills/free-tool-strategy/evals/evals.json +90 -0
- package/payload/.agents/skills/free-tool-strategy/references/tool-types.md +217 -0
- package/payload/.agents/skills/launch-strategy/SKILL.md +353 -0
- package/payload/.agents/skills/launch-strategy/evals/evals.json +91 -0
- package/payload/.agents/skills/marketing-ideas/SKILL.md +167 -0
- package/payload/.agents/skills/marketing-ideas/evals/evals.json +90 -0
- package/payload/.agents/skills/marketing-ideas/references/ideas-by-category.md +366 -0
- package/payload/.agents/skills/marketing-psychology/SKILL.md +455 -0
- package/payload/.agents/skills/marketing-psychology/evals/evals.json +88 -0
- package/payload/.agents/skills/onboarding-cro/SKILL.md +220 -0
- package/payload/.agents/skills/onboarding-cro/evals/evals.json +92 -0
- package/payload/.agents/skills/onboarding-cro/references/experiments.md +258 -0
- package/payload/.agents/skills/page-cro/SKILL.md +182 -0
- package/payload/.agents/skills/page-cro/evals/evals.json +111 -0
- package/payload/.agents/skills/page-cro/references/experiments.md +248 -0
- package/payload/.agents/skills/paid-ads/SKILL.md +315 -0
- package/payload/.agents/skills/paid-ads/evals/evals.json +90 -0
- package/payload/.agents/skills/paid-ads/references/ad-copy-templates.md +207 -0
- package/payload/.agents/skills/paid-ads/references/audience-targeting.md +243 -0
- package/payload/.agents/skills/paid-ads/references/platform-setup-checklists.md +277 -0
- package/payload/.agents/skills/paywall-upgrade-cro/SKILL.md +227 -0
- package/payload/.agents/skills/paywall-upgrade-cro/evals/evals.json +93 -0
- package/payload/.agents/skills/paywall-upgrade-cro/references/experiments.md +164 -0
- package/payload/.agents/skills/popup-cro/SKILL.md +453 -0
- package/payload/.agents/skills/popup-cro/evals/evals.json +94 -0
- package/payload/.agents/skills/pricing-strategy/SKILL.md +231 -0
- package/payload/.agents/skills/pricing-strategy/evals/evals.json +90 -0
- package/payload/.agents/skills/pricing-strategy/references/research-methods.md +152 -0
- package/payload/.agents/skills/pricing-strategy/references/tier-structure.md +232 -0
- package/payload/.agents/skills/product-marketing-context/SKILL.md +27 -0
- package/payload/.agents/skills/product-marketing-context/evals/evals.json +40 -0
- package/payload/.agents/skills/programmatic-seo/SKILL.md +238 -0
- package/payload/.agents/skills/programmatic-seo/evals/evals.json +94 -0
- package/payload/.agents/skills/programmatic-seo/references/playbooks.md +308 -0
- package/payload/.agents/skills/referral-program/SKILL.md +255 -0
- package/payload/.agents/skills/referral-program/evals/evals.json +89 -0
- package/payload/.agents/skills/referral-program/references/affiliate-programs.md +164 -0
- package/payload/.agents/skills/referral-program/references/program-examples.md +143 -0
- package/payload/.agents/skills/revops/SKILL.md +343 -0
- package/payload/.agents/skills/revops/evals/evals.json +91 -0
- package/payload/.agents/skills/revops/references/automation-playbooks.md +290 -0
- package/payload/.agents/skills/revops/references/lifecycle-definitions.md +278 -0
- package/payload/.agents/skills/revops/references/routing-rules.md +203 -0
- package/payload/.agents/skills/revops/references/scoring-models.md +247 -0
- package/payload/.agents/skills/sales-enablement/SKILL.md +349 -0
- package/payload/.agents/skills/sales-enablement/evals/evals.json +91 -0
- package/payload/.agents/skills/sales-enablement/references/deck-frameworks.md +263 -0
- package/payload/.agents/skills/sales-enablement/references/demo-scripts.md +355 -0
- package/payload/.agents/skills/sales-enablement/references/objection-library.md +270 -0
- package/payload/.agents/skills/sales-enablement/references/one-pager-templates.md +208 -0
- package/payload/.agents/skills/schema-markup/SKILL.md +179 -0
- package/payload/.agents/skills/schema-markup/evals/evals.json +87 -0
- package/payload/.agents/skills/schema-markup/references/schema-examples.md +398 -0
- package/payload/.agents/skills/seo-audit/SKILL.md +412 -0
- package/payload/.agents/skills/seo-audit/evals/evals.json +136 -0
- package/payload/.agents/skills/seo-audit/references/ai-writing-detection.md +200 -0
- package/payload/.agents/skills/signup-flow-cro/SKILL.md +359 -0
- package/payload/.agents/skills/signup-flow-cro/evals/evals.json +88 -0
- package/payload/.agents/skills/site-architecture/SKILL.md +357 -0
- package/payload/.agents/skills/site-architecture/evals/evals.json +88 -0
- package/payload/.agents/skills/site-architecture/references/mermaid-templates.md +216 -0
- package/payload/.agents/skills/site-architecture/references/navigation-patterns.md +305 -0
- package/payload/.agents/skills/site-architecture/references/site-type-templates.md +293 -0
- package/payload/.agents/skills/social-content/SKILL.md +278 -0
- package/payload/.agents/skills/social-content/evals/evals.json +92 -0
- package/payload/.agents/skills/social-content/references/platforms.md +170 -0
- package/payload/.agents/skills/social-content/references/post-templates.md +177 -0
- package/payload/.agents/skills/social-content/references/reverse-engineering.md +195 -0
- package/payload/.maya/executor.md +79 -0
- package/payload/.maya/meta-api-agent.md +48 -0
- package/payload/.maya/modes/consult.md +63 -0
- package/payload/.maya/modes/task.md +97 -0
- package/payload/.maya/planner.md +69 -0
- package/payload/.maya/researcher.md +51 -0
- package/payload/.maya/templates/plan.md +77 -0
- package/payload/.maya/templates/state.md +87 -0
- package/payload/.maya/templates/task-packet.md +75 -0
- package/payload/MAYA-CATALOG.md +115 -0
- package/payload/MAYA-DEPENDENCIES.md +58 -0
- package/payload/MAYA.md +151 -0
- package/payload/campaigns/README.md +14 -0
- package/payload/commands/maya-consult.md +28 -0
- package/payload/commands/maya-task.md +38 -0
- package/payload/commands/product.md +55 -0
- package/payload/research/README.md +14 -0
- package/payload/templates/README.md +15 -0
- package/payload/templates/plan.md +77 -0
- package/payload/templates/state.md +87 -0
- package/payload/templates/task-packet.md +75 -0
- package/payload/tools/REGISTRY.md +368 -0
- package/payload/tools/clis/README.md +187 -0
- package/payload/tools/clis/activecampaign.js +435 -0
- package/payload/tools/clis/adobe-analytics.js +161 -0
- package/payload/tools/clis/ahrefs.js +192 -0
- package/payload/tools/clis/amplitude.js +182 -0
- package/payload/tools/clis/apollo.js +142 -0
- package/payload/tools/clis/beehiiv.js +245 -0
- package/payload/tools/clis/brevo.js +368 -0
- package/payload/tools/clis/buffer.js +260 -0
- package/payload/tools/clis/calendly.js +253 -0
- package/payload/tools/clis/clearbit.js +163 -0
- package/payload/tools/clis/customer-io.js +205 -0
- package/payload/tools/clis/dataforseo.js +257 -0
- package/payload/tools/clis/demio.js +149 -0
- package/payload/tools/clis/dub.js +158 -0
- package/payload/tools/clis/g2.js +186 -0
- package/payload/tools/clis/ga4.js +194 -0
- package/payload/tools/clis/google-ads.js +189 -0
- package/payload/tools/clis/google-search-console.js +166 -0
- package/payload/tools/clis/hotjar.js +167 -0
- package/payload/tools/clis/hunter.js +249 -0
- package/payload/tools/clis/instantly.js +270 -0
- package/payload/tools/clis/intercom.js +399 -0
- package/payload/tools/clis/keywords-everywhere.js +185 -0
- package/payload/tools/clis/kit.js +232 -0
- package/payload/tools/clis/klaviyo.js +348 -0
- package/payload/tools/clis/lemlist.js +221 -0
- package/payload/tools/clis/linkedin-ads.js +185 -0
- package/payload/tools/clis/livestorm.js +292 -0
- package/payload/tools/clis/mailchimp.js +220 -0
- package/payload/tools/clis/mention-me.js +161 -0
- package/payload/tools/clis/meta-ads.js +181 -0
- package/payload/tools/clis/mixpanel.js +248 -0
- package/payload/tools/clis/onesignal.js +241 -0
- package/payload/tools/clis/optimizely.js +233 -0
- package/payload/tools/clis/paddle.js +385 -0
- package/payload/tools/clis/partnerstack.js +382 -0
- package/payload/tools/clis/plausible.js +249 -0
- package/payload/tools/clis/postmark.js +375 -0
- package/payload/tools/clis/resend.js +370 -0
- package/payload/tools/clis/rewardful.js +160 -0
- package/payload/tools/clis/savvycal.js +223 -0
- package/payload/tools/clis/segment.js +192 -0
- package/payload/tools/clis/semrush.js +207 -0
- package/payload/tools/clis/sendgrid.js +211 -0
- package/payload/tools/clis/snov.js +237 -0
- package/payload/tools/clis/tiktok-ads.js +190 -0
- package/payload/tools/clis/tolt.js +153 -0
- package/payload/tools/clis/trustpilot.js +276 -0
- package/payload/tools/clis/typeform.js +269 -0
- package/payload/tools/clis/wistia.js +256 -0
- package/payload/tools/clis/zapier.js +160 -0
- package/payload/tools/integrations/activecampaign.md +337 -0
- package/payload/tools/integrations/adobe-analytics.md +156 -0
- package/payload/tools/integrations/ahrefs.md +142 -0
- package/payload/tools/integrations/amplitude.md +135 -0
- package/payload/tools/integrations/apollo.md +148 -0
- package/payload/tools/integrations/beehiiv.md +157 -0
- package/payload/tools/integrations/brevo.md +268 -0
- package/payload/tools/integrations/buffer.md +138 -0
- package/payload/tools/integrations/calendly.md +161 -0
- package/payload/tools/integrations/clearbit.md +142 -0
- package/payload/tools/integrations/customer-io.md +187 -0
- package/payload/tools/integrations/dataforseo.md +165 -0
- package/payload/tools/integrations/demio.md +182 -0
- package/payload/tools/integrations/dub-co.md +160 -0
- package/payload/tools/integrations/g2.md +179 -0
- package/payload/tools/integrations/ga4.md +126 -0
- package/payload/tools/integrations/google-ads.md +159 -0
- package/payload/tools/integrations/google-search-console.md +147 -0
- package/payload/tools/integrations/hotjar.md +147 -0
- package/payload/tools/integrations/hubspot.md +178 -0
- package/payload/tools/integrations/hunter.md +90 -0
- package/payload/tools/integrations/instantly.md +104 -0
- package/payload/tools/integrations/intercom.md +292 -0
- package/payload/tools/integrations/keywords-everywhere.md +207 -0
- package/payload/tools/integrations/kit.md +167 -0
- package/payload/tools/integrations/klaviyo.md +228 -0
- package/payload/tools/integrations/lemlist.md +110 -0
- package/payload/tools/integrations/linkedin-ads.md +164 -0
- package/payload/tools/integrations/livestorm.md +313 -0
- package/payload/tools/integrations/mailchimp.md +150 -0
- package/payload/tools/integrations/mention-me.md +160 -0
- package/payload/tools/integrations/meta-ads.md +147 -0
- package/payload/tools/integrations/mixpanel.md +137 -0
- package/payload/tools/integrations/onesignal.md +229 -0
- package/payload/tools/integrations/optimizely.md +171 -0
- package/payload/tools/integrations/paddle.md +212 -0
- package/payload/tools/integrations/partnerstack.md +222 -0
- package/payload/tools/integrations/plausible.md +177 -0
- package/payload/tools/integrations/posthog.md +151 -0
- package/payload/tools/integrations/postmark.md +234 -0
- package/payload/tools/integrations/resend.md +168 -0
- package/payload/tools/integrations/rewardful.md +147 -0
- package/payload/tools/integrations/salesforce.md +150 -0
- package/payload/tools/integrations/savvycal.md +181 -0
- package/payload/tools/integrations/segment.md +159 -0
- package/payload/tools/integrations/semrush.md +121 -0
- package/payload/tools/integrations/sendgrid.md +161 -0
- package/payload/tools/integrations/shopify.md +176 -0
- package/payload/tools/integrations/snov.md +94 -0
- package/payload/tools/integrations/stripe.md +148 -0
- package/payload/tools/integrations/tiktok-ads.md +161 -0
- package/payload/tools/integrations/tolt.md +144 -0
- package/payload/tools/integrations/trustpilot.md +191 -0
- package/payload/tools/integrations/typeform.md +190 -0
- package/payload/tools/integrations/webflow.md +198 -0
- package/payload/tools/integrations/wistia.md +164 -0
- package/payload/tools/integrations/wordpress.md +175 -0
- package/payload/tools/integrations/zapier.md +150 -0
- package/payload/tools/meta/README.md +55 -0
- package/payload/tools/meta/meta-cache-schema.md +65 -0
- package/payload/tools/meta/meta-fetch.ps1 +324 -0
- package/payload/tools/meta/meta-fetch.test.ps1 +38 -0
- package/vendor/shared-installer/manifests/claude-files.json +13 -0
- package/vendor/shared-installer/manifests/codex-files.json +13 -0
- package/vendor/shared-installer/manifests/common-files.json +13 -0
- package/vendor/shared-installer/package.json +15 -0
- package/vendor/shared-installer/src/bootstrap.js +12 -0
- package/vendor/shared-installer/src/cli-options.js +53 -0
- package/vendor/shared-installer/src/fs.js +105 -0
- package/vendor/shared-installer/src/index.js +44 -0
- package/vendor/shared-installer/src/install.js +157 -0
- package/vendor/shared-installer/src/manifest.js +52 -0
- package/vendor/shared-installer/templates/claude/.claude/skills/.gitkeep +1 -0
- package/vendor/shared-installer/templates/claude/CLAUDE.md +27 -0
- package/vendor/shared-installer/templates/codex/.agent/skills/.gitkeep +1 -0
- package/vendor/shared-installer/templates/codex/AGENTS.md +27 -0
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const API_KEY = process.env.ACTIVECAMPAIGN_API_KEY
|
|
4
|
+
const API_URL = process.env.ACTIVECAMPAIGN_API_URL
|
|
5
|
+
|
|
6
|
+
if (!API_KEY) {
|
|
7
|
+
console.error(JSON.stringify({ error: 'ACTIVECAMPAIGN_API_KEY environment variable required' }))
|
|
8
|
+
process.exit(1)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (!API_URL) {
|
|
12
|
+
console.error(JSON.stringify({ error: 'ACTIVECAMPAIGN_API_URL environment variable required (e.g. https://yourname.api-us1.com)' }))
|
|
13
|
+
process.exit(1)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const BASE_URL = `${API_URL.replace(/\/$/, '')}/api/3`
|
|
17
|
+
|
|
18
|
+
async function api(method, path, body) {
|
|
19
|
+
if (args['dry-run']) {
|
|
20
|
+
return { _dry_run: true, method, url: `${BASE_URL}${path}`, headers: { 'Api-Token': '***', 'Content-Type': 'application/json', 'Accept': 'application/json' }, body: body || undefined }
|
|
21
|
+
}
|
|
22
|
+
const res = await fetch(`${BASE_URL}${path}`, {
|
|
23
|
+
method,
|
|
24
|
+
headers: {
|
|
25
|
+
'Api-Token': API_KEY,
|
|
26
|
+
'Content-Type': 'application/json',
|
|
27
|
+
'Accept': 'application/json',
|
|
28
|
+
},
|
|
29
|
+
body: body ? JSON.stringify(body) : undefined,
|
|
30
|
+
})
|
|
31
|
+
const text = await res.text()
|
|
32
|
+
try {
|
|
33
|
+
return JSON.parse(text)
|
|
34
|
+
} catch {
|
|
35
|
+
return { status: res.status, body: text }
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function parseArgs(args) {
|
|
40
|
+
const result = { _: [] }
|
|
41
|
+
for (let i = 0; i < args.length; i++) {
|
|
42
|
+
const arg = args[i]
|
|
43
|
+
if (arg.startsWith('--')) {
|
|
44
|
+
const key = arg.slice(2)
|
|
45
|
+
const next = args[i + 1]
|
|
46
|
+
if (next && !next.startsWith('--')) {
|
|
47
|
+
result[key] = next
|
|
48
|
+
i++
|
|
49
|
+
} else {
|
|
50
|
+
result[key] = true
|
|
51
|
+
}
|
|
52
|
+
} else {
|
|
53
|
+
result._.push(arg)
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return result
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const args = parseArgs(process.argv.slice(2))
|
|
60
|
+
const [cmd, sub, ...rest] = args._
|
|
61
|
+
|
|
62
|
+
async function main() {
|
|
63
|
+
let result
|
|
64
|
+
const limit = args.limit ? Number(args.limit) : 20
|
|
65
|
+
const offset = args.offset ? Number(args.offset) : 0
|
|
66
|
+
|
|
67
|
+
switch (cmd) {
|
|
68
|
+
case 'contacts':
|
|
69
|
+
switch (sub) {
|
|
70
|
+
case 'list': {
|
|
71
|
+
const params = new URLSearchParams()
|
|
72
|
+
params.set('limit', String(limit))
|
|
73
|
+
params.set('offset', String(offset))
|
|
74
|
+
if (args.email) params.set('email', args.email)
|
|
75
|
+
if (args.search) params.set('search', args.search)
|
|
76
|
+
if (args['list-id']) params.set('listid', args['list-id'])
|
|
77
|
+
if (args.status) params.set('status', args.status)
|
|
78
|
+
result = await api('GET', `/contacts?${params.toString()}`)
|
|
79
|
+
break
|
|
80
|
+
}
|
|
81
|
+
case 'get': {
|
|
82
|
+
const id = args.id
|
|
83
|
+
if (!id) { result = { error: '--id required' }; break }
|
|
84
|
+
result = await api('GET', `/contacts/${id}`)
|
|
85
|
+
break
|
|
86
|
+
}
|
|
87
|
+
case 'create': {
|
|
88
|
+
const email = args.email
|
|
89
|
+
if (!email) { result = { error: '--email required' }; break }
|
|
90
|
+
const contact = { email }
|
|
91
|
+
if (args['first-name']) contact.firstName = args['first-name']
|
|
92
|
+
if (args['last-name']) contact.lastName = args['last-name']
|
|
93
|
+
if (args.phone) contact.phone = args.phone
|
|
94
|
+
result = await api('POST', '/contacts', { contact })
|
|
95
|
+
break
|
|
96
|
+
}
|
|
97
|
+
case 'update': {
|
|
98
|
+
const id = args.id
|
|
99
|
+
if (!id) { result = { error: '--id required' }; break }
|
|
100
|
+
const contact = {}
|
|
101
|
+
if (args.email) contact.email = args.email
|
|
102
|
+
if (args['first-name']) contact.firstName = args['first-name']
|
|
103
|
+
if (args['last-name']) contact.lastName = args['last-name']
|
|
104
|
+
if (args.phone) contact.phone = args.phone
|
|
105
|
+
result = await api('PUT', `/contacts/${id}`, { contact })
|
|
106
|
+
break
|
|
107
|
+
}
|
|
108
|
+
case 'delete': {
|
|
109
|
+
const id = args.id
|
|
110
|
+
if (!id) { result = { error: '--id required' }; break }
|
|
111
|
+
result = await api('DELETE', `/contacts/${id}`)
|
|
112
|
+
break
|
|
113
|
+
}
|
|
114
|
+
case 'sync': {
|
|
115
|
+
const email = args.email
|
|
116
|
+
if (!email) { result = { error: '--email required' }; break }
|
|
117
|
+
const contact = { email }
|
|
118
|
+
if (args['first-name']) contact.firstName = args['first-name']
|
|
119
|
+
if (args['last-name']) contact.lastName = args['last-name']
|
|
120
|
+
if (args.phone) contact.phone = args.phone
|
|
121
|
+
result = await api('POST', '/contact/sync', { contact })
|
|
122
|
+
break
|
|
123
|
+
}
|
|
124
|
+
default:
|
|
125
|
+
result = { error: 'Unknown contacts subcommand. Use: list, get, create, update, delete, sync' }
|
|
126
|
+
}
|
|
127
|
+
break
|
|
128
|
+
|
|
129
|
+
case 'lists':
|
|
130
|
+
switch (sub) {
|
|
131
|
+
case 'list': {
|
|
132
|
+
const params = new URLSearchParams()
|
|
133
|
+
params.set('limit', String(limit))
|
|
134
|
+
params.set('offset', String(offset))
|
|
135
|
+
result = await api('GET', `/lists?${params.toString()}`)
|
|
136
|
+
break
|
|
137
|
+
}
|
|
138
|
+
case 'get': {
|
|
139
|
+
const id = args.id
|
|
140
|
+
if (!id) { result = { error: '--id required' }; break }
|
|
141
|
+
result = await api('GET', `/lists/${id}`)
|
|
142
|
+
break
|
|
143
|
+
}
|
|
144
|
+
case 'create': {
|
|
145
|
+
const name = args.name
|
|
146
|
+
if (!name) { result = { error: '--name required' }; break }
|
|
147
|
+
const list = { name }
|
|
148
|
+
if (args['string-id']) list.stringid = args['string-id']
|
|
149
|
+
if (args['sender-url']) list.sender_url = args['sender-url']
|
|
150
|
+
if (args['sender-reminder']) list.sender_reminder = args['sender-reminder']
|
|
151
|
+
result = await api('POST', '/lists', { list })
|
|
152
|
+
break
|
|
153
|
+
}
|
|
154
|
+
case 'delete': {
|
|
155
|
+
const id = args.id
|
|
156
|
+
if (!id) { result = { error: '--id required' }; break }
|
|
157
|
+
result = await api('DELETE', `/lists/${id}`)
|
|
158
|
+
break
|
|
159
|
+
}
|
|
160
|
+
case 'subscribe': {
|
|
161
|
+
const listId = args['list-id'] || args.id
|
|
162
|
+
const contactId = args['contact-id']
|
|
163
|
+
if (!listId) { result = { error: '--list-id required' }; break }
|
|
164
|
+
if (!contactId) { result = { error: '--contact-id required' }; break }
|
|
165
|
+
result = await api('POST', '/contactLists', {
|
|
166
|
+
contactList: { list: listId, contact: contactId, status: 1 }
|
|
167
|
+
})
|
|
168
|
+
break
|
|
169
|
+
}
|
|
170
|
+
case 'unsubscribe': {
|
|
171
|
+
const listId = args['list-id'] || args.id
|
|
172
|
+
const contactId = args['contact-id']
|
|
173
|
+
if (!listId) { result = { error: '--list-id required' }; break }
|
|
174
|
+
if (!contactId) { result = { error: '--contact-id required' }; break }
|
|
175
|
+
result = await api('POST', '/contactLists', {
|
|
176
|
+
contactList: { list: listId, contact: contactId, status: 2 }
|
|
177
|
+
})
|
|
178
|
+
break
|
|
179
|
+
}
|
|
180
|
+
default:
|
|
181
|
+
result = { error: 'Unknown lists subcommand. Use: list, get, create, delete, subscribe, unsubscribe' }
|
|
182
|
+
}
|
|
183
|
+
break
|
|
184
|
+
|
|
185
|
+
case 'campaigns':
|
|
186
|
+
switch (sub) {
|
|
187
|
+
case 'list': {
|
|
188
|
+
const params = new URLSearchParams()
|
|
189
|
+
params.set('limit', String(limit))
|
|
190
|
+
params.set('offset', String(offset))
|
|
191
|
+
result = await api('GET', `/campaigns?${params.toString()}`)
|
|
192
|
+
break
|
|
193
|
+
}
|
|
194
|
+
case 'get': {
|
|
195
|
+
const id = args.id
|
|
196
|
+
if (!id) { result = { error: '--id required' }; break }
|
|
197
|
+
result = await api('GET', `/campaigns/${id}`)
|
|
198
|
+
break
|
|
199
|
+
}
|
|
200
|
+
default:
|
|
201
|
+
result = { error: 'Unknown campaigns subcommand. Use: list, get' }
|
|
202
|
+
}
|
|
203
|
+
break
|
|
204
|
+
|
|
205
|
+
case 'deals':
|
|
206
|
+
switch (sub) {
|
|
207
|
+
case 'list': {
|
|
208
|
+
const params = new URLSearchParams()
|
|
209
|
+
params.set('limit', String(limit))
|
|
210
|
+
params.set('offset', String(offset))
|
|
211
|
+
if (args.search) params.set('search', args.search)
|
|
212
|
+
if (args.stage) params.set('filters[stage]', args.stage)
|
|
213
|
+
if (args.owner) params.set('filters[owner]', args.owner)
|
|
214
|
+
result = await api('GET', `/deals?${params.toString()}`)
|
|
215
|
+
break
|
|
216
|
+
}
|
|
217
|
+
case 'get': {
|
|
218
|
+
const id = args.id
|
|
219
|
+
if (!id) { result = { error: '--id required' }; break }
|
|
220
|
+
result = await api('GET', `/deals/${id}`)
|
|
221
|
+
break
|
|
222
|
+
}
|
|
223
|
+
case 'create': {
|
|
224
|
+
const title = args.title
|
|
225
|
+
if (!title) { result = { error: '--title required' }; break }
|
|
226
|
+
const deal = { title }
|
|
227
|
+
if (args.value) deal.value = Number(args.value)
|
|
228
|
+
if (args.currency) deal.currency = args.currency
|
|
229
|
+
if (args.pipeline) deal.group = args.pipeline
|
|
230
|
+
if (args.stage) deal.stage = args.stage
|
|
231
|
+
if (args.owner) deal.owner = args.owner
|
|
232
|
+
if (args['contact-id']) deal.contact = args['contact-id']
|
|
233
|
+
result = await api('POST', '/deals', { deal })
|
|
234
|
+
break
|
|
235
|
+
}
|
|
236
|
+
case 'update': {
|
|
237
|
+
const id = args.id
|
|
238
|
+
if (!id) { result = { error: '--id required' }; break }
|
|
239
|
+
const deal = {}
|
|
240
|
+
if (args.title) deal.title = args.title
|
|
241
|
+
if (args.value) deal.value = Number(args.value)
|
|
242
|
+
if (args.stage) deal.stage = args.stage
|
|
243
|
+
if (args.owner) deal.owner = args.owner
|
|
244
|
+
if (args.status) deal.status = Number(args.status)
|
|
245
|
+
result = await api('PUT', `/deals/${id}`, { deal })
|
|
246
|
+
break
|
|
247
|
+
}
|
|
248
|
+
case 'delete': {
|
|
249
|
+
const id = args.id
|
|
250
|
+
if (!id) { result = { error: '--id required' }; break }
|
|
251
|
+
result = await api('DELETE', `/deals/${id}`)
|
|
252
|
+
break
|
|
253
|
+
}
|
|
254
|
+
default:
|
|
255
|
+
result = { error: 'Unknown deals subcommand. Use: list, get, create, update, delete' }
|
|
256
|
+
}
|
|
257
|
+
break
|
|
258
|
+
|
|
259
|
+
case 'automations':
|
|
260
|
+
switch (sub) {
|
|
261
|
+
case 'list': {
|
|
262
|
+
const params = new URLSearchParams()
|
|
263
|
+
params.set('limit', String(limit))
|
|
264
|
+
params.set('offset', String(offset))
|
|
265
|
+
result = await api('GET', `/automations?${params.toString()}`)
|
|
266
|
+
break
|
|
267
|
+
}
|
|
268
|
+
case 'get': {
|
|
269
|
+
const id = args.id
|
|
270
|
+
if (!id) { result = { error: '--id required' }; break }
|
|
271
|
+
result = await api('GET', `/automations/${id}`)
|
|
272
|
+
break
|
|
273
|
+
}
|
|
274
|
+
case 'add-contact': {
|
|
275
|
+
const automationId = args.id
|
|
276
|
+
const contactId = args['contact-id']
|
|
277
|
+
if (!automationId) { result = { error: '--id required (automation ID)' }; break }
|
|
278
|
+
if (!contactId) { result = { error: '--contact-id required (contact ID, not email)' }; break }
|
|
279
|
+
result = await api('POST', '/contactAutomations', {
|
|
280
|
+
contactAutomation: { contact: contactId, automation: automationId }
|
|
281
|
+
})
|
|
282
|
+
break
|
|
283
|
+
}
|
|
284
|
+
default:
|
|
285
|
+
result = { error: 'Unknown automations subcommand. Use: list, get, add-contact' }
|
|
286
|
+
}
|
|
287
|
+
break
|
|
288
|
+
|
|
289
|
+
case 'tags':
|
|
290
|
+
switch (sub) {
|
|
291
|
+
case 'list': {
|
|
292
|
+
const params = new URLSearchParams()
|
|
293
|
+
params.set('limit', String(limit))
|
|
294
|
+
params.set('offset', String(offset))
|
|
295
|
+
if (args.search) params.set('search', args.search)
|
|
296
|
+
result = await api('GET', `/tags?${params.toString()}`)
|
|
297
|
+
break
|
|
298
|
+
}
|
|
299
|
+
case 'get': {
|
|
300
|
+
const id = args.id
|
|
301
|
+
if (!id) { result = { error: '--id required' }; break }
|
|
302
|
+
result = await api('GET', `/tags/${id}`)
|
|
303
|
+
break
|
|
304
|
+
}
|
|
305
|
+
case 'create': {
|
|
306
|
+
const name = args.name
|
|
307
|
+
if (!name) { result = { error: '--name required' }; break }
|
|
308
|
+
result = await api('POST', '/tags', {
|
|
309
|
+
tag: { tag: name, tagType: args.type || 'contact' }
|
|
310
|
+
})
|
|
311
|
+
break
|
|
312
|
+
}
|
|
313
|
+
case 'delete': {
|
|
314
|
+
const id = args.id
|
|
315
|
+
if (!id) { result = { error: '--id required' }; break }
|
|
316
|
+
result = await api('DELETE', `/tags/${id}`)
|
|
317
|
+
break
|
|
318
|
+
}
|
|
319
|
+
case 'add-to-contact': {
|
|
320
|
+
const tagId = args['tag-id']
|
|
321
|
+
const contactId = args['contact-id']
|
|
322
|
+
if (!tagId) { result = { error: '--tag-id required' }; break }
|
|
323
|
+
if (!contactId) { result = { error: '--contact-id required' }; break }
|
|
324
|
+
result = await api('POST', '/contactTags', {
|
|
325
|
+
contactTag: { contact: contactId, tag: tagId }
|
|
326
|
+
})
|
|
327
|
+
break
|
|
328
|
+
}
|
|
329
|
+
case 'remove-from-contact': {
|
|
330
|
+
const contactTagId = args.id
|
|
331
|
+
if (!contactTagId) { result = { error: '--id required (contactTag ID)' }; break }
|
|
332
|
+
result = await api('DELETE', `/contactTags/${contactTagId}`)
|
|
333
|
+
break
|
|
334
|
+
}
|
|
335
|
+
default:
|
|
336
|
+
result = { error: 'Unknown tags subcommand. Use: list, get, create, delete, add-to-contact, remove-from-contact' }
|
|
337
|
+
}
|
|
338
|
+
break
|
|
339
|
+
|
|
340
|
+
case 'pipelines':
|
|
341
|
+
switch (sub) {
|
|
342
|
+
case 'list': {
|
|
343
|
+
const params = new URLSearchParams()
|
|
344
|
+
params.set('limit', String(limit))
|
|
345
|
+
params.set('offset', String(offset))
|
|
346
|
+
result = await api('GET', `/dealGroups?${params.toString()}`)
|
|
347
|
+
break
|
|
348
|
+
}
|
|
349
|
+
case 'get': {
|
|
350
|
+
const id = args.id
|
|
351
|
+
if (!id) { result = { error: '--id required' }; break }
|
|
352
|
+
result = await api('GET', `/dealGroups/${id}`)
|
|
353
|
+
break
|
|
354
|
+
}
|
|
355
|
+
default:
|
|
356
|
+
result = { error: 'Unknown pipelines subcommand. Use: list, get' }
|
|
357
|
+
}
|
|
358
|
+
break
|
|
359
|
+
|
|
360
|
+
case 'webhooks':
|
|
361
|
+
switch (sub) {
|
|
362
|
+
case 'list': {
|
|
363
|
+
const params = new URLSearchParams()
|
|
364
|
+
params.set('limit', String(limit))
|
|
365
|
+
params.set('offset', String(offset))
|
|
366
|
+
result = await api('GET', `/webhooks?${params.toString()}`)
|
|
367
|
+
break
|
|
368
|
+
}
|
|
369
|
+
case 'get': {
|
|
370
|
+
const id = args.id
|
|
371
|
+
if (!id) { result = { error: '--id required' }; break }
|
|
372
|
+
result = await api('GET', `/webhooks/${id}`)
|
|
373
|
+
break
|
|
374
|
+
}
|
|
375
|
+
case 'create': {
|
|
376
|
+
const name = args.name
|
|
377
|
+
const url = args.url
|
|
378
|
+
if (!name) { result = { error: '--name required' }; break }
|
|
379
|
+
if (!url) { result = { error: '--url required' }; break }
|
|
380
|
+
const events = args.events?.split(',') || ['subscribe']
|
|
381
|
+
const sources = args.sources?.split(',') || ['public', 'admin', 'api', 'system']
|
|
382
|
+
result = await api('POST', '/webhooks', {
|
|
383
|
+
webhook: { name, url, events, sources }
|
|
384
|
+
})
|
|
385
|
+
break
|
|
386
|
+
}
|
|
387
|
+
case 'delete': {
|
|
388
|
+
const id = args.id
|
|
389
|
+
if (!id) { result = { error: '--id required' }; break }
|
|
390
|
+
result = await api('DELETE', `/webhooks/${id}`)
|
|
391
|
+
break
|
|
392
|
+
}
|
|
393
|
+
default:
|
|
394
|
+
result = { error: 'Unknown webhooks subcommand. Use: list, get, create, delete' }
|
|
395
|
+
}
|
|
396
|
+
break
|
|
397
|
+
|
|
398
|
+
case 'users':
|
|
399
|
+
switch (sub) {
|
|
400
|
+
case 'me':
|
|
401
|
+
result = await api('GET', '/users/me')
|
|
402
|
+
break
|
|
403
|
+
case 'list':
|
|
404
|
+
result = await api('GET', '/users')
|
|
405
|
+
break
|
|
406
|
+
default:
|
|
407
|
+
result = { error: 'Unknown users subcommand. Use: me, list' }
|
|
408
|
+
}
|
|
409
|
+
break
|
|
410
|
+
|
|
411
|
+
default:
|
|
412
|
+
result = {
|
|
413
|
+
error: 'Unknown command',
|
|
414
|
+
usage: {
|
|
415
|
+
contacts: 'contacts [list | get --id <id> | create --email <email> | update --id <id> | delete --id <id> | sync --email <email>]',
|
|
416
|
+
lists: 'lists [list | get --id <id> | create --name <name> | delete --id <id> | subscribe --list-id <lid> --contact-id <cid> | unsubscribe --list-id <lid> --contact-id <cid>]',
|
|
417
|
+
campaigns: 'campaigns [list | get --id <id>]',
|
|
418
|
+
deals: 'deals [list | get --id <id> | create --title <title> | update --id <id> | delete --id <id>]',
|
|
419
|
+
automations: 'automations [list | get --id <id> | add-contact --id <aid> --email <email>]',
|
|
420
|
+
tags: 'tags [list | get --id <id> | create --name <name> | delete --id <id> | add-to-contact --tag-id <tid> --contact-id <cid>]',
|
|
421
|
+
pipelines: 'pipelines [list | get --id <id>]',
|
|
422
|
+
webhooks: 'webhooks [list | get --id <id> | create --name <name> --url <url> | delete --id <id>]',
|
|
423
|
+
users: 'users [me | list]',
|
|
424
|
+
options: '--limit <n> --offset <n> --search <query> --email <email>',
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
console.log(JSON.stringify(result, null, 2))
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
main().catch(err => {
|
|
433
|
+
console.error(JSON.stringify({ error: err.message }))
|
|
434
|
+
process.exit(1)
|
|
435
|
+
})
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const ACCESS_TOKEN = process.env.ADOBE_ACCESS_TOKEN
|
|
4
|
+
const CLIENT_ID = process.env.ADOBE_CLIENT_ID
|
|
5
|
+
const COMPANY_ID = process.env.ADOBE_COMPANY_ID
|
|
6
|
+
|
|
7
|
+
if (!ACCESS_TOKEN || !CLIENT_ID || !COMPANY_ID) {
|
|
8
|
+
console.error(JSON.stringify({ error: 'ADOBE_ACCESS_TOKEN, ADOBE_CLIENT_ID, and ADOBE_COMPANY_ID environment variables required' }))
|
|
9
|
+
process.exit(1)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const BASE_URL = `https://analytics.adobe.io/api/${COMPANY_ID}`
|
|
13
|
+
|
|
14
|
+
async function api(method, path, body) {
|
|
15
|
+
if (args['dry-run']) {
|
|
16
|
+
return { _dry_run: true, method, url: `${BASE_URL}${path}`, headers: { 'Authorization': '***', 'x-api-key': '***', 'x-proxy-global-company-id': COMPANY_ID, 'Content-Type': 'application/json' }, body: body || undefined }
|
|
17
|
+
}
|
|
18
|
+
const res = await fetch(`${BASE_URL}${path}`, {
|
|
19
|
+
method,
|
|
20
|
+
headers: {
|
|
21
|
+
'Authorization': `Bearer ${ACCESS_TOKEN}`,
|
|
22
|
+
'x-api-key': CLIENT_ID,
|
|
23
|
+
'x-proxy-global-company-id': COMPANY_ID,
|
|
24
|
+
'Content-Type': 'application/json',
|
|
25
|
+
},
|
|
26
|
+
body: body ? JSON.stringify(body) : undefined,
|
|
27
|
+
})
|
|
28
|
+
const text = await res.text()
|
|
29
|
+
try {
|
|
30
|
+
return JSON.parse(text)
|
|
31
|
+
} catch {
|
|
32
|
+
return { status: res.status, body: text }
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function parseArgs(args) {
|
|
37
|
+
const result = { _: [] }
|
|
38
|
+
for (let i = 0; i < args.length; i++) {
|
|
39
|
+
const arg = args[i]
|
|
40
|
+
if (arg.startsWith('--')) {
|
|
41
|
+
const key = arg.slice(2)
|
|
42
|
+
const next = args[i + 1]
|
|
43
|
+
if (next && !next.startsWith('--')) {
|
|
44
|
+
result[key] = next
|
|
45
|
+
i++
|
|
46
|
+
} else {
|
|
47
|
+
result[key] = true
|
|
48
|
+
}
|
|
49
|
+
} else {
|
|
50
|
+
result._.push(arg)
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return result
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const args = parseArgs(process.argv.slice(2))
|
|
57
|
+
const [cmd, sub, ...rest] = args._
|
|
58
|
+
|
|
59
|
+
async function main() {
|
|
60
|
+
let result
|
|
61
|
+
|
|
62
|
+
switch (cmd) {
|
|
63
|
+
case 'reportsuites':
|
|
64
|
+
switch (sub) {
|
|
65
|
+
case 'list':
|
|
66
|
+
result = await api('GET', '/reportsuites')
|
|
67
|
+
break
|
|
68
|
+
default:
|
|
69
|
+
result = { error: 'Unknown reportsuites subcommand. Use: list' }
|
|
70
|
+
}
|
|
71
|
+
break
|
|
72
|
+
|
|
73
|
+
case 'dimensions':
|
|
74
|
+
switch (sub) {
|
|
75
|
+
case 'list': {
|
|
76
|
+
if (!args.rsid) { result = { error: '--rsid required' }; break }
|
|
77
|
+
const params = new URLSearchParams()
|
|
78
|
+
params.set('rsid', args.rsid)
|
|
79
|
+
result = await api('GET', `/dimensions?${params}`)
|
|
80
|
+
break
|
|
81
|
+
}
|
|
82
|
+
default:
|
|
83
|
+
result = { error: 'Unknown dimensions subcommand. Use: list' }
|
|
84
|
+
}
|
|
85
|
+
break
|
|
86
|
+
|
|
87
|
+
case 'metrics':
|
|
88
|
+
switch (sub) {
|
|
89
|
+
case 'list': {
|
|
90
|
+
if (!args.rsid) { result = { error: '--rsid required' }; break }
|
|
91
|
+
const params = new URLSearchParams()
|
|
92
|
+
params.set('rsid', args.rsid)
|
|
93
|
+
result = await api('GET', `/metrics?${params}`)
|
|
94
|
+
break
|
|
95
|
+
}
|
|
96
|
+
default:
|
|
97
|
+
result = { error: 'Unknown metrics subcommand. Use: list' }
|
|
98
|
+
}
|
|
99
|
+
break
|
|
100
|
+
|
|
101
|
+
case 'reports':
|
|
102
|
+
switch (sub) {
|
|
103
|
+
case 'run': {
|
|
104
|
+
if (!args.rsid) { result = { error: '--rsid required' }; break }
|
|
105
|
+
if (!args['start-date']) { result = { error: '--start-date required' }; break }
|
|
106
|
+
if (!args['end-date']) { result = { error: '--end-date required' }; break }
|
|
107
|
+
if (!args.metrics) { result = { error: '--metrics required (comma-separated)' }; break }
|
|
108
|
+
const body = {
|
|
109
|
+
rsid: args.rsid,
|
|
110
|
+
globalFilters: [{
|
|
111
|
+
type: 'dateRange',
|
|
112
|
+
dateRange: `${args['start-date']}T00:00:00/${args['end-date']}T23:59:59`,
|
|
113
|
+
}],
|
|
114
|
+
metricContainer: {
|
|
115
|
+
metrics: args.metrics.split(',').map(m => ({ id: m.trim() })),
|
|
116
|
+
},
|
|
117
|
+
}
|
|
118
|
+
if (args.dimension) {
|
|
119
|
+
body.dimension = args.dimension
|
|
120
|
+
}
|
|
121
|
+
result = await api('POST', '/reports', body)
|
|
122
|
+
break
|
|
123
|
+
}
|
|
124
|
+
default:
|
|
125
|
+
result = { error: 'Unknown reports subcommand. Use: run' }
|
|
126
|
+
}
|
|
127
|
+
break
|
|
128
|
+
|
|
129
|
+
case 'segments':
|
|
130
|
+
switch (sub) {
|
|
131
|
+
case 'list': {
|
|
132
|
+
const params = new URLSearchParams()
|
|
133
|
+
if (args.rsid) params.set('rsid', args.rsid)
|
|
134
|
+
result = await api('GET', `/segments?${params}`)
|
|
135
|
+
break
|
|
136
|
+
}
|
|
137
|
+
default:
|
|
138
|
+
result = { error: 'Unknown segments subcommand. Use: list' }
|
|
139
|
+
}
|
|
140
|
+
break
|
|
141
|
+
|
|
142
|
+
default:
|
|
143
|
+
result = {
|
|
144
|
+
error: 'Unknown command',
|
|
145
|
+
usage: {
|
|
146
|
+
reportsuites: 'reportsuites list',
|
|
147
|
+
dimensions: 'dimensions list --rsid <report_suite_id>',
|
|
148
|
+
metrics: 'metrics list --rsid <report_suite_id>',
|
|
149
|
+
reports: 'reports run --rsid <report_suite_id> --start-date <YYYY-MM-DD> --end-date <YYYY-MM-DD> --metrics <metrics> [--dimension <dimension>]',
|
|
150
|
+
segments: 'segments list [--rsid <report_suite_id>]',
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
console.log(JSON.stringify(result, null, 2))
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
main().catch(err => {
|
|
159
|
+
console.error(JSON.stringify({ error: err.message }))
|
|
160
|
+
process.exit(1)
|
|
161
|
+
})
|