@wix/himalaya-cli 0.1576.0 → 0.1578.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 (95) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/clipboard/src/index.d.ts +32 -1
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/haptic/src/index.d.ts +69 -5
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/sdk-types/src/capabilities.generated.d.ts +2 -2
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/ui/src/index.d.ts +19 -2
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts +6 -0
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/loyalty/src/index.d.ts +64 -6
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/online-programs/src/index.d.ts +87 -0
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/audio-record.mjs +2 -2
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calendar.mjs +2 -2
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calls.mjs +2 -2
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/clipboard.mjs +58 -1
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/contacts.mjs +2 -2
  13. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/haptic.mjs +73 -4
  14. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/location.mjs +2 -2
  15. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/motion.mjs +2 -2
  16. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/photos.mjs +2 -2
  17. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdk-types.mjs +2 -2
  18. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/tasks.mjs +2 -2
  19. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/ui.mjs +5 -0
  20. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-loyalty.mjs +15 -3
  21. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-online-programs.mjs +42 -0
  22. package/dist/cli.mjs +7245 -6889
  23. package/dist/preview-assets.generated.bin +0 -0
  24. package/fixtures/wix-canned.json +56 -3
  25. package/guides/one-app-section-mappings.md +1 -1
  26. package/guides/one-app-to-himi-app.md +50 -1
  27. package/guides/qa-builds.md +14 -6
  28. package/guides/sdk-reference.json +249 -17
  29. package/guides/web-page-sdk-reference.md +2 -2
  30. package/package.json +2 -2
  31. package/templates/beauty-salon/tier5-src/_shared/branded-lite-hosted.ts +1 -0
  32. package/templates/beauty-salon/tier5-src/_shared/owner-load-error.ts +8 -0
  33. package/templates/beauty-salon-owner/dev/index.ts +52 -27
  34. package/templates/beauty-salon-owner/tier5-src/_shared/owner-load-error.ts +8 -0
  35. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-post/index.ts +20 -8
  36. package/templates/branded-lite/config.ts +7 -0
  37. package/templates/branded-lite/dev/index.ts +833 -0
  38. package/templates/branded-lite/himalaya.content.json +3 -0
  39. package/templates/branded-lite/l10n/en.json +4 -2
  40. package/templates/branded-lite/tier5-src/_shared/branded-lite-hosted.ts +1 -0
  41. package/templates/branded-lite/tier5-src/_shared/owner-load-error.ts +8 -0
  42. package/templates/branded-lite/tier5-src/himi-branded-lite-member-programs/index.ts +658 -0
  43. package/templates/community-club/tier5-src/_shared/branded-lite-hosted.ts +1 -0
  44. package/templates/community-club/tier5-src/_shared/owner-load-error.ts +8 -0
  45. package/templates/community-club-owner/dev/index.ts +52 -27
  46. package/templates/community-club-owner/tier5-src/_shared/owner-load-error.ts +8 -0
  47. package/templates/community-club-owner/tier5-src/himi-owner-lite-post/index.ts +20 -8
  48. package/templates/events-meetups/tier5-src/_shared/branded-lite-hosted.ts +1 -0
  49. package/templates/events-meetups/tier5-src/_shared/owner-load-error.ts +8 -0
  50. package/templates/events-meetups-owner/dev/index.ts +52 -27
  51. package/templates/events-meetups-owner/tier5-src/_shared/owner-load-error.ts +8 -0
  52. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-post/index.ts +20 -8
  53. package/templates/gym-fitness/tier5-src/_shared/branded-lite-hosted.ts +1 -0
  54. package/templates/gym-fitness/tier5-src/_shared/owner-load-error.ts +8 -0
  55. package/templates/gym-fitness-owner/dev/index.ts +52 -27
  56. package/templates/gym-fitness-owner/tier5-src/_shared/owner-load-error.ts +8 -0
  57. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-post/index.ts +20 -8
  58. package/templates/himi-chat/tier5-src/_shared/owner-load-error.ts +8 -0
  59. package/templates/nonprofit-cause/tier5-src/_shared/branded-lite-hosted.ts +1 -0
  60. package/templates/nonprofit-cause/tier5-src/_shared/owner-load-error.ts +8 -0
  61. package/templates/nonprofit-cause-owner/dev/index.ts +52 -27
  62. package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-load-error.ts +8 -0
  63. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-post/index.ts +20 -8
  64. package/templates/owner-lite/dev/index.ts +52 -27
  65. package/templates/owner-lite/tier5-src/_shared/owner-load-error.ts +8 -0
  66. package/templates/owner-lite/tier5-src/himi-owner-lite-post/index.ts +20 -8
  67. package/templates/podcast-creator/tier5-src/_shared/branded-lite-hosted.ts +1 -0
  68. package/templates/podcast-creator/tier5-src/_shared/owner-load-error.ts +8 -0
  69. package/templates/podcast-creator-owner/dev/index.ts +52 -27
  70. package/templates/podcast-creator-owner/tier5-src/_shared/owner-load-error.ts +8 -0
  71. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-post/index.ts +20 -8
  72. package/templates/portfolio-creative/tier5-src/_shared/branded-lite-hosted.ts +1 -0
  73. package/templates/portfolio-creative/tier5-src/_shared/owner-load-error.ts +8 -0
  74. package/templates/portfolio-creative-owner/dev/index.ts +52 -27
  75. package/templates/portfolio-creative-owner/tier5-src/_shared/owner-load-error.ts +8 -0
  76. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-post/index.ts +20 -8
  77. package/templates/restaurant/tier5-src/_shared/branded-lite-hosted.ts +1 -0
  78. package/templates/restaurant/tier5-src/_shared/owner-load-error.ts +8 -0
  79. package/templates/restaurant-owner/dev/index.ts +52 -27
  80. package/templates/restaurant-owner/tier5-src/_shared/owner-load-error.ts +8 -0
  81. package/templates/restaurant-owner/tier5-src/himi-owner-lite-post/index.ts +20 -8
  82. package/templates/retail-store/tier5-src/_shared/branded-lite-hosted.ts +1 -0
  83. package/templates/retail-store/tier5-src/_shared/owner-load-error.ts +8 -0
  84. package/templates/retail-store-owner/dev/index.ts +52 -27
  85. package/templates/retail-store-owner/tier5-src/_shared/owner-load-error.ts +8 -0
  86. package/templates/retail-store-owner/tier5-src/himi-owner-lite-post/index.ts +20 -8
  87. package/templates/yoga-studio/config.ts +7 -0
  88. package/templates/yoga-studio/dev/index.ts +833 -0
  89. package/templates/yoga-studio/himalaya.content.json +3 -0
  90. package/templates/yoga-studio/tier5-src/_shared/branded-lite-hosted.ts +1 -0
  91. package/templates/yoga-studio/tier5-src/_shared/owner-load-error.ts +8 -0
  92. package/templates/yoga-studio/tier5-src/himi-branded-lite-member-programs/index.ts +658 -0
  93. package/templates/yoga-studio-owner/dev/index.ts +52 -27
  94. package/templates/yoga-studio-owner/tier5-src/_shared/owner-load-error.ts +8 -0
  95. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-post/index.ts +20 -8
