palbase 0.52.2 → 0.52.3

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 (50) hide show
  1. package/dist/ai/index.js +2 -2
  2. package/dist/backend/engine.js +2 -2
  3. package/dist/backend/env.js +1 -1
  4. package/dist/backend/index.js +3 -3
  5. package/dist/backend/stack.js +1 -1
  6. package/dist/backend/test.js +2 -2
  7. package/dist/chunks/{CS7VS2I4.js → 2PCDSIWJ.js} +1 -1
  8. package/dist/chunks/{F3RZ5XX3.js → 3OXYHLPZ.js} +2 -2
  9. package/dist/chunks/{6KUEOXTD.js → 57HMBEZC.js} +2 -2
  10. package/dist/chunks/{3ECCMPHK.js → 5ASDRQ76.js} +2 -2
  11. package/dist/chunks/{QZNTAOHQ.js → 6EWQSD7D.js} +1 -1
  12. package/dist/chunks/{R5DJKZ7O.js → 7ZMRJPD5.js} +2 -2
  13. package/dist/chunks/{2TJ6G7EB.js → CLFVU67I.js} +2 -2
  14. package/dist/chunks/{HJ32UYIZ.js → DOOOEV6B.js} +2 -2
  15. package/dist/chunks/IAEVNAIO.js +2 -0
  16. package/dist/chunks/{GPO2P47C.js → IMY77ULI.js} +1 -1
  17. package/dist/chunks/{FZYSYMLN.js → JJC4IE3C.js} +2 -2
  18. package/dist/chunks/{UYSZUJJJ.js → JL542ZSC.js} +2 -2
  19. package/dist/chunks/{UZHDAEGV.js → LHOFBMBZ.js} +2 -2
  20. package/dist/chunks/{7MZR43VA.js → MFQQUKVA.js} +2 -2
  21. package/dist/chunks/{SNAGLIWD.js → N7ZEBHXL.js} +2 -2
  22. package/dist/chunks/{XW72Z3PD.js → OPXS5CYY.js} +1 -1
  23. package/dist/chunks/{CNNM6TEU.js → P2IYCDCP.js} +1 -1
  24. package/dist/chunks/{USFK3JYL.js → QBER5HWP.js} +2 -2
  25. package/dist/chunks/{7KWRJAD3.js → TGML3Y7W.js} +2 -2
  26. package/dist/chunks/{LIAYIEXX.js → UH5Q63EN.js} +2 -2
  27. package/dist/chunks/{LRBCJG6J.js → VNMRZXZM.js} +2 -2
  28. package/dist/chunks/{CAFJGSSL.js → XHTOI77Q.js} +1 -1
  29. package/dist/chunks/{QBPW2ZV2.js → ZAR57AMM.js} +1 -1
  30. package/dist/cli.js +111 -111
  31. package/dist/cloud/index.js +2 -2
  32. package/dist/refuse/ai.js +1 -1
  33. package/dist/refuse/backend.js +1 -1
  34. package/dist/refuse/cloud.js +1 -1
  35. package/dist/refuse/server.js +1 -1
  36. package/dist/server/index.js +2 -2
  37. package/dist/server/testing.js +2 -2
  38. package/dist/web/index.js +2 -2
  39. package/dist/web/message.js +2 -2
  40. package/dist/web/palbe.js +2 -2
  41. package/dist/web/paywall.js +2 -2
  42. package/dist/web/push-sw.js +1 -1
  43. package/dist/web/ssr.js +2 -2
  44. package/dist/web/vite.js +2 -2
  45. package/package.json +2 -2
  46. package/types/internal/src/modules/auth.d.ts +22 -10
  47. package/types/internal/src/modules/events.d.ts +2 -2
  48. package/types/internal/src/modules/machines.d.ts +17 -3
  49. package/types/internal/src/modules/notify.d.ts +34 -2
  50. package/dist/chunks/WBQBWQEG.js +0 -2
