@wix/himalaya-cli 0.1567.0 → 0.1569.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 (168) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/l10n/src/index.d.ts +9 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/message-format.d.ts +28 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/online-programs/src/index.d.ts +7 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/l10n.mjs +191 -0
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-online-programs.mjs +14 -1
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/package.json +4 -0
  7. package/dist/cli.mjs +20994 -20822
  8. package/dist/preview-assets.generated.bin +0 -0
  9. package/guides/app-config.md +10 -0
  10. package/guides/app-icon.md +20 -1
  11. package/guides/himi-json-output.md +7 -0
  12. package/guides/importable-sdks.md +1 -0
  13. package/guides/one-app-to-himi-app.md +14 -0
  14. package/guides/release-notes.md +6 -0
  15. package/guides/sdk-reference.json +41 -2
  16. package/guides/splash-screens.md +156 -5
  17. package/package.json +2 -2
  18. package/templates/beauty-salon/config.ts +12 -1
  19. package/templates/beauty-salon/dev/index.ts +265 -0
  20. package/templates/beauty-salon/himalaya.content.json +3 -0
  21. package/templates/beauty-salon/splash.json +3 -0
  22. package/templates/beauty-salon/tier5-src/_shared/himi-copy.ts +17 -6
  23. package/templates/beauty-salon/tier5-src/_shared/rich-body.ts +44 -0
  24. package/templates/beauty-salon/tier5-src/himi-booking-service/index.ts +13 -9
  25. package/templates/beauty-salon/tier5-src/himi-branded-lite-splash/index.ts +35 -0
  26. package/templates/beauty-salon/tier5-src/himi-store-account/index.ts +4 -0
  27. package/templates/beauty-salon-owner/config.ts +8 -0
  28. package/templates/beauty-salon-owner/dev/index.ts +1 -0
  29. package/templates/beauty-salon-owner/tier5-src/_shared/himi-copy.ts +17 -6
  30. package/templates/beauty-salon-owner/tier5-src/_shared/rich-body.ts +44 -0
  31. package/templates/branded-lite/config.ts +12 -1
  32. package/templates/branded-lite/dev/index.ts +299 -2
  33. package/templates/branded-lite/himalaya.content.json +3 -0
  34. package/templates/branded-lite/splash.json +3 -0
  35. package/templates/branded-lite/tier5-src/_shared/himi-copy.ts +17 -6
  36. package/templates/branded-lite/tier5-src/_shared/rich-body.ts +44 -0
  37. package/templates/branded-lite/tier5-src/himi-booking-service/index.ts +13 -9
  38. package/templates/branded-lite/tier5-src/himi-branded-lite-group/index.ts +20 -3
  39. package/templates/branded-lite/tier5-src/himi-branded-lite-groups/index.ts +18 -2
  40. package/templates/branded-lite/tier5-src/himi-branded-lite-notifsettings/index.ts +4 -2
  41. package/templates/branded-lite/tier5-src/himi-branded-lite-program/index.ts +124 -15
  42. package/templates/branded-lite/tier5-src/himi-branded-lite-splash/index.ts +35 -0
  43. package/templates/branded-lite/tier5-src/himi-store-account/index.ts +4 -0
  44. package/templates/brandy/tier5-src/_shared/himi-copy.ts +17 -6
  45. package/templates/community-club/config.ts +12 -1
  46. package/templates/community-club/dev/index.ts +267 -1
  47. package/templates/community-club/himalaya.content.json +3 -0
  48. package/templates/community-club/splash.json +3 -0
  49. package/templates/community-club/tier5-src/_shared/himi-copy.ts +17 -6
  50. package/templates/community-club/tier5-src/_shared/rich-body.ts +44 -0
  51. package/templates/community-club/tier5-src/himi-branded-lite-group/index.ts +20 -3
  52. package/templates/community-club/tier5-src/himi-branded-lite-groups/index.ts +18 -2
  53. package/templates/community-club/tier5-src/himi-branded-lite-splash/index.ts +35 -0
  54. package/templates/community-club/tier5-src/himi-store-account/index.ts +4 -0
  55. package/templates/community-club-owner/config.ts +8 -0
  56. package/templates/community-club-owner/dev/index.ts +1 -0
  57. package/templates/community-club-owner/tier5-src/_shared/himi-copy.ts +17 -6
  58. package/templates/community-club-owner/tier5-src/_shared/rich-body.ts +44 -0
  59. package/templates/events-meetups/config.ts +12 -1
  60. package/templates/events-meetups/dev/index.ts +267 -1
  61. package/templates/events-meetups/himalaya.content.json +3 -0
  62. package/templates/events-meetups/splash.json +3 -0
  63. package/templates/events-meetups/tier5-src/_shared/himi-copy.ts +17 -6
  64. package/templates/events-meetups/tier5-src/_shared/rich-body.ts +44 -0
  65. package/templates/events-meetups/tier5-src/himi-branded-lite-group/index.ts +20 -3
  66. package/templates/events-meetups/tier5-src/himi-branded-lite-groups/index.ts +18 -2
  67. package/templates/events-meetups/tier5-src/himi-branded-lite-splash/index.ts +35 -0
  68. package/templates/events-meetups/tier5-src/himi-store-account/index.ts +4 -0
  69. package/templates/events-meetups-owner/config.ts +8 -0
  70. package/templates/events-meetups-owner/dev/index.ts +1 -0
  71. package/templates/events-meetups-owner/tier5-src/_shared/himi-copy.ts +17 -6
  72. package/templates/events-meetups-owner/tier5-src/_shared/rich-body.ts +44 -0
  73. package/templates/gym-fitness/config.ts +12 -1
  74. package/templates/gym-fitness/dev/index.ts +265 -0
  75. package/templates/gym-fitness/himalaya.content.json +3 -0
  76. package/templates/gym-fitness/splash.json +3 -0
  77. package/templates/gym-fitness/tier5-src/_shared/himi-copy.ts +17 -6
  78. package/templates/gym-fitness/tier5-src/_shared/rich-body.ts +44 -0
  79. package/templates/gym-fitness/tier5-src/himi-booking-service/index.ts +13 -9
  80. package/templates/gym-fitness/tier5-src/himi-branded-lite-splash/index.ts +35 -0
  81. package/templates/gym-fitness/tier5-src/himi-store-account/index.ts +4 -0
  82. package/templates/gym-fitness-owner/config.ts +8 -0
  83. package/templates/gym-fitness-owner/dev/index.ts +1 -0
  84. package/templates/gym-fitness-owner/tier5-src/_shared/himi-copy.ts +17 -6
  85. package/templates/gym-fitness-owner/tier5-src/_shared/rich-body.ts +44 -0
  86. package/templates/himi-chat/dev/index.ts +1 -0
  87. package/templates/himi-chat/tier5-src/_shared/himi-copy.ts +17 -6
  88. package/templates/nonprofit-cause/config.ts +12 -1
  89. package/templates/nonprofit-cause/dev/index.ts +267 -1
  90. package/templates/nonprofit-cause/himalaya.content.json +3 -0
  91. package/templates/nonprofit-cause/splash.json +3 -0
  92. package/templates/nonprofit-cause/tier5-src/_shared/himi-copy.ts +17 -6
  93. package/templates/nonprofit-cause/tier5-src/_shared/rich-body.ts +44 -0
  94. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-group/index.ts +20 -3
  95. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-groups/index.ts +18 -2
  96. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-splash/index.ts +35 -0
  97. package/templates/nonprofit-cause/tier5-src/himi-store-account/index.ts +4 -0
  98. package/templates/nonprofit-cause-owner/config.ts +8 -0
  99. package/templates/nonprofit-cause-owner/dev/index.ts +1 -0
  100. package/templates/nonprofit-cause-owner/tier5-src/_shared/himi-copy.ts +17 -6
  101. package/templates/nonprofit-cause-owner/tier5-src/_shared/rich-body.ts +44 -0
  102. package/templates/owner-lite/config.ts +8 -0
  103. package/templates/owner-lite/dev/index.ts +1 -0
  104. package/templates/owner-lite/tier5-src/_shared/himi-copy.ts +17 -6
  105. package/templates/owner-lite/tier5-src/_shared/rich-body.ts +44 -0
  106. package/templates/podcast-creator/config.ts +12 -1
  107. package/templates/podcast-creator/dev/index.ts +237 -0
  108. package/templates/podcast-creator/himalaya.content.json +3 -0
  109. package/templates/podcast-creator/splash.json +3 -0
  110. package/templates/podcast-creator/tier5-src/_shared/himi-copy.ts +17 -6
  111. package/templates/podcast-creator/tier5-src/_shared/rich-body.ts +44 -0
  112. package/templates/podcast-creator/tier5-src/himi-branded-lite-splash/index.ts +35 -0
  113. package/templates/podcast-creator/tier5-src/himi-store-account/index.ts +4 -0
  114. package/templates/podcast-creator-owner/config.ts +8 -0
  115. package/templates/podcast-creator-owner/dev/index.ts +1 -0
  116. package/templates/podcast-creator-owner/tier5-src/_shared/himi-copy.ts +17 -6
  117. package/templates/podcast-creator-owner/tier5-src/_shared/rich-body.ts +44 -0
  118. package/templates/portfolio-creative/config.ts +12 -1
  119. package/templates/portfolio-creative/dev/index.ts +237 -0
  120. package/templates/portfolio-creative/himalaya.content.json +3 -0
  121. package/templates/portfolio-creative/splash.json +3 -0
  122. package/templates/portfolio-creative/tier5-src/_shared/himi-copy.ts +17 -6
  123. package/templates/portfolio-creative/tier5-src/_shared/rich-body.ts +44 -0
  124. package/templates/portfolio-creative/tier5-src/himi-branded-lite-splash/index.ts +35 -0
  125. package/templates/portfolio-creative/tier5-src/himi-store-account/index.ts +4 -0
  126. package/templates/portfolio-creative-owner/config.ts +8 -0
  127. package/templates/portfolio-creative-owner/dev/index.ts +1 -0
  128. package/templates/portfolio-creative-owner/tier5-src/_shared/himi-copy.ts +17 -6
  129. package/templates/portfolio-creative-owner/tier5-src/_shared/rich-body.ts +44 -0
  130. package/templates/restaurant/config.ts +12 -1
  131. package/templates/restaurant/dev/index.ts +237 -0
  132. package/templates/restaurant/himalaya.content.json +3 -0
  133. package/templates/restaurant/splash.json +3 -0
  134. package/templates/restaurant/tier5-src/_shared/himi-copy.ts +17 -6
  135. package/templates/restaurant/tier5-src/_shared/rich-body.ts +44 -0
  136. package/templates/restaurant/tier5-src/himi-branded-lite-splash/index.ts +35 -0
  137. package/templates/restaurant/tier5-src/himi-store-account/index.ts +4 -0
  138. package/templates/restaurant-owner/config.ts +8 -0
  139. package/templates/restaurant-owner/dev/index.ts +1 -0
  140. package/templates/restaurant-owner/tier5-src/_shared/himi-copy.ts +17 -6
  141. package/templates/restaurant-owner/tier5-src/_shared/rich-body.ts +44 -0
  142. package/templates/retail-store/config.ts +12 -1
  143. package/templates/retail-store/dev/index.ts +237 -0
  144. package/templates/retail-store/himalaya.content.json +3 -0
  145. package/templates/retail-store/splash.json +3 -0
  146. package/templates/retail-store/tier5-src/_shared/himi-copy.ts +17 -6
  147. package/templates/retail-store/tier5-src/_shared/rich-body.ts +44 -0
  148. package/templates/retail-store/tier5-src/himi-branded-lite-splash/index.ts +35 -0
  149. package/templates/retail-store/tier5-src/himi-store-account/index.ts +4 -0
  150. package/templates/retail-store-owner/config.ts +8 -0
  151. package/templates/retail-store-owner/dev/index.ts +1 -0
  152. package/templates/retail-store-owner/tier5-src/_shared/himi-copy.ts +17 -6
  153. package/templates/retail-store-owner/tier5-src/_shared/rich-body.ts +44 -0
  154. package/templates/surface-showcase/dev/index.ts +1 -0
  155. package/templates/yoga-studio/config.ts +12 -1
  156. package/templates/yoga-studio/dev/index.ts +269 -1
  157. package/templates/yoga-studio/himalaya.content.json +3 -0
  158. package/templates/yoga-studio/splash.json +3 -0
  159. package/templates/yoga-studio/tier5-src/_shared/himi-copy.ts +17 -6
  160. package/templates/yoga-studio/tier5-src/_shared/rich-body.ts +44 -0
  161. package/templates/yoga-studio/tier5-src/himi-booking-service/index.ts +13 -9
  162. package/templates/yoga-studio/tier5-src/himi-branded-lite-program/index.ts +124 -15
  163. package/templates/yoga-studio/tier5-src/himi-branded-lite-splash/index.ts +35 -0
  164. package/templates/yoga-studio/tier5-src/himi-store-account/index.ts +4 -0
  165. package/templates/yoga-studio-owner/config.ts +8 -0
  166. package/templates/yoga-studio-owner/dev/index.ts +1 -0
  167. package/templates/yoga-studio-owner/tier5-src/_shared/himi-copy.ts +17 -6
  168. package/templates/yoga-studio-owner/tier5-src/_shared/rich-body.ts +44 -0