@@ -23,12 +23,12 @@ var CAPABILITY_REGISTRY = {
23
23
  "calendar": ["createEvent", "deleteEvent", "getPermissionStatus", "listEvents", "requestPermission", "updateEvent"],
24
24
  "calls": ["answer", "availability", "getPermissionStatus", "getState", "hangup", "listCalls", "offer", "receiveSignal", "reject", "requestPermission", "setMuted", "setRingback", "setSpeaker", "signalNext", "signalStart", "signalStop", "start", "subscribeEvents"],
25
25
  "camera": ["capture", "pickDocument", "prepareImage", "scanQR"],
26
- "clipboard": ["hasText", "readText", "writeText"],
26
+ "clipboard": ["hasImage", "hasText", "readText", "writeImage", "writeText"],
27
27
  "contacts": ["getPermissionStatus", "pick", "requestPermission", "search"],
28
28
  "file_picker": ["pick", "pickDirectoryForExport"],
29
29
  "files": ["list", "readText", "remove", "stat", "write"],
30
30
  "godot": ["loadPack", "release", "send"],
31
- "haptic": ["play"],
31
+ "haptic": ["play", "sequence", "vibrate"],
32
32
  "health": ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"],
33
33
  "himi_apps": ["canOpen", "current", "hostInfo", "open"],
34
34
  "iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore"],
@@ -23,12 +23,12 @@ var CAPABILITY_REGISTRY = {
23
23
  "calendar": ["createEvent", "deleteEvent", "getPermissionStatus", "listEvents", "requestPermission", "updateEvent"],
24
24
  "calls": ["answer", "availability", "getPermissionStatus", "getState", "hangup", "listCalls", "offer", "receiveSignal", "reject", "requestPermission", "setMuted", "setRingback", "setSpeaker", "signalNext", "signalStart", "signalStop", "start", "subscribeEvents"],
25
25
  "camera": ["capture", "pickDocument", "prepareImage", "scanQR"],
26
- "clipboard": ["hasText", "readText", "writeText"],
26
+ "clipboard": ["hasImage", "hasText", "readText", "writeImage", "writeText"],
27
27
  "contacts": ["getPermissionStatus", "pick", "requestPermission", "search"],
28
28
  "file_picker": ["pick", "pickDirectoryForExport"],
29
29
  "files": ["list", "readText", "remove", "stat", "write"],
30
30
  "godot": ["loadPack", "release", "send"],
31
- "haptic": ["play"],
31
+ "haptic": ["play", "sequence", "vibrate"],
32
32
  "health": ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"],
33
33
  "himi_apps": ["canOpen", "current", "hostInfo", "open"],
34
34
  "iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore"],
