@fluxbase/sdk 0.0.1-rc.2 → 0.0.1-rc.7
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.cjs +461 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +535 -4
- package/dist/index.d.ts +535 -4
- package/dist/index.js +461 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -456,6 +456,48 @@ interface UpdateSystemSettingRequest {
|
|
|
456
456
|
interface ListSystemSettingsResponse {
|
|
457
457
|
settings: SystemSetting[];
|
|
458
458
|
}
|
|
459
|
+
/**
|
|
460
|
+
* Custom setting with flexible key-value storage and role-based editing permissions
|
|
461
|
+
*/
|
|
462
|
+
interface CustomSetting {
|
|
463
|
+
id: string;
|
|
464
|
+
key: string;
|
|
465
|
+
value: Record<string, unknown>;
|
|
466
|
+
value_type: 'string' | 'number' | 'boolean' | 'json';
|
|
467
|
+
description?: string;
|
|
468
|
+
editable_by: string[];
|
|
469
|
+
metadata?: Record<string, unknown>;
|
|
470
|
+
created_by?: string;
|
|
471
|
+
updated_by?: string;
|
|
472
|
+
created_at: string;
|
|
473
|
+
updated_at: string;
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* Request to create a custom setting
|
|
477
|
+
*/
|
|
478
|
+
interface CreateCustomSettingRequest {
|
|
479
|
+
key: string;
|
|
480
|
+
value: Record<string, unknown>;
|
|
481
|
+
value_type?: 'string' | 'number' | 'boolean' | 'json';
|
|
482
|
+
description?: string;
|
|
483
|
+
editable_by?: string[];
|
|
484
|
+
metadata?: Record<string, unknown>;
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Request to update a custom setting
|
|
488
|
+
*/
|
|
489
|
+
interface UpdateCustomSettingRequest {
|
|
490
|
+
value: Record<string, unknown>;
|
|
491
|
+
description?: string;
|
|
492
|
+
editable_by?: string[];
|
|
493
|
+
metadata?: Record<string, unknown>;
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* Response containing all custom settings
|
|
497
|
+
*/
|
|
498
|
+
interface ListCustomSettingsResponse {
|
|
499
|
+
settings: CustomSetting[];
|
|
500
|
+
}
|
|
459
501
|
/**
|
|
460
502
|
* Authentication settings for the application
|
|
461
503
|
*/
|
|
@@ -464,6 +506,12 @@ interface AuthenticationSettings {
|
|
|
464
506
|
enable_magic_link: boolean;
|
|
465
507
|
password_min_length: number;
|
|
466
508
|
require_email_verification: boolean;
|
|
509
|
+
password_require_uppercase: boolean;
|
|
510
|
+
password_require_lowercase: boolean;
|
|
511
|
+
password_require_number: boolean;
|
|
512
|
+
password_require_special: boolean;
|
|
513
|
+
session_timeout_minutes: number;
|
|
514
|
+
max_sessions_per_user: number;
|
|
467
515
|
}
|
|
468
516
|
/**
|
|
469
517
|
* Feature flags for the application
|
|
@@ -473,12 +521,51 @@ interface FeatureSettings {
|
|
|
473
521
|
enable_storage: boolean;
|
|
474
522
|
enable_functions: boolean;
|
|
475
523
|
}
|
|
524
|
+
/**
|
|
525
|
+
* SMTP email provider configuration
|
|
526
|
+
*/
|
|
527
|
+
interface SMTPSettings {
|
|
528
|
+
host: string;
|
|
529
|
+
port: number;
|
|
530
|
+
username: string;
|
|
531
|
+
password: string;
|
|
532
|
+
use_tls: boolean;
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* SendGrid email provider configuration
|
|
536
|
+
*/
|
|
537
|
+
interface SendGridSettings {
|
|
538
|
+
api_key: string;
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Mailgun email provider configuration
|
|
542
|
+
*/
|
|
543
|
+
interface MailgunSettings {
|
|
544
|
+
api_key: string;
|
|
545
|
+
domain: string;
|
|
546
|
+
eu_region: boolean;
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* AWS SES email provider configuration
|
|
550
|
+
*/
|
|
551
|
+
interface SESSettings {
|
|
552
|
+
access_key_id: string;
|
|
553
|
+
secret_access_key: string;
|
|
554
|
+
region: string;
|
|
555
|
+
}
|
|
476
556
|
/**
|
|
477
557
|
* Email configuration settings
|
|
478
558
|
*/
|
|
479
559
|
interface EmailSettings {
|
|
480
560
|
enabled: boolean;
|
|
481
|
-
provider:
|
|
561
|
+
provider: 'smtp' | 'sendgrid' | 'mailgun' | 'ses';
|
|
562
|
+
from_address?: string;
|
|
563
|
+
from_name?: string;
|
|
564
|
+
reply_to_address?: string;
|
|
565
|
+
smtp?: SMTPSettings;
|
|
566
|
+
sendgrid?: SendGridSettings;
|
|
567
|
+
mailgun?: MailgunSettings;
|
|
568
|
+
ses?: SESSettings;
|
|
482
569
|
}
|
|
483
570
|
/**
|
|
484
571
|
* Security settings for the application
|
|
@@ -505,6 +592,43 @@ interface UpdateAppSettingsRequest {
|
|
|
505
592
|
email?: Partial<EmailSettings>;
|
|
506
593
|
security?: Partial<SecuritySettings>;
|
|
507
594
|
}
|
|
595
|
+
/**
|
|
596
|
+
* Email template type
|
|
597
|
+
*/
|
|
598
|
+
type EmailTemplateType = 'magic_link' | 'verify_email' | 'reset_password' | 'invite_user';
|
|
599
|
+
/**
|
|
600
|
+
* Email template structure
|
|
601
|
+
*/
|
|
602
|
+
interface EmailTemplate {
|
|
603
|
+
id: string;
|
|
604
|
+
template_type: EmailTemplateType;
|
|
605
|
+
subject: string;
|
|
606
|
+
html_body: string;
|
|
607
|
+
text_body?: string;
|
|
608
|
+
is_custom: boolean;
|
|
609
|
+
created_at: string;
|
|
610
|
+
updated_at: string;
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* Request to update an email template
|
|
614
|
+
*/
|
|
615
|
+
interface UpdateEmailTemplateRequest {
|
|
616
|
+
subject: string;
|
|
617
|
+
html_body: string;
|
|
618
|
+
text_body?: string;
|
|
619
|
+
}
|
|
620
|
+
/**
|
|
621
|
+
* Request to test an email template
|
|
622
|
+
*/
|
|
623
|
+
interface TestEmailTemplateRequest {
|
|
624
|
+
recipient_email: string;
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* Response when listing email templates
|
|
628
|
+
*/
|
|
629
|
+
interface ListEmailTemplatesResponse {
|
|
630
|
+
templates: EmailTemplate[];
|
|
631
|
+
}
|
|
508
632
|
interface OAuthProvider {
|
|
509
633
|
id: string;
|
|
510
634
|
name: string;
|
|
@@ -1517,7 +1641,7 @@ declare class AppSettingsManager {
|
|
|
1517
1641
|
* await client.admin.settings.app.setFeature('storage', false)
|
|
1518
1642
|
* ```
|
|
1519
1643
|
*/
|
|
1520
|
-
setFeature(feature:
|
|
1644
|
+
setFeature(feature: "realtime" | "storage" | "functions", enabled: boolean): Promise<AppSettings>;
|
|
1521
1645
|
/**
|
|
1522
1646
|
* Enable or disable global rate limiting
|
|
1523
1647
|
*
|
|
@@ -1532,11 +1656,410 @@ declare class AppSettingsManager {
|
|
|
1532
1656
|
* ```
|
|
1533
1657
|
*/
|
|
1534
1658
|
setRateLimiting(enabled: boolean): Promise<AppSettings>;
|
|
1659
|
+
/**
|
|
1660
|
+
* Configure SMTP email provider
|
|
1661
|
+
*
|
|
1662
|
+
* Convenience method to set up SMTP email delivery.
|
|
1663
|
+
*
|
|
1664
|
+
* @param config - SMTP configuration
|
|
1665
|
+
* @returns Promise resolving to AppSettings
|
|
1666
|
+
*
|
|
1667
|
+
* @example
|
|
1668
|
+
* ```typescript
|
|
1669
|
+
* await client.admin.settings.app.configureSMTP({
|
|
1670
|
+
* host: 'smtp.gmail.com',
|
|
1671
|
+
* port: 587,
|
|
1672
|
+
* username: 'your-email@gmail.com',
|
|
1673
|
+
* password: 'your-app-password',
|
|
1674
|
+
* use_tls: true,
|
|
1675
|
+
* from_address: 'noreply@yourapp.com',
|
|
1676
|
+
* from_name: 'Your App'
|
|
1677
|
+
* })
|
|
1678
|
+
* ```
|
|
1679
|
+
*/
|
|
1680
|
+
configureSMTP(config: {
|
|
1681
|
+
host: string;
|
|
1682
|
+
port: number;
|
|
1683
|
+
username: string;
|
|
1684
|
+
password: string;
|
|
1685
|
+
use_tls: boolean;
|
|
1686
|
+
from_address?: string;
|
|
1687
|
+
from_name?: string;
|
|
1688
|
+
reply_to_address?: string;
|
|
1689
|
+
}): Promise<AppSettings>;
|
|
1690
|
+
/**
|
|
1691
|
+
* Configure SendGrid email provider
|
|
1692
|
+
*
|
|
1693
|
+
* Convenience method to set up SendGrid email delivery.
|
|
1694
|
+
*
|
|
1695
|
+
* @param apiKey - SendGrid API key
|
|
1696
|
+
* @param options - Optional from address, name, and reply-to
|
|
1697
|
+
* @returns Promise resolving to AppSettings
|
|
1698
|
+
*
|
|
1699
|
+
* @example
|
|
1700
|
+
* ```typescript
|
|
1701
|
+
* await client.admin.settings.app.configureSendGrid('SG.xxx', {
|
|
1702
|
+
* from_address: 'noreply@yourapp.com',
|
|
1703
|
+
* from_name: 'Your App'
|
|
1704
|
+
* })
|
|
1705
|
+
* ```
|
|
1706
|
+
*/
|
|
1707
|
+
configureSendGrid(apiKey: string, options?: {
|
|
1708
|
+
from_address?: string;
|
|
1709
|
+
from_name?: string;
|
|
1710
|
+
reply_to_address?: string;
|
|
1711
|
+
}): Promise<AppSettings>;
|
|
1712
|
+
/**
|
|
1713
|
+
* Configure Mailgun email provider
|
|
1714
|
+
*
|
|
1715
|
+
* Convenience method to set up Mailgun email delivery.
|
|
1716
|
+
*
|
|
1717
|
+
* @param apiKey - Mailgun API key
|
|
1718
|
+
* @param domain - Mailgun domain
|
|
1719
|
+
* @param options - Optional EU region flag and email addresses
|
|
1720
|
+
* @returns Promise resolving to AppSettings
|
|
1721
|
+
*
|
|
1722
|
+
* @example
|
|
1723
|
+
* ```typescript
|
|
1724
|
+
* await client.admin.settings.app.configureMailgun('key-xxx', 'mg.yourapp.com', {
|
|
1725
|
+
* eu_region: false,
|
|
1726
|
+
* from_address: 'noreply@yourapp.com',
|
|
1727
|
+
* from_name: 'Your App'
|
|
1728
|
+
* })
|
|
1729
|
+
* ```
|
|
1730
|
+
*/
|
|
1731
|
+
configureMailgun(apiKey: string, domain: string, options?: {
|
|
1732
|
+
eu_region?: boolean;
|
|
1733
|
+
from_address?: string;
|
|
1734
|
+
from_name?: string;
|
|
1735
|
+
reply_to_address?: string;
|
|
1736
|
+
}): Promise<AppSettings>;
|
|
1737
|
+
/**
|
|
1738
|
+
* Configure AWS SES email provider
|
|
1739
|
+
*
|
|
1740
|
+
* Convenience method to set up AWS SES email delivery.
|
|
1741
|
+
*
|
|
1742
|
+
* @param accessKeyId - AWS access key ID
|
|
1743
|
+
* @param secretAccessKey - AWS secret access key
|
|
1744
|
+
* @param region - AWS region (e.g., 'us-east-1')
|
|
1745
|
+
* @param options - Optional email addresses
|
|
1746
|
+
* @returns Promise resolving to AppSettings
|
|
1747
|
+
*
|
|
1748
|
+
* @example
|
|
1749
|
+
* ```typescript
|
|
1750
|
+
* await client.admin.settings.app.configureSES(
|
|
1751
|
+
* 'AKIAIOSFODNN7EXAMPLE',
|
|
1752
|
+
* 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',
|
|
1753
|
+
* 'us-east-1',
|
|
1754
|
+
* {
|
|
1755
|
+
* from_address: 'noreply@yourapp.com',
|
|
1756
|
+
* from_name: 'Your App'
|
|
1757
|
+
* }
|
|
1758
|
+
* )
|
|
1759
|
+
* ```
|
|
1760
|
+
*/
|
|
1761
|
+
configureSES(accessKeyId: string, secretAccessKey: string, region: string, options?: {
|
|
1762
|
+
from_address?: string;
|
|
1763
|
+
from_name?: string;
|
|
1764
|
+
reply_to_address?: string;
|
|
1765
|
+
}): Promise<AppSettings>;
|
|
1766
|
+
/**
|
|
1767
|
+
* Enable or disable email functionality
|
|
1768
|
+
*
|
|
1769
|
+
* Convenience method to toggle email system on/off.
|
|
1770
|
+
*
|
|
1771
|
+
* @param enabled - Whether to enable email
|
|
1772
|
+
* @returns Promise resolving to AppSettings
|
|
1773
|
+
*
|
|
1774
|
+
* @example
|
|
1775
|
+
* ```typescript
|
|
1776
|
+
* await client.admin.settings.app.setEmailEnabled(true)
|
|
1777
|
+
* ```
|
|
1778
|
+
*/
|
|
1779
|
+
setEmailEnabled(enabled: boolean): Promise<AppSettings>;
|
|
1780
|
+
/**
|
|
1781
|
+
* Configure password complexity requirements
|
|
1782
|
+
*
|
|
1783
|
+
* Convenience method to set password validation rules.
|
|
1784
|
+
*
|
|
1785
|
+
* @param requirements - Password complexity requirements
|
|
1786
|
+
* @returns Promise resolving to AppSettings
|
|
1787
|
+
*
|
|
1788
|
+
* @example
|
|
1789
|
+
* ```typescript
|
|
1790
|
+
* await client.admin.settings.app.setPasswordComplexity({
|
|
1791
|
+
* min_length: 12,
|
|
1792
|
+
* require_uppercase: true,
|
|
1793
|
+
* require_lowercase: true,
|
|
1794
|
+
* require_number: true,
|
|
1795
|
+
* require_special: true
|
|
1796
|
+
* })
|
|
1797
|
+
* ```
|
|
1798
|
+
*/
|
|
1799
|
+
setPasswordComplexity(requirements: {
|
|
1800
|
+
min_length?: number;
|
|
1801
|
+
require_uppercase?: boolean;
|
|
1802
|
+
require_lowercase?: boolean;
|
|
1803
|
+
require_number?: boolean;
|
|
1804
|
+
require_special?: boolean;
|
|
1805
|
+
}): Promise<AppSettings>;
|
|
1806
|
+
/**
|
|
1807
|
+
* Configure session settings
|
|
1808
|
+
*
|
|
1809
|
+
* Convenience method to set session timeout and limits.
|
|
1810
|
+
*
|
|
1811
|
+
* @param timeoutMinutes - Session timeout in minutes (0 for no timeout)
|
|
1812
|
+
* @param maxSessionsPerUser - Maximum concurrent sessions per user (0 for unlimited)
|
|
1813
|
+
* @returns Promise resolving to AppSettings
|
|
1814
|
+
*
|
|
1815
|
+
* @example
|
|
1816
|
+
* ```typescript
|
|
1817
|
+
* // 30 minute sessions, max 3 devices per user
|
|
1818
|
+
* await client.admin.settings.app.setSessionSettings(30, 3)
|
|
1819
|
+
* ```
|
|
1820
|
+
*/
|
|
1821
|
+
setSessionSettings(timeoutMinutes: number, maxSessionsPerUser: number): Promise<AppSettings>;
|
|
1822
|
+
/**
|
|
1823
|
+
* Enable or disable email verification requirement
|
|
1824
|
+
*
|
|
1825
|
+
* Convenience method to require email verification for new signups.
|
|
1826
|
+
*
|
|
1827
|
+
* @param required - Whether to require email verification
|
|
1828
|
+
* @returns Promise resolving to AppSettings
|
|
1829
|
+
*
|
|
1830
|
+
* @example
|
|
1831
|
+
* ```typescript
|
|
1832
|
+
* await client.admin.settings.app.setEmailVerificationRequired(true)
|
|
1833
|
+
* ```
|
|
1834
|
+
*/
|
|
1835
|
+
setEmailVerificationRequired(required: boolean): Promise<AppSettings>;
|
|
1836
|
+
}
|
|
1837
|
+
/**
|
|
1838
|
+
* Custom Settings Manager
|
|
1839
|
+
*
|
|
1840
|
+
* Manages custom admin-created settings with flexible key-value storage.
|
|
1841
|
+
* Unlike system settings, custom settings allow admins to create arbitrary configuration entries
|
|
1842
|
+
* with role-based editing permissions.
|
|
1843
|
+
*
|
|
1844
|
+
* @example
|
|
1845
|
+
* ```typescript
|
|
1846
|
+
* const custom = client.admin.settings.custom
|
|
1847
|
+
*
|
|
1848
|
+
* // Create a custom setting
|
|
1849
|
+
* const setting = await custom.create({
|
|
1850
|
+
* key: 'feature.dark_mode',
|
|
1851
|
+
* value: { enabled: true, theme: 'dark' },
|
|
1852
|
+
* value_type: 'json',
|
|
1853
|
+
* description: 'Dark mode configuration',
|
|
1854
|
+
* editable_by: ['dashboard_admin', 'admin']
|
|
1855
|
+
* })
|
|
1856
|
+
*
|
|
1857
|
+
* // List all custom settings
|
|
1858
|
+
* const { settings } = await custom.list()
|
|
1859
|
+
*
|
|
1860
|
+
* // Get specific setting
|
|
1861
|
+
* const darkMode = await custom.get('feature.dark_mode')
|
|
1862
|
+
*
|
|
1863
|
+
* // Update setting
|
|
1864
|
+
* await custom.update('feature.dark_mode', {
|
|
1865
|
+
* value: { enabled: false, theme: 'light' }
|
|
1866
|
+
* })
|
|
1867
|
+
*
|
|
1868
|
+
* // Delete setting
|
|
1869
|
+
* await custom.delete('feature.dark_mode')
|
|
1870
|
+
* ```
|
|
1871
|
+
*/
|
|
1872
|
+
declare class CustomSettingsManager {
|
|
1873
|
+
private fetch;
|
|
1874
|
+
constructor(fetch: FluxbaseFetch);
|
|
1875
|
+
/**
|
|
1876
|
+
* Create a new custom setting
|
|
1877
|
+
*
|
|
1878
|
+
* @param request - Custom setting creation request
|
|
1879
|
+
* @returns Promise resolving to CustomSetting
|
|
1880
|
+
*
|
|
1881
|
+
* @example
|
|
1882
|
+
* ```typescript
|
|
1883
|
+
* const setting = await client.admin.settings.custom.create({
|
|
1884
|
+
* key: 'api.quotas',
|
|
1885
|
+
* value: { free: 1000, pro: 10000, enterprise: 100000 },
|
|
1886
|
+
* value_type: 'json',
|
|
1887
|
+
* description: 'API request quotas by tier',
|
|
1888
|
+
* metadata: { category: 'billing' }
|
|
1889
|
+
* })
|
|
1890
|
+
* ```
|
|
1891
|
+
*/
|
|
1892
|
+
create(request: CreateCustomSettingRequest): Promise<CustomSetting>;
|
|
1893
|
+
/**
|
|
1894
|
+
* List all custom settings
|
|
1895
|
+
*
|
|
1896
|
+
* @returns Promise resolving to ListCustomSettingsResponse
|
|
1897
|
+
*
|
|
1898
|
+
* @example
|
|
1899
|
+
* ```typescript
|
|
1900
|
+
* const response = await client.admin.settings.custom.list()
|
|
1901
|
+
* console.log(response.settings)
|
|
1902
|
+
* ```
|
|
1903
|
+
*/
|
|
1904
|
+
list(): Promise<ListCustomSettingsResponse>;
|
|
1905
|
+
/**
|
|
1906
|
+
* Get a specific custom setting by key
|
|
1907
|
+
*
|
|
1908
|
+
* @param key - Setting key (e.g., 'feature.dark_mode')
|
|
1909
|
+
* @returns Promise resolving to CustomSetting
|
|
1910
|
+
*
|
|
1911
|
+
* @example
|
|
1912
|
+
* ```typescript
|
|
1913
|
+
* const setting = await client.admin.settings.custom.get('feature.dark_mode')
|
|
1914
|
+
* console.log(setting.value)
|
|
1915
|
+
* ```
|
|
1916
|
+
*/
|
|
1917
|
+
get(key: string): Promise<CustomSetting>;
|
|
1918
|
+
/**
|
|
1919
|
+
* Update an existing custom setting
|
|
1920
|
+
*
|
|
1921
|
+
* @param key - Setting key
|
|
1922
|
+
* @param request - Update request with new values
|
|
1923
|
+
* @returns Promise resolving to CustomSetting
|
|
1924
|
+
*
|
|
1925
|
+
* @example
|
|
1926
|
+
* ```typescript
|
|
1927
|
+
* const updated = await client.admin.settings.custom.update('feature.dark_mode', {
|
|
1928
|
+
* value: { enabled: false },
|
|
1929
|
+
* description: 'Updated description'
|
|
1930
|
+
* })
|
|
1931
|
+
* ```
|
|
1932
|
+
*/
|
|
1933
|
+
update(key: string, request: UpdateCustomSettingRequest): Promise<CustomSetting>;
|
|
1934
|
+
/**
|
|
1935
|
+
* Delete a custom setting
|
|
1936
|
+
*
|
|
1937
|
+
* @param key - Setting key to delete
|
|
1938
|
+
* @returns Promise<void>
|
|
1939
|
+
*
|
|
1940
|
+
* @example
|
|
1941
|
+
* ```typescript
|
|
1942
|
+
* await client.admin.settings.custom.delete('feature.dark_mode')
|
|
1943
|
+
* ```
|
|
1944
|
+
*/
|
|
1945
|
+
delete(key: string): Promise<void>;
|
|
1946
|
+
}
|
|
1947
|
+
/**
|
|
1948
|
+
* Email Template Manager
|
|
1949
|
+
*
|
|
1950
|
+
* Manages email templates for authentication and user communication.
|
|
1951
|
+
* Supports customizing templates for magic links, email verification, password resets, and user invitations.
|
|
1952
|
+
*
|
|
1953
|
+
* @example
|
|
1954
|
+
* ```typescript
|
|
1955
|
+
* const templates = client.admin.emailTemplates
|
|
1956
|
+
*
|
|
1957
|
+
* // List all templates
|
|
1958
|
+
* const { templates: allTemplates } = await templates.list()
|
|
1959
|
+
*
|
|
1960
|
+
* // Get specific template
|
|
1961
|
+
* const magicLink = await templates.get('magic_link')
|
|
1962
|
+
*
|
|
1963
|
+
* // Update template
|
|
1964
|
+
* await templates.update('magic_link', {
|
|
1965
|
+
* subject: 'Sign in to ' + '{{.AppName}}',
|
|
1966
|
+
* html_body: '<html>Custom template with ' + '{{.MagicLink}}' + '</html>',
|
|
1967
|
+
* text_body: 'Click here: ' + '{{.MagicLink}}'
|
|
1968
|
+
* })
|
|
1969
|
+
*
|
|
1970
|
+
* // Test template (sends to specified email)
|
|
1971
|
+
* await templates.test('magic_link', 'test@example.com')
|
|
1972
|
+
*
|
|
1973
|
+
* // Reset to default
|
|
1974
|
+
* await templates.reset('magic_link')
|
|
1975
|
+
* ```
|
|
1976
|
+
*/
|
|
1977
|
+
declare class EmailTemplateManager {
|
|
1978
|
+
private fetch;
|
|
1979
|
+
constructor(fetch: FluxbaseFetch);
|
|
1980
|
+
/**
|
|
1981
|
+
* List all email templates
|
|
1982
|
+
*
|
|
1983
|
+
* @returns Promise resolving to ListEmailTemplatesResponse
|
|
1984
|
+
*
|
|
1985
|
+
* @example
|
|
1986
|
+
* ```typescript
|
|
1987
|
+
* const response = await client.admin.emailTemplates.list()
|
|
1988
|
+
* console.log(response.templates)
|
|
1989
|
+
* ```
|
|
1990
|
+
*/
|
|
1991
|
+
list(): Promise<ListEmailTemplatesResponse>;
|
|
1992
|
+
/**
|
|
1993
|
+
* Get a specific email template by type
|
|
1994
|
+
*
|
|
1995
|
+
* @param type - Template type (magic_link | verify_email | reset_password | invite_user)
|
|
1996
|
+
* @returns Promise resolving to EmailTemplate
|
|
1997
|
+
*
|
|
1998
|
+
* @example
|
|
1999
|
+
* ```typescript
|
|
2000
|
+
* const template = await client.admin.emailTemplates.get('magic_link')
|
|
2001
|
+
* console.log(template.subject)
|
|
2002
|
+
* console.log(template.html_body)
|
|
2003
|
+
* ```
|
|
2004
|
+
*/
|
|
2005
|
+
get(type: EmailTemplateType): Promise<EmailTemplate>;
|
|
2006
|
+
/**
|
|
2007
|
+
* Update an email template
|
|
2008
|
+
*
|
|
2009
|
+
* Available template variables:
|
|
2010
|
+
* - magic_link: `{{.MagicLink}}`, `{{.AppName}}`, `{{.ExpiryMinutes}}`
|
|
2011
|
+
* - verify_email: `{{.VerificationLink}}`, `{{.AppName}}`
|
|
2012
|
+
* - reset_password: `{{.ResetLink}}`, `{{.AppName}}`, `{{.ExpiryMinutes}}`
|
|
2013
|
+
* - invite_user: `{{.InviteLink}}`, `{{.AppName}}`, `{{.InviterName}}`
|
|
2014
|
+
*
|
|
2015
|
+
* @param type - Template type to update
|
|
2016
|
+
* @param request - Update request with subject, html_body, and optional text_body
|
|
2017
|
+
* @returns Promise resolving to EmailTemplate
|
|
2018
|
+
*
|
|
2019
|
+
* @example
|
|
2020
|
+
* ```typescript
|
|
2021
|
+
* const updated = await client.admin.emailTemplates.update('magic_link', {
|
|
2022
|
+
* subject: 'Your Magic Link - Sign in to ' + '{{.AppName}}',
|
|
2023
|
+
* html_body: '<html><body><h1>Welcome!</h1><a href="' + '{{.MagicLink}}' + '">Sign In</a></body></html>',
|
|
2024
|
+
* text_body: 'Click here to sign in: ' + '{{.MagicLink}}'
|
|
2025
|
+
* })
|
|
2026
|
+
* ```
|
|
2027
|
+
*/
|
|
2028
|
+
update(type: EmailTemplateType, request: UpdateEmailTemplateRequest): Promise<EmailTemplate>;
|
|
2029
|
+
/**
|
|
2030
|
+
* Reset an email template to default
|
|
2031
|
+
*
|
|
2032
|
+
* Removes any customizations and restores the template to its original state.
|
|
2033
|
+
*
|
|
2034
|
+
* @param type - Template type to reset
|
|
2035
|
+
* @returns Promise resolving to EmailTemplate - The default template
|
|
2036
|
+
*
|
|
2037
|
+
* @example
|
|
2038
|
+
* ```typescript
|
|
2039
|
+
* const defaultTemplate = await client.admin.emailTemplates.reset('magic_link')
|
|
2040
|
+
* ```
|
|
2041
|
+
*/
|
|
2042
|
+
reset(type: EmailTemplateType): Promise<EmailTemplate>;
|
|
2043
|
+
/**
|
|
2044
|
+
* Send a test email using the template
|
|
2045
|
+
*
|
|
2046
|
+
* Useful for previewing template changes before deploying to production.
|
|
2047
|
+
*
|
|
2048
|
+
* @param type - Template type to test
|
|
2049
|
+
* @param recipientEmail - Email address to send test to
|
|
2050
|
+
* @returns Promise<void>
|
|
2051
|
+
*
|
|
2052
|
+
* @example
|
|
2053
|
+
* ```typescript
|
|
2054
|
+
* await client.admin.emailTemplates.test('magic_link', 'test@example.com')
|
|
2055
|
+
* ```
|
|
2056
|
+
*/
|
|
2057
|
+
test(type: EmailTemplateType, recipientEmail: string): Promise<void>;
|
|
1535
2058
|
}
|
|
1536
2059
|
/**
|
|
1537
2060
|
* Settings Manager
|
|
1538
2061
|
*
|
|
1539
|
-
* Provides access to
|
|
2062
|
+
* Provides access to system-level, application-level, and custom settings.
|
|
1540
2063
|
*
|
|
1541
2064
|
* @example
|
|
1542
2065
|
* ```typescript
|
|
@@ -1547,11 +2070,15 @@ declare class AppSettingsManager {
|
|
|
1547
2070
|
*
|
|
1548
2071
|
* // Access app settings
|
|
1549
2072
|
* const appSettings = await settings.app.get()
|
|
2073
|
+
*
|
|
2074
|
+
* // Access custom settings
|
|
2075
|
+
* const customSettings = await settings.custom.list()
|
|
1550
2076
|
* ```
|
|
1551
2077
|
*/
|
|
1552
2078
|
declare class FluxbaseSettings {
|
|
1553
2079
|
system: SystemSettingsManager;
|
|
1554
2080
|
app: AppSettingsManager;
|
|
2081
|
+
custom: CustomSettingsManager;
|
|
1555
2082
|
constructor(fetch: FluxbaseFetch);
|
|
1556
2083
|
}
|
|
1557
2084
|
|
|
@@ -2672,6 +3199,10 @@ declare class FluxbaseAdmin {
|
|
|
2672
3199
|
* Management namespace for API keys, webhooks, and invitations
|
|
2673
3200
|
*/
|
|
2674
3201
|
management: FluxbaseManagement;
|
|
3202
|
+
/**
|
|
3203
|
+
* Email template manager for customizing authentication and notification emails
|
|
3204
|
+
*/
|
|
3205
|
+
emailTemplates: EmailTemplateManager;
|
|
2675
3206
|
constructor(fetch: FluxbaseFetch);
|
|
2676
3207
|
/**
|
|
2677
3208
|
* Set admin authentication token
|
|
@@ -3421,4 +3952,4 @@ declare class FluxbaseClient {
|
|
|
3421
3952
|
*/
|
|
3422
3953
|
declare function createClient(options: FluxbaseClientOptions): FluxbaseClient;
|
|
3423
3954
|
|
|
3424
|
-
export { type APIKey, APIKeysManager, type AcceptInvitationRequest, type AcceptInvitationResponse, type AdminAuthResponse, type AdminLoginRequest, type AdminMeResponse, type AdminRefreshRequest, type AdminRefreshResponse, type AdminSetupRequest, type AdminSetupStatusResponse, type AdminUser, type AppSettings, AppSettingsManager, type AuthResponse, type AuthSession, type AuthSettings, AuthSettingsManager, type AuthenticationSettings, type Column, type CreateAPIKeyRequest, type CreateAPIKeyResponse, type CreateColumnRequest, type CreateInvitationRequest, type CreateInvitationResponse, type CreateOAuthProviderRequest, type CreateOAuthProviderResponse, type CreateSchemaRequest, type CreateSchemaResponse, type CreateTableRequest, type CreateTableResponse, type CreateWebhookRequest, DDLManager, type DeleteAPIKeyResponse, type DeleteOAuthProviderResponse, type DeleteTableResponse, type DeleteUserResponse, type DeleteWebhookResponse, type EmailSettings, type EnrichedUser, type FeatureSettings, type FilterOperator, FluxbaseAdmin, FluxbaseAuth, FluxbaseClient, type FluxbaseClientOptions, type FluxbaseError, FluxbaseFetch, FluxbaseManagement, FluxbaseOAuth, FluxbaseRealtime, FluxbaseSettings, FluxbaseStorage, type GetImpersonationResponse, type HttpMethod, type ImpersonateAnonRequest, type ImpersonateServiceRequest, type ImpersonateUserRequest, ImpersonationManager, type ImpersonationSession, type ImpersonationTargetUser, type ImpersonationType, type Invitation, InvitationsManager, type InviteUserRequest, type InviteUserResponse, type ListAPIKeysResponse, type ListImpersonationSessionsOptions, type ListImpersonationSessionsResponse, type ListInvitationsOptions, type ListInvitationsResponse, type ListOAuthProvidersResponse, type ListOptions, type ListSchemasResponse, type ListSystemSettingsResponse, type ListTablesResponse, type ListUsersOptions, type ListUsersResponse, type ListWebhookDeliveriesResponse, type ListWebhooksResponse, type OAuthProvider, OAuthProviderManager, type OrderBy, type OrderDirection, type PostgrestError, type PostgrestResponse, QueryBuilder, type QueryFilter, type RealtimeCallback, type RealtimeChangePayload, RealtimeChannel, type RealtimeMessage, type RequestOptions, type ResetUserPasswordResponse, type RevokeAPIKeyResponse, type RevokeInvitationResponse, type Schema, type SecuritySettings, type SignInCredentials, type SignInWith2FAResponse, type SignUpCredentials, type SignedUrlOptions, type StartImpersonationResponse, type StopImpersonationResponse, StorageBucket, type StorageObject, type SystemSetting, SystemSettingsManager, type Table, type TestWebhookResponse, type TwoFactorEnableResponse, type TwoFactorSetupResponse, type TwoFactorStatusResponse, type TwoFactorVerifyRequest, type UpdateAPIKeyRequest, type UpdateAppSettingsRequest, type UpdateAuthSettingsRequest, type UpdateAuthSettingsResponse, type UpdateOAuthProviderRequest, type UpdateOAuthProviderResponse, type UpdateSystemSettingRequest, type UpdateUserRoleRequest, type UpdateWebhookRequest, type UploadOptions, type User, type ValidateInvitationResponse, type Webhook, type WebhookDelivery, WebhooksManager, createClient };
|
|
3955
|
+
export { type APIKey, APIKeysManager, type AcceptInvitationRequest, type AcceptInvitationResponse, type AdminAuthResponse, type AdminLoginRequest, type AdminMeResponse, type AdminRefreshRequest, type AdminRefreshResponse, type AdminSetupRequest, type AdminSetupStatusResponse, type AdminUser, type AppSettings, AppSettingsManager, type AuthResponse, type AuthSession, type AuthSettings, AuthSettingsManager, type AuthenticationSettings, type Column, type CreateAPIKeyRequest, type CreateAPIKeyResponse, type CreateColumnRequest, type CreateInvitationRequest, type CreateInvitationResponse, type CreateOAuthProviderRequest, type CreateOAuthProviderResponse, type CreateSchemaRequest, type CreateSchemaResponse, type CreateTableRequest, type CreateTableResponse, type CreateWebhookRequest, DDLManager, type DeleteAPIKeyResponse, type DeleteOAuthProviderResponse, type DeleteTableResponse, type DeleteUserResponse, type DeleteWebhookResponse, type EmailSettings, type EmailTemplate, EmailTemplateManager, type EmailTemplateType, type EnrichedUser, type FeatureSettings, type FilterOperator, FluxbaseAdmin, FluxbaseAuth, FluxbaseClient, type FluxbaseClientOptions, type FluxbaseError, FluxbaseFetch, FluxbaseManagement, FluxbaseOAuth, FluxbaseRealtime, FluxbaseSettings, FluxbaseStorage, type GetImpersonationResponse, type HttpMethod, type ImpersonateAnonRequest, type ImpersonateServiceRequest, type ImpersonateUserRequest, ImpersonationManager, type ImpersonationSession, type ImpersonationTargetUser, type ImpersonationType, type Invitation, InvitationsManager, type InviteUserRequest, type InviteUserResponse, type ListAPIKeysResponse, type ListEmailTemplatesResponse, type ListImpersonationSessionsOptions, type ListImpersonationSessionsResponse, type ListInvitationsOptions, type ListInvitationsResponse, type ListOAuthProvidersResponse, type ListOptions, type ListSchemasResponse, type ListSystemSettingsResponse, type ListTablesResponse, type ListUsersOptions, type ListUsersResponse, type ListWebhookDeliveriesResponse, type ListWebhooksResponse, type MailgunSettings, type OAuthProvider, OAuthProviderManager, type OrderBy, type OrderDirection, type PostgrestError, type PostgrestResponse, QueryBuilder, type QueryFilter, type RealtimeCallback, type RealtimeChangePayload, RealtimeChannel, type RealtimeMessage, type RequestOptions, type ResetUserPasswordResponse, type RevokeAPIKeyResponse, type RevokeInvitationResponse, type SESSettings, type SMTPSettings, type Schema, type SecuritySettings, type SendGridSettings, type SignInCredentials, type SignInWith2FAResponse, type SignUpCredentials, type SignedUrlOptions, type StartImpersonationResponse, type StopImpersonationResponse, StorageBucket, type StorageObject, type SystemSetting, SystemSettingsManager, type Table, type TestEmailTemplateRequest, type TestWebhookResponse, type TwoFactorEnableResponse, type TwoFactorSetupResponse, type TwoFactorStatusResponse, type TwoFactorVerifyRequest, type UpdateAPIKeyRequest, type UpdateAppSettingsRequest, type UpdateAuthSettingsRequest, type UpdateAuthSettingsResponse, type UpdateEmailTemplateRequest, type UpdateOAuthProviderRequest, type UpdateOAuthProviderResponse, type UpdateSystemSettingRequest, type UpdateUserRoleRequest, type UpdateWebhookRequest, type UploadOptions, type User, type ValidateInvitationResponse, type Webhook, type WebhookDelivery, WebhooksManager, createClient };
|