@@ -0,0 +1,9 @@
1
+ /** Resolve app copy: active catalog, source catalog, then the key. Missing copy
2
+ * stays visible. The host performs both lookups from resident data, without I/O.
3
+ * Requires an l10n-capable host; the SDK foundation alone does not enable it. */
4
+ export declare function t(key: string, args?: Record<string, string | number>): string;
5
+ /** The app's active resolved locale, including any region subtag. */
6
+ export declare function locale(): string;
7
+ /** The active app locale's layout direction. */
8
+ export declare function dir(): "ltr" | "rtl";
9
+ export declare const version = 1;
@@ -0,0 +1,28 @@
1
+ /** CLDR cardinal plural categories, in the order a pattern may declare them. */
2
+ export type PluralCategory = "zero" | "one" | "two" | "few" | "many" | "other";
3
+ /**
4
+ * The CLDR cardinal rule for the locales Himi ships (`SUPPORTED_LOCALES`).
5
+ *
6
+ * `en`/`es` are two-form. `he` is the reason this function is not a one-liner: it has a
7
+ * dual for exactly 2, and a separate `many` for round tens. An implementation that
8
+ * assumed one/other would render Hebrew that reads as broken grammar to a native
9
+ * speaker while passing every English test.
10
+ */
11
+ export declare function pluralCategory(n: number, locale: string): PluralCategory;
12
+ /**
13
+ * The explicit CLDR table used where ECMA-402 does not exist (QuickJS: watchOS, Wear).
14
+ *
15
+ * EXPORTED so a test can compare it against `Intl.PluralRules` directly. Asserting
16
+ * through `pluralCategory` cannot check it: on any engine that has `Intl` the branch
17
+ * above wins, so the test would be comparing Intl to itself and would pass with the
18
+ * table arbitrarily wrong — which is how the obsolete Hebrew `many` rule nearly shipped.
19
+ */
20
+ export declare function pluralCategoryFallback(n: number, locale: string): PluralCategory;
21
+ /**
22
+ * Format an ICU pattern.
23
+ *
24
+ * Unknown arguments render as their own `{name}` placeholder rather than as empty — a
25
+ * visible marker is a better bug report than silently missing text, the same reasoning
26
+ * that makes a `$t:` miss fall back to its key.
27
+ */
28
+ export declare function formatMessage(pattern: string, args?: Record<string, unknown>, locale?: string): string;
@@ -158,6 +158,11 @@ export interface WixQueryParticipantsResponse {
158
158
  hasNext?: boolean;
159
159
  };
