shelving 1.77.0 → 1.80.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 (313) hide show
  1. package/{api → modules/api}/Resource.d.ts +0 -0
  2. package/{api → modules/api}/Resource.js +0 -0
  3. package/{api → modules/api}/index.d.ts +0 -0
  4. package/{api → modules/api}/index.js +0 -0
  5. package/{constraint → modules/constraint}/Constraint.d.ts +0 -0
  6. package/{constraint → modules/constraint}/Constraint.js +0 -0
  7. package/{constraint → modules/constraint}/Constraints.d.ts +0 -0
  8. package/{constraint → modules/constraint}/Constraints.js +2 -2
  9. package/{constraint → modules/constraint}/FilterConstraint.d.ts +1 -1
  10. package/{constraint → modules/constraint}/FilterConstraint.js +0 -0
  11. package/{constraint → modules/constraint}/FilterConstraints.d.ts +0 -0
  12. package/{constraint → modules/constraint}/FilterConstraints.js +0 -0
  13. package/{constraint → modules/constraint}/QueryConstraints.d.ts +1 -1
  14. package/{constraint → modules/constraint}/QueryConstraints.js +1 -1
  15. package/{constraint → modules/constraint}/SortConstraint.d.ts +0 -0
  16. package/{constraint → modules/constraint}/SortConstraint.js +0 -0
  17. package/{constraint → modules/constraint}/SortConstraints.d.ts +0 -0
  18. package/{constraint → modules/constraint}/SortConstraints.js +0 -0
  19. package/{constraint → modules/constraint}/index.d.ts +0 -0
  20. package/{constraint → modules/constraint}/index.js +0 -0
  21. package/{db → modules/db}/Change.d.ts +9 -12
  22. package/{db → modules/db}/Change.js +2 -2
  23. package/{db → modules/db}/Collection.d.ts +34 -6
  24. package/{db → modules/db}/Collection.js +47 -7
  25. package/modules/db/Database.d.ts +76 -0
  26. package/modules/db/Database.js +95 -0
  27. package/{db → modules/db}/Item.d.ts +9 -9
  28. package/{db → modules/db}/Item.js +19 -21
  29. package/{db → modules/db}/Query.d.ts +4 -4
  30. package/{db → modules/db}/Query.js +2 -3
  31. package/{db → modules/db}/index.d.ts +0 -0
  32. package/{db → modules/db}/index.js +0 -0
  33. package/{error → modules/error}/AssertionError.d.ts +0 -0
  34. package/{error → modules/error}/AssertionError.js +0 -0
  35. package/{error → modules/error}/ConditionError.d.ts +0 -0
  36. package/{error → modules/error}/ConditionError.js +0 -0
  37. package/{error → modules/error}/PermissionError.d.ts +0 -0
  38. package/{error → modules/error}/PermissionError.js +0 -0
  39. package/{error → modules/error}/RequiredError.d.ts +0 -0
  40. package/{error → modules/error}/RequiredError.js +0 -0
  41. package/{error → modules/error}/ThroughError.d.ts +0 -0
  42. package/{error → modules/error}/ThroughError.js +0 -0
  43. package/{error → modules/error}/UnsupportedError.d.ts +0 -0
  44. package/{error → modules/error}/UnsupportedError.js +0 -0
  45. package/{error → modules/error}/ValidationError.d.ts +0 -0
  46. package/{error → modules/error}/ValidationError.js +0 -0
  47. package/{error → modules/error}/index.d.ts +0 -0
  48. package/{error → modules/error}/index.js +0 -0
  49. package/{feedback → modules/feedback}/ErrorFeedback.d.ts +0 -0
  50. package/{feedback → modules/feedback}/ErrorFeedback.js +1 -5
  51. package/{feedback → modules/feedback}/Feedback.d.ts +0 -0
  52. package/{feedback → modules/feedback}/Feedback.js +1 -5
  53. package/{feedback → modules/feedback}/InvalidFeedback.d.ts +0 -0
  54. package/{feedback → modules/feedback}/InvalidFeedback.js +1 -5
  55. package/{feedback → modules/feedback}/SuccessFeedback.d.ts +0 -0
  56. package/{feedback → modules/feedback}/SuccessFeedback.js +1 -5
  57. package/{feedback → modules/feedback}/WarningFeedback.d.ts +0 -0
  58. package/{feedback → modules/feedback}/WarningFeedback.js +1 -5
  59. package/{feedback → modules/feedback}/hydrations.d.ts +0 -0
  60. package/{feedback → modules/feedback}/hydrations.js +0 -0
  61. package/{feedback → modules/feedback}/index.d.ts +0 -0
  62. package/{feedback → modules/feedback}/index.js +0 -0
  63. package/{firestore → modules/firestore}/client/FirestoreClientProvider.d.ts +3 -3
  64. package/{firestore → modules/firestore}/client/FirestoreClientProvider.js +4 -4
  65. package/{firestore → modules/firestore}/client/index.d.ts +0 -0
  66. package/{firestore → modules/firestore}/client/index.js +0 -0
  67. package/{firestore → modules/firestore}/lite/FirestoreLiteProvider.d.ts +3 -3
  68. package/{firestore → modules/firestore}/lite/FirestoreLiteProvider.js +4 -4
  69. package/{firestore → modules/firestore}/lite/index.d.ts +0 -0
  70. package/{firestore → modules/firestore}/lite/index.js +0 -0
  71. package/{firestore → modules/firestore}/server/FirestoreServerProvider.d.ts +3 -3
  72. package/{firestore → modules/firestore}/server/FirestoreServerProvider.js +4 -4
  73. package/{firestore → modules/firestore}/server/index.d.ts +0 -0
  74. package/{firestore → modules/firestore}/server/index.js +0 -0
  75. package/{index.d.ts → modules/index.d.ts} +0 -0
  76. package/{index.js → modules/index.js} +0 -0
  77. package/{markup → modules/markup}/index.d.ts +0 -0
  78. package/{markup → modules/markup}/index.js +0 -0
  79. package/{markup → modules/markup}/options.d.ts +0 -0
  80. package/{markup → modules/markup}/options.js +0 -0
  81. package/{markup → modules/markup}/regexp.d.ts +0 -0
  82. package/{markup → modules/markup}/regexp.js +0 -0
  83. package/{markup → modules/markup}/render.d.ts +0 -0
  84. package/{markup → modules/markup}/render.js +0 -0
  85. package/{markup → modules/markup}/rules.d.ts +0 -0
  86. package/{markup → modules/markup}/rules.js +0 -0
  87. package/{observe → modules/observe}/AbstractObserver.d.ts +0 -0
  88. package/{observe → modules/observe}/AbstractObserver.js +0 -0
  89. package/{observe → modules/observe}/AsyncObserver.d.ts +0 -0
  90. package/{observe → modules/observe}/AsyncObserver.js +0 -0
  91. package/{observe → modules/observe}/LastSubject.d.ts +0 -0
  92. package/{observe → modules/observe}/LastSubject.js +0 -0
  93. package/{observe → modules/observe}/MatchObserver.d.ts +0 -0
  94. package/{observe → modules/observe}/MatchObserver.js +0 -0
  95. package/{observe → modules/observe}/MatchableObserver.d.ts +0 -0
  96. package/{observe → modules/observe}/MatchableObserver.js +0 -0
  97. package/{observe → modules/observe}/Observable.d.ts +0 -0
  98. package/{observe → modules/observe}/Observable.js +0 -0
  99. package/{observe → modules/observe}/Observer.d.ts +0 -0
  100. package/{observe → modules/observe}/Observer.js +0 -0
  101. package/{observe → modules/observe}/OnceObserver.d.ts +0 -0
  102. package/{observe → modules/observe}/OnceObserver.js +0 -0
  103. package/{observe → modules/observe}/Subject.d.ts +0 -0
  104. package/{observe → modules/observe}/Subject.js +0 -0
  105. package/{observe → modules/observe}/ThroughObserver.d.ts +0 -0
  106. package/{observe → modules/observe}/ThroughObserver.js +0 -0
  107. package/{observe → modules/observe}/TransformObserver.d.ts +0 -0
  108. package/{observe → modules/observe}/TransformObserver.js +0 -0
  109. package/{observe → modules/observe}/TransformableObserver.d.ts +0 -0
  110. package/{observe → modules/observe}/TransformableObserver.js +0 -0
  111. package/{observe → modules/observe}/index.d.ts +0 -0
  112. package/{observe → modules/observe}/index.js +0 -0
  113. package/{observe → modules/observe}/util.d.ts +0 -0
  114. package/{observe → modules/observe}/util.js +0 -0
  115. package/{provider → modules/provider}/BatchProvider.d.ts +0 -0
  116. package/{provider → modules/provider}/BatchProvider.js +0 -0
  117. package/{provider → modules/provider}/CacheProvider.d.ts +3 -3
  118. package/{provider → modules/provider}/CacheProvider.js +6 -6
  119. package/{provider → modules/provider}/DebugProvider.d.ts +5 -5
  120. package/{provider → modules/provider}/DebugProvider.js +12 -12
  121. package/{provider → modules/provider}/MemoryProvider.d.ts +5 -5
  122. package/{provider → modules/provider}/MemoryProvider.js +9 -8
  123. package/{provider → modules/provider}/Provider.d.ts +7 -7
  124. package/{provider → modules/provider}/Provider.js +0 -0
  125. package/{provider → modules/provider}/ThroughProvider.d.ts +5 -5
  126. package/{provider → modules/provider}/ThroughProvider.js +4 -4
  127. package/{provider → modules/provider}/ValidationProvider.d.ts +11 -11
  128. package/{provider → modules/provider}/ValidationProvider.js +29 -28
  129. package/{provider → modules/provider}/index.d.ts +0 -0
  130. package/{provider → modules/provider}/index.js +0 -0
  131. package/{react → modules/react}/index.d.ts +0 -0
  132. package/{react → modules/react}/index.js +0 -0
  133. package/{react → modules/react}/useCache.d.ts +0 -0
  134. package/{react → modules/react}/useCache.js +0 -0
  135. package/{react → modules/react}/useInstance.d.ts +0 -0
  136. package/{react → modules/react}/useInstance.js +0 -0
  137. package/{react → modules/react}/useItem.d.ts +0 -0
  138. package/{react → modules/react}/useItem.js +0 -0
  139. package/{react → modules/react}/useLazy.d.ts +0 -0
  140. package/{react → modules/react}/useLazy.js +0 -0
  141. package/{react → modules/react}/useQuery.d.ts +0 -0
  142. package/{react → modules/react}/useQuery.js +0 -0
  143. package/{react → modules/react}/useReduce.d.ts +0 -0
  144. package/{react → modules/react}/useReduce.js +0 -0
  145. package/{react → modules/react}/useSubscribe.d.ts +0 -0
  146. package/{react → modules/react}/useSubscribe.js +0 -0
  147. package/{schema → modules/schema}/AllowSchema.d.ts +0 -0
  148. package/{schema → modules/schema}/AllowSchema.js +2 -2
  149. package/{schema → modules/schema}/ArraySchema.d.ts +0 -0
  150. package/{schema → modules/schema}/ArraySchema.js +0 -0
  151. package/{schema → modules/schema}/BooleanSchema.d.ts +0 -0
  152. package/{schema → modules/schema}/BooleanSchema.js +0 -0
  153. package/{schema → modules/schema}/ColorSchema.d.ts +0 -0
  154. package/{schema → modules/schema}/ColorSchema.js +0 -0
  155. package/{schema → modules/schema}/DataSchema.d.ts +5 -1
  156. package/{schema → modules/schema}/DataSchema.js +0 -0
  157. package/{schema → modules/schema}/DateSchema.d.ts +0 -0
  158. package/{schema → modules/schema}/DateSchema.js +0 -0
  159. package/{schema → modules/schema}/EmailSchema.d.ts +0 -0
  160. package/{schema → modules/schema}/EmailSchema.js +0 -0
  161. package/{schema → modules/schema}/KeySchema.d.ts +0 -0
  162. package/{schema → modules/schema}/KeySchema.js +0 -0
  163. package/{schema → modules/schema}/LinkSchema.d.ts +0 -0
  164. package/{schema → modules/schema}/LinkSchema.js +0 -0
  165. package/{schema → modules/schema}/NumberSchema.d.ts +0 -0
  166. package/{schema → modules/schema}/NumberSchema.js +0 -0
  167. package/{schema → modules/schema}/ObjectSchema.d.ts +0 -0
  168. package/{schema → modules/schema}/ObjectSchema.js +0 -0
  169. package/{schema → modules/schema}/OptionalSchema.d.ts +0 -0
  170. package/{schema → modules/schema}/OptionalSchema.js +0 -0
  171. package/{schema → modules/schema}/PhoneSchema.d.ts +0 -0
  172. package/{schema → modules/schema}/PhoneSchema.js +0 -0
  173. package/{schema → modules/schema}/RequiredSchema.d.ts +0 -0
  174. package/{schema → modules/schema}/RequiredSchema.js +0 -0
  175. package/{schema → modules/schema}/Schema.d.ts +0 -0
  176. package/{schema → modules/schema}/Schema.js +0 -0
  177. package/{schema → modules/schema}/SlugSchema.d.ts +0 -0
  178. package/{schema → modules/schema}/SlugSchema.js +0 -0
  179. package/{schema → modules/schema}/StringSchema.d.ts +0 -0
  180. package/{schema → modules/schema}/StringSchema.js +0 -0
  181. package/{schema → modules/schema}/ThroughSchema.d.ts +0 -0
  182. package/{schema → modules/schema}/ThroughSchema.js +0 -0
  183. package/{schema → modules/schema}/index.d.ts +0 -0
  184. package/{schema → modules/schema}/index.js +0 -0
  185. package/{state → modules/state}/ArrayState.d.ts +6 -8
  186. package/modules/state/ArrayState.js +28 -0
  187. package/{state → modules/state}/BooleanState.d.ts +0 -0
  188. package/{state → modules/state}/BooleanState.js +0 -0
  189. package/{state → modules/state}/DataState.d.ts +3 -3
  190. package/{state → modules/state}/DataState.js +2 -1
  191. package/{state → modules/state}/ObjectState.d.ts +1 -1
  192. package/{state → modules/state}/ObjectState.js +4 -4
  193. package/{state → modules/state}/SelfClosingState.d.ts +0 -0
  194. package/{state → modules/state}/SelfClosingState.js +0 -0
  195. package/{state → modules/state}/State.d.ts +0 -0
  196. package/{state → modules/state}/State.js +0 -0
  197. package/{state → modules/state}/index.d.ts +0 -0
  198. package/{state → modules/state}/index.js +0 -0
  199. package/{test → modules/test}/basics.d.ts +0 -0
  200. package/{test → modules/test}/basics.js +0 -0
  201. package/{test → modules/test}/index.d.ts +0 -0
  202. package/{test → modules/test}/index.js +0 -0
  203. package/{test → modules/test}/people.d.ts +0 -0
  204. package/{test → modules/test}/people.js +0 -0
  205. package/{test → modules/test}/util.d.ts +0 -0
  206. package/{test → modules/test}/util.js +0 -0
  207. package/{update → modules/update}/ArrayUpdate.d.ts +0 -0
  208. package/{update → modules/update}/ArrayUpdate.js +1 -1
  209. package/{update → modules/update}/DataUpdate.d.ts +13 -7
  210. package/{update → modules/update}/DataUpdate.js +29 -22
  211. package/{update → modules/update}/Delete.d.ts +0 -0
  212. package/{update → modules/update}/Delete.js +0 -0
  213. package/{update → modules/update}/Increment.d.ts +0 -0
  214. package/{update → modules/update}/Increment.js +0 -0
  215. package/{update → modules/update}/ObjectUpdate.d.ts +0 -0
  216. package/{update → modules/update}/ObjectUpdate.js +0 -0
  217. package/{update → modules/update}/Update.d.ts +0 -0
  218. package/{update → modules/update}/Update.js +0 -0
  219. package/modules/update/hydrations.d.ts +3 -0
  220. package/{update → modules/update}/hydrations.js +2 -2
  221. package/{update → modules/update}/index.d.ts +0 -0
  222. package/{update → modules/update}/index.js +0 -0
  223. package/{util → modules/util}/array.d.ts +6 -52
  224. package/{util → modules/util}/array.js +15 -89
  225. package/{util → modules/util}/assert.d.ts +0 -0
  226. package/{util → modules/util}/assert.js +0 -0
  227. package/{util → modules/util}/async.d.ts +0 -0
  228. package/{util → modules/util}/async.js +0 -0
  229. package/{util → modules/util}/boolean.d.ts +0 -0
  230. package/{util → modules/util}/boolean.js +0 -0
  231. package/{util → modules/util}/class.d.ts +0 -0
  232. package/{util → modules/util}/class.js +0 -0
  233. package/{util → modules/util}/clone.d.ts +0 -0
  234. package/{util → modules/util}/clone.js +0 -0
  235. package/{util → modules/util}/color.d.ts +0 -0
  236. package/{util → modules/util}/color.js +0 -0
  237. package/modules/util/data.d.ts +74 -0
  238. package/modules/util/data.js +27 -0
  239. package/{util → modules/util}/date.d.ts +0 -0
  240. package/{util → modules/util}/date.js +0 -0
  241. package/{util → modules/util}/debug.d.ts +0 -0
  242. package/{util → modules/util}/debug.js +0 -0
  243. package/{util → modules/util}/diff.d.ts +0 -0
  244. package/{util → modules/util}/diff.js +0 -0
  245. package/{util → modules/util}/entry.d.ts +2 -2
  246. package/{util → modules/util}/entry.js +0 -0
  247. package/{util → modules/util}/equal.d.ts +0 -0
  248. package/{util → modules/util}/equal.js +0 -0
  249. package/{util → modules/util}/error.d.ts +0 -0
  250. package/{util → modules/util}/error.js +0 -0
  251. package/{util → modules/util}/filter.d.ts +0 -0
  252. package/{util → modules/util}/filter.js +0 -0
  253. package/{util → modules/util}/function.d.ts +0 -0
  254. package/{util → modules/util}/function.js +0 -0
  255. package/{util → modules/util}/hydrate.d.ts +0 -0
  256. package/{util → modules/util}/hydrate.js +0 -0
  257. package/{util → modules/util}/index.d.ts +0 -0
  258. package/{util → modules/util}/index.js +0 -0
  259. package/{util → modules/util}/iterate.d.ts +0 -0
  260. package/{util → modules/util}/iterate.js +0 -0
  261. package/{util → modules/util}/jsx.d.ts +0 -0
  262. package/{util → modules/util}/jsx.js +0 -0
  263. package/{util → modules/util}/lazy.d.ts +0 -0
  264. package/{util → modules/util}/lazy.js +0 -0
  265. package/{util → modules/util}/map.d.ts +0 -0
  266. package/{util → modules/util}/map.js +0 -0
  267. package/{util → modules/util}/match.d.ts +0 -0
  268. package/{util → modules/util}/match.js +0 -0
  269. package/{util → modules/util}/merge.d.ts +0 -0
  270. package/{util → modules/util}/merge.js +0 -0
  271. package/{util → modules/util}/null.d.ts +0 -0
  272. package/{util → modules/util}/null.js +0 -0
  273. package/{util → modules/util}/number.d.ts +0 -0
  274. package/{util → modules/util}/number.js +0 -0
  275. package/modules/util/object.d.ts +110 -0
  276. package/modules/util/object.js +124 -0
  277. package/{util → modules/util}/random.d.ts +0 -0
  278. package/{util → modules/util}/random.js +0 -0
  279. package/{util → modules/util}/regexp.d.ts +0 -0
  280. package/{util → modules/util}/regexp.js +0 -0
  281. package/{util → modules/util}/serialise.d.ts +0 -0
  282. package/{util → modules/util}/serialise.js +0 -0
  283. package/{util → modules/util}/set.d.ts +0 -0
  284. package/{util → modules/util}/set.js +0 -0
  285. package/{util → modules/util}/sort.d.ts +0 -0
  286. package/{util → modules/util}/sort.js +0 -0
  287. package/{util → modules/util}/source.d.ts +0 -0
  288. package/{util → modules/util}/source.js +0 -0
  289. package/{util → modules/util}/string.d.ts +0 -0
  290. package/{util → modules/util}/string.js +0 -0
  291. package/{util → modules/util}/template.d.ts +0 -0
  292. package/{util → modules/util}/template.js +0 -0
  293. package/{util → modules/util}/timeout.d.ts +0 -0
  294. package/{util → modules/util}/timeout.js +0 -0
  295. package/{util → modules/util}/transform.d.ts +10 -14
  296. package/{util → modules/util}/transform.js +20 -8
  297. package/{util → modules/util}/undefined.d.ts +0 -0
  298. package/{util → modules/util}/undefined.js +0 -0
  299. package/{util → modules/util}/units.d.ts +0 -0
  300. package/{util → modules/util}/units.js +0 -0
  301. package/{util → modules/util}/url.d.ts +0 -0
  302. package/{util → modules/util}/url.js +0 -0
  303. package/{util → modules/util}/validate.d.ts +2 -2
  304. package/{util → modules/util}/validate.js +1 -1
  305. package/package.json +8 -8
  306. package/db/Database.d.ts +0 -42
  307. package/db/Database.js +0 -43
  308. package/state/ArrayState.js +0 -32
  309. package/update/hydrations.d.ts +0 -3
  310. package/util/data.d.ts +0 -126
  311. package/util/data.js +0 -78
  312. package/util/object.d.ts +0 -102
  313. package/util/object.js +0 -121
