@nodaro/sdk 2.65.0 → 2.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-4BAHF762.cjs → chunk-7FLTDTHR.cjs} +2 -2
- package/dist/chunk-7FLTDTHR.cjs.map +1 -0
- package/dist/{chunk-SVWEWBXI.js → chunk-ADW6LPRT.js} +17 -2
- package/dist/chunk-ADW6LPRT.js.map +1 -0
- package/dist/{chunk-3HL3IHVE.js → chunk-CSIPRLX3.js} +3 -3
- package/dist/{chunk-3HL3IHVE.js.map → chunk-CSIPRLX3.js.map} +1 -1
- package/dist/{chunk-KP2DIIKO.cjs → chunk-DQQRFBWY.cjs} +5 -5
- package/dist/{chunk-KP2DIIKO.cjs.map → chunk-DQQRFBWY.cjs.map} +1 -1
- package/dist/{chunk-MQRPXZW5.js → chunk-EBQXAOHW.js} +3 -3
- package/dist/{chunk-MQRPXZW5.js.map → chunk-EBQXAOHW.js.map} +1 -1
- package/dist/{chunk-DR5WM36L.cjs → chunk-EWVQFW5L.cjs} +22 -22
- package/dist/chunk-EWVQFW5L.cjs.map +1 -0
- package/dist/{chunk-7QK2NXJA.js → chunk-F3AV3TC7.js} +2 -2
- package/dist/chunk-F3AV3TC7.js.map +1 -0
- package/dist/{chunk-UPGZTLK7.cjs → chunk-F6KAMECM.cjs} +6 -3
- package/dist/chunk-F6KAMECM.cjs.map +1 -0
- package/dist/{chunk-P6E4QDJN.js → chunk-GG7DOKTH.js} +2 -2
- package/dist/chunk-GG7DOKTH.js.map +1 -0
- package/dist/{chunk-S4BERJXU.js → chunk-GQU5FXYB.js} +4 -4
- package/dist/{chunk-S4BERJXU.js.map → chunk-GQU5FXYB.js.map} +1 -1
- package/dist/chunk-HADYBDBT.js +19 -0
- package/dist/chunk-HADYBDBT.js.map +1 -0
- package/dist/chunk-HFDTOEAL.cjs +21 -0
- package/dist/chunk-HFDTOEAL.cjs.map +1 -0
- package/dist/{chunk-A75Q7UEU.js → chunk-JC66EEFI.js} +3 -3
- package/dist/{chunk-A75Q7UEU.js.map → chunk-JC66EEFI.js.map} +1 -1
- package/dist/{chunk-CRIQLLR2.js → chunk-JZO5WWKX.js} +51 -7
- package/dist/chunk-JZO5WWKX.js.map +1 -0
- package/dist/{chunk-YLXCXVYF.cjs → chunk-KAYCRIMA.cjs} +5 -5
- package/dist/{chunk-YLXCXVYF.cjs.map → chunk-KAYCRIMA.cjs.map} +1 -1
- package/dist/{chunk-L3RTC4FL.js → chunk-KEZMNVN3.js} +3 -3
- package/dist/chunk-KEZMNVN3.js.map +1 -0
- package/dist/{chunk-Y6V6CBY5.js → chunk-KNNSGWHO.js} +2 -2
- package/dist/{chunk-Y6V6CBY5.js.map → chunk-KNNSGWHO.js.map} +1 -1
- package/dist/{chunk-HW3CSUVC.cjs → chunk-LCQIQFWD.cjs} +17 -2
- package/dist/chunk-LCQIQFWD.cjs.map +1 -0
- package/dist/{chunk-DHJRS65Q.js → chunk-LQMJFFST.js} +6 -4
- package/dist/chunk-LQMJFFST.js.map +1 -0
- package/dist/{chunk-QUYZCZ33.js → chunk-LTRJNCXB.js} +23 -19
- package/dist/chunk-LTRJNCXB.js.map +1 -0
- package/dist/{chunk-JDEZHITT.js → chunk-MC77SD42.js} +2 -2
- package/dist/chunk-MC77SD42.js.map +1 -0
- package/dist/{chunk-VQOUF4F5.js → chunk-MCXZV3CW.js} +20 -9
- package/dist/chunk-MCXZV3CW.js.map +1 -0
- package/dist/{chunk-XZYJBJ2K.cjs → chunk-MOGPM5RM.cjs} +38 -34
- package/dist/chunk-MOGPM5RM.cjs.map +1 -0
- package/dist/{chunk-T23YD5BR.js → chunk-MYUJEVP6.js} +3 -3
- package/dist/{chunk-T23YD5BR.js.map → chunk-MYUJEVP6.js.map} +1 -1
- package/dist/chunk-N4FKPJ7J.cjs +4 -0
- package/dist/chunk-N4FKPJ7J.cjs.map +1 -0
- package/dist/{chunk-TBFA6QPH.cjs → chunk-O6LQV6BD.cjs} +4 -4
- package/dist/{chunk-TBFA6QPH.cjs.map → chunk-O6LQV6BD.cjs.map} +1 -1
- package/dist/{chunk-2DZWWIJ4.cjs → chunk-OI4RCW2J.cjs} +2 -2
- package/dist/chunk-OI4RCW2J.cjs.map +1 -0
- package/dist/{chunk-UIM5SLPP.cjs → chunk-PHBOLYRT.cjs} +4 -4
- package/dist/{chunk-UIM5SLPP.cjs.map → chunk-PHBOLYRT.cjs.map} +1 -1
- package/dist/{chunk-A5UGBCAW.js → chunk-Q6HMDIC4.js} +3 -3
- package/dist/{chunk-A5UGBCAW.js.map → chunk-Q6HMDIC4.js.map} +1 -1
- package/dist/{chunk-P2JYDWZT.cjs → chunk-QHCVKMSF.cjs} +3 -2
- package/dist/chunk-QHCVKMSF.cjs.map +1 -0
- package/dist/{chunk-7QOCWJKD.cjs → chunk-RPV4QBHS.cjs} +2 -2
- package/dist/{chunk-7QOCWJKD.cjs.map → chunk-RPV4QBHS.cjs.map} +1 -1
- package/dist/chunk-RQ6GE7KG.js +3 -0
- package/dist/chunk-RQ6GE7KG.js.map +1 -0
- package/dist/{chunk-QTO2U6JZ.cjs → chunk-S5BOU6JG.cjs} +6 -4
- package/dist/chunk-S5BOU6JG.cjs.map +1 -0
- package/dist/{chunk-3CB4WYEY.cjs → chunk-S5VSDJAM.cjs} +51 -7
- package/dist/chunk-S5VSDJAM.cjs.map +1 -0
- package/dist/{chunk-WNXX3B2A.js → chunk-SNPDM72K.js} +3 -2
- package/dist/chunk-SNPDM72K.js.map +1 -0
- package/dist/{chunk-ZVG5ODVY.cjs → chunk-UBZ2XVHM.cjs} +5 -5
- package/dist/{chunk-ZVG5ODVY.cjs.map → chunk-UBZ2XVHM.cjs.map} +1 -1
- package/dist/{chunk-WUKIJJG2.cjs → chunk-W63ZKKYT.cjs} +2 -2
- package/dist/chunk-W63ZKKYT.cjs.map +1 -0
- package/dist/{chunk-GRATHB3C.cjs → chunk-WSMZ3AAU.cjs} +9 -9
- package/dist/{chunk-GRATHB3C.cjs.map → chunk-WSMZ3AAU.cjs.map} +1 -1
- package/dist/{chunk-GGIWDFER.cjs → chunk-XSYNVD3X.cjs} +20 -9
- package/dist/chunk-XSYNVD3X.cjs.map +1 -0
- package/dist/{chunk-P2C33IOF.js → chunk-YEOK5A5H.js} +6 -3
- package/dist/chunk-YEOK5A5H.js.map +1 -0
- package/dist/entries/billing.cjs +2 -2
- package/dist/entries/billing.d.cts +18 -7
- package/dist/entries/billing.d.ts +18 -7
- package/dist/entries/billing.js +1 -1
- package/dist/entries/cast-swap.cjs +2 -2
- package/dist/entries/cast-swap.d.cts +22 -17
- package/dist/entries/cast-swap.d.ts +22 -17
- package/dist/entries/cast-swap.js +1 -1
- package/dist/entries/characters.d.cts +1 -1
- package/dist/entries/characters.d.ts +1 -1
- package/dist/entries/client.cjs +26 -25
- package/dist/entries/client.d.cts +4 -1
- package/dist/entries/client.d.ts +4 -1
- package/dist/entries/client.js +21 -20
- package/dist/entries/copilot.cjs +4 -4
- package/dist/entries/copilot.js +3 -3
- package/dist/entries/core.cjs +6 -6
- package/dist/entries/core.js +2 -2
- package/dist/entries/creatures.d.cts +1 -1
- package/dist/entries/creatures.d.ts +1 -1
- package/dist/entries/credits.cjs +2 -2
- package/dist/entries/credits.d.cts +89 -1
- package/dist/entries/credits.d.ts +89 -1
- package/dist/entries/credits.js +1 -1
- package/dist/entries/edit.cjs +7 -7
- package/dist/entries/edit.js +2 -2
- package/dist/entries/errors.cjs +28 -28
- package/dist/entries/errors.d.cts +6 -3
- package/dist/entries/errors.d.ts +6 -3
- package/dist/entries/errors.js +1 -1
- package/dist/entries/gallery.cjs +2 -2
- package/dist/entries/gallery.d.cts +5 -0
- package/dist/entries/gallery.d.ts +5 -0
- package/dist/entries/gallery.js +1 -1
- package/dist/entries/jobs.cjs +2 -2
- package/dist/entries/jobs.d.cts +26 -1
- package/dist/entries/jobs.d.ts +26 -1
- package/dist/entries/jobs.js +1 -1
- package/dist/entries/library.cjs +2 -2
- package/dist/entries/library.d.cts +6 -0
- package/dist/entries/library.d.ts +6 -0
- package/dist/entries/library.js +1 -1
- package/dist/entries/locations.d.cts +1 -1
- package/dist/entries/locations.d.ts +1 -1
- package/dist/entries/media.cjs +4 -4
- package/dist/entries/media.js +3 -3
- package/dist/entries/models.cjs +2 -2
- package/dist/entries/models.d.cts +2 -0
- package/dist/entries/models.d.ts +2 -0
- package/dist/entries/models.js +1 -1
- package/dist/entries/nodes.cjs +3 -3
- package/dist/entries/nodes.d.cts +1 -1
- package/dist/entries/nodes.d.ts +1 -1
- package/dist/entries/nodes.js +2 -2
- package/dist/entries/objects.d.cts +1 -1
- package/dist/entries/objects.d.ts +1 -1
- package/dist/entries/scene3d.d.cts +2 -2
- package/dist/entries/scene3d.d.ts +2 -2
- package/dist/entries/studio.cjs +5 -5
- package/dist/entries/studio.js +2 -2
- package/dist/entries/surface.cjs +13 -0
- package/dist/entries/surface.cjs.map +1 -0
- package/dist/entries/surface.d.cts +47 -0
- package/dist/entries/surface.d.ts +47 -0
- package/dist/entries/surface.js +4 -0
- package/dist/entries/surface.js.map +1 -0
- package/dist/entries/uploads.cjs +2 -2
- package/dist/entries/uploads.d.cts +4 -1
- package/dist/entries/uploads.d.ts +4 -1
- package/dist/entries/uploads.js +1 -1
- package/dist/entries/voices.cjs +2 -2
- package/dist/entries/voices.d.cts +32 -9
- package/dist/entries/voices.d.ts +32 -9
- package/dist/entries/voices.js +1 -1
- package/dist/index.cjs +89 -83
- package/dist/index.d.cts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +24 -22
- package/dist/{nodes-BXL3qXlY.d.ts → nodes-C9O2tdGH.d.ts} +17 -1
- package/dist/{nodes-Dx8rpU12.d.cts → nodes-WkaQjuwS.d.cts} +17 -1
- package/dist/supabase-browser.cjs +43 -5
- package/dist/supabase-browser.cjs.map +1 -1
- package/dist/supabase-browser.d.cts +11 -0
- package/dist/supabase-browser.d.ts +11 -0
- package/dist/supabase-browser.js +43 -5
- package/dist/supabase-browser.js.map +1 -1
- package/package.json +8 -3
- package/dist/chunk-2DZWWIJ4.cjs.map +0 -1
- package/dist/chunk-3CB4WYEY.cjs.map +0 -1
- package/dist/chunk-4BAHF762.cjs.map +0 -1
- package/dist/chunk-7QK2NXJA.js.map +0 -1
- package/dist/chunk-CRIQLLR2.js.map +0 -1
- package/dist/chunk-DHJRS65Q.js.map +0 -1
- package/dist/chunk-DR5WM36L.cjs.map +0 -1
- package/dist/chunk-GGIWDFER.cjs.map +0 -1
- package/dist/chunk-HW3CSUVC.cjs.map +0 -1
- package/dist/chunk-JDEZHITT.js.map +0 -1
- package/dist/chunk-L3RTC4FL.js.map +0 -1
- package/dist/chunk-P2C33IOF.js.map +0 -1
- package/dist/chunk-P2JYDWZT.cjs.map +0 -1
- package/dist/chunk-P6E4QDJN.js.map +0 -1
- package/dist/chunk-QTO2U6JZ.cjs.map +0 -1
- package/dist/chunk-QUYZCZ33.js.map +0 -1
- package/dist/chunk-SVWEWBXI.js.map +0 -1
- package/dist/chunk-UPGZTLK7.cjs.map +0 -1
- package/dist/chunk-VQOUF4F5.js.map +0 -1
- package/dist/chunk-WNXX3B2A.js.map +0 -1
- package/dist/chunk-WUKIJJG2.cjs.map +0 -1
- package/dist/chunk-XZYJBJ2K.cjs.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -14,13 +14,13 @@ export { CompetitorsResource } from './entries/competitors.cjs';
|
|
|
14
14
|
export { ContentRightsAuthorization, ContentRightsConfirmation, ContentRightsDeclaration, ContentRightsResource } from './entries/content-rights.cjs';
|
|
15
15
|
export { CopilotMemorySavedFrameData, CopilotMessage, CopilotMessagePart, CopilotMetadataFrameData, CopilotModelTier, CopilotResource, CopilotRunMode, CopilotRunProposalFrameData, CopilotRunProposalNode, CopilotStreamFrame, CopilotStreamOptions, CopilotSurface, CopilotThread, CopilotThreadWorkflow, CopilotToolCallFrameData, CopilotWiredAsset, CopilotWorkflowCreatedFrameData, CopilotWorkflowUpdateFrameData, CreateCopilotThreadInput } from './entries/copilot.cjs';
|
|
16
16
|
export { ApproveCreatureMainImageResult, CREATURE_ASSET_TYPES, CreateCreatureInput, Creature, CreatureAssetType, CreatureDetail, CreatureReferencePhoto, CreatureReferencePhotoKind, CreatureVoice, CreaturesResource, GenerateCreatureAssetInput, GenerateCreatureAssetResult, GenerateCreatureInput, GenerateCreatureMotionInput, GenerateCreatureMotionResult, GenerateCreatureResult, ListCreaturesParams, RecaptionCreatureResult, UpdateCreatureInput, UpdateCreatureResult, UpsertCreatureInput, UpsertCreatureResult } from './entries/creatures.cjs';
|
|
17
|
-
export { CreditHistoryEntry, CreditHistoryFilters, CreditHistoryJob, CreditHistoryKind, CreditHistoryOptions, CreditHistoryPage, CreditTransaction, CreditTransactionsOptions, CreditTransactionsPage, CreditsResource, FreeGrantState, ModelCostError, ModelCostResult, ModelCostsResult, SignupGrantClaimResult, SignupKeys, UsageByCategory, UsageByGroup, UsageByModel, UsageOverTime, UsageSummary, UsageSummaryBucket, UsageSummaryOptions, UsageSummaryTotals, UserBalance, WelcomeOfferClaimInput, WelcomeOfferClaimResult, WelcomeOfferSeenResult, WelcomeOfferState } from './entries/credits.cjs';
|
|
17
|
+
export { BalanceAllowance, BalanceDisplay, CreditHistoryEntry, CreditHistoryFilters, CreditHistoryJob, CreditHistoryKind, CreditHistoryOptions, CreditHistoryPage, CreditTransaction, CreditTransactionsOptions, CreditTransactionsPage, CreditsResource, DisplayUnitInfo, FreeGrantState, ModelCostDisplay, ModelCostError, ModelCostResult, ModelCostsDisplay, ModelCostsResult, SignupGrantClaimResult, SignupKeys, UsageByCategory, UsageByGroup, UsageByModel, UsageOverTime, UsageSummary, UsageSummaryBucket, UsageSummaryOptions, UsageSummaryTotals, UserBalance, WelcomeOfferClaimInput, WelcomeOfferClaimResult, WelcomeOfferSeenResult, WelcomeOfferState } from './entries/credits.cjs';
|
|
18
18
|
export { ChapterSet, EditPlanMode, EditPlanTier, Edl, EdlClipSet, SpeakerMapResult, Transcript, unwrapEditPlanOutput } from '@nodaro/shared/edl';
|
|
19
19
|
export { ApplyEdlInput, AudioSyncInput, AudioSyncOffset, AudioSyncResult, AudioSyncSource, CLIP_PACK_MAX_TARGET_SEC, CLIP_PACK_MIN_TARGET_SEC, CameraSwitchInput, ClipPackEmphasis, ClipPackInput, EditJobResult, EditPlanInput, EditPlanSource, EditResource, EpisodeChaptersInput, EpisodeTrailerInput, SilenceDetectInput, SilenceRanges, SpeakerLayoutInput, SpeakerMapInput, SpeakerMapSource, TRAILER_FORMATS, TightenEpisodeEstimate, TightenEpisodeInput, TightenEpisodeJobResult, TrailerFormat, UseCaseContinueInput, UseCaseEstimate, UseCaseJobResult, UseCaseRecordingsInput, UseCaseRequestOptions } from './entries/edit.cjs';
|
|
20
20
|
export { AlreadyRunningError, AppRunVersionChangedError, CREDIT_CAP_CODES, ContinuationPreviewPendingError, ContinuationRefusedError, CreditCapCode, CreditCapExceededError, ForbiddenError, HeldFinalRun, IMPORT_REFUSAL_CODES, ImportRefusalCode, ImportRefusedError, InsufficientCreditsError, JobAbortedError, JobBlockedError, JobFailedError, JobHeldError, JobTimeoutError, MODEL_UNAVAILABLE_CODES, ModelUnavailableCode, ModelUnavailableError, NodaroError, NotFoundError, RateLimitedError, StorageExceededError, StudioOpError, StudioPreviewAppliedError, StudioPreviewUnavailable, UnauthorizedError, WorkflowConflictCode, WorkflowConflictError, throwFromResponse } from './entries/errors.cjs';
|
|
21
21
|
export { CancelExecutionParams, ExecutionStatus, ExecutionTriggerType, ExecutionsResource, ListExecutionsForWorkflowParams, ListExecutionsPage, NodeExecutionState, WorkflowExecution, WorkflowExecutionSummary } from './entries/executions.cjs';
|
|
22
22
|
export { BrowseGalleryParams, GalleryItem, GalleryMediaType, GalleryPage, GalleryResource, ToggleFavoriteResult } from './entries/gallery.cjs';
|
|
23
|
-
export { CancelJobResult, CreditStatus, CreditsHint, DeleteJobResult, InputRefusedHint, Job, JobErrorHint, JobFromUploadParams, JobQueueInfo, JobRating, JobRatingFilter, JobSessionRef, JobSource, JobStatus, JobStatusResult, JobsResource, ListJobsPage, ListJobsParams, PolicyBlockHint, QueueTimeoutHint, RateJobResult, RequestRefusedHint, SafetyBlockHint } from './entries/jobs.cjs';
|
|
23
|
+
export { CancelJobResult, CreditStatus, CreditsHint, DeleteJobResult, InputRefusedHint, Job, JobErrorHint, JobFromUploadParams, JobQueueInfo, JobRating, JobRatingFilter, JobSessionRef, JobSource, JobStatus, JobStatusResult, JobsResource, ListJobsPage, ListJobsParams, PolicyBlockHint, QueueTimeoutHint, RateJobResult, RenameJobResult, RequestRefusedHint, SafetyBlockHint } from './entries/jobs.cjs';
|
|
24
24
|
export { CopyKeeperResult, KEEPER_KINDS, KeeperCatalogItem, KeeperCatalogPage, KeeperCatalogParams, KeeperKind, KeepersResource, SetKeeperCatalogInput, SetKeeperCatalogResult } from './entries/keepers.cjs';
|
|
25
25
|
export { LibraryAsset, LibraryResource, ListLibraryParams, ListLibraryResult } from './entries/library.cjs';
|
|
26
26
|
export { LlmResource, LlmStructuredInput, LlmStructuredJobInput, LlmStructuredJobOutput, LlmStructuredResult } from './entries/llm.cjs';
|
|
@@ -33,7 +33,7 @@ export { CreateNodePresetGroupInput, CreateNodePresetInput, FactoryPresetEntry,
|
|
|
33
33
|
export { ConnectedReference, DescribedReference, GenericEdge, GenericNode } from '@nodaro/shared/types';
|
|
34
34
|
export { VideoCharacterReference, VideoCharacterVoice } from '@nodaro/shared/video';
|
|
35
35
|
export { AudioFxPreset, GenerateMaskOutput, GenerateMaskRequest, VideoDepthColormap, VideoDepthModelSize, VideoDepthProvider, VideoDepthResolution } from '@nodaro/shared/media';
|
|
36
|
-
export { A as AssembleNarratedVideoParams, B as BatchJobOutcome, E as EditImageCommonParams, a as EditImageFromTaskParams, b as EditImageFromUrlParams, c as EditImageParams, d as EditScene3DParams, G as GenerateImageBatchGroup, e as GenerateImageBatchOutput, f as GenerateImageBatchResult, g as GenerateImageParams, h as GenerateMaskJobOutput, i as GenerateMaskParams, j as GenerateScene3DParams, k as GenerateVideoParams, l as GenerationSessionParams, I as ImageJobStarted, m as ImageToImageParams, J as JobOutputImage, N as NodeCategory, n as NodeCreditRate, o as NodeDescriptor, p as NodeInputField, q as NodeInputSchema, r as NodeJobOutput, s as NodeQuote, t as NodesResource, O as OutputType, P as Pro3DRenderJobOutput, u as Pro3DRenderParams, v as Pro3DRenderQuote, w as Pro3DRenderRunOptions, x as Pro3DRenderRunParams, Q as QuoteAdjustment, y as QuoteWarning, R as ReferenceCaptionParams, z as RenderScene3DParams, C as RetainedScene3DEditParams, D as RetainedScene3DEditResult, F as RunAndWaitOptions, H as RunManyResult, K as RunNodeAdjustment, L as RunNodeOptions, M as RunNodeResult, S as RunNodeWarning, T as SCENE3D_DELIVERY_ASSET_USAGE, U as Scene3DAuthoringEngine, V as Scene3DCapabilities, W as Scene3DDelivery, X as Scene3DDeliveryAsset, Y as Scene3DDeliveryAssetKind, Z as Scene3DJobOutput, _ as SocialSearchJobOutput, $ as SplitImageParams, a0 as SplitImageResult, a1 as SplitImageTile, a2 as StructuredReferenceParams, a3 as Subject, a4 as TextToSpeechParams, a5 as TextToVideoParams, a6 as VideoDepthParams, a7 as VideoToVideoParams, a8 as VideoUpscaleParams } from './nodes-
|
|
36
|
+
export { A as AssembleNarratedVideoParams, B as BatchJobOutcome, E as EditImageCommonParams, a as EditImageFromTaskParams, b as EditImageFromUrlParams, c as EditImageParams, d as EditScene3DParams, G as GenerateImageBatchGroup, e as GenerateImageBatchOutput, f as GenerateImageBatchResult, g as GenerateImageParams, h as GenerateMaskJobOutput, i as GenerateMaskParams, j as GenerateScene3DParams, k as GenerateVideoParams, l as GenerationSessionParams, I as ImageJobStarted, m as ImageToImageParams, J as JobOutputImage, N as NodeCategory, n as NodeCreditRate, o as NodeDescriptor, p as NodeInputField, q as NodeInputSchema, r as NodeJobOutput, s as NodeQuote, t as NodesResource, O as OutputType, P as Pro3DRenderJobOutput, u as Pro3DRenderParams, v as Pro3DRenderQuote, w as Pro3DRenderRunOptions, x as Pro3DRenderRunParams, Q as QuoteAdjustment, y as QuoteWarning, R as ReferenceCaptionParams, z as RenderScene3DParams, C as RetainedScene3DEditParams, D as RetainedScene3DEditResult, F as RunAndWaitOptions, H as RunManyResult, K as RunNodeAdjustment, L as RunNodeOptions, M as RunNodeResult, S as RunNodeWarning, T as SCENE3D_DELIVERY_ASSET_USAGE, U as Scene3DAuthoringEngine, V as Scene3DCapabilities, W as Scene3DDelivery, X as Scene3DDeliveryAsset, Y as Scene3DDeliveryAssetKind, Z as Scene3DJobOutput, _ as SocialSearchJobOutput, $ as SplitImageParams, a0 as SplitImageResult, a1 as SplitImageTile, a2 as StructuredReferenceParams, a3 as Subject, a4 as TextToSpeechParams, a5 as TextToVideoParams, a6 as VideoDepthParams, a7 as VideoToVideoParams, a8 as VideoUpscaleParams } from './nodes-WkaQjuwS.cjs';
|
|
37
37
|
export { TopazUpscaleFactor } from '@nodaro/shared/credits';
|
|
38
38
|
export { CHARACTER_ASPECT_DEFAULTS, CHARACTER_ASPECT_OPTIONS, CHARACTER_STYLES, OBJECT_ASPECT_DEFAULTS as CREATURE_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS as CREATURE_ASPECT_OPTIONS, CREATURE_ATTACH_COLUMNS, CharacterAspectRatio, ObjectAspectRatio as CreatureAspectRatio, CreatureAttachColumn, EntityStyle, ImageToImageAttachColumn, LOCATION_ASSET_TYPES, LOCATION_ATTACH_COLUMNS, LocationAssetType, LocationAttachColumn, OBJECT_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS, OBJECT_ASSET_TYPES, OBJECT_ATTACH_COLUMNS, ObjectAspectRatio, ObjectAssetType, ObjectAttachColumn, SURROUND_DIRECTIONS, SurroundDirection } from '@nodaro/shared/entities';
|
|
39
39
|
export { AccessTokenResponse, ExchangeCodeInput, OAuthAppInfo, OAuthResource } from './entries/oauth.cjs';
|
|
@@ -54,6 +54,7 @@ export { Scene3DResource } from './entries/scene3d.cjs';
|
|
|
54
54
|
export { CreateSessionInput, GenerationSession, ListSessionItemsParams, ListSessionsParams, MoveSessionItemsInput, SessionItem, SessionPage, SessionsResource, UpdateSessionInput } from './entries/sessions.cjs';
|
|
55
55
|
export { CreateShotInput, Shot, ShotEntityRef, ShotMode, ShotsResource, UpdateShotInput } from './entries/shots.cjs';
|
|
56
56
|
export { StudioDocumentJson, StudioEditInput, StudioGenerationReply, StudioKeyframeAcceptanceInput, StudioKeyframeGenerationInput, StudioKeyframeRecord, StudioProductionCapabilities, StudioProductionRecord, StudioProductionReply, StudioResource, StudioShotGenerationInput } from './entries/studio.cjs';
|
|
57
|
+
export { SurfaceAvailability, SurfaceAvailabilityWorld, SurfaceResource } from './entries/surface.cjs';
|
|
57
58
|
export { BrowseTemplatesParams, BrowseTemplatesResult, CloneTemplateParams, CloneTemplateResult, Template, TemplateBrowseCard, TemplateSort, TemplatesResource } from './entries/templates.cjs';
|
|
58
59
|
export { ListTrashParams, TrashEntry, TrashPage, TrashResource, TrashSession } from './entries/trash.cjs';
|
|
59
60
|
export { ListTrendCandidatesParams, TrendCandidate, TrendCandidateApproval, TrendCandidateCard, TrendCandidateCheck, TrendCandidateEvent, TrendCandidateLabel, TrendCandidatePage, TrendCandidatePlatform, TrendCandidatePost, TrendCandidateReading, TrendCandidateSearch, TrendCandidateSort, TrendCandidateSource, TrendCandidateStatus, TrendCandidateTemplate, TrendRadarAlerts, TrendRadarLastRun, TrendRadarResource, TrendRadarSettings, TrendRadarSettingsPatch, TrendRadarSource, TrendRadarSourceInput, TrendRadarSourceKind, TrendRadarSummary, TrendRadarThresholds } from './entries/trend-radar.cjs';
|
|
@@ -68,7 +69,7 @@ export { VerifyWebhookSignatureOptions, WebhookSignatureError, WebhookSignatureE
|
|
|
68
69
|
export { ExecutionOutcome, NodeExecutionStatus, NodeSkipReason, OUTPUT_BEARING_NODE_STATUSES, ReduceMeta, ReduceStrategyId, WorkflowExport, WorkflowExportCharacter, WorkflowExportLocation, WorkflowExportObject, nodeStateMayCarryOutput } from '@nodaro/shared/workflow';
|
|
69
70
|
export { AddCollaboratorInput, Collaborator, CreateWorkflowInput, DroppedCollaborator, ListMcpConversationsParams, ListWorkflowsParams, McpConversation, McpConversationList, RenderFinalParams, RenderFinalQuote, RunWorkflowOptions, RunWorkflowParams, RunWorkflowResult, SharedWorkflow, UpdateWorkflowInput, Workflow, WorkflowsResource } from './entries/workflows.cjs';
|
|
70
71
|
export { CreateWorkspaceInput, WorkspacesResource } from './entries/workspaces.cjs';
|
|
71
|
-
export { AnimateSubGate, ChatEnabledStage, PipelineInput, PipelineMode, PipelineStageName, PipelineStatus, ProposedChange, SharedVoice, SubGateName, Voice, VoiceClone, VoiceLibraryParams, VoiceLibraryResponse } from '@nodaro/shared/pipeline';
|
|
72
|
+
export { AnimateSubGate, ChatEnabledStage, PipelineInput, PipelineMode, PipelineStageName, PipelineStatus, ProposedChange, SharedVoice, SubGateName, Voice, VoiceClone, VoiceFavorite, VoiceFavoriteInput, VoiceFavoriteType, VoiceLibraryDescriptive, VoiceLibraryFacetCount, VoiceLibraryFacets, VoiceLibraryFacetsParams, VoiceLibraryParams, VoiceLibraryResponse, VoiceLibraryUseCase } from '@nodaro/shared/pipeline';
|
|
72
73
|
export { G as GetProductionOptions, L as ListStudioProductionsOptions, S as StudioClientRequestId, a as StudioCloneRequest, b as StudioCreateProductionRequest, c as StudioDescribeRequest, d as StudioExportPlanOptions, e as StudioExportPlanResponse, f as StudioExportStep, g as StudioFrameRequest, h as StudioGenerateEstimate, i as StudioGenerateOptions, j as StudioGenerateRequest, k as StudioGenerateResponse, l as StudioGenerateResult, m as StudioImportSummary, n as StudioJobStartedResponse, o as StudioListProductionsResponse, p as StudioMediaResponse, q as StudioMusicRequest, r as StudioOpClass, s as StudioOpsDryRunReceipt, t as StudioOpsDryRunResponse, u as StudioOpsImpact, v as StudioOpsReceipt, w as StudioOpsRequest, x as StudioOpsResponse, y as StudioOpsText, z as StudioPlanIssue, A as StudioProduction, B as StudioProductionDetail, C as StudioProductionResponse, D as StudioProductionsResource, E as StudioReconcileResponse, F as StudioRevoiceRequest, H as StudioSkillResponse, I as StudioValidatePlanResponse, J as StudioVideoLane, K as StudioVoiceRequest, M as isStudioGenerateEstimate } from './studio-productions-CMiS827q.cjs';
|
|
73
74
|
export { PEOPLE, PERSON_DIMENSION_LABELS, PERSON_DIMENSION_ORDER, PersonValue, buildPersonHints } from '@nodaro/prompts/person';
|
|
74
75
|
import '@nodaro/shared/captions';
|
package/dist/index.d.ts
CHANGED
|
@@ -14,13 +14,13 @@ export { CompetitorsResource } from './entries/competitors.js';
|
|
|
14
14
|
export { ContentRightsAuthorization, ContentRightsConfirmation, ContentRightsDeclaration, ContentRightsResource } from './entries/content-rights.js';
|
|
15
15
|
export { CopilotMemorySavedFrameData, CopilotMessage, CopilotMessagePart, CopilotMetadataFrameData, CopilotModelTier, CopilotResource, CopilotRunMode, CopilotRunProposalFrameData, CopilotRunProposalNode, CopilotStreamFrame, CopilotStreamOptions, CopilotSurface, CopilotThread, CopilotThreadWorkflow, CopilotToolCallFrameData, CopilotWiredAsset, CopilotWorkflowCreatedFrameData, CopilotWorkflowUpdateFrameData, CreateCopilotThreadInput } from './entries/copilot.js';
|
|
16
16
|
export { ApproveCreatureMainImageResult, CREATURE_ASSET_TYPES, CreateCreatureInput, Creature, CreatureAssetType, CreatureDetail, CreatureReferencePhoto, CreatureReferencePhotoKind, CreatureVoice, CreaturesResource, GenerateCreatureAssetInput, GenerateCreatureAssetResult, GenerateCreatureInput, GenerateCreatureMotionInput, GenerateCreatureMotionResult, GenerateCreatureResult, ListCreaturesParams, RecaptionCreatureResult, UpdateCreatureInput, UpdateCreatureResult, UpsertCreatureInput, UpsertCreatureResult } from './entries/creatures.js';
|
|
17
|
-
export { CreditHistoryEntry, CreditHistoryFilters, CreditHistoryJob, CreditHistoryKind, CreditHistoryOptions, CreditHistoryPage, CreditTransaction, CreditTransactionsOptions, CreditTransactionsPage, CreditsResource, FreeGrantState, ModelCostError, ModelCostResult, ModelCostsResult, SignupGrantClaimResult, SignupKeys, UsageByCategory, UsageByGroup, UsageByModel, UsageOverTime, UsageSummary, UsageSummaryBucket, UsageSummaryOptions, UsageSummaryTotals, UserBalance, WelcomeOfferClaimInput, WelcomeOfferClaimResult, WelcomeOfferSeenResult, WelcomeOfferState } from './entries/credits.js';
|
|
17
|
+
export { BalanceAllowance, BalanceDisplay, CreditHistoryEntry, CreditHistoryFilters, CreditHistoryJob, CreditHistoryKind, CreditHistoryOptions, CreditHistoryPage, CreditTransaction, CreditTransactionsOptions, CreditTransactionsPage, CreditsResource, DisplayUnitInfo, FreeGrantState, ModelCostDisplay, ModelCostError, ModelCostResult, ModelCostsDisplay, ModelCostsResult, SignupGrantClaimResult, SignupKeys, UsageByCategory, UsageByGroup, UsageByModel, UsageOverTime, UsageSummary, UsageSummaryBucket, UsageSummaryOptions, UsageSummaryTotals, UserBalance, WelcomeOfferClaimInput, WelcomeOfferClaimResult, WelcomeOfferSeenResult, WelcomeOfferState } from './entries/credits.js';
|
|
18
18
|
export { ChapterSet, EditPlanMode, EditPlanTier, Edl, EdlClipSet, SpeakerMapResult, Transcript, unwrapEditPlanOutput } from '@nodaro/shared/edl';
|
|
19
19
|
export { ApplyEdlInput, AudioSyncInput, AudioSyncOffset, AudioSyncResult, AudioSyncSource, CLIP_PACK_MAX_TARGET_SEC, CLIP_PACK_MIN_TARGET_SEC, CameraSwitchInput, ClipPackEmphasis, ClipPackInput, EditJobResult, EditPlanInput, EditPlanSource, EditResource, EpisodeChaptersInput, EpisodeTrailerInput, SilenceDetectInput, SilenceRanges, SpeakerLayoutInput, SpeakerMapInput, SpeakerMapSource, TRAILER_FORMATS, TightenEpisodeEstimate, TightenEpisodeInput, TightenEpisodeJobResult, TrailerFormat, UseCaseContinueInput, UseCaseEstimate, UseCaseJobResult, UseCaseRecordingsInput, UseCaseRequestOptions } from './entries/edit.js';
|
|
20
20
|
export { AlreadyRunningError, AppRunVersionChangedError, CREDIT_CAP_CODES, ContinuationPreviewPendingError, ContinuationRefusedError, CreditCapCode, CreditCapExceededError, ForbiddenError, HeldFinalRun, IMPORT_REFUSAL_CODES, ImportRefusalCode, ImportRefusedError, InsufficientCreditsError, JobAbortedError, JobBlockedError, JobFailedError, JobHeldError, JobTimeoutError, MODEL_UNAVAILABLE_CODES, ModelUnavailableCode, ModelUnavailableError, NodaroError, NotFoundError, RateLimitedError, StorageExceededError, StudioOpError, StudioPreviewAppliedError, StudioPreviewUnavailable, UnauthorizedError, WorkflowConflictCode, WorkflowConflictError, throwFromResponse } from './entries/errors.js';
|
|
21
21
|
export { CancelExecutionParams, ExecutionStatus, ExecutionTriggerType, ExecutionsResource, ListExecutionsForWorkflowParams, ListExecutionsPage, NodeExecutionState, WorkflowExecution, WorkflowExecutionSummary } from './entries/executions.js';
|
|
22
22
|
export { BrowseGalleryParams, GalleryItem, GalleryMediaType, GalleryPage, GalleryResource, ToggleFavoriteResult } from './entries/gallery.js';
|
|
23
|
-
export { CancelJobResult, CreditStatus, CreditsHint, DeleteJobResult, InputRefusedHint, Job, JobErrorHint, JobFromUploadParams, JobQueueInfo, JobRating, JobRatingFilter, JobSessionRef, JobSource, JobStatus, JobStatusResult, JobsResource, ListJobsPage, ListJobsParams, PolicyBlockHint, QueueTimeoutHint, RateJobResult, RequestRefusedHint, SafetyBlockHint } from './entries/jobs.js';
|
|
23
|
+
export { CancelJobResult, CreditStatus, CreditsHint, DeleteJobResult, InputRefusedHint, Job, JobErrorHint, JobFromUploadParams, JobQueueInfo, JobRating, JobRatingFilter, JobSessionRef, JobSource, JobStatus, JobStatusResult, JobsResource, ListJobsPage, ListJobsParams, PolicyBlockHint, QueueTimeoutHint, RateJobResult, RenameJobResult, RequestRefusedHint, SafetyBlockHint } from './entries/jobs.js';
|
|
24
24
|
export { CopyKeeperResult, KEEPER_KINDS, KeeperCatalogItem, KeeperCatalogPage, KeeperCatalogParams, KeeperKind, KeepersResource, SetKeeperCatalogInput, SetKeeperCatalogResult } from './entries/keepers.js';
|
|
25
25
|
export { LibraryAsset, LibraryResource, ListLibraryParams, ListLibraryResult } from './entries/library.js';
|
|
26
26
|
export { LlmResource, LlmStructuredInput, LlmStructuredJobInput, LlmStructuredJobOutput, LlmStructuredResult } from './entries/llm.js';
|
|
@@ -33,7 +33,7 @@ export { CreateNodePresetGroupInput, CreateNodePresetInput, FactoryPresetEntry,
|
|
|
33
33
|
export { ConnectedReference, DescribedReference, GenericEdge, GenericNode } from '@nodaro/shared/types';
|
|
34
34
|
export { VideoCharacterReference, VideoCharacterVoice } from '@nodaro/shared/video';
|
|
35
35
|
export { AudioFxPreset, GenerateMaskOutput, GenerateMaskRequest, VideoDepthColormap, VideoDepthModelSize, VideoDepthProvider, VideoDepthResolution } from '@nodaro/shared/media';
|
|
36
|
-
export { A as AssembleNarratedVideoParams, B as BatchJobOutcome, E as EditImageCommonParams, a as EditImageFromTaskParams, b as EditImageFromUrlParams, c as EditImageParams, d as EditScene3DParams, G as GenerateImageBatchGroup, e as GenerateImageBatchOutput, f as GenerateImageBatchResult, g as GenerateImageParams, h as GenerateMaskJobOutput, i as GenerateMaskParams, j as GenerateScene3DParams, k as GenerateVideoParams, l as GenerationSessionParams, I as ImageJobStarted, m as ImageToImageParams, J as JobOutputImage, N as NodeCategory, n as NodeCreditRate, o as NodeDescriptor, p as NodeInputField, q as NodeInputSchema, r as NodeJobOutput, s as NodeQuote, t as NodesResource, O as OutputType, P as Pro3DRenderJobOutput, u as Pro3DRenderParams, v as Pro3DRenderQuote, w as Pro3DRenderRunOptions, x as Pro3DRenderRunParams, Q as QuoteAdjustment, y as QuoteWarning, R as ReferenceCaptionParams, z as RenderScene3DParams, C as RetainedScene3DEditParams, D as RetainedScene3DEditResult, F as RunAndWaitOptions, H as RunManyResult, K as RunNodeAdjustment, L as RunNodeOptions, M as RunNodeResult, S as RunNodeWarning, T as SCENE3D_DELIVERY_ASSET_USAGE, U as Scene3DAuthoringEngine, V as Scene3DCapabilities, W as Scene3DDelivery, X as Scene3DDeliveryAsset, Y as Scene3DDeliveryAssetKind, Z as Scene3DJobOutput, _ as SocialSearchJobOutput, $ as SplitImageParams, a0 as SplitImageResult, a1 as SplitImageTile, a2 as StructuredReferenceParams, a3 as Subject, a4 as TextToSpeechParams, a5 as TextToVideoParams, a6 as VideoDepthParams, a7 as VideoToVideoParams, a8 as VideoUpscaleParams } from './nodes-
|
|
36
|
+
export { A as AssembleNarratedVideoParams, B as BatchJobOutcome, E as EditImageCommonParams, a as EditImageFromTaskParams, b as EditImageFromUrlParams, c as EditImageParams, d as EditScene3DParams, G as GenerateImageBatchGroup, e as GenerateImageBatchOutput, f as GenerateImageBatchResult, g as GenerateImageParams, h as GenerateMaskJobOutput, i as GenerateMaskParams, j as GenerateScene3DParams, k as GenerateVideoParams, l as GenerationSessionParams, I as ImageJobStarted, m as ImageToImageParams, J as JobOutputImage, N as NodeCategory, n as NodeCreditRate, o as NodeDescriptor, p as NodeInputField, q as NodeInputSchema, r as NodeJobOutput, s as NodeQuote, t as NodesResource, O as OutputType, P as Pro3DRenderJobOutput, u as Pro3DRenderParams, v as Pro3DRenderQuote, w as Pro3DRenderRunOptions, x as Pro3DRenderRunParams, Q as QuoteAdjustment, y as QuoteWarning, R as ReferenceCaptionParams, z as RenderScene3DParams, C as RetainedScene3DEditParams, D as RetainedScene3DEditResult, F as RunAndWaitOptions, H as RunManyResult, K as RunNodeAdjustment, L as RunNodeOptions, M as RunNodeResult, S as RunNodeWarning, T as SCENE3D_DELIVERY_ASSET_USAGE, U as Scene3DAuthoringEngine, V as Scene3DCapabilities, W as Scene3DDelivery, X as Scene3DDeliveryAsset, Y as Scene3DDeliveryAssetKind, Z as Scene3DJobOutput, _ as SocialSearchJobOutput, $ as SplitImageParams, a0 as SplitImageResult, a1 as SplitImageTile, a2 as StructuredReferenceParams, a3 as Subject, a4 as TextToSpeechParams, a5 as TextToVideoParams, a6 as VideoDepthParams, a7 as VideoToVideoParams, a8 as VideoUpscaleParams } from './nodes-C9O2tdGH.js';
|
|
37
37
|
export { TopazUpscaleFactor } from '@nodaro/shared/credits';
|
|
38
38
|
export { CHARACTER_ASPECT_DEFAULTS, CHARACTER_ASPECT_OPTIONS, CHARACTER_STYLES, OBJECT_ASPECT_DEFAULTS as CREATURE_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS as CREATURE_ASPECT_OPTIONS, CREATURE_ATTACH_COLUMNS, CharacterAspectRatio, ObjectAspectRatio as CreatureAspectRatio, CreatureAttachColumn, EntityStyle, ImageToImageAttachColumn, LOCATION_ASSET_TYPES, LOCATION_ATTACH_COLUMNS, LocationAssetType, LocationAttachColumn, OBJECT_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS, OBJECT_ASSET_TYPES, OBJECT_ATTACH_COLUMNS, ObjectAspectRatio, ObjectAssetType, ObjectAttachColumn, SURROUND_DIRECTIONS, SurroundDirection } from '@nodaro/shared/entities';
|
|
39
39
|
export { AccessTokenResponse, ExchangeCodeInput, OAuthAppInfo, OAuthResource } from './entries/oauth.js';
|
|
@@ -54,6 +54,7 @@ export { Scene3DResource } from './entries/scene3d.js';
|
|
|
54
54
|
export { CreateSessionInput, GenerationSession, ListSessionItemsParams, ListSessionsParams, MoveSessionItemsInput, SessionItem, SessionPage, SessionsResource, UpdateSessionInput } from './entries/sessions.js';
|
|
55
55
|
export { CreateShotInput, Shot, ShotEntityRef, ShotMode, ShotsResource, UpdateShotInput } from './entries/shots.js';
|
|
56
56
|
export { StudioDocumentJson, StudioEditInput, StudioGenerationReply, StudioKeyframeAcceptanceInput, StudioKeyframeGenerationInput, StudioKeyframeRecord, StudioProductionCapabilities, StudioProductionRecord, StudioProductionReply, StudioResource, StudioShotGenerationInput } from './entries/studio.js';
|
|
57
|
+
export { SurfaceAvailability, SurfaceAvailabilityWorld, SurfaceResource } from './entries/surface.js';
|
|
57
58
|
export { BrowseTemplatesParams, BrowseTemplatesResult, CloneTemplateParams, CloneTemplateResult, Template, TemplateBrowseCard, TemplateSort, TemplatesResource } from './entries/templates.js';
|
|
58
59
|
export { ListTrashParams, TrashEntry, TrashPage, TrashResource, TrashSession } from './entries/trash.js';
|
|
59
60
|
export { ListTrendCandidatesParams, TrendCandidate, TrendCandidateApproval, TrendCandidateCard, TrendCandidateCheck, TrendCandidateEvent, TrendCandidateLabel, TrendCandidatePage, TrendCandidatePlatform, TrendCandidatePost, TrendCandidateReading, TrendCandidateSearch, TrendCandidateSort, TrendCandidateSource, TrendCandidateStatus, TrendCandidateTemplate, TrendRadarAlerts, TrendRadarLastRun, TrendRadarResource, TrendRadarSettings, TrendRadarSettingsPatch, TrendRadarSource, TrendRadarSourceInput, TrendRadarSourceKind, TrendRadarSummary, TrendRadarThresholds } from './entries/trend-radar.js';
|
|
@@ -68,7 +69,7 @@ export { VerifyWebhookSignatureOptions, WebhookSignatureError, WebhookSignatureE
|
|
|
68
69
|
export { ExecutionOutcome, NodeExecutionStatus, NodeSkipReason, OUTPUT_BEARING_NODE_STATUSES, ReduceMeta, ReduceStrategyId, WorkflowExport, WorkflowExportCharacter, WorkflowExportLocation, WorkflowExportObject, nodeStateMayCarryOutput } from '@nodaro/shared/workflow';
|
|
69
70
|
export { AddCollaboratorInput, Collaborator, CreateWorkflowInput, DroppedCollaborator, ListMcpConversationsParams, ListWorkflowsParams, McpConversation, McpConversationList, RenderFinalParams, RenderFinalQuote, RunWorkflowOptions, RunWorkflowParams, RunWorkflowResult, SharedWorkflow, UpdateWorkflowInput, Workflow, WorkflowsResource } from './entries/workflows.js';
|
|
70
71
|
export { CreateWorkspaceInput, WorkspacesResource } from './entries/workspaces.js';
|
|
71
|
-
export { AnimateSubGate, ChatEnabledStage, PipelineInput, PipelineMode, PipelineStageName, PipelineStatus, ProposedChange, SharedVoice, SubGateName, Voice, VoiceClone, VoiceLibraryParams, VoiceLibraryResponse } from '@nodaro/shared/pipeline';
|
|
72
|
+
export { AnimateSubGate, ChatEnabledStage, PipelineInput, PipelineMode, PipelineStageName, PipelineStatus, ProposedChange, SharedVoice, SubGateName, Voice, VoiceClone, VoiceFavorite, VoiceFavoriteInput, VoiceFavoriteType, VoiceLibraryDescriptive, VoiceLibraryFacetCount, VoiceLibraryFacets, VoiceLibraryFacetsParams, VoiceLibraryParams, VoiceLibraryResponse, VoiceLibraryUseCase } from '@nodaro/shared/pipeline';
|
|
72
73
|
export { G as GetProductionOptions, L as ListStudioProductionsOptions, S as StudioClientRequestId, a as StudioCloneRequest, b as StudioCreateProductionRequest, c as StudioDescribeRequest, d as StudioExportPlanOptions, e as StudioExportPlanResponse, f as StudioExportStep, g as StudioFrameRequest, h as StudioGenerateEstimate, i as StudioGenerateOptions, j as StudioGenerateRequest, k as StudioGenerateResponse, l as StudioGenerateResult, m as StudioImportSummary, n as StudioJobStartedResponse, o as StudioListProductionsResponse, p as StudioMediaResponse, q as StudioMusicRequest, r as StudioOpClass, s as StudioOpsDryRunReceipt, t as StudioOpsDryRunResponse, u as StudioOpsImpact, v as StudioOpsReceipt, w as StudioOpsRequest, x as StudioOpsResponse, y as StudioOpsText, z as StudioPlanIssue, A as StudioProduction, B as StudioProductionDetail, C as StudioProductionResponse, D as StudioProductionsResource, E as StudioReconcileResponse, F as StudioRevoiceRequest, H as StudioSkillResponse, I as StudioValidatePlanResponse, J as StudioVideoLane, K as StudioVoiceRequest, M as isStudioGenerateEstimate } from './studio-productions-DkI51Z9M.js';
|
|
73
74
|
export { PEOPLE, PERSON_DIMENSION_LABELS, PERSON_DIMENSION_ORDER, PersonValue, buildPersonHints } from '@nodaro/prompts/person';
|
|
74
75
|
import '@nodaro/shared/captions';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
export { WebhookSignatureError, verifyWebhookSignature } from './chunk-VGTRKXF2.js';
|
|
1
2
|
import './chunk-PGYQ754I.js';
|
|
2
3
|
import './chunk-FHEYAW5H.js';
|
|
4
|
+
import './chunk-6NTKEXT5.js';
|
|
3
5
|
import './chunk-XV4MDWHF.js';
|
|
4
6
|
import './chunk-YCVRQZT3.js';
|
|
5
7
|
import './chunk-VT237QF2.js';
|
|
@@ -7,15 +9,14 @@ import './chunk-CGNVHN4V.js';
|
|
|
7
9
|
import './chunk-K6BWJ7ZY.js';
|
|
8
10
|
import './chunk-VPAUN75Q.js';
|
|
9
11
|
import './chunk-MEKI37WI.js';
|
|
10
|
-
export { WebhookSignatureError, verifyWebhookSignature } from './chunk-VGTRKXF2.js';
|
|
11
12
|
import './chunk-6JFNBAKV.js';
|
|
12
13
|
import './chunk-OJDBSKC2.js';
|
|
13
14
|
import './chunk-CRCPRZFN.js';
|
|
14
15
|
import './chunk-D3PW7AHZ.js';
|
|
15
16
|
import './chunk-BKP6F2IX.js';
|
|
16
17
|
import './chunk-PMTM26LL.js';
|
|
18
|
+
import './chunk-RQ6GE7KG.js';
|
|
17
19
|
import './chunk-LHRQXWI5.js';
|
|
18
|
-
import './chunk-6NTKEXT5.js';
|
|
19
20
|
import './chunk-OLPA44QJ.js';
|
|
20
21
|
export { USAGE_GROUP_BYS, WORKSPACE_HEADER } from './chunk-RKVRCNMB.js';
|
|
21
22
|
import './chunk-HLHR3R4P.js';
|
|
@@ -54,25 +55,26 @@ import './chunk-M6Y5TOYE.js';
|
|
|
54
55
|
import './chunk-KARJ7P7Y.js';
|
|
55
56
|
import './chunk-SUCHGNYT.js';
|
|
56
57
|
import './chunk-SLPD47SR.js';
|
|
57
|
-
export { NodaroClient, createClient } from './chunk-
|
|
58
|
+
export { NodaroClient, createClient } from './chunk-LTRJNCXB.js';
|
|
59
|
+
export { WebhooksResource } from './chunk-YN6CBIIB.js';
|
|
58
60
|
export { WorkflowsResource } from './chunk-33HT46A3.js';
|
|
59
61
|
export { WorkspacesResource } from './chunk-Z5GLY4R3.js';
|
|
62
|
+
export { TrashResource } from './chunk-2SQ7V6EX.js';
|
|
60
63
|
export { TrendRadarResource } from './chunk-TLTPIS2A.js';
|
|
61
64
|
export { TrendsResource } from './chunk-OVFH7L2T.js';
|
|
62
65
|
export { TutorialsResource } from './chunk-HPXE3NZW.js';
|
|
63
|
-
export { UploadsResource } from './chunk-
|
|
66
|
+
export { UploadsResource } from './chunk-YEOK5A5H.js';
|
|
64
67
|
export { UserSettingsResource } from './chunk-LR5TGCJP.js';
|
|
65
68
|
export { VideoProResource } from './chunk-ERLXU47J.js';
|
|
66
|
-
export { VoicesResource } from './chunk-
|
|
67
|
-
export { WebhooksResource } from './chunk-YN6CBIIB.js';
|
|
69
|
+
export { VoicesResource } from './chunk-JZO5WWKX.js';
|
|
68
70
|
export { ReduceResource } from './chunk-IHKIYVZQ.js';
|
|
69
71
|
export { SavedPostsResource } from './chunk-NCCBS6GU.js';
|
|
70
72
|
export { SCENE3D_DELIVERY_ASSET_USAGE, Scene3DResource } from './chunk-NNHWH7ER.js';
|
|
71
73
|
export { SessionsResource } from './chunk-WS4ZQ4AA.js';
|
|
72
74
|
export { ShotsResource } from './chunk-WVFAQBS7.js';
|
|
73
|
-
export { StudioProductionsResource, StudioResource, isStudioGenerateEstimate } from './chunk-
|
|
75
|
+
export { StudioProductionsResource, StudioResource, isStudioGenerateEstimate } from './chunk-Q6HMDIC4.js';
|
|
76
|
+
export { SurfaceResource } from './chunk-HADYBDBT.js';
|
|
74
77
|
export { TemplatesResource } from './chunk-M7VSFZMV.js';
|
|
75
|
-
export { TrashResource } from './chunk-2SQ7V6EX.js';
|
|
76
78
|
export { OBJECT_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS, OBJECT_ASSET_TYPES, OBJECT_ATTACH_COLUMNS, ObjectsResource } from './chunk-GIQDM2MH.js';
|
|
77
79
|
export { OrganizationsResource } from './chunk-ALSLZG3U.js';
|
|
78
80
|
export { PALETTE_DIRECTION_PREFIX, PalettesResource, paletteDirectionId } from './chunk-WEQWU2IC.js';
|
|
@@ -83,33 +85,33 @@ export { PromptHelperResource } from './chunk-OIPPTBW4.js';
|
|
|
83
85
|
export { RecastResource } from './chunk-AJVSMNPZ.js';
|
|
84
86
|
export { LlmResource } from './chunk-E37CVHWW.js';
|
|
85
87
|
export { LOCATION_ASSET_TYPES, LOCATION_ATTACH_COLUMNS, LocationsResource, SURROUND_DIRECTIONS } from './chunk-XZPSJG2X.js';
|
|
86
|
-
export { MediaResource } from './chunk-
|
|
87
|
-
export { ModelsResource } from './chunk-
|
|
88
|
+
export { MediaResource } from './chunk-CSIPRLX3.js';
|
|
89
|
+
export { ModelsResource } from './chunk-KNNSGWHO.js';
|
|
88
90
|
export { MOODBOARD_DIRECTION_PREFIX, MoodboardsResource, moodboardDirectionId } from './chunk-YVU2M7MI.js';
|
|
89
91
|
export { PresetsResource } from './chunk-AEUPH7EE.js';
|
|
90
|
-
export { NodesResource } from './chunk-
|
|
92
|
+
export { NodesResource } from './chunk-KEZMNVN3.js';
|
|
91
93
|
export { OAuthResource } from './chunk-Z7LGWNI7.js';
|
|
92
94
|
export { DeveloperAppsResource } from './chunk-65E3JBFZ.js';
|
|
93
|
-
export { CLIP_PACK_MAX_TARGET_SEC, CLIP_PACK_MIN_TARGET_SEC, EditResource, TRAILER_FORMATS, USE_CASE_NODE_TYPES } from './chunk-
|
|
95
|
+
export { CLIP_PACK_MAX_TARGET_SEC, CLIP_PACK_MIN_TARGET_SEC, EditResource, TRAILER_FORMATS, USE_CASE_NODE_TYPES } from './chunk-MYUJEVP6.js';
|
|
94
96
|
export { ExecutionsResource, OUTPUT_BEARING_NODE_STATUSES, nodeStateMayCarryOutput } from './chunk-22XXTB2R.js';
|
|
95
|
-
export { GalleryResource } from './chunk-
|
|
96
|
-
export { JobsResource } from './chunk-
|
|
97
|
+
export { GalleryResource } from './chunk-MC77SD42.js';
|
|
98
|
+
export { JobsResource } from './chunk-ADW6LPRT.js';
|
|
97
99
|
export { KEEPER_KINDS, KeepersResource } from './chunk-MQWZFWHE.js';
|
|
98
|
-
export { LibraryResource } from './chunk-
|
|
100
|
+
export { LibraryResource } from './chunk-GG7DOKTH.js';
|
|
99
101
|
export { CollectionsResource } from './chunk-4WRDR4GN.js';
|
|
100
102
|
export { CommunityResource } from './chunk-SFB4YLCS.js';
|
|
101
103
|
export { CompetitorsResource } from './chunk-BU5A6K4C.js';
|
|
102
104
|
export { ContentRightsResource } from './chunk-HAS6PMQN.js';
|
|
103
|
-
export { CopilotResource } from './chunk-
|
|
104
|
-
import './chunk-
|
|
105
|
-
export { CallbackAuth, NodaroClientCore, StaticTokenAuth, supabaseAuth } from './chunk-
|
|
106
|
-
export { AlreadyRunningError, AppRunVersionChangedError, CREDIT_CAP_CODES, ContinuationPreviewPendingError, ContinuationRefusedError, CreditCapExceededError, ForbiddenError, IMPORT_REFUSAL_CODES, ImportRefusedError, InsufficientCreditsError, JobAbortedError, JobBlockedError, JobFailedError, JobHeldError, JobTimeoutError, MODEL_UNAVAILABLE_CODES, ModelUnavailableError, NodaroError, NotFoundError, RateLimitedError, StorageExceededError, StudioOpError, StudioPreviewAppliedError, StudioPreviewUnavailable, UnauthorizedError, WorkflowConflictError, throwFromResponse } from './chunk-
|
|
105
|
+
export { CopilotResource } from './chunk-EBQXAOHW.js';
|
|
106
|
+
import './chunk-JC66EEFI.js';
|
|
107
|
+
export { CallbackAuth, NodaroClientCore, StaticTokenAuth, supabaseAuth } from './chunk-GQU5FXYB.js';
|
|
108
|
+
export { AlreadyRunningError, AppRunVersionChangedError, CREDIT_CAP_CODES, ContinuationPreviewPendingError, ContinuationRefusedError, CreditCapExceededError, ForbiddenError, IMPORT_REFUSAL_CODES, ImportRefusedError, InsufficientCreditsError, JobAbortedError, JobBlockedError, JobFailedError, JobHeldError, JobTimeoutError, MODEL_UNAVAILABLE_CODES, ModelUnavailableError, NodaroError, NotFoundError, RateLimitedError, StorageExceededError, StudioOpError, StudioPreviewAppliedError, StudioPreviewUnavailable, UnauthorizedError, WorkflowConflictError, throwFromResponse } from './chunk-SNPDM72K.js';
|
|
107
109
|
export { OBJECT_ASPECT_DEFAULTS as CREATURE_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS as CREATURE_ASPECT_OPTIONS, CREATURE_ASSET_TYPES, CREATURE_ATTACH_COLUMNS, CreaturesResource } from './chunk-HUYI5G3D.js';
|
|
108
|
-
export { CreditsResource } from './chunk-
|
|
110
|
+
export { CreditsResource } from './chunk-F3AV3TC7.js';
|
|
109
111
|
export { AppsResource } from './chunk-7LODCIQK.js';
|
|
110
112
|
export { AudioResource } from './chunk-OHC4JIUP.js';
|
|
111
|
-
export { BillingResource } from './chunk-
|
|
112
|
-
export { CastSwapResource } from './chunk-
|
|
113
|
+
export { BillingResource } from './chunk-MCXZV3CW.js';
|
|
114
|
+
export { CastSwapResource } from './chunk-LQMJFFST.js';
|
|
113
115
|
export { CatalogsResource } from './chunk-KG4R454Z.js';
|
|
114
116
|
export { CHARACTER_ASPECT_DEFAULTS, CHARACTER_ASPECT_OPTIONS, CHARACTER_STYLES, CharactersResource, PEOPLE, PERSON_DIMENSION_LABELS, PERSON_DIMENSION_ORDER, buildPersonHints, buildPersonSeedPrompt } from './chunk-CBDUHYTR.js';
|
|
115
117
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConnectedReference, DescribedReference } from '@nodaro/shared/types';
|
|
2
2
|
import { VideoCharacterReference } from '@nodaro/shared/video';
|
|
3
|
-
import { ImageEditTargetResolution, ImageAspectRatio, TaskChainedEditProvider, ImageEditProvider, ModifyImageProvider, ImageResolution, ImageQuality, ImageRenderingSpeed, VideoToVideoNodeProvider } from '@nodaro/shared/models';
|
|
3
|
+
import { ImageEditTargetResolution, ImageAspectRatio, TaskChainedEditProvider, ImageEditProvider, ModifyImageProvider, ImageResolution, ImageQuality, ImageBackground, ImageRenderingSpeed, VideoToVideoNodeProvider, TtsOutputFormat } from '@nodaro/shared/models';
|
|
4
4
|
import '@nodaro/shared/nodes';
|
|
5
5
|
import { SocialSearchParams, SocialPost, SocialPlatform, SocialSearchMode } from '@nodaro/shared/social';
|
|
6
6
|
import { GenerateMaskOutput, GenerateMaskRequest, VideoDepthProvider, VideoDepthModelSize, VideoDepthColormap, VideoDepthResolution } from '@nodaro/shared/media';
|
|
@@ -328,6 +328,8 @@ interface ImageToImageParams extends GenerationSessionParams {
|
|
|
328
328
|
referenceImageUrls?: string[];
|
|
329
329
|
resolution?: ImageResolution;
|
|
330
330
|
quality?: ImageQuality;
|
|
331
|
+
/** Image background, on the models that take one. `transparent` renders at 1K. */
|
|
332
|
+
background?: ImageBackground;
|
|
331
333
|
/** 0–1: how far the result may move from the source (taken by the models in `I2I_STRENGTH_SUPPORT`). */
|
|
332
334
|
strength?: number;
|
|
333
335
|
/** `"auto"` on a model without a native auto keeps the source image's shape (the model's nearest ratio). */
|
|
@@ -784,6 +786,18 @@ interface TextToSpeechParams extends GenerationSessionParams {
|
|
|
784
786
|
previousText?: string;
|
|
785
787
|
/** The line spoken just AFTER this one. Same rule as `previousText`. */
|
|
786
788
|
nextText?: string;
|
|
789
|
+
/**
|
|
790
|
+
* Ask for per-word timings: the finished job's `output_data.transcript` carries
|
|
791
|
+
* `words[]` with `startMs` / `endMs`, at no extra credits. Without it the request
|
|
792
|
+
* is exactly the plain one and no `transcript` is written.
|
|
793
|
+
*/
|
|
794
|
+
withTimestamps?: boolean;
|
|
795
|
+
/**
|
|
796
|
+
* The audio file to deliver: `mp3_44100_128` (the default, as before the field
|
|
797
|
+
* existed), `mp3_44100_192` (a higher MP3 bitrate) or `wav_24000` (an uncompressed
|
|
798
|
+
* WAV). Same credits; the job's `audioUrl` ends in `.mp3` or `.wav` accordingly.
|
|
799
|
+
*/
|
|
800
|
+
outputFormat?: TtsOutputFormat;
|
|
787
801
|
[k: string]: unknown;
|
|
788
802
|
}
|
|
789
803
|
/**
|
|
@@ -838,6 +852,8 @@ interface GenerateImageParams extends StructuredReferenceParams, GenerationSessi
|
|
|
838
852
|
* applied once per model. */
|
|
839
853
|
models?: string[];
|
|
840
854
|
/** With `count`, image i gets `seed + i` — one seed would draw the same image every time. */
|
|
855
|
+
/** Image background, on the models that take one. `transparent` renders at 1K. */
|
|
856
|
+
background?: ImageBackground;
|
|
841
857
|
seed?: number;
|
|
842
858
|
/** Flat reference image URLs — appended after `connectedReferences`. */
|
|
843
859
|
referenceImageUrls?: string[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConnectedReference, DescribedReference } from '@nodaro/shared/types';
|
|
2
2
|
import { VideoCharacterReference } from '@nodaro/shared/video';
|
|
3
|
-
import { ImageEditTargetResolution, ImageAspectRatio, TaskChainedEditProvider, ImageEditProvider, ModifyImageProvider, ImageResolution, ImageQuality, ImageRenderingSpeed, VideoToVideoNodeProvider } from '@nodaro/shared/models';
|
|
3
|
+
import { ImageEditTargetResolution, ImageAspectRatio, TaskChainedEditProvider, ImageEditProvider, ModifyImageProvider, ImageResolution, ImageQuality, ImageBackground, ImageRenderingSpeed, VideoToVideoNodeProvider, TtsOutputFormat } from '@nodaro/shared/models';
|
|
4
4
|
import '@nodaro/shared/nodes';
|
|
5
5
|
import { SocialSearchParams, SocialPost, SocialPlatform, SocialSearchMode } from '@nodaro/shared/social';
|
|
6
6
|
import { GenerateMaskOutput, GenerateMaskRequest, VideoDepthProvider, VideoDepthModelSize, VideoDepthColormap, VideoDepthResolution } from '@nodaro/shared/media';
|
|
@@ -328,6 +328,8 @@ interface ImageToImageParams extends GenerationSessionParams {
|
|
|
328
328
|
referenceImageUrls?: string[];
|
|
329
329
|
resolution?: ImageResolution;
|
|
330
330
|
quality?: ImageQuality;
|
|
331
|
+
/** Image background, on the models that take one. `transparent` renders at 1K. */
|
|
332
|
+
background?: ImageBackground;
|
|
331
333
|
/** 0–1: how far the result may move from the source (taken by the models in `I2I_STRENGTH_SUPPORT`). */
|
|
332
334
|
strength?: number;
|
|
333
335
|
/** `"auto"` on a model without a native auto keeps the source image's shape (the model's nearest ratio). */
|
|
@@ -784,6 +786,18 @@ interface TextToSpeechParams extends GenerationSessionParams {
|
|
|
784
786
|
previousText?: string;
|
|
785
787
|
/** The line spoken just AFTER this one. Same rule as `previousText`. */
|
|
786
788
|
nextText?: string;
|
|
789
|
+
/**
|
|
790
|
+
* Ask for per-word timings: the finished job's `output_data.transcript` carries
|
|
791
|
+
* `words[]` with `startMs` / `endMs`, at no extra credits. Without it the request
|
|
792
|
+
* is exactly the plain one and no `transcript` is written.
|
|
793
|
+
*/
|
|
794
|
+
withTimestamps?: boolean;
|
|
795
|
+
/**
|
|
796
|
+
* The audio file to deliver: `mp3_44100_128` (the default, as before the field
|
|
797
|
+
* existed), `mp3_44100_192` (a higher MP3 bitrate) or `wav_24000` (an uncompressed
|
|
798
|
+
* WAV). Same credits; the job's `audioUrl` ends in `.mp3` or `.wav` accordingly.
|
|
799
|
+
*/
|
|
800
|
+
outputFormat?: TtsOutputFormat;
|
|
787
801
|
[k: string]: unknown;
|
|
788
802
|
}
|
|
789
803
|
/**
|
|
@@ -838,6 +852,8 @@ interface GenerateImageParams extends StructuredReferenceParams, GenerationSessi
|
|
|
838
852
|
* applied once per model. */
|
|
839
853
|
models?: string[];
|
|
840
854
|
/** With `count`, image i gets `seed + i` — one seed would draw the same image every time. */
|
|
855
|
+
/** Image background, on the models that take one. `transparent` renders at 1K. */
|
|
856
|
+
background?: ImageBackground;
|
|
841
857
|
seed?: number;
|
|
842
858
|
/** Flat reference image URLs — appended after `connectedReferences`. */
|
|
843
859
|
referenceImageUrls?: string[];
|
|
@@ -3,13 +3,47 @@
|
|
|
3
3
|
var ssr = require('@supabase/ssr');
|
|
4
4
|
|
|
5
5
|
// src/supabase-browser.ts
|
|
6
|
+
function projectLabel(url) {
|
|
7
|
+
return new URL(url).hostname.split(".")[0];
|
|
8
|
+
}
|
|
6
9
|
function legacyStorageKey(url) {
|
|
7
|
-
return `sb-${
|
|
10
|
+
return `sb-${projectLabel(url)}-auth-token`;
|
|
8
11
|
}
|
|
9
12
|
function domainApplies(hostname, cookieDomain) {
|
|
10
13
|
const bare = cookieDomain.replace(/^\./, "");
|
|
11
14
|
return hostname === bare || hostname.endsWith(`.${bare}`);
|
|
12
15
|
}
|
|
16
|
+
function clearRetiredProjectCookies(retiredUrls, currentUrl, scope) {
|
|
17
|
+
if (!retiredUrls?.length || typeof document === "undefined") return;
|
|
18
|
+
try {
|
|
19
|
+
const current = projectLabel(currentUrl);
|
|
20
|
+
const prefixes = [];
|
|
21
|
+
for (const url of retiredUrls) {
|
|
22
|
+
let label;
|
|
23
|
+
try {
|
|
24
|
+
label = projectLabel(url);
|
|
25
|
+
} catch {
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (label && label !== current) prefixes.push(`sb-${label}-`);
|
|
29
|
+
}
|
|
30
|
+
if (prefixes.length === 0) return;
|
|
31
|
+
const own = `sb-${current}-`;
|
|
32
|
+
const names = /* @__PURE__ */ new Set();
|
|
33
|
+
for (const pair of document.cookie.split(";")) {
|
|
34
|
+
const name = pair.split("=")[0].trim();
|
|
35
|
+
if (!name.startsWith(own) && prefixes.some((p) => name.startsWith(p))) {
|
|
36
|
+
names.add(name);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const attributes = `; Path=${scope.path}; Max-Age=0; SameSite=${scope.sameSite}${scope.secure ? "; Secure" : ""}`;
|
|
40
|
+
for (const name of names) {
|
|
41
|
+
if (scope.domain) document.cookie = `${name}=; Domain=${scope.domain}${attributes}`;
|
|
42
|
+
document.cookie = `${name}=${attributes}`;
|
|
43
|
+
}
|
|
44
|
+
} catch {
|
|
45
|
+
}
|
|
46
|
+
}
|
|
13
47
|
function migrateLegacySession(client, url) {
|
|
14
48
|
if (typeof localStorage === "undefined") return null;
|
|
15
49
|
const key = legacyStorageKey(url);
|
|
@@ -33,15 +67,18 @@ function migrateLegacySession(client, url) {
|
|
|
33
67
|
function createSharedSupabaseClient(opts) {
|
|
34
68
|
const hostname = typeof location !== "undefined" ? location.hostname : "";
|
|
35
69
|
const domain = opts.cookieDomain && domainApplies(hostname, opts.cookieDomain) ? opts.cookieDomain : void 0;
|
|
70
|
+
const scope = {
|
|
71
|
+
...domain ? { domain } : {},
|
|
72
|
+
path: "/",
|
|
73
|
+
sameSite: "lax",
|
|
74
|
+
secure: typeof location !== "undefined" && location.protocol === "https:"
|
|
75
|
+
};
|
|
36
76
|
const client = ssr.createBrowserClient(opts.url, opts.anonKey, {
|
|
37
77
|
// Each app keeps its own module-level singleton; per-call instances keep
|
|
38
78
|
// tests deterministic.
|
|
39
79
|
isSingleton: false,
|
|
40
80
|
cookieOptions: {
|
|
41
|
-
...
|
|
42
|
-
path: "/",
|
|
43
|
-
sameSite: "lax",
|
|
44
|
-
secure: typeof location !== "undefined" && location.protocol === "https:",
|
|
81
|
+
...scope,
|
|
45
82
|
// Long-lived cookie; real session validity is governed by refresh-token
|
|
46
83
|
// rotation, not cookie lifetime.
|
|
47
84
|
maxAge: 60 * 60 * 24 * 365
|
|
@@ -55,6 +92,7 @@ function createSharedSupabaseClient(opts) {
|
|
|
55
92
|
lock: async (_name, _acquireTimeout, fn) => fn()
|
|
56
93
|
}
|
|
57
94
|
});
|
|
95
|
+
clearRetiredProjectCookies(opts.retiredSupabaseUrls, opts.url, scope);
|
|
58
96
|
const migration = migrateLegacySession(client, opts.url);
|
|
59
97
|
if (migration) {
|
|
60
98
|
const orig = client.auth.getSession.bind(client.auth);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/supabase-browser.ts"],"names":["createBrowserClient"],"mappings":";;;;;AAwBA,SAAS,iBAAiB,GAAA,EAAqB;AAC7C,EAAA,OAAO,CAAA,GAAA,EAAM,IAAI,GAAA,CAAI,GAAG,CAAA,CAAE,SAAS,KAAA,CAAM,GAAG,CAAA,CAAE,CAAC,CAAC,CAAA,WAAA,CAAA;AAClD;AAEA,SAAS,aAAA,CAAc,UAAkB,YAAA,EAA+B;AACtE,EAAA,MAAM,IAAA,GAAO,YAAA,CAAa,OAAA,CAAQ,KAAA,EAAO,EAAE,CAAA;AAC3C,EAAA,OAAO,aAAa,IAAA,IAAQ,QAAA,CAAS,QAAA,CAAS,CAAA,CAAA,EAAI,IAAI,CAAA,CAAE,CAAA;AAC1D;AASA,SAAS,oBA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A,EAAQ,OAAO,QAAA,KAAa,WAAA,IAAe,SAAS,QAAA,KAAa,QAAA;AAAA;AAAA;AAAA,MAGjE,MAAA,EAAQ,EAAA,GAAK,EAAA,GAAK,EAAA,GAAK;AAAA,KACzB;AAAA,IACA,IAAA,EAAM;AAAA,MACJ,QAAA,EAAU,MAAA;AAAA,MACV,kBAAA,EAAoB,IAAA;AAAA;AAAA;AAAA;AAAA,MAIpB,IAAA,EAAM,OACJ,KAAA,EACA,eAAA,EACA,OACe,EAAA;AAAG;AACtB,GACD,CAAA;AAED,EAAA,MAAM,SAAA,GAAY,oBAAA,CAAqB,MAAA,EAA+B,IAAA,CAAK,GAAG,CAAA;AAC9E,EAAA,IAAI,SAAA,EAAW;AAGb,IAAA,MAAM,OAAO,MAAA,CAAO,IAAA,CAAK,UAAA,CAAW,IAAA,CAAK,OAAO,IAAI,CAAA;AACpD,IAAA,MAAA,CAAO,IAAA,CAAK,aAAa,YAAY;AACnC,MAAA,MAAM,SAAA;AACN,MAAA,OAAO,IAAA,EAAK;AAAA,IACd,CAAA;AAAA,EACF;AAEA,EAAA,OAAO,MAAA;AACT","file":"supabase-browser.cjs","sourcesContent":["import { createBrowserClient } from \"@supabase/ssr\"\nimport type { SupabaseClient } from \"@supabase/supabase-js\"\n\n/**\n * Browser Supabase client with session storage in cookies instead of\n * localStorage, so several apps on sibling subdomains (e.g. app/studio/voice\n * on *.nodaro.ai) share one login: sign in on any of them, signed in on all;\n * sign out anywhere, signed out everywhere (supabase-js signOut defaults to\n * the global scope).\n */\nexport interface SharedSupabaseOptions {\n /** Supabase project URL (https://<ref>.supabase.co). */\n url: string\n anonKey: string\n /**\n * Cookie Domain for cross-subdomain sharing (e.g. \".nodaro.ai\"). Applied\n * only when the page's hostname is that domain or a subdomain of it; on any\n * other host (localhost, preview URLs) cookies stay host-only, which keeps\n * local dev on per-origin sessions.\n */\n cookieDomain?: string\n}\n\n/** supabase-js's default localStorage key: `sb-<project-ref>-auth-token`. */\nfunction legacyStorageKey(url: string): string {\n return `sb-${new URL(url).hostname.split(\".\")[0]}-auth-token`\n}\n\nfunction domainApplies(hostname: string, cookieDomain: string): boolean {\n const bare = cookieDomain.replace(/^\\./, \"\")\n return hostname === bare || hostname.endsWith(`.${bare}`)\n}\n\n/**\n * One-time adoption of a pre-cookie session this origin left in localStorage,\n * so already-signed-in users survive the storage switch. setSession persists\n * through the client's (cookie) storage; dead tokens reject and the user is\n * simply signed out. The legacy key is removed in every outcome.\n * Returns null when there is nothing to migrate.\n */\nfunction migrateLegacySession(\n client: SupabaseClient<any>,\n url: string\n): Promise<void> | null {\n if (typeof localStorage === \"undefined\") return null\n const key = legacyStorageKey(url)\n const raw = localStorage.getItem(key)\n if (!raw) return null\n return (async () => {\n try {\n const parsed = JSON.parse(raw) as {\n access_token?: string\n refresh_token?: string\n }\n if (parsed.access_token && parsed.refresh_token) {\n await client.auth.setSession({\n access_token: parsed.access_token,\n refresh_token: parsed.refresh_token,\n })\n }\n } catch {\n // Unparseable or dead legacy session — discard; the user logs in again.\n } finally {\n localStorage.removeItem(key)\n }\n })()\n}\n\nexport function createSharedSupabaseClient<Db = any>(\n opts: SharedSupabaseOptions\n): SupabaseClient<Db> {\n const hostname = typeof location !== \"undefined\" ? location.hostname : \"\"\n const domain =\n opts.cookieDomain && domainApplies(hostname, opts.cookieDomain)\n ? opts.cookieDomain\n : undefined\n\n const client = createBrowserClient<Db>(opts.url, opts.anonKey, {\n // Each app keeps its own module-level singleton; per-call instances keep\n // tests deterministic.\n isSingleton: false,\n cookieOptions: {\n ...(domain ? { domain } : {}),\n path: \"/\",\n sameSite: \"lax\",\n secure: typeof location !== \"undefined\" && location.protocol === \"https:\",\n // Long-lived cookie; real session validity is governed by refresh-token\n // rotation, not cookie lifetime.\n maxAge: 60 * 60 * 24 * 365,\n },\n auth: {\n flowType: \"pkce\",\n detectSessionInUrl: true,\n // Bypass Navigator Lock API: prevents AbortError from\n // @supabase/auth-js/locks.ts during session synchronization; cross-tab\n // coordination is non-critical for these apps.\n lock: async <R>(\n _name: string,\n _acquireTimeout: number,\n fn: () => Promise<R>\n ): Promise<R> => fn(),\n },\n })\n\n const migration = migrateLegacySession(client as SupabaseClient<any>, opts.url)\n if (migration) {\n // Gate reads on the one-time migration so the first getSession() after the\n // storage switch can't race it — keeps call sites unchanged in the apps.\n const orig = client.auth.getSession.bind(client.auth)\n client.auth.getSession = async () => {\n await migration\n return orig()\n }\n }\n\n return client\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/supabase-browser.ts"],"names":["createBrowserClient"],"mappings":";;;;;AA2CA,SAAS,aAAa,GAAA,EAAqB;AACzC,EAAA,OAAO,IAAI,IAAI,GAAG,CAAA,CAAE,SAAS,KAAA,CAAM,GAAG,EAAE,CAAC,CAAA;AAC3C;AAGA,SAAS,iBAAiB,GAAA,EAAqB;AAC7C,EAAA,OAAO,CAAA,GAAA,EAAM,YAAA,CAAa,GAAG,CAAC,CAAA,WAAA,CAAA;AAChC;AAEA,SAAS,aAAA,CAAc,UAAkB,YAAA,EAA+B;AACtE,EAAA,MAAM,IAAA,GAAO,YAAA,CAAa,OAAA,CAAQ,KAAA,EAAO,EAAE,CAAA;AAC3C,EAAA,OAAO,aAAa,IAAA,IAAQ,QAAA,CAAS,QAAA,CAAS,CAAA,CAAA,EAAI,IAAI,CAAA,CAAE,CAAA;AAC1D;AAoBA,SAAS,0BAAA,CACP,WAAA,EACA,UAAA,EACA,KAAA,EACM;AACN,EAAA,IAAI,CAAC,WAAA,EAAa,MAAA,IAAU,OAAO,aAAa,WAAA,EAAa;AAC7D,EAAA,IAAI;AACF,IAAA,MAAM,OAAA,GAAU,aAAa,UAAU,CAAA;AACvC,IAAA,MAAM,WAAqB,EAAC;AAC5B,IAAA,KAAA,MAAW,OAAO,WAAA,EAAa;AAC7B,MAAA,IAAI,KAAA;AACJ,MAAA,IAAI;AACF,QAAA,KAAA,GAAQ,aAAa,GAAG,CAAA;AAAA,MAC1B,CAAA,CAAA,MAAQ;AACN,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AAA,EAAK,KAAK,OAAA,EAAS;AAAA;AAAA;AAAA,IAG7D,WAAA,EAAa,KAAA;AAAA,IACb,aAAA,EAAe;AAAA,MACb,GAAG,KAAA;AAAA;AAAA;AAAA,MAGH,MAAA,EAAQ,EAAA,GAAK,EAAA,GAAK,EAAA,GAAK;AAAA,KACzB;AAAA,IACA,IAAA,EAAM;AAAA,MACJ,QAAA,EAAU,MAAA;AAAA,MACV,kBAAA,EAAoB,IAAA;AAAA;AAAA;AAAA;AAAA,MAIpB,IAAA,EAAM,OACJ,KAAA,EACA,eAAA,EACA,OACe,EAAA;AAAG;AACtB,GACD,CAAA;AAED,EAAA,0BAAA,CAA2B,IAAA,CAAK,mBAAA,EAAqB,IAAA,CAAK,GAAA,EAAK,KAAK,CAAA;AAEpE,EAAA,MAAM,SAAA,GAAY,oBAAA,CAAqB,MAAA,EAA+B,IAAA,CAAK,GAAG,CAAA;AAC9E,EAAA,IAAI,SAAA,EAAW;AAGb,IAAA,MAAM,OAAO,MAAA,CAAO,IAAA,CAAK,UAAA,CAAW,IAAA,CAAK,OAAO,IAAI,CAAA;AACpD,IAAA,MAAA,CAAO,IAAA,CAAK,aAAa,YAAY;AACnC,MAAA,MAAM,SAAA;AACN,MAAA,OAAO,IAAA,EAAK;AAAA,IACd,CAAA;AAAA,EACF;AAEA,EAAA,OAAO,MAAA;AACT","file":"supabase-browser.cjs","sourcesContent":["import { createBrowserClient } from \"@supabase/ssr\"\nimport type { SupabaseClient } from \"@supabase/supabase-js\"\n\n/**\n * Browser Supabase client with session storage in cookies instead of\n * localStorage, so several apps on sibling subdomains (e.g. app/studio/voice\n * on *.nodaro.ai) share one login: sign in on any of them, signed in on all;\n * sign out anywhere, signed out everywhere (supabase-js signOut defaults to\n * the global scope).\n */\nexport interface SharedSupabaseOptions {\n /** Supabase project URL (https://<ref>.supabase.co). */\n url: string\n anonKey: string\n /**\n * Cookie Domain for cross-subdomain sharing (e.g. \".nodaro.ai\"). Applied\n * only when the page's hostname is that domain or a subdomain of it; on any\n * other host (localhost, preview URLs) cookies stay host-only, which keeps\n * local dev on per-origin sessions.\n */\n cookieDomain?: string\n /**\n * Supabase project URLs this deployment no longer uses, such as a project\n * it moved away from. Creating the client in a browser deletes the cookies\n * such a project left behind: every cookie named `sb-<project-ref>-…` (the\n * session and its chunks, the PKCE code verifiers, the stored user), both\n * on `cookieDomain` and host-only. Nothing reads them any more, yet the\n * browser sends them with every request to every host they cover until\n * they expire, a year after their last write. The current project (`url`)\n * is never cleared, even when it is listed.\n */\n retiredSupabaseUrls?: readonly string[]\n}\n\n/** Where the client's cookies live; a delete has to match it to take effect. */\ninterface CookieScope {\n domain?: string\n path: string\n sameSite: \"lax\"\n secure: boolean\n}\n\n/** First label of a project URL's host: the `<project-ref>` of supabase-js's storage key. */\nfunction projectLabel(url: string): string {\n return new URL(url).hostname.split(\".\")[0]\n}\n\n/** supabase-js's default localStorage key: `sb-<project-ref>-auth-token`. */\nfunction legacyStorageKey(url: string): string {\n return `sb-${projectLabel(url)}-auth-token`\n}\n\nfunction domainApplies(hostname: string, cookieDomain: string): boolean {\n const bare = cookieDomain.replace(/^\\./, \"\")\n return hostname === bare || hostname.endsWith(`.${bare}`)\n}\n\n/**\n * Deletes the cookies the retired projects left in this browser: every name\n * starting `sb-<project-ref>-`, at both places one can live, on the cookie\n * domain (when it applies here) and host-only, written with `Max-Age=0` and\n * the client's own Path/SameSite/Secure.\n *\n * The current project is never touched. Its label is skipped even when\n * listed, and a name under its own prefix is kept even when a retired prefix\n * also matches it (a retired `auth` beside a current `auth-eu`).\n *\n * Deliberately an explicit list, not \"every project but this one\": two\n * projects in use at once (production and a staging project on the same\n * parent domain, say) can share one cookie domain, and that rule would have\n * each of them delete the other's sessions.\n *\n * Best effort: a page that cannot touch its cookies (a sandboxed frame)\n * simply keeps them.\n */\nfunction clearRetiredProjectCookies(\n retiredUrls: readonly string[] | undefined,\n currentUrl: string,\n scope: CookieScope\n): void {\n if (!retiredUrls?.length || typeof document === \"undefined\") return\n try {\n const current = projectLabel(currentUrl)\n const prefixes: string[] = []\n for (const url of retiredUrls) {\n let label: string\n try {\n label = projectLabel(url)\n } catch {\n continue // not a URL\n }\n if (label && label !== current) prefixes.push(`sb-${label}-`)\n }\n if (prefixes.length === 0) return\n\n const own = `sb-${current}-`\n const names = new Set<string>()\n for (const pair of document.cookie.split(\";\")) {\n const name = pair.split(\"=\")[0].trim()\n if (!name.startsWith(own) && prefixes.some((p) => name.startsWith(p))) {\n names.add(name)\n }\n }\n const attributes = `; Path=${scope.path}; Max-Age=0; SameSite=${scope.sameSite}${scope.secure ? \"; Secure\" : \"\"}`\n for (const name of names) {\n if (scope.domain) document.cookie = `${name}=; Domain=${scope.domain}${attributes}`\n document.cookie = `${name}=${attributes}`\n }\n } catch {\n // Cookies are not available on this page; there is nothing to clear.\n }\n}\n\n/**\n * One-time adoption of a pre-cookie session this origin left in localStorage,\n * so already-signed-in users survive the storage switch. setSession persists\n * through the client's (cookie) storage; dead tokens reject and the user is\n * simply signed out. The legacy key is removed in every outcome.\n * Returns null when there is nothing to migrate.\n */\nfunction migrateLegacySession(\n client: SupabaseClient<any>,\n url: string\n): Promise<void> | null {\n if (typeof localStorage === \"undefined\") return null\n const key = legacyStorageKey(url)\n const raw = localStorage.getItem(key)\n if (!raw) return null\n return (async () => {\n try {\n const parsed = JSON.parse(raw) as {\n access_token?: string\n refresh_token?: string\n }\n if (parsed.access_token && parsed.refresh_token) {\n await client.auth.setSession({\n access_token: parsed.access_token,\n refresh_token: parsed.refresh_token,\n })\n }\n } catch {\n // Unparseable or dead legacy session — discard; the user logs in again.\n } finally {\n localStorage.removeItem(key)\n }\n })()\n}\n\nexport function createSharedSupabaseClient<Db = any>(\n opts: SharedSupabaseOptions\n): SupabaseClient<Db> {\n const hostname = typeof location !== \"undefined\" ? location.hostname : \"\"\n const domain =\n opts.cookieDomain && domainApplies(hostname, opts.cookieDomain)\n ? opts.cookieDomain\n : undefined\n // One scope for the cookies the client writes and the ones it deletes.\n const scope: CookieScope = {\n ...(domain ? { domain } : {}),\n path: \"/\",\n sameSite: \"lax\",\n secure: typeof location !== \"undefined\" && location.protocol === \"https:\",\n }\n\n const client = createBrowserClient<Db>(opts.url, opts.anonKey, {\n // Each app keeps its own module-level singleton; per-call instances keep\n // tests deterministic.\n isSingleton: false,\n cookieOptions: {\n ...scope,\n // Long-lived cookie; real session validity is governed by refresh-token\n // rotation, not cookie lifetime.\n maxAge: 60 * 60 * 24 * 365,\n },\n auth: {\n flowType: \"pkce\",\n detectSessionInUrl: true,\n // Bypass Navigator Lock API: prevents AbortError from\n // @supabase/auth-js/locks.ts during session synchronization; cross-tab\n // coordination is non-critical for these apps.\n lock: async <R>(\n _name: string,\n _acquireTimeout: number,\n fn: () => Promise<R>\n ): Promise<R> => fn(),\n },\n })\n\n clearRetiredProjectCookies(opts.retiredSupabaseUrls, opts.url, scope)\n\n const migration = migrateLegacySession(client as SupabaseClient<any>, opts.url)\n if (migration) {\n // Gate reads on the one-time migration so the first getSession() after the\n // storage switch can't race it — keeps call sites unchanged in the apps.\n const orig = client.auth.getSession.bind(client.auth)\n client.auth.getSession = async () => {\n await migration\n return orig()\n }\n }\n\n return client\n}\n"]}
|
|
@@ -18,6 +18,17 @@ interface SharedSupabaseOptions {
|
|
|
18
18
|
* local dev on per-origin sessions.
|
|
19
19
|
*/
|
|
20
20
|
cookieDomain?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Supabase project URLs this deployment no longer uses, such as a project
|
|
23
|
+
* it moved away from. Creating the client in a browser deletes the cookies
|
|
24
|
+
* such a project left behind: every cookie named `sb-<project-ref>-…` (the
|
|
25
|
+
* session and its chunks, the PKCE code verifiers, the stored user), both
|
|
26
|
+
* on `cookieDomain` and host-only. Nothing reads them any more, yet the
|
|
27
|
+
* browser sends them with every request to every host they cover until
|
|
28
|
+
* they expire, a year after their last write. The current project (`url`)
|
|
29
|
+
* is never cleared, even when it is listed.
|
|
30
|
+
*/
|
|
31
|
+
retiredSupabaseUrls?: readonly string[];
|
|
21
32
|
}
|
|
22
33
|
declare function createSharedSupabaseClient<Db = any>(opts: SharedSupabaseOptions): SupabaseClient<Db>;
|
|
23
34
|
|
|
@@ -18,6 +18,17 @@ interface SharedSupabaseOptions {
|
|
|
18
18
|
* local dev on per-origin sessions.
|
|
19
19
|
*/
|
|
20
20
|
cookieDomain?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Supabase project URLs this deployment no longer uses, such as a project
|
|
23
|
+
* it moved away from. Creating the client in a browser deletes the cookies
|
|
24
|
+
* such a project left behind: every cookie named `sb-<project-ref>-…` (the
|
|
25
|
+
* session and its chunks, the PKCE code verifiers, the stored user), both
|
|
26
|
+
* on `cookieDomain` and host-only. Nothing reads them any more, yet the
|
|
27
|
+
* browser sends them with every request to every host they cover until
|
|
28
|
+
* they expire, a year after their last write. The current project (`url`)
|
|
29
|
+
* is never cleared, even when it is listed.
|
|
30
|
+
*/
|
|
31
|
+
retiredSupabaseUrls?: readonly string[];
|
|
21
32
|
}
|
|
22
33
|
declare function createSharedSupabaseClient<Db = any>(opts: SharedSupabaseOptions): SupabaseClient<Db>;
|
|
23
34
|
|
package/dist/supabase-browser.js
CHANGED
|
@@ -1,13 +1,47 @@
|
|
|
1
1
|
import { createBrowserClient } from '@supabase/ssr';
|
|
2
2
|
|
|
3
3
|
// src/supabase-browser.ts
|
|
4
|
+
function projectLabel(url) {
|
|
5
|
+
return new URL(url).hostname.split(".")[0];
|
|
6
|
+
}
|
|
4
7
|
function legacyStorageKey(url) {
|
|
5
|
-
return `sb-${
|
|
8
|
+
return `sb-${projectLabel(url)}-auth-token`;
|
|
6
9
|
}
|
|
7
10
|
function domainApplies(hostname, cookieDomain) {
|
|
8
11
|
const bare = cookieDomain.replace(/^\./, "");
|
|
9
12
|
return hostname === bare || hostname.endsWith(`.${bare}`);
|
|
10
13
|
}
|
|
14
|
+
function clearRetiredProjectCookies(retiredUrls, currentUrl, scope) {
|
|
15
|
+
if (!retiredUrls?.length || typeof document === "undefined") return;
|
|
16
|
+
try {
|
|
17
|
+
const current = projectLabel(currentUrl);
|
|
18
|
+
const prefixes = [];
|
|
19
|
+
for (const url of retiredUrls) {
|
|
20
|
+
let label;
|
|
21
|
+
try {
|
|
22
|
+
label = projectLabel(url);
|
|
23
|
+
} catch {
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
if (label && label !== current) prefixes.push(`sb-${label}-`);
|
|
27
|
+
}
|
|
28
|
+
if (prefixes.length === 0) return;
|
|
29
|
+
const own = `sb-${current}-`;
|
|
30
|
+
const names = /* @__PURE__ */ new Set();
|
|
31
|
+
for (const pair of document.cookie.split(";")) {
|
|
32
|
+
const name = pair.split("=")[0].trim();
|
|
33
|
+
if (!name.startsWith(own) && prefixes.some((p) => name.startsWith(p))) {
|
|
34
|
+
names.add(name);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const attributes = `; Path=${scope.path}; Max-Age=0; SameSite=${scope.sameSite}${scope.secure ? "; Secure" : ""}`;
|
|
38
|
+
for (const name of names) {
|
|
39
|
+
if (scope.domain) document.cookie = `${name}=; Domain=${scope.domain}${attributes}`;
|
|
40
|
+
document.cookie = `${name}=${attributes}`;
|
|
41
|
+
}
|
|
42
|
+
} catch {
|
|
43
|
+
}
|
|
44
|
+
}
|
|
11
45
|
function migrateLegacySession(client, url) {
|
|
12
46
|
if (typeof localStorage === "undefined") return null;
|
|
13
47
|
const key = legacyStorageKey(url);
|
|
@@ -31,15 +65,18 @@ function migrateLegacySession(client, url) {
|
|
|
31
65
|
function createSharedSupabaseClient(opts) {
|
|
32
66
|
const hostname = typeof location !== "undefined" ? location.hostname : "";
|
|
33
67
|
const domain = opts.cookieDomain && domainApplies(hostname, opts.cookieDomain) ? opts.cookieDomain : void 0;
|
|
68
|
+
const scope = {
|
|
69
|
+
...domain ? { domain } : {},
|
|
70
|
+
path: "/",
|
|
71
|
+
sameSite: "lax",
|
|
72
|
+
secure: typeof location !== "undefined" && location.protocol === "https:"
|
|
73
|
+
};
|
|
34
74
|
const client = createBrowserClient(opts.url, opts.anonKey, {
|
|
35
75
|
// Each app keeps its own module-level singleton; per-call instances keep
|
|
36
76
|
// tests deterministic.
|
|
37
77
|
isSingleton: false,
|
|
38
78
|
cookieOptions: {
|
|
39
|
-
...
|
|
40
|
-
path: "/",
|
|
41
|
-
sameSite: "lax",
|
|
42
|
-
secure: typeof location !== "undefined" && location.protocol === "https:",
|
|
79
|
+
...scope,
|
|
43
80
|
// Long-lived cookie; real session validity is governed by refresh-token
|
|
44
81
|
// rotation, not cookie lifetime.
|
|
45
82
|
maxAge: 60 * 60 * 24 * 365
|
|
@@ -53,6 +90,7 @@ function createSharedSupabaseClient(opts) {
|
|
|
53
90
|
lock: async (_name, _acquireTimeout, fn) => fn()
|
|
54
91
|
}
|
|
55
92
|
});
|
|
93
|
+
clearRetiredProjectCookies(opts.retiredSupabaseUrls, opts.url, scope);
|
|
56
94
|
const migration = migrateLegacySession(client, opts.url);
|
|
57
95
|
if (migration) {
|
|
58
96
|
const orig = client.auth.getSession.bind(client.auth);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/supabase-browser.ts"],"names":[],"mappings":";;;AAwBA,SAAS,iBAAiB,GAAA,EAAqB;AAC7C,EAAA,OAAO,CAAA,GAAA,EAAM,IAAI,GAAA,CAAI,GAAG,CAAA,CAAE,SAAS,KAAA,CAAM,GAAG,CAAA,CAAE,CAAC,CAAC,CAAA,WAAA,CAAA;AAClD;AAEA,SAAS,aAAA,CAAc,UAAkB,YAAA,EAA+B;AACtE,EAAA,MAAM,IAAA,GAAO,YAAA,CAAa,OAAA,CAAQ,KAAA,EAAO,EAAE,CAAA;AAC3C,EAAA,OAAO,aAAa,IAAA,IAAQ,QAAA,CAAS,QAAA,CAAS,CAAA,CAAA,EAAI,IAAI,CAAA,CAAE,CAAA;AAC1D;AASA,SAAS,oBAAA,CACP,QACA,GAAA,EACsB;AACtB,EAAA,IAAI,OAAO,YAAA,KAAiB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A;AAAA;AAAA;AAAA,MAGjE,MAAA,EAAQ,EAAA,GAAK,EAAA,GAAK,EAAA,GAAK;AAAA,KACzB;AAAA,IACA,IAAA,EAAM;AAAA,MACJ,QAAA,EAAU,MAAA;AAAA,MACV,kBAAA,EAAoB,IAAA;AAAA;AAAA;AAAA;AAAA,MAIpB,IAAA,EAAM,OACJ,KAAA,EACA,eAAA,EACA,OACe,EAAA;AAAG;AACtB,GACD,CAAA;AAED,EAAA,MAAM,SAAA,GAAY,oBAAA,CAAqB,MAAA,EAA+B,IAAA,CAAK,GAAG,CAAA;AAC9E,EAAA,IAAI,SAAA,EAAW;AAGb,IAAA,MAAM,OAAO,MAAA,CAAO,IAAA,CAAK,UAAA,CAAW,IAAA,CAAK,OAAO,IAAI,CAAA;AACpD,IAAA,MAAA,CAAO,IAAA,CAAK,aAAa,YAAY;AACnC,MAAA,MAAM,SAAA;AACN,MAAA,OAAO,IAAA,EAAK;AAAA,IACd,CAAA;AAAA,EACF;AAEA,EAAA,OAAO,MAAA;AACT","file":"supabase-browser.js","sourcesContent":["import { createBrowserClient } from \"@supabase/ssr\"\nimport type { SupabaseClient } from \"@supabase/supabase-js\"\n\n/**\n * Browser Supabase client with session storage in cookies instead of\n * localStorage, so several apps on sibling subdomains (e.g. app/studio/voice\n * on *.nodaro.ai) share one login: sign in on any of them, signed in on all;\n * sign out anywhere, signed out everywhere (supabase-js signOut defaults to\n * the global scope).\n */\nexport interface SharedSupabaseOptions {\n /** Supabase project URL (https://<ref>.supabase.co). */\n url: string\n anonKey: string\n /**\n * Cookie Domain for cross-subdomain sharing (e.g. \".nodaro.ai\"). Applied\n * only when the page's hostname is that domain or a subdomain of it; on any\n * other host (localhost, preview URLs) cookies stay host-only, which keeps\n * local dev on per-origin sessions.\n */\n cookieDomain?: string\n}\n\n/** supabase-js's default localStorage key: `sb-<project-ref>-auth-token`. */\nfunction legacyStorageKey(url: string): string {\n return `sb-${new URL(url).hostname.split(\".\")[0]}-auth-token`\n}\n\nfunction domainApplies(hostname: string, cookieDomain: string): boolean {\n const bare = cookieDomain.replace(/^\\./, \"\")\n return hostname === bare || hostname.endsWith(`.${bare}`)\n}\n\n/**\n * One-time adoption of a pre-cookie session this origin left in localStorage,\n * so already-signed-in users survive the storage switch. setSession persists\n * through the client's (cookie) storage; dead tokens reject and the user is\n * simply signed out. The legacy key is removed in every outcome.\n * Returns null when there is nothing to migrate.\n */\nfunction migrateLegacySession(\n client: SupabaseClient<any>,\n url: string\n): Promise<void> | null {\n if (typeof localStorage === \"undefined\") return null\n const key = legacyStorageKey(url)\n const raw = localStorage.getItem(key)\n if (!raw) return null\n return (async () => {\n try {\n const parsed = JSON.parse(raw) as {\n access_token?: string\n refresh_token?: string\n }\n if (parsed.access_token && parsed.refresh_token) {\n await client.auth.setSession({\n access_token: parsed.access_token,\n refresh_token: parsed.refresh_token,\n })\n }\n } catch {\n // Unparseable or dead legacy session — discard; the user logs in again.\n } finally {\n localStorage.removeItem(key)\n }\n })()\n}\n\nexport function createSharedSupabaseClient<Db = any>(\n opts: SharedSupabaseOptions\n): SupabaseClient<Db> {\n const hostname = typeof location !== \"undefined\" ? location.hostname : \"\"\n const domain =\n opts.cookieDomain && domainApplies(hostname, opts.cookieDomain)\n ? opts.cookieDomain\n : undefined\n\n const client = createBrowserClient<Db>(opts.url, opts.anonKey, {\n // Each app keeps its own module-level singleton; per-call instances keep\n // tests deterministic.\n isSingleton: false,\n cookieOptions: {\n ...(domain ? { domain } : {}),\n path: \"/\",\n sameSite: \"lax\",\n secure: typeof location !== \"undefined\" && location.protocol === \"https:\",\n // Long-lived cookie; real session validity is governed by refresh-token\n // rotation, not cookie lifetime.\n maxAge: 60 * 60 * 24 * 365,\n },\n auth: {\n flowType: \"pkce\",\n detectSessionInUrl: true,\n // Bypass Navigator Lock API: prevents AbortError from\n // @supabase/auth-js/locks.ts during session synchronization; cross-tab\n // coordination is non-critical for these apps.\n lock: async <R>(\n _name: string,\n _acquireTimeout: number,\n fn: () => Promise<R>\n ): Promise<R> => fn(),\n },\n })\n\n const migration = migrateLegacySession(client as SupabaseClient<any>, opts.url)\n if (migration) {\n // Gate reads on the one-time migration so the first getSession() after the\n // storage switch can't race it — keeps call sites unchanged in the apps.\n const orig = client.auth.getSession.bind(client.auth)\n client.auth.getSession = async () => {\n await migration\n return orig()\n }\n }\n\n return client\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/supabase-browser.ts"],"names":[],"mappings":";;;AA2CA,SAAS,aAAa,GAAA,EAAqB;AACzC,EAAA,OAAO,IAAI,IAAI,GAAG,CAAA,CAAE,SAAS,KAAA,CAAM,GAAG,EAAE,CAAC,CAAA;AAC3C;AAGA,SAAS,iBAAiB,GAAA,EAAqB;AAC7C,EAAA,OAAO,CAAA,GAAA,EAAM,YAAA,CAAa,GAAG,CAAC,CAAA,WAAA,CAAA;AAChC;AAEA,SAAS,aAAA,CAAc,UAAkB,YAAA,EAA+B;AACtE,EAAA,MAAM,IAAA,GAAO,YAAA,CAAa,OAAA,CAAQ,KAAA,EAAO,EAAE,CAAA;AAC3C,EAAA,OAAO,aAAa,IAAA,IAAQ,QAAA,CAAS,QAAA,CAAS,CAAA,CAAA,EAAI,IAAI,CAAA,CAAE,CAAA;AAC1D;AAoBA,SAAS,0BAAA,CACP,WAAA,EACA,UAAA,EACA,KAAA,EACM;AACN,EAAA,IAAI,CAAC,WAAA,EAAa,MAAA,IAAU,OAAO,aAAa,WAAA,EAAa;AAC7D,EAAA,IAAI;AACF,IAAA,MAAM,OAAA,GAAU,aAAa,UAAU,CAAA;AACvC,IAAA,MAAM,WAAqB,EAAC;AAC5B,IAAA,KAAA,MAAW,OAAO,WAAA,EAAa;AAC7B,MAAA,IAAI,KAAA;AACJ,MAAA,IAAI;AACF,QAAA,KAAA,GAAQ,aAAa,GAAG,CAAA;AAAA,MAC1B,CAAA,CAAA,MAAQ;AACN,QAAA;AAAA,MACF;AACA,MAAA,IAAI,SAAS,KAAA,KAAU,OAAA,WAAkB,IAAA,CAAK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A,IACb,aAAA,EAAe;AAAA,MACb,GAAG,KAAA;AAAA;AAAA;AAAA,MAGH,MAAA,EAAQ,EAAA,GAAK,EAAA,GAAK,EAAA,GAAK;AAAA,KACzB;AAAA,IACA,IAAA,EAAM;AAAA,MACJ,QAAA,EAAU,MAAA;AAAA,MACV,kBAAA,EAAoB,IAAA;AAAA;AAAA;AAAA;AAAA,MAIpB,IAAA,EAAM,OACJ,KAAA,EACA,eAAA,EACA,OACe,EAAA;AAAG;AACtB,GACD,CAAA;AAED,EAAA,0BAAA,CAA2B,IAAA,CAAK,mBAAA,EAAqB,IAAA,CAAK,GAAA,EAAK,KAAK,CAAA;AAEpE,EAAA,MAAM,SAAA,GAAY,oBAAA,CAAqB,MAAA,EAA+B,IAAA,CAAK,GAAG,CAAA;AAC9E,EAAA,IAAI,SAAA,EAAW;AAGb,IAAA,MAAM,OAAO,MAAA,CAAO,IAAA,CAAK,UAAA,CAAW,IAAA,CAAK,OAAO,IAAI,CAAA;AACpD,IAAA,MAAA,CAAO,IAAA,CAAK,aAAa,YAAY;AACnC,MAAA,MAAM,SAAA;AACN,MAAA,OAAO,IAAA,EAAK;AAAA,IACd,CAAA;AAAA,EACF;AAEA,EAAA,OAAO,MAAA;AACT","file":"supabase-browser.js","sourcesContent":["import { createBrowserClient } from \"@supabase/ssr\"\nimport type { SupabaseClient } from \"@supabase/supabase-js\"\n\n/**\n * Browser Supabase client with session storage in cookies instead of\n * localStorage, so several apps on sibling subdomains (e.g. app/studio/voice\n * on *.nodaro.ai) share one login: sign in on any of them, signed in on all;\n * sign out anywhere, signed out everywhere (supabase-js signOut defaults to\n * the global scope).\n */\nexport interface SharedSupabaseOptions {\n /** Supabase project URL (https://<ref>.supabase.co). */\n url: string\n anonKey: string\n /**\n * Cookie Domain for cross-subdomain sharing (e.g. \".nodaro.ai\"). Applied\n * only when the page's hostname is that domain or a subdomain of it; on any\n * other host (localhost, preview URLs) cookies stay host-only, which keeps\n * local dev on per-origin sessions.\n */\n cookieDomain?: string\n /**\n * Supabase project URLs this deployment no longer uses, such as a project\n * it moved away from. Creating the client in a browser deletes the cookies\n * such a project left behind: every cookie named `sb-<project-ref>-…` (the\n * session and its chunks, the PKCE code verifiers, the stored user), both\n * on `cookieDomain` and host-only. Nothing reads them any more, yet the\n * browser sends them with every request to every host they cover until\n * they expire, a year after their last write. The current project (`url`)\n * is never cleared, even when it is listed.\n */\n retiredSupabaseUrls?: readonly string[]\n}\n\n/** Where the client's cookies live; a delete has to match it to take effect. */\ninterface CookieScope {\n domain?: string\n path: string\n sameSite: \"lax\"\n secure: boolean\n}\n\n/** First label of a project URL's host: the `<project-ref>` of supabase-js's storage key. */\nfunction projectLabel(url: string): string {\n return new URL(url).hostname.split(\".\")[0]\n}\n\n/** supabase-js's default localStorage key: `sb-<project-ref>-auth-token`. */\nfunction legacyStorageKey(url: string): string {\n return `sb-${projectLabel(url)}-auth-token`\n}\n\nfunction domainApplies(hostname: string, cookieDomain: string): boolean {\n const bare = cookieDomain.replace(/^\\./, \"\")\n return hostname === bare || hostname.endsWith(`.${bare}`)\n}\n\n/**\n * Deletes the cookies the retired projects left in this browser: every name\n * starting `sb-<project-ref>-`, at both places one can live, on the cookie\n * domain (when it applies here) and host-only, written with `Max-Age=0` and\n * the client's own Path/SameSite/Secure.\n *\n * The current project is never touched. Its label is skipped even when\n * listed, and a name under its own prefix is kept even when a retired prefix\n * also matches it (a retired `auth` beside a current `auth-eu`).\n *\n * Deliberately an explicit list, not \"every project but this one\": two\n * projects in use at once (production and a staging project on the same\n * parent domain, say) can share one cookie domain, and that rule would have\n * each of them delete the other's sessions.\n *\n * Best effort: a page that cannot touch its cookies (a sandboxed frame)\n * simply keeps them.\n */\nfunction clearRetiredProjectCookies(\n retiredUrls: readonly string[] | undefined,\n currentUrl: string,\n scope: CookieScope\n): void {\n if (!retiredUrls?.length || typeof document === \"undefined\") return\n try {\n const current = projectLabel(currentUrl)\n const prefixes: string[] = []\n for (const url of retiredUrls) {\n let label: string\n try {\n label = projectLabel(url)\n } catch {\n continue // not a URL\n }\n if (label && label !== current) prefixes.push(`sb-${label}-`)\n }\n if (prefixes.length === 0) return\n\n const own = `sb-${current}-`\n const names = new Set<string>()\n for (const pair of document.cookie.split(\";\")) {\n const name = pair.split(\"=\")[0].trim()\n if (!name.startsWith(own) && prefixes.some((p) => name.startsWith(p))) {\n names.add(name)\n }\n }\n const attributes = `; Path=${scope.path}; Max-Age=0; SameSite=${scope.sameSite}${scope.secure ? \"; Secure\" : \"\"}`\n for (const name of names) {\n if (scope.domain) document.cookie = `${name}=; Domain=${scope.domain}${attributes}`\n document.cookie = `${name}=${attributes}`\n }\n } catch {\n // Cookies are not available on this page; there is nothing to clear.\n }\n}\n\n/**\n * One-time adoption of a pre-cookie session this origin left in localStorage,\n * so already-signed-in users survive the storage switch. setSession persists\n * through the client's (cookie) storage; dead tokens reject and the user is\n * simply signed out. The legacy key is removed in every outcome.\n * Returns null when there is nothing to migrate.\n */\nfunction migrateLegacySession(\n client: SupabaseClient<any>,\n url: string\n): Promise<void> | null {\n if (typeof localStorage === \"undefined\") return null\n const key = legacyStorageKey(url)\n const raw = localStorage.getItem(key)\n if (!raw) return null\n return (async () => {\n try {\n const parsed = JSON.parse(raw) as {\n access_token?: string\n refresh_token?: string\n }\n if (parsed.access_token && parsed.refresh_token) {\n await client.auth.setSession({\n access_token: parsed.access_token,\n refresh_token: parsed.refresh_token,\n })\n }\n } catch {\n // Unparseable or dead legacy session — discard; the user logs in again.\n } finally {\n localStorage.removeItem(key)\n }\n })()\n}\n\nexport function createSharedSupabaseClient<Db = any>(\n opts: SharedSupabaseOptions\n): SupabaseClient<Db> {\n const hostname = typeof location !== \"undefined\" ? location.hostname : \"\"\n const domain =\n opts.cookieDomain && domainApplies(hostname, opts.cookieDomain)\n ? opts.cookieDomain\n : undefined\n // One scope for the cookies the client writes and the ones it deletes.\n const scope: CookieScope = {\n ...(domain ? { domain } : {}),\n path: \"/\",\n sameSite: \"lax\",\n secure: typeof location !== \"undefined\" && location.protocol === \"https:\",\n }\n\n const client = createBrowserClient<Db>(opts.url, opts.anonKey, {\n // Each app keeps its own module-level singleton; per-call instances keep\n // tests deterministic.\n isSingleton: false,\n cookieOptions: {\n ...scope,\n // Long-lived cookie; real session validity is governed by refresh-token\n // rotation, not cookie lifetime.\n maxAge: 60 * 60 * 24 * 365,\n },\n auth: {\n flowType: \"pkce\",\n detectSessionInUrl: true,\n // Bypass Navigator Lock API: prevents AbortError from\n // @supabase/auth-js/locks.ts during session synchronization; cross-tab\n // coordination is non-critical for these apps.\n lock: async <R>(\n _name: string,\n _acquireTimeout: number,\n fn: () => Promise<R>\n ): Promise<R> => fn(),\n },\n })\n\n clearRetiredProjectCookies(opts.retiredSupabaseUrls, opts.url, scope)\n\n const migration = migrateLegacySession(client as SupabaseClient<any>, opts.url)\n if (migration) {\n // Gate reads on the one-time migration so the first getSession() after the\n // storage switch can't race it — keeps call sites unchanged in the apps.\n const orig = client.auth.getSession.bind(client.auth)\n client.auth.getSession = async () => {\n await migration\n return orig()\n }\n }\n\n return client\n}\n"]}
|