@joy-loyalty/hydrogen 0.0.0-stage → 0.2.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.
Files changed (127) hide show
  1. package/LICENSE +3 -0
  2. package/README.md +134 -2
  3. package/dist/cache-control.d.ts +8 -0
  4. package/dist/cache-control.js +6 -0
  5. package/dist/csp.d.ts +14 -0
  6. package/dist/csp.js +33 -0
  7. package/dist/headless-host-adapter.d.ts +5 -0
  8. package/dist/headless-host-adapter.js +197 -0
  9. package/dist/host-adapter/capabilities.d.ts +3 -0
  10. package/dist/host-adapter/capabilities.js +12 -0
  11. package/dist/host-adapter/data-source.d.ts +3 -0
  12. package/dist/host-adapter/data-source.js +49 -0
  13. package/dist/host-adapter/product-fetcher.d.ts +2 -0
  14. package/dist/host-adapter/product-fetcher.js +37 -0
  15. package/dist/host-adapter/promoted-collections.d.ts +2 -0
  16. package/dist/host-adapter/promoted-collections.js +43 -0
  17. package/dist/host-adapter/types.d.ts +212 -0
  18. package/dist/host-adapter/types.js +1 -0
  19. package/dist/hydrogen-cart-port.d.ts +134 -0
  20. package/dist/hydrogen-cart-port.js +245 -0
  21. package/dist/index.d.ts +26 -0
  22. package/dist/index.js +15 -0
  23. package/dist/joy-widget.d.ts +29 -0
  24. package/dist/joy-widget.js +291 -0
  25. package/dist/lib/JoyProvider.d.ts +47 -0
  26. package/dist/lib/JoyProvider.js +95 -0
  27. package/dist/lib/account-links.d.ts +5 -0
  28. package/dist/lib/account-links.js +65 -0
  29. package/dist/lib/apply-behavior.d.ts +12 -0
  30. package/dist/lib/apply-behavior.js +26 -0
  31. package/dist/lib/core-loader.d.ts +63 -0
  32. package/dist/lib/core-loader.js +160 -0
  33. package/dist/lib/core-manifest.d.ts +7 -0
  34. package/dist/lib/core-manifest.js +54 -0
  35. package/dist/lib/core-preload-links.d.ts +8 -0
  36. package/dist/lib/core-preload-links.js +8 -0
  37. package/dist/lib/coupon-mapper.d.ts +95 -0
  38. package/dist/lib/coupon-mapper.js +167 -0
  39. package/dist/lib/custom-links.d.ts +22 -0
  40. package/dist/lib/custom-links.js +56 -0
  41. package/dist/lib/deeplink.d.ts +25 -0
  42. package/dist/lib/deeplink.js +92 -0
  43. package/dist/lib/earn-signup-gate.d.ts +3 -0
  44. package/dist/lib/earn-signup-gate.js +31 -0
  45. package/dist/lib/facebook-ref-link.d.ts +13 -0
  46. package/dist/lib/facebook-ref-link.js +31 -0
  47. package/dist/lib/headless-referral-origin.d.ts +2 -0
  48. package/dist/lib/headless-referral-origin.js +24 -0
  49. package/dist/lib/headless-source.d.ts +8 -0
  50. package/dist/lib/headless-source.js +71 -0
  51. package/dist/lib/image.d.ts +2 -0
  52. package/dist/lib/image.js +14 -0
  53. package/dist/lib/metafield-blob.d.ts +33 -0
  54. package/dist/lib/metafield-blob.js +76 -0
  55. package/dist/lib/money.d.ts +6 -0
  56. package/dist/lib/money.js +25 -0
  57. package/dist/lib/order-mapper.d.ts +44 -0
  58. package/dist/lib/order-mapper.js +141 -0
  59. package/dist/lib/place-order-scope.d.ts +6 -0
  60. package/dist/lib/place-order-scope.js +22 -0
  61. package/dist/lib/points.d.ts +5 -0
  62. package/dist/lib/points.js +10 -0
  63. package/dist/lib/recently-viewed-tracker.d.ts +1 -0
  64. package/dist/lib/recently-viewed-tracker.js +34 -0
  65. package/dist/lib/recommended-loader.d.ts +43 -0
  66. package/dist/lib/recommended-loader.js +111 -0
  67. package/dist/lib/referral-share.d.ts +4 -0
  68. package/dist/lib/referral-share.js +33 -0
  69. package/dist/lib/safe-navigation-url.d.ts +1 -0
  70. package/dist/lib/safe-navigation-url.js +9 -0
  71. package/dist/lib/server-token.d.ts +41 -0
  72. package/dist/lib/server-token.js +87 -0
  73. package/dist/lib/shop-locale.d.ts +1 -0
  74. package/dist/lib/shop-locale.js +21 -0
  75. package/dist/lib/social-earn.d.ts +11 -0
  76. package/dist/lib/social-earn.js +25 -0
  77. package/dist/lib/storefront-fonts.d.ts +5 -0
  78. package/dist/lib/storefront-fonts.js +52 -0
  79. package/dist/lib/token.d.ts +14 -0
  80. package/dist/lib/token.js +135 -0
  81. package/dist/lib/write-review.d.ts +2 -0
  82. package/dist/lib/write-review.js +44 -0
  83. package/dist/loyalty-page/JoyLoyaltyPage.d.ts +151 -0
  84. package/dist/loyalty-page/JoyLoyaltyPage.js +447 -0
  85. package/dist/loyalty-page/compose-home.d.ts +35 -0
  86. package/dist/loyalty-page/compose-home.js +177 -0
  87. package/dist/loyalty-page/skeleton.d.ts +11 -0
  88. package/dist/loyalty-page/skeleton.js +99 -0
  89. package/dist/orchestrator/context.d.ts +61 -0
  90. package/dist/orchestrator/context.js +64 -0
  91. package/dist/orchestrator/gated.d.ts +1 -0
  92. package/dist/orchestrator/gated.js +14 -0
  93. package/dist/orchestrator/handlers/account.d.ts +19 -0
  94. package/dist/orchestrator/handlers/account.js +266 -0
  95. package/dist/orchestrator/handlers/birthday.d.ts +6 -0
  96. package/dist/orchestrator/handlers/birthday.js +128 -0
  97. package/dist/orchestrator/handlers/earn.d.ts +5 -0
  98. package/dist/orchestrator/handlers/earn.js +258 -0
  99. package/dist/orchestrator/handlers/milestone-tier.d.ts +5 -0
  100. package/dist/orchestrator/handlers/milestone-tier.js +123 -0
  101. package/dist/orchestrator/handlers/profile.d.ts +5 -0
  102. package/dist/orchestrator/handlers/profile.js +262 -0
  103. package/dist/orchestrator/handlers/redeem.d.ts +6 -0
  104. package/dist/orchestrator/handlers/redeem.js +464 -0
  105. package/dist/orchestrator/handlers/referral.d.ts +5 -0
  106. package/dist/orchestrator/handlers/referral.js +218 -0
  107. package/dist/orchestrator/render.d.ts +2 -0
  108. package/dist/orchestrator/render.js +193 -0
  109. package/dist/render-adapter.d.ts +50 -0
  110. package/dist/render-adapter.js +422 -0
  111. package/dist/routes/joy-place-order-scope.d.ts +12 -0
  112. package/dist/routes/joy-place-order-scope.js +32 -0
  113. package/dist/routes/joy-products.d.ts +48 -0
  114. package/dist/routes/joy-products.js +326 -0
  115. package/dist/routes/joy-token.d.ts +16 -0
  116. package/dist/routes/joy-token.js +32 -0
  117. package/dist/server/get-joy-initial-data.d.ts +38 -0
  118. package/dist/server/get-joy-initial-data.js +61 -0
  119. package/dist/server/get-joy-loyalty-page-data.d.ts +27 -0
  120. package/dist/server/get-joy-loyalty-page-data.js +99 -0
  121. package/dist/server/index.d.ts +8 -0
  122. package/dist/server/index.js +4 -0
  123. package/dist/widget-controller.d.ts +2 -0
  124. package/dist/widget-controller.js +1 -0
  125. package/dist/widget-orchestrator.d.ts +88 -0
  126. package/dist/widget-orchestrator.js +499 -0
  127. package/package.json +121 -4
