@qbcart/cosmos
Version:
Azure Cosmos DB access common across the QBCart node ecosystem.
25 lines (24 loc) • 1.1 kB
JavaScript
;
/***********************************************
* @license
* Copyright (c) QBCart Inc. All rights reserved.
************************************************/
Object.defineProperty(exports, "__esModule", { value: true });
const cosmos_1 = require("@azure/cosmos");
const customers_1 = require("./containers/customers");
const info_1 = require("./containers/info");
const line_items_1 = require("./containers/line-items");
const users_1 = require("./containers/users");
class Cosmos {
constructor(connectionString) {
if (!connectionString)
throw 'Missing connection string!';
this.client = new cosmos_1.CosmosClient(connectionString);
this.database = this.client.database('QBCart');
this.info = new info_1.default(this.database.container('Info'));
this.lineItems = new line_items_1.default(this.database.container('LineItems'));
this.customers = new customers_1.default(this.database.container('Customers'));
this.users = new users_1.default(this.database.container('Users'));
}
}
exports.default = Cosmos;