@@ -1,11 +1,11 @@
1
1
  import type { Dispatch } from "../util/function.js";
2
2
  import type { Key, Datas } from "../util/data.js";
3
+ import type { Updates } from "../update/DataUpdate.js";
3
4
  import type { PartialObserver } from "../observe/Observer.js";
4
5
  import type { Observable, Unsubscribe } from "../observe/Observable.js";
5
6
  import type { FilterList } from "../constraint/FilterConstraint.js";
6
7
  import type { SortList } from "../constraint/SortConstraint.js";
7
8
  import { QueryConstraints } from "../constraint/QueryConstraints.js";
8
- import { DataUpdate, PropUpdates } from "../update/DataUpdate.js";
9
9
  import type { ItemArray, ItemValue, ItemData } from "./Item.js";
10
10
  import type { AsyncDatabase, Database } from "./Database.js";
11
11
  /** Reference to a set of items in a sync or async provider. */
@@ -68,7 +68,7 @@ declare abstract class BaseQuery<T extends Datas = Datas, K extends Key<T> = Key
68
68
  * @param updates `Update` instance or set of updates to apply to every matching item.
69
69
  * @return Nothing (possibly promised).
70
70
  */
71
- abstract update(updates: DataUpdate<T[K]> | PropUpdates<T[K]>): number | PromiseLike<number>;
71
+ abstract update(updates: Updates<T[K]>): number | PromiseLike<number>;
72
72
  /**
73
73
  * Delete all matching items.
74
74
  * @return Nothing (possibly promised).
@@ -89,7 +89,7 @@ export declare class Query<T extends Datas = Datas, K extends Key<T> = Key<T>> e
89
89
  get lastValue(): ItemValue<T[K]>;
90
90
  get lastData(): ItemData<T[K]>;
91
91
  set(data: T[K]): number;
92
- update(updates: DataUpdate<T[K]> | PropUpdates<T[K]>): number;
92
+ update(updates: Updates<T[K]>): number;
93
93
  delete(): number;
94
94
  }
95
95
  /** Reference to a set of items in a provider. */
