qstd 0.3.77 → 0.3.78

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.
@@ -1,30 +1,47 @@
1
1
  /**
2
- * these 2 lsis should solve all future lsis. Lsi can be a
3
- * generic type that has different sk based on the pk.
4
- * E.g. pkUser can store username in lsi and pkDocument
5
- * can store id. By lsi being a generic field, can serve
6
- * the role of multiple lsis.
2
+ * Generic LSIs (1-5) for flexible querying.
3
+ *
4
+ * DynamoDB allows max 5 LSIs per table. These generic LSIs can store
5
+ * different values per partition key, enabling flexible query patterns.
6
+ *
7
+ * Since LSIs are local to each partition, the same LSI attribute can
8
+ * serve different purposes across partitions.
9
+ *
10
+ * @example
11
+ * // pk="user" partition
12
+ * lsi1: username - query users by username
13
+ * lsi2: normalized - query by normalized name for search
14
+ * lsi3: email - query users by email
15
+ *
16
+ * // pk="media" partition
17
+ * lsi1: type#<createdAt> - filter by type, sort by created
18
+ * lsi2: created#<ts> - sort by created date
19
+ * lsi3: plays#<count> - sort by play count
20
+ * lsi4: fingerprint#<h> - find by perceptual hash
21
+ * lsi5: lastPlayed#<ts> - sort by last played
22
+ *
23
+ * // pk="image" partition
24
+ * lsi1: phash#<hash> - find by perceptual hash (dHash)
25
+ * lsi2: created#<ts> - sort by created date
7
26
  */
