@streamoid/settings 0.22.0 → 0.22.2

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/index.d.mts CHANGED
@@ -1767,6 +1767,24 @@ declare const BILLING_TABLE_PAGER_STYLE: CSSProperties;
1767
1767
  */
1768
1768
  declare function productsForCountry(products: readonly BillingProduct[], country: string | null | undefined): BillingProduct[];
1769
1769
 
1770
+ /**
1771
+ * What an Invoice history row can download, decided by its `transactionId`:
1772
+ *
1773
+ * - `in_…` — a Stripe invoice; billing returns its `invoice_pdf`.
1774
+ * - `pi_…` — a one-off payment; billing returns the receipt PDF it generated.
1775
+ * - anything else — `null`. Billing's own `T-…` / `TG-…` ids (rollovers,
1776
+ * bonuses, offline and manual credits) have no invoice or receipt behind
1777
+ * them, and asking billing for one fails.
1778
+ *
1779
+ * One rule so the row's Download cell, its click and the export agree.
1780
+ */
1781
+ type InvoiceDownloadKind = "invoice" | "receipt";
1782
+ declare function invoiceDownloadKind(item: Pick<UsageHistoryItem, "transactionId">): InvoiceDownloadKind | null;
1783
+ /** Shown when a row has nothing to download. */
1784
+ declare const INVOICE_NOT_AVAILABLE_MESSAGE = "There's no invoice for this order. Rolled-over, bonus and manually added credits don't have one.";
1785
+ /** Leads the toast when billing could not hand back a PDF for a row that should have one. */
1786
+ declare const INVOICE_DOWNLOAD_FAILED_MESSAGE = "Couldn't download this invoice.";
1787
+
1770
1788
  /** Rows on one page of Billing's Usage logs table. */
1771
1789
  declare const USAGE_LOGS_PAGE_SIZE = 50;
1772
1790
  /** Rows per request while exporting: billing's own `limit` ceiling. */
@@ -3097,4 +3115,4 @@ interface AppSettingsRowProps {
3097
3115
  }
3098
3116
  declare function AppSettingsRow({ title, description, summary, href, onClick, disabled, disabledReason, ariaLabel, trailing }: AppSettingsRowProps): react.JSX.Element;
3099
3117
 
