@heavybit/ecommerce-contracts 0.0.0-stage → 0.2.2

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.
Files changed (130) hide show
  1. package/README.md +158 -2
  2. package/dist/cjs/app.js +38 -0
  3. package/dist/cjs/app.js.map +1 -0
  4. package/dist/cjs/bindings.js +127 -0
  5. package/dist/cjs/bindings.js.map +1 -0
  6. package/dist/cjs/events/audit.js +26 -0
  7. package/dist/cjs/events/audit.js.map +1 -0
  8. package/dist/cjs/events/auth.js +68 -0
  9. package/dist/cjs/events/auth.js.map +1 -0
  10. package/dist/cjs/events/base.js +99 -0
  11. package/dist/cjs/events/base.js.map +1 -0
  12. package/dist/cjs/events/cart.js +15 -0
  13. package/dist/cjs/events/cart.js.map +1 -0
  14. package/dist/cjs/events/catalog.js +24 -0
  15. package/dist/cjs/events/catalog.js.map +1 -0
  16. package/dist/cjs/events/gateway.js +24 -0
  17. package/dist/cjs/events/gateway.js.map +1 -0
  18. package/dist/cjs/events/index.js +131 -0
  19. package/dist/cjs/events/index.js.map +1 -0
  20. package/dist/cjs/events/media.js +17 -0
  21. package/dist/cjs/events/media.js.map +1 -0
  22. package/dist/cjs/events/notification.js +43 -0
  23. package/dist/cjs/events/notification.js.map +1 -0
  24. package/dist/cjs/events/order.js +45 -0
  25. package/dist/cjs/events/order.js.map +1 -0
  26. package/dist/cjs/events/payment.js +34 -0
  27. package/dist/cjs/events/payment.js.map +1 -0
  28. package/dist/cjs/events/security.js +36 -0
  29. package/dist/cjs/events/security.js.map +1 -0
  30. package/dist/cjs/events/shipping.js +25 -0
  31. package/dist/cjs/events/shipping.js.map +1 -0
  32. package/dist/cjs/events/store.js +25 -0
  33. package/dist/cjs/events/store.js.map +1 -0
  34. package/dist/cjs/events/usage.js +17 -0
  35. package/dist/cjs/events/usage.js.map +1 -0
  36. package/dist/cjs/identity.js +52 -0
  37. package/dist/cjs/identity.js.map +1 -0
  38. package/dist/cjs/index.js +27 -0
  39. package/dist/cjs/index.js.map +1 -0
  40. package/dist/cjs/package.json +1 -0
  41. package/dist/cjs/permissions.js +10 -0
  42. package/dist/cjs/permissions.js.map +1 -0
  43. package/dist/cjs/scopes.js +57 -0
  44. package/dist/cjs/scopes.js.map +1 -0
  45. package/dist/esm/app.js +35 -0
  46. package/dist/esm/app.js.map +1 -0
  47. package/dist/esm/bindings.js +115 -0
  48. package/dist/esm/bindings.js.map +1 -0
  49. package/dist/esm/events/audit.js +23 -0
  50. package/dist/esm/events/audit.js.map +1 -0
  51. package/dist/esm/events/auth.js +65 -0
  52. package/dist/esm/events/auth.js.map +1 -0
  53. package/dist/esm/events/base.js +90 -0
  54. package/dist/esm/events/base.js.map +1 -0
  55. package/dist/esm/events/cart.js +12 -0
  56. package/dist/esm/events/cart.js.map +1 -0
  57. package/dist/esm/events/catalog.js +21 -0
  58. package/dist/esm/events/catalog.js.map +1 -0
  59. package/dist/esm/events/gateway.js +21 -0
  60. package/dist/esm/events/gateway.js.map +1 -0
  61. package/dist/esm/events/index.js +100 -0
  62. package/dist/esm/events/index.js.map +1 -0
  63. package/dist/esm/events/media.js +14 -0
  64. package/dist/esm/events/media.js.map +1 -0
  65. package/dist/esm/events/notification.js +40 -0
  66. package/dist/esm/events/notification.js.map +1 -0
  67. package/dist/esm/events/order.js +42 -0
  68. package/dist/esm/events/order.js.map +1 -0
  69. package/dist/esm/events/payment.js +31 -0
  70. package/dist/esm/events/payment.js.map +1 -0
  71. package/dist/esm/events/security.js +33 -0
  72. package/dist/esm/events/security.js.map +1 -0
  73. package/dist/esm/events/shipping.js +22 -0
  74. package/dist/esm/events/shipping.js.map +1 -0
  75. package/dist/esm/events/store.js +22 -0
  76. package/dist/esm/events/store.js.map +1 -0
  77. package/dist/esm/events/usage.js +14 -0
  78. package/dist/esm/events/usage.js.map +1 -0
  79. package/dist/esm/identity.js +49 -0
  80. package/dist/esm/identity.js.map +1 -0
  81. package/dist/esm/index.js +11 -0
  82. package/dist/esm/index.js.map +1 -0
  83. package/dist/esm/package.json +1 -0
  84. package/dist/esm/permissions.js +7 -0
  85. package/dist/esm/permissions.js.map +1 -0
  86. package/dist/esm/scopes.js +52 -0
  87. package/dist/esm/scopes.js.map +1 -0
  88. package/dist/types/app.d.ts +40 -0
  89. package/dist/types/app.d.ts.map +1 -0
  90. package/dist/types/bindings.d.ts +88 -0
  91. package/dist/types/bindings.d.ts.map +1 -0
  92. package/dist/types/events/audit.d.ts +86 -0
  93. package/dist/types/events/audit.d.ts.map +1 -0
  94. package/dist/types/events/auth.d.ts +357 -0
  95. package/dist/types/events/auth.d.ts.map +1 -0
  96. package/dist/types/events/base.d.ts +108 -0
  97. package/dist/types/events/base.d.ts.map +1 -0
  98. package/dist/types/events/cart.d.ts +37 -0
  99. package/dist/types/events/cart.d.ts.map +1 -0
  100. package/dist/types/events/catalog.d.ts +126 -0
  101. package/dist/types/events/catalog.d.ts.map +1 -0
  102. package/dist/types/events/gateway.d.ts +77 -0
  103. package/dist/types/events/gateway.d.ts.map +1 -0
  104. package/dist/types/events/index.d.ts +4333 -0
  105. package/dist/types/events/index.d.ts.map +1 -0
  106. package/dist/types/events/media.d.ts +51 -0
  107. package/dist/types/events/media.d.ts.map +1 -0
  108. package/dist/types/events/notification.d.ts +270 -0
  109. package/dist/types/events/notification.d.ts.map +1 -0
  110. package/dist/types/events/order.d.ts +289 -0
  111. package/dist/types/events/order.d.ts.map +1 -0
  112. package/dist/types/events/payment.d.ts +228 -0
  113. package/dist/types/events/payment.d.ts.map +1 -0
  114. package/dist/types/events/security.d.ts +201 -0
  115. package/dist/types/events/security.d.ts.map +1 -0
  116. package/dist/types/events/shipping.d.ts +91 -0
  117. package/dist/types/events/shipping.d.ts.map +1 -0
  118. package/dist/types/events/store.d.ts +134 -0
  119. package/dist/types/events/store.d.ts.map +1 -0
  120. package/dist/types/events/usage.d.ts +59 -0
  121. package/dist/types/events/usage.d.ts.map +1 -0
  122. package/dist/types/identity.d.ts +24 -0
  123. package/dist/types/identity.d.ts.map +1 -0
  124. package/dist/types/index.d.ts +11 -0
  125. package/dist/types/index.d.ts.map +1 -0
  126. package/dist/types/permissions.d.ts +7 -0
  127. package/dist/types/permissions.d.ts.map +1 -0
  128. package/dist/types/scopes.d.ts +57 -0
  129. package/dist/types/scopes.d.ts.map +1 -0
  130. package/package.json +44 -4
