realitydb 0.3.0 → 0.4.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.
Files changed (2) hide show
  1. package/dist/index.js +478 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5708,6 +5708,474 @@ var educationTemplate = {
5708
5708
  ])
5709
5709
  };
5710
5710
 
5711
+ // ../../packages/templates/dist/domains/fintech.js
5712
+ var fintechTemplate = {
5713
+ name: "fintech",
5714
+ version: "1.0",
5715
+ description: "Financial services with accounts, transactions, fraud alerts, and settlements",
5716
+ targetTables: ["accounts", "transactions", "fraud_alerts", "settlements", "chargebacks"],
5717
+ tableConfigs: /* @__PURE__ */ new Map([
5718
+ ["accounts", {
5719
+ tableName: "accounts",
5720
+ matchPattern: ["accounts", "*account*"],
5721
+ columnOverrides: [
5722
+ {
5723
+ columnName: "account_type",
5724
+ strategy: {
5725
+ kind: "enum",
5726
+ options: {
5727
+ values: ["checking", "savings", "investment", "credit", "business"],
5728
+ weights: [0.35, 0.25, 0.15, 0.15, 0.1]
5729
+ }
5730
+ }
5731
+ },
5732
+ {
5733
+ columnName: "balance_cents",
5734
+ strategy: { kind: "money", options: { min: 0, max: 5e6 } }
5735
+ },
5736
+ {
5737
+ columnName: "currency",
5738
+ strategy: {
5739
+ kind: "enum",
5740
+ options: {
5741
+ values: ["USD", "EUR", "GBP", "CAD", "JPY"],
5742
+ weights: [0.55, 0.2, 0.1, 0.08, 0.07]
5743
+ }
5744
+ }
5745
+ },
5746
+ {
5747
+ columnName: "status",
5748
+ strategy: {
5749
+ kind: "enum",
5750
+ options: {
5751
+ values: ["active", "frozen", "closed", "pending_review"],
5752
+ weights: [0.82, 0.05, 0.08, 0.05]
5753
+ }
5754
+ }
5755
+ },
5756
+ {
5757
+ columnName: "owner_name",
5758
+ strategy: { kind: "full_name" }
5759
+ },
5760
+ {
5761
+ columnName: "email",
5762
+ strategy: { kind: "email" }
5763
+ },
5764
+ {
5765
+ columnName: "account_number",
5766
+ strategy: { kind: "text", options: { mode: "short" } }
5767
+ },
5768
+ {
5769
+ columnName: "opened_at",
5770
+ strategy: { kind: "timestamp", options: { mode: "past" } }
5771
+ }
5772
+ ]
5773
+ }],
5774
+ ["transactions", {
5775
+ tableName: "transactions",
5776
+ matchPattern: ["transactions", "*transaction*", "*transfer*"],
5777
+ columnOverrides: [
5778
+ {
5779
+ columnName: "transaction_type",
5780
+ strategy: {
5781
+ kind: "enum",
5782
+ options: {
5783
+ values: ["deposit", "withdrawal", "transfer", "payment", "refund", "fee"],
5784
+ weights: [0.25, 0.2, 0.2, 0.2, 0.1, 0.05]
5785
+ }
5786
+ }
5787
+ },
5788
+ {
5789
+ columnName: "amount_cents",
5790
+ strategy: { kind: "money", options: { min: 100, max: 5e5 } }
5791
+ },
5792
+ {
5793
+ columnName: "currency",
5794
+ strategy: {
5795
+ kind: "enum",
5796
+ options: {
5797
+ values: ["USD", "EUR", "GBP", "CAD", "JPY"],
5798
+ weights: [0.55, 0.2, 0.1, 0.08, 0.07]
5799
+ }
5800
+ }
5801
+ },
5802
+ {
5803
+ columnName: "status",
5804
+ strategy: {
5805
+ kind: "enum",
5806
+ options: {
5807
+ values: ["completed", "pending", "failed", "reversed", "held"],
5808
+ weights: [0.78, 0.08, 0.05, 0.04, 0.05]
5809
+ }
5810
+ }
5811
+ },
5812
+ {
5813
+ columnName: "description",
5814
+ strategy: { kind: "text", options: { mode: "short" } }
5815
+ },
5816
+ {
5817
+ columnName: "created_at",
5818
+ strategy: { kind: "timestamp", options: { mode: "past" } }
5819
+ }
5820
+ ]
5821
+ }],
5822
+ ["fraud_alerts", {
5823
+ tableName: "fraud_alerts",
5824
+ matchPattern: ["fraud_alerts", "*fraud*", "*alert*"],
5825
+ columnOverrides: [
5826
+ {
5827
+ columnName: "alert_type",
5828
+ strategy: {
5829
+ kind: "enum",
5830
+ options: {
5831
+ values: ["unusual_amount", "velocity_check", "geo_mismatch", "duplicate_transaction", "account_takeover"],
5832
+ weights: [0.3, 0.25, 0.2, 0.15, 0.1]
5833
+ }
5834
+ }
5835
+ },
5836
+ {
5837
+ columnName: "severity",
5838
+ strategy: {
5839
+ kind: "enum",
5840
+ options: {
5841
+ values: ["low", "medium", "high", "critical"],
5842
+ weights: [0.2, 0.4, 0.3, 0.1]
5843
+ }
5844
+ }
5845
+ },
5846
+ {
5847
+ columnName: "status",
5848
+ strategy: {
5849
+ kind: "enum",
5850
+ options: {
5851
+ values: ["open", "investigating", "resolved_fraud", "resolved_legitimate", "escalated"],
5852
+ weights: [0.25, 0.2, 0.3, 0.15, 0.1]
5853
+ }
5854
+ }
5855
+ },
5856
+ {
5857
+ columnName: "description",
5858
+ strategy: { kind: "text", options: { mode: "short" } }
5859
+ },
5860
+ {
5861
+ columnName: "created_at",
5862
+ strategy: { kind: "timestamp", options: { mode: "past" } }
5863
+ }
5864
+ ]
5865
+ }],
5866
+ ["settlements", {
5867
+ tableName: "settlements",
5868
+ matchPattern: ["settlements", "*settlement*"],
5869
+ columnOverrides: [
5870
+ {
5871
+ columnName: "settlement_type",
5872
+ strategy: {
5873
+ kind: "enum",
5874
+ options: {
5875
+ values: ["standard", "expedited", "batch", "real_time"],
5876
+ weights: [0.5, 0.2, 0.2, 0.1]
5877
+ }
5878
+ }
5879
+ },
5880
+ {
5881
+ columnName: "amount_cents",
5882
+ strategy: { kind: "money", options: { min: 100, max: 5e5 } }
5883
+ },
5884
+ {
5885
+ columnName: "status",
5886
+ strategy: {
5887
+ kind: "enum",
5888
+ options: {
5889
+ values: ["pending", "processing", "completed", "failed"],
5890
+ weights: [0.15, 0.1, 0.7, 0.05]
5891
+ }
5892
+ }
5893
+ },
5894
+ {
5895
+ columnName: "created_at",
5896
+ strategy: { kind: "timestamp", options: { mode: "past" } }
5897
+ }
5898
+ ]
5899
+ }],
5900
+ ["chargebacks", {
5901
+ tableName: "chargebacks",
5902
+ matchPattern: ["chargebacks", "*chargeback*", "*dispute*"],
5903
+ columnOverrides: [
5904
+ {
5905
+ columnName: "reason",
5906
+ strategy: {
5907
+ kind: "enum",
5908
+ options: {
5909
+ values: ["unauthorized", "product_not_received", "product_defective", "duplicate_charge", "subscription_canceled", "other"],
5910
+ weights: [0.25, 0.2, 0.15, 0.15, 0.15, 0.1]
5911
+ }
5912
+ }
5913
+ },
5914
+ {
5915
+ columnName: "amount_cents",
5916
+ strategy: { kind: "money", options: { min: 500, max: 2e5 } }
5917
+ },
5918
+ {
5919
+ columnName: "status",
5920
+ strategy: {
5921
+ kind: "enum",
5922
+ options: {
5923
+ values: ["open", "under_review", "won", "lost", "expired"],
5924
+ weights: [0.2, 0.25, 0.3, 0.15, 0.1]
5925
+ }
5926
+ }
5927
+ },
5928
+ {
5929
+ columnName: "filed_at",
5930
+ strategy: { kind: "timestamp", options: { mode: "past" } }
5931
+ }
5932
+ ]
5933
+ }]
5934
+ ])
5935
+ };
5936
+
5937
+ // ../../packages/templates/dist/domains/healthcare.js
5938
+ var healthcareTemplate = {
5939
+ name: "healthcare",
5940
+ version: "1.0",
5941
+ description: "Healthcare system with patients, providers, encounters, diagnoses, and billing",
5942
+ targetTables: ["patients", "providers", "encounters", "diagnoses", "billing"],
5943
+ tableConfigs: /* @__PURE__ */ new Map([
5944
+ ["patients", {
5945
+ tableName: "patients",
5946
+ matchPattern: ["patients", "*patient*"],
5947
+ columnOverrides: [
5948
+ {
5949
+ columnName: "first_name",
5950
+ strategy: { kind: "first_name" }
5951
+ },
5952
+ {
5953
+ columnName: "last_name",
5954
+ strategy: { kind: "last_name" }
5955
+ },
5956
+ {
5957
+ columnName: "email",
5958
+ strategy: { kind: "email" }
5959
+ },
5960
+ {
5961
+ columnName: "phone",
5962
+ strategy: { kind: "phone" }
5963
+ },
5964
+ {
5965
+ columnName: "gender",
5966
+ strategy: {
5967
+ kind: "enum",
5968
+ options: {
5969
+ values: ["Male", "Female", "Non-binary", "Other", "Prefer not to say"],
5970
+ weights: [0.48, 0.48, 0.02, 0.01, 0.01]
5971
+ }
5972
+ }
5973
+ },
5974
+ {
5975
+ columnName: "insurance_provider",
5976
+ strategy: {
5977
+ kind: "enum",
5978
+ options: {
5979
+ values: ["Blue Cross", "Aetna", "UnitedHealth", "Cigna", "Humana", "Medicare", "Medicaid", "Self-Pay"],
5980
+ weights: [0.18, 0.15, 0.15, 0.12, 0.1, 0.12, 0.1, 0.08]
5981
+ }
5982
+ }
5983
+ },
5984
+ {
5985
+ columnName: "mrn",
5986
+ strategy: { kind: "text", options: { mode: "short" } }
5987
+ },
5988
+ {
5989
+ columnName: "date_of_birth",
5990
+ strategy: { kind: "timestamp", options: { mode: "past" } }
5991
+ },
5992
+ {
5993
+ columnName: "registered_at",
5994
+ strategy: { kind: "timestamp", options: { mode: "past" } }
5995
+ }
5996
+ ]
5997
+ }],
5998
+ ["providers", {
5999
+ tableName: "providers",
6000
+ matchPattern: ["providers", "doctors", "physicians", "*provider*"],
6001
+ columnOverrides: [
6002
+ {
6003
+ columnName: "first_name",
6004
+ strategy: { kind: "first_name" }
6005
+ },
6006
+ {
6007
+ columnName: "last_name",
6008
+ strategy: { kind: "last_name" }
6009
+ },
6010
+ {
6011
+ columnName: "email",
6012
+ strategy: { kind: "email" }
6013
+ },
6014
+ {
6015
+ columnName: "specialty",
6016
+ strategy: {
6017
+ kind: "enum",
6018
+ options: {
6019
+ values: ["Family Medicine", "Internal Medicine", "Pediatrics", "Cardiology", "Orthopedics", "Dermatology", "Neurology", "Psychiatry", "Emergency Medicine", "Radiology"],
6020
+ weights: [0.18, 0.15, 0.12, 0.1, 0.1, 0.08, 0.08, 0.07, 0.07, 0.05]
6021
+ }
6022
+ }
6023
+ },
6024
+ {
6025
+ columnName: "department",
6026
+ strategy: {
6027
+ kind: "enum",
6028
+ options: {
6029
+ values: ["Primary Care", "Surgery", "Emergency", "Specialty", "Diagnostics"],
6030
+ weights: [0.3, 0.2, 0.15, 0.25, 0.1]
6031
+ }
6032
+ }
6033
+ },
6034
+ {
6035
+ columnName: "npi",
6036
+ strategy: { kind: "text", options: { mode: "short" } }
6037
+ },
6038
+ {
6039
+ columnName: "active",
6040
+ strategy: { kind: "boolean", options: { trueWeight: 0.92 } }
6041
+ }
6042
+ ]
6043
+ }],
6044
+ ["encounters", {
6045
+ tableName: "encounters",
6046
+ matchPattern: ["encounters", "visits", "appointments", "*encounter*", "*visit*"],
6047
+ columnOverrides: [
6048
+ {
6049
+ columnName: "encounter_type",
6050
+ strategy: {
6051
+ kind: "enum",
6052
+ options: {
6053
+ values: ["office_visit", "emergency", "telehealth", "procedure", "follow_up", "annual_checkup"],
6054
+ weights: [0.35, 0.08, 0.15, 0.12, 0.18, 0.12]
6055
+ }
6056
+ }
6057
+ },
6058
+ {
6059
+ columnName: "status",
6060
+ strategy: {
6061
+ kind: "enum",
6062
+ options: {
6063
+ values: ["completed", "scheduled", "in_progress", "canceled", "no_show"],
6064
+ weights: [0.55, 0.15, 0.1, 0.1, 0.1]
6065
+ }
6066
+ }
6067
+ },
6068
+ {
6069
+ columnName: "chief_complaint",
6070
+ strategy: {
6071
+ kind: "enum",
6072
+ options: {
6073
+ values: ["Headache", "Back pain", "Cough", "Chest pain", "Fatigue", "Fever", "Joint pain", "Shortness of breath", "Abdominal pain", "Skin rash", "Dizziness", "Annual checkup"],
6074
+ weights: [0.1, 0.12, 0.1, 0.06, 0.08, 0.08, 0.09, 0.06, 0.08, 0.07, 0.06, 0.1]
6075
+ }
6076
+ }
6077
+ },
6078
+ {
6079
+ columnName: "scheduled_at",
6080
+ strategy: { kind: "timestamp", options: { mode: "past" } }
6081
+ }
6082
+ ]
6083
+ }],
6084
+ ["diagnoses", {
6085
+ tableName: "diagnoses",
6086
+ matchPattern: ["diagnoses", "*diagnosis*", "*diagnos*"],
6087
+ columnOverrides: [
6088
+ {
6089
+ columnName: "icd_code",
6090
+ strategy: {
6091
+ kind: "enum",
6092
+ options: {
6093
+ values: ["J06.9", "M54.5", "I10", "E11.9", "J20.9", "R51.9", "M25.50", "Z00.00", "K21.0", "L30.9", "F41.1", "E78.5"],
6094
+ weights: [0.1, 0.1, 0.12, 0.1, 0.08, 0.08, 0.08, 0.08, 0.07, 0.06, 0.07, 0.06]
6095
+ }
6096
+ }
6097
+ },
6098
+ {
6099
+ columnName: "description",
6100
+ strategy: {
6101
+ kind: "enum",
6102
+ options: {
6103
+ values: ["Acute upper respiratory infection", "Low back pain", "Essential hypertension", "Type 2 diabetes", "Acute bronchitis", "Headache", "Joint pain", "General adult medical exam", "Gastroesophageal reflux", "Dermatitis", "Generalized anxiety disorder", "Hyperlipidemia"],
6104
+ weights: [0.1, 0.1, 0.12, 0.1, 0.08, 0.08, 0.08, 0.08, 0.07, 0.06, 0.07, 0.06]
6105
+ }
6106
+ }
6107
+ },
6108
+ {
6109
+ columnName: "diagnosis_type",
6110
+ strategy: {
6111
+ kind: "enum",
6112
+ options: {
6113
+ values: ["primary", "secondary", "admitting", "working"],
6114
+ weights: [0.6, 0.25, 0.08, 0.07]
6115
+ }
6116
+ }
6117
+ },
6118
+ {
6119
+ columnName: "diagnosed_at",
6120
+ strategy: { kind: "timestamp", options: { mode: "past" } }
6121
+ }
6122
+ ]
6123
+ }],
6124
+ ["billing", {
6125
+ tableName: "billing",
6126
+ matchPattern: ["billing", "claims", "charges", "*bill*", "*claim*"],
6127
+ columnOverrides: [
6128
+ {
6129
+ columnName: "cpt_code",
6130
+ strategy: {
6131
+ kind: "enum",
6132
+ options: {
6133
+ values: ["99213", "99214", "99215", "99203", "99204", "99281", "99282", "99283", "99395", "99396"],
6134
+ weights: [0.25, 0.2, 0.1, 0.1, 0.08, 0.05, 0.05, 0.05, 0.06, 0.06]
6135
+ }
6136
+ }
6137
+ },
6138
+ {
6139
+ columnName: "description",
6140
+ strategy: {
6141
+ kind: "enum",
6142
+ options: {
6143
+ values: ["Office visit - established, low", "Office visit - established, moderate", "Office visit - established, high", "Office visit - new, low", "Office visit - new, moderate", "ED visit - low", "ED visit - moderate", "ED visit - high", "Preventive visit 18-39", "Preventive visit 40-64"],
6144
+ weights: [0.25, 0.2, 0.1, 0.1, 0.08, 0.05, 0.05, 0.05, 0.06, 0.06]
6145
+ }
6146
+ }
6147
+ },
6148
+ {
6149
+ columnName: "amount_cents",
6150
+ strategy: { kind: "money", options: { min: 5e3, max: 15e4 } }
6151
+ },
6152
+ {
6153
+ columnName: "insurance_covered_cents",
6154
+ strategy: { kind: "money", options: { min: 0, max: 12e4 } }
6155
+ },
6156
+ {
6157
+ columnName: "patient_responsibility_cents",
6158
+ strategy: { kind: "money", options: { min: 0, max: 5e4 } }
6159
+ },
6160
+ {
6161
+ columnName: "status",
6162
+ strategy: {
6163
+ kind: "enum",
6164
+ options: {
6165
+ values: ["paid", "pending", "denied", "appealed", "partially_paid"],
6166
+ weights: [0.5, 0.2, 0.1, 0.05, 0.15]
6167
+ }
6168
+ }
6169
+ },
6170
+ {
6171
+ columnName: "billed_at",
6172
+ strategy: { kind: "timestamp", options: { mode: "past" } }
6173
+ }
6174
+ ]
6175
+ }]
6176
+ ])
6177
+ };
6178
+
5711
6179
  // ../../packages/templates/dist/registry.js
