@mtcute/web 0.16.0 → 0.16.2

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/cjs/client.js CHANGED
@@ -33,6 +33,7 @@ class TelegramClient extends client_js_1.TelegramClient {
33
33
  }
34
34
  super({
35
35
  client: new BaseTelegramClient(opts),
36
+ disableUpdates: opts.disableUpdates,
36
37
  });
37
38
  }
38
39
  }
package/cjs/client.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";;;AACA,sDAK+B;AAC/B,0DAAsD;AAEtD,2CAA+C;AAC/C,6CAA2C;AAC3C,+CAA2C;AAC3C,iDAAmD;AAyBnD,MAAa,kBAAmB,SAAQ,8BAAsB;IAC1D,YAAY,IAA+B;QACvC,IAAI,CAAC,IAAI,CAAC,YAAY;YAAE,IAAA,yBAAW,EAAC,IAAI,yBAAW,EAAE,CAAC,CAAA;QAEtD,KAAK,CAAC;YACF,MAAM,EAAE,IAAI,6BAAiB,EAAE;YAC/B,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,iCAAkB,EAAE;YACzC,GAAG,IAAI;YACP,OAAO,EACH,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC;gBAC9B,IAAI,qBAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;gBAC9B,IAAI,CAAC,OAAO,IAAI,IAAI,qBAAU,CAAC,gBAAgB,CAAC;SAC3D,CAAC,CAAA;IACN,CAAC;CACJ;AAdD,gDAcC;AAED;;GAEG;AACH,MAAa,cAAe,SAAQ,0BAAkB;IAClD,YAAY,IAA2B;QACnC,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACnB,KAAK,CAAC,IAAI,CAAC,CAAA;YAEX,OAAM;QACV,CAAC;QAED,KAAK,CAAC;YACF,MAAM,EAAE,IAAI,kBAAkB,CAAC,IAAI,CAAC;SACvC,CAAC,CAAA;IACN,CAAC;CACJ;AAZD,wCAYC","sourcesContent":["import { ITelegramStorageProvider, PartialOnly } from '@mtcute/core'\nimport {\n BaseTelegramClient as BaseTelegramClientBase,\n BaseTelegramClientOptions as BaseTelegramClientOptionsBase,\n TelegramClient as TelegramClientBase,\n TelegramClientOptions,\n} from '@mtcute/core/client.js'\nimport { setPlatform } from '@mtcute/core/platform.js'\n\nimport { WebCryptoProvider } from './crypto.js'\nimport { IdbStorage } from './idb/index.js'\nimport { WebPlatform } from './platform.js'\nimport { WebSocketTransport } from './websocket.js'\n\nexport type { TelegramClientOptions }\n\nexport interface BaseTelegramClientOptions\n extends PartialOnly<Omit<BaseTelegramClientOptionsBase, 'storage'>, 'transport' | 'crypto'> {\n /**\n * Storage to use for this client.\n *\n * If a string is passed, it will be used as\n * a name for an IndexedDB database.\n *\n * @default `\"client.session\"`\n */\n storage?: string | ITelegramStorageProvider\n\n /**\n * **ADVANCED USE ONLY**\n *\n * Whether to not set up the platform.\n * This is useful if you call `setPlatform` yourself.\n */\n platformless?: boolean\n}\n\nexport class BaseTelegramClient extends BaseTelegramClientBase {\n constructor(opts: BaseTelegramClientOptions) {\n if (!opts.platformless) setPlatform(new WebPlatform())\n\n super({\n crypto: new WebCryptoProvider(),\n transport: () => new WebSocketTransport(),\n ...opts,\n storage:\n typeof opts.storage === 'string' ?\n new IdbStorage(opts.storage) :\n opts.storage ?? new IdbStorage('client.session'),\n })\n }\n}\n\n/**\n * Telegram client for use in Node.js\n */\nexport class TelegramClient extends TelegramClientBase {\n constructor(opts: TelegramClientOptions) {\n if ('client' in opts) {\n super(opts)\n\n return\n }\n\n super({\n client: new BaseTelegramClient(opts),\n })\n }\n}\n"]}
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";;;AACA,sDAK+B;AAC/B,0DAAsD;AAEtD,2CAA+C;AAC/C,6CAA2C;AAC3C,+CAA2C;AAC3C,iDAAmD;AAyBnD,MAAa,kBAAmB,SAAQ,8BAAsB;IAC1D,YAAY,IAA+B;QACvC,IAAI,CAAC,IAAI,CAAC,YAAY;YAAE,IAAA,yBAAW,EAAC,IAAI,yBAAW,EAAE,CAAC,CAAA;QAEtD,KAAK,CAAC;YACF,MAAM,EAAE,IAAI,6BAAiB,EAAE;YAC/B,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,iCAAkB,EAAE;YACzC,GAAG,IAAI;YACP,OAAO,EACH,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC;gBAC9B,IAAI,qBAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;gBAC9B,IAAI,CAAC,OAAO,IAAI,IAAI,qBAAU,CAAC,gBAAgB,CAAC;SAC3D,CAAC,CAAA;IACN,CAAC;CACJ;AAdD,gDAcC;AAED;;GAEG;AACH,MAAa,cAAe,SAAQ,0BAAkB;IAClD,YAAY,IAA2B;QACnC,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACnB,KAAK,CAAC,IAAI,CAAC,CAAA;YAEX,OAAM;QACV,CAAC;QAED,KAAK,CAAC;YACF,MAAM,EAAE,IAAI,kBAAkB,CAAC,IAAI,CAAC;YACpC,cAAc,EAAE,IAAI,CAAC,cAAc;SACtC,CAAC,CAAA;IACN,CAAC;CACJ;AAbD,wCAaC","sourcesContent":["import { ITelegramStorageProvider, PartialOnly } from '@mtcute/core'\nimport {\n BaseTelegramClient as BaseTelegramClientBase,\n BaseTelegramClientOptions as BaseTelegramClientOptionsBase,\n TelegramClient as TelegramClientBase,\n TelegramClientOptions,\n} from '@mtcute/core/client.js'\nimport { setPlatform } from '@mtcute/core/platform.js'\n\nimport { WebCryptoProvider } from './crypto.js'\nimport { IdbStorage } from './idb/index.js'\nimport { WebPlatform } from './platform.js'\nimport { WebSocketTransport } from './websocket.js'\n\nexport type { TelegramClientOptions }\n\nexport interface BaseTelegramClientOptions\n extends PartialOnly<Omit<BaseTelegramClientOptionsBase, 'storage'>, 'transport' | 'crypto'> {\n /**\n * Storage to use for this client.\n *\n * If a string is passed, it will be used as\n * a name for an IndexedDB database.\n *\n * @default `\"client.session\"`\n */\n storage?: string | ITelegramStorageProvider\n\n /**\n * **ADVANCED USE ONLY**\n *\n * Whether to not set up the platform.\n * This is useful if you call `setPlatform` yourself.\n */\n platformless?: boolean\n}\n\nexport class BaseTelegramClient extends BaseTelegramClientBase {\n constructor(opts: BaseTelegramClientOptions) {\n if (!opts.platformless) setPlatform(new WebPlatform())\n\n super({\n crypto: new WebCryptoProvider(),\n transport: () => new WebSocketTransport(),\n ...opts,\n storage:\n typeof opts.storage === 'string' ?\n new IdbStorage(opts.storage) :\n opts.storage ?? new IdbStorage('client.session'),\n })\n }\n}\n\n/**\n * Telegram client for use in Node.js\n */\nexport class TelegramClient extends TelegramClientBase {\n constructor(opts: TelegramClientOptions) {\n if ('client' in opts) {\n super(opts)\n\n return\n }\n\n super({\n client: new BaseTelegramClient(opts),\n disableUpdates: opts.disableUpdates,\n })\n }\n}\n"]}
package/esm/client.js CHANGED
@@ -29,6 +29,7 @@ export class TelegramClient extends TelegramClientBase {
29
29
  }
