@fluxbase/sdk 0.0.1-rc.6 → 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 +56 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +56 -21
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1641,7 +1641,7 @@ declare class AppSettingsManager {
|
|
|
1641
1641
|
* await client.admin.settings.app.setFeature('storage', false)
|
|
1642
1642
|
* ```
|
|
1643
1643
|
*/
|
|
1644
|
-
setFeature(feature:
|
|
1644
|
+
setFeature(feature: "realtime" | "storage" | "functions", enabled: boolean): Promise<AppSettings>;
|
|
1645
1645
|
/**
|
|
1646
1646
|
* Enable or disable global rate limiting
|
|
1647
1647
|
*
|
|
@@ -1962,9 +1962,9 @@ declare class CustomSettingsManager {
|
|
|
1962
1962
|
*
|
|
1963
1963
|
* // Update template
|
|
1964
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}}'
|
|
1965
|
+
* subject: 'Sign in to ' + '{{.AppName}}',
|
|
1966
|
+
* html_body: '<html>Custom template with ' + '{{.MagicLink}}' + '</html>',
|
|
1967
|
+
* text_body: 'Click here: ' + '{{.MagicLink}}'
|
|
1968
1968
|
* })
|
|
1969
1969
|
*
|
|
1970
1970
|
* // Test template (sends to specified email)
|
|
@@ -2007,10 +2007,10 @@ declare class EmailTemplateManager {
|
|
|
2007
2007
|
* Update an email template
|
|
2008
2008
|
*
|
|
2009
2009
|
* Available template variables:
|
|
2010
|
-
* - magic_link: {{.MagicLink}}
|
|
2011
|
-
* - verify_email: {{.VerificationLink}}
|
|
2012
|
-
* - reset_password: {{.ResetLink}}
|
|
2013
|
-
* - invite_user: {{.InviteLink}}
|
|
2010
|
+
* - magic_link: `{{.MagicLink}}`, `{{.AppName}}`, `{{.ExpiryMinutes}}`
|
|
2011
|
+
* - verify_email: `{{.VerificationLink}}`, `{{.AppName}}`
|
|
2012
|
+
* - reset_password: `{{.ResetLink}}`, `{{.AppName}}`, `{{.ExpiryMinutes}}`
|
|
2013
|
+
* - invite_user: `{{.InviteLink}}`, `{{.AppName}}`, `{{.InviterName}}`
|
|
2014
2014
|
*
|
|
2015
2015
|
* @param type - Template type to update
|
|
2016
2016
|
* @param request - Update request with subject, html_body, and optional text_body
|
|
@@ -2019,9 +2019,9 @@ declare class EmailTemplateManager {
|
|
|
2019
2019
|
* @example
|
|
2020
2020
|
* ```typescript
|
|
2021
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}}'
|
|
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
2025
|
* })
|
|
2026
2026
|
* ```
|
|
2027
2027
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -1641,7 +1641,7 @@ declare class AppSettingsManager {
|
|
|
1641
1641
|
* await client.admin.settings.app.setFeature('storage', false)
|
|
1642
1642
|
* ```
|
|
1643
1643
|
*/
|
|
1644
|
-
setFeature(feature:
|
|
1644
|
+
setFeature(feature: "realtime" | "storage" | "functions", enabled: boolean): Promise<AppSettings>;
|
|
1645
1645
|
/**
|
|
1646
1646
|
* Enable or disable global rate limiting
|
|
1647
1647
|
*
|
|
@@ -1962,9 +1962,9 @@ declare class CustomSettingsManager {
|
|
|
1962
1962
|
*
|
|
1963
1963
|
* // Update template
|
|
1964
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}}'
|
|
1965
|
+
* subject: 'Sign in to ' + '{{.AppName}}',
|
|
1966
|
+
* html_body: '<html>Custom template with ' + '{{.MagicLink}}' + '</html>',
|
|
1967
|
+
* text_body: 'Click here: ' + '{{.MagicLink}}'
|
|
1968
1968
|
* })
|
|
1969
1969
|
*
|
|
1970
1970
|
* // Test template (sends to specified email)
|
|
@@ -2007,10 +2007,10 @@ declare class EmailTemplateManager {
|
|
|
2007
2007
|
* Update an email template
|
|
2008
2008
|
*
|
|
2009
2009
|
* Available template variables:
|
|
2010
|
-
* - magic_link: {{.MagicLink}}
|
|
2011
|
-
* - verify_email: {{.VerificationLink}}
|
|
2012
|
-
* - reset_password: {{.ResetLink}}
|
|
2013
|
-
* - invite_user: {{.InviteLink}}
|
|
2010
|
+
* - magic_link: `{{.MagicLink}}`, `{{.AppName}}`, `{{.ExpiryMinutes}}`
|
|
2011
|
+
* - verify_email: `{{.VerificationLink}}`, `{{.AppName}}`
|
|
2012
|
+
* - reset_password: `{{.ResetLink}}`, `{{.AppName}}`, `{{.ExpiryMinutes}}`
|
|
2013
|
+
* - invite_user: `{{.InviteLink}}`, `{{.AppName}}`, `{{.InviterName}}`
|
|
2014
2014
|
*
|
|
2015
2015
|
* @param type - Template type to update
|
|
2016
2016
|
* @param request - Update request with subject, html_body, and optional text_body
|
|
@@ -2019,9 +2019,9 @@ declare class EmailTemplateManager {
|
|
|
2019
2019
|
* @example
|
|
2020
2020
|
* ```typescript
|
|
2021
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}}'
|
|
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
2025
|
* })
|
|
2026
2026
|
* ```
|
|
2027
2027
|
*/
|
package/dist/index.js
CHANGED
|
@@ -995,7 +995,9 @@ var SystemSettingsManager = class {
|
|
|
995
995
|
* ```
|
|
996
996
|
*/
|
|
997
997
|
async list() {
|
|
998
|
-
const settings = await this.fetch.get(
|
|
998
|
+
const settings = await this.fetch.get(
|
|
999
|
+
"/api/v1/admin/system/settings"
|
|
1000
|
+
);
|
|
999
1001
|
return { settings: Array.isArray(settings) ? settings : [] };
|
|
1000
1002
|
}
|
|
1001
1003
|
/**
|
|
@@ -1011,7 +1013,9 @@ var SystemSettingsManager = class {
|
|
|
1011
1013
|
* ```
|
|
1012
1014
|
*/
|
|
1013
1015
|
async get(key) {
|
|
1014
|
-
return await this.fetch.get(
|
|
1016
|
+
return await this.fetch.get(
|
|
1017
|
+
`/api/v1/admin/system/settings/${key}`
|
|
1018
|
+
);
|
|
1015
1019
|
}
|
|
1016
1020
|
/**
|
|
1017
1021
|
* Update or create a system setting
|
|
@@ -1029,7 +1033,10 @@ var SystemSettingsManager = class {
|
|
|
1029
1033
|
* ```
|
|
1030
1034
|
*/
|
|
1031
1035
|
async update(key, request) {
|
|
1032
|
-
return await this.fetch.put(
|
|
1036
|
+
return await this.fetch.put(
|
|
1037
|
+
`/api/v1/admin/system/settings/${key}`,
|
|
1038
|
+
request
|
|
1039
|
+
);
|
|
1033
1040
|
}
|
|
1034
1041
|
/**
|
|
1035
1042
|
* Delete a system setting
|
|
@@ -1096,7 +1103,10 @@ var AppSettingsManager = class {
|
|
|
1096
1103
|
* ```
|
|
1097
1104
|
*/
|
|
1098
1105
|
async update(request) {
|
|
1099
|
-
return await this.fetch.put(
|
|
1106
|
+
return await this.fetch.put(
|
|
1107
|
+
"/api/v1/admin/app/settings",
|
|
1108
|
+
request
|
|
1109
|
+
);
|
|
1100
1110
|
}
|
|
1101
1111
|
/**
|
|
1102
1112
|
* Reset all application settings to defaults
|
|
@@ -1112,7 +1122,10 @@ var AppSettingsManager = class {
|
|
|
1112
1122
|
* ```
|
|
1113
1123
|
*/
|
|
1114
1124
|
async reset() {
|
|
1115
|
-
return await this.fetch.post(
|
|
1125
|
+
return await this.fetch.post(
|
|
1126
|
+
"/api/v1/admin/app/settings/reset",
|
|
1127
|
+
{}
|
|
1128
|
+
);
|
|
1116
1129
|
}
|
|
1117
1130
|
/**
|
|
1118
1131
|
* Enable user signup
|
|
@@ -1163,7 +1176,9 @@ var AppSettingsManager = class {
|
|
|
1163
1176
|
*/
|
|
1164
1177
|
async setPasswordMinLength(length) {
|
|
1165
1178
|
if (length < 8 || length > 128) {
|
|
1166
|
-
throw new Error(
|
|
1179
|
+
throw new Error(
|
|
1180
|
+
"Password minimum length must be between 8 and 128 characters"
|
|
1181
|
+
);
|
|
1167
1182
|
}
|
|
1168
1183
|
return await this.update({
|
|
1169
1184
|
authentication: { password_min_length: length }
|
|
@@ -1468,7 +1483,10 @@ var CustomSettingsManager = class {
|
|
|
1468
1483
|
* ```
|
|
1469
1484
|
*/
|
|
1470
1485
|
async create(request) {
|
|
1471
|
-
return await this.fetch.post(
|
|
1486
|
+
return await this.fetch.post(
|
|
1487
|
+
"/api/v1/admin/settings/custom",
|
|
1488
|
+
request
|
|
1489
|
+
);
|
|
1472
1490
|
}
|
|
1473
1491
|
/**
|
|
1474
1492
|
* List all custom settings
|
|
@@ -1482,7 +1500,9 @@ var CustomSettingsManager = class {
|
|
|
1482
1500
|
* ```
|
|
1483
1501
|
*/
|
|
1484
1502
|
async list() {
|
|
1485
|
-
const settings = await this.fetch.get(
|
|
1503
|
+
const settings = await this.fetch.get(
|
|
1504
|
+
"/api/v1/admin/settings/custom"
|
|
1505
|
+
);
|
|
1486
1506
|
return { settings: Array.isArray(settings) ? settings : [] };
|
|
1487
1507
|
}
|
|
1488
1508
|
/**
|
|
@@ -1498,7 +1518,9 @@ var CustomSettingsManager = class {
|
|
|
1498
1518
|
* ```
|
|
1499
1519
|
*/
|
|
1500
1520
|
async get(key) {
|
|
1501
|
-
return await this.fetch.get(
|
|
1521
|
+
return await this.fetch.get(
|
|
1522
|
+
`/api/v1/admin/settings/custom/${key}`
|
|
1523
|
+
);
|
|
1502
1524
|
}
|
|
1503
1525
|
/**
|
|
1504
1526
|
* Update an existing custom setting
|
|
@@ -1516,7 +1538,10 @@ var CustomSettingsManager = class {
|
|
|
1516
1538
|
* ```
|
|
1517
1539
|
*/
|
|
1518
1540
|
async update(key, request) {
|
|
1519
|
-
return await this.fetch.put(
|
|
1541
|
+
return await this.fetch.put(
|
|
1542
|
+
`/api/v1/admin/settings/custom/${key}`,
|
|
1543
|
+
request
|
|
1544
|
+
);
|
|
1520
1545
|
}
|
|
1521
1546
|
/**
|
|
1522
1547
|
* Delete a custom setting
|
|
@@ -1549,7 +1574,9 @@ var EmailTemplateManager = class {
|
|
|
1549
1574
|
* ```
|
|
1550
1575
|
*/
|
|
1551
1576
|
async list() {
|
|
1552
|
-
const templates = await this.fetch.get(
|
|
1577
|
+
const templates = await this.fetch.get(
|
|
1578
|
+
"/api/v1/admin/email/templates"
|
|
1579
|
+
);
|
|
1553
1580
|
return { templates: Array.isArray(templates) ? templates : [] };
|
|
1554
1581
|
}
|
|
1555
1582
|
/**
|
|
@@ -1566,16 +1593,18 @@ var EmailTemplateManager = class {
|
|
|
1566
1593
|
* ```
|
|
1567
1594
|
*/
|
|
1568
1595
|
async get(type) {
|
|
1569
|
-
return await this.fetch.get(
|
|
1596
|
+
return await this.fetch.get(
|
|
1597
|
+
`/api/v1/admin/email/templates/${type}`
|
|
1598
|
+
);
|
|
1570
1599
|
}
|
|
1571
1600
|
/**
|
|
1572
1601
|
* Update an email template
|
|
1573
1602
|
*
|
|
1574
1603
|
* Available template variables:
|
|
1575
|
-
* - magic_link: {{.MagicLink}}
|
|
1576
|
-
* - verify_email: {{.VerificationLink}}
|
|
1577
|
-
* - reset_password: {{.ResetLink}}
|
|
1578
|
-
* - invite_user: {{.InviteLink}}
|
|
1604
|
+
* - magic_link: `{{.MagicLink}}`, `{{.AppName}}`, `{{.ExpiryMinutes}}`
|
|
1605
|
+
* - verify_email: `{{.VerificationLink}}`, `{{.AppName}}`
|
|
1606
|
+
* - reset_password: `{{.ResetLink}}`, `{{.AppName}}`, `{{.ExpiryMinutes}}`
|
|
1607
|
+
* - invite_user: `{{.InviteLink}}`, `{{.AppName}}`, `{{.InviterName}}`
|
|
1579
1608
|
*
|
|
1580
1609
|
* @param type - Template type to update
|
|
1581
1610
|
* @param request - Update request with subject, html_body, and optional text_body
|
|
@@ -1584,14 +1613,17 @@ var EmailTemplateManager = class {
|
|
|
1584
1613
|
* @example
|
|
1585
1614
|
* ```typescript
|
|
1586
1615
|
* const updated = await client.admin.emailTemplates.update('magic_link', {
|
|
1587
|
-
* subject: 'Your Magic Link - Sign in to {{.AppName}}',
|
|
1588
|
-
* html_body: '<html><body><h1>Welcome!</h1><a href="{{.MagicLink}}">Sign In</a></body></html>',
|
|
1589
|
-
* text_body: 'Click here to sign in: {{.MagicLink}}'
|
|
1616
|
+
* subject: 'Your Magic Link - Sign in to ' + '{{.AppName}}',
|
|
1617
|
+
* html_body: '<html><body><h1>Welcome!</h1><a href="' + '{{.MagicLink}}' + '">Sign In</a></body></html>',
|
|
1618
|
+
* text_body: 'Click here to sign in: ' + '{{.MagicLink}}'
|
|
1590
1619
|
* })
|
|
1591
1620
|
* ```
|
|
1592
1621
|
*/
|
|
1593
1622
|
async update(type, request) {
|
|
1594
|
-
return await this.fetch.put(
|
|
1623
|
+
return await this.fetch.put(
|
|
1624
|
+
`/api/v1/admin/email/templates/${type}`,
|
|
1625
|
+
request
|
|
1626
|
+
);
|
|
1595
1627
|
}
|
|
1596
1628
|
/**
|
|
1597
1629
|
* Reset an email template to default
|
|
@@ -1607,7 +1639,10 @@ var EmailTemplateManager = class {
|
|
|
1607
1639
|
* ```
|
|
1608
1640
|
*/
|
|
1609
1641
|
async reset(type) {
|
|
1610
|
-
return await this.fetch.post(
|
|
1642
|
+
return await this.fetch.post(
|
|
1643
|
+
`/api/v1/admin/email/templates/${type}/reset`,
|
|
1644
|
+
{}
|
|
1645
|
+
);
|
|
1611
1646
|
}
|
|
1612
1647
|
/**
|
|
1613
1648
|
* Send a test email using the template
|