replicas-cli 0.2.120 → 0.2.121

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.
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env bun
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
10
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
11
+ }) : x)(function(x) {
12
+ if (typeof require !== "undefined") return require.apply(this, arguments);
13
+ throw Error('Dynamic require of "' + x + '" is not supported');
14
+ });
15
+ var __commonJS = (cb, mod) => function __require2() {
16
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
27
+ // If the importer is in node compatibility mode or this is not an ESM
28
+ // file that has been converted to a CommonJS file using a Babel-
29
+ // compatible transform (i.e. "__esModule" has not been set), then set
30
+ // "default" to the CommonJS "module.exports" for node compatibility.
31
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
32
+ mod
33
+ ));
34
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
35
+
36
+ export {
37
+ __require,
38
+ __commonJS,
39
+ __toESM,
40
+ __publicField
41
+ };
@@ -0,0 +1,175 @@
1
+ #!/usr/bin/env bun
2
+ import {
3
+ fromBase64,
4
+ streamCollector,
5
+ toBase64,
6
+ toHex
7
+ } from "./chunk-H7SOGPWV.mjs";
8
+ import {
9
+ fromArrayBuffer,
10
+ toUtf8
11
+ } from "./chunk-S6VA5TIO.mjs";
12
+
13
+ // ../node_modules/.bun/@smithy+util-stream@4.5.21/node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.js
14
+ import { Readable } from "stream";
15
+
16
+ // ../node_modules/.bun/@smithy+fetch-http-handler@5.3.15/node_modules/@smithy/fetch-http-handler/dist-es/stream-collector.js
17
+ var streamCollector2 = async (stream) => {
18
+ if (typeof Blob === "function" && stream instanceof Blob || stream.constructor?.name === "Blob") {
19
+ if (Blob.prototype.arrayBuffer !== void 0) {
20
+ return new Uint8Array(await stream.arrayBuffer());
21
+ }
22
+ return collectBlob(stream);
23
+ }
24
+ return collectStream(stream);
25
+ };
26
+ async function collectBlob(blob) {
27
+ const base64 = await readToBase64(blob);
28
+ const arrayBuffer = fromBase64(base64);
29
+ return new Uint8Array(arrayBuffer);
30
+ }
31
+ async function collectStream(stream) {
32
+ const chunks = [];
33
+ const reader = stream.getReader();
34
+ let isDone = false;
35
+ let length = 0;
36
+ while (!isDone) {
37
+ const { done, value } = await reader.read();
38
+ if (value) {
39
+ chunks.push(value);
40
+ length += value.length;
41
+ }
42
+ isDone = done;
43
+ }
44
+ const collected = new Uint8Array(length);
45
+ let offset = 0;
46
+ for (const chunk of chunks) {
47
+ collected.set(chunk, offset);
48
+ offset += chunk.length;
49
+ }
50
+ return collected;
51
+ }
52
+ function readToBase64(blob) {
53
+ return new Promise((resolve, reject) => {
54
+ const reader = new FileReader();
55
+ reader.onloadend = () => {
56
+ if (reader.readyState !== 2) {
57
+ return reject(new Error("Reader aborted too early"));
58
+ }
59
+ const result = reader.result ?? "";
60
+ const commaIndex = result.indexOf(",");
61
+ const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length;
62
+ resolve(result.substring(dataOffset));
63
+ };
64
+ reader.onabort = () => reject(new Error("Read aborted"));
65
+ reader.onerror = () => reject(reader.error);
66
+ reader.readAsDataURL(blob);
67
+ });
68
+ }
69
+
70
+ // ../node_modules/.bun/@smithy+util-stream@4.5.21/node_modules/@smithy/util-stream/dist-es/stream-type-check.js
71
+ var isReadableStream = (stream) => typeof ReadableStream === "function" && (stream?.constructor?.name === ReadableStream.name || stream instanceof ReadableStream);
72
+
73
+ // ../node_modules/.bun/@smithy+util-stream@4.5.21/node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.browser.js
74
+ var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed.";
75
+ var sdkStreamMixin = (stream) => {
76
+ if (!isBlobInstance(stream) && !isReadableStream(stream)) {
77
+ const name = stream?.__proto__?.constructor?.name || stream;
78
+ throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name}`);
79
+ }
80
+ let transformed = false;
81
+ const transformToByteArray = async () => {
82
+ if (transformed) {
83
+ throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
84
+ }
85
+ transformed = true;
86
+ return await streamCollector2(stream);
87
+ };
88
+ const blobToWebStream = (blob) => {
89
+ if (typeof blob.stream !== "function") {
90
+ throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");
91
+ }
92
+ return blob.stream();
93
+ };
94
+ return Object.assign(stream, {
95
+ transformToByteArray,
96
+ transformToString: async (encoding) => {
97
+ const buf = await transformToByteArray();
98
+ if (encoding === "base64") {
99
+ return toBase64(buf);
100
+ } else if (encoding === "hex") {
101
+ return toHex(buf);
102
+ } else if (encoding === void 0 || encoding === "utf8" || encoding === "utf-8") {
103
+ return toUtf8(buf);
104
+ } else if (typeof TextDecoder === "function") {
105
+ return new TextDecoder(encoding).decode(buf);
106
+ } else {
107
+ throw new Error("TextDecoder is not available, please make sure polyfill is provided.");
108
+ }
109
+ },
110
+ transformToWebStream: () => {
111
+ if (transformed) {
112
+ throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
113
+ }
114
+ transformed = true;
115
+ if (isBlobInstance(stream)) {
116
+ return blobToWebStream(stream);
117
+ } else if (isReadableStream(stream)) {
118
+ return stream;
119
+ } else {
120
+ throw new Error(`Cannot transform payload to web stream, got ${stream}`);
121
+ }
122
+ }
123
+ });
124
+ };
125
+ var isBlobInstance = (stream) => typeof Blob === "function" && stream instanceof Blob;
126
+
127
+ // ../node_modules/.bun/@smithy+util-stream@4.5.21/node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.js
128
+ var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2 = "The stream has already been transformed.";
129
+ var sdkStreamMixin2 = (stream) => {
130
+ if (!(stream instanceof Readable)) {
131
+ try {
132
+ return sdkStreamMixin(stream);
133
+ } catch (e) {
134
+ const name = stream?.__proto__?.constructor?.name || stream;
135
+ throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name}`);
136
+ }
137
+ }
138
+ let transformed = false;
139
+ const transformToByteArray = async () => {
140
+ if (transformed) {
141
+ throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2);
142
+ }
143
+ transformed = true;
144
+ return await streamCollector(stream);
145
+ };
146
+ return Object.assign(stream, {
147
+ transformToByteArray,
148
+ transformToString: async (encoding) => {
149
+ const buf = await transformToByteArray();
150
+ if (encoding === void 0 || Buffer.isEncoding(encoding)) {
151
+ return fromArrayBuffer(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding);
152
+ } else {
153
+ const decoder = new TextDecoder(encoding);
154
+ return decoder.decode(buf);
155
+ }
156
+ },
157
+ transformToWebStream: () => {
158
+ if (transformed) {
159
+ throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2);
160
+ }
161
+ if (stream.readableFlowing !== null) {
162
+ throw new Error("The stream has been consumed by other callbacks.");
163
+ }
164
+ if (typeof Readable.toWeb !== "function") {
165
+ throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");
166
+ }
167
+ transformed = true;
168
+ return Readable.toWeb(stream);
169
+ }
170
+ });
171
+ };
172
+
173
+ export {
174
+ sdkStreamMixin2 as sdkStreamMixin
175
+ };
@@ -0,0 +1,178 @@
1
+ #!/usr/bin/env bun
2
+
3
+ // ../node_modules/.bun/@smithy+core@3.23.17/node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js
4
+ var expectNumber = (value) => {
5
+ if (value === null || value === void 0) {
6
+ return void 0;
7
+ }
8
+ if (typeof value === "string") {
9
+ const parsed = parseFloat(value);
10
+ if (!Number.isNaN(parsed)) {
11
+ if (String(parsed) !== String(value)) {
12
+ logger.warn(stackTraceWarning(`Expected number but observed string: ${value}`));
13
+ }
14
+ return parsed;
15
+ }
16
+ }
17
+ if (typeof value === "number") {
18
+ return value;
19
+ }
20
+ throw new TypeError(`Expected number, got ${typeof value}: ${value}`);
21
+ };
22
+ var MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23));
23
+ var expectFloat32 = (value) => {
24
+ const expected = expectNumber(value);
25
+ if (expected !== void 0 && !Number.isNaN(expected) && expected !== Infinity && expected !== -Infinity) {
26
+ if (Math.abs(expected) > MAX_FLOAT) {
27
+ throw new TypeError(`Expected 32-bit float, got ${value}`);
28
+ }
29
+ }
30
+ return expected;
31
+ };
32
+ var expectLong = (value) => {
33
+ if (value === null || value === void 0) {
34
+ return void 0;
35
+ }
36
+ if (Number.isInteger(value) && !Number.isNaN(value)) {
37
+ return value;
38
+ }
39
+ throw new TypeError(`Expected integer, got ${typeof value}: ${value}`);
40
+ };
41
+ var expectShort = (value) => expectSizedInt(value, 16);
42
+ var expectByte = (value) => expectSizedInt(value, 8);
43
+ var expectSizedInt = (value, size) => {
44
+ const expected = expectLong(value);
45
+ if (expected !== void 0 && castInt(expected, size) !== expected) {
46
+ throw new TypeError(`Expected ${size}-bit integer, got ${value}`);
47
+ }
48
+ return expected;
49
+ };
50
+ var castInt = (value, size) => {
51
+ switch (size) {
52
+ case 32:
53
+ return Int32Array.of(value)[0];
54
+ case 16:
55
+ return Int16Array.of(value)[0];
56
+ case 8:
57
+ return Int8Array.of(value)[0];
58
+ }
59
+ };
60
+ var strictParseFloat32 = (value) => {
61
+ if (typeof value == "string") {
62
+ return expectFloat32(parseNumber(value));
63
+ }
64
+ return expectFloat32(value);
65
+ };
66
+ var NUMBER_REGEX = /(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g;
67
+ var parseNumber = (value) => {
68
+ const matches = value.match(NUMBER_REGEX);
69
+ if (matches === null || matches[0].length !== value.length) {
70
+ throw new TypeError(`Expected real number, got implicit NaN`);
71
+ }
72
+ return parseFloat(value);
73
+ };
74
+ var strictParseShort = (value) => {
75
+ if (typeof value === "string") {
76
+ return expectShort(parseNumber(value));
77
+ }
78
+ return expectShort(value);
79
+ };
80
+ var strictParseByte = (value) => {
81
+ if (typeof value === "string") {
82
+ return expectByte(parseNumber(value));
83
+ }
84
+ return expectByte(value);
85
+ };
86
+ var stackTraceWarning = (message) => {
87
+ return String(new TypeError(message).stack || message).split("\n").slice(0, 5).filter((s) => !s.includes("stackTraceWarning")).join("\n");
88
+ };
89
+ var logger = {
90
+ warn: console.warn
91
+ };
92
+
93
+ // ../node_modules/.bun/@smithy+core@3.23.17/node_modules/@smithy/core/dist-es/submodules/serde/date-utils.js
94
+ var DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
95
+ var MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
96
+ function dateToUtcString(date) {
97
+ const year = date.getUTCFullYear();
98
+ const month = date.getUTCMonth();
99
+ const dayOfWeek = date.getUTCDay();
100
+ const dayOfMonthInt = date.getUTCDate();
101
+ const hoursInt = date.getUTCHours();
102
+ const minutesInt = date.getUTCMinutes();
103
+ const secondsInt = date.getUTCSeconds();
104
+ const dayOfMonthString = dayOfMonthInt < 10 ? `0${dayOfMonthInt}` : `${dayOfMonthInt}`;
105
+ const hoursString = hoursInt < 10 ? `0${hoursInt}` : `${hoursInt}`;
106
+ const minutesString = minutesInt < 10 ? `0${minutesInt}` : `${minutesInt}`;
107
+ const secondsString = secondsInt < 10 ? `0${secondsInt}` : `${secondsInt}`;
108
+ return `${DAYS[dayOfWeek]}, ${dayOfMonthString} ${MONTHS[month]} ${year} ${hoursString}:${minutesString}:${secondsString} GMT`;
109
+ }
110
+ var RFC3339 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/);
111
+ var parseRfc3339DateTime = (value) => {
112
+ if (value === null || value === void 0) {
113
+ return void 0;
114
+ }
115
+ if (typeof value !== "string") {
116
+ throw new TypeError("RFC-3339 date-times must be expressed as strings");
117
+ }
118
+ const match = RFC3339.exec(value);
119
+ if (!match) {
120
+ throw new TypeError("Invalid RFC-3339 date-time value");
121
+ }
122
+ const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds] = match;
123
+ const year = strictParseShort(stripLeadingZeroes(yearStr));
124
+ const month = parseDateValue(monthStr, "month", 1, 12);
125
+ const day = parseDateValue(dayStr, "day", 1, 31);
126
+ return buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds });
127
+ };
128
+ var RFC3339_WITH_OFFSET = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/);
129
+ var IMF_FIXDATE = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/);
130
+ var RFC_850_DATE = new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/);
131
+ var ASC_TIME = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/);
132
+ var buildDate = (year, month, day, time) => {
133
+ const adjustedMonth = month - 1;
134
+ validateDayOfMonth(year, adjustedMonth, day);
135
+ return new Date(Date.UTC(year, adjustedMonth, day, parseDateValue(time.hours, "hour", 0, 23), parseDateValue(time.minutes, "minute", 0, 59), parseDateValue(time.seconds, "seconds", 0, 60), parseMilliseconds(time.fractionalMilliseconds)));
136
+ };
137
+ var FIFTY_YEARS_IN_MILLIS = 50 * 365 * 24 * 60 * 60 * 1e3;
138
+ var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
139
+ var validateDayOfMonth = (year, month, day) => {
140
+ let maxDays = DAYS_IN_MONTH[month];
141
+ if (month === 1 && isLeapYear(year)) {
142
+ maxDays = 29;
143
+ }
144
+ if (day > maxDays) {
145
+ throw new TypeError(`Invalid day for ${MONTHS[month]} in ${year}: ${day}`);
146
+ }
147
+ };
148
+ var isLeapYear = (year) => {
149
+ return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
150
+ };
151
+ var parseDateValue = (value, type, lower, upper) => {
152
+ const dateVal = strictParseByte(stripLeadingZeroes(value));
153
+ if (dateVal < lower || dateVal > upper) {
154
+ throw new TypeError(`${type} must be between ${lower} and ${upper}, inclusive`);
155
+ }
156
+ return dateVal;
157
+ };
158
+ var parseMilliseconds = (value) => {
159
+ if (value === null || value === void 0) {
160
+ return 0;
161
+ }
162
+ return strictParseFloat32("0." + value) * 1e3;
163
+ };
164
+ var stripLeadingZeroes = (value) => {
165
+ let idx = 0;
166
+ while (idx < value.length - 1 && value.charAt(idx) === "0") {
167
+ idx++;
168
+ }
169
+ if (idx === 0) {
170
+ return value;
171
+ }
172
+ return value.slice(idx);
173
+ };
174
+
175
+ export {
176
+ dateToUtcString,
177
+ parseRfc3339DateTime
178
+ };