@buildbase/sdk 0.0.23 → 0.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/dist/index.esm.js +4 -5
  2. package/dist/index.js +4 -5
  3. package/dist/saas-os.css +1 -1
  4. package/package.json +3 -2
  5. package/dist/index.esm.js.map +0 -1
  6. package/dist/index.js.map +0 -1
  7. package/dist/types/api/currency-utils.d.ts +0 -44
  8. package/dist/types/api/index.d.ts +0 -12
  9. package/dist/types/api/pricing-variant-utils.d.ts +0 -66
  10. package/dist/types/api/quota-utils.d.ts +0 -24
  11. package/dist/types/api/types.d.ts +0 -495
  12. package/dist/types/components/ErrorBoundary.d.ts +0 -81
  13. package/dist/types/components/beta/BetaForm.d.ts +0 -24
  14. package/dist/types/components/beta/api.d.ts +0 -48
  15. package/dist/types/components/beta/hooks.d.ts +0 -11
  16. package/dist/types/components/beta/schema.d.ts +0 -6
  17. package/dist/types/components/beta/types.d.ts +0 -8
  18. package/dist/types/components/dropdowns/country/countries.d.ts +0 -7
  19. package/dist/types/components/dropdowns/country/selectCountry.d.ts +0 -6
  20. package/dist/types/components/dropdowns/currency/currencies.d.ts +0 -6
  21. package/dist/types/components/dropdowns/currency/selectCurrency.d.ts +0 -6
  22. package/dist/types/components/dropdowns/language/languages.d.ts +0 -6
  23. package/dist/types/components/dropdowns/language/selectLanguage.d.ts +0 -6
  24. package/dist/types/components/dropdowns/timezone/selectTimeZone.d.ts +0 -6
  25. package/dist/types/components/dropdowns/timezone/timezones.d.ts +0 -8
  26. package/dist/types/components/features/index.d.ts +0 -130
  27. package/dist/types/components/pricing/PricingPage.d.ts +0 -49
  28. package/dist/types/components/pricing/index.d.ts +0 -2
  29. package/dist/types/components/quota/index.d.ts +0 -121
  30. package/dist/types/components/subscription/index.d.ts +0 -182
  31. package/dist/types/components/ui/alert-dialog.d.ts +0 -20
  32. package/dist/types/components/ui/avatar.d.ts +0 -6
  33. package/dist/types/components/ui/button.d.ts +0 -18
  34. package/dist/types/components/ui/command-select.d.ts +0 -13
  35. package/dist/types/components/ui/command.d.ts +0 -82
  36. package/dist/types/components/ui/dialog.d.ts +0 -19
  37. package/dist/types/components/ui/form.d.ts +0 -23
  38. package/dist/types/components/ui/input.d.ts +0 -5
  39. package/dist/types/components/ui/label.d.ts +0 -5
  40. package/dist/types/components/ui/popover.d.ts +0 -6
  41. package/dist/types/components/ui/radio-group.d.ts +0 -5
  42. package/dist/types/components/ui/scroll-area.d.ts +0 -5
  43. package/dist/types/components/ui/select.d.ts +0 -11
  44. package/dist/types/components/ui/separator.d.ts +0 -4
  45. package/dist/types/components/ui/skeleton.d.ts +0 -3
  46. package/dist/types/components/ui/switch.d.ts +0 -4
  47. package/dist/types/components/user/auth.d.ts +0 -76
  48. package/dist/types/components/user/role.d.ts +0 -84
  49. package/dist/types/contexts/AuthContext/AuthContext.d.ts +0 -9
  50. package/dist/types/contexts/AuthContext/actions.d.ts +0 -12
  51. package/dist/types/contexts/AuthContext/index.d.ts +0 -4
  52. package/dist/types/contexts/AuthContext/reducer.d.ts +0 -19
  53. package/dist/types/contexts/AuthContext/types.d.ts +0 -18
  54. package/dist/types/contexts/OSContext/OSContext.d.ts +0 -9
  55. package/dist/types/contexts/OSContext/actions.d.ts +0 -11
  56. package/dist/types/contexts/OSContext/index.d.ts +0 -4
  57. package/dist/types/contexts/OSContext/reducer.d.ts +0 -11
  58. package/dist/types/contexts/OSContext/types.d.ts +0 -16
  59. package/dist/types/contexts/QuotaUsageContext/QuotaUsageContext.d.ts +0 -22
  60. package/dist/types/contexts/QuotaUsageContext/index.d.ts +0 -2
  61. package/dist/types/contexts/QuotaUsageContext/quotaUsageInvalidation.d.ts +0 -21
  62. package/dist/types/contexts/QuotaUsageContext/types.d.ts +0 -14
  63. package/dist/types/contexts/SDKContext/SDKContextProvider.d.ts +0 -18
  64. package/dist/types/contexts/SDKContext/index.d.ts +0 -2
  65. package/dist/types/contexts/SDKContext/types.d.ts +0 -12
  66. package/dist/types/contexts/SubscriptionContext/SubscriptionContext.d.ts +0 -22
  67. package/dist/types/contexts/SubscriptionContext/index.d.ts +0 -2
  68. package/dist/types/contexts/SubscriptionContext/subscriptionInvalidation.d.ts +0 -21
  69. package/dist/types/contexts/SubscriptionContext/types.d.ts +0 -14
  70. package/dist/types/contexts/WorkspaceContext/WorkspaceContext.d.ts +0 -8
  71. package/dist/types/contexts/WorkspaceContext/actions.d.ts +0 -19
  72. package/dist/types/contexts/WorkspaceContext/index.d.ts +0 -4
  73. package/dist/types/contexts/WorkspaceContext/reducer.d.ts +0 -10
  74. package/dist/types/contexts/WorkspaceContext/types.d.ts +0 -52
  75. package/dist/types/contexts/index.d.ts +0 -14
  76. package/dist/types/contexts/shared/createContext.d.ts +0 -27
  77. package/dist/types/contexts/shared/types.d.ts +0 -21
  78. package/dist/types/contexts/shared/useAppDispatch.d.ts +0 -20
  79. package/dist/types/contexts/shared/useAppSelector.d.ts +0 -26
  80. package/dist/types/contexts/shared/useSelectWithEquality.d.ts +0 -10
  81. package/dist/types/contexts/shared/utils/reducerHelpers.d.ts +0 -11
  82. package/dist/types/contexts/shared/utils/storage.d.ts +0 -25
  83. package/dist/types/hooks/use-seat-status.d.ts +0 -42
  84. package/dist/types/hooks/use-trial-status.d.ts +0 -28
  85. package/dist/types/index.d.ts +0 -39
  86. package/dist/types/lib/api-base.d.ts +0 -49
  87. package/dist/types/lib/api-client.d.ts +0 -25
  88. package/dist/types/lib/api-utils.d.ts +0 -182
  89. package/dist/types/lib/error-handler.d.ts +0 -118
  90. package/dist/types/lib/logger.d.ts +0 -27
  91. package/dist/types/lib/useAsyncEffect.d.ts +0 -29
  92. package/dist/types/lib/utils.d.ts +0 -7
  93. package/dist/types/providers/ContextConfigProvider.d.ts +0 -15
  94. package/dist/types/providers/PortalContainer.d.ts +0 -9
  95. package/dist/types/providers/SaaSOSProvider.d.ts +0 -7
  96. package/dist/types/providers/auth/api.d.ts +0 -12
  97. package/dist/types/providers/auth/hooks.d.ts +0 -75
  98. package/dist/types/providers/auth/provider.d.ts +0 -13
  99. package/dist/types/providers/auth/types.d.ts +0 -62
  100. package/dist/types/providers/auth/utils.d.ts +0 -40
  101. package/dist/types/providers/constants.d.ts +0 -3
  102. package/dist/types/providers/events/EventEmitter.d.ts +0 -81
  103. package/dist/types/providers/events/index.d.ts +0 -2
  104. package/dist/types/providers/events/types.d.ts +0 -61
  105. package/dist/types/providers/os/api.d.ts +0 -11
  106. package/dist/types/providers/os/hooks.d.ts +0 -50
  107. package/dist/types/providers/os/types.d.ts +0 -19
  108. package/dist/types/providers/types.d.ts +0 -9
  109. package/dist/types/providers/user/api.d.ts +0 -16
  110. package/dist/types/providers/user/hooks.d.ts +0 -80
  111. package/dist/types/providers/user/provider.d.ts +0 -17
  112. package/dist/types/providers/workspace/WorkspaceSettingsProvider.d.ts +0 -9
  113. package/dist/types/providers/workspace/api.d.ts +0 -155
  114. package/dist/types/providers/workspace/hooks.d.ts +0 -161
  115. package/dist/types/providers/workspace/provider.d.ts +0 -8
  116. package/dist/types/providers/workspace/settings-manager.d.ts +0 -36
  117. package/dist/types/providers/workspace/subscription-hooks.d.ts +0 -741
  118. package/dist/types/providers/workspace/types.d.ts +0 -61
  119. package/dist/types/providers/workspace/ui/SettingsDanger.d.ts +0 -6
  120. package/dist/types/providers/workspace/ui/SettingsDialog.d.ts +0 -17
  121. package/dist/types/providers/workspace/ui/SettingsFeatures.d.ts +0 -5
  122. package/dist/types/providers/workspace/ui/SettingsGeneral.d.ts +0 -6
  123. package/dist/types/providers/workspace/ui/SettingsInvoices.d.ts +0 -12
  124. package/dist/types/providers/workspace/ui/SettingsProfile.d.ts +0 -6
  125. package/dist/types/providers/workspace/ui/SettingsSubscription.d.ts +0 -6
  126. package/dist/types/providers/workspace/ui/SettingsUsage.d.ts +0 -3
  127. package/dist/types/providers/workspace/ui/SettingsUsers.d.ts +0 -6
  128. package/dist/types/providers/workspace/ui/Sidebar.d.ts +0 -10
  129. package/dist/types/providers/workspace/ui/Skeleton.d.ts +0 -1
  130. package/dist/types/providers/workspace/ui/SubscriptionDialog.d.ts +0 -19
  131. package/dist/types/providers/workspace/ui/utils.d.ts +0 -2
  132. package/dist/types/providers/workspace/utils.d.ts +0 -28
