itd-api 0.0.11 → 0.2.0

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 (60) hide show
  1. package/README.md +114 -485
  2. package/dist/index.cjs +8781 -415
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +4990 -1
  5. package/dist/index.d.ts +4990 -1
  6. package/dist/index.js +8688 -2
  7. package/dist/index.js.map +1 -1
  8. package/dist/multi-storage-BhcA2Izn.d.ts +198 -0
  9. package/dist/multi-storage-CyMe404l.js +805 -0
  10. package/dist/multi-storage-CyMe404l.js.map +1 -0
  11. package/dist/multi-storage-D1keK2Op.cjs +930 -0
  12. package/dist/multi-storage-D1keK2Op.cjs.map +1 -0
  13. package/dist/multi-storage-NDqzRQcD.d.cts +198 -0
  14. package/dist/node.cjs +225 -548
  15. package/dist/node.cjs.map +1 -1
  16. package/dist/node.d.cts +46 -59
  17. package/dist/node.d.ts +46 -59
  18. package/dist/node.js +223 -126
  19. package/dist/node.js.map +1 -1
  20. package/dist/runtime-CFEsf-jD.cjs +185 -0
  21. package/dist/runtime-CFEsf-jD.cjs.map +1 -0
  22. package/dist/runtime-DHxDn8gf.js +126 -0
  23. package/dist/runtime-DHxDn8gf.js.map +1 -0
  24. package/dist/storage-BjNRlkbE.d.cts +82 -0
  25. package/dist/storage-BjNRlkbE.d.ts +82 -0
  26. package/dist/storage-D9tfHx7Z.js +424 -0
  27. package/dist/storage-D9tfHx7Z.js.map +1 -0
  28. package/dist/storage-ycBqLBRB.cjs +615 -0
  29. package/dist/storage-ycBqLBRB.cjs.map +1 -0
  30. package/dist/web.cjs +87 -0
  31. package/dist/web.cjs.map +1 -0
  32. package/dist/web.d.cts +27 -0
  33. package/dist/web.d.ts +27 -0
  34. package/dist/web.js +86 -0
  35. package/dist/web.js.map +1 -0
  36. package/package.json +34 -14
  37. package/dist/chunk-QD4UHJFF.cjs +0 -7387
  38. package/dist/chunk-QD4UHJFF.cjs.map +0 -1
  39. package/dist/chunk-TB7HW3VX.js +0 -7277
  40. package/dist/chunk-TB7HW3VX.js.map +0 -1
  41. package/dist/index-CrlTO7sR.d.cts +0 -4858
  42. package/dist/index-CrlTO7sR.d.ts +0 -4858
  43. package/guides/README.md +0 -22
  44. package/guides/authentication/README.md +0 -176
  45. package/guides/authentication/examples/bot-with-session.mjs +0 -98
  46. package/guides/authentication/examples/turnstile-login.mjs +0 -56
  47. package/guides/integrations/README.md +0 -62
  48. package/guides/integrations/examples/proxy.mjs +0 -26
  49. package/guides/multi-accounts/README.md +0 -142
  50. package/guides/multi-accounts/examples/multi-accounts.mjs +0 -71
  51. package/guides/plugins/README.md +0 -162
  52. package/guides/plugins/examples/cache.mjs +0 -33
  53. package/guides/plugins/examples/crypto.mjs +0 -54
  54. package/guides/quickstart/README.md +0 -124
  55. package/guides/quickstart/examples/quick-start.mjs +0 -44
  56. package/guides/quickstart/examples/typescript.ts +0 -90
  57. package/guides/realtime/README.md +0 -109
  58. package/guides/realtime/examples/notifications.mjs +0 -62
  59. package/guides/text-markup/README.md +0 -214
  60. package/guides/text-markup/examples/create-post.mjs +0 -64
package/dist/node.cjs CHANGED
@@ -1,563 +1,240 @@
1
- 'use strict';
2
-
3
- var chunkQD4UHJFF_cjs = require('./chunk-QD4UHJFF.cjs');
4
-
5
- // src/node.ts
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_multi_storage = require("./multi-storage-D1keK2Op.cjs");
3
+ const require_storage = require("./storage-ycBqLBRB.cjs");
4
+ //#region src/node.ts
5
+ /**
6
+ * `itd-api/node` — файловая система для Node, Bun и Deno.
7
+ *
8
+ * Здесь лежит только то, что требует `node:fs` и потому не может попасть в основной бандл:
9
+ * иначе браузерные сборщики пытались бы разрешить этот модуль. Клиент, аккаунты, билдеры,
10
+ * типы и всё остальное берутся из `itd-api` — одинаково на всех платформах.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * import { ItdClient } from 'itd-api';
15
+ * import { FileTokenStorage, fromPath } from 'itd-api/node';
16
+ *
17
+ * // Когда сессия уже сохранена, `auth` не нужен — токен возьмётся из хранилища.
18
+ * const itd = new ItdClient({ storage: new FileTokenStorage('./.itd-session.json') });
19
+ *
20
+ * await itd.posts.create((p) => p.content('привет').attach(fromPath('./photo.jpg')));
21
+ * ```
22
+ *
23
+ * @packageDocumentation
24
+ */
25
+ /** Проверяет код системной ошибки без привязки к типам конкретного рантайма. */
6
26
  function hasErrorCode(error, code) {
7
- return typeof error === "object" && error !== null && "code" in error && error.code === code;
27
+ return typeof error === "object" && error !== null && "code" in error && error.code === code;
8
28
  }
