palbase 0.36.1 → 0.36.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/{H4U6H3OQ.js → 3MGAJ4QB.js} +1 -1
  8. package/dist/chunks/{5A5YCRPV.js → 4KZO2C5H.js} +2 -2
  9. package/dist/chunks/{LZM7DZDZ.js → 4VCY7CWJ.js} +2 -2
  10. package/dist/chunks/{ZBANMLOU.js → 5J224ZLW.js} +1 -1
  11. package/dist/chunks/{KN2GS5WM.js → 5SP42QUJ.js} +2 -2
  12. package/dist/chunks/{M7SGK2KE.js → 6PGRSVYO.js} +2 -2
  13. package/dist/chunks/{QMNURUZN.js → 6UCMNHJR.js} +2 -2
  14. package/dist/chunks/{PORYVJPX.js → AKTUT5UR.js} +2 -2
  15. package/dist/chunks/BGY524G7.js +22 -0
  16. package/dist/chunks/{RR6G2GXT.js → FOODO57K.js} +1 -1
  17. package/dist/chunks/{IYSOKCF4.js → GPCVPQRD.js} +2 -2
  18. package/dist/chunks/{VAC32QIB.js → HPMVVGYC.js} +2 -2
  19. package/dist/chunks/{ICTHOHDI.js → JLQ6DNXQ.js} +2 -2
  20. package/dist/chunks/{ID4L4YNL.js → KKJGY76F.js} +2 -2
  21. package/dist/chunks/{4XFRN45H.js → MVB43ENS.js} +2 -2
  22. package/dist/chunks/{QAH6YJUC.js → N246ARLY.js} +1 -1
  23. package/dist/chunks/{5XN7I6JA.js → OEWOP7JD.js} +1 -1
  24. package/dist/chunks/{LFNWB4YQ.js → OSMUZCE3.js} +1 -1
  25. package/dist/chunks/{KAUIR66Z.js → PGNK2ATJ.js} +2 -2
  26. package/dist/chunks/{S76G5MS2.js → RWVDZGUN.js} +1 -1
  27. package/dist/chunks/{HBXDBDED.js → U5N652TM.js} +2 -2
  28. package/dist/chunks/{QY5HQFM5.js → UU53ZCFV.js} +2 -2
  29. package/dist/chunks/{YULBKQL2.js → ZBRTF44F.js} +2 -2
  30. package/dist/cli.js +39 -39
  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/cloud/src/generated/studio.d.ts +4 -0
  47. package/types/internal/src/messaging/store.d.ts +11 -2
  48. package/types/internal/src/modules/messaging.d.ts +2 -2
  49. package/types/web/src/messaging.d.ts +1 -0
  50. package/dist/chunks/XNR3LADA.js +0 -22
