@listmonk-ops/operations 0.1.2 → 0.1.3

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 CHANGED
@@ -3,10 +3,10 @@
3
3
  Shared, runtime-neutral operation contracts and executors used by the
4
4
  listmonk-ops CLI and MCP adapters.
5
5
 
6
- The initial registry covers subscriber-list CRUD. Each operation owns its
7
- runtime input/output schemas, generated JSON Schemas, safety hints, MCP name,
8
- and named executor. Each list operation also exports a named `invoke*Operation`
9
- entrypoint, while `invokeListOperationByMcpName` provides the shared MCP
10
- dispatcher. These functions preserve the registry validation and error contract
11
- while keeping CLI/MCP-to-domain call paths visible to static tooling. Surface
12
- packages remain responsible for authentication and presentation.
6
+ The registry covers subscriber-list CRUD and transactional email delivery. Each
7
+ operation owns its runtime input/output schemas, generated JSON Schemas, safety
8
+ hints, MCP name, and named executor. List and transactional operations export
9
+ named `invoke*Operation` entrypoints plus domain-specific MCP dispatchers. These
10
+ functions preserve the registry validation and error contract while keeping
11
+ CLI/MCP-to-domain call paths visible to static tooling. Surface packages remain
12
+ responsible for authentication and presentation.
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from "./lists";
2
2
  export * from "./operation";