5712
6180
  var TemplateRegistry = class {
5713
6181
  templates = /* @__PURE__ */ new Map();
@@ -5763,6 +6231,8 @@ function getDefaultRegistry() {
5763
6231
  registry.register(saasTemplate);
5764
6232
  registry.register(ecommerceTemplate);
5765
6233
  registry.register(educationTemplate);
6234
+ registry.register(fintechTemplate);
6235
+ registry.register(healthcareTemplate);
5766
6236
  return registry;
5767
6237
  }
5768
6238
 
@@ -6920,7 +7390,7 @@ function maskConnectionString(connectionString) {
6920
7390
  }
6921
7391
 
6922
7392
  // src/commands/scan.ts
6923
- var VERSION2 = "0.3.0";
7393
+ var VERSION2 = "0.4.0";
6924
7394
  async function scanCommand(options) {
6925
7395
  const start = performance.now();
6926
7396
  try {
@@ -7011,7 +7481,7 @@ async function scanCommand(options) {
7011
7481
  }
7012
7482
 
7013
7483
  // src/commands/seed.ts
7014
- var VERSION3 = "0.3.0";
7484
+ var VERSION3 = "0.4.0";
7015
7485
  async function seedCommand(options) {
7016
7486
  const start = performance.now();
7017
7487
  try {
@@ -7189,7 +7659,7 @@ async function seedCommand(options) {
7189
7659
  }
7190
7660
 
7191
7661
  // src/commands/reset.ts
7192
- var VERSION4 = "0.3.0";
7662
+ var VERSION4 = "0.4.0";
7193
7663
  async function resetCommand(options) {
7194
7664
  const start = performance.now();
7195
7665
  if (!options.ci && !options.confirm) {
@@ -7259,7 +7729,7 @@ async function resetCommand(options) {
7259
7729
  }
7260
7730
 
7261
7731
  // src/commands/export.ts
7262
- var VERSION5 = "0.3.0";
7732
+ var VERSION5 = "0.4.0";
7263
7733
  async function exportCommand(options) {
7264
7734
  const start = performance.now();
7265
7735
  try {
@@ -7611,7 +8081,7 @@ async function packImportCommand(filePath, options) {
7611
8081
 
7612
8082
  // src/commands/capture.ts
7613
8083
  var import_promises8 = require("fs/promises");
7614
- var VERSION6 = "0.3.0";
8084
+ var VERSION6 = "0.4.0";
7615
8085
  async function captureCommand(options) {
7616
8086
  const start = performance.now();
7617
8087
  try {
@@ -7711,7 +8181,7 @@ async function captureCommand(options) {
7711
8181
  }
7712
8182
 
7713
8183
  // src/commands/share.ts
7714
- var VERSION7 = "0.3.0";
8184
+ var VERSION7 = "0.4.0";
7715
8185
  async function shareCommand(filePath, options) {
7716
8186
  const start = performance.now();
7717
8187
  try {
@@ -7786,7 +8256,7 @@ async function shareCommand(filePath, options) {
7786
8256
  }
7787
8257
 
7788
8258
  // src/commands/load.ts
7789
- var VERSION8 = "0.3.0";
8259
+ var VERSION8 = "0.4.0";
7790
8260
  async function loadCommand(filePath, options) {
7791
8261
  const start = performance.now();
7792
8262
  try {
@@ -7929,7 +8399,7 @@ async function loadCommand(filePath, options) {
7929
8399
  }
7930
8400
 
7931
8401
  // src/cli.ts
7932
- var VERSION9 = "0.3.0";
8402
+ var VERSION9 = "0.4.0";
7933
8403
  function run(argv) {
7934
8404
  const program2 = new Command();
7935
8405
  program2.name("realitydb").description("RealityDB \u2014 Developer Reality Platform").version(VERSION9).option("--config <path>", "Path to config file").option("--ci", "CI mode: JSON output, no prompts, proper exit codes", false).option("--verbose", "Enable verbose output", false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "realitydb",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Developer Reality Platform - realistic database environments from your schema",
5
5
  "license": "MIT",
6
6
  "keywords": [