@visulima/storage 1.0.0-alpha.15 → 1.0.0-alpha.17

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.
Files changed (144) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/LICENSE.md +1094 -382
  3. package/dist/adapter/nuxt/module.d.ts +41 -34
  4. package/dist/handler/http/fetch/index.d.ts +297 -4
  5. package/dist/handler/http/hono/index.d.ts +1474 -58
  6. package/dist/handler/http/nextjs/index.d.ts +66 -58
  7. package/dist/handler/http/node/index.d.ts +361 -4
  8. package/dist/handler/http/solid-start/index.d.ts +66 -57
  9. package/dist/index.d.ts +376 -17
  10. package/dist/openapi/index.d.ts +24 -5
  11. package/dist/packem_shared/{GCSMetaStorage-BkUIdJ5m.js → GCSMetaStorage-BygVH0Ee.js} +1 -1
  12. package/dist/packem_shared/{GCStorage-BnsSAjdW.js → GCStorage-4hSx_bN1.js} +1 -1
  13. package/dist/packem_shared/S3Client.d-CZ62Jztg.d.ts +20357 -0
  14. package/dist/packem_shared/disk-storage-with-checksum.d-hEoe2ugb.d.ts +148 -0
  15. package/dist/packem_shared/{gcs-meta-storage-DBeGn2ix.js → gcs-meta-storage-8FovEDbW.js} +1 -1
  16. package/dist/packem_shared/local-meta-storage.d-Dop9RP9k.d.ts +20 -0
  17. package/dist/packem_shared/media-transformer.d-ChmjTvjc.d.ts +331 -0
  18. package/dist/packem_shared/s3-base-storage.d-CczjSe98.d.ts +251 -0
  19. package/dist/packem_shared/storage.d-BOMUJD96.d.ts +939 -0
  20. package/dist/packem_shared/tus-base.d-CpLzyd-S.d.ts +99 -0
  21. package/dist/packem_shared/types.d-DBjmJvIT.d.ts +708 -0
  22. package/dist/packem_shared/types.d-DviSTLOg.d.ts +49 -0
  23. package/dist/storage/aws/clients/index.d.ts +166 -6
  24. package/dist/storage/aws/index.d.ts +320 -4
  25. package/dist/storage/aws-light/index.d.ts +252 -4
  26. package/dist/storage/azure/index.d.ts +10422 -4
  27. package/dist/storage/gcs/index.d.ts +4107 -5
  28. package/dist/storage/gcs/index.js +2 -2
  29. package/dist/storage/local/index.d.ts +7 -4
  30. package/dist/storage/netlify-blob/index.d.ts +142 -4
  31. package/dist/storage/vercel-blob/index.d.ts +129 -4
  32. package/dist/transformer/audio-transformer.d.ts +127 -125
  33. package/dist/transformer/image-transformer.d.ts +569 -568
  34. package/dist/transformer/index.d.ts +62 -5
  35. package/dist/transformer/video-transformer.d.ts +144 -142
  36. package/package.json +38 -38
  37. package/dist/handler/base/base-handler-core.d.ts +0 -91
  38. package/dist/handler/base/base-handler-fetch.d.ts +0 -76
  39. package/dist/handler/base/base-handler-node.d.ts +0 -137
  40. package/dist/handler/multipart/multipart-base.d.ts +0 -84
  41. package/dist/handler/multipart/multipart-fetch.d.ts +0 -64
  42. package/dist/handler/multipart/multipart.d.ts +0 -49
  43. package/dist/handler/rest/rest-base.d.ts +0 -106
  44. package/dist/handler/rest/rest-fetch.d.ts +0 -88
  45. package/dist/handler/rest/rest.d.ts +0 -93
  46. package/dist/handler/tus/tus-base.d.ts +0 -152
  47. package/dist/handler/tus/tus-fetch.d.ts +0 -72
  48. package/dist/handler/tus/tus.d.ts +0 -78
  49. package/dist/handler/types.d.ts +0 -53
  50. package/dist/handler/utils/request-parser.d.ts +0 -72
  51. package/dist/handler/utils/response-builder.d.ts +0 -83
  52. package/dist/handler/utils/storage-utils.d.ts +0 -10
  53. package/dist/handler/utils/stream-utils.d.ts +0 -29
  54. package/dist/handler/utils/upload-handlers.d.ts +0 -76
  55. package/dist/metrics/index.d.ts +0 -2
  56. package/dist/metrics/no-op-metrics.d.ts +0 -15
  57. package/dist/metrics/opentelemetry-metrics.d.ts +0 -55
  58. package/dist/openapi/rest.d.ts +0 -7
  59. package/dist/openapi/shared.d.ts +0 -13
  60. package/dist/openapi/transform.d.ts +0 -3
  61. package/dist/openapi/tus.d.ts +0 -7
  62. package/dist/openapi/xhr.d.ts +0 -7
  63. package/dist/storage/aws/clients/backblaze.d.ts +0 -12
  64. package/dist/storage/aws/clients/cloudflare.d.ts +0 -13
  65. package/dist/storage/aws/clients/digital-ocean.d.ts +0 -12
  66. package/dist/storage/aws/clients/minio.d.ts +0 -13
  67. package/dist/storage/aws/clients/tigris.d.ts +0 -12
  68. package/dist/storage/aws/clients/types.d.ts +0 -95
  69. package/dist/storage/aws/clients/wasabi.d.ts +0 -12
  70. package/dist/storage/aws/s3-base-storage.d.ts +0 -248
  71. package/dist/storage/aws/s3-client-adapter.d.ts +0 -110
  72. package/dist/storage/aws/s3-file.d.ts +0 -10
  73. package/dist/storage/aws/s3-meta-storage.d.ts +0 -15
  74. package/dist/storage/aws/s3-storage.d.ts +0 -70
  75. package/dist/storage/aws/types.d.ts +0 -118
  76. package/dist/storage/aws-light/aws-light-api-adapter.d.ts +0 -130
  77. package/dist/storage/aws-light/aws-light-file.d.ts +0 -10
  78. package/dist/storage/aws-light/aws-light-meta-storage.d.ts +0 -19
  79. package/dist/storage/aws-light/aws-light-storage.d.ts +0 -66
  80. package/dist/storage/aws-light/types.d.ts +0 -36
  81. package/dist/storage/azure/azure-file.d.ts +0 -6
  82. package/dist/storage/azure/azure-meta-storage.d.ts +0 -15
  83. package/dist/storage/azure/azure-storage.d.ts +0 -69
  84. package/dist/storage/azure/types.d.ts +0 -61
  85. package/dist/storage/gcs/fetch-error.d.ts +0 -11
  86. package/dist/storage/gcs/gcs-config.d.ts +0 -2
  87. package/dist/storage/gcs/gcs-file.d.ts +0 -6
  88. package/dist/storage/gcs/gcs-meta-storage.d.ts +0 -27
  89. package/dist/storage/gcs/gcs-storage.d.ts +0 -91
  90. package/dist/storage/gcs/types.d.ts +0 -54
  91. package/dist/storage/gcs/utils.d.ts +0 -7
  92. package/dist/storage/local/disk-storage-with-checksum.d.ts +0 -15
  93. package/dist/storage/local/disk-storage.d.ts +0 -135
  94. package/dist/storage/local/local-meta-storage.d.ts +0 -27
  95. package/dist/storage/meta-storage-options.d.ts +0 -11
  96. package/dist/storage/meta-storage.d.ts +0 -30
  97. package/dist/storage/netlify-blob/netlify-blob-file.d.ts +0 -12
  98. package/dist/storage/netlify-blob/netlify-blob-meta-storage.d.ts +0 -6
  99. package/dist/storage/netlify-blob/netlify-blob-storage.d.ts +0 -93
  100. package/dist/storage/netlify-blob/types.d.ts +0 -29
  101. package/dist/storage/storage.d.ts +0 -353
  102. package/dist/storage/types.d.ts +0 -217
  103. package/dist/storage/utils/file/file.d.ts +0 -25
  104. package/dist/storage/utils/file/get-file-status.d.ts +0 -9
  105. package/dist/storage/utils/file/has-content.d.ts +0 -9
  106. package/dist/storage/utils/file/index.d.ts +0 -10
  107. package/dist/storage/utils/file/is-expired.d.ts +0 -8
  108. package/dist/storage/utils/file/metadata.d.ts +0 -18
  109. package/dist/storage/utils/file/part-match.d.ts +0 -11
  110. package/dist/storage/utils/file/types.d.ts +0 -37
  111. package/dist/storage/utils/file/update-metadata.d.ts +0 -10
  112. package/dist/storage/utils/file/update-size.d.ts +0 -10
  113. package/dist/storage/vercel-blob/types.d.ts +0 -31
  114. package/dist/storage/vercel-blob/vercel-blob-file.d.ts +0 -16
  115. package/dist/storage/vercel-blob/vercel-blob-meta-storage.d.ts +0 -6
  116. package/dist/storage/vercel-blob/vercel-blob-storage.d.ts +0 -76
  117. package/dist/transformer/base-transformer.d.ts +0 -63
  118. package/dist/transformer/media-transformer.d.ts +0 -332
  119. package/dist/transformer/transformer-config.d.ts +0 -16
  120. package/dist/transformer/types.d.ts +0 -639
  121. package/dist/transformer/utils.d.ts +0 -33
  122. package/dist/transformer/validation-error.d.ts +0 -23
  123. package/dist/utils/cache.d.ts +0 -32
  124. package/dist/utils/chunked-upload.d.ts +0 -65
  125. package/dist/utils/detect-file-type.d.ts +0 -28
  126. package/dist/utils/errors.d.ts +0 -74
  127. package/dist/utils/file-path-url-matcher.d.ts +0 -18
  128. package/dist/utils/headers.d.ts +0 -111
  129. package/dist/utils/http.d.ts +0 -92
  130. package/dist/utils/locker.d.ts +0 -26
  131. package/dist/utils/pipes/stream-checksum.d.ts +0 -47
  132. package/dist/utils/pipes/stream-length.d.ts +0 -22
  133. package/dist/utils/primitives/get-last-one.d.ts +0 -3
  134. package/dist/utils/primitives/is-record.d.ts +0 -2
  135. package/dist/utils/primitives/map-values.d.ts +0 -9
  136. package/dist/utils/primitives/pick.d.ts +0 -2
  137. package/dist/utils/primitives/to-milliseconds.d.ts +0 -12
  138. package/dist/utils/primitives/to-seconds.d.ts +0 -12
  139. package/dist/utils/range-checksum.d.ts +0 -33
  140. package/dist/utils/range-hasher.d.ts +0 -46
  141. package/dist/utils/retry.d.ts +0 -64
  142. package/dist/utils/types.d.ts +0 -108
  143. package/dist/utils/validation-error.d.ts +0 -22
  144. package/dist/utils/validator.d.ts +0 -36