@@ -105,7 +105,7 @@ export declare class AsyncQuery<T extends Datas = Datas, K extends Key<T> = Key<
105
105
  get lastValue(): Promise<ItemValue<T[K]>>;
106
106
  get lastData(): Promise<ItemData<T[K]>>;
107
107
  set(data: T[K]): Promise<number>;
108
- update(updates: DataUpdate<T[K]> | PropUpdates<T[K]>): PromiseLike<number>;
108
+ update(updates: Updates<T[K]>): PromiseLike<number>;
109
109
  delete(): PromiseLike<number>;
110
110
  }
111
111
  export {};
@@ -1,7 +1,6 @@
1
1
  import { getFirstItem, getLastItem, getOptionalFirstItem, getOptionalLastItem } from "../util/array.js";
2
2
  import { QueryConstraints } from "../constraint/QueryConstraints.js";
3
3
  import { countItems, hasItems } from "../util/iterate.js";
4
- import { DataUpdate } from "../update/DataUpdate.js";
5
4
  /** Reference to a set of items in a sync or async provider. */
6
5
  class BaseQuery extends QueryConstraints {
7
6
  /**
@@ -51,7 +50,7 @@ export class Query extends BaseQuery {
51
50
  return this.db.provider.setQuery(this.collection, this, data);
52
51
  }
53
52
  update(updates) {
54
- return this.db.provider.updateQuery(this.collection, this, updates instanceof DataUpdate ? updates : new DataUpdate(updates));
53
+ return this.db.provider.updateQuery(this.collection, this, updates);
55
54
  }
56
55
  delete() {
57
56
  return this.db.provider.deleteQuery(this.collection, this);
@@ -89,7 +88,7 @@ export class AsyncQuery extends BaseQuery {
89
88
  return this.db.provider.setQuery(this.collection, this, data);
90
89
  }
91
90
  update(updates) {
92
- return this.db.provider.updateQuery(this.collection, this, updates instanceof DataUpdate ? updates : new DataUpdate(updates));
91
+ return this.db.provider.updateQuery(this.collection, this, updates);
93
92
  }
94
93
  delete() {
95
94
  return this.db.provider.deleteQuery(this.collection, this);
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -4,15 +4,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
7
  import { setPrototype } from "../util/class.js";
11
8
  import { Feedback } from "./Feedback.js";
12
9
  /** Specific type of `Feedback` to indicate an error (something went wrong). */
13
10
  export class ErrorFeedback extends Feedback {
14
11
  }
15
12
  __decorate([
16
- setPrototype("name", "ErrorFeedback"),
17
- __metadata("design:type", String)
13
+ setPrototype("name", "ErrorFeedback")
18
14
  ], ErrorFeedback.prototype, "name", void 0);
File without changes
@@ -4,9 +4,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
7
  import { isObject } from "../util/object.js";
11
8
  import { getEntries } from "../util/entry.js";
12
9
  import { setPrototype } from "../util/class.js";
@@ -28,8 +25,7 @@ export class Feedback {
28
25
  }
29
26
  }
