@wix/himalaya-cli 0.1753.0 → 0.1754.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.
@@ -63,6 +63,9 @@ export interface ScreenDescriptor {
63
63
  /** "" / "pinned" (default) | "floating": how the host draws `stickyFooter`. Mirror of
64
64
  * ScreenDescriptor.sticky_footer_placement in core.proto. */
65
65
  stickyFooterPlacement?: string;
66
+ /** A `$service:` token: each new non-empty value scrolls the screen back to the top. Mirror of
67
+ * ScreenDescriptor.scroll_to_top_path in core.proto. */
68
+ scrollToTopPath?: string;
66
69
  }
67
70
  /** Tier 3/4 + embeddable WebView behavior. Mirror of WebViewConfig in core.proto
68
71
  * (RFC 0038). All fields optional; zero values reproduce legacy behavior. */
@@ -897,9 +897,10 @@ export type Capability = "camera" | "barcode_scanner" | "biometrics" | "secure_s
897
897
  /** `defineApp({ socialSignIn })` — see AppConfig.socialSignIn. */
898
898
  export interface SocialSignInConfig {
899
899
  google?: {
900
- /** The iOS OAuth client: Info.plist GIDClientID and the token audience on iOS. */
900
+ /** The iOS OAuth client: Info.plist GIDClientID and the reversed-client-ID URL scheme. */
901
901
  iosClientId?: string;
902
- /** The WEB OAuth client Credential Manager mints the Android token for. */
902
+ /** The WEB OAuth client, the token audience on both platforms: Info.plist GIDServerClientID on iOS,
903
+ * the client Credential Manager mints for on Android. */
903
904
  serverClientId?: string;
904
905
  };
905
906
  }
