@onyx.dev/onyx-database 1.0.3 → 1.1.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/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { O as OnyxFacade } from './aggregates-BGXzij4U.cjs';
2
- export { E as FetchImpl, F as FetchResponse, T as ICascadeBuilder, V as ICascadeRelationshipBuilder, M as IConditionBuilder, I as IOnyxDatabase, N as IQueryBuilder, P as ISaveBuilder, L as LogicalOperator, b as OnyxConfig, D as OnyxDocument, H as QueryCondition, G as QueryCriteria, A as QueryCriteriaOperator, K as QueryPage, Q as QueryResults, a as QueryResultsPromise, R as RetryOptions, i as SchemaAttribute, u as SchemaAttributeChange, f as SchemaDataType, z as SchemaDiff, o as SchemaEntity, r as SchemaHistoryEntry, h as SchemaIdentifier, g as SchemaIdentifierGenerator, k as SchemaIndex, v as SchemaIndexChange, j as SchemaIndexType, l as SchemaResolver, w as SchemaResolverChange, q as SchemaRevision, p as SchemaRevisionMetadata, y as SchemaTableDiff, n as SchemaTrigger, x as SchemaTriggerChange, m as SchemaTriggerEvent, s as SchemaUpsertRequest, t as SchemaValidationResult, S as SecretMetadata, c as SecretRecord, e as SecretSaveRequest, d as SecretsListResponse, J as SelectQuery, B as Sort, C as StreamAction, U as UpdateQuery, W as asc, aj as avg, a2 as between, ab as contains, ac as containsIgnoreCase, al as count, X as desc, Y as eq, a3 as gt, a4 as gte, _ as inOp, ah as isNull, a9 as like, as as lower, a5 as lt, a6 as lte, a7 as matches, an as max, aq as median, am as min, Z as neq, ad as notContains, ae as notContainsIgnoreCase, a0 as notIn, aa as notLike, a8 as notMatches, ai as notNull, ag as notStartsWith, a1 as notWithin, av as percentile, au as replace, af as startsWith, ao as std, at as substring, ak as sum, ar as upper, ap as variance, $ as within } from './aggregates-BGXzij4U.cjs';
1
+ import { O as OnyxFacade } from './aggregates-DodZNu9-.cjs';
2
+ export { G as FetchImpl, E as FetchResponse, F as FullTextQuery, V as ICascadeBuilder, W as ICascadeRelationshipBuilder, N as IConditionBuilder, I as IOnyxDatabase, P as IQueryBuilder, T as ISaveBuilder, L as LogicalOperator, b as OnyxConfig, D as OnyxDocument, J as QueryCondition, H as QueryCriteria, A as QueryCriteriaOperator, M as QueryPage, Q as QueryResults, a as QueryResultsPromise, R as RetryOptions, i as SchemaAttribute, u as SchemaAttributeChange, f as SchemaDataType, z as SchemaDiff, o as SchemaEntity, r as SchemaHistoryEntry, h as SchemaIdentifier, g as SchemaIdentifierGenerator, k as SchemaIndex, v as SchemaIndexChange, j as SchemaIndexType, l as SchemaResolver, w as SchemaResolverChange, q as SchemaRevision, p as SchemaRevisionMetadata, y as SchemaTableDiff, n as SchemaTrigger, x as SchemaTriggerChange, m as SchemaTriggerEvent, s as SchemaUpsertRequest, t as SchemaValidationResult, S as SecretMetadata, c as SecretRecord, e as SecretSaveRequest, d as SecretsListResponse, K as SelectQuery, B as Sort, C as StreamAction, U as UpdateQuery, X as asc, al as avg, a3 as between, ad as contains, ae as containsIgnoreCase, an as count, Y as desc, Z as eq, a4 as gt, a5 as gte, $ as inOp, aj as isNull, ab as like, au as lower, a6 as lt, a7 as lte, a8 as matches, ap as max, as as median, ao as min, _ as neq, af as notContains, ag as notContainsIgnoreCase, a1 as notIn, ac as notLike, aa as notMatches, ak as notNull, ai as notStartsWith, a2 as notWithin, ax as percentile, aw as replace, a9 as search, ah as startsWith, aq as std, av as substring, am as sum, at as upper, ar as variance, a0 as within } from './aggregates-DodZNu9-.cjs';
3
3
 