9
- var nodeFileReader = async (path) => {
10
- const { readFile } = await import('fs/promises');
11
- const { basename } = await import('path');
12
- return { data: new Uint8Array(await readFile(path)), filename: basename(path) };
13
- };
29
+ function fromPath(path, options = {}) {
30
+ const resolved = require_multi_storage.resolveFileStreamOptions(options);
31
+ if (resolved.mode === require_multi_storage.FileTransferMode.Stream) return { open: async ({ signal }) => {
32
+ const [{ createReadStream }, { stat }, { basename }, { Readable }] = await Promise.all([
33
+ import("node:fs"),
34
+ import("node:fs/promises"),
35
+ import("node:path"),
36
+ import("node:stream")
37
+ ]);
38
+ const info = await stat(path);
39
+ if (resolved.maxBytes !== void 0 && info.size > resolved.maxBytes) throw new require_storage.ItdFileError(`файл ${path} больше предела в ${resolved.maxBytes} байт: ${info.size}`, {
40
+ reason: require_storage.ItdFileErrorReason.TooLarge,
41
+ limit: resolved.maxBytes,
42
+ actual: info.size
43
+ });
44
+ const file = createReadStream(path, {
45
+ highWaterMark: Math.min(resolved.streamBufferBytes, 1024 * 1024),
46
+ ...signal ? { signal } : {}
47
+ });
48
+ return {
49
+ stream: require_multi_storage.boundedFileStream(Readable.toWeb(file), {
50
+ ...resolved.maxBytes !== void 0 ? { maxBytes: resolved.maxBytes } : {},
51
+ streamBufferBytes: resolved.streamBufferBytes,
52
+ ...signal ? { signal } : {}
53
+ }),
54
+ filename: options.filename ?? basename(path),
55
+ ...options.contentType ? { contentType: options.contentType } : {},
56
+ size: info.size,
57
+ close: () => {
58
+ file.destroy();
59
+ }
60
+ };
61
+ } };
62
+ return { load: async ({ signal }) => {
63
+ const [{ readFile, stat }, { basename }] = await Promise.all([import("node:fs/promises"), import("node:path")]);
64
+ if (resolved.maxBytes !== void 0) {
65
+ const info = await stat(path);
66
+ if (info.size > resolved.maxBytes) throw new require_storage.ItdFileError(`файл ${path} больше предела в ${resolved.maxBytes} байт: ${info.size}`, {
67
+ reason: require_storage.ItdFileErrorReason.TooLarge,
68
+ limit: resolved.maxBytes,
69
+ actual: info.size
70
+ });
71
+ }
72
+ const file = new Uint8Array(await readFile(path, signal ? { signal } : void 0));
73
+ if (resolved.maxBytes !== void 0 && file.byteLength > resolved.maxBytes) throw new require_storage.ItdFileError(`файл ${path} больше предела в ${resolved.maxBytes} байт: ${file.byteLength}`, {
74
+ reason: require_storage.ItdFileErrorReason.TooLarge,
75
+ limit: resolved.maxBytes,
76
+ actual: file.byteLength
77
+ });
78
+ return {
79
+ file,
80
+ filename: options.filename ?? basename(path),
81
+ ...options.contentType ? { contentType: options.contentType } : {}
82
+ };
83
+ } };
84
+ }
85
+ /**
86
+ * Читает и разбирает JSON-файл.
87
+ *
88
+ * Отсутствующий файл означает `null`. Остальные ошибки файловой системы не скрываются.
89
+ * Одиночное хранилище ради обратной совместимости считает повреждённый JSON пустым,
90
+ * а мультихранилище требует строгого разбора: молча затереть файл с несколькими токенами
91
+ * особенно опасно.
92
+ */
14
93
  async function readJsonFile(path, strict = false) {
15
- let raw;
16
- try {
17
- const { readFile } = await import('fs/promises');
18
- raw = await readFile(path, "utf8");
19
- } catch (error) {
20
- if (hasErrorCode(error, "ENOENT")) return null;
21
- throw error;
22
- }
23
- try {
24
- return JSON.parse(raw);
25
- } catch {
26
- if (!strict) return null;
27
- throw new chunkQD4UHJFF_cjs.ItdConfigError(
28
- `\u0424\u0430\u0439\u043B ${path} \u043F\u043E\u0432\u0440\u0435\u0436\u0434\u0451\u043D: \u043E\u0436\u0438\u0434\u0430\u043B\u0441\u044F JSON \u0441 \u0441\u0435\u0441\u0441\u0438\u044F\u043C\u0438 \u0430\u043A\u043A\u0430\u0443\u043D\u0442\u043E\u0432. \u0418\u0441\u043F\u0440\u0430\u0432\u044C\u0442\u0435 \u0444\u0430\u0439\u043B \u0438\u043B\u0438 \u043F\u0435\u0440\u0435\u043D\u0435\u0441\u0438\u0442\u0435 \u0435\u0433\u043E \u043F\u0435\u0440\u0435\u0434 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u043C \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u0435\u043C.`
29
- );
30
- }
94
+ let raw;
95
+ try {
96
+ const { readFile } = await import("node:fs/promises");
97
+ raw = await readFile(path, "utf8");
98
+ } catch (error) {
99
+ if (hasErrorCode(error, "ENOENT")) return null;
100
+ throw error;
101
+ }
102
+ try {
103
+ return JSON.parse(raw);
104
+ } catch {
105
+ if (!strict) return null;
106
+ throw new require_storage.ItdConfigError(`Файл ${path} повреждён: ожидался JSON с сессиями аккаунтов. Исправьте файл или перенесите его перед следующим сохранением.`);
107
+ }
31
108
  }
