@rebasepro/client 0.21.2-canary.g1ea48be → 0.22.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.
package/dist/auth.d.ts CHANGED
@@ -229,6 +229,11 @@ export declare function createAuth(transport: Transport, options?: CreateAuthOpt
229
229
  success: boolean;
230
230
  provider: string;
231
231
  alreadyLinked: boolean;
232
+ /**
233
+ * The provider's profile picture, when it has one. Usually a signed
234
+ * URL with an expiry, so copy the bytes rather than storing this.
235
+ */
236
+ photoURL?: string | null;
232
237
  }>;
233
238
  sendVerificationEmail: () => Promise<{
234
239
  success: boolean;
package/dist/index.es.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DEFAULT_STORAGE_SOURCE_KEY, EntityReference, EntityRelation, GeoPoint, PUBLIC_STORAGE_PREFIX, RebaseApiError, RebaseApiError as RebaseApiError$1, RebaseClientError, RebaseClientError as RebaseClientError$1, SCHEMA_VERSION_HEADER, Vector, hasFieldOperation, isPublicStoragePath, isUnsupported, parseRelationAggregateSort, sortKeyToString, toCanonicalOp, unsupportedMethod } from "@rebasepro/types";
2
2
  import { COMPOSITE_ID_SEPARATOR, QueryBuilder, RebasePaginationError, and, buildCompositeId, collectAllPages, cond, mergeIncludeSpecs, normalizeOrderBy, not, or, paginateFind, resolveFindWindow, serializeFilter, serializeInclude, serializeLogicalCondition, serializeOrderBy } from "@rebasepro/common";
3
- import { toSnakeCase, unref } from "@rebasepro/utils";
3
+ import { splitSearchTerms, toSnakeCase, unref } from "@rebasepro/utils";
4
4
  //#region src/reviver.ts
5
5
  function rebaseReviver(_key, value) {
6
6
  if (value && typeof value === "object" && "__type" in value) {
@@ -4742,16 +4742,23 @@ function matchesLogical(row, condition) {
4742
4742
  * cached row does not carry — a local list may therefore be missing rows the
4743
4743
  * server would have returned, which is why {@link isExactlyEvaluable} refuses
4744
4744
  * to call a search query exact.
4745
+ *
4746
+ * Every term has to match, but they may match different fields — the same rule
4747
+ * both drivers apply, and the one that finds `sebastian melendez` on a row that
4748
+ * keeps the two halves of a name in separate fields. Matching the typed string
4749
+ * as a whole found neither that row nor, because the space was part of the
4750
+ * needle, anything at all for `sebastian `.
4745
4751
  */
4746
4752
  function matchesSearch(row, searchString) {
4747
4753
  if (!searchString) return true;
4748
- const needle = searchString.trim().toLowerCase();
4749
- if (!needle) return true;
4750
- for (const value of Object.values(row)) {
4751
- if (typeof value === "string" && value.toLowerCase().includes(needle)) return true;
4752
- if (typeof value === "number" && String(value).includes(needle)) return true;
4753
- }
4754
- return false;
4754
+ const terms = splitSearchTerms(searchString).map((term) => term.toLowerCase());
4755
+ if (terms.length === 0) return true;
4756
+ const values = Object.values(row);
4757
+ return terms.every((term) => values.some((value) => {
4758
+ if (typeof value === "string") return value.toLowerCase().includes(term);
4759
+ if (typeof value === "number") return String(value).includes(term);
4760
+ return false;
4761
+ }));
4755
4762
  }
4756
4763
  /** Does this row belong in the result set for `params`, ignoring pagination? */
4757
4764
  function matchesParams(row, params) {