@wix/himalaya-cli 0.1723.0 → 0.1724.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.
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/app-config.d.ts +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/app-module.d.ts +2 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/godot/src/index.d.ts +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/attendance-classifier.d.ts +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/wix-payments-contract.d.ts +3 -39
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts +10 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/index.d.ts +2 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/preview-surfaces.d.ts +24 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-web-sdk.d.ts +37 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-web-sdk.generated.d.ts +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/wrapped-app-link.d.ts +13 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/checkout-source.d.ts +2 -3
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-order-backend.d.ts +0 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/attendance.d.ts +2 -8
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/index.d.ts +4 -13
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +175 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap-checkout.mjs +46 -502
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap.mjs +5 -26
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +64 -648
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +1 -0
- package/dist/browser-plane/assets.json +5 -5
- package/dist/browser-plane/package-reader.js +4 -4
- package/dist/browser-plane/preview-deferred/{74e5b76ecf38392d7eb3f9a9512d60a0675de85d411c9c56293e123152b3f70b.bin → a6e25c06d2a17ab2b5e34bf2b5965fa3ddd76ce3da32a036e546a60938130d7b.bin} +1 -1
- package/dist/browser-plane/sw.js +9 -9
- package/dist/cli.mjs +1275 -408
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/himi-json-output.md +6 -2
- package/guides/iap-screen-adoption.md +4 -4
- package/guides/sdk-reference.json +11 -74
- package/guides/webview-page-sdk.md +14 -0
- package/guides/wix-business-context.md +24 -0
- package/guides/wix-site-to-himi-app.md +2 -1
- package/package.json +2 -2
- package/templates/beauty-salon/tier5-src/himi-store-account/index.ts +2 -2
- package/templates/beauty-salon/tier5-src/himi-store-product/index.ts +5 -8
- package/templates/branded-lite/tier5-src/himi-store-account/index.ts +2 -2
- package/templates/branded-lite/tier5-src/himi-store-product/index.ts +5 -8
- package/templates/brandy/README.md +13 -0
- package/templates/brandy/config.ts +15 -1
- package/templates/brandy/dev/index.ts +10 -7
- package/templates/community-club/tier5-src/himi-store-account/index.ts +2 -2
- package/templates/conference/tier5-src/himi-store-account/index.ts +2 -2
- package/templates/events-meetups/tier5-src/himi-store-account/index.ts +2 -2
- package/templates/gym-fitness/tier5-src/himi-store-account/index.ts +2 -2
- package/templates/gym-fitness/tier5-src/himi-store-product/index.ts +5 -8
- package/templates/nonprofit-cause/tier5-src/himi-store-account/index.ts +2 -2
- package/templates/podcast-creator/tier5-src/himi-store-account/index.ts +2 -2
- package/templates/portfolio-creative/tier5-src/himi-store-account/index.ts +2 -2
- package/templates/portfolio-creative/tier5-src/himi-store-product/index.ts +5 -8
- package/templates/restaurant/tier5-src/himi-store-account/index.ts +2 -2
- package/templates/retail-store/tier5-src/himi-store-account/index.ts +2 -2
- package/templates/retail-store/tier5-src/himi-store-product/index.ts +5 -8
- package/templates/salon-spa/tier5-src/himi-store-account/index.ts +2 -2
- package/templates/wholesale-store/tier5-src/himi-store-account/index.ts +2 -2
- package/templates/wholesale-store/tier5-src/himi-store-product/index.ts +5 -8
- package/templates/yoga-studio/tier5-src/himi-store-account/index.ts +2 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/attendance-orders.d.ts +0 -10
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/online-programs-orders.d.ts +0 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/pricing-plans-orders.d.ts +0 -2
|
@@ -9605,6 +9605,7 @@ function deriveAppMeta(name, m, platforms = {}, provisioning = {}) {
|
|
|
9605
9605
|
...provisioning.contract ? { releaseContract: provisioning.contract } : {},
|
|
9606
9606
|
control: config.control,
|
|
9607
9607
|
appLinkHosts: config.appLinkHosts,
|
|
9608
|
+
wrappedAppLinks: config.wrappedAppLinks,
|
|
9608
9609
|
permissionCopy: config.permissionCopy,
|
|
9609
9610
|
tabBar: config.navigation?.tabBar,
|
|
9610
9611
|
drawer: config.navigation?.drawer,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"files": [
|
|
3
3
|
{
|
|
4
4
|
"name": "sw.js",
|
|
5
|
-
"bytes":
|
|
5
|
+
"bytes": 2515358
|
|
6
6
|
},
|
|
7
7
|
{
|
|
8
8
|
"name": "host.html",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"bytes": 23064
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
"name": "preview-deferred/
|
|
24
|
+
"name": "preview-deferred/a6e25c06d2a17ab2b5e34bf2b5965fa3ddd76ce3da32a036e546a60938130d7b.bin",
|
|
25
25
|
"bytes": 488215
|
|
26
26
|
},
|
|
27
27
|
{
|
|
@@ -79,10 +79,10 @@
|
|
|
79
79
|
],
|
|
80
80
|
"deferred": [
|
|
81
81
|
{
|
|
82
|
-
"key": "assets/pdf-
|
|
82
|
+
"key": "assets/pdf-lBqZPqkf.js",
|
|
83
83
|
"contentType": "application/javascript; charset=utf-8",
|
|
84
|
-
"sha256": "
|
|
85
|
-
"file": "preview-deferred/
|
|
84
|
+
"sha256": "a6e25c06d2a17ab2b5e34bf2b5965fa3ddd76ce3da32a036e546a60938130d7b",
|
|
85
|
+
"file": "preview-deferred/a6e25c06d2a17ab2b5e34bf2b5965fa3ddd76ce3da32a036e546a60938130d7b.bin"
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
"key": "assets/pdf.worker.min-BGnVRhRG.js",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
2
|
-
`)}var
|
|
3
|
-
${
|
|
4
|
-
`)}`:`not a Himi package \u2014 no ${b}`);if(w(
|
|
1
|
+
var h="himi-package/2",v="himi-package/1",g="himi-package.json",b="release-manifest.json",H="source.zip";function w(n){return n?.contents==="dev"?"dev":"release"}var z=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/,A=/^[a-f0-9]{64}$/;function E(n){return z.test(n)}function V(n){return Array.isArray(n.handlers)?n.handlers:[]}var S=n=>{if(typeof TextDecoder>"u")throw new Error("this JS host has no TextDecoder, so package text cannot be decoded safely");return new TextDecoder().decode(n)};function I(n,t,e){let s=n(t);if(!s)return null;try{return JSON.parse(S(s))}catch(r){return e.push(`${t} is not valid JSON: ${r.message}`),null}}function _(n,t={}){let e=[],s=[],r=I(n,g,e);if(!r&&t.requireHeader&&e.push(`${g} is missing \u2014 not a .himi package`),r&&r.format!==h&&r.format!==v&&e.push(`unsupported package format ${JSON.stringify(r.format)} (this build reads ${v} and ${h})`),r?.format===h&&r.launchMode!=="live"&&r.launchMode!=="snapshot"&&e.push(`${g} format ${h} needs launchMode "live" or "snapshot"`),r?.format===h&&(typeof r.contentHash!="string"||r.contentHash.trim()==="")&&e.push(`${g} format ${h} needs contentHash`),r&&r.contents!==void 0&&r.contents!=="release"&&r.contents!=="dev")e.push(`${g} has an unreadable contents ${JSON.stringify(r.contents)} (expected "release" or "dev")`);else if(r){let a=n(H)!==null;w(r)==="dev"&&!a&&e.push(`${H} is missing \u2014 the header says this package carries source`),w(r)==="release"&&a&&e.push(`${H} is present in a package whose header declares no source`)}let i=I(n,b,e);if(!i)return e.some(a=>a.startsWith(b))||e.push(`${b} is missing`),{ok:!1,errors:e,warnings:s,header:r,manifest:null};let l=i.screens,c=i.bundles;if((!l||typeof l!="object")&&e.push("release-manifest.json missing 'screens' object"),(!c||typeof c!="object")&&e.push("release-manifest.json missing 'bundles' object"),e.length>0)return{ok:!1,errors:e,warnings:s,header:r,manifest:i};r&&(r.app&&i.app&&r.app!==i.app&&e.push(`header app ${JSON.stringify(r.app)} disagrees with manifest app ${JSON.stringify(i.app)}`),r.releaseId&&i.releaseId&&r.releaseId!==i.releaseId&&e.push(`header releaseId ${JSON.stringify(r.releaseId)} disagrees with manifest releaseId ${JSON.stringify(i.releaseId)}`),t.contentHash&&r.contentHash&&t.contentHash!==r.contentHash&&e.push("contentHash mismatch \u2014 the package was truncated or modified after packing"));for(let[a,o]of Object.entries(l??{})){if(!E(a)){e.push(`screen id ${JSON.stringify(a)} is not a safe entry name`);continue}n(`screens/${a}.json`)||e.push(`screens/${a}.json missing (referenced in manifest)`);let u=o?.bundle;u!=null&&!(u in(c??{}))&&e.push(`screen "${a}" references bundle "${u}" which is absent from manifest.bundles`)}for(let[a,o]of Object.entries(c??{})){if(!o?.sha256||!A.test(o.sha256)){e.push(`bundle "${a}" has no valid sha256`);continue}n(`bundles/${o.sha256}.bundle.js`)||e.push(`bundles/${o.sha256}.bundle.js missing (bundle "${a}")`)}i.handlers!=null&&!Array.isArray(i.handlers)&&e.push(`manifest.handlers must be an array (got ${typeof i.handlers})`);for(let a of V(i)){let o=JSON.stringify(a?.id??"?");if(!a?.bundleHash||!A.test(a.bundleHash)){e.push(`handler ${o} has no valid bundleHash`);continue}n(`bundles/${a.bundleHash}.bundle.js`)||e.push(`bundles/${a.bundleHash}.bundle.js missing (handler ${o})`)}for(let[a,o]of Object.entries(i.assets??{})){if(!o?.sha256||!A.test(o.sha256)){e.push(`asset "${a}" has no valid sha256`);continue}n(`assets/${o.sha256}`)||e.push(`assets/${o.sha256} missing (asset "${a}")`)}for(let a of Object.keys(i.widgets??{})){if(!E(a)){e.push(`widget id ${JSON.stringify(a)} is not a safe entry name`);continue}n(`widgets/${a}.json`)||e.push(`widgets/${a}.json missing (referenced in manifest)`)}return(t.warnMissingDocs??!0)&&(n("app-config.json")||s.push("app-config.json is absent \u2014 the host has no navigation baseline"),n("tokens.json")||s.push("tokens.json is absent \u2014 the host falls back to default design tokens")),{ok:e.length===0,errors:e,warnings:s,header:r,manifest:i}}function C(n){return n.filter(t=>t.path!==g).slice().sort((t,e)=>t.path<e.path?-1:t.path>e.path?1:0).map(t=>`${t.path} ${t.hash}`).join(`
|
|
2
|
+
`)}var D=67324752,K=33639248,q=101010256,P=null;function L(n){if(!P){P=new Uint32Array(256);for(let e=0;e<256;e++){let s=e;for(let r=0;r<8;r++)s=s&1?3988292384^s>>>1:s>>>1;P[e]=s>>>0}}let t=4294967295;for(let e=0;e<n.length;e++)t=P[(t^n[e])&255]^t>>>8;return(t^4294967295)>>>0}function F(n){return!n||n.length>512||n.startsWith("/")||n.includes("\\")||n.includes("\0")||/^[A-Za-z]:/.test(n)?!1:!n.split("/").some(t=>t===""||t==="."||t==="..")}var G={maxCompressedBytes:64*1024*1024,maxExpandedBytes:256*1024*1024,maxEntries:1e4,maxDecompressionRatio:1e3};function j(n,t,e=G){if(n>e.maxCompressedBytes)throw new Error(`package archive is ${n} bytes, over the ${e.maxCompressedBytes}-byte compressed-size limit`);if(t.length>e.maxEntries)throw new Error(`package archive has ${t.length} entries, over the ${e.maxEntries}-entry limit`);let s=0;for(let r of t){if(s+=r.rawSize,s>e.maxExpandedBytes)throw new Error(`package expands to more than the ${e.maxExpandedBytes}-byte expanded-size limit`);if(r.rawSize>0&&(r.compSize===0||r.rawSize/r.compSize>e.maxDecompressionRatio))throw new Error(`package entry ${JSON.stringify(r.name)} exceeds the ${e.maxDecompressionRatio}:1 decompression-ratio limit`)}}function M(n){let t=new DataView(n.buffer,n.byteOffset,n.byteLength),e=o=>t.getUint32(o,!0),s=o=>t.getUint16(o,!0),r=-1,i=Math.max(0,n.length-65535-22);for(let o=n.length-22;o>=i;o--)if(e(o)===q){r=o;break}if(r<0)throw new Error("not a zip archive (no end-of-central-directory record)");let l=s(r+10),c=e(r+16),a=[];for(let o=0;o<l;o++){if(c+46>n.length||e(c)!==K)throw new Error("corrupt zip central directory");let u=s(c+10),d=e(c+16),p=e(c+20),f=e(c+24),R=s(c+28),T=s(c+30),B=s(c+32),k=e(c+42),m=S(n.subarray(c+46,c+46+R));if(c+=46+R+T+B,m.endsWith("/"))continue;if(!F(m))throw new Error(`unsafe zip entry name: ${JSON.stringify(m)}`);if(k+30>n.length||e(k)!==D)throw new Error(`corrupt zip local header for ${m}`);let $=k+30+s(k+26)+s(k+28);if($+p>n.length)throw new Error(`truncated zip entry ${m}`);a.push({name:m,method:u,crc:d,dataStart:$,compSize:p,rawSize:f})}return a}function O(n,t){if(t.length!==n.rawSize)throw new Error(`size mismatch for zip entry ${n.name}`);if(L(t)!==n.crc)throw new Error(`checksum mismatch for zip entry ${n.name} \u2014 the package is damaged`)}function J(){return typeof DecompressionStream<"u"}var Z="this browser cannot open a compressed .himi package (DecompressionStream is unavailable) \u2014 open it with `himi run`, or host the package unpacked with `himi pack --format dir`";async function Y(n){if(!J())throw new Error(Z);let t=new Blob([n]).stream().pipeThrough(new DecompressionStream("deflate-raw"));return new Uint8Array(await new Response(t).arrayBuffer())}async function W(n,t){let e=n.subarray(t.dataStart,t.dataStart+t.compSize),s;if(t.method===0)s=e.slice();else if(t.method===8)try{s=await Y(e)}catch(r){throw new Error(`corrupt entry ${t.name} \u2014 the package is damaged (${r.message})`)}else throw new Error(`unsupported compression method ${t.method} for ${t.name}`);return O(t,s),s}async function U(n){let t=n instanceof Uint8Array?n:new Uint8Array(n),e=new Map,s=M(t);j(t.length,s);for(let r of s)e.set(r.name,await W(t,r));return e}async function Q(n,t,e){let s=c=>n.get(c)??null,r=await ee(n),i=_(s,{requireHeader:e.requireHeader,contentHash:r});if(!i.ok||!i.manifest)throw new Error(i.errors.length?`not a Himi package:
|
|
3
|
+
${i.errors.join(`
|
|
4
|
+
`)}`:`not a Himi package \u2014 no ${b}`);if(w(i.header)==="dev")throw new Error("this package carries the app's source (a dev package). The web host opens release packages only \u2014 restore it with `himi import <package.himi>` instead.");let l=i.header?.app??i.manifest.app;if(!l)throw new Error("package declares no app id");return{app:l,header:i.header,manifest:i.manifest,read:s,validation:i,source:t}}async function X(n){let t=await crypto.subtle.digest("SHA-256",n);return Array.from(new Uint8Array(t),e=>e.toString(16).padStart(2,"0")).join("")}async function ee(n){let t=await Promise.all(Array.from(n,async([s,r])=>({path:s,hash:await X(r)}))),e=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(C(t)));return"sha256-"+btoa(String.fromCharCode(...new Uint8Array(e)))}async function N(n){return Q(await U(await n.arrayBuffer()),{kind:"file",name:n.name},{requireHeader:!0})}var y=n=>n?new TextDecoder().decode(n):void 0;function x(n){if(!n)return;let t="",e=32768;for(let s=0;s<n.length;s+=e)t+=String.fromCharCode(...n.subarray(s,s+e));return btoa(t)}function ne(n){if(n)try{return JSON.parse(n)?.authConfig?.config?.clientId}catch{return}}function te(n){let t=n.manifest,e=d=>n.read(d),s={},r={};for(let[d,p]of Object.entries(t.screens??{})){let f=y(e(`screens/${d}.json`));f!==void 0&&(s[d]=f,p.descriptorHash&&(r[p.descriptorHash]=f))}let i=(d,p)=>{if(!d||r[d]!==void 0)return;let f=y(e(p))??y(e(`docs/${d}.json`));f!==void 0&&(r[d]=f)};for(let[d,p]of Object.entries(t.catalogs??{}))i(p,`catalogs/${d}.json`);i(t.tokensHash,"tokens.json"),i(t.appConfigHash,"app-config.json");let l={};for(let d of Object.values(t.bundles??{})){let p=x(e(`bundles/${d.sha256}.bundle.js`));p!==void 0&&(l[d.sha256]=p)}let c={};for(let d of Object.values(t.assets??{})){let p=x(e(`assets/${d.sha256}`));p!==void 0&&(c[d.sha256]={base64:p,contentType:d.contentType})}let a={};for(let d of Object.keys(t.widgets??{})){let p=y(e(`widgets/${d}.json`));p!==void 0&&(a[d]=p)}let o=y(e("app-config.json")),u=ne(o);return{app:n.app,manifest:t,screens:s,bundles:l,docs:r,assets:c,widgets:a,tokens:y(e("tokens.json")),appConfig:o,icon:x(e("icon.png")),header:n.header,...u?{wixClientId:u}:{}}}async function ye(n){let t=await N(n);return te(t)}export{ye as openPackageAsPayload,te as payloadFromPackage};
|