3
+ export * from "./transactional";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC"}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{z as i}from"zod";import{z as $}from"zod";var O=class extends Error{constructor(e){super(e),this.name="OperationInputError"}},L=class extends Error{constructor(e){super(e),this.name="OperationOutputError"}},y=class extends Error{operationId;constructor(e,n){super(R(n),{cause:n}),this.name="OperationExecutionError",this.operationId=e}};function R(t){return t instanceof Error?t.message:t&&typeof t=="object"&&"message"in t?String(t.message):String(t)}function w(t,e){let n=$.toJSONSchema(t,{io:e});if(n.type!=="object")throw new TypeError("Operation schemas must have an object root");return n}function q(t,e){if(!t||typeof t!="object"||!(e in t))return!1;let n=Reflect.get(t,e);return n==null?!1:typeof n=="string"?n.trim().length>0:Array.isArray(n)?n.length>0:!0}function Z(t,e){let n=t.issues[0];if(!n)return"Invalid operation input";let r=n.path[0],s=n.path.map(String).join(".")||"input";return(typeof r=="string"||typeof r=="number")&&!q(e,r)?`Missing required parameter: ${String(r)}`:`Invalid parameter ${s}: ${n.message}`}function o(t,e){let n=t.safeParse(e??{});if(!n.success)throw new O(Z(n.error,e??{}));return n.data}function a(t,e){return e instanceof y?e:new y(t,e)}function p(t,e,n){let r=e.safeParse(n);if(!r.success)throw new L(`${t} produced invalid output: ${r.error.message}`);return r.data}function f(t){return{id:t.id,title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema,inputJsonSchema:w(t.inputSchema,"input"),outputJsonSchema:w(t.outputSchema,"output"),safety:t.safety,mcp:t.mcp,async invoke(e,n){let r=o(t.inputSchema,n),s;try{s=await t.execute(e,r)}catch(g){throw a(t.id,g)}return p(t.id,t.outputSchema,s)}}}var S=i.looseObject({id:i.number().optional(),created_at:i.string().optional(),updated_at:i.string().optional(),uuid:i.string().optional(),name:i.string().optional(),type:i.string().optional(),optin:i.string().optional(),tags:i.array(i.string()).optional(),subscriber_count:i.number().optional(),description:i.string().optional()}),F=i.object({results:i.array(S),total:i.number(),per_page:i.number(),page:i.number()}),N=i.object({page:i.coerce.number().int().positive().default(1).describe("Page number for pagination"),per_page:i.coerce.number().int().positive().default(20).describe("Number of items per page")}),I=i.number().int().positive(),k=i.codec(i.union([I,i.string().regex(/^[1-9][0-9]*$/)]),I,{decode:t=>Number(t),encode:t=>t}).describe("Subscriber list ID"),v=i.object({id:k}),G=i.object({name:i.string().trim().min(1).describe("List name"),type:i.enum(["public","private"]).default("private").describe("List visibility"),optin:i.enum(["single","double"]).default("single").describe("Opt-in type"),description:i.string().default("").describe("List description"),tags:i.array(i.string()).default([]).describe("List tags")}),W=i.object({id:k,name:i.string().trim().min(1).optional().describe("List name"),type:i.enum(["public","private"]).optional().describe("List visibility"),optin:i.enum(["single","double"]).optional().describe("Opt-in type"),description:i.string().optional().describe("List description"),tags:i.array(i.string()).optional().describe("List tags")}),B=i.object({id:i.number().int().positive(),deleted:i.boolean()});function z(t){if(t instanceof Error)return t.message;if(t&&typeof t=="object"){if("message"in t&&typeof t.message=="string")return t.message;if("error"in t&&typeof t.error=="string")return t.error;try{return JSON.stringify(t)}catch{}}return String(t)}function P(t){return t.error!==void 0}function h(t,e){if(P(t))throw new Error(`${e}: ${z(t.error)}`);if(t.data===void 0)throw new Error(`${e}: received empty data`);return t.data}async function _({client:t},e){let n=await t.list.list({query:{page:e.page,per_page:e.per_page}}),r=h(n,"Failed to fetch lists");return{results:r.results??[],total:r.total??0,per_page:r.per_page??e.per_page,page:r.page??e.page}}async function C({client:t},e){let n=await t.list.getById({path:{list_id:e.id}});return h(n,"Failed to fetch list")}async function U(t,e){let r=await t.list.list({query:{page:1,per_page:100,query:e}}),s=h(r,"Failed to resolve created list"),g=s.results?.find(b=>b.name===e);if(g)return g;let M=Math.max(1,Math.ceil((s.total??0)/100));for(let b=2;b<=M;b+=1){let D=await t.list.list({query:{page:b,per_page:100,query:e}}),x=h(D,"Failed to resolve created list").results?.find(J=>J.name===e);if(x)return x}}async function j({client:t},e){let n=await t.list.create({body:{name:e.name,type:e.type,optin:e.optin,description:e.description,tags:e.tags}});if(P(n))throw new Error(`Failed to create list: ${z(n.error)}`);if(n.data!==void 0)return n.data;let r=await U(t,e.name);if(!r)throw new Error("List was created but the created record could not be resolved");return r}async function E({client:t},e){let{id:n,...r}=e,s=await t.list.update({path:{list_id:n},body:r});return h(s,"Failed to update list")}async function H({client:t},e){let n=await t.list.delete({path:{list_id:e.id}});return{id:e.id,deleted:h(n,"Failed to delete list")}}var T={readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},u=f({id:"lists.list",title:"List subscriber lists",description:"Get subscriber lists from Listmonk",inputSchema:N,outputSchema:F,safety:T,mcp:{name:"listmonk_get_lists"},execute:_}),c=f({id:"lists.get",title:"Get subscriber list",description:"Get a specific subscriber list by ID",inputSchema:v,outputSchema:S,safety:T,mcp:{name:"listmonk_get_list"},execute:C}),d=f({id:"lists.create",title:"Create subscriber list",description:"Create a new subscriber list",inputSchema:G,outputSchema:S,safety:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0},mcp:{name:"listmonk_create_list"},execute:j}),m=f({id:"lists.update",title:"Update subscriber list",description:"Update an existing subscriber list",inputSchema:W,outputSchema:S,safety:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!0},mcp:{name:"listmonk_update_list",legacySuccessText:"List updated successfully"},execute:E}),l=f({id:"lists.delete",title:"Delete subscriber list",description:"Delete a subscriber list",inputSchema:v,outputSchema:B,safety:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!0},mcp:{name:"listmonk_delete_list",legacySuccessText:"List deleted successfully"},execute:H});async function A(t,e){let n=o(u.inputSchema,e),r;try{r=await _(t,n)}catch(s){throw a(u.id,s)}return p(u.id,u.outputSchema,r)}async function K(t,e){let n=o(c.inputSchema,e),r;try{r=await C(t,n)}catch(s){throw a(c.id,s)}return p(c.id,c.outputSchema,r)}async function V(t,e){let n=o(d.inputSchema,e),r;try{r=await j(t,n)}catch(s){throw a(d.id,s)}return p(d.id,d.outputSchema,r)}async function Q(t,e){let n=o(m.inputSchema,e),r;try{r=await E(t,n)}catch(s){throw a(m.id,s)}return p(m.id,m.outputSchema,r)}async function X(t,e){let n=o(l.inputSchema,e),r;try{r=await H(t,n)}catch(s){throw a(l.id,s)}return p(l.id,l.outputSchema,r)}var Y=[u,c,d,m,l],tt=new Map(Y.map(t=>[t.mcp.name,t]));function ot(t){return tt.get(t)}async function at(t,e,n){switch(e){case u.mcp.name:return{operation:u,output:await A(t,n)};case c.mcp.name:return{operation:c,output:await K(t,n)};case d.mcp.name:return{operation:d,output:await V(t,n)};case m.mcp.name:return{operation:m,output:await Q(t,n)};case l.mcp.name:return{operation:l,output:await X(t,n)};default:return}}export{y as OperationExecutionError,O as OperationInputError,L as OperationOutputError,d as createListOperation,j as createSubscriberList,f as defineOperation,l as deleteListOperation,H as deleteSubscriberList,c as getListOperation,ot as getListOperationByMcpName,u as getListsOperation,C as getSubscriberList,V as invokeCreateListOperation,X as invokeDeleteListOperation,K as invokeGetListOperation,A as invokeGetListsOperation,at as invokeListOperationByMcpName,Q as invokeUpdateListOperation,Y as listOperations,_ as listSubscriberLists,a as normalizeOperationExecutionError,o as parseOperationInput,p as parseOperationOutput,m as updateListOperation,E as updateSubscriberList};
1
+ import{z as i}from"zod";import{z as Z}from"zod";var L=class extends Error{constructor(e){super(e),this.name="OperationInputError"}},w=class extends Error{constructor(e){super(e),this.name="OperationOutputError"}},O=class extends Error{operationId;constructor(e,n){super(W(n),{cause:n}),this.name="OperationExecutionError",this.operationId=e}};function W(t){return t instanceof Error?t.message:t&&typeof t=="object"&&"message"in t?String(t.message):String(t)}function k(t,e){let n=Z.toJSONSchema(t,{io:e});if(n.type!=="object")throw new TypeError("Operation schemas must have an object root");return n}function B(t,e){if(!t||typeof t!="object"||!(e in t))return!1;let n=Reflect.get(t,e);return n==null?!1:typeof n=="string"?n.trim().length>0:Array.isArray(n)?n.length>0:!0}function G(t,e){let n=t.issues[0];if(!n)return"Invalid operation input";let r=n.path[0],a=n.path.map(String).join(".")||"input";return(typeof r=="string"||typeof r=="number")&&!B(e,r)?`Missing required parameter: ${String(r)}`:`Invalid parameter ${a}: ${n.message}`}function s(t,e){let n=t.safeParse(e??{});if(!n.success)throw new L(G(n.error,e??{}));return n.data}function p(t,e){return e instanceof O?e:new O(t,e)}function u(t,e,n){let r=e.safeParse(n);if(!r.success)throw new w(`${t} produced invalid output: ${r.error.message}`);return r.data}function d(t){return{id:t.id,title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema,inputJsonSchema:k(t.inputSchema,"input"),outputJsonSchema:k(t.outputSchema,"output"),safety:t.safety,mcp:t.mcp,async invoke(e,n){let r=s(t.inputSchema,n),a;try{a=await t.execute(e,r)}catch(S){throw p(t.id,S)}return u(t.id,t.outputSchema,a)}}}var x=i.looseObject({id:i.number().optional(),created_at:i.string().optional(),updated_at:i.string().optional(),uuid:i.string().optional(),name:i.string().optional(),type:i.string().optional(),optin:i.string().optional(),tags:i.array(i.string()).optional(),subscriber_count:i.number().optional(),description:i.string().optional()}),A=i.object({results:i.array(x),total:i.number(),per_page:i.number(),page:i.number()}),U=i.object({page:i.coerce.number().int().positive().default(1).describe("Page number for pagination"),per_page:i.coerce.number().int().positive().default(20).describe("Number of items per page")}),T=i.number().int().positive(),_=i.codec(i.union([T,i.string().regex(/^[1-9][0-9]*$/)]),T,{decode:t=>Number(t),encode:t=>t}).describe("Subscriber list ID"),v=i.object({id:_}),K=i.object({name:i.string().trim().min(1).describe("List name"),type:i.enum(["public","private"]).default("private").describe("List visibility"),optin:i.enum(["single","double"]).default("single").describe("Opt-in type"),description:i.string().default("").describe("List description"),tags:i.array(i.string()).default([]).describe("List tags")}),V=i.object({id:_,name:i.string().trim().min(1).optional().describe("List name"),type:i.enum(["public","private"]).optional().describe("List visibility"),optin:i.enum(["single","double"]).optional().describe("Opt-in type"),description:i.string().optional().describe("List description"),tags:i.array(i.string()).optional().describe("List tags")}),Q=i.object({id:i.number().int().positive(),deleted:i.boolean()});function z(t){if(t instanceof Error)return t.message;if(t&&typeof t=="object"){if("message"in t&&typeof t.message=="string")return t.message;if("error"in t&&typeof t.error=="string")return t.error;try{return JSON.stringify(t)}catch{}}return String(t)}function C(t){return t.error!==void 0}function g(t,e){if(C(t))throw new Error(`${e}: ${z(t.error)}`);if(t.data===void 0)throw new Error(`${e}: received empty data`);return t.data}async function P({client:t},e){let n=await t.list.list({query:{page:e.page,per_page:e.per_page}}),r=g(n,"Failed to fetch lists");return{results:r.results??[],total:r.total??0,per_page:r.per_page??e.per_page,page:r.page??e.page}}async function E({client:t},e){let n=await t.list.getById({path:{list_id:e.id}});return g(n,"Failed to fetch list")}async function X(t,e){let r=await t.list.list({query:{page:1,per_page:100,query:e}}),a=g(r,"Failed to resolve created list"),S=a.results?.find(y=>y.name===e);if(S)return S;let N=Math.max(1,Math.ceil((a.total??0)/100));for(let y=2;y<=N;y+=1){let q=await t.list.list({query:{page:y,per_page:100,query:e}}),I=g(q,"Failed to resolve created list").results?.find(F=>F.name===e);if(I)return I}}async function j({client:t},e){let n=await t.list.create({body:{name:e.name,type:e.type,optin:e.optin,description:e.description,tags:e.tags}});if(C(n))throw new Error(`Failed to create list: ${z(n.error)}`);if(n.data!==void 0)return n.data;let r=await X(t,e.name);if(!r)throw new Error("List was created but the created record could not be resolved");return r}async function H({client:t},e){let{id:n,...r}=e,a=await t.list.update({path:{list_id:n},body:r});return g(a,"Failed to update list")}async function M({client:t},e){let n=await t.list.delete({path:{list_id:e.id}});return{id:e.id,deleted:g(n,"Failed to delete list")}}var D={readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},m=d({id:"lists.list",title:"List subscriber lists",description:"Get subscriber lists from Listmonk",inputSchema:U,outputSchema:A,safety:D,mcp:{name:"listmonk_get_lists"},execute:P}),l=d({id:"lists.get",title:"Get subscriber list",description:"Get a specific subscriber list by ID",inputSchema:v,outputSchema:x,safety:D,mcp:{name:"listmonk_get_list"},execute:E}),f=d({id:"lists.create",title:"Create subscriber list",description:"Create a new subscriber list",inputSchema:K,outputSchema:x,safety:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0},mcp:{name:"listmonk_create_list"},execute:j}),h=d({id:"lists.update",title:"Update subscriber list",description:"Update an existing subscriber list",inputSchema:V,outputSchema:x,safety:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!0},mcp:{name:"listmonk_update_list",legacySuccessText:"List updated successfully"},execute:H}),b=d({id:"lists.delete",title:"Delete subscriber list",description:"Delete a subscriber list",inputSchema:v,outputSchema:Q,safety:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!0},mcp:{name:"listmonk_delete_list",legacySuccessText:"List deleted successfully"},execute:M});async function Y(t,e){let n=s(m.inputSchema,e),r;try{r=await P(t,n)}catch(a){throw p(m.id,a)}return u(m.id,m.outputSchema,r)}async function tt(t,e){let n=s(l.inputSchema,e),r;try{r=await E(t,n)}catch(a){throw p(l.id,a)}return u(l.id,l.outputSchema,r)}async function et(t,e){let n=s(f.inputSchema,e),r;try{r=await j(t,n)}catch(a){throw p(f.id,a)}return u(f.id,f.outputSchema,r)}async function nt(t,e){let n=s(h.inputSchema,e),r;try{r=await H(t,n)}catch(a){throw p(h.id,a)}return u(h.id,h.outputSchema,r)}async function it(t,e){let n=s(b.inputSchema,e),r;try{r=await M(t,n)}catch(a){throw p(b.id,a)}return u(b.id,b.outputSchema,r)}var rt=[m,l,f,h,b],at=new Map(rt.map(t=>[t.mcp.name,t]));function bt(t){return at.get(t)}async function gt(t,e,n){switch(e){case m.mcp.name:return{operation:m,output:await Y(t,n)};case l.mcp.name:return{operation:l,output:await tt(t,n)};case f.mcp.name:return{operation:f,output:await et(t,n)};case h.mcp.name:return{operation:h,output:await nt(t,n)};case b.mcp.name:return{operation:b,output:await it(t,n)};default:return}}import{z as o}from"zod";var $=o.number().int().positive(),R=o.codec(o.union([$,o.string().regex(/^[1-9][0-9]*$/)]),$,{decode:t=>Number(t),encode:t=>t}),ot=o.object({template_id:R.describe("Transactional template ID"),subscriber_email:o.string().trim().email().optional().describe("Recipient subscriber email"),subscriber_id:R.optional().describe("Recipient subscriber ID"),from_email:o.string().trim().min(1).optional().describe("From email header value"),data:o.record(o.string(),o.unknown()).optional().describe("Template variables"),headers:o.array(o.record(o.string(),o.string())).optional().describe("Additional email headers"),content_type:o.enum(["html","markdown","plain"]).optional().describe("Message content type")}).refine(t=>t.subscriber_email!==void 0||t.subscriber_id!==void 0,{message:"Either subscriber_email or subscriber_id is required"}),st=o.object({sent:o.boolean().describe("Whether Listmonk accepted the message")});function pt(t){if(t instanceof Error)return t.message;if(t&&typeof t=="object"){if("message"in t&&typeof t.message=="string")return t.message;if("error"in t&&typeof t.error=="string")return t.error;try{return JSON.stringify(t)}catch{}}return String(t)}function ut(t,e){if(t.error!==void 0)throw new Error(`${e}: ${pt(t.error)}`);if(t.data===void 0)throw new Error(`${e}: received empty data`);return t.data}async function J({client:t},e){let n=await t.transactional.send({template_id:e.template_id,subscriber_email:e.subscriber_email,subscriber_id:e.subscriber_id,from_email:e.from_email,data:e.data,headers:e.headers,content_type:e.content_type});return{sent:ut(n,"Failed to send transactional message")}}var c=d({id:"transactional.send",title:"Send transactional message",description:"Send a transactional email through Listmonk",inputSchema:ot,outputSchema:st,safety:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0},mcp:{name:"listmonk_send_transactional"},execute:J});async function ct(t,e){let n=s(c.inputSchema,e),r;try{r=await J(t,n)}catch(a){throw p(c.id,a)}return u(c.id,c.outputSchema,r)}var xt=[c];function Lt(t){return t===c.mcp.name?c:void 0}async function wt(t,e,n){if(e===c.mcp.name)return{operation:c,output:await ct(t,n)}}export{O as OperationExecutionError,L as OperationInputError,w as OperationOutputError,f as createListOperation,j as createSubscriberList,d as defineOperation,b as deleteListOperation,M as deleteSubscriberList,l as getListOperation,bt as getListOperationByMcpName,m as getListsOperation,E as getSubscriberList,Lt as getTransactionalOperationByMcpName,et as invokeCreateListOperation,it as invokeDeleteListOperation,tt as invokeGetListOperation,Y as invokeGetListsOperation,gt as invokeListOperationByMcpName,ct as invokeSendTransactionalOperation,wt as invokeTransactionalOperationByMcpName,nt as invokeUpdateListOperation,rt as listOperations,P as listSubscriberLists,p as normalizeOperationExecutionError,s as parseOperationInput,u as parseOperationOutput,J as sendTransactionalMessage,c as sendTransactionalOperation,xt as transactionalOperations,h as updateListOperation,H as updateSubscriberList};
@@ -0,0 +1,64 @@
1
+ import type { ListmonkClient } from "@listmonk-ops/openapi";
2
+ import { z } from "zod";
3
+ export interface TransactionalOperationContext {
4
+ client: Pick<ListmonkClient, "transactional">;
5
+ }
6
+ declare const sendTransactionalInputSchema: z.ZodObject<{
7
+ template_id: z.ZodCodec<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodNumber>;
8
+ subscriber_email: z.ZodOptional<z.ZodString>;
9
+ subscriber_id: z.ZodOptional<z.ZodCodec<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodNumber>>;
10
+ from_email: z.ZodOptional<z.ZodString>;
11
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
12
+ headers: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodString>>>;
13
+ content_type: z.ZodOptional<z.ZodEnum<{
14
+ html: "html";
15
+ markdown: "markdown";
16
+ plain: "plain";
17
+ }>>;
18
+ }, z.core.$strip>;
19
+ declare const sendTransactionalOutputSchema: z.ZodObject<{
20
+ sent: z.ZodBoolean;
21
+ }, z.core.$strip>;
22
+ export type SendTransactionalInput = z.input<typeof sendTransactionalInputSchema>;
23
+ export type SendTransactionalOutput = z.output<typeof sendTransactionalOutputSchema>;
24
+ export declare function sendTransactionalMessage({ client }: TransactionalOperationContext, input: z.output<typeof sendTransactionalInputSchema>): Promise<SendTransactionalOutput>;
25
+ export declare const sendTransactionalOperation: import("./operation").OperationDefinition<TransactionalOperationContext, z.ZodObject<{
26
+ template_id: z.ZodCodec<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodNumber>;
27
+ subscriber_email: z.ZodOptional<z.ZodString>;
28
+ subscriber_id: z.ZodOptional<z.ZodCodec<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodNumber>>;
29
+ from_email: z.ZodOptional<z.ZodString>;
30
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
31
+ headers: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodString>>>;
32
+ content_type: z.ZodOptional<z.ZodEnum<{
33
+ html: "html";
34
+ markdown: "markdown";
35
+ plain: "plain";
36
+ }>>;
37
+ }, z.core.$strip>, z.ZodObject<{
38
+ sent: z.ZodBoolean;
39
+ }, z.core.$strip>>;
40
+ export declare function invokeSendTransactionalOperation(context: TransactionalOperationContext, input: unknown): Promise<SendTransactionalOutput>;
41
+ export declare const transactionalOperations: readonly [import("./operation").OperationDefinition<TransactionalOperationContext, z.ZodObject<{
42
+ template_id: z.ZodCodec<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodNumber>;
43
+ subscriber_email: z.ZodOptional<z.ZodString>;
44
+ subscriber_id: z.ZodOptional<z.ZodCodec<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodNumber>>;
45
+ from_email: z.ZodOptional<z.ZodString>;
46
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
47
+ headers: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodString>>>;
48
+ content_type: z.ZodOptional<z.ZodEnum<{
49
+ html: "html";
50
+ markdown: "markdown";
51
+ plain: "plain";
52
+ }>>;
53
+ }, z.core.$strip>, z.ZodObject<{
54
+ sent: z.ZodBoolean;
55
+ }, z.core.$strip>>];
56
+ export type TransactionalOperation = (typeof transactionalOperations)[number];
57
+ export declare function getTransactionalOperationByMcpName(name: string): TransactionalOperation | undefined;
58
+ export interface TransactionalOperationInvocation {
59
+ operation: TransactionalOperation;
60
+ output: SendTransactionalOutput;
61
+ }
62
+ export declare function invokeTransactionalOperationByMcpName(context: TransactionalOperationContext, name: string, input: unknown): Promise<TransactionalOperationInvocation | undefined>;
63
+ export {};
64
+ //# sourceMappingURL=transactional.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transactional.d.ts","sourceRoot":"","sources":["../src/transactional.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,MAAM,WAAW,6BAA6B;IAC7C,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC;CAC9C;AAiBD,QAAA,MAAM,4BAA4B;;;;;;;;;;;;iBAmChC,CAAC;AAEH,QAAA,MAAM,6BAA6B;;iBAEjC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,4BAA4B,CACnC,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAC7C,OAAO,6BAA6B,CACpC,CAAC;AAgCF,wBAAsB,wBAAwB,CAC7C,EAAE,MAAM,EAAE,EAAE,6BAA6B,EACzC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,4BAA4B,CAAC,GAClD,OAAO,CAAC,uBAAuB,CAAC,CAclC;AAED,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;kBAcrC,CAAC;AAEH,wBAAsB,gCAAgC,CACrD,OAAO,EAAE,6BAA6B,EACtC,KAAK,EAAE,OAAO,GACZ,OAAO,CAAC,uBAAuB,CAAC,CAmBlC;AAED,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;mBAAwC,CAAC;AAE7E,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9E,wBAAgB,kCAAkC,CACjD,IAAI,EAAE,MAAM,GACV,sBAAsB,GAAG,SAAS,CAIpC;AAED,MAAM,WAAW,gCAAgC;IAChD,SAAS,EAAE,sBAAsB,CAAC;IAClC,MAAM,EAAE,uBAAuB,CAAC;CAChC;AAED,wBAAsB,qCAAqC,CAC1D,OAAO,EAAE,6BAA6B,EACtC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,GACZ,OAAO,CAAC,gCAAgC,GAAG,SAAS,CAAC,CAUvD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@listmonk-ops/operations",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "description": "Shared typed operations for listmonk-ops CLI and MCP adapters",
6
6
  "sideEffects": false,