New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@mcma/data

Package Overview
Dependencies
Maintainers
3
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mcma/data - npm Package Compare versions

Comparing version 0.11.0 to 0.11.1

11

dist/lib/document-database/document-database-table-provider.d.ts
import { DocumentDatabaseTable } from "./document-database-table";
import { DocumentDatabaseTableConfig } from "./document-database-table-config";
import { Document } from "./document";
import { DocumentType } from "./document-type";
export interface DocumentDatabaseTableProvider {
configure<TDocument extends Document = Document, TPartitionKey = string, TSortKey = string>(type: DocumentType<TDocument>, config: DocumentDatabaseTableConfig<TDocument, TPartitionKey, TSortKey>): this;
get<TDocument extends Document = Document, TPartitionKey = string, TSortKey = string>(tableName: string, type: DocumentType<TDocument>): DocumentDatabaseTable<TDocument, TPartitionKey, TSortKey>;
get<TPartitionKey = string, TSortKey = string>(tableName: string): Promise<DocumentDatabaseTable<TPartitionKey, TSortKey>>;
}
export declare abstract class DocumentDatabaseTableProvider implements DocumentDatabaseTableProvider {
private configurations;
isConfigured<TDocument extends Document = Document>(type: DocumentType<TDocument>): boolean;
protected abstract getFromConfig<TDocument extends Document = Document, TPartitionKey = string, TSortKey = string>(tableName: string, type: DocumentType<TDocument>, config: DocumentDatabaseTableConfig<TDocument, TPartitionKey, TSortKey>): DocumentDatabaseTable<TDocument, TPartitionKey, TSortKey>;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@mcma/core");
class DocumentDatabaseTableProvider {
constructor() {
this.configurations = {};
}
isConfigured(type) {
return !!this.configurations[core_1.Utils.getTypeName(type)];
}
configure(type, config, overwriteIfExisting = false) {
const typeName = core_1.Utils.getTypeName(type);
if (this.configurations[typeName] && !overwriteIfExisting) {
throw new core_1.McmaException(`Document type ${typeName} has already been configured for this DocumentDatabaseTableProvider. If you would like overwrite the existing configuration, specify true for the optional overwriteIfExisting argument.`);
}
this.configurations[typeName] = config;
return this;
}
get(tableName, type) {
const typeName = core_1.Utils.getTypeName(type);
if (!this.configurations[typeName]) {
throw new core_1.McmaException(`Type '${typeName}' does not have a configured partition key and/or sort key.`);
}
return this.getFromConfig(tableName, type, this.configurations[typeName]);
}
}
exports.DocumentDatabaseTableProvider = DocumentDatabaseTableProvider;

11

dist/lib/document-database/document-database-table.d.ts
import { DocumentDatabaseQuery } from "./document-database-query";
import { Document } from "./document";
import { DocumentType } from "./document-type";
export declare abstract class DocumentDatabaseTable<TDocument extends Document = Document, TPartitionKey = string, TSortKey = string> {
protected type: string;
protected constructor(type: DocumentType<TDocument>);
abstract query(query: DocumentDatabaseQuery<TDocument, TPartitionKey, TSortKey>): Promise<TDocument[]>;
abstract get(partitionKey: TPartitionKey, sortKey: TSortKey): Promise<TDocument>;
abstract put(resource: TDocument): Promise<TDocument>;
export declare abstract class DocumentDatabaseTable<TPartitionKey = string, TSortKey = string> {
abstract query<TDocument extends Document = Document>(query: DocumentDatabaseQuery<TDocument, TPartitionKey, TSortKey>): Promise<TDocument[]>;
abstract get<TDocument extends Document = Document>(partitionKey: TPartitionKey, sortKey: TSortKey): Promise<TDocument>;
abstract put<TDocument extends Document = Document>(partitionKey: TPartitionKey, sortKey: TSortKey, resource: TDocument): Promise<TDocument>;
abstract delete(partitionKey: TPartitionKey, sortKey: TSortKey): Promise<void>;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@mcma/core");
class DocumentDatabaseTable {
constructor(type) {
this.type = core_1.Utils.getTypeName(type);
}
}
exports.DocumentDatabaseTable = DocumentDatabaseTable;

@@ -6,5 +6,4 @@ export * from "./document";

export * from "./document-database-table";
export * from "./document-database-table-config";
export * from "./document-database-table-provider";
export * from "./document-type";
export * from "./get-filter-expression-from-key-value-pairs";

@@ -9,4 +9,2 @@ "use strict";

__export(require("./document-database-table"));
__export(require("./document-database-table-config"));
__export(require("./document-database-table-provider"));
__export(require("./get-filter-expression-from-key-value-pairs"));
{
"name": "@mcma/data",
"version": "0.11.0",
"version": "0.11.1",
"description": "Node module with helper utils for dealing with data in the EBU MCMA framework",

@@ -32,6 +32,6 @@ "engines": {

"peerDependencies": {
"@mcma/core": "0.11.0"
"@mcma/core": "0.11.1"
},
"devDependencies": {
"@mcma/core": "0.11.0",
"@mcma/core": "0.11.1",
"@types/node": "^13.7.4",

@@ -38,0 +38,0 @@ "jasmine": "^3.3.1"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc