@qrvey/data-persistence
Advanced tools
Comparing version 0.0.3-Rev-1-ds-support-array to 0.0.3-Rev-1-ds-support-array-v2
@@ -18,4 +18,7 @@ "use strict"; | ||
constructor(crudSchema) { | ||
this.crudService = crudFactory_service_1.CrudFactory.databaseClientService(crudSchema); | ||
this.initializeCrudService(crudSchema); | ||
} | ||
async initializeCrudService(crudSchema) { | ||
this.crudService = await crudFactory_service_1.CrudFactory.databaseClientService(crudSchema); | ||
} | ||
create(entity) { | ||
@@ -22,0 +25,0 @@ return this.crudService.create(entity); |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CrudFactory = void 0; | ||
class CrudFactory { | ||
static databaseClientService(crudSchema) { | ||
static async databaseClientService(crudSchema) { | ||
var _a; | ||
const isMultiPlatformMode = ((_a = process.env.PLATFORM_TYPE) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'container'; | ||
const DatabaseCrudServiceImport = isMultiPlatformMode | ||
? require('./cruds').PostgreSqlCrudService | ||
: require('./cruds').DynamoDbCrudService; | ||
const DatabaseCrudService = DatabaseCrudServiceImport; | ||
let DatabaseCrudService; | ||
if (isMultiPlatformMode) { | ||
const { PostgreSqlCrudService } = await Promise.resolve().then(() => __importStar(require('./cruds'))); | ||
DatabaseCrudService = PostgreSqlCrudService; | ||
} | ||
else { | ||
const { DynamoDbCrudService } = await Promise.resolve().then(() => __importStar(require('./cruds'))); | ||
DatabaseCrudService = DynamoDbCrudService; | ||
} | ||
return new DatabaseCrudService(crudSchema); | ||
@@ -13,0 +41,0 @@ } |
@@ -105,2 +105,3 @@ type FilterInput = string | IFilter[] | ICompoundFilter[] | ICompoundFilter; | ||
constructor(crudSchema: typeof CrudSchema); | ||
private initializeCrudService; | ||
create(entity: T): Promise<T>; | ||
@@ -107,0 +108,0 @@ find(options: IFindOptions): Promise<IFindResult<T>>; |
@@ -5,3 +5,3 @@ { | ||
"main": "dist/cjs/index.js", | ||
"version": "0.0.3-Rev-1-ds-support-array", | ||
"version": "0.0.3-Rev-1-ds-support-array-v2", | ||
"license": "MIT", | ||
@@ -70,6 +70,3 @@ "exports": { | ||
"dist/*" | ||
], | ||
"dependencies": { | ||
"q-id-generator": "1.4.0" | ||
} | ||
] | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
100873
4
83
1370
5
- Removedq-id-generator@1.4.0
- Removednanoid@3.3.4(transitive)
- Removedq-id-generator@1.4.0(transitive)