30
30
  super({
31
31
  client: new BaseTelegramClient(opts),
32
+ disableUpdates: opts.disableUpdates,
32
33
  });
33
34
  }
34
35
  }
package/esm/client.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AACA,OAAO,EACH,kBAAkB,IAAI,sBAAsB,EAE5C,cAAc,IAAI,kBAAkB,GAEvC,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAEtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAyBnD,MAAM,OAAO,kBAAmB,SAAQ,sBAAsB;IAC1D,YAAY,IAA+B;QACvC,IAAI,CAAC,IAAI,CAAC,YAAY;YAAE,WAAW,CAAC,IAAI,WAAW,EAAE,CAAC,CAAA;QAEtD,KAAK,CAAC;YACF,MAAM,EAAE,IAAI,iBAAiB,EAAE;YAC/B,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,kBAAkB,EAAE;YACzC,GAAG,IAAI;YACP,OAAO,EACH,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC;gBAC9B,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;gBAC9B,IAAI,CAAC,OAAO,IAAI,IAAI,UAAU,CAAC,gBAAgB,CAAC;SAC3D,CAAC,CAAA;IACN,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,kBAAkB;IAClD,YAAY,IAA2B;QACnC,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACnB,KAAK,CAAC,IAAI,CAAC,CAAA;YAEX,OAAM;QACV,CAAC;QAED,KAAK,CAAC;YACF,MAAM,EAAE,IAAI,kBAAkB,CAAC,IAAI,CAAC;SACvC,CAAC,CAAA;IACN,CAAC;CACJ","sourcesContent":["import { ITelegramStorageProvider, PartialOnly } from '@mtcute/core'\nimport {\n BaseTelegramClient as BaseTelegramClientBase,\n BaseTelegramClientOptions as BaseTelegramClientOptionsBase,\n TelegramClient as TelegramClientBase,\n TelegramClientOptions,\n} from '@mtcute/core/client.js'\nimport { setPlatform } from '@mtcute/core/platform.js'\n\nimport { WebCryptoProvider } from './crypto.js'\nimport { IdbStorage } from './idb/index.js'\nimport { WebPlatform } from './platform.js'\nimport { WebSocketTransport } from './websocket.js'\n\nexport type { TelegramClientOptions }\n\nexport interface BaseTelegramClientOptions\n extends PartialOnly<Omit<BaseTelegramClientOptionsBase, 'storage'>, 'transport' | 'crypto'> {\n /**\n * Storage to use for this client.\n *\n * If a string is passed, it will be used as\n * a name for an IndexedDB database.\n *\n * @default `\"client.session\"`\n */\n storage?: string | ITelegramStorageProvider\n\n /**\n * **ADVANCED USE ONLY**\n *\n * Whether to not set up the platform.\n * This is useful if you call `setPlatform` yourself.\n */\n platformless?: boolean\n}\n\nexport class BaseTelegramClient extends BaseTelegramClientBase {\n constructor(opts: BaseTelegramClientOptions) {\n if (!opts.platformless) setPlatform(new WebPlatform())\n\n super({\n crypto: new WebCryptoProvider(),\n transport: () => new WebSocketTransport(),\n ...opts,\n storage:\n typeof opts.storage === 'string' ?\n new IdbStorage(opts.storage) :\n opts.storage ?? new IdbStorage('client.session'),\n })\n }\n}\n\n/**\n * Telegram client for use in Node.js\n */\nexport class TelegramClient extends TelegramClientBase {\n constructor(opts: TelegramClientOptions) {\n if ('client' in opts) {\n super(opts)\n\n return\n }\n\n super({\n client: new BaseTelegramClient(opts),\n })\n }\n}\n"]}
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AACA,OAAO,EACH,kBAAkB,IAAI,sBAAsB,EAE5C,cAAc,IAAI,kBAAkB,GAEvC,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAEtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAyBnD,MAAM,OAAO,kBAAmB,SAAQ,sBAAsB;IAC1D,YAAY,IAA+B;QACvC,IAAI,CAAC,IAAI,CAAC,YAAY;YAAE,WAAW,CAAC,IAAI,WAAW,EAAE,CAAC,CAAA;QAEtD,KAAK,CAAC;YACF,MAAM,EAAE,IAAI,iBAAiB,EAAE;YAC/B,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,kBAAkB,EAAE;YACzC,GAAG,IAAI;YACP,OAAO,EACH,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC;gBAC9B,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;gBAC9B,IAAI,CAAC,OAAO,IAAI,IAAI,UAAU,CAAC,gBAAgB,CAAC;SAC3D,CAAC,CAAA;IACN,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,kBAAkB;IAClD,YAAY,IAA2B;QACnC,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACnB,KAAK,CAAC,IAAI,CAAC,CAAA;YAEX,OAAM;QACV,CAAC;QAED,KAAK,CAAC;YACF,MAAM,EAAE,IAAI,kBAAkB,CAAC,IAAI,CAAC;YACpC,cAAc,EAAE,IAAI,CAAC,cAAc;SACtC,CAAC,CAAA;IACN,CAAC;CACJ","sourcesContent":["import { ITelegramStorageProvider, PartialOnly } from '@mtcute/core'\nimport {\n BaseTelegramClient as BaseTelegramClientBase,\n BaseTelegramClientOptions as BaseTelegramClientOptionsBase,\n TelegramClient as TelegramClientBase,\n TelegramClientOptions,\n} from '@mtcute/core/client.js'\nimport { setPlatform } from '@mtcute/core/platform.js'\n\nimport { WebCryptoProvider } from './crypto.js'\nimport { IdbStorage } from './idb/index.js'\nimport { WebPlatform } from './platform.js'\nimport { WebSocketTransport } from './websocket.js'\n\nexport type { TelegramClientOptions }\n\nexport interface BaseTelegramClientOptions\n extends PartialOnly<Omit<BaseTelegramClientOptionsBase, 'storage'>, 'transport' | 'crypto'> {\n /**\n * Storage to use for this client.\n *\n * If a string is passed, it will be used as\n * a name for an IndexedDB database.\n *\n * @default `\"client.session\"`\n */\n storage?: string | ITelegramStorageProvider\n\n /**\n * **ADVANCED USE ONLY**\n *\n * Whether to not set up the platform.\n * This is useful if you call `setPlatform` yourself.\n */\n platformless?: boolean\n}\n\nexport class BaseTelegramClient extends BaseTelegramClientBase {\n constructor(opts: BaseTelegramClientOptions) {\n if (!opts.platformless) setPlatform(new WebPlatform())\n\n super({\n crypto: new WebCryptoProvider(),\n transport: () => new WebSocketTransport(),\n ...opts,\n storage:\n typeof opts.storage === 'string' ?\n new IdbStorage(opts.storage) :\n opts.storage ?? new IdbStorage('client.session'),\n })\n }\n}\n\n/**\n * Telegram client for use in Node.js\n */\nexport class TelegramClient extends TelegramClientBase {\n constructor(opts: TelegramClientOptions) {\n if ('client' in opts) {\n super(opts)\n\n return\n }\n\n super({\n client: new BaseTelegramClient(opts),\n disableUpdates: opts.disableUpdates,\n })\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mtcute/web",
3
- "version": "0.16.0",
3
+ "version": "0.16.2",
4
4
  "description": "Meta-package for the web platform",
5
5
  "author": "alina sireneva <alina@tei.su>",
6
6
  "license": "MIT",
@@ -18,7 +18,7 @@
18
18
  }
19
19
  },
20
20
  "dependencies": {
21
- "@mtcute/core": "^0.16.0",
21
+ "@mtcute/core": "^0.16.1",
22
22
  "@mtcute/wasm": "^0.16.0",
23
23
  "events": "3.2.0"
24
24
  },