@tinycloud/operations 0.3.3-beta.11 → 0.3.3-beta.13
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/artifacts.cjs +10 -9
- package/dist/artifacts.cjs.map +1 -1
- package/dist/artifacts.d.cts +30 -30
- package/dist/artifacts.d.ts +30 -30
- package/dist/artifacts.js +10 -9
- package/dist/artifacts.js.map +1 -1
- package/dist/cli-runtime.cjs +10 -9
- package/dist/cli-runtime.cjs.map +1 -1
- package/dist/cli-runtime.js +10 -9
- package/dist/cli-runtime.js.map +1 -1
- package/dist/index.cjs +10 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -3620,16 +3620,17 @@ var init_dist2 = __esm({
|
|
|
3620
3620
|
...options?.ifNoneMatch === void 0 ? {} : { "if-none-match": options.ifNoneMatch }
|
|
3621
3621
|
}
|
|
3622
3622
|
);
|
|
3623
|
+
if (response.status === 401 || response.status === 403) {
|
|
3624
|
+
const errorText = await response.text();
|
|
3625
|
+
const message = errorText.trim().length > 0 ? errorText : `Failed to put key "${key}": ${response.status} - ${response.statusText || "authorization failed"}`;
|
|
3626
|
+
const { resource, action: requiredAction } = parseAuthError(errorText);
|
|
3627
|
+
return err(authUnauthorizedError("kv", message, {
|
|
3628
|
+
status: response.status,
|
|
3629
|
+
...requiredAction && { requiredAction },
|
|
3630
|
+
...resource && { resource }
|
|
3631
|
+
}));
|
|
3632
|
+
}
|
|
3623
3633
|
if (!response.ok) {
|
|
3624
|
-
if (response.status === 401) {
|
|
3625
|
-
const errorText2 = await response.text();
|
|
3626
|
-
const { resource, action } = parseAuthError(errorText2);
|
|
3627
|
-
return err(authUnauthorizedError("kv", errorText2, {
|
|
3628
|
-
status: response.status,
|
|
3629
|
-
...action && { requiredAction: action },
|
|
3630
|
-
...resource && { resource }
|
|
3631
|
-
}));
|
|
3632
|
-
}
|
|
3633
3634
|
const errorText = await response.text();
|
|
3634
3635
|
if (response.status === 412) {
|
|
3635
3636
|
return err(serviceError(
|