4
4
  declare const onyx: OnyxFacade;
5
5
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { O as OnyxFacade } from './aggregates-BGXzij4U.js';
2
- export { E as FetchImpl, F as FetchResponse, T as ICascadeBuilder, V as ICascadeRelationshipBuilder, M as IConditionBuilder, I as IOnyxDatabase, N as IQueryBuilder, P as ISaveBuilder, L as LogicalOperator, b as OnyxConfig, D as OnyxDocument, H as QueryCondition, G as QueryCriteria, A as QueryCriteriaOperator, K as QueryPage, Q as QueryResults, a as QueryResultsPromise, R as RetryOptions, i as SchemaAttribute, u as SchemaAttributeChange, f as SchemaDataType, z as SchemaDiff, o as SchemaEntity, r as SchemaHistoryEntry, h as SchemaIdentifier, g as SchemaIdentifierGenerator, k as SchemaIndex, v as SchemaIndexChange, j as SchemaIndexType, l as SchemaResolver, w as SchemaResolverChange, q as SchemaRevision, p as SchemaRevisionMetadata, y as SchemaTableDiff, n as SchemaTrigger, x as SchemaTriggerChange, m as SchemaTriggerEvent, s as SchemaUpsertRequest, t as SchemaValidationResult, S as SecretMetadata, c as SecretRecord, e as SecretSaveRequest, d as SecretsListResponse, J as SelectQuery, B as Sort, C as StreamAction, U as UpdateQuery, W as asc, aj as avg, a2 as between, ab as contains, ac as containsIgnoreCase, al as count, X as desc, Y as eq, a3 as gt, a4 as gte, _ as inOp, ah as isNull, a9 as like, as as lower, a5 as lt, a6 as lte, a7 as matches, an as max, aq as median, am as min, Z as neq, ad as notContains, ae as notContainsIgnoreCase, a0 as notIn, aa as notLike, a8 as notMatches, ai as notNull, ag as notStartsWith, a1 as notWithin, av as percentile, au as replace, af as startsWith, ao as std, at as substring, ak as sum, ar as upper, ap as variance, $ as within } from './aggregates-BGXzij4U.js';
1
+ import { O as OnyxFacade } from './aggregates-DodZNu9-.js';
2
+ export { G as FetchImpl, E as FetchResponse, F as FullTextQuery, V as ICascadeBuilder, W as ICascadeRelationshipBuilder, N as IConditionBuilder, I as IOnyxDatabase, P as IQueryBuilder, T as ISaveBuilder, L as LogicalOperator, b as OnyxConfig, D as OnyxDocument, J as QueryCondition, H as QueryCriteria, A as QueryCriteriaOperator, M as QueryPage, Q as QueryResults, a as QueryResultsPromise, R as RetryOptions, i as SchemaAttribute, u as SchemaAttributeChange, f as SchemaDataType, z as SchemaDiff, o as SchemaEntity, r as SchemaHistoryEntry, h as SchemaIdentifier, g as SchemaIdentifierGenerator, k as SchemaIndex, v as SchemaIndexChange, j as SchemaIndexType, l as SchemaResolver, w as SchemaResolverChange, q as SchemaRevision, p as SchemaRevisionMetadata, y as SchemaTableDiff, n as SchemaTrigger, x as SchemaTriggerChange, m as SchemaTriggerEvent, s as SchemaUpsertRequest, t as SchemaValidationResult, S as SecretMetadata, c as SecretRecord, e as SecretSaveRequest, d as SecretsListResponse, K as SelectQuery, B as Sort, C as StreamAction, U as UpdateQuery, X as asc, al as avg, a3 as between, ad as contains, ae as containsIgnoreCase, an as count, Y as desc, Z as eq, a4 as gt, a5 as gte, $ as inOp, aj as isNull, ab as like, au as lower, a6 as lt, a7 as lte, a8 as matches, ap as max, as as median, ao as min, _ as neq, af as notContains, ag as notContainsIgnoreCase, a1 as notIn, ac as notLike, aa as notMatches, ak as notNull, ai as notStartsWith, a2 as notWithin, ax as percentile, aw as replace, a9 as search, ah as startsWith, aq as std, av as substring, am as sum, at as upper, ar as variance, a0 as within } from './aggregates-DodZNu9-.js';
3
3
 