30
27
  __decorate([
31
- setPrototype("name", "Feedback"),
32
- __metadata("design:type", String)
28
+ setPrototype("name", "Feedback")
33
29
  ], Feedback.prototype, "name", void 0);
34
30
  /** Is an unknown value a `Feedback` object. */
35
31
  export const isFeedback = (v) => isObject(v) && typeof v.name === "string" && v.name.endsWith("Feedback") && typeof v.message === "string";
@@ -4,15 +4,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
7
  import { setPrototype } from "../util/class.js";
11
8
  import { ErrorFeedback } from "./ErrorFeedback.js";
12
9
  /** Specific type of `ErrorFeedback` returned from `validate()` when a value is invalid. */
13
10
  export class InvalidFeedback extends ErrorFeedback {
14
11
  }
15
12
  __decorate([
16
- setPrototype("name", "InvalidFeedback"),
17
- __metadata("design:type", String)
13
+ setPrototype("name", "InvalidFeedback")
18
14
  ], InvalidFeedback.prototype, "name", void 0);
@@ -4,15 +4,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
7
  import { setPrototype } from "../util/class.js";
11
8
  import { Feedback } from "./Feedback.js";
12
9
  /** Specific type of `Feedback` to indicate success (something went right!). */
13
10
  export class SuccessFeedback extends Feedback {
14
11
  }
