@armor/zuora-mcp 1.0.1 → 1.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.
@@ -0,0 +1,499 @@
1
+ /**
2
+ * MCP Resource Definitions for Zuora Data Model & ZOQL Reference
3
+ *
4
+ * Static content that Claude reads to write better ad-hoc ZOQL queries.
5
+ * These resources expose Zuora's data model, relationships, syntax rules,
6
+ * and common query patterns so Claude can construct correct multi-step ZOQL
7
+ * without needing to guess field names or relationships.
8
+ */
9
+ // ==================== Resource Content ====================
10
+ const DATA_MODEL_RELATIONSHIPS = `# Zuora Data Model & Relationships
11
+
12
+ ## Object Hierarchy
13
+
14
+ \`\`\`
15
+ Account
16
+ ├── Subscription (AccountId → Account.Id)
17
+ │ ├── RatePlan (SubscriptionId → Subscription.Id)
18
+ │ │ ├── RatePlanCharge (RatePlanId → RatePlan.Id)
19
+ │ │ └── ProductRatePlan (via RatePlan.ProductRatePlanId)
20
+ │ └── Amendment (SubscriptionId → Subscription.Id)
21
+ ├── Invoice (AccountId → Account.Id)
22
+ │ └── InvoiceItem (InvoiceId → Invoice.Id)
23
+ │ └── InvoiceItemAdjustment
24
+ ├── Payment (AccountId → Account.Id)
25
+ │ └── InvoicePayment (PaymentId → Payment.Id, InvoiceId → Invoice.Id)
26
+ ├── CreditBalanceAdjustment (AccountId → Account.Id)
27
+ ├── Refund (AccountId → Account.Id)
28
+ └── Contact (AccountId → Account.Id)
29
+
30
+ Product (standalone)
31
+ ├── ProductRatePlan (ProductId → Product.Id)
32
+ │ └── ProductRatePlanCharge (ProductRatePlanId → ProductRatePlan.Id)
33
+ │ └── ProductRatePlanChargeTier
34
+ \`\`\`
35
+
36
+ ## Key Foreign Key Relationships
37
+
38
+ | Child Object | Foreign Key | Parent Object |
39
+ |---|---|---|
40
+ | Subscription | AccountId | Account.Id |
41
+ | RatePlan | SubscriptionId | Subscription.Id |
42
+ | RatePlan | ProductRatePlanId | ProductRatePlan.Id |
43
+ | RatePlanCharge | RatePlanId | RatePlan.Id |
44
+ | Invoice | AccountId | Account.Id |
45
+ | InvoiceItem | InvoiceId | Invoice.Id |
46
+ | InvoiceItem | SubscriptionId | Subscription.Id |
47
+ | InvoiceItem | RatePlanChargeId | RatePlanCharge.Id |
48
+ | Payment | AccountId | Account.Id |
49
+ | InvoicePayment | PaymentId | Payment.Id |
50
+ | InvoicePayment | InvoiceId | Invoice.Id |
51
+ | ProductRatePlan | ProductId | Product.Id |
52
+ | ProductRatePlanCharge | ProductRatePlanId | ProductRatePlan.Id |
53
+
54
+ ## Common Multi-Step Query Patterns
55
+
56
+ ### Find accounts by product name (3 steps)
57
+ 1. \`SELECT Id, ProductRatePlanId FROM RatePlan WHERE ProductRatePlanId != ''\`
58
+ - Or filter by name using ProductRatePlan first
59
+ 2. Get SubscriptionIds from RatePlan results
60
+ 3. \`SELECT AccountId, AccountNumber FROM Subscription WHERE Id IN (...subscriptionIds) AND Status = 'Active'\`
61
+
62
+ ### Find invoices by product (3 steps)
63
+ 1. Query RatePlan to get RatePlanCharge IDs for the product
64
+ 2. Query InvoiceItem WHERE RatePlanChargeId IN (...)
65
+ 3. Query Invoice WHERE Id IN (...invoiceIds from step 2)
66
+
67
+ ### Get subscription details with product info (2 steps)
68
+ 1. \`SELECT Id, SubscriptionId, ProductRatePlanId FROM RatePlan WHERE SubscriptionId = '...'\`
69
+ 2. \`SELECT Id, Name FROM ProductRatePlan WHERE Id IN (...productRatePlanIds)\`
70
+
71
+ ## Important Notes
72
+
73
+ - **No JOINs**: ZOQL does not support JOIN. You must query each object separately and correlate by ID.
74
+ - **Case-sensitive fields**: Field names are case-sensitive (e.g., \`AccountId\` not \`accountid\`).
75
+ - **Max 2000 records**: Each query returns at most 2000 records. Use queryLocator for pagination.
76
+ - **No subqueries**: ZOQL does not support subqueries or nested SELECT statements.
77
+ - **No date functions**: ZOQL has no built-in date arithmetic. Compute date literals server-side.
78
+ `;
79
+ const ZOQL_SYNTAX_GUIDE = `# ZOQL Syntax Guide
80
+
81
+ ## Basic Syntax
82
+ \`\`\`
83
+ SELECT field1, field2, ... FROM ObjectName [WHERE conditions] [ORDER BY field [ASC|DESC]]
84
+ \`\`\`
85
+
86
+ ## Supported Operators
87
+ | Operator | Example |
88
+ |---|---|
89
+ | = | \`WHERE Status = 'Active'\` |
90
+ | != | \`WHERE Status != 'Cancelled'\` |
91
+ | < | \`WHERE Balance < 100\` |
92
+ | <= | \`WHERE DueDate <= '2024-12-31'\` |
93
+ | > | \`WHERE Amount > 0\` |
94
+ | >= | \`WHERE CreatedDate >= '2024-01-01'\` |
95
+ | LIKE | \`WHERE Name LIKE 'Acme%'\` |
96
+ | IN | \`WHERE Id IN ('id1', 'id2', 'id3')\` |
97
+ | AND | \`WHERE Status = 'Active' AND Balance > 0\` |
98
+ | OR | \`WHERE Status = 'Active' OR Status = 'Draft'\` |
99
+ | IS NULL | \`WHERE TermEndDate IS NULL\` (for EVERGREEN)\` |
100
+ | IS NOT NULL | \`WHERE CancelledDate IS NOT NULL\` |
101
+
102
+ ## Key Limitations
103
+ 1. **No JOINs** — Must query each object separately
104
+ 2. **No subqueries** — Cannot nest SELECT statements
105
+ 3. **No aggregation** — No SUM, COUNT, AVG, GROUP BY (aggregate client-side)
106
+ 4. **No date functions** — No DATEADD, DATEDIFF, NOW() (compute dates in code)
107
+ 5. **Max 2000 records per page** — Use queryLocator for pagination
108
+ 6. **No DISTINCT** — Deduplicate client-side
109
+ 7. **No LIMIT/OFFSET** — Cannot limit result count in query
110
+ 8. **Case-sensitive field names** — Must match exactly (AccountId, not accountid)
111
+
112
+ ## Date Handling
113
+ - Dates must be string literals in YYYY-MM-DD format: \`WHERE DueDate < '2024-03-15'\`
114
+ - DateTime fields use ISO 8601: \`WHERE CreatedDate >= '2024-01-01T00:00:00'\`
115
+ - No timezone conversion in ZOQL — all dates are in tenant's timezone
116
+
117
+ ## String Handling
118
+ - Strings use single quotes: \`WHERE Name = 'Acme Corp'\`
119
+ - Escape single quotes by doubling: \`WHERE Name = 'O''Brien Inc'\`
120
+ - LIKE uses % as wildcard: \`WHERE Name LIKE '%Analytics%'\`
121
+
122
+ ## Pagination
123
+ 1. First query returns up to 2000 records + a \`queryLocator\` if more exist
124
+ 2. Call \`queryMore\` with the queryLocator to get the next page
125
+ 3. Repeat until \`done: true\` or no queryLocator returned
126
+
127
+ ## Queryable Objects (most common)
128
+ | Object | Key Fields |
129
+ |---|---|
130
+ | Account | Id, AccountNumber, Name, Status, Balance, Currency, CreatedDate |
131
+ | Subscription | Id, AccountId, SubscriptionNumber, Status, TermStartDate, TermEndDate, ContractedMrr, AutoRenew |
132
+ | RatePlan | Id, SubscriptionId, ProductRatePlanId, Name |
133
+ | RatePlanCharge | Id, RatePlanId, Name, ChargeType, MRR, TCV, Price, Currency |
134
+ | Invoice | Id, AccountId, InvoiceNumber, InvoiceDate, DueDate, Amount, Balance, Status |
135
+ | InvoiceItem | Id, InvoiceId, SubscriptionId, RatePlanChargeId, ChargeAmount, ChargeName, ServiceStartDate, ServiceEndDate |
136
+ | Payment | Id, AccountId, PaymentNumber, Amount, EffectiveDate, Status, PaymentMethodType |
137
+ | InvoicePayment | Id, InvoiceId, PaymentId, Amount |
138
+ | Product | Id, Name, SKU, Description |
139
+ | ProductRatePlan | Id, ProductId, Name, Description |
140
+ | ProductRatePlanCharge | Id, ProductRatePlanId, Name, ChargeType, BillingPeriod |
141
+ | Contact | Id, AccountId, FirstName, LastName, WorkEmail |
142
+ | Amendment | Id, SubscriptionId, Type, EffectiveDate, Status |
143
+ | Refund | Id, AccountId, Amount, Status, RefundDate |
144
+ `;
145
+ const ZOQL_COMMON_PATTERNS = `# Common ZOQL Patterns
146
+
147
+ ## Account Queries
148
+
149
+ ### Active accounts with balance
150
+ \`\`\`
151
+ SELECT Id, AccountNumber, Name, Balance, Currency
152
+ FROM Account
153
+ WHERE Status = 'Active' AND Balance > 0
154
+ \`\`\`
155
+
156
+ ### Find account by name (partial match)
157
+ \`\`\`
158
+ SELECT Id, AccountNumber, Name, Status, Balance
159
+ FROM Account
160
+ WHERE Name LIKE '%Acme%'
161
+ \`\`\`
162
+
163
+ ## Subscription Queries
164
+
165
+ ### Active subscriptions for an account
166
+ \`\`\`
167
+ SELECT Id, SubscriptionNumber, Status, TermStartDate, TermEndDate, ContractedMrr, AutoRenew
168
+ FROM Subscription
169
+ WHERE AccountId = 'ACCOUNT_ID' AND Status = 'Active'
170
+ \`\`\`
171
+
172
+ ### Subscriptions expiring in next 30 days
173
+ \`\`\`
174
+ SELECT Id, SubscriptionNumber, AccountId, TermEndDate, ContractedMrr, AutoRenew
175
+ FROM Subscription
176
+ WHERE Status = 'Active' AND TermEndDate >= 'YYYY-MM-DD' AND TermEndDate <= 'YYYY-MM-DD'
177
+ \`\`\`
178
+
179
+ ### Recently cancelled subscriptions
180
+ \`\`\`
181
+ SELECT Id, SubscriptionNumber, AccountId, Status, TermEndDate, UpdatedDate
182
+ FROM Subscription
183
+ WHERE Status = 'Cancelled' AND UpdatedDate >= 'YYYY-MM-DD'
184
+ \`\`\`
185
+
186
+ ## Invoice Queries
187
+
188
+ ### Overdue invoices (Posted with balance, past due date)
189
+ \`\`\`
190
+ SELECT Id, InvoiceNumber, AccountId, InvoiceDate, DueDate, Amount, Balance
191
+ FROM Invoice
192
+ WHERE Status = 'Posted' AND Balance > 0 AND DueDate < 'TODAY'
193
+ \`\`\`
194
+
195
+ ### Invoices for a date range
196
+ \`\`\`
197
+ SELECT Id, InvoiceNumber, AccountId, InvoiceDate, Amount, Balance, Status
198
+ FROM Invoice
199
+ WHERE InvoiceDate >= '2024-01-01' AND InvoiceDate <= '2024-01-31'
200
+ \`\`\`
201
+
202
+ ## Rate Plan Queries
203
+
204
+ ### Find subscriptions with a specific product
205
+ \`\`\`
206
+ -- Step 1: Get ProductRatePlan IDs for the product
207
+ SELECT Id, Name FROM ProductRatePlan WHERE ProductId = 'PRODUCT_ID'
208
+
209
+ -- Step 2: Find RatePlans using those ProductRatePlanIds
210
+ SELECT Id, SubscriptionId FROM RatePlan WHERE ProductRatePlanId IN ('prp_id1', 'prp_id2')
211
+
212
+ -- Step 3: Get subscription details
213
+ SELECT Id, AccountId, SubscriptionNumber, Status, ContractedMrr
214
+ FROM Subscription WHERE Id IN ('sub_id1', 'sub_id2') AND Status = 'Active'
215
+ \`\`\`
216
+
217
+ ### Find products by name (when exact ProductId unknown)
218
+ \`\`\`
219
+ SELECT Id, Name FROM Product WHERE Name LIKE '%Security Analytics%'
220
+ \`\`\`
221
+
222
+ ### Get rate plan charges (MRR/pricing details)
223
+ \`\`\`
224
+ SELECT Id, RatePlanId, Name, ChargeType, MRR, TCV, Price, Currency
225
+ FROM RatePlanCharge WHERE RatePlanId IN ('rp_id1', 'rp_id2')
226
+ \`\`\`
227
+
228
+ ## Payment Queries
229
+
230
+ ### Payments in a date range
231
+ \`\`\`
232
+ SELECT Id, PaymentNumber, AccountId, Amount, EffectiveDate, Status, PaymentMethodType
233
+ FROM Payment
234
+ WHERE EffectiveDate >= '2024-01-01' AND EffectiveDate <= '2024-01-31'
235
+ \`\`\`
236
+
237
+ ### Failed payments
238
+ \`\`\`
239
+ SELECT Id, PaymentNumber, AccountId, Amount, EffectiveDate, Status
240
+ FROM Payment
241
+ WHERE Status = 'Error' AND EffectiveDate >= '2024-01-01'
242
+ \`\`\`
243
+
244
+ ## Invoice Item Queries
245
+
246
+ ### Invoice items for a specific invoice
247
+ \`\`\`
248
+ SELECT Id, ChargeAmount, ChargeName, ServiceStartDate, ServiceEndDate, SubscriptionId
249
+ FROM InvoiceItem
250
+ WHERE InvoiceId = 'INVOICE_ID'
251
+ \`\`\`
252
+
253
+ ### Invoice items by rate plan charge
254
+ \`\`\`
255
+ SELECT Id, InvoiceId, ChargeAmount, ChargeName, ServiceStartDate, ServiceEndDate
256
+ FROM InvoiceItem
257
+ WHERE RatePlanChargeId IN ('rpc_id1', 'rpc_id2')
258
+ \`\`\`
259
+
260
+ ## Multi-Step Pattern: Account → Subscription → Product Mapping
261
+ \`\`\`
262
+ -- Step 1: Get all active subscriptions
263
+ SELECT Id, AccountId, SubscriptionNumber, ContractedMrr
264
+ FROM Subscription WHERE Status = 'Active'
265
+
266
+ -- Step 2: Get rate plans for those subscriptions
267
+ SELECT Id, SubscriptionId, ProductRatePlanId, Name
268
+ FROM RatePlan WHERE SubscriptionId IN ('sub1', 'sub2', ...)
269
+
270
+ -- Step 3: Resolve product names
271
+ SELECT Id, Name FROM ProductRatePlan WHERE Id IN ('prp1', 'prp2', ...)
272
+ \`\`\`
273
+ `;
274
+ const OBJECT_FIELD_DEFINITIONS = {
275
+ account: `# Account Object
276
+
277
+ | Field | Type | Description |
278
+ |---|---|---|
279
+ | Id | string | Unique identifier (UUID) |
280
+ | AccountNumber | string | Human-readable account number (e.g., A00000001) |
281
+ | Name | string | Account name |
282
+ | Status | string | Active, Cancelled, Draft |
283
+ | Balance | decimal | Current account balance (outstanding amount) |
284
+ | CreditBalance | decimal | Credit balance available |
285
+ | Currency | string | ISO 4217 currency code |
286
+ | BillCycleDay | integer | Day of month for billing (1-31) |
287
+ | AutoPay | boolean | Whether auto-collection is enabled |
288
+ | PaymentTerm | string | Payment terms (e.g., "Net 30") |
289
+ | BillToId | string | FK to Contact for billing address |
290
+ | SoldToId | string | FK to Contact for sold-to address |
291
+ | CreatedDate | datetime | When the account was created |
292
+ | UpdatedDate | datetime | Last modification timestamp |
293
+ `,
294
+ subscription: `# Subscription Object
295
+
296
+ | Field | Type | Description |
297
+ |---|---|---|
298
+ | Id | string | Unique identifier (UUID) |
299
+ | AccountId | string | FK to Account.Id |
300
+ | SubscriptionNumber | string | Human-readable (e.g., A-S00000001) |
301
+ | Status | string | Active, Cancelled, Expired, Suspended, Draft |
302
+ | TermType | string | TERMED or EVERGREEN |
303
+ | TermStartDate | date | Current term start |
304
+ | TermEndDate | date | Current term end (null for EVERGREEN) |
305
+ | ContractEffectiveDate | date | When the contract became effective |
306
+ | ServiceActivationDate | date | When the service was activated |
307
+ | ContractedMrr | decimal | Monthly Recurring Revenue |
308
+ | TotalContractedValue | decimal | Total Contract Value |
309
+ | AutoRenew | boolean | Whether auto-renewal is enabled |
310
+ | RenewalTerm | integer | Renewal period length |
311
+ | RenewalTermPeriodType | string | Month, Year, Day, Week |
312
+ | CancelledDate | date | When cancelled (null if not cancelled) |
313
+ | CreatedDate | datetime | Creation timestamp |
314
+ | UpdatedDate | datetime | Last modification timestamp |
315
+ `,
316
+ invoice: `# Invoice Object
317
+
318
+ | Field | Type | Description |
319
+ |---|---|---|
320
+ | Id | string | Unique identifier (UUID) |
321
+ | AccountId | string | FK to Account.Id |
322
+ | InvoiceNumber | string | Human-readable invoice number |
323
+ | InvoiceDate | date | Date the invoice was generated |
324
+ | DueDate | date | Payment due date |
325
+ | Amount | decimal | Total invoice amount |
326
+ | Balance | decimal | Remaining unpaid balance |
327
+ | Status | string | Draft, Posted, Cancelled, Error |
328
+ | CreatedDate | datetime | Creation timestamp |
329
+ | UpdatedDate | datetime | Last modification timestamp |
330
+ `,
331
+ payment: `# Payment Object
332
+
333
+ | Field | Type | Description |
334
+ |---|---|---|
335
+ | Id | string | Unique identifier (UUID) |
336
+ | AccountId | string | FK to Account.Id |
337
+ | PaymentNumber | string | Human-readable payment number |
338
+ | Amount | decimal | Total payment amount |
339
+ | AppliedAmount | decimal | Amount applied to invoices |
340
+ | UnappliedAmount | decimal | Remaining unapplied amount |
341
+ | EffectiveDate | date | When the payment takes effect |
342
+ | Status | string | Processed, Error, Cancelled, Draft |
343
+ | Type | string | Electronic or External |
344
+ | PaymentMethodType | string | CreditCard, ACH, PayPal, etc. |
345
+ | GatewayResponse | string | Gateway transaction response |
346
+ | GatewayResponseCode | string | Gateway response code |
347
+ | CreatedDate | datetime | Creation timestamp |
348
+ | UpdatedDate | datetime | Last modification timestamp |
349
+ `,
350
+ rateplan: `# RatePlan Object
351
+
352
+ | Field | Type | Description |
353
+ |---|---|---|
354
+ | Id | string | Unique identifier (UUID) |
355
+ | SubscriptionId | string | FK to Subscription.Id |
356
+ | ProductRatePlanId | string | FK to ProductRatePlan.Id |
357
+ | Name | string | Rate plan name (copied from catalog) |
358
+ | AmendmentType | string | NewProduct, RemoveProduct, UpdateProduct |
359
+ | CreatedDate | datetime | Creation timestamp |
360
+ | UpdatedDate | datetime | Last modification timestamp |
361
+ `,
362
+ rateplancharge: `# RatePlanCharge Object
363
+
364
+ | Field | Type | Description |
365
+ |---|---|---|
366
+ | Id | string | Unique identifier (UUID) |
367
+ | RatePlanId | string | FK to RatePlan.Id |
368
+ | Name | string | Charge name |
369
+ | ChargeNumber | string | Human-readable charge number |
370
+ | ChargeType | string | OneTime, Recurring, Usage |
371
+ | ChargeModel | string | FlatFee, PerUnit, Tiered, Volume |
372
+ | MRR | decimal | Monthly Recurring Revenue for this charge |
373
+ | TCV | decimal | Total Contract Value for this charge |
374
+ | Price | decimal | Per-unit price |
375
+ | Currency | string | ISO 4217 currency code |
376
+ | Quantity | decimal | Quantity ordered |
377
+ | BillingPeriod | string | Month, Quarter, Annual, etc. |
378
+ | EffectiveStartDate | date | Charge effective start |
379
+ | EffectiveEndDate | date | Charge effective end |
380
+ `,
381
+ invoiceitem: `# InvoiceItem Object
382
+
383
+ | Field | Type | Description |
384
+ |---|---|---|
385
+ | Id | string | Unique identifier (UUID) |
386
+ | InvoiceId | string | FK to Invoice.Id |
387
+ | SubscriptionId | string | FK to Subscription.Id |
388
+ | RatePlanChargeId | string | FK to RatePlanCharge.Id |
389
+ | ChargeAmount | decimal | Amount for this line item |
390
+ | ChargeName | string | Name of the charge |
391
+ | ChargeDate | datetime | When the charge was generated |
392
+ | ServiceStartDate | date | Service period start |
393
+ | ServiceEndDate | date | Service period end |
394
+ | Quantity | decimal | Quantity billed |
395
+ | UnitOfMeasure | string | Unit of measure |
396
+ | TaxAmount | decimal | Tax amount for this item |
397
+ `,
398
+ product: `# Product Object
399
+
400
+ | Field | Type | Description |
401
+ |---|---|---|
402
+ | Id | string | Unique identifier (UUID) |
403
+ | Name | string | Product name |
404
+ | SKU | string | Stock keeping unit |
405
+ | Description | string | Product description |
406
+ | Category | string | Product category |
407
+ | EffectiveStartDate | date | When the product becomes available |
408
+ | EffectiveEndDate | date | When the product expires |
409
+ `,
410
+ productrateplan: `# ProductRatePlan Object
411
+
412
+ | Field | Type | Description |
413
+ |---|---|---|
414
+ | Id | string | Unique identifier (UUID) |
415
+ | ProductId | string | FK to Product.Id |
416
+ | Name | string | Rate plan name in catalog |
417
+ | Description | string | Rate plan description |
418
+ | EffectiveStartDate | date | When the plan becomes available |
419
+ | EffectiveEndDate | date | When the plan expires |
420
+ `,
421
+ };
422
+ // ==================== Registration ====================
423
+ export function registerResources(server) {
424
+ // Static resource: Data model relationships
425
+ server.resource("data-model-relationships", "zuora://data-model/relationships", {
426
+ description: "Zuora object hierarchy, foreign key mappings, and multi-step query patterns. " +
427
+ "Read this before writing ad-hoc ZOQL queries that span multiple objects.",
428
+ mimeType: "text/markdown",
429
+ }, async () => ({
430
+ contents: [
431
+ {
432
+ uri: "zuora://data-model/relationships",
433
+ mimeType: "text/markdown",
434
+ text: DATA_MODEL_RELATIONSHIPS,
435
+ },
436
+ ],
437
+ }));
438
+ // Template resource: Object field definitions
439
+ server.resource("data-model-object", "zuora://data-model/objects/{name}", {
440
+ description: "Field names, types, and descriptions for a specific Zuora object. " +
441
+ "Available objects: account, subscription, invoice, payment, rateplan, " +
442
+ "rateplancharge, invoiceitem, product, productrateplan.",
443
+ mimeType: "text/markdown",
444
+ }, async (uri) => {
445
+ const objectName = uri.pathname.split("/").pop()?.toLowerCase() ?? "";
446
+ const content = OBJECT_FIELD_DEFINITIONS[objectName];
447
+ if (!content) {
448
+ const available = Object.keys(OBJECT_FIELD_DEFINITIONS).join(", ");
449
+ return {
450
+ contents: [
451
+ {
452
+ uri: uri.href,
453
+ mimeType: "text/plain",
454
+ text: `Unknown object: ${objectName}. Available objects: ${available}`,
455
+ },
456
+ ],
457
+ };
458
+ }
459
+ return {
460
+ contents: [
461
+ {
462
+ uri: uri.href,
463
+ mimeType: "text/markdown",
464
+ text: content,
465
+ },
466
+ ],
467
+ };
468
+ });
469
+ // Static resource: ZOQL syntax guide
470
+ server.resource("zoql-syntax-guide", "zuora://zoql/syntax-guide", {
471
+ description: "ZOQL syntax reference: SELECT/WHERE operators, limitations, pagination, " +
472
+ "date handling, and string escaping rules.",
473
+ mimeType: "text/markdown",
474
+ }, async () => ({
475
+ contents: [
476
+ {
477
+ uri: "zuora://zoql/syntax-guide",
478
+ mimeType: "text/markdown",
479
+ text: ZOQL_SYNTAX_GUIDE,
480
+ },
481
+ ],
482
+ }));
483
+ // Static resource: Common ZOQL patterns
484
+ server.resource("zoql-common-patterns", "zuora://zoql/common-patterns", {
485
+ description: "Ready-to-use ZOQL query patterns for common finance scenarios: " +
486
+ "overdue invoices, active subscriptions, payment lookups, product searches, " +
487
+ "and multi-step joins.",
488
+ mimeType: "text/markdown",
489
+ }, async () => ({
490
+ contents: [
491
+ {
492
+ uri: "zuora://zoql/common-patterns",
493
+ mimeType: "text/markdown",
494
+ text: ZOQL_COMMON_PATTERNS,
495
+ },
496
+ ],
497
+ }));
498
+ }
499
+ //# sourceMappingURL=resources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources.js","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,6DAA6D;AAE7D,MAAM,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoEhC,CAAC;AAEF,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiEzB,CAAC;AAEF,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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+ * node:readline/promises, node:fs, node:path, node:os
6
+ *
7
+ * Detects Claude Code and Claude Desktop config files, prompts for
8
+ * Zuora OAuth credentials, and writes MCP server entries using the
9
+ * npx-based format so the server auto-installs on first use.
10
+ */
11
+ export declare function runSetup(): Promise<void>;
12
+ //# sourceMappingURL=setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA0MH,wBAAsB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CA0D9C"}