3100
- export { APP_KEYS, type AddCreditPoolMemberInput, AdministrationOverview, type AdministrationOverviewProps, type AdministrativeNavigationOptions, type ApiToken, type AppKey, AppSettingsHeader, type AppSettingsHeaderProps, AppSettingsPage, type AppSettingsPageProps, AppSettingsRow, type AppSettingsRowProps, AppSettingsSection, type AppSettingsSectionProps, type AvailableCreditsResponse, BILLING_TABLE_FRAME_STYLE, BILLING_TABLE_MIN_HEIGHT, BILLING_TABLE_PAGER_STYLE, BillingContent, type BillingEntitlement, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type ConnectedApp, ConnectedAppsContent, type CreatedToken, type CreditCycleUnit, type CreditLimitUnit, type CreditLimitValidation, type CreditPoolCandidate, type CreditPoolFormerMember, type CreditPoolMember, CreditPoolMemberModal, type CreditPoolMemberModalProps, type CreditPoolMemberStatus, type CreditPoolMode, type CreditPoolResponse, type CreditPoolSelfShare, type CreditsMeter, type CurrentPlanState, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, DEFAULT_USER_LANGUAGE, EMPTY_USAGE_LOGS_PAGE, ExportDateModal, type FetchUsageLogs, type FetchUsageLogsInRangeOptions, INITIAL_USAGE_LOGS_STATE, InviteUpdateModal, type InvoicePdfResponse, type LoginMethodsMember, type LoginMethodsSettings, type LoginMethodsSwitchState, MOCK_REFERRED_USERS, type MemberCreditLimit, MemberCreditLimitModal, type MemberCreditLimitRow, type MemberCreditLimitSource, type MemberCreditLimitsResponse, MemberListFrame, type MemberListFrameProps, type MemberListTab, MemberListToolbar, type MemberListToolbarProps, type MemberPermissionsPayload, OrganizationContent, type OrganizationData, type OrganizationDetails, OrganizationIntegrationsContent, type OrganizationInvite, type OrganizationJoinRequest, type OrganizationJoinableWorkspace, OrganizationLoginMethodsContent, type OrganizationMember, OrganizationMemberModal, type OrganizationMemberModalProps, type OrganizationMemberRole, OrganizationModal, OrganizationPicker, type OrganizationPickerItem, type OrganizationPickerProps, type OrganizationPickerType, type OrganizationView, type OrganizationWorkspaceItem, POOL_ERROR_CODES, POOL_EXPIRY_MAX_MONTHS, POOL_NOTE_MAX_LENGTH, PerUserLimitsView, type PoolEndsAtResult, type PoolErrorCode, type PoolExpiryChoice, type PoolValueValidation, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, REMOVE_REASON_MAX_LENGTH, ReferralHistoryView, type ReferralHistoryViewProps, ReferralTab, type ReferredUser, RemovePoolMemberModal, type RemovePoolMemberModalProps, RemoveSelfShareModal, type RemoveSelfShareModalProps, SCOPE_LABELS, ScopeHeader, type ScopeHeaderProps, type ServiceItem, type SetCreditPoolSelfShareInput, type SettingsAdapters, SettingsAdaptersProvider, type SettingsApiAdapter, type SettingsAuthAdapter, type SettingsAuthUser, SettingsContent, type SettingsContentProps, type SettingsImageUploadAdapter, type SettingsIntegrationsAdapter, type SettingsLoginMethodsAdapter, type SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCreateOptions, type SettingsOrganizationCurrent, type SettingsOrganizationJoinableItem, type SettingsOrganizationListItem, type SettingsOrganizationType, type SettingsScope, type SettingsTab, type SettingsToastAdapter, SettingsTooltip, type SettingsTooltipPlacement, type SettingsTooltipProps, type SettingsWorkspaceAdapter, type SettingsWorkspaceCurrent, type SettingsWorkspaceListItem, SharedCreditsView, type SharedPoolBalance, SiconKey, type SponsorShareBalance, type StoreItem, type SubscriptionPlan, type SubscriptionResponse, TAB_DESCRIPTIONS, TAB_LABELS, TAB_SCOPE, TAB_TO_URL, type TeamMember, TeamsContent, type TokenExpiry, TokensContent, URL_TO_TAB, USAGE_LOGS_EXPORT_BATCH_SIZE, USAGE_LOGS_EXPORT_EXTRA_REQUESTS, USAGE_LOGS_EXPORT_MAX_ROWS, USAGE_LOGS_PAGE_SIZE, USER_LANGUAGES, type UpdateCreditPoolMemberInput, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryPagination, type UsageHistoryResponse, type UsageLogsAction, type UsageLogsExportResult, type UsageLogsPage, UsageLogsPager, type UsageLogsQuery, type UsageLogsState, type UsedByNamesLoader, type UserLanguage, type UserPermissions, WORKSPACE_CREDIT_LIMIT_REACHED, WORKSPACE_CREDIT_LIMIT_REACHED_MESSAGE, WORKSPACE_LIST_PAGE_SIZE, type WorkspaceCreditLimit, WorkspaceCreditLimitCard, type WorkspaceCreditLimitSummary, type WorkspaceData, WorkspaceGeneralTab, type WorkspaceGeneralTabProps, type WorkspaceInvite, type WorkspaceListOrganization, WorkspaceListTab, type WorkspaceMember, WorkspaceModal, type WorkspaceOrganization, type WorkspaceOrganizationRequest, WorkspacePicker, type WorkspacePickerGroup, type WorkspacePickerItem, type WorkspacePickerProps, WorkspaceTab, type WorkspaceUsageResponse, aboveTotalReason, belowUsageReason, canManageOnlyWorkspaceCreditLimit, canShowSharedCredits, checkPoolPercentTotal, cleanCreditLimitInput, cleanPoolValueInput, countLabel, createUsedByNamesLoader, creditCycleUnit, creditsMeter, deriveWorkspaceInvitePermission, describeAllowance, describeDefaultLimit, describeMemberLimit, describeWorkspaceCreditLimit, entitlementFromBody, entitlementFromFailure, expiryChoiceFor, fetchUsageLogsInRange, findBillingError, findPoolError, formatCreditLimit, formatCredits, formatPoolEndsAt, formatPoolSplit, groupWorkspaceList, hasPaidFeatures, inviteUpdate, isLimitAboveTotal, isLimitBelowUsage, isPaidPlan, isSponsoredEntitlement, isWorkspaceCreditLimitReached, joinMembersWithLimits, lastUsedLabel, limitAboveTotalTotal, limitBelowUsageUsed, limitSourceLabel, loadCurrentPlan, loadWorkspaceOrganization, loginMethodsSwitchState, maximumCreditLimit, memberRoleUpdate, minPoolEndDate, minimumCreditLimit, ownCreditsFirstText, parseBillingEntitlement, parseInviteEmails, pausedOwnCreditsText, poolAllocatedPercent, poolAllocationText, poolEndsAtFrom, poolErrorMessage, poolRenewsAtCycleEnd, poolUnallocatedPercent, poolWorkspaceName, productsForCountry, readSettingsCaller, referralCodeOf, referralCountLabel, referralLink, referralSignupDate, rememberSettingsCaller, resolveSettingsTabFromPath, roundCredits, settingsReturnTarget, sharedPoolBannerText, sharedPoolEndsText, sliceUsageLogsPage, sortReferredUsers, sponsorShareBannerText, sponsorShareDetailText, sponsorShareSpentText, sponsoredCreditsText, ssoLabel, toCsv, toLocalDateInput, usageLogsCsvRows, usageLogsDateRange, usageLogsExportFileName, usageLogsPage, usageLogsReducer, usageLogsReloadPage, usageLogsSpentByOthers, useBillingEntitlement, useSettingsAdapters, useWorkspaceInvitePermission, useWorkspaceOrganization, usedByNamesFrom, usedByWorkspaceKey, userLanguageLabel, validateCreditLimitInput, validateDefaultCreditLimitInput, validatePoolText, validatePoolValue };
3118
+ export { APP_KEYS, type AddCreditPoolMemberInput, AdministrationOverview, type AdministrationOverviewProps, type AdministrativeNavigationOptions, type ApiToken, type AppKey, AppSettingsHeader, type AppSettingsHeaderProps, AppSettingsPage, type AppSettingsPageProps, AppSettingsRow, type AppSettingsRowProps, AppSettingsSection, type AppSettingsSectionProps, type AvailableCreditsResponse, BILLING_TABLE_FRAME_STYLE, BILLING_TABLE_MIN_HEIGHT, BILLING_TABLE_PAGER_STYLE, BillingContent, type BillingEntitlement, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type ConnectedApp, ConnectedAppsContent, type CreatedToken, type CreditCycleUnit, type CreditLimitUnit, type CreditLimitValidation, type CreditPoolCandidate, type CreditPoolFormerMember, type CreditPoolMember, CreditPoolMemberModal, type CreditPoolMemberModalProps, type CreditPoolMemberStatus, type CreditPoolMode, type CreditPoolResponse, type CreditPoolSelfShare, type CreditsMeter, type CurrentPlanState, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, DEFAULT_USER_LANGUAGE, EMPTY_USAGE_LOGS_PAGE, ExportDateModal, type FetchUsageLogs, type FetchUsageLogsInRangeOptions, INITIAL_USAGE_LOGS_STATE, INVOICE_DOWNLOAD_FAILED_MESSAGE, INVOICE_NOT_AVAILABLE_MESSAGE, InviteUpdateModal, type InvoiceDownloadKind, type InvoicePdfResponse, type LoginMethodsMember, type LoginMethodsSettings, type LoginMethodsSwitchState, MOCK_REFERRED_USERS, type MemberCreditLimit, MemberCreditLimitModal, type MemberCreditLimitRow, type MemberCreditLimitSource, type MemberCreditLimitsResponse, MemberListFrame, type MemberListFrameProps, type MemberListTab, MemberListToolbar, type MemberListToolbarProps, type MemberPermissionsPayload, OrganizationContent, type OrganizationData, type OrganizationDetails, OrganizationIntegrationsContent, type OrganizationInvite, type OrganizationJoinRequest, type OrganizationJoinableWorkspace, OrganizationLoginMethodsContent, type OrganizationMember, OrganizationMemberModal, type OrganizationMemberModalProps, type OrganizationMemberRole, OrganizationModal, OrganizationPicker, type OrganizationPickerItem, type OrganizationPickerProps, type OrganizationPickerType, type OrganizationView, type OrganizationWorkspaceItem, POOL_ERROR_CODES, POOL_EXPIRY_MAX_MONTHS, POOL_NOTE_MAX_LENGTH, PerUserLimitsView, type PoolEndsAtResult, type PoolErrorCode, type PoolExpiryChoice, type PoolValueValidation, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, REMOVE_REASON_MAX_LENGTH, ReferralHistoryView, type ReferralHistoryViewProps, ReferralTab, type ReferredUser, RemovePoolMemberModal, type RemovePoolMemberModalProps, RemoveSelfShareModal, type RemoveSelfShareModalProps, SCOPE_LABELS, ScopeHeader, type ScopeHeaderProps, type ServiceItem, type SetCreditPoolSelfShareInput, type SettingsAdapters, SettingsAdaptersProvider, type SettingsApiAdapter, type SettingsAuthAdapter, type SettingsAuthUser, SettingsContent, type SettingsContentProps, type SettingsImageUploadAdapter, type SettingsIntegrationsAdapter, type SettingsLoginMethodsAdapter, type SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCreateOptions, type SettingsOrganizationCurrent, type SettingsOrganizationJoinableItem, type SettingsOrganizationListItem, type SettingsOrganizationType, type SettingsScope, type SettingsTab, type SettingsToastAdapter, SettingsTooltip, type SettingsTooltipPlacement, type SettingsTooltipProps, type SettingsWorkspaceAdapter, type SettingsWorkspaceCurrent, type SettingsWorkspaceListItem, SharedCreditsView, type SharedPoolBalance, SiconKey, type SponsorShareBalance, type StoreItem, type SubscriptionPlan, type SubscriptionResponse, TAB_DESCRIPTIONS, TAB_LABELS, TAB_SCOPE, TAB_TO_URL, type TeamMember, TeamsContent, type TokenExpiry, TokensContent, URL_TO_TAB, USAGE_LOGS_EXPORT_BATCH_SIZE, USAGE_LOGS_EXPORT_EXTRA_REQUESTS, USAGE_LOGS_EXPORT_MAX_ROWS, USAGE_LOGS_PAGE_SIZE, USER_LANGUAGES, type UpdateCreditPoolMemberInput, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryPagination, type UsageHistoryResponse, type UsageLogsAction, type UsageLogsExportResult, type UsageLogsPage, UsageLogsPager, type UsageLogsQuery, type UsageLogsState, type UsedByNamesLoader, type UserLanguage, type UserPermissions, WORKSPACE_CREDIT_LIMIT_REACHED, WORKSPACE_CREDIT_LIMIT_REACHED_MESSAGE, WORKSPACE_LIST_PAGE_SIZE, type WorkspaceCreditLimit, WorkspaceCreditLimitCard, type WorkspaceCreditLimitSummary, type WorkspaceData, WorkspaceGeneralTab, type WorkspaceGeneralTabProps, type WorkspaceInvite, type WorkspaceListOrganization, WorkspaceListTab, type WorkspaceMember, WorkspaceModal, type WorkspaceOrganization, type WorkspaceOrganizationRequest, WorkspacePicker, type WorkspacePickerGroup, type WorkspacePickerItem, type WorkspacePickerProps, WorkspaceTab, type WorkspaceUsageResponse, aboveTotalReason, belowUsageReason, canManageOnlyWorkspaceCreditLimit, canShowSharedCredits, checkPoolPercentTotal, cleanCreditLimitInput, cleanPoolValueInput, countLabel, createUsedByNamesLoader, creditCycleUnit, creditsMeter, deriveWorkspaceInvitePermission, describeAllowance, describeDefaultLimit, describeMemberLimit, describeWorkspaceCreditLimit, entitlementFromBody, entitlementFromFailure, expiryChoiceFor, fetchUsageLogsInRange, findBillingError, findPoolError, formatCreditLimit, formatCredits, formatPoolEndsAt, formatPoolSplit, groupWorkspaceList, hasPaidFeatures, inviteUpdate, invoiceDownloadKind, isLimitAboveTotal, isLimitBelowUsage, isPaidPlan, isSponsoredEntitlement, isWorkspaceCreditLimitReached, joinMembersWithLimits, lastUsedLabel, limitAboveTotalTotal, limitBelowUsageUsed, limitSourceLabel, loadCurrentPlan, loadWorkspaceOrganization, loginMethodsSwitchState, maximumCreditLimit, memberRoleUpdate, minPoolEndDate, minimumCreditLimit, ownCreditsFirstText, parseBillingEntitlement, parseInviteEmails, pausedOwnCreditsText, poolAllocatedPercent, poolAllocationText, poolEndsAtFrom, poolErrorMessage, poolRenewsAtCycleEnd, poolUnallocatedPercent, poolWorkspaceName, productsForCountry, readSettingsCaller, referralCodeOf, referralCountLabel, referralLink, referralSignupDate, rememberSettingsCaller, resolveSettingsTabFromPath, roundCredits, settingsReturnTarget, sharedPoolBannerText, sharedPoolEndsText, sliceUsageLogsPage, sortReferredUsers, sponsorShareBannerText, sponsorShareDetailText, sponsorShareSpentText, sponsoredCreditsText, ssoLabel, toCsv, toLocalDateInput, usageLogsCsvRows, usageLogsDateRange, usageLogsExportFileName, usageLogsPage, usageLogsReducer, usageLogsReloadPage, usageLogsSpentByOthers, useBillingEntitlement, useSettingsAdapters, useWorkspaceInvitePermission, useWorkspaceOrganization, usedByNamesFrom, usedByWorkspaceKey, userLanguageLabel, validateCreditLimitInput, validateDefaultCreditLimitInput, validatePoolText, validatePoolValue };
package/dist/index.d.ts CHANGED
@@ -1767,6 +1767,24 @@ declare const BILLING_TABLE_PAGER_STYLE: CSSProperties;
1767
1767
  */
