@insforge/sdk 1.2.10 → 1.3.0-ssr.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -14
- package/dist/client-B8ykVESe.d.mts +1121 -0
- package/dist/client-B8ykVESe.d.ts +1121 -0
- package/dist/index.d.mts +4 -1113
- package/dist/index.d.ts +4 -1113
- package/dist/index.js +22 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -7
- package/dist/index.mjs.map +1 -1
- package/dist/ssr.d.mts +93 -0
- package/dist/ssr.d.ts +93 -0
- package/dist/ssr.js +3158 -0
- package/dist/ssr.js.map +1 -0
- package/dist/ssr.mjs +3119 -0
- package/dist/ssr.mjs.map +1 -0
- package/package.json +7 -2
package/dist/index.js
CHANGED
|
@@ -1172,8 +1172,11 @@ var Auth = class {
|
|
|
1172
1172
|
* Browser mode:
|
|
1173
1173
|
* - Uses httpOnly refresh cookie and optional CSRF header.
|
|
1174
1174
|
*
|
|
1175
|
-
*
|
|
1175
|
+
* Legacy server mode (`isServerMode: true`):
|
|
1176
1176
|
* - Uses mobile auth flow and requires `refreshToken` in request body.
|
|
1177
|
+
*
|
|
1178
|
+
* SSR apps should prefer `createRefreshAuthRouter()` / `refreshAuth()` from
|
|
1179
|
+
* `@insforge/sdk/ssr`.
|
|
1177
1180
|
*/
|
|
1178
1181
|
async refreshSession(options) {
|
|
1179
1182
|
try {
|
|
@@ -1183,7 +1186,7 @@ var Auth = class {
|
|
|
1183
1186
|
error: new InsForgeError(
|
|
1184
1187
|
"refreshToken is required when refreshing session in server mode",
|
|
1185
1188
|
400,
|
|
1186
|
-
|
|
1189
|
+
import_shared_schemas.ERROR_CODES.AUTH_UNAUTHORIZED
|
|
1187
1190
|
)
|
|
1188
1191
|
};
|
|
1189
1192
|
}
|
|
@@ -1645,10 +1648,23 @@ var StorageBucket = class {
|
|
|
1645
1648
|
*/
|
|
1646
1649
|
async download(path) {
|
|
1647
1650
|
try {
|
|
1648
|
-
const
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1651
|
+
const encodedKey = encodeURIComponent(path);
|
|
1652
|
+
let strategyResponse;
|
|
1653
|
+
try {
|
|
1654
|
+
strategyResponse = await this.http.get(
|
|
1655
|
+
`/api/storage/buckets/${this.bucketName}/download-strategy/objects/${encodedKey}`
|
|
1656
|
+
);
|
|
1657
|
+
} catch (err) {
|
|
1658
|
+
const status = err instanceof InsForgeError ? err.statusCode : void 0;
|
|
1659
|
+
if (status === 404 || status === 405) {
|
|
1660
|
+
strategyResponse = await this.http.post(
|
|
1661
|
+
`/api/storage/buckets/${this.bucketName}/objects/${encodedKey}/download-strategy`,
|
|
1662
|
+
{}
|
|
1663
|
+
);
|
|
1664
|
+
} else {
|
|
1665
|
+
throw err;
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1652
1668
|
const downloadUrl = strategyResponse.url;
|
|
1653
1669
|
const headers = {};
|
|
1654
1670
|
if (strategyResponse.method === "direct") {
|