109
+ /**
110
+ * Записывает JSON во временный файл и переименовывает его поверх целевого.
111
+ *
112
+ * Права `0600` (чтение и запись только владельцу) — в файле лежат токены. Переименование
113
+ * атомарно, поэтому падение процесса посреди сохранения не оставит повреждённого файла.
114
+ */
32
115
  async function writeJsonAtomic(path, value) {
33
- const { writeFile, rename, unlink } = await import('fs/promises');
34
- const pid = typeof process !== "undefined" ? process.pid : 0;
35
- const temporary = `${path}.${pid}.${Math.random().toString(36).slice(2)}.tmp`;
36
- try {
37
- await writeFile(temporary, JSON.stringify(value, null, 2), { encoding: "utf8", mode: 384 });
38
- await rename(temporary, path);
39
- } catch (error) {
40
- await unlink(temporary).catch(() => {
41
- });
42
- throw error;
43
- }
116
+ const { writeFile, rename, unlink } = await import("node:fs/promises");
117
+ const temporary = `${path}.${typeof process !== "undefined" ? process.pid : 0}.${Math.random().toString(36).slice(2)}.tmp`;
118
+ try {
119
+ await writeFile(temporary, JSON.stringify(value, null, 2), {
120
+ encoding: "utf8",
121
+ mode: 384
122
+ });
123
+ await rename(temporary, path);
124
+ } catch (error) {
125
+ await unlink(temporary).catch(() => {});
126
+ throw error;
127
+ }
44
128
  }
129
+ /** Удаляет файл. Благодаря `force` отсутствие файла ошибкой не считается. */
45
130
  async function removeFile(path) {
46
- const { rm } = await import('fs/promises');
47
- await rm(path, { force: true });
131
+ const { rm } = await import("node:fs/promises");
132
+ await rm(path, { force: true });
48
133
  }
134
+ /**
135
+ * Хранит сессию в файле.
136
+ *
137
+ * Нужна долгоживущим процессам: без неё бот при каждом запуске входит заново — а вход
138
+ * требует решённой капчи, да и серия входов подряд может привести к временной блокировке
139
+ * аккаунта. С сохранённой сессией опция `auth` не нужна вовсе.
140
+ *
141
+ * Файл создаётся с правами `0600` (чтение и запись только владельцу) — в нём лежат токены.
142
+ * Запись идёт через временный файл с последующим переименованием, поэтому падение процесса
143
+ * посреди сохранения не оставит повреждённую сессию.
144
+ *
145
+ * @example
146
+ * ```ts
147
+ * const itd = new ItdClient({ storage: new FileTokenStorage('./.itd-session.json') });
148
+ * ```
149
+ */
49
150
  var FileTokenStorage = class {
50
- #path;
51
- /**
52
- * Цепочка операций с файлом. Запись и удаление выполняются последовательно
53
- * в порядке вызова; ошибка одной операции не останавливает следующие.
54
- */
55
- #writing = Promise.resolve();
56
- /** @param path путь к файлу сессии. Добавьте его в `.gitignore`. */
57
- constructor(path) {
58
- this.#path = path;
59
- }
60
- async get() {
61
- await this.#writing.then(
62
- () => void 0,
63
- () => void 0
64
- );
65
- const parsed = await readJsonFile(this.#path);
66
- return typeof parsed === "object" && parsed !== null ? chunkQD4UHJFF_cjs.copySession(parsed) : null;
67
- }
68
- set(session) {
69
- const snapshot = chunkQD4UHJFF_cjs.copySession(session);
70
- return this.#enqueue(() => writeJsonAtomic(this.#path, snapshot));
71
- }
72
- clear() {
73
- return this.#enqueue(() => removeFile(this.#path));
74
- }
75
- /** Добавляет файловую операцию в очередь. */
76
- #enqueue(operation) {
77
- this.#writing = this.#writing.then(operation, operation);
78
- return this.#writing;
79
- }
151
+ #path;
152
+ /**
153
+ * Цепочка операций с файлом. Запись и удаление выполняются последовательно
154
+ * в порядке вызова; ошибка одной операции не останавливает следующие.
155
+ */
156
+ #writing = Promise.resolve();
157
+ /** @param path путь к файлу сессии. Добавьте его в `.gitignore`. */
158
+ constructor(path) {
159
+ this.#path = path;
160
+ }
161
+ async get() {
162
+ await this.#writing.then(() => void 0, () => void 0);
163
+ const parsed = await readJsonFile(this.#path);
164
+ return typeof parsed === "object" && parsed !== null ? require_storage.copySession(parsed) : null;
165
+ }
166
+ set(session) {
167
+ const snapshot = require_storage.copySession(session);
168
+ return this.#enqueue(() => writeJsonAtomic(this.#path, snapshot));
169
+ }
170
+ clear() {
171
+ return this.#enqueue(() => removeFile(this.#path));
172
+ }
173
+ /** Добавляет файловую операцию в очередь. */
174
+ #enqueue(operation) {
175
+ this.#writing = this.#writing.then(operation, operation);
176
+ return this.#writing;
177
+ }
80
178
  };