@@ -1,2 +1,2 @@
1
- /*! palbase 0.52.2 — Palbase SDK License (see LICENSE) */
2
- import{a as G}from"../chunks/CAFJGSSL.js";import{a as P,b as k,c as S,e as w,f as C,g as A,h as T,i as R,j,k as E,l as x,m as D,n as M,o as U}from"../chunks/WBQBWQEG.js";import{a as I,b as B}from"../chunks/2TJ6G7EB.js";import{b as y,c as r,d as f}from"../chunks/LIAYIEXX.js";import"../chunks/CS7VS2I4.js";import"../chunks/CNNM6TEU.js";function L(t){let e=P.client(t),a=k.client(t),n=S.client(t),p=w.client(t),g=C.client(t),m=A.client(t),s=T.client(t),d=R.client(t),l=j.client(t),i=E.client(t),h=x.client(t),c=D.client(t),u=M.client(t),o=U.client(t);return{ai:{draftAgent:e.draftAgent,listAgents:e.listAgents,getAgent:e.getAgent,putAgent:e.putAgent,deleteAgent:e.deleteAgent,publishAgent:e.publishAgent,rollbackAgent:e.rollbackAgent,listAgentVersions:e.listAgentVersions,listChats:e.listChats,createChat:e.createChat,getChat:e.getChat,deleteChat:e.deleteChat,decideChatApproval:e.decideChatApproval,forkChat:e.forkChat,getChatGoal:e.getChatGoal,setChatGoal:e.setChatGoal,clearChatGoal:e.clearChatGoal,updateChatGoal:e.updateChatGoal,putChatMember:e.putChatMember,deleteChatMember:e.deleteChatMember,listChatMessages:e.listChatMessages,sendChatMessage:e.sendChatMessage,getChatMessageAttachment:e.getChatMessageAttachment,listChatParts:e.listChatParts,putChatPipe:e.putChatPipe,deleteChatPipe:e.deleteChatPipe,sendSubagentMessage:e.sendSubagentMessage,stopSubagent:e.stopSubagent,stopChat:e.stopChat,listTurnToolCalls:e.listTurnToolCalls,getChatToolCall:e.getChatToolCall,answerChatToolCall:e.answerChatToolCall,listChatTurnArtifacts:e.listChatTurnArtifacts,getChatTurnArtifact:e.getChatTurnArtifact,getChatTurnCost:e.getChatTurnCost,startChatVoice:e.startChatVoice,getChatVoice:e.getChatVoice,closeChatVoice:e.closeChatVoice,commandChatVoice:e.commandChatVoice,getChatWorkspaceFile:e.getChatWorkspaceFile,putChatWorkspaceFile:e.putChatWorkspaceFile,deleteChatWorkspaceFile:e.deleteChatWorkspaceFile,addChatWorkspaceRepo:e.addChatWorkspaceRepo,listChatWorkspaceTokens:e.listChatWorkspaceTokens,createChatWorkspaceToken:e.createChatWorkspaceToken,revokeChatWorkspaceToken:e.revokeChatWorkspaceToken,createEmbeddings:e.createEmbeddings,listEndpoints:e.listEndpoints,putEndpoint:e.putEndpoint,deleteEndpoint:e.deleteEndpoint,listEnv:e.listEnv,putEnv:e.putEnv,deleteEnv:e.deleteEnv,createImage:e.createImage,getImage:e.getImage,getImageFile:e.getImageFile,deleteMachine:e.deleteMachine,cordonMachine:e.cordonMachine,resumeMachine:e.resumeMachine,listModels:e.listModels,revokePoolKey:e.revokePoolKey,listPools:e.listPools,createPool:e.createPool,deletePool:e.deletePool,listPoolKeys:e.listPoolKeys,createPoolKey:e.createPoolKey,getPoolState:e.getPoolState,listProviders:e.listProviders,connectProvider:e.connectProvider,disconnectProvider:e.disconnectProvider,listRepos:e.listRepos,putRepo:e.putRepo,deleteRepo:e.deleteRepo,createResponse:e.createResponse,getResponse:e.getResponse,cancelResponse:e.cancelResponse,followResponse:e.followResponse,getSettings:e.getSettings,putSettings:e.putSettings,getSpend:e.getSpend,askSupport:e.askSupport,listTools:e.listTools,listUsage:e.listUsage},analytics:{listAudiences:a.listAudiences,createAudience:a.createAudience,previewAudience:a.previewAudience,getAudience:a.getAudience,deleteAudience:a.deleteAudience,updateAudience:a.updateAudience,listAudienceMembers:a.listAudienceMembers,alias:a.alias,batch:a.batch,getEventBreakdown:a.getEventBreakdown,capture:a.capture,sendConsoleHistory:a.sendConsoleHistory,getConsoleConfig:a.getConsoleConfig,listConsoleRecords:a.listConsoleRecords,listEventNames:a.listEventNames,listEvents:a.listEvents,getEventTimeline:a.getEventTimeline,runFunnel:a.runFunnel,identify:a.identify,page:a.page,sendPerf:a.sendPerf,listPerfGroups:a.listPerfGroups,getPerfConfig:a.getPerfConfig,getPerfTimeline:a.getPerfTimeline,listRequestLines:a.listRequestLines,getMachineTraffic:a.getMachineTraffic,runRetention:a.runRetention,screen:a.screen,getSettings:a.getSettings,putSettings:a.putSettings,getSummary:a.getSummary,listTraces:a.listTraces,sendTrace:a.sendTrace,sendTraceBatch:a.sendTraceBatch,getTraceHops:a.getTraceHops,listSessionTraces:a.listSessionTraces,getTraceSummary:a.getTraceSummary,getTraceTimeline:a.getTraceTimeline,searchPeople:a.searchPeople,setPersonProperties:a.setPersonProperties,getPerson:a.getPerson,listPersonEvents:a.listPersonEvents,getEventCatalog:a.getEventCatalog,defineEvent:a.defineEvent},auth:{adminVerifyDeviceAssertion:n.adminVerifyDeviceAssertion,adminGetAttestPolicy:n.adminGetAttestPolicy,adminGetAttestObservations:n.adminGetAttestObservations,adminRecordAttestObservations:n.adminRecordAttestObservations,adminListAuditEvents:n.adminListAuditEvents,adminExportAuditEvents:n.adminExportAuditEvents,adminVerifyAuditTrail:n.adminVerifyAuditTrail,adminGetAuthSettings:n.adminGetAuthSettings,adminUpdateAuthSettings:n.adminUpdateAuthSettings,adminGetBreachWatch:n.adminGetBreachWatch,adminListHooks:n.adminListHooks,adminCreateHook:n.adminCreateHook,adminUpdateHook:n.adminUpdateHook,adminDeleteHook:n.adminDeleteHook,adminListHookExecutions:n.adminListHookExecutions,adminListIntegrations:n.adminListIntegrations,adminPutIntegration:n.adminPutIntegration,adminDeleteIntegration:n.adminDeleteIntegration,adminListOAuthClients:n.adminListOAuthClients,adminCreateOAuthClient:n.adminCreateOAuthClient,adminGetOAuthClient:n.adminGetOAuthClient,adminDeleteOAuthClient:n.adminDeleteOAuthClient,adminUpdateOAuthClient:n.adminUpdateOAuthClient,adminListProviders:n.adminListProviders,adminGetPhoneSettings:n.adminGetPhoneSettings,adminUpdatePhoneSettings:n.adminUpdatePhoneSettings,adminToggleProvider:n.adminToggleProvider,adminListRoles:n.adminListRoles,adminUpsertRole:n.adminUpsertRole,adminDeleteRole:n.adminDeleteRole,adminListServiceAccounts:n.adminListServiceAccounts,adminCreateServiceAccount:n.adminCreateServiceAccount,adminGetServiceAccount:n.adminGetServiceAccount,adminRevokeServiceAccount:n.adminRevokeServiceAccount,adminRotateServiceAccount:n.adminRotateServiceAccount,adminListSessions:n.adminListSessions,adminRevokeSession:n.adminRevokeSession,adminListSigningKeys:n.adminListSigningKeys,adminRotateSigningKey:n.adminRotateSigningKey,socialAdminConfig:n.socialAdminConfig,socialCredentialPut:n.socialCredentialPut,socialCredentialDelete:n.socialCredentialDelete,socialProviderPatch:n.socialProviderPatch,adminGetStats:n.adminGetStats,adminSendTestTemplate:n.adminSendTestTemplate,adminListTestUsers:n.adminListTestUsers,adminCreateTestUsers:n.adminCreateTestUsers,adminSetTestUserPhone:n.adminSetTestUserPhone,adminCreateTestSignupAddress:n.adminCreateTestSignupAddress,adminDeleteTestUser:n.adminDeleteTestUser,adminCreateCustomToken:n.adminCreateCustomToken,adminListUsers:n.adminListUsers,adminCreateUser:n.adminCreateUser,adminImportUsers:n.adminImportUsers,adminGetUser:n.adminGetUser,adminDeleteUser:n.adminDeleteUser,adminUpdateUser:n.adminUpdateUser,adminBanUser:n.adminBanUser,adminGetUserConsents:n.adminGetUserConsents,adminRevokeUserCredentials:n.adminRevokeUserCredentials,adminExportUser:n.adminExportUser,adminListUserMfaFactors:n.adminListUserMfaFactors,adminResetUserMfa:n.adminResetUserMfa,adminResetUserPassword:n.adminResetUserPassword,adminListUserRoles:n.adminListUserRoles,adminAssignUserRole:n.adminAssignUserRole,adminRevokeUserRole:n.adminRevokeUserRole,adminRevokeUserSessions:n.adminRevokeUserSessions,adminUnbanUser:n.adminUnbanUser,adminGetInstallationConsents:n.adminGetInstallationConsents,adminRefuseConsents:n.adminRefuseConsents,adminInviteUser:n.adminInviteUser},calls:{adminListCalls:p.adminListCalls,adminGetCall:p.adminGetCall,adminEndCall:p.adminEndCall,createCallTicket:p.createCallTicket,getCallSettings:p.getCallSettings,putCallSettings:p.putCallSettings,rotateCallHookSecret:p.rotateCallHookSecret},flags:{getValues:g.getValues,batchUserValues:g.batchUserValues,getDelta:g.getDelta,getEvaluations:g.getEvaluations,listExperiments:g.listExperiments,startExperiment:g.startExperiment,getExperiment:g.getExperiment,getExperimentResults:g.getExperimentResults,stopExperiment:g.stopExperiment,declareExperimentWinner:g.declareExperimentWinner,getCurrentInstallations:g.getCurrentInstallations,getInstallationsDaily:g.getInstallationsDaily,getSnapshot:g.getSnapshot,listDefinitions:g.listDefinitions,getDefinition:g.getDefinition,putDefinition:g.putDefinition,deleteDefinition:g.deleteDefinition,activateTemplates:g.activateTemplates,getActiveTemplate:g.getActiveTemplate,getTemplateCapabilities:g.getTemplateCapabilities,getTemplateDraft:g.getTemplateDraft,createTemplateDraft:g.createTemplateDraft,discardTemplateDraft:g.discardTemplateDraft,putTemplateParameter:g.putTemplateParameter,removeTemplateParameter:g.removeTemplateParameter,reviewTemplateDraft:g.reviewTemplateDraft,publishTemplate:g.publishTemplate,getPublishReceipt:g.getPublishReceipt,restoreTemplateVersion:g.restoreTemplateVersion,listTemplateVersions:g.listTemplateVersions,getTemplateVersion:g.getTemplateVersion,getUserValues:g.getUserValues,putUserValues:g.putUserValues,deleteUserValues:g.deleteUserValues,putUserValue:g.putUserValue,deleteUserValue:g.deleteUserValue},journeys:{listJourneys:m.listJourneys,createJourney:m.createJourney,listPersonRuns:m.listPersonRuns,simulateJourney:m.simulateJourney,validateJourney:m.validateJourney,getJourney:m.getJourney,updateJourney:m.updateJourney,deleteJourney:m.deleteJourney,copyJourney:m.copyJourney,publishJourney:m.publishJourney,listJourneyRuns:m.listJourneyRuns,getJourneyStats:m.getJourneyStats,stopJourney:m.stopJourney,testJourney:m.testJourney},machines:{listMachines:s.listMachines,createMachine:s.createMachine,listMachineSizes:s.listMachineSizes,getMachineNetwork:s.getMachineNetwork,connectGitHub:s.connectGitHub,listInstallations:s.listInstallations,linkInstallation:s.linkInstallation,shareInstallation:s.shareInstallation,unlinkInstallation:s.unlinkInstallation,listRepositories:s.listRepositories,getMachine:s.getMachine,deleteMachine:s.deleteMachine,updateMachine:s.updateMachine,listBuilds:s.listBuilds,deployMachine:s.deployMachine,listMachinePreviews:s.listMachinePreviews,putMachinePreview:s.putMachinePreview,deleteMachinePreview:s.deleteMachinePreview,listMachineDomains:s.listMachineDomains,addMachineDomain:s.addMachineDomain,deleteMachineDomain:s.deleteMachineDomain,updateMachineDomain:s.updateMachineDomain,getBuild:s.getBuild,getBuildLog:s.getBuildLog,rollbackMachine:s.rollbackMachine,listDatabases:s.listDatabases,createDatabase:s.createDatabase,listDatabaseSizes:s.listDatabaseSizes,getDatabase:s.getDatabase,deleteDatabase:s.deleteDatabase,updateDatabase:s.updateDatabase,undeleteDatabase:s.undeleteDatabase,purgeDatabase:s.purgeDatabase,getDatabaseCredentials:s.getDatabaseCredentials,changeDatabasePassword:s.changeDatabasePassword,readMachineLogs:s.readMachineLogs,execInMachine:s.execInMachine,listMachineExecs:s.listMachineExecs,getMachineMetrics:s.getMachineMetrics,getMachineContract:s.getMachineContract,restoreDatabase:s.restoreDatabase,getDatabaseSchema:s.getDatabaseSchema,getDatabaseMetrics:s.getDatabaseMetrics,queryDatabase:s.queryDatabase,listCrons:s.listCrons,listCronRuns:s.listCronRuns,runCron:s.runCron,pauseCron:s.pauseCron,resumeCron:s.resumeCron,listTasks:s.listTasks,enqueueTask:s.enqueueTask,getTask:s.getTask,cancelTask:s.cancelTask,retryTask:s.retryTask,listTaskTypes:s.listTaskTypes,makeTemplatedTestUsers:s.makeTemplatedTestUsers,templateTestUser:s.templateTestUser,deleteTemplatedTestUser:s.deleteTemplatedTestUser,listSites:s.listSites,createSite:s.createSite,getSite:s.getSite,deleteSite:s.deleteSite,updateSite:s.updateSite,listSiteReleases:s.listSiteReleases,createSiteRelease:s.createSiteRelease,uploadSiteFile:s.uploadSiteFile,finishSiteRelease:s.finishSiteRelease,rollbackSite:s.rollbackSite,listSiteBuilds:s.listSiteBuilds,deploySite:s.deploySite,listSitePreviews:s.listSitePreviews,listSiteDomains:s.listSiteDomains,addSiteDomain:s.addSiteDomain,deleteSiteDomain:s.deleteSiteDomain,updateSiteDomain:s.updateSiteDomain,getSiteBuild:s.getSiteBuild,authorizeSitePreview:s.authorizeSitePreview,authorizeMachinePreview:s.authorizeMachinePreview,openMachinePreview:s.openMachinePreview,moveMachine:s.moveMachine,moveSite:s.moveSite,moveDatabase:s.moveDatabase,cancelSiteBuild:s.cancelSiteBuild,cancelBuild:s.cancelBuild,listSiteHooks:s.listSiteHooks,createSiteHook:s.createSiteHook,deleteSiteHook:s.deleteSiteHook,listMachineHooks:s.listMachineHooks,createMachineHook:s.createMachineHook,deleteMachineHook:s.deleteMachineHook,detectProject:s.detectProject,createPreviewPass:s.createPreviewPass,listPreviewLinks:s.listPreviewLinks,createPreviewLink:s.createPreviewLink,deletePreviewLink:s.deletePreviewLink,listEnvironmentDomains:s.listEnvironmentDomains,addEnvironmentDomain:s.addEnvironmentDomain,deleteEnvironmentDomain:s.deleteEnvironmentDomain,setEnvironmentSignInDomain:s.setEnvironmentSignInDomain},messaging:{adminAccessLog:d.adminAccessLog,adminListConversations:d.adminListConversations,adminCreateConversation:d.adminCreateConversation,adminGetConversation:d.adminGetConversation,adminDeleteConversation:d.adminDeleteConversation,adminUpdateConversation:d.adminUpdateConversation,adminAddMembers:d.adminAddMembers,adminRemoveMember:d.adminRemoveMember,adminListMessages:d.adminListMessages,adminSendMessage:d.adminSendMessage,adminDeleteMessage:d.adminDeleteMessage,adminFileUrl:d.adminFileUrl,adminPutProfile:d.adminPutProfile,adminListReports:d.adminListReports,adminGetReport:d.adminGetReport,adminReportFileUrl:d.adminReportFileUrl,adminResolveReport:d.adminResolveReport,getSettings:d.getSettings,putSettings:d.putSettings,rotateHookSecret:d.rotateHookSecret},notify:{getDeliverability:l.getDeliverability,listDevices:l.listDevices,getDeviceStats:l.getDeviceStats,deleteMyDevice:l.deleteMyDevice,sendEmail:l.sendEmail,listInAppCampaigns:l.listInAppCampaigns,createInAppCampaign:l.createInAppCampaign,getInAppCampaign:l.getInAppCampaign,putInAppCampaign:l.putInAppCampaign,deleteInAppCampaign:l.deleteInAppCampaign,getInAppCampaignStats:l.getInAppCampaignStats,listInAppTemplates:l.listInAppTemplates,sendInbox:l.sendInbox,listInboxMessages:l.listInboxMessages,listNotifyMessages:l.listNotifyMessages,getNotifyMessage:l.getNotifyMessage,cancelMessage:l.cancelMessage,getMetricsSummary:l.getMetricsSummary,listNotifyProviders:l.listNotifyProviders,putNotifyProvider:l.putNotifyProvider,deleteNotifyProvider:l.deleteNotifyProvider,sendPush:l.sendPush,getNotifySettings:l.getNotifySettings,putNotifySettings:l.putNotifySettings,sendSms:l.sendSms,listEmailTemplates:l.listEmailTemplates,getEmailTemplate:l.getEmailTemplate,putEmailTemplate:l.putEmailTemplate,deleteEmailTemplate:l.deleteEmailTemplate,listPushTemplates:l.listPushTemplates,getPushTemplate:l.getPushTemplate,putPushTemplate:l.putPushTemplate,deletePushTemplate:l.deletePushTemplate,listSmsTemplates:l.listSmsTemplates,getSmsTemplate:l.getSmsTemplate,putSmsTemplate:l.putSmsTemplate,deleteSmsTemplate:l.deleteSmsTemplate,listWhatsAppTemplates:l.listWhatsAppTemplates,getWhatsAppTemplate:l.getWhatsAppTemplate,putWhatsAppTemplate:l.putWhatsAppTemplate,deleteWhatsAppTemplate:l.deleteWhatsAppTemplate,listTestUserMessages:l.listTestUserMessages,listTopics:l.listTopics,createTopic:l.createTopic,deleteTopic:l.deleteTopic,changeTopic:l.changeTopic,addTopicSubscribers:l.addTopicSubscribers,removeTopicSubscriber:l.removeTopicSubscriber,listUserDevices:l.listUserDevices,getUserPreferences:l.getUserPreferences,setUserPreferences:l.setUserPreferences,startVerification:l.startVerification,checkVerification:l.checkVerification,getWebPushStatus:l.getWebPushStatus,sendWhatsApp:l.sendWhatsApp,listWhatsAppInbound:l.listWhatsAppInbound},purchases:{getAppleAccount:i.getAppleAccount,disconnectApple:i.disconnectApple,createAppleGrant:i.createAppleGrant,getAppleReadiness:i.getAppleReadiness,setXcodeCertificate:i.setXcodeCertificate,clearXcodeCertificate:i.clearXcodeCertificate,getGoogleAccount:i.getGoogleAccount,connectGoogle:i.connectGoogle,disconnectGoogle:i.disconnectGoogle,getCatalog:i.getCatalog,saveCatalog:i.saveCatalog,planCatalog:i.planCatalog,getCatalogPlan:i.getCatalogPlan,confirmCatalogPlan:i.confirmCatalogPlan,declineCatalogPlan:i.declineCatalogPlan,validateCatalog:i.validateCatalog,listCharts:i.listCharts,getChartsOverview:i.getChartsOverview,getChart:i.getChart,getCustomer:i.getCustomer,grantCredits:i.grantCredits,listCreditEntries:i.listCreditEntries,forgiveCredits:i.forgiveCredits,listCustomerGrants:i.listCustomerGrants,grantEntitlement:i.grantEntitlement,revokeGrant:i.revokeGrant,holdSpend:i.holdSpend,setCustomerLimit:i.setCustomerLimit,clearCustomerLimit:i.clearCustomerLimit,grantLimit:i.grantLimit,spend:i.spend,commitSpend:i.commitSpend,extendHold:i.extendHold,releaseSpend:i.releaseSpend,reverseSpend:i.reverseSpend,listExperiments:i.listExperiments,startExperiment:i.startExperiment,getExperiment:i.getExperiment,getExperimentResults:i.getExperimentResults,stopExperiment:i.stopExperiment,declareExperimentWinner:i.declareExperimentWinner,getOfferings:i.getOfferings,listPaywalls:i.listPaywalls,createPaywall:i.createPaywall,listPaywallAssets:i.listPaywallAssets,registerPaywallAsset:i.registerPaywallAsset,deletePaywallAsset:i.deletePaywallAsset,listPaywallTemplates:i.listPaywallTemplates,getPaywallTemplateAsset:i.getPaywallTemplateAsset,validatePaywall:i.validatePaywall,getPaywall:i.getPaywall,deletePaywall:i.deletePaywall,savePaywallDraft:i.savePaywallDraft,publishPaywall:i.publishPaywall,listPaywallVersions:i.listPaywallVersions,getPaywallVersion:i.getPaywallVersion,listPlacements:i.listPlacements,listAttributeKeys:i.listAttributeKeys,setPlacement:i.setPlacement,deletePlacement:i.deletePlacement,recordPaywallExposure:i.recordPaywallExposure,getPlacementPaywall:i.getPlacementPaywall,previewPlacement:i.previewPlacement,getPlacementResults:i.getPlacementResults,getPlacementRules:i.getPlacementRules,setPlacementRules:i.setPlacementRules,getSettings:i.getSettings,updateSettings:i.updateSettings,getStripeAccount:i.getStripeAccount,disconnectStripe:i.disconnectStripe,checkStripeAccount:i.checkStripeAccount,createCheckout:i.createCheckout,createCheckoutRedemption:i.createCheckoutRedemption,createStripeGrant:i.createStripeGrant,createStripeAppInstall:i.createStripeAppInstall,getOfferStats:i.getOfferStats,listCoupons:i.listCoupons,createCoupon:i.createCoupon,getCoupon:i.getCoupon,revokeCoupon:i.revokeCoupon,listCouponCodes:i.listCouponCodes,setXcodeOfferKey:i.setXcodeOfferKey,searchCustomers:i.searchCustomers,getCustomerHistory:i.getCustomerHistory,listCatalogRevisions:i.listCatalogRevisions,getCatalogRevision:i.getCatalogRevision,restoreCatalogRevision:i.restoreCatalogRevision,extendSubscription:i.extendSubscription,refundSubscription:i.refundSubscription,cancelSubscription:i.cancelSubscription},realtime:{broadcast:h.broadcast,getChannels:h.getChannels,putChannels:h.putChannels,getLimits:h.getLimits,putLimits:h.putLimits,revalidate:h.revalidate,writeState:h.writeState,getStats:h.getStats},secrets:{listSecretAudit:c.listSecretAudit,listFieldKeys:c.listFieldKeys,getFieldKeys:c.getFieldKeys,openFields:c.openFields,sealPlaceholder:c.sealPlaceholder,rotateFieldKeys:c.rotateFieldKeys,listTransitKeys:c.listTransitKeys,getTransitKeys:c.getTransitKeys,getTransitPublicKeys:c.getTransitPublicKeys,rotateTransitKeys:c.rotateTransitKeys,retireTransitKey:c.retireTransitKey,listSecrets:c.listSecrets,getEnvironmentValues:c.getEnvironmentValues,getSecret:c.getSecret,putSecret:c.putSecret,deleteSecret:c.deleteSecret,rollbackSecret:c.rollbackSecret,listSecretVersions:c.listSecretVersions},storage:{listBuckets:u.listBuckets,getBucket:u.getBucket,putBucket:u.putBucket,deleteBucket:u.deleteBucket,copyObject:u.copyObject,moveObject:u.moveObject,listObjects:u.listObjects,getObject:u.getObject,putObject:u.putObject,deleteObject:u.deleteObject,headObject:u.headObject,createSignedUrl:u.createSignedUrl,createUploadUrl:u.createUploadUrl,getStorageStats:u.getStorageStats},stores:{listActions:o.listActions,getAction:o.getAction,confirmAction:o.confirmAction,declineAction:o.declineAction,getAppleAccount:o.getAppleAccount,disconnectApple:o.disconnectApple,checkAppleAccount:o.checkAppleAccount,createAppleGrant:o.createAppleGrant,getSandboxReadiness:o.getSandboxReadiness,listSandboxTesters:o.listSandboxTesters,clearSandboxPurchaseHistory:o.clearSandboxPurchaseHistory,updateSandboxTester:o.updateSandboxTester,listApps:o.listApps,listFeedback:o.listFeedback,getFeedback:o.getFeedback,listGroups:o.listGroups,createGroup:o.createGroup,linkApp:o.linkApp,getListing:o.getListing,setListing:o.setListing,planListing:o.planListing,createPackage:o.createPackage,uploadScreenshot:o.uploadScreenshot,getReviewInfo:o.getReviewInfo,setReviewInfo:o.setReviewInfo,getUploadKey:o.getUploadKey,getAppStoreVersion:o.getAppStoreVersion,prepareAppStoreVersion:o.prepareAppStoreVersion,planPhasedRelease:o.planPhasedRelease,planReleaseVersion:o.planReleaseVersion,planSubmitReview:o.planSubmitReview,planWithdrawReview:o.planWithdrawReview,getAppVitals:o.getAppVitals,getAppWebhook:o.getAppWebhook,makeAppWebhook:o.makeAppWebhook,pingAppWebhook:o.pingAppWebhook,getGoogleAccount:o.getGoogleAccount,connectGoogle:o.connectGoogle,disconnectGoogle:o.disconnectGoogle,checkGoogleAccount:o.checkGoogleAccount,deleteGroup:o.deleteGroup,renameGroup:o.renameGroup,addGroupBuild:o.addGroupBuild,listTesters:o.listTesters,setTesters:o.setTesters,listPackages:o.listPackages,getPackage:o.getPackage,planBetaReview:o.planBetaReview,listDeliveries:o.listDeliveries,deliver:o.deliver,getSignedBundleLink:o.getSignedBundleLink,planExpire:o.planExpire,planExportCompliance:o.planExportCompliance,setWhatToTest:o.setWhatToTest,getAppleSession:o.getAppleSession,disconnectAppleSession:o.disconnectAppleSession,checkAppleSession:o.checkAppleSession,createAppleIdGrant:o.createAppleIdGrant,getAppReview:o.getAppReview,getReviewAttachment:o.getReviewAttachment,setReviewDraft:o.setReviewDraft,sendReviewDraft:o.sendReviewDraft,getAppPrivacy:o.getAppPrivacy,setAppPrivacy:o.setAppPrivacy,makeAppRecord:o.makeAppRecord,removeAppRecord:o.removeAppRecord,listMadeAppleKeys:o.listMadeAppleKeys,makeAppleKey:o.makeAppleKey,revokeMadeAppleKey:o.revokeMadeAppleKey,shareAppleSession:o.shareAppleSession,unshareAppleSession:o.unshareAppleSession}}}function K(t){return{orgs:{async list(e){return t.send({op:"orgs.list",method:"GET",path:"/v1/orgs",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e?.signal})},async create(e){return t.send({op:"orgs.create",method:"POST",path:"/v1/orgs",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async get(e){return t.send({op:"orgs.get",method:"GET",path:"/v1/orgs/"+r("orgs.get","id",e.path.id),auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async takeAway(e){return t.send({op:"orgs.takeAway",method:"DELETE",path:"/v1/orgs/"+r("orgs.takeAway","id",e.path.id),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async rename(e){return t.send({op:"orgs.rename",method:"PATCH",path:"/v1/orgs/"+r("orgs.rename","id",e.path.id),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async members(e){return t.send({op:"orgs.members",method:"GET",path:"/v1/orgs/"+r("orgs.members","id",e.path.id)+"/members",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async auditLog(e){return t.send({op:"orgs.auditLog",method:"GET",path:"/v1/orgs/"+r("orgs.auditLog","id",e.path.id)+"/audit",auth:[["PalbaseBearer"]],answers:{200:"json"},query:e.query,signal:e.signal})}},invitations:{async mine(e){return t.send({op:"invitations.mine",method:"GET",path:"/v1/invitations",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e?.signal})},async accept(e){return t.send({op:"invitations.accept",method:"POST",path:"/v1/invitations/"+r("invitations.accept","id",e.path.id)+"/accept",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})}},orgWebhooks:{async list(e){return t.send({op:"orgWebhooks.list",method:"GET",path:"/v1/orgs/"+r("orgWebhooks.list","id",e.path.id)+"/webhooks",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async add(e){return t.send({op:"orgWebhooks.add",method:"POST",path:"/v1/orgs/"+r("orgWebhooks.add","id",e.path.id)+"/webhooks",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async remove(e){return t.send({op:"orgWebhooks.remove",method:"DELETE",path:"/v1/orgs/"+r("orgWebhooks.remove","id",e.path.id)+"/webhooks/"+r("orgWebhooks.remove","endpoint",e.path.endpoint),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})}},projects:{async mine(e){return t.send({op:"projects.mine",method:"GET",path:"/v1/projects",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e?.signal})},async environmentsMine(e){return t.send({op:"projects.environmentsMine",method:"GET",path:"/v1/environments",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e?.signal})},async list(e){return t.send({op:"projects.list",method:"GET",path:"/v1/orgs/"+r("projects.list","id",e.path.id)+"/projects",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async create(e){return t.send({op:"projects.create",method:"POST",path:"/v1/orgs/"+r("projects.create","id",e.path.id)+"/projects",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async get(e){return t.send({op:"projects.get",method:"GET",path:"/v1/projects/"+r("projects.get","id",e.path.id),auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async remove(e){return t.send({op:"projects.remove",method:"DELETE",path:"/v1/projects/"+r("projects.remove","id",e.path.id),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async rename(e){return t.send({op:"projects.rename",method:"PATCH",path:"/v1/projects/"+r("projects.rename","id",e.path.id),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async addEnvironment(e){return t.send({op:"projects.addEnvironment",method:"POST",path:"/v1/projects/"+r("projects.addEnvironment","id",e.path.id)+"/environments",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async environment(e){return t.send({op:"projects.environment",method:"GET",path:"/v1/environments/"+r("projects.environment","ref",e.path.ref),auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async removeEnvironment(e){return t.send({op:"projects.removeEnvironment",method:"DELETE",path:"/v1/environments/"+r("projects.removeEnvironment","ref",e.path.ref),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,query:e.query,headers:e.headers,signal:e.signal})},async renameEnvironment(e){return t.send({op:"projects.renameEnvironment",method:"PATCH",path:"/v1/environments/"+r("projects.renameEnvironment","ref",e.path.ref),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async keys(e){return t.send({op:"projects.keys",method:"GET",path:"/v1/environments/"+r("projects.keys","ref",e.path.ref)+"/keys",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async usage(e){return t.send({op:"projects.usage",method:"GET",path:"/v1/environments/"+r("projects.usage","ref",e.path.ref)+"/usage",auth:[["PalbaseBearer"]],answers:{200:"json"},query:e.query,signal:e.signal})},async personalKey(e){return t.send({op:"projects.personalKey",method:"POST",path:"/v1/environments/"+r("projects.personalKey","ref",e.path.ref)+"/personal-key",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async revokePersonalKey(e){return t.send({op:"projects.revokePersonalKey",method:"DELETE",path:"/v1/environments/"+r("projects.revokePersonalKey","ref",e.path.ref)+"/personal-key/"+r("projects.revokePersonalKey","key",e.path.key),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async shareInstallation(e){return t.send({op:"projects.shareInstallation",method:"POST",path:"/v1/environments/"+r("projects.shareInstallation","ref",e.path.ref)+"/github/installations",auth:[["PalbaseBearer"]],answers:{},ownResponse:!0,idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})}},apps:{async list(e){return t.send({op:"apps.list",method:"GET",path:"/v1/projects/"+r("apps.list","id",e.path.id)+"/apps",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async create(e){return t.send({op:"apps.create",method:"POST",path:"/v1/projects/"+r("apps.create","id",e.path.id)+"/apps",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async get(e){return t.send({op:"apps.get",method:"GET",path:"/v1/projects/"+r("apps.get","id",e.path.id)+"/apps/"+r("apps.get","app",e.path.app),auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async remove(e){return t.send({op:"apps.remove",method:"DELETE",path:"/v1/projects/"+r("apps.remove","id",e.path.id)+"/apps/"+r("apps.remove","app",e.path.app),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async update(e){return t.send({op:"apps.update",method:"PATCH",path:"/v1/projects/"+r("apps.update","id",e.path.id)+"/apps/"+r("apps.update","app",e.path.app),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async restore(e){return t.send({op:"apps.restore",method:"POST",path:"/v1/projects/"+r("apps.restore","id",e.path.id)+"/apps/"+r("apps.restore","app",e.path.app)+"/restore",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async setIn(e){return t.send({op:"apps.setIn",method:"PUT",path:"/v1/environments/"+r("apps.setIn","ref",e.path.ref)+"/apps/"+r("apps.setIn","app",e.path.app),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async removeFrom(e){return t.send({op:"apps.removeFrom",method:"DELETE",path:"/v1/environments/"+r("apps.removeFrom","ref",e.path.ref)+"/apps/"+r("apps.removeFrom","app",e.path.app),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async config(e){return t.send({op:"apps.config",method:"GET",path:"/v1/environments/"+r("apps.config","ref",e.path.ref)+"/apps/"+r("apps.config","app",e.path.app)+"/config",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})}},snippets:{async list(e){return t.send({op:"snippets.list",method:"GET",path:"/v1/environments/"+r("snippets.list","ref",e.path.ref)+"/snippets",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async create(e){return t.send({op:"snippets.create",method:"POST",path:"/v1/environments/"+r("snippets.create","ref",e.path.ref)+"/snippets",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async remove(e){return t.send({op:"snippets.remove",method:"DELETE",path:"/v1/environments/"+r("snippets.remove","ref",e.path.ref)+"/snippets/"+r("snippets.remove","id",e.path.id),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async change(e){return t.send({op:"snippets.change",method:"PATCH",path:"/v1/environments/"+r("snippets.change","ref",e.path.ref)+"/snippets/"+r("snippets.change","id",e.path.id),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})}},chartViews:{async list(e){return t.send({op:"chartViews.list",method:"GET",path:"/v1/environments/"+r("chartViews.list","ref",e.path.ref)+"/chart-views",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async create(e){return t.send({op:"chartViews.create",method:"POST",path:"/v1/environments/"+r("chartViews.create","ref",e.path.ref)+"/chart-views",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async remove(e){return t.send({op:"chartViews.remove",method:"DELETE",path:"/v1/environments/"+r("chartViews.remove","ref",e.path.ref)+"/chart-views/"+r("chartViews.remove","id",e.path.id),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async change(e){return t.send({op:"chartViews.change",method:"PATCH",path:"/v1/environments/"+r("chartViews.change","ref",e.path.ref)+"/chart-views/"+r("chartViews.change","id",e.path.id),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})}},webhooks:{async list(e){return t.send({op:"webhooks.list",method:"GET",path:"/v1/environments/"+r("webhooks.list","ref",e.path.ref)+"/webhooks",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async add(e){return t.send({op:"webhooks.add",method:"POST",path:"/v1/environments/"+r("webhooks.add","ref",e.path.ref)+"/webhooks",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async deliveries(e){return t.send({op:"webhooks.deliveries",method:"GET",path:"/v1/environments/"+r("webhooks.deliveries","ref",e.path.ref)+"/webhooks/deliveries",auth:[["PalbaseBearer"]],answers:{200:"json"},query:e.query,signal:e.signal})},async redeliver(e){return t.send({op:"webhooks.redeliver",method:"POST",path:"/v1/environments/"+r("webhooks.redeliver","ref",e.path.ref)+"/webhooks/deliveries/"+r("webhooks.redeliver","delivery",e.path.delivery)+"/redeliver",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async change(e){return t.send({op:"webhooks.change",method:"PUT",path:"/v1/environments/"+r("webhooks.change","ref",e.path.ref)+"/webhooks/"+r("webhooks.change","endpoint",e.path.endpoint),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async remove(e){return t.send({op:"webhooks.remove",method:"DELETE",path:"/v1/environments/"+r("webhooks.remove","ref",e.path.ref)+"/webhooks/"+r("webhooks.remove","endpoint",e.path.endpoint),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})}},environmentTokens:{async list(e){return t.send({op:"environmentTokens.list",method:"GET",path:"/v1/environments/"+r("environmentTokens.list","ref",e.path.ref)+"/tokens",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async mint(e){return t.send({op:"environmentTokens.mint",method:"POST",path:"/v1/environments/"+r("environmentTokens.mint","ref",e.path.ref)+"/tokens",auth:[["PalbaseBearer"],[]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async revoke(e){return t.send({op:"environmentTokens.revoke",method:"DELETE",path:"/v1/environments/"+r("environmentTokens.revoke","ref",e.path.ref)+"/tokens/"+r("environmentTokens.revoke","id",e.path.id),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})}},billing:{async bill(e){return t.send({op:"billing.bill",method:"GET",path:"/v1/orgs/"+r("billing.bill","id",e.path.id)+"/billing",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async confirm(e){return t.send({op:"billing.confirm",method:"POST",path:"/v1/orgs/"+r("billing.confirm","id",e.path.id)+"/billing/checkout/"+r("billing.confirm","session",e.path.session)+"/confirm",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async cards(e){return t.send({op:"billing.cards",method:"GET",path:"/v1/orgs/"+r("billing.cards","id",e.path.id)+"/billing/cards",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async defaultCard(e){return t.send({op:"billing.defaultCard",method:"PUT",path:"/v1/orgs/"+r("billing.defaultCard","id",e.path.id)+"/billing/cards/"+r("billing.defaultCard","card",e.path.card)+"/default",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async removeCard(e){return t.send({op:"billing.removeCard",method:"DELETE",path:"/v1/orgs/"+r("billing.removeCard","id",e.path.id)+"/billing/cards/"+r("billing.removeCard","card",e.path.card),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async customer(e){return t.send({op:"billing.customer",method:"GET",path:"/v1/orgs/"+r("billing.customer","id",e.path.id)+"/billing/customer",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async setCustomer(e){return t.send({op:"billing.setCustomer",method:"PUT",path:"/v1/orgs/"+r("billing.setCustomer","id",e.path.id)+"/billing/customer",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async charges(e){return t.send({op:"billing.charges",method:"GET",path:"/v1/orgs/"+r("billing.charges","id",e.path.id)+"/billing/charges",auth:[["PalbaseBearer"]],answers:{200:"json"},query:e.query,signal:e.signal})},async csv(e){return t.send({op:"billing.csv",method:"GET",path:"/v1/orgs/"+r("billing.csv","id",e.path.id)+"/billing/charges.csv",auth:[["PalbaseBearer"]],answers:{},ownResponse:!0,query:e.query,signal:e.signal})},async invoices(e){return t.send({op:"billing.invoices",method:"GET",path:"/v1/orgs/"+r("billing.invoices","id",e.path.id)+"/billing/invoices",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async payer(e){return t.send({op:"billing.payer",method:"PUT",path:"/v1/orgs/"+r("billing.payer","id",e.path.id)+"/billing/payer",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async paid(e){return t.send({op:"billing.paid",method:"GET",path:"/v1/orgs/"+r("billing.paid","id",e.path.id)+"/billing/paid",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async stopPaying(e){return t.send({op:"billing.stopPaying",method:"DELETE",path:"/v1/orgs/"+r("billing.stopPaying","id",e.path.id)+"/billing/paid/"+r("billing.stopPaying","org",e.path.org),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async report(e){return t.send({op:"billing.report",method:"GET",path:"/v1/orgs/"+r("billing.report","id",e.path.id)+"/billing/report",auth:[["PalbaseBearer"]],answers:{200:"json"},query:e.query,signal:e.signal})},async reportCsv(e){return t.send({op:"billing.reportCsv",method:"GET",path:"/v1/orgs/"+r("billing.reportCsv","id",e.path.id)+"/billing/report.csv",auth:[["PalbaseBearer"]],answers:{},ownResponse:!0,query:e.query,signal:e.signal})},async project(e){return t.send({op:"billing.project",method:"GET",path:"/v1/orgs/"+r("billing.project","id",e.path.id)+"/billing/projects/"+r("billing.project","project",e.path.project),auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async steer(e){return t.send({op:"billing.steer",method:"PATCH",path:"/v1/orgs/"+r("billing.steer","id",e.path.id)+"/billing/projects/"+r("billing.steer","project",e.path.project),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async freeze(e){return t.send({op:"billing.freeze",method:"PATCH",path:"/v1/orgs/"+r("billing.freeze","id",e.path.id)+"/billing/environments/"+r("billing.freeze","ref",e.path.ref),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})}},accessRequests:{async request(e){return t.send({op:"accessRequests.request",method:"POST",path:"/v1/access-requests",auth:[["PalbaseBearer"],[]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})}},docs:{async search(e){return t.send({op:"docs.search",method:"GET",path:"/v1/docs/search",auth:[["PalbaseBearer"],[]],answers:{200:"json"},query:e.query,signal:e.signal})}}}}function V(t){let{mint:e,revoke:a}=t;return async n=>{let p=await e(n),g=n.body?.role,m=n.body?.on_behalf_of;if(g===void 0&&m===void 0)return p;let s=p.data,d=[];if(g!==void 0&&s.role!==g&&d.push(`role ${g} (it came back ${s.role==null?"at its minter's":s.role})`),m!==void 0&&s.on_behalf_of!==m.trim()&&d.push("on_behalf_of"),d.length===0)return p;let l;try{await a({path:{ref:n.path.ref,id:String(s.id)}})}catch(h){l=h}let i=`Studio minted the token without the ${d.join(" and ")} asked for \u2014 it is older than this SDK`;throw new y({op:"environmentTokens.mint",status:0,code:"token_role_not_kept",message:l===void 0?`environmentTokens.mint: ${i}; the token (${s.id}) was revoked at once and is not returned \u2014 mint it again once Studio is updated`:`environmentTokens.mint: ${i}, and revoking it failed (${l instanceof Error?l.message:String(l)}) \u2014 revoke token ${s.id} of environment ${n.path.ref} yourself, now`,cause:l})}}var _={pbo_:"an organization's",pbu_:"an account's",pbe_:"an environment's"},J=/^[A-Za-z0-9_-]*$/,O=64,b=44;function z(t){if(typeof t!="string"||t==="")return"token is missing: pass an access token, an organization's (pbo_\u2026), an account's (pbu_\u2026) or an environment's (pbe_\u2026)";let e=t.slice(0,4);if(!Object.hasOwn(_,e))return`token has the wrong prefix: an access token starts with pbo_ (an organization's), pbu_ (an account's) or pbe_ (an environment's)${/^pb_[a-z0-9]+_[cs]/.test(t)?" \u2014 a project key belongs in palbase/server or palbase/web":""}`;let a=t.slice(4);if(a.length!==O)return`token has the wrong length: ${_[e]} access token is ${e} and ${O} characters, this one has ${a.length} after it`;if(!J.test(a))return`token is not ${_[e]} access token: after ${e} come base64url characters alone (A\u2013Z, a\u2013z, 0\u20139, - and _)`;let n=X(a),p=(n[b]<<24|n[b+1]<<16|n[b+2]<<8|n[b+3])>>>0;if(Y(e,n.subarray(0,b))!==p)return"token's checksum does not match: it was mistyped or cut, or made before access tokens carried one \u2014 make a new token"}function N(t){return z(t)===void 0}function H(t){let e=z(t);if(e!==void 0)throw new TypeError(e)}var $="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function X(t){let e=new Uint8Array(t.length*6/8),a=0,n=0,p=0;for(let g of t)a=a<<6|$.indexOf(g),n+=6,n>=8&&(n-=8,e[p++]=a>>n&255);return e}var W=(()=>{let t=new Uint32Array(256);for(let e=0;e<256;e++){let a=e;for(let n=0;n<8;n++)a=a&1?3988292384^a>>>1:a>>>1;t[e]=a>>>0}return t})();function Y(t,e){let a=4294967295;for(let n=0;n<t.length;n++)a=W[(a^t.charCodeAt(n))&255]^a>>>8;for(let n of e)a=W[(a^n)&255]^a>>>8;return(a^4294967295)>>>0}var q="palbase.studio",Z="palbase";function Q(){let t=globalThis;return typeof t.window<"u"||typeof t.document<"u"||typeof t.importScripts=="function"||G()}var v=class{domain;#e;#t=new Map;constructor(e){if(Q())throw new TypeError("palbase/cloud runs on a server: its access token opens the organization's projects, so it never goes into a browser, a web worker or a mobile app \u2014 keep it on your server, and have your app call that");H(e?.token);let a=e.domain??q;if(typeof a!="string"||!/^[a-z0-9-]+(\.[a-z0-9-]+)+$/.test(a))throw new TypeError(`domain ${JSON.stringify(a)} is not a domain`);this.domain=a;let n=e.token;this.#e=g=>B(f({baseUrl:g,credentials:{token:n},fetch:e.fetch,solveProofOfWork:!1}),e.retry??I);let p=K(this.#e(`https://palbase.app.${a}`));p.environmentTokens.mint=V(p.environmentTokens),Object.assign(this,p)}project(e){if(typeof e!="string"||!/^[a-z0-9]{1,63}$/.test(e))throw new TypeError(`${JSON.stringify(e)} is not an environment's ref`);let a=this.#t.get(e);return a||(a=L(this.#e(e===Z?`https://connect.${this.domain}`:`https://${e}.${this.domain}`)),this.#t.set(e,a)),a}};export{q as DEFAULT_DOMAIN,v as PalbaseCloud,y as PalbaseError,N as tokenIsWellFormed};
1
+ /*! palbase 0.52.3 — Palbase SDK License (see LICENSE) */
2
+ import{a as G}from"../chunks/XHTOI77Q.js";import{a as P,b as k,c as S,e as w,f as C,g as A,h as T,i as R,j,k as E,l as x,m as D,n as M,o as U}from"../chunks/IAEVNAIO.js";import{a as I,b as B}from"../chunks/CLFVU67I.js";import{b as y,c as r,d as f}from"../chunks/UH5Q63EN.js";import"../chunks/2PCDSIWJ.js";import"../chunks/P2IYCDCP.js";function L(t){let e=P.client(t),a=k.client(t),n=S.client(t),p=w.client(t),g=C.client(t),m=A.client(t),s=T.client(t),d=R.client(t),l=j.client(t),i=E.client(t),h=x.client(t),c=D.client(t),u=M.client(t),o=U.client(t);return{ai:{draftAgent:e.draftAgent,listAgents:e.listAgents,getAgent:e.getAgent,putAgent:e.putAgent,deleteAgent:e.deleteAgent,publishAgent:e.publishAgent,rollbackAgent:e.rollbackAgent,listAgentVersions:e.listAgentVersions,listChats:e.listChats,createChat:e.createChat,getChat:e.getChat,deleteChat:e.deleteChat,decideChatApproval:e.decideChatApproval,forkChat:e.forkChat,getChatGoal:e.getChatGoal,setChatGoal:e.setChatGoal,clearChatGoal:e.clearChatGoal,updateChatGoal:e.updateChatGoal,putChatMember:e.putChatMember,deleteChatMember:e.deleteChatMember,listChatMessages:e.listChatMessages,sendChatMessage:e.sendChatMessage,getChatMessageAttachment:e.getChatMessageAttachment,listChatParts:e.listChatParts,putChatPipe:e.putChatPipe,deleteChatPipe:e.deleteChatPipe,sendSubagentMessage:e.sendSubagentMessage,stopSubagent:e.stopSubagent,stopChat:e.stopChat,listTurnToolCalls:e.listTurnToolCalls,getChatToolCall:e.getChatToolCall,answerChatToolCall:e.answerChatToolCall,listChatTurnArtifacts:e.listChatTurnArtifacts,getChatTurnArtifact:e.getChatTurnArtifact,getChatTurnCost:e.getChatTurnCost,startChatVoice:e.startChatVoice,getChatVoice:e.getChatVoice,closeChatVoice:e.closeChatVoice,commandChatVoice:e.commandChatVoice,getChatWorkspaceFile:e.getChatWorkspaceFile,putChatWorkspaceFile:e.putChatWorkspaceFile,deleteChatWorkspaceFile:e.deleteChatWorkspaceFile,addChatWorkspaceRepo:e.addChatWorkspaceRepo,listChatWorkspaceTokens:e.listChatWorkspaceTokens,createChatWorkspaceToken:e.createChatWorkspaceToken,revokeChatWorkspaceToken:e.revokeChatWorkspaceToken,createEmbeddings:e.createEmbeddings,listEndpoints:e.listEndpoints,putEndpoint:e.putEndpoint,deleteEndpoint:e.deleteEndpoint,listEnv:e.listEnv,putEnv:e.putEnv,deleteEnv:e.deleteEnv,createImage:e.createImage,getImage:e.getImage,getImageFile:e.getImageFile,deleteMachine:e.deleteMachine,cordonMachine:e.cordonMachine,resumeMachine:e.resumeMachine,listModels:e.listModels,revokePoolKey:e.revokePoolKey,listPools:e.listPools,createPool:e.createPool,deletePool:e.deletePool,listPoolKeys:e.listPoolKeys,createPoolKey:e.createPoolKey,getPoolState:e.getPoolState,listProviders:e.listProviders,connectProvider:e.connectProvider,disconnectProvider:e.disconnectProvider,listRepos:e.listRepos,putRepo:e.putRepo,deleteRepo:e.deleteRepo,createResponse:e.createResponse,getResponse:e.getResponse,cancelResponse:e.cancelResponse,followResponse:e.followResponse,getSettings:e.getSettings,putSettings:e.putSettings,getSpend:e.getSpend,askSupport:e.askSupport,listTools:e.listTools,listUsage:e.listUsage},analytics:{listAudiences:a.listAudiences,createAudience:a.createAudience,previewAudience:a.previewAudience,getAudience:a.getAudience,deleteAudience:a.deleteAudience,updateAudience:a.updateAudience,listAudienceMembers:a.listAudienceMembers,alias:a.alias,batch:a.batch,getEventBreakdown:a.getEventBreakdown,capture:a.capture,sendConsoleHistory:a.sendConsoleHistory,getConsoleConfig:a.getConsoleConfig,listConsoleRecords:a.listConsoleRecords,listEventNames:a.listEventNames,listEvents:a.listEvents,getEventTimeline:a.getEventTimeline,runFunnel:a.runFunnel,identify:a.identify,page:a.page,sendPerf:a.sendPerf,listPerfGroups:a.listPerfGroups,getPerfConfig:a.getPerfConfig,getPerfTimeline:a.getPerfTimeline,listRequestLines:a.listRequestLines,getMachineTraffic:a.getMachineTraffic,runRetention:a.runRetention,screen:a.screen,getSettings:a.getSettings,putSettings:a.putSettings,getSummary:a.getSummary,listTraces:a.listTraces,sendTrace:a.sendTrace,sendTraceBatch:a.sendTraceBatch,getTraceHops:a.getTraceHops,listSessionTraces:a.listSessionTraces,getTraceSummary:a.getTraceSummary,getTraceTimeline:a.getTraceTimeline,searchPeople:a.searchPeople,setPersonProperties:a.setPersonProperties,getPerson:a.getPerson,listPersonEvents:a.listPersonEvents,getEventCatalog:a.getEventCatalog,defineEvent:a.defineEvent},auth:{adminVerifyDeviceAssertion:n.adminVerifyDeviceAssertion,adminGetAttestPolicy:n.adminGetAttestPolicy,adminGetAttestObservations:n.adminGetAttestObservations,adminRecordAttestObservations:n.adminRecordAttestObservations,adminListAuditEvents:n.adminListAuditEvents,adminExportAuditEvents:n.adminExportAuditEvents,adminVerifyAuditTrail:n.adminVerifyAuditTrail,adminGetAuthSettings:n.adminGetAuthSettings,adminUpdateAuthSettings:n.adminUpdateAuthSettings,adminGetBreachWatch:n.adminGetBreachWatch,adminListHooks:n.adminListHooks,adminCreateHook:n.adminCreateHook,adminUpdateHook:n.adminUpdateHook,adminDeleteHook:n.adminDeleteHook,adminListHookExecutions:n.adminListHookExecutions,adminListIntegrations:n.adminListIntegrations,adminPutIntegration:n.adminPutIntegration,adminDeleteIntegration:n.adminDeleteIntegration,adminListOAuthClients:n.adminListOAuthClients,adminCreateOAuthClient:n.adminCreateOAuthClient,adminGetOAuthClient:n.adminGetOAuthClient,adminDeleteOAuthClient:n.adminDeleteOAuthClient,adminUpdateOAuthClient:n.adminUpdateOAuthClient,adminListProviders:n.adminListProviders,adminGetPhoneSettings:n.adminGetPhoneSettings,adminUpdatePhoneSettings:n.adminUpdatePhoneSettings,adminToggleProvider:n.adminToggleProvider,adminListRoles:n.adminListRoles,adminUpsertRole:n.adminUpsertRole,adminDeleteRole:n.adminDeleteRole,adminListServiceAccounts:n.adminListServiceAccounts,adminCreateServiceAccount:n.adminCreateServiceAccount,adminGetServiceAccount:n.adminGetServiceAccount,adminRevokeServiceAccount:n.adminRevokeServiceAccount,adminRotateServiceAccount:n.adminRotateServiceAccount,adminListSessions:n.adminListSessions,adminRevokeSession:n.adminRevokeSession,adminListSigningKeys:n.adminListSigningKeys,adminRotateSigningKey:n.adminRotateSigningKey,socialAdminConfig:n.socialAdminConfig,socialCredentialPut:n.socialCredentialPut,socialCredentialDelete:n.socialCredentialDelete,socialProviderPatch:n.socialProviderPatch,adminGetStats:n.adminGetStats,adminSendTestTemplate:n.adminSendTestTemplate,adminListTestUsers:n.adminListTestUsers,adminCreateTestUsers:n.adminCreateTestUsers,adminSetTestUserPhone:n.adminSetTestUserPhone,adminCreateTestSignupAddress:n.adminCreateTestSignupAddress,adminDeleteTestUser:n.adminDeleteTestUser,adminCreateCustomToken:n.adminCreateCustomToken,adminListUsers:n.adminListUsers,adminCreateUser:n.adminCreateUser,adminImportUsers:n.adminImportUsers,adminGetUser:n.adminGetUser,adminDeleteUser:n.adminDeleteUser,adminUpdateUser:n.adminUpdateUser,adminBanUser:n.adminBanUser,adminGetUserConsents:n.adminGetUserConsents,adminRevokeUserCredentials:n.adminRevokeUserCredentials,adminExportUser:n.adminExportUser,adminListUserMfaFactors:n.adminListUserMfaFactors,adminResetUserMfa:n.adminResetUserMfa,adminResetUserPassword:n.adminResetUserPassword,adminListUserRoles:n.adminListUserRoles,adminAssignUserRole:n.adminAssignUserRole,adminRevokeUserRole:n.adminRevokeUserRole,adminRevokeUserSessions:n.adminRevokeUserSessions,adminUnbanUser:n.adminUnbanUser,adminGetInstallationConsents:n.adminGetInstallationConsents,adminRefuseConsents:n.adminRefuseConsents,adminInviteUser:n.adminInviteUser},calls:{adminListCalls:p.adminListCalls,adminGetCall:p.adminGetCall,adminEndCall:p.adminEndCall,createCallTicket:p.createCallTicket,getCallSettings:p.getCallSettings,putCallSettings:p.putCallSettings,rotateCallHookSecret:p.rotateCallHookSecret},flags:{getValues:g.getValues,batchUserValues:g.batchUserValues,getDelta:g.getDelta,getEvaluations:g.getEvaluations,listExperiments:g.listExperiments,startExperiment:g.startExperiment,getExperiment:g.getExperiment,getExperimentResults:g.getExperimentResults,stopExperiment:g.stopExperiment,declareExperimentWinner:g.declareExperimentWinner,getCurrentInstallations:g.getCurrentInstallations,getInstallationsDaily:g.getInstallationsDaily,getSnapshot:g.getSnapshot,listDefinitions:g.listDefinitions,getDefinition:g.getDefinition,putDefinition:g.putDefinition,deleteDefinition:g.deleteDefinition,activateTemplates:g.activateTemplates,getActiveTemplate:g.getActiveTemplate,getTemplateCapabilities:g.getTemplateCapabilities,getTemplateDraft:g.getTemplateDraft,createTemplateDraft:g.createTemplateDraft,discardTemplateDraft:g.discardTemplateDraft,putTemplateParameter:g.putTemplateParameter,removeTemplateParameter:g.removeTemplateParameter,reviewTemplateDraft:g.reviewTemplateDraft,publishTemplate:g.publishTemplate,getPublishReceipt:g.getPublishReceipt,restoreTemplateVersion:g.restoreTemplateVersion,listTemplateVersions:g.listTemplateVersions,getTemplateVersion:g.getTemplateVersion,getUserValues:g.getUserValues,putUserValues:g.putUserValues,deleteUserValues:g.deleteUserValues,putUserValue:g.putUserValue,deleteUserValue:g.deleteUserValue},journeys:{listJourneys:m.listJourneys,createJourney:m.createJourney,listPersonRuns:m.listPersonRuns,simulateJourney:m.simulateJourney,validateJourney:m.validateJourney,getJourney:m.getJourney,updateJourney:m.updateJourney,deleteJourney:m.deleteJourney,copyJourney:m.copyJourney,publishJourney:m.publishJourney,listJourneyRuns:m.listJourneyRuns,getJourneyStats:m.getJourneyStats,stopJourney:m.stopJourney,testJourney:m.testJourney},machines:{listMachines:s.listMachines,createMachine:s.createMachine,listMachineSizes:s.listMachineSizes,getMachineNetwork:s.getMachineNetwork,connectGitHub:s.connectGitHub,listInstallations:s.listInstallations,linkInstallation:s.linkInstallation,shareInstallation:s.shareInstallation,unlinkInstallation:s.unlinkInstallation,listRepositories:s.listRepositories,getMachine:s.getMachine,deleteMachine:s.deleteMachine,updateMachine:s.updateMachine,listBuilds:s.listBuilds,deployMachine:s.deployMachine,listMachinePreviews:s.listMachinePreviews,putMachinePreview:s.putMachinePreview,deleteMachinePreview:s.deleteMachinePreview,listMachineDomains:s.listMachineDomains,addMachineDomain:s.addMachineDomain,deleteMachineDomain:s.deleteMachineDomain,updateMachineDomain:s.updateMachineDomain,getBuild:s.getBuild,getBuildLog:s.getBuildLog,rollbackMachine:s.rollbackMachine,listDatabases:s.listDatabases,createDatabase:s.createDatabase,listDatabaseSizes:s.listDatabaseSizes,getDatabase:s.getDatabase,deleteDatabase:s.deleteDatabase,updateDatabase:s.updateDatabase,undeleteDatabase:s.undeleteDatabase,purgeDatabase:s.purgeDatabase,getDatabaseCredentials:s.getDatabaseCredentials,changeDatabasePassword:s.changeDatabasePassword,readMachineLogs:s.readMachineLogs,execInMachine:s.execInMachine,listMachineExecs:s.listMachineExecs,getMachineMetrics:s.getMachineMetrics,getMachineContract:s.getMachineContract,restoreDatabase:s.restoreDatabase,getDatabaseSchema:s.getDatabaseSchema,getDatabaseMetrics:s.getDatabaseMetrics,queryDatabase:s.queryDatabase,listCrons:s.listCrons,listCronRuns:s.listCronRuns,runCron:s.runCron,pauseCron:s.pauseCron,resumeCron:s.resumeCron,listTasks:s.listTasks,enqueueTask:s.enqueueTask,getTask:s.getTask,cancelTask:s.cancelTask,retryTask:s.retryTask,listTaskTypes:s.listTaskTypes,makeTemplatedTestUsers:s.makeTemplatedTestUsers,templateTestUser:s.templateTestUser,deleteTemplatedTestUser:s.deleteTemplatedTestUser,listSites:s.listSites,createSite:s.createSite,getSite:s.getSite,deleteSite:s.deleteSite,updateSite:s.updateSite,listSiteReleases:s.listSiteReleases,createSiteRelease:s.createSiteRelease,uploadSiteFile:s.uploadSiteFile,finishSiteRelease:s.finishSiteRelease,rollbackSite:s.rollbackSite,listSiteBuilds:s.listSiteBuilds,deploySite:s.deploySite,listSitePreviews:s.listSitePreviews,listSiteDomains:s.listSiteDomains,addSiteDomain:s.addSiteDomain,deleteSiteDomain:s.deleteSiteDomain,updateSiteDomain:s.updateSiteDomain,getSiteBuild:s.getSiteBuild,authorizeSitePreview:s.authorizeSitePreview,authorizeMachinePreview:s.authorizeMachinePreview,openMachinePreview:s.openMachinePreview,moveMachine:s.moveMachine,moveSite:s.moveSite,moveDatabase:s.moveDatabase,cancelSiteBuild:s.cancelSiteBuild,cancelBuild:s.cancelBuild,listSiteHooks:s.listSiteHooks,createSiteHook:s.createSiteHook,deleteSiteHook:s.deleteSiteHook,listMachineHooks:s.listMachineHooks,createMachineHook:s.createMachineHook,deleteMachineHook:s.deleteMachineHook,detectProject:s.detectProject,createPreviewPass:s.createPreviewPass,listPreviewLinks:s.listPreviewLinks,createPreviewLink:s.createPreviewLink,deletePreviewLink:s.deletePreviewLink,listEnvironmentDomains:s.listEnvironmentDomains,addEnvironmentDomain:s.addEnvironmentDomain,deleteEnvironmentDomain:s.deleteEnvironmentDomain,setEnvironmentSignInDomain:s.setEnvironmentSignInDomain},messaging:{adminAccessLog:d.adminAccessLog,adminListConversations:d.adminListConversations,adminCreateConversation:d.adminCreateConversation,adminGetConversation:d.adminGetConversation,adminDeleteConversation:d.adminDeleteConversation,adminUpdateConversation:d.adminUpdateConversation,adminAddMembers:d.adminAddMembers,adminRemoveMember:d.adminRemoveMember,adminListMessages:d.adminListMessages,adminSendMessage:d.adminSendMessage,adminDeleteMessage:d.adminDeleteMessage,adminFileUrl:d.adminFileUrl,adminPutProfile:d.adminPutProfile,adminListReports:d.adminListReports,adminGetReport:d.adminGetReport,adminReportFileUrl:d.adminReportFileUrl,adminResolveReport:d.adminResolveReport,getSettings:d.getSettings,putSettings:d.putSettings,rotateHookSecret:d.rotateHookSecret},notify:{getDeliverability:l.getDeliverability,listDevices:l.listDevices,getDeviceStats:l.getDeviceStats,deleteMyDevice:l.deleteMyDevice,sendEmail:l.sendEmail,listInAppCampaigns:l.listInAppCampaigns,createInAppCampaign:l.createInAppCampaign,getInAppCampaign:l.getInAppCampaign,putInAppCampaign:l.putInAppCampaign,deleteInAppCampaign:l.deleteInAppCampaign,getInAppCampaignStats:l.getInAppCampaignStats,listInAppTemplates:l.listInAppTemplates,sendInbox:l.sendInbox,listInboxMessages:l.listInboxMessages,listNotifyMessages:l.listNotifyMessages,getNotifyMessage:l.getNotifyMessage,cancelMessage:l.cancelMessage,getMetricsSummary:l.getMetricsSummary,listNotifyProviders:l.listNotifyProviders,putNotifyProvider:l.putNotifyProvider,deleteNotifyProvider:l.deleteNotifyProvider,sendPush:l.sendPush,getNotifySettings:l.getNotifySettings,putNotifySettings:l.putNotifySettings,sendSms:l.sendSms,listEmailTemplates:l.listEmailTemplates,getEmailTemplate:l.getEmailTemplate,putEmailTemplate:l.putEmailTemplate,deleteEmailTemplate:l.deleteEmailTemplate,listPushTemplates:l.listPushTemplates,getPushTemplate:l.getPushTemplate,putPushTemplate:l.putPushTemplate,deletePushTemplate:l.deletePushTemplate,listSmsTemplates:l.listSmsTemplates,getSmsTemplate:l.getSmsTemplate,putSmsTemplate:l.putSmsTemplate,deleteSmsTemplate:l.deleteSmsTemplate,listWhatsAppTemplates:l.listWhatsAppTemplates,getWhatsAppTemplate:l.getWhatsAppTemplate,putWhatsAppTemplate:l.putWhatsAppTemplate,deleteWhatsAppTemplate:l.deleteWhatsAppTemplate,listTestUserMessages:l.listTestUserMessages,listTopics:l.listTopics,createTopic:l.createTopic,deleteTopic:l.deleteTopic,changeTopic:l.changeTopic,addTopicSubscribers:l.addTopicSubscribers,removeTopicSubscriber:l.removeTopicSubscriber,listUserDevices:l.listUserDevices,getUserPreferences:l.getUserPreferences,setUserPreferences:l.setUserPreferences,startVerification:l.startVerification,checkVerification:l.checkVerification,getWebPushStatus:l.getWebPushStatus,sendWhatsApp:l.sendWhatsApp,listWhatsAppInbound:l.listWhatsAppInbound},purchases:{getAppleAccount:i.getAppleAccount,disconnectApple:i.disconnectApple,createAppleGrant:i.createAppleGrant,getAppleReadiness:i.getAppleReadiness,setXcodeCertificate:i.setXcodeCertificate,clearXcodeCertificate:i.clearXcodeCertificate,getGoogleAccount:i.getGoogleAccount,connectGoogle:i.connectGoogle,disconnectGoogle:i.disconnectGoogle,getCatalog:i.getCatalog,saveCatalog:i.saveCatalog,planCatalog:i.planCatalog,getCatalogPlan:i.getCatalogPlan,confirmCatalogPlan:i.confirmCatalogPlan,declineCatalogPlan:i.declineCatalogPlan,validateCatalog:i.validateCatalog,listCharts:i.listCharts,getChartsOverview:i.getChartsOverview,getChart:i.getChart,getCustomer:i.getCustomer,grantCredits:i.grantCredits,listCreditEntries:i.listCreditEntries,forgiveCredits:i.forgiveCredits,listCustomerGrants:i.listCustomerGrants,grantEntitlement:i.grantEntitlement,revokeGrant:i.revokeGrant,holdSpend:i.holdSpend,setCustomerLimit:i.setCustomerLimit,clearCustomerLimit:i.clearCustomerLimit,grantLimit:i.grantLimit,spend:i.spend,commitSpend:i.commitSpend,extendHold:i.extendHold,releaseSpend:i.releaseSpend,reverseSpend:i.reverseSpend,listExperiments:i.listExperiments,startExperiment:i.startExperiment,getExperiment:i.getExperiment,getExperimentResults:i.getExperimentResults,stopExperiment:i.stopExperiment,declareExperimentWinner:i.declareExperimentWinner,getOfferings:i.getOfferings,listPaywalls:i.listPaywalls,createPaywall:i.createPaywall,listPaywallAssets:i.listPaywallAssets,registerPaywallAsset:i.registerPaywallAsset,deletePaywallAsset:i.deletePaywallAsset,listPaywallTemplates:i.listPaywallTemplates,getPaywallTemplateAsset:i.getPaywallTemplateAsset,validatePaywall:i.validatePaywall,getPaywall:i.getPaywall,deletePaywall:i.deletePaywall,savePaywallDraft:i.savePaywallDraft,publishPaywall:i.publishPaywall,listPaywallVersions:i.listPaywallVersions,getPaywallVersion:i.getPaywallVersion,listPlacements:i.listPlacements,listAttributeKeys:i.listAttributeKeys,setPlacement:i.setPlacement,deletePlacement:i.deletePlacement,recordPaywallExposure:i.recordPaywallExposure,getPlacementPaywall:i.getPlacementPaywall,previewPlacement:i.previewPlacement,getPlacementResults:i.getPlacementResults,getPlacementRules:i.getPlacementRules,setPlacementRules:i.setPlacementRules,getSettings:i.getSettings,updateSettings:i.updateSettings,getStripeAccount:i.getStripeAccount,disconnectStripe:i.disconnectStripe,checkStripeAccount:i.checkStripeAccount,createCheckout:i.createCheckout,createCheckoutRedemption:i.createCheckoutRedemption,createStripeGrant:i.createStripeGrant,createStripeAppInstall:i.createStripeAppInstall,getOfferStats:i.getOfferStats,listCoupons:i.listCoupons,createCoupon:i.createCoupon,getCoupon:i.getCoupon,revokeCoupon:i.revokeCoupon,listCouponCodes:i.listCouponCodes,setXcodeOfferKey:i.setXcodeOfferKey,searchCustomers:i.searchCustomers,getCustomerHistory:i.getCustomerHistory,listCatalogRevisions:i.listCatalogRevisions,getCatalogRevision:i.getCatalogRevision,restoreCatalogRevision:i.restoreCatalogRevision,extendSubscription:i.extendSubscription,refundSubscription:i.refundSubscription,cancelSubscription:i.cancelSubscription},realtime:{broadcast:h.broadcast,getChannels:h.getChannels,putChannels:h.putChannels,getLimits:h.getLimits,putLimits:h.putLimits,revalidate:h.revalidate,writeState:h.writeState,getStats:h.getStats},secrets:{listSecretAudit:c.listSecretAudit,listFieldKeys:c.listFieldKeys,getFieldKeys:c.getFieldKeys,openFields:c.openFields,sealPlaceholder:c.sealPlaceholder,rotateFieldKeys:c.rotateFieldKeys,listTransitKeys:c.listTransitKeys,getTransitKeys:c.getTransitKeys,getTransitPublicKeys:c.getTransitPublicKeys,rotateTransitKeys:c.rotateTransitKeys,retireTransitKey:c.retireTransitKey,listSecrets:c.listSecrets,getEnvironmentValues:c.getEnvironmentValues,getSecret:c.getSecret,putSecret:c.putSecret,deleteSecret:c.deleteSecret,rollbackSecret:c.rollbackSecret,listSecretVersions:c.listSecretVersions},storage:{listBuckets:u.listBuckets,getBucket:u.getBucket,putBucket:u.putBucket,deleteBucket:u.deleteBucket,copyObject:u.copyObject,moveObject:u.moveObject,listObjects:u.listObjects,getObject:u.getObject,putObject:u.putObject,deleteObject:u.deleteObject,headObject:u.headObject,createSignedUrl:u.createSignedUrl,createUploadUrl:u.createUploadUrl,getStorageStats:u.getStorageStats},stores:{listActions:o.listActions,getAction:o.getAction,confirmAction:o.confirmAction,declineAction:o.declineAction,getAppleAccount:o.getAppleAccount,disconnectApple:o.disconnectApple,checkAppleAccount:o.checkAppleAccount,createAppleGrant:o.createAppleGrant,getSandboxReadiness:o.getSandboxReadiness,listSandboxTesters:o.listSandboxTesters,clearSandboxPurchaseHistory:o.clearSandboxPurchaseHistory,updateSandboxTester:o.updateSandboxTester,listApps:o.listApps,listFeedback:o.listFeedback,getFeedback:o.getFeedback,listGroups:o.listGroups,createGroup:o.createGroup,linkApp:o.linkApp,getListing:o.getListing,setListing:o.setListing,planListing:o.planListing,createPackage:o.createPackage,uploadScreenshot:o.uploadScreenshot,getReviewInfo:o.getReviewInfo,setReviewInfo:o.setReviewInfo,getUploadKey:o.getUploadKey,getAppStoreVersion:o.getAppStoreVersion,prepareAppStoreVersion:o.prepareAppStoreVersion,planPhasedRelease:o.planPhasedRelease,planReleaseVersion:o.planReleaseVersion,planSubmitReview:o.planSubmitReview,planWithdrawReview:o.planWithdrawReview,getAppVitals:o.getAppVitals,getAppWebhook:o.getAppWebhook,makeAppWebhook:o.makeAppWebhook,pingAppWebhook:o.pingAppWebhook,getGoogleAccount:o.getGoogleAccount,connectGoogle:o.connectGoogle,disconnectGoogle:o.disconnectGoogle,checkGoogleAccount:o.checkGoogleAccount,deleteGroup:o.deleteGroup,renameGroup:o.renameGroup,addGroupBuild:o.addGroupBuild,listTesters:o.listTesters,setTesters:o.setTesters,listPackages:o.listPackages,getPackage:o.getPackage,planBetaReview:o.planBetaReview,listDeliveries:o.listDeliveries,deliver:o.deliver,getSignedBundleLink:o.getSignedBundleLink,planExpire:o.planExpire,planExportCompliance:o.planExportCompliance,setWhatToTest:o.setWhatToTest,getAppleSession:o.getAppleSession,disconnectAppleSession:o.disconnectAppleSession,checkAppleSession:o.checkAppleSession,createAppleIdGrant:o.createAppleIdGrant,getAppReview:o.getAppReview,getReviewAttachment:o.getReviewAttachment,setReviewDraft:o.setReviewDraft,sendReviewDraft:o.sendReviewDraft,getAppPrivacy:o.getAppPrivacy,setAppPrivacy:o.setAppPrivacy,makeAppRecord:o.makeAppRecord,removeAppRecord:o.removeAppRecord,listMadeAppleKeys:o.listMadeAppleKeys,makeAppleKey:o.makeAppleKey,revokeMadeAppleKey:o.revokeMadeAppleKey,shareAppleSession:o.shareAppleSession,unshareAppleSession:o.unshareAppleSession}}}function K(t){return{orgs:{async list(e){return t.send({op:"orgs.list",method:"GET",path:"/v1/orgs",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e?.signal})},async create(e){return t.send({op:"orgs.create",method:"POST",path:"/v1/orgs",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async get(e){return t.send({op:"orgs.get",method:"GET",path:"/v1/orgs/"+r("orgs.get","id",e.path.id),auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async takeAway(e){return t.send({op:"orgs.takeAway",method:"DELETE",path:"/v1/orgs/"+r("orgs.takeAway","id",e.path.id),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async rename(e){return t.send({op:"orgs.rename",method:"PATCH",path:"/v1/orgs/"+r("orgs.rename","id",e.path.id),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async members(e){return t.send({op:"orgs.members",method:"GET",path:"/v1/orgs/"+r("orgs.members","id",e.path.id)+"/members",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async auditLog(e){return t.send({op:"orgs.auditLog",method:"GET",path:"/v1/orgs/"+r("orgs.auditLog","id",e.path.id)+"/audit",auth:[["PalbaseBearer"]],answers:{200:"json"},query:e.query,signal:e.signal})}},invitations:{async mine(e){return t.send({op:"invitations.mine",method:"GET",path:"/v1/invitations",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e?.signal})},async accept(e){return t.send({op:"invitations.accept",method:"POST",path:"/v1/invitations/"+r("invitations.accept","id",e.path.id)+"/accept",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})}},orgWebhooks:{async list(e){return t.send({op:"orgWebhooks.list",method:"GET",path:"/v1/orgs/"+r("orgWebhooks.list","id",e.path.id)+"/webhooks",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async add(e){return t.send({op:"orgWebhooks.add",method:"POST",path:"/v1/orgs/"+r("orgWebhooks.add","id",e.path.id)+"/webhooks",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async remove(e){return t.send({op:"orgWebhooks.remove",method:"DELETE",path:"/v1/orgs/"+r("orgWebhooks.remove","id",e.path.id)+"/webhooks/"+r("orgWebhooks.remove","endpoint",e.path.endpoint),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})}},projects:{async mine(e){return t.send({op:"projects.mine",method:"GET",path:"/v1/projects",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e?.signal})},async environmentsMine(e){return t.send({op:"projects.environmentsMine",method:"GET",path:"/v1/environments",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e?.signal})},async list(e){return t.send({op:"projects.list",method:"GET",path:"/v1/orgs/"+r("projects.list","id",e.path.id)+"/projects",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async create(e){return t.send({op:"projects.create",method:"POST",path:"/v1/orgs/"+r("projects.create","id",e.path.id)+"/projects",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async get(e){return t.send({op:"projects.get",method:"GET",path:"/v1/projects/"+r("projects.get","id",e.path.id),auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async remove(e){return t.send({op:"projects.remove",method:"DELETE",path:"/v1/projects/"+r("projects.remove","id",e.path.id),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async rename(e){return t.send({op:"projects.rename",method:"PATCH",path:"/v1/projects/"+r("projects.rename","id",e.path.id),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async addEnvironment(e){return t.send({op:"projects.addEnvironment",method:"POST",path:"/v1/projects/"+r("projects.addEnvironment","id",e.path.id)+"/environments",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async environment(e){return t.send({op:"projects.environment",method:"GET",path:"/v1/environments/"+r("projects.environment","ref",e.path.ref),auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async removeEnvironment(e){return t.send({op:"projects.removeEnvironment",method:"DELETE",path:"/v1/environments/"+r("projects.removeEnvironment","ref",e.path.ref),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,query:e.query,headers:e.headers,signal:e.signal})},async renameEnvironment(e){return t.send({op:"projects.renameEnvironment",method:"PATCH",path:"/v1/environments/"+r("projects.renameEnvironment","ref",e.path.ref),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async keys(e){return t.send({op:"projects.keys",method:"GET",path:"/v1/environments/"+r("projects.keys","ref",e.path.ref)+"/keys",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async usage(e){return t.send({op:"projects.usage",method:"GET",path:"/v1/environments/"+r("projects.usage","ref",e.path.ref)+"/usage",auth:[["PalbaseBearer"]],answers:{200:"json"},query:e.query,signal:e.signal})},async personalKey(e){return t.send({op:"projects.personalKey",method:"POST",path:"/v1/environments/"+r("projects.personalKey","ref",e.path.ref)+"/personal-key",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async revokePersonalKey(e){return t.send({op:"projects.revokePersonalKey",method:"DELETE",path:"/v1/environments/"+r("projects.revokePersonalKey","ref",e.path.ref)+"/personal-key/"+r("projects.revokePersonalKey","key",e.path.key),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async shareInstallation(e){return t.send({op:"projects.shareInstallation",method:"POST",path:"/v1/environments/"+r("projects.shareInstallation","ref",e.path.ref)+"/github/installations",auth:[["PalbaseBearer"]],answers:{},ownResponse:!0,idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})}},apps:{async list(e){return t.send({op:"apps.list",method:"GET",path:"/v1/projects/"+r("apps.list","id",e.path.id)+"/apps",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async create(e){return t.send({op:"apps.create",method:"POST",path:"/v1/projects/"+r("apps.create","id",e.path.id)+"/apps",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async get(e){return t.send({op:"apps.get",method:"GET",path:"/v1/projects/"+r("apps.get","id",e.path.id)+"/apps/"+r("apps.get","app",e.path.app),auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async remove(e){return t.send({op:"apps.remove",method:"DELETE",path:"/v1/projects/"+r("apps.remove","id",e.path.id)+"/apps/"+r("apps.remove","app",e.path.app),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async update(e){return t.send({op:"apps.update",method:"PATCH",path:"/v1/projects/"+r("apps.update","id",e.path.id)+"/apps/"+r("apps.update","app",e.path.app),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async restore(e){return t.send({op:"apps.restore",method:"POST",path:"/v1/projects/"+r("apps.restore","id",e.path.id)+"/apps/"+r("apps.restore","app",e.path.app)+"/restore",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async setIn(e){return t.send({op:"apps.setIn",method:"PUT",path:"/v1/environments/"+r("apps.setIn","ref",e.path.ref)+"/apps/"+r("apps.setIn","app",e.path.app),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async removeFrom(e){return t.send({op:"apps.removeFrom",method:"DELETE",path:"/v1/environments/"+r("apps.removeFrom","ref",e.path.ref)+"/apps/"+r("apps.removeFrom","app",e.path.app),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async config(e){return t.send({op:"apps.config",method:"GET",path:"/v1/environments/"+r("apps.config","ref",e.path.ref)+"/apps/"+r("apps.config","app",e.path.app)+"/config",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})}},snippets:{async list(e){return t.send({op:"snippets.list",method:"GET",path:"/v1/environments/"+r("snippets.list","ref",e.path.ref)+"/snippets",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async create(e){return t.send({op:"snippets.create",method:"POST",path:"/v1/environments/"+r("snippets.create","ref",e.path.ref)+"/snippets",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async remove(e){return t.send({op:"snippets.remove",method:"DELETE",path:"/v1/environments/"+r("snippets.remove","ref",e.path.ref)+"/snippets/"+r("snippets.remove","id",e.path.id),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async change(e){return t.send({op:"snippets.change",method:"PATCH",path:"/v1/environments/"+r("snippets.change","ref",e.path.ref)+"/snippets/"+r("snippets.change","id",e.path.id),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})}},chartViews:{async list(e){return t.send({op:"chartViews.list",method:"GET",path:"/v1/environments/"+r("chartViews.list","ref",e.path.ref)+"/chart-views",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async create(e){return t.send({op:"chartViews.create",method:"POST",path:"/v1/environments/"+r("chartViews.create","ref",e.path.ref)+"/chart-views",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async remove(e){return t.send({op:"chartViews.remove",method:"DELETE",path:"/v1/environments/"+r("chartViews.remove","ref",e.path.ref)+"/chart-views/"+r("chartViews.remove","id",e.path.id),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async change(e){return t.send({op:"chartViews.change",method:"PATCH",path:"/v1/environments/"+r("chartViews.change","ref",e.path.ref)+"/chart-views/"+r("chartViews.change","id",e.path.id),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})}},webhooks:{async list(e){return t.send({op:"webhooks.list",method:"GET",path:"/v1/environments/"+r("webhooks.list","ref",e.path.ref)+"/webhooks",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async add(e){return t.send({op:"webhooks.add",method:"POST",path:"/v1/environments/"+r("webhooks.add","ref",e.path.ref)+"/webhooks",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async deliveries(e){return t.send({op:"webhooks.deliveries",method:"GET",path:"/v1/environments/"+r("webhooks.deliveries","ref",e.path.ref)+"/webhooks/deliveries",auth:[["PalbaseBearer"]],answers:{200:"json"},query:e.query,signal:e.signal})},async redeliver(e){return t.send({op:"webhooks.redeliver",method:"POST",path:"/v1/environments/"+r("webhooks.redeliver","ref",e.path.ref)+"/webhooks/deliveries/"+r("webhooks.redeliver","delivery",e.path.delivery)+"/redeliver",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async change(e){return t.send({op:"webhooks.change",method:"PUT",path:"/v1/environments/"+r("webhooks.change","ref",e.path.ref)+"/webhooks/"+r("webhooks.change","endpoint",e.path.endpoint),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async remove(e){return t.send({op:"webhooks.remove",method:"DELETE",path:"/v1/environments/"+r("webhooks.remove","ref",e.path.ref)+"/webhooks/"+r("webhooks.remove","endpoint",e.path.endpoint),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})}},environmentTokens:{async list(e){return t.send({op:"environmentTokens.list",method:"GET",path:"/v1/environments/"+r("environmentTokens.list","ref",e.path.ref)+"/tokens",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async mint(e){return t.send({op:"environmentTokens.mint",method:"POST",path:"/v1/environments/"+r("environmentTokens.mint","ref",e.path.ref)+"/tokens",auth:[["PalbaseBearer"],[]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async revoke(e){return t.send({op:"environmentTokens.revoke",method:"DELETE",path:"/v1/environments/"+r("environmentTokens.revoke","ref",e.path.ref)+"/tokens/"+r("environmentTokens.revoke","id",e.path.id),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})}},billing:{async bill(e){return t.send({op:"billing.bill",method:"GET",path:"/v1/orgs/"+r("billing.bill","id",e.path.id)+"/billing",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async confirm(e){return t.send({op:"billing.confirm",method:"POST",path:"/v1/orgs/"+r("billing.confirm","id",e.path.id)+"/billing/checkout/"+r("billing.confirm","session",e.path.session)+"/confirm",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async cards(e){return t.send({op:"billing.cards",method:"GET",path:"/v1/orgs/"+r("billing.cards","id",e.path.id)+"/billing/cards",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async defaultCard(e){return t.send({op:"billing.defaultCard",method:"PUT",path:"/v1/orgs/"+r("billing.defaultCard","id",e.path.id)+"/billing/cards/"+r("billing.defaultCard","card",e.path.card)+"/default",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async removeCard(e){return t.send({op:"billing.removeCard",method:"DELETE",path:"/v1/orgs/"+r("billing.removeCard","id",e.path.id)+"/billing/cards/"+r("billing.removeCard","card",e.path.card),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async customer(e){return t.send({op:"billing.customer",method:"GET",path:"/v1/orgs/"+r("billing.customer","id",e.path.id)+"/billing/customer",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async setCustomer(e){return t.send({op:"billing.setCustomer",method:"PUT",path:"/v1/orgs/"+r("billing.setCustomer","id",e.path.id)+"/billing/customer",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async charges(e){return t.send({op:"billing.charges",method:"GET",path:"/v1/orgs/"+r("billing.charges","id",e.path.id)+"/billing/charges",auth:[["PalbaseBearer"]],answers:{200:"json"},query:e.query,signal:e.signal})},async csv(e){return t.send({op:"billing.csv",method:"GET",path:"/v1/orgs/"+r("billing.csv","id",e.path.id)+"/billing/charges.csv",auth:[["PalbaseBearer"]],answers:{},ownResponse:!0,query:e.query,signal:e.signal})},async invoices(e){return t.send({op:"billing.invoices",method:"GET",path:"/v1/orgs/"+r("billing.invoices","id",e.path.id)+"/billing/invoices",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async payer(e){return t.send({op:"billing.payer",method:"PUT",path:"/v1/orgs/"+r("billing.payer","id",e.path.id)+"/billing/payer",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async paid(e){return t.send({op:"billing.paid",method:"GET",path:"/v1/orgs/"+r("billing.paid","id",e.path.id)+"/billing/paid",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async stopPaying(e){return t.send({op:"billing.stopPaying",method:"DELETE",path:"/v1/orgs/"+r("billing.stopPaying","id",e.path.id)+"/billing/paid/"+r("billing.stopPaying","org",e.path.org),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async report(e){return t.send({op:"billing.report",method:"GET",path:"/v1/orgs/"+r("billing.report","id",e.path.id)+"/billing/report",auth:[["PalbaseBearer"]],answers:{200:"json"},query:e.query,signal:e.signal})},async reportCsv(e){return t.send({op:"billing.reportCsv",method:"GET",path:"/v1/orgs/"+r("billing.reportCsv","id",e.path.id)+"/billing/report.csv",auth:[["PalbaseBearer"]],answers:{},ownResponse:!0,query:e.query,signal:e.signal})},async project(e){return t.send({op:"billing.project",method:"GET",path:"/v1/orgs/"+r("billing.project","id",e.path.id)+"/billing/projects/"+r("billing.project","project",e.path.project),auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async steer(e){return t.send({op:"billing.steer",method:"PATCH",path:"/v1/orgs/"+r("billing.steer","id",e.path.id)+"/billing/projects/"+r("billing.steer","project",e.path.project),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async freeze(e){return t.send({op:"billing.freeze",method:"PATCH",path:"/v1/orgs/"+r("billing.freeze","id",e.path.id)+"/billing/environments/"+r("billing.freeze","ref",e.path.ref),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})}},accessRequests:{async request(e){return t.send({op:"accessRequests.request",method:"POST",path:"/v1/access-requests",auth:[["PalbaseBearer"],[]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})}},docs:{async search(e){return t.send({op:"docs.search",method:"GET",path:"/v1/docs/search",auth:[["PalbaseBearer"],[]],answers:{200:"json"},query:e.query,signal:e.signal})}}}}function V(t){let{mint:e,revoke:a}=t;return async n=>{let p=await e(n),g=n.body?.role,m=n.body?.on_behalf_of;if(g===void 0&&m===void 0)return p;let s=p.data,d=[];if(g!==void 0&&s.role!==g&&d.push(`role ${g} (it came back ${s.role==null?"at its minter's":s.role})`),m!==void 0&&s.on_behalf_of!==m.trim()&&d.push("on_behalf_of"),d.length===0)return p;let l;try{await a({path:{ref:n.path.ref,id:String(s.id)}})}catch(h){l=h}let i=`Studio minted the token without the ${d.join(" and ")} asked for \u2014 it is older than this SDK`;throw new y({op:"environmentTokens.mint",status:0,code:"token_role_not_kept",message:l===void 0?`environmentTokens.mint: ${i}; the token (${s.id}) was revoked at once and is not returned \u2014 mint it again once Studio is updated`:`environmentTokens.mint: ${i}, and revoking it failed (${l instanceof Error?l.message:String(l)}) \u2014 revoke token ${s.id} of environment ${n.path.ref} yourself, now`,cause:l})}}var _={pbo_:"an organization's",pbu_:"an account's",pbe_:"an environment's"},J=/^[A-Za-z0-9_-]*$/,O=64,b=44;function z(t){if(typeof t!="string"||t==="")return"token is missing: pass an access token, an organization's (pbo_\u2026), an account's (pbu_\u2026) or an environment's (pbe_\u2026)";let e=t.slice(0,4);if(!Object.hasOwn(_,e))return`token has the wrong prefix: an access token starts with pbo_ (an organization's), pbu_ (an account's) or pbe_ (an environment's)${/^pb_[a-z0-9]+_[cs]/.test(t)?" \u2014 a project key belongs in palbase/server or palbase/web":""}`;let a=t.slice(4);if(a.length!==O)return`token has the wrong length: ${_[e]} access token is ${e} and ${O} characters, this one has ${a.length} after it`;if(!J.test(a))return`token is not ${_[e]} access token: after ${e} come base64url characters alone (A\u2013Z, a\u2013z, 0\u20139, - and _)`;let n=X(a),p=(n[b]<<24|n[b+1]<<16|n[b+2]<<8|n[b+3])>>>0;if(Y(e,n.subarray(0,b))!==p)return"token's checksum does not match: it was mistyped or cut, or made before access tokens carried one \u2014 make a new token"}function N(t){return z(t)===void 0}function H(t){let e=z(t);if(e!==void 0)throw new TypeError(e)}var $="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function X(t){let e=new Uint8Array(t.length*6/8),a=0,n=0,p=0;for(let g of t)a=a<<6|$.indexOf(g),n+=6,n>=8&&(n-=8,e[p++]=a>>n&255);return e}var W=(()=>{let t=new Uint32Array(256);for(let e=0;e<256;e++){let a=e;for(let n=0;n<8;n++)a=a&1?3988292384^a>>>1:a>>>1;t[e]=a>>>0}return t})();function Y(t,e){let a=4294967295;for(let n=0;n<t.length;n++)a=W[(a^t.charCodeAt(n))&255]^a>>>8;for(let n of e)a=W[(a^n)&255]^a>>>8;return(a^4294967295)>>>0}var q="palbase.studio",Z="palbase";function Q(){let t=globalThis;return typeof t.window<"u"||typeof t.document<"u"||typeof t.importScripts=="function"||G()}var v=class{domain;#e;#t=new Map;constructor(e){if(Q())throw new TypeError("palbase/cloud runs on a server: its access token opens the organization's projects, so it never goes into a browser, a web worker or a mobile app \u2014 keep it on your server, and have your app call that");H(e?.token);let a=e.domain??q;if(typeof a!="string"||!/^[a-z0-9-]+(\.[a-z0-9-]+)+$/.test(a))throw new TypeError(`domain ${JSON.stringify(a)} is not a domain`);this.domain=a;let n=e.token;this.#e=g=>B(f({baseUrl:g,credentials:{token:n},fetch:e.fetch,solveProofOfWork:!1}),e.retry??I);let p=K(this.#e(`https://palbase.app.${a}`));p.environmentTokens.mint=V(p.environmentTokens),Object.assign(this,p)}project(e){if(typeof e!="string"||!/^[a-z0-9]{1,63}$/.test(e))throw new TypeError(`${JSON.stringify(e)} is not an environment's ref`);let a=this.#t.get(e);return a||(a=L(this.#e(e===Z?`https://connect.${this.domain}`:`https://${e}.${this.domain}`)),this.#t.set(e,a)),a}};export{q as DEFAULT_DOMAIN,v as PalbaseCloud,y as PalbaseError,N as tokenIsWellFormed};
package/dist/refuse/ai.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! palbase 0.52.2 — Palbase SDK License (see LICENSE) */
1
+ /*! palbase 0.52.3 — Palbase SDK License (see LICENSE) */
2
2
  throw new Error("palbase/ai is for servers: it speaks with the project secret key, which never goes into a browser or a mobile app \u2014 call your backend, and let it ask the model");
@@ -1,2 +1,2 @@
1
- /*! palbase 0.52.2 — Palbase SDK License (see LICENSE) */
1
+ /*! palbase 0.52.3 — Palbase SDK License (see LICENSE) */
2
2
  throw new Error("palbase/backend is a server framework: it runs on your backend, never in a browser or a mobile app \u2014 apps use palbase/web (or the native SDKs)");
@@ -1,2 +1,2 @@
1
- /*! palbase 0.52.2 — Palbase SDK License (see LICENSE) */
1
+ /*! palbase 0.52.3 — Palbase SDK License (see LICENSE) */
2
2
  throw new Error("palbase/cloud is for servers: its access token opens the organization's projects, so it belongs on your server and never in a browser or a mobile app \u2014 have your app call your server");
@@ -1,2 +1,2 @@
1
- /*! palbase 0.52.2 — Palbase SDK License (see LICENSE) */
1
+ /*! palbase 0.52.3 — Palbase SDK License (see LICENSE) */
2
2
  throw new Error("palbase/server is for servers: its secret key never goes into a browser or a mobile app \u2014 apps use palbase/web (or the native SDKs) with the publishable key");
@@ -1,2 +1,2 @@
1
- /*! palbase 0.52.2 — Palbase SDK License (see LICENSE) */
2
- import{a as e,b as f,c as g,d as h,e as i,f as j,g as k,h as l,i as m,j as n,k as o,l as p,m as q,n as r,o as s,p as t,q as u,r as v,s as w,t as x,u as y}from"../chunks/USFK3JYL.js";import{a as c,b as d}from"../chunks/QZNTAOHQ.js";import"../chunks/XW72Z3PD.js";import"../chunks/CAFJGSSL.js";import{p as b}from"../chunks/WBQBWQEG.js";import"../chunks/2TJ6G7EB.js";import{b as a}from"../chunks/LIAYIEXX.js";import"../chunks/CS7VS2I4.js";import"../chunks/CNNM6TEU.js";export{o as AuthUnavailable,b as EVENT_TYPES,c as FieldError,d as Fields,a as PalbaseError,t as ReservationSettled,n as TokenError,q as TokenVerifier,f as Transit,e as TransitRefusal,g as TransitRequest,i as WebhookSignatureError,h as createServer,s as isEntitled,y as loadSecrets,v as pages,x as platformOwn,w as processOwn,r as requestAddress,p as sessionStanding,l as signatureHeader,k as verifySignature,j as verifyWebhook,m as verifyWebhookRequest,u as withReservation};
1
+ /*! palbase 0.52.3 — Palbase SDK License (see LICENSE) */
2
+ import{a as e,b as f,c as g,d as h,e as i,f as j,g as k,h as l,i as m,j as n,k as o,l as p,m as q,n as r,o as s,p as t,q as u,r as v,s as w,t as x,u as y}from"../chunks/QBER5HWP.js";import{a as c,b as d}from"../chunks/6EWQSD7D.js";import"../chunks/OPXS5CYY.js";import"../chunks/XHTOI77Q.js";import{p as b}from"../chunks/IAEVNAIO.js";import"../chunks/CLFVU67I.js";import{b as a}from"../chunks/UH5Q63EN.js";import"../chunks/2PCDSIWJ.js";import"../chunks/P2IYCDCP.js";export{o as AuthUnavailable,b as EVENT_TYPES,c as FieldError,d as Fields,a as PalbaseError,t as ReservationSettled,n as TokenError,q as TokenVerifier,f as Transit,e as TransitRefusal,g as TransitRequest,i as WebhookSignatureError,h as createServer,s as isEntitled,y as loadSecrets,v as pages,x as platformOwn,w as processOwn,r as requestAddress,p as sessionStanding,l as signatureHeader,k as verifySignature,j as verifyWebhook,m as verifyWebhookRequest,u as withReservation};
@@ -1,2 +1,2 @@
1
- /*! palbase 0.52.2 — Palbase SDK License (see LICENSE) */
2
- import{a,b,c,d,e}from"../chunks/UZHDAEGV.js";import"../chunks/QZNTAOHQ.js";import"../chunks/CS7VS2I4.js";import"../chunks/CNNM6TEU.js";export{b as TestApiError,e as api,c as createTestApi,a as testFields,d as testRun};
1
+ /*! palbase 0.52.3 — Palbase SDK License (see LICENSE) */
2
+ import{a,b,c,d,e}from"../chunks/LHOFBMBZ.js";import"../chunks/6EWQSD7D.js";import"../chunks/2PCDSIWJ.js";import"../chunks/P2IYCDCP.js";export{b as TestApiError,e as api,c as createTestApi,a as testFields,d as testRun};
package/dist/web/index.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! palbase 0.52.2 — Palbase SDK License (see LICENSE) */
2
- import{A as de,B as ye,a as I,b as j,c as q,d as G,e as D,f as H,g as N,h as U,i as B,j as F,k as J,l as K,m as W,n as X,o as Y,p as Z,q as ee,r as te,s as ne,t as re,u as oe,v as se,w as ae,x as ie,y as ce,z as pe}from"../chunks/6KUEOXTD.js";import{a as _,b as Q,f as z}from"../chunks/FZYSYMLN.js";import"../chunks/LRBCJG6J.js";import"../chunks/7MZR43VA.js";import"../chunks/3ECCMPHK.js";import"../chunks/QBPW2ZV2.js";import{b as k,c as O,d as T,f as x,g as R,j as A,k as V,l as M,m as E,o as P}from"../chunks/XW72Z3PD.js";import"../chunks/WBQBWQEG.js";import"../chunks/2TJ6G7EB.js";import{b as L}from"../chunks/LIAYIEXX.js";import"../chunks/CS7VS2I4.js";import"../chunks/CNNM6TEU.js";var le="oai-events";async function ue(e){if(typeof e?.start!="function")throw new TypeError("connectVoice: start(sdp) is the round trip to the app's backend, which starts the voice (chats.voice.start) and answers { id, sdp }");let r=e.rtc??he(),t=e.signal;t?.throwIfAborted();let l=e.audio??ge(),f=e.microphone===void 0,c=e.microphone??await r.getUserMedia({audio:!0});if(t?.aborted){if(f)for(let n of c.getTracks())n.stop();throw t.reason}let o=new r.RTCPeerConnection,s=!1,u=()=>{if(!s){if(s=!0,m.close(),o.close(),f)for(let n of c.getTracks())n.stop();l.srcObject!==null&&(l.srcObject=null)}};o.addEventListener("track",n=>{l.srcObject=n.streams[0]??new MediaStream([n.track]),l.play?.()?.catch?.(()=>{})}),o.addEventListener("connectionstatechange",()=>e.onState?.(o.connectionState));for(let n of c.getAudioTracks())o.addTrack(n,c);let m=o.createDataChannel(le);m.addEventListener("message",n=>{let d=me(n.data);d!==void 0&&e.onError?.(d)});let p=()=>u();t?.addEventListener("abort",p,{once:!0});try{await o.setLocalDescription(await o.createOffer()),t?.throwIfAborted(),await fe(o,e.iceTimeoutMs??1e4,t);let n=o.localDescription?.sdp;if(!n)throw new Error("connectVoice: the peer connection made no offer");let d=await e.start(n);if(t?.throwIfAborted(),typeof d?.id!="string"||d.id===""||typeof d.sdp!="string"||d.sdp==="")throw new TypeError("connectVoice: start answered no voice \u2014 it is { id, sdp }, chats.voice.start's answer as the backend got it");return await o.setRemoteDescription({type:"answer",sdp:d.sdp}),t?.removeEventListener("abort",p),{id:d.id,peer:o,audio:l,microphone:c,get muted(){return c.getAudioTracks().every(h=>!h.enabled)},mute(h){for(let w of c.getAudioTracks())w.enabled=!h},close:u}}catch(n){throw t?.removeEventListener("abort",p),u(),t?.aborted?t.reason:n}}function fe(e,r,t){return e.iceGatheringState==="complete"?Promise.resolve():t?.aborted?Promise.reject(t.reason):new Promise((l,f)=>{let c=()=>{clearTimeout(u),e.removeEventListener("icegatheringstatechange",o),t?.removeEventListener("abort",s)},o=()=>{e.iceGatheringState==="complete"&&(c(),l())},s=()=>{c(),f(t?.reason)},u=setTimeout(()=>{c(),f(new Error(`connectVoice: the network candidates were not gathered in ${r} ms`))},r);e.addEventListener("icegatheringstatechange",o),t?.addEventListener("abort",s,{once:!0})})}function me(e){if(typeof e=="string")try{let r=JSON.parse(e);return r.type!=="error"?void 0:typeof r.error?.message=="string"?r.error.message:typeof r.error?.code=="string"?r.error.code:"the voice failed"}catch{return}}function he(){let e=globalThis;if(typeof e.RTCPeerConnection!="function"||typeof e.navigator?.mediaDevices?.getUserMedia!="function")throw new TypeError("connectVoice: this runtime has no WebRTC (RTCPeerConnection, navigator.mediaDevices): a chat's voice is a browser's");let r=e.navigator.mediaDevices;return{RTCPeerConnection:e.RTCPeerConnection,getUserMedia:t=>r.getUserMedia(t)}}function ge(){let e=globalThis.document;if(!e)throw new TypeError("connectVoice: give audio \u2014 the element the voice plays in \u2014 where there is no document");let r=e.createElement("audio");return r.autoplay=!0,r}var i=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0;function we(e,r,t){let l=i(i(i(e)?.components)?.schemas)??{},f=(p,n)=>{let d=new Set,h=(b,g,y)=>{let a=i(b);if(!a)return;if(typeof a.$ref=="string"){if(y.has(a.$ref)||!a.$ref.startsWith("#/components/schemas/"))return;h(l[a.$ref.slice(21)],g,new Set(y).add(a.$ref));return}if(a[k]===!0){d.add(g);return}for(let C of["anyOf","oneOf","allOf"]){let S=a[C];if(Array.isArray(S))for(let $ of S)h($,g,y)}let v=i(a.properties);if(v)for(let[C,S]of Object.entries(v))h(S,`${g}/${E(C)}`,y);i(a.items)&&h(a.items,`${g}/*`,y);for(let C of["additionalProperties","patternProperties","prefixItems"])if(a[C]!==void 0&&w(a[C],new Set(y)))throw new Error(`${t}: an encrypted field is a named property \u2014 not every key of a record, nor a tuple's place`)},w=(b,g)=>{if(Array.isArray(b))return b.some(a=>w(a,g));let y=i(b);return y?y[k]===!0?!0:typeof y.$ref=="string"&&!g.has(y.$ref)&&y.$ref.startsWith("#/components/schemas/")?(g.add(y.$ref),w(l[y.$ref.slice(21)],g)):Object.values(y).some(a=>typeof a=="object"&&a!==null&&w(a,g)):!1};return h(p,n,new Set),[...d]},c=p=>i(i(i(p)?.["application/json"])?.schema),o=[];o.push(...f(c(i(r.requestBody)?.content),"/body"));for(let p of Array.isArray(r.parameters)?r.parameters:[]){let n=i(p);if(!n)continue;let d=f(n.schema,`/query/${E(String(n.name))}`);if(d.length!==0){if(n.in!=="query")throw new Error(`${t}: ${String(n.in)} parameter ${String(n.name)} is marked encrypted \u2014 a body's or a query's field is`);if(d.some(h=>h.split("/").length!==3))throw new Error(`${t}: an encrypted query field is one of the query's own names`);o.push(...d)}}let s=i(r.responses)??{},u=Object.keys(s).filter(p=>/^2\d\d$/.test(p)).sort((p,n)=>p==="200"?-1:n==="200"?1:p.localeCompare(n)),m=u.length>0?f(c(i(s[u[0]])?.content),"/response"):[];if(o.length+m.length!==0){if(r["x-palbase-sse"]!==void 0&&m.length>0)throw new Error(`${t}: a streamed answer carries no encrypted field`);if(r["x-palbase-upload"]!==void 0)throw new Error(`${t}: an upload goes through storage, which seals nothing \u2014 it carries no encrypted field`);return{request:o,response:m}}}async function Ce(e){let r=`${e.method.toUpperCase()} ${e.path}`,t=i(i(i(i(e.contract)?.paths)?.[e.path])?.[e.method.toLowerCase()]),l=t?we(e.contract,t,r):void 0;if(!l)return{body:e.body,query:e.query,open:async s=>s};let{key:f,header:c}=await R(e.key.kid,T(e.key.publicKey),x(e.projectId,e.method,e.path,e.params??[])),o=(s,u)=>s==null?s:P(s,u,l.request,(m,p)=>A(f,m,p));return{header:c,body:await o(e.body,"/body"),query:await o(e.query,"/query"),open:s=>s===void 0?Promise.resolve(s):P(s,"/response",l.response,async(u,m)=>{if(!V(m))throw new O("unopenable",`${r}: ${u} came plain where the contract says it is encrypted`);return M(f,u,m)})}}export{N as Analytics,_ as BackendError,de as CallPlace,ce as CallSession,pe as Calls,G as Channel,U as Consent,ne as ConversationList,oe as ConversationView,re as DeletedGroupList,Z as Flags,z as GatewayError,J as InApp,B as Inbox,H as Installation,te as Messaging,W as Notify,L as PalbaseError,ie as PlaceBusyError,X as Purchases,D as RealtimeSocket,F as SESSION_START,ae as ScheduledList,I as SessionChangedError,se as ThreadView,K as WebPush,ue as connectVoice,ye as createClient,Ce as encryptedCall,ee as indexedDBKeyValue,Q as isBackendError,q as localStore,j as memoryStore,Y as redemptionToken};
1
+ /*! palbase 0.52.3 — Palbase SDK License (see LICENSE) */
2
+ import{A as de,B as ye,a as I,b as j,c as q,d as G,e as D,f as H,g as N,h as U,i as B,j as F,k as J,l as K,m as W,n as X,o as Y,p as Z,q as ee,r as te,s as ne,t as re,u as oe,v as se,w as ae,x as ie,y as ce,z as pe}from"../chunks/57HMBEZC.js";import{a as _,b as Q,f as z}from"../chunks/JJC4IE3C.js";import"../chunks/VNMRZXZM.js";import"../chunks/MFQQUKVA.js";import"../chunks/5ASDRQ76.js";import"../chunks/ZAR57AMM.js";import{b as k,c as O,d as T,f as x,g as R,j as A,k as V,l as M,m as E,o as P}from"../chunks/OPXS5CYY.js";import"../chunks/IAEVNAIO.js";import"../chunks/CLFVU67I.js";import{b as L}from"../chunks/UH5Q63EN.js";import"../chunks/2PCDSIWJ.js";import"../chunks/P2IYCDCP.js";var le="oai-events";async function ue(e){if(typeof e?.start!="function")throw new TypeError("connectVoice: start(sdp) is the round trip to the app's backend, which starts the voice (chats.voice.start) and answers { id, sdp }");let r=e.rtc??he(),t=e.signal;t?.throwIfAborted();let l=e.audio??ge(),f=e.microphone===void 0,c=e.microphone??await r.getUserMedia({audio:!0});if(t?.aborted){if(f)for(let n of c.getTracks())n.stop();throw t.reason}let o=new r.RTCPeerConnection,s=!1,u=()=>{if(!s){if(s=!0,m.close(),o.close(),f)for(let n of c.getTracks())n.stop();l.srcObject!==null&&(l.srcObject=null)}};o.addEventListener("track",n=>{l.srcObject=n.streams[0]??new MediaStream([n.track]),l.play?.()?.catch?.(()=>{})}),o.addEventListener("connectionstatechange",()=>e.onState?.(o.connectionState));for(let n of c.getAudioTracks())o.addTrack(n,c);let m=o.createDataChannel(le);m.addEventListener("message",n=>{let d=me(n.data);d!==void 0&&e.onError?.(d)});let p=()=>u();t?.addEventListener("abort",p,{once:!0});try{await o.setLocalDescription(await o.createOffer()),t?.throwIfAborted(),await fe(o,e.iceTimeoutMs??1e4,t);let n=o.localDescription?.sdp;if(!n)throw new Error("connectVoice: the peer connection made no offer");let d=await e.start(n);if(t?.throwIfAborted(),typeof d?.id!="string"||d.id===""||typeof d.sdp!="string"||d.sdp==="")throw new TypeError("connectVoice: start answered no voice \u2014 it is { id, sdp }, chats.voice.start's answer as the backend got it");return await o.setRemoteDescription({type:"answer",sdp:d.sdp}),t?.removeEventListener("abort",p),{id:d.id,peer:o,audio:l,microphone:c,get muted(){return c.getAudioTracks().every(h=>!h.enabled)},mute(h){for(let w of c.getAudioTracks())w.enabled=!h},close:u}}catch(n){throw t?.removeEventListener("abort",p),u(),t?.aborted?t.reason:n}}function fe(e,r,t){return e.iceGatheringState==="complete"?Promise.resolve():t?.aborted?Promise.reject(t.reason):new Promise((l,f)=>{let c=()=>{clearTimeout(u),e.removeEventListener("icegatheringstatechange",o),t?.removeEventListener("abort",s)},o=()=>{e.iceGatheringState==="complete"&&(c(),l())},s=()=>{c(),f(t?.reason)},u=setTimeout(()=>{c(),f(new Error(`connectVoice: the network candidates were not gathered in ${r} ms`))},r);e.addEventListener("icegatheringstatechange",o),t?.addEventListener("abort",s,{once:!0})})}function me(e){if(typeof e=="string")try{let r=JSON.parse(e);return r.type!=="error"?void 0:typeof r.error?.message=="string"?r.error.message:typeof r.error?.code=="string"?r.error.code:"the voice failed"}catch{return}}function he(){let e=globalThis;if(typeof e.RTCPeerConnection!="function"||typeof e.navigator?.mediaDevices?.getUserMedia!="function")throw new TypeError("connectVoice: this runtime has no WebRTC (RTCPeerConnection, navigator.mediaDevices): a chat's voice is a browser's");let r=e.navigator.mediaDevices;return{RTCPeerConnection:e.RTCPeerConnection,getUserMedia:t=>r.getUserMedia(t)}}function ge(){let e=globalThis.document;if(!e)throw new TypeError("connectVoice: give audio \u2014 the element the voice plays in \u2014 where there is no document");let r=e.createElement("audio");return r.autoplay=!0,r}var i=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0;function we(e,r,t){let l=i(i(i(e)?.components)?.schemas)??{},f=(p,n)=>{let d=new Set,h=(b,g,y)=>{let a=i(b);if(!a)return;if(typeof a.$ref=="string"){if(y.has(a.$ref)||!a.$ref.startsWith("#/components/schemas/"))return;h(l[a.$ref.slice(21)],g,new Set(y).add(a.$ref));return}if(a[k]===!0){d.add(g);return}for(let C of["anyOf","oneOf","allOf"]){let S=a[C];if(Array.isArray(S))for(let $ of S)h($,g,y)}let v=i(a.properties);if(v)for(let[C,S]of Object.entries(v))h(S,`${g}/${E(C)}`,y);i(a.items)&&h(a.items,`${g}/*`,y);for(let C of["additionalProperties","patternProperties","prefixItems"])if(a[C]!==void 0&&w(a[C],new Set(y)))throw new Error(`${t}: an encrypted field is a named property \u2014 not every key of a record, nor a tuple's place`)},w=(b,g)=>{if(Array.isArray(b))return b.some(a=>w(a,g));let y=i(b);return y?y[k]===!0?!0:typeof y.$ref=="string"&&!g.has(y.$ref)&&y.$ref.startsWith("#/components/schemas/")?(g.add(y.$ref),w(l[y.$ref.slice(21)],g)):Object.values(y).some(a=>typeof a=="object"&&a!==null&&w(a,g)):!1};return h(p,n,new Set),[...d]},c=p=>i(i(i(p)?.["application/json"])?.schema),o=[];o.push(...f(c(i(r.requestBody)?.content),"/body"));for(let p of Array.isArray(r.parameters)?r.parameters:[]){let n=i(p);if(!n)continue;let d=f(n.schema,`/query/${E(String(n.name))}`);if(d.length!==0){if(n.in!=="query")throw new Error(`${t}: ${String(n.in)} parameter ${String(n.name)} is marked encrypted \u2014 a body's or a query's field is`);if(d.some(h=>h.split("/").length!==3))throw new Error(`${t}: an encrypted query field is one of the query's own names`);o.push(...d)}}let s=i(r.responses)??{},u=Object.keys(s).filter(p=>/^2\d\d$/.test(p)).sort((p,n)=>p==="200"?-1:n==="200"?1:p.localeCompare(n)),m=u.length>0?f(c(i(s[u[0]])?.content),"/response"):[];if(o.length+m.length!==0){if(r["x-palbase-sse"]!==void 0&&m.length>0)throw new Error(`${t}: a streamed answer carries no encrypted field`);if(r["x-palbase-upload"]!==void 0)throw new Error(`${t}: an upload goes through storage, which seals nothing \u2014 it carries no encrypted field`);return{request:o,response:m}}}async function Ce(e){let r=`${e.method.toUpperCase()} ${e.path}`,t=i(i(i(i(e.contract)?.paths)?.[e.path])?.[e.method.toLowerCase()]),l=t?we(e.contract,t,r):void 0;if(!l)return{body:e.body,query:e.query,open:async s=>s};let{key:f,header:c}=await R(e.key.kid,T(e.key.publicKey),x(e.projectId,e.method,e.path,e.params??[])),o=(s,u)=>s==null?s:P(s,u,l.request,(m,p)=>A(f,m,p));return{header:c,body:await o(e.body,"/body"),query:await o(e.query,"/query"),open:s=>s===void 0?Promise.resolve(s):P(s,"/response",l.response,async(u,m)=>{if(!V(m))throw new O("unopenable",`${r}: ${u} came plain where the contract says it is encrypted`);return M(f,u,m)})}}export{N as Analytics,_ as BackendError,de as CallPlace,ce as CallSession,pe as Calls,G as Channel,U as Consent,ne as ConversationList,oe as ConversationView,re as DeletedGroupList,Z as Flags,z as GatewayError,J as InApp,B as Inbox,H as Installation,te as Messaging,W as Notify,L as PalbaseError,ie as PlaceBusyError,X as Purchases,D as RealtimeSocket,F as SESSION_START,ae as ScheduledList,I as SessionChangedError,se as ThreadView,K as WebPush,ue as connectVoice,ye as createClient,Ce as encryptedCall,ee as indexedDBKeyValue,Q as isBackendError,q as localStore,j as memoryStore,Y as redemptionToken};
@@ -1,2 +1,2 @@
1
- /*! palbase 0.52.2 — Palbase SDK License (see LICENSE) */
2
- import{a as i}from"../chunks/3ECCMPHK.js";import{a as e,b as s,c as t,d as p,e as o,f as a,h as r,j as n,k as y,p as M,q as l,t as g}from"../chunks/QBPW2ZV2.js";import"../chunks/CNNM6TEU.js";export{n as MESSAGE_COMPONENTS,a as MESSAGE_ICONS,r as MESSAGE_SCHEMA,s as assetId,y as countdownValues,e as fontFamily,o as htmlDocument,t as prepareAssets,i as presentMessage,g as renderMessage,M as resolveMessage,l as resolveMessageWithPaths,p as unzip};
1
+ /*! palbase 0.52.3 — Palbase SDK License (see LICENSE) */
2
+ import{a as i}from"../chunks/5ASDRQ76.js";import{a as e,b as s,c as t,d as p,e as o,f as a,h as r,j as n,k as y,p as M,q as l,t as g}from"../chunks/ZAR57AMM.js";import"../chunks/P2IYCDCP.js";export{n as MESSAGE_COMPONENTS,a as MESSAGE_ICONS,r as MESSAGE_SCHEMA,s as assetId,y as countdownValues,e as fontFamily,o as htmlDocument,t as prepareAssets,i as presentMessage,g as renderMessage,M as resolveMessage,l as resolveMessageWithPaths,p as unzip};
package/dist/web/palbe.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! palbase 0.52.2 — Palbase SDK License (see LICENSE) */
2
- import{c as e,d as r,i as t}from"../chunks/FZYSYMLN.js";import"../chunks/LRBCJG6J.js";import"../chunks/XW72Z3PD.js";import"../chunks/2TJ6G7EB.js";import"../chunks/LIAYIEXX.js";import"../chunks/CS7VS2I4.js";import"../chunks/CNNM6TEU.js";export{e as RESERVED_CLIENT_NAMES,t as __registerBackend,r as isClientName};
1
+ /*! palbase 0.52.3 — Palbase SDK License (see LICENSE) */
2
+ import{c as e,d as r,i as t}from"../chunks/JJC4IE3C.js";import"../chunks/VNMRZXZM.js";import"../chunks/OPXS5CYY.js";import"../chunks/CLFVU67I.js";import"../chunks/UH5Q63EN.js";import"../chunks/2PCDSIWJ.js";import"../chunks/P2IYCDCP.js";export{e as RESERVED_CLIENT_NAMES,t as __registerBackend,r as isClientName};
@@ -1,2 +1,2 @@
1
- /*! palbase 0.52.2 — Palbase SDK License (see LICENSE) */
2
- import{a as f,b as d,c as m,d as u,e as A,f as c,g as R}from"../chunks/7MZR43VA.js";import{a as e,b as a,c as t,d as l,e as r,f as o,g as p,i as y,k as s,l as P,n,o as i,s as w}from"../chunks/QBPW2ZV2.js";import"../chunks/LIAYIEXX.js";import"../chunks/CS7VS2I4.js";import"../chunks/CNNM6TEU.js";export{y as PAYWALL_COMPONENTS,o as PAYWALL_ICONS,p as PAYWALL_SCHEMA,c as Paywall,a as assetId,f as attributesHeader,s as countdownValues,R as defaultPaywall,e as fontFamily,u as formatPeriod,m as formatPrice,r as htmlDocument,A as packageValues,P as packagesOf,d as parseDuration,t as prepareAssets,w as renderPaywall,n as resolvePaywall,i as resolvePaywallWithPaths,l as unzip};
1
+ /*! palbase 0.52.3 — Palbase SDK License (see LICENSE) */
2
+ import{a as f,b as d,c as m,d as u,e as A,f as c,g as R}from"../chunks/MFQQUKVA.js";import{a as e,b as a,c as t,d as l,e as r,f as o,g as p,i as y,k as s,l as P,n,o as i,s as w}from"../chunks/ZAR57AMM.js";import"../chunks/UH5Q63EN.js";import"../chunks/2PCDSIWJ.js";import"../chunks/P2IYCDCP.js";export{y as PAYWALL_COMPONENTS,o as PAYWALL_ICONS,p as PAYWALL_SCHEMA,c as Paywall,a as assetId,f as attributesHeader,s as countdownValues,R as defaultPaywall,e as fontFamily,u as formatPeriod,m as formatPrice,r as htmlDocument,A as packageValues,P as packagesOf,d as parseDuration,t as prepareAssets,w as renderPaywall,n as resolvePaywall,i as resolvePaywallWithPaths,l as unzip};
@@ -1,2 +1,2 @@
1
- /*! palbase 0.52.2 — Palbase SDK License (see LICENSE) */
1
+ /*! palbase 0.52.3 — Palbase SDK License (see LICENSE) */
2
2
  "use strict";(()=>{function g(t,l){if(t)try{let o=new URL(t,l);if(o.protocol==="https:"||o.protocol==="http:"&&(o.hostname==="localhost"||o.hostname==="127.0.0.1"))return o.href}catch{}}function w(t){let l=new URL(t.location.href).searchParams,o=l.get("url")??"",p=l.get("key")??"",c=(e,n)=>!e||!o?Promise.resolve():t.fetch(`${o.replace(/\/$/,"")}/notify/receipts`,{method:"POST",headers:{"content-type":"application/json",apikey:p},body:JSON.stringify({receipts:[{receipt:e,status:n}]}),keepalive:!0}).catch(()=>{}),f=async(e,n)=>{for(let s of await t.clients.matchAll({type:"window",includeUncontrolled:!0}))s.postMessage({type:"palbase.push",event:e,url:n.url,data:n.data})};t.addEventListener("push",(e=>{let n={};try{n=e.data?.json()??{}}catch{}let s={url:n.url,receipt:n.receipt,data:n.data},a=n.data?.type==="messaging.message"||n.data?.pb_call==="incoming",u=async()=>a&&(await t.clients.matchAll({type:"window",includeUncontrolled:!0})).some(i=>i.focused===!0),r=async()=>{let i=n.data?.pb_call==="missed"?n.data.call_id:void 0;if(i)for(let d of await t.registration.getNotifications?.({tag:i})??[])d.close()};e.waitUntil(Promise.all([u(),r().catch(()=>{})]).then(([i])=>i?void 0:t.registration.showNotification(n.title??"",{body:n.body,image:n.image,tag:n.tag,data:s})).then(()=>Promise.all([c(n.receipt,"delivered"),f("received",s)])))})),t.addEventListener("notificationclick",(e=>{e.notification.close();let n=e.notification.data??{},s=n.data?.pb_call!==void 0,a=g(n.url,t.location.origin)??(s?g(t.registration.scope??"/",t.location.origin):void 0),u=async()=>{if(!a)return;let r=await t.clients.matchAll({type:"window",includeUncontrolled:!0}),i=r.find(d=>d.url===a)??(s&&!n.url?r.find(d=>d.focused)??r[0]:void 0);i?await i.focus():await t.clients.openWindow(a)};e.waitUntil(Promise.all([c(n.receipt,"opened"),u(),f("opened",n)]))})),t.addEventListener("notificationclose",(e=>{e.waitUntil(c(e.notification.data?.receipt,"dismissed"))}))}typeof self<"u"&&typeof self.registration=="object"&&!("document"in self)&&w(self);})();
package/dist/web/ssr.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! palbase 0.52.2 — Palbase SDK License (see LICENSE) */
2
- import{B as g}from"../chunks/6KUEOXTD.js";import"../chunks/FZYSYMLN.js";import"../chunks/LRBCJG6J.js";import"../chunks/7MZR43VA.js";import"../chunks/3ECCMPHK.js";import"../chunks/QBPW2ZV2.js";import"../chunks/XW72Z3PD.js";import"../chunks/WBQBWQEG.js";import"../chunks/2TJ6G7EB.js";import"../chunks/LIAYIEXX.js";import"../chunks/CS7VS2I4.js";import"../chunks/CNNM6TEU.js";var A=Object.freeze({"Cache-Control":"private, no-cache, no-store, must-revalidate, max-age=0",Expires:"0",Pragma:"no-cache"}),x={path:"/",sameSite:"lax",secure:!0,httpOnly:!1,maxAge:400*24*60*60},h=3180,$=5*6e4;function b(e,t={}){let s=/^pb_([a-z0-9]+)_c/.exec(e)?.[1];if(s===void 0)throw new TypeError("publishableKey is the project publishable key (pb_<ref>_c\u2026)");let o={...x,...t};return`${o.secure===!0&&!o.domain&&(o.path??"/")==="/"?"__Host-":""}pb-${s}-session`}var v=e=>{let t=new TextEncoder().encode(JSON.stringify(e)),s="";for(let o of t)s+=String.fromCharCode(o);return btoa(s).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},_=e=>{try{let t=atob(e.replace(/-/g,"+").replace(/_/g,"/")),s=JSON.parse(new TextDecoder().decode(Uint8Array.from(t,o=>o.charCodeAt(0))));return typeof s.accessToken!="string"||typeof s.refreshToken!="string"||typeof s.expiresAt!="number"||typeof s.userId!="string"?null:s}catch{return null}},f="__Host-",C=!1;function w(e,t,s={},o=!1){let r={...x,...s},d=async()=>new Map((await t.getAll()).map(n=>[n.name,n.value])),m=n=>a=>a===n||a.startsWith(`${n}.`)&&/^\d+$/.test(a.slice(n.length+1)),S=m(e),k=e.startsWith(f)?e.slice(f.length):f+e,O=m(k),y=async n=>{if(!t.setAll)return;let a=n===null?[]:n.length<=h?[[e,n]]:Array.from({length:Math.ceil(n.length/h)},(i,u)=>[`${e}.${u}`,n.slice(u*h,(u+1)*h)]),l=new Set(a.map(([i])=>i)),c=a.map(([i,u])=>({name:i,value:u,options:r})),p=await d();for(let i of p.keys())S(i)&&!l.has(i)&&c.push({name:i,value:"",options:{...r,maxAge:0}});if(e.startsWith(f))for(let i of p.keys())O(i)&&c.push({name:i,value:"",options:{...r,maxAge:0}});c.length>0&&await t.setAll(c,{...A})};return{async load(){let n=await d(),a=[...n.keys()];!C&&!a.some(S)&&a.some(O)&&(C=!0,console.warn(`palbase: the request holds a session cookie named ${k}, and this client reads ${e}: no one is signed in here. The browser's client and the server's name it from the same cookieOptions \u2014 on http (localhost) the server's needs cookieOptions: { secure: false }.`));let l=n.get(e);if(l===void 0){let c="";for(let p=0;n.has(`${e}.${p}`);p++)c+=n.get(`${e}.${p}`);l=c}return l?_(l):null},save:n=>y(v(n)),clear:()=>y(null),shared:o}}function P(e){let{cookies:t,cookieOptions:s,...o}=e,r=e.refresh??(t.setAll?"before":"never");return g({...o,refresh:r,storage:w(b(e.publishableKey,s),t,s)})}function T(){let e=()=>{let t=globalThis.document;if(!t)throw new Error("documentCookies: there is no document here \u2014 a server gives its request's cookies to createServerClient");return t};return{getAll:()=>e().cookie.split(";").map(t=>t.trim()).filter(t=>t.includes("=")).map(t=>{let s=t.indexOf("=");return{name:t.slice(0,s),value:t.slice(s+1)}}),setAll(t){for(let s of t){let o=s.options,r=[`Path=${o.path??"/"}`,o.domain?`Domain=${o.domain}`:"",o.maxAge!==void 0?`Max-Age=${o.maxAge}`:"",o.expires?`Expires=${o.expires.toUTCString()}`:"",o.sameSite?`SameSite=${o.sameSite.charAt(0).toUpperCase()}${o.sameSite.slice(1)}`:"",o.secure?"Secure":""].filter(Boolean);e().cookie=[`${s.name}=${s.value}`,...r].join("; ")}}}}function M(e){let{cookieOptions:t,...s}=e,r={secure:globalThis.location?.protocol==="https:",...t};return g({...s,storage:w(b(e.publishableKey,r),T(),r,!0)})}async function N(e){let t=await e.auth.currentSession();if(!t||(t.expiresAt-Date.now()<=$&&await e.auth.refreshSession().catch(()=>{}),!await e.auth.currentSession()))return null;try{return(await e.auth.api.verifyTokenUser()).data}catch(s){if(s.status===401)return null;throw s}}export{A as NO_STORE_HEADERS,x as SESSION_COOKIE_OPTIONS,w as cookieSessionStore,M as createBrowserClient,P as createServerClient,T as documentCookies,N as keepSession,b as sessionCookieName};
1
+ /*! palbase 0.52.3 — Palbase SDK License (see LICENSE) */
2
+ import{B as g}from"../chunks/57HMBEZC.js";import"../chunks/JJC4IE3C.js";import"../chunks/VNMRZXZM.js";import"../chunks/MFQQUKVA.js";import"../chunks/5ASDRQ76.js";import"../chunks/ZAR57AMM.js";import"../chunks/OPXS5CYY.js";import"../chunks/IAEVNAIO.js";import"../chunks/CLFVU67I.js";import"../chunks/UH5Q63EN.js";import"../chunks/2PCDSIWJ.js";import"../chunks/P2IYCDCP.js";var A=Object.freeze({"Cache-Control":"private, no-cache, no-store, must-revalidate, max-age=0",Expires:"0",Pragma:"no-cache"}),x={path:"/",sameSite:"lax",secure:!0,httpOnly:!1,maxAge:400*24*60*60},h=3180,$=5*6e4;function b(e,t={}){let s=/^pb_([a-z0-9]+)_c/.exec(e)?.[1];if(s===void 0)throw new TypeError("publishableKey is the project publishable key (pb_<ref>_c\u2026)");let o={...x,...t};return`${o.secure===!0&&!o.domain&&(o.path??"/")==="/"?"__Host-":""}pb-${s}-session`}var v=e=>{let t=new TextEncoder().encode(JSON.stringify(e)),s="";for(let o of t)s+=String.fromCharCode(o);return btoa(s).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},_=e=>{try{let t=atob(e.replace(/-/g,"+").replace(/_/g,"/")),s=JSON.parse(new TextDecoder().decode(Uint8Array.from(t,o=>o.charCodeAt(0))));return typeof s.accessToken!="string"||typeof s.refreshToken!="string"||typeof s.expiresAt!="number"||typeof s.userId!="string"?null:s}catch{return null}},f="__Host-",C=!1;function w(e,t,s={},o=!1){let r={...x,...s},d=async()=>new Map((await t.getAll()).map(n=>[n.name,n.value])),m=n=>a=>a===n||a.startsWith(`${n}.`)&&/^\d+$/.test(a.slice(n.length+1)),S=m(e),k=e.startsWith(f)?e.slice(f.length):f+e,O=m(k),y=async n=>{if(!t.setAll)return;let a=n===null?[]:n.length<=h?[[e,n]]:Array.from({length:Math.ceil(n.length/h)},(i,u)=>[`${e}.${u}`,n.slice(u*h,(u+1)*h)]),l=new Set(a.map(([i])=>i)),c=a.map(([i,u])=>({name:i,value:u,options:r})),p=await d();for(let i of p.keys())S(i)&&!l.has(i)&&c.push({name:i,value:"",options:{...r,maxAge:0}});if(e.startsWith(f))for(let i of p.keys())O(i)&&c.push({name:i,value:"",options:{...r,maxAge:0}});c.length>0&&await t.setAll(c,{...A})};return{async load(){let n=await d(),a=[...n.keys()];!C&&!a.some(S)&&a.some(O)&&(C=!0,console.warn(`palbase: the request holds a session cookie named ${k}, and this client reads ${e}: no one is signed in here. The browser's client and the server's name it from the same cookieOptions \u2014 on http (localhost) the server's needs cookieOptions: { secure: false }.`));let l=n.get(e);if(l===void 0){let c="";for(let p=0;n.has(`${e}.${p}`);p++)c+=n.get(`${e}.${p}`);l=c}return l?_(l):null},save:n=>y(v(n)),clear:()=>y(null),shared:o}}function P(e){let{cookies:t,cookieOptions:s,...o}=e,r=e.refresh??(t.setAll?"before":"never");return g({...o,refresh:r,storage:w(b(e.publishableKey,s),t,s)})}function T(){let e=()=>{let t=globalThis.document;if(!t)throw new Error("documentCookies: there is no document here \u2014 a server gives its request's cookies to createServerClient");return t};return{getAll:()=>e().cookie.split(";").map(t=>t.trim()).filter(t=>t.includes("=")).map(t=>{let s=t.indexOf("=");return{name:t.slice(0,s),value:t.slice(s+1)}}),setAll(t){for(let s of t){let o=s.options,r=[`Path=${o.path??"/"}`,o.domain?`Domain=${o.domain}`:"",o.maxAge!==void 0?`Max-Age=${o.maxAge}`:"",o.expires?`Expires=${o.expires.toUTCString()}`:"",o.sameSite?`SameSite=${o.sameSite.charAt(0).toUpperCase()}${o.sameSite.slice(1)}`:"",o.secure?"Secure":""].filter(Boolean);e().cookie=[`${s.name}=${s.value}`,...r].join("; ")}}}}function M(e){let{cookieOptions:t,...s}=e,r={secure:globalThis.location?.protocol==="https:",...t};return g({...s,storage:w(b(e.publishableKey,r),T(),r,!0)})}async function N(e){let t=await e.auth.currentSession();if(!t||(t.expiresAt-Date.now()<=$&&await e.auth.refreshSession().catch(()=>{}),!await e.auth.currentSession()))return null;try{return(await e.auth.api.verifyTokenUser()).data}catch(s){if(s.status===401)return null;throw s}}export{A as NO_STORE_HEADERS,x as SESSION_COOKIE_OPTIONS,w as cookieSessionStore,M as createBrowserClient,P as createServerClient,T as documentCookies,N as keepSession,b as sessionCookieName};
package/dist/web/vite.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! palbase 0.52.2 — Palbase SDK License (see LICENSE) */
2
- import"../chunks/CNNM6TEU.js";import{execFile as $}from"node:child_process";import{existsSync as y,mkdtempSync as k,readFileSync as S,rmSync as x,writeFileSync as P}from"node:fs";import{createRequire as O}from"node:module";import{tmpdir as W}from"node:os";import{dirname as g,join as o,relative as u,resolve as v,sep as d}from"node:path";var E=/\.(?:ts|js|mts|mjs)$/;function F(n){if(!/^[a-z][a-z0-9-]*$/.test(n.app))throw new TypeError(`palbase({ app }): ${JSON.stringify(n.app)} is an app's slug (palbase apps:list)`);let c=process.cwd(),p="",i="",f=()=>v(c,n.dir??"palbase"),m=()=>{let e=n.environments[p];if(!e)throw new Error(`palbase: the mode "${p}" is not built against any environment \u2014 say which in vite.config: palbase({ environments: { ${JSON.stringify(p)}: '<environment slug>' } })`);return e};return{name:"palbase",enforce:"pre",config(e,s){p=s.mode,i=s.command??"";let r=e.build?.rollupOptions?.onwarn;return{build:{rollupOptions:{onwarn(t,a){let l=String(t.exporter??t.id??"");if(t.code==="MISSING_EXPORT"&&l.includes(`${d}environments${d}`))throw new Error(`palbase: ${t.message} \u2014 ${m()}'s backend has no such route (palbase apps:sync brings what it has)`);r?r(t,a):a(t)}}}}},configResolved(e){c=e.root,p=e.mode,i=e.command??i},async buildStart(){i!=="build"||n.typecheck===!1||await j(c,m(),n.tsconfig)},resolveId(e,s){if(!s)return null;let r=f();if(e==="palbase"||e.startsWith("palbase/")){let w=u(r,s);return w.startsWith("..")||w===""?null:this.resolve(e,o(c,"index.html"),{skipSelf:!0})}if(!(e.startsWith(".")||e.startsWith("/")))return null;let t=v(g(s),e);if(E.test(t)||(t+=".ts"),g(t)!==r&&g(t)!==o(r,"palbe"))return null;let a=u(r,t),l=`${n.app}.ts`;if(a!==l&&!a.startsWith(`palbe${d}`))return null;let h=m(),b=o(r,"environments",h,a===l?l:o("palbe",a.slice(`palbe${d}`.length)));if(!y(b))throw new Error(`palbase: ${u(c,b)} is not there \u2014 palbase apps:sync writes it (is ${n.app} set in ${h}, and has ${h} that machine?)`);return b}}}async function j(n,c,p){let i=p?v(n,p):["tsconfig.app.json","tsconfig.json"].map(e=>o(n,e)).find(y);if(!i)return;if(!y(i))throw new Error(`palbase({ tsconfig }): ${u(n,i)} is not there`);let f;try{let e=O(o(n,"package.json")).resolve("typescript/package.json"),s=JSON.parse(S(e,"utf8")).bin?.tsc;if(!s)throw new Error("no tsc");f=o(g(e),s)}catch{throw new Error("palbase: the build type-checks the app against its environment with the app's TypeScript, and the app has none (npm i -D typescript) \u2014 or say palbase({ typecheck: false })")}let m=k(o(W(),"palbase-typecheck-"));try{let e=o(m,"tsconfig.json");P(e,JSON.stringify({extends:i,compilerOptions:{noEmit:!0,composite:!1,incremental:!1,moduleSuffixes:[`.${c}`,""]}}));let s=await new Promise(r=>$(process.execPath,[f,"-p",e,"--pretty","false"],{cwd:n,maxBuffer:16<<20},(t,a,l)=>r({code:t?typeof t.code=="number"?t.code:1:0,text:`${a}${l}`.trim()})));if(s.code!==0)throw new Error(`palbase: the app does not type-check against ${c}, the environment this build is made for \u2014 a route its backend does not have, or a call that does not fit it:
1
+ /*! palbase 0.52.3 — Palbase SDK License (see LICENSE) */
2
+ import"../chunks/P2IYCDCP.js";import{execFile as $}from"node:child_process";import{existsSync as y,mkdtempSync as k,readFileSync as S,rmSync as x,writeFileSync as P}from"node:fs";import{createRequire as O}from"node:module";import{tmpdir as W}from"node:os";import{dirname as g,join as o,relative as u,resolve as v,sep as d}from"node:path";var E=/\.(?:ts|js|mts|mjs)$/;function F(n){if(!/^[a-z][a-z0-9-]*$/.test(n.app))throw new TypeError(`palbase({ app }): ${JSON.stringify(n.app)} is an app's slug (palbase apps:list)`);let c=process.cwd(),p="",i="",f=()=>v(c,n.dir??"palbase"),m=()=>{let e=n.environments[p];if(!e)throw new Error(`palbase: the mode "${p}" is not built against any environment \u2014 say which in vite.config: palbase({ environments: { ${JSON.stringify(p)}: '<environment slug>' } })`);return e};return{name:"palbase",enforce:"pre",config(e,s){p=s.mode,i=s.command??"";let r=e.build?.rollupOptions?.onwarn;return{build:{rollupOptions:{onwarn(t,a){let l=String(t.exporter??t.id??"");if(t.code==="MISSING_EXPORT"&&l.includes(`${d}environments${d}`))throw new Error(`palbase: ${t.message} \u2014 ${m()}'s backend has no such route (palbase apps:sync brings what it has)`);r?r(t,a):a(t)}}}}},configResolved(e){c=e.root,p=e.mode,i=e.command??i},async buildStart(){i!=="build"||n.typecheck===!1||await j(c,m(),n.tsconfig)},resolveId(e,s){if(!s)return null;let r=f();if(e==="palbase"||e.startsWith("palbase/")){let w=u(r,s);return w.startsWith("..")||w===""?null:this.resolve(e,o(c,"index.html"),{skipSelf:!0})}if(!(e.startsWith(".")||e.startsWith("/")))return null;let t=v(g(s),e);if(E.test(t)||(t+=".ts"),g(t)!==r&&g(t)!==o(r,"palbe"))return null;let a=u(r,t),l=`${n.app}.ts`;if(a!==l&&!a.startsWith(`palbe${d}`))return null;let h=m(),b=o(r,"environments",h,a===l?l:o("palbe",a.slice(`palbe${d}`.length)));if(!y(b))throw new Error(`palbase: ${u(c,b)} is not there \u2014 palbase apps:sync writes it (is ${n.app} set in ${h}, and has ${h} that machine?)`);return b}}}async function j(n,c,p){let i=p?v(n,p):["tsconfig.app.json","tsconfig.json"].map(e=>o(n,e)).find(y);if(!i)return;if(!y(i))throw new Error(`palbase({ tsconfig }): ${u(n,i)} is not there`);let f;try{let e=O(o(n,"package.json")).resolve("typescript/package.json"),s=JSON.parse(S(e,"utf8")).bin?.tsc;if(!s)throw new Error("no tsc");f=o(g(e),s)}catch{throw new Error("palbase: the build type-checks the app against its environment with the app's TypeScript, and the app has none (npm i -D typescript) \u2014 or say palbase({ typecheck: false })")}let m=k(o(W(),"palbase-typecheck-"));try{let e=o(m,"tsconfig.json");P(e,JSON.stringify({extends:i,compilerOptions:{noEmit:!0,composite:!1,incremental:!1,moduleSuffixes:[`.${c}`,""]}}));let s=await new Promise(r=>$(process.execPath,[f,"-p",e,"--pretty","false"],{cwd:n,maxBuffer:16<<20},(t,a,l)=>r({code:t?typeof t.code=="number"?t.code:1:0,text:`${a}${l}`.trim()})));if(s.code!==0)throw new Error(`palbase: the app does not type-check against ${c}, the environment this build is made for \u2014 a route its backend does not have, or a call that does not fit it:
3
3
  ${s.text}`)}finally{x(m,{recursive:!0,force:!0})}}export{F as palbase};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "palbase",
3
- "version": "0.52.2",
3
+ "version": "0.52.3",
4
4
  "description": "Palbase for JavaScript: the web client (palbase/web), the server SDK (palbase/server), an organization's management SDK (palbase/cloud), the backend framework (palbase/backend), AI (palbase/ai) and the CLI (npx palbase).",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "homepage": "https://palbase.studio",
@@ -150,7 +150,7 @@
150
150
  "@types/node": "26.6.4",
151
151
  "bun-types": "1.4.2",
152
152
  "livekit-client": "^2.23.0",
153
- "palgres": "0.52.2",
153
+ "palgres": "0.52.3",
154
154
  "reflect-metadata": "^0.2.2",
155
155
  "typescript": "~6.0.3",
156
156
  "zod": "^4.6.5"
@@ -670,10 +670,10 @@ export type AdminUserExportUser = {
670
670
  updated_at: string;
671
671
  };
672
672
  /**
673
- * A user the call did not write. invalid_* names the field to fix; *_exists names what the project already has (the user, or one of its identities, passkeys or sessions, belongs to another); too_many: the user brings more than a person has (at most 10 recovery codes, 32 identities, 32 passkeys, 16 second factors, 100 sessions); internal_error is ours — send the user again.
673
+ * A user the call did not write. invalid_* names the field to fix; *_exists names what the project already has (the user, or one of its identities, passkeys or sessions, belongs to another); too_many: the user brings more than a person has (at most 10 recovery codes, 32 identities, 32 passkeys, 16 second factors, 100 sessions); passkey_address_moved and passkey_address_unavailable: where the environment's passkeys are saved moved, or could not be decided, while the user was written — send the user again; internal_error is ours — send the user again.
674
674
  */
675
675
  export type AdminUserImportError = {
676
- error: "invalid_id" | "invalid_email" | "invalid_phone" | "invalid_locale" | "invalid_metadata" | "invalid_password_hash" | "invalid_identity" | "invalid_passkey" | "invalid_mfa_factor" | "invalid_recovery_code" | "invalid_session" | "identifier_required" | "user_exists" | "email_exists" | "phone_exists" | "identity_exists" | "passkey_exists" | "session_exists" | "too_many" | "conflict" | "internal_error";
676
+ error: "invalid_id" | "invalid_email" | "invalid_phone" | "invalid_locale" | "invalid_metadata" | "invalid_password_hash" | "invalid_identity" | "invalid_passkey" | "invalid_mfa_factor" | "invalid_recovery_code" | "invalid_session" | "identifier_required" | "user_exists" | "email_exists" | "phone_exists" | "identity_exists" | "passkey_exists" | "passkey_address_moved" | "passkey_address_unavailable" | "session_exists" | "too_many" | "conflict" | "internal_error";
677
677
  /**
678
678
  * The user's id as sent.
679
679
  */
@@ -5045,10 +5045,13 @@ export declare function client(t: Transport): {
5045
5045
  *
5046
5046
  * Always returns 200 (enumeration prevention). When the email
5047
5047
  * belongs to an account the server emails a single-use signed link
5048
- * / OTP. Subject to per-IP rate limiting.
5049
- *
5048
+ * / OTP. Subject to per-IP rate limiting. Asks a proof of work first (403 `pow_required`, which the SDKs solve), its difficulty rising when the project's attempts surge: a bot that posts it in a loop pays seconds a request.
5050
5049
  */
5051
5050
  magicLinkRequest(input: {
5051
+ headers?: {
5052
+ "X-PoW-Challenge-ID"?: string; /** The nonce that solves it. */
5053
+ "X-PoW-Nonce"?: string;
5054
+ };
5052
5055
  body: MagicLinkRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
5053
5056
  signal?: AbortSignal;
5054
5057
  }): Promise<Reply<200, SuccessResponse>>;
@@ -5489,10 +5492,13 @@ export declare function client(t: Transport): {
5489
5492
  *
5490
5493
  * Always returns 200 (enumeration prevention). The plain-text
5491
5494
  * request never reveals whether the email is registered. Subject to
5492
- * rate limiting (3 per 15 min per account).
5493
- *
5495
+ * rate limiting (3 per 15 min per account). Asks a proof of work first (403 `pow_required`, which the SDKs solve), its difficulty rising when the project's attempts surge: a bot that posts it in a loop pays seconds a request.
5494
5496
  */
5495
5497
  passwordResetRequest(input: {
5498
+ headers?: {
5499
+ "X-PoW-Challenge-ID"?: string; /** The nonce that solves it. */
5500
+ "X-PoW-Nonce"?: string;
5501
+ };
5496
5502
  body: PasswordResetRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
5497
5503
  signal?: AbortSignal;
5498
5504
  }): Promise<Reply<200, SuccessResponse>>;
@@ -5603,10 +5609,13 @@ export declare function client(t: Transport): {
5603
5609
  * Initiate trusted-contact recovery
5604
5610
  *
5605
5611
  * Start a trusted-contact account recovery for the named user.
5606
- * Sends approval tokens to each verified contact.
5607
- *
5612
+ * Sends approval tokens to each verified contact. Asks a proof of work first (403 `pow_required`, which the SDKs solve), its difficulty rising when the project's attempts surge: a bot that posts it in a loop pays seconds a request.
5608
5613
  */
5609
5614
  initiateRecovery(input: {
5615
+ headers?: {
5616
+ "X-PoW-Challenge-ID"?: string; /** The nonce that solves it. */
5617
+ "X-PoW-Nonce"?: string;
5618
+ };
5610
5619
  body: InitiateRecoveryRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
5611
5620
  signal?: AbortSignal;
5612
5621
  }): Promise<Reply<200, RecoveryStatus> | Reply<202, RecoveryInitiated>>;
@@ -5627,10 +5636,13 @@ export declare function client(t: Transport): {
5627
5636
  * Always returns 200 with an empty body (enumeration prevention). When the email is
5628
5637
  * bound to an unverified account the server queues a fresh
5629
5638
  * verification email; otherwise the response is identical but no
5630
- * email is sent. The code or link reaches the address by e-mail only.
5631
- *
5639
+ * email is sent. The code or link reaches the address by e-mail only. Asks a proof of work first (403 `pow_required`, which the SDKs solve), its difficulty rising when the project's attempts surge: a bot that posts it in a loop pays seconds a request.
5632
5640
  */
5633
5641
  resendVerification(input: {
5642
+ headers?: {
5643
+ "X-PoW-Challenge-ID"?: string; /** The nonce that solves it. */
5644
+ "X-PoW-Nonce"?: string;
5645
+ };
5634
5646
  body: ResendVerificationRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
5635
5647
  signal?: AbortSignal;
5636
5648
  }): Promise<Reply<200, ResendResult>>;