@@ -1,61 +0,0 @@
1
- export interface IWorkspace {
2
- _id: string;
3
- name: string;
4
- image?: string;
5
- workspaceId: string;
6
- users: IUser[];
7
- roles: string[];
8
- createdBy: string | IUser;
9
- features: Record<string, boolean>;
10
- /**
11
- * Quota usage tracking: { [quotaSlug]: number } – how much of each quota has been used.
12
- */
13
- quotas?: Record<string, number>;
14
- /**
15
- * Subscription limits snapshot: { [limitSlug]: number | null } – synced from subscription plan.
16
- * Limits are maximum values (e.g. max-users, max-workspaces). Updated when subscription is assigned/updated.
17
- */
18
- limits?: Record<string, number | null>;
19
- subscription?: ISubscription | string | null;
20
- /** Stripe Customer ID for this workspace. */
21
- stripeCustomerId?: string;
22
- /**
23
- * Billing currency locked for this workspace (set on first subscription).
24
- * Stripe allows one currency per customer; all future subscriptions must use this currency.
25
- * When set, subscription UI only shows/uses this currency.
26
- */
27
- billingCurrency?: string | null;
28
- /** Workspace onboarding config. Set on creation based on org settings. SDK shows trial CTA. */
29
- pendingOnboarding?: {
30
- mode: 'trial';
31
- planVersionId: string;
32
- } | null;
33
- }
34
- export interface IWorkspaceFeature {
35
- _id: string;
36
- name: string;
37
- description: string;
38
- userManaged: boolean;
39
- defaultValue: boolean;
40
- slug: string;
41
- category: string;
42
- createdAt: Date;
43
- updatedAt: Date;
44
- }
45
- export interface IWorkspaceUser {
46
- _id: string;
47
- workspace: string | IWorkspace;
48
- user: string | IUser;
49
- role: string;
50
- }
51
- export interface WorkspaceContextValue {
52
- workspaces: IWorkspace[];
53
- currentWorkspace: IWorkspace | null;
54
- loading: boolean;
55
- switchingToId: string | null;
56
- refreshing: boolean;
57
- error: string | null;
58
- fetchWorkspaces: () => Promise<void>;
59
- refreshWorkspaces: () => Promise<void>;
60
- }
61
- import type { ISubscription, IUser } from '../../api/types';
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import { IWorkspace } from '../types';
3
- declare const WorkspaceSettingsDanger: React.FC<{
4
- workspace: IWorkspace;
5
- }>;
6
- export default WorkspaceSettingsDanger;
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
- import { IWorkspace } from '../types';
3
- export type WorkspaceSettingsSection = 'profile' | 'general' | 'users' | 'subscription' | 'usage' | 'features' | 'danger';
4
- export interface WorkspaceSettingsDialogProps {
5
- workspace: IWorkspace;
6
- onClose?: () => void;
7
- open?: boolean;
8
- onOpenChange?: (open: boolean) => void;
9
- defaultSection?: WorkspaceSettingsSection;
10
- section?: WorkspaceSettingsSection;
11
- onSectionChange?: (section: WorkspaceSettingsSection) => void;
12
- showTrigger?: boolean;
13
- trigger?: React.ReactNode;
14
- }
15
- declare const WorkspaceSettingsDialog: React.FC<WorkspaceSettingsDialogProps>;
16
- export default WorkspaceSettingsDialog;
17
- export { WorkspaceSettingsDialog };
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- declare const WorkspaceSettingsFeatures: React.FC<{
3
- workspaceId: string;
4
- }>;
5
- export default WorkspaceSettingsFeatures;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import { IWorkspace } from '../types';
3
- declare const WorkspaceSettingsGeneral: React.FC<{
4
- workspace: IWorkspace;
5
- }>;
6
- export default WorkspaceSettingsGeneral;
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- export interface SettingsInvoicesProps {
3
- workspaceId: string | null | undefined;
4
- /** Whether the user has an active subscription */
5
- hasActiveSubscription?: boolean;
6
- /** Callback when user clicks View Pricing Plans (e.g., switch to Plan tab) */
7
- onViewPricingPlans?: () => void;
8
- /** Number of invoices to fetch (default: 20) */
9
- limit?: number;
10
- }
11
- declare const SettingsInvoices: React.FC<SettingsInvoicesProps>;
12
- export default SettingsInvoices;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import { IWorkspace } from '../types';
3
- declare const WorkspaceSettingsProfile: React.FC<{
4
- workspace: IWorkspace;
5
- }>;
6
- export default WorkspaceSettingsProfile;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import { IWorkspace } from '../types';
3
- declare const WorkspaceSettingsSubscription: React.FC<{
4
- workspace: IWorkspace;
5
- }>;
6
- export default WorkspaceSettingsSubscription;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const WorkspaceSettingsUsage: React.FC;
3
- export default WorkspaceSettingsUsage;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import { IWorkspace } from '../types';
3
- declare const WorkspaceSettingsUsers: React.FC<{
4
- workspace: IWorkspace;
5
- }>;
6
- export default WorkspaceSettingsUsers;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { IWorkspace } from '../types';
3
- import type { WorkspaceSettingsSection } from './SettingsDialog';
4
- interface Props {
5
- workspace: IWorkspace;
6
- section: WorkspaceSettingsSection;
7
- setSection: (section: WorkspaceSettingsSection) => void;
8
- }
9
- declare const Sidebar: React.FC<Props>;
10
- export default Sidebar;
@@ -1 +0,0 @@
1
- export default function SettingSkeleton(): import("react/jsx-runtime").JSX.Element;
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import { BillingInterval, IPlanVersionWithPlan } from '../../../api/types';
3
- interface SubscriptionDialogProps {
4
- open: boolean;
5
- onOpenChange: (open: boolean) => void;
6
- planVersions: IPlanVersionWithPlan[];
7
- currentPlanVersionId?: string | null;
8
- currentStripePriceId?: string | null;
9
- /**
10
- * When set, only this currency is allowed (workspace has existing Stripe billing; Stripe does not allow multiple currencies per customer).
11
- * When null/undefined, all plan currencies are available.
12
- */
13
- billingCurrency?: string | null;
14
- /** Called when user selects a plan. Currency is optional (for display/logging only; not sent to API). */
15
- onSelectPlan: (planVersionId: string, billingInterval: BillingInterval, currency?: string) => Promise<void>;
16
- loading?: boolean;
17
- }
18
- declare const SubscriptionDialog: React.FC<SubscriptionDialogProps>;
19
- export default SubscriptionDialog;
@@ -1,2 +0,0 @@
1
- export declare function getSvgImage(emoji: string): string;
2
- export declare const workspaceEmojis: string[];
@@ -1,28 +0,0 @@
1
- import { IWorkspace } from './types';
2
- export declare const workspaceStorage: {
3
- saveCurrentWorkspace: (workspace: IWorkspace | null) => void;
4
- loadCurrentWorkspace: () => string | null;
5
- clearCurrentWorkspace: () => void;
6
- isWorkspaceValid: (workspaceId: string | null, availableWorkspaces: IWorkspace[]) => boolean;
7
- getStorageKey: () => string;
8
- };
9
- /**
10
- * Check if a user is the owner of a workspace
11
- * @param workspace - The workspace to check
12
- * @param userId - The user ID to check
13
- * @returns true if the user is the workspace owner, false otherwise
14
- */
15
- export declare function isWorkspaceOwner(workspace: IWorkspace, userId: string | null | undefined): boolean;
16
- /**
17
- * Get the workspace owner ID safely
18
- * @param workspace - The workspace
19
- * @returns The owner ID as a string, or null if not available
20
- */
21
- export declare function getWorkspaceOwnerId(workspace: IWorkspace): string | null;
22
- /**
23
- * Type guard to safely get user role from workspace users array
24
- * @param workspace - The workspace
25
- * @param userId - The user ID to find
26
- * @returns The user's role as a string, or null if not found
27
- */
28
- export declare function getWorkspaceUserRole(workspace: IWorkspace, userId: string | null | undefined): string | null;