@tinycloud/sdk-services 3.1.0-beta.2 → 3.1.0-beta.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.
@@ -1,4 +1,4 @@
1
- import { B as BaseService } from '../BaseService-BhpVpA9b.cjs';
1
+ import { B as BaseService } from '../BaseService-C8zRy0ww.cjs';
2
2
  import { R as Result, I as IService } from '../types-qwMmB7qB.cjs';
3
3
 
4
4
  /**
@@ -23,8 +23,11 @@ interface KVServiceConfig {
23
23
  */
24
24
  prefix?: string;
25
25
  /**
26
- * Default timeout in milliseconds for KV operations.
27
- * Overrides the context-level timeout if set.
26
+ * Default timeout in milliseconds for each KV request, including reading
27
+ * the response body. When it elapses the request is aborted and the
28
+ * operation returns an `ErrorCodes.TIMEOUT` error. A per-call `timeout`
29
+ * option overrides it. Unset (the default), `0`, or `Infinity` means no
30
+ * timeout.
28
31
  */
29
32
  timeout?: number;
30
33
  /** Allow additional config properties */
@@ -55,7 +58,8 @@ interface KVGetOptions {
55
58
  */
56
59
  maxResponseBytes?: number;
57
60
  /**
58
- * Custom timeout for this operation in milliseconds.
61
+ * Custom timeout for this operation in milliseconds. Overrides
62
+ * `KVServiceConfig.timeout`; `0` disables a configured timeout.
59
63
  */
60
64
  timeout?: number;
61
65
  /**
@@ -85,7 +89,8 @@ interface KVPutOptions {
85
89
  /** Only write when the key does not exist. */
86
90
  ifNoneMatch?: "*";
87
91
  /**
88
- * Custom timeout for this operation in milliseconds.
92
+ * Custom timeout for this operation in milliseconds. Overrides
93
+ * `KVServiceConfig.timeout`; `0` disables a configured timeout.
89
94
  */
90
95
  timeout?: number;
91
96
  /**
@@ -123,7 +128,8 @@ interface KVBatchPutOptions {
123
128
  */
124
129
  prefix?: string;
125
130
  /**
126
- * Custom timeout for this operation in milliseconds.
131
+ * Custom timeout for this operation in milliseconds. Overrides
132
+ * `KVServiceConfig.timeout`; `0` disables a configured timeout.
127
133
  */
128
134
  timeout?: number;
129
135
  /**
@@ -182,7 +188,8 @@ interface KVListOptions {
182
188
  /** Opaque scope-bound cursor returned by a previous bounded list. */
183
189
  cursor?: string;
184
190
  /**
185
- * Custom timeout for this operation in milliseconds.
191
+ * Custom timeout for this operation in milliseconds. Overrides
192
+ * `KVServiceConfig.timeout`; `0` disables a configured timeout.
186
193
  */
187
194
  timeout?: number;
188
195
  /**
@@ -201,7 +208,8 @@ interface KVDeleteOptions {
201
208
  /** Only delete when the current object has this strong ETag. */
202
209
  ifMatch?: string;
203
210
  /**
204
- * Custom timeout for this operation in milliseconds.
211
+ * Custom timeout for this operation in milliseconds. Overrides
212
+ * `KVServiceConfig.timeout`; `0` disables a configured timeout.
205
213
  */
206
214
  timeout?: number;
207
215
  /**
@@ -218,7 +226,8 @@ interface KVHeadOptions {
218
226
  */
219
227
  prefix?: string;
220
228
  /**
221
- * Custom timeout for this operation in milliseconds.
229
+ * Custom timeout for this operation in milliseconds. Overrides
230
+ * `KVServiceConfig.timeout`; `0` disables a configured timeout.
222
231
  */
223
232
  timeout?: number;
224
233
  /**
@@ -259,7 +268,8 @@ interface KVCreateSignedReadUrlOptions {
259
268
  */
260
269
  etag?: string;
261
270
  /**
262
- * Custom timeout for this operation in milliseconds.
271
+ * Custom timeout for this operation in milliseconds. Overrides
272
+ * `KVServiceConfig.timeout`; `0` disables a configured timeout.
263
273
  */
264
274
  timeout?: number;
265
275
  /**
@@ -882,7 +892,7 @@ declare class KVService extends BaseService implements IKVService {
882
892
  * @param path - Resource path
883
893
  * @param action - KV action
884
894
  * @param body - Optional request body
885
- * @param signal - Optional abort signal
895
+ * @param signal - Request signal from createRequestSignal()
886
896
  * @returns Fetch response
887
897
  */
888
898
  private invokeOperation;
@@ -918,12 +928,16 @@ declare class KVService extends BaseService implements IKVService {
918
928
  */
919
929
  private parseResponse;
920
930
  private createSignedReadUrlError;
931
+ /** A known 401/403 keeps its typed status even if reading its body fails. */
932
+ private readAuthorizationText;
921
933
  /**
922
934
  * AUTH_UNAUTHORIZED for a 401/403 response. The message keeps the HTTP
923
935
  * status and the server text (`<context>: <status> - <text>`, the same
924
936
  * shape as every other KV failure) so callers that rethrow only the message
925
937
  * still see the status; `meta.status` carries it for typed callers.
926
- * Resource/ability hints are parsed from the raw body, never the message.
938
+ * Server hints must match the requested path/action (whether the node sends
939
+ * a relative path or full resource); metadata uses only the request-derived
940
+ * canonical resource under the authenticated session's space.
927
941
  */
928
942
  private authorizationFailure;
929
943
  private normalizeSignedReadUrlResponse;
@@ -1,4 +1,4 @@
1
- import { B as BaseService } from '../BaseService-CuV-ZVPs.js';
1
+ import { B as BaseService } from '../BaseService-DU-lE-Qx.js';
2
2
  import { R as Result, I as IService } from '../types-qwMmB7qB.js';
3
3
 
4
4
  /**
@@ -23,8 +23,11 @@ interface KVServiceConfig {
23
23
  */
24
24
  prefix?: string;
25
25
  /**
26
- * Default timeout in milliseconds for KV operations.
27
- * Overrides the context-level timeout if set.
26
+ * Default timeout in milliseconds for each KV request, including reading
27
+ * the response body. When it elapses the request is aborted and the
28
+ * operation returns an `ErrorCodes.TIMEOUT` error. A per-call `timeout`
29
+ * option overrides it. Unset (the default), `0`, or `Infinity` means no
30
+ * timeout.
28
31
  */
29
32
  timeout?: number;
30
33
  /** Allow additional config properties */
@@ -55,7 +58,8 @@ interface KVGetOptions {
55
58
  */
56
59
  maxResponseBytes?: number;
57
60
  /**
58
- * Custom timeout for this operation in milliseconds.
61
+ * Custom timeout for this operation in milliseconds. Overrides
62
+ * `KVServiceConfig.timeout`; `0` disables a configured timeout.
59
63
  */
60
64
  timeout?: number;
61
65
  /**
@@ -85,7 +89,8 @@ interface KVPutOptions {
85
89
  /** Only write when the key does not exist. */
86
90
  ifNoneMatch?: "*";
87
91
  /**
88
- * Custom timeout for this operation in milliseconds.
92
+ * Custom timeout for this operation in milliseconds. Overrides
93
+ * `KVServiceConfig.timeout`; `0` disables a configured timeout.
89
94
  */
90
95
  timeout?: number;
91
96
  /**
@@ -123,7 +128,8 @@ interface KVBatchPutOptions {
123
128
  */
124
129
  prefix?: string;
125
130
  /**
126
- * Custom timeout for this operation in milliseconds.
131
+ * Custom timeout for this operation in milliseconds. Overrides
132
+ * `KVServiceConfig.timeout`; `0` disables a configured timeout.
127
133
  */
128
134
  timeout?: number;
129
135
  /**
@@ -182,7 +188,8 @@ interface KVListOptions {
182
188
  /** Opaque scope-bound cursor returned by a previous bounded list. */
183
189
  cursor?: string;
184
190
  /**
185
- * Custom timeout for this operation in milliseconds.
191
+ * Custom timeout for this operation in milliseconds. Overrides
192
+ * `KVServiceConfig.timeout`; `0` disables a configured timeout.
186
193
  */
187
194
  timeout?: number;
188
195
  /**
@@ -201,7 +208,8 @@ interface KVDeleteOptions {
201
208
  /** Only delete when the current object has this strong ETag. */
202
209
  ifMatch?: string;
203
210
  /**
204
- * Custom timeout for this operation in milliseconds.
211
+ * Custom timeout for this operation in milliseconds. Overrides
212
+ * `KVServiceConfig.timeout`; `0` disables a configured timeout.
205
213
  */
206
214
  timeout?: number;
207
215
  /**
@@ -218,7 +226,8 @@ interface KVHeadOptions {
218
226
  */
219
227
  prefix?: string;
220
228
  /**
221
- * Custom timeout for this operation in milliseconds.
229
+ * Custom timeout for this operation in milliseconds. Overrides
230
+ * `KVServiceConfig.timeout`; `0` disables a configured timeout.
222
231
  */
223
232
  timeout?: number;
224
233
  /**
@@ -259,7 +268,8 @@ interface KVCreateSignedReadUrlOptions {
259
268
  */
260
269
  etag?: string;
261
270
  /**
262
- * Custom timeout for this operation in milliseconds.
271
+ * Custom timeout for this operation in milliseconds. Overrides
272
+ * `KVServiceConfig.timeout`; `0` disables a configured timeout.
263
273
  */
264
274
  timeout?: number;
265
275
  /**
@@ -882,7 +892,7 @@ declare class KVService extends BaseService implements IKVService {
882
892
  * @param path - Resource path
883
893
  * @param action - KV action
884
894
  * @param body - Optional request body
885
- * @param signal - Optional abort signal
895
+ * @param signal - Request signal from createRequestSignal()
886
896
  * @returns Fetch response
887
897
  */
888
898
  private invokeOperation;
@@ -918,12 +928,16 @@ declare class KVService extends BaseService implements IKVService {
918
928
  */
919
929
  private parseResponse;
920
930
  private createSignedReadUrlError;
931
+ /** A known 401/403 keeps its typed status even if reading its body fails. */
932
+ private readAuthorizationText;
921
933
  /**
922
934
  * AUTH_UNAUTHORIZED for a 401/403 response. The message keeps the HTTP
923
935
  * status and the server text (`<context>: <status> - <text>`, the same
924
936
  * shape as every other KV failure) so callers that rethrow only the message
925
937
  * still see the status; `meta.status` carries it for typed callers.
926
- * Resource/ability hints are parsed from the raw body, never the message.
938
+ * Server hints must match the requested path/action (whether the node sends
939
+ * a relative path or full resource); metadata uses only the request-derived
940
+ * canonical resource under the authenticated session's space.
927
941
  */
928
942
  private authorizationFailure;
929
943
  private normalizeSignedReadUrlResponse;