@tinkerlandai/longplay-sdk 0.10.18 → 0.10.19
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/CHANGELOG.md +8 -0
- package/README.md +9 -3
- package/README.zh-CN.md +1 -1
- package/dist/{ai-usage-D7BUuP1H.d.ts → ai-usage-DPGx5otD.d.ts} +3 -3
- package/dist/{api-CIbhe8RY.d.ts → api-G8EA_ueL.d.ts} +3596 -200
- package/dist/chunk-2JBNOE2D.js +1 -0
- package/dist/chunk-4SWGHICJ.js +17 -0
- package/dist/chunk-5OD42XQS.js +1 -0
- package/dist/{chunk-OMHZBCS3.js → chunk-A7U4Z6EH.js} +1 -1
- package/dist/{chunk-LHBBSD77.js → chunk-CCRBXW4M.js} +1 -1
- package/dist/chunk-DVKZLOS7.js +1 -0
- package/dist/{chunk-ML6EHT43.js → chunk-EDVR7FPD.js} +1 -1
- package/dist/chunk-FISFN5IY.js +1 -0
- package/dist/chunk-GSFNAB3W.js +6 -0
- package/dist/{chunk-26HU2HXU.js → chunk-KHIQQNTR.js} +1 -1
- package/dist/{chunk-6HWNW6FJ.js → chunk-LNSFRQ6G.js} +1 -1
- package/dist/chunk-W2Z3UVW3.js +1 -0
- package/dist/{chunk-T5COWMDA.js → chunk-XIYNQHN7.js} +1 -1
- package/dist/{chunk-P6HCD5OQ.js → chunk-XXBN76NP.js} +1 -1
- package/dist/{chunk-E4LUW6KP.js → chunk-YNMSSQQY.js} +1 -1
- package/dist/{content-DLYNJIEB.js → content-E2OWWKDG.js} +1 -1
- package/dist/{customer-page-km5f1PJZ.d.ts → customer-page-BV5EvCUY.d.ts} +20 -0
- package/dist/{funnel-local-client-CAuNpJ-e.d.ts → funnel-local-client-DjvVzCfH.d.ts} +14039 -312
- package/dist/{funnel-node-evaluation-BLnJp8vj.d.ts → funnel-node-evaluation-D9FwkMa3.d.ts} +425 -1
- package/dist/funnel-process-client-bO9Wfumi.d.ts +62372 -0
- package/dist/funnel-runtime-host-FOM4Z7ZK.js +1 -0
- package/dist/index.d.ts +322 -23334
- package/dist/index.js +1 -1
- package/dist/native-shell.js +1 -1
- package/dist/openrouter.d.ts +2 -2
- package/dist/openrouter.js +1 -1
- package/dist/page.js +1 -1
- package/dist/paywall-OUIB7SVI.js +1 -0
- package/dist/popup.d.ts +2 -2
- package/dist/popup.js +1 -1
- package/dist/react-native.d.ts +41 -38098
- package/dist/react-native.js +1 -1
- package/dist/screen-renderer-ZNELQB64.js +1 -0
- package/dist/server.d.ts +6860 -298
- package/dist/server.js +1 -1
- package/dist/visual.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-4ZUMMPHV.js +0 -1
- package/dist/chunk-EEZLS2YP.js +0 -1
- package/dist/chunk-JVQVQHV2.js +0 -6
- package/dist/chunk-KYXX676W.js +0 -1
- package/dist/chunk-LC2VUKYM.js +0 -1
- package/dist/chunk-N4HZ55YU.js +0 -1
- package/dist/chunk-PFHS7HK3.js +0 -17
- package/dist/chunk-VVW2J2GL.js +0 -1
- package/dist/funnel-process-client-C9EIwNTr.d.ts +0 -20575
- package/dist/funnel-runtime-host-FVOUCR35.js +0 -1
- package/dist/paywall-6Q3VLXXL.js +0 -1
- package/dist/screen-renderer-IZ3VJGU6.js +0 -1
- package/dist/{coupon-fA1QujHt.d.ts → coupon-Btz_KFKp.d.ts} +1 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as a}from"./chunk-VVW2J2GL.js";import"./chunk-T5COWMDA.js";import"./chunk-LC2VUKYM.js";import"./chunk-EEZLS2YP.js";import"./chunk-E4LUW6KP.js";import"./chunk-26HU2HXU.js";import"./chunk-SLUA7ABW.js";import"./chunk-6HWNW6FJ.js";import"./chunk-DSPLGTQI.js";import"./chunk-JVQVQHV2.js";import"./chunk-PFHS7HK3.js";export{a as showFunnelRun};
|
package/dist/paywall-6Q3VLXXL.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as ue}from"./chunk-SSLZKIIU.js";import{b as se,c as le}from"./chunk-T5COWMDA.js";import{a as oe,b as Y,c as ce}from"./chunk-EEZLS2YP.js";import"./chunk-E4LUW6KP.js";import{a as v}from"./chunk-26HU2HXU.js";import{a as J}from"./chunk-DSPLGTQI.js";import{R as V}from"./chunk-JVQVQHV2.js";import{Da as K,Fa as ie,Z as $,i as j}from"./chunk-PFHS7HK3.js";async function de(g,r,b){if(r.status!=="complete")throw new v("INVALID_RESPONSE","A verified completed purchase is required");if(await b.onComplete?.(r),!g||!b.check)return;let x=$.parse(await b.check());if(x.internal_feature_id!==g.internal_feature_id||x.quantity!==g.quantity)throw new v("INVALID_RESPONSE","The access requirement changed");x.allowed&&await b.onAccessGranted?.(x)}function X(g){return Object.entries(g.document.buttons).filter(([,r])=>r.type==="checkout"&&r.product.type==="fixed"&&!V(r.product,{},g.capabilities)).map(([r])=>r)}async function Oe(g,r){let b=r.check?$.parse(await r.check()):null;if(b?.allowed)return await r.onAccessGranted?.(b),{check:b,host:null};let x=ue(g.ownerDocument),{mountScreenPreview:pe}=await import("./screen-renderer-IZ3VJGU6.js"),t=await r.start(),m;try{let e=t.view??await t.refresh();if(!e)throw new v("INVALID_RESPONSE","Paywall presentation is missing");m=e}catch(e){throw t.destroy(),x(),e}let c=g.ownerDocument,q=new AbortController,R=c.createElement("section"),Z=c.createElement("div"),D=c.createElement("div"),C=c.createElement("p"),l=c.createElement("button"),z=c.createElement("button"),u=c.createElement("dialog"),o=m.document.screen.strings.defaultLocale.startsWith("zh");R.dataset.indianaPaywall="",R.setAttribute("aria-label",m.document.name),R.style.cssText="width:100%;box-sizing:border-box;background:#fff;color:#172033;font:14px/1.5 system-ui,sans-serif",D.style.cssText="display:flex;gap:12px;padding:12px 20px;align-items:center;flex-wrap:wrap",C.setAttribute("role","status"),z.textContent=o?"\u5173\u95ED":"Close",l.textContent=o?"\u91CD\u8BD5":"Retry",l.hidden=!0,D.append(C,l,z),R.append(Z,D);let N=m.document.presentation,_,P;function ee(){let e=c.defaultView;P?.responsive&&e&&_?.resizeViewport?.(e.innerHeight,e.innerWidth)}let f=!1,A=!1,h=null,te=!1,H=!1;function fe(){return A||f||H?{type:"recover",operationId:t.operation?.operationId??t.quote?.operationId??null,requestId:null}:Y(t)}let w=()=>!te&&r.canInteract?.()!==!1,Q=!1,i=null,T=null;function ne(e){t.quote||t.operation||(C.textContent=Object.values(e.capabilities.plans).some(n=>n.available)?"":o?"\u5F53\u524D\u8D26\u53F7\u6682\u65E0\u53EF\u8D2D\u4E70\u7684\u65B9\u6848\u3002":"No plans are currently available for this account.")}let F=new Map;async function B(e){if(!(!w()||!e.checkoutUrl||F.get(e.operationId)===e.checkoutUrl)){F.set(e.operationId,e.checkoutUrl);try{r.onCheckoutUrl?await r.onCheckoutUrl(e.checkoutUrl):c.defaultView?.location.assign(e.checkoutUrl)}catch(n){throw F.delete(e.operationId),n}}}let L=e=>{C.textContent=e instanceof Error?e.message:o?"\u8BF7\u6C42\u5931\u8D25":"Request failed",J(r.onError,e),l.hidden=i===null};async function k(e){if(!(A||f||!w())){A=!0,l.hidden=!0,C.textContent="";try{await e()}catch(n){f||L(n)}finally{A=!1}}}async function me(e){await de(b,e,r)}function re(e){return Y(t).type==="recording"||oe({quote:t.quote,operation:e,requestId:null,pending:!1,destroyed:!1,canReselect:t.canReselect}).type==="recording"}async function y(e){if(f)return;if(!w()){i=async()=>y(await t.read()),l.hidden=!1;return}if(C.textContent=e.status,re(e)){let a=e.merchantExecution?.type==="purchase"&&e.merchantExecution.recordingStatus==="failed";C.textContent=a?o?"\u4ED8\u6B3E\u548C\u5546\u6237\u5904\u7406\u5DF2\u5B8C\u6210\uFF0C\u4F46\u4EA4\u6613\u8BB0\u5F55\u5931\u8D25\u3002\u8BF7\u8054\u7CFB\u5546\u6237\u4FEE\u590D\uFF0C\u52FF\u91CD\u590D\u8D2D\u4E70\u3002":"Payment and fulfillment succeeded, but recording failed. Contact the merchant to repair this purchase; do not buy again.":o?"\u4ED8\u6B3E\u548C\u5546\u6237\u5904\u7406\u5DF2\u5B8C\u6210\uFF0C\u6B63\u5728\u786E\u8BA4\u4EA4\u6613\u8BB0\u5F55\u3002\u8BF7\u52FF\u91CD\u590D\u8D2D\u4E70\u3002":"Payment and merchant fulfillment are complete. Recording is pending confirmation; do not purchase again.",l.textContent=o?"\u67E5\u8BE2\u8BB0\u5F55":"Check recording",i=async()=>y(await t.read()),l.hidden=!1;return}if(e.problem){let a=e.problem;i=M,l.textContent=o?"\u68C0\u67E5\u5E76\u6062\u590D\u539F\u64CD\u4F5C":"Check and recover original purchase",L(new v(a.code,a.reason==="RESULT_UNKNOWN"?o?"\u4ED8\u6B3E\u7ED3\u679C\u5C1A\u672A\u786E\u5B9A\uFF0C\u8BF7\u6062\u590D\u539F\u64CD\u4F5C\uFF0C\u6682\u52FF\u91CD\u590D\u8D2D\u4E70\u3002":"The payment result is unknown. Recover the original purchase before buying again.":a.phase==="fulfillment"?o?"\u4ED8\u6B3E\u5DF2\u8BB0\u5F55\uFF0C\u5546\u6237\u6743\u76CA\u5904\u7406\u9700\u8981\u6838\u5BF9\u3002":"Payment was recorded. Access fulfillment needs attention.":a.code==="CAPABILITY_UNAVAILABLE"?o?"\u5546\u6237\u5C1A\u4E0D\u652F\u6301\u672C\u6B21\u8D2D\u4E70\u6240\u9700\u7684\u5B8C\u6574\u80FD\u529B\uFF0C\u8BF7\u5904\u7406\u540E\u6062\u590D\u539F\u64CD\u4F5C\u3002":"The merchant does not currently support all actions required by this purchase. Recover the original purchase after this is resolved.":a.code==="NOT_CONFIGURED"?o?"\u4ED8\u6B3E\u670D\u52A1\u8FDE\u63A5\u9700\u8981\u5904\u7406\uFF0C\u8BF7\u8054\u7CFB\u5546\u6237\u540E\u6062\u590D\u539F\u64CD\u4F5C\u3002":"The payment connection needs attention. Contact the merchant, then recover the original purchase.":o?"\u539F\u8D2D\u4E70\u64CD\u4F5C\u9700\u8981\u5904\u7406\uFF0C\u8BF7\u67E5\u8BE2\u6216\u6062\u590D\u6B64\u64CD\u4F5C\u3002":"The original purchase needs attention. Check or recover this operation.",void 0,void 0,a));return}if(e.merchantExecution?.type==="purchase"&&e.merchantExecution.paymentStatus==="succeeded"&&!["applied","not_applicable"].includes(e.merchantExecution.fulfillmentStatus)&&(C.textContent=o?"\u4ED8\u6B3E\u5DF2\u8BB0\u5F55\uFF0C\u6B63\u5728\u7B49\u5F85\u5546\u6237\u5B8C\u6210\u5904\u7406\u3002":"Payment was recorded. Waiting for merchant fulfillment."),e.status==="complete"){i=null,await me(e);return}if(e.status!=="pending"){if(t.canReselect===!1){C.textContent=o?"\u6B63\u5728\u6838\u5BF9\u539F\u8D2D\u4E70\u7ED3\u679C":"Checking the original purchase result",l.textContent=o?"\u67E5\u8BE2\u7ED3\u679C":"Check result",i=async()=>y(await t.read()),l.hidden=!1;return}l.textContent=o?"\u91CD\u8BD5":"Retry",i=null,h=null;return}await B(e);let n=Date.now()+6e5,p=2e3;for(;!f&&Date.now()<n;){if(await new Promise(d=>{let E=()=>{clearTimeout(I),d()},I=setTimeout(()=>{q.signal.removeEventListener("abort",E),d()},p);q.signal.addEventListener("abort",E,{once:!0})}),f)return;if(!w()){i=async()=>y(await t.read()),l.hidden=!1;return}let a=await t.read();if(!a.problem&&a.status==="pending"&&await B(a),a.status!=="pending"||a.problem||re(a)){await y(a);return}p=Math.min(p*1.5,3e4)}i=async()=>y(await t.read()),l.hidden=!1}async function M(){T?.remove(),T=null,i=M;let e=await t.confirm();if(!w()){i=M,l.hidden=!1;return}if(e.problem){await y(e);return}if(e.status==="pending"){if(e.checkoutUrl)await B(e);else if(e.execution&&e.execution.provider!=="merchant"||e.nativePurchase){if(!r.onPurchase)throw new v("PURCHASE_HANDLER_REQUIRED","Provide the merchant or native purchase handler");await r.onPurchase({operation:e,signal:q.signal})}}i=async()=>y(await t.read()),await y(e)}function he(e){T?.remove();let n=c.createElement("div"),p=c.createElement("button"),a=c.createElement("button"),d=c.createElement("p");d.textContent=e.lines.map(s=>s.productName).join(", ")+" \xB7 "+j(e.charge?.totalMinor??e.catalogAmountMinor-(e.discount?.amountMinor??0),e.currency),p.textContent=o?"\u786E\u8BA4\u8D2D\u4E70":"Confirm purchase",a.textContent=o?"\u53D6\u6D88":"Cancel",p.onclick=()=>{k(M)};let E=async()=>{let s=await t.cancel();f||(n.remove(),T=null,await y(s))};a.onclick=()=>{i=E,k(E)};let I=c.createElement("div");for(let s of e.lines){let ae=c.createElement("p");ae.textContent=`${s.productName} \xB7 ${j(s.catalogAmountMinor,e.currency)}${K(s.interval,o?"zh-CN":"en",s.intervalCount??1)}`,I.append(ae);for(let O of s.prepaid??[]){let W=c.createElement("p"),U=t.view?.capabilities.plans[s.productVersionId]?.prepaid?.find(we=>we.internalFeatureId===O.internal_feature_id);W.textContent=`${U?.name??O.internal_feature_id} \xB7 ${O.quantity} ${o?"\u4EFD":"packs"} \xD7 ${O.terms.units}`,U&&(W.textContent+=K(U.reset==="week"||U.reset==="month"||U.reset==="year"?U.reset:"one_time",o?"zh-CN":"en",U.resetCount)),I.append(W)}if(s.trial){let O=c.createElement("p");O.textContent=o?`\u8BD5\u7528 ${s.trial.days} \u5929\uFF1B${s.trial.cardRequired?"\u9700\u8981\u63D0\u4F9B\u4ED8\u6B3E\u65B9\u5F0F":"\u65E0\u9700\u63D0\u4F9B\u4ED8\u6B3E\u65B9\u5F0F"}`:`Trial days: ${s.trial.days}; ${s.trial.cardRequired?"a payment method is required":"no payment method is required"}`,I.append(O)}}if(!e.charge){let s=c.createElement("p");s.textContent=o?"\u76EE\u5F55\u4EF7\u683C\uFF1B\u6700\u7EC8\u91D1\u989D\u4EE5\u7ED3\u8D26\u65F6\u7A0E\u8D39\u548C\u8BD5\u7528\u89C4\u5219\u4E3A\u51C6\u3002":"Catalog price; the final charge depends on checkout taxes and trial terms.",I.append(s)}n.append(d,I,p,a),D.prepend(n),n.scrollIntoView?.({block:"nearest"}),p.focus({preventScroll:!0}),T=n,i=null}async function G(){if(!h)return;if(i=G,!Q){let n=t.view,p=n?.document.buttons[h.actionId],a=n&&p?.type==="checkout"?V(p.product,h.selection,n.capabilities):null;if(!a)throw new v("PRODUCT_UNAVAILABLE","Choose an available Product in this purchase area");let d=await r.resolveOfferId?.({actionId:h.actionId,productVersionId:a});if(f)return;d!==void 0&&(h.offerId=d),Q=!0}if(!w()){l.hidden=!1;return}let e=await t.preview(h);f||he(e)}function S(e="destroy"){f||(f=!0,q.abort(),P?.destroy(),_?.destroy(),t.destroy(),u.open&&u.close(),u.remove(),R.remove(),x(),e==="dismiss"&&J(r.onDismiss))}z.onclick=()=>{w()&&S("dismiss")},u.addEventListener("cancel",e=>{e.preventDefault(),w()&&S("dismiss")}),l.onclick=()=>{i&&k(i)};try{if(N.type==="inline")g.append(R);else{let n={sm:420,md:640,lg:900};u.style.cssText=`padding:0;border:0;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto;width:${"size"in N?n[N.size]+"px":"100vw"}`,u.setAttribute("aria-label",m.document.name),u.append(R),g.append(u),P=se(u,{...m.document.screen,presentation:N},ee),P.latch(),w()&&(u.showModal(),P.responsive&&u.focus({preventScroll:!0}),le(u,P.type,P.responsive))}_=pe(Z,{mode:"live",rendererUrl:t.webViewUrl,title:m.document.name,hostPresentation:()=>P?.type??N.type,onResize:n=>{P?.responsive&&P.setContentHeight(n+D.getBoundingClientRect().height)},onAction(n,p={}){if(!w())return;let a=t.view,d=a?.document.buttons[n];if(!d)return;if(d.type==="close"){k(async()=>{await r.onAction?.(n),S(r.onAction?"action":"dismiss")});return}if(d.type==="action"){i=async()=>{if(d.action.type==="event"){if(!r.onEvent)throw new v("EVENT_HANDLER_REQUIRED","Provide the event handler");await r.onEvent(d.action.event)}else r.onOpenUrl?await r.onOpenUrl(d.action.url):c.defaultView?.location.assign(d.action.url);await r.onAction?.(n),i=null},k(i);return}if((t.quote||h)&&t.canReselect===!1){i=t.quote?async()=>y(await t.read()):G,k(i);return}let E=a&&V(d.product,p,a.capabilities);if(!a||!E){L(new v("PRODUCT_UNAVAILABLE","Choose an available Product in this purchase area"));return}if(r.onPurchaseIntent){i=null,k(async()=>{let I={actionId:n,productVersionId:E,selection:structuredClone(p),featureQuantities:ie(a.document.screen,E,p,a.capabilities)};H=!0,await r.onPurchaseIntent(I)});return}if(h&&h.actionId!==n){L(new v("COMMAND_PENDING","Finish the current purchase"));return}h||(h={requestId:crypto.randomUUID(),actionId:n,selection:p},Q=!1),k(G)},onEscape:()=>{w()&&S("dismiss")},onError:n=>L(new Error(n)),onRendered:n=>{n&&u.setAttribute("aria-label",n)}}),ee(),_.update(m.document.screen,m.document.screen.strings.defaultLocale,{capabilities:m.capabilities,unavailableActions:X(m),serverInput:{bindings:[],answers:{}}}),await _.ready,ne(m);let e=t.operation;e&&(e.confirmedAt||e.checkoutUrl||e.status==="complete")&&(i=async()=>y(await t.read()),k(i))}catch(e){throw S(),e}return{check:b,host:{get recovery(){return fe()},async prepareFallback(){if(A||f||H)return{type:"recover",operationId:t.operation?.operationId??t.quote?.operationId??null,requestId:null};A=!0;try{let e=await ce(t);return e.type==="native"&&S(),e}finally{A=!1}},setSuspended(e){te=e,R.hidden=e,e&&u.open?u.close():!e&&!f&&N.type!=="inline"&&!u.open&&u.showModal()},destroy:S,refresh:async()=>{if(!w()){if(t.view)return t.view;throw new v("PRECONDITION_FAILED","Paywall presentation is suspended")}let e=await t.refresh();return f||(_?.updateCapabilities(e.capabilities,X(e)),ne(e)),e}}}}export{Oe as showPaywall};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d,e,g as f,h as g,i as h,j as i}from"./chunk-ML6EHT43.js";import"./chunk-SSLZKIIU.js";import"./chunk-T5COWMDA.js";import"./chunk-26HU2HXU.js";import"./chunk-DSPLGTQI.js";import"./chunk-PFHS7HK3.js";export{f as formatCustomerDecimal,b as hostedRendererScript,a as hostedRendererShell,d as inspectCustomHtml,i as mountScreenPreview,h as preparePopup,e as prepareScreen,c as sanitizeCustomHtml,g as showPopup};
|
|
@@ -91,10 +91,10 @@ declare const offerSchema: z.ZodObject<{
|
|
|
91
91
|
couponId: z.ZodUUID;
|
|
92
92
|
status: z.ZodEnum<{
|
|
93
93
|
expired: "expired";
|
|
94
|
+
revoked: "revoked";
|
|
94
95
|
issued: "issued";
|
|
95
96
|
reserved: "reserved";
|
|
96
97
|
redeemed: "redeemed";
|
|
97
|
-
revoked: "revoked";
|
|
98
98
|
}>;
|
|
99
99
|
issuedAt: z.ZodISODateTime;
|
|
100
100
|
expiresAt: z.ZodISODateTime;
|