@@ -0,0 +1,123 @@
1
+ import { detail, writeProps } from '../../widget-orchestrator.js';
2
+ function hasMilestoneProgram(blob) {
3
+ const program = blob && typeof blob === 'object' ? blob.program : undefined;
4
+ const earning = program && typeof program === 'object' ? program.earning : undefined;
5
+ if (!Array.isArray(earning))
6
+ return false;
7
+ return earning.some(p => {
8
+ const prog = p;
9
+ return !!prog.isMilestoneV2 && !!prog.status && !prog.expired && !prog.isDraft;
10
+ });
11
+ }
12
+ export function registerMilestoneTierHandlers(ctx, deps) {
13
+ const { element, controller, hostAdapter, coreExports, surface, patchCustomer, toast, tLabel } = ctx;
14
+ const { buildLoaderFacade } = deps;
15
+ const claimsInFlight = new Set();
16
+ const pendingClaimsInFlight = new Set();
17
+ function loadMilestone() {
18
+ const load = coreExports?.loadMilestoneData;
19
+ if (typeof load !== 'function' || !hasMilestoneProgram(ctx.activeBlob))
20
+ return;
21
+ const facade = buildLoaderFacade();
22
+ if (!facade)
23
+ return;
24
+ surface(Promise.resolve(load(facade)));
25
+ }
26
+ function loadTierPerks() {
27
+ const apply = coreExports?.applyTierPerks;
28
+ if (typeof apply !== 'function')
29
+ return;
30
+ const facade = buildLoaderFacade();
31
+ if (!facade)
32
+ return;
33
+ surface(Promise.resolve(apply(facade, {})));
34
+ }
35
+ async function runMilestoneClaim(d) {
36
+ const { programId } = d;
37
+ if (!programId)
38
+ return;
39
+ const claimKey = `${programId}::${d.milestoneValue ?? ''}`;
40
+ if (claimsInFlight.has(claimKey))
41
+ return;
42
+ claimsInFlight.add(claimKey);
43
+ const setLoading = (loading) => {
44
+ element.setMilestoneTimelineLoading?.(programId, loading);
45
+ };
46
+ setLoading(true);
47
+ try {
48
+ const result = await hostAdapter.data.claimMilestone({
49
+ programId,
50
+ milestoneValue: d.milestoneValue ?? '',
51
+ selectedRewardIds: d.selectedRewardIds,
52
+ stepType: d.stepType,
53
+ isMixed: d.isMixed,
54
+ isSelectVariantFreeGiftMilestone: d.isSelectVariantFreeGiftMilestone,
55
+ variantIdsSelected: d.variantIdsSelected
56
+ });
57
+ if (typeof result?.point === 'number') {
58
+ writeProps(element, { points: result.point });
59
+ }
60
+ if (result && typeof result === 'object') {
61
+ patchCustomer(result);
62
+ }
63
+ toast('Reward claimed!');
64
+ loadMilestone();
65
+ }
66
+ catch {
67
+ toast('Failed to claim reward');
68
+ loadMilestone();
69
+ }
70
+ finally {
71
+ claimsInFlight.delete(claimKey);
72
+ setLoading(false);
73
+ }
74
+ }
75
+ async function runTierPerkSave(event) {
76
+ const d = detail(event);
77
+ const picker = (event.composedPath?.() ?? []).find(el => el?.tagName?.toLowerCase() === 'joy-tier-perk-picker');
78
+ const failPicker = () => {
79
+ if (!picker)
80
+ return;
81
+ picker.saving = false;
82
+ picker.errorText = tLabel('Failed to save selection');
83
+ };
84
+ const { tierId, programId, variantIds, claimKind, pendingId } = d;
85
+ if (!tierId || !programId || !Array.isArray(variantIds))
86
+ return;
87
+ try {
88
+ if (claimKind === 'entry-pending') {
89
+ if (!pendingId) {
90
+ failPicker();
91
+ return;
92
+ }
93
+ if (pendingClaimsInFlight.has(pendingId))
94
+ return;
95
+ pendingClaimsInFlight.add(pendingId);
96
+ try {
97
+ const result = await hostAdapter.data.claimPendingReward(pendingId, { variantIds });
98
+ if (result?.couponCode)
99
+ toast('Your coupon code: {{code}}', { code: result.couponCode });
100
+ }
101
+ finally {
102
+ pendingClaimsInFlight.delete(pendingId);
103
+ }
104
+ }
105
+ else {
106
+ const result = await hostAdapter.data.saveTierPerkVariantSelection({ tierId, programId, variantIds });
107
+ if (result?.tierData !== undefined)
108
+ patchCustomer({ tierData: result.tierData });
109
+ }
110
+ loadTierPerks();
111
+ }
112
+ catch {
113
+ failPicker();
114
+ }
115
+ }
116
+ controller.on('joy-milestone-login', () => hostAdapter.navigate({ type: 'login' }));
117
+ controller.on('joy-milestone-claim', event => {
118
+ void runMilestoneClaim(detail(event));
119
+ });
120
+ controller.on('joy-tier-perk-save', event => void runTierPerkSave(event));
121
+ ctx.loadMilestone = loadMilestone;
122
+ ctx.loadTierPerks = loadTierPerks;
123
+ }
@@ -0,0 +1,5 @@
1
+ import type { OrchestratorContext } from '../context.js';
2
+ export interface ProfileHandlers {
3
+ loadAddresses(): void;
4
+ }
5
+ export declare function registerProfileHandlers(ctx: OrchestratorContext): ProfileHandlers;
@@ -0,0 +1,262 @@
1
+ import { detail, writeProps } from '../../widget-orchestrator.js';
2
+ import { readFacebookPageId, socialToFacebook } from '../../render-adapter.js';
3
+ import { generateFacebookRefLink } from '../../lib/facebook-ref-link.js';
4
+ import { safeNavigationUrl } from '../../lib/safe-navigation-url.js';
5
+ function readShopId(blob) {
6
+ const shopId = blob && typeof blob === 'object' ? blob.shopId : undefined;
7
+ return typeof shopId === 'string' ? shopId : '';
8
+ }
9
+ function toAddressInput(d) {
10
+ return {
11
+ ...(d.id != null && d.id !== '' ? { id: d.id } : {}),
12
+ firstName: d.first_name,
13
+ lastName: d.last_name,
14
+ address1: d.address1 ?? '',
15
+ city: d.city ?? '',
16
+ country: d.country ?? '',
17
+ isDefault: d.default,
18
+ ...('company' in d ? { company: d.company ?? '' } : {}),
19
+ ...('address2' in d ? { address2: d.address2 ?? '' } : {}),
20
+ ...('province' in d ? { province: d.province ?? '' } : {}),
21
+ ...('province_code' in d ? { provinceCode: d.province_code ?? '' } : {}),
22
+ ...('zip' in d ? { zip: d.zip ?? '' } : {}),
23
+ ...('phone' in d ? { phone: d.phone ?? '' } : {})
24
+ };
25
+ }
26
+ export function registerProfileHandlers(ctx) {
27
+ const { element, controller, hostAdapter, surface, patchCustomer, toast, tLabel, isAuthed } = ctx;
28
+ function loadAddresses() {
29
+ surface(hostAdapter.data.getAddresses().then(addresses => {
30
+ element.addresses = addresses.map(a => ({
31
+ ...a,
32
+ first_name: a.firstName,
33
+ last_name: a.lastName,
34
+ province_code: a.provinceCode,
35
+ default: a.isDefault
36
+ }));
37
+ }));
38
+ }
39
+ async function runInstagramLink(username, source) {
40
+ const setterKey = source === 'earn' ? 'setEarnInstagramLinkResult' : 'setProfileInstagramResult';
41
+ const setResult = (ok, points) => {
42
+ element[setterKey]?.(ok, points);
43
+ };
44
+ if (!username) {
45
+ setResult(false);
46
+ return;
47
+ }
48
+ try {
49
+ const result = await hostAdapter.data.linkInstagram(username);
50
+ writeProps(element, { 'instagram-id': result.instagramUsername });
51
+ if (result.rewardEarned)
52
+ writeProps(element, { 'instagram-link-rewarded': true });
53
+ setResult(true, result.pointsEarned);
54
+ }
55
+ catch (error) {
56
+ setResult(false);
57
+ throw error;
58
+ }
59
+ }
60
+ function setFacebookResult(ok) {
61
+ element.setEarnFacebookResult?.(ok);
62
+ element.setProfileFacebookResult?.(ok);
63
+ }
64
+ function runConsentToggle(field, attr, value) {
65
+ const update = field === 'acceptsMarketing' ? { acceptsMarketing: value } : { acceptsSmsMarketing: value };
66
+ void hostAdapter.data
67
+ .updateProfile(update)
68
+ .then(() => {
69
+ writeProps(element, { [attr]: value });
70
+ toast('Settings saved');
71
+ })
72
+ .catch((error) => {
73
+ writeProps(element, { [attr]: !value });
74
+ toast(error instanceof Error && error.message ? error.message : 'Failed to save. Please try again.');
75
+ });
76
+ }
77
+ function runFacebookLink() {
78
+ if (!isAuthed()) {
79
+ setFacebookResult(false);
80
+ return;
81
+ }
82
+ const pageId = readFacebookPageId(ctx.activeBlob);
83
+ if (!pageId) {
84
+ toast('Facebook Page is not connected');
85
+ setFacebookResult(false);
86
+ return;
87
+ }
88
+ const newWindow = typeof window === 'undefined' ? null : window.open('', '_blank');
89
+ surface(generateFacebookRefLink({
90
+ pageId,
91
+ shopId: readShopId(ctx.activeBlob),
92
+ customerId: String(ctx.activeCustomer?.id ?? ''),
93
+ shopDomain: hostAdapter.context().shopDomain
94
+ })
95
+ .then(result => {
96
+ const safe = safeNavigationUrl(result.link);
97
+ if (!safe) {
98
+ newWindow?.close();
99
+ return;
100
+ }
101
+ if (newWindow)
102
+ newWindow.location.href = result.link;
103
+ else
104
+ window.location.href = result.link;
105
+ toast('Complete in Messenger to link your account');
106
+ setFacebookResult(true);
107
+ })
108
+ .catch((error) => {
109
+ newWindow?.close();
110
+ toast('Cannot connect Facebook account');
111
+ setFacebookResult(false);
112
+ throw error;
113
+ }));
114
+ }
115
+ async function runFacebookStatusCheck() {
116
+ const clearChecking = () => {
117
+ element.clearEarnFacebookChecking?.();
118
+ };
119
+ if (!isAuthed()) {
120
+ clearChecking();
121
+ return;
122
+ }
123
+ try {
124
+ const fresh = await hostAdapter.data.getCustomer();
125
+ const facebook = socialToFacebook(fresh.social, readFacebookPageId(ctx.activeBlob));
126
+ if (!facebook)
127
+ return;
128
+ patchCustomer({ facebook });
129
+ writeProps(element, {
130
+ 'facebook-psid': facebook.psid,
131
+ 'facebook-stored-page-id': facebook.pageId,
132
+ 'facebook-name': facebook.name
133
+ });
134
+ }
135
+ catch {
136
+ }
137
+ finally {
138
+ clearChecking();
139
+ }
140
+ }
141
+ controller.on('joy-link-instagram', event => {
142
+ const { instagramUsername } = detail(event);
143
+ surface(runInstagramLink(instagramUsername, 'earn'));
144
+ });
145
+ controller.on('joy-update-instagram', event => {
146
+ const { instagramId } = detail(event);
147
+ surface(runInstagramLink(instagramId, 'profile'));
148
+ });
149
+ controller.on('joy-link-facebook', () => runFacebookLink());
150
+ controller.on('joy-check-facebook-status', () => void runFacebookStatusCheck());
151
+ controller.on('joy-disconnect-facebook', () => {
152
+ surface(hostAdapter.data.disconnectFacebook()
153
+ .then(() => {
154
+ setFacebookResult(true);
155
+ patchCustomer({ facebook: null });
156
+ writeProps(element, { 'facebook-psid': '', 'facebook-name': '' });
157
+ })
158
+ .catch((error) => {
159
+ setFacebookResult(false);
160
+ throw error;
161
+ }));
162
+ });
163
+ controller.on('joy-profile-save', event => {
164
+ const { firstName, lastName, phone, avatarBase64, birthdayMonth, birthdayDay, birthdayYear } = detail(event);
165
+ const setProfileResult = (ok, msg) => {
166
+ element.setProfileSaveResult?.(ok, msg);
167
+ };
168
+ if (birthdayMonth && birthdayDay) {
169
+ const mm = String(birthdayMonth).padStart(2, '0');
170
+ const dd = String(birthdayDay).padStart(2, '0');
171
+ const dateOfBirth = birthdayYear ? `${birthdayYear}-${mm}-${dd}` : undefined;
172
+ void hostAdapter.data.saveBirthday(`${mm}/${dd}`, dateOfBirth).catch(() => {
173
+ });
174
+ }
175
+ surface(hostAdapter.data.updateProfile({ firstName, lastName, phone, avatarBase64 })
176
+ .then(result => {
177
+ if (result.avatarUrl !== null) {
178
+ writeProps(element, { 'customer-avatar': result.avatarUrl });
179
+ }
180
+ setProfileResult(true);
181
+ })
182
+ .catch((error) => {
183
+ setProfileResult(false, error instanceof Error ? error.message : 'Failed to save profile');
184
+ throw error;
185
+ }));
186
+ });
187
+ controller.on('joy-avatar-change', event => {
188
+ const { avatarBase64 } = detail(event);
189
+ if (!avatarBase64)
190
+ return;
191
+ surface(hostAdapter.data.updateProfile({ avatarBase64 })
192
+ .then(result => {
193
+ if (result.avatarUrl !== null) {
194
+ writeProps(element, { 'customer-avatar': result.avatarUrl });
195
+ }
196
+ }));
197
+ });
198
+ const setAddressResult = (ok, msg) => {
199
+ element.setAddressSaveResult?.(ok, msg);
200
+ };
201
+ const backToProfile = (message) => {
202
+ loadAddresses();
203
+ element.navigateTo?.('profile');
204
+ toast(message);
205
+ };
206
+ controller.on('joy-address-save', event => {
207
+ surface(hostAdapter.data.saveAddress(toAddressInput(detail(event)))
208
+ .then(() => {
209
+ setAddressResult(true);
210
+ backToProfile('Address saved!');
211
+ })
212
+ .catch(() => {
213
+ const message = tLabel('Failed to save address. Please try again.');
214
+ setAddressResult(false, message);
215
+ toast(message);
216
+ }));
217
+ });
218
+ controller.on('joy-address-delete', event => {
219
+ const { id } = detail(event);
220
+ if (id == null)
221
+ return;
222
+ surface(hostAdapter.data.deleteAddress(String(id))
223
+ .then(() => {
224
+ setAddressResult(true);
225
+ backToProfile('Address deleted!');
226
+ })
227
+ .catch((error) => {
228
+ setAddressResult(false, error instanceof Error ? error.message : 'Failed to delete address');
229
+ throw error;
230
+ }));
231
+ });
232
+ controller.on('joy-marketing-change', event => {
233
+ const { acceptsMarketing } = detail(event);
234
+ if (typeof acceptsMarketing !== 'boolean')
235
+ return;
236
+ runConsentToggle('acceptsMarketing', 'accepts-marketing', acceptsMarketing);
237
+ });
238
+ controller.on('joy-sms-marketing-change', event => {
239
+ const { acceptsSmsMarketing } = detail(event);
240
+ if (typeof acceptsSmsMarketing !== 'boolean')
241
+ return;
242
+ runConsentToggle('acceptsSmsMarketing', 'accepts-sms-marketing', acceptsSmsMarketing);
243
+ });
244
+ controller.on('joy-notification-change', event => {
245
+ const { label, checked } = detail(event);
246
+ const customerId = String(ctx.activeCustomer?.id ?? '');
247
+ if (!label || typeof checked !== 'boolean' || !customerId)
248
+ return;
249
+ if (typeof window === 'undefined' || typeof localStorage === 'undefined')
250
+ return;
251
+ try {
252
+ const key = `joy_notification_prefs_${customerId}`;
253
+ const saved = JSON.parse(localStorage.getItem(key) || '{}');
254
+ saved[label] = checked;
255
+ localStorage.setItem(key, JSON.stringify(saved));
256
+ toast('Settings saved');
257
+ }
258
+ catch {
259
+ }
260
+ });
261
+ return { loadAddresses };
262
+ }
@@ -0,0 +1,6 @@
1
+ import type { OrchestratorContext } from '../context.js';
2
+ export interface RedeemHandlers {
3
+ restoreAvailableCouponsOnLeave(view?: string): void;
4
+ openCouponsView(): void;
5
+ }
6
+ export declare function registerRedeemHandlers(ctx: OrchestratorContext): RedeemHandlers;