@ez4/aws-topic 0.47.0 → 0.49.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/dist/main.cjs CHANGED
@@ -104,19 +104,19 @@ tags:ie}=o,ne=$e(e,p.name,o),pt=n.getDependencyFiles(p.file),{runtime:ct=v?.runt
104
104
  b.Runtime,architecture:st=v?.architecture??b.Architecture,logRetention:at=v?.logRetention??
105
105
  b.LogRetention,logLevel:mt=v?.logLevel??b.LogLevel,memory:ut=v?.memory??b.Memory,
106
106
  timeout:ft=b.Timeout,debug:St=o.debug,files:lt,vpc:yt}=c,gt=(0,Qe.createLogGroup)(
107
- t,{groupName:ne,retention:at,tags:ie});a=Y(t,n.role,gt,{functionName:ne,description:p.
108
- description,messageSchema:e.schema,context:e.context,variables:[o.variables,e.variables,
109
- c.variables],handler:{sourceFile:p.file,functionName:p.name,module:p.module,dependencies:pt},
110
- listener:s&&{functionName:s.name,sourceFile:s.file,module:s.module},architecture:st,
111
- logLevel:mt,runtime:ct,release:nt,timeout:ft,memory:ut,files:lt,debug:St,tags:ie,
112
- vpc:yt}),n.setServiceState(m,o,a)}q(t,r,a,{fromService:a.parameters.functionName});
113
- break}case F.TopicSubscriptionType.Queue:{let p=(0,re.getQueueState)(n,c.service,
114
- o);q(t,r,p,{fromService:p.parameters.queueName});break}}},"prepareSubscriptions"),
115
- _=i((t,e,r,o)=>{if(!o.role||!(0,te.isRoleState)(o.role))throw new N;let n=(0,I.isLinkedContextVpcRequired)(
116
- e.context);for(let c of e.subscriptions)switch(c.type){default:throw new Q.InvalidParameterError(
117
- u,"subscription not supported.");case F.TopicSubscriptionType.Lambda:{let p=ee(e,
118
- c.handler.name),s=(0,G.getFunctionState)(o,p,r);(0,I.linkServiceContext)(t,s.entryId,
119
- e.context),s.parameters.vpc||(s.parameters.vpc=n);break}case F.TopicSubscriptionType.
107
+ t,{groupName:ne,retention:at,tags:ie});a=Y(t,n.role,gt,{functionName:ne,messageSchema:e.
108
+ schema,description:p.summary??p.description,context:e.context,variables:[o.variables,
109
+ e.variables,c.variables],handler:{sourceFile:p.file,functionName:p.name,module:p.
110
+ module,dependencies:pt},listener:s&&{functionName:s.name,sourceFile:s.file,module:s.
111
+ module},architecture:st,logLevel:mt,runtime:ct,release:nt,timeout:ft,memory:ut,files:lt,
112
+ debug:St,tags:ie,vpc:yt}),n.setServiceState(m,o,a)}q(t,r,a,{fromService:a.parameters.
113
+ functionName});break}case F.TopicSubscriptionType.Queue:{let p=(0,re.getQueueState)(
114
+ n,c.service,o);q(t,r,p,{fromService:p.parameters.queueName});break}}},"prepareSu\
115
+ bscriptions"),_=i((t,e,r,o)=>{if(!o.role||!(0,te.isRoleState)(o.role))throw new N;
116
+ let n=(0,I.isLinkedContextVpcRequired)(e.context);for(let c of e.subscriptions)switch(c.
117
+ type){default:throw new Q.InvalidParameterError(u,"subscription not supported.");case F.TopicSubscriptionType.
118
+ Lambda:{let p=ee(e,c.handler.name),s=(0,G.getFunctionState)(o,p,r);(0,I.linkServiceContext)(
119
+ t,s.entryId,e.context),s.parameters.vpc||(s.parameters.vpc=n);break}case F.TopicSubscriptionType.
120
120
  Queue:{let p=(0,re.getQueueState)(o,c.service,r);(0,I.linkServiceContext)(t,p.entryId,
121
121
  e.context);break}}},"connectSubscriptions");var Ge=require("@ez4/project/library");var U=i((t,e,r)=>{let n=W(t,e.name,r).entryId,c=(0,Ge.getDefinitionName)(n,"topi\
122
122
  cArn"),p=JSON.stringify(e.fifoMode??null),s=JSON.stringify(e.schema);return{module:"\
package/dist/main.mjs CHANGED
@@ -95,18 +95,19 @@ tags:M}=o,k=se(e,p.name,o),xe=n.getDependencyFiles(p.file),{runtime:Ee=g?.runtim
95
95
  y.Runtime,architecture:we=g?.architecture??y.Architecture,logRetention:Re=g?.logRetention??
96
96
  y.LogRetention,logLevel:Ae=g?.logLevel??y.LogLevel,memory:Ce=g?.memory??y.Memory,
97
97
  timeout:Pe=y.Timeout,debug:he=o.debug,files:Le,vpc:Ne}=c,Ie=qt(t,{groupName:k,retention:Re,
98
- tags:M});a=ie(t,n.role,Ie,{functionName:k,description:p.description,messageSchema:e.
99
- schema,context:e.context,variables:[o.variables,e.variables,c.variables],handler:{
100
- sourceFile:p.file,functionName:p.name,module:p.module,dependencies:xe},listener:s&&
101
- {functionName:s.name,sourceFile:s.file,module:s.module},architecture:we,logLevel:Ae,
102
- runtime:Ee,release:ve,timeout:Pe,memory:Ce,files:Le,debug:he,tags:M,vpc:Ne}),n.setServiceState(
103
- m,o,a)}N(t,r,a,{fromService:a.parameters.functionName});break}case w.Queue:{let p=ue(
104
- n,c.service,o);N(t,r,p,{fromService:p.parameters.queueName});break}}},"prepareSu\
105
- bscriptions"),A=i((t,e,r,o)=>{if(!o.role||!me(o.role))throw new v;let n=Mt(e.context);
106
- for(let c of e.subscriptions)switch(c.type){default:throw new z(u,"subscription \
107
- not supported.");case w.Lambda:{let p=F(e,c.handler.name),s=kt(o,p,r);ae(t,s.entryId,
108
- e.context),s.parameters.vpc||(s.parameters.vpc=n);break}case w.Queue:{let p=ue(o,
109
- c.service,r);ae(t,p.entryId,e.context);break}}},"connectSubscriptions");import{getDefinitionName as $t}from"@ez4/project/library";var C=i((t,e,r)=>{let n=te(t,e.name,r).entryId,c=$t(n,"topicArn"),p=JSON.stringify(
98
+ tags:M});a=ie(t,n.role,Ie,{functionName:k,messageSchema:e.schema,description:p.summary??
99
+ p.description,context:e.context,variables:[o.variables,e.variables,c.variables],
100
+ handler:{sourceFile:p.file,functionName:p.name,module:p.module,dependencies:xe},
101
+ listener:s&&{functionName:s.name,sourceFile:s.file,module:s.module},architecture:we,
102
+ logLevel:Ae,runtime:Ee,release:ve,timeout:Pe,memory:Ce,files:Le,debug:he,tags:M,
103
+ vpc:Ne}),n.setServiceState(m,o,a)}N(t,r,a,{fromService:a.parameters.functionName});
104
+ break}case w.Queue:{let p=ue(n,c.service,o);N(t,r,p,{fromService:p.parameters.queueName});
105
+ break}}},"prepareSubscriptions"),A=i((t,e,r,o)=>{if(!o.role||!me(o.role))throw new v;
106
+ let n=Mt(e.context);for(let c of e.subscriptions)switch(c.type){default:throw new z(
107
+ u,"subscription not supported.");case w.Lambda:{let p=F(e,c.handler.name),s=kt(o,
108
+ p,r);ae(t,s.entryId,e.context),s.parameters.vpc||(s.parameters.vpc=n);break}case w.
109
+ Queue:{let p=ue(o,c.service,r);ae(t,p.entryId,e.context);break}}},"connectSubscr\
110
+ iptions");import{getDefinitionName as $t}from"@ez4/project/library";var C=i((t,e,r)=>{let n=te(t,e.name,r).entryId,c=$t(n,"topicArn"),p=JSON.stringify(
110
111
  e.fifoMode??null),s=JSON.stringify(e.schema);return{module:"Client",from:"@ez4/a\
111
112
  ws-topic/client",constructor:`@{EZ4_MODULE_IMPORT}.make(${c}, ${s}, ${p})`,dependencyIds:[
112
113
  n],connectionIds:[n]}},"prepareLinkedClient");var fe=i(t=>{let{service:e,options:r,context:o}=t;return O(e)?C(o,e,r):null},"pr\
package/lib/message.ts CHANGED
@@ -56,7 +56,7 @@ export async function snsEntryPoint(event: SNSEvent, context: Context): Promise<
56
56
  }