4
4
  declare const onyx: OnyxFacade;
5
5
 
package/dist/index.js CHANGED
@@ -1323,6 +1323,14 @@ var OnyxDatabaseImpl = class {
1323
1323
  qb.select(...fields);
1324
1324
  return qb;
1325
1325
  }
1326
+ search(queryText, minScore) {
1327
+ const qb = new QueryBuilderImpl(
1328
+ this,
1329
+ "ALL",
1330
+ this.defaultPartition
1331
+ );
1332
+ return qb.search(queryText, minScore);
1333
+ }
1326
1334
  cascade(...relationships) {
1327
1335
  const cb = new CascadeBuilderImpl(this);
1328
1336
  return cb.cascade(...relationships);
@@ -1609,6 +1617,7 @@ var QueryBuilderImpl = class {
1609
1617
  toSelectQuery() {
1610
1618
  return {
1611
1619
  type: "SelectQuery",
1620
+ table: this.table,
1612
1621
  fields: this.fields,
1613
1622
  conditions: this.serializableConditions(),
1614
1623
  sort: this.sort,
@@ -1648,6 +1657,13 @@ var QueryBuilderImpl = class {
1648
1657
  this.resolvers = flat.length > 0 ? flat : null;
1649
1658
  return this;
1650
1659
  }
1660
+ search(queryText, minScore) {
1661
+ return this.and({
1662
+ field: "__full_text__",
1663
+ operator: "MATCHES",
1664
+ value: { queryText, minScore: minScore ?? null }
1665
+ });
1666
+ }
1651
1667
  where(condition) {
1652
1668
  const c2 = toCondition(condition);
1653
1669
  if (!this.conditions) {
@@ -1999,6 +2015,10 @@ var ConditionBuilderImpl = class {
1999
2015
 
2000
2016
  // src/helpers/conditions.ts
2001
2017
  var c = (field, operator, value) => new ConditionBuilderImpl({ field, operator, value });
2018
+ var fullText = (queryText, minScore) => ({
2019
+ queryText,
2020
+ minScore: minScore ?? null
2021
+ });
2002
2022
  var eq = (field, value) => c(field, "EQUAL", value);
2003
2023
  var neq = (field, value) => c(field, "NOT_EQUAL", value);
2004
2024
  function inOp(field, values) {
@@ -2021,6 +2041,7 @@ var gte = (field, value) => c(field, "GREATER_THAN_EQUAL", value);
2021
2041
  var lt = (field, value) => c(field, "LESS_THAN", value);
2022
2042
  var lte = (field, value) => c(field, "LESS_THAN_EQUAL", value);
2023
2043
  var matches = (field, regex) => c(field, "MATCHES", regex);
2044
+ var search = (queryText, minScore) => c("__full_text__", "MATCHES", fullText(queryText, minScore));
2024
2045
  var notMatches = (field, regex) => c(field, "NOT_MATCHES", regex);
2025
2046
  var like = (field, pattern) => c(field, "LIKE", pattern);
2026
2047
  var notLike = (field, pattern) => c(field, "NOT_LIKE", pattern);
@@ -2052,6 +2073,6 @@ var percentile = (attribute, p) => `percentile(${attribute}, ${p})`;
2052
2073
  var sdkName = "@onyx.dev/onyx-database";
2053
2074
  var sdkVersion = "0.1.0";
2054
2075
 
2055
- export { QueryResults, asc, avg, between, contains, containsIgnoreCase, count, desc, eq, gt, gte, inOp, isNull, like, lower, lt, lte, matches, max, median, min, neq, notContains, notContainsIgnoreCase, notIn, notLike, notMatches, notNull, notStartsWith, notWithin, onyx, percentile, replace, sdkName, sdkVersion, startsWith, std, substring, sum, upper, variance, within };
2076
+ export { QueryResults, asc, avg, between, contains, containsIgnoreCase, count, desc, eq, gt, gte, inOp, isNull, like, lower, lt, lte, matches, max, median, min, neq, notContains, notContainsIgnoreCase, notIn, notLike, notMatches, notNull, notStartsWith, notWithin, onyx, percentile, replace, sdkName, sdkVersion, search, startsWith, std, substring, sum, upper, variance, within };
2056
2077
  //# sourceMappingURL=index.js.map
2057
2078
  //# sourceMappingURL=index.js.map