8
- export declare const lsi: {
9
- readonly name: "lsi";
10
- readonly sk: "lsi";
27
+ export declare const lsi1: {
28
+ readonly name: "lsi1";
29
+ readonly sk: "lsi1";
11
30
  };
12
31
  export declare const lsi2: {
13
32
  readonly name: "lsi2";
14
33
  readonly sk: "lsi2";
15
34
  };
16
- export declare const lsiUsername: {
17
- readonly name: "username-lsi";
18
- readonly sk: "username";
35
+ export declare const lsi3: {
36
+ readonly name: "lsi3";
37
+ readonly sk: "lsi3";
19
38
  };
20
- export declare const lsiNormalized: {
21
- /** use in index_name */
22
- readonly name: "normalized-lsi";
23
- readonly sk: "normalized";
39
+ export declare const lsi4: {
40
+ readonly name: "lsi4";
41
+ readonly sk: "lsi4";
24
42
  };
25
- export declare const lsiPhash: {
26
- /** use in index_name */
27
- readonly name: "phash-lsi";
28
- readonly sk: "phash";
43
+ export declare const lsi5: {
44
+ readonly name: "lsi5";
45
+ readonly sk: "lsi5";
29
46
  };
30
47
  //# sourceMappingURL=literals.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"literals.d.ts","sourceRoot":"","sources":["../../../../src/server/aws/ddb/literals.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,GAAG;;;CAAsC,CAAC;AACvD,eAAO,MAAM,IAAI;;;CAAwC,CAAC;AAE1D,eAAO,MAAM,WAAW;;;CAGd,CAAC;AAGX,eAAO,MAAM,aAAa;IACxB,wBAAwB;;;CAGhB,CAAC;AAGX,eAAO,MAAM,QAAQ;IACnB,wBAAwB;;;CAGhB,CAAC"}
1
+ {"version":3,"file":"literals.d.ts","sourceRoot":"","sources":["../../../../src/server/aws/ddb/literals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,IAAI;;;CAAwC,CAAC;AAC1D,eAAO,MAAM,IAAI;;;CAAwC,CAAC;AAC1D,eAAO,MAAM,IAAI;;;CAAwC,CAAC;AAC1D,eAAO,MAAM,IAAI;;;CAAwC,CAAC;AAC1D,eAAO,MAAM,IAAI;;;CAAwC,CAAC"}
@@ -1223,11 +1223,11 @@ __export(ddb_exports, {
1223
1223
  create: () => create2,
1224
1224
  deleteTable: () => deleteTable,
1225
1225
  find: () => find,
1226
- lsi: () => lsi,
1226
+ lsi1: () => lsi1,
1227
1227
  lsi2: () => lsi2,
1228
- lsiNormalized: () => lsiNormalized,
1229
- lsiPhash: () => lsiPhash,
1230
- lsiUsername: () => lsiUsername,
1228
+ lsi3: () => lsi3,
1229
+ lsi4: () => lsi4,
1230
+ lsi5: () => lsi5,
1231
1231
  remove: () => remove2,
1232
1232
  save: () => save,
1233
1233
  tableExists: () => tableExists
@@ -1803,22 +1803,11 @@ var tableExists = async (ddb, props) => {
1803
1803
  };
1804
1804
 
1805
1805
  // src/server/aws/ddb/literals.ts
1806
- var lsi = { name: "lsi", sk: "lsi" };
1806
+ var lsi1 = { name: "lsi1", sk: "lsi1" };
1807
1807
  var lsi2 = { name: "lsi2", sk: "lsi2" };
1808
- var lsiUsername = {
1809
- name: "username-lsi",
1810
- sk: "username"
1811
- };
1812
- var lsiNormalized = {
1813
- /** use in index_name */
1814
- name: "normalized-lsi",
1815
- sk: "normalized"
1816
- };
1817
- var lsiPhash = {
1818
- /** use in index_name */
1819
- name: "phash-lsi",
1820
- sk: "phash"
1821
- };
1808
+ var lsi3 = { name: "lsi3", sk: "lsi3" };
1809
+ var lsi4 = { name: "lsi4", sk: "lsi4" };
1810
+ var lsi5 = { name: "lsi5", sk: "lsi5" };
1822
1811
  var validateTableName = (tableName) => {
1823
1812
  const regex = /^[a-zA-Z0-9_.-]{3,255}$/;
1824
1813
  if (!regex.test(tableName)) {
@@ -1844,10 +1833,10 @@ var clearTableSchema = (table) => {
1844
1833
  }
1845
1834
  if (table.LocalSecondaryIndexes && table.LocalSecondaryIndexes.length > 0) {
1846
1835
  cleanTable.LocalSecondaryIndexes = table.LocalSecondaryIndexes.map(
1847
- (lsi3) => ({
1848
- IndexName: lsi3.IndexName,
1849
- KeySchema: lsi3.KeySchema,
1850
- Projection: lsi3.Projection
1836
+ (lsi) => ({
1837
+ IndexName: lsi.IndexName,
1838
+ KeySchema: lsi.KeySchema,
1839
+ Projection: lsi.Projection
1851
1840
  })
1852
1841
  );
1853
1842
  }
@@ -1215,11 +1215,11 @@ __export(ddb_exports, {
1215
1215
  create: () => create2,
1216
1216
  deleteTable: () => deleteTable,
1217
1217
  find: () => find,
1218
- lsi: () => lsi,
1218
+ lsi1: () => lsi1,
1219
1219
  lsi2: () => lsi2,
1220
- lsiNormalized: () => lsiNormalized,
1221
- lsiPhash: () => lsiPhash,
1222
- lsiUsername: () => lsiUsername,
1220
+ lsi3: () => lsi3,
1221
+ lsi4: () => lsi4,
1222
+ lsi5: () => lsi5,
1223
1223
  remove: () => remove2,
1224
1224
  save: () => save,
1225
1225
  tableExists: () => tableExists
@@ -1795,22 +1795,11 @@ var tableExists = async (ddb, props) => {
1795
1795
  };
1796
1796
 
1797
1797
  // src/server/aws/ddb/literals.ts
1798
- var lsi = { name: "lsi", sk: "lsi" };
1798
+ var lsi1 = { name: "lsi1", sk: "lsi1" };
1799
1799
  var lsi2 = { name: "lsi2", sk: "lsi2" };
1800
- var lsiUsername = {
1801
- name: "username-lsi",
1802
- sk: "username"
1803
- };
1804
- var lsiNormalized = {
1805
- /** use in index_name */
1806
- name: "normalized-lsi",
1807
- sk: "normalized"
1808
- };
1809
- var lsiPhash = {
1810
- /** use in index_name */
1811
- name: "phash-lsi",
1812
- sk: "phash"
1813
- };
1800
+ var lsi3 = { name: "lsi3", sk: "lsi3" };
1801
+ var lsi4 = { name: "lsi4", sk: "lsi4" };
1802
+ var lsi5 = { name: "lsi5", sk: "lsi5" };
1814
1803
  var validateTableName = (tableName) => {
1815
1804
  const regex = /^[a-zA-Z0-9_.-]{3,255}$/;
1816
1805
  if (!regex.test(tableName)) {
@@ -1836,10 +1825,10 @@ var clearTableSchema = (table) => {
1836
1825
  }
1837
1826
  if (table.LocalSecondaryIndexes && table.LocalSecondaryIndexes.length > 0) {
1838
1827
  cleanTable.LocalSecondaryIndexes = table.LocalSecondaryIndexes.map(
1839
- (lsi3) => ({
1840
- IndexName: lsi3.IndexName,
1841
- KeySchema: lsi3.KeySchema,
1842
- Projection: lsi3.Projection
1828
+ (lsi) => ({
1829
+ IndexName: lsi.IndexName,
1830
+ KeySchema: lsi.KeySchema,
1831
+ Projection: lsi.Projection
1843
1832
  })
1844
1833
  );
1845
1834
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qstd",
3
- "version": "0.3.77",
3
+ "version": "0.3.78",
4
4
  "description": "Standard Block component and utilities library with Panda CSS",
5
5
  "author": "malin1",
6
6
  "license": "MIT",