57
57
  }
58
58
 
59
- const onBegin = async (request: Topic.Request) => {
59
+ const onBegin = (request: Partial<Topic.Request>) => {
60
60
  return dispatch(
61
61
  {
62
62
  type: ServiceEventType.Begin,
@@ -66,7 +66,7 @@ const onBegin = async (request: Topic.Request) => {
66
66
  );
67
67
  };
68
68
 
69
- const onReady = async (request: Topic.Incoming<Topic.Message>) => {
69
+ const onReady = (request: Partial<Topic.Incoming<Topic.Message>>) => {
70
70
  return dispatch(
71
71
  {
72
72
  type: ServiceEventType.Ready,
@@ -76,7 +76,7 @@ const onReady = async (request: Topic.Incoming<Topic.Message>) => {
76
76
  );
77
77
  };
78
78
 
79
- const onDone = async (request: Topic.Incoming<Topic.Message>) => {
79
+ const onDone = (request: Partial<Topic.Incoming<Topic.Message>>) => {
80
80
  return dispatch(
81
81
  {
82
82
  type: ServiceEventType.Done,
@@ -86,7 +86,7 @@ const onDone = async (request: Topic.Incoming<Topic.Message>) => {
86
86
  );
87
87
  };
88
88
 
89
- const onError = async (error: unknown, request: Topic.Request | Topic.Incoming<Topic.Message>) => {
89
+ const onError = (error: unknown, request: Partial<Topic.Request | Topic.Incoming<Topic.Message>>) => {
90
90
  console.error({ ...Runtime.getScope(), error });
91
91
 
92
92
  return dispatch(
@@ -99,7 +99,7 @@ const onError = async (error: unknown, request: Topic.Request | Topic.Incoming<T
99
99
  );
100
100
  };
101
101
 
102
- const onEnd = async (request: Topic.Request) => {
102
+ const onEnd = (request: Partial<Topic.Request>) => {
103
103
  return dispatch(
104
104
  {
105
105
  type: ServiceEventType.End,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ez4/aws-topic",
3
3
  "description": "EZ4: Self-managed AWS SNS topics provider",
4
- "version": "0.47.0",
4
+ "version": "0.49.0",
5
5
  "author": "Silas B.",
6
6
  "license": "MIT",
7
7
  "type": "module",
@@ -54,19 +54,19 @@
54
54
  },
55
55
  "dependencies": {
56
56
  "@aws-sdk/client-sns": "^3.996.0",
57
- "@ez4/aws-common": "^0.47.0",
58
- "@ez4/aws-identity": "^0.47.0",
59
- "@ez4/aws-function": "^0.47.0",
60
- "@ez4/aws-logs": "^0.47.0",
61
- "@ez4/aws-queue": "^0.47.0",
62
- "@ez4/common": "^0.47.0",
63
- "@ez4/project": "^0.47.0",
64
- "@ez4/queue": "^0.47.0",
65
- "@ez4/schema": "^0.47.0",
66
- "@ez4/stateful": "^0.47.0",
67
- "@ez4/topic": "^0.47.0",
68
- "@ez4/transform": "^0.47.0",
69
- "@ez4/utils": "^0.47.0",
70
- "@ez4/validator": "^0.47.0"
57
+ "@ez4/aws-common": "^0.49.0",
58
+ "@ez4/aws-identity": "^0.49.0",
59
+ "@ez4/aws-function": "^0.49.0",
60
+ "@ez4/aws-logs": "^0.49.0",
61
+ "@ez4/aws-queue": "^0.49.0",
62
+ "@ez4/common": "^0.49.0",
63
+ "@ez4/project": "^0.49.0",
64
+ "@ez4/queue": "^0.49.0",
65
+ "@ez4/schema": "^0.49.0",
66
+ "@ez4/stateful": "^0.49.0",
67
+ "@ez4/topic": "^0.49.0",
68
+ "@ez4/transform": "^0.49.0",
69
+ "@ez4/utils": "^0.49.0",
70
+ "@ez4/validator": "^0.49.0"
71
71
  }
72
72
  }