81
- var SESSIONS_FILE_VERSION = 1;
179
+ /** Версия формата файла с сессиями нескольких аккаунтов. */
180
+ const SESSIONS_FILE_VERSION = 1;
181
+ /**
182
+ * Хранит сессии нескольких аккаунтов в одном файле.
183
+ *
184
+ * Разбирается с гонкой «прочитать, изменить, записать»: десять аккаунтов пишут в один файл,
185
+ * и без общего слепка с очередью записей они теряли бы сессии друг друга. Как и
186
+ * {@link FileTokenStorage}, пишет через временный файл с правами `0600`.
187
+ *
188
+ * Формат — конверт `{ version, accounts }`, а не голая карта: так файл нескольких аккаунтов
189
+ * не спутать с однопользовательским, и чужой не будет молча перезаписан.
190
+ *
191
+ * @example
192
+ * ```ts
193
+ * const accounts = new ItdAccounts({
194
+ * storage: new FileMultiTokenStorage('./.itd-sessions.json'),
195
+ * });
196
+ * await accounts.restore();
197
+ * ```
198
+ */
82
199
  var FileMultiTokenStorage = class {
83
- #path;
84
- #inner;
85
- /** @param path путь к файлу сессий. Добавьте его в `.gitignore`. */
86
- constructor(path) {
87
- this.#path = path;
88
- this.#inner = chunkQD4UHJFF_cjs.createRecordMultiStorage({
89
- read: () => this.#read(),
90
- write: (accounts) => writeJsonAtomic(path, { version: SESSIONS_FILE_VERSION, accounts }),
91
- // Последний аккаунт ушёл — файл с пустой картой выглядел бы мусором.
92
- remove: () => removeFile(path)
93
- });
94
- }
95
- get(account) {
96
- return Promise.resolve(this.#inner.get(account));
97
- }
98
- set(account, session) {
99
- return Promise.resolve(this.#inner.set(account, session));
100
- }
101
- clear(account) {
102
- return Promise.resolve(this.#inner.clear(account));
103
- }
104
- accounts() {
105
- return Promise.resolve(this.#inner.accounts());
106
- }
107
- async #read() {
108
- const parsed = await readJsonFile(this.#path, true);
109
- if (parsed === null) return null;
110
- const envelope = typeof parsed === "object" && parsed !== null ? parsed : void 0;
111
- const accounts = envelope?.accounts;
112
- if (envelope?.version !== SESSIONS_FILE_VERSION || typeof accounts !== "object" || accounts === null || Array.isArray(accounts)) {
113
- throw new chunkQD4UHJFF_cjs.ItdConfigError(
114
- `\u0424\u0430\u0439\u043B ${this.#path} \u0438\u043C\u0435\u0435\u0442 \u043D\u0435\u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043C\u044B\u0439 \u0444\u043E\u0440\u043C\u0430\u0442: \u043E\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044F { version: ${SESSIONS_FILE_VERSION}, accounts }. \u0412\u043E\u0437\u043C\u043E\u0436\u043D\u043E, \u044D\u0442\u043E \u0444\u0430\u0439\u043B \u043E\u0434\u0438\u043D\u043E\u0447\u043D\u043E\u0439 \u0441\u0435\u0441\u0441\u0438\u0438 \u0438\u043B\u0438 \u0444\u0430\u0439\u043B \u0434\u0440\u0443\u0433\u043E\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u2014 \u0432\u043E\u0437\u044C\u043C\u0438\u0442\u0435 \u043E\u0442\u0434\u0435\u043B\u044C\u043D\u044B\u0439 \u043F\u0443\u0442\u044C, \u0447\u0442\u043E\u0431\u044B \u043D\u0435 \u043F\u0435\u0440\u0435\u0437\u0430\u043F\u0438\u0441\u0430\u0442\u044C \u0435\u0433\u043E.`
115
- );
116
- }
117
- return accounts;
118
- }
119
- };
120
- var ItdClient2 = class extends chunkQD4UHJFF_cjs.ItdClient {
121
- constructor(options = {}, internals = {}) {
122
- super(options, { ...internals, fileReader: nodeFileReader });
123
- }
200
+ #path;
201
+ #inner;
202
+ /** @param path путь к файлу сессий. Добавьте его в `.gitignore`. */
203
+ constructor(path) {
204
+ this.#path = path;
205
+ this.#inner = require_multi_storage.createRecordMultiStorage({
206
+ read: () => this.#read(),
207
+ write: (accounts) => writeJsonAtomic(path, {
208
+ version: SESSIONS_FILE_VERSION,
209
+ accounts
210
+ }),
211
+ remove: () => removeFile(path)
212
+ });
213
+ }
214
+ get(account) {
215
+ return Promise.resolve(this.#inner.get(account));
216
+ }
217
+ set(account, session) {
218
+ return Promise.resolve(this.#inner.set(account, session));
219
+ }
220
+ clear(account) {
221
+ return Promise.resolve(this.#inner.clear(account));
222
+ }
223
+ accounts() {
224
+ return Promise.resolve(this.#inner.accounts());
225
+ }
226
+ async #read() {
227
+ const parsed = await readJsonFile(this.#path, true);
228
+ if (parsed === null) return null;
229
+ const envelope = typeof parsed === "object" && parsed !== null ? parsed : void 0;
230
+ const accounts = envelope?.accounts;
231
+ if (envelope?.version !== SESSIONS_FILE_VERSION || typeof accounts !== "object" || accounts === null || Array.isArray(accounts)) throw new require_storage.ItdConfigError(`Файл ${this.#path} имеет неподдерживаемый формат: ожидается { version: ${SESSIONS_FILE_VERSION}, accounts }. Возможно, это файл одиночной сессии или файл другой версии возьмите отдельный путь, чтобы не перезаписать его.`);
232
+ return accounts;
233
+ }
124
234
  };
125
- function createClient(options = {}) {
126
- return new ItdClient2(options);
127
- }
128
- var ItdAccounts2 = class extends chunkQD4UHJFF_cjs.ItdAccounts {
129
- constructor(options = {}) {
130
- super(options, {
131
- createClient: (clientOptions, internals) => new ItdClient2(clientOptions, internals)
132
- });
133
- }
134
- };
135
- function createAccounts(options = {}) {
136
- return new ItdAccounts2(options);
137
- }
138
-
139
- Object.defineProperty(exports, "ALLOWED_MIME_TYPES", {
140
- enumerable: true,
141
- get: function () { return chunkQD4UHJFF_cjs.ALLOWED_MIME_TYPES; }
142
- });
143
- Object.defineProperty(exports, "AUDIO_MIME_TYPES", {
144
- enumerable: true,
145
- get: function () { return chunkQD4UHJFF_cjs.AUDIO_MIME_TYPES; }
146
- });
147
- Object.defineProperty(exports, "AUTH_FLAG_COOKIE", {
148
- enumerable: true,
149
- get: function () { return chunkQD4UHJFF_cjs.AUTH_FLAG_COOKIE; }
150
- });
151
- Object.defineProperty(exports, "AUTH_PATHS", {
152
- enumerable: true,
153
- get: function () { return chunkQD4UHJFF_cjs.AUTH_PATHS; }
154
- });
155
- Object.defineProperty(exports, "AccessType", {
156
- enumerable: true,
157
- get: function () { return chunkQD4UHJFF_cjs.AccessType; }
158
- });
159
- Object.defineProperty(exports, "AttachmentType", {
160
- enumerable: true,
161
- get: function () { return chunkQD4UHJFF_cjs.AttachmentType; }
162
- });
163
- Object.defineProperty(exports, "BUILT_IN_SERVICES", {
164
- enumerable: true,
165
- get: function () { return chunkQD4UHJFF_cjs.BUILT_IN_SERVICES; }
166
- });
167
- Object.defineProperty(exports, "CommentSort", {
168
- enumerable: true,
169
- get: function () { return chunkQD4UHJFF_cjs.CommentSort; }
170
- });
171
- Object.defineProperty(exports, "DEFAULT_BASE_URL", {
172
- enumerable: true,
173
- get: function () { return chunkQD4UHJFF_cjs.DEFAULT_BASE_URL; }
174
- });
175
- Object.defineProperty(exports, "DEFAULT_STATUS_BASE_URL", {
176
- enumerable: true,
177
- get: function () { return chunkQD4UHJFF_cjs.DEFAULT_STATUS_BASE_URL; }
178
- });
179
- Object.defineProperty(exports, "DEFAULT_TIMEOUT", {
180
- enumerable: true,
181
- get: function () { return chunkQD4UHJFF_cjs.DEFAULT_TIMEOUT; }
182
- });
183
- Object.defineProperty(exports, "DEFAULT_UPLOAD_TIMEOUT", {
184
- enumerable: true,
185
- get: function () { return chunkQD4UHJFF_cjs.DEFAULT_UPLOAD_TIMEOUT; }
186
- });
187
- Object.defineProperty(exports, "DEFAULT_USER_AGENT", {
188
- enumerable: true,
189
- get: function () { return chunkQD4UHJFF_cjs.DEFAULT_USER_AGENT; }
190
- });
191
- Object.defineProperty(exports, "DEVICE_ID_HEADER", {
192
- enumerable: true,
193
- get: function () { return chunkQD4UHJFF_cjs.DEVICE_ID_HEADER; }
194
- });
195
- Object.defineProperty(exports, "DetectedRuntime", {
196
- enumerable: true,
197
- get: function () { return chunkQD4UHJFF_cjs.DetectedRuntime; }
198
- });
199
- Object.defineProperty(exports, "FeedTab", {
200
- enumerable: true,
201
- get: function () { return chunkQD4UHJFF_cjs.FeedTab; }
202
- });
203
- Object.defineProperty(exports, "IMAGE_MIME_TYPES", {
204
- enumerable: true,
205
- get: function () { return chunkQD4UHJFF_cjs.IMAGE_MIME_TYPES; }
206
- });
207
- Object.defineProperty(exports, "IncidentKind", {
208
- enumerable: true,
209
- get: function () { return chunkQD4UHJFF_cjs.IncidentKind; }
210
- });
211
- Object.defineProperty(exports, "InteractionType", {
212
- enumerable: true,
213
- get: function () { return chunkQD4UHJFF_cjs.InteractionType; }
214
- });
215
- Object.defineProperty(exports, "ItdAbortError", {
216
- enumerable: true,
217
- get: function () { return chunkQD4UHJFF_cjs.ItdAbortError; }
218
- });
219
- Object.defineProperty(exports, "ItdApiError", {
220
- enumerable: true,
221
- get: function () { return chunkQD4UHJFF_cjs.ItdApiError; }
222
- });
223
- Object.defineProperty(exports, "ItdApiErrorKind", {
224
- enumerable: true,
225
- get: function () { return chunkQD4UHJFF_cjs.ItdApiErrorKind; }
226
- });
227
- Object.defineProperty(exports, "ItdAuthError", {
228
- enumerable: true,
229
- get: function () { return chunkQD4UHJFF_cjs.ItdAuthError; }
230
- });
231
- Object.defineProperty(exports, "ItdConfigError", {
232
- enumerable: true,
233
- get: function () { return chunkQD4UHJFF_cjs.ItdConfigError; }
234
- });
235
- Object.defineProperty(exports, "ItdConflictError", {
236
- enumerable: true,
237
- get: function () { return chunkQD4UHJFF_cjs.ItdConflictError; }
238
- });
239
- Object.defineProperty(exports, "ItdError", {
240
- enumerable: true,
241
- get: function () { return chunkQD4UHJFF_cjs.ItdError; }
242
- });
243
- Object.defineProperty(exports, "ItdErrorCode", {
244
- enumerable: true,
245
- get: function () { return chunkQD4UHJFF_cjs.ItdErrorCode; }
246
- });
247
- Object.defineProperty(exports, "ItdErrorKind", {
248
- enumerable: true,
249
- get: function () { return chunkQD4UHJFF_cjs.ItdErrorKind; }
250
- });
251
- Object.defineProperty(exports, "ItdForbiddenError", {
252
- enumerable: true,
253
- get: function () { return chunkQD4UHJFF_cjs.ItdForbiddenError; }
254
- });
255
- Object.defineProperty(exports, "ItdNetworkError", {
256
- enumerable: true,
257
- get: function () { return chunkQD4UHJFF_cjs.ItdNetworkError; }
258
- });
259
- Object.defineProperty(exports, "ItdNotFoundError", {
260
- enumerable: true,
261
- get: function () { return chunkQD4UHJFF_cjs.ItdNotFoundError; }
262
- });
263
- Object.defineProperty(exports, "ItdPhoneVerificationError", {
264
- enumerable: true,
265
- get: function () { return chunkQD4UHJFF_cjs.ItdPhoneVerificationError; }
266
- });
267
- Object.defineProperty(exports, "ItdRateLimitError", {
268
- enumerable: true,
269
- get: function () { return chunkQD4UHJFF_cjs.ItdRateLimitError; }
270
- });
271
- Object.defineProperty(exports, "ItdRealtime", {
272
- enumerable: true,
273
- get: function () { return chunkQD4UHJFF_cjs.ItdRealtime; }
274
- });
275
- Object.defineProperty(exports, "ItdServerError", {
276
- enumerable: true,
277
- get: function () { return chunkQD4UHJFF_cjs.ItdServerError; }
278
- });
279
- Object.defineProperty(exports, "ItdTimeoutError", {
280
- enumerable: true,
281
- get: function () { return chunkQD4UHJFF_cjs.ItdTimeoutError; }
282
- });
283
- Object.defineProperty(exports, "ItdValidationError", {
284
- enumerable: true,
285
- get: function () { return chunkQD4UHJFF_cjs.ItdValidationError; }
286
- });
287
- Object.defineProperty(exports, "LIBRARY_VERSION", {
288
- enumerable: true,
289
- get: function () { return chunkQD4UHJFF_cjs.LIBRARY_VERSION; }
290
- });
291
- Object.defineProperty(exports, "LikesVisibility", {
292
- enumerable: true,
293
- get: function () { return chunkQD4UHJFF_cjs.LikesVisibility; }
294
- });
295
- Object.defineProperty(exports, "LocalStorageTokenStorage", {
296
- enumerable: true,
297
- get: function () { return chunkQD4UHJFF_cjs.LocalStorageTokenStorage; }
298
- });
299
- Object.defineProperty(exports, "MAX_RECONNECT_ATTEMPTS", {
300
- enumerable: true,
301
- get: function () { return chunkQD4UHJFF_cjs.MAX_RECONNECT_ATTEMPTS; }
302
- });
303
- Object.defineProperty(exports, "MemoryMultiTokenStorage", {
304
- enumerable: true,
305
- get: function () { return chunkQD4UHJFF_cjs.MemoryMultiTokenStorage; }
306
- });
307
- Object.defineProperty(exports, "MemoryTokenStorage", {
308
- enumerable: true,
309
- get: function () { return chunkQD4UHJFF_cjs.MemoryTokenStorage; }
310
- });
311
- Object.defineProperty(exports, "NOTIFICATION_TYPE_ALIASES", {
312
- enumerable: true,
313
- get: function () { return chunkQD4UHJFF_cjs.NOTIFICATION_TYPE_ALIASES; }
314
- });
315
- Object.defineProperty(exports, "NotificationType", {
316
- enumerable: true,
317
- get: function () { return chunkQD4UHJFF_cjs.NotificationType; }
318
- });
319
- Object.defineProperty(exports, "OAuthProvider", {
320
- enumerable: true,
321
- get: function () { return chunkQD4UHJFF_cjs.OAuthProvider; }
322
- });
323
- Object.defineProperty(exports, "PaginationMode", {
324
- enumerable: true,
325
- get: function () { return chunkQD4UHJFF_cjs.PaginationMode; }
326
- });
327
- Object.defineProperty(exports, "Paginator", {
328
- enumerable: true,
329
- get: function () { return chunkQD4UHJFF_cjs.Paginator; }
330
- });
331
- Object.defineProperty(exports, "RECONNECT_BACKOFF", {
332
- enumerable: true,
333
- get: function () { return chunkQD4UHJFF_cjs.RECONNECT_BACKOFF; }
334
- });
335
- Object.defineProperty(exports, "RECONNECT_JITTER", {
336
- enumerable: true,
337
- get: function () { return chunkQD4UHJFF_cjs.RECONNECT_JITTER; }
338
- });
339
- Object.defineProperty(exports, "REFRESH_COOKIE", {
340
- enumerable: true,
341
- get: function () { return chunkQD4UHJFF_cjs.REFRESH_COOKIE; }
342
- });
343
- Object.defineProperty(exports, "REFRESH_COOKIE_PATH", {
344
- enumerable: true,
345
- get: function () { return chunkQD4UHJFF_cjs.REFRESH_COOKIE_PATH; }
346
- });
347
- Object.defineProperty(exports, "REQUEST_OPTION_KEYS", {
348
- enumerable: true,
349
- get: function () { return chunkQD4UHJFF_cjs.REQUEST_OPTION_KEYS; }
350
- });
351
- Object.defineProperty(exports, "RealtimeStatus", {
352
- enumerable: true,
353
- get: function () { return chunkQD4UHJFF_cjs.RealtimeStatus; }
354
- });
355
- Object.defineProperty(exports, "RealtimeTransportKind", {
356
- enumerable: true,
357
- get: function () { return chunkQD4UHJFF_cjs.RealtimeTransportKind; }
358
- });
359
- Object.defineProperty(exports, "ReportReason", {
360
- enumerable: true,
361
- get: function () { return chunkQD4UHJFF_cjs.ReportReason; }
362
- });
363
- Object.defineProperty(exports, "ReportTargetType", {
364
- enumerable: true,
365
- get: function () { return chunkQD4UHJFF_cjs.ReportTargetType; }
366
- });
367
- Object.defineProperty(exports, "RuntimeMode", {
368
- enumerable: true,
369
- get: function () { return chunkQD4UHJFF_cjs.RuntimeMode; }
370
- });
371
- Object.defineProperty(exports, "STATUS_SERVICE", {
372
- enumerable: true,
373
- get: function () { return chunkQD4UHJFF_cjs.STATUS_SERVICE; }
374
- });
375
- Object.defineProperty(exports, "STREAM_PATH", {
376
- enumerable: true,
377
- get: function () { return chunkQD4UHJFF_cjs.STREAM_PATH; }
378
- });
379
- Object.defineProperty(exports, "ServiceRegistry", {
380
- enumerable: true,
381
- get: function () { return chunkQD4UHJFF_cjs.ServiceRegistry; }
382
- });
383
- Object.defineProperty(exports, "ServiceState", {
384
- enumerable: true,
385
- get: function () { return chunkQD4UHJFF_cjs.ServiceState; }
386
- });
387
- Object.defineProperty(exports, "SignInStatus", {
388
- enumerable: true,
389
- get: function () { return chunkQD4UHJFF_cjs.SignInStatus; }
390
- });
391
- Object.defineProperty(exports, "SpanType", {
392
- enumerable: true,
393
- get: function () { return chunkQD4UHJFF_cjs.SpanType; }
394
- });
395
- Object.defineProperty(exports, "TURNSTILE_SITE_KEY", {
396
- enumerable: true,
397
- get: function () { return chunkQD4UHJFF_cjs.TURNSTILE_SITE_KEY; }
398
- });
399
- Object.defineProperty(exports, "UnauthorizedStreamError", {
400
- enumerable: true,
401
- get: function () { return chunkQD4UHJFF_cjs.UnauthorizedStreamError; }
402
- });
403
- Object.defineProperty(exports, "VIDEO_MIME_TYPES", {
404
- enumerable: true,
405
- get: function () { return chunkQD4UHJFF_cjs.VIDEO_MIME_TYPES; }
406
- });
407
- Object.defineProperty(exports, "ViewReason", {
408
- enumerable: true,
409
- get: function () { return chunkQD4UHJFF_cjs.ViewReason; }
410
- });
411
- Object.defineProperty(exports, "ViewSource", {
412
- enumerable: true,
413
- get: function () { return chunkQD4UHJFF_cjs.ViewSource; }
414
- });
415
- Object.defineProperty(exports, "WallAccess", {
416
- enumerable: true,
417
- get: function () { return chunkQD4UHJFF_cjs.WallAccess; }
418
- });
419
- Object.defineProperty(exports, "autoSpans", {
420
- enumerable: true,
421
- get: function () { return chunkQD4UHJFF_cjs.autoSpans; }
422
- });
423
- Object.defineProperty(exports, "canonicalNotificationType", {
424
- enumerable: true,
425
- get: function () { return chunkQD4UHJFF_cjs.canonicalNotificationType; }
426
- });
427
- Object.defineProperty(exports, "comment", {
428
- enumerable: true,
429
- get: function () { return chunkQD4UHJFF_cjs.comment; }
430
- });
431
- Object.defineProperty(exports, "createMultiTokenStorage", {
432
- enumerable: true,
433
- get: function () { return chunkQD4UHJFF_cjs.createMultiTokenStorage; }
434
- });
435
- Object.defineProperty(exports, "createRecordMultiStorage", {
436
- enumerable: true,
437
- get: function () { return chunkQD4UHJFF_cjs.createRecordMultiStorage; }
438
- });
439
- Object.defineProperty(exports, "createTokenStorage", {
440
- enumerable: true,
441
- get: function () { return chunkQD4UHJFF_cjs.createTokenStorage; }
442
- });
443
- Object.defineProperty(exports, "formatNotificationText", {
444
- enumerable: true,
445
- get: function () { return chunkQD4UHJFF_cjs.formatNotificationText; }
446
- });
447
- Object.defineProperty(exports, "isBuilder", {
448
- enumerable: true,
449
- get: function () { return chunkQD4UHJFF_cjs.isBuilder; }
450
- });
451
- Object.defineProperty(exports, "isItdApiError", {
452
- enumerable: true,
453
- get: function () { return chunkQD4UHJFF_cjs.isItdApiError; }
454
- });
455
- Object.defineProperty(exports, "isItdAuthError", {
456
- enumerable: true,
457
- get: function () { return chunkQD4UHJFF_cjs.isItdAuthError; }
458
- });
459
- Object.defineProperty(exports, "isItdConflictError", {
460
- enumerable: true,
461
- get: function () { return chunkQD4UHJFF_cjs.isItdConflictError; }
462
- });
463
- Object.defineProperty(exports, "isItdError", {
464
- enumerable: true,
465
- get: function () { return chunkQD4UHJFF_cjs.isItdError; }
466
- });
467
- Object.defineProperty(exports, "isItdForbiddenError", {
468
- enumerable: true,
469
- get: function () { return chunkQD4UHJFF_cjs.isItdForbiddenError; }
470
- });
471
- Object.defineProperty(exports, "isItdNotFoundError", {
472
- enumerable: true,
473
- get: function () { return chunkQD4UHJFF_cjs.isItdNotFoundError; }
474
- });
475
- Object.defineProperty(exports, "isItdPhoneVerificationError", {
476
- enumerable: true,
477
- get: function () { return chunkQD4UHJFF_cjs.isItdPhoneVerificationError; }
478
- });
479
- Object.defineProperty(exports, "isItdRateLimitError", {
480
- enumerable: true,
481
- get: function () { return chunkQD4UHJFF_cjs.isItdRateLimitError; }
482
- });
483
- Object.defineProperty(exports, "isItdServerError", {
484
- enumerable: true,
485
- get: function () { return chunkQD4UHJFF_cjs.isItdServerError; }
486
- });
487
- Object.defineProperty(exports, "isItdValidationError", {
488
- enumerable: true,
489
- get: function () { return chunkQD4UHJFF_cjs.isItdValidationError; }
490
- });
491
- Object.defineProperty(exports, "isKnownNotificationType", {
492
- enumerable: true,
493
- get: function () { return chunkQD4UHJFF_cjs.isKnownNotificationType; }
494
- });
495
- Object.defineProperty(exports, "isMyProfile", {
496
- enumerable: true,
497
- get: function () { return chunkQD4UHJFF_cjs.isMyProfile; }
498
- });
499
- Object.defineProperty(exports, "mapPage", {
500
- enumerable: true,
501
- get: function () { return chunkQD4UHJFF_cjs.mapPage; }
502
- });
503
- Object.defineProperty(exports, "markup", {
504
- enumerable: true,
505
- get: function () { return chunkQD4UHJFF_cjs.markup; }
506
- });
507
- Object.defineProperty(exports, "normalizeNotification", {
508
- enumerable: true,
509
- get: function () { return chunkQD4UHJFF_cjs.normalizeNotification; }
510
- });
511
- Object.defineProperty(exports, "poll", {
512
- enumerable: true,
513
- get: function () { return chunkQD4UHJFF_cjs.poll; }
514
- });
515
- Object.defineProperty(exports, "post", {
516
- enumerable: true,
517
- get: function () { return chunkQD4UHJFF_cjs.post; }
518
- });
519
- Object.defineProperty(exports, "readNotificationEvent", {
520
- enumerable: true,
521
- get: function () { return chunkQD4UHJFF_cjs.readNotificationEvent; }
522
- });
523
- Object.defineProperty(exports, "readUnreadCountEvent", {
524
- enumerable: true,
525
- get: function () { return chunkQD4UHJFF_cjs.readUnreadCountEvent; }
526
- });
527
- Object.defineProperty(exports, "renderSpans", {
528
- enumerable: true,
529
- get: function () { return chunkQD4UHJFF_cjs.renderSpans; }
530
- });
531
- Object.defineProperty(exports, "report", {
532
- enumerable: true,
533
- get: function () { return chunkQD4UHJFF_cjs.report; }
534
- });
535
- Object.defineProperty(exports, "resolveNotificationUrl", {
536
- enumerable: true,
537
- get: function () { return chunkQD4UHJFF_cjs.resolveNotificationUrl; }
538
- });
539
- Object.defineProperty(exports, "scopedTokenStorage", {
540
- enumerable: true,
541
- get: function () { return chunkQD4UHJFF_cjs.scopedTokenStorage; }
542
- });
543
- Object.defineProperty(exports, "statusDays", {
544
- enumerable: true,
545
- get: function () { return chunkQD4UHJFF_cjs.statusDays; }
546
- });
547
- Object.defineProperty(exports, "toDate", {
548
- enumerable: true,
549
- get: function () { return chunkQD4UHJFF_cjs.toDate; }
550
- });
551
- Object.defineProperty(exports, "utcStampToIso", {
552
- enumerable: true,
553
- get: function () { return chunkQD4UHJFF_cjs.utcStampToIso; }
554
- });
235
+ //#endregion
555
236
  exports.FileMultiTokenStorage = FileMultiTokenStorage;
556
237
  exports.FileTokenStorage = FileTokenStorage;
557
- exports.ItdAccounts = ItdAccounts2;
558
- exports.ItdClient = ItdClient2;
559
- exports.createAccounts = createAccounts;
560
- exports.createClient = createClient;
561
- exports.nodeFileReader = nodeFileReader;
562
- //# sourceMappingURL=node.cjs.map
238
+ exports.fromPath = fromPath;
239
+
563
240
  //# sourceMappingURL=node.cjs.map