1768
1768
  declare function productsForCountry(products: readonly BillingProduct[], country: string | null | undefined): BillingProduct[];
1769
1769
 
1770
+ /**
1771
+ * What an Invoice history row can download, decided by its `transactionId`:
1772
+ *
1773
+ * - `in_…` — a Stripe invoice; billing returns its `invoice_pdf`.
1774
+ * - `pi_…` — a one-off payment; billing returns the receipt PDF it generated.
1775
+ * - anything else — `null`. Billing's own `T-…` / `TG-…` ids (rollovers,
1776
+ * bonuses, offline and manual credits) have no invoice or receipt behind
1777
+ * them, and asking billing for one fails.
1778
+ *
1779
+ * One rule so the row's Download cell, its click and the export agree.
1780
+ */
1781
+ type InvoiceDownloadKind = "invoice" | "receipt";
1782
+ declare function invoiceDownloadKind(item: Pick<UsageHistoryItem, "transactionId">): InvoiceDownloadKind | null;
1783
+ /** Shown when a row has nothing to download. */
1784
+ declare const INVOICE_NOT_AVAILABLE_MESSAGE = "There's no invoice for this order. Rolled-over, bonus and manually added credits don't have one.";
1785
+ /** Leads the toast when billing could not hand back a PDF for a row that should have one. */
1786
+ declare const INVOICE_DOWNLOAD_FAILED_MESSAGE = "Couldn't download this invoice.";
1787
+
1770
1788
  /** Rows on one page of Billing's Usage logs table. */