@@ -8,12 +8,12 @@ var CAPABILITY_REGISTRY = {
8
8
  "calendar": ["createEvent", "deleteEvent", "getPermissionStatus", "listEvents", "requestPermission", "updateEvent"],
9
9
  "calls": ["answer", "availability", "getPermissionStatus", "getState", "hangup", "listCalls", "offer", "receiveSignal", "reject", "requestPermission", "setMuted", "setRingback", "setSpeaker", "signalNext", "signalStart", "signalStop", "start", "subscribeEvents"],
10
10
  "camera": ["capture", "pickDocument", "prepareImage", "scanQR"],
11
- "clipboard": ["hasText", "readText", "writeText"],
11
+ "clipboard": ["hasImage", "hasText", "readText", "writeImage", "writeText"],
12
12
  "contacts": ["getPermissionStatus", "pick", "requestPermission", "search"],
13
13
  "file_picker": ["pick", "pickDirectoryForExport"],
14
14
  "files": ["list", "readText", "remove", "stat", "write"],
15
15
  "godot": ["loadPack", "release", "send"],
16
- "haptic": ["play"],
16
+ "haptic": ["play", "sequence", "vibrate"],
17
17
  "health": ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"],
18
18
  "himi_apps": ["canOpen", "current", "hostInfo", "open"],
19
19
  "iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore"],
@@ -23,12 +23,12 @@ var CAPABILITY_REGISTRY = {
23
23
  "calendar": ["createEvent", "deleteEvent", "getPermissionStatus", "listEvents", "requestPermission", "updateEvent"],
24
24
  "calls": ["answer", "availability", "getPermissionStatus", "getState", "hangup", "listCalls", "offer", "receiveSignal", "reject", "requestPermission", "setMuted", "setRingback", "setSpeaker", "signalNext", "signalStart", "signalStop", "start", "subscribeEvents"],
25
25
  "camera": ["capture", "pickDocument", "prepareImage", "scanQR"],
26
- "clipboard": ["hasText", "readText", "writeText"],
26
+ "clipboard": ["hasImage", "hasText", "readText", "writeImage", "writeText"],
27
27
  "contacts": ["getPermissionStatus", "pick", "requestPermission", "search"],
28
28
  "file_picker": ["pick", "pickDirectoryForExport"],
29
29
  "files": ["list", "readText", "remove", "stat", "write"],
30
30
  "godot": ["loadPack", "release", "send"],
31
- "haptic": ["play"],
31
+ "haptic": ["play", "sequence", "vibrate"],
32
32
  "health": ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"],
33
33
  "himi_apps": ["canOpen", "current", "hostInfo", "open"],
34
34
  "iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore"],
@@ -20,6 +20,11 @@ async function alert(options) {
20
20
  if (options.confirmLabel) params.confirmLabel = options.confirmLabel;
21
21
  if (options.cancelLabel) params.cancelLabel = options.cancelLabel;
22
22
  if (options.destructive) params.destructive = true;
23
+ if (options.confirm) {
24
+ const { label, actionId, args } = options.confirm;
25
+ params.confirm = JSON.stringify(args === void 0 ? { label, actionId } : { label, actionId, args });
26
+ params.confirmLabel = label;
27
+ }
23
28
  const r = await dispatch("capability.ui.alert", params);
24
29
  return { confirmed: r?.confirmed === true || r?.confirmed === "true" };
25
30
  }
@@ -20,17 +20,29 @@ function wixCall(method, path, body, readOptions) {
20
20
  return readOptions?.site ? api.call(method, path, body, { "wix-site-id": readOptions.site }) : api.call(method, path, body);
21
21
  }