package/dist/index.d.ts CHANGED
@@ -1,17 +1,376 @@
1
- export { waitForStorage } from "./handler/utils/storage-utils.d.ts";
2
- export { NoOpMetrics, OpenTelemetryMetrics } from "./metrics/index.d.ts";
3
- export { default as DiskStorage } from "./storage/local/disk-storage.d.ts";
4
- export { default as DiskStorageWithChecksum } from "./storage/local/disk-storage-with-checksum.d.ts";
5
- export type { LocalMetaStorageOptions } from "./storage/local/local-meta-storage.d.ts";
6
- export { default as LocalMetaStorage } from "./storage/local/local-meta-storage.d.ts";
7
- export { default as MetaStorage } from "./storage/meta-storage.d.ts";
8
- export { BaseStorage as AbstractBaseStorage, defaultCloudStorageFileNameValidation, defaultFilesystemFileNameValidation } from "./storage/storage.d.ts";
9
- export type { BaseStorageOptions, BatchOperationResponse, BatchOperationResult, DiskStorageOptions, DiskStorageWithChecksumOptions, ExpirationOptions, MetaStorageOptions, OnComplete, OnCreate, OnDelete, OnError, OnUpdate, PurgeList, } from "./storage/types.d.ts";
10
- export type { FileInit, FilePart, FileQuery, UploadEventType, UploadFile } from "./storage/utils/file/index.d.ts";
11
- export { File, Metadata } from "./storage/utils/file/index.d.ts";
12
- export { ErrorMap, ERRORS, isUploadError, throwErrorCode, UploadError } from "./utils/errors.d.ts";
13
- export type { RetryConfig } from "./utils/retry.d.ts";
14
- export { createRetryWrapper, isRetryableError, retry } from "./utils/retry.d.ts";
15
- export type { Header, Headers, HttpError, HttpErrorBody, IncomingMessageWithBody, Metrics, RangeChecksum, RangeHasher, ResponseBody, ResponseBodyType, ResponseTuple, UploadResponse, Validation, ValidationError, ValidatorConfig, } from "./utils/types.d.ts";
16
- export type { AnyWebReadableByteStreamWithFileType, AnyWebReadableStream, Detector, FileTypeOptions, FileTypeParser, FileTypeResult, StreamOptions, TokenizerPositionError, } from "file-type";
17
- export { fileTypeFromBlob, fileTypeFromBuffer, fileTypeFromTokenizer, supportedExtensions, supportedMimeTypes } from "file-type";
1
+ import { n as Metrics } from "./packem_shared/storage.d-BOMUJD96.js";
2
+ export { B as AbstractBaseStorage, type k as BaseStorageOptions, type o as BatchOperationResponse, type p as BatchOperationResult, type D as DiskStorageOptions, type h as DiskStorageWithChecksumOptions, E as ERRORS, q as ErrorMap, type r as ExpirationOptions, F as File, type b as FileInit, type d as FilePart, type e as FileQuery, type s as Header, type t as Headers, type H as HttpError, type u as HttpErrorBody, type I as IncomingMessageWithBody, type L as LocalMetaStorageOptions, M as MetaStorage, type m as MetaStorageOptions, v as Metadata, type O as OnComplete, type w as OnCreate, type x as OnDelete, type y as OnError, type z as OnUpdate, type P as PurgeList, type A as RangeChecksum, type G as RangeHasher, type J as ResponseBody, type i as ResponseBodyType, type K as ResponseTuple, type R as RetryConfig, f as UploadError, type g as UploadEventType, type U as UploadFile, type l as UploadResponse, type V as Validation, type N as ValidationError, type Q as ValidatorConfig, c as createRetryWrapper, S as defaultCloudStorageFileNameValidation, T as defaultFilesystemFileNameValidation, W as isRetryableError, X as isUploadError, Y as retry, Z as throwErrorCode } from "./packem_shared/storage.d-BOMUJD96.js";
3
+ export { D as DiskStorage, a as DiskStorageWithChecksum } from "./packem_shared/disk-storage-with-checksum.d-hEoe2ugb.js";
4
+ export { L as LocalMetaStorage } from "./packem_shared/local-meta-storage.d-Dop9RP9k.js";
5
+ export { type AnyWebReadableByteStreamWithFileType, type AnyWebReadableStream, type Detector, type FileTypeOptions, type FileTypeParser, type FileTypeResult, type StreamOptions, type TokenizerPositionError, fileTypeFromBlob, fileTypeFromBuffer, fileTypeFromTokenizer, supportedExtensions, supportedMimeTypes } from 'file-type';
6
+ import 'node:stream';
7
+ import 'node:crypto';
8
+ import 'node:http';
9
+ import 'lru-cache';
10
+ /**
11
+ * Wait for storage to be ready before handling requests.
12
+ * This ensures storage initialization (e.g., AWS S3, GCS) completes before processing uploads.
13
+ * @param storage Storage instance with isReady property
14
+ * @param timeoutMs Maximum time to wait in milliseconds (default: 5000)
15
+ * @throws Error if storage doesn't become ready within timeout
16
+ */
17
+ declare const waitForStorage: (storage: {
18
+ isReady: boolean;
19
+ }, timeoutMs?: number) => Promise<void>;
20
+ /**
21
+ * No-op metrics that does nothing.
22
+ * Used as a default when metrics are not provided.
23
+ */
24
+ declare class NoOpMetrics implements Metrics {
25
+ increment(_name: string, _value?: number, _attributes?: Record<string, string | number>): void;
26
+ timing(_name: string, _duration: number, _attributes?: Record<string, string | number>): void;
27
+ gauge(_name: string, _value: number, _attributes?: Record<string, string | number>): void;
28
+ }
29
+ /**
30
+ * @since 1.0.0
31
+ */
32
+ interface Context {
33
+ /**
34
+ * Get a value from the context.
35
+ *
36
+ * @param key key which identifies a context value
37
+ */
38
+ getValue(key: symbol): unknown;
39
+ /**
40
+ * Create a new context which inherits from this context and has
41
+ * the given key set to the given value.
42
+ *
43
+ * @param key context key for which to set the value
44
+ * @param value value to set for the given key
45
+ */
46
+ setValue(key: symbol, value: unknown): Context;
47
+ /**
48
+ * Return a new context which inherits from this context but does
49
+ * not contain a value for the given key.
50
+ *
51
+ * @param key context key for which to clear a value
52
+ */
53
+ deleteValue(key: symbol): Context;
54
+ }
55
+ /**
56
+ * Attributes is a map from string to attribute values.
57
+ *
58
+ * Note: only the own enumerable keys are counted as valid attribute keys.
59
+ *
60
+ * @since 1.3.0
61
+ */
62
+ interface Attributes {
63
+ [attributeKey: string]: AttributeValue | undefined;
64
+ }
65
+ /**
66
+ * Attribute values may be any non-nullish primitive value except an object.
67
+ *
68
+ * null or undefined attribute values are invalid and will result in undefined behavior.
69
+ *
70
+ * @since 1.3.0
71
+ */
72
+ type AttributeValue = string | number | boolean | Array<null | undefined | string> | Array<null | undefined | number> | Array<null | undefined | boolean>;
73
+ /**
74
+ * Advisory options influencing aggregation configuration parameters.
75
+ *
76
+ * @since 1.7.0
77
+ * @experimental
78
+ */
79
+ interface MetricAdvice {
80
+ /**
81
+ * Hint the explicit bucket boundaries for SDK if the metric is been
82
+ * aggregated with a HistogramAggregator.
83
+ */
84
+ explicitBucketBoundaries?: number[];
85
+ }
86
+ /**
87
+ * Options needed for metric creation
88
+ *
89
+ * @since 1.3.0
90
+ */
91
+ interface MetricOptions {
92
+ /**
93
+ * The description of the Metric.
94
+ * @default ''
95
+ */
96
+ description?: string;
97
+ /**
98
+ * The unit of the Metric values.
99
+ * @default ''
100
+ */
101
+ unit?: string;
102
+ /**
103
+ * Indicates the type of the recorded value.
104
+ * @default {@link ValueType.DOUBLE}
105
+ */
106
+ valueType?: ValueType;
107
+ /**
108
+ * The advice influencing aggregation configuration parameters.
109
+ * @experimental
110
+ * @since 1.7.0
111
+ */
112
+ advice?: MetricAdvice;
113
+ }
114
+ /**
115
+ * The Type of value. It describes how the data is reported.
116
+ *
117
+ * @since 1.3.0
118
+ */
119
+ declare enum ValueType {
120
+ INT = 0,
121
+ DOUBLE = 1,
122
+ }
123
+ /**
124
+ * Counter is the most common synchronous instrument. This instrument supports
125
+ * an `Add(increment)` function for reporting a sum, and is restricted to
126
+ * non-negative increments. The default aggregation is Sum, as for any additive
127
+ * instrument.
128
+ *
129
+ * Example uses for Counter:
130
+ * <ol>
131
+ * <li> count the number of bytes received. </li>
132
+ * <li> count the number of requests completed. </li>
133
+ * <li> count the number of accounts created. </li>
134
+ * <li> count the number of checkpoints run. </li>
135
+ * <li> count the number of 5xx errors. </li>
136
+ * <ol>
137
+ *
138
+ * @since 1.3.0
139
+ */
140
+ interface Counter<AttributesTypes extends MetricAttributes = MetricAttributes> {
141
+ /**
142
+ * Increment value of counter by the input. Inputs must not be negative.
143
+ */
144
+ add(value: number, attributes?: AttributesTypes, context?: Context): void;
145
+ }
146
+ /**
147
+ * @since 1.3.0
148
+ */
149
+ interface UpDownCounter<AttributesTypes extends MetricAttributes = MetricAttributes> {
150
+ /**
151
+ * Increment value of counter by the input. Inputs may be negative.
152
+ */
153
+ add(value: number, attributes?: AttributesTypes, context?: Context): void;
154
+ }
155
+ /**
156
+ * @since 1.9.0
157
+ */
158
+ interface Gauge<AttributesTypes extends MetricAttributes = MetricAttributes> {
159
+ /**
160
+ * Records a measurement.
161
+ */
162
+ record(value: number, attributes?: AttributesTypes, context?: Context): void;
163
+ }
164
+ /**
165
+ * @since 1.3.0
166
+ */
167
+ interface Histogram<AttributesTypes extends MetricAttributes = MetricAttributes> {
168
+ /**
169
+ * Records a measurement. Value of the measurement must not be negative.
170
+ */
171
+ record(value: number, attributes?: AttributesTypes, context?: Context): void;
172
+ }
173
+ /**
174
+ * @deprecated please use {@link Attributes}
175
+ * @since 1.3.0
176
+ */
177
+ type MetricAttributes = Attributes;
178
+ /**
179
+ * Interface that is being used in callback function for Observable Metric.
180
+ *
181
+ * @since 1.3.0
182
+ */
183
+ interface ObservableResult<AttributesTypes extends MetricAttributes = MetricAttributes> {
184
+ /**
185
+ * Observe a measurement of the value associated with the given attributes.
186
+ *
187
+ * @param value The value to be observed.
188
+ * @param attributes The attributes associated with the value. If more than
189
+ * one value is associated with the same attributes values, SDK may pick the
190
+ * last one or simply drop the entire observable result.
191
+ */
192
+ observe(this: ObservableResult<AttributesTypes>, value: number, attributes?: AttributesTypes): void;
193
+ }
194
+ /**
195
+ * Interface that is being used in batch observable callback function.
196
+ */
197
+ interface BatchObservableResult<AttributesTypes extends MetricAttributes = MetricAttributes> {
198
+ /**
199
+ * Observe a measurement of the value associated with the given attributes.
200
+ *
201
+ * @param metric The observable metric to be observed.
202
+ * @param value The value to be observed.
203
+ * @param attributes The attributes associated with the value. If more than
204
+ * one value is associated with the same attributes values, SDK may pick the
205
+ * last one or simply drop the entire observable result.
206
+ */
207
+ observe(this: BatchObservableResult<AttributesTypes>, metric: Observable<AttributesTypes>, value: number, attributes?: AttributesTypes): void;
208
+ }
209
+ /**
210
+ * The observable callback for Observable instruments.
211
+ *
212
+ * @since 1.3.0
213
+ */
214
+ type ObservableCallback<AttributesTypes extends MetricAttributes = MetricAttributes> = (observableResult: ObservableResult<AttributesTypes>) => void | Promise<void>;
215
+ /**
216
+ * The observable callback for a batch of Observable instruments.
217
+ *
218
+ * @since 1.3.0
219
+ */
220
+ type BatchObservableCallback<AttributesTypes extends MetricAttributes = MetricAttributes> = (observableResult: BatchObservableResult<AttributesTypes>) => void | Promise<void>;
221
+ /**
222
+ * @since 1.3.0
223
+ */
224
+ interface Observable<AttributesTypes extends MetricAttributes = MetricAttributes> {
225
+ /**
226
+ * Sets up a function that will be called whenever a metric collection is initiated.
227
+ *
228
+ * If the function is already in the list of callbacks for this Observable, the function is not added a second time.
229
+ */
230
+ addCallback(callback: ObservableCallback<AttributesTypes>): void;
231
+ /**
232
+ * Removes a callback previously registered with {@link Observable.addCallback}.
233
+ */
234
+ removeCallback(callback: ObservableCallback<AttributesTypes>): void;
235
+ }
236
+ /**
237
+ * @since 1.3.0
238
+ */
239
+ type ObservableCounter<AttributesTypes extends MetricAttributes = MetricAttributes> = Observable<AttributesTypes>;
240
+ /**
241
+ * @since 1.3.0
242
+ */
243
+ type ObservableUpDownCounter<AttributesTypes extends MetricAttributes = MetricAttributes> = Observable<AttributesTypes>;
244
+ /**
245
+ * @since 1.3.0
246
+ */
247
+ type ObservableGauge<AttributesTypes extends MetricAttributes = MetricAttributes> = Observable<AttributesTypes>;
248
+ /**
249
+ * An interface to allow the recording metrics.
250
+ *
251
+ * {@link Metric}s are used for recording pre-defined aggregation (`Counter`),
252
+ * or raw values (`Histogram`) in which the aggregation and attributes
253
+ * for the exported metric are deferred.
254
+ *
255
+ * @since 1.3.0
256
+ */
257
+ interface Meter {
258
+ /**
259
+ * Creates and returns a new `Gauge`.
260
+ * @param name the name of the metric.
261
+ * @param [options] the metric options.
262
+ */
263
+ createGauge<AttributesTypes extends MetricAttributes = MetricAttributes>(name: string, options?: MetricOptions): Gauge<AttributesTypes>;
264
+ /**
265
+ * Creates and returns a new `Histogram`.
266
+ * @param name the name of the metric.
267
+ * @param [options] the metric options.
268
+ */
269
+ createHistogram<AttributesTypes extends MetricAttributes = MetricAttributes>(name: string, options?: MetricOptions): Histogram<AttributesTypes>;
270
+ /**
271
+ * Creates a new `Counter` metric. Generally, this kind of metric when the
272
+ * value is a quantity, the sum is of primary interest, and the event count
273
+ * and value distribution are not of primary interest.
274
+ * @param name the name of the metric.
275
+ * @param [options] the metric options.
276
+ */
277
+ createCounter<AttributesTypes extends MetricAttributes = MetricAttributes>(name: string, options?: MetricOptions): Counter<AttributesTypes>;
278
+ /**
279
+ * Creates a new `UpDownCounter` metric. UpDownCounter is a synchronous
280
+ * instrument and very similar to Counter except that Add(increment)
281
+ * supports negative increments. It is generally useful for capturing changes
282
+ * in an amount of resources used, or any quantity that rises and falls
283
+ * during a request.
284
+ * Example uses for UpDownCounter:
285
+ * <ol>
286
+ * <li> count the number of active requests. </li>
287
+ * <li> count memory in use by instrumenting new and delete. </li>
288
+ * <li> count queue size by instrumenting enqueue and dequeue. </li>
289
+ * <li> count semaphore up and down operations. </li>
290
+ * </ol>
291
+ *
292
+ * @param name the name of the metric.
293
+ * @param [options] the metric options.
294
+ */
295
+ createUpDownCounter<AttributesTypes extends MetricAttributes = MetricAttributes>(name: string, options?: MetricOptions): UpDownCounter<AttributesTypes>;
296
+ /**
297
+ * Creates a new `ObservableGauge` metric.
298
+ *
299
+ * The callback SHOULD be safe to be invoked concurrently.
300
+ *
301
+ * @param name the name of the metric.
302
+ * @param [options] the metric options.
303
+ */
304
+ createObservableGauge<AttributesTypes extends MetricAttributes = MetricAttributes>(name: string, options?: MetricOptions): ObservableGauge<AttributesTypes>;
305
+ /**
306
+ * Creates a new `ObservableCounter` metric.
307
+ *
308
+ * The callback SHOULD be safe to be invoked concurrently.
309
+ *
310
+ * @param name the name of the metric.
311
+ * @param [options] the metric options.
312
+ */
313
+ createObservableCounter<AttributesTypes extends MetricAttributes = MetricAttributes>(name: string, options?: MetricOptions): ObservableCounter<AttributesTypes>;
314
+ /**
315
+ * Creates a new `ObservableUpDownCounter` metric.
316
+ *
317
+ * The callback SHOULD be safe to be invoked concurrently.
318
+ *
319
+ * @param name the name of the metric.
320
+ * @param [options] the metric options.
321
+ */
322
+ createObservableUpDownCounter<AttributesTypes extends MetricAttributes = MetricAttributes>(name: string, options?: MetricOptions): ObservableUpDownCounter<AttributesTypes>;
323
+ /**
324
+ * Sets up a function that will be called whenever a metric collection is
325
+ * initiated.
326
+ *
327
+ * If the function is already in the list of callbacks for this Observable,
328
+ * the function is not added a second time.
329
+ *
330
+ * Only the associated observables can be observed in the callback.
331
+ * Measurements of observables that are not associated observed in the
332
+ * callback are dropped.
333
+ *
334
+ * @param callback the batch observable callback
335
+ * @param observables the observables associated with this batch observable callback
336
+ */
337
+ addBatchObservableCallback<AttributesTypes extends MetricAttributes = MetricAttributes>(callback: BatchObservableCallback<AttributesTypes>, observables: Observable<AttributesTypes>[]): void;
338
+ /**
339
+ * Removes a callback previously registered with {@link Meter.addBatchObservableCallback}.
340
+ *
341
+ * The callback to be removed is identified using a combination of the callback itself,
342
+ * and the set of the observables associated with it.
343
+ *
344
+ * @param callback the batch observable callback
345
+ * @param observables the observables associated with this batch observable callback
346
+ */
347
+ removeBatchObservableCallback<AttributesTypes extends MetricAttributes = MetricAttributes>(callback: BatchObservableCallback<AttributesTypes>, observables: Observable<AttributesTypes>[]): void;
348
+ }
349
+ /**
350
+ * OpenTelemetry-based metrics implementation.
351
+ */
352
+ declare class OpenTelemetryMetrics implements Metrics {
353
+ private readonly meter;
354
+ private readonly counters;
355
+ private readonly histograms;
356
+ private readonly gauges;
357
+ /**
358
+ * Creates a new OpenTelemetryMetrics instance.
359
+ * @param meter OpenTelemetry Meter instance. If not provided, uses the default meter.
360
+ * @throws {Error} If \@opentelemetry/api is not installed
361
+ */
362
+ constructor(meter?: Meter);
363
+ /**
364
+ * Increment a counter metric.
365
+ */
366
+ increment(name: string, value?: number, attributes?: Record<string, string | number>): void;
367
+ /**
368
+ * Record a duration/timing metric in milliseconds.
369
+ */
370
+ timing(name: string, duration: number, attributes?: Record<string, string | number>): void;
371
+ /**
372
+ * Set a gauge metric value.
373
+ */
374
+ gauge(name: string, value: number, attributes?: Record<string, string | number>): void;
375
+ }
376
+ export { type Metrics, NoOpMetrics, OpenTelemetryMetrics, waitForStorage };
@@ -1,5 +1,24 @@
1
- export { default as restOpenApiSpec } from "./rest.d.ts";
2
- export { sharedErrorSchemaObject, sharedFileMetaExampleObject, sharedFileMetaSchemaObject, sharedGet, sharedGetList } from "./shared.d.ts";
3
- export { default as transformOpenApiSpec } from "./transform.d.ts";
4
- export { default as tusOpenApiSpec } from "./tus.d.ts";
5
- export { default as xhrOpenApiSpec } from "./xhr.d.ts";
1
+ import { OpenAPIV3 } from 'openapi-types';
2
+ declare const swaggerSpec$3: (origin: string, path: string, options: {
3
+ supportedTransformerFormat?: string[];
4
+ tags?: string[] | undefined;
5
+ transformer?: boolean | "audio" | "video" | "image";
6
+ }) => Partial<OpenAPIV3.Document>;
7
+ type TransformType = boolean | "audio" | "video" | "image";
8
+ declare const sharedGet: (operationId: string, tags: string[] | undefined, transform?: TransformType, transformerFormat?: string[]) => OpenAPIV3.OperationObject;
9
+ declare const sharedErrorSchemaObject: Record<string, OpenAPIV3.NonArraySchemaObject>;
10
+ declare const sharedFileMetaSchemaObject: Record<string, OpenAPIV3.NonArraySchemaObject>;
11
+ declare const sharedFileMetaExampleObject: Record<string, OpenAPIV3.ExampleObject>;
12
+ declare const sharedGetList: (operationId: string, tags: string[] | undefined) => OpenAPIV3.OperationObject;
13
+ declare const swaggerSpec$2: (path?: string, tags?: string[] | undefined) => Partial<OpenAPIV3.Document>;
14
+ declare const swaggerSpec$1: (path: string, options: {
15
+ supportedTransformerFormat?: string[];
16
+ tags?: string[] | undefined;
17
+ transformer?: boolean | "audio" | "video" | "image";
18
+ }) => Partial<OpenAPIV3.Document>;
19
+ declare const swaggerSpec: (origin: string, path: string, options: {
20
+ supportedTransformerFormat?: string[];
21
+ tags?: string[] | undefined;
22
+ transformer?: boolean | "audio" | "video" | "image";
23
+ }) => Partial<OpenAPIV3.Document>;
24
+ export { swaggerSpec$3 as restOpenApiSpec, sharedErrorSchemaObject, sharedFileMetaExampleObject, sharedFileMetaSchemaObject, sharedGet, sharedGetList, swaggerSpec$2 as transformOpenApiSpec, swaggerSpec$1 as tusOpenApiSpec, swaggerSpec as xhrOpenApiSpec };
@@ -1,7 +1,7 @@
1
1
  import 'node:crypto';
