itd-api 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -0
- package/dist/{chunk-3RNNZJZ4.cjs → chunk-ATCZ4T2K.cjs} +1055 -971
- package/dist/chunk-ATCZ4T2K.cjs.map +1 -0
- package/dist/{chunk-CG4SERVM.js → chunk-JIYN33FG.js} +1055 -971
- package/dist/chunk-JIYN33FG.js.map +1 -0
- package/dist/{index-DNFPX_Z1.d.cts → index-Duh31Wnx.d.cts} +362 -329
- package/dist/{index-DNFPX_Z1.d.ts → index-Duh31Wnx.d.ts} +362 -329
- package/dist/index.cjs +89 -89
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/node.cjs +116 -95
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.cts +2 -2
- package/dist/node.d.ts +2 -2
- package/dist/node.js +30 -9
- package/dist/node.js.map +1 -1
- package/package.json +8 -4
- package/dist/chunk-3RNNZJZ4.cjs.map +0 -1
- package/dist/chunk-CG4SERVM.js.map +0 -1
package/dist/node.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkATCZ4T2K_cjs = require('./chunk-ATCZ4T2K.cjs');
|
|
4
4
|
|
|
5
5
|
// src/node.ts
|
|
6
6
|
var nodeFileReader = async (path) => {
|
|
@@ -10,6 +10,11 @@ var nodeFileReader = async (path) => {
|
|
|
10
10
|
};
|
|
11
11
|
var FileTokenStorage = class {
|
|
12
12
|
#path;
|
|
13
|
+
/**
|
|
14
|
+
* Цепочка записей: сохранения идут строго по одному, конкурентные `set` не
|
|
15
|
+
* перемешиваются. Ошибка одной записи цепочку не рвёт.
|
|
16
|
+
*/
|
|
17
|
+
#writing = Promise.resolve();
|
|
13
18
|
/** @param path путь к файлу сессии. Добавьте его в `.gitignore`. */
|
|
14
19
|
constructor(path) {
|
|
15
20
|
this.#path = path;
|
|
@@ -24,11 +29,28 @@ var FileTokenStorage = class {
|
|
|
24
29
|
return null;
|
|
25
30
|
}
|
|
26
31
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
set(session) {
|
|
33
|
+
this.#writing = this.#writing.then(
|
|
34
|
+
() => this.#write(session),
|
|
35
|
+
() => this.#write(session)
|
|
36
|
+
);
|
|
37
|
+
return this.#writing;
|
|
38
|
+
}
|
|
39
|
+
async #write(session) {
|
|
40
|
+
const { writeFile, rename, unlink } = await import('fs/promises');
|
|
41
|
+
const pid = typeof process !== "undefined" ? process.pid : 0;
|
|
42
|
+
const temporary = `${this.#path}.${pid}.${Math.random().toString(36).slice(2)}.tmp`;
|
|
43
|
+
try {
|
|
44
|
+
await writeFile(temporary, JSON.stringify(session, null, 2), {
|
|
45
|
+
encoding: "utf8",
|
|
46
|
+
mode: 384
|
|
47
|
+
});
|
|
48
|
+
await rename(temporary, this.#path);
|
|
49
|
+
} catch (error) {
|
|
50
|
+
await unlink(temporary).catch(() => {
|
|
51
|
+
});
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
32
54
|
}
|
|
33
55
|
async clear() {
|
|
34
56
|
try {
|
|
@@ -38,10 +60,9 @@ var FileTokenStorage = class {
|
|
|
38
60
|
}
|
|
39
61
|
}
|
|
40
62
|
};
|
|
41
|
-
var ItdClient2 = class extends
|
|
63
|
+
var ItdClient2 = class extends chunkATCZ4T2K_cjs.ItdClient {
|
|
42
64
|
constructor(options = {}) {
|
|
43
|
-
super(options);
|
|
44
|
-
this.setFileReader(nodeFileReader);
|
|
65
|
+
super(options, { fileReader: nodeFileReader });
|
|
45
66
|
}
|
|
46
67
|
};
|
|
47
68
|
function createClient(options = {}) {
|
|
@@ -50,347 +71,347 @@ function createClient(options = {}) {
|
|
|
50
71
|
|
|
51
72
|
Object.defineProperty(exports, "ALLOWED_MIME_TYPES", {
|
|
52
73
|
enumerable: true,
|
|
53
|
-
get: function () { return
|
|
74
|
+
get: function () { return chunkATCZ4T2K_cjs.ALLOWED_MIME_TYPES; }
|
|
54
75
|
});
|
|
55
76
|
Object.defineProperty(exports, "AUDIO_MIME_TYPES", {
|
|
56
77
|
enumerable: true,
|
|
57
|
-
get: function () { return
|
|
78
|
+
get: function () { return chunkATCZ4T2K_cjs.AUDIO_MIME_TYPES; }
|
|
58
79
|
});
|
|
59
80
|
Object.defineProperty(exports, "AUTH_FLAG_COOKIE", {
|
|
60
81
|
enumerable: true,
|
|
61
|
-
get: function () { return
|
|
82
|
+
get: function () { return chunkATCZ4T2K_cjs.AUTH_FLAG_COOKIE; }
|
|
62
83
|
});
|
|
63
84
|
Object.defineProperty(exports, "AUTH_PATHS", {
|
|
64
85
|
enumerable: true,
|
|
65
|
-
get: function () { return
|
|
86
|
+
get: function () { return chunkATCZ4T2K_cjs.AUTH_PATHS; }
|
|
66
87
|
});
|
|
67
88
|
Object.defineProperty(exports, "AccessType", {
|
|
68
89
|
enumerable: true,
|
|
69
|
-
get: function () { return
|
|
90
|
+
get: function () { return chunkATCZ4T2K_cjs.AccessType; }
|
|
70
91
|
});
|
|
71
92
|
Object.defineProperty(exports, "AttachmentType", {
|
|
72
93
|
enumerable: true,
|
|
73
|
-
get: function () { return
|
|
94
|
+
get: function () { return chunkATCZ4T2K_cjs.AttachmentType; }
|
|
74
95
|
});
|
|
75
96
|
Object.defineProperty(exports, "CommentSort", {
|
|
76
97
|
enumerable: true,
|
|
77
|
-
get: function () { return
|
|
98
|
+
get: function () { return chunkATCZ4T2K_cjs.CommentSort; }
|
|
78
99
|
});
|
|
79
100
|
Object.defineProperty(exports, "DEFAULT_BASE_URL", {
|
|
80
101
|
enumerable: true,
|
|
81
|
-
get: function () { return
|
|
102
|
+
get: function () { return chunkATCZ4T2K_cjs.DEFAULT_BASE_URL; }
|
|
82
103
|
});
|
|
83
104
|
Object.defineProperty(exports, "DEFAULT_TIMEOUT", {
|
|
84
105
|
enumerable: true,
|
|
85
|
-
get: function () { return
|
|
106
|
+
get: function () { return chunkATCZ4T2K_cjs.DEFAULT_TIMEOUT; }
|
|
86
107
|
});
|
|
87
108
|
Object.defineProperty(exports, "DEFAULT_USER_AGENT", {
|
|
88
109
|
enumerable: true,
|
|
89
|
-
get: function () { return
|
|
110
|
+
get: function () { return chunkATCZ4T2K_cjs.DEFAULT_USER_AGENT; }
|
|
90
111
|
});
|
|
91
112
|
Object.defineProperty(exports, "DEVICE_ID_HEADER", {
|
|
92
113
|
enumerable: true,
|
|
93
|
-
get: function () { return
|
|
114
|
+
get: function () { return chunkATCZ4T2K_cjs.DEVICE_ID_HEADER; }
|
|
94
115
|
});
|
|
95
116
|
Object.defineProperty(exports, "DetectedRuntime", {
|
|
96
117
|
enumerable: true,
|
|
97
|
-
get: function () { return
|
|
118
|
+
get: function () { return chunkATCZ4T2K_cjs.DetectedRuntime; }
|
|
98
119
|
});
|
|
99
120
|
Object.defineProperty(exports, "FeedTab", {
|
|
100
121
|
enumerable: true,
|
|
101
|
-
get: function () { return
|
|
122
|
+
get: function () { return chunkATCZ4T2K_cjs.FeedTab; }
|
|
102
123
|
});
|
|
103
124
|
Object.defineProperty(exports, "IMAGE_MIME_TYPES", {
|
|
104
125
|
enumerable: true,
|
|
105
|
-
get: function () { return
|
|
126
|
+
get: function () { return chunkATCZ4T2K_cjs.IMAGE_MIME_TYPES; }
|
|
106
127
|
});
|
|
107
128
|
Object.defineProperty(exports, "InteractionType", {
|
|
108
129
|
enumerable: true,
|
|
109
|
-
get: function () { return
|
|
130
|
+
get: function () { return chunkATCZ4T2K_cjs.InteractionType; }
|
|
110
131
|
});
|
|
111
132
|
Object.defineProperty(exports, "ItdAbortError", {
|
|
112
133
|
enumerable: true,
|
|
113
|
-
get: function () { return
|
|
134
|
+
get: function () { return chunkATCZ4T2K_cjs.ItdAbortError; }
|
|
114
135
|
});
|
|
115
136
|
Object.defineProperty(exports, "ItdApiError", {
|
|
116
137
|
enumerable: true,
|
|
117
|
-
get: function () { return
|
|
138
|
+
get: function () { return chunkATCZ4T2K_cjs.ItdApiError; }
|
|
118
139
|
});
|
|
119
140
|
Object.defineProperty(exports, "ItdApiErrorKind", {
|
|
120
141
|
enumerable: true,
|
|
121
|
-
get: function () { return
|
|
142
|
+
get: function () { return chunkATCZ4T2K_cjs.ItdApiErrorKind; }
|
|
122
143
|
});
|
|
123
144
|
Object.defineProperty(exports, "ItdAuthError", {
|
|
124
145
|
enumerable: true,
|
|
125
|
-
get: function () { return
|
|
146
|
+
get: function () { return chunkATCZ4T2K_cjs.ItdAuthError; }
|
|
126
147
|
});
|
|
127
148
|
Object.defineProperty(exports, "ItdConfigError", {
|
|
128
149
|
enumerable: true,
|
|
129
|
-
get: function () { return
|
|
150
|
+
get: function () { return chunkATCZ4T2K_cjs.ItdConfigError; }
|
|
130
151
|
});
|
|
131
152
|
Object.defineProperty(exports, "ItdConflictError", {
|
|
132
153
|
enumerable: true,
|
|
133
|
-
get: function () { return
|
|
154
|
+
get: function () { return chunkATCZ4T2K_cjs.ItdConflictError; }
|
|
134
155
|
});
|
|
135
156
|
Object.defineProperty(exports, "ItdError", {
|
|
136
157
|
enumerable: true,
|
|
137
|
-
get: function () { return
|
|
158
|
+
get: function () { return chunkATCZ4T2K_cjs.ItdError; }
|
|
138
159
|
});
|
|
139
160
|
Object.defineProperty(exports, "ItdErrorCode", {
|
|
140
161
|
enumerable: true,
|
|
141
|
-
get: function () { return
|
|
162
|
+
get: function () { return chunkATCZ4T2K_cjs.ItdErrorCode; }
|
|
142
163
|
});
|
|
143
164
|
Object.defineProperty(exports, "ItdErrorKind", {
|
|
144
165
|
enumerable: true,
|
|
145
|
-
get: function () { return
|
|
166
|
+
get: function () { return chunkATCZ4T2K_cjs.ItdErrorKind; }
|
|
146
167
|
});
|
|
147
168
|
Object.defineProperty(exports, "ItdForbiddenError", {
|
|
148
169
|
enumerable: true,
|
|
149
|
-
get: function () { return
|
|
170
|
+
get: function () { return chunkATCZ4T2K_cjs.ItdForbiddenError; }
|
|
150
171
|
});
|
|
151
172
|
Object.defineProperty(exports, "ItdNetworkError", {
|
|
152
173
|
enumerable: true,
|
|
153
|
-
get: function () { return
|
|
174
|
+
get: function () { return chunkATCZ4T2K_cjs.ItdNetworkError; }
|
|
154
175
|
});
|
|
155
176
|
Object.defineProperty(exports, "ItdNotFoundError", {
|
|
156
177
|
enumerable: true,
|
|
157
|
-
get: function () { return
|
|
178
|
+
get: function () { return chunkATCZ4T2K_cjs.ItdNotFoundError; }
|
|
158
179
|
});
|
|
159
180
|
Object.defineProperty(exports, "ItdPhoneVerificationError", {
|
|
160
181
|
enumerable: true,
|
|
161
|
-
get: function () { return
|
|
182
|
+
get: function () { return chunkATCZ4T2K_cjs.ItdPhoneVerificationError; }
|
|
162
183
|
});
|
|
163
184
|
Object.defineProperty(exports, "ItdRateLimitError", {
|
|
164
185
|
enumerable: true,
|
|
165
|
-
get: function () { return
|
|
186
|
+
get: function () { return chunkATCZ4T2K_cjs.ItdRateLimitError; }
|
|
166
187
|
});
|
|
167
188
|
Object.defineProperty(exports, "ItdRealtime", {
|
|
168
189
|
enumerable: true,
|
|
169
|
-
get: function () { return
|
|
190
|
+
get: function () { return chunkATCZ4T2K_cjs.ItdRealtime; }
|
|
170
191
|
});
|
|
171
192
|
Object.defineProperty(exports, "ItdServerError", {
|
|
172
193
|
enumerable: true,
|
|
173
|
-
get: function () { return
|
|
194
|
+
get: function () { return chunkATCZ4T2K_cjs.ItdServerError; }
|
|
174
195
|
});
|
|
175
196
|
Object.defineProperty(exports, "ItdTimeoutError", {
|
|
176
197
|
enumerable: true,
|
|
177
|
-
get: function () { return
|
|
198
|
+
get: function () { return chunkATCZ4T2K_cjs.ItdTimeoutError; }
|
|
178
199
|
});
|
|
179
200
|
Object.defineProperty(exports, "ItdValidationError", {
|
|
180
201
|
enumerable: true,
|
|
181
|
-
get: function () { return
|
|
202
|
+
get: function () { return chunkATCZ4T2K_cjs.ItdValidationError; }
|
|
182
203
|
});
|
|
183
204
|
Object.defineProperty(exports, "LIBRARY_VERSION", {
|
|
184
205
|
enumerable: true,
|
|
185
|
-
get: function () { return
|
|
206
|
+
get: function () { return chunkATCZ4T2K_cjs.LIBRARY_VERSION; }
|
|
186
207
|
});
|
|
187
208
|
Object.defineProperty(exports, "LikesVisibility", {
|
|
188
209
|
enumerable: true,
|
|
189
|
-
get: function () { return
|
|
210
|
+
get: function () { return chunkATCZ4T2K_cjs.LikesVisibility; }
|
|
190
211
|
});
|
|
191
212
|
Object.defineProperty(exports, "LocalStorageTokenStorage", {
|
|
192
213
|
enumerable: true,
|
|
193
|
-
get: function () { return
|
|
214
|
+
get: function () { return chunkATCZ4T2K_cjs.LocalStorageTokenStorage; }
|
|
194
215
|
});
|
|
195
216
|
Object.defineProperty(exports, "MAX_RECONNECT_ATTEMPTS", {
|
|
196
217
|
enumerable: true,
|
|
197
|
-
get: function () { return
|
|
218
|
+
get: function () { return chunkATCZ4T2K_cjs.MAX_RECONNECT_ATTEMPTS; }
|
|
198
219
|
});
|
|
199
220
|
Object.defineProperty(exports, "MemoryTokenStorage", {
|
|
200
221
|
enumerable: true,
|
|
201
|
-
get: function () { return
|
|
222
|
+
get: function () { return chunkATCZ4T2K_cjs.MemoryTokenStorage; }
|
|
202
223
|
});
|
|
203
224
|
Object.defineProperty(exports, "NOTIFICATION_TYPE_ALIASES", {
|
|
204
225
|
enumerable: true,
|
|
205
|
-
get: function () { return
|
|
226
|
+
get: function () { return chunkATCZ4T2K_cjs.NOTIFICATION_TYPE_ALIASES; }
|
|
206
227
|
});
|
|
207
228
|
Object.defineProperty(exports, "NotificationType", {
|
|
208
229
|
enumerable: true,
|
|
209
|
-
get: function () { return
|
|
230
|
+
get: function () { return chunkATCZ4T2K_cjs.NotificationType; }
|
|
210
231
|
});
|
|
211
232
|
Object.defineProperty(exports, "OAuthProvider", {
|
|
212
233
|
enumerable: true,
|
|
213
|
-
get: function () { return
|
|
234
|
+
get: function () { return chunkATCZ4T2K_cjs.OAuthProvider; }
|
|
214
235
|
});
|
|
215
236
|
Object.defineProperty(exports, "PaginationMode", {
|
|
216
237
|
enumerable: true,
|
|
217
|
-
get: function () { return
|
|
238
|
+
get: function () { return chunkATCZ4T2K_cjs.PaginationMode; }
|
|
218
239
|
});
|
|
219
240
|
Object.defineProperty(exports, "Paginator", {
|
|
220
241
|
enumerable: true,
|
|
221
|
-
get: function () { return
|
|
242
|
+
get: function () { return chunkATCZ4T2K_cjs.Paginator; }
|
|
222
243
|
});
|
|
223
244
|
Object.defineProperty(exports, "RECONNECT_BACKOFF", {
|
|
224
245
|
enumerable: true,
|
|
225
|
-
get: function () { return
|
|
246
|
+
get: function () { return chunkATCZ4T2K_cjs.RECONNECT_BACKOFF; }
|
|
226
247
|
});
|
|
227
248
|
Object.defineProperty(exports, "RECONNECT_JITTER", {
|
|
228
249
|
enumerable: true,
|
|
229
|
-
get: function () { return
|
|
250
|
+
get: function () { return chunkATCZ4T2K_cjs.RECONNECT_JITTER; }
|
|
230
251
|
});
|
|
231
252
|
Object.defineProperty(exports, "REFRESH_COOKIE", {
|
|
232
253
|
enumerable: true,
|
|
233
|
-
get: function () { return
|
|
254
|
+
get: function () { return chunkATCZ4T2K_cjs.REFRESH_COOKIE; }
|
|
234
255
|
});
|
|
235
256
|
Object.defineProperty(exports, "REFRESH_COOKIE_PATH", {
|
|
236
257
|
enumerable: true,
|
|
237
|
-
get: function () { return
|
|
258
|
+
get: function () { return chunkATCZ4T2K_cjs.REFRESH_COOKIE_PATH; }
|
|
238
259
|
});
|
|
239
260
|
Object.defineProperty(exports, "RealtimeStatus", {
|
|
240
261
|
enumerable: true,
|
|
241
|
-
get: function () { return
|
|
262
|
+
get: function () { return chunkATCZ4T2K_cjs.RealtimeStatus; }
|
|
242
263
|
});
|
|
243
264
|
Object.defineProperty(exports, "RealtimeTransportKind", {
|
|
244
265
|
enumerable: true,
|
|
245
|
-
get: function () { return
|
|
266
|
+
get: function () { return chunkATCZ4T2K_cjs.RealtimeTransportKind; }
|
|
246
267
|
});
|
|
247
268
|
Object.defineProperty(exports, "ReportReason", {
|
|
248
269
|
enumerable: true,
|
|
249
|
-
get: function () { return
|
|
270
|
+
get: function () { return chunkATCZ4T2K_cjs.ReportReason; }
|
|
250
271
|
});
|
|
251
272
|
Object.defineProperty(exports, "ReportTargetType", {
|
|
252
273
|
enumerable: true,
|
|
253
|
-
get: function () { return
|
|
274
|
+
get: function () { return chunkATCZ4T2K_cjs.ReportTargetType; }
|
|
254
275
|
});
|
|
255
276
|
Object.defineProperty(exports, "RuntimeMode", {
|
|
256
277
|
enumerable: true,
|
|
257
|
-
get: function () { return
|
|
278
|
+
get: function () { return chunkATCZ4T2K_cjs.RuntimeMode; }
|
|
258
279
|
});
|
|
259
280
|
Object.defineProperty(exports, "STREAM_PATH", {
|
|
260
281
|
enumerable: true,
|
|
261
|
-
get: function () { return
|
|
282
|
+
get: function () { return chunkATCZ4T2K_cjs.STREAM_PATH; }
|
|
262
283
|
});
|
|
263
284
|
Object.defineProperty(exports, "SignInStatus", {
|
|
264
285
|
enumerable: true,
|
|
265
|
-
get: function () { return
|
|
286
|
+
get: function () { return chunkATCZ4T2K_cjs.SignInStatus; }
|
|
266
287
|
});
|
|
267
288
|
Object.defineProperty(exports, "SpanType", {
|
|
268
289
|
enumerable: true,
|
|
269
|
-
get: function () { return
|
|
290
|
+
get: function () { return chunkATCZ4T2K_cjs.SpanType; }
|
|
270
291
|
});
|
|
271
292
|
Object.defineProperty(exports, "TURNSTILE_SITE_KEY", {
|
|
272
293
|
enumerable: true,
|
|
273
|
-
get: function () { return
|
|
294
|
+
get: function () { return chunkATCZ4T2K_cjs.TURNSTILE_SITE_KEY; }
|
|
274
295
|
});
|
|
275
296
|
Object.defineProperty(exports, "UnauthorizedStreamError", {
|
|
276
297
|
enumerable: true,
|
|
277
|
-
get: function () { return
|
|
298
|
+
get: function () { return chunkATCZ4T2K_cjs.UnauthorizedStreamError; }
|
|
278
299
|
});
|
|
279
300
|
Object.defineProperty(exports, "VIDEO_MIME_TYPES", {
|
|
280
301
|
enumerable: true,
|
|
281
|
-
get: function () { return
|
|
302
|
+
get: function () { return chunkATCZ4T2K_cjs.VIDEO_MIME_TYPES; }
|
|
282
303
|
});
|
|
283
304
|
Object.defineProperty(exports, "ViewReason", {
|
|
284
305
|
enumerable: true,
|
|
285
|
-
get: function () { return
|
|
306
|
+
get: function () { return chunkATCZ4T2K_cjs.ViewReason; }
|
|
286
307
|
});
|
|
287
308
|
Object.defineProperty(exports, "ViewSource", {
|
|
288
309
|
enumerable: true,
|
|
289
|
-
get: function () { return
|
|
310
|
+
get: function () { return chunkATCZ4T2K_cjs.ViewSource; }
|
|
290
311
|
});
|
|
291
312
|
Object.defineProperty(exports, "WallAccess", {
|
|
292
313
|
enumerable: true,
|
|
293
|
-
get: function () { return
|
|
314
|
+
get: function () { return chunkATCZ4T2K_cjs.WallAccess; }
|
|
294
315
|
});
|
|
295
316
|
Object.defineProperty(exports, "canonicalNotificationType", {
|
|
296
317
|
enumerable: true,
|
|
297
|
-
get: function () { return
|
|
318
|
+
get: function () { return chunkATCZ4T2K_cjs.canonicalNotificationType; }
|
|
298
319
|
});
|
|
299
320
|
Object.defineProperty(exports, "comment", {
|
|
300
321
|
enumerable: true,
|
|
301
|
-
get: function () { return
|
|
322
|
+
get: function () { return chunkATCZ4T2K_cjs.comment; }
|
|
302
323
|
});
|
|
303
324
|
Object.defineProperty(exports, "createTokenStorage", {
|
|
304
325
|
enumerable: true,
|
|
305
|
-
get: function () { return
|
|
326
|
+
get: function () { return chunkATCZ4T2K_cjs.createTokenStorage; }
|
|
306
327
|
});
|
|
307
328
|
Object.defineProperty(exports, "formatNotificationText", {
|
|
308
329
|
enumerable: true,
|
|
309
|
-
get: function () { return
|
|
330
|
+
get: function () { return chunkATCZ4T2K_cjs.formatNotificationText; }
|
|
310
331
|
});
|
|
311
332
|
Object.defineProperty(exports, "isBuilder", {
|
|
312
333
|
enumerable: true,
|
|
313
|
-
get: function () { return
|
|
334
|
+
get: function () { return chunkATCZ4T2K_cjs.isBuilder; }
|
|
314
335
|
});
|
|
315
336
|
Object.defineProperty(exports, "isItdApiError", {
|
|
316
337
|
enumerable: true,
|
|
317
|
-
get: function () { return
|
|
338
|
+
get: function () { return chunkATCZ4T2K_cjs.isItdApiError; }
|
|
318
339
|
});
|
|
319
340
|
Object.defineProperty(exports, "isItdAuthError", {
|
|
320
341
|
enumerable: true,
|
|
321
|
-
get: function () { return
|
|
342
|
+
get: function () { return chunkATCZ4T2K_cjs.isItdAuthError; }
|
|
322
343
|
});
|
|
323
344
|
Object.defineProperty(exports, "isItdConflictError", {
|
|
324
345
|
enumerable: true,
|
|
325
|
-
get: function () { return
|
|
346
|
+
get: function () { return chunkATCZ4T2K_cjs.isItdConflictError; }
|
|
326
347
|
});
|
|
327
348
|
Object.defineProperty(exports, "isItdError", {
|
|
328
349
|
enumerable: true,
|
|
329
|
-
get: function () { return
|
|
350
|
+
get: function () { return chunkATCZ4T2K_cjs.isItdError; }
|
|
330
351
|
});
|
|
331
352
|
Object.defineProperty(exports, "isItdForbiddenError", {
|
|
332
353
|
enumerable: true,
|
|
333
|
-
get: function () { return
|
|
354
|
+
get: function () { return chunkATCZ4T2K_cjs.isItdForbiddenError; }
|
|
334
355
|
});
|
|
335
356
|
Object.defineProperty(exports, "isItdNotFoundError", {
|
|
336
357
|
enumerable: true,
|
|
337
|
-
get: function () { return
|
|
358
|
+
get: function () { return chunkATCZ4T2K_cjs.isItdNotFoundError; }
|
|
338
359
|
});
|
|
339
360
|
Object.defineProperty(exports, "isItdPhoneVerificationError", {
|
|
340
361
|
enumerable: true,
|
|
341
|
-
get: function () { return
|
|
362
|
+
get: function () { return chunkATCZ4T2K_cjs.isItdPhoneVerificationError; }
|
|
342
363
|
});
|
|
343
364
|
Object.defineProperty(exports, "isItdRateLimitError", {
|
|
344
365
|
enumerable: true,
|
|
345
|
-
get: function () { return
|
|
366
|
+
get: function () { return chunkATCZ4T2K_cjs.isItdRateLimitError; }
|
|
346
367
|
});
|
|
347
368
|
Object.defineProperty(exports, "isItdServerError", {
|
|
348
369
|
enumerable: true,
|
|
349
|
-
get: function () { return
|
|
370
|
+
get: function () { return chunkATCZ4T2K_cjs.isItdServerError; }
|
|
350
371
|
});
|
|
351
372
|
Object.defineProperty(exports, "isItdValidationError", {
|
|
352
373
|
enumerable: true,
|
|
353
|
-
get: function () { return
|
|
374
|
+
get: function () { return chunkATCZ4T2K_cjs.isItdValidationError; }
|
|
354
375
|
});
|
|
355
376
|
Object.defineProperty(exports, "isKnownNotificationType", {
|
|
356
377
|
enumerable: true,
|
|
357
|
-
get: function () { return
|
|
378
|
+
get: function () { return chunkATCZ4T2K_cjs.isKnownNotificationType; }
|
|
358
379
|
});
|
|
359
380
|
Object.defineProperty(exports, "isMyProfile", {
|
|
360
381
|
enumerable: true,
|
|
361
|
-
get: function () { return
|
|
382
|
+
get: function () { return chunkATCZ4T2K_cjs.isMyProfile; }
|
|
362
383
|
});
|
|
363
384
|
Object.defineProperty(exports, "normalizeNotification", {
|
|
364
385
|
enumerable: true,
|
|
365
|
-
get: function () { return
|
|
386
|
+
get: function () { return chunkATCZ4T2K_cjs.normalizeNotification; }
|
|
366
387
|
});
|
|
367
388
|
Object.defineProperty(exports, "poll", {
|
|
368
389
|
enumerable: true,
|
|
369
|
-
get: function () { return
|
|
390
|
+
get: function () { return chunkATCZ4T2K_cjs.poll; }
|
|
370
391
|
});
|
|
371
392
|
Object.defineProperty(exports, "post", {
|
|
372
393
|
enumerable: true,
|
|
373
|
-
get: function () { return
|
|
394
|
+
get: function () { return chunkATCZ4T2K_cjs.post; }
|
|
374
395
|
});
|
|
375
396
|
Object.defineProperty(exports, "readNotificationEvent", {
|
|
376
397
|
enumerable: true,
|
|
377
|
-
get: function () { return
|
|
398
|
+
get: function () { return chunkATCZ4T2K_cjs.readNotificationEvent; }
|
|
378
399
|
});
|
|
379
400
|
Object.defineProperty(exports, "readUnreadCountEvent", {
|
|
380
401
|
enumerable: true,
|
|
381
|
-
get: function () { return
|
|
402
|
+
get: function () { return chunkATCZ4T2K_cjs.readUnreadCountEvent; }
|
|
382
403
|
});
|
|
383
404
|
Object.defineProperty(exports, "report", {
|
|
384
405
|
enumerable: true,
|
|
385
|
-
get: function () { return
|
|
406
|
+
get: function () { return chunkATCZ4T2K_cjs.report; }
|
|
386
407
|
});
|
|
387
408
|
Object.defineProperty(exports, "resolveNotificationUrl", {
|
|
388
409
|
enumerable: true,
|
|
389
|
-
get: function () { return
|
|
410
|
+
get: function () { return chunkATCZ4T2K_cjs.resolveNotificationUrl; }
|
|
390
411
|
});
|
|
391
412
|
Object.defineProperty(exports, "toDate", {
|
|
392
413
|
enumerable: true,
|
|
393
|
-
get: function () { return
|
|
414
|
+
get: function () { return chunkATCZ4T2K_cjs.toDate; }
|
|
394
415
|
});
|
|
395
416
|
exports.FileTokenStorage = FileTokenStorage;
|
|
396
417
|
exports.ItdClient = ItdClient2;
|
package/dist/node.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/node.ts"],"names":["ItdClient"],"mappings":";;;;;AAgCO,IAAM,cAAA,GAA6B,OAAO,IAAA,KAAS;AACxD,EAAA,MAAM,EAAE,QAAA,EAAS,GAAI,MAAM,OAAO,aAAkB,CAAA;AACpD,EAAA,MAAM,EAAE,QAAA,EAAS,GAAI,MAAM,OAAO,MAAW,CAAA;AAE7C,EAAA,OAAO,EAAE,IAAA,EAAM,IAAI,UAAA,CAAW,MAAM,QAAA,CAAS,IAAI,CAAC,CAAA,EAAG,QAAA,EAAU,QAAA,CAAS,IAAI,CAAA,EAAE;AAChF;AAkBO,IAAM,mBAAN,MAA+C;AAAA,EAC3C,KAAA;AAAA;AAAA,
|
|
1
|
+
{"version":3,"sources":["../src/node.ts"],"names":["ItdClient"],"mappings":"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","file":"node.cjs","sourcesContent":["/**\n * `itd-api/node` — то же, что `itd-api`, плюс работа с файловой системой.\n *\n * Импортируйте эту точку входа в Node, Bun и Deno: клиент отсюда умеет загружать файлы\n * по пути (`attach('./photo.jpg')`), а `FileTokenStorage` сохраняет сессию между запусками.\n * В основном бандле работы с файлами нет намеренно — иначе браузерные сборщики пытались бы\n * разрешить `node:fs`.\n *\n * @example\n * ```ts\n * import { ItdClient, FileTokenStorage } from 'itd-api/node';\n *\n * // Когда сессия уже сохранена, `auth` не нужен — токен возьмётся из хранилища.\n * const itd = new ItdClient({ storage: new FileTokenStorage('./.itd-session.json') });\n *\n * await itd.posts.create((p) => p.content('привет').attach('./photo.jpg'));\n * ```\n *\n * @packageDocumentation\n */\n\nimport { ItdClient as BaseClient } from './client.js';\nimport type { ItdSession, TokenStorage } from './core/storage.js';\nimport type { FileReader } from './resources/files.js';\nimport type { ItdClientOptions } from './types/options.js';\n\n/**\n * Читает файл с диска для загрузки.\n *\n * Модуль `node:fs` подключается динамически, поэтому импорт этой точки входа не тянет\n * его в браузерные сборки.\n */\nexport const nodeFileReader: FileReader = async (path) => {\n const { readFile } = await import('node:fs/promises');\n const { basename } = await import('node:path');\n\n return { data: new Uint8Array(await readFile(path)), filename: basename(path) };\n};\n\n/**\n * Хранит сессию в файле.\n *\n * Нужна долгоживущим процессам: без неё бот при каждом запуске входит заново — а вход\n * требует решённой капчи, да и серия входов подряд может привести к временной блокировке\n * аккаунта. С сохранённой сессией опция `auth` не нужна вовсе.\n *\n * Файл создаётся с правами `0600` (чтение и запись только владельцу) — в нём лежат токены.\n * Запись идёт через временный файл с последующим переименованием, поэтому падение процесса\n * посреди сохранения не оставит повреждённую сессию.\n *\n * @example\n * ```ts\n * const itd = new ItdClient({ storage: new FileTokenStorage('./.itd-session.json') });\n * ```\n */\nexport class FileTokenStorage implements TokenStorage {\n readonly #path: string;\n /**\n * Цепочка записей: сохранения идут строго по одному, конкурентные `set` не\n * перемешиваются. Ошибка одной записи цепочку не рвёт.\n */\n #writing: Promise<void> = Promise.resolve();\n\n /** @param path путь к файлу сессии. Добавьте его в `.gitignore`. */\n constructor(path: string) {\n this.#path = path;\n }\n\n async get(): Promise<ItdSession | null> {\n try {\n const { readFile } = await import('node:fs/promises');\n const raw = await readFile(this.#path, 'utf8');\n const parsed: unknown = JSON.parse(raw);\n\n return typeof parsed === 'object' && parsed !== null ? (parsed as ItdSession) : null;\n } catch {\n // Файла нет или он повреждён — считаем, что сессии не было.\n return null;\n }\n }\n\n set(session: ItdSession): Promise<void> {\n this.#writing = this.#writing.then(\n () => this.#write(session),\n () => this.#write(session),\n );\n return this.#writing;\n }\n\n async #write(session: ItdSession): Promise<void> {\n const { writeFile, rename, unlink } = await import('node:fs/promises');\n\n // Временный файл уникален на процесс и вызов — иначе параллельные записи (в том числе\n // из разных процессов) делят один `.tmp`.\n const pid = typeof process !== 'undefined' ? process.pid : 0;\n const temporary = `${this.#path}.${pid}.${Math.random().toString(36).slice(2)}.tmp`;\n\n try {\n await writeFile(temporary, JSON.stringify(session, null, 2), {\n encoding: 'utf8',\n mode: 0o600,\n });\n await rename(temporary, this.#path);\n } catch (error) {\n await unlink(temporary).catch(() => {});\n throw error;\n }\n }\n\n async clear(): Promise<void> {\n try {\n const { rm } = await import('node:fs/promises');\n await rm(this.#path, { force: true });\n } catch {\n // Удалять нечего — это не ошибка.\n }\n }\n}\n\n/**\n * Клиент API итд.com с поддержкой файловой системы.\n *\n * Отличается от базового только тем, что умеет читать файлы по пути:\n * `attach('./photo.jpg')` и `itd.files.upload('./video.mp4')` работают сразу.\n */\nexport class ItdClient extends BaseClient {\n constructor(options: ItdClientOptions = {}) {\n // Чтение файлов передаётся скрытым параметром конструктора, а не мутацией уже\n // собранного клиента: так объект работоспособен сразу и не меняется после создания.\n super(options, { fileReader: nodeFileReader });\n }\n}\n\n/** Создаёт {@link ItdClient} с поддержкой файловой системы. */\nexport function createClient(options: ItdClientOptions = {}): ItdClient {\n return new ItdClient(options);\n}\n\n// Всё остальное — билдеры, типы, ошибки, перечисления — доступно отсюда же,\n// чтобы в Node хватало одного импорта. Объявленные выше имена перекрывают одноимённые.\nexport * from './index.js';\n"]}
|
package/dist/node.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TokenStorage, I as ItdSession, a as ItdClient$1, b as ItdClientOptions, F as FileReader } from './index-
|
|
2
|
-
export { A as ALLOWED_MIME_TYPES, c as AUDIO_MIME_TYPES, d as AUTH_FLAG_COOKIE, e as AUTH_PATHS, f as AccessType, g as Actor, h as AllowedMimeType, i as Announcement, j as AnnouncementButton, k as Attachment, l as AttachmentType, m as AudioMimeType, n as AuthInput, o as AuthResource, p as Author, B as BuilderInput, C as CaptchaCredentials, q as ChangelogEntry, r as Clan, s as ClientHooks, t as Comment, u as CommentBuilder, v as CommentInput, w as CommentReplyTo, x as CommentSort, y as CommentsParams, z as CommentsResource, D as CreateCommentInput, E as CreatePollInput, G as CreatePostInput, H as CreateReportInput, J as Credentials, K as CredentialsAuth, L as DEFAULT_BASE_URL, M as DEFAULT_TIMEOUT, N as DEFAULT_USER_AGENT, O as DEVICE_ID_HEADER, P as DetectedRuntime, Q as DwellEntry, R as ErrorContextHook, S as FeedParams, U as FeedTab, V as FileInput, W as FilesResource, X as FollowResult, Y as ForgotPasswordInput, Z as Hashtag, _ as HashtagPostsParams, $ as HashtagsResource, a0 as IMAGE_MIME_TYPES, a1 as ImageMimeType, a2 as InteractionEntry, a3 as InteractionType, a4 as IsoDate, a5 as ItdAbortError, a6 as ItdApiError, a7 as ItdApiErrorInit, a8 as ItdApiErrorKind, a9 as ItdAuthError, aa as ItdBuilder, ab as ItdConfigError, ac as ItdConflictError, ad as ItdError, ae as ItdErrorCode, af as ItdErrorKind, ag as ItdFieldErrors, ah as ItdForbiddenError, ai as ItdNetworkError, aj as ItdNotFoundError, ak as ItdPhoneVerificationError, al as ItdPlugin, am as ItdRateLimitError, an as ItdRealtime, ao as ItdServerError, ap as ItdTimeoutError, aq as ItdValidationError, ar as LIBRARY_VERSION, as as LikeResult, at as LikesVisibility, au as Listener, av as LocalStorageTokenStorage, aw as Logger, ax as Loose, ay as MAX_RECONNECT_ATTEMPTS, az as MemoryTokenStorage, aA as MyProfile, aB as NOTIFICATION_TYPE_ALIASES, aC as Notification, aD as NotificationEvent, aE as NotificationListParams, aF as NotificationSettings, aG as NotificationType, aH as NotificationsResource, aI as OAuthProvider, aJ as Page, aK as PageState, aL as PaginationMode, aM as Paginator, aN as PaymentMethod, aO as Pin, aP as PinPostResult, aQ as PinsResult, aR as PlatformResource, aS as PluginContext, aT as Poll, aU as PollBuilder, aV as PollInput, aW as PollOption, aX as PollTransportOptions, aY as Portal, aZ as Post, a_ as PostBuilder, a$ as PostInput, b0 as PostStats, b1 as PostsResource, b2 as PrivacySettings, b3 as Profile, b4 as PublicProfile, b5 as RECONNECT_BACKOFF, b6 as RECONNECT_JITTER, b7 as REFRESH_COOKIE, b8 as REFRESH_COOKIE_PATH, b9 as RateLimitOptions, ba as RawRequestOptions, bb as RealtimeEvents, bc as RealtimeOptions, bd as RealtimeStatus, be as RealtimeTransport, bf as RealtimeTransportKind, bg as ReconnectOptions, bh as RepliesParams, bi as Report, bj as ReportBuilder, bk as ReportInput, bl as ReportReason, bm as ReportTargetType, bn as ReportsResource, bo as RequestContext, bp as RequestOptions, bq as ResetPasswordInput, br as ResponseContext, bs as RetryContext, bt as RetryOptions, bu as RuntimeMode, bv as STREAM_PATH, bw as SearchResource, bx as SearchResult, by as Session, bz as SignInResult, bA as SignInStatus, bB as Span, bC as SpanType, bD as SseTransportOptions, bE as Subscription, bF as SubscriptionResource, bG as SubscriptionState, bH as TURNSTILE_SITE_KEY, bI as TelemetryOptions, bJ as TelemetryResource, bK as Transformer, bL as TransportContext, bM as TransportEvent, bN as UnauthorizedStreamError, bO as Unsubscribe, bP as UpdateNotificationSettingsInput, bQ as UpdatePrivacyInput, bR as UpdateProfileInput, bS as UploadOptions, bT as UploadedFile, bU as UserId, bV as UserListParams, bW as UserPostsParams, bX as UserRef, bY as UserSummary, bZ as UsersResource, b_ as VIDEO_MIME_TYPES, b$ as VerificationResource, c0 as VerificationStatus, c1 as VideoMimeType, c2 as ViewReason, c3 as ViewSource, c4 as WallAccess, c5 as canonicalNotificationType, c6 as comment, c7 as createTokenStorage, c8 as formatNotificationText, c9 as isBuilder, ca as isItdApiError, cb as isItdAuthError, cc as isItdConflictError, cd as isItdError, ce as isItdForbiddenError, cf as isItdNotFoundError, cg as isItdPhoneVerificationError, ch as isItdRateLimitError, ci as isItdServerError, cj as isItdValidationError, ck as isKnownNotificationType, cl as isMyProfile, cm as normalizeNotification, cn as poll, co as post, cp as readNotificationEvent, cq as readUnreadCountEvent, cr as report, cs as resolveNotificationUrl, ct as toDate } from './index-
|
|
1
|
+
import { T as TokenStorage, I as ItdSession, a as ItdClient$1, b as ItdClientOptions, F as FileReader } from './index-Duh31Wnx.cjs';
|
|
2
|
+
export { A as ALLOWED_MIME_TYPES, c as AUDIO_MIME_TYPES, d as AUTH_FLAG_COOKIE, e as AUTH_PATHS, f as AccessType, g as Actor, h as AllowedMimeType, i as Announcement, j as AnnouncementButton, k as Attachment, l as AttachmentType, m as AudioMimeType, n as AuthInput, o as AuthResource, p as Author, B as BuilderInput, C as CaptchaCredentials, q as ChangelogEntry, r as Clan, s as ClientHooks, t as Comment, u as CommentBuilder, v as CommentInput, w as CommentReplyTo, x as CommentSort, y as CommentsParams, z as CommentsResource, D as CreateCommentInput, E as CreatePollInput, G as CreatePostInput, H as CreateReportInput, J as Credentials, K as CredentialsAuth, L as DEFAULT_BASE_URL, M as DEFAULT_TIMEOUT, N as DEFAULT_USER_AGENT, O as DEVICE_ID_HEADER, P as DetectedRuntime, Q as DwellEntry, R as ErrorContextHook, S as FeedParams, U as FeedTab, V as FileInput, W as FilesResource, X as FollowResult, Y as ForgotPasswordInput, Z as Hashtag, _ as HashtagPostsParams, $ as HashtagsResource, a0 as IMAGE_MIME_TYPES, a1 as ImageMimeType, a2 as InteractionEntry, a3 as InteractionType, a4 as IsoDate, a5 as ItdAbortError, a6 as ItdApiError, a7 as ItdApiErrorInit, a8 as ItdApiErrorKind, a9 as ItdAuthError, aa as ItdBuilder, ab as ItdConfigError, ac as ItdConflictError, ad as ItdError, ae as ItdErrorCode, af as ItdErrorKind, ag as ItdFieldErrors, ah as ItdForbiddenError, ai as ItdNetworkError, aj as ItdNotFoundError, ak as ItdPhoneVerificationError, al as ItdPlugin, am as ItdRateLimitError, an as ItdRealtime, ao as ItdServerError, ap as ItdTimeoutError, aq as ItdValidationError, ar as LIBRARY_VERSION, as as LikeResult, at as LikesVisibility, au as Listener, av as LocalStorageTokenStorage, aw as Logger, ax as Loose, ay as MAX_RECONNECT_ATTEMPTS, az as MemoryTokenStorage, aA as MyProfile, aB as NOTIFICATION_TYPE_ALIASES, aC as Notification, aD as NotificationEvent, aE as NotificationListParams, aF as NotificationSettings, aG as NotificationType, aH as NotificationsResource, aI as OAuthProvider, aJ as Page, aK as PageState, aL as PaginationMode, aM as Paginator, aN as PaymentMethod, aO as Pin, aP as PinPostResult, aQ as PinsResult, aR as PlatformResource, aS as PluginContext, aT as Poll, aU as PollBuilder, aV as PollInput, aW as PollOption, aX as PollTransportOptions, aY as Portal, aZ as Post, a_ as PostBuilder, a$ as PostInput, b0 as PostStats, b1 as PostsResource, b2 as PrivacySettings, b3 as Profile, b4 as PublicProfile, b5 as RECONNECT_BACKOFF, b6 as RECONNECT_JITTER, b7 as REFRESH_COOKIE, b8 as REFRESH_COOKIE_PATH, b9 as RateLimitOptions, ba as RawRequestOptions, bb as RealtimeEvents, bc as RealtimeOptions, bd as RealtimeStatus, be as RealtimeTransport, bf as RealtimeTransportKind, bg as ReconnectOptions, bh as RepliesParams, bi as Report, bj as ReportBuilder, bk as ReportInput, bl as ReportReason, bm as ReportTargetType, bn as ReportsResource, bo as RequestContext, bp as RequestOptions, bq as ResetPasswordInput, br as ResponseContext, bs as RetryContext, bt as RetryOptions, bu as RuntimeMode, bv as STREAM_PATH, bw as SearchResource, bx as SearchResult, by as Session, bz as SignInResult, bA as SignInStatus, bB as Span, bC as SpanType, bD as SseTransportOptions, bE as Subscription, bF as SubscriptionResource, bG as SubscriptionState, bH as TURNSTILE_SITE_KEY, bI as TelemetryOptions, bJ as TelemetryResource, bK as Transformer, bL as TransportContext, bM as TransportEvent, bN as UnauthorizedStreamError, bO as Unsubscribe, bP as UpdateNotificationSettingsInput, bQ as UpdatePrivacyInput, bR as UpdateProfileInput, bS as UploadOptions, bT as UploadedFile, bU as UserId, bV as UserListParams, bW as UserPostsParams, bX as UserRef, bY as UserSummary, bZ as UsersResource, b_ as VIDEO_MIME_TYPES, b$ as VerificationResource, c0 as VerificationStatus, c1 as VideoMimeType, c2 as ViewReason, c3 as ViewSource, c4 as WallAccess, c5 as canonicalNotificationType, c6 as comment, c7 as createTokenStorage, c8 as formatNotificationText, c9 as isBuilder, ca as isItdApiError, cb as isItdAuthError, cc as isItdConflictError, cd as isItdError, ce as isItdForbiddenError, cf as isItdNotFoundError, cg as isItdPhoneVerificationError, ch as isItdRateLimitError, ci as isItdServerError, cj as isItdValidationError, ck as isKnownNotificationType, cl as isMyProfile, cm as normalizeNotification, cn as poll, co as post, cp as readNotificationEvent, cq as readUnreadCountEvent, cr as report, cs as resolveNotificationUrl, ct as toDate } from './index-Duh31Wnx.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* `itd-api/node` — то же, что `itd-api`, плюс работа с файловой системой.
|
package/dist/node.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TokenStorage, I as ItdSession, a as ItdClient$1, b as ItdClientOptions, F as FileReader } from './index-
|
|
2
|
-
export { A as ALLOWED_MIME_TYPES, c as AUDIO_MIME_TYPES, d as AUTH_FLAG_COOKIE, e as AUTH_PATHS, f as AccessType, g as Actor, h as AllowedMimeType, i as Announcement, j as AnnouncementButton, k as Attachment, l as AttachmentType, m as AudioMimeType, n as AuthInput, o as AuthResource, p as Author, B as BuilderInput, C as CaptchaCredentials, q as ChangelogEntry, r as Clan, s as ClientHooks, t as Comment, u as CommentBuilder, v as CommentInput, w as CommentReplyTo, x as CommentSort, y as CommentsParams, z as CommentsResource, D as CreateCommentInput, E as CreatePollInput, G as CreatePostInput, H as CreateReportInput, J as Credentials, K as CredentialsAuth, L as DEFAULT_BASE_URL, M as DEFAULT_TIMEOUT, N as DEFAULT_USER_AGENT, O as DEVICE_ID_HEADER, P as DetectedRuntime, Q as DwellEntry, R as ErrorContextHook, S as FeedParams, U as FeedTab, V as FileInput, W as FilesResource, X as FollowResult, Y as ForgotPasswordInput, Z as Hashtag, _ as HashtagPostsParams, $ as HashtagsResource, a0 as IMAGE_MIME_TYPES, a1 as ImageMimeType, a2 as InteractionEntry, a3 as InteractionType, a4 as IsoDate, a5 as ItdAbortError, a6 as ItdApiError, a7 as ItdApiErrorInit, a8 as ItdApiErrorKind, a9 as ItdAuthError, aa as ItdBuilder, ab as ItdConfigError, ac as ItdConflictError, ad as ItdError, ae as ItdErrorCode, af as ItdErrorKind, ag as ItdFieldErrors, ah as ItdForbiddenError, ai as ItdNetworkError, aj as ItdNotFoundError, ak as ItdPhoneVerificationError, al as ItdPlugin, am as ItdRateLimitError, an as ItdRealtime, ao as ItdServerError, ap as ItdTimeoutError, aq as ItdValidationError, ar as LIBRARY_VERSION, as as LikeResult, at as LikesVisibility, au as Listener, av as LocalStorageTokenStorage, aw as Logger, ax as Loose, ay as MAX_RECONNECT_ATTEMPTS, az as MemoryTokenStorage, aA as MyProfile, aB as NOTIFICATION_TYPE_ALIASES, aC as Notification, aD as NotificationEvent, aE as NotificationListParams, aF as NotificationSettings, aG as NotificationType, aH as NotificationsResource, aI as OAuthProvider, aJ as Page, aK as PageState, aL as PaginationMode, aM as Paginator, aN as PaymentMethod, aO as Pin, aP as PinPostResult, aQ as PinsResult, aR as PlatformResource, aS as PluginContext, aT as Poll, aU as PollBuilder, aV as PollInput, aW as PollOption, aX as PollTransportOptions, aY as Portal, aZ as Post, a_ as PostBuilder, a$ as PostInput, b0 as PostStats, b1 as PostsResource, b2 as PrivacySettings, b3 as Profile, b4 as PublicProfile, b5 as RECONNECT_BACKOFF, b6 as RECONNECT_JITTER, b7 as REFRESH_COOKIE, b8 as REFRESH_COOKIE_PATH, b9 as RateLimitOptions, ba as RawRequestOptions, bb as RealtimeEvents, bc as RealtimeOptions, bd as RealtimeStatus, be as RealtimeTransport, bf as RealtimeTransportKind, bg as ReconnectOptions, bh as RepliesParams, bi as Report, bj as ReportBuilder, bk as ReportInput, bl as ReportReason, bm as ReportTargetType, bn as ReportsResource, bo as RequestContext, bp as RequestOptions, bq as ResetPasswordInput, br as ResponseContext, bs as RetryContext, bt as RetryOptions, bu as RuntimeMode, bv as STREAM_PATH, bw as SearchResource, bx as SearchResult, by as Session, bz as SignInResult, bA as SignInStatus, bB as Span, bC as SpanType, bD as SseTransportOptions, bE as Subscription, bF as SubscriptionResource, bG as SubscriptionState, bH as TURNSTILE_SITE_KEY, bI as TelemetryOptions, bJ as TelemetryResource, bK as Transformer, bL as TransportContext, bM as TransportEvent, bN as UnauthorizedStreamError, bO as Unsubscribe, bP as UpdateNotificationSettingsInput, bQ as UpdatePrivacyInput, bR as UpdateProfileInput, bS as UploadOptions, bT as UploadedFile, bU as UserId, bV as UserListParams, bW as UserPostsParams, bX as UserRef, bY as UserSummary, bZ as UsersResource, b_ as VIDEO_MIME_TYPES, b$ as VerificationResource, c0 as VerificationStatus, c1 as VideoMimeType, c2 as ViewReason, c3 as ViewSource, c4 as WallAccess, c5 as canonicalNotificationType, c6 as comment, c7 as createTokenStorage, c8 as formatNotificationText, c9 as isBuilder, ca as isItdApiError, cb as isItdAuthError, cc as isItdConflictError, cd as isItdError, ce as isItdForbiddenError, cf as isItdNotFoundError, cg as isItdPhoneVerificationError, ch as isItdRateLimitError, ci as isItdServerError, cj as isItdValidationError, ck as isKnownNotificationType, cl as isMyProfile, cm as normalizeNotification, cn as poll, co as post, cp as readNotificationEvent, cq as readUnreadCountEvent, cr as report, cs as resolveNotificationUrl, ct as toDate } from './index-
|
|
1
|
+
import { T as TokenStorage, I as ItdSession, a as ItdClient$1, b as ItdClientOptions, F as FileReader } from './index-Duh31Wnx.js';
|
|
2
|
+
export { A as ALLOWED_MIME_TYPES, c as AUDIO_MIME_TYPES, d as AUTH_FLAG_COOKIE, e as AUTH_PATHS, f as AccessType, g as Actor, h as AllowedMimeType, i as Announcement, j as AnnouncementButton, k as Attachment, l as AttachmentType, m as AudioMimeType, n as AuthInput, o as AuthResource, p as Author, B as BuilderInput, C as CaptchaCredentials, q as ChangelogEntry, r as Clan, s as ClientHooks, t as Comment, u as CommentBuilder, v as CommentInput, w as CommentReplyTo, x as CommentSort, y as CommentsParams, z as CommentsResource, D as CreateCommentInput, E as CreatePollInput, G as CreatePostInput, H as CreateReportInput, J as Credentials, K as CredentialsAuth, L as DEFAULT_BASE_URL, M as DEFAULT_TIMEOUT, N as DEFAULT_USER_AGENT, O as DEVICE_ID_HEADER, P as DetectedRuntime, Q as DwellEntry, R as ErrorContextHook, S as FeedParams, U as FeedTab, V as FileInput, W as FilesResource, X as FollowResult, Y as ForgotPasswordInput, Z as Hashtag, _ as HashtagPostsParams, $ as HashtagsResource, a0 as IMAGE_MIME_TYPES, a1 as ImageMimeType, a2 as InteractionEntry, a3 as InteractionType, a4 as IsoDate, a5 as ItdAbortError, a6 as ItdApiError, a7 as ItdApiErrorInit, a8 as ItdApiErrorKind, a9 as ItdAuthError, aa as ItdBuilder, ab as ItdConfigError, ac as ItdConflictError, ad as ItdError, ae as ItdErrorCode, af as ItdErrorKind, ag as ItdFieldErrors, ah as ItdForbiddenError, ai as ItdNetworkError, aj as ItdNotFoundError, ak as ItdPhoneVerificationError, al as ItdPlugin, am as ItdRateLimitError, an as ItdRealtime, ao as ItdServerError, ap as ItdTimeoutError, aq as ItdValidationError, ar as LIBRARY_VERSION, as as LikeResult, at as LikesVisibility, au as Listener, av as LocalStorageTokenStorage, aw as Logger, ax as Loose, ay as MAX_RECONNECT_ATTEMPTS, az as MemoryTokenStorage, aA as MyProfile, aB as NOTIFICATION_TYPE_ALIASES, aC as Notification, aD as NotificationEvent, aE as NotificationListParams, aF as NotificationSettings, aG as NotificationType, aH as NotificationsResource, aI as OAuthProvider, aJ as Page, aK as PageState, aL as PaginationMode, aM as Paginator, aN as PaymentMethod, aO as Pin, aP as PinPostResult, aQ as PinsResult, aR as PlatformResource, aS as PluginContext, aT as Poll, aU as PollBuilder, aV as PollInput, aW as PollOption, aX as PollTransportOptions, aY as Portal, aZ as Post, a_ as PostBuilder, a$ as PostInput, b0 as PostStats, b1 as PostsResource, b2 as PrivacySettings, b3 as Profile, b4 as PublicProfile, b5 as RECONNECT_BACKOFF, b6 as RECONNECT_JITTER, b7 as REFRESH_COOKIE, b8 as REFRESH_COOKIE_PATH, b9 as RateLimitOptions, ba as RawRequestOptions, bb as RealtimeEvents, bc as RealtimeOptions, bd as RealtimeStatus, be as RealtimeTransport, bf as RealtimeTransportKind, bg as ReconnectOptions, bh as RepliesParams, bi as Report, bj as ReportBuilder, bk as ReportInput, bl as ReportReason, bm as ReportTargetType, bn as ReportsResource, bo as RequestContext, bp as RequestOptions, bq as ResetPasswordInput, br as ResponseContext, bs as RetryContext, bt as RetryOptions, bu as RuntimeMode, bv as STREAM_PATH, bw as SearchResource, bx as SearchResult, by as Session, bz as SignInResult, bA as SignInStatus, bB as Span, bC as SpanType, bD as SseTransportOptions, bE as Subscription, bF as SubscriptionResource, bG as SubscriptionState, bH as TURNSTILE_SITE_KEY, bI as TelemetryOptions, bJ as TelemetryResource, bK as Transformer, bL as TransportContext, bM as TransportEvent, bN as UnauthorizedStreamError, bO as Unsubscribe, bP as UpdateNotificationSettingsInput, bQ as UpdatePrivacyInput, bR as UpdateProfileInput, bS as UploadOptions, bT as UploadedFile, bU as UserId, bV as UserListParams, bW as UserPostsParams, bX as UserRef, bY as UserSummary, bZ as UsersResource, b_ as VIDEO_MIME_TYPES, b$ as VerificationResource, c0 as VerificationStatus, c1 as VideoMimeType, c2 as ViewReason, c3 as ViewSource, c4 as WallAccess, c5 as canonicalNotificationType, c6 as comment, c7 as createTokenStorage, c8 as formatNotificationText, c9 as isBuilder, ca as isItdApiError, cb as isItdAuthError, cc as isItdConflictError, cd as isItdError, ce as isItdForbiddenError, cf as isItdNotFoundError, cg as isItdPhoneVerificationError, ch as isItdRateLimitError, ci as isItdServerError, cj as isItdValidationError, ck as isKnownNotificationType, cl as isMyProfile, cm as normalizeNotification, cn as poll, co as post, cp as readNotificationEvent, cq as readUnreadCountEvent, cr as report, cs as resolveNotificationUrl, ct as toDate } from './index-Duh31Wnx.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* `itd-api/node` — то же, что `itd-api`, плюс работа с файловой системой.
|