15
12
  __decorate([
16
- setPrototype("name", "SuccessFeedback"),
17
- __metadata("design:type", String)
13
+ setPrototype("name", "SuccessFeedback")
18
14
  ], SuccessFeedback.prototype, "name", void 0);
@@ -4,15 +4,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
7
  import { setPrototype } from "../util/class.js";
11
8
  import { Feedback } from "./Feedback.js";
12
9
  /** Specific type of `Feedback` to indicate warning (something might go wrong soon). */
13
10
  export class WarningFeedback extends Feedback {
14
11
  }
15
12
  __decorate([
16
- setPrototype("name", "WarningFeedback"),
17
- __metadata("design:type", String)
13
+ setPrototype("name", "WarningFeedback")
18
14
  ], WarningFeedback.prototype, "name", void 0);
File without changes
File without changes
File without changes
File without changes
@@ -4,7 +4,7 @@ import type { Unsubscribe } from "../../observe/Observable.js";
4
4
  import type { AsyncProvider } from "../../provider/Provider.js";
5
5
  import type { ItemArray, ItemValue, ItemConstraints } from "../../db/Item.js";
6
6
  import { Observer, PartialObserver } from "../../observe/Observer.js";
7
- import { DataUpdate } from "../../update/DataUpdate.js";
7
+ import { Updates } from "../../update/DataUpdate.js";
8
8
  /**
9
9
  * Firestore client database provider.
10
10
  * - Works with the Firebase JS SDK.
@@ -18,11 +18,11 @@ export declare class FirestoreClientProvider implements AsyncProvider {
18
18
  subscribeItem(collection: string, id: string, observer: PartialObserver<ItemValue>): Unsubscribe;
19
19
  addItem(collection: string, data: Data): Promise<string>;
20
20
  setItem(collection: string, id: string, data: Data): Promise<void>;
21
- updateItem(collection: string, id: string, update: DataUpdate): Promise<void>;
21
+ updateItem(collection: string, id: string, updates: Updates): Promise<void>;
22
22
  deleteItem(collection: string, id: string): Promise<void>;
23
23
  getQuery(collection: string, constraints: ItemConstraints): Promise<ItemArray>;
24
24
  subscribeQuery(collection: string, constraints: ItemConstraints, observer: Observer<ItemArray>): Unsubscribe;
25
25
  setQuery(collection: string, constraints: ItemConstraints, data: Data): Promise<number>;
26
- updateQuery(collection: string, constraints: ItemConstraints, update: DataUpdate): Promise<number>;
26
+ updateQuery(collection: string, constraints: ItemConstraints, updates: Updates): Promise<number>;
27
27
  deleteQuery(collection: string, constraints: ItemConstraints): Promise<number>;
28
28
  }
@@ -101,8 +101,8 @@ export class FirestoreClientProvider {
101
101
  async setItem(collection, id, data) {
102
102
  await setDoc(firestoreDocument(this._firestore, collection, id), data);
103
103
  }
104
- async updateItem(collection, id, update) {
105
- await updateDoc(firestoreDocument(this._firestore, collection, id), ..._getFieldValues(update));
104
+ async updateItem(collection, id, updates) {
105
+ await updateDoc(firestoreDocument(this._firestore, collection, id), ..._getFieldValues(Object.entries(updates)));
106
106
  }
107
107
  async deleteItem(collection, id) {
108
108
  await deleteDoc(firestoreDocument(this._firestore, collection, id));
@@ -118,9 +118,9 @@ export class FirestoreClientProvider {
118
118
  await Promise.all(snapshot.docs.map(s => setDoc(s.ref, data)));
119
119
  return snapshot.size;
120
120
  }
121
- async updateQuery(collection, constraints, update) {
121
+ async updateQuery(collection, constraints, updates) {
122
122
  const snapshot = await getDocs(_getQuery(this._firestore, collection, constraints));
123
- const fieldValues = Array.from(_getFieldValues(update));
123
+ const fieldValues = Array.from(_getFieldValues(Object.entries(updates)));
124
124
  await Promise.all(snapshot.docs.map(s => updateDoc(s.ref, ...fieldValues)));
125
125
  return snapshot.size;
126
126
  }
File without changes
@@ -3,7 +3,7 @@ import type { Data } from "../../util/data.js";
3
3
  import type { Unsubscribe } from "../../observe/Observable.js";
4
4
  import type { AsyncProvider } from "../../provider/Provider.js";
5
5
  import type { ItemArray, ItemValue, ItemConstraints } from "../../db/Item.js";
6
- import { DataUpdate } from "../../update/DataUpdate.js";
6
+ import { Updates } from "../../update/DataUpdate.js";
7
7
  /**
8
8
  * Firestore Lite client database provider.
9
9
  * - Works with the Firebase JS SDK.
@@ -17,11 +17,11 @@ export declare class FirestoreLiteProvider implements AsyncProvider {
17
17
  subscribeItem(): Unsubscribe;
18
18
  addItem(collection: string, data: Data): Promise<string>;
19
19
  setItem(collection: string, id: string, data: Data): Promise<void>;
20
- updateItem(collection: string, id: string, update: DataUpdate): Promise<void>;
20
+ updateItem(collection: string, id: string, updates: Updates): Promise<void>;
21
21
  deleteItem(collection: string, id: string): Promise<void>;
22
22
  getQuery(collection: string, constraints: ItemConstraints): Promise<ItemArray>;
23
23
  subscribeQuery(): Unsubscribe;
24
24
  setQuery(collection: string, constraints: ItemConstraints, data: Data): Promise<number>;
25
- updateQuery(collection: string, constraints: ItemConstraints, update: DataUpdate): Promise<number>;
25
+ updateQuery(collection: string, constraints: ItemConstraints, updates: Updates): Promise<number>;
26
26
  deleteQuery(collection: string, constraints: ItemConstraints): Promise<number>;
27
27
  }
@@ -101,8 +101,8 @@ export class FirestoreLiteProvider {
101
101
  async setItem(collection, id, data) {
102
102
  await setDoc(firestoreDocument(this._firestore, collection, id), data);
103
103
  }
104
- async updateItem(collection, id, update) {
105
- await updateDoc(firestoreDocument(this._firestore, collection, id), ..._getFieldValues(update));
104
+ async updateItem(collection, id, updates) {
105
+ await updateDoc(firestoreDocument(this._firestore, collection, id), ..._getFieldValues(Object.entries(updates)));
106
106
  }
107
107
  async deleteItem(collection, id) {
108
108
  await deleteDoc(firestoreDocument(this._firestore, collection, id));
@@ -118,9 +118,9 @@ export class FirestoreLiteProvider {
118
118
  await Promise.all(snapshot.docs.map(s => setDoc(s.ref, data)));
119
119
  return snapshot.size;
120
120
  }
121
- async updateQuery(collection, constraints, update) {
121
+ async updateQuery(collection, constraints, updates) {
122
122
  const snapshot = await getDocs(_getQuery(this._firestore, collection, constraints));
123
- const fieldValues = Array.from(_getFieldValues(update));
123
+ const fieldValues = Array.from(_getFieldValues(Object.entries(updates)));
124
124
  await Promise.all(snapshot.docs.map(s => updateDoc(s.ref, ...fieldValues)));
125
125
  return snapshot.size;
126
126
  }
File without changes
File without changes
@@ -3,7 +3,7 @@ import type { Unsubscribe } from "../../observe/Observable.js";
3
3
  import type { AsyncProvider } from "../../provider/Provider.js";
4
4
  import type { ItemArray, ItemValue, ItemConstraints } from "../../db/Item.js";
5
5
  import { Observer } from "../../observe/Observer.js";
6
- import { DataUpdate } from "../../update/DataUpdate.js";
6
+ import { Updates } from "../../update/DataUpdate.js";
7
7
  import { Data } from "../../util/data.js";
8
8
  /**
9
9
  * Firestore server database provider.
@@ -16,11 +16,11 @@ export declare class FirestoreServerProvider implements AsyncProvider {
16
16
  subscribeItem(collection: string, id: string, observer: Observer<ItemValue>): Unsubscribe;
17
17
  addItem(collection: string, data: Data): Promise<string>;
18
18
  setItem(collection: string, id: string, data: Data): Promise<void>;
19
- updateItem(collection: string, id: string, update: DataUpdate): Promise<void>;
19
+ updateItem(collection: string, id: string, updates: Updates): Promise<void>;
20
20
  deleteItem(collection: string, id: string): Promise<void>;
21
21
  getQuery(collection: string, constraints: ItemConstraints): Promise<ItemArray>;
22
22
  subscribeQuery(collection: string, constraints: ItemConstraints, observer: Observer<ItemArray>): Unsubscribe;
23
23
  setQuery(collection: string, constraints: ItemConstraints, data: Data): Promise<number>;
24
- updateQuery(collection: string, constraints: ItemConstraints, update: DataUpdate): Promise<number>;
24
+ updateQuery(collection: string, constraints: ItemConstraints, updates: Updates): Promise<number>;
25
25
  deleteQuery(collection: string, constraints: ItemConstraints): Promise<number>;
26
26
  }
@@ -101,11 +101,11 @@ export class FirestoreServerProvider {
101
101
  async setItem(collection, id, data) {
102
102
  await this._firestore.collection(collection).doc(id).set(data);
103
103
  }
104
- async updateItem(collection, id, update) {
104
+ async updateItem(collection, id, updates) {
105
105
  await this._firestore
106
106
  .collection(collection)
107
107
  .doc(id)
108
- .update(..._getFieldValues(update));
108
+ .update(..._getFieldValues(Object.entries(updates)));
109
109
  }
110
110
  async deleteItem(collection, id) {
111
111
  await this._firestore.collection(collection).doc(id).delete();
@@ -119,8 +119,8 @@ export class FirestoreServerProvider {
119
119
  async setQuery(collection, constraints, data) {
120
120
  return await bulkWrite(this._firestore, collection, constraints, (w, s) => void w.set(s.ref, data));
121
121
  }
122
- async updateQuery(collection, constraints, update) {
123
- const fieldValues = _getFieldValues(update);
122
+ async updateQuery(collection, constraints, updates) {
123
+ const fieldValues = _getFieldValues(Object.entries(updates));
124
124
  return await bulkWrite(this._firestore, collection, constraints, (w, s) => void w.update(s.ref, ...fieldValues));
125
125
  }
126
126
  async deleteQuery(collection, constraints) {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -2,7 +2,7 @@ import type { Datas, Key } from "../util/data.js";
2
2
  import type { ItemArray, ItemValue, ItemConstraints } from "../db/Item.js";
3
3
  import type { PartialObserver } from "../observe/Observer.js";
4
4
  import type { Unsubscribe } from "../observe/Observable.js";
5
- import type { DataUpdate } from "../update/DataUpdate.js";
5
+ import type { Updates } from "../update/DataUpdate.js";
6
6
  import type { AsyncProvider } from "./Provider.js";
7
7
  import type { AsyncThroughProvider } from "./ThroughProvider.js";
8
8
  import { MemoryProvider } from "./MemoryProvider.js";
@@ -15,11 +15,11 @@ export declare class CacheProvider<T extends Datas> implements AsyncThroughProvi
15
15
  subscribeItem<K extends Key<T>>(collection: K, id: string, observer: PartialObserver<ItemValue<T[K]>>): Unsubscribe;
16
16
  addItem<K extends Key<T>>(collection: K, data: T[K]): Promise<string>;
17
17
  setItem<K extends Key<T>>(collection: K, id: string, data: T[K]): Promise<void>;
18
- updateItem<K extends Key<T>>(collection: K, id: string, update: DataUpdate<T[K]>): Promise<void>;
18
+ updateItem<K extends Key<T>>(collection: K, id: string, updates: Updates<T[K]>): Promise<void>;
19
19
  deleteItem<K extends Key<T>>(collection: K, id: string): Promise<void>;
20
20
  getQuery<K extends Key<T>>(collection: K, constraints: ItemConstraints<T[K]>): Promise<ItemArray<T[K]>>;
21
21
  subscribeQuery<K extends Key<T>>(collection: K, constraints: ItemConstraints<T[K]>, observer: PartialObserver<ItemArray<T[K]>>): Unsubscribe;
22
22
  setQuery<K extends Key<T>>(collection: K, constraints: ItemConstraints<T[K]>, data: T[K]): Promise<number>;
23
- updateQuery<K extends Key<T>>(collection: K, constraints: ItemConstraints<T[K]>, update: DataUpdate<T[K]>): Promise<number>;
23
+ updateQuery<K extends Key<T>>(collection: K, constraints: ItemConstraints<T[K]>, updates: Updates<T[K]>): Promise<number>;
24
24
  deleteQuery<K extends Key<T>>(collection: K, constraints: ItemConstraints<T[K]>): Promise<number>;
25
25
  }
@@ -24,11 +24,11 @@ export class CacheProvider {
24
24
  await this.source.setItem(collection, id, data);
25
25
  this.memory.getTable(collection).setItem(id, data);
26
26
  }
27
- async updateItem(collection, id, update) {
28
- await this.source.updateItem(collection, id, update);
27
+ async updateItem(collection, id, updates) {
28
+ await this.source.updateItem(collection, id, updates);
29
29
  const table = this.memory.getTable(collection);
30
30
  if (table.getItem(id))
31
- table.updateItem(id, update);
31
+ table.updateItem(id, updates);
32
32
  }
33
33
  async deleteItem(collection, id) {
34
34
  await this.source.deleteItem(collection, id);
@@ -49,9 +49,9 @@ export class CacheProvider {
49
49
  this.memory.getTable(collection).setQuery(constraints, data);
50
50
  return count;
51
51
  }
52
- async updateQuery(collection, constraints, update) {
53
- const count = await this.source.updateQuery(collection, constraints, update);
54
- this.memory.getTable(collection).updateQuery(constraints, update);
52
+ async updateQuery(collection, constraints, updates) {
53
+ const count = await this.source.updateQuery(collection, constraints, updates);
54
+ this.memory.getTable(collection).updateQuery(constraints, updates);
55
55
  return count;
56
56
  }
57
57
  async deleteQuery(collection, constraints) {
@@ -1,6 +1,6 @@
1
1
  import type { Datas, Key } from "../util/data.js";
2
2
  import type { ItemArray, ItemConstraints, ItemValue } from "../db/Item.js";
3
- import type { DataUpdate } from "../update/DataUpdate.js";
3
+ import type { Updates } from "../update/DataUpdate.js";
4
4
  import type { PartialObserver } from "../observe/Observer.js";
5
5
  import type { Unsubscribe } from "../observe/Observable.js";
6
6
  import { Provider, AsyncProvider } from "./Provider.js";
@@ -18,11 +18,11 @@ export declare class DebugProvider<T extends Datas> extends AbstractDebugProvide
18
18
  getItem<K extends Key<T>>(collection: K, id: string): ItemValue<T[K]>;
19
19
  addItem<K extends Key<T>>(collection: K, data: T[K]): string;
20
20
  setItem<K extends Key<T>>(collection: K, id: string, data: T[K]): void;
21
- updateItem<K extends Key<T>>(collection: K, id: string, update: DataUpdate<T[K]>): void;
21
+ updateItem<K extends Key<T>>(collection: K, id: string, updates: Updates<T[K]>): void;
22
22
  deleteItem<K extends Key<T>>(collection: K, id: string): void;
23
23
  getQuery<K extends Key<T>>(collection: K, constraints: ItemConstraints<T[K]>): ItemArray<T[K]>;
24
24
  setQuery<K extends Key<T>>(collection: K, constraints: ItemConstraints<T[K]>, data: T[K]): number;
25
- updateQuery<K extends Key<T>>(collection: K, constraints: ItemConstraints<T[K]>, update: DataUpdate<T[K]>): number;
25
+ updateQuery<K extends Key<T>>(collection: K, constraints: ItemConstraints<T[K]>, updates: Updates<T[K]>): number;
26
26
  deleteQuery<K extends Key<T>>(collection: K, constraints: ItemConstraints<T[K]>): number;
27
27
  }
28
28
  /** Provider that logs operations to a synchronous source provider to the console. */