@@ -3856,6 +3856,11 @@ export interface ScreenDescriptor {
3856
3856
  * over the bottom of the scroll with no band behind it (a Fab, a snackbar) and insets the
3857
3857
  * content by its height. Static; an unknown value is "pinned". */
3858
3858
  stickyFooterPlacement?: string;
3859
+ /** A `$service:` path used as a token: when its value CHANGES to a non-empty one, the screen's
3860
+ * own vertical scroll returns to the top (animated; none under Reduce Motion). The value on
3861
+ * first render is a baseline; an empty or unresolved value does nothing. A worker fires it
3862
+ * again by writing a new value (a counter, "x|3"). The rule of `LazyList.scrollToItemPath`. */
3863
+ scrollToTopPath?: string;
3859
3864
  etag?: string;
3860
3865
  cacheControl?: CacheControl;
3861
3866
  telemetryScreenName?: string;
@@ -157,6 +157,10 @@ export declare const screenDescriptorSchema: {
157
157
  readonly stickyFooterPlacement: {
158
158
  readonly type: "string";
159
159
  };
160
+ readonly scrollToTopPath: {
161
+ readonly type: "string";
162
+ readonly pattern: "^$|^\\$service:";
163
+ };
160
164
  readonly logicBundle: {
161
165
  readonly type: "object";
162
166
  readonly additionalProperties: false;
@@ -427,3 +427,178 @@ export interface WixGetPremiumStatsResponse {
427
427
  export declare function getPremiumStats(): Promise<WixGetPremiumStatsResponse>;
428
428
  /** True when participation is blocked by the free-tier cap (no premium, count over limit). */
429
429
  export declare function isParticipationBlocked(stats: WixGetPremiumStatsResponse | undefined): boolean;
430
+ export interface WixSection {
431
+ id?: string;
432
+ revision?: string;
433
+ programId?: string;
434
+ description?: {
435
+ title?: string;
436
+ };
437
+ totalSteps?: number;
438
+ ordering?: number;
439
+ delayInDays?: number;
440
+ }
441
+ export interface WixListSectionsResponse {
442
+ sections?: WixSection[];
443
+ }
444
+ /** GET /online-programs/v3/sections?programId= — every section of one program, in order.
445
+ * An empty list can mean the program has no sections OR the caller may not read them: the API does not tell the two apart.
446
+ * @scope member — a joined member (or a visitor of a program that allows it). */
447
+ export declare function listSections(programId: string, readOptions?: WixCallOptions): Promise<WixListSectionsResponse>;
448
+ export interface WixStep {
449
+ id?: string;
450
+ revision?: string;
451
+ programId?: string;
452
+ sectionId?: string;
453
+ description?: {
454
+ title?: string;
455
+ details?: unknown;
456
+ [field: string]: unknown;
457
+ };
458
+ ordering?: number;
459
+ /** VIDEO | QUIZ | TEXT | … — read `videoOptions` / `quizOptions` for the matching one. */
460
+ stepType?: string;
461
+ videoOptions?: Record<string, unknown>;
462
+ quizOptions?: {
463
+ id?: string;
464
+ totalQuestions?: number;
465
+ passingGrade?: number;
466
+ };
467
+ }
468
+ export interface WixQueryStepsResponse {
469
+ steps?: WixStep[];
470
+ pagingMetadata?: {
471
+ count?: number;
472
+ hasNext?: boolean;
473
+ cursors?: {
474
+ next?: string | null;
475
+ prev?: string | null;
476
+ };
477
+ };
478
+ }
479
+ export interface WixQueryStepsOptions {
480
+ /** Narrow to one section. */
481
+ sectionId?: string;
482
+ /** Page size, 1..100; default 100. */
483
+ limit?: number;
484
+ /** `pagingMetadata.cursors.next` of the previous page. A cursor page carries no filter: the cursor holds the section filter, as in the other cursor pages here. */
485
+ cursor?: string;
486
+ /** Which description fields come back; omit for the API default (the participant view). */
487
+ descriptionFieldSet?: string;
488
+ }
489
+ /** POST /online-programs/v3/steps/query — the steps of one program as a participant sees them.
490
+ * @scope member */
491
+ export declare function queryParticipantSteps(programId: string, opts?: WixQueryStepsOptions, readOptions?: WixCallOptions): Promise<WixQueryStepsResponse>;
492
+ export interface WixResolvedStep {
493
+ id?: string;
494
+ participantId?: string;
495
+ programStepId?: string;
496
+ quizSubmissionId?: string;
497
+ earnedScore?: number;
498
+ passingGrade?: number;
499
+ /** A free string in the spec; the API defines no values there, so none are listed here. */
500
+ status?: string;
501
+ createdDate?: string;
502
+ updatedDate?: string;
503
+ }
504
+ export interface WixQueryResolvedStepsResponse {
505
+ resolvedSteps?: WixResolvedStep[];
506
+ pagingMetadata?: {
507
+ count?: number;
508
+ hasNext?: boolean;
509
+ cursors?: {
510
+ next?: string | null;
511
+ prev?: string | null;
512
+ };
513
+ };
514
+ }
515
+ /** POST /online-programs/participants/v3/resolved-steps/query — the steps one participant finished.
516
+ * An empty list means nothing is done yet, never that the read failed. A cursor page carries no filter: the cursor
517
+ * holds the participant filter, so pass the cursor from the same participant's previous page.
518
+ * @scope member */
519
+ export declare function queryResolvedSteps(participantId: string, opts?: {
520
+ limit?: number;
521
+ cursor?: string;
522
+ }, readOptions?: WixCallOptions): Promise<WixQueryResolvedStepsResponse>;
523
+ /** POST /online-programs/participants/v3/resolved-steps/upsert/participant/{participantId}/step/{stepId}
524
+ * — complete a step. Repeating the call for the same pair updates the one resolved step.
525
+ * The ids in the body always come from the two arguments, so they match the path. `status` is sent as given
526
+ * and is NOT defaulted: the spec lists no values and no default, so the caller passes what the site expects.
527
+ * A quiz step's score is the server's to set from `quizSubmissionId`; the binding does not send one.
528
+ * @scope member — the participant must be the signed-in member's own. */
529
+ export declare function completeStep(participantId: string, programStepId: string, resolvedStep?: Pick<WixResolvedStep, "status" | "quizSubmissionId">, options?: WixCallOptions): Promise<{
530
+ resolvedStep?: WixResolvedStep;
531
+ }>;
532
+ /** DELETE /online-programs/participants/v3/resolved-steps/{resolvedStepId} — undo a completed step.
533
+ * @scope member */
534
+ export declare function undoStep(resolvedStepId: string, options?: WixCallOptions): Promise<Record<string, never>>;
535
+ export interface WixQuizField {
536
+ id?: string;
537
+ /** The key a submission's `answers` use for this question (not `id`). */
538
+ target?: string;
539
+ /** The question text. */
540
+ question?: string;
541
+ score?: number;
542
+ rightMessage?: string;
543
+ wrongMessage?: string;
544
+ /** One of `numeric` / `shortText` / `longText` / `singleChoice` / `multiChoice` / `fileUpload` is set. */
545
+ [fieldType: string]: unknown;
546
+ }
547
+ export interface WixQuiz {
548
+ id?: string;
549
+ revision?: string;
550
+ settings?: {
551
+ passingGrade?: number;
552
+ title?: string;
553
+ attempts?: number;
554
+ };
555
+ fields?: WixQuizField[];
556
+ }
557
+ /** GET /online-programs/v1/quizzes/{quizId} — a quiz with its questions. `quizId` is the step's `quizOptions.id`.
558
+ * NOT callable by a member: on amit1 the gateway answers a member token with an empty 403 (the lock lists
559
+ * only the APP identity for this route). The submission route below does accept a member.
560
+ * @scope owner — the quiz definition is app-identity only, so a member session cannot read it. */
561
+ export declare function getQuiz(quizId: string, readOptions?: WixCallOptions): Promise<{
562
+ quiz?: WixQuiz;
563
+ }>;
564
+ export interface WixQuizAnswer {
565
+ fieldId?: string;
566
+ value?: unknown;
567
+ score?: number;
568
+ correct?: boolean;
569
+ message?: string;
570
+ }
571
+ export interface WixQuizSubmission {
572
+ id?: string;
573
+ quizId?: string;
574
+ /** The participant the answers belong to: pass the signed-in member's own participant id. */
575
+ groupId?: string;
576
+ earnedGrade?: number;
577
+ passingGrade?: number;
578
+ /** Keyed by question `target` (`WixQuizField.target`). */
579
+ answers?: Record<string, WixQuizAnswer>;
580
+ evaluationStatus?: string;
581
+ }
582
+ /** POST /online-programs/v1/quiz-submissions — submit answers; the response carries the evaluation.
583
+ * @scope member */
584
+ export declare function createQuizSubmission(submission: {
585
+ quizId: string;
586
+ groupId?: string;
587
+ answers: Record<string, WixQuizAnswer>;
588
+ }, options?: WixCallOptions): Promise<{
589
+ quizSubmission?: WixQuizSubmission;
590
+ }>;
591
+ /** DELETE /online-programs/v3/participants/{participantId} — the member leaves the program.
592
+ * Removes the member's own participation: pass the participant id from `queryMemberParticipants` / `listMyParticipations`,
593
+ * never another member's. Whether progress is kept is not documented by the spec.
594
+ * Verified on amit1: a member leaving their own participation gets `{}` and the participant's
595
+ * `enrollmentStatus` becomes `LEFT`.
596
+ * @scope member */
597
+ export declare function leaveProgram(participantId: string, options?: WixCallOptions): Promise<Record<string, never>>;
598
+ export interface WixCertificateDownloadUrl {
599
+ downloadUrl?: string;
600
+ expirationDate?: string;
601
+ }
602
+ /** GET /online-programs/v3/participants/{participantId}/certificate-download-url — a time-limited link.
603
+ * @scope member */
604
+ export declare function getCertificateDownloadUrl(participantId: string, readOptions?: WixCallOptions): Promise<WixCertificateDownloadUrl>;
@@ -9048,6 +9048,9 @@ var screenDescriptorSchema = {
9048
9048
  // "" / "pinned" (default) | "floating" — how the host draws `stickyFooter`. A free string
9049
9049
  // like every chrome discriminator: an unknown value coalesces to "pinned" (invariant 6).
9050
9050
  stickyFooterPlacement: { type: "string" },
9051
+ // A `$service:` token: each new non-empty value scrolls the screen back to the top. A literal never changes,
9052
+ // so it could never fire: the path must be a binding (or empty, which is unset), as transcriptScroll.anchorPath.
9053
+ scrollToTopPath: { type: "string", pattern: "^$|^\\$service:" },
9051
9054
  // RFC 0002 — Tier-5 worker bundle reference (LogicBundleRef). Without this in
9052
9055
  // the schema, `additionalProperties:false` rejected EVERY T5 descriptor, so the
9053
9056
  // admin's pre-push validation 400'd any edit of a T5 screen.
@@ -7060,6 +7060,9 @@ var screenDescriptorSchema = {
7060
7060
  // "" / "pinned" (default) | "floating" — how the host draws `stickyFooter`. A free string
7061
7061
  // like every chrome discriminator: an unknown value coalesces to "pinned" (invariant 6).
7062
7062
  stickyFooterPlacement: { type: "string" },
7063
+ // A `$service:` token: each new non-empty value scrolls the screen back to the top. A literal never changes,
7064
+ // so it could never fire: the path must be a binding (or empty, which is unset), as transcriptScroll.anchorPath.
7065
+ scrollToTopPath: { type: "string", pattern: "^$|^\\$service:" },
7063
7066
  // RFC 0002 — Tier-5 worker bundle reference (LogicBundleRef). Without this in
7064
7067
  // the schema, `additionalProperties:false` rejected EVERY T5 descriptor, so the
7065
7068
  // admin's pre-push validation 400'd any edit of a T5 screen.
@@ -237,6 +237,61 @@ function isParticipationBlocked(stats) {
237
237
  const limit = stats.activeParticipantsLimit;
238
238
  return typeof limit === "number" && count > limit;
239
239
  }
240
+ function listSections(programId, readOptions) {
241
+ if (!programId) throw new Error("listSections: programId is required");
242
+ return wixCall("GET", `/online-programs/v3/sections?programId=${encodeURIComponent(programId)}`, void 0, readOptions);
243
+ }
244
+ function queryParticipantSteps(programId, opts = {}, readOptions) {
245
+ if (!programId) throw new Error("queryParticipantSteps: programId is required");
246
+ const limit = clampPageLimit(opts.limit, 100);
247
+ const query = opts.cursor ? { cursorPaging: { limit, cursor: opts.cursor } } : {
248
+ // Verified on amit1: a member's call IGNORES the top-level `programId` and returns the steps of every program,
249
+ // so the program must be in the filter. The API accepts an `ordering` sort only together with a `sectionId` filter.
250
+ filter: { programId: { $eq: programId }, ...opts.sectionId ? { sectionId: { $eq: opts.sectionId } } : {} },
251
+ ...opts.sectionId ? { sort: [{ fieldName: "ordering", order: "ASC" }] } : {},
252
+ cursorPaging: { limit }
253
+ };
254
+ return wixCall("POST", "/online-programs/v3/steps/query", {
255
+ programId,
256
+ query,
257
+ ...opts.descriptionFieldSet ? { descriptionFieldSet: opts.descriptionFieldSet } : {}
258
+ }, readOptions);
259
+ }
260
+ function queryResolvedSteps(participantId, opts = {}, readOptions) {
261
+ if (!participantId) throw new Error("queryResolvedSteps: participantId is required");
262
+ const limit = clampPageLimit(opts.limit, 100);
263
+ const query = opts.cursor ? { cursorPaging: { limit, cursor: opts.cursor } } : { filter: { participantId: { $eq: participantId } }, cursorPaging: { limit } };
264
+ return wixCall("POST", "/online-programs/participants/v3/resolved-steps/query", { query }, readOptions);
265
+ }
266
+ function completeStep(participantId, programStepId, resolvedStep = {}, options) {
267
+ if (!participantId || !programStepId) throw new Error("completeStep: participantId and programStepId are required");
268
+ return wixCall(
269
+ "POST",
270
+ `/online-programs/participants/v3/resolved-steps/upsert/participant/${encodeURIComponent(participantId)}/step/${encodeURIComponent(programStepId)}`,
271
+ { resolvedStep: { ...resolvedStep.status !== void 0 ? { status: resolvedStep.status } : {}, ...resolvedStep.quizSubmissionId ? { quizSubmissionId: resolvedStep.quizSubmissionId } : {}, participantId, programStepId } },
272
+ options
273
+ );
274
+ }
275
+ function undoStep(resolvedStepId, options) {
276
+ if (!resolvedStepId) throw new Error("undoStep: resolvedStepId is required");
277
+ return wixCall("DELETE", `/online-programs/participants/v3/resolved-steps/${encodeURIComponent(resolvedStepId)}`, void 0, options);
278
+ }
279
+ function getQuiz(quizId, readOptions) {
280
+ if (!quizId) throw new Error("getQuiz: quizId is required");
281
+ return wixCall("GET", `/online-programs/v1/quizzes/${encodeURIComponent(quizId)}`, void 0, readOptions);
282
+ }
283
+ function createQuizSubmission(submission, options) {
284
+ if (!submission?.quizId) throw new Error("createQuizSubmission: quizId is required");
285
+ return wixCall("POST", "/online-programs/v1/quiz-submissions", { quizSubmission: submission }, options);
286
+ }
287
+ function leaveProgram(participantId, options) {
288
+ if (!participantId) throw new Error("leaveProgram: participantId is required");
289
+ return wixCall("DELETE", `/online-programs/v3/participants/${encodeURIComponent(participantId)}`, void 0, options);
290
+ }
291
+ function getCertificateDownloadUrl(participantId, readOptions) {
292
+ if (!participantId) throw new Error("getCertificateDownloadUrl: participantId is required");
293
+ return wixCall("GET", `/online-programs/v3/participants/${encodeURIComponent(participantId)}/certificate-download-url`, void 0, readOptions);
294
+ }
240
295
  function clampPageLimit(limit, max) {
241
296
  const n = Math.floor(limit ?? max);
242
297
  if (!Number.isFinite(n) || n < 1) return 1;
@@ -255,22 +310,31 @@ export {
255
310
  MEMBER_FINISHED_PROGRESS_STATUSES,
256
311
  PENDING_JOIN_APPLICATION_STATUSES,
257
312
  cancelJoinApplication,
313
+ completeStep,
314
+ createQuizSubmission,
315
+ getCertificateDownloadUrl,
258
316
  getCurrentJoinApplication,
259
317
  getParticipationStats,
260
318
  getPremiumStats,
261
319
  getProgram,
320
+ getQuiz,
262
321
  isParticipationBlocked,
263
322
  joinProgram,
323
+ leaveProgram,
264
324
  listJoinApplications,
265
325
  listMyParticipations,
266
326
  listProgramCategories,
327
+ listSections,
267
328
  participantsShownByProgram,
268
329
  participationsByProgram,
269
330
  payableIdOf,
270
331
  queryJoinApplications,
271
332
  queryMemberParticipants,
333
+ queryParticipantSteps,
272
334
  queryParticipants,
273
335
  queryPrograms,
274
- searchMemberParticipation
336
+ queryResolvedSteps,
337
+ searchMemberParticipation,
338
+ undoStep
275
339
  };
276
340
  //# sourceMappingURL=wix-online-programs.mjs.map
@@ -2,7 +2,7 @@
2
2
  "files": [
3
3
  {
4
4
  "name": "sw.js",
5
- "bytes": 2570584
5
+ "bytes": 2572028
6
6
  },
7
7
  {
8
8
  "name": "host.html",
@@ -21,7 +21,7 @@
21
21
  "bytes": 24320
22
22
  },
23
23
  {
24
- "name": "preview-deferred/2671d1cadb15daa5e59440f4c924e30c221ab3d405e8a56a0ab1cdbe4764af3d.bin",
24
+ "name": "preview-deferred/707207384524513171a679366d75e91a1652b53eb3de01ef15418c4ba68c9370.bin",
25
25
  "bytes": 488215
26
26
  },
27
27
  {
@@ -79,10 +79,10 @@
79
79
  ],
80
80
  "deferred": [
81
81
  {
82
- "key": "assets/pdf-C6dm8ZFK.js",
82
+ "key": "assets/pdf-CR8c7gMK.js",
83
83
  "contentType": "application/javascript; charset=utf-8",
84
- "sha256": "2671d1cadb15daa5e59440f4c924e30c221ab3d405e8a56a0ab1cdbe4764af3d",
85
- "file": "preview-deferred/2671d1cadb15daa5e59440f4c924e30c221ab3d405e8a56a0ab1cdbe4764af3d.bin"
84
+ "sha256": "707207384524513171a679366d75e91a1652b53eb3de01ef15418c4ba68c9370",
85
+ "file": "preview-deferred/707207384524513171a679366d75e91a1652b53eb3de01ef15418c4ba68c9370.bin"
86
86
  },
87
87
  {
88
88
  "key": "assets/pdf.worker.min-BGnVRhRG.js",