@@ -1,2 +1,2 @@
1
- /*! palbase 0.36.1 — Palbase SDK License (see LICENSE) */
2
- import{a as I}from"../chunks/H4U6H3OQ.js";import{a as P,b as S,c as k,e as A,f as w,g as C,h as T,i as R,j,k as E,l as x,m as D,n as U,o as M}from"../chunks/HBXDBDED.js";import{a as G,b as B}from"../chunks/KN2GS5WM.js";import{b as y,c as r,d as v}from"../chunks/QY5HQFM5.js";import"../chunks/5XN7I6JA.js";import"../chunks/S76G5MS2.js";function L(t){let e=P.client(t),a=S.client(t),s=k.client(t),p=A.client(t),g=w.client(t),m=C.client(t),i=T.client(t),d=R.client(t),l=j.client(t),n=E.client(t),h=x.client(t),c=D.client(t),u=U.client(t),o=M.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,addChatWorkspaceRepo:e.addChatWorkspaceRepo,createEmbeddings:e.createEmbeddings,listEndpoints:e.listEndpoints,putEndpoint:e.putEndpoint,deleteEndpoint:e.deleteEndpoint,createImage:e.createImage,getImage:e.getImage,getImageFile:e.getImageFile,listModels:e.listModels,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:s.adminVerifyDeviceAssertion,adminGetAttestPolicy:s.adminGetAttestPolicy,adminGetAttestObservations:s.adminGetAttestObservations,adminRecordAttestObservations:s.adminRecordAttestObservations,adminListAuditEvents:s.adminListAuditEvents,adminExportAuditEvents:s.adminExportAuditEvents,adminVerifyAuditTrail:s.adminVerifyAuditTrail,adminGetAuthSettings:s.adminGetAuthSettings,adminUpdateAuthSettings:s.adminUpdateAuthSettings,adminGetBreachWatch:s.adminGetBreachWatch,adminListHooks:s.adminListHooks,adminCreateHook:s.adminCreateHook,adminUpdateHook:s.adminUpdateHook,adminDeleteHook:s.adminDeleteHook,adminListHookExecutions:s.adminListHookExecutions,adminListIntegrations:s.adminListIntegrations,adminPutIntegration:s.adminPutIntegration,adminDeleteIntegration:s.adminDeleteIntegration,adminListOAuthClients:s.adminListOAuthClients,adminCreateOAuthClient:s.adminCreateOAuthClient,adminGetOAuthClient:s.adminGetOAuthClient,adminDeleteOAuthClient:s.adminDeleteOAuthClient,adminUpdateOAuthClient:s.adminUpdateOAuthClient,adminListProviders:s.adminListProviders,adminGetPhoneSettings:s.adminGetPhoneSettings,adminUpdatePhoneSettings:s.adminUpdatePhoneSettings,adminToggleProvider:s.adminToggleProvider,adminListRoles:s.adminListRoles,adminUpsertRole:s.adminUpsertRole,adminDeleteRole:s.adminDeleteRole,adminListServiceAccounts:s.adminListServiceAccounts,adminCreateServiceAccount:s.adminCreateServiceAccount,adminGetServiceAccount:s.adminGetServiceAccount,adminRevokeServiceAccount:s.adminRevokeServiceAccount,adminRotateServiceAccount:s.adminRotateServiceAccount,adminListSessions:s.adminListSessions,adminRevokeSession:s.adminRevokeSession,adminListSigningKeys:s.adminListSigningKeys,adminRotateSigningKey:s.adminRotateSigningKey,socialAdminConfig:s.socialAdminConfig,socialCredentialPut:s.socialCredentialPut,socialCredentialDelete:s.socialCredentialDelete,socialProviderPatch:s.socialProviderPatch,adminGetStats:s.adminGetStats,adminSendTestTemplate:s.adminSendTestTemplate,adminListTestUsers:s.adminListTestUsers,adminCreateTestUsers:s.adminCreateTestUsers,adminSetTestUserPhone:s.adminSetTestUserPhone,adminCreateTestSignupAddress:s.adminCreateTestSignupAddress,adminDeleteTestUser:s.adminDeleteTestUser,adminCreateCustomToken:s.adminCreateCustomToken,adminListUsers:s.adminListUsers,adminCreateUser:s.adminCreateUser,adminImportUsers:s.adminImportUsers,adminGetUser:s.adminGetUser,adminDeleteUser:s.adminDeleteUser,adminUpdateUser:s.adminUpdateUser,adminBanUser:s.adminBanUser,adminGetUserConsents:s.adminGetUserConsents,adminRevokeUserCredentials:s.adminRevokeUserCredentials,adminExportUser:s.adminExportUser,adminListUserMfaFactors:s.adminListUserMfaFactors,adminResetUserMfa:s.adminResetUserMfa,adminResetUserPassword:s.adminResetUserPassword,adminListUserRoles:s.adminListUserRoles,adminAssignUserRole:s.adminAssignUserRole,adminRevokeUserRole:s.adminRevokeUserRole,adminRevokeUserSessions:s.adminRevokeUserSessions,adminUnbanUser:s.adminUnbanUser,adminGetInstallationConsents:s.adminGetInstallationConsents,adminRefuseConsents:s.adminRefuseConsents},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:i.listMachines,createMachine:i.createMachine,listMachineSizes:i.listMachineSizes,getMachineNetwork:i.getMachineNetwork,connectGitHub:i.connectGitHub,listInstallations:i.listInstallations,linkInstallation:i.linkInstallation,shareInstallation:i.shareInstallation,unlinkInstallation:i.unlinkInstallation,listRepositories:i.listRepositories,getMachine:i.getMachine,deleteMachine:i.deleteMachine,updateMachine:i.updateMachine,listBuilds:i.listBuilds,deployMachine:i.deployMachine,listMachinePreviews:i.listMachinePreviews,putMachinePreview:i.putMachinePreview,deleteMachinePreview:i.deleteMachinePreview,listMachineDomains:i.listMachineDomains,addMachineDomain:i.addMachineDomain,deleteMachineDomain:i.deleteMachineDomain,updateMachineDomain:i.updateMachineDomain,getBuild:i.getBuild,getBuildLog:i.getBuildLog,rollbackMachine:i.rollbackMachine,listDatabases:i.listDatabases,createDatabase:i.createDatabase,listDatabaseSizes:i.listDatabaseSizes,getDatabase:i.getDatabase,deleteDatabase:i.deleteDatabase,updateDatabase:i.updateDatabase,undeleteDatabase:i.undeleteDatabase,purgeDatabase:i.purgeDatabase,getDatabaseCredentials:i.getDatabaseCredentials,changeDatabasePassword:i.changeDatabasePassword,readMachineLogs:i.readMachineLogs,getMachineMetrics:i.getMachineMetrics,getMachineContract:i.getMachineContract,restoreDatabase:i.restoreDatabase,getDatabaseSchema:i.getDatabaseSchema,getDatabaseMetrics:i.getDatabaseMetrics,queryDatabase:i.queryDatabase,listCrons:i.listCrons,listCronRuns:i.listCronRuns,runCron:i.runCron,pauseCron:i.pauseCron,resumeCron:i.resumeCron,listTasks:i.listTasks,enqueueTask:i.enqueueTask,getTask:i.getTask,cancelTask:i.cancelTask,retryTask:i.retryTask,listTaskTypes:i.listTaskTypes,makeTemplatedTestUsers:i.makeTemplatedTestUsers,templateTestUser:i.templateTestUser,deleteTemplatedTestUser:i.deleteTemplatedTestUser,listSites:i.listSites,createSite:i.createSite,getSite:i.getSite,deleteSite:i.deleteSite,updateSite:i.updateSite,listSiteReleases:i.listSiteReleases,createSiteRelease:i.createSiteRelease,uploadSiteFile:i.uploadSiteFile,finishSiteRelease:i.finishSiteRelease,rollbackSite:i.rollbackSite,listSiteBuilds:i.listSiteBuilds,deploySite:i.deploySite,listSitePreviews:i.listSitePreviews,listSiteDomains:i.listSiteDomains,addSiteDomain:i.addSiteDomain,deleteSiteDomain:i.deleteSiteDomain,updateSiteDomain:i.updateSiteDomain,getSiteBuild:i.getSiteBuild,authorizeSitePreview:i.authorizeSitePreview,authorizeMachinePreview:i.authorizeMachinePreview,openMachinePreview:i.openMachinePreview},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:n.getAppleAccount,disconnectApple:n.disconnectApple,createAppleGrant:n.createAppleGrant,getAppleReadiness:n.getAppleReadiness,setXcodeCertificate:n.setXcodeCertificate,clearXcodeCertificate:n.clearXcodeCertificate,getGoogleAccount:n.getGoogleAccount,connectGoogle:n.connectGoogle,disconnectGoogle:n.disconnectGoogle,getCatalog:n.getCatalog,saveCatalog:n.saveCatalog,planCatalog:n.planCatalog,getCatalogPlan:n.getCatalogPlan,confirmCatalogPlan:n.confirmCatalogPlan,declineCatalogPlan:n.declineCatalogPlan,validateCatalog:n.validateCatalog,listCharts:n.listCharts,getChartsOverview:n.getChartsOverview,getChart:n.getChart,getCustomer:n.getCustomer,grantCredits:n.grantCredits,listCreditEntries:n.listCreditEntries,forgiveCredits:n.forgiveCredits,listCustomerGrants:n.listCustomerGrants,grantEntitlement:n.grantEntitlement,revokeGrant:n.revokeGrant,holdSpend:n.holdSpend,setCustomerLimit:n.setCustomerLimit,clearCustomerLimit:n.clearCustomerLimit,grantLimit:n.grantLimit,spend:n.spend,commitSpend:n.commitSpend,extendHold:n.extendHold,releaseSpend:n.releaseSpend,reverseSpend:n.reverseSpend,listExperiments:n.listExperiments,startExperiment:n.startExperiment,getExperiment:n.getExperiment,getExperimentResults:n.getExperimentResults,stopExperiment:n.stopExperiment,declareExperimentWinner:n.declareExperimentWinner,getOfferings:n.getOfferings,listPaywalls:n.listPaywalls,createPaywall:n.createPaywall,listPaywallAssets:n.listPaywallAssets,registerPaywallAsset:n.registerPaywallAsset,deletePaywallAsset:n.deletePaywallAsset,listPaywallTemplates:n.listPaywallTemplates,getPaywallTemplateAsset:n.getPaywallTemplateAsset,validatePaywall:n.validatePaywall,getPaywall:n.getPaywall,deletePaywall:n.deletePaywall,savePaywallDraft:n.savePaywallDraft,publishPaywall:n.publishPaywall,listPaywallVersions:n.listPaywallVersions,getPaywallVersion:n.getPaywallVersion,listPlacements:n.listPlacements,listAttributeKeys:n.listAttributeKeys,setPlacement:n.setPlacement,deletePlacement:n.deletePlacement,recordPaywallExposure:n.recordPaywallExposure,getPlacementPaywall:n.getPlacementPaywall,previewPlacement:n.previewPlacement,getPlacementResults:n.getPlacementResults,getPlacementRules:n.getPlacementRules,setPlacementRules:n.setPlacementRules,getSettings:n.getSettings,updateSettings:n.updateSettings,getStripeAccount:n.getStripeAccount,disconnectStripe:n.disconnectStripe,checkStripeAccount:n.checkStripeAccount,createCheckout:n.createCheckout,createCheckoutRedemption:n.createCheckoutRedemption,createStripeGrant:n.createStripeGrant,createStripeAppInstall:n.createStripeAppInstall,getOfferStats:n.getOfferStats,listCoupons:n.listCoupons,createCoupon:n.createCoupon,getCoupon:n.getCoupon,revokeCoupon:n.revokeCoupon,listCouponCodes:n.listCouponCodes,setXcodeOfferKey:n.setXcodeOfferKey,searchCustomers:n.searchCustomers,getCustomerHistory:n.getCustomerHistory,listCatalogRevisions:n.listCatalogRevisions,getCatalogRevision:n.getCatalogRevision,restoreCatalogRevision:n.restoreCatalogRevision,extendSubscription:n.extendSubscription,refundSubscription:n.refundSubscription,cancelSubscription:n.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,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"},query:e.query,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 environment(e){return t.send({op:"billing.environment",method:"GET",path:"/v1/orgs/"+r("billing.environment","id",e.path.id)+"/billing/environments/"+r("billing.environment","ref",e.path.ref),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/environments/"+r("billing.steer","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 s=>{let p=await e(s),g=s.body?.role,m=s.body?.on_behalf_of;if(g===void 0&&m===void 0)return p;let i=p.data,d=[];if(g!==void 0&&i.role!==g&&d.push(`role ${g} (it came back ${i.role==null?"at its minter's":i.role})`),m!==void 0&&i.on_behalf_of!==m.trim()&&d.push("on_behalf_of"),d.length===0)return p;let l;try{await a({path:{ref:s.path.ref,id:String(i.id)}})}catch(h){l=h}let n=`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: ${n}; the token (${i.id}) was revoked at once and is not returned \u2014 mint it again once Studio is updated`:`environmentTokens.mint: ${n}, and revoking it failed (${l instanceof Error?l.message:String(l)}) \u2014 revoke token ${i.id} of environment ${s.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 W(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 s=X(a),p=(s[b]<<24|s[b+1]<<16|s[b+2]<<8|s[b+3])>>>0;if(Y(e,s.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 W(t)===void 0}function q(t){let e=W(t);if(e!==void 0)throw new TypeError(e)}var $="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function X(t){let e=new Uint8Array(t.length*6/8),a=0,s=0,p=0;for(let g of t)a=a<<6|$.indexOf(g),s+=6,s>=8&&(s-=8,e[p++]=a>>s&255);return e}var z=(()=>{let t=new Uint32Array(256);for(let e=0;e<256;e++){let a=e;for(let s=0;s<8;s++)a=a&1?3988292384^a>>>1:a>>>1;t[e]=a>>>0}return t})();function Y(t,e){let a=4294967295;for(let s=0;s<t.length;s++)a=z[(a^t.charCodeAt(s))&255]^a>>>8;for(let s of e)a=z[(a^s)&255]^a>>>8;return(a^4294967295)>>>0}var F="palbase.studio",Z="palbase";function Q(){let t=globalThis;return typeof t.window<"u"||typeof t.document<"u"||typeof t.importScripts=="function"||I()}var f=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");q(e?.token);let a=e.domain??F;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 s=e.token;this.#e=g=>B(v({baseUrl:g,credentials:{token:s},fetch:e.fetch,solveProofOfWork:!1}),e.retry??G);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{F as DEFAULT_DOMAIN,f as PalbaseCloud,y as PalbaseError,N as tokenIsWellFormed};
1
+ /*! palbase 0.36.3 — Palbase SDK License (see LICENSE) */
2
+ import{a as I}from"../chunks/3MGAJ4QB.js";import{a as P,b as S,c as k,e as A,f as w,g as C,h as T,i as R,j,k as E,l as x,m as D,n as U,o as M}from"../chunks/U5N652TM.js";import{a as G,b as B}from"../chunks/5SP42QUJ.js";import{b as y,c as r,d as v}from"../chunks/UU53ZCFV.js";import"../chunks/OEWOP7JD.js";import"../chunks/RWVDZGUN.js";function L(t){let e=P.client(t),a=S.client(t),s=k.client(t),p=A.client(t),g=w.client(t),m=C.client(t),i=T.client(t),d=R.client(t),l=j.client(t),n=E.client(t),h=x.client(t),c=D.client(t),u=U.client(t),o=M.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,addChatWorkspaceRepo:e.addChatWorkspaceRepo,createEmbeddings:e.createEmbeddings,listEndpoints:e.listEndpoints,putEndpoint:e.putEndpoint,deleteEndpoint:e.deleteEndpoint,createImage:e.createImage,getImage:e.getImage,getImageFile:e.getImageFile,listModels:e.listModels,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:s.adminVerifyDeviceAssertion,adminGetAttestPolicy:s.adminGetAttestPolicy,adminGetAttestObservations:s.adminGetAttestObservations,adminRecordAttestObservations:s.adminRecordAttestObservations,adminListAuditEvents:s.adminListAuditEvents,adminExportAuditEvents:s.adminExportAuditEvents,adminVerifyAuditTrail:s.adminVerifyAuditTrail,adminGetAuthSettings:s.adminGetAuthSettings,adminUpdateAuthSettings:s.adminUpdateAuthSettings,adminGetBreachWatch:s.adminGetBreachWatch,adminListHooks:s.adminListHooks,adminCreateHook:s.adminCreateHook,adminUpdateHook:s.adminUpdateHook,adminDeleteHook:s.adminDeleteHook,adminListHookExecutions:s.adminListHookExecutions,adminListIntegrations:s.adminListIntegrations,adminPutIntegration:s.adminPutIntegration,adminDeleteIntegration:s.adminDeleteIntegration,adminListOAuthClients:s.adminListOAuthClients,adminCreateOAuthClient:s.adminCreateOAuthClient,adminGetOAuthClient:s.adminGetOAuthClient,adminDeleteOAuthClient:s.adminDeleteOAuthClient,adminUpdateOAuthClient:s.adminUpdateOAuthClient,adminListProviders:s.adminListProviders,adminGetPhoneSettings:s.adminGetPhoneSettings,adminUpdatePhoneSettings:s.adminUpdatePhoneSettings,adminToggleProvider:s.adminToggleProvider,adminListRoles:s.adminListRoles,adminUpsertRole:s.adminUpsertRole,adminDeleteRole:s.adminDeleteRole,adminListServiceAccounts:s.adminListServiceAccounts,adminCreateServiceAccount:s.adminCreateServiceAccount,adminGetServiceAccount:s.adminGetServiceAccount,adminRevokeServiceAccount:s.adminRevokeServiceAccount,adminRotateServiceAccount:s.adminRotateServiceAccount,adminListSessions:s.adminListSessions,adminRevokeSession:s.adminRevokeSession,adminListSigningKeys:s.adminListSigningKeys,adminRotateSigningKey:s.adminRotateSigningKey,socialAdminConfig:s.socialAdminConfig,socialCredentialPut:s.socialCredentialPut,socialCredentialDelete:s.socialCredentialDelete,socialProviderPatch:s.socialProviderPatch,adminGetStats:s.adminGetStats,adminSendTestTemplate:s.adminSendTestTemplate,adminListTestUsers:s.adminListTestUsers,adminCreateTestUsers:s.adminCreateTestUsers,adminSetTestUserPhone:s.adminSetTestUserPhone,adminCreateTestSignupAddress:s.adminCreateTestSignupAddress,adminDeleteTestUser:s.adminDeleteTestUser,adminCreateCustomToken:s.adminCreateCustomToken,adminListUsers:s.adminListUsers,adminCreateUser:s.adminCreateUser,adminImportUsers:s.adminImportUsers,adminGetUser:s.adminGetUser,adminDeleteUser:s.adminDeleteUser,adminUpdateUser:s.adminUpdateUser,adminBanUser:s.adminBanUser,adminGetUserConsents:s.adminGetUserConsents,adminRevokeUserCredentials:s.adminRevokeUserCredentials,adminExportUser:s.adminExportUser,adminListUserMfaFactors:s.adminListUserMfaFactors,adminResetUserMfa:s.adminResetUserMfa,adminResetUserPassword:s.adminResetUserPassword,adminListUserRoles:s.adminListUserRoles,adminAssignUserRole:s.adminAssignUserRole,adminRevokeUserRole:s.adminRevokeUserRole,adminRevokeUserSessions:s.adminRevokeUserSessions,adminUnbanUser:s.adminUnbanUser,adminGetInstallationConsents:s.adminGetInstallationConsents,adminRefuseConsents:s.adminRefuseConsents},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:i.listMachines,createMachine:i.createMachine,listMachineSizes:i.listMachineSizes,getMachineNetwork:i.getMachineNetwork,connectGitHub:i.connectGitHub,listInstallations:i.listInstallations,linkInstallation:i.linkInstallation,shareInstallation:i.shareInstallation,unlinkInstallation:i.unlinkInstallation,listRepositories:i.listRepositories,getMachine:i.getMachine,deleteMachine:i.deleteMachine,updateMachine:i.updateMachine,listBuilds:i.listBuilds,deployMachine:i.deployMachine,listMachinePreviews:i.listMachinePreviews,putMachinePreview:i.putMachinePreview,deleteMachinePreview:i.deleteMachinePreview,listMachineDomains:i.listMachineDomains,addMachineDomain:i.addMachineDomain,deleteMachineDomain:i.deleteMachineDomain,updateMachineDomain:i.updateMachineDomain,getBuild:i.getBuild,getBuildLog:i.getBuildLog,rollbackMachine:i.rollbackMachine,listDatabases:i.listDatabases,createDatabase:i.createDatabase,listDatabaseSizes:i.listDatabaseSizes,getDatabase:i.getDatabase,deleteDatabase:i.deleteDatabase,updateDatabase:i.updateDatabase,undeleteDatabase:i.undeleteDatabase,purgeDatabase:i.purgeDatabase,getDatabaseCredentials:i.getDatabaseCredentials,changeDatabasePassword:i.changeDatabasePassword,readMachineLogs:i.readMachineLogs,getMachineMetrics:i.getMachineMetrics,getMachineContract:i.getMachineContract,restoreDatabase:i.restoreDatabase,getDatabaseSchema:i.getDatabaseSchema,getDatabaseMetrics:i.getDatabaseMetrics,queryDatabase:i.queryDatabase,listCrons:i.listCrons,listCronRuns:i.listCronRuns,runCron:i.runCron,pauseCron:i.pauseCron,resumeCron:i.resumeCron,listTasks:i.listTasks,enqueueTask:i.enqueueTask,getTask:i.getTask,cancelTask:i.cancelTask,retryTask:i.retryTask,listTaskTypes:i.listTaskTypes,makeTemplatedTestUsers:i.makeTemplatedTestUsers,templateTestUser:i.templateTestUser,deleteTemplatedTestUser:i.deleteTemplatedTestUser,listSites:i.listSites,createSite:i.createSite,getSite:i.getSite,deleteSite:i.deleteSite,updateSite:i.updateSite,listSiteReleases:i.listSiteReleases,createSiteRelease:i.createSiteRelease,uploadSiteFile:i.uploadSiteFile,finishSiteRelease:i.finishSiteRelease,rollbackSite:i.rollbackSite,listSiteBuilds:i.listSiteBuilds,deploySite:i.deploySite,listSitePreviews:i.listSitePreviews,listSiteDomains:i.listSiteDomains,addSiteDomain:i.addSiteDomain,deleteSiteDomain:i.deleteSiteDomain,updateSiteDomain:i.updateSiteDomain,getSiteBuild:i.getSiteBuild,authorizeSitePreview:i.authorizeSitePreview,authorizeMachinePreview:i.authorizeMachinePreview,openMachinePreview:i.openMachinePreview},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:n.getAppleAccount,disconnectApple:n.disconnectApple,createAppleGrant:n.createAppleGrant,getAppleReadiness:n.getAppleReadiness,setXcodeCertificate:n.setXcodeCertificate,clearXcodeCertificate:n.clearXcodeCertificate,getGoogleAccount:n.getGoogleAccount,connectGoogle:n.connectGoogle,disconnectGoogle:n.disconnectGoogle,getCatalog:n.getCatalog,saveCatalog:n.saveCatalog,planCatalog:n.planCatalog,getCatalogPlan:n.getCatalogPlan,confirmCatalogPlan:n.confirmCatalogPlan,declineCatalogPlan:n.declineCatalogPlan,validateCatalog:n.validateCatalog,listCharts:n.listCharts,getChartsOverview:n.getChartsOverview,getChart:n.getChart,getCustomer:n.getCustomer,grantCredits:n.grantCredits,listCreditEntries:n.listCreditEntries,forgiveCredits:n.forgiveCredits,listCustomerGrants:n.listCustomerGrants,grantEntitlement:n.grantEntitlement,revokeGrant:n.revokeGrant,holdSpend:n.holdSpend,setCustomerLimit:n.setCustomerLimit,clearCustomerLimit:n.clearCustomerLimit,grantLimit:n.grantLimit,spend:n.spend,commitSpend:n.commitSpend,extendHold:n.extendHold,releaseSpend:n.releaseSpend,reverseSpend:n.reverseSpend,listExperiments:n.listExperiments,startExperiment:n.startExperiment,getExperiment:n.getExperiment,getExperimentResults:n.getExperimentResults,stopExperiment:n.stopExperiment,declareExperimentWinner:n.declareExperimentWinner,getOfferings:n.getOfferings,listPaywalls:n.listPaywalls,createPaywall:n.createPaywall,listPaywallAssets:n.listPaywallAssets,registerPaywallAsset:n.registerPaywallAsset,deletePaywallAsset:n.deletePaywallAsset,listPaywallTemplates:n.listPaywallTemplates,getPaywallTemplateAsset:n.getPaywallTemplateAsset,validatePaywall:n.validatePaywall,getPaywall:n.getPaywall,deletePaywall:n.deletePaywall,savePaywallDraft:n.savePaywallDraft,publishPaywall:n.publishPaywall,listPaywallVersions:n.listPaywallVersions,getPaywallVersion:n.getPaywallVersion,listPlacements:n.listPlacements,listAttributeKeys:n.listAttributeKeys,setPlacement:n.setPlacement,deletePlacement:n.deletePlacement,recordPaywallExposure:n.recordPaywallExposure,getPlacementPaywall:n.getPlacementPaywall,previewPlacement:n.previewPlacement,getPlacementResults:n.getPlacementResults,getPlacementRules:n.getPlacementRules,setPlacementRules:n.setPlacementRules,getSettings:n.getSettings,updateSettings:n.updateSettings,getStripeAccount:n.getStripeAccount,disconnectStripe:n.disconnectStripe,checkStripeAccount:n.checkStripeAccount,createCheckout:n.createCheckout,createCheckoutRedemption:n.createCheckoutRedemption,createStripeGrant:n.createStripeGrant,createStripeAppInstall:n.createStripeAppInstall,getOfferStats:n.getOfferStats,listCoupons:n.listCoupons,createCoupon:n.createCoupon,getCoupon:n.getCoupon,revokeCoupon:n.revokeCoupon,listCouponCodes:n.listCouponCodes,setXcodeOfferKey:n.setXcodeOfferKey,searchCustomers:n.searchCustomers,getCustomerHistory:n.getCustomerHistory,listCatalogRevisions:n.listCatalogRevisions,getCatalogRevision:n.getCatalogRevision,restoreCatalogRevision:n.restoreCatalogRevision,extendSubscription:n.extendSubscription,refundSubscription:n.refundSubscription,cancelSubscription:n.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,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"},query:e.query,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 environment(e){return t.send({op:"billing.environment",method:"GET",path:"/v1/orgs/"+r("billing.environment","id",e.path.id)+"/billing/environments/"+r("billing.environment","ref",e.path.ref),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/environments/"+r("billing.steer","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 s=>{let p=await e(s),g=s.body?.role,m=s.body?.on_behalf_of;if(g===void 0&&m===void 0)return p;let i=p.data,d=[];if(g!==void 0&&i.role!==g&&d.push(`role ${g} (it came back ${i.role==null?"at its minter's":i.role})`),m!==void 0&&i.on_behalf_of!==m.trim()&&d.push("on_behalf_of"),d.length===0)return p;let l;try{await a({path:{ref:s.path.ref,id:String(i.id)}})}catch(h){l=h}let n=`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: ${n}; the token (${i.id}) was revoked at once and is not returned \u2014 mint it again once Studio is updated`:`environmentTokens.mint: ${n}, and revoking it failed (${l instanceof Error?l.message:String(l)}) \u2014 revoke token ${i.id} of environment ${s.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 W(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 s=X(a),p=(s[b]<<24|s[b+1]<<16|s[b+2]<<8|s[b+3])>>>0;if(Y(e,s.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 W(t)===void 0}function q(t){let e=W(t);if(e!==void 0)throw new TypeError(e)}var $="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function X(t){let e=new Uint8Array(t.length*6/8),a=0,s=0,p=0;for(let g of t)a=a<<6|$.indexOf(g),s+=6,s>=8&&(s-=8,e[p++]=a>>s&255);return e}var z=(()=>{let t=new Uint32Array(256);for(let e=0;e<256;e++){let a=e;for(let s=0;s<8;s++)a=a&1?3988292384^a>>>1:a>>>1;t[e]=a>>>0}return t})();function Y(t,e){let a=4294967295;for(let s=0;s<t.length;s++)a=z[(a^t.charCodeAt(s))&255]^a>>>8;for(let s of e)a=z[(a^s)&255]^a>>>8;return(a^4294967295)>>>0}var F="palbase.studio",Z="palbase";function Q(){let t=globalThis;return typeof t.window<"u"||typeof t.document<"u"||typeof t.importScripts=="function"||I()}var f=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");q(e?.token);let a=e.domain??F;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 s=e.token;this.#e=g=>B(v({baseUrl:g,credentials:{token:s},fetch:e.fetch,solveProofOfWork:!1}),e.retry??G);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{F as DEFAULT_DOMAIN,f as PalbaseCloud,y as PalbaseError,N as tokenIsWellFormed};
package/dist/refuse/ai.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! palbase 0.36.1 — Palbase SDK License (see LICENSE) */
1
+ /*! palbase 0.36.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.36.1 — Palbase SDK License (see LICENSE) */
1
+ /*! palbase 0.36.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.36.1 — Palbase SDK License (see LICENSE) */
1
+ /*! palbase 0.36.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.36.1 — Palbase SDK License (see LICENSE) */
1
+ /*! palbase 0.36.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.36.1 — 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/VAC32QIB.js";import{a as c,b as d}from"../chunks/ZBANMLOU.js";import"../chunks/RR6G2GXT.js";import"../chunks/H4U6H3OQ.js";import{p as b}from"../chunks/HBXDBDED.js";import"../chunks/KN2GS5WM.js";import{b as a}from"../chunks/QY5HQFM5.js";import"../chunks/5XN7I6JA.js";import"../chunks/S76G5MS2.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.36.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/HPMVVGYC.js";import{a as c,b as d}from"../chunks/5J224ZLW.js";import"../chunks/FOODO57K.js";import"../chunks/3MGAJ4QB.js";import{p as b}from"../chunks/U5N652TM.js";import"../chunks/5SP42QUJ.js";import{b as a}from"../chunks/UU53ZCFV.js";import"../chunks/OEWOP7JD.js";import"../chunks/RWVDZGUN.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.36.1 — Palbase SDK License (see LICENSE) */
2
- import{a,b,c,d,e}from"../chunks/4XFRN45H.js";import"../chunks/ZBANMLOU.js";import"../chunks/5XN7I6JA.js";import"../chunks/S76G5MS2.js";export{b as TestApiError,e as api,c as createTestApi,a as testFields,d as testRun};
1
+ /*! palbase 0.36.3 — Palbase SDK License (see LICENSE) */
2
+ import{a,b,c,d,e}from"../chunks/MVB43ENS.js";import"../chunks/5J224ZLW.js";import"../chunks/OEWOP7JD.js";import"../chunks/RWVDZGUN.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.36.1 — 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/XNR3LADA.js";import{a as _,b as Q,f as z}from"../chunks/LZM7DZDZ.js";import"../chunks/ID4L4YNL.js";import"../chunks/M7SGK2KE.js";import"../chunks/ICTHOHDI.js";import"../chunks/QAH6YJUC.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/RR6G2GXT.js";import"../chunks/HBXDBDED.js";import"../chunks/KN2GS5WM.js";import{b as L}from"../chunks/QY5HQFM5.js";import"../chunks/5XN7I6JA.js";import"../chunks/S76G5MS2.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.36.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/BGY524G7.js";import{a as _,b as Q,f as z}from"../chunks/4VCY7CWJ.js";import"../chunks/KKJGY76F.js";import"../chunks/6PGRSVYO.js";import"../chunks/JLQ6DNXQ.js";import"../chunks/N246ARLY.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/FOODO57K.js";import"../chunks/U5N652TM.js";import"../chunks/5SP42QUJ.js";import{b as L}from"../chunks/UU53ZCFV.js";import"../chunks/OEWOP7JD.js";import"../chunks/RWVDZGUN.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.36.1 — Palbase SDK License (see LICENSE) */
2
- import{a as i}from"../chunks/ICTHOHDI.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/QAH6YJUC.js";import"../chunks/S76G5MS2.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.36.3 — Palbase SDK License (see LICENSE) */
2
+ import{a as i}from"../chunks/JLQ6DNXQ.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/N246ARLY.js";import"../chunks/RWVDZGUN.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.36.1 — Palbase SDK License (see LICENSE) */
2
- import{c as e,d as r,i as t}from"../chunks/LZM7DZDZ.js";import"../chunks/ID4L4YNL.js";import"../chunks/RR6G2GXT.js";import"../chunks/KN2GS5WM.js";import"../chunks/QY5HQFM5.js";import"../chunks/5XN7I6JA.js";import"../chunks/S76G5MS2.js";export{e as RESERVED_CLIENT_NAMES,t as __registerBackend,r as isClientName};
1
+ /*! palbase 0.36.3 — Palbase SDK License (see LICENSE) */
2
+ import{c as e,d as r,i as t}from"../chunks/4VCY7CWJ.js";import"../chunks/KKJGY76F.js";import"../chunks/FOODO57K.js";import"../chunks/5SP42QUJ.js";import"../chunks/UU53ZCFV.js";import"../chunks/OEWOP7JD.js";import"../chunks/RWVDZGUN.js";export{e as RESERVED_CLIENT_NAMES,t as __registerBackend,r as isClientName};
@@ -1,2 +1,2 @@
1
- /*! palbase 0.36.1 — 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/M7SGK2KE.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/QAH6YJUC.js";import"../chunks/QY5HQFM5.js";import"../chunks/5XN7I6JA.js";import"../chunks/S76G5MS2.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.36.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/6PGRSVYO.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/N246ARLY.js";import"../chunks/UU53ZCFV.js";import"../chunks/OEWOP7JD.js";import"../chunks/RWVDZGUN.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.36.1 — Palbase SDK License (see LICENSE) */
1
+ /*! palbase 0.36.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.36.1 — Palbase SDK License (see LICENSE) */
2
- import{B as f}from"../chunks/XNR3LADA.js";import"../chunks/LZM7DZDZ.js";import"../chunks/ID4L4YNL.js";import"../chunks/M7SGK2KE.js";import"../chunks/ICTHOHDI.js";import"../chunks/QAH6YJUC.js";import"../chunks/RR6G2GXT.js";import"../chunks/HBXDBDED.js";import"../chunks/KN2GS5WM.js";import"../chunks/QY5HQFM5.js";import"../chunks/5XN7I6JA.js";import"../chunks/S76G5MS2.js";var C=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},u=3180,k=5*6e4;function d(t){let e=/^pb_([a-z0-9]+)_c/.exec(t)?.[1];if(e===void 0)throw new TypeError("publishableKey is the project publishable key (pb_<ref>_c\u2026)");return`pb-${e}-session`}var y=t=>{let e=new TextEncoder().encode(JSON.stringify(t)),o="";for(let s of e)o+=String.fromCharCode(s);return btoa(o).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},b=t=>{try{let e=atob(t.replace(/-/g,"+").replace(/_/g,"/")),o=JSON.parse(new TextDecoder().decode(Uint8Array.from(e,s=>s.charCodeAt(0))));return typeof o.accessToken!="string"||typeof o.refreshToken!="string"||typeof o.expiresAt!="number"||typeof o.userId!="string"?null:o}catch{return null}};function m(t,e,o={},s=!1){let c={...x,...o},g=async()=>new Map((await e.getAll()).map(n=>[n.name,n.value])),S=n=>n===t||n.startsWith(`${t}.`)&&/^\d+$/.test(n.slice(t.length+1)),h=async n=>{if(!e.setAll)return;let i=n===null?[]:n.length<=u?[[t,n]]:Array.from({length:Math.ceil(n.length/u)},(r,l)=>[`${t}.${l}`,n.slice(l*u,(l+1)*u)]),p=new Set(i.map(([r])=>r)),a=i.map(([r,l])=>({name:r,value:l,options:c}));for(let r of(await g()).keys())S(r)&&!p.has(r)&&a.push({name:r,value:"",options:{...c,maxAge:0}});a.length>0&&await e.setAll(a,{...C})};return{async load(){let n=await g(),i=n.get(t);if(i===void 0){let p="";for(let a=0;n.has(`${t}.${a}`);a++)p+=n.get(`${t}.${a}`);i=p}return i?b(i):null},save:n=>h(y(n)),clear:()=>h(null),shared:s}}function A(t){let{cookies:e,cookieOptions:o,...s}=t,c=t.refresh??(e.setAll?"before":"never");return f({...s,refresh:c,storage:m(d(t.publishableKey),e,o)})}function O(){let t=()=>{let e=globalThis.document;if(!e)throw new Error("documentCookies: there is no document here \u2014 a server gives its request's cookies to createServerClient");return e};return{getAll:()=>t().cookie.split(";").map(e=>e.trim()).filter(e=>e.includes("=")).map(e=>{let o=e.indexOf("=");return{name:e.slice(0,o),value:e.slice(o+1)}}),setAll(e){for(let o of e){let s=o.options,c=[`Path=${s.path??"/"}`,s.domain?`Domain=${s.domain}`:"",s.maxAge!==void 0?`Max-Age=${s.maxAge}`:"",s.expires?`Expires=${s.expires.toUTCString()}`:"",s.sameSite?`SameSite=${s.sameSite.charAt(0).toUpperCase()}${s.sameSite.slice(1)}`:"",s.secure?"Secure":""].filter(Boolean);t().cookie=[`${o.name}=${o.value}`,...c].join("; ")}}}}function $(t){let{cookieOptions:e,...o}=t,s=globalThis.location?.protocol==="https:";return f({...o,storage:m(d(t.publishableKey),O(),{secure:s,...e},!0)})}async function v(t){let e=await t.auth.currentSession();if(!e||(e.expiresAt-Date.now()<=k&&await t.auth.refreshSession().catch(()=>{}),!await t.auth.currentSession()))return null;try{return(await t.auth.api.verifyTokenUser()).data}catch(o){if(o.status===401)return null;throw o}}export{C as NO_STORE_HEADERS,x as SESSION_COOKIE_OPTIONS,m as cookieSessionStore,$ as createBrowserClient,A as createServerClient,O as documentCookies,v as keepSession,d as sessionCookieName};
1
+ /*! palbase 0.36.3 — Palbase SDK License (see LICENSE) */
2
+ import{B as f}from"../chunks/BGY524G7.js";import"../chunks/4VCY7CWJ.js";import"../chunks/KKJGY76F.js";import"../chunks/6PGRSVYO.js";import"../chunks/JLQ6DNXQ.js";import"../chunks/N246ARLY.js";import"../chunks/FOODO57K.js";import"../chunks/U5N652TM.js";import"../chunks/5SP42QUJ.js";import"../chunks/UU53ZCFV.js";import"../chunks/OEWOP7JD.js";import"../chunks/RWVDZGUN.js";var C=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},u=3180,k=5*6e4;function d(t){let e=/^pb_([a-z0-9]+)_c/.exec(t)?.[1];if(e===void 0)throw new TypeError("publishableKey is the project publishable key (pb_<ref>_c\u2026)");return`pb-${e}-session`}var y=t=>{let e=new TextEncoder().encode(JSON.stringify(t)),o="";for(let s of e)o+=String.fromCharCode(s);return btoa(o).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},b=t=>{try{let e=atob(t.replace(/-/g,"+").replace(/_/g,"/")),o=JSON.parse(new TextDecoder().decode(Uint8Array.from(e,s=>s.charCodeAt(0))));return typeof o.accessToken!="string"||typeof o.refreshToken!="string"||typeof o.expiresAt!="number"||typeof o.userId!="string"?null:o}catch{return null}};function m(t,e,o={},s=!1){let c={...x,...o},g=async()=>new Map((await e.getAll()).map(n=>[n.name,n.value])),S=n=>n===t||n.startsWith(`${t}.`)&&/^\d+$/.test(n.slice(t.length+1)),h=async n=>{if(!e.setAll)return;let i=n===null?[]:n.length<=u?[[t,n]]:Array.from({length:Math.ceil(n.length/u)},(r,l)=>[`${t}.${l}`,n.slice(l*u,(l+1)*u)]),p=new Set(i.map(([r])=>r)),a=i.map(([r,l])=>({name:r,value:l,options:c}));for(let r of(await g()).keys())S(r)&&!p.has(r)&&a.push({name:r,value:"",options:{...c,maxAge:0}});a.length>0&&await e.setAll(a,{...C})};return{async load(){let n=await g(),i=n.get(t);if(i===void 0){let p="";for(let a=0;n.has(`${t}.${a}`);a++)p+=n.get(`${t}.${a}`);i=p}return i?b(i):null},save:n=>h(y(n)),clear:()=>h(null),shared:s}}function A(t){let{cookies:e,cookieOptions:o,...s}=t,c=t.refresh??(e.setAll?"before":"never");return f({...s,refresh:c,storage:m(d(t.publishableKey),e,o)})}function O(){let t=()=>{let e=globalThis.document;if(!e)throw new Error("documentCookies: there is no document here \u2014 a server gives its request's cookies to createServerClient");return e};return{getAll:()=>t().cookie.split(";").map(e=>e.trim()).filter(e=>e.includes("=")).map(e=>{let o=e.indexOf("=");return{name:e.slice(0,o),value:e.slice(o+1)}}),setAll(e){for(let o of e){let s=o.options,c=[`Path=${s.path??"/"}`,s.domain?`Domain=${s.domain}`:"",s.maxAge!==void 0?`Max-Age=${s.maxAge}`:"",s.expires?`Expires=${s.expires.toUTCString()}`:"",s.sameSite?`SameSite=${s.sameSite.charAt(0).toUpperCase()}${s.sameSite.slice(1)}`:"",s.secure?"Secure":""].filter(Boolean);t().cookie=[`${o.name}=${o.value}`,...c].join("; ")}}}}function $(t){let{cookieOptions:e,...o}=t,s=globalThis.location?.protocol==="https:";return f({...o,storage:m(d(t.publishableKey),O(),{secure:s,...e},!0)})}async function v(t){let e=await t.auth.currentSession();if(!e||(e.expiresAt-Date.now()<=k&&await t.auth.refreshSession().catch(()=>{}),!await t.auth.currentSession()))return null;try{return(await t.auth.api.verifyTokenUser()).data}catch(o){if(o.status===401)return null;throw o}}export{C as NO_STORE_HEADERS,x as SESSION_COOKIE_OPTIONS,m as cookieSessionStore,$ as createBrowserClient,A as createServerClient,O as documentCookies,v as keepSession,d as sessionCookieName};
package/dist/web/vite.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! palbase 0.36.1 — Palbase SDK License (see LICENSE) */
2
- import"../chunks/S76G5MS2.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.36.3 — Palbase SDK License (see LICENSE) */
2
+ import"../chunks/RWVDZGUN.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.36.1",
3
+ "version": "0.36.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.36.1",
153
+ "palgres": "0.36.3",
154
154
  "reflect-metadata": "^0.2.2",