@@ -32,11 +32,11 @@ export declare class AsyncDebugProvider<T extends Datas> extends AbstractDebugPr
32
32
  getItem<K extends Key<T>>(collection: K, id: string): Promise<ItemValue<T[K]>>;
33
33
  addItem<K extends Key<T>>(collection: K, data: T[K]): Promise<string>;
34
34
  setItem<K extends Key<T>>(collection: K, id: string, data: T[K]): Promise<void>;
35
- updateItem<K extends Key<T>>(collection: K, id: string, update: DataUpdate<T[K]>): Promise<void>;
35
+ updateItem<K extends Key<T>>(collection: K, id: string, updates: Updates<T[K]>): Promise<void>;
36
36
  deleteItem<K extends Key<T>>(collection: K, id: string): Promise<void>;
37
37
  getQuery<K extends Key<T>>(collection: K, constraints: ItemConstraints<T[K]>): Promise<ItemArray<T[K]>>;
38
38
  setQuery<K extends Key<T>>(collection: K, constraints: ItemConstraints<T[K]>, data: T[K]): Promise<number>;
39
- updateQuery<K extends Key<T>>(collection: K, constraints: ItemConstraints<T[K]>, update: DataUpdate<T[K]>): Promise<number>;
39
+ updateQuery<K extends Key<T>>(collection: K, constraints: ItemConstraints<T[K]>, updates: Updates<T[K]>): Promise<number>;
40
40
  deleteQuery<K extends Key<T>>(collection: K, constraints: ItemConstraints<T[K]>): Promise<number>;
41
41
  }
42
42
  export {};