@toxplanet/pegasus-sdk 1.0.2 → 1.1.1
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/index.js +43 -43
- package/lib/chemicals.js +293 -293
- package/lib/connection.js +223 -223
- package/lib/documents.js +94 -94
- package/lib/search.js +336 -336
- package/lib/sync.js +43 -43
- package/lib/utils.js +49 -49
- package/package.json +48 -48
package/lib/sync.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
class SyncService {
|
|
2
|
-
constructor(connection) {
|
|
3
|
-
this.connection = connection;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
async syncBatch(batchSize) {}
|
|
7
|
-
|
|
8
|
-
async syncAll() {}
|
|
9
|
-
|
|
10
|
-
async syncContinuous(intervalMs) {}
|
|
11
|
-
|
|
12
|
-
async stopContinuousSync() {}
|
|
13
|
-
|
|
14
|
-
async getPendingCount() {}
|
|
15
|
-
|
|
16
|
-
async getOldestPending() {}
|
|
17
|
-
|
|
18
|
-
async getSyncLag() {}
|
|
19
|
-
|
|
20
|
-
async getFailedEntries(minRetryCount) {}
|
|
21
|
-
|
|
22
|
-
async retryFailed(outboxId) {}
|
|
23
|
-
|
|
24
|
-
async retryAllFailed() {}
|
|
25
|
-
|
|
26
|
-
async markAsProcessed(outboxId) {}
|
|
27
|
-
|
|
28
|
-
async deleteProcessedOlderThan(days) {}
|
|
29
|
-
|
|
30
|
-
async cleanupOutbox(daysToKeep) {}
|
|
31
|
-
|
|
32
|
-
async getSyncStats(timeWindowMinutes) {}
|
|
33
|
-
|
|
34
|
-
async getSyncThroughput() {}
|
|
35
|
-
|
|
36
|
-
async verifySync(chemicalId) {}
|
|
37
|
-
|
|
38
|
-
async forceResync(chemicalId) {}
|
|
39
|
-
|
|
40
|
-
async getOutboxHealth() {}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
module.exports = SyncService;
|
|
1
|
+
class SyncService {
|
|
2
|
+
constructor(connection) {
|
|
3
|
+
this.connection = connection;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
async syncBatch(batchSize) {}
|
|
7
|
+
|
|
8
|
+
async syncAll() {}
|
|
9
|
+
|
|
10
|
+
async syncContinuous(intervalMs) {}
|
|
11
|
+
|
|
12
|
+
async stopContinuousSync() {}
|
|
13
|
+
|
|
14
|
+
async getPendingCount() {}
|
|
15
|
+
|
|
16
|
+
async getOldestPending() {}
|
|
17
|
+
|
|
18
|
+
async getSyncLag() {}
|
|
19
|
+
|
|
20
|
+
async getFailedEntries(minRetryCount) {}
|
|
21
|
+
|
|
22
|
+
async retryFailed(outboxId) {}
|
|
23
|
+
|
|
24
|
+
async retryAllFailed() {}
|
|
25
|
+
|
|
26
|
+
async markAsProcessed(outboxId) {}
|
|
27
|
+
|
|
28
|
+
async deleteProcessedOlderThan(days) {}
|
|
29
|
+
|
|
30
|
+
async cleanupOutbox(daysToKeep) {}
|
|
31
|
+
|
|
32
|
+
async getSyncStats(timeWindowMinutes) {}
|
|
33
|
+
|
|
34
|
+
async getSyncThroughput() {}
|
|
35
|
+
|
|
36
|
+
async verifySync(chemicalId) {}
|
|
37
|
+
|
|
38
|
+
async forceResync(chemicalId) {}
|
|
39
|
+
|
|
40
|
+
async getOutboxHealth() {}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
module.exports = SyncService;
|
package/lib/utils.js
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
class UtilsService {
|
|
2
|
-
constructor(connection) {
|
|
3
|
-
this.connection = connection;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
async executeBatch(operations, batchSize, concurrency) {}
|
|
7
|
-
|
|
8
|
-
async withTransaction(callback) {}
|
|
9
|
-
|
|
10
|
-
async withRetry(operation, maxRetries, backoffMs) {}
|
|
11
|
-
|
|
12
|
-
validateChemical(chemical) {}
|
|
13
|
-
|
|
14
|
-
validateDocument(document) {}
|
|
15
|
-
|
|
16
|
-
validateIdentifier(identifier) {}
|
|
17
|
-
|
|
18
|
-
validateCAS(casNumber) {}
|
|
19
|
-
|
|
20
|
-
transformForOpenSearch(chemical) {}
|
|
21
|
-
|
|
22
|
-
transformFromElasticsearch(esDocument) {}
|
|
23
|
-
|
|
24
|
-
transformFromDynamoDB(dynamoItem) {}
|
|
25
|
-
|
|
26
|
-
buildOpenSearchQuery(searchTerm, searchType) {}
|
|
27
|
-
|
|
28
|
-
buildPostgresFilter(filters) {}
|
|
29
|
-
|
|
30
|
-
parseChemicalIdentifiers(identifiers) {}
|
|
31
|
-
|
|
32
|
-
parseSynonyms(synonyms) {}
|
|
33
|
-
|
|
34
|
-
extractCASFromText(text) {}
|
|
35
|
-
|
|
36
|
-
sanitizeSearchTerm(term) {}
|
|
37
|
-
|
|
38
|
-
generateSourceId(chemical) {}
|
|
39
|
-
|
|
40
|
-
calculateChecksum(data) {}
|
|
41
|
-
|
|
42
|
-
formatError(error) {}
|
|
43
|
-
|
|
44
|
-
logOperation(operation, duration, metadata) {}
|
|
45
|
-
|
|
46
|
-
getTimestamp() {}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
module.exports = UtilsService;
|
|
1
|
+
class UtilsService {
|
|
2
|
+
constructor(connection) {
|
|
3
|
+
this.connection = connection;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
async executeBatch(operations, batchSize, concurrency) {}
|
|
7
|
+
|
|
8
|
+
async withTransaction(callback) {}
|
|
9
|
+
|
|
10
|
+
async withRetry(operation, maxRetries, backoffMs) {}
|
|
11
|
+
|
|
12
|
+
validateChemical(chemical) {}
|
|
13
|
+
|
|
14
|
+
validateDocument(document) {}
|
|
15
|
+
|
|
16
|
+
validateIdentifier(identifier) {}
|
|
17
|
+
|
|
18
|
+
validateCAS(casNumber) {}
|
|
19
|
+
|
|
20
|
+
transformForOpenSearch(chemical) {}
|
|
21
|
+
|
|
22
|
+
transformFromElasticsearch(esDocument) {}
|
|
23
|
+
|
|
24
|
+
transformFromDynamoDB(dynamoItem) {}
|
|
25
|
+
|
|
26
|
+
buildOpenSearchQuery(searchTerm, searchType) {}
|
|
27
|
+
|
|
28
|
+
buildPostgresFilter(filters) {}
|
|
29
|
+
|
|
30
|
+
parseChemicalIdentifiers(identifiers) {}
|
|
31
|
+
|
|
32
|
+
parseSynonyms(synonyms) {}
|
|
33
|
+
|
|
34
|
+
extractCASFromText(text) {}
|
|
35
|
+
|
|
36
|
+
sanitizeSearchTerm(term) {}
|
|
37
|
+
|
|
38
|
+
generateSourceId(chemical) {}
|
|
39
|
+
|
|
40
|
+
calculateChecksum(data) {}
|
|
41
|
+
|
|
42
|
+
formatError(error) {}
|
|
43
|
+
|
|
44
|
+
logOperation(operation, duration, metadata) {}
|
|
45
|
+
|
|
46
|
+
getTimestamp() {}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
module.exports = UtilsService;
|
package/package.json
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@toxplanet/pegasus-sdk",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "SDK for migrating chemical data to Pegasus PostgreSQL + OpenSearch architecture with Elasticsearch client compatibility",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"type": "commonjs",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"test": "vitest run",
|
|
9
|
-
"test:watch": "vitest",
|
|
10
|
-
"test:ui": "vitest --ui"
|
|
11
|
-
},
|
|
12
|
-
"keywords": [
|
|
13
|
-
"elasticsearch",
|
|
14
|
-
"opensearch",
|
|
15
|
-
"postgresql",
|
|
16
|
-
"aws",
|
|
17
|
-
"chemicals",
|
|
18
|
-
"database",
|
|
19
|
-
"search",
|
|
20
|
-
"sdk",
|
|
21
|
-
"pegasus",
|
|
22
|
-
"migration"
|
|
23
|
-
],
|
|
24
|
-
"author": "Chemical Research Development Team",
|
|
25
|
-
"license": "MIT",
|
|
26
|
-
"dependencies": {
|
|
27
|
-
"@toxplanet/tphelper": "1.2.8",
|
|
28
|
-
"pg": "^8.11.3",
|
|
29
|
-
"drizzle-orm": "^0.30.0",
|
|
30
|
-
"@opensearch-project/opensearch": "^2.5.0",
|
|
31
|
-
"@aws-sdk/client-secrets-manager": "^3.490.0",
|
|
32
|
-
"@aws-sdk/credential-providers": "^3.490.0"
|
|
33
|
-
},
|
|
34
|
-
"engines": {
|
|
35
|
-
"node": ">=18.0.0"
|
|
36
|
-
},
|
|
37
|
-
"files": [
|
|
38
|
-
"index.js",
|
|
39
|
-
"lib/",
|
|
40
|
-
"config/",
|
|
41
|
-
"README.md",
|
|
42
|
-
"ELASTICSEARCH_CLIENT.md",
|
|
43
|
-
"LICENSE"
|
|
44
|
-
],
|
|
45
|
-
"devDependencies": {
|
|
46
|
-
"vitest": "^1.2.0"
|
|
47
|
-
}
|
|
48
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@toxplanet/pegasus-sdk",
|
|
3
|
+
"version": "1.1.1",
|
|
4
|
+
"description": "SDK for migrating chemical data to Pegasus PostgreSQL + OpenSearch architecture with Elasticsearch client compatibility",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"type": "commonjs",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "vitest run",
|
|
9
|
+
"test:watch": "vitest",
|
|
10
|
+
"test:ui": "vitest --ui"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"elasticsearch",
|
|
14
|
+
"opensearch",
|
|
15
|
+
"postgresql",
|
|
16
|
+
"aws",
|
|
17
|
+
"chemicals",
|
|
18
|
+
"database",
|
|
19
|
+
"search",
|
|
20
|
+
"sdk",
|
|
21
|
+
"pegasus",
|
|
22
|
+
"migration"
|
|
23
|
+
],
|
|
24
|
+
"author": "Chemical Research Development Team",
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@toxplanet/tphelper": "1.2.8",
|
|
28
|
+
"pg": "^8.11.3",
|
|
29
|
+
"drizzle-orm": "^0.30.0",
|
|
30
|
+
"@opensearch-project/opensearch": "^2.5.0",
|
|
31
|
+
"@aws-sdk/client-secrets-manager": "^3.490.0",
|
|
32
|
+
"@aws-sdk/credential-providers": "^3.490.0"
|
|
33
|
+
},
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=18.0.0"
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"index.js",
|
|
39
|
+
"lib/",
|
|
40
|
+
"config/",
|
|
41
|
+
"README.md",
|
|
42
|
+
"ELASTICSEARCH_CLIENT.md",
|
|
43
|
+
"LICENSE"
|
|
44
|
+
],
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"vitest": "^1.2.0"
|
|
47
|
+
}
|
|
48
|
+
}
|