ofpos-shared-core 1.1.0 → 2.0.0-alpha.0
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/dist/IntegrationServices.d.ts +0 -4
- package/dist/PosCore.d.ts +46 -1
- package/dist/data/schema.d.ts +1 -3
- package/dist/finance/offinanceProjection.d.ts +37 -0
- package/dist/index.browser.mjs +4 -4
- package/dist/index.cjs.js +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.esm.js +4 -4
- package/dist/index.umd.js +4 -4
- package/dist/integration/NotificationAdapter.d.ts +6 -67
- package/dist/integration/authorizationService.d.ts +2 -19
- package/dist/integration/changeQueuePort.d.ts +5 -0
- package/dist/integration/loggerAdapter.d.ts +6 -43
- package/dist/integration/socket.d.ts +13 -0
- package/dist/integration/userService.d.ts +17 -32
- package/dist/models/User.d.ts +0 -6
- package/dist/services/bomService.d.ts +1 -1
- package/dist/services/categoryService.d.ts +1 -1
- package/dist/services/customerGroupService.d.ts +1 -1
- package/dist/services/customerService.d.ts +1 -1
- package/dist/services/expenseService.d.ts +1 -1
- package/dist/services/exportAdapter.d.ts +6 -46
- package/dist/services/financialSettingService.d.ts +1 -1
- package/dist/services/historyService.d.ts +1 -1
- package/dist/services/inventoryLogService.d.ts +2 -1
- package/dist/services/inventoryService.d.ts +7 -1
- package/dist/services/orderItemService.d.ts +1 -1
- package/dist/services/orderService.d.ts +1 -1
- package/dist/services/payableService.d.ts +1 -1
- package/dist/services/priceHistoryService.d.ts +1 -1
- package/dist/services/priceTierService.d.ts +1 -1
- package/dist/services/productService.d.ts +1 -1
- package/dist/services/promotionService.d.ts +1 -1
- package/dist/services/purchaseItemService.d.ts +1 -1
- package/dist/services/purchaseOrderItemService.d.ts +1 -1
- package/dist/services/purchaseOrderService.d.ts +1 -1
- package/dist/services/purchaseService.d.ts +3 -1
- package/dist/services/receivableService.d.ts +1 -1
- package/dist/services/reportScheduleService.d.ts +1 -1
- package/dist/services/reportingService.d.ts +1 -1
- package/dist/services/returnItemService.d.ts +1 -1
- package/dist/services/returnService.d.ts +1 -1
- package/dist/services/roleService.d.ts +1 -1
- package/dist/services/saleItemService.d.ts +1 -1
- package/dist/services/saleService.d.ts +2 -1
- package/dist/services/settlementService.d.ts +1 -1
- package/dist/services/shiftService.d.ts +1 -1
- package/dist/services/stockAdjustmentService.d.ts +1 -1
- package/dist/services/stockOpnameItemService.d.ts +1 -1
- package/dist/services/stockOpnameService.d.ts +1 -1
- package/dist/services/supplierService.d.ts +1 -1
- package/dist/services/taxRateService.d.ts +1 -1
- package/dist/services/transactionService.d.ts +1 -1
- package/dist/services/uiProductService.d.ts +0 -1
- package/dist/services/uomService.d.ts +1 -1
- package/dist/services/userService.d.ts +1 -1
- package/dist/stores/storageAdapter.d.ts +8 -39
- package/dist/stores/syncService.d.ts +16 -0
- package/package.json +27 -7
- package/dist/data/inMemoryDbAdapter.d.ts +0 -65
- package/dist/data/seed.d.ts +0 -370
- package/dist/integration/ofauthBridge.d.ts +0 -29
- package/dist/integration/ofauthCoreBridge.d.ts +0 -19
|
@@ -23,7 +23,7 @@ export interface IReceivableService {
|
|
|
23
23
|
export declare class ReceivableService implements IReceivableService {
|
|
24
24
|
private context;
|
|
25
25
|
private dbAdapter;
|
|
26
|
-
private
|
|
26
|
+
private changeQueue;
|
|
27
27
|
/**
|
|
28
28
|
* Initialize ReceivableService.
|
|
29
29
|
* @param context - PosCore context
|
|
@@ -23,7 +23,7 @@ export interface IReportScheduleService {
|
|
|
23
23
|
export declare class ReportScheduleService implements IReportScheduleService {
|
|
24
24
|
private context;
|
|
25
25
|
private dbAdapter;
|
|
26
|
-
private
|
|
26
|
+
private changeQueue;
|
|
27
27
|
/**
|
|
28
28
|
* Initialize ReportScheduleService.
|
|
29
29
|
* @param context - PosCore context
|
|
@@ -198,7 +198,7 @@ export declare class ReportingService implements IReportingService {
|
|
|
198
198
|
private dbAdapter;
|
|
199
199
|
/**
|
|
200
200
|
* Inisialisasi layanan pelaporan.
|
|
201
|
-
* @param context - instance PosCore yang berisi registry
|
|
201
|
+
* @param context - instance PosCore yang berisi registry runtime.
|
|
202
202
|
*/
|
|
203
203
|
constructor(context: PosCore);
|
|
204
204
|
/**
|
|
@@ -23,7 +23,7 @@ export interface IReturnItemService {
|
|
|
23
23
|
export declare class ReturnItemService implements IReturnItemService {
|
|
24
24
|
private context;
|
|
25
25
|
private dbAdapter;
|
|
26
|
-
private
|
|
26
|
+
private changeQueue;
|
|
27
27
|
/**
|
|
28
28
|
* Initialize ReturnItemService.
|
|
29
29
|
* @param context - PosCore context
|
|
@@ -73,7 +73,7 @@ export interface IReturnService {
|
|
|
73
73
|
export declare class ReturnService implements IReturnService {
|
|
74
74
|
private context;
|
|
75
75
|
private dbAdapter;
|
|
76
|
-
private
|
|
76
|
+
private changeQueue;
|
|
77
77
|
/**
|
|
78
78
|
* Initialize ReturnService.
|
|
79
79
|
* @param context - PosCore context
|
|
@@ -23,7 +23,7 @@ export interface ISaleItemService {
|
|
|
23
23
|
export declare class SaleItemService implements ISaleItemService {
|
|
24
24
|
private context;
|
|
25
25
|
private dbAdapter;
|
|
26
|
-
private
|
|
26
|
+
private changeQueue;
|
|
27
27
|
/**
|
|
28
28
|
* Initialize SaleItemService.
|
|
29
29
|
* @param context - PosCore context
|
|
@@ -71,7 +71,7 @@ export interface ISaleService {
|
|
|
71
71
|
export declare class SaleService implements ISaleService {
|
|
72
72
|
private context;
|
|
73
73
|
private dbAdapter;
|
|
74
|
-
private
|
|
74
|
+
private changeQueue;
|
|
75
75
|
private docNumberPolicy;
|
|
76
76
|
private readonly defaultBaseCurrencyCode;
|
|
77
77
|
/**
|
|
@@ -85,6 +85,7 @@ export declare class SaleService implements ISaleService {
|
|
|
85
85
|
private diffInDays;
|
|
86
86
|
private enforceTempoCustomerCreditPolicy;
|
|
87
87
|
private normalizeDocNo;
|
|
88
|
+
private toBaseQuantity;
|
|
88
89
|
getDuplicateDocumentNumbers(options?: {
|
|
89
90
|
dateFrom?: string;
|
|
90
91
|
dateTo?: string;
|
|
@@ -33,7 +33,7 @@ export interface ISettlementService {
|
|
|
33
33
|
export declare class SettlementService implements ISettlementService {
|
|
34
34
|
private context;
|
|
35
35
|
private dbAdapter;
|
|
36
|
-
private
|
|
36
|
+
private changeQueue;
|
|
37
37
|
private runInTransaction;
|
|
38
38
|
/**
|
|
39
39
|
* Initialize SettlementService.
|
|
@@ -44,7 +44,7 @@ export interface IShiftService {
|
|
|
44
44
|
export declare class ShiftService implements IShiftService {
|
|
45
45
|
private context;
|
|
46
46
|
private dbAdapter;
|
|
47
|
-
private
|
|
47
|
+
private changeQueue;
|
|
48
48
|
/**
|
|
49
49
|
* Initialize ShiftService.
|
|
50
50
|
* @param context - PosCore context
|
|
@@ -23,7 +23,7 @@ export interface IStockAdjustmentService {
|
|
|
23
23
|
export declare class StockAdjustmentService implements IStockAdjustmentService {
|
|
24
24
|
private context;
|
|
25
25
|
private dbAdapter;
|
|
26
|
-
private
|
|
26
|
+
private changeQueue;
|
|
27
27
|
/**
|
|
28
28
|
* Initialize StockAdjustmentService.
|
|
29
29
|
* @param context - PosCore context
|
|
@@ -23,7 +23,7 @@ export interface IStockOpnameItemService {
|
|
|
23
23
|
export declare class StockOpnameItemService implements IStockOpnameItemService {
|
|
24
24
|
private context;
|
|
25
25
|
private dbAdapter;
|
|
26
|
-
private
|
|
26
|
+
private changeQueue;
|
|
27
27
|
/**
|
|
28
28
|
* Initialize StockOpnameItemService.
|
|
29
29
|
* @param context - PosCore context
|
|
@@ -25,7 +25,7 @@ export interface IStockOpnameService {
|
|
|
25
25
|
export declare class StockOpnameService implements IStockOpnameService {
|
|
26
26
|
private context;
|
|
27
27
|
private dbAdapter;
|
|
28
|
-
private
|
|
28
|
+
private changeQueue;
|
|
29
29
|
/**
|
|
30
30
|
* Initialize StockOpnameService.
|
|
31
31
|
* @param context - PosCore context
|
|
@@ -25,7 +25,7 @@ export interface ISupplierService {
|
|
|
25
25
|
export declare class SupplierService implements ISupplierService {
|
|
26
26
|
private context;
|
|
27
27
|
private dbAdapter;
|
|
28
|
-
private
|
|
28
|
+
private changeQueue;
|
|
29
29
|
/**
|
|
30
30
|
* Initialize SupplierService.
|
|
31
31
|
* @param context - PosCore context
|
|
@@ -23,7 +23,7 @@ export interface ITaxRateService {
|
|
|
23
23
|
export declare class TaxRateService implements ITaxRateService {
|
|
24
24
|
private context;
|
|
25
25
|
private dbAdapter;
|
|
26
|
-
private
|
|
26
|
+
private changeQueue;
|
|
27
27
|
/**
|
|
28
28
|
* Initialize TaxRateService.
|
|
29
29
|
* @param context - PosCore context
|
|
@@ -49,7 +49,7 @@ export interface ITransactionService {
|
|
|
49
49
|
export declare class TransactionService implements ITransactionService {
|
|
50
50
|
private context;
|
|
51
51
|
private dbAdapter;
|
|
52
|
-
private
|
|
52
|
+
private changeQueue;
|
|
53
53
|
private readonly allowedReferenceTypes;
|
|
54
54
|
/**
|
|
55
55
|
* Initialize TransactionService.
|
|
@@ -68,7 +68,6 @@ export declare class UIProductService implements IUIProductService {
|
|
|
68
68
|
private readonly dbAdapter;
|
|
69
69
|
private readonly productService;
|
|
70
70
|
private readonly bomService;
|
|
71
|
-
private readonly syncStore?;
|
|
72
71
|
/**
|
|
73
72
|
* Membuat instance layanan UI produk.
|
|
74
73
|
* @param context Konteks PosCore dengan dependensi yang diperlukan.
|
|
@@ -1,44 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Bridge file for RFC extraction phase.
|
|
3
|
+
*
|
|
4
|
+
* Source of truth for generic storage contract/defaults is `ofcore`.
|
|
5
|
+
* Shared-core keeps this path for backward import compatibility.
|
|
3
6
|
*/
|
|
4
|
-
import {
|
|
7
|
+
import { MemoryStorageAdapter } from 'ofcore';
|
|
8
|
+
export type { StorageAdapter } from 'ofcore';
|
|
5
9
|
/**
|
|
6
|
-
*
|
|
10
|
+
* Backward-compatible alias for previous shared-core name.
|
|
7
11
|
*/
|
|
8
|
-
export
|
|
9
|
-
/**
|
|
10
|
-
* Mengambil nilai berdasarkan key.
|
|
11
|
-
* @param key Kunci item
|
|
12
|
-
* @returns Promise atau nilai string|null
|
|
13
|
-
*/
|
|
14
|
-
getItem(key: string): Promise<string | null> | string | null;
|
|
15
|
-
/**
|
|
16
|
-
* Menyimpan nilai dengan key tertentu.
|
|
17
|
-
* @param key Kunci item
|
|
18
|
-
* @param value Nilai string yang akan disimpan
|
|
19
|
-
*/
|
|
20
|
-
setItem(key: string, value: string): Promise<void> | void;
|
|
21
|
-
/**
|
|
22
|
-
* Menghapus item berdasarkan key.
|
|
23
|
-
* @param key Kunci item yang akan dihapus
|
|
24
|
-
*/
|
|
25
|
-
removeItem(key: string): Promise<void> | void;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Adapter penyimpanan memori untuk testing atau demo.
|
|
29
|
-
*/
|
|
30
|
-
export declare class MemoryStorage implements StorageAdapter {
|
|
31
|
-
private context;
|
|
32
|
-
private map;
|
|
33
|
-
/**
|
|
34
|
-
* Membuat instance MemoryStorage.
|
|
35
|
-
* @param context PosCore sebagai konteks (opsional)
|
|
36
|
-
*/
|
|
37
|
-
constructor(context: PosCore);
|
|
38
|
-
/** {@inheritDoc StorageAdapter.getItem} */
|
|
39
|
-
getItem(key: string): string | null;
|
|
40
|
-
/** {@inheritDoc StorageAdapter.setItem} */
|
|
41
|
-
setItem(key: string, value: string): void;
|
|
42
|
-
/** {@inheritDoc StorageAdapter.removeItem} */
|
|
43
|
-
removeItem(key: string): void;
|
|
12
|
+
export declare class MemoryStorage extends MemoryStorageAdapter {
|
|
44
13
|
}
|
|
@@ -40,6 +40,16 @@ export interface ISyncService {
|
|
|
40
40
|
*/
|
|
41
41
|
syncLoop(): Promise<void>;
|
|
42
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Implementasi sinkronisasi no-op untuk mode host-managed sync orchestration.
|
|
45
|
+
* Dipakai saat host app ingin menyerahkan push/pull ke ofsync-shared-core.
|
|
46
|
+
*/
|
|
47
|
+
export declare class NoopSyncService implements ISyncService {
|
|
48
|
+
backoff<T>(fn: () => Promise<T>): Promise<T>;
|
|
49
|
+
applyChanges(): Promise<void>;
|
|
50
|
+
syncWithErp(): Promise<void>;
|
|
51
|
+
syncLoop(): Promise<void>;
|
|
52
|
+
}
|
|
43
53
|
/**
|
|
44
54
|
* Implementasi layanan sinkronisasi.
|
|
45
55
|
*/
|
|
@@ -53,11 +63,17 @@ export declare class SyncService {
|
|
|
53
63
|
private unsubscribeStore?;
|
|
54
64
|
private readonly onDataChanged;
|
|
55
65
|
private lastAlertAtByCode;
|
|
66
|
+
private started;
|
|
56
67
|
/**
|
|
57
68
|
* Membuat instance SyncService.
|
|
58
69
|
* @param context Konteks PosCore aplikasi
|
|
59
70
|
*/
|
|
60
71
|
constructor(context: PosCore);
|
|
72
|
+
/**
|
|
73
|
+
* Aktifkan orchestration internal (debounce queue, socket trigger, periodic fallback).
|
|
74
|
+
* Idempotent: aman dipanggil berkali-kali.
|
|
75
|
+
*/
|
|
76
|
+
start(): void;
|
|
61
77
|
private normalizeOutgoingChange;
|
|
62
78
|
private getRemoteTimestamp;
|
|
63
79
|
private getConflictResolutionStrategy;
|
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ofpos-shared-core",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Offline-first POS
|
|
3
|
+
"version": "2.0.0-alpha.0",
|
|
4
|
+
"description": "Offline-first POS shared-core (domain and integration runtime) for of* host apps; platform and database agnostic.",
|
|
5
|
+
"private": false,
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Agus Made",
|
|
8
|
+
"email": "krisnaparta@gmail.com"
|
|
9
|
+
},
|
|
5
10
|
"main": "dist/index.cjs.js",
|
|
6
11
|
"module": "dist/index.esm.js",
|
|
7
12
|
"browser": "dist/index.browser.mjs",
|
|
@@ -31,29 +36,43 @@
|
|
|
31
36
|
"verify:ofcore-spike": "node ./scripts/verify-ofcore-spike.js",
|
|
32
37
|
"verify:ofcore-bridges": "node ./scripts/verify-ofcore-bridges.js",
|
|
33
38
|
"verify:no-internal-bridge-imports": "node ./scripts/verify-no-internal-bridge-imports.js",
|
|
39
|
+
"verify:ofauth-coupling": "node ./scripts/verify-ofauth-coupling.js",
|
|
34
40
|
"verify:governance": "node ./scripts/verify-governance-transport.js",
|
|
35
41
|
"verify:governance:negative": "node ./scripts/verify-governance-transport-negative.js",
|
|
36
42
|
"verify:poscore-runtime-bridge": "node ./scripts/verify-poscore-runtime-bridge.js",
|
|
37
43
|
"verify:poscore-overrides": "node ./scripts/verify-poscore-overrides.js",
|
|
44
|
+
"verify:auth-bridge-policy-mode": "node ./scripts/verify-auth-bridge-policy-mode.js",
|
|
45
|
+
"verify:host-managed-sync-mode": "node ./scripts/verify-host-managed-sync-mode.js",
|
|
46
|
+
"verify:sync-boundary": "node ./scripts/verify-sync-boundary.js",
|
|
38
47
|
"audit:schema": "node ./scripts/schema-audit.js",
|
|
39
48
|
"docs:check-links": "bash ./scripts/check-docs-links.sh",
|
|
40
|
-
"ci:check": "npm run lint && npm test -- --runInBand && npm run build && npm run verify:release-discipline && npm run verify:ofcore-bridges && npm run verify:no-internal-bridge-imports && npm run verify:governance && npm run verify:governance:negative && npm run verify:poscore-runtime-bridge && npm run verify:poscore-overrides && npm run docs:check-links",
|
|
49
|
+
"ci:check": "npm run lint && npm test -- --runInBand && npm run build && npm run verify:release-discipline && npm run verify:ofcore-bridges && npm run verify:no-internal-bridge-imports && npm run verify:ofauth-coupling && npm run verify:governance && npm run verify:governance:negative && npm run verify:poscore-runtime-bridge && npm run verify:poscore-overrides && npm run verify:auth-bridge-policy-mode && npm run verify:host-managed-sync-mode && npm run verify:sync-boundary && npm run docs:check-links",
|
|
41
50
|
"test:watch": "jest --watch",
|
|
42
51
|
"docs": "typedoc src/index.ts --out tsdocs",
|
|
52
|
+
"prepublishOnly": "npm run ci:check",
|
|
43
53
|
"prepack": "npm run build"
|
|
44
54
|
},
|
|
45
55
|
"repository": {
|
|
46
56
|
"type": "git",
|
|
47
|
-
"url": "git+https://
|
|
57
|
+
"url": "git+https://gitlab.com/rintisan/inti/ofpos-shared-core.git"
|
|
48
58
|
},
|
|
49
|
-
"author": "Agus Made <krisnaparta@gmail.com>",
|
|
50
59
|
"license": "MIT",
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"access": "public"
|
|
62
|
+
},
|
|
51
63
|
"files": [
|
|
52
64
|
"dist"
|
|
53
65
|
],
|
|
54
66
|
"dependencies": {
|
|
55
|
-
"ofcore": "0.
|
|
56
|
-
|
|
67
|
+
"ofcore": "0.2.0-alpha.0"
|
|
68
|
+
},
|
|
69
|
+
"peerDependencies": {
|
|
70
|
+
"ofauth-shared-core": "0.2.0-alpha.0"
|
|
71
|
+
},
|
|
72
|
+
"peerDependenciesMeta": {
|
|
73
|
+
"ofauth-shared-core": {
|
|
74
|
+
"optional": true
|
|
75
|
+
}
|
|
57
76
|
},
|
|
58
77
|
"devDependencies": {
|
|
59
78
|
"@types/crypto-js": "^4.2.2",
|
|
@@ -70,6 +89,7 @@
|
|
|
70
89
|
"jest": "^30.2.0",
|
|
71
90
|
"jest-html-reporters": "^3.1.7",
|
|
72
91
|
"mitt": "^3.0.1",
|
|
92
|
+
"ofauth-shared-core": "0.2.0-alpha.0",
|
|
73
93
|
"react": "^19.2.0",
|
|
74
94
|
"reflect-metadata": "^0.2.2",
|
|
75
95
|
"rimraf": "^6.0.1",
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* In-memory implementation of DbAdapter for testing and development.
|
|
3
|
-
* Fully compliant with the latest DbAdapter interface.
|
|
4
|
-
*/
|
|
5
|
-
import { DbAdapter, TableSchema, ColumnDefinition, DbSchema, QueryOptions, LiteralValue } from './DbAdapter';
|
|
6
|
-
export declare class InMemoryDbAdapter implements DbAdapter {
|
|
7
|
-
schema: DbSchema;
|
|
8
|
-
private data;
|
|
9
|
-
/**
|
|
10
|
-
* Initialize with a full schema (e.g., from `schemas`).
|
|
11
|
-
*/
|
|
12
|
-
setUpWithSchema(schema: DbSchema): Promise<void>;
|
|
13
|
-
/**
|
|
14
|
-
* Normalize value for comparison (handles Date, boolean, etc.)
|
|
15
|
-
*/
|
|
16
|
-
private normalizeForComparison;
|
|
17
|
-
/**
|
|
18
|
-
* Evaluate a ValueExpression against a record (and joined records).
|
|
19
|
-
* @param record Record from main table
|
|
20
|
-
* @param joinedRecords Map of alias → record (for joins)
|
|
21
|
-
* @param expr ValueExpression to evaluate
|
|
22
|
-
* @param mainAlias Main table alias (default: 't0')
|
|
23
|
-
*/
|
|
24
|
-
private evalValueExpr;
|
|
25
|
-
private buildFieldCondition;
|
|
26
|
-
/**
|
|
27
|
-
* Recursively evaluate FilterExpression.
|
|
28
|
-
*/
|
|
29
|
-
private matchFilterExpression;
|
|
30
|
-
/**
|
|
31
|
-
* Simulate JOINs by pre-matching records (for testing only).
|
|
32
|
-
* Limited to one-to-many/many-to-one; no many-to-many or complex conditions.
|
|
33
|
-
*/
|
|
34
|
-
private simulateJoins;
|
|
35
|
-
/**
|
|
36
|
-
* Extract field from record (handles alias.field and string field).
|
|
37
|
-
*/
|
|
38
|
-
private extractField;
|
|
39
|
-
private extractAggregateField;
|
|
40
|
-
getSchemaVersion(): Promise<number>;
|
|
41
|
-
setSchemaVersion(version: number): Promise<void>;
|
|
42
|
-
addTable(table: TableSchema): Promise<void>;
|
|
43
|
-
addColumn(_table: string, _column: ColumnDefinition): Promise<void>;
|
|
44
|
-
get<T>(table: string, idOrOptions: string | QueryOptions): Promise<T | null>;
|
|
45
|
-
query<T>(table: string, options?: QueryOptions): Promise<T[]>;
|
|
46
|
-
create<T>(table: string, data: Partial<Record<string, LiteralValue>> & {
|
|
47
|
-
id: string;
|
|
48
|
-
}): Promise<T>;
|
|
49
|
-
update<T>(table: string, id: string, updates: Partial<Record<string, LiteralValue>>): Promise<T>;
|
|
50
|
-
delete(table: string, id: string): Promise<void>;
|
|
51
|
-
bulkCreate<T>(table: string, rows: Array<Partial<Record<string, LiteralValue>> & {
|
|
52
|
-
id: string;
|
|
53
|
-
}>): Promise<T[]>;
|
|
54
|
-
bulkUpdate<T>(table: string, rows: Array<{
|
|
55
|
-
id: string;
|
|
56
|
-
updates: Partial<Record<string, LiteralValue>>;
|
|
57
|
-
}>): Promise<T[]>;
|
|
58
|
-
private transactionDepth;
|
|
59
|
-
private snapshots;
|
|
60
|
-
/**
|
|
61
|
-
* Simpan snapshot seluruh database (shallow copy cukup karena data immutable dalam transaksi)
|
|
62
|
-
*/
|
|
63
|
-
private takeSnapshot;
|
|
64
|
-
transaction<T>(callback: (tx: this) => Promise<T>): Promise<T>;
|
|
65
|
-
}
|