@scrapa/sdk 0.1.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.
@@ -0,0 +1,213 @@
1
+ import type { RequestOptions, RequestSpec } from "../client.ts";
2
+ import type { BatchDto, BatchQuoteDto, CreatedBatchDto, LiveSessionDto, ScrapeQuoteDto, ScrapeResultDto, SearchResultDto, SessionDto, SessionQuoteDto, UsageDto } from "./contract.ts";
3
+ import type { CancelBatchParams, CloseSessionParams, CreateBatchParams, CreateSessionParams, GetBatchParams, GetSessionParams, ListBatchesParams, ListSessionsParams, QuoteBatchParams, QuoteScrapeParams, QuoteSessionParams, ScrapeParams, SearchParams } from "./params.ts";
4
+ /** The version this client reports in `x-scrapa-client`. */
5
+ export declare const SDK_VERSION = "0.1.0";
6
+ /** The hosted API. */
7
+ export declare const DEFAULT_BASE_URL = "https://api.scrapa.app/v1";
8
+ export declare abstract class GeneratedOperations {
9
+ protected abstract request<T>(spec: RequestSpec, params?: object, opts?: RequestOptions): Promise<T>;
10
+ /**
11
+ * Scrape a page
12
+ *
13
+ * Read one web page and hand it back as markdown, HTML, plain text, its links, a screenshot or
14
+ * a PDF. `engine: "auto"` (the default) makes a plain HTTP request first and re-reads the page
15
+ * in a real Chromium when the body turns out to be a JavaScript shell, so you pay for a
16
+ * browser only when the page needed one. Every request leaves through a residential proxy, or
17
+ * through your own with `proxy: { pool: "custom", server }`. The answer says which engine
18
+ * replied, where the page finally was and what it cost.
19
+ *
20
+ * Credits: 1 credit with the fetch engine, 5 with the browser (a screenshot or a PDF is included, never
21
+ * a surcharge), plus managed-proxy bandwidth past the first megabyte. A page the site blocked,
22
+ * a URL our policy refused and anything we broke all cost nothing.
23
+ *
24
+ * `POST /v1/scrape`
25
+ */
26
+ scrape(params: ScrapeParams, opts?: RequestOptions): Promise<ScrapeResultDto>;
27
+ /**
28
+ * Price a scrape
29
+ *
30
+ * What the same request would cost, without making it. Free, and refused by the same guards a
31
+ * real call meets — so a quote is never a price for a call that would be denied. `maxCost` is
32
+ * the ceiling: for `auto` it is the browser's price, which is only charged if the page turns
33
+ * out to need one.
34
+ *
35
+ * Credits: 0 credits — pricing a call is free.
36
+ *
37
+ * `POST /v1/scrape/quote`
38
+ */
39
+ quote(params: QuoteScrapeParams, opts?: RequestOptions): Promise<ScrapeQuoteDto>;
40
+ /**
41
+ * Search the web
42
+ *
43
+ * Ask the web a question and get back ranked results — title, URL and the snippet the index
44
+ * holds — read live off a real search front through a residential exit, never a reseller's
45
+ * cache. `country` picks both the exit and the market, so `br` returns what somebody in Brazil
46
+ * would see. Narrow to your own list of hosts with `includeDomains`, ask for `topic: "news"`
47
+ * when you want dated journalism, and add `answer: true` when you want a paragraph written
48
+ * over the results instead of writing it yourself. To read a result, pass its URL to `scrape`.
49
+ *
50
+ * Credits: 4 credits per 10 results, so a `limit` above 10 costs two rows, plus 1 for `answer: true`. A
51
+ * search every front refused, and anything we broke, cost nothing; a search that ran and found
52
+ * nothing is charged, because the index answered. A repeat of the same search within a few
53
+ * minutes is free and says so with `cached: true`.
54
+ *
55
+ * `POST /v1/search`
56
+ */
57
+ search(params: SearchParams, opts?: RequestOptions): Promise<SearchResultDto>;
58
+ readonly batches: {
59
+ /**
60
+ * Start a batch
61
+ *
62
+ * Hand us a list of URLs and stop holding a connection open. Every one is read with the
63
+ * options you pass here — the same engines, the same exit and the same meter a single
64
+ * `scrape` uses — and a page the site blocked costs nothing here too. Nothing is charged
65
+ * when you submit: a batch spends as it goes, so use `quote` for the ceiling. Poll `get`
66
+ * for progress, or pass a `webhook` and we will call you instead. Results are readable for
67
+ * 24 hours.
68
+ *
69
+ * Credits: Creating a batch is free, and nothing is held: each URL then costs exactly what the same
70
+ * call would have cost on its own, and the pages the web refused cost nothing here too.
71
+ * What the batch has spent so far is on the batch itself, and it grows while it runs.
72
+ *
73
+ * `POST /v1/batches`
74
+ */
75
+ create: (params: CreateBatchParams, opts?: RequestOptions) => Promise<CreatedBatchDto>;
76
+ /**
77
+ * Price a batch
78
+ *
79
+ * What that submission would cost at most, without submitting it. `maxCost` prices every
80
+ * URL at the ceiling one page could reach, so the real bill comes in lower by whatever the
81
+ * web refuses for free and by every page that never needed a browser. Bandwidth is on top
82
+ * and cannot be quoted — it depends on what the pages weigh.
83
+ *
84
+ * Credits: 0 credits — pricing a batch is free.
85
+ *
86
+ * `POST /v1/batches/quote`
87
+ */
88
+ quote: (params: QuoteBatchParams, opts?: RequestOptions) => Promise<BatchQuoteDto>;
89
+ /**
90
+ * List your batches
91
+ *
92
+ * Your most recent batches, newest first — what each one is doing, how far it has got and
93
+ * what it has cost. Results are not included; ask `get` for one batch's pages.
94
+ *
95
+ * Credits: 0 credits — listing batches is free.
96
+ *
97
+ * `GET /v1/batches`
98
+ */
99
+ list: (params?: ListBatchesParams, opts?: RequestOptions) => Promise<BatchDto[]>;
100
+ /**
101
+ * Read one batch
102
+ *
103
+ * Where a batch got to: whether it is still running, how many of its URLs now have a
104
+ * verdict, how many of those the web or our policy refused, how many were never attempted,
105
+ * and what it has spent so far. Ask for `items` to get the results themselves — the pages
106
+ * and the refusals, in the order you submitted them, each one the same answer a single
107
+ * `scrape` would have given — up to 200 at a time, from wherever `from` says. A batch
108
+ * whose results have expired still answers with everything else, because somebody who paid
109
+ * for those pages must never be told the batch does not exist.
110
+ *
111
+ * Credits: 0 credits — reading a batch is free.
112
+ *
113
+ * `GET /v1/batches/{id}`
114
+ */
115
+ get: (params: GetBatchParams, opts?: RequestOptions) => Promise<BatchDto>;
116
+ /**
117
+ * Cancel a batch
118
+ *
119
+ * Stop a batch. A URL already being read finishes and is charged — it is a page we are
120
+ * already paying for — and every URL not yet started becomes `skipped`, which costs
121
+ * nothing and is not a verdict about the URL: submit those positions again whenever you
122
+ * like. Safe to repeat; a batch that has already ended answers with how it ended.
123
+ *
124
+ * Credits: 0 credits — cancelling is free, and it stops the spending.
125
+ *
126
+ * `DELETE /v1/batches/{id}`
127
+ */
128
+ cancel: (params: CancelBatchParams, opts?: RequestOptions) => Promise<BatchDto>;
129
+ };
130
+ readonly sessions: {
131
+ /**
132
+ * Start a browser session
133
+ *
134
+ * Hold a real Chromium for as long as you asked for and answer with a CDP URL your own
135
+ * tools connect to: `chromium.connectOverCDP(connectUrl)` in Playwright,
136
+ * `puppeteer.connect({ browserWSEndpoint: connectUrl })` in Puppeteer. The browser is
137
+ * yours alone for the whole window, every byte it pulls leaves through the exit you
138
+ * picked, and the socket survives our deploys. The URL carries the session's token and is
139
+ * shown once — it cannot be rebuilt from the id.
140
+ *
141
+ * Credits: 2 credits per minute, reserved for the whole window when the session starts and settled
142
+ * by the minutes actually used when it closes — so closing early gives the rest back, and
143
+ * a browser that never came up costs nothing at all. Managed-proxy bandwidth past the
144
+ * first megabyte is added at close; your own proxy is never metered.
145
+ *
146
+ * `POST /v1/sessions`
147
+ */
148
+ create: (params?: CreateSessionParams, opts?: RequestOptions) => Promise<LiveSessionDto>;
149
+ /**
150
+ * Price a session
151
+ *
152
+ * What holding a browser for that long would cost, without holding one. `maxCost` is the
153
+ * whole window at the per-minute rate — a ceiling, not a bill, because the minutes you do
154
+ * not use come back when the session closes.
155
+ *
156
+ * Credits: 0 credits — pricing a session is free.
157
+ *
158
+ * `POST /v1/sessions/quote`
159
+ */
160
+ quote: (params?: QuoteSessionParams, opts?: RequestOptions) => Promise<SessionQuoteDto>;
161
+ /**
162
+ * List your sessions
163
+ *
164
+ * Your most recent sessions, newest first — the live ones and the ones that have ended,
165
+ * with what each of them cost.
166
+ *
167
+ * Credits: 0 credits — listing sessions is free.
168
+ *
169
+ * `GET /v1/sessions`
170
+ */
171
+ list: (params?: ListSessionsParams, opts?: RequestOptions) => Promise<SessionDto[]>;
172
+ /**
173
+ * Read one session
174
+ *
175
+ * Where a session got to: whether it is still live, when it expires, what it has pulled
176
+ * and — once it has ended — what it finally cost. The connect URL is not repeated here; it
177
+ * is shown once, when the session starts.
178
+ *
179
+ * Credits: 0 credits — reading a session is free.
180
+ *
181
+ * `GET /v1/sessions/{id}`
182
+ */
183
+ get: (params: GetSessionParams, opts?: RequestOptions) => Promise<SessionDto>;
184
+ /**
185
+ * Close a session
186
+ *
187
+ * Stop the browser and settle the bill: the minutes you held it are kept and the rest of
188
+ * the reservation goes back. Safe to repeat — a session that has already ended answers
189
+ * with how it ended.
190
+ *
191
+ * Credits: Closing is free. It is where the session's own bill lands: the unused minutes are
192
+ * refunded and the managed pool's bandwidth is charged.
193
+ *
194
+ * `DELETE /v1/sessions/{id}`
195
+ */
196
+ close: (params: CloseSessionParams, opts?: RequestOptions) => Promise<SessionDto>;
197
+ };
198
+ readonly usage: {
199
+ /**
200
+ * Usage this month
201
+ *
202
+ * Credits spent this billing month against the plan's grant, the purchased balance on top
203
+ * of it, managed-proxy megabytes against the plan's ceiling, when the month rolls over,
204
+ * and the same split per API key. Free, and worth reading before a bulk run.
205
+ *
206
+ * Credits: 0 credits.
207
+ *
208
+ * `GET /v1/usage`
209
+ */
210
+ get: (opts?: RequestOptions) => Promise<UsageDto>;
211
+ };
212
+ }
213
+ //# sourceMappingURL=operations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/generated/operations.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,KAAK,EACR,QAAQ,EACR,aAAa,EACb,eAAe,EACf,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,UAAU,EACV,eAAe,EACf,QAAQ,EACX,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACR,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACf,MAAM,aAAa,CAAC;AAErB,4DAA4D;AAC5D,eAAO,MAAM,WAAW,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B,SAAS,cAAc,KAAG,OAAO,CAAC,eAAe,CAAC;QAMrF;;;;;;;;;WASG;wBACa,kBAAkB,SAAS,cAAc,KAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QAEjF;;;;;;;;;;WAUG;sBACW,gBAAgB,SAAS,cAAc,KAAG,OAAO,CAAC,UAAU,CAAC;QAE3E;;;;;;;;;;;WAWG;wBACa,kBAAkB,SAAS,cAAc,KAAG,OAAO,CAAC,UAAU,CAAC;MAMjF;IAEF,QAAQ,CAAC,KAAK;QACV;;;;;;;;;;WAUG;qBACU,cAAc,KAAG,OAAO,CAAC,QAAQ,CAAC;MAEjD;CACL"}
@@ -0,0 +1,220 @@
1
+ // GENERATED FILE — do not edit. Run `bun run sdk:gen`.
2
+ // Source: apps/api/src/routes/v1 (the mounted operations)
3
+ //
4
+ // One method per capability, grouped the way the docs group them, returning the
5
+ // DTO the operation declares. `Scrapa` in ../client.ts supplies request().
6
+ /** The version this client reports in `x-scrapa-client`. */
7
+ export const SDK_VERSION = "0.1.0";
8
+ /** The hosted API. */
9
+ export const DEFAULT_BASE_URL = "https://api.scrapa.app/v1";
10
+ export class GeneratedOperations {
11
+ /**
12
+ * Scrape a page
13
+ *
14
+ * Read one web page and hand it back as markdown, HTML, plain text, its links, a screenshot or
15
+ * a PDF. `engine: "auto"` (the default) makes a plain HTTP request first and re-reads the page
16
+ * in a real Chromium when the body turns out to be a JavaScript shell, so you pay for a
17
+ * browser only when the page needed one. Every request leaves through a residential proxy, or
18
+ * through your own with `proxy: { pool: "custom", server }`. The answer says which engine
19
+ * replied, where the page finally was and what it cost.
20
+ *
21
+ * Credits: 1 credit with the fetch engine, 5 with the browser (a screenshot or a PDF is included, never
22
+ * a surcharge), plus managed-proxy bandwidth past the first megabyte. A page the site blocked,
23
+ * a URL our policy refused and anything we broke all cost nothing.
24
+ *
25
+ * `POST /v1/scrape`
26
+ */
27
+ scrape(params, opts) {
28
+ return this.request({ method: "POST", path: "/scrape", idempotent: true }, params, opts);
29
+ }
30
+ /**
31
+ * Price a scrape
32
+ *
33
+ * What the same request would cost, without making it. Free, and refused by the same guards a
34
+ * real call meets — so a quote is never a price for a call that would be denied. `maxCost` is
35
+ * the ceiling: for `auto` it is the browser's price, which is only charged if the page turns
36
+ * out to need one.
37
+ *
38
+ * Credits: 0 credits — pricing a call is free.
39
+ *
40
+ * `POST /v1/scrape/quote`
41
+ */
42
+ quote(params, opts) {
43
+ return this.request({ method: "POST", path: "/scrape/quote", idempotent: true }, params, opts);
44
+ }
45
+ /**
46
+ * Search the web
47
+ *
48
+ * Ask the web a question and get back ranked results — title, URL and the snippet the index
49
+ * holds — read live off a real search front through a residential exit, never a reseller's
50
+ * cache. `country` picks both the exit and the market, so `br` returns what somebody in Brazil
51
+ * would see. Narrow to your own list of hosts with `includeDomains`, ask for `topic: "news"`
52
+ * when you want dated journalism, and add `answer: true` when you want a paragraph written
53
+ * over the results instead of writing it yourself. To read a result, pass its URL to `scrape`.
54
+ *
55
+ * Credits: 4 credits per 10 results, so a `limit` above 10 costs two rows, plus 1 for `answer: true`. A
56
+ * search every front refused, and anything we broke, cost nothing; a search that ran and found
57
+ * nothing is charged, because the index answered. A repeat of the same search within a few
58
+ * minutes is free and says so with `cached: true`.
59
+ *
60
+ * `POST /v1/search`
61
+ */
62
+ search(params, opts) {
63
+ return this.request({ method: "POST", path: "/search", idempotent: true }, params, opts);
64
+ }
65
+ batches = {
66
+ /**
67
+ * Start a batch
68
+ *
69
+ * Hand us a list of URLs and stop holding a connection open. Every one is read with the
70
+ * options you pass here — the same engines, the same exit and the same meter a single
71
+ * `scrape` uses — and a page the site blocked costs nothing here too. Nothing is charged
72
+ * when you submit: a batch spends as it goes, so use `quote` for the ceiling. Poll `get`
73
+ * for progress, or pass a `webhook` and we will call you instead. Results are readable for
74
+ * 24 hours.
75
+ *
76
+ * Credits: Creating a batch is free, and nothing is held: each URL then costs exactly what the same
77
+ * call would have cost on its own, and the pages the web refused cost nothing here too.
78
+ * What the batch has spent so far is on the batch itself, and it grows while it runs.
79
+ *
80
+ * `POST /v1/batches`
81
+ */
82
+ create: (params, opts) => this.request({ method: "POST", path: "/batches", idempotent: false }, params, opts),
83
+ /**
84
+ * Price a batch
85
+ *
86
+ * What that submission would cost at most, without submitting it. `maxCost` prices every
87
+ * URL at the ceiling one page could reach, so the real bill comes in lower by whatever the
88
+ * web refuses for free and by every page that never needed a browser. Bandwidth is on top
89
+ * and cannot be quoted — it depends on what the pages weigh.
90
+ *
91
+ * Credits: 0 credits — pricing a batch is free.
92
+ *
93
+ * `POST /v1/batches/quote`
94
+ */
95
+ quote: (params, opts) => this.request({ method: "POST", path: "/batches/quote", idempotent: true }, params, opts),
96
+ /**
97
+ * List your batches
98
+ *
99
+ * Your most recent batches, newest first — what each one is doing, how far it has got and
100
+ * what it has cost. Results are not included; ask `get` for one batch's pages.
101
+ *
102
+ * Credits: 0 credits — listing batches is free.
103
+ *
104
+ * `GET /v1/batches`
105
+ */
106
+ list: (params, opts) => this.request({ method: "GET", path: "/batches", idempotent: true }, params, opts),
107
+ /**
108
+ * Read one batch
109
+ *
110
+ * Where a batch got to: whether it is still running, how many of its URLs now have a
111
+ * verdict, how many of those the web or our policy refused, how many were never attempted,
112
+ * and what it has spent so far. Ask for `items` to get the results themselves — the pages
113
+ * and the refusals, in the order you submitted them, each one the same answer a single
114
+ * `scrape` would have given — up to 200 at a time, from wherever `from` says. A batch
115
+ * whose results have expired still answers with everything else, because somebody who paid
116
+ * for those pages must never be told the batch does not exist.
117
+ *
118
+ * Credits: 0 credits — reading a batch is free.
119
+ *
120
+ * `GET /v1/batches/{id}`
121
+ */
122
+ get: (params, opts) => this.request({ method: "GET", path: "/batches/{id}", idempotent: true }, params, opts),
123
+ /**
124
+ * Cancel a batch
125
+ *
126
+ * Stop a batch. A URL already being read finishes and is charged — it is a page we are
127
+ * already paying for — and every URL not yet started becomes `skipped`, which costs
128
+ * nothing and is not a verdict about the URL: submit those positions again whenever you
129
+ * like. Safe to repeat; a batch that has already ended answers with how it ended.
130
+ *
131
+ * Credits: 0 credits — cancelling is free, and it stops the spending.
132
+ *
133
+ * `DELETE /v1/batches/{id}`
134
+ */
135
+ cancel: (params, opts) => this.request({ method: "DELETE", path: "/batches/{id}", idempotent: true }, params, opts),
136
+ };
137
+ sessions = {
138
+ /**
139
+ * Start a browser session
140
+ *
141
+ * Hold a real Chromium for as long as you asked for and answer with a CDP URL your own
142
+ * tools connect to: `chromium.connectOverCDP(connectUrl)` in Playwright,
143
+ * `puppeteer.connect({ browserWSEndpoint: connectUrl })` in Puppeteer. The browser is
144
+ * yours alone for the whole window, every byte it pulls leaves through the exit you
145
+ * picked, and the socket survives our deploys. The URL carries the session's token and is
146
+ * shown once — it cannot be rebuilt from the id.
147
+ *
148
+ * Credits: 2 credits per minute, reserved for the whole window when the session starts and settled
149
+ * by the minutes actually used when it closes — so closing early gives the rest back, and
150
+ * a browser that never came up costs nothing at all. Managed-proxy bandwidth past the
151
+ * first megabyte is added at close; your own proxy is never metered.
152
+ *
153
+ * `POST /v1/sessions`
154
+ */
155
+ create: (params, opts) => this.request({ method: "POST", path: "/sessions", idempotent: false }, params, opts),
156
+ /**
157
+ * Price a session
158
+ *
159
+ * What holding a browser for that long would cost, without holding one. `maxCost` is the
160
+ * whole window at the per-minute rate — a ceiling, not a bill, because the minutes you do
161
+ * not use come back when the session closes.
162
+ *
163
+ * Credits: 0 credits — pricing a session is free.
164
+ *
165
+ * `POST /v1/sessions/quote`
166
+ */
167
+ quote: (params, opts) => this.request({ method: "POST", path: "/sessions/quote", idempotent: true }, params, opts),
168
+ /**
169
+ * List your sessions
170
+ *
171
+ * Your most recent sessions, newest first — the live ones and the ones that have ended,
172
+ * with what each of them cost.
173
+ *
174
+ * Credits: 0 credits — listing sessions is free.
175
+ *
176
+ * `GET /v1/sessions`
177
+ */
178
+ list: (params, opts) => this.request({ method: "GET", path: "/sessions", idempotent: true }, params, opts),
179
+ /**
180
+ * Read one session
181
+ *
182
+ * Where a session got to: whether it is still live, when it expires, what it has pulled
183
+ * and — once it has ended — what it finally cost. The connect URL is not repeated here; it
184
+ * is shown once, when the session starts.
185
+ *
186
+ * Credits: 0 credits — reading a session is free.
187
+ *
188
+ * `GET /v1/sessions/{id}`
189
+ */
190
+ get: (params, opts) => this.request({ method: "GET", path: "/sessions/{id}", idempotent: true }, params, opts),
191
+ /**
192
+ * Close a session
193
+ *
194
+ * Stop the browser and settle the bill: the minutes you held it are kept and the rest of
195
+ * the reservation goes back. Safe to repeat — a session that has already ended answers
196
+ * with how it ended.
197
+ *
198
+ * Credits: Closing is free. It is where the session's own bill lands: the unused minutes are
199
+ * refunded and the managed pool's bandwidth is charged.
200
+ *
201
+ * `DELETE /v1/sessions/{id}`
202
+ */
203
+ close: (params, opts) => this.request({ method: "DELETE", path: "/sessions/{id}", idempotent: true }, params, opts),
204
+ };
205
+ usage = {
206
+ /**
207
+ * Usage this month
208
+ *
209
+ * Credits spent this billing month against the plan's grant, the purchased balance on top
210
+ * of it, managed-proxy megabytes against the plan's ceiling, when the month rolls over,
211
+ * and the same split per API key. Free, and worth reading before a bulk run.
212
+ *
213
+ * Credits: 0 credits.
214
+ *
215
+ * `GET /v1/usage`
216
+ */
217
+ get: (opts) => this.request({ method: "GET", path: "/usage", idempotent: true }, undefined, opts),
218
+ };
219
+ }
220
+ //# sourceMappingURL=operations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations.js","sourceRoot":"","sources":["../../src/generated/operations.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,0DAA0D;AAC1D,EAAE;AACF,gFAAgF;AAChF,2EAA2E;AA+B3E,4DAA4D;AAC5D,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC;AAEnC,sBAAsB;AACtB,MAAM,CAAC,MAAM,gBAAgB,GAAG,2BAA2B,CAAC;AAE5D,MAAM,OAAgB,mBAAmB;IAOrC;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,MAAoB,EAAE,IAAqB;QAC9C,OAA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