1771
1789
  declare const USAGE_LOGS_PAGE_SIZE = 50;
1772
1790
  /** Rows per request while exporting: billing's own `limit` ceiling. */
@@ -3097,4 +3115,4 @@ interface AppSettingsRowProps {
3097
3115
  }
3098
3116
  declare function AppSettingsRow({ title, description, summary, href, onClick, disabled, disabledReason, ariaLabel, trailing }: AppSettingsRowProps): react.JSX.Element;
3099
3117
 
3100
- export { APP_KEYS, type AddCreditPoolMemberInput, AdministrationOverview, type AdministrationOverviewProps, type AdministrativeNavigationOptions, type ApiToken, type AppKey, AppSettingsHeader, type AppSettingsHeaderProps, AppSettingsPage, type AppSettingsPageProps, AppSettingsRow, type AppSettingsRowProps, AppSettingsSection, type AppSettingsSectionProps, type AvailableCreditsResponse, BILLING_TABLE_FRAME_STYLE, BILLING_TABLE_MIN_HEIGHT, BILLING_TABLE_PAGER_STYLE, BillingContent, type BillingEntitlement, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type ConnectedApp, ConnectedAppsContent, type CreatedToken, type CreditCycleUnit, type CreditLimitUnit, type CreditLimitValidation, type CreditPoolCandidate, type CreditPoolFormerMember, type CreditPoolMember, CreditPoolMemberModal, type CreditPoolMemberModalProps, type CreditPoolMemberStatus, type CreditPoolMode, type CreditPoolResponse, type CreditPoolSelfShare, type CreditsMeter, type CurrentPlanState, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, DEFAULT_USER_LANGUAGE, EMPTY_USAGE_LOGS_PAGE, ExportDateModal, type FetchUsageLogs, type FetchUsageLogsInRangeOptions, INITIAL_USAGE_LOGS_STATE, InviteUpdateModal, type InvoicePdfResponse, type LoginMethodsMember, type LoginMethodsSettings, type LoginMethodsSwitchState, MOCK_REFERRED_USERS, type MemberCreditLimit, MemberCreditLimitModal, type MemberCreditLimitRow, type MemberCreditLimitSource, type MemberCreditLimitsResponse, MemberListFrame, type MemberListFrameProps, type MemberListTab, MemberListToolbar, type MemberListToolbarProps, type MemberPermissionsPayload, OrganizationContent, type OrganizationData, type OrganizationDetails, OrganizationIntegrationsContent, type OrganizationInvite, type OrganizationJoinRequest, type OrganizationJoinableWorkspace, OrganizationLoginMethodsContent, type OrganizationMember, OrganizationMemberModal, type OrganizationMemberModalProps, type OrganizationMemberRole, OrganizationModal, OrganizationPicker, type OrganizationPickerItem, type OrganizationPickerProps, type OrganizationPickerType, type OrganizationView, type OrganizationWorkspaceItem, POOL_ERROR_CODES, POOL_EXPIRY_MAX_MONTHS, POOL_NOTE_MAX_LENGTH, PerUserLimitsView, type PoolEndsAtResult, type PoolErrorCode, type PoolExpiryChoice, type PoolValueValidation, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, REMOVE_REASON_MAX_LENGTH, ReferralHistoryView, type ReferralHistoryViewProps, ReferralTab, type ReferredUser, RemovePoolMemberModal, type RemovePoolMemberModalProps, RemoveSelfShareModal, type RemoveSelfShareModalProps, SCOPE_LABELS, ScopeHeader, type ScopeHeaderProps, type ServiceItem, type SetCreditPoolSelfShareInput, type SettingsAdapters, SettingsAdaptersProvider, type SettingsApiAdapter, type SettingsAuthAdapter, type SettingsAuthUser, SettingsContent, type SettingsContentProps, type SettingsImageUploadAdapter, type SettingsIntegrationsAdapter, type SettingsLoginMethodsAdapter, type SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCreateOptions, type SettingsOrganizationCurrent, type SettingsOrganizationJoinableItem, type SettingsOrganizationListItem, type SettingsOrganizationType, type SettingsScope, type SettingsTab, type SettingsToastAdapter, SettingsTooltip, type SettingsTooltipPlacement, type SettingsTooltipProps, type SettingsWorkspaceAdapter, type SettingsWorkspaceCurrent, type SettingsWorkspaceListItem, SharedCreditsView, type SharedPoolBalance, SiconKey, type SponsorShareBalance, type StoreItem, type SubscriptionPlan, type SubscriptionResponse, TAB_DESCRIPTIONS, TAB_LABELS, TAB_SCOPE, TAB_TO_URL, type TeamMember, TeamsContent, type TokenExpiry, TokensContent, URL_TO_TAB, USAGE_LOGS_EXPORT_BATCH_SIZE, USAGE_LOGS_EXPORT_EXTRA_REQUESTS, USAGE_LOGS_EXPORT_MAX_ROWS, USAGE_LOGS_PAGE_SIZE, USER_LANGUAGES, type UpdateCreditPoolMemberInput, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryPagination, type UsageHistoryResponse, type UsageLogsAction, type UsageLogsExportResult, type UsageLogsPage, UsageLogsPager, type UsageLogsQuery, type UsageLogsState, type UsedByNamesLoader, type UserLanguage, type UserPermissions, WORKSPACE_CREDIT_LIMIT_REACHED, WORKSPACE_CREDIT_LIMIT_REACHED_MESSAGE, WORKSPACE_LIST_PAGE_SIZE, type WorkspaceCreditLimit, WorkspaceCreditLimitCard, type WorkspaceCreditLimitSummary, type WorkspaceData, WorkspaceGeneralTab, type WorkspaceGeneralTabProps, type WorkspaceInvite, type WorkspaceListOrganization, WorkspaceListTab, type WorkspaceMember, WorkspaceModal, type WorkspaceOrganization, type WorkspaceOrganizationRequest, WorkspacePicker, type WorkspacePickerGroup, type WorkspacePickerItem, type WorkspacePickerProps, WorkspaceTab, type WorkspaceUsageResponse, aboveTotalReason, belowUsageReason, canManageOnlyWorkspaceCreditLimit, canShowSharedCredits, checkPoolPercentTotal, cleanCreditLimitInput, cleanPoolValueInput, countLabel, createUsedByNamesLoader, creditCycleUnit, creditsMeter, deriveWorkspaceInvitePermission, describeAllowance, describeDefaultLimit, describeMemberLimit, describeWorkspaceCreditLimit, entitlementFromBody, entitlementFromFailure, expiryChoiceFor, fetchUsageLogsInRange, findBillingError, findPoolError, formatCreditLimit, formatCredits, formatPoolEndsAt, formatPoolSplit, groupWorkspaceList, hasPaidFeatures, inviteUpdate, isLimitAboveTotal, isLimitBelowUsage, isPaidPlan, isSponsoredEntitlement, isWorkspaceCreditLimitReached, joinMembersWithLimits, lastUsedLabel, limitAboveTotalTotal, limitBelowUsageUsed, limitSourceLabel, loadCurrentPlan, loadWorkspaceOrganization, loginMethodsSwitchState, maximumCreditLimit, memberRoleUpdate, minPoolEndDate, minimumCreditLimit, ownCreditsFirstText, parseBillingEntitlement, parseInviteEmails, pausedOwnCreditsText, poolAllocatedPercent, poolAllocationText, poolEndsAtFrom, poolErrorMessage, poolRenewsAtCycleEnd, poolUnallocatedPercent, poolWorkspaceName, productsForCountry, readSettingsCaller, referralCodeOf, referralCountLabel, referralLink, referralSignupDate, rememberSettingsCaller, resolveSettingsTabFromPath, roundCredits, settingsReturnTarget, sharedPoolBannerText, sharedPoolEndsText, sliceUsageLogsPage, sortReferredUsers, sponsorShareBannerText, sponsorShareDetailText, sponsorShareSpentText, sponsoredCreditsText, ssoLabel, toCsv, toLocalDateInput, usageLogsCsvRows, usageLogsDateRange, usageLogsExportFileName, usageLogsPage, usageLogsReducer, usageLogsReloadPage, usageLogsSpentByOthers, useBillingEntitlement, useSettingsAdapters, useWorkspaceInvitePermission, useWorkspaceOrganization, usedByNamesFrom, usedByWorkspaceKey, userLanguageLabel, validateCreditLimitInput, validateDefaultCreditLimitInput, validatePoolText, validatePoolValue };
3118
+ export { APP_KEYS, type AddCreditPoolMemberInput, AdministrationOverview, type AdministrationOverviewProps, type AdministrativeNavigationOptions, type ApiToken, type AppKey, AppSettingsHeader, type AppSettingsHeaderProps, AppSettingsPage, type AppSettingsPageProps, AppSettingsRow, type AppSettingsRowProps, AppSettingsSection, type AppSettingsSectionProps, type AvailableCreditsResponse, BILLING_TABLE_FRAME_STYLE, BILLING_TABLE_MIN_HEIGHT, BILLING_TABLE_PAGER_STYLE, BillingContent, type BillingEntitlement, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type ConnectedApp, ConnectedAppsContent, type CreatedToken, type CreditCycleUnit, type CreditLimitUnit, type CreditLimitValidation, type CreditPoolCandidate, type CreditPoolFormerMember, type CreditPoolMember, CreditPoolMemberModal, type CreditPoolMemberModalProps, type CreditPoolMemberStatus, type CreditPoolMode, type CreditPoolResponse, type CreditPoolSelfShare, type CreditsMeter, type CurrentPlanState, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, DEFAULT_USER_LANGUAGE, EMPTY_USAGE_LOGS_PAGE, ExportDateModal, type FetchUsageLogs, type FetchUsageLogsInRangeOptions, INITIAL_USAGE_LOGS_STATE, INVOICE_DOWNLOAD_FAILED_MESSAGE, INVOICE_NOT_AVAILABLE_MESSAGE, InviteUpdateModal, type InvoiceDownloadKind, type InvoicePdfResponse, type LoginMethodsMember, type LoginMethodsSettings, type LoginMethodsSwitchState, MOCK_REFERRED_USERS, type MemberCreditLimit, MemberCreditLimitModal, type MemberCreditLimitRow, type MemberCreditLimitSource, type MemberCreditLimitsResponse, MemberListFrame, type MemberListFrameProps, type MemberListTab, MemberListToolbar, type MemberListToolbarProps, type MemberPermissionsPayload, OrganizationContent, type OrganizationData, type OrganizationDetails, OrganizationIntegrationsContent, type OrganizationInvite, type OrganizationJoinRequest, type OrganizationJoinableWorkspace, OrganizationLoginMethodsContent, type OrganizationMember, OrganizationMemberModal, type OrganizationMemberModalProps, type OrganizationMemberRole, OrganizationModal, OrganizationPicker, type OrganizationPickerItem, type OrganizationPickerProps, type OrganizationPickerType, type OrganizationView, type OrganizationWorkspaceItem, POOL_ERROR_CODES, POOL_EXPIRY_MAX_MONTHS, POOL_NOTE_MAX_LENGTH, PerUserLimitsView, type PoolEndsAtResult, type PoolErrorCode, type PoolExpiryChoice, type PoolValueValidation, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, REMOVE_REASON_MAX_LENGTH, ReferralHistoryView, type ReferralHistoryViewProps, ReferralTab, type ReferredUser, RemovePoolMemberModal, type RemovePoolMemberModalProps, RemoveSelfShareModal, type RemoveSelfShareModalProps, SCOPE_LABELS, ScopeHeader, type ScopeHeaderProps, type ServiceItem, type SetCreditPoolSelfShareInput, type SettingsAdapters, SettingsAdaptersProvider, type SettingsApiAdapter, type SettingsAuthAdapter, type SettingsAuthUser, SettingsContent, type SettingsContentProps, type SettingsImageUploadAdapter, type SettingsIntegrationsAdapter, type SettingsLoginMethodsAdapter, type SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCreateOptions, type SettingsOrganizationCurrent, type SettingsOrganizationJoinableItem, type SettingsOrganizationListItem, type SettingsOrganizationType, type SettingsScope, type SettingsTab, type SettingsToastAdapter, SettingsTooltip, type SettingsTooltipPlacement, type SettingsTooltipProps, type SettingsWorkspaceAdapter, type SettingsWorkspaceCurrent, type SettingsWorkspaceListItem, SharedCreditsView, type SharedPoolBalance, SiconKey, type SponsorShareBalance, type StoreItem, type SubscriptionPlan, type SubscriptionResponse, TAB_DESCRIPTIONS, TAB_LABELS, TAB_SCOPE, TAB_TO_URL, type TeamMember, TeamsContent, type TokenExpiry, TokensContent, URL_TO_TAB, USAGE_LOGS_EXPORT_BATCH_SIZE, USAGE_LOGS_EXPORT_EXTRA_REQUESTS, USAGE_LOGS_EXPORT_MAX_ROWS, USAGE_LOGS_PAGE_SIZE, USER_LANGUAGES, type UpdateCreditPoolMemberInput, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryPagination, type UsageHistoryResponse, type UsageLogsAction, type UsageLogsExportResult, type UsageLogsPage, UsageLogsPager, type UsageLogsQuery, type UsageLogsState, type UsedByNamesLoader, type UserLanguage, type UserPermissions, WORKSPACE_CREDIT_LIMIT_REACHED, WORKSPACE_CREDIT_LIMIT_REACHED_MESSAGE, WORKSPACE_LIST_PAGE_SIZE, type WorkspaceCreditLimit, WorkspaceCreditLimitCard, type WorkspaceCreditLimitSummary, type WorkspaceData, WorkspaceGeneralTab, type WorkspaceGeneralTabProps, type WorkspaceInvite, type WorkspaceListOrganization, WorkspaceListTab, type WorkspaceMember, WorkspaceModal, type WorkspaceOrganization, type WorkspaceOrganizationRequest, WorkspacePicker, type WorkspacePickerGroup, type WorkspacePickerItem, type WorkspacePickerProps, WorkspaceTab, type WorkspaceUsageResponse, aboveTotalReason, belowUsageReason, canManageOnlyWorkspaceCreditLimit, canShowSharedCredits, checkPoolPercentTotal, cleanCreditLimitInput, cleanPoolValueInput, countLabel, createUsedByNamesLoader, creditCycleUnit, creditsMeter, deriveWorkspaceInvitePermission, describeAllowance, describeDefaultLimit, describeMemberLimit, describeWorkspaceCreditLimit, entitlementFromBody, entitlementFromFailure, expiryChoiceFor, fetchUsageLogsInRange, findBillingError, findPoolError, formatCreditLimit, formatCredits, formatPoolEndsAt, formatPoolSplit, groupWorkspaceList, hasPaidFeatures, inviteUpdate, invoiceDownloadKind, isLimitAboveTotal, isLimitBelowUsage, isPaidPlan, isSponsoredEntitlement, isWorkspaceCreditLimitReached, joinMembersWithLimits, lastUsedLabel, limitAboveTotalTotal, limitBelowUsageUsed, limitSourceLabel, loadCurrentPlan, loadWorkspaceOrganization, loginMethodsSwitchState, maximumCreditLimit, memberRoleUpdate, minPoolEndDate, minimumCreditLimit, ownCreditsFirstText, parseBillingEntitlement, parseInviteEmails, pausedOwnCreditsText, poolAllocatedPercent, poolAllocationText, poolEndsAtFrom, poolErrorMessage, poolRenewsAtCycleEnd, poolUnallocatedPercent, poolWorkspaceName, productsForCountry, readSettingsCaller, referralCodeOf, referralCountLabel, referralLink, referralSignupDate, rememberSettingsCaller, resolveSettingsTabFromPath, roundCredits, settingsReturnTarget, sharedPoolBannerText, sharedPoolEndsText, sliceUsageLogsPage, sortReferredUsers, sponsorShareBannerText, sponsorShareDetailText, sponsorShareSpentText, sponsoredCreditsText, ssoLabel, toCsv, toLocalDateInput, usageLogsCsvRows, usageLogsDateRange, usageLogsExportFileName, usageLogsPage, usageLogsReducer, usageLogsReloadPage, usageLogsSpentByOthers, useBillingEntitlement, useSettingsAdapters, useWorkspaceInvitePermission, useWorkspaceOrganization, usedByNamesFrom, usedByWorkspaceKey, userLanguageLabel, validateCreditLimitInput, validateDefaultCreditLimitInput, validatePoolText, validatePoolValue };
package/dist/index.js CHANGED
@@ -40,6 +40,8 @@ __export(index_exports, {
40
40
  EMPTY_USAGE_LOGS_PAGE: () => EMPTY_USAGE_LOGS_PAGE,
41
41
  ExportDateModal: () => ExportDateModal,
42
42
  INITIAL_USAGE_LOGS_STATE: () => INITIAL_USAGE_LOGS_STATE,
43
+ INVOICE_DOWNLOAD_FAILED_MESSAGE: () => INVOICE_DOWNLOAD_FAILED_MESSAGE,
44
+ INVOICE_NOT_AVAILABLE_MESSAGE: () => INVOICE_NOT_AVAILABLE_MESSAGE,
43
45
  InviteUpdateModal: () => InviteUpdateModal,
44
46
  MOCK_REFERRED_USERS: () => MOCK_REFERRED_USERS,
45
47
  MemberCreditLimitModal: () => MemberCreditLimitModal,
@@ -120,6 +122,7 @@ __export(index_exports, {
120
122
  groupWorkspaceList: () => groupWorkspaceList,
121
123
  hasPaidFeatures: () => hasPaidFeatures,
122
124
  inviteUpdate: () => inviteUpdate,
125
+ invoiceDownloadKind: () => invoiceDownloadKind,
123
126
  isLimitAboveTotal: () => isLimitAboveTotal,
124
127
  isLimitBelowUsage: () => isLimitBelowUsage,
125
128
  isPaidPlan: () => isPaidPlan,
@@ -8092,6 +8095,17 @@ function findBillingError(failure, codes) {
8092
8095
  return visit(failure, 0);
8093
8096
  }
8094
8097
 
8098
+ // src/invoice-download.ts
8099
+ function invoiceDownloadKind(item) {
8100
+ const id = item.transactionId;
8101
+ if (!id) return null;
8102
+ if (id.startsWith("in_")) return "invoice";
8103
+ if (id.startsWith("pi_")) return "receipt";
8104
+ return null;
8105
+ }
8106
+ var INVOICE_NOT_AVAILABLE_MESSAGE = "There's no invoice for this order. Rolled-over, bonus and manually added credits don't have one.";
8107
+ var INVOICE_DOWNLOAD_FAILED_MESSAGE = "Couldn't download this invoice.";
8108
+
8095
8109
  // src/billing-content.tsx
8096
8110
  var import_react24 = require("react");
8097
8111
  var import_ui18 = require("@streamoid/ui");
@@ -12400,19 +12414,20 @@ function InvoiceHistoryTable({
12400
12414
  const currencySymbol = getCurrencySymbolByCountry(workspaceCountry);
12401
12415
  const handleDownload = async (item) => {
12402
12416
  const orderId = item.transactionId;
12403
- if (!orderId) {
12404
- toast.info?.("No invoice PDF available");
12417
+ const kind = invoiceDownloadKind(item);
12418
+ if (!orderId || !kind) {
12419
+ toast.info?.(INVOICE_NOT_AVAILABLE_MESSAGE);
12405
12420
  return;
12406
12421
  }
12407
12422
  try {
12408
12423
  const res = await api.downloadInvoice(orderId);
12409
- const invoiceData = res.data?.invoiceData;
12410
- if (invoiceData.id.startsWith("in_")) {
12411
- const downloadUrl = invoiceData.invoice_pdf;
12412
- window.open(downloadUrl, "_blank");
12413
- } else if (invoiceData.id.startsWith("pi_") && res.data.receiptPdfUrl) {
12414
- const downloadUrl = res.data?.receiptPdfUrl;
12415
- const response = await fetch(downloadUrl);
12424
+ const invoicePdfUrl = res?.data?.invoiceData?.invoice_pdf;
12425
+ const receiptPdfUrl = res?.data?.receiptPdfUrl;
12426
+ if (kind === "invoice" && invoicePdfUrl) {
12427
+ window.open(invoicePdfUrl, "_blank");
12428
+ } else if (kind === "receipt" && receiptPdfUrl) {
12429
+ const response = await fetch(receiptPdfUrl);
12430
+ if (!response.ok) throw new Error(`HTTP ${response.status}`);
12416
12431
  const blob = await response.blob();
12417
12432
  const url = window.URL.createObjectURL(blob);
12418
12433
  const a = document.createElement("a");
@@ -12423,10 +12438,14 @@ function InvoiceHistoryTable({
12423
12438
  a.remove();
12424
12439
  window.URL.revokeObjectURL(url);
12425
12440
  } else {
12426
- toast.info?.("Invoice PDF not available");
12441
+ toast.info?.(
12442
+ kind === "receipt" ? "The receipt for this payment isn't ready yet. Try again in a few minutes." : "The PDF for this invoice isn't available yet. Try again in a few minutes."
12443
+ );
12427
12444
  }
12428
- } catch {
12429
- toast.error("Failed to download invoice");
12445
+ } catch (err) {
12446
+ toast.error(
12447
+ `${INVOICE_DOWNLOAD_FAILED_MESSAGE} ${errorMessage(err, { method: "GET" })}`
12448
+ );
12430
12449
  }
12431
12450
  };
12432
12451
  const handleRowClick = (e, invoiceNumber) => {
@@ -12504,6 +12523,9 @@ function InvoiceHistoryTable({
12504
12523
  amount: inv.amountPaid != null ? `${currencySymbol}${inv.amountPaid.toFixed(2)}` : `${currencySymbol}${(inv.amount / 100).toFixed(2)}`,
12505
12524
  date: formatDate3(inv.createdAt),
12506
12525
  downloadLabel: "Download invoice",
12526
+ downloadable: invoiceDownloadKind(inv) !== null,
12527
+ unavailableLabel: "No invoice",
12528
+ title: invoiceDownloadKind(inv) === null ? INVOICE_NOT_AVAILABLE_MESSAGE : void 0,
12507
12529
  onClick: (e) => handleRowClick(e, inv)
12508
12530
  },
12509
12531
  inv._id
@@ -13295,7 +13317,7 @@ function BillingContent({
13295
13317
  if (activeTab === "invoice") {
13296
13318
  const filtered = invoices.filter((inv) => {
13297
13319
  const d = new Date(inv.createdAt);
13298
- return d >= startDate && d <= end;
13320
+ return d >= startDate && d <= end && invoiceDownloadKind(inv) === "invoice";
13299
13321
  });
13300
13322
  if (filtered.length === 0) {
13301
13323
  toast.info?.("No invoices found in the selected date range.");
@@ -17222,11 +17244,13 @@ function SettingsContentInner({
17222
17244
  return true;
17223
17245
  };
17224
17246
  (0, import_react29.useEffect)(() => {
17225
- if (workspaceList.length > 0 && localWorkspaces === null) {
17226
- setLocalWorkspaces(workspaceList.map(toWorkspaceData));
17227
- }
17228
- }, [workspaceList, localWorkspaces]);
17229
- const displayWorkspaces = localWorkspaces !== null ? localWorkspaces.map(toWorkspaceInfo) : workspaceList;
17247
+ setLocalWorkspaces(null);
17248
+ }, [workspaceId]);
17249
+ const displayWorkspaces = (localWorkspaces ?? workspaceList.map(toWorkspaceData)).map(
17250
+ (ws) => toWorkspaceInfo(
17251
+ workspaceId ? { ...ws, isCurrent: ws.id === workspaceId } : ws
17252
+ )
17253
+ );
17230
17254
  const currentWorkspaceInfo = displayWorkspaces.find((ws) => ws.isCurrent) ?? null;
17231
17255
  const currentWorkspaceData = currentWorkspaceInfo ? {
17232
17256
  ...toWorkspaceData(currentWorkspaceInfo),
package/dist/index.mjs CHANGED
@@ -7950,6 +7950,17 @@ function findBillingError(failure, codes) {
7950
7950
  return visit(failure, 0);
7951
7951
  }
7952
7952
 
7953
+ // src/invoice-download.ts
7954
+ function invoiceDownloadKind(item) {
7955
+ const id = item.transactionId;
7956
+ if (!id) return null;
7957
+ if (id.startsWith("in_")) return "invoice";
7958
+ if (id.startsWith("pi_")) return "receipt";
7959
+ return null;
7960
+ }
7961
+ var INVOICE_NOT_AVAILABLE_MESSAGE = "There's no invoice for this order. Rolled-over, bonus and manually added credits don't have one.";
7962
+ var INVOICE_DOWNLOAD_FAILED_MESSAGE = "Couldn't download this invoice.";
7963
+
7953
7964
  // src/billing-content.tsx
7954
7965
  import {
7955
7966
  useState as useState22,
@@ -12281,19 +12292,20 @@ function InvoiceHistoryTable({
12281
12292
  const currencySymbol = getCurrencySymbolByCountry(workspaceCountry);
12282
12293
  const handleDownload = async (item) => {
12283
12294
  const orderId = item.transactionId;
12284
- if (!orderId) {
12285
- toast.info?.("No invoice PDF available");
12295
+ const kind = invoiceDownloadKind(item);
12296
+ if (!orderId || !kind) {
12297
+ toast.info?.(INVOICE_NOT_AVAILABLE_MESSAGE);
12286
12298
  return;
12287
12299
  }
12288
12300
  try {
12289
12301
  const res = await api.downloadInvoice(orderId);
12290
- const invoiceData = res.data?.invoiceData;
12291
- if (invoiceData.id.startsWith("in_")) {
12292
- const downloadUrl = invoiceData.invoice_pdf;
12293
- window.open(downloadUrl, "_blank");
12294
- } else if (invoiceData.id.startsWith("pi_") && res.data.receiptPdfUrl) {
12295
- const downloadUrl = res.data?.receiptPdfUrl;
12296
- const response = await fetch(downloadUrl);
12302
+ const invoicePdfUrl = res?.data?.invoiceData?.invoice_pdf;
12303
+ const receiptPdfUrl = res?.data?.receiptPdfUrl;
12304
+ if (kind === "invoice" && invoicePdfUrl) {
12305
+ window.open(invoicePdfUrl, "_blank");
12306
+ } else if (kind === "receipt" && receiptPdfUrl) {
12307
+ const response = await fetch(receiptPdfUrl);
12308
+ if (!response.ok) throw new Error(`HTTP ${response.status}`);
12297
12309
  const blob = await response.blob();
12298
12310
  const url = window.URL.createObjectURL(blob);
12299
12311
  const a = document.createElement("a");
@@ -12304,10 +12316,14 @@ function InvoiceHistoryTable({
12304
12316
  a.remove();
12305
12317
  window.URL.revokeObjectURL(url);
12306
12318
  } else {
12307
- toast.info?.("Invoice PDF not available");
12319
+ toast.info?.(
12320
+ kind === "receipt" ? "The receipt for this payment isn't ready yet. Try again in a few minutes." : "The PDF for this invoice isn't available yet. Try again in a few minutes."
12321
+ );
12308
12322
  }
12309
- } catch {
12310
- toast.error("Failed to download invoice");
12323
+ } catch (err) {
12324
+ toast.error(
12325
+ `${INVOICE_DOWNLOAD_FAILED_MESSAGE} ${errorMessage(err, { method: "GET" })}`
12326
+ );
12311
12327
  }
12312
12328
  };
12313
12329
  const handleRowClick = (e, invoiceNumber) => {
@@ -12385,6 +12401,9 @@ function InvoiceHistoryTable({
12385
12401
  amount: inv.amountPaid != null ? `${currencySymbol}${inv.amountPaid.toFixed(2)}` : `${currencySymbol}${(inv.amount / 100).toFixed(2)}`,
12386
12402
  date: formatDate3(inv.createdAt),
12387
12403
  downloadLabel: "Download invoice",
12404
+ downloadable: invoiceDownloadKind(inv) !== null,
12405
+ unavailableLabel: "No invoice",
12406
+ title: invoiceDownloadKind(inv) === null ? INVOICE_NOT_AVAILABLE_MESSAGE : void 0,
12388
12407
  onClick: (e) => handleRowClick(e, inv)
12389
12408
  },
12390
12409
  inv._id
@@ -13176,7 +13195,7 @@ function BillingContent({
13176
13195
  if (activeTab === "invoice") {
13177
13196
  const filtered = invoices.filter((inv) => {
13178
13197
  const d = new Date(inv.createdAt);
13179
- return d >= startDate && d <= end;
13198
+ return d >= startDate && d <= end && invoiceDownloadKind(inv) === "invoice";
13180
13199
  });
13181
13200
  if (filtered.length === 0) {
13182
13201
  toast.info?.("No invoices found in the selected date range.");
@@ -17109,11 +17128,13 @@ function SettingsContentInner({
17109
17128
  return true;
17110
17129
  };
17111
17130
  useEffect21(() => {
17112
- if (workspaceList.length > 0 && localWorkspaces === null) {
17113
- setLocalWorkspaces(workspaceList.map(toWorkspaceData));
17114
- }
17115
- }, [workspaceList, localWorkspaces]);
17116
- const displayWorkspaces = localWorkspaces !== null ? localWorkspaces.map(toWorkspaceInfo) : workspaceList;
17131
+ setLocalWorkspaces(null);
17132
+ }, [workspaceId]);
17133
+ const displayWorkspaces = (localWorkspaces ?? workspaceList.map(toWorkspaceData)).map(
17134
+ (ws) => toWorkspaceInfo(
17135
+ workspaceId ? { ...ws, isCurrent: ws.id === workspaceId } : ws
17136
+ )
17137
+ );
17117
17138
  const currentWorkspaceInfo = displayWorkspaces.find((ws) => ws.isCurrent) ?? null;
17118
17139
  const currentWorkspaceData = currentWorkspaceInfo ? {
17119
17140
  ...toWorkspaceData(currentWorkspaceInfo),
@@ -18668,6 +18689,8 @@ export {
18668
18689
  EMPTY_USAGE_LOGS_PAGE,
18669
18690
  ExportDateModal,
18670
18691
  INITIAL_USAGE_LOGS_STATE,
18692
+ INVOICE_DOWNLOAD_FAILED_MESSAGE,
18693
+ INVOICE_NOT_AVAILABLE_MESSAGE,
18671
18694
  InviteUpdateModal,
18672
18695
  MOCK_REFERRED_USERS,
18673
18696
  MemberCreditLimitModal,
@@ -18748,6 +18771,7 @@ export {
18748
18771
  groupWorkspaceList,
18749
18772
  hasPaidFeatures,
18750
18773
  inviteUpdate,
18774
+ invoiceDownloadKind,
18751
18775
  isLimitAboveTotal,
18752
18776
  isLimitBelowUsage,
18753
18777
  isPaidPlan,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamoid/settings",
3
- "version": "0.22.0",
3
+ "version": "0.22.2",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "peerDependencies": {
25
25
  "react": "^18.0.0 || ^19.0.0",
26
26
  "react-dom": "^18.0.0 || ^19.0.0",
27
- "@streamoid/ui": ">=0.6.76",
27
+ "@streamoid/ui": ">=0.8.1",
28
28
  "@streamoid/icons": "*"
29
29
  },
30
30
  "devDependencies": {
@@ -32,6 +32,7 @@
32
32
  "@types/react-dom": "^19.0.0",
33
33
  "@streamoid/icons": "*",
34
34
  "@streamoid/ui": "*",
35
+ "jsdom": "^29.1.1",
35
36
  "react": "^19.0.0",
36
37
  "react-dom": "^19.0.0",
37
38
  "tsup": "^8.0.0",