@tinycloud/operations 0.3.3-beta.10 → 0.3.3-beta.12
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.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/artifacts.js
CHANGED
|
@@ -2177,16 +2177,17 @@ var KVService = class extends BaseService {
|
|
|
2177
2177
|
...options?.ifNoneMatch === void 0 ? {} : { "if-none-match": options.ifNoneMatch }
|
|
2178
2178
|
}
|
|
2179
2179
|
);
|
|
2180
|
+
if (response.status === 401 || response.status === 403) {
|
|
2181
|
+
const errorText = await response.text();
|
|
2182
|
+
const message = errorText.trim().length > 0 ? errorText : `Failed to put key "${key}": ${response.status} - ${response.statusText || "authorization failed"}`;
|
|
2183
|
+
const { resource, action: requiredAction } = parseAuthError(errorText);
|
|
2184
|
+
return err(authUnauthorizedError("kv", message, {
|
|
2185
|
+
status: response.status,
|
|
2186
|
+
...requiredAction && { requiredAction },
|
|
2187
|
+
...resource && { resource }
|
|
2188
|
+
}));
|
|
2189
|
+
}
|
|
2180
2190
|
if (!response.ok) {
|
|
2181
|
-
if (response.status === 401) {
|
|
2182
|
-
const errorText2 = await response.text();
|
|
2183
|
-
const { resource, action } = parseAuthError(errorText2);
|
|
2184
|
-
return err(authUnauthorizedError("kv", errorText2, {
|
|
2185
|
-
status: response.status,
|
|
2186
|
-
...action && { requiredAction: action },
|
|
2187
|
-
...resource && { resource }
|
|
2188
|
-
}));
|
|
2189
|
-
}
|
|
2190
2191
|
const errorText = await response.text();
|
|
2191
2192
|
if (response.status === 412) {
|
|
2192
2193
|
return err(serviceError(
|