155
155
  "typescript": "~6.0.3",
156
156
  "zod": "^4.6.5"
@@ -1359,6 +1359,8 @@ export declare function client(t: Transport): {
1359
1359
  unpaid_micros: number;
1360
1360
  past_due_since: string | null;
1361
1361
  free_on: string | null;
1362
+ hold_at_micros: number;
1363
+ hold_eta: string | null;
1362
1364
  held: ("unpaid" | "disputed") | null;
1363
1365
  paid_organizations: number;
1364
1366
  }) | null;
@@ -1625,6 +1627,8 @@ export declare function client(t: Transport): {
1625
1627
  unpaid_micros: number;
1626
1628
  past_due_since: string | null;
1627
1629
  free_on: string | null;
1630
+ hold_at_micros: number;
1631
+ hold_eta: string | null;
1628
1632
  held: ("unpaid" | "disputed") | null;
1629
1633
  paid_organizations: number;
1630
1634
  }) | null;
@@ -83,10 +83,19 @@ export declare class Store {
83
83
  private readTo;
84
84
  /** The reader's place in a thread, read up to `to`: what the store has of its answers up to there is read. */
85
85
  private threadReadTo;
86
- /** A message removed where the reader is (its timer ran out, it vanished): gone from the store at once, before the server says. */
86
+ /**
87
+ * A message removed where the reader is (its timer ran out, it vanished): gone from the store at once, before the
88
+ * server says — from its conversation's row too, where it was the last message.
89
+ */
87
90
  expire(conversationId: string, messageId: string): boolean;
88
- /** The conversations, the latest first. */
91
+ /** The conversation's row no longer says messageId is its last message: answers whether it did. */
92
+ private forgetLast;
93
+ /**
94
+ * The conversations, the latest first, each with the last message the reader sees in it: the newer of the one the
95
+ * server said and the newest of its timeline the store holds — as the store holds it (edited, removed).
96
+ */
89
97
  list(): Conversation[];
98
+ private withLast;
90
99
  /** A conversation's own timeline (its messages and the answers sent to it too), the oldest first. */
91
100
  timeline(conversationId: string): Message[];
92
101
  /** A thread's answers, the oldest first. */
@@ -2306,7 +2306,7 @@ export declare function client(t: Transport): {
2306
2306
  /**
2307
2307
  * The direct conversation with a person
2308
2308
  *
2309
- * The one conversation between the reader and another person: made the first time — when the project's hook lets them reach them — and the same one every time after (200). The other sees it once something is said in it.
2309
+ * The one conversation between the reader and another person, with its two `members`: made the first time — when the project's hook lets them reach them — and the same one every time after (200). The other sees it once something is said in it.
2310
2310
  */
2311
2311
  openDirectConversation(input: {
2312
2312
  body: DirectRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
@@ -2781,7 +2781,7 @@ export declare function client(t: Transport): {
2781
2781
  /**
2782
2782
  * What changed for the reader
2783
2783
  *
2784
- * What changed for the signed-in person since `since` (the `cursor` the last sync handed out): their conversations with their own place in each and what they have not read, the people of the small ones, the messages written, changed or removed, what they removed for themselves, the threads they follow, the messages they scheduled. Nothing is missed; a change may come twice — each says its `version`. With no `since`, or one older than 30 days, it is everything to start from (`reset`): the conversations without their messages, read a page at a time.
2784
+ * What changed for the signed-in person since `since` (the `cursor` the last sync handed out): their conversations with their own place in each, what they have not read and the last message each shows (`last_message`, as the list has it), the people of the small ones, the messages written, changed or removed, what they removed for themselves, the threads they follow, the messages they scheduled. Nothing is missed; a change may come twice — each says its `version`. With no `since`, or one older than 30 days, it is everything to start from (`reset`): the conversations without their messages, read a page at a time.
2785
2785
  */
2786
2786
  sync(input?: {
2787
2787
  query?: {
@@ -389,6 +389,7 @@ export declare class Messaging {
389
389
  * reportableUntil, naming no message: the last 30 messages the person saw in it go with the report.
390
390
  */
391
391
  report(input: api.ReportRequest): Promise<api.ReportCreated>;
392
+ private tellConversation;
392
393
  /**
393
394
  * A stretch that reaches the newest becomes the timeline's: both run to the newest, so together they are one —
394
395
  * read back from the older of their ends.