applesauce-sqlite 0.0.0-next-20251117143754 → 0.0.0-next-20251203172109

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,10 +1,10 @@
1
- import { FilterWithAnd, NostrEvent } from "applesauce-core/helpers";
1
+ import { Filter, NostrEvent } from "applesauce-core/helpers";
2
2
  import type { Statement } from "./statements.js";
3
3
  export declare const CREATE_SEARCH_TABLE_STATEMENT: Statement<[]>;
4
4
  export declare const INSERT_SEARCH_CONTENT_STATEMENT: Statement<[string, string, number, string, number]>;
5
5
  export declare const DELETE_SEARCH_CONTENT_STATEMENT: Statement<[string]>;
6
- /** Filter with search field and NIP-ND AND operator support */
7
- export type FilterWithSearch = FilterWithAnd & {
6
+ /** Filter with search field and NIP-91 AND operator support */
7
+ export type FilterWithSearch = Filter & {
8
8
  search?: string;
9
9
  order?: "created_at" | "rank";
10
10
  };
@@ -49,7 +49,7 @@ export function buildFilterConditions(filter) {
49
49
  conditions.push(`events.created_at <= ?`);
50
50
  params.push(filter.until);
51
51
  }
52
- // Handle AND tag filters (& prefix) first - NIP-ND
52
+ // Handle AND tag filters (& prefix) first - NIP-91
53
53
  // AND takes precedence and requires ALL values to be present
54
54
  for (const [key, values] of Object.entries(filter)) {
55
55
  if (key.startsWith("&") && values && Array.isArray(values) && values.length > 0) {
@@ -69,14 +69,14 @@ export function buildFilterConditions(filter) {
69
69
  }
70
70
  }
71
71
  // Handle OR tag filters (# prefix)
72
- // Skip values that are in AND tags (NIP-ND rule)
72
+ // Skip values that are in AND tags (NIP-91 rule)
73
73
  for (const [key, values] of Object.entries(filter)) {
74
74
  if (key.startsWith("#") && values && Array.isArray(values) && values.length > 0) {
75
75
  const tagName = key.slice(1); // Remove the '#' prefix
76
76
  // Check if there's a corresponding AND filter for this tag
77
77
  const andKey = `&${tagName}`;
78
78
  const andValues = filter[andKey];
79
- // Filter out values that are in AND tags (NIP-ND rule)
79
+ // Filter out values that are in AND tags (NIP-91 rule)
80
80
  const filteredValues = andValues
81
81
  ? values.filter((v) => !andValues.includes(v))
82
82
  : values;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "applesauce-sqlite",
3
- "version": "0.0.0-next-20251117143754",
3
+ "version": "0.0.0-next-20251203172109",
4
4
  "description": "sqlite event databases for applesauce",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -102,7 +102,7 @@
102
102
  }
103
103
  },
104
104
  "dependencies": {
105
- "applesauce-core": "0.0.0-next-20251117143754"
105
+ "applesauce-core": "0.0.0-next-20251203172109"
106
106
  },
107
107
  "optionalDependencies": {
108
108
  "@libsql/client": "^0.15.15",
@@ -113,12 +113,11 @@
113
113
  "devDependencies": {
114
114
  "@hirez_io/observer-spy": "^2.2.0",
115
115
  "@types/better-sqlite3": "^7.6.13",
116
- "@types/ws": "^8.5.13",
117
- "applesauce-signers": "^4.1.0",
118
- "nostr-tools": "^2.17.0",
119
- "rimraf": "^6.0.1",
120
- "typescript": "^5.7.3",
121
- "vitest": "^3.2.4",
116
+ "@types/ws": "^8.18.1",
117
+ "applesauce-signers": "0.0.0-next-20251203172109",
118
+ "rimraf": "^6.1.2",
119
+ "typescript": "^5.9.3",
120
+ "vitest": "^4.0.15",
122
121
  "vitest-websocket-mock": "^0.5.0",
123
122
  "ws": "^8.18.3"
124
123
  },