160
160
  }
161
+ /** Fresh member participation, matching Branded's member lookup (Search Participants).
162
+ * Results are scoped by the caller's authorization; the worker also verifies returned identity.
163
+ * @scope member
164
+ */
165
+ export declare function searchMemberParticipation(programId: string, memberId: string): Promise<WixQueryParticipantsResponse>;
161
166
  /** POST /online-programs/v3/participants/query — participants for one program. */
162
167
  export declare function queryParticipants(programId: string, opts?: {
163
168
  progressStatus?: string;
@@ -201,10 +206,12 @@ export interface WixJoinProgramResponse {
201
206
  * Approved paid applications prepare
202
207
  * SINGLE_PAYMENT and return the Wix Payments order as paymentPendingOptions.orderId.
203
208
  * mayPreparePayment rechecks the caller's checkout guard before creating that order.
209
+ * beforeWrite lets a resumed caller revalidate its confirmed member after asynchronous reads.
204
210
  * @scope member
205
211
  */
206
212
  export declare function joinProgram(programId: string, options?: {
207
213
  mayPreparePayment?: () => boolean;
214
+ beforeWrite?: () => Promise<void>;
208
215
  }): Promise<WixJoinProgramResponse>;
209
216
  /** The cashier handle to settle, or "" when no payable order is available. */
210
217
  export declare function payableIdOf(participant?: WixJoinedParticipant): string;
@@ -0,0 +1,191 @@
1
+ // ../../core/ts/src/message-format.ts
2
+ function pluralCategory(n, locale2) {
3
+ const lang = (locale2 || "en").split(/[-_]/)[0].toLowerCase();
4
+ if (typeof Intl !== "undefined" && typeof Intl.PluralRules === "function") {
5
+ try {
6
+ return new Intl.PluralRules(lang).select(n);
7
+ } catch {
8
+ }
9
+ }
10
+ return pluralCategoryFallback(n, lang);
11
+ }
12
+ function pluralCategoryFallback(n, locale2) {
13
+ const lang = (locale2 || "en").split(/[-_]/)[0].toLowerCase();
14
+ const i = Math.floor(Math.abs(n));
15
+ const isInt = Number.isInteger(n);
16
+ switch (lang) {
17
+ case "he":
18
+ if (i === 1 && isInt) return "one";
19
+ if (i === 2 && isInt) return "two";
20
+ return "other";
21
+ case "en":
22
+ case "es":
23
+ default:
24
+ return i === 1 && isInt ? "one" : "other";
25
+ }
26
+ }
27
+ function splitArg(body) {
28
+ const out = [];
29
+ let depth = 0;
30
+ let start = 0;
31
+ for (let i = 0; i < body.length && out.length < 2; i++) {
32
+ const c = body[i];
33
+ if (c === "{") depth++;
34
+ else if (c === "}") depth--;
35
+ else if (c === "," && depth === 0) {
36
+ out.push(body.slice(start, i).trim());
37
+ start = i + 1;
38
+ }
39
+ }
40
+ out.push(body.slice(start));
41
+ return out;
42
+ }
43
+ function parseBranches(spec) {
44
+ const branches = {};
45
+ let i = 0;
46
+ while (i < spec.length) {
47
+ while (i < spec.length && /\s/.test(spec[i])) i++;
48
+ const keyStart = i;
49
+ while (i < spec.length && !/\s|\{/.test(spec[i])) i++;
50
+ const key = spec.slice(keyStart, i).trim();
51
+ while (i < spec.length && /\s/.test(spec[i])) i++;
52
+ if (spec[i] !== "{" || !key) break;
53
+ let depth = 0;
54
+ const bodyStart = ++i;
55
+ for (; i < spec.length; i++) {
56
+ if (spec[i] === "{") depth++;
57
+ else if (spec[i] === "}") {
58
+ if (depth === 0) break;
59
+ depth--;
60
+ }
61
+ }
62
+ branches[key] = spec.slice(bodyStart, i);
63
+ i++;
64
+ }
65
+ return branches;
66
+ }
67
+ function formatMessage(pattern, args = {}, locale2 = "en") {
68
+ if (!pattern.includes("{") && !pattern.includes("''")) return pattern;
69
+ let out = "";
70
+ let i = 0;
71
+ while (i < pattern.length) {
72
+ const c = pattern[i];
73
+ if (c === "'" && pattern[i + 1] === "'") {
74
+ out += "'";
75
+ i += 2;
76
+ continue;
77
+ }
78
+ if (c === "'" && (pattern[i + 1] === "{" || pattern[i + 1] === "}" || pattern[i + 1] === "#")) {
79
+ const close = pattern.indexOf("'", i + 1);
80
+ if (close === -1) {
81
+ out += pattern.slice(i + 1);
82
+ break;
83
+ }
84
+ out += pattern.slice(i + 1, close);
85
+ i = close + 1;
86
+ continue;
87
+ }
88
+ if (c !== "{") {
89
+ out += c;
90
+ i++;
91
+ continue;
92
+ }
93
+ let depth = 0;
94
+ const start = ++i;
95
+ for (; i < pattern.length; i++) {
96
+ if (pattern[i] === "{") depth++;
97
+ else if (pattern[i] === "}") {
98
+ if (depth === 0) break;
99
+ depth--;
100
+ }
101
+ }
102
+ if (i >= pattern.length) {
103
+ out += "{" + pattern.slice(start);
104
+ break;
105
+ }
106
+ const body = pattern.slice(start, i);
107
+ i++;
108
+ const [name, kind, spec] = splitArg(body);
109
+ const value = args[name];
110
+ if (!kind) {
111
+ out += value === void 0 || value === null ? `{${name}}` : String(value);
112
+ continue;
113
+ }
114
+ if (kind === "plural" && spec !== void 0) {
115
+ const n = typeof value === "number" ? value : Number(value);
116
+ const branches = parseBranches(spec);
117
+ const exact = branches[`=${n}`];
118
+ const chosen = exact ?? branches[pluralCategory(n, locale2)] ?? branches.other;
119
+ if (chosen === void 0) {
120
+ out += "{" + body + "}";
121
+ continue;
122
+ }
123
+ out += formatMessage(chosen.replace(/#/g, Number.isFinite(n) ? String(n) : ""), args, locale2);
124
+ continue;
125
+ }
126
+ if (kind === "select" && spec !== void 0) {
127
+ const branches = parseBranches(spec);
128
+ const chosen = branches[String(value)] ?? branches.other;
129
+ if (chosen === void 0) {
130
+ out += "{" + body + "}";
131
+ continue;
132
+ }
133
+ out += formatMessage(chosen, args, locale2);
134
+ continue;
135
+ }
136
+ out += value === void 0 || value === null ? `{${name}}` : String(value);
137
+ }
138
+ return out;
139
+ }
140
+
141
+ // ../../core/sdk/l10n/src/index.ts
142
+ var lookup = globalThis.__himalaya_l10n;
143
+ if (typeof lookup !== "function") {
144
+ throw new Error("@himalaya/l10n requires an l10n-capable Himalaya host and the declared l10n capability");
145
+ }
146
+ function read(key) {
147
+ const raw = lookup(key);
148
+ let value;
149
+ try {
150
+ value = JSON.parse(raw);
151
+ } catch {
152
+ value = null;
153
+ }
154
+ const data = value && typeof value === "object" ? value : {};
155
+ if (typeof data.error === "string" && data.error) throw new Error(data.error);
156
+ return {
157
+ locale: typeof data.locale === "string" && data.locale ? data.locale : "en",
158
+ dir: data.dir === "rtl" ? "rtl" : "ltr",
159
+ ...typeof data.message === "string" && data.message ? { message: data.message } : {}
160
+ };
161
+ }
162
+ read(null);
163
+ function t(key, args) {
164
+ const { message, locale: locale2 } = read(key);
165
+ if (!message) return key;
166
+ const safeArgs = /* @__PURE__ */ Object.create(null);
167
+ if (args && typeof args === "object") {
168
+ for (const [name, value] of Object.entries(args)) {
169
+ if (typeof value === "string" || typeof value === "number" && Number.isFinite(value)) safeArgs[name] = value;
170
+ }
171
+ }
172
+ try {
173
+ return formatMessage(message, safeArgs, locale2);
174
+ } catch {
175
+ return message;
176
+ }
177
+ }
178
+ function locale() {
179
+ return read(null).locale;
180
+ }
181
+ function dir() {
182
+ return read(null).dir;
183
+ }
184
+ var version = 1;
185
+ export {
186
+ dir,
187
+ locale,
188
+ t,
189
+ version
190
+ };
191
+ //# sourceMappingURL=l10n.mjs.map
@@ -19,6 +19,16 @@ function queryPrograms(query, readOptions) {
19
19
  function getProgram(id, readOptions) {
20
20
  return wixCall("GET", `/online-programs/v3/programs/${encodeURIComponent(id)}`, void 0, readOptions);
21
21
  }
22
+ function searchMemberParticipation(programId, memberId) {
23
+ return wixCall("POST", "/online-programs/v3/participants/search", {
24
+ fields: ["PROGRESS"],
25
+ search: {
26
+ filter: { programId, memberId: { $in: [memberId] } },
27
+ sort: [{ fieldName: "createdDate", order: "DESC" }],
28
+ cursorPaging: { limit: 1 }
29
+ }
30
+ });
31
+ }
22
32
  function queryParticipants(programId, opts, readOptions) {
23
33
  const and = [{ programId: { $eq: programId } }];
24
34
  if (opts?.progressStatus) and.push({ progressStatus: { $eq: opts.progressStatus } });
@@ -43,12 +53,14 @@ async function joinProgram(programId, options) {
43
53
  } catch {
44
54
  }
45
55
  if (!currentReadSucceeded) {
56
+ await options?.beforeWrite?.();
46
57
  response = await wixCall("POST", JOIN_APPLICATIONS, { joinApplication: { programId } });
47
58
  }
48
59
  let application = response?.joinApplication;
49
60
  if (!application?.id || application.programId !== programId) throw joinProgramError("invalid_join_application", "invalid join application");
50
61
  if (application.status === "APPROVED" && ["PAYMENT_PENDING", "PAYMENT_FAILED", "PAYMENT_CANCELED"].includes(application.paymentStatus ?? "")) {
51
62
  if (options?.mayPreparePayment && !options.mayPreparePayment()) throw joinProgramError("payment_preparation_withdrawn", "payment preparation withdrawn");
63
+ await options?.beforeWrite?.();
52
64
  const prepared = await wixCall("POST", `${JOIN_APPLICATIONS}/${encodeURIComponent(application.id)}/prepare-payment`, { paymentType: "SINGLE_PAYMENT" });
53
65
  if (prepared?.joinApplication?.id !== application.id || prepared.joinApplication.programId !== programId) throw joinProgramError("invalid_prepared_application", "invalid prepared application");
54
66
  application = prepared.joinApplication;
@@ -74,6 +86,7 @@ export {
74
86
  joinProgram,
75
87
  payableIdOf,
76
88
  queryParticipants,
77
- queryPrograms
89
+ queryPrograms,
90
+ searchMemberParticipation
78
91
  };
79
92
  //# sourceMappingURL=wix-online-programs.mjs.map
@@ -146,6 +146,10 @@
146
146
  "types": "./dist/_types/core/sdk/kyber-api/src/index.d.ts",
147
147
  "import": "./dist/kyber-api.mjs"
148
148
  },
149
+ "./l10n": {
150
+ "types": "./dist/_types/core/sdk/l10n/src/index.d.ts",
151
+ "import": "./dist/l10n.mjs"
152
+ },
149
153
  "./live-activity": {
150
154
  "types": "./dist/_types/core/sdk/live-activity/src/index.d.ts",
151
155
  "import": "./dist/live-activity.mjs"