@@ -0,0 +1,228 @@
1
+ /** payment-service events: M-Pesa payments, refunds and payouts. */
2
+ import { z } from '@heavybit/shared-lib';
3
+ /** Routing keys published by payment-service. */
4
+ export declare const PAYMENT_KEYS: {
5
+ readonly payment: {
6
+ readonly initiated: "payment.payment.initiated";
7
+ readonly succeeded: "payment.payment.succeeded";
8
+ readonly failed: "payment.payment.failed";
9
+ readonly expired: "payment.payment.expired";
10
+ };
11
+ readonly refund: {
12
+ readonly completed: "payment.refund.completed";
13
+ readonly failed: "payment.refund.failed";
14
+ };
15
+ readonly payout: {
16
+ readonly scheduled: "payment.payout.scheduled";
17
+ readonly paid: "payment.payout.paid";
18
+ readonly failed: "payment.payout.failed";
19
+ };
20
+ };
21
+ /** v1 payload schemas of the payment events. */
22
+ export declare const PAYMENT_EVENTS: {
23
+ readonly "payment.payment.initiated": z.ZodObject<{
24
+ companyId: z.ZodString;
25
+ } & {
26
+ method: z.ZodString;
27
+ amount: z.ZodString;
28
+ currency: z.ZodLiteral<"KES">;
29
+ paymentId: z.ZodString;
30
+ orderId: z.ZodString;
31
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
32
+ companyId: z.ZodString;
33
+ } & {
34
+ method: z.ZodString;
35
+ amount: z.ZodString;
36
+ currency: z.ZodLiteral<"KES">;
37
+ paymentId: z.ZodString;
38
+ orderId: z.ZodString;
39
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
40
+ companyId: z.ZodString;
41
+ } & {
42
+ method: z.ZodString;
43
+ amount: z.ZodString;
44
+ currency: z.ZodLiteral<"KES">;
45
+ paymentId: z.ZodString;
46
+ orderId: z.ZodString;
47
+ }, z.ZodTypeAny, "passthrough">>;
48
+ readonly "payment.payment.succeeded": z.ZodObject<{
49
+ companyId: z.ZodString;
50
+ } & {
51
+ providerRef: z.ZodString;
52
+ paidAt: z.ZodString;
53
+ amount: z.ZodString;
54
+ currency: z.ZodLiteral<"KES">;
55
+ paymentId: z.ZodString;
56
+ orderId: z.ZodString;
57
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
58
+ companyId: z.ZodString;
59
+ } & {
60
+ providerRef: z.ZodString;
61
+ paidAt: z.ZodString;
62
+ amount: z.ZodString;
63
+ currency: z.ZodLiteral<"KES">;
64
+ paymentId: z.ZodString;
65
+ orderId: z.ZodString;
66
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
67
+ companyId: z.ZodString;
68
+ } & {
69
+ providerRef: z.ZodString;
70
+ paidAt: z.ZodString;
71
+ amount: z.ZodString;
72
+ currency: z.ZodLiteral<"KES">;
73
+ paymentId: z.ZodString;
74
+ orderId: z.ZodString;
75
+ }, z.ZodTypeAny, "passthrough">>;
76
+ readonly "payment.payment.failed": z.ZodObject<{
77
+ companyId: z.ZodString;
78
+ } & {
79
+ paymentId: z.ZodString;
80
+ orderId: z.ZodString;
81
+ reason: z.ZodString;
82
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
83
+ companyId: z.ZodString;
84
+ } & {
85
+ paymentId: z.ZodString;
86
+ orderId: z.ZodString;
87
+ reason: z.ZodString;
88
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
89
+ companyId: z.ZodString;
90
+ } & {
91
+ paymentId: z.ZodString;
92
+ orderId: z.ZodString;
93
+ reason: z.ZodString;
94
+ }, z.ZodTypeAny, "passthrough">>;
95
+ readonly "payment.payment.expired": z.ZodObject<{
96
+ companyId: z.ZodString;
97
+ } & {
98
+ paymentId: z.ZodString;
99
+ orderId: z.ZodString;
100
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
101
+ companyId: z.ZodString;
102
+ } & {
103
+ paymentId: z.ZodString;
104
+ orderId: z.ZodString;
105
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
106
+ companyId: z.ZodString;
107
+ } & {
108
+ paymentId: z.ZodString;
109
+ orderId: z.ZodString;
110
+ }, z.ZodTypeAny, "passthrough">>;
111
+ readonly "payment.refund.completed": z.ZodObject<{
112
+ companyId: z.ZodString;
113
+ } & {
114
+ completedAt: z.ZodString;
115
+ amount: z.ZodString;
116
+ currency: z.ZodLiteral<"KES">;
117
+ refundId: z.ZodString;
118
+ orderId: z.ZodString;
119
+ paymentId: z.ZodString;
120
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
121
+ companyId: z.ZodString;
122
+ } & {
123
+ completedAt: z.ZodString;
124
+ amount: z.ZodString;
125
+ currency: z.ZodLiteral<"KES">;
126
+ refundId: z.ZodString;
127
+ orderId: z.ZodString;
128
+ paymentId: z.ZodString;
129
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
130
+ companyId: z.ZodString;
131
+ } & {
132
+ completedAt: z.ZodString;
133
+ amount: z.ZodString;
134
+ currency: z.ZodLiteral<"KES">;
135
+ refundId: z.ZodString;
136
+ orderId: z.ZodString;
137
+ paymentId: z.ZodString;
138
+ }, z.ZodTypeAny, "passthrough">>;
139
+ readonly "payment.refund.failed": z.ZodObject<{
140
+ companyId: z.ZodString;
141
+ } & {
142
+ refundId: z.ZodString;
143
+ orderId: z.ZodString;
144
+ reason: z.ZodString;
145
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
146
+ companyId: z.ZodString;
147
+ } & {
148
+ refundId: z.ZodString;
149
+ orderId: z.ZodString;
150
+ reason: z.ZodString;
151
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
152
+ companyId: z.ZodString;
153
+ } & {
154
+ refundId: z.ZodString;
155
+ orderId: z.ZodString;
156
+ reason: z.ZodString;
157
+ }, z.ZodTypeAny, "passthrough">>;
158
+ readonly "payment.payout.scheduled": z.ZodObject<{
159
+ companyId: z.ZodString;
160
+ } & {
161
+ scheduledFor: z.ZodString;
162
+ amount: z.ZodString;
163
+ currency: z.ZodLiteral<"KES">;
164
+ payoutId: z.ZodString;
165
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
166
+ companyId: z.ZodString;
167
+ } & {
168
+ scheduledFor: z.ZodString;
169
+ amount: z.ZodString;
170
+ currency: z.ZodLiteral<"KES">;
171
+ payoutId: z.ZodString;
172
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
173
+ companyId: z.ZodString;
174
+ } & {
175
+ scheduledFor: z.ZodString;
176
+ amount: z.ZodString;
177
+ currency: z.ZodLiteral<"KES">;
178
+ payoutId: z.ZodString;
179
+ }, z.ZodTypeAny, "passthrough">>;
180
+ readonly "payment.payout.paid": z.ZodObject<{
181
+ companyId: z.ZodString;
182
+ } & {
183
+ providerRef: z.ZodString;
184
+ paidAt: z.ZodString;
185
+ amount: z.ZodString;
186
+ currency: z.ZodLiteral<"KES">;
187
+ payoutId: z.ZodString;
188
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
189
+ companyId: z.ZodString;
190
+ } & {
191
+ providerRef: z.ZodString;
192
+ paidAt: z.ZodString;
193
+ amount: z.ZodString;
194
+ currency: z.ZodLiteral<"KES">;
195
+ payoutId: z.ZodString;
196
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
197
+ companyId: z.ZodString;
198
+ } & {
199
+ providerRef: z.ZodString;
200
+ paidAt: z.ZodString;
201
+ amount: z.ZodString;
202
+ currency: z.ZodLiteral<"KES">;
203
+ payoutId: z.ZodString;
204
+ }, z.ZodTypeAny, "passthrough">>;
205
+ readonly "payment.payout.failed": z.ZodObject<{
206
+ companyId: z.ZodString;
207
+ } & {
208
+ reason: z.ZodString;
209
+ amount: z.ZodString;
210
+ currency: z.ZodLiteral<"KES">;
211
+ payoutId: z.ZodString;
212
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
213
+ companyId: z.ZodString;
214
+ } & {
215
+ reason: z.ZodString;
216
+ amount: z.ZodString;
217
+ currency: z.ZodLiteral<"KES">;
218
+ payoutId: z.ZodString;
219
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
220
+ companyId: z.ZodString;
221
+ } & {
222
+ reason: z.ZodString;
223
+ amount: z.ZodString;
224
+ currency: z.ZodLiteral<"KES">;
225
+ payoutId: z.ZodString;
226
+ }, z.ZodTypeAny, "passthrough">>;
227
+ };
228
+ //# sourceMappingURL=payment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../../../src/events/payment.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,sBAAsB,CAAC;AAGzC,iDAAiD;AACjD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;CASf,CAAC;AAOX,gDAAgD;AAChD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAUjB,CAAC"}
@@ -0,0 +1,201 @@
1
+ /** auth-admin-service security events (§6, security events feed and alerts). No IPs, emails or tokens. */
2
+ import { z } from '@heavybit/shared-lib';
3
+ /** Routing keys of `auth.security.*`. */
4
+ export declare const SECURITY_KEYS: {
5
+ readonly loginSucceeded: "auth.security.login_succeeded";
6
+ readonly loginFailed: "auth.security.login_failed";
7
+ readonly otpFailed: "auth.security.otp_failed";
8
+ readonly stepUp: "auth.security.step_up";
9
+ readonly accountLocked: "auth.security.account_locked";
10
+ readonly sessionsRevoked: "auth.security.sessions_revoked";
11
+ readonly roleChanged: "auth.security.role_changed";
12
+ readonly loginRisky: "auth.security.login_risky";
13
+ readonly loginUnrecognized: "auth.security.login_unrecognized";
14
+ readonly alertRaised: "auth.security.alert_raised";
15
+ };
16
+ /** v1 payload schemas of the security events. `companyId` is set when a company was active. */
17
+ export declare const SECURITY_EVENTS: {
18
+ readonly "auth.security.login_succeeded": z.ZodObject<{
19
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20
+ } & {
21
+ userId: z.ZodString;
22
+ sessionId: z.ZodString;
23
+ method: z.ZodEnum<["password", "otp", "sso"]>;
24
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
25
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
26
+ } & {
27
+ userId: z.ZodString;
28
+ sessionId: z.ZodString;
29
+ method: z.ZodEnum<["password", "otp", "sso"]>;
30
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
31
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
32
+ } & {
33
+ userId: z.ZodString;
34
+ sessionId: z.ZodString;
35
+ method: z.ZodEnum<["password", "otp", "sso"]>;
36
+ }, z.ZodTypeAny, "passthrough">>;
37
+ /** `userId` is null when the account does not exist (no enumeration of identifiers in payloads). */
38
+ readonly "auth.security.login_failed": z.ZodObject<{
39
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
40
+ } & {
41
+ userId: z.ZodNullable<z.ZodString>;
42
+ reason: z.ZodString;
43
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
44
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
45
+ } & {
46
+ userId: z.ZodNullable<z.ZodString>;
47
+ reason: z.ZodString;
48
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
49
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
50
+ } & {
51
+ userId: z.ZodNullable<z.ZodString>;
52
+ reason: z.ZodString;
53
+ }, z.ZodTypeAny, "passthrough">>;
54
+ readonly "auth.security.otp_failed": z.ZodObject<{
55
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
56
+ } & {
57
+ userId: z.ZodString;
58
+ purpose: z.ZodString;
59
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
60
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
61
+ } & {
62
+ userId: z.ZodString;
63
+ purpose: z.ZodString;
64
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
65
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
66
+ } & {
67
+ userId: z.ZodString;
68
+ purpose: z.ZodString;
69
+ }, z.ZodTypeAny, "passthrough">>;
70
+ readonly "auth.security.step_up": z.ZodObject<{
71
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
72
+ } & {
73
+ userId: z.ZodString;
74
+ sessionId: z.ZodString;
75
+ scope: z.ZodString;
76
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
77
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
78
+ } & {
79
+ userId: z.ZodString;
80
+ sessionId: z.ZodString;
81
+ scope: z.ZodString;
82
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
83
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
84
+ } & {
85
+ userId: z.ZodString;
86
+ sessionId: z.ZodString;
87
+ scope: z.ZodString;
88
+ }, z.ZodTypeAny, "passthrough">>;
89
+ readonly "auth.security.account_locked": z.ZodObject<{
90
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
91
+ } & {
92
+ userId: z.ZodString;
93
+ lockedUntil: z.ZodString;
94
+ reason: z.ZodString;
95
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
96
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
97
+ } & {
98
+ userId: z.ZodString;
99
+ lockedUntil: z.ZodString;
100
+ reason: z.ZodString;
101
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
102
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
103
+ } & {
104
+ userId: z.ZodString;
105
+ lockedUntil: z.ZodString;
106
+ reason: z.ZodString;
107
+ }, z.ZodTypeAny, "passthrough">>;
108
+ readonly "auth.security.sessions_revoked": z.ZodObject<{
109
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
110
+ } & {
111
+ userId: z.ZodString;
112
+ count: z.ZodNumber;
113
+ reason: z.ZodString;
114
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
115
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
116
+ } & {
117
+ userId: z.ZodString;
118
+ count: z.ZodNumber;
119
+ reason: z.ZodString;
120
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
121
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
122
+ } & {
123
+ userId: z.ZodString;
124
+ count: z.ZodNumber;
125
+ reason: z.ZodString;
126
+ }, z.ZodTypeAny, "passthrough">>;
127
+ readonly "auth.security.role_changed": z.ZodObject<{
128
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
129
+ } & {
130
+ userId: z.ZodString;
131
+ roleId: z.ZodString;
132
+ change: z.ZodEnum<["assigned", "revoked"]>;
133
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
134
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
135
+ } & {
136
+ userId: z.ZodString;
137
+ roleId: z.ZodString;
138
+ change: z.ZodEnum<["assigned", "revoked"]>;
139
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
140
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
141
+ } & {
142
+ userId: z.ZodString;
143
+ roleId: z.ZodString;
144
+ change: z.ZodEnum<["assigned", "revoked"]>;
145
+ }, z.ZodTypeAny, "passthrough">>;
146
+ readonly "auth.security.login_risky": z.ZodObject<{
147
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
148
+ } & {
149
+ userId: z.ZodString;
150
+ sessionId: z.ZodNullable<z.ZodString>;
151
+ signals: z.ZodArray<z.ZodString, "many">;
152
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
153
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
154
+ } & {
155
+ userId: z.ZodString;
156
+ sessionId: z.ZodNullable<z.ZodString>;
157
+ signals: z.ZodArray<z.ZodString, "many">;
158
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
159
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
160
+ } & {
161
+ userId: z.ZodString;
162
+ sessionId: z.ZodNullable<z.ZodString>;
163
+ signals: z.ZodArray<z.ZodString, "many">;
164
+ }, z.ZodTypeAny, "passthrough">>;
165
+ readonly "auth.security.login_unrecognized": z.ZodObject<{
166
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
167
+ } & {
168
+ userId: z.ZodString;
169
+ sessionId: z.ZodString;
170
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
171
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
172
+ } & {
173
+ userId: z.ZodString;
174
+ sessionId: z.ZodString;
175
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
176
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
177
+ } & {
178
+ userId: z.ZodString;
179
+ sessionId: z.ZodString;
180
+ }, z.ZodTypeAny, "passthrough">>;
181
+ readonly "auth.security.alert_raised": z.ZodObject<{
182
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
183
+ } & {
184
+ userId: z.ZodNullable<z.ZodString>;
185
+ alert: z.ZodString;
186
+ severity: z.ZodEnum<["low", "medium", "high", "critical"]>;
187
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
188
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
189
+ } & {
190
+ userId: z.ZodNullable<z.ZodString>;
191
+ alert: z.ZodString;
192
+ severity: z.ZodEnum<["low", "medium", "high", "critical"]>;
193
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
194
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
195
+ } & {
196
+ userId: z.ZodNullable<z.ZodString>;
197
+ alert: z.ZodString;
198
+ severity: z.ZodEnum<["low", "medium", "high", "critical"]>;
199
+ }, z.ZodTypeAny, "passthrough">>;
200
+ };
201
+ //# sourceMappingURL=security.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../../src/events/security.ts"],"names":[],"mappings":"AAAA,0GAA0G;AAC1G,OAAO,EAAE,CAAC,EAAE,MAAM,sBAAsB,CAAC;AAGzC,yCAAyC;AACzC,eAAO,MAAM,aAAa;;;;;;;;;;;CAWhB,CAAC;AAKX,+FAA+F;AAC/F,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;IAE1B,oGAAoG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAU5F,CAAC"}
@@ -0,0 +1,91 @@
1
+ /** shipping-service events. Shipment addresses stay in shipping-service (snapshot, MS-3). */
2
+ import { z } from '@heavybit/shared-lib';
3
+ /** Routing keys published by shipping-service. */
4
+ export declare const SHIPPING_KEYS: {
5
+ readonly shipment: {
6
+ readonly created: "shipping.shipment.created";
7
+ readonly dispatched: "shipping.shipment.dispatched";
8
+ readonly delivered: "shipping.shipment.delivered";
9
+ readonly failed: "shipping.shipment.failed";
10
+ };
11
+ };
12
+ /** v1 payload schemas of the shipping events. */
13
+ export declare const SHIPPING_EVENTS: {
14
+ readonly "shipping.shipment.created": z.ZodObject<{
15
+ companyId: z.ZodString;
16
+ } & {
17
+ method: z.ZodString;
18
+ shipmentId: z.ZodString;
19
+ orderId: z.ZodString;
20
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
21
+ companyId: z.ZodString;
22
+ } & {
23
+ method: z.ZodString;
24
+ shipmentId: z.ZodString;
25
+ orderId: z.ZodString;
26
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
27
+ companyId: z.ZodString;
28
+ } & {
29
+ method: z.ZodString;
30
+ shipmentId: z.ZodString;
31
+ orderId: z.ZodString;
32
+ }, z.ZodTypeAny, "passthrough">>;
33
+ readonly "shipping.shipment.dispatched": z.ZodObject<{
34
+ companyId: z.ZodString;
35
+ } & {
36
+ trackingNumber: z.ZodNullable<z.ZodString>;
37
+ shipmentId: z.ZodString;
38
+ orderId: z.ZodString;
39
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
40
+ companyId: z.ZodString;
41
+ } & {
42
+ trackingNumber: z.ZodNullable<z.ZodString>;
43
+ shipmentId: z.ZodString;
44
+ orderId: z.ZodString;
45
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
46
+ companyId: z.ZodString;
47
+ } & {
48
+ trackingNumber: z.ZodNullable<z.ZodString>;
49
+ shipmentId: z.ZodString;
50
+ orderId: z.ZodString;
51
+ }, z.ZodTypeAny, "passthrough">>;
52
+ readonly "shipping.shipment.delivered": z.ZodObject<{
53
+ companyId: z.ZodString;
54
+ } & {
55
+ deliveredAt: z.ZodString;
56
+ shipmentId: z.ZodString;
57
+ orderId: z.ZodString;
58
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
59
+ companyId: z.ZodString;
60
+ } & {
61
+ deliveredAt: z.ZodString;
62
+ shipmentId: z.ZodString;
63
+ orderId: z.ZodString;
64
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
65
+ companyId: z.ZodString;
66
+ } & {
67
+ deliveredAt: z.ZodString;
68
+ shipmentId: z.ZodString;
69
+ orderId: z.ZodString;
70
+ }, z.ZodTypeAny, "passthrough">>;
71
+ readonly "shipping.shipment.failed": z.ZodObject<{
72
+ companyId: z.ZodString;
73
+ } & {
74
+ reason: z.ZodString;
75
+ shipmentId: z.ZodString;
76
+ orderId: z.ZodString;
77
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
78
+ companyId: z.ZodString;
79
+ } & {
80
+ reason: z.ZodString;
81
+ shipmentId: z.ZodString;
82
+ orderId: z.ZodString;
83
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
84
+ companyId: z.ZodString;
85
+ } & {
86
+ reason: z.ZodString;
87
+ shipmentId: z.ZodString;
88
+ orderId: z.ZodString;
89
+ }, z.ZodTypeAny, "passthrough">>;
90
+ };
91
+ //# sourceMappingURL=shipping.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shipping.d.ts","sourceRoot":"","sources":["../../../src/events/shipping.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,OAAO,EAAE,CAAC,EAAE,MAAM,sBAAsB,CAAC;AAGzC,kDAAkD;AAClD,eAAO,MAAM,aAAa;;;;;;;CAOhB,CAAC;AAKX,iDAAiD;AACjD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKlB,CAAC"}
@@ -0,0 +1,134 @@
1
+ /** store-service events: shop provisioning, settings, theme and domains. */
2
+ import { z } from '@heavybit/shared-lib';
3
+ /** Routing keys published by store-service. */
4
+ export declare const STORE_KEYS: {
5
+ readonly shop: {
6
+ readonly provisioned: "store.shop.provisioned";
7
+ };
8
+ readonly settings: {
9
+ readonly changed: "store.settings.changed";
10
+ };
11
+ readonly theme: {
12
+ readonly published: "store.theme.published";
13
+ };
14
+ readonly domain: {
15
+ readonly changed: "store.domain.changed";
16
+ readonly verified: "store.domain.verified";
17
+ readonly failed: "store.domain.failed";
18
+ };
19
+ };
20
+ /** v1 payload schemas of the store events. */
21
+ export declare const STORE_EVENTS: {
22
+ readonly "store.shop.provisioned": z.ZodObject<{
23
+ companyId: z.ZodString;
24
+ } & {
25
+ shopId: z.ZodString;
26
+ slug: z.ZodString;
27
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
28
+ companyId: z.ZodString;
29
+ } & {
30
+ shopId: z.ZodString;
31
+ slug: z.ZodString;
32
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
33
+ companyId: z.ZodString;
34
+ } & {
35
+ shopId: z.ZodString;
36
+ slug: z.ZodString;
37
+ }, z.ZodTypeAny, "passthrough">>;
38
+ readonly "store.settings.changed": z.ZodObject<{
39
+ companyId: z.ZodString;
40
+ } & {
41
+ shopId: z.ZodString;
42
+ changedFields: z.ZodArray<z.ZodString, "many">;
43
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
44
+ companyId: z.ZodString;
45
+ } & {
46
+ shopId: z.ZodString;
47
+ changedFields: z.ZodArray<z.ZodString, "many">;
48
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
49
+ companyId: z.ZodString;
50
+ } & {
51
+ shopId: z.ZodString;
52
+ changedFields: z.ZodArray<z.ZodString, "many">;
53
+ }, z.ZodTypeAny, "passthrough">>;
54
+ readonly "store.theme.published": z.ZodObject<{
55
+ companyId: z.ZodString;
56
+ } & {
57
+ shopId: z.ZodString;
58
+ themeId: z.ZodString;
59
+ revision: z.ZodNumber;
60
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
61
+ companyId: z.ZodString;
62
+ } & {
63
+ shopId: z.ZodString;
64
+ themeId: z.ZodString;
65
+ revision: z.ZodNumber;
66
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
67
+ companyId: z.ZodString;
68
+ } & {
69
+ shopId: z.ZodString;
70
+ themeId: z.ZodString;
71
+ revision: z.ZodNumber;
72
+ }, z.ZodTypeAny, "passthrough">>;
73
+ readonly "store.domain.changed": z.ZodObject<{
74
+ companyId: z.ZodString;
75
+ } & {
76
+ shopId: z.ZodString;
77
+ domainId: z.ZodString;
78
+ hostname: z.ZodString;
79
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
80
+ companyId: z.ZodString;
81
+ } & {
82
+ shopId: z.ZodString;
83
+ domainId: z.ZodString;
84
+ hostname: z.ZodString;
85
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
86
+ companyId: z.ZodString;
87
+ } & {
88
+ shopId: z.ZodString;
89
+ domainId: z.ZodString;
90
+ hostname: z.ZodString;
91
+ }, z.ZodTypeAny, "passthrough">>;
92
+ readonly "store.domain.verified": z.ZodObject<{
93
+ companyId: z.ZodString;
94
+ } & {
95
+ shopId: z.ZodString;
96
+ domainId: z.ZodString;
97
+ hostname: z.ZodString;
98
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
99
+ companyId: z.ZodString;
100
+ } & {
101
+ shopId: z.ZodString;
102
+ domainId: z.ZodString;
103
+ hostname: z.ZodString;
104
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
105
+ companyId: z.ZodString;
106
+ } & {
107
+ shopId: z.ZodString;
108
+ domainId: z.ZodString;
109
+ hostname: z.ZodString;
110
+ }, z.ZodTypeAny, "passthrough">>;
111
+ readonly "store.domain.failed": z.ZodObject<{
112
+ companyId: z.ZodString;
113
+ } & {
114
+ shopId: z.ZodString;
115
+ domainId: z.ZodString;
116
+ hostname: z.ZodString;
117
+ reason: z.ZodString;
118
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
119
+ companyId: z.ZodString;
120
+ } & {
121
+ shopId: z.ZodString;
122
+ domainId: z.ZodString;
123
+ hostname: z.ZodString;
124
+ reason: z.ZodString;
125
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
126
+ companyId: z.ZodString;
127
+ } & {
128
+ shopId: z.ZodString;
129
+ domainId: z.ZodString;
130
+ hostname: z.ZodString;
131
+ reason: z.ZodString;
132
+ }, z.ZodTypeAny, "passthrough">>;
133
+ };
134
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/events/store.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,OAAO,EAAE,CAAC,EAAE,MAAM,sBAAsB,CAAC;AAGzC,+CAA+C;AAC/C,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;CAKb,CAAC;AAKX,8CAA8C;AAC9C,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOf,CAAC"}