qstd 0.2.26 → 0.2.28

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.
@@ -2,6 +2,8 @@
2
2
 
3
3
  var dateFns = require('date-fns');
4
4
  var fs = require('fs');
5
+ var libDynamodb = require('@aws-sdk/lib-dynamodb');
6
+ var clientDynamodb = require('@aws-sdk/client-dynamodb');
5
7
 
6
8
  var __defProp = Object.defineProperty;
7
9
  var __export = (target, all) => {
@@ -607,8 +609,8 @@ var readFile = async (filePath, encoding = "utf-8") => {
607
609
  var writeBufferToFile = async (filepath, buffer) => {
608
610
  if (!buffer) return;
609
611
  const chunks = [];
610
- for await (const chunk2 of buffer) {
611
- chunks.push(chunk2);
612
+ for await (const chunk3 of buffer) {
613
+ chunks.push(chunk3);
612
614
  }
613
615
  await fs.promises.writeFile(filepath, Buffer.concat(chunks));
614
616
  };
@@ -616,6 +618,603 @@ var writeFile = async (filepath, content) => {
616
618
  return fs.promises.writeFile(filepath, content);
617
619
  };
618
620
 
621
+ // src/server/aws/ddb/index.ts
622
+ var ddb_exports = {};
623
+ __export(ddb_exports, {
624
+ batchDelete: () => batchDelete,
625
+ batchGet: () => batchGet,
626
+ batchWrite: () => batchWrite,
627
+ create: () => create2,
628
+ deleteTable: () => deleteTable,
629
+ find: () => find,
630
+ lsi: () => lsi,
631
+ lsi2: () => lsi2,
632
+ lsiNormalized: () => lsiNormalized,
633
+ lsiPhash: () => lsiPhash,
634
+ lsiUsername: () => lsiUsername,
635
+ remove: () => remove,
636
+ save: () => save,
637
+ tableExists: () => tableExists
638
+ });
639
+
640
+ // src/server/aws/ddb/fns.ts
641
+ var validateFindProps = (props) => {
642
+ const isScan = "scan" in props && props.scan === true;
643
+ if (!props.tableName) {
644
+ throw new Error(`[ddb] "tableName" is required`);
645
+ }
646
+ if (props.limit && props.recursive) {
647
+ throw new Error(`[ddb] "limit" and "recursive" cannot be used together`);
648
+ }
649
+ if (!isScan) {
650
+ const queryProps = props;
651
+ if (!queryProps.pk) {
652
+ throw new Error(`[ddb] [find] "pk" is required for Query mode. Use scan: true to scan without pk.`);
653
+ }
654
+ if (queryProps.sk && "key" in queryProps.sk && queryProps.sk.key && queryProps.sk.key !== "sk" && !queryProps.indexName) {
655
+ throw new Error(
656
+ `[ddb] [find] you provided a custom sk but no indexName. If this is a mistake, change this error to a warn.`
657
+ );
658
+ }
659
+ }
660
+ };
661
+ var buildKeyConditionExpression = (pk, sk, names, values) => {
662
+ const pkKey = pk.key ?? "pk";
663
+ names["#pk"] = pkKey;
664
+ values[":pk"] = pk.value;
665
+ if (!sk) return "#pk = :pk";
666
+ const skName = sk.key ?? "sk";
667
+ names["#sk"] = skName;
668
+ if ("op" in sk && sk.op) {
669
+ switch (sk.op) {
670
+ case "=":
671
+ case ">=":
672
+ case ">":
673
+ case "<=":
674
+ case "<":
675
+ values[":sk"] = sk.value;
676
+ return `#pk = :pk AND #sk ${sk.op} :sk`;
677
+ case "begins_with":
678
+ values[":sk"] = sk.value;
679
+ return `#pk = :pk AND begins_with(#sk, :sk)`;
680
+ case "between": {
681
+ const [from, to] = sk.value;
682
+ values[":skFrom"] = from;
683
+ values[":skTo"] = to;
684
+ return `#pk = :pk AND #sk BETWEEN :skFrom AND :skTo`;
685
+ }
686
+ default:
687
+ throw new Error(`Unsupported SK op: ${JSON.stringify(sk, null, 2)}`);
688
+ }
689
+ }
690
+ if ("value" in sk && sk.value !== void 0) {
691
+ values[":sk"] = sk.value;
692
+ return `#pk = :pk AND #sk = :sk`;
693
+ }
694
+ if ("valueBeginsWith" in sk && sk.valueBeginsWith !== void 0) {
695
+ values[":sk"] = sk.valueBeginsWith;
696
+ return `#pk = :pk AND begins_with(#sk, :sk)`;
697
+ }
698
+ throw new Error(
699
+ `Invalid SK condition: expected 'op' or legacy 'value'/'valueBeginsWith'`
700
+ );
701
+ };
702
+ var buildFilterExpression = (filters, names, values) => {
703
+ if (!filters || filters.length === 0) return void 0;
704
+ const frags = [];
705
+ filters.forEach((f, i) => {
706
+ const nameToken = `#f${i}`;
707
+ names[nameToken] = f.key;
708
+ switch (f.op) {
709
+ case "attribute_exists":
710
+ frags.push(`attribute_exists(${nameToken})`);
711
+ break;
712
+ case "attribute_not_exists":
713
+ frags.push(`attribute_not_exists(${nameToken})`);
714
+ break;
715
+ case "between": {
716
+ const [lo, hi] = f.value;
717
+ const loPh = `:f${i}_lo`;
718
+ const hiPh = `:f${i}_hi`;
719
+ values[loPh] = lo;
720
+ values[hiPh] = hi;
721
+ frags.push(`${nameToken} BETWEEN ${loPh} AND ${hiPh}`);
722
+ break;
723
+ }
724
+ case "in": {
725
+ const arr = f.value;
726
+ if (!arr.length) {
727
+ throw new Error(
728
+ `'in' filter for ${f.key} requires at least one value`
729
+ );
730
+ }
731
+ const phs = arr.map((_, j) => `:f${i}_${j}`);
732
+ arr.forEach((v, j) => {
733
+ const ph = phs[j];
734
+ if (ph) values[ph] = v;
735
+ });
736
+ frags.push(`${nameToken} IN (${phs.join(", ")})`);
737
+ break;
738
+ }
739
+ case "contains":
740
+ case "begins_with": {
741
+ const ph = `:f${i}`;
742
+ values[ph] = f.value;
743
+ frags.push(`${f.op}(${nameToken}, ${ph})`);
744
+ break;
745
+ }
746
+ case "=":
747
+ case "<>":
748
+ case ">":
749
+ case ">=":
750
+ case "<":
751
+ case "<=": {
752
+ const ph = `:f${i}`;
753
+ values[ph] = f.value;
754
+ frags.push(`${nameToken} ${f.op} ${ph}`);
755
+ break;
756
+ }
757
+ }
758
+ });
759
+ return frags.join(" AND ");
760
+ };
761
+ var buildProjectionExpression = (projection, names) => {
762
+ const projectionNames = projection.map((key, idx) => {
763
+ const nameKey = `#proj${idx}`;
764
+ names[nameKey] = key;
765
+ return nameKey;
766
+ });
767
+ return projectionNames.join(", ");
768
+ };
769
+ var sleep3 = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
770
+ var backoffDelay = (attempt) => {
771
+ return Math.min(1e3 * Math.pow(2, attempt), 1e4);
772
+ };
773
+ var chunk2 = (arr, size) => {
774
+ return Array.from(
775
+ { length: Math.ceil(arr.length / size) },
776
+ (_, i) => arr.slice(i * size, i * size + size)
777
+ );
778
+ };
779
+
780
+ // src/server/aws/ddb/domain.ts
781
+ var create2 = (props) => {
782
+ const tableName = props?.tableName;
783
+ const credentials = props?.credentials;
784
+ const client = libDynamodb.DynamoDBDocumentClient.from(
785
+ new clientDynamodb.DynamoDBClient({
786
+ ...credentials && { credentials },
787
+ region: "us-east-1"
788
+ }),
789
+ {
790
+ marshallOptions: {
791
+ // Whether to automatically convert empty strings, blobs, and sets to `null`.
792
+ convertEmptyValues: false,
793
+ // false, by default.
794
+ // Whether to remove undefined values while marshalling.
795
+ removeUndefinedValues: false,
796
+ // false, by default.
797
+ // Whether to convert typeof object to map attribute.
798
+ convertClassInstanceToMap: false
799
+ // false, by default.
800
+ },
801
+ unmarshallOptions: {
802
+ // Whether to return numbers as a string instead of converting them to native JavaScript numbers.
803
+ wrapNumbers: false
804
+ // false, by default.
805
+ }
806
+ }
807
+ );
808
+ return { client, tableName };
809
+ };
810
+ async function find(ddb, props) {
811
+ try {
812
+ const TableName = props.tableName ?? ddb.tableName;
813
+ const { filters, projection, debug } = props;
814
+ const isScan = "scan" in props && props.scan === true;
815
+ validateFindProps(props);
816
+ const names = {};
817
+ const values = {};
818
+ const KeyConditionExpression = isScan ? void 0 : buildKeyConditionExpression(
819
+ props.pk,
820
+ props.sk,
821
+ names,
822
+ values
823
+ );
824
+ const FilterExpression = filters ? buildFilterExpression(filters, names, values) : void 0;
825
+ if (debug) {
826
+ console.log(`[debug] [ddb] [find] input:`, {
827
+ isScan,
828
+ filters,
829
+ FilterExpression,
830
+ names,
831
+ values
832
+ });
833
+ }
834
+ const ProjectionExpression = projection ? buildProjectionExpression(projection, names) : void 0;
835
+ const all = [];
836
+ let startKey = props.startKey;
837
+ let pageCount = 0;
838
+ let totalItems = 0;
839
+ do {
840
+ if (props.maxPages && pageCount >= props.maxPages) break;
841
+ const command = isScan ? new libDynamodb.ScanCommand({
842
+ TableName,
843
+ IndexName: props.indexName,
844
+ FilterExpression,
845
+ Limit: props.limit,
846
+ ProjectionExpression,
847
+ ExclusiveStartKey: startKey,
848
+ ConsistentRead: props.strong,
849
+ ...Object.keys(names).length > 0 && {
850
+ ExpressionAttributeNames: names
851
+ },
852
+ ...Object.keys(values).length > 0 && {
853
+ ExpressionAttributeValues: values
854
+ }
855
+ }) : new libDynamodb.QueryCommand({
856
+ TableName,
857
+ IndexName: props.indexName,
858
+ KeyConditionExpression,
859
+ FilterExpression,
860
+ Limit: props.limit,
861
+ ProjectionExpression,
862
+ ExclusiveStartKey: startKey,
863
+ ConsistentRead: props.strong,
864
+ ExpressionAttributeNames: names,
865
+ ExpressionAttributeValues: values,
866
+ ScanIndexForward: props.sort === "desc" ? false : true
867
+ });
868
+ const result = await ddb.client.send(command);
869
+ const pageItems = result.Items ?? [];
870
+ all.push(...pageItems);
871
+ totalItems += pageItems.length;
872
+ pageCount++;
873
+ startKey = result.LastEvaluatedKey;
874
+ if (props.recursive) {
875
+ if (props.maxItems && totalItems >= props.maxItems) break;
876
+ if (!startKey) break;
877
+ if (typeof props.recursive === "function") {
878
+ const page = {
879
+ lastEvaluatedKey: result.LastEvaluatedKey,
880
+ scannedCount: result.ScannedCount ?? 0,
881
+ count: result.Count ?? 0,
882
+ items: pageItems
883
+ };
884
+ const shouldContinue = props.recursive(page, pageCount, totalItems);
885
+ if (!shouldContinue) break;
886
+ }
887
+ } else {
888
+ break;
889
+ }
890
+ } while (true);
891
+ const rawResponse = {
892
+ lastEvaluatedKey: startKey,
893
+ scannedCount: totalItems,
894
+ count: totalItems,
895
+ items: all
896
+ };
897
+ if (props.raw && props.first) {
898
+ return {
899
+ count: rawResponse.count,
900
+ item: rawResponse.items[0],
901
+ scannedCount: rawResponse.scannedCount
902
+ };
903
+ }
904
+ if (props.raw) return rawResponse;
905
+ if (props.first) return rawResponse.items[0];
906
+ return rawResponse.items;
907
+ } catch (error2) {
908
+ const err = error2;
909
+ console.log(`[error] [ddb] [find] failed with ${err.message}. Input:`);
910
+ console.dir(props, { depth: 100 });
911
+ throw err;
912
+ }
913
+ }
914
+ var remove = async (ddb, props) => {
915
+ const TableName = props.tableName ?? ddb.tableName;
916
+ const command = new libDynamodb.DeleteCommand({ Key: props.key, TableName });
917
+ return ddb.client.send(command);
918
+ };
919
+ var save = async (ddb, props) => {
920
+ const TableName = props.tableName ?? ddb.tableName;
921
+ const command = new libDynamodb.PutCommand({
922
+ Item: props.item,
923
+ TableName
924
+ });
925
+ return ddb.client.send(command);
926
+ };
927
+ async function batchGet(ddb, props) {
928
+ const { keys, maxRetries = 3, strong = false } = props;
929
+ const TableName = props.tableName ?? ddb.tableName;
930
+ const chunks = chunk2(keys, 100);
931
+ const allItems = [];
932
+ const requestedCount = keys.length;
933
+ let totalConsumedCapacity = 0;
934
+ for (const chunk3 of chunks) {
935
+ let attempt = 0;
936
+ let keysToFetch = chunk3;
937
+ while (keysToFetch.length > 0 && attempt <= maxRetries) {
938
+ if (attempt > 0) {
939
+ const delay = backoffDelay(attempt);
940
+ console.log(
941
+ `[info] [ddb] [batchGet]: Retrying ${keysToFetch.length} keys (attempt ${attempt}/${maxRetries}) after ${delay}ms`
942
+ );
943
+ await sleep3(delay);
944
+ }
945
+ try {
946
+ const command = new libDynamodb.BatchGetCommand({
947
+ RequestItems: {
948
+ [TableName]: { Keys: keysToFetch, ConsistentRead: strong }
949
+ }
950
+ });
951
+ const result = await ddb.client.send(command);
952
+ const items = result.Responses?.[TableName] ?? [];
953
+ allItems.push(...items);
954
+ if (result.ConsumedCapacity) {
955
+ totalConsumedCapacity += result.ConsumedCapacity.reduce(
956
+ (sum, cap) => sum + (cap.CapacityUnits ?? 0),
957
+ 0
958
+ );
959
+ }
960
+ const unprocessed = result.UnprocessedKeys?.[TableName]?.Keys;
961
+ if (unprocessed && unprocessed.length > 0) {
962
+ keysToFetch = unprocessed;
963
+ attempt++;
964
+ } else {
965
+ keysToFetch = [];
966
+ }
967
+ } catch (error2) {
968
+ console.log(
969
+ `[error] [ddb] [batchGet]: Error fetching chunk (attempt ${attempt}/${maxRetries}):`,
970
+ error2
971
+ );
972
+ if (attempt >= maxRetries) throw error2;
973
+ attempt++;
974
+ }
975
+ }
976
+ if (keysToFetch.length > 0) {
977
+ console.log(
978
+ `[error] [ddb] [batchGet]: Failed to fetch ${keysToFetch.length} keys after ${maxRetries} retries`
979
+ );
980
+ }
981
+ }
982
+ const missing = requestedCount - allItems.length;
983
+ return {
984
+ missing,
985
+ items: allItems,
986
+ count: allItems.length,
987
+ consumedCapacity: totalConsumedCapacity || void 0
988
+ };
989
+ }
990
+ async function batchWrite(ddb, props) {
991
+ const { maxRetries = 3 } = props;
992
+ const TableName = props.tableName ?? ddb.tableName;
993
+ const items = props.transform ? props.items.map(props.transform) : props.items;
994
+ const hasConditions = items.some((x) => x.cond);
995
+ const chunkSize = hasConditions ? 100 : 25;
996
+ const chunks = chunk2(items, chunkSize);
997
+ let processedCount = 0;
998
+ let failedCount = 0;
999
+ let totalConsumedCapacity = 0;
1000
+ for (const chunk3 of chunks) {
1001
+ let attempt = 0;
1002
+ let itemsToWrite = chunk3;
1003
+ while (itemsToWrite.length > 0 && attempt <= maxRetries) {
1004
+ if (attempt > 0) {
1005
+ const delay = backoffDelay(attempt);
1006
+ console.log(
1007
+ `[info] [ddb] [batchWrite]: Retrying ${itemsToWrite.length} items (attempt ${attempt}/${maxRetries}) after ${delay}ms`
1008
+ );
1009
+ await sleep3(delay);
1010
+ }
1011
+ try {
1012
+ if (hasConditions) {
1013
+ const transactItems = itemsToWrite.map((x) => ({
1014
+ Put: {
1015
+ TableName,
1016
+ Item: x.item,
1017
+ ...x.cond && { ConditionExpression: x.cond }
1018
+ }
1019
+ }));
1020
+ const command = new libDynamodb.TransactWriteCommand({
1021
+ TransactItems: transactItems
1022
+ });
1023
+ const result = await ddb.client.send(command);
1024
+ if (result.ConsumedCapacity) {
1025
+ totalConsumedCapacity += result.ConsumedCapacity.reduce(
1026
+ (sum, cap) => sum + (cap.CapacityUnits ?? 0),
1027
+ 0
1028
+ );
1029
+ }
1030
+ processedCount += itemsToWrite.length;
1031
+ itemsToWrite = [];
1032
+ } else {
1033
+ const writeRequests = itemsToWrite.map((x) => ({
1034
+ PutRequest: { Item: x.item }
1035
+ }));
1036
+ const command = new libDynamodb.BatchWriteCommand({
1037
+ RequestItems: { [TableName]: writeRequests }
1038
+ });
1039
+ const result = await ddb.client.send(command);
1040
+ if (result.ConsumedCapacity) {
1041
+ totalConsumedCapacity += result.ConsumedCapacity.reduce(
1042
+ (sum, cap) => sum + (cap.CapacityUnits ?? 0),
1043
+ 0
1044
+ );
1045
+ }
1046
+ const unprocessed = result.UnprocessedItems?.[TableName];
1047
+ if (unprocessed && unprocessed.length > 0) {
1048
+ itemsToWrite = unprocessed.map((req) => ({
1049
+ item: req.PutRequest.Item
1050
+ }));
1051
+ processedCount += chunk3.length - itemsToWrite.length;
1052
+ attempt++;
1053
+ } else {
1054
+ processedCount += itemsToWrite.length;
1055
+ itemsToWrite = [];
1056
+ }
1057
+ }
1058
+ } catch (error2) {
1059
+ console.log(
1060
+ `[error] [ddb] [batchWrite]: Error writing chunk (attempt ${attempt}/${maxRetries}):`,
1061
+ error2
1062
+ );
1063
+ if (attempt >= maxRetries) {
1064
+ failedCount += itemsToWrite.length;
1065
+ itemsToWrite = [];
1066
+ } else {
1067
+ attempt++;
1068
+ }
1069
+ }
1070
+ }
1071
+ if (itemsToWrite.length > 0) {
1072
+ console.log(
1073
+ `[error] [ddb] [batchWrite]: Failed to write ${itemsToWrite.length} items after ${maxRetries} retries`
1074
+ );
1075
+ failedCount += itemsToWrite.length;
1076
+ }
1077
+ }
1078
+ return {
1079
+ failed: failedCount,
1080
+ processed: processedCount,
1081
+ consumedCapacity: totalConsumedCapacity || void 0
1082
+ };
1083
+ }
1084
+ async function batchDelete(ddb, props) {
1085
+ const { maxRetries = 3 } = props;
1086
+ const TableName = props.tableName ?? ddb.tableName;
1087
+ const keys = props.transform ? props.keys.map(props.transform) : props.keys;
1088
+ const hasConditions = keys.some((x) => x.cond);
1089
+ const chunkSize = hasConditions ? 100 : 25;
1090
+ const chunks = chunk2(keys, chunkSize);
1091
+ let processedCount = 0;
1092
+ let failedCount = 0;
1093
+ let totalConsumedCapacity = 0;
1094
+ for (const chunk3 of chunks) {
1095
+ let attempt = 0;
1096
+ let itemsToDelete = chunk3;
1097
+ while (itemsToDelete.length > 0 && attempt <= maxRetries) {
1098
+ if (attempt > 0) {
1099
+ const delay = backoffDelay(attempt);
1100
+ console.log(
1101
+ `[info] [ddb] [batchDelete]: Retrying ${itemsToDelete.length} items (attempt ${attempt}/${maxRetries}) after ${delay}ms`
1102
+ );
1103
+ await sleep3(delay);
1104
+ }
1105
+ try {
1106
+ if (hasConditions) {
1107
+ const transactItems = itemsToDelete.map((x) => ({
1108
+ Delete: {
1109
+ TableName,
1110
+ Key: x.key,
1111
+ ...x.cond && { ConditionExpression: x.cond }
1112
+ }
1113
+ }));
1114
+ const command = new libDynamodb.TransactWriteCommand({
1115
+ TransactItems: transactItems
1116
+ });
1117
+ const result = await ddb.client.send(command);
1118
+ if (result.ConsumedCapacity) {
1119
+ totalConsumedCapacity += result.ConsumedCapacity.reduce(
1120
+ (sum, cap) => sum + (cap.CapacityUnits ?? 0),
1121
+ 0
1122
+ );
1123
+ }
1124
+ processedCount += itemsToDelete.length;
1125
+ itemsToDelete = [];
1126
+ } else {
1127
+ const writeRequests = itemsToDelete.map((x) => ({
1128
+ DeleteRequest: { Key: x.key }
1129
+ }));
1130
+ const command = new libDynamodb.BatchWriteCommand({
1131
+ RequestItems: { [TableName]: writeRequests }
1132
+ });
1133
+ const result = await ddb.client.send(command);
1134
+ if (result.ConsumedCapacity) {
1135
+ totalConsumedCapacity += result.ConsumedCapacity.reduce(
1136
+ (sum, cap) => sum + (cap.CapacityUnits ?? 0),
1137
+ 0
1138
+ );
1139
+ }
1140
+ const unprocessed = result.UnprocessedItems?.[TableName];
1141
+ if (unprocessed && unprocessed.length > 0) {
1142
+ itemsToDelete = unprocessed.map((req) => ({
1143
+ key: req.DeleteRequest.Key
1144
+ }));
1145
+ processedCount += chunk3.length - itemsToDelete.length;
1146
+ attempt++;
1147
+ } else {
1148
+ processedCount += itemsToDelete.length;
1149
+ itemsToDelete = [];
1150
+ }
1151
+ }
1152
+ } catch (error2) {
1153
+ console.log(
1154
+ `[error] [ddb] [batchDelete]: Error deleting chunk (attempt ${attempt}/${maxRetries}):`,
1155
+ error2
1156
+ );
1157
+ if (attempt >= maxRetries) {
1158
+ failedCount += itemsToDelete.length;
1159
+ itemsToDelete = [];
1160
+ } else {
1161
+ attempt++;
1162
+ }
1163
+ }
1164
+ }
1165
+ if (itemsToDelete.length > 0) {
1166
+ console.log(
1167
+ `[error] [ddb] [batchDelete]: Failed to delete ${itemsToDelete.length} items after ${maxRetries} retries`
1168
+ );
1169
+ failedCount += itemsToDelete.length;
1170
+ }
1171
+ }
1172
+ return {
1173
+ failed: failedCount,
1174
+ processed: processedCount,
1175
+ consumedCapacity: totalConsumedCapacity || void 0
1176
+ };
1177
+ }
1178
+ var deleteTable = (ddb, tableName) => {
1179
+ const TableName = tableName;
1180
+ const command = new clientDynamodb.DeleteTableCommand({ TableName });
1181
+ return ddb.client.send(command);
1182
+ };
1183
+ var tableExists = async (ddb, props) => {
1184
+ try {
1185
+ const TableName = props.tableName;
1186
+ const command = new clientDynamodb.DescribeTableCommand({ TableName });
1187
+ await ddb.client.send(command);
1188
+ return true;
1189
+ } catch (err) {
1190
+ if (err instanceof clientDynamodb.DynamoDBServiceException) {
1191
+ if (err.name === "ResourceNotFoundException" || err.$metadata.httpStatusCode === 400) {
1192
+ return false;
1193
+ }
1194
+ }
1195
+ throw err;
1196
+ }
1197
+ };
1198
+
1199
+ // src/server/aws/ddb/literals.ts
1200
+ var lsi = { name: "lsi", sk: "lsi" };
1201
+ var lsi2 = { name: "lsi2", sk: "lsi2" };
1202
+ var lsiUsername = {
1203
+ name: "username-lsi",
1204
+ sk: "username"
1205
+ };
1206
+ var lsiNormalized = {
1207
+ /** use in index_name */
1208
+ name: "normalized-lsi",
1209
+ sk: "normalized"
1210
+ };
1211
+ var lsiPhash = {
1212
+ /** use in index_name */
1213
+ name: "phash-lsi",
1214
+ sk: "phash"
1215
+ };
1216
+
1217
+ exports.DDB = ddb_exports;
619
1218
  exports.Dict = dict_exports;
620
1219
  exports.File = file_exports;
621
1220
  exports.Flow = flow_exports;
@@ -8,4 +8,5 @@ export * as Flow from "../shared/flow";
8
8
  export * as Random from "../shared/random";
9
9
  export * as Log from "../shared/log";
10
10
  export * as File from "./file";
11
+ export * as DDB from "./aws/ddb";
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AACvC,OAAO,KAAK,GAAG,MAAM,eAAe,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,eAAe,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAC;AACzC,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AACvC,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAC3C,OAAO,KAAK,GAAG,MAAM,eAAe,CAAC;AAGrC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AACvC,OAAO,KAAK,GAAG,MAAM,eAAe,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,eAAe,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAC;AACzC,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AACvC,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAC3C,OAAO,KAAK,GAAG,MAAM,eAAe,CAAC;AAGrC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,GAAG,MAAM,WAAW,CAAC"}