@strimz/shared-types 0.13.0 → 0.14.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/src/events.ts CHANGED
@@ -16,7 +16,7 @@ import { transactionSchema } from './transactions.js'
16
16
  import { subscriptionSchema, subscriptionChargeSchema } from './subscriptions.js'
17
17
  import { refundSchema } from './refunds.js'
18
18
  import { invoiceSchema } from './invoices.js'
19
- import { agentActivityLogSchema, agentJobSchema } from './agents.js'
19
+ import { agentJobSchema } from './agents.js'
20
20
  import { complianceLogSchema } from './compliance.js'
21
21
  import { webhookEventNameSchema } from './webhooks.js'
22
22
 
@@ -62,13 +62,6 @@ export const subscriptionRecoveryAttemptEventSchema = envelope(
62
62
  'subscription.recovery_attempt',
63
63
  z.object({ subscription: subscriptionSchema, attemptNumber: z.number().int().min(1) }),
64
64
  )
65
- export const subscriptionRecoveryOutcomeEventSchema = envelope(
66
- 'subscription.recovery_outcome',
67
- z.object({
68
- subscription: subscriptionSchema,
69
- outcome: z.enum(['recovered', 'churned']),
70
- }),
71
- )
72
65
  export const subscriptionCancelledEventSchema = envelope(
73
66
  'subscription.cancelled',
74
67
  subscriptionSchema,
@@ -82,10 +75,6 @@ export const refundCompletedEventSchema = envelope(
82
75
  'refund.completed',
83
76
  z.object({ refund: refundSchema, transaction: transactionSchema }),
84
77
  )
85
- export const refundFailedEventSchema = envelope(
86
- 'refund.failed',
87
- z.object({ refund: refundSchema, reason: z.string() }),
88
- )
89
78
 
90
79
  // ---------- Invoice ----------
91
80
 
@@ -98,10 +87,6 @@ export const invoiceOverdueEventSchema = envelope('invoice.overdue', invoiceSche
98
87
 
99
88
  // ---------- Agent ----------
100
89
 
101
- export const agentActionExecutedEventSchema = envelope(
102
- 'agent.action_executed',
103
- agentActivityLogSchema,
104
- )
105
90
  export const agentJobProposedEventSchema = envelope('agent.job_proposed', agentJobSchema)
106
91
  export const agentJobCompletedEventSchema = envelope('agent.job_completed', agentJobSchema)
107
92
  export const agentJobDisputedEventSchema = envelope('agent.job_disputed', agentJobSchema)
@@ -127,16 +112,13 @@ export const webhookEventSchema = z.discriminatedUnion('type', [
127
112
  subscriptionChargedEventSchema,
128
113
  subscriptionChargeFailedEventSchema,
129
114
  subscriptionRecoveryAttemptEventSchema,
130
- subscriptionRecoveryOutcomeEventSchema,
131
115
  subscriptionCancelledEventSchema,
132
116
  subscriptionLapsedEventSchema,
133
117
  refundCreatedEventSchema,
134
118
  refundCompletedEventSchema,
135
- refundFailedEventSchema,
136
119
  invoiceCreatedEventSchema,
137
120
  invoicePaidEventSchema,
138
121
  invoiceOverdueEventSchema,
139
- agentActionExecutedEventSchema,
140
122
  agentJobProposedEventSchema,
141
123
  agentJobCompletedEventSchema,
142
124
  agentJobDisputedEventSchema,
@@ -155,18 +137,13 @@ export type SubscriptionChargeFailedEvent = z.infer<typeof subscriptionChargeFai
155
137
  export type SubscriptionRecoveryAttemptEvent = z.infer<
156
138
  typeof subscriptionRecoveryAttemptEventSchema
157
139
  >
158
- export type SubscriptionRecoveryOutcomeEvent = z.infer<
159
- typeof subscriptionRecoveryOutcomeEventSchema
160
- >
161
140
  export type SubscriptionCancelledEvent = z.infer<typeof subscriptionCancelledEventSchema>
162
141
  export type SubscriptionLapsedEvent = z.infer<typeof subscriptionLapsedEventSchema>
163
142
  export type RefundCreatedEvent = z.infer<typeof refundCreatedEventSchema>
164
143
  export type RefundCompletedEvent = z.infer<typeof refundCompletedEventSchema>
165
- export type RefundFailedEvent = z.infer<typeof refundFailedEventSchema>
166
144
  export type InvoiceCreatedEvent = z.infer<typeof invoiceCreatedEventSchema>
167
145
  export type InvoicePaidEvent = z.infer<typeof invoicePaidEventSchema>
168
146
  export type InvoiceOverdueEvent = z.infer<typeof invoiceOverdueEventSchema>
169
- export type AgentActionExecutedEvent = z.infer<typeof agentActionExecutedEventSchema>
170
147
  export type AgentJobProposedEvent = z.infer<typeof agentJobProposedEventSchema>
171
148
  export type AgentJobCompletedEvent = z.infer<typeof agentJobCompletedEventSchema>
172
149
  export type AgentJobDisputedEvent = z.infer<typeof agentJobDisputedEventSchema>
package/src/webhooks.ts CHANGED
@@ -23,16 +23,13 @@ export const webhookEventNameSchema = z.enum([
23
23
  'subscription.charged',
24
24
  'subscription.charge_failed',
25
25
  'subscription.recovery_attempt',
26
- 'subscription.recovery_outcome',
27
26
  'subscription.cancelled',
28
27
  'subscription.lapsed',
29
28
  'refund.created',
30
29
  'refund.completed',
31
- 'refund.failed',
32
30
  'invoice.created',
33
31
  'invoice.paid',
34
32
  'invoice.overdue',
35
- 'agent.action_executed',
36
33
  'agent.job_proposed',
37
34
  'agent.job_completed',
38
35
  'agent.job_disputed',