22
22
  function getLoyaltyProgram(readOptions) {
23
- return wixCall("GET", "/loyalty/v1/program", void 0, readOptions);
23
+ return wixCall("GET", "/loyalty-programs/v1/program", void 0, readOptions);
24
+ }
25
+ function withLegacyRewardCost(reward) {
26
+ if (reward.requiredPoints !== void 0) return reward;
27
+ const configs = reward.discountAmount?.configsByTier ?? reward.couponReward?.fixedAmount?.configsByTier ?? reward.couponReward?.percentage?.configsByTier ?? reward.couponReward?.freeShipping?.configsByTier;
28
+ const base = configs?.filter((config) => !config.tierId);
29
+ if (base?.length !== 1) return reward;
30
+ const cost = base[0].costInPoints;
31
+ return typeof cost === "number" && Number.isFinite(cost) && cost >= 0 ? { ...reward, requiredPoints: cost } : reward;
24
32
  }
25
33
  function listLoyaltyRewards(readOptions) {
26
- return wixCall("GET", "/loyalty/v1/rewards", void 0, readOptions);
34
+ return wixCall("GET", "/loyalty-rewards/v1/rewards", void 0, readOptions).then((response) => response.rewards ? { ...response, rewards: response.rewards.map(withLegacyRewardCost) } : response);
27
35
  }
28
36
  function listLoyaltyTiers(readOptions) {
29
- return wixCall("GET", "/loyalty/v1/tiers", void 0, readOptions);
37
+ return wixCall("GET", "/loyalty-tiers/v1/tiers", void 0, readOptions);
38
+ }
39
+ function listLoyaltyEarningRules(readOptions) {
40
+ return wixCall("GET", "/_api/loyalty-earning-rules/v1/earning-rules/rules", void 0, readOptions);
30
41
  }
31
42
  export {
32
43
  getLoyaltyBffDashboard,
33
44
  getLoyaltyProgram,
45
+ listLoyaltyEarningRules,
34
46
  listLoyaltyRewards,
35
47
  listLoyaltyTiers,
36
48
  wixCall
@@ -81,10 +81,52 @@ function payableIdOf(participant) {
81
81
  const pending = participant?.paymentPendingOptions;
82
82
  return pending?.purchaseFlowId || pending?.snapshotId || pending?.orderId || "";
83
83
  }
84
+ var MEMBER_ENROLLMENT_STATUSES = {
85
+ joined: "JOINED",
86
+ suspended: "SUSPENDED",
87
+ unknown: "UNKNOWN_ENROLLMENT_STATUS"
88
+ };
89
+ var MEMBER_FINISHED_PROGRESS_STATUSES = ["COMPLETED", "FAILED"];
90
+ function queryMemberParticipants(opts) {
91
+ if (!opts?.memberId) throw new Error("queryMemberParticipants: memberId is required");
92
+ const limit = opts.limit ?? 100;
93
+ const query = opts.cursor ? { cursorPaging: { limit, cursor: opts.cursor } } : {
94
+ filter: {
95
+ memberId: opts.memberId,
96
+ $or: [
97
+ { enrollmentStatus: { $in: [MEMBER_ENROLLMENT_STATUSES.joined, MEMBER_ENROLLMENT_STATUSES.suspended] } },
98
+ { enrollmentStatus: MEMBER_ENROLLMENT_STATUSES.unknown, progressStatus: { $in: [...MEMBER_FINISHED_PROGRESS_STATUSES] } }
99
+ ]
100
+ },
101
+ cursorPaging: { limit }
102
+ };
103
+ return wixCall("POST", "/online-programs/v3/participants/query", { query, fields: ["PROGRESS"] });
104
+ }
105
+ function getParticipationStats(programIds) {
106
+ const ids = [...new Set((programIds ?? []).filter((id) => typeof id === "string" && id))];
107
+ if (!ids.length) return Promise.resolve({ participationStats: [] });
108
+ return wixCall("POST", "/online-programs/v3/participants/stats", { programIds: ids });
109
+ }
110
+ function getCurrentJoinApplication(programId) {
111
+ if (!programId) throw new Error("getCurrentJoinApplication: programId is required");
112
+ return wixCall(
113
+ "GET",
114
+ `/online-programs/participants/v3/join-applications/current/${encodeURIComponent(programId)}`
115
+ );
116
+ }
117
+ function listProgramCategories() {
118
+ return wixCall("GET", "/_api/program-categories-service/v3/categories");
119
+ }
84
120
  export {
121
+ MEMBER_ENROLLMENT_STATUSES,
122
+ MEMBER_FINISHED_PROGRESS_STATUSES,
123
+ getCurrentJoinApplication,
124
+ getParticipationStats,
85
125
  getProgram,
86
126
  joinProgram,
127
+ listProgramCategories,
87
128
  payableIdOf,
129
+ queryMemberParticipants,
88
130
  queryParticipants,
89
131
  queryPrograms,
90
132
  searchMemberParticipation