recurly-mcp 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/CHANGELOG.md +61 -0
- package/LICENSE +21 -0
- package/README.md +179 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +19 -0
- package/dist/bin.js.map +1 -0
- package/dist/client/errors.d.ts +16 -0
- package/dist/client/errors.js +44 -0
- package/dist/client/errors.js.map +1 -0
- package/dist/client/pagination.d.ts +8 -0
- package/dist/client/pagination.js +33 -0
- package/dist/client/pagination.js.map +1 -0
- package/dist/client/recurly.d.ts +19 -0
- package/dist/client/recurly.js +277 -0
- package/dist/client/recurly.js.map +1 -0
- package/dist/config.d.ts +9 -0
- package/dist/config.js +99 -0
- package/dist/config.js.map +1 -0
- package/dist/responseGuard.d.ts +1 -0
- package/dist/responseGuard.js +124 -0
- package/dist/responseGuard.js.map +1 -0
- package/dist/server.d.ts +7 -0
- package/dist/server.js +119 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/accounts.d.ts +217 -0
- package/dist/tools/accounts.js +71 -0
- package/dist/tools/accounts.js.map +1 -0
- package/dist/tools/addOns.d.ts +46 -0
- package/dist/tools/addOns.js +24 -0
- package/dist/tools/addOns.js.map +1 -0
- package/dist/tools/billingInfo.d.ts +57 -0
- package/dist/tools/billingInfo.js +31 -0
- package/dist/tools/billingInfo.js.map +1 -0
- package/dist/tools/businessEntities.d.ts +80 -0
- package/dist/tools/businessEntities.js +32 -0
- package/dist/tools/businessEntities.js.map +1 -0
- package/dist/tools/couponRedemptions.d.ts +135 -0
- package/dist/tools/couponRedemptions.js +57 -0
- package/dist/tools/couponRedemptions.js.map +1 -0
- package/dist/tools/coupons.d.ts +86 -0
- package/dist/tools/coupons.js +37 -0
- package/dist/tools/coupons.js.map +1 -0
- package/dist/tools/creditPayments.d.ts +73 -0
- package/dist/tools/creditPayments.js +28 -0
- package/dist/tools/creditPayments.js.map +1 -0
- package/dist/tools/customFieldDefinitions.d.ts +46 -0
- package/dist/tools/customFieldDefinitions.js +32 -0
- package/dist/tools/customFieldDefinitions.js.map +1 -0
- package/dist/tools/dunningCampaigns.d.ts +42 -0
- package/dist/tools/dunningCampaigns.js +21 -0
- package/dist/tools/dunningCampaigns.js.map +1 -0
- package/dist/tools/exports.d.ts +20 -0
- package/dist/tools/exports.js +21 -0
- package/dist/tools/exports.js.map +1 -0
- package/dist/tools/externalAccounts.d.ts +48 -0
- package/dist/tools/externalAccounts.js +28 -0
- package/dist/tools/externalAccounts.js.map +1 -0
- package/dist/tools/externalInvoices.d.ts +73 -0
- package/dist/tools/externalInvoices.js +28 -0
- package/dist/tools/externalInvoices.js.map +1 -0
- package/dist/tools/externalProducts.d.ts +85 -0
- package/dist/tools/externalProducts.js +34 -0
- package/dist/tools/externalProducts.js.map +1 -0
- package/dist/tools/externalSubscriptions.d.ts +147 -0
- package/dist/tools/externalSubscriptions.js +47 -0
- package/dist/tools/externalSubscriptions.js.map +1 -0
- package/dist/tools/generalLedgerAccounts.d.ts +46 -0
- package/dist/tools/generalLedgerAccounts.js +32 -0
- package/dist/tools/generalLedgerAccounts.js.map +1 -0
- package/dist/tools/giftCards.d.ts +42 -0
- package/dist/tools/giftCards.js +21 -0
- package/dist/tools/giftCards.js.map +1 -0
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.js +68 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/invoiceTemplates.d.ts +83 -0
- package/dist/tools/invoiceTemplates.js +39 -0
- package/dist/tools/invoiceTemplates.js.map +1 -0
- package/dist/tools/invoices.d.ts +168 -0
- package/dist/tools/invoices.js +58 -0
- package/dist/tools/invoices.js.map +1 -0
- package/dist/tools/items.d.ts +46 -0
- package/dist/tools/items.js +24 -0
- package/dist/tools/items.js.map +1 -0
- package/dist/tools/lineItems.d.ts +93 -0
- package/dist/tools/lineItems.js +37 -0
- package/dist/tools/lineItems.js.map +1 -0
- package/dist/tools/measuredUnits.d.ts +46 -0
- package/dist/tools/measuredUnits.js +24 -0
- package/dist/tools/measuredUnits.js.map +1 -0
- package/dist/tools/performanceObligations.d.ts +42 -0
- package/dist/tools/performanceObligations.js +24 -0
- package/dist/tools/performanceObligations.js.map +1 -0
- package/dist/tools/plans.d.ts +93 -0
- package/dist/tools/plans.js +34 -0
- package/dist/tools/plans.js.map +1 -0
- package/dist/tools/priceSegments.d.ts +42 -0
- package/dist/tools/priceSegments.js +21 -0
- package/dist/tools/priceSegments.js.map +1 -0
- package/dist/tools/request.d.ts +17 -0
- package/dist/tools/request.js +55 -0
- package/dist/tools/request.js.map +1 -0
- package/dist/tools/shared.d.ts +32 -0
- package/dist/tools/shared.js +73 -0
- package/dist/tools/shared.js.map +1 -0
- package/dist/tools/shippingAddresses.d.ts +48 -0
- package/dist/tools/shippingAddresses.js +28 -0
- package/dist/tools/shippingAddresses.js.map +1 -0
- package/dist/tools/shippingMethods.d.ts +42 -0
- package/dist/tools/shippingMethods.js +21 -0
- package/dist/tools/shippingMethods.js.map +1 -0
- package/dist/tools/sites.d.ts +46 -0
- package/dist/tools/sites.js +24 -0
- package/dist/tools/sites.js.map +1 -0
- package/dist/tools/subscriptions.d.ts +178 -0
- package/dist/tools/subscriptions.js +68 -0
- package/dist/tools/subscriptions.js.map +1 -0
- package/dist/tools/transactions.d.ts +87 -0
- package/dist/tools/transactions.js +36 -0
- package/dist/tools/transactions.js.map +1 -0
- package/dist/tools/types.d.ts +13 -0
- package/dist/tools/types.js +2 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/tools/usage.d.ts +52 -0
- package/dist/tools/usage.js +33 -0
- package/dist/tools/usage.js.map +1 -0
- package/package.json +77 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ToolDefinition } from './types.js';
|
|
3
|
+
declare const inputSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
|
|
4
|
+
action: z.ZodLiteral<"list">;
|
|
5
|
+
} & {
|
|
6
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
8
|
+
sort: z.ZodOptional<z.ZodString>;
|
|
9
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
10
|
+
ids: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
11
|
+
begin_time: z.ZodOptional<z.ZodString>;
|
|
12
|
+
end_time: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
action: "list";
|
|
15
|
+
cursor?: string | undefined;
|
|
16
|
+
limit?: number | undefined;
|
|
17
|
+
order?: "asc" | "desc" | undefined;
|
|
18
|
+
sort?: string | undefined;
|
|
19
|
+
ids?: string[] | undefined;
|
|
20
|
+
begin_time?: string | undefined;
|
|
21
|
+
end_time?: string | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
action: "list";
|
|
24
|
+
cursor?: string | undefined;
|
|
25
|
+
limit?: number | undefined;
|
|
26
|
+
order?: "asc" | "desc" | undefined;
|
|
27
|
+
sort?: string | undefined;
|
|
28
|
+
ids?: string[] | undefined;
|
|
29
|
+
begin_time?: string | undefined;
|
|
30
|
+
end_time?: string | undefined;
|
|
31
|
+
}>, z.ZodObject<{
|
|
32
|
+
action: z.ZodLiteral<"get">;
|
|
33
|
+
dunning_campaign_id: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
action: "get";
|
|
36
|
+
dunning_campaign_id: string;
|
|
37
|
+
}, {
|
|
38
|
+
action: "get";
|
|
39
|
+
dunning_campaign_id: string;
|
|
40
|
+
}>]>;
|
|
41
|
+
export declare const dunningCampaignsTool: ToolDefinition<typeof inputSchema>;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { enc, fetchList, idParam, listParamsSchema } from './shared.js';
|
|
3
|
+
const inputSchema = z.discriminatedUnion('action', [
|
|
4
|
+
z.object({ action: z.literal('list') }).merge(listParamsSchema),
|
|
5
|
+
z.object({ action: z.literal('get'), dunning_campaign_id: idParam('dunning_campaign_id') }),
|
|
6
|
+
]);
|
|
7
|
+
export const dunningCampaignsTool = {
|
|
8
|
+
name: 'recurly_dunning_campaigns',
|
|
9
|
+
description: 'Recurly dunning campaigns (read-only). Actions: list, get. Returns raw Recurly JSON; list adds a _pagination cursor hint.',
|
|
10
|
+
inputSchema,
|
|
11
|
+
handler: async (ctx, input) => {
|
|
12
|
+
const parsed = inputSchema.parse(input);
|
|
13
|
+
switch (parsed.action) {
|
|
14
|
+
case 'list':
|
|
15
|
+
return fetchList(ctx, '/dunning_campaigns', parsed);
|
|
16
|
+
case 'get':
|
|
17
|
+
return ctx.client.request('GET', `/dunning_campaigns/${enc(parsed.dunning_campaign_id)}`);
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=dunningCampaigns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dunningCampaigns.js","sourceRoot":"","sources":["../../src/tools/dunningCampaigns.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGxE,MAAM,WAAW,GAAG,CAAC,CAAC,kBAAkB,CAAC,QAAQ,EAAE;IACjD,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC;IAC/D,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,mBAAmB,EAAE,OAAO,CAAC,qBAAqB,CAAC,EAAE,CAAC;CAC5F,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAuC;IACtE,IAAI,EAAE,2BAA2B;IACjC,WAAW,EACT,2HAA2H;IAC7H,WAAW;IACX,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE;QAC5B,MAAM,MAAM,GAAG,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACxC,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;YACtB,KAAK,MAAM;gBACT,OAAO,SAAS,CAAC,GAAG,EAAE,oBAAoB,EAAE,MAAM,CAAC,CAAC;YACtD,KAAK,KAAK;gBACR,OAAO,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,sBAAsB,GAAG,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC;QAC9F,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ToolDefinition } from './types.js';
|
|
3
|
+
declare const inputSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
|
|
4
|
+
action: z.ZodLiteral<"get_dates">;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
action: "get_dates";
|
|
7
|
+
}, {
|
|
8
|
+
action: "get_dates";
|
|
9
|
+
}>, z.ZodObject<{
|
|
10
|
+
action: z.ZodLiteral<"get_files">;
|
|
11
|
+
export_date: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
action: "get_files";
|
|
14
|
+
export_date: string;
|
|
15
|
+
}, {
|
|
16
|
+
action: "get_files";
|
|
17
|
+
export_date: string;
|
|
18
|
+
}>]>;
|
|
19
|
+
export declare const exportTool: ToolDefinition<typeof inputSchema>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { enc, idParam } from './shared.js';
|
|
3
|
+
const inputSchema = z.discriminatedUnion('action', [
|
|
4
|
+
z.object({ action: z.literal('get_dates') }),
|
|
5
|
+
z.object({ action: z.literal('get_files'), export_date: idParam('export_date') }),
|
|
6
|
+
]);
|
|
7
|
+
export const exportTool = {
|
|
8
|
+
name: 'recurly_export',
|
|
9
|
+
description: 'Recurly automated exports (read-only). Actions: get_dates (the dates that have available export files), get_files (the export files available for a given date; export_date is an ISO date like 2021-06-01). Returns raw Recurly JSON.',
|
|
10
|
+
inputSchema,
|
|
11
|
+
handler: async (ctx, input) => {
|
|
12
|
+
const parsed = inputSchema.parse(input);
|
|
13
|
+
switch (parsed.action) {
|
|
14
|
+
case 'get_dates':
|
|
15
|
+
return ctx.client.request('GET', '/export_dates');
|
|
16
|
+
case 'get_files':
|
|
17
|
+
return ctx.client.request('GET', `/export_dates/${enc(parsed.export_date)}/export_files`);
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=exports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../../src/tools/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAG3C,MAAM,WAAW,GAAG,CAAC,CAAC,kBAAkB,CAAC,QAAQ,EAAE;IACjD,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;IAC5C,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;CAClF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAAuC;IAC5D,IAAI,EAAE,gBAAgB;IACtB,WAAW,EACT,wOAAwO;IAC1O,WAAW;IACX,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE;QAC5B,MAAM,MAAM,GAAG,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACxC,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;YACtB,KAAK,WAAW;gBACd,OAAO,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;YACpD,KAAK,WAAW;gBACd,OAAO,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,iBAAiB,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;QAC9F,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ToolDefinition } from './types.js';
|
|
3
|
+
declare const inputSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
|
|
4
|
+
action: z.ZodLiteral<"list">;
|
|
5
|
+
account_id: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
|
|
6
|
+
} & {
|
|
7
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
9
|
+
sort: z.ZodOptional<z.ZodString>;
|
|
10
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
11
|
+
ids: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
12
|
+
begin_time: z.ZodOptional<z.ZodString>;
|
|
13
|
+
end_time: z.ZodOptional<z.ZodString>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
action: "list";
|
|
16
|
+
account_id: string;
|
|
17
|
+
cursor?: string | undefined;
|
|
18
|
+
limit?: number | undefined;
|
|
19
|
+
order?: "asc" | "desc" | undefined;
|
|
20
|
+
sort?: string | undefined;
|
|
21
|
+
ids?: string[] | undefined;
|
|
22
|
+
begin_time?: string | undefined;
|
|
23
|
+
end_time?: string | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
action: "list";
|
|
26
|
+
account_id: string;
|
|
27
|
+
cursor?: string | undefined;
|
|
28
|
+
limit?: number | undefined;
|
|
29
|
+
order?: "asc" | "desc" | undefined;
|
|
30
|
+
sort?: string | undefined;
|
|
31
|
+
ids?: string[] | undefined;
|
|
32
|
+
begin_time?: string | undefined;
|
|
33
|
+
end_time?: string | undefined;
|
|
34
|
+
}>, z.ZodObject<{
|
|
35
|
+
action: z.ZodLiteral<"get">;
|
|
36
|
+
account_id: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
|
|
37
|
+
external_account_id: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
action: "get";
|
|
40
|
+
account_id: string;
|
|
41
|
+
external_account_id: string;
|
|
42
|
+
}, {
|
|
43
|
+
action: "get";
|
|
44
|
+
account_id: string;
|
|
45
|
+
external_account_id: string;
|
|
46
|
+
}>]>;
|
|
47
|
+
export declare const externalAccountsTool: ToolDefinition<typeof inputSchema>;
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { enc, fetchList, idParam, listParamsSchema } from './shared.js';
|
|
3
|
+
const accountId = idParam('account_id');
|
|
4
|
+
const inputSchema = z.discriminatedUnion('action', [
|
|
5
|
+
z.object({ action: z.literal('list'), account_id: accountId }).merge(listParamsSchema),
|
|
6
|
+
z.object({
|
|
7
|
+
action: z.literal('get'),
|
|
8
|
+
account_id: accountId,
|
|
9
|
+
external_account_id: idParam('external_account_id'),
|
|
10
|
+
}),
|
|
11
|
+
]);
|
|
12
|
+
export const externalAccountsTool = {
|
|
13
|
+
name: 'recurly_external_accounts',
|
|
14
|
+
description: "Recurly external accounts (read-only), scoped to an account — links to a customer's identity in an external app store. Actions: list, get. Returns raw Recurly JSON; list adds a _pagination cursor hint.",
|
|
15
|
+
inputSchema,
|
|
16
|
+
handler: async (ctx, input) => {
|
|
17
|
+
const parsed = inputSchema.parse(input);
|
|
18
|
+
switch (parsed.action) {
|
|
19
|
+
case 'list':
|
|
20
|
+
return fetchList(ctx, `/accounts/${enc(parsed.account_id)}/external_accounts`, parsed, [
|
|
21
|
+
'account_id',
|
|
22
|
+
]);
|
|
23
|
+
case 'get':
|
|
24
|
+
return ctx.client.request('GET', `/accounts/${enc(parsed.account_id)}/external_accounts/${enc(parsed.external_account_id)}`);
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=externalAccounts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"externalAccounts.js","sourceRoot":"","sources":["../../src/tools/externalAccounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGxE,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAExC,MAAM,WAAW,GAAG,CAAC,CAAC,kBAAkB,CAAC,QAAQ,EAAE;IACjD,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC;IACtF,CAAC,CAAC,MAAM,CAAC;QACP,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;QACxB,UAAU,EAAE,SAAS;QACrB,mBAAmB,EAAE,OAAO,CAAC,qBAAqB,CAAC;KACpD,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAuC;IACtE,IAAI,EAAE,2BAA2B;IACjC,WAAW,EACT,2MAA2M;IAC7M,WAAW;IACX,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE;QAC5B,MAAM,MAAM,GAAG,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACxC,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;YACtB,KAAK,MAAM;gBACT,OAAO,SAAS,CAAC,GAAG,EAAE,aAAa,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,oBAAoB,EAAE,MAAM,EAAE;oBACrF,YAAY;iBACb,CAAC,CAAC;YACL,KAAK,KAAK;gBACR,OAAO,GAAG,CAAC,MAAM,CAAC,OAAO,CACvB,KAAK,EACL,aAAa,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,sBAAsB,GAAG,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE,CAC3F,CAAC;QACN,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ToolDefinition } from './types.js';
|
|
3
|
+
declare const inputSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
|
|
4
|
+
action: z.ZodLiteral<"list">;
|
|
5
|
+
} & {
|
|
6
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
8
|
+
sort: z.ZodOptional<z.ZodString>;
|
|
9
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
10
|
+
ids: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
11
|
+
begin_time: z.ZodOptional<z.ZodString>;
|
|
12
|
+
end_time: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
action: "list";
|
|
15
|
+
cursor?: string | undefined;
|
|
16
|
+
limit?: number | undefined;
|
|
17
|
+
order?: "asc" | "desc" | undefined;
|
|
18
|
+
sort?: string | undefined;
|
|
19
|
+
ids?: string[] | undefined;
|
|
20
|
+
begin_time?: string | undefined;
|
|
21
|
+
end_time?: string | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
action: "list";
|
|
24
|
+
cursor?: string | undefined;
|
|
25
|
+
limit?: number | undefined;
|
|
26
|
+
order?: "asc" | "desc" | undefined;
|
|
27
|
+
sort?: string | undefined;
|
|
28
|
+
ids?: string[] | undefined;
|
|
29
|
+
begin_time?: string | undefined;
|
|
30
|
+
end_time?: string | undefined;
|
|
31
|
+
}>, z.ZodObject<{
|
|
32
|
+
action: z.ZodLiteral<"get">;
|
|
33
|
+
external_invoice_id: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
action: "get";
|
|
36
|
+
external_invoice_id: string;
|
|
37
|
+
}, {
|
|
38
|
+
action: "get";
|
|
39
|
+
external_invoice_id: string;
|
|
40
|
+
}>, z.ZodObject<{
|
|
41
|
+
action: z.ZodLiteral<"list_for_account">;
|
|
42
|
+
account_id: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
|
|
43
|
+
} & {
|
|
44
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
46
|
+
sort: z.ZodOptional<z.ZodString>;
|
|
47
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
48
|
+
ids: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
49
|
+
begin_time: z.ZodOptional<z.ZodString>;
|
|
50
|
+
end_time: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
action: "list_for_account";
|
|
53
|
+
account_id: string;
|
|
54
|
+
cursor?: string | undefined;
|
|
55
|
+
limit?: number | undefined;
|
|
56
|
+
order?: "asc" | "desc" | undefined;
|
|
57
|
+
sort?: string | undefined;
|
|
58
|
+
ids?: string[] | undefined;
|
|
59
|
+
begin_time?: string | undefined;
|
|
60
|
+
end_time?: string | undefined;
|
|
61
|
+
}, {
|
|
62
|
+
action: "list_for_account";
|
|
63
|
+
account_id: string;
|
|
64
|
+
cursor?: string | undefined;
|
|
65
|
+
limit?: number | undefined;
|
|
66
|
+
order?: "asc" | "desc" | undefined;
|
|
67
|
+
sort?: string | undefined;
|
|
68
|
+
ids?: string[] | undefined;
|
|
69
|
+
begin_time?: string | undefined;
|
|
70
|
+
end_time?: string | undefined;
|
|
71
|
+
}>]>;
|
|
72
|
+
export declare const externalInvoicesTool: ToolDefinition<typeof inputSchema>;
|
|
73
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { enc, fetchList, idParam, listParamsSchema } from './shared.js';
|
|
3
|
+
const inputSchema = z.discriminatedUnion('action', [
|
|
4
|
+
z.object({ action: z.literal('list') }).merge(listParamsSchema),
|
|
5
|
+
z.object({ action: z.literal('get'), external_invoice_id: idParam('external_invoice_id') }),
|
|
6
|
+
z
|
|
7
|
+
.object({ action: z.literal('list_for_account'), account_id: idParam('account_id') })
|
|
8
|
+
.merge(listParamsSchema),
|
|
9
|
+
]);
|
|
10
|
+
export const externalInvoicesTool = {
|
|
11
|
+
name: 'recurly_external_invoices',
|
|
12
|
+
description: 'Recurly external invoices (read-only) — invoices from external app stores. Actions: list (site-wide), get (one by ID), list_for_account. Returns raw Recurly JSON; list actions add a _pagination cursor hint.',
|
|
13
|
+
inputSchema,
|
|
14
|
+
handler: async (ctx, input) => {
|
|
15
|
+
const parsed = inputSchema.parse(input);
|
|
16
|
+
switch (parsed.action) {
|
|
17
|
+
case 'list':
|
|
18
|
+
return fetchList(ctx, '/external_invoices', parsed);
|
|
19
|
+
case 'get':
|
|
20
|
+
return ctx.client.request('GET', `/external_invoices/${enc(parsed.external_invoice_id)}`);
|
|
21
|
+
case 'list_for_account':
|
|
22
|
+
return fetchList(ctx, `/accounts/${enc(parsed.account_id)}/external_invoices`, parsed, [
|
|
23
|
+
'account_id',
|
|
24
|
+
]);
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=externalInvoices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"externalInvoices.js","sourceRoot":"","sources":["../../src/tools/externalInvoices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGxE,MAAM,WAAW,GAAG,CAAC,CAAC,kBAAkB,CAAC,QAAQ,EAAE;IACjD,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC;IAC/D,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,mBAAmB,EAAE,OAAO,CAAC,qBAAqB,CAAC,EAAE,CAAC;IAC3F,CAAC;SACE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;SACpF,KAAK,CAAC,gBAAgB,CAAC;CAC3B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAuC;IACtE,IAAI,EAAE,2BAA2B;IACjC,WAAW,EACT,gNAAgN;IAClN,WAAW;IACX,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE;QAC5B,MAAM,MAAM,GAAG,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACxC,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;YACtB,KAAK,MAAM;gBACT,OAAO,SAAS,CAAC,GAAG,EAAE,oBAAoB,EAAE,MAAM,CAAC,CAAC;YACtD,KAAK,KAAK;gBACR,OAAO,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,sBAAsB,GAAG,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC;YAC5F,KAAK,kBAAkB;gBACrB,OAAO,SAAS,CAAC,GAAG,EAAE,aAAa,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,oBAAoB,EAAE,MAAM,EAAE;oBACrF,YAAY;iBACb,CAAC,CAAC;QACP,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ToolDefinition } from './types.js';
|
|
3
|
+
declare const inputSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
|
|
4
|
+
action: z.ZodLiteral<"list">;
|
|
5
|
+
} & {
|
|
6
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
8
|
+
sort: z.ZodOptional<z.ZodString>;
|
|
9
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
10
|
+
ids: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
11
|
+
begin_time: z.ZodOptional<z.ZodString>;
|
|
12
|
+
end_time: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
action: "list";
|
|
15
|
+
cursor?: string | undefined;
|
|
16
|
+
limit?: number | undefined;
|
|
17
|
+
order?: "asc" | "desc" | undefined;
|
|
18
|
+
sort?: string | undefined;
|
|
19
|
+
ids?: string[] | undefined;
|
|
20
|
+
begin_time?: string | undefined;
|
|
21
|
+
end_time?: string | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
action: "list";
|
|
24
|
+
cursor?: string | undefined;
|
|
25
|
+
limit?: number | undefined;
|
|
26
|
+
order?: "asc" | "desc" | undefined;
|
|
27
|
+
sort?: string | undefined;
|
|
28
|
+
ids?: string[] | undefined;
|
|
29
|
+
begin_time?: string | undefined;
|
|
30
|
+
end_time?: string | undefined;
|
|
31
|
+
}>, z.ZodObject<{
|
|
32
|
+
action: z.ZodLiteral<"get">;
|
|
33
|
+
external_product_id: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
action: "get";
|
|
36
|
+
external_product_id: string;
|
|
37
|
+
}, {
|
|
38
|
+
action: "get";
|
|
39
|
+
external_product_id: string;
|
|
40
|
+
}>, z.ZodObject<{
|
|
41
|
+
action: z.ZodLiteral<"list_references">;
|
|
42
|
+
external_product_id: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
|
|
43
|
+
} & {
|
|
44
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
46
|
+
sort: z.ZodOptional<z.ZodString>;
|
|
47
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
48
|
+
ids: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
49
|
+
begin_time: z.ZodOptional<z.ZodString>;
|
|
50
|
+
end_time: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
action: "list_references";
|
|
53
|
+
external_product_id: string;
|
|
54
|
+
cursor?: string | undefined;
|
|
55
|
+
limit?: number | undefined;
|
|
56
|
+
order?: "asc" | "desc" | undefined;
|
|
57
|
+
sort?: string | undefined;
|
|
58
|
+
ids?: string[] | undefined;
|
|
59
|
+
begin_time?: string | undefined;
|
|
60
|
+
end_time?: string | undefined;
|
|
61
|
+
}, {
|
|
62
|
+
action: "list_references";
|
|
63
|
+
external_product_id: string;
|
|
64
|
+
cursor?: string | undefined;
|
|
65
|
+
limit?: number | undefined;
|
|
66
|
+
order?: "asc" | "desc" | undefined;
|
|
67
|
+
sort?: string | undefined;
|
|
68
|
+
ids?: string[] | undefined;
|
|
69
|
+
begin_time?: string | undefined;
|
|
70
|
+
end_time?: string | undefined;
|
|
71
|
+
}>, z.ZodObject<{
|
|
72
|
+
action: z.ZodLiteral<"get_reference">;
|
|
73
|
+
external_product_id: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
|
|
74
|
+
external_product_reference_id: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
action: "get_reference";
|
|
77
|
+
external_product_id: string;
|
|
78
|
+
external_product_reference_id: string;
|
|
79
|
+
}, {
|
|
80
|
+
action: "get_reference";
|
|
81
|
+
external_product_id: string;
|
|
82
|
+
external_product_reference_id: string;
|
|
83
|
+
}>]>;
|
|
84
|
+
export declare const externalProductsTool: ToolDefinition<typeof inputSchema>;
|
|
85
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { enc, fetchList, idParam, listParamsSchema } from './shared.js';
|
|
3
|
+
const externalProductId = idParam('external_product_id');
|
|
4
|
+
const inputSchema = z.discriminatedUnion('action', [
|
|
5
|
+
z.object({ action: z.literal('list') }).merge(listParamsSchema),
|
|
6
|
+
z.object({ action: z.literal('get'), external_product_id: externalProductId }),
|
|
7
|
+
z
|
|
8
|
+
.object({ action: z.literal('list_references'), external_product_id: externalProductId })
|
|
9
|
+
.merge(listParamsSchema),
|
|
10
|
+
z.object({
|
|
11
|
+
action: z.literal('get_reference'),
|
|
12
|
+
external_product_id: externalProductId,
|
|
13
|
+
external_product_reference_id: idParam('external_product_reference_id'),
|
|
14
|
+
}),
|
|
15
|
+
]);
|
|
16
|
+
export const externalProductsTool = {
|
|
17
|
+
name: 'recurly_external_products',
|
|
18
|
+
description: 'Recurly external products (read-only) — products from external app stores (Apple App Store, Google Play). Actions: list, get, list_references (external product references), get_reference. Returns raw Recurly JSON; list actions add a _pagination cursor hint.',
|
|
19
|
+
inputSchema,
|
|
20
|
+
handler: async (ctx, input) => {
|
|
21
|
+
const parsed = inputSchema.parse(input);
|
|
22
|
+
switch (parsed.action) {
|
|
23
|
+
case 'list':
|
|
24
|
+
return fetchList(ctx, '/external_products', parsed);
|
|
25
|
+
case 'get':
|
|
26
|
+
return ctx.client.request('GET', `/external_products/${enc(parsed.external_product_id)}`);
|
|
27
|
+
case 'list_references':
|
|
28
|
+
return fetchList(ctx, `/external_products/${enc(parsed.external_product_id)}/external_product_references`, parsed, ['external_product_id']);
|
|
29
|
+
case 'get_reference':
|
|
30
|
+
return ctx.client.request('GET', `/external_products/${enc(parsed.external_product_id)}/external_product_references/${enc(parsed.external_product_reference_id)}`);
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=externalProducts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"externalProducts.js","sourceRoot":"","sources":["../../src/tools/externalProducts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGxE,MAAM,iBAAiB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAEzD,MAAM,WAAW,GAAG,CAAC,CAAC,kBAAkB,CAAC,QAAQ,EAAE;IACjD,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC;IAC/D,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,CAAC;IAC9E,CAAC;SACE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,CAAC;SACxF,KAAK,CAAC,gBAAgB,CAAC;IAC1B,CAAC,CAAC,MAAM,CAAC;QACP,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;QAClC,mBAAmB,EAAE,iBAAiB;QACtC,6BAA6B,EAAE,OAAO,CAAC,+BAA+B,CAAC;KACxE,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAuC;IACtE,IAAI,EAAE,2BAA2B;IACjC,WAAW,EACT,mQAAmQ;IACrQ,WAAW;IACX,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE;QAC5B,MAAM,MAAM,GAAG,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACxC,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;YACtB,KAAK,MAAM;gBACT,OAAO,SAAS,CAAC,GAAG,EAAE,oBAAoB,EAAE,MAAM,CAAC,CAAC;YACtD,KAAK,KAAK;gBACR,OAAO,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,sBAAsB,GAAG,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC;YAC5F,KAAK,iBAAiB;gBACpB,OAAO,SAAS,CACd,GAAG,EACH,sBAAsB,GAAG,CAAC,MAAM,CAAC,mBAAmB,CAAC,8BAA8B,EACnF,MAAM,EACN,CAAC,qBAAqB,CAAC,CACxB,CAAC;YACJ,KAAK,eAAe;gBAClB,OAAO,GAAG,CAAC,MAAM,CAAC,OAAO,CACvB,KAAK,EACL,sBAAsB,GAAG,CAAC,MAAM,CAAC,mBAAmB,CAAC,gCAAgC,GAAG,CAAC,MAAM,CAAC,6BAA6B,CAAC,EAAE,CACjI,CAAC;QACN,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ToolDefinition } from './types.js';
|
|
3
|
+
declare const inputSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
|
|
4
|
+
action: z.ZodLiteral<"list">;
|
|
5
|
+
} & {
|
|
6
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
8
|
+
sort: z.ZodOptional<z.ZodString>;
|
|
9
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
10
|
+
ids: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
11
|
+
begin_time: z.ZodOptional<z.ZodString>;
|
|
12
|
+
end_time: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
action: "list";
|
|
15
|
+
cursor?: string | undefined;
|
|
16
|
+
limit?: number | undefined;
|
|
17
|
+
order?: "asc" | "desc" | undefined;
|
|
18
|
+
sort?: string | undefined;
|
|
19
|
+
ids?: string[] | undefined;
|
|
20
|
+
begin_time?: string | undefined;
|
|
21
|
+
end_time?: string | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
action: "list";
|
|
24
|
+
cursor?: string | undefined;
|
|
25
|
+
limit?: number | undefined;
|
|
26
|
+
order?: "asc" | "desc" | undefined;
|
|
27
|
+
sort?: string | undefined;
|
|
28
|
+
ids?: string[] | undefined;
|
|
29
|
+
begin_time?: string | undefined;
|
|
30
|
+
end_time?: string | undefined;
|
|
31
|
+
}>, z.ZodObject<{
|
|
32
|
+
action: z.ZodLiteral<"get">;
|
|
33
|
+
external_subscription_id: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
action: "get";
|
|
36
|
+
external_subscription_id: string;
|
|
37
|
+
}, {
|
|
38
|
+
action: "get";
|
|
39
|
+
external_subscription_id: string;
|
|
40
|
+
}>, z.ZodObject<{
|
|
41
|
+
action: z.ZodLiteral<"list_invoices">;
|
|
42
|
+
external_subscription_id: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
|
|
43
|
+
} & {
|
|
44
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
46
|
+
sort: z.ZodOptional<z.ZodString>;
|
|
47
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
48
|
+
ids: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
49
|
+
begin_time: z.ZodOptional<z.ZodString>;
|
|
50
|
+
end_time: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
action: "list_invoices";
|
|
53
|
+
external_subscription_id: string;
|
|
54
|
+
cursor?: string | undefined;
|
|
55
|
+
limit?: number | undefined;
|
|
56
|
+
order?: "asc" | "desc" | undefined;
|
|
57
|
+
sort?: string | undefined;
|
|
58
|
+
ids?: string[] | undefined;
|
|
59
|
+
begin_time?: string | undefined;
|
|
60
|
+
end_time?: string | undefined;
|
|
61
|
+
}, {
|
|
62
|
+
action: "list_invoices";
|
|
63
|
+
external_subscription_id: string;
|
|
64
|
+
cursor?: string | undefined;
|
|
65
|
+
limit?: number | undefined;
|
|
66
|
+
order?: "asc" | "desc" | undefined;
|
|
67
|
+
sort?: string | undefined;
|
|
68
|
+
ids?: string[] | undefined;
|
|
69
|
+
begin_time?: string | undefined;
|
|
70
|
+
end_time?: string | undefined;
|
|
71
|
+
}>, z.ZodObject<{
|
|
72
|
+
action: z.ZodLiteral<"list_payment_phases">;
|
|
73
|
+
external_subscription_id: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
|
|
74
|
+
} & {
|
|
75
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
76
|
+
order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
77
|
+
sort: z.ZodOptional<z.ZodString>;
|
|
78
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
79
|
+
ids: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
80
|
+
begin_time: z.ZodOptional<z.ZodString>;
|
|
81
|
+
end_time: z.ZodOptional<z.ZodString>;
|
|
82
|
+
}, "strip", z.ZodTypeAny, {
|
|
83
|
+
action: "list_payment_phases";
|
|
84
|
+
external_subscription_id: string;
|
|
85
|
+
cursor?: string | undefined;
|
|
86
|
+
limit?: number | undefined;
|
|
87
|
+
order?: "asc" | "desc" | undefined;
|
|
88
|
+
sort?: string | undefined;
|
|
89
|
+
ids?: string[] | undefined;
|
|
90
|
+
begin_time?: string | undefined;
|
|
91
|
+
end_time?: string | undefined;
|
|
92
|
+
}, {
|
|
93
|
+
action: "list_payment_phases";
|
|
94
|
+
external_subscription_id: string;
|
|
95
|
+
cursor?: string | undefined;
|
|
96
|
+
limit?: number | undefined;
|
|
97
|
+
order?: "asc" | "desc" | undefined;
|
|
98
|
+
sort?: string | undefined;
|
|
99
|
+
ids?: string[] | undefined;
|
|
100
|
+
begin_time?: string | undefined;
|
|
101
|
+
end_time?: string | undefined;
|
|
102
|
+
}>, z.ZodObject<{
|
|
103
|
+
action: z.ZodLiteral<"get_payment_phase">;
|
|
104
|
+
external_subscription_id: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
|
|
105
|
+
external_payment_phase_id: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
|
|
106
|
+
}, "strip", z.ZodTypeAny, {
|
|
107
|
+
action: "get_payment_phase";
|
|
108
|
+
external_subscription_id: string;
|
|
109
|
+
external_payment_phase_id: string;
|
|
110
|
+
}, {
|
|
111
|
+
action: "get_payment_phase";
|
|
112
|
+
external_subscription_id: string;
|
|
113
|
+
external_payment_phase_id: string;
|
|
114
|
+
}>, z.ZodObject<{
|
|
115
|
+
action: z.ZodLiteral<"list_for_account">;
|
|
116
|
+
account_id: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
|
|
117
|
+
} & {
|
|
118
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
119
|
+
order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
120
|
+
sort: z.ZodOptional<z.ZodString>;
|
|
121
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
122
|
+
ids: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
123
|
+
begin_time: z.ZodOptional<z.ZodString>;
|
|
124
|
+
end_time: z.ZodOptional<z.ZodString>;
|
|
125
|
+
}, "strip", z.ZodTypeAny, {
|
|
126
|
+
action: "list_for_account";
|
|
127
|
+
account_id: string;
|
|
128
|
+
cursor?: string | undefined;
|
|
129
|
+
limit?: number | undefined;
|
|
130
|
+
order?: "asc" | "desc" | undefined;
|
|
131
|
+
sort?: string | undefined;
|
|
132
|
+
ids?: string[] | undefined;
|
|
133
|
+
begin_time?: string | undefined;
|
|
134
|
+
end_time?: string | undefined;
|
|
135
|
+
}, {
|
|
136
|
+
action: "list_for_account";
|
|
137
|
+
account_id: string;
|
|
138
|
+
cursor?: string | undefined;
|
|
139
|
+
limit?: number | undefined;
|
|
140
|
+
order?: "asc" | "desc" | undefined;
|
|
141
|
+
sort?: string | undefined;
|
|
142
|
+
ids?: string[] | undefined;
|
|
143
|
+
begin_time?: string | undefined;
|
|
144
|
+
end_time?: string | undefined;
|
|
145
|
+
}>]>;
|
|
146
|
+
export declare const externalSubscriptionsTool: ToolDefinition<typeof inputSchema>;
|
|
147
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { enc, fetchList, idParam, listParamsSchema } from './shared.js';
|
|
3
|
+
const externalSubscriptionId = idParam('external_subscription_id');
|
|
4
|
+
const inputSchema = z.discriminatedUnion('action', [
|
|
5
|
+
z.object({ action: z.literal('list') }).merge(listParamsSchema),
|
|
6
|
+
z.object({ action: z.literal('get'), external_subscription_id: externalSubscriptionId }),
|
|
7
|
+
z
|
|
8
|
+
.object({ action: z.literal('list_invoices'), external_subscription_id: externalSubscriptionId })
|
|
9
|
+
.merge(listParamsSchema),
|
|
10
|
+
z
|
|
11
|
+
.object({
|
|
12
|
+
action: z.literal('list_payment_phases'),
|
|
13
|
+
external_subscription_id: externalSubscriptionId,
|
|
14
|
+
})
|
|
15
|
+
.merge(listParamsSchema),
|
|
16
|
+
z.object({
|
|
17
|
+
action: z.literal('get_payment_phase'),
|
|
18
|
+
external_subscription_id: externalSubscriptionId,
|
|
19
|
+
external_payment_phase_id: idParam('external_payment_phase_id'),
|
|
20
|
+
}),
|
|
21
|
+
z
|
|
22
|
+
.object({ action: z.literal('list_for_account'), account_id: idParam('account_id') })
|
|
23
|
+
.merge(listParamsSchema),
|
|
24
|
+
]);
|
|
25
|
+
export const externalSubscriptionsTool = {
|
|
26
|
+
name: 'recurly_external_subscriptions',
|
|
27
|
+
description: 'Recurly external subscriptions (read-only) — subscriptions managed in external app stores. Actions: list, get, list_invoices (external invoices for the subscription), list_payment_phases, get_payment_phase, list_for_account. Returns raw Recurly JSON; list actions add a _pagination cursor hint.',
|
|
28
|
+
inputSchema,
|
|
29
|
+
handler: async (ctx, input) => {
|
|
30
|
+
const parsed = inputSchema.parse(input);
|
|
31
|
+
switch (parsed.action) {
|
|
32
|
+
case 'list':
|
|
33
|
+
return fetchList(ctx, '/external_subscriptions', parsed);
|
|
34
|
+
case 'get':
|
|
35
|
+
return ctx.client.request('GET', `/external_subscriptions/${enc(parsed.external_subscription_id)}`);
|
|
36
|
+
case 'list_invoices':
|
|
37
|
+
return fetchList(ctx, `/external_subscriptions/${enc(parsed.external_subscription_id)}/external_invoices`, parsed, ['external_subscription_id']);
|
|
38
|
+
case 'list_payment_phases':
|
|
39
|
+
return fetchList(ctx, `/external_subscriptions/${enc(parsed.external_subscription_id)}/external_payment_phases`, parsed, ['external_subscription_id']);
|
|
40
|
+
case 'get_payment_phase':
|
|
41
|
+
return ctx.client.request('GET', `/external_subscriptions/${enc(parsed.external_subscription_id)}/external_payment_phases/${enc(parsed.external_payment_phase_id)}`);
|
|
42
|
+
case 'list_for_account':
|
|
43
|
+
return fetchList(ctx, `/accounts/${enc(parsed.account_id)}/external_subscriptions`, parsed, ['account_id']);
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=externalSubscriptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"externalSubscriptions.js","sourceRoot":"","sources":["../../src/tools/externalSubscriptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGxE,MAAM,sBAAsB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAEnE,MAAM,WAAW,GAAG,CAAC,CAAC,kBAAkB,CAAC,QAAQ,EAAE;IACjD,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC;IAC/D,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,CAAC;IACxF,CAAC;SACE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,CAAC;SAChG,KAAK,CAAC,gBAAgB,CAAC;IAC1B,CAAC;SACE,MAAM,CAAC;QACN,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,qBAAqB,CAAC;QACxC,wBAAwB,EAAE,sBAAsB;KACjD,CAAC;SACD,KAAK,CAAC,gBAAgB,CAAC;IAC1B,CAAC,CAAC,MAAM,CAAC;QACP,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC;QACtC,wBAAwB,EAAE,sBAAsB;QAChD,yBAAyB,EAAE,OAAO,CAAC,2BAA2B,CAAC;KAChE,CAAC;IACF,CAAC;SACE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;SACpF,KAAK,CAAC,gBAAgB,CAAC;CAC3B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,yBAAyB,GAAuC;IAC3E,IAAI,EAAE,gCAAgC;IACtC,WAAW,EACT,wSAAwS;IAC1S,WAAW;IACX,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE;QAC5B,MAAM,MAAM,GAAG,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACxC,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;YACtB,KAAK,MAAM;gBACT,OAAO,SAAS,CAAC,GAAG,EAAE,yBAAyB,EAAE,MAAM,CAAC,CAAC;YAC3D,KAAK,KAAK;gBACR,OAAO,GAAG,CAAC,MAAM,CAAC,OAAO,CACvB,KAAK,EACL,2BAA2B,GAAG,CAAC,MAAM,CAAC,wBAAwB,CAAC,EAAE,CAClE,CAAC;YACJ,KAAK,eAAe;gBAClB,OAAO,SAAS,CACd,GAAG,EACH,2BAA2B,GAAG,CAAC,MAAM,CAAC,wBAAwB,CAAC,oBAAoB,EACnF,MAAM,EACN,CAAC,0BAA0B,CAAC,CAC7B,CAAC;YACJ,KAAK,qBAAqB;gBACxB,OAAO,SAAS,CACd,GAAG,EACH,2BAA2B,GAAG,CAAC,MAAM,CAAC,wBAAwB,CAAC,0BAA0B,EACzF,MAAM,EACN,CAAC,0BAA0B,CAAC,CAC7B,CAAC;YACJ,KAAK,mBAAmB;gBACtB,OAAO,GAAG,CAAC,MAAM,CAAC,OAAO,CACvB,KAAK,EACL,2BAA2B,GAAG,CAAC,MAAM,CAAC,wBAAwB,CAAC,4BAA4B,GAAG,CAAC,MAAM,CAAC,yBAAyB,CAAC,EAAE,CACnI,CAAC;YACJ,KAAK,kBAAkB;gBACrB,OAAO,SAAS,CACd,GAAG,EACH,aAAa,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,yBAAyB,EAC5D,MAAM,EACN,CAAC,YAAY,CAAC,CACf,CAAC;QACN,CAAC;IACH,CAAC;CACF,CAAC"}
|