MCPcopy Create free account
hub / github.com/violentmonkey/violentmonkey / list

Function list

src/background/sync/s3.js:197–219  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

195 return this.loadData({ method, url, headers, body });
196 },
197 async list() {
198 const listPrefix = this._prefix ? `${this._prefix}/` : '';
199 const items = [];
200 let continuationToken;
201 do {
202 const queryParams = { delimiter: '/', 'list-type': '2', prefix: listPrefix };
203 if (continuationToken) queryParams['continuation-token'] = continuationToken;
204 const { url, headers } = await signS3Request({
205 method: 'GET',
206 endpoint: this._endpoint,
207 pathSegments: [this._bucket],
208 queryParams,
209 accessKeyId: this._accessKeyId,
210 secretKey: this._secretAccessKey,
211 region: this._region,
212 });
213 const xml = await this.loadData({ url, headers });
214 const page = parseListXml(xml);
215 items.push(...page.items);
216 continuationToken = page.nextToken;
217 } while (continuationToken);
218 return items;
219 },
220 get(item) {
221 const name = getItemFilename(item);
222 return this._s3('GET', name);

Callers

nothing calls this directly

Calls 2

signS3RequestFunction · 0.85
parseListXmlFunction · 0.85

Tested by

no test coverage detected