@joystick.js/db-canary 0.0.0-canary.2255 → 0.0.0-canary.2256

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.
@@ -1 +1 @@
1
- const r=(c,t,e={})=>({admin_action:c,database:t,...e}),n=(c,t,e,s={})=>({admin_action:c,database:t,collection:e,...s}),a=async(c,t)=>c.send_request("admin",t);class _{constructor(t,e){this.client=t,this.database_name=e}collection(t){const e=this.client.constructor.Collection;return new e(this.client,this.database_name,t)}async list_collections(){const t=r("list_collections",this.database_name);return a(this.client,t)}async get_stats(){const t=r("get_database_stats",this.database_name);return a(this.client,t)}async drop_database(){const t=r("drop_database",this.database_name);return a(this.client,t)}async create_collection(t,e={}){const s=n("create_collection",this.database_name,t,{options:e});return a(this.client,s)}async list_documents(t){const e=n("list_documents",this.database_name,t);return a(this.client,e)}async get_document(t,e){const s=n("get_document",this.database_name,t,{document_id:e});return a(this.client,s)}async query_documents(t,e){const s=n("query_documents",this.database_name,t,{filter:e});return a(this.client,s)}async insert_document(t,e){const s=n("insert_document",this.database_name,t,{document:e});return a(this.client,s)}async update_document(t,e,s){const i=n("update_document",this.database_name,t,{document_id:e,update:s});return a(this.client,i)}async delete_document(t,e){const s=n("delete_document",this.database_name,t,{document_id:e});return a(this.client,s)}async stats(){return this.client.get_stats()}async ping(){return this.client.ping()}async backup_now(){return this.client.backup_now()}async list_backups(){return this.client.list_backups()}async restore_backup(t){return this.client.restore_backup(t)}async get_replication_status(){return this.client.get_replication_status()}async add_secondary(t){return this.client.add_secondary(t)}async remove_secondary(t){return this.client.remove_secondary(t)}async sync_secondaries(){return this.client.sync_secondaries()}async get_secondary_health(){return this.client.get_secondary_health()}async get_forwarder_status(){return this.client.get_forwarder_status()}async get_auto_index_stats(){return this.client.get_auto_index_stats()}async reload(){return this.client.reload()}}var o=_;export{o as default};
1
+ const r=(c,t,e={})=>({admin_action:c,database:t,...e}),n=(c,t,e,s={})=>({admin_action:c,database:t,collection:e,...s}),a=async(c,t)=>c.send_request("admin",t);class _{constructor(t,e){this.client=t,this.database_name=e}collection(t){const e=this.client.constructor.Collection;return new e(this.client,this.database_name,t)}async list_collections(){const t=r("list_collections",this.database_name);return a(this.client,t)}async get_stats(){const t=r("get_database_stats",this.database_name);return a(this.client,t)}async drop_database(){const t=r("drop_database",this.database_name);return a(this.client,t)}async create_collection(t,e={}){const s=n("create_collection",this.database_name,t,{options:e});return a(this.client,s)}async list_documents(t){const e=n("list_documents",this.database_name,t);return a(this.client,e)}async get_document(t,e){const s=n("get_document",this.database_name,t,{document_id:e});return a(this.client,s)}async query_documents(t,e){const s=n("query_documents",this.database_name,t,{filter:e});return a(this.client,s)}async insert_document(t,e){const s=n("insert_document",this.database_name,t,{document:e});return a(this.client,s)}async update_document(t,e,s){const i=n("update_document",this.database_name,t,{document_id:e,update:s});return a(this.client,i)}async delete_document(t,e){const s=n("delete_document",this.database_name,t,{document_id:e});return a(this.client,s)}async stats(){return this.client.send_request("admin",{admin_action:"stats"})}async ping(){return this.client.send_request("ping",{},!1)}async backup_now(){return this.client.backup_now()}async list_backups(){return this.client.list_backups()}async restore_backup(t){return this.client.restore_backup(t)}async get_replication_status(){return this.client.get_replication_status()}async add_secondary(t){return this.client.add_secondary(t)}async remove_secondary(t){return this.client.remove_secondary(t)}async sync_secondaries(){return this.client.sync_secondaries()}async get_secondary_health(){return this.client.get_secondary_health()}async get_forwarder_status(){return this.client.get_forwarder_status()}async get_auto_index_stats(){return this.client.get_auto_index_stats()}async reload(){return this.client.reload()}}var d=_;export{d as default};
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@joystick.js/db-canary",
3
3
  "type": "module",
4
- "version": "0.0.0-canary.2255",
5
- "canary_version": "0.0.0-canary.2254",
4
+ "version": "0.0.0-canary.2256",
5
+ "canary_version": "0.0.0-canary.2255",
6
6
  "description": "JoystickDB - A minimalist database server for the Joystick framework",
7
7
  "main": "./dist/server/index.js",
8
8
  "scripts": {
@@ -137,11 +137,11 @@ class Database {
137
137
 
138
138
  // NOTE: Admin method delegations to client
139
139
  async stats() {
140
- return this.client.get_stats();
140
+ return this.client.send_request('admin', { admin_action: 'stats' });
141
141
  }
142
142
 
143
143
  async ping() {
144
- return this.client.ping();
144
+ return this.client.send_request('ping', {}, false);
145
145
  }
146
146
 
147
147
  async backup_now() {