id int64 0 1.29M | original_id stringlengths 32 32 | swhid stringlengths 100 170 | sha1 stringlengths 40 40 | repo_name stringlengths 2 45 | repo_group stringclasses 12
values | filepath stringlengths 5 153 | name stringlengths 1 14.9k | type stringclasses 3
values | code stringlengths 7 2.12M |
|---|---|---|---|---|---|---|---|---|---|
1,285,000 | 794ac4bb997aa565ba3ced85af21363d | swh:1:cnt:d0ca02b8957b5f5b814676855fcc3f21b931dc1a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=1-1/ | db338849830cf6444a087a7a07ec34bf4ea6790b | wlbdashboard | wmcs | node_modules/workbox-background-sync/build/workbox-background-sync.prod.js | x::fromRequest | function | static async fromRequest(t){const e={url:t.url,headers:{}};"GET"!==t.method&&(e.body=await t.clone().arrayBuffer());for(const[s,n]of t.headers.entries())e.headers[s]=n;for(const s of R)void 0!==t[s]&&(e[s]=t[s]);return new x(e)} |
1,285,001 | 08f4e383adaa78c2610c2de9f50b725a | swh:1:cnt:d0ca02b8957b5f5b814676855fcc3f21b931dc1a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=1-1/ | db338849830cf6444a087a7a07ec34bf4ea6790b | wlbdashboard | wmcs | node_modules/workbox-background-sync/build/workbox-background-sync.prod.js | x::clone | function | clone(){return new x(this.toObject())} |
1,285,002 | 4ec921660479159a35409df93e078752 | swh:1:cnt:d0ca02b8957b5f5b814676855fcc3f21b931dc1a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=1-1/ | db338849830cf6444a087a7a07ec34bf4ea6790b | wlbdashboard | wmcs | node_modules/workbox-background-sync/build/workbox-background-sync.prod.js | A::popRequest | function | async popRequest(){return this.v("pop")} |
1,285,003 | dd2b6dd7082d21f88f0f798aff4d78e9 | swh:1:cnt:d0ca02b8957b5f5b814676855fcc3f21b931dc1a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=1-1/ | db338849830cf6444a087a7a07ec34bf4ea6790b | wlbdashboard | wmcs | node_modules/workbox-background-sync/build/workbox-background-sync.prod.js | get | function | get(t,e,s){if(t instanceof IDBTransaction){if("done"===e)return u.get(t);if("objectStoreNames"===e)return t.objectStoreNames||h.get(t);if("store"===e)return s.objectStoreNames[1]?void 0:s.objectStore(s.objectStoreNames[0])}return m(t[e])} |
1,285,004 | 352d94d36dfd524184827aebd3781a43 | swh:1:cnt:d0ca02b8957b5f5b814676855fcc3f21b931dc1a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=1-1/ | db338849830cf6444a087a7a07ec34bf4ea6790b | wlbdashboard | wmcs | node_modules/workbox-background-sync/build/workbox-background-sync.prod.js | A::j | function | static get j(){return j} |
1,285,005 | fc011374dc30390df3fc31a151177863 | swh:1:cnt:d0ca02b8957b5f5b814676855fcc3f21b931dc1a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=1-1/ | db338849830cf6444a087a7a07ec34bf4ea6790b | wlbdashboard | wmcs | node_modules/workbox-background-sync/build/workbox-background-sync.prod.js | k | type | class k{constructor(){this.t=null}async addEntry(t){const e=(await this.getDb()).transaction(I,"readwrite",{durability:"relaxed"});await e.store.add(t),await e.done}async getFirstEntryId(){const t=await this.getDb(),e=await t.transaction(I).store.openCursor();return null==e?void 0:e.value.id}async getAllEntriesByQueueN... |
1,285,006 | 562cd5fa79dacb1e3165461c6ac63c61 | swh:1:cnt:d0ca02b8957b5f5b814676855fcc3f21b931dc1a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=1-1/ | db338849830cf6444a087a7a07ec34bf4ea6790b | wlbdashboard | wmcs | node_modules/workbox-background-sync/build/workbox-background-sync.prod.js | E | type | class E{constructor(t){this.o=t,this.u=new k}async pushEntry(t){delete t.id,t.queueName=this.o,await this.u.addEntry(t)}async unshiftEntry(t){const e=await this.u.getFirstEntryId();e?t.id=e-1:delete t.id,t.queueName=this.o,await this.u.addEntry(t)}async popEntry(){return this.h(await this.u.getLastEntryByQueueName(this... |
1,285,007 | 07cd921695b3db1b2c83f322c6281f50 | swh:1:cnt:d0ca02b8957b5f5b814676855fcc3f21b931dc1a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=1-1/ | db338849830cf6444a087a7a07ec34bf4ea6790b | wlbdashboard | wmcs | node_modules/workbox-background-sync/build/workbox-background-sync.prod.js | x | type | class x{static async fromRequest(t){const e={url:t.url,headers:{}};"GET"!==t.method&&(e.body=await t.clone().arrayBuffer());for(const[s,n]of t.headers.entries())e.headers[s]=n;for(const s of R)void 0!==t[s]&&(e[s]=t[s]);return new x(e)}constructor(t){"navigate"===t.mode&&(t.mode="same-origin"),this.l=t}toObject(){const... |
1,285,008 | 4d79eade4269112240a86e5a69240c70 | swh:1:cnt:d0ca02b8957b5f5b814676855fcc3f21b931dc1a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=1-1/ | db338849830cf6444a087a7a07ec34bf4ea6790b | wlbdashboard | wmcs | node_modules/workbox-background-sync/build/workbox-background-sync.prod.js | A | type | class A{constructor(t,{forceSyncFallback:s,onSync:n,maxRetentionTime:r}={}){if(this.m=!1,this.p=!1,j.has(t))throw new e.WorkboxError("duplicate-queue-name",{name:t});j.add(t),this.g=t,this.D=n||this.replayRequests,this.B=r||10080,this.I=Boolean(s),this.q=new E(this.g),this.k()}get name(){return this.g}async pushRequest... |
1,285,009 | ecc9c212d8494c563712e208de6daa76 | swh:1:cnt:2df55333cce6f8a39a0f0fdc58033e72dc1a7c76;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=3-9/ | af91b0e4603598abdf0bb849b68df0ef7e94e4c1 | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/QueueDb.d.ts | UnidentifiedQueueStoreEntry | type | interface UnidentifiedQueueStoreEntry {
requestData: RequestData;
timestamp: number;
id?: number;
queueName?: string;
metadata?: object;
} |
1,285,010 | f64a7adaa17382e77da54fa29f32c11d | swh:1:cnt:2df55333cce6f8a39a0f0fdc58033e72dc1a7c76;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=10-12/ | af91b0e4603598abdf0bb849b68df0ef7e94e4c1 | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/QueueDb.d.ts | QueueStoreEntry | type | interface QueueStoreEntry extends UnidentifiedQueueStoreEntry {
id: number;
} |
1,285,011 | a5d4e845e6e083d95ecc955e0833dbf7 | swh:1:cnt:2df55333cce6f8a39a0f0fdc58033e72dc1a7c76;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=20-90/ | af91b0e4603598abdf0bb849b68df0ef7e94e4c1 | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/QueueDb.d.ts | QueueDb | type | class QueueDb {
private _db;
/**
* Add QueueStoreEntry to underlying db.
*
* @param {UnidentifiedQueueStoreEntry} entry
*/
addEntry(entry: UnidentifiedQueueStoreEntry): Promise<void>;
/**
* Returns the first entry id in the ObjectStore.
*
* @return {number | undefined}... |
1,285,012 | cac6008ff1163afcaac366ff2ae9f2df | swh:1:cnt:cbdbcfd40483530bffbe9b58c7aea27e575ed6d8;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=21-145/ | 1b98f982948dd9601edab5678e72386eaf86ebc5 | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/QueueDb.js | QueueDb | type | class QueueDb {
constructor() {
this._db = null;
}
/**
* Add QueueStoreEntry to underlying db.
*
* @param {UnidentifiedQueueStoreEntry} entry
*/
async addEntry(entry) {
const db = await this.getDb();
const tx = db.transaction(REQUEST_OBJECT_STORE_NAME, 'readwr... |
1,285,013 | ada2d14efe0a50adcb923aaca7e2301e | swh:1:cnt:cbdbcfd40483530bffbe9b58c7aea27e575ed6d8;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=22-24/ | 1b98f982948dd9601edab5678e72386eaf86ebc5 | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/QueueDb.js | QueueDb::constructor | function | constructor() {
this._db = null;
} |
1,285,014 | e16d3321c6a52afe9f18e4c309b09d91 | swh:1:cnt:cbdbcfd40483530bffbe9b58c7aea27e575ed6d8;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=50-60/ | 1b98f982948dd9601edab5678e72386eaf86ebc5 | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/QueueDb.js | QueueDb::getAllEntriesByQueueName | function | /**
* Get all the entries filtered by index
*
* @param queueName
* @return {Promise<QueueStoreEntry[]>}
*/
async getAllEntriesByQueueName(queueName) {
const db = await this.getDb();
const results = await db.getAllFromIndex(REQUEST_OBJECT_STORE_NAME, QUEUE_NAME_INDEX, IDBKeyR... |
1,285,015 | 05d67a575ce13600d79d4ef0eba7a3f8 | swh:1:cnt:cbdbcfd40483530bffbe9b58c7aea27e575ed6d8;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=38-49/ | 1b98f982948dd9601edab5678e72386eaf86ebc5 | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/QueueDb.js | QueueDb::getFirstEntryId | function | /**
* Returns the first entry id in the ObjectStore.
*
* @return {number | undefined}
*/
async getFirstEntryId() {
const db = await this.getDb();
const cursor = await db
.transaction(REQUEST_OBJECT_STORE_NAME)
.store.openCursor();
return cursor ===... |
1,285,016 | 9a61caf4707696c89cfbd913946ad0df | swh:1:cnt:cbdbcfd40483530bffbe9b58c7aea27e575ed6d8;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=61-70/ | 1b98f982948dd9601edab5678e72386eaf86ebc5 | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/QueueDb.js | QueueDb::getEntryCountByQueueName | function | /**
* Returns the number of entries filtered by index
*
* @param queueName
* @return {Promise<number>}
*/
async getEntryCountByQueueName(queueName) {
const db = await this.getDb();
return db.countFromIndex(REQUEST_OBJECT_STORE_NAME, QUEUE_NAME_INDEX, IDBKeyRange.only(queueNa... |
1,285,017 | d9255b98cfcdcb1893a1122bfd8a60fa | swh:1:cnt:cbdbcfd40483530bffbe9b58c7aea27e575ed6d8;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=25-37/ | 1b98f982948dd9601edab5678e72386eaf86ebc5 | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/QueueDb.js | QueueDb::addEntry | function | /**
* Add QueueStoreEntry to underlying db.
*
* @param {UnidentifiedQueueStoreEntry} entry
*/
async addEntry(entry) {
const db = await this.getDb();
const tx = db.transaction(REQUEST_OBJECT_STORE_NAME, 'readwrite', {
durability: 'relaxed',
});
await tx... |
1,285,018 | cdc03e7b94ed8ec9e5ddc2bb4685dfce | swh:1:cnt:cbdbcfd40483530bffbe9b58c7aea27e575ed6d8;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=71-79/ | 1b98f982948dd9601edab5678e72386eaf86ebc5 | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/QueueDb.js | QueueDb::deleteEntry | function | /**
* Deletes a single entry by id.
*
* @param {number} id the id of the entry to be deleted
*/
async deleteEntry(id) {
const db = await this.getDb();
await db.delete(REQUEST_OBJECT_STORE_NAME, id);
} |
1,285,019 | 07d2f6e3360360d1a19ef1f5b16f0285 | swh:1:cnt:cbdbcfd40483530bffbe9b58c7aea27e575ed6d8;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=80-87/ | 1b98f982948dd9601edab5678e72386eaf86ebc5 | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/QueueDb.js | QueueDb::getFirstEntryByQueueName | function | /**
*
* @param queueName
* @returns {Promise<QueueStoreEntry | undefined>}
*/
async getFirstEntryByQueueName(queueName) {
return await this.getEndEntryFromIndex(IDBKeyRange.only(queueName), 'next');
} |
1,285,020 | f5f914eabcd62ec7093679a0d3b16170 | swh:1:cnt:cbdbcfd40483530bffbe9b58c7aea27e575ed6d8;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=88-95/ | 1b98f982948dd9601edab5678e72386eaf86ebc5 | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/QueueDb.js | QueueDb::getLastEntryByQueueName | function | /**
*
* @param queueName
* @returns {Promise<QueueStoreEntry | undefined>}
*/
async getLastEntryByQueueName(queueName) {
return await this.getEndEntryFromIndex(IDBKeyRange.only(queueName), 'prev');
} |
1,285,021 | 5767bfd718916d4258e3c37c9593e097 | swh:1:cnt:cbdbcfd40483530bffbe9b58c7aea27e575ed6d8;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=96-112/ | 1b98f982948dd9601edab5678e72386eaf86ebc5 | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/QueueDb.js | QueueDb::getEndEntryFromIndex | function | /**
* Returns either the first or the last entries, depending on direction.
* Filtered by index.
*
* @param {IDBCursorDirection} direction
* @param {IDBKeyRange} query
* @return {Promise<QueueStoreEntry | undefined>}
* @private
*/
async getEndEntryFromIndex(query, direction) ... |
1,285,022 | ce24011f34d50461723c3c397953aa9b | swh:1:cnt:cbdbcfd40483530bffbe9b58c7aea27e575ed6d8;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=113-125/ | 1b98f982948dd9601edab5678e72386eaf86ebc5 | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/QueueDb.js | QueueDb::getDb | function | /**
* Returns an open connection to the database.
*
* @private
*/
async getDb() {
if (!this._db) {
this._db = await openDB(DB_NAME, DB_VERSION, {
upgrade: this._upgradeDb,
});
}
return this._db;
} |
1,285,023 | ca54a2213d340f34b856f849ca5fe0d8 | swh:1:cnt:cbdbcfd40483530bffbe9b58c7aea27e575ed6d8;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=126-144/ | 1b98f982948dd9601edab5678e72386eaf86ebc5 | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/QueueDb.js | QueueDb::_upgradeDb | function | /**
* Upgrades QueueDB
*
* @param {IDBPDatabase<QueueDBSchema>} db
* @param {number} oldVersion
* @private
*/
_upgradeDb(db, oldVersion) {
if (oldVersion > 0 && oldVersion < DB_VERSION) {
if (db.objectStoreNames.contains(REQUEST_OBJECT_STORE_NAME)) {
... |
1,285,024 | dbe829fa900cbaaa6a57f3b6f28da5e6 | swh:1:cnt:6cca5e3dd1535c82fdbe61ac55a70f89f4120feb;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=10-83/ | 25b6ed727046829b0759a96186888319426d51ba | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/QueueStore.d.ts | QueueStore | type | class QueueStore {
private readonly _queueName;
private readonly _queueDb;
/**
* Associates this instance with a Queue instance, so entries added can be
* identified by their queue name.
*
* @param {string} queueName
*/
constructor(queueName: string);
/**
* Append an en... |
1,285,025 | d099c0efedb3b3eb1e6cd73d44b6fce5 | swh:1:cnt:411a36f042fafbcb68b6e2c89800d85ec60a90c0;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=18-152/ | d130a6a97a8752c573e0733e4a6d356bc6326298 | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/QueueStore.js | QueueStore | type | class QueueStore {
/**
* Associates this instance with a Queue instance, so entries added can be
* identified by their queue name.
*
* @param {string} queueName
*/
constructor(queueName) {
this._queueName = queueName;
this._queueDb = new QueueDb();
}
/**
* A... |
1,285,026 | 72aad4df50179b186c96aa6a8f2892a1 | swh:1:cnt:411a36f042fafbcb68b6e2c89800d85ec60a90c0;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=19-28/ | d130a6a97a8752c573e0733e4a6d356bc6326298 | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/QueueStore.js | QueueStore::constructor | function | /**
* Associates this instance with a Queue instance, so entries added can be
* identified by their queue name.
*
* @param {string} queueName
*/
constructor(queueName) {
this._queueName = queueName;
this._queueDb = new QueueDb();
} |
1,285,027 | 557e849f2c20dba0fd6c85be4e5b54b6 | swh:1:cnt:411a36f042fafbcb68b6e2c89800d85ec60a90c0;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=29-56/ | d130a6a97a8752c573e0733e4a6d356bc6326298 | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/QueueStore.js | QueueStore::pushEntry | function | /**
* Append an entry last in the queue.
*
* @param {Object} entry
* @param {Object} entry.requestData
* @param {number} [entry.timestamp]
* @param {Object} [entry.metadata]
*/
async pushEntry(entry) {
if (process.env.NODE_ENV !== 'production') {
assert.isType(... |
1,285,028 | d113bb62117cc671c08ed821dfb69217 | swh:1:cnt:411a36f042fafbcb68b6e2c89800d85ec60a90c0;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=57-91/ | d130a6a97a8752c573e0733e4a6d356bc6326298 | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/QueueStore.js | QueueStore::unshiftEntry | function | /**
* Prepend an entry first in the queue.
*
* @param {Object} entry
* @param {Object} entry.requestData
* @param {number} [entry.timestamp]
* @param {Object} [entry.metadata]
*/
async unshiftEntry(entry) {
if (process.env.NODE_ENV !== 'production') {
assert.is... |
1,285,029 | 7cd3cf933b15116e10713d9e62a131cf | swh:1:cnt:411a36f042fafbcb68b6e2c89800d85ec60a90c0;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=100-107/ | d130a6a97a8752c573e0733e4a6d356bc6326298 | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/QueueStore.js | QueueStore::shiftEntry | function | /**
* Removes and returns the first entry in the queue matching the `queueName`.
*
* @return {Promise<QueueStoreEntry|undefined>}
*/
async shiftEntry() {
return this._removeEntry(await this._queueDb.getFirstEntryByQueueName(this._queueName));
} |
1,285,030 | 7703c6a7e3b593383bd7f22566420bda | swh:1:cnt:411a36f042fafbcb68b6e2c89800d85ec60a90c0;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=92-99/ | d130a6a97a8752c573e0733e4a6d356bc6326298 | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/QueueStore.js | QueueStore::popEntry | function | /**
* Removes and returns the last entry in the queue matching the `queueName`.
*
* @return {Promise<QueueStoreEntry|undefined>}
*/
async popEntry() {
return this._removeEntry(await this._queueDb.getLastEntryByQueueName(this._queueName));
} |
1,285,031 | f4d9b87e062b3846df9e7486b2478deb | swh:1:cnt:411a36f042fafbcb68b6e2c89800d85ec60a90c0;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=108-116/ | d130a6a97a8752c573e0733e4a6d356bc6326298 | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/QueueStore.js | QueueStore::getAll | function | /**
* Returns all entries in the store matching the `queueName`.
*
* @param {Object} options See {@link workbox-background-sync.Queue~getAll}
* @return {Promise<Array<Object>>}
*/
async getAll() {
return await this._queueDb.getAllEntriesByQueueName(this._queueName);
} |
1,285,032 | df4af3b29bfa8a15f5c1892423dfaf54 | swh:1:cnt:411a36f042fafbcb68b6e2c89800d85ec60a90c0;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=117-125/ | d130a6a97a8752c573e0733e4a6d356bc6326298 | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/QueueStore.js | QueueStore::size | function | /**
* Returns the number of entries in the store matching the `queueName`.
*
* @param {Object} options See {@link workbox-background-sync.Queue~size}
* @return {Promise<number>}
*/
async size() {
return await this._queueDb.getEntryCountByQueueName(this._queueName);
} |
1,285,033 | a90bd06fefd8b6011833012e62c15774 | swh:1:cnt:411a36f042fafbcb68b6e2c89800d85ec60a90c0;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=126-138/ | d130a6a97a8752c573e0733e4a6d356bc6326298 | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/QueueStore.js | QueueStore::deleteEntry | function | /**
* Deletes the entry for the given ID.
*
* WARNING: this method does not ensure the deleted entry belongs to this
* queue (i.e. matches the `queueName`). But this limitation is acceptable
* as this class is not publicly exposed. An additional check would make
* this method slower than i... |
1,285,034 | 1093d38aa1a7f0536f48fe2c7c334047 | swh:1:cnt:411a36f042fafbcb68b6e2c89800d85ec60a90c0;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=139-151/ | d130a6a97a8752c573e0733e4a6d356bc6326298 | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/QueueStore.js | QueueStore::_removeEntry | function | /**
* Removes and returns the first or last entry in the queue (based on the
* `direction` argument) matching the `queueName`.
*
* @return {Promise<QueueStoreEntry|undefined>}
* @private
*/
async _removeEntry(entry) {
if (entry) {
await this.deleteEntry(entry.id);
... |
1,285,035 | cff1063dca1d6c45cc06479192a3336d | swh:1:cnt:d204585569b68f43f8d3f796cd9adb115a3834cb;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=3-7/ | 5a3187cc3fc18604fba95d089319d42323292c8f | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/StorableRequest.d.ts | RequestData | type | interface RequestData extends MapLikeObject {
url: string;
headers: MapLikeObject;
body?: ArrayBuffer;
} |
1,285,036 | 60cce853732ac8debfabb1d7e54ab413 | swh:1:cnt:d204585569b68f43f8d3f796cd9adb115a3834cb;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=15-52/ | 5a3187cc3fc18604fba95d089319d42323292c8f | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/StorableRequest.d.ts | StorableRequest | type | class StorableRequest {
private readonly _requestData;
/**
* Converts a Request object to a plain object that can be structured
* cloned or JSON-stringified.
*
* @param {Request} request
* @return {Promise<StorableRequest>}
*/
static fromRequest(request: Request): Promise<Stora... |
1,285,037 | e90d20e0d576591d4fa3a143c4b19bb5 | swh:1:cnt:4334db69d48b0c585201909cfa5e514facd75e0b;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=21-120/ | ea279d04cd322d1a8d806025616cf8921e5662ff | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/StorableRequest.js | StorableRequest | type | /**
* A class to make it easier to serialize and de-serialize requests so they
* can be stored in IndexedDB.
*
* Most developers will not need to access this class directly;
* it is exposed for advanced use cases.
*/
class StorableRequest {
/**
* Converts a Request object to a plain object that can be st... |
1,285,038 | ad16d330be55f30dfc5ddc9a046fe846 | swh:1:cnt:4334db69d48b0c585201909cfa5e514facd75e0b;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=29-60/ | ea279d04cd322d1a8d806025616cf8921e5662ff | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/StorableRequest.js | StorableRequest::fromRequest | function | /**
* Converts a Request object to a plain object that can be structured
* cloned or JSON-stringified.
*
* @param {Request} request
* @return {Promise<StorableRequest>}
*/
static async fromRequest(request) {
const requestData = {
url: request.url,
header... |
1,285,039 | 70d4f53e4dc3c8a9c69214535959c2d0 | swh:1:cnt:4334db69d48b0c585201909cfa5e514facd75e0b;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=61-90/ | ea279d04cd322d1a8d806025616cf8921e5662ff | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/StorableRequest.js | StorableRequest::constructor | function | /**
* Accepts an object of request data that can be used to construct a
* `Request` but can also be stored in IndexedDB.
*
* @param {Object} requestData An object of request data that includes the
* `url` plus any relevant properties of
* [requestInit]{@link https://fetch.spec.what... |
1,285,040 | 4a947ae3caef06a4ec330d2bbe774203 | swh:1:cnt:4334db69d48b0c585201909cfa5e514facd75e0b;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=112-119/ | ea279d04cd322d1a8d806025616cf8921e5662ff | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/StorableRequest.js | StorableRequest::clone | function | /**
* Creates and returns a deep clone of the instance.
*
* @return {StorableRequest}
*/
clone() {
return new StorableRequest(this.toObject());
} |
1,285,041 | b181f31126a989f2d175b6f35af65ea2 | swh:1:cnt:4334db69d48b0c585201909cfa5e514facd75e0b;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=91-103/ | ea279d04cd322d1a8d806025616cf8921e5662ff | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/StorableRequest.js | StorableRequest::toObject | function | /**
* Returns a deep clone of the instances `_requestData` object.
*
* @return {Object}
*/
toObject() {
const requestData = Object.assign({}, this._requestData);
requestData.headers = Object.assign({}, this._requestData.headers);
if (requestData.body) {
reques... |
1,285,042 | 38e9e8bf2303d784ed95e65e3f326ec5 | swh:1:cnt:4334db69d48b0c585201909cfa5e514facd75e0b;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=104-111/ | ea279d04cd322d1a8d806025616cf8921e5662ff | wlbdashboard | wmcs | node_modules/workbox-background-sync/lib/StorableRequest.js | StorableRequest::toRequest | function | /**
* Converts this instance to a Request.
*
* @return {Request}
*/
toRequest() {
return new Request(this._requestData.url, this._requestData);
} |
1,285,043 | a5351b8953a42d3f6989664679e900eb | swh:1:cnt:acb682c4ef9f86d27843779d87e89216b50fbb68;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=13-41/ | 1871a3620390f8d716307c62de043dfa1cfa11ec | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/BackgroundSyncPlugin.ts | BackgroundSyncPlugin | type | /**
* A class implementing the `fetchDidFail` lifecycle callback. This makes it
* easier to add failed requests to a background sync Queue.
*
* @memberof workbox-background-sync
*/
class BackgroundSyncPlugin implements WorkboxPlugin {
private readonly _queue: Queue;
/**
* @param {string} name See the {@lin... |
1,285,044 | 6623449db2950fe1a5feb2af0435fc14 | swh:1:cnt:acb682c4ef9f86d27843779d87e89216b50fbb68;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=22-31/ | 1871a3620390f8d716307c62de043dfa1cfa11ec | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/BackgroundSyncPlugin.ts | BackgroundSyncPlugin::constructor | function | /**
* @param {string} name See the {@link workbox-background-sync.Queue}
* documentation for parameter details.
* @param {Object} [options] See the
* {@link workbox-background-sync.Queue} documentation for
* parameter details.
*/
constructor(name: string, options?: QueueOptions) {
th... |
1,285,045 | 9a7a34fa9b6cbc144c120fa8ff2e4559 | swh:1:cnt:6e40eebaa6ba3f17513cd827e87077bcefd7d112;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=16-20/ | df7efae8530bea9e71fb0d3e81632e936c25ba21 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/index.ts | SyncManager | type | // See https://github.com/GoogleChrome/workbox/issues/2946
interface SyncManager {
getTags(): Promise<string[]>;
register(tag: string): Promise<void>;
} |
1,285,046 | 07df0d1df97801333d80cd53d64c2c8c | swh:1:cnt:6e40eebaa6ba3f17513cd827e87077bcefd7d112;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=32-34/ | df7efae8530bea9e71fb0d3e81632e936c25ba21 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/index.ts | ServiceWorkerGlobalScopeEventMap | type | interface ServiceWorkerGlobalScopeEventMap {
sync: SyncEvent;
} |
1,285,047 | c85d7a3150a9cadd0da9cb3779210486 | swh:1:cnt:6e40eebaa6ba3f17513cd827e87077bcefd7d112;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=27-30/ | df7efae8530bea9e71fb0d3e81632e936c25ba21 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/index.ts | SyncEvent | type | interface SyncEvent extends ExtendableEvent {
readonly lastChance: boolean;
readonly tag: string;
} |
1,285,048 | 9655610dbec5d4e7585a211e812caeb9 | swh:1:cnt:6e40eebaa6ba3f17513cd827e87077bcefd7d112;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=23-25/ | df7efae8530bea9e71fb0d3e81632e936c25ba21 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/index.ts | ServiceWorkerRegistration | type | interface ServiceWorkerRegistration {
readonly sync: SyncManager;
} |
1,285,049 | e628af167775c26aa27f12d5dba4c760 | swh:1:cnt:4e05183964897d5d84e5159323c19c51c2d8e2a7;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=21-23/ | a53940ed18717ca4b49711f0019405deec35c7c3 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/Queue.ts | OnSyncCallbackOptions | type | interface OnSyncCallbackOptions {
queue: Queue;
} |
1,285,050 | 5e41ec7f04cebf960fd8e9c5455f0a95 | swh:1:cnt:4e05183964897d5d84e5159323c19c51c2d8e2a7;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=71-485/ | a53940ed18717ca4b49711f0019405deec35c7c3 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/Queue.ts | Queue | type | /**
* A class to manage storing failed requests in IndexedDB and retrying them
* later. All parts of the storing and replaying process are observable via
* callbacks.
*
* @memberof workbox-background-sync
*/
class Queue {
private readonly _name: string;
private readonly _onSync: OnSyncCallback;
private read... |
1,285,051 | 42367e6a5b2655d9f2addca389d4272b | swh:1:cnt:4e05183964897d5d84e5159323c19c51c2d8e2a7;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=29-33/ | a53940ed18717ca4b49711f0019405deec35c7c3 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/Queue.ts | QueueOptions | type | interface QueueOptions {
forceSyncFallback?: boolean;
maxRetentionTime?: number;
onSync?: OnSyncCallback;
} |
1,285,052 | 4d5daaf625cb7832279c26cb3aaf9f94 | swh:1:cnt:4e05183964897d5d84e5159323c19c51c2d8e2a7;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=25-27/ | a53940ed18717ca4b49711f0019405deec35c7c3 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/Queue.ts | OnSyncCallback | type | interface OnSyncCallback {
(options: OnSyncCallbackOptions): void | Promise<void>;
} |
1,285,053 | 4f122491cdb413722794e06b30a20e29 | swh:1:cnt:4e05183964897d5d84e5159323c19c51c2d8e2a7;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=35-42/ | a53940ed18717ca4b49711f0019405deec35c7c3 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/Queue.ts | QueueEntry | type | interface QueueEntry {
request: Request;
timestamp?: number;
// We could use Record<string, unknown> as a type but that would be a breaking
// change, better do it in next major release.
// eslint-disable-next-line @typescript-eslint/ban-types
metadata?: object;
} |
1,285,054 | e2ba3b9c8713740bb92f7ff9b8832a0b | swh:1:cnt:4e05183964897d5d84e5159323c19c51c2d8e2a7;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=87-130/ | a53940ed18717ca4b49711f0019405deec35c7c3 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/Queue.ts | Queue::constructor | function | /**
* Creates an instance of Queue with the given options
*
* @param {string} name The unique name for this queue. This name must be
* unique as it's used to register sync events and store requests
* in IndexedDB specific to this instance. An error will be thrown if
* a duplicate name is d... |
1,285,055 | 8a637cff76256a612d84ca2b2214c80a | swh:1:cnt:4e05183964897d5d84e5159323c19c51c2d8e2a7;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=139-172/ | a53940ed18717ca4b49711f0019405deec35c7c3 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/Queue.ts | Queue::pushRequest | function | /**
* Stores the passed request in IndexedDB (with its timestamp and any
* metadata) at the end of the queue.
*
* @param {QueueEntry} entry
* @param {Request} entry.request The request to store in the queue.
* @param {Object} [entry.metadata] Any metadata you want associated with the
* stored r... |
1,285,056 | fffe8241b68910127b7c38f212abd9f7 | swh:1:cnt:4e05183964897d5d84e5159323c19c51c2d8e2a7;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=132-137/ | a53940ed18717ca4b49711f0019405deec35c7c3 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/Queue.ts | Queue::name | function | /**
* @return {string}
*/
get name(): string {
return this._name;
} |
1,285,057 | 23f76b0cc0203942d45d968bb00f9e55 | swh:1:cnt:4e05183964897d5d84e5159323c19c51c2d8e2a7;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=209-218/ | a53940ed18717ca4b49711f0019405deec35c7c3 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/Queue.ts | Queue::popRequest | function | /**
* Removes and returns the last request in the queue (along with its
* timestamp and any metadata). The returned object takes the form:
* `{request, timestamp, metadata}`.
*
* @return {Promise<QueueEntry | undefined>}
*/
async popRequest(): Promise<QueueEntry | undefined> {
return this._remov... |
1,285,058 | c778f4ada0b80fcede45384d7479cd57 | swh:1:cnt:4e05183964897d5d84e5159323c19c51c2d8e2a7;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=174-207/ | a53940ed18717ca4b49711f0019405deec35c7c3 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/Queue.ts | Queue::unshiftRequest | function | /**
* Stores the passed request in IndexedDB (with its timestamp and any
* metadata) at the beginning of the queue.
*
* @param {QueueEntry} entry
* @param {Request} entry.request The request to store in the queue.
* @param {Object} [entry.metadata] Any metadata you want associated with the
* st... |
1,285,059 | 22226eaa768af2d4ed576d00d1859006 | swh:1:cnt:4e05183964897d5d84e5159323c19c51c2d8e2a7;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=220-229/ | a53940ed18717ca4b49711f0019405deec35c7c3 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/Queue.ts | Queue::shiftRequest | function | /**
* Removes and returns the first request in the queue (along with its
* timestamp and any metadata). The returned object takes the form:
* `{request, timestamp, metadata}`.
*
* @return {Promise<QueueEntry | undefined>}
*/
async shiftRequest(): Promise<QueueEntry | undefined> {
return this._re... |
1,285,060 | 4f4dd570d05da72c0f352ebfedadc361 | swh:1:cnt:4e05183964897d5d84e5159323c19c51c2d8e2a7;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=231-254/ | a53940ed18717ca4b49711f0019405deec35c7c3 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/Queue.ts | Queue::getAll | function | /**
* Returns all the entries that have not expired (per `maxRetentionTime`).
* Any expired entries are removed from the queue.
*
* @return {Promise<Array<QueueEntry>>}
*/
async getAll(): Promise<Array<QueueEntry>> {
const allEntries = await this._queueStore.getAll();
const now = Date.now();
... |
1,285,061 | c0e6002d834b6de1cf0f0977ac3293ea | swh:1:cnt:4e05183964897d5d84e5159323c19c51c2d8e2a7;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=256-264/ | a53940ed18717ca4b49711f0019405deec35c7c3 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/Queue.ts | Queue::size | function | /**
* Returns the number of entries present in the queue.
* Note that expired entries (per `maxRetentionTime`) are also included in this count.
*
* @return {Promise<number>}
*/
async size(): Promise<number> {
return await this._queueStore.size();
} |
1,285,062 | 77fb56b6fdaa787e1c9e3f2787b8329f | swh:1:cnt:4e05183964897d5d84e5159323c19c51c2d8e2a7;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=266-315/ | a53940ed18717ca4b49711f0019405deec35c7c3 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/Queue.ts | Queue::_addRequest | function | /**
* Adds the entry to the QueueStore and registers for a sync event.
*
* @param {Object} entry
* @param {Request} entry.request
* @param {Object} [entry.metadata]
* @param {number} [entry.timestamp=Date.now()]
* @param {string} operation ('push' or 'unshift')
* @private
*/
async _addReque... |
1,285,063 | 2958723cffdf47dc56394c94676bb4b3 | swh:1:cnt:4e05183964897d5d84e5159323c19c51c2d8e2a7;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=317-351/ | a53940ed18717ca4b49711f0019405deec35c7c3 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/Queue.ts | Queue::_removeRequest | function | /**
* Removes and returns the first or last (depending on `operation`) entry
* from the QueueStore that's not older than the `maxRetentionTime`.
*
* @param {string} operation ('pop' or 'shift')
* @return {Object|undefined}
* @private
*/
async _removeRequest(
operation: 'pop' | 'shift',
): P... |
1,285,064 | b37b8c822fe3018f56e8f5fc534e885a | swh:1:cnt:4e05183964897d5d84e5159323c19c51c2d8e2a7;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=474-484/ | a53940ed18717ca4b49711f0019405deec35c7c3 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/Queue.ts | Queue::_queueNames | function | /**
* Returns the set of queue names. This is primarily used to reset the list
* of queue names in tests.
*
* @return {Set<string>}
*
* @private
*/
static get _queueNames(): Set<string> {
return queueNames;
} |
1,285,065 | 9289fd09758c435aebe8d58bbe60dd8c | swh:1:cnt:4e05183964897d5d84e5159323c19c51c2d8e2a7;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=390-409/ | a53940ed18717ca4b49711f0019405deec35c7c3 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/Queue.ts | Queue::registerSync | function | /**
* Registers a sync event with a tag unique to this instance.
*/
async registerSync(): Promise<void> {
// See https://github.com/GoogleChrome/workbox/issues/2393
if ('sync' in self.registration && !this._forceSyncFallback) {
try {
await self.registration.sync.register(`${TAG_PREFIX}:${t... |
1,285,066 | 7932fe423c79cec867b0c54e5af79d5c | swh:1:cnt:4e05183964897d5d84e5159323c19c51c2d8e2a7;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=353-388/ | a53940ed18717ca4b49711f0019405deec35c7c3 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/Queue.ts | Queue::replayRequests | function | /**
* Loops through each request in the queue and attempts to re-fetch it.
* If any request fails to re-fetch, it's put back in the same position in
* the queue (which registers a retry for the next sync event).
*/
async replayRequests(): Promise<void> {
let entry;
while ((entry = await this.shift... |
1,285,067 | b1a51c2edb440f4662f3fc607259a6aa | swh:1:cnt:4e05183964897d5d84e5159323c19c51c2d8e2a7;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=411-472/ | a53940ed18717ca4b49711f0019405deec35c7c3 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/Queue.ts | Queue::_addSyncListener | function | /**
* In sync-supporting browsers, this adds a listener for the sync event.
* In non-sync-supporting browsers, or if _forceSyncFallback is true, this
* will retry the queue on service worker startup.
*
* @private
*/
private _addSyncListener() {
// See https://github.com/GoogleChrome/workbox/issu... |
1,285,068 | cb685669f97da83f0fcf043914cefe88 | swh:1:cnt:a017f9db4863c10f8b55b6eb5f3dde90af73251f;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=13-19/ | fa4f9ece5efc85bfba3521d75bd61ebad9311619 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/QueueDb.ts | QueueDBSchema | type | interface QueueDBSchema extends DBSchema {
requests: {
key: number;
value: QueueStoreEntry;
indexes: {queueName: string};
};
} |
1,285,069 | fe8dd15ffe895f37ae9b821eabaee17b | swh:1:cnt:a017f9db4863c10f8b55b6eb5f3dde90af73251f;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=49-200/ | fa4f9ece5efc85bfba3521d75bd61ebad9311619 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/QueueDb.ts | QueueDb | type | class QueueDb {
private _db: IDBPDatabase<QueueDBSchema> | null = null;
/**
* Add QueueStoreEntry to underlying db.
*
* @param {UnidentifiedQueueStoreEntry} entry
*/
async addEntry(entry: UnidentifiedQueueStoreEntry): Promise<void> {
const db = await this.getDb();
const tx = db.transaction(RE... |
1,285,070 | 5a91e9a74e7bcff55939ef0ade01ba78 | swh:1:cnt:a017f9db4863c10f8b55b6eb5f3dde90af73251f;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=26-35/ | fa4f9ece5efc85bfba3521d75bd61ebad9311619 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/QueueDb.ts | UnidentifiedQueueStoreEntry | type | interface UnidentifiedQueueStoreEntry {
requestData: RequestData;
timestamp: number;
id?: number;
queueName?: string;
// We could use Record<string, unknown> as a type but that would be a breaking
// change, better do it in next major release.
// eslint-disable-next-line @typescript-eslint/ban-types
me... |
1,285,071 | 744758aa5e400bb33d85204c704c6fe7 | swh:1:cnt:a017f9db4863c10f8b55b6eb5f3dde90af73251f;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=37-39/ | fa4f9ece5efc85bfba3521d75bd61ebad9311619 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/QueueDb.ts | QueueStoreEntry | type | interface QueueStoreEntry extends UnidentifiedQueueStoreEntry {
id: number;
} |
1,285,072 | 9a50cc9e725b62123bc255bfc30b9257 | swh:1:cnt:a017f9db4863c10f8b55b6eb5f3dde90af73251f;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=52-64/ | fa4f9ece5efc85bfba3521d75bd61ebad9311619 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/QueueDb.ts | QueueDb::addEntry | function | /**
* Add QueueStoreEntry to underlying db.
*
* @param {UnidentifiedQueueStoreEntry} entry
*/
async addEntry(entry: UnidentifiedQueueStoreEntry): Promise<void> {
const db = await this.getDb();
const tx = db.transaction(REQUEST_OBJECT_STORE_NAME, 'readwrite', {
durability: 'relaxed',
});
... |
1,285,073 | f72b6f07eeaa3d6eb0e29188db88b560 | swh:1:cnt:a017f9db4863c10f8b55b6eb5f3dde90af73251f;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=66-77/ | fa4f9ece5efc85bfba3521d75bd61ebad9311619 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/QueueDb.ts | QueueDb::getFirstEntryId | function | /**
* Returns the first entry id in the ObjectStore.
*
* @return {number | undefined}
*/
async getFirstEntryId(): Promise<number | undefined> {
const db = await this.getDb();
const cursor = await db
.transaction(REQUEST_OBJECT_STORE_NAME)
.store.openCursor();
return cursor?.value.i... |
1,285,074 | 08171418c7e84a8abee57b49274181c0 | swh:1:cnt:a017f9db4863c10f8b55b6eb5f3dde90af73251f;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=79-95/ | fa4f9ece5efc85bfba3521d75bd61ebad9311619 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/QueueDb.ts | QueueDb::getAllEntriesByQueueName | function | /**
* Get all the entries filtered by index
*
* @param queueName
* @return {Promise<QueueStoreEntry[]>}
*/
async getAllEntriesByQueueName(
queueName: string,
): Promise<QueueStoreEntry[]> {
const db = await this.getDb();
const results = await db.getAllFromIndex(
REQUEST_OBJECT_STORE... |
1,285,075 | 27d78ec68b84b6ca0fbb40b2a893039f | swh:1:cnt:a017f9db4863c10f8b55b6eb5f3dde90af73251f;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=97-110/ | fa4f9ece5efc85bfba3521d75bd61ebad9311619 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/QueueDb.ts | QueueDb::getEntryCountByQueueName | function | /**
* Returns the number of entries filtered by index
*
* @param queueName
* @return {Promise<number>}
*/
async getEntryCountByQueueName(queueName: string): Promise<number> {
const db = await this.getDb();
return db.countFromIndex(
REQUEST_OBJECT_STORE_NAME,
QUEUE_NAME_INDEX,
... |
1,285,076 | 5db64f7b79b1c7f76a56fe889e2bf189 | swh:1:cnt:a017f9db4863c10f8b55b6eb5f3dde90af73251f;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=112-120/ | fa4f9ece5efc85bfba3521d75bd61ebad9311619 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/QueueDb.ts | QueueDb::deleteEntry | function | /**
* Deletes a single entry by id.
*
* @param {number} id the id of the entry to be deleted
*/
async deleteEntry(id: number): Promise<void> {
const db = await this.getDb();
await db.delete(REQUEST_OBJECT_STORE_NAME, id);
} |
1,285,077 | fdeda170ad3b33d756680ff77f81e7e0 | swh:1:cnt:a017f9db4863c10f8b55b6eb5f3dde90af73251f;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=122-131/ | fa4f9ece5efc85bfba3521d75bd61ebad9311619 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/QueueDb.ts | QueueDb::getFirstEntryByQueueName | function | /**
*
* @param queueName
* @returns {Promise<QueueStoreEntry | undefined>}
*/
async getFirstEntryByQueueName(
queueName: string,
): Promise<QueueStoreEntry | undefined> {
return await this.getEndEntryFromIndex(IDBKeyRange.only(queueName), 'next');
} |
1,285,078 | ad3ed24e978cdf2f626f7ca6e5ba2088 | swh:1:cnt:a017f9db4863c10f8b55b6eb5f3dde90af73251f;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=133-142/ | fa4f9ece5efc85bfba3521d75bd61ebad9311619 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/QueueDb.ts | QueueDb::getLastEntryByQueueName | function | /**
*
* @param queueName
* @returns {Promise<QueueStoreEntry | undefined>}
*/
async getLastEntryByQueueName(
queueName: string,
): Promise<QueueStoreEntry | undefined> {
return await this.getEndEntryFromIndex(IDBKeyRange.only(queueName), 'prev');
} |
1,285,079 | 7fb3da3a9fa7d55c7b44a8ed8f0cf324 | swh:1:cnt:a017f9db4863c10f8b55b6eb5f3dde90af73251f;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=144-164/ | fa4f9ece5efc85bfba3521d75bd61ebad9311619 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/QueueDb.ts | QueueDb::getEndEntryFromIndex | function | /**
* Returns either the first or the last entries, depending on direction.
* Filtered by index.
*
* @param {IDBCursorDirection} direction
* @param {IDBKeyRange} query
* @return {Promise<QueueStoreEntry | undefined>}
* @private
*/
async getEndEntryFromIndex(
query: IDBKeyRange,
directi... |
1,285,080 | 914112b2bdbb35f7d73ca656246dea69 | swh:1:cnt:a017f9db4863c10f8b55b6eb5f3dde90af73251f;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=166-178/ | fa4f9ece5efc85bfba3521d75bd61ebad9311619 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/QueueDb.ts | QueueDb::getDb | function | /**
* Returns an open connection to the database.
*
* @private
*/
private async getDb() {
if (!this._db) {
this._db = await openDB(DB_NAME, DB_VERSION, {
upgrade: this._upgradeDb,
});
}
return this._db;
} |
1,285,081 | 1ec097891d7cb36ded0e166ca609e7db | swh:1:cnt:a017f9db4863c10f8b55b6eb5f3dde90af73251f;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=180-199/ | fa4f9ece5efc85bfba3521d75bd61ebad9311619 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/QueueDb.ts | QueueDb::_upgradeDb | function | /**
* Upgrades QueueDB
*
* @param {IDBPDatabase<QueueDBSchema>} db
* @param {number} oldVersion
* @private
*/
private _upgradeDb(db: IDBPDatabase<QueueDBSchema>, oldVersion: number) {
if (oldVersion > 0 && oldVersion < DB_VERSION) {
if (db.objectStoreNames.contains(REQUEST_OBJECT_STORE_NAM... |
1,285,082 | 990c2824b28850f0be14cdf9253f10b1 | swh:1:cnt:67461e3ee253a7ae6c142ffae4dd3494bd50405c;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=24-179/ | 2dd4cb32751b6ffef657d4722a784f6715f3163f | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/QueueStore.ts | QueueStore | type | class QueueStore {
private readonly _queueName: string;
private readonly _queueDb: QueueDb;
/**
* Associates this instance with a Queue instance, so entries added can be
* identified by their queue name.
*
* @param {string} queueName
*/
constructor(queueName: string) {
this._queueName = queu... |
1,285,083 | 5d961b0a6a82ee397ad3cc2e50414c8b | swh:1:cnt:67461e3ee253a7ae6c142ffae4dd3494bd50405c;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=28-37/ | 2dd4cb32751b6ffef657d4722a784f6715f3163f | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/QueueStore.ts | QueueStore::constructor | function | /**
* Associates this instance with a Queue instance, so entries added can be
* identified by their queue name.
*
* @param {string} queueName
*/
constructor(queueName: string) {
this._queueName = queueName;
this._queueDb = new QueueDb();
} |
1,285,084 | de29df5871bb1b9cfa26996cbe2542f5 | swh:1:cnt:67461e3ee253a7ae6c142ffae4dd3494bd50405c;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=119-128/ | 2dd4cb32751b6ffef657d4722a784f6715f3163f | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/QueueStore.ts | QueueStore::shiftEntry | function | /**
* Removes and returns the first entry in the queue matching the `queueName`.
*
* @return {Promise<QueueStoreEntry|undefined>}
*/
async shiftEntry(): Promise<QueueStoreEntry | undefined> {
return this._removeEntry(
await this._queueDb.getFirstEntryByQueueName(this._queueName),
);
} |
1,285,085 | 8444f8ecbd996d139b19af76c842764f | swh:1:cnt:67461e3ee253a7ae6c142ffae4dd3494bd50405c;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=39-68/ | 2dd4cb32751b6ffef657d4722a784f6715f3163f | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/QueueStore.ts | QueueStore::pushEntry | function | /**
* Append an entry last in the queue.
*
* @param {Object} entry
* @param {Object} entry.requestData
* @param {number} [entry.timestamp]
* @param {Object} [entry.metadata]
*/
async pushEntry(entry: UnidentifiedQueueStoreEntry): Promise<void> {
if (process.env.NODE_ENV !== 'production') {
... |
1,285,086 | 5c09cd4f397da91abddb29e897c5e280 | swh:1:cnt:67461e3ee253a7ae6c142ffae4dd3494bd50405c;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=70-106/ | 2dd4cb32751b6ffef657d4722a784f6715f3163f | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/QueueStore.ts | QueueStore::unshiftEntry | function | /**
* Prepend an entry first in the queue.
*
* @param {Object} entry
* @param {Object} entry.requestData
* @param {number} [entry.timestamp]
* @param {Object} [entry.metadata]
*/
async unshiftEntry(entry: UnidentifiedQueueStoreEntry): Promise<void> {
if (process.env.NODE_ENV !== 'production')... |
1,285,087 | 913946e739b1fea906f2845b7733e21a | swh:1:cnt:67461e3ee253a7ae6c142ffae4dd3494bd50405c;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=108-117/ | 2dd4cb32751b6ffef657d4722a784f6715f3163f | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/QueueStore.ts | QueueStore::popEntry | function | /**
* Removes and returns the last entry in the queue matching the `queueName`.
*
* @return {Promise<QueueStoreEntry|undefined>}
*/
async popEntry(): Promise<QueueStoreEntry | undefined> {
return this._removeEntry(
await this._queueDb.getLastEntryByQueueName(this._queueName),
);
} |
1,285,088 | c53f8e74488080bb8f51daace99d48c3 | swh:1:cnt:67461e3ee253a7ae6c142ffae4dd3494bd50405c;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=130-138/ | 2dd4cb32751b6ffef657d4722a784f6715f3163f | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/QueueStore.ts | QueueStore::getAll | function | /**
* Returns all entries in the store matching the `queueName`.
*
* @param {Object} options See {@link workbox-background-sync.Queue~getAll}
* @return {Promise<Array<Object>>}
*/
async getAll(): Promise<QueueStoreEntry[]> {
return await this._queueDb.getAllEntriesByQueueName(this._queueName);
} |
1,285,089 | c73a5dcfca771b208f84d4281989b685 | swh:1:cnt:67461e3ee253a7ae6c142ffae4dd3494bd50405c;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=140-148/ | 2dd4cb32751b6ffef657d4722a784f6715f3163f | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/QueueStore.ts | QueueStore::size | function | /**
* Returns the number of entries in the store matching the `queueName`.
*
* @param {Object} options See {@link workbox-background-sync.Queue~size}
* @return {Promise<number>}
*/
async size(): Promise<number> {
return await this._queueDb.getEntryCountByQueueName(this._queueName);
} |
1,285,090 | d62edd50cc92334ecd516ad769d094bc | swh:1:cnt:67461e3ee253a7ae6c142ffae4dd3494bd50405c;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=150-162/ | 2dd4cb32751b6ffef657d4722a784f6715f3163f | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/QueueStore.ts | QueueStore::deleteEntry | function | /**
* Deletes the entry for the given ID.
*
* WARNING: this method does not ensure the deleted entry belongs to this
* queue (i.e. matches the `queueName`). But this limitation is acceptable
* as this class is not publicly exposed. An additional check would make
* this method slower than it needs to b... |
1,285,091 | ac26b3380a8b98fbb9fa457df6fcb7dc | swh:1:cnt:67461e3ee253a7ae6c142ffae4dd3494bd50405c;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=164-178/ | 2dd4cb32751b6ffef657d4722a784f6715f3163f | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/QueueStore.ts | QueueStore::_removeEntry | function | /**
* Removes and returns the first or last entry in the queue (based on the
* `direction` argument) matching the `queueName`.
*
* @return {Promise<QueueStoreEntry|undefined>}
* @private
*/
async _removeEntry(
entry?: QueueStoreEntry,
): Promise<QueueStoreEntry | undefined> {
if (entry) {
... |
1,285,092 | af71c5a6adfcb52b412101bc31a3f151 | swh:1:cnt:f28d6aef62f241ad3f2846dff6d5436d6fb77744;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=13-22/ | d7c11f8dc24b6b64edca212464948a1828602421 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/StorableRequest.ts | SerializableProperties | type | type SerializableProperties =
| 'method'
| 'referrer'
| 'referrerPolicy'
| 'mode'
| 'credentials'
| 'cache'
| 'redirect'
| 'integrity'
| 'keepalive'; |
1,285,093 | 4b9bea05d6a5dad32f7e1d88bba433eb | swh:1:cnt:f28d6aef62f241ad3f2846dff6d5436d6fb77744;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=42-154/ | d7c11f8dc24b6b64edca212464948a1828602421 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/StorableRequest.ts | StorableRequest | type | /**
* A class to make it easier to serialize and de-serialize requests so they
* can be stored in IndexedDB.
*
* Most developers will not need to access this class directly;
* it is exposed for advanced use cases.
*/
class StorableRequest {
private readonly _requestData: RequestData;
/**
* Converts a Requ... |
1,285,094 | f825cd3d391239e1787b6675b961a5c3 | swh:1:cnt:f28d6aef62f241ad3f2846dff6d5436d6fb77744;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=36-40/ | d7c11f8dc24b6b64edca212464948a1828602421 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/StorableRequest.ts | RequestData | type | interface RequestData extends MapLikeObject {
url: string;
headers: MapLikeObject;
body?: ArrayBuffer;
} |
1,285,095 | c114f91ad5c419df059fb76ff54491aa | swh:1:cnt:f28d6aef62f241ad3f2846dff6d5436d6fb77744;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=52-87/ | d7c11f8dc24b6b64edca212464948a1828602421 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/StorableRequest.ts | StorableRequest::fromRequest | function | /**
* Converts a Request object to a plain object that can be structured
* cloned or JSON-stringified.
*
* @param {Request} request
* @return {Promise<StorableRequest>}
*/
static async fromRequest(request: Request): Promise<StorableRequest> {
const requestData: RequestData = {
url: request... |
1,285,096 | 11f851a9489c0aa98ef75e83dec3fd8a | swh:1:cnt:f28d6aef62f241ad3f2846dff6d5436d6fb77744;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=146-153/ | d7c11f8dc24b6b64edca212464948a1828602421 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/StorableRequest.ts | StorableRequest::clone | function | /**
* Creates and returns a deep clone of the instance.
*
* @return {StorableRequest}
*/
clone(): StorableRequest {
return new StorableRequest(this.toObject());
} |
1,285,097 | ea28f8e0129fa992b5510ce1270b1e13 | swh:1:cnt:f28d6aef62f241ad3f2846dff6d5436d6fb77744;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=122-135/ | d7c11f8dc24b6b64edca212464948a1828602421 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/StorableRequest.ts | StorableRequest::toObject | function | /**
* Returns a deep clone of the instances `_requestData` object.
*
* @return {Object}
*/
toObject(): RequestData {
const requestData = Object.assign({}, this._requestData);
requestData.headers = Object.assign({}, this._requestData.headers);
if (requestData.body) {
requestData.body = re... |
1,285,098 | 413e9510006ee1409375e16945d240de | swh:1:cnt:f28d6aef62f241ad3f2846dff6d5436d6fb77744;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=89-120/ | d7c11f8dc24b6b64edca212464948a1828602421 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/StorableRequest.ts | StorableRequest::constructor | function | /**
* Accepts an object of request data that can be used to construct a
* `Request` but can also be stored in IndexedDB.
*
* @param {Object} requestData An object of request data that includes the
* `url` plus any relevant properties of
* [requestInit]{@link https://fetch.spec.whatwg.org/#requ... |
1,285,099 | 89034949f9085f6de1b9447171aae0c0 | swh:1:cnt:f28d6aef62f241ad3f2846dff6d5436d6fb77744;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=137-144/ | d7c11f8dc24b6b64edca212464948a1828602421 | wlbdashboard | wmcs | node_modules/workbox-background-sync/src/lib/StorableRequest.ts | StorableRequest::toRequest | function | /**
* Converts this instance to a Request.
*
* @return {Request}
*/
toRequest(): Request {
return new Request(this._requestData.url, this._requestData);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.