2
2
  import 'gaxios';
3
3
  import 'google-auth-library';
4
- export { G as default } from './gcs-meta-storage-DBeGn2ix.js';
4
+ export { G as default } from './gcs-meta-storage-8FovEDbW.js';
5
5
  import './MetaStorage-pECeFOad.js';
6
6
  import './Metadata-DRLXeJ0F.js';
7
7
  import './GCSConfig-vPP22kN6.js';
@@ -1,7 +1,7 @@
1
1
  import { randomUUID } from 'node:crypto';
2
2
  import { request } from 'gaxios';
3
3
  import { GoogleAuth } from 'google-auth-library';
4
- import { r as retryOptions, G as GCSMetaStorage, g as getRangeEnd, p as package_, b as buildContentRange } from './gcs-meta-storage-DBeGn2ix.js';
4
+ import { r as retryOptions, G as GCSMetaStorage, g as getRangeEnd, p as package_, b as buildContentRange } from './gcs-meta-storage-8FovEDbW.js';
5
5
  import { p as partMatch, d as detectFileTypeFromStream, g as getFileStatus } from './part-match-Dt738Ddb.js';
6
6
  import { throwErrorCode, ERRORS } from './ERRORS-D0apMqnc.js';
7
7
  import { B as BaseStorage, t as toMilliseconds } from './storage-5XW1E7XU.js';