@tinkerlandai/indiana-sdk 0.2.0 → 0.3.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/CHANGELOG.md +13 -0
- package/README.md +55 -3
- package/THIRD_PARTY_NOTICES.md +27 -0
- package/dist/{ai-usage-CO0lDavO.d.ts → ai-usage-D_mBF5Gp.d.ts} +329 -18
- package/dist/chunk-D37O6FAW.js +11 -0
- package/dist/chunk-MJG7X7LM.js +17 -0
- package/dist/chunk-PTWRGCVW.js +1 -0
- package/dist/chunk-X5UXOLOU.js +1 -0
- package/dist/funnel-runtime-host-OVCJIQRT.js +1 -0
- package/dist/{funnel-runtime-start-DvrWekm0.d.ts → funnel-runtime-start-CQhy2kx1.d.ts} +3422 -3592
- package/dist/growth-rules-D64pEvg9.d.ts +166 -0
- package/dist/index.d.ts +2560 -2371
- 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.d.ts +134 -0
- package/dist/page.js +4 -0
- package/dist/paywall-4JTI7QAB.js +1 -0
- package/dist/popup.d.ts +31 -4
- package/dist/popup.js +15 -4
- package/dist/server.d.ts +4 -3
- package/dist/server.js +1 -1
- package/dist/src-RZJKF6LQ.js +1 -0
- package/package.json +5 -1
- package/dist/chunk-EZFAY4ZL.js +0 -1
- package/dist/chunk-ULRVTA45.js +0 -1
- package/dist/chunk-YOH6DIUN.js +0 -27
- package/dist/funnel-runtime-host-OJJSHKUD.js +0 -1
- package/dist/paywall-HCADUT22.js +0 -1
- package/dist/src-3GT6E6XD.js +0 -1
- package/dist/{screen-DfuSw6Tz.d.ts → screen-Keau_Qa2.d.ts} +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$,$a as gb,$b as gc,$c as gd,$d as ge,$e as gf,$f as hg,$g as hh,$h as hi,$i as hj,$j as hk,$k as hl,$l as hm,A,Aa as Ha,Ab as Hb,Ac as Hc,Ad as Hd,Ae as He,Af as If,Ag as Ig,Ah as Ih,Ai as Ii,Aj as Ij,Ak as Ik,Al as Il,B,Ba as Ia,Bb as Ib,Bc as Ic,Bd as Id,Be as Ie,Bf as Jf,Bg as Jg,Bh as Jh,Bi as Ji,Bj as Jj,Bk as Jk,Bl as Jl,C,Ca as Ja,Cb as Jb,Cc as Jc,Cd as Jd,Ce as Je,Cf as Kf,Cg as Kg,Ch as Kh,Ci as Ki,Cj as Kj,Ck as Kk,Cl as Kl,D,Da as Ka,Db as Kb,Dc as Kc,Dd as Kd,De as Ke,Df as Lf,Dg as Lg,Dh as Lh,Di as Li,Dj as Lj,Dk as Lk,Dl as Ll,E,Ea as La,Eb as Lb,Ec as Lc,Ed as Ld,Ee as Le,Ef as Mf,Eg as Mg,Eh as Mh,Ei as Mi,Ej as Mj,Ek as Mk,El as Ml,F,Fa as Ma,Fb as Mb,Fc as Mc,Fd as Md,Fe as Me,Ff as Nf,Fg as Ng,Fh as Nh,Fi as Ni,Fj as Nj,Fk as Nk,Fl as Nl,G,Ga as Na,Gb as Nb,Gc as Nc,Gd as Nd,Ge as Ne,Gf as Of,Gg as Og,Gh as Oh,Gi as Oi,Gj as Oj,Gk as Ok,Gl as Ol,H,Ha as Oa,Hb as Ob,Hc as Oc,Hd as Od,He as Oe,Hf as Pf,Hg as Pg,Hh as Ph,Hi as Pi,Hj as Pj,Hk as Pk,Hl as Pl,I,Ia as Pa,Ib as Pb,Ic as Pc,Id as Pd,Ie as Pe,If as Qf,Ig as Qg,Ih as Qh,Ii as Qi,Ij as Qj,Ik as Qk,Il as Ql,J,Ja as Qa,Jb as Qb,Jc as Qc,Jd as Qd,Je as Qe,Jf as Rf,Jg as Rg,Jh as Rh,Ji as Ri,Jj as Rj,Jk as Rk,Jl as Rl,K,Ka as Ra,Kb as Rb,Kc as Rc,Kd as Rd,Ke as Re,Kf as Sf,Kg as Sg,Kh as Sh,Ki as Si,Kj as Sj,Kk as Sk,Kl as Sl,L,La as Sa,Lb as Sb,Lc as Sc,Ld as Sd,Le as Se,Lf as Tf,Lg as Tg,Lh as Th,Li as Ti,Lj as Tj,Lk as Tk,Ll as Tl,M,Ma as Ta,Mb as Tb,Mc as Tc,Md as Td,Me as Te,Mf as Uf,Mg as Ug,Mh as Uh,Mi as Ui,Mj as Uj,Mk as Uk,Ml as Ul,N,Na as Ua,Nb as Ub,Nc as Uc,Nd as Ud,Ne as Ue,Nf as Vf,Ng as Vg,Nh as Vh,Ni as Vi,Nj as Vj,Nk as Vk,Nl as Vl,O,Oa as Va,Ob as Vb,Oc as Vc,Od as Vd,Oe as Ve,Of as Wf,Og as Wg,Oh as Wh,Oi as Wi,Oj as Wj,Ok as Wk,Ol as Wl,P,Pa as Wa,Pb as Wb,Pc as Wc,Pd as Wd,Pe as We,Pf as Xf,Pg as Xg,Ph as Xh,Pi as Xi,Pj as Xj,Pk as Xk,Pl as Xl,Q,Qa as Xa,Qb as Xb,Qc as Xc,Qd as Xd,Qe as Xe,Qf as Yf,Qg as Yg,Qh as Yh,Qi as Yi,Qj as Yj,Qk as Yk,Ql as Yl,R,Ra as Ya,Rb as Yb,Rc as Yc,Rd as Yd,Re as Ye,Rf as Zf,Rg as Zg,Rh as Zh,Ri as Zi,Rj as Zj,Rk as Zk,Rl as Zl,S,Sa as Za,Sb as Zb,Sc as Zc,Sd as Zd,Se as Ze,Sf as _f,Sg as _g,Sh as _h,Si as _i,Sj as _j,Sk as _k,Sl as _l,T,Ta as _a,Tb as _b,Tc as _c,Td as _d,Te as _e,Tf as $f,Tg as $g,Th as $h,Ti as $i,Tj as $j,Tk as $k,Tl as $l,U,Ua as $a,Ub as $b,Uc as $c,Ud as $d,Ue as $e,Uf as ag,Ug as ah,Uh as ai,Ui as aj,Uj as ak,Uk as al,Ul as am,V,Va as ab,Vb as ac,Vc as ad,Vd as ae,Ve as af,Vf as bg,Vg as bh,Vh as bi,Vi as bj,Vj as bk,Vk as bl,Vl as bm,W,Wa as bb,Wb as bc,Wc as bd,Wd as be,We as bf,Wf as cg,Wg as ch,Wh as ci,Wi as cj,Wj as ck,Wk as cl,Wl as cm,X,Xa as cb,Xb as cc,Xc as cd,Xd as ce,Xe as cf,Xf as dg,Xg as dh,Xh as di,Xi as dj,Xj as dk,Xk as dl,Xl as dm,Y,Ya as db,Yb as dc,Yc as dd,Yd as de,Ye as df,Yf as eg,Yg as eh,Yh as ei,Yi as ej,Yj as ek,Yk as el,Yl as em,Z,Za as eb,Zb as ec,Zc as ed,Zd as ee,Ze as ef,Zf as fg,Zg as fh,Zh as fi,Zi as fj,Zj as fk,Zk as fl,Zl as fm,_,_a as fb,_b as fc,_c as fd,_d as fe,_e as ff,_f as gg,_g as gh,_h as gi,_i as gj,_j as gk,_k as gl,_l as gm,a,aa,ab as hb,ac as hc,ad as hd,ae as he,af as hf,ag as ig,ah as ih,ai as ii,aj as ij,ak as ik,al as il,am as im,b,ba,bb as ib,bc as ic,bd as id,be as ie,bf as jf,bg as jg,bh as jh,bi as ji,bj as jj,bk as jk,bl as jl,bm as jm,c,ca,cb as jb,cc as jc,cd as jd,ce as je,cf as kf,cg as kg,ch as kh,ci as ki,cj as kj,ck as kk,cl as kl,cm as km,d,da,db as kb,dc as kc,dd as kd,de as ke,df as lf,dg as lg,dh as lh,di as li,dj as lj,dk as lk,dl as ll,dm as lm,e,ea,eb as lb,ec as lc,ed as ld,ee as le,ef as mf,eg as mg,eh as mh,ei as mi,ej as mj,ek as mk,el as ml,em as mm,f,fa,fb as mb,fc as mc,fd as md,fe as me,ff as nf,fg as ng,fh as nh,fi as ni,fj as nj,fk as nk,fl as nl,fm as nm,g,ga,gb as nb,gc as nc,gd as nd,ge as ne,gf as of,gg as og,gh as oh,gi as oi,gj as oj,gk as ok,gl as ol,gm as om,h,ha,hb as ob,hc as oc,hd as od,he as oe,hf as pf,hg as pg,hh as ph,hi as pi,hj as pj,hk as pk,hl as pl,hm as pm,i,ia,ib as pb,ic as pc,id as pd,ie as pe,if as qf,ig as qg,ih as qh,ii as qi,ij as qj,ik as qk,il as ql,im as qm,j,ja,jb as qb,jc as qc,jd as qd,je as qe,jf as rf,jg as rg,jh as rh,ji as ri,jj as rj,jk as rk,jl as rl,jm as rm,k,ka,kb as rb,kc as rc,kd as rd,ke as re,kf as sf,kg as sg,kh as sh,ki as si,kj as sj,kk as sk,kl as sl,km as sm,l,la as sa,lb as sb,lc as sc,ld as sd,le as se,lf as tf,lg as tg,lh as th,li as ti,lj as tj,lk as tk,ll as tl,lm as tm,m,ma as ta,mb as tb,mc as tc,md as td,me as te,mf as uf,mg as ug,mh as uh,mi as ui,mj as uj,mk as uk,ml as ul,mm as um,n,na as ua,nb as ub,nc as uc,nd as ud,ne as ue,nf as vf,ng as vg,nh as vh,ni as vi,nj as vj,nk as vk,nl as vl,nm as vm,o,oa as va,ob as vb,oc as vc,od as vd,oe as ve,of as wf,og as wg,oh as wh,oi as wi,oj as wj,ok as wk,ol as wl,om as wm,p,pa as wa,pb as wb,pc as wc,pd as wd,pe as we,pf as xf,pg as xg,ph as xh,pi as xi,pj as xj,pk as xk,pl as xl,pm as xm,q,qa as xa,qb as xb,qc as xc,qd as xd,qe as xe,qf as yf,qg as yg,qh as yh,qi as yi,qj as yj,qk as yk,ql as yl,qm as ym,r,ra as ya,rb as yb,rc as yc,rd as yd,re as ye,rf as zf,rg as zg,rh as zh,ri as zi,rj as zj,rk as zk,rl as zl,rm as zm,s,sa as za,sb as zb,sc as zc,sd as zd,se as ze,sf as Af,sg as Ag,sh as Ah,si as Ai,sj as Aj,sk as Ak,sl as Al,sm as Am,t,ta as Aa,tb as Ab,tc as Ac,td as Ad,te as Ae,tf as Bf,tg as Bg,th as Bh,ti as Bi,tj as Bj,tk as Bk,tl as Bl,tm as Bm,u,ua as Ba,ub as Bb,uc as Bc,ud as Bd,ue as Be,uf as Cf,ug as Cg,uh as Ch,ui as Ci,uj as Cj,uk as Ck,ul as Cl,um as Cm,v,va as Ca,vb as Cb,vc as Cc,vd as Cd,ve as Ce,vf as Df,vg as Dg,vh as Dh,vi as Di,vj as Dj,vk as Dk,vl as Dl,vm as Dm,w,wa as Da,wb as Db,wc as Dc,wd as Dd,we as De,wf as Ef,wg as Eg,wh as Eh,wi as Ei,wj as Ej,wk as Ek,wl as El,x,xa as Ea,xb as Eb,xc as Ec,xd as Ed,xe as Ee,xf as Ff,xg as Fg,xh as Fh,xi as Fi,xj as Fj,xk as Fk,xl as Fl,y,ya as Fa,yb as Fb,yc as Fc,yd as Fd,ye as Fe,yf as Gf,yg as Gg,yh as Gh,yi as Gi,yj as Gj,yk as Gk,yl as Gl,z,za as Ga,zb as Gb,zc as Gc,zd as Gd,ze as Ge,zf as Hf,zg as Hg,zh as Hh,zi as Hi,zj as Hj,zk as Hk,zl as Hl}from"./chunk-D37O6FAW.js";import{a as la,b as ma,c as na,d as oa,e as pa,f as qa,g as ra}from"./chunk-MJG7X7LM.js";export{Oa as COMMON_LOCALES,Qa as COUPON_TERM_LOCALES,Bf as CUSTOMER_DATA_SOURCES,vl as DEFAULT_AUDIENCE_GROUP,Dj as DEFAULT_FUNNEL_EXECUTION_POLICY,Vj as FUNNEL_API_CAPABILITIES,Gi as FUNNEL_LIMITS,Qk as FUNNEL_PREVIEW_LIMITS,Te as OFFERING_MAX_DEPTH,Ve as OFFERING_MAX_ITEMS,Ue as OFFERING_MAX_PRODUCTS,vg as POPUP_WIDTHS,Mf as SCREEN_LIMITS,Ai as SCREEN_RENDER_PATH,Lf as SCREEN_SCHEMA_VERSION,Ji as SCREEN_TEMPLATES,uc as SDK_PROTOCOL_HEADER,wc as SDK_SUPPORT_HEADER,xc as SDK_SUPPORT_POLICY,vc as SDK_VERSION_HEADER,tg as SURFACE_PATHS,tf as SURFACE_VARIABLES,Dc as SdkProtocolError,Hi as UNBOUND_PRODUCT_VERSION_ID,Bc as addSupportMonths,j as aiCreditSystemConfigSchema,eh as aiMarkupSchema,dh as aiModelIdSchema,fh as aiModelRatesSchema,gh as aiPricingConfigurationSchema,ch as aiTokenPools,w as amountToMinor,kc as apiErrorCatalog,lc as apiErrorCodeForStatus,fc as apiErrorCodeSchema,yi as apiOperations,ri as apiPermissionSchema,Pl as appResultsSchema,Ol as appRevenueSchema,Yl as appendScreenTemplate,um as applyGrowthReleasePlan,ij as archiveSurfaceTemplateSchema,yl as audienceCustomerSchema,Hl as audienceFunnelUsageSchema,Il as audienceFunnelUsagesSchema,zl as audienceMembersSchema,Gc as audienceSchema,xl as audienceWriteSchema,ql as auditFieldSchema,tl as auditHistoryCursorSchema,ul as auditHistorySchema,pl as auditResourceSchema,pb as autoTopupPurchaseLimitSchema,Bb as autoTopupStateSchema,Bm as autumnAmountToMinor,el as autumnCustomerAutoTopupSchema,jl as autumnCustomerControlsSchema,ll as autumnCustomerMetadataSchema,il as autumnCustomerOverageAllowedSchema,nl as autumnCustomerProductSummarySchema,ml as autumnCustomerProfileRecordSchema,fl as autumnCustomerSpendLimitSchema,hl as autumnCustomerUsageAlertSchema,gl as autumnCustomerUsageLimitSchema,kl as autumnEntityControlsSchema,Cm as autumnMinorToAmount,Dm as autumnUsageUnitAmountDecimal,Zg as balanceAdjustmentCommandSchema,_g as balanceAdjustmentStateSchema,Xc as balanceAllocationSchema,Uc as balanceCommandSchema,ad as balanceGrantCommandSchema,$c as balanceGrantCreateSchema,dd as balanceGrantPageSchema,cd as balanceGrantReadSchema,bd as balanceGrantSchema,_c as balanceOperationSchema,Vc as balancePricingSegmentSchema,Zc as balanceQuoteSchema,Wc as balanceReceiptUnitsSchema,Yc as balanceRejectionReasonSchema,cm as balanceSourceReasonSchema,$g as balanceSourceStateSchema,dm as balanceSourceStatusSchema,fm as balanceSourcesPageSchema,em as balanceSourcesQuerySchema,ib as billingAccruedMinorSchema,hb as billingAmountMinorSchema,sb as billingAuthorizationSchema,rb as billingAuthorizationTermsSchema,jb as billingBudgetMinorSchema,Cb as billingControlInputSchema,Db as billingControlsSchema,Lb as billingCouponsSchema,z as billingCurrencies,Eb as billingInvoiceLineSchema,Fb as billingInvoiceSchema,Ib as billingInvoicesSchema,wb as billingLimitSchema,ej as billingPortalInputSchema,fj as billingPortalSchema,D as billingSettingsMutationSchema,B as billingSettingsSchema,C as billingSettingsScopeSchema,Ab as billingUsageWindowSchema,_f as borderSchema,eg as buttonNodeSchema,Jc as campaignInputSchema,Hc as campaignOfferSchema,Kc as campaignSchema,Ma as canonicalLocale,uf as capabilityBindingSchema,nb as cashPriceSchema,lb as cashPricingSchema,kb as cashPricingTiersSchema,gb as cashUnitAmountMinorSchema,Hh as claimRewardProductRequestSchema,Fd as commerceAccessSchema,Ke as commerceContextSchema,xe as commerceCursorSchema,ye as commerceListQuerySchema,Gd as commerceMoneySchema,_l as commerceProductKind,Ed as commerceProductKindSchema,Dd as commerceProviderSchema,Da as compileGrowthFeatures,Gb as confirmBillingAdjustmentInputSchema,ub as confirmBillingAuthorizationInputSchema,hc as consoleErrorCodeSchema,sc as consoleErrorResponseSchema,ym as consoleHasPermission,he as consoleRefundRequestSchema,wm as consoleResources,xm as consoleRolePermissions,vm as consoleRoleSchema,lg as countdownNodeSchema,Xa as couponAppliesToSchema,ab as couponChangeErrors,kg as couponCodeNodeSchema,Va as couponDiscountSchema,Al as couponDisplaySchema,Oi as couponDistributionBatchSchema,Qi as couponDistributionDetailSchema,Ni as couponDistributionPreviewSchema,Pi as couponDistributionRecipientSchema,Ri as couponDistributionWriteSchema,Wa as couponDurationSchema,Ya as couponEligibilitySchema,Za as couponInputSchema,Ua as couponStatusSchema,dl as couponTemplateExample,bl as couponTemplateKey,db as couponWindow,Dl as createAccountOverviewPage,Cl as createCreditCenterPage,Fl as createCustomerPageTemplates,ui as createCustomerRequestSchema,vi as createCustomerResponseSchema,El as createMembershipPage,Jh as createReferralCodeRequestSchema,F as creditAmountSchema,jh as creditAnalyticsFilterSchema,lh as creditAnalyticsPageSchema,kh as creditAnalyticsQuerySchema,hh as creditAnalyticsRangeSchema,ih as creditAnalyticsTimezoneSchema,L as creditDimensionSchema,M as creditMultiplierSchema,H as creditPriceAdjustmentSchema,N as creditPricingSchema,J as creditPropertiesSchema,G as creditQuantitySchema,O as creditRateSchema,Nb as creditResetCountSchema,Mb as creditResetSchema,I as creditResourceKeySchema,Ob as creditRolloverSchema,c as creditSchemaItemSchema,hd as creditStatementInputSchema,id as creditStatementSchema,i as creditSystemConfigSchema,K as creditTiersSchema,t as currencies,A as currencyAmountOptionsSchema,v as currencyDecimals,u as currencySchema,zi as currentApiOperations,jd as currentNotificationEventTypeSchema,ig as customHtmlNodeSchema,ka as customerActivitySchema,Sh as customerAttributesSchema,wl as customerAudienceSchema,Df as customerDataConfigSchema,Gf as customerDataIntentSchema,gg as customerDataNodeSchema,Yh as customerDataReferenceMessage,Xh as customerDataReferenced,Wh as customerDataSchema,Cf as customerDataSourceSchema,xi as customerEntitlementsSchema,di as customerFiltersSchema,Th as customerFingerprintSchema,Ql as customerFunnelDecisionsSchema,bi as customerGetSchema,rd as customerHoldingsSchema,Uh as customerInputSchema,vd as customerLedgerEntrySchema,wd as customerLedgerPageSchema,ud as customerLedgerQuerySchema,$h as customerLookupSchema,_h as customerMutationSchema,Ff as customerPageDataSchema,Ef as customerPageNodeStateSchema,ol as customerPageSampleData,ei as customerPageSchema,ai as customerPatchSchema,dc as customerPlanCreateSchema,ec as customerPlanCreatedSchema,ja as customerPlanSchema,Zh as customerProfileSchema,Vh as customerReferenceSchema,dj as customerScheduledChangeCancelSchema,bj as customerScheduledChangeSchema,cj as customerScheduledChangesSchema,Lc as customerSchema,Rh as customerTagsSchema,ci as customerUpdateRequestSchema,Ii as defaultScreenTheme,bb as describeCoupon,Zb as diffProductVariant,fg as dividerNodeSchema,Hf as emptyCustomerPageNode,Me as entitlementCheckInputSchema,Ne as entitlementCheckReasonSchema,Pe as entitlementCheckResultSchema,Le as entitlementRequirementSchema,ga as entitlementSnapshotSchema,wi as entitlementStatusSchema,X as environmentSchema,Bd as environmentSettingsSchema,nc as errorCodeMatchesStatus,tc as errorMetadata,pc as errorMetadataSchema,mc as errorPolicy,jc as errorReasonSchema,ic as errorRecoverySchema,qc as errorResponseSchema,Jf as escapeHtmlText,pa as evalCondition,ra as evalFeature,mi as evaluateFeaturesRequestSchema,oi as evaluateFeaturesResultSchema,Fk as executionSourceSchema,Ca as experimentConfigurationSchema,Ba as experimentPhaseSchema,Ga as experimentSnapshotSchema,n as featureCollectionSchema,g as featureConfigOverrideSchema,k as featureDefinitionSchema,li as featureDeliveryPayloadSchema,a as featureIdSchema,$ as featureInputSchema,f as featureMarkupsOverrideSchema,o as featureOptionsSchema,ki as featurePayloadSchema,m as featureRecordSchema,aa as featureSchema,zm as featureTypes,Am as featureUpdateBlockers,l as featureUpdateRulesSchema,nd as featureUsageReadSchema,od as featureUsageSetSchema,pd as featureUsageStateSchema,b as featureUsageTypeSchema,p as featureWriteSchema,Bg as fieldValue,Yf as fillSchema,qd as financialAmountSchema,td as financialCursorSchema,sd as financialEntryTypeSchema,Ig as findDocumentNode,Hg as findNode,al as formatCouponConditions,Sa as formatCouponDiscount,Ra as formatCouponMoney,Ta as formatCouponTerms,y as formatCurrencyMinor,bm as formatProductBillingPeriod,cb as formatUsd,Wj as funnelApiBindingSchema,Tj as funnelApiProjectionSchema,Kk as funnelCampaignCommandSchema,Lk as funnelCampaignStartResponseSchema,Xj as funnelCapabilitySchema,Ak as funnelCollectionSchema,wk as funnelCommandSchema,Nk as funnelConfigurationSchema,gk as funnelConsumedVariables,Ik as funnelCredentialCommandSchema,Jk as funnelCredentialResponseSchema,vk as funnelDataQueriesSchema,Nj as funnelDecideShape,Oj as funnelDecisionCommandSchema,Lj as funnelDecisionOutputSchema,Pj as funnelDecisionResponseSchema,Mj as funnelDecisionSchema,Qj as funnelDecisionUsedResponseSchema,qk as funnelDocumentDraftSchema,sk as funnelDocumentSchema,kj as funnelEvaluationAttributes,yk as funnelEvaluationModeSchema,Cj as funnelExecutionPolicySchema,mk as funnelExecutionStateSchema,Zj as funnelExternalPageUrlSchema,Bj as funnelExternalTaskSchema,ak as funnelGraphDraftSchema,$j as funnelGraphNodeSchema,bk as funnelGraphSchema,ck as funnelGraphTargets,Gl as funnelGroupReferenceSchema,Ek as funnelInstructionSchema,kk as funnelNodeInputSchema,ik as funnelNodeKindSchema,lk as funnelNodeResultSchema,_j as funnelOpenInSchema,Hj as funnelOrchestrationCommandSchema,qj as funnelParametersFromUrl,uk as funnelPresentationSubmissionSchema,Rk as funnelPreviewCommandSchema,Uk as funnelPreviewDependencySchema,Vk as funnelPreviewJournalSchema,Sk as funnelPreviewOutcomeSchema,Xk as funnelPreviewRequestSchema,Yk as funnelPreviewResponseSchema,Tk as funnelPreviewScenarioSchema,_k as funnelPreviewShareWriteSchema,Zk as funnelPreviewSnapshotSchema,Wk as funnelPreviewSourceSchema,Rj as funnelProjectionFilterValueSchema,Sj as funnelProjectionWhereSchema,rk as funnelPublishableDraftSchema,zk as funnelRecordSchema,jk as funnelResourceReferenceSchema,Jl as funnelResultsCursorSchema,Kl as funnelResultsQuerySchema,Kj as funnelResultsResponseSchema,Ll as funnelResultsSchema,Gk as funnelRunViewSchema,Hk as funnelRuntimeResponseSchema,Dk as funnelRuntimeStatusSchema,Ij as funnelSignalResponseSchema,$k as funnelStatisticsSchema,Aj as funnelTaskBindingSchema,yj as funnelTaskDataSchema,zj as funnelTaskOutputsSchema,Ej as funnelTaskResponseSchema,Jj as funnelTaskResultsSchema,Xl as funnelTemplateDraft,Vl as funnelTemplateSchema,Ok as funnelTopology,Mk as funnelTopologySchema,nk as funnelTraceEventSchema,uj as funnelValueBindingSchema,pk as funnelValueDeclarationSchema,tk as funnelValueMatches,tj as funnelValuePathSchema,jj as funnelValueSchema,hk as funnelWaitKindSchema,Bk as funnelWriteSchema,gi as gbRuntimeExperimentResultSchema,fi as gbRuntimeExperimentSchema,hi as gbRuntimeFeatureRuleSchema,ii as gbRuntimeFeatureSchema,ji as gbRuntimeSavedGroupsSchema,la as getQueryStringOverride,tm as getRecommendedRolloutData,lm as growthAttributeSchema,ta as growthAttributesSchema,nm as growthCatalogSchema,wa as growthConditionGroupIds,mj as growthConditionPaths,ua as growthConditionSchema,pm as growthDryRunSchema,qm as growthExperimentInspectionSchema,Ea as growthExperimentStop,Fa as growthFeatureExpiry,ya as growthFeatureRuleSchema,za as growthFeatureSchema,Aa as growthFeaturesSchema,rm as growthGroupReferenceCursorSchema,sm as growthGroupReferencesSchema,va as growthGroupSchema,mm as growthNamespaceSchema,om as growthResourceWriteSchema,Ja as growthRuleContextSchema,xa as growthSavedGroupsSchema,Ha as growthSnapshotSchema,Ka as growthSplitResultSchema,If as htmlVariableErrors,Of as identifierSchema,dg as imageNodeSchema,Xf as imagePositionSchema,Vf as insetsSchema,ed as invoiceDetailInputSchema,gd as invoiceDetailSchema,fd as invoiceProductItemSchema,ge as invoiceRefundsSchema,ob as isInvoiceCreditPrice,qf as isProductGroup,Zl as isRecurringMembership,Jg as isRtlLocale,Ac as isStableSdkProtocol,na as isURLTargeted,mb as itemBillingCycleSchema,sa as jsonValueSchema,E as licenseOfferSchema,Hb as listBillingInvoicesInputSchema,Pa as localeLabel,La as localeSchema,Cg as localeStatuses,Gg as localizeScreen,yb as manageBillingLimitsInputSchema,xb as manageOveragePolicyInputSchema,gc as managementErrorCodeSchema,rc as managementErrorResponseSchema,Wf as marginSchema,Na as matchLocale,lj as matchesGrowthCondition,T as membershipActionSchema,$l as membershipBillingCount,U as membershipChangeSchema,V as membershipHoldingSchema,R as membershipRulesSchema,W as membershipStateSchema,S as membershipTimingSchema,rl as mergeAuditSchema,_ as metadataSchema,h as meteredConfigSchema,x as minorToAmount,e as modelMarkupsSchema,Sl as nativeCompletionSchema,Hd as nativeCouponStoreOfferLinkWriteSchema,Id as nativeCouponStoreOfferLinksSchema,Qc as nativeProductBindingSchema,Sc as nativeProductBindingWriteSchema,Rc as nativeProductBindingsPageSchema,Rl as nativeProofSchema,Nd as nativePurchaseInstructionSchema,Tl as nativeReceiptCommandSchema,Ul as nativeReceiptResponseSchema,Ie as nativeRestoreCommandSchema,Je as nativeRestoreResultSchema,Ld as nativeStoreOfferForProduct,Jd as nativeStoreOfferSelectionSchema,Kd as nativeStoreOfferSelectionsSchema,Md as nativeStoreSelectionMatches,_d as nativeSubscriptionUpdatePreviewSchema,$d as nativeSubscriptionUpdateResultSchema,Mi as newBlankSurface,$a as newCouponInput,Ck as newFunnelDocument,Ki as newScreenFromTemplate,Li as newSurfaceFromTemplate,Nf as nodeIdSchema,sl as objectAuditSchema,Ml as offerFlowInputSchema,Nl as offerFlowResultSchema,eb as offerSchema,fb as offerUnavailableReasonSchema,$e as offeringAuthorSchema,df as offeringCollectionSchema,_e as offeringDocumentSchema,We as offeringItemSchema,Xe as offeringItemsSchema,Se as offeringMetadataSchema,af as offeringProductEvidenceSchema,Re as offeringProductIdSchema,Ye as offeringProductIds,hf as offeringProductOptionSchema,Ze as offeringProductPaths,kf as offeringPublicationIssues,bf as offeringRecordSchema,gf as offeringSelectorSchema,lf as offeringValueSchema,cf as offeringVersionSchema,jf as offeringWorkspaceSchema,ff as offeringWriteResultSchema,ef as offeringWriteSchema,Tc as overageBehaviorSchema,zb as overagePolicySchema,ok as ownedFunnelScreenSchema,im as pageExperimentEventSchema,jm as pageExperimentEventsRequestSchema,km as pageExperimentEventsResponseSchema,hm as pageExperimentPayloadSchema,gm as pageExperimentSchema,Tf as paintColorSchema,oc as parseRetryAfter,Ei as parseScreenRenderPath,re as paymentSetupCommandSchema,se as paymentSetupReadSchema,ue as paymentSetupSchema,Oe as paywallCandidateSchema,Ng as paywallClientActionSchema,Tg as paywallCollectionSchema,Og as paywallDocumentDraftSchema,Pg as paywallDocumentSchema,Rg as paywallFlowIssues,Wg as paywallLibrarySchema,Qg as paywallProductIssues,of as paywallProductsSchema,Sg as paywallRecordSchema,Qe as paywallRequestSchema,Yg as paywallResolutionSchema,Xg as paywallResolveInputSchema,Ug as paywallSummarySchema,Vg as paywallWriteSchema,da as planConfigSchema,ea as planInputSchema,ca as planItemSchema,mg as planPickerNodeSchema,fa as planSchema,ha as planVersionSchema,Ic as popupSchema,cc as prepaidAllowanceAmount,r as prepaidPriceAmount,s as prepaidQuantityAmount,Mc as prepaidQuantitySchema,q as prepaidTierPricingSchema,qb as prepareBillingAuthorizationInputSchema,cl as prepareCouponTemplate,oa as prepareSavedGroups,tb as preparedBillingAuthorizationSchema,ug as presentationSchema,jg as priceNodeSchema,ba as priceSchema,Rb as productAllowanceSchema,Nc as productBindingSchema,Pc as productBindingWriteSchema,Oc as productBindingsPageSchema,ac as productCollectionSchema,Ub as productConfigurationSchema,Xb as productDefinitionSchema,bc as productEditorOptionsSchema,nf as productGroupingMatches,mf as productGroupingSchema,Tb as productLicenseSchema,Si as productMigrationBlockReasonSchema,Zi as productMigrationDetailSchema,Ti as productMigrationErrorCodeSchema,Yi as productMigrationItemSchema,Wi as productMigrationItemStatusSchema,_i as productMigrationListSchema,Ui as productMigrationPreviewSchema,aj as productMigrationQuerySchema,Vi as productMigrationRunStatusSchema,Xi as productMigrationSchema,$i as productMigrationWriteSchema,_b as productOptionsSchema,Qb as productPrepaidPriceSchema,Pb as productPricesSchema,$b as productRecordSchema,Lg as productSelectionSchema,Sb as productTrialSchema,Vb as productVariantOverridesSchema,Wb as productVariantSchema,Uj as projectFunnelApiOutputs,Pk as projectFunnelConfiguration,Ad as projectSettingsSchema,_a as promotionCodeInputSchema,zc as protocolForSdkVersion,d as providerMarkupsSchema,Dg as publishChecks,Ae as purchaseListItemSchema,Ge as purchaseListPageSchema,Qf as radiusSchema,vj as readFunnelValuePath,Gh as redeemRewardRequestSchema,Kh as referralCodeSchema,Mh as referralProgramCollectionSchema,zh as referralProgramInputSchema,Bh as referralProgramRecordSchema,Eh as referralProgramWriteSchema,ni as remoteFeatureResultSchema,xg as replaceFirstPageRoot,Bl as resolveCouponDisplay,Yj as resolveFunnelCapabilityInputs,Gj as resolveFunnelTaskInputs,wj as resolveFunnelValueBinding,xj as resolveFunnelValueBindings,Yb as resolveProductVariant,Fg as resolveScreenLocale,Ec as resolveSdkProtocol,ti as responseMetaSchema,vb as revokeBillingAuthorizationInputSchema,Oh as rewardActivityRedemptionSchema,Ph as rewardActivitySchema,yh as rewardCodeInputSchema,Nh as rewardCodeSchema,Qh as rewardCodeWriteSchema,Lh as rewardCollectionSchema,vh as rewardConfigurationSchema,th as rewardGrantExpirySchema,uh as rewardGrantSchema,xh as rewardInputSchema,wh as rewardKeySchema,Ch as rewardOptionSchema,Ih as rewardProductCheckoutSchema,Ah as rewardRecordSchema,Fh as rewardRedemptionSchema,sh as rewardStatusSchema,rh as rewardTypeSchema,Dh as rewardWriteSchema,qa as runExperiment,am as sameMembershipBillingCycle,hj as saveSurfaceTemplateSchema,Y as scopeSchema,qg as screenActionSchema,oj as screenAnswersSchema,nj as screenDataCursorSchema,yg as screenDocumentSchema,Rf as screenImageSourceSchema,rj as screenInputBindingsSchema,pg as screenNodeSchema,pj as screenParametersSchema,Mg as screenPresentationSchema,rf as screenProductScopes,sf as screenProductSelections,Di as screenRenderPath,Bi as screenRenderPathSchema,Fi as screenRenderTags,Ci as screenRenderUrlSchema,sj as screenRendererInputSchema,Kg as screenSelections,rg as screenStringsSchema,yc as sdkProtocolRegistry,Fc as sdkProtocolResponseHeaders,yd as seatCommandSchema,xd as seatReadSchema,zd as seatsStateSchema,ek as selectFunnelCondition,pf as selectedPaywallProduct,Af as selectedSurfaceValue,Eg as servableLocales,Kb as setBillingCouponsInputSchema,$f as shadowSchema,Zf as shapeSchema,Uf as sizeSchema,Pf as spaceSchema,hg as spacerNodeSchema,Z as stableKeySchema,ng as stackInteractionSchema,og as stackNodeSchema,Ia as stickyAssignmentDocumentSchema,Rd as stripeAppendContextSchema,Qd as stripeCouponTermsSchema,Sd as stripePurchaseExecutionSchema,de as stripeRefundExecutionSchema,te as stripeSetupExecutionSchema,Xd as stripeSubscriptionUpdateExecutionSchema,Yd as stripeSubscriptionUpdatePreviewSchema,Zd as stripeSubscriptionUpdateResultSchema,oe as stripeTrialExecutionSchema,bg as styleSchema,Od as subscriptionAttachCommandSchema,Td as subscriptionAttachQuoteSchema,ie as subscriptionBatchCommandSchema,ke as subscriptionBatchGroupSchema,je as subscriptionBatchReadSchema,le as subscriptionBatchSchema,Vd as subscriptionCarryOptionsSchema,He as subscriptionConflictPageSchema,Ce as subscriptionConflictQuerySchema,Ee as subscriptionConflictRetryResultSchema,De as subscriptionConflictRetrySchema,Be as subscriptionConflictSchema,Jb as subscriptionCouponExecutionSchema,ze as subscriptionListItemSchema,Fe as subscriptionListPageSchema,Pd as subscriptionOperationInputSchema,Ud as subscriptionOperationSchema,ce as subscriptionRefundCommandSchema,ee as subscriptionRefundPreviewSchema,fe as subscriptionRefundResultSchema,me as subscriptionTrialCommandSchema,qe as subscriptionTrialPolicySchema,ne as subscriptionTrialReadSchema,pe as subscriptionTrialResultSchema,Wd as subscriptionUpdateCommandSchema,ae as subscriptionUpdatePreviewSchema,be as subscriptionUpdateResultSchema,ve as subscriptionVerificationInputSchema,we as subscriptionVerificationSchema,Kf as substituteHtmlVariables,zf as substituteSurfaceVariables,wf as surfaceDataSchema,sg as surfaceSchema,gj as surfaceTemplateSchema,vf as surfaceValueSchema,xf as surfaceVariableNames,Wl as templateScreen,cg as textNodeSchema,ag as textStyleSchema,Sf as themeSchema,ma as toAttributeString,pi as trackEventsRequestSchema,qi as trackEventsResultSchema,fk as transitionFunnelGraph,Ag as translatableFields,P as trialPolicySchema,Q as trialRecordSchema,yf as unknownSurfaceVariables,ld as usageAlertNotificationDataSchema,md as usageAllowanceNotificationDataSchema,nh as usageAnalyticsPageSchema,mh as usageAnalyticsQuerySchema,qh as usageBatchPageSchema,ph as usageBatchReadSchema,oh as usageBatchSubmitSchema,ah as usageEntityCommandSchema,bh as usageEntitySchema,kd as usageLimitNotificationDataSchema,dk as validateFunnelGraph,Fj as validateFunnelTaskData,xk as validateScreenAnswers,Cc as validateSdkProtocolRegistry,ia as validitySchema,si as verifiedPrincipalSchema,wg as walkDocument,zg as walkScreen,Cd as workspaceSettingsSchema};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinkerlandai/indiana-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Framework-independent Indiana SDK for customer identity, entitlements, credits, offers and growth surfaces.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -43,6 +43,10 @@
|
|
|
43
43
|
"./native-shell": {
|
|
44
44
|
"types": "./dist/native-shell.d.ts",
|
|
45
45
|
"import": "./dist/native-shell.js"
|
|
46
|
+
},
|
|
47
|
+
"./page": {
|
|
48
|
+
"types": "./dist/page.d.ts",
|
|
49
|
+
"import": "./dist/page.js"
|
|
46
50
|
}
|
|
47
51
|
},
|
|
48
52
|
"dependencies": {
|
package/dist/chunk-EZFAY4ZL.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Y as E,jc as O}from"./chunk-YOH6DIUN.js";var e=class extends Error{constructor(m,o,n,N){super(o);this.code=m;this.status=n;this.requestId=N;this.name="IndianaError"}code;status;requestId},V=Symbol("IndianaNoContent");function L(d,y){let m=d.webView??"hosted";if(!["hosted","embedded"].includes(m))throw new e("INVALID_REQUEST","Invalid Web View mode");let o=d.scope?E.parse(d.scope):void 0,n=new URL(d.baseUrl);if(n.username||n.password||n.search||n.hash)throw new e("INVALID_URL","baseUrl must not contain credentials, query, or fragment");if(n.protocol!=="https:"&&!(n.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(n.hostname)))throw new e("INVALID_URL","Use HTTPS, or HTTP on localhost during development");let N=d.fetch??globalThis.fetch.bind(globalThis),u=d.timeoutMs??1e4;if(!Number.isFinite(u)||u<=0||u>12e4)throw new e("INVALID_TIMEOUT","timeoutMs must be between 1 and 120000");let h=null,b,c=0,l=null,w=new Set;function S(){c+=1,h=null,l=null;for(let s of w)s.abort();w.clear()}async function _(s,R={},v="POST"){if(!h)throw new e("NOT_IDENTIFIED","Call identify with a server-issued customer token first");let I=c,r=new AbortController;w.add(r);let p=()=>I!==c?new e("IDENTITY_CHANGED","Customer identity changed while the request was in flight"):new e("TIMEOUT","Indiana request timed out"),g,A=new Promise((t,i)=>{g=()=>i(p()),r.signal.addEventListener("abort",g,{once:!0})}),D=setTimeout(()=>r.abort(),u),P=async()=>{let t=await N(`${n.href.replace(/\/$/,"")}/api/v1/${s}`,{method:v,headers:{"Content-Type":"application/json",Authorization:`Bearer ${h}`,...o?{"X-Indiana-Project":o.projectId,"X-Indiana-Environment":o.environment}:{}},body:v==="POST"?JSON.stringify(R):void 0,signal:r.signal,credentials:"omit",cache:"no-store",redirect:"error"});if(r.signal.aborted)throw p();let i=t.status===204?V:await t.json();if(r.signal.aborted)throw p();if(I!==c)throw new e("IDENTITY_CHANGED","Customer identity changed while the request was in flight");if(!t.ok){let a=O.safeParse(i);throw new e(a.success?a.data.error.code:"HTTP_ERROR",a.success?a.data.error.message:"Indiana request failed",t.status,t.headers.get("X-Request-Id")??void 0)}if(o&&i&&typeof i=="object"&&"scope"in i){let a=E.safeParse(i.scope);if(!a.success||a.data.projectId!==o.projectId||a.data.environment!==o.environment)throw new e("SCOPE_MISMATCH","Response scope does not match this SDK instance")}let T=t.headers.get("X-Indiana-Web-View");if(T){if(!/^\/web-view\/renderer\/[a-f0-9]{64}$/.test(T))throw new e("INVALID_RESPONSE","Invalid Web View renderer metadata");b=T}let f=t.headers.get("X-Indiana-Telemetry-Subject");if(f){if(!/^[a-f0-9]{64}$/.test(f))throw new e("INVALID_RESPONSE","Invalid telemetry identity");l!==f&&(l=f,y?.(l))}return i};try{return await Promise.race([P(),A])}catch(t){throw I!==c?new e("IDENTITY_CHANGED","Customer identity changed while the request was in flight"):t instanceof e?t:new e(r.signal.aborted?"TIMEOUT":"NETWORK_ERROR",r.signal.aborted?"Indiana request timed out":"Unable to read the Indiana response")}finally{clearTimeout(D),r.signal.removeEventListener("abort",g),w.delete(r)}}return{subjectKey:()=>l,webViewUrl(){if(m!=="embedded"){if(!b)throw new e("INVALID_RESPONSE","The gateway did not provide a hosted Web View renderer");return new URL(b,n).href}},identify(s){if(!s.trim()||/\s/.test(s)||s.length>4096)throw new e("INVALID_TOKEN","A nonempty server-issued token is required");S(),h=s},reset:S,request:_}}export{e as a,L as b};
|
package/dist/chunk-ULRVTA45.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as s,b as E}from"./chunk-EZFAY4ZL.js";import{Dj as D,Lh as w,Mj as V,Oe as b,Oj as N,ma as I,na as x,oa as k,pa as h,ra as v,sj as O}from"./chunk-YOH6DIUN.js";async function q(n,t){if(!/^gg_ct_[A-Za-z0-9_-]{43}$/.test(t.customerToken))throw new s("INVALID_TOKEN","A verified Customer credential is required");let a=E(n);a.identify(t.customerToken);let i=w.resolvePaywall.request.parse({selector:{type:"paywall",paywallId:t.paywallId},commerce:t.commerce,locale:t.locale,...t.requirement?{requirement:t.requirement}:{}}),e=null,o=null,u=null,r=null,c=null;async function p(){let l=w.resolvePaywall,f=l.response.parse(await a.request(l.path,l.request.parse({...i,selector:e?{type:"version",versionId:e.id}:i.selector})));if(f.paywall.paywallId!==t.paywallId)throw new s("INVALID_RESPONSE","The requested Paywall changed");if(e&&(f.paywall.id!==e.id||f.paywall.paywallId!==e.paywallId||f.paywall.offering.id!==e.offering.id))throw new s("INVALID_RESPONSE","The pinned Paywall or Offering Version changed");return e=f.paywall,structuredClone(e)}async function d(l){if(!o)throw new s("INVALID_REQUEST","A quoted purchase is required");let f=l==="read"?w.readSubscriptionOperation:w.attach,m=f.response.parse(await a.request(f.path,f.request.parse({operationId:o.operationId,...l==="read"?{}:{intent:l}})));if(m.operation.operationId!==o.operationId||m.operation.currency!==i.commerce.currency)throw new s("INVALID_RESPONSE","The purchase operation changed");return u?.status==="complete"&&m.operation.status!=="complete"||u&&u.status!=="pending"&&m.operation.status==="pending"||(u=m.operation),structuredClone(u)}let y={get view(){return e?structuredClone(e):null},get quote(){return o?structuredClone(o):null},get operation(){return u?structuredClone(u):null},get webViewUrl(){return a.webViewUrl()},refresh:p,async preview(l){if(!e)throw new s("INVALID_REQUEST","Load the Paywall first");let f=e.document.buttons[l.actionId];if(f?.type!=="checkout")throw new s("INVALID_REQUEST","Choose an authored purchase action");let m=b(f.product,l.selection,e.capabilities);if(!m)throw new s("PRODUCT_UNAVAILABLE","Choose an available Product");let C=w.previewAttach.request.parse({requestId:l.requestId,plans:[{productVersionId:m}],provider:i.commerce.provider,currency:i.commerce.currency,...l.offerId?{offerId:l.offerId}:{},...l.nativeOffer?{nativeOffer:l.nativeOffer}:{}}),A=JSON.stringify(C);if(r&&r!==A&&(!u||u.status==="pending"))throw new s("COMMAND_PENDING","Finish or cancel the original purchase before changing it");if(r===A){if(c)return c;if(o)return structuredClone(o)}r=A;let P=(async()=>{let F=w.previewAttach,g=F.response.parse(await a.request(F.path,C));if(g.quote.currency!==i.commerce.currency||g.quote.provider!==i.commerce.provider||g.quote.lines.length!==1||g.quote.lines[0].productVersionId!==m)throw new s("INVALID_RESPONSE","The purchase quote changed its selected Product or presentment");return o=g.quote,u=null,structuredClone(o)})();c=P;try{return await P}finally{c===P&&(c=null)}},confirm:()=>d("confirm"),cancel:()=>d("cancel"),read:()=>d("read"),destroy(){a.reset(),e=null,o=null,u=null,r=null}};return await p(),y}function L(n){let t=null,a=null,i=0,e={attributes:v.parse(n.attributes??{}),onFeatureUsage:n.onFeatureUsage?(r,c)=>n.onFeatureUsage(r,structuredClone(c)):void 0,onExperimentViewed:n.onExperimentViewed?(r,c)=>n.onExperimentViewed(structuredClone(r),structuredClone(c)):void 0,stickyBucketAssignmentDocs:structuredClone(n.stickyBucketAssignmentDocs),saveStickyBucketAssignmentDoc:n.saveStickyBucketAssignmentDoc?r=>n.saveStickyBucketAssignmentDoc(structuredClone(r)):void 0,trackedFeatureUsage:{},trackedExperiments:new Set},o=r=>{if(!t)throw new Error("Initialize the Feature client before evaluation");if(t.expiresAt&&Date.parse(t.expiresAt)<=Date.now())throw new Error("Feature configuration expired; refresh before evaluation");return structuredClone(h(r,e))};async function u(){if(a)return a;let r=i,c=(async()=>{let p=V.parse(await n.load());if(p.scope.projectId!==n.scope.projectId||p.scope.environment!==n.scope.environment)throw new Error("Feature payload scope changed");if(r!==i)throw new Error("Feature client was reset");return t=structuredClone(p),e.features=t.features,e.savedGroups=I(t.savedGroups),e.trackedFeatureUsage={},structuredClone(t)})();a=c;try{return await c}finally{a===c&&(a=null)}}return{init:u,refresh:u,get generation(){return t?.generation??null},setAttributes(r){e.attributes=v.parse(r)},evalFeature:o,getFeatureValue(r,c){let p=o(r).value;return p===null?structuredClone(c):structuredClone(p)},reset(){i++,a=null,t=null,e.features={},e.savedGroups={},e.stickyBucketAssignmentDocs={},e.attributes={},e.trackedFeatureUsage={},e.trackedExperiments?.clear()}}}function Q(n,t,a){let i=N.parse(n);if(i.evaluationMode!=="local")throw new s("EVALUATION_MODE","Remote nodes are evaluated by Grow");if(i.expiresAt&&Date.parse(i.expiresAt)<=Date.now())throw new s("CONFIGURATION_EXPIRED","Refresh local rules at the scheduled transition");let e=i.topology.nodes.find(d=>d.id===t);if(!e)throw new s("NOT_FOUND","Funnel node is unavailable");let o=v.parse(a.attributes??{}),u={attributes:o,saveStickyBucketAssignmentDoc:a.saveStickyBucketAssignmentDoc?d=>a.saveStickyBucketAssignmentDoc(structuredClone(d)):void 0,onFeatureUsage:a.onFeatureUsage?(d,y)=>a.onFeatureUsage(d,structuredClone(y)):void 0,onExperimentViewed:a.onExperimentViewed?(d,y)=>a.onExperimentViewed(structuredClone(d),structuredClone(y)):void 0,features:structuredClone(i.growth.features),savedGroups:I(i.growth.savedGroups),stickyBucketAssignmentDocs:structuredClone(a.stickyBucketAssignmentDocs)},r,c;if(e.type==="condition"){let d=i.conditions[e.id];if(!d)throw new s("INVALID_RESPONSE","Local condition rules are unavailable");r=d.find(y=>x(o,y.condition,u.savedGroups))?.port??"default"}else if(e.type==="feature"){if(!e.resources.featureKey)throw new s("INVALID_RESPONSE","Feature reference is unavailable");c=h(e.resources.featureKey,u).value,r="next"}else if(e.type==="split"){let d=e.resources.experimentId,y=d?i.growth.experiments[d]:null;if(!y||!d)throw new s("INVALID_RESPONSE","Experiment reference is unavailable");let l=k(y,u);c=l.value,r=l.inExperiment&&!l.passthrough&&typeof l.value=="string"?l.value:"notParticipating"}else throw new s("SERVER_REQUIRED","This node is driven by the authoritative Funnel runtime");let p=e.outputs[r];if(!p)throw new s("INVALID_RESPONSE","Evaluated node exit is unavailable");return{nodeId:t,port:r,target:p,...c===void 0?{}:{value:c}}}function K(n,t){return t.type==="id"?n.customerId===t.value:n.externalUserId===t.value}function S(n,t){if(n===t)return!0;if(Array.isArray(n)||Array.isArray(t))return Array.isArray(n)&&Array.isArray(t)&&n.length===t.length&&n.every((e,o)=>S(e,t[o]));if(!n||!t||typeof n!="object"||typeof t!="object")return!1;let a=Object.entries(n),i=Object.entries(t);return a.length===i.length&&a.every(([e,o])=>Object.hasOwn(t,e)&&S(o,Reflect.get(t,e)))}function X(n){let t=/^gg_ct_[A-Za-z0-9_-]{32,128}$/.test(n.apiKey);if(typeof window<"u"&&!t)throw new s("SERVER_ONLY","Funnel starts are issued by your backend");if(!t&&!/^gg_sk_[A-Za-z0-9_-]{32,128}$/.test(n.apiKey))throw new s("INVALID_TOKEN","A customer credential or server API key is required");let a=E({...n,timeoutMs:n.timeoutMs??35e3});return a.identify(n.apiKey),{async start(i){let e=O.safeParse({...i,operation:"start"});if(!e.success||e.data.operation!=="start"||(t?e.data.customer!==void 0:e.data.customer===void 0))throw new s("INVALID_REQUEST","Invalid current Funnel start");let o=e.data,u=D.safeParse(await a.request("funnels",o));if(!u.success||!u.data.runToken)throw new s("INVALID_RESPONSE","Funnel start credentials are missing");let r=u.data;if(r.run.source.id!==o.funnelId||r.run.locale!==(o.locale??"en")||!S(r.run.parameters,o.parameters??{})||(o.customer?!r.customerId||o.customer.type==="id"&&r.customerId!==o.customer.value:r.customerId!==void 0))throw new s("INVALID_RESPONSE","Funnel start contract changed");return{...r,runToken:r.runToken}}}}export{K as a,S as b,q as c,L as d,Q as e,X as f};
|