@onyx.dev/onyx-database 2.0.0 → 2.0.1

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,9 +1,6 @@
1
- import { O as OnyxFacade } from './aggregates-BJT5DGGX.cjs';
2
- export { s as AiChatClient, l as AiChatCompletionChoice, p as AiChatCompletionChunk, o as AiChatCompletionChunkChoice, n as AiChatCompletionChunkDelta, j as AiChatCompletionRequest, m as AiChatCompletionResponse, q as AiChatCompletionStream, k as AiChatCompletionUsage, f as AiChatMessage, r as AiChatOptions, c as AiChatRole, y as AiClient, x as AiErrorResponse, w as AiModel, v as AiModelsResponse, A as AiRequestOptions, t as AiScriptApprovalRequest, u as AiScriptApprovalResponse, h as AiTool, e as AiToolCall, d as AiToolCallFunction, i as AiToolChoice, g as AiToolFunction, a8 as FetchImpl, a7 as FetchResponse, F as FullTextQuery, ah as ICascadeBuilder, ai as ICascadeRelationshipBuilder, ae as IConditionBuilder, I as IOnyxDatabase, af as IQueryBuilder, ag as ISaveBuilder, a3 as LogicalOperator, b as OnyxConfig, a6 as OnyxDocument, aa as QueryCondition, a9 as QueryCriteria, a2 as QueryCriteriaOperator, ad as QueryPage, Q as QueryResults, a as QueryResultsPromise, R as RetryOptions, H as SchemaAttribute, Y as SchemaAttributeChange, D as SchemaDataType, a1 as SchemaDiff, P as SchemaEntity, V as SchemaHistoryEntry, G as SchemaIdentifier, E as SchemaIdentifierGenerator, K as SchemaIndex, Z as SchemaIndexChange, J as SchemaIndexType, L as SchemaResolver, _ as SchemaResolverChange, U as SchemaRevision, T as SchemaRevisionMetadata, a0 as SchemaTableDiff, N as SchemaTrigger, $ as SchemaTriggerChange, M as SchemaTriggerEvent, W as SchemaUpsertRequest, X as SchemaValidationResult, S as SecretMetadata, z as SecretRecord, C as SecretSaveRequest, B as SecretsListResponse, ab as SelectQuery, a4 as Sort, a5 as StreamAction, ac as UpdateQuery, aj as asc, aJ as avg, ar as between, aB as contains, aC as containsIgnoreCase, aL as count, ak as desc, al as eq, as as gt, at as gte, an as inOp, aH as isNull, az as like, aS as lower, au as lt, av as lte, aw as matches, aN as max, aQ as median, aM as min, am as neq, aD as notContains, aE as notContainsIgnoreCase, ap as notIn, aA as notLike, ay as notMatches, aI as notNull, aG as notStartsWith, aq as notWithin, aV as percentile, aU as replace, ax as search, aF as startsWith, aO as std, aT as substring, aK as sum, aR as upper, aP as variance, ao as within } from './aggregates-BJT5DGGX.cjs';
1
+ import { O as OnyxFacade } from './aggregates-BPpzRHGH.cjs';
2
+ export { t as AiChatClient, l as AiChatCompletionChoice, q as AiChatCompletionChunk, p as AiChatCompletionChunkChoice, o as AiChatCompletionChunkDelta, j as AiChatCompletionRequest, m as AiChatCompletionResponse, r as AiChatCompletionStream, k as AiChatCompletionUsage, f as AiChatMessage, s as AiChatOptions, c as AiChatRole, B as AiClient, z as AiErrorResponse, y as AiModel, x as AiModelsResponse, A as AiRequestOptions, u as AiScriptApprovalRequest, w as AiScriptApprovalResponse, h as AiTool, e as AiToolCall, d as AiToolCallFunction, i as AiToolChoice, g as AiToolFunction, aa as FetchImpl, a9 as FetchResponse, F as FullTextQuery, aj as ICascadeBuilder, ak as ICascadeRelationshipBuilder, ag as IConditionBuilder, I as IOnyxDatabase, ah as IQueryBuilder, ai as ISaveBuilder, a5 as LogicalOperator, b as OnyxConfig, a8 as OnyxDocument, ac as QueryCondition, ab as QueryCriteria, a4 as QueryCriteriaOperator, af as QueryPage, Q as QueryResults, a as QueryResultsPromise, R as RetryOptions, K as SchemaAttribute, _ as SchemaAttributeChange, G as SchemaDataType, a3 as SchemaDiff, U as SchemaEntity, X as SchemaHistoryEntry, J as SchemaIdentifier, H as SchemaIdentifierGenerator, M as SchemaIndex, $ as SchemaIndexChange, L as SchemaIndexType, N as SchemaResolver, a0 as SchemaResolverChange, W as SchemaRevision, V as SchemaRevisionMetadata, a2 as SchemaTableDiff, T as SchemaTrigger, a1 as SchemaTriggerChange, P as SchemaTriggerEvent, Y as SchemaUpsertRequest, Z as SchemaValidationResult, S as SecretMetadata, C as SecretRecord, E as SecretSaveRequest, D as SecretsListResponse, ad as SelectQuery, a6 as Sort, a7 as StreamAction, ae as UpdateQuery, al as asc, aL as avg, at as between, aD as contains, aE as containsIgnoreCase, aN as count, am as desc, an as eq, aX as format, au as gt, av as gte, ap as inOp, aJ as isNull, aB as like, aU as lower, aw as lt, ax as lte, ay as matches, aP as max, aS as median, aO as min, ao as neq, aF as notContains, aG as notContainsIgnoreCase, ar as notIn, aC as notLike, aA as notMatches, aK as notNull, aI as notStartsWith, as as notWithin, aY as percentile, aW as replace, n as sdkName, v as sdkVersion, az as search, aH as startsWith, aQ as std, aV as substring, aM as sum, aT as upper, aR as variance, aq as within } from './aggregates-BPpzRHGH.cjs';
3
3
 
4
4
  declare const onyx: OnyxFacade;
5
5
 
6
- declare const sdkName = "@onyx.dev/onyx-database";
7
- declare const sdkVersion = "0.1.0";
8
-
9
- export { OnyxFacade, onyx, sdkName, sdkVersion };
6
+ export { OnyxFacade, onyx };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,6 @@
1
- import { O as OnyxFacade } from './aggregates-BJT5DGGX.js';
2
- export { s as AiChatClient, l as AiChatCompletionChoice, p as AiChatCompletionChunk, o as AiChatCompletionChunkChoice, n as AiChatCompletionChunkDelta, j as AiChatCompletionRequest, m as AiChatCompletionResponse, q as AiChatCompletionStream, k as AiChatCompletionUsage, f as AiChatMessage, r as AiChatOptions, c as AiChatRole, y as AiClient, x as AiErrorResponse, w as AiModel, v as AiModelsResponse, A as AiRequestOptions, t as AiScriptApprovalRequest, u as AiScriptApprovalResponse, h as AiTool, e as AiToolCall, d as AiToolCallFunction, i as AiToolChoice, g as AiToolFunction, a8 as FetchImpl, a7 as FetchResponse, F as FullTextQuery, ah as ICascadeBuilder, ai as ICascadeRelationshipBuilder, ae as IConditionBuilder, I as IOnyxDatabase, af as IQueryBuilder, ag as ISaveBuilder, a3 as LogicalOperator, b as OnyxConfig, a6 as OnyxDocument, aa as QueryCondition, a9 as QueryCriteria, a2 as QueryCriteriaOperator, ad as QueryPage, Q as QueryResults, a as QueryResultsPromise, R as RetryOptions, H as SchemaAttribute, Y as SchemaAttributeChange, D as SchemaDataType, a1 as SchemaDiff, P as SchemaEntity, V as SchemaHistoryEntry, G as SchemaIdentifier, E as SchemaIdentifierGenerator, K as SchemaIndex, Z as SchemaIndexChange, J as SchemaIndexType, L as SchemaResolver, _ as SchemaResolverChange, U as SchemaRevision, T as SchemaRevisionMetadata, a0 as SchemaTableDiff, N as SchemaTrigger, $ as SchemaTriggerChange, M as SchemaTriggerEvent, W as SchemaUpsertRequest, X as SchemaValidationResult, S as SecretMetadata, z as SecretRecord, C as SecretSaveRequest, B as SecretsListResponse, ab as SelectQuery, a4 as Sort, a5 as StreamAction, ac as UpdateQuery, aj as asc, aJ as avg, ar as between, aB as contains, aC as containsIgnoreCase, aL as count, ak as desc, al as eq, as as gt, at as gte, an as inOp, aH as isNull, az as like, aS as lower, au as lt, av as lte, aw as matches, aN as max, aQ as median, aM as min, am as neq, aD as notContains, aE as notContainsIgnoreCase, ap as notIn, aA as notLike, ay as notMatches, aI as notNull, aG as notStartsWith, aq as notWithin, aV as percentile, aU as replace, ax as search, aF as startsWith, aO as std, aT as substring, aK as sum, aR as upper, aP as variance, ao as within } from './aggregates-BJT5DGGX.js';
1
+ import { O as OnyxFacade } from './aggregates-BPpzRHGH.js';
2
+ export { t as AiChatClient, l as AiChatCompletionChoice, q as AiChatCompletionChunk, p as AiChatCompletionChunkChoice, o as AiChatCompletionChunkDelta, j as AiChatCompletionRequest, m as AiChatCompletionResponse, r as AiChatCompletionStream, k as AiChatCompletionUsage, f as AiChatMessage, s as AiChatOptions, c as AiChatRole, B as AiClient, z as AiErrorResponse, y as AiModel, x as AiModelsResponse, A as AiRequestOptions, u as AiScriptApprovalRequest, w as AiScriptApprovalResponse, h as AiTool, e as AiToolCall, d as AiToolCallFunction, i as AiToolChoice, g as AiToolFunction, aa as FetchImpl, a9 as FetchResponse, F as FullTextQuery, aj as ICascadeBuilder, ak as ICascadeRelationshipBuilder, ag as IConditionBuilder, I as IOnyxDatabase, ah as IQueryBuilder, ai as ISaveBuilder, a5 as LogicalOperator, b as OnyxConfig, a8 as OnyxDocument, ac as QueryCondition, ab as QueryCriteria, a4 as QueryCriteriaOperator, af as QueryPage, Q as QueryResults, a as QueryResultsPromise, R as RetryOptions, K as SchemaAttribute, _ as SchemaAttributeChange, G as SchemaDataType, a3 as SchemaDiff, U as SchemaEntity, X as SchemaHistoryEntry, J as SchemaIdentifier, H as SchemaIdentifierGenerator, M as SchemaIndex, $ as SchemaIndexChange, L as SchemaIndexType, N as SchemaResolver, a0 as SchemaResolverChange, W as SchemaRevision, V as SchemaRevisionMetadata, a2 as SchemaTableDiff, T as SchemaTrigger, a1 as SchemaTriggerChange, P as SchemaTriggerEvent, Y as SchemaUpsertRequest, Z as SchemaValidationResult, S as SecretMetadata, C as SecretRecord, E as SecretSaveRequest, D as SecretsListResponse, ad as SelectQuery, a6 as Sort, a7 as StreamAction, ae as UpdateQuery, al as asc, aL as avg, at as between, aD as contains, aE as containsIgnoreCase, aN as count, am as desc, an as eq, aX as format, au as gt, av as gte, ap as inOp, aJ as isNull, aB as like, aU as lower, aw as lt, ax as lte, ay as matches, aP as max, aS as median, aO as min, ao as neq, aF as notContains, aG as notContainsIgnoreCase, ar as notIn, aC as notLike, aA as notMatches, aK as notNull, aI as notStartsWith, as as notWithin, aY as percentile, aW as replace, n as sdkName, v as sdkVersion, az as search, aH as startsWith, aQ as std, aV as substring, aM as sum, aT as upper, aR as variance, aq as within } from './aggregates-BPpzRHGH.js';
3
3
 
4
4
  declare const onyx: OnyxFacade;
5
5
 
6
- declare const sdkName = "@onyx.dev/onyx-database";
7
- declare const sdkVersion = "0.1.0";
8
-
9
- export { OnyxFacade, onyx, sdkName, sdkVersion };
6
+ export { OnyxFacade, onyx };
package/dist/index.js CHANGED
@@ -1,3 +1,7 @@
1
+ // package.json
2
+ var name = "@onyx.dev/onyx-database";
3
+ var version = "2.0.1";
4
+
1
5
  // src/config/defaults.ts
2
6
  var DEFAULT_BASE_URL = "https://api.onyx.dev";
3
7
  var DEFAULT_AI_BASE_URL = "https://ai.onyx.dev";
@@ -949,8 +953,8 @@ var CascadeRelationshipBuilder = class {
949
953
  * builder.graph('programs');
950
954
  * ```
951
955
  */
952
- graph(name) {
953
- this.graphName = name;
956
+ graph(name2) {
957
+ this.graphName = name2;
954
958
  return this;
955
959
  }
956
960
  /**
@@ -1037,24 +1041,24 @@ function diffAttributes(apiAttrs, localAttrs) {
1037
1041
  const added = [];
1038
1042
  const removed = [];
1039
1043
  const changed = [];
1040
- for (const [name, local] of localMap.entries()) {
1041
- if (!apiMap.has(name)) {
1044
+ for (const [name2, local] of localMap.entries()) {
1045
+ if (!apiMap.has(name2)) {
1042
1046
  added.push(local);
1043
1047
  continue;
1044
1048
  }
1045
- const api = apiMap.get(name);
1049
+ const api = apiMap.get(name2);
1046
1050
  const apiNull = Boolean(api.isNullable);
1047
1051
  const localNull = Boolean(local.isNullable);
1048
1052
  if (api.type !== local.type || apiNull !== localNull) {
1049
1053
  changed.push({
1050
- name,
1054
+ name: name2,
1051
1055
  from: { type: api.type, isNullable: apiNull },
1052
1056
  to: { type: local.type, isNullable: localNull }
1053
1057
  });
1054
1058
  }
1055
1059
  }
1056
- for (const name of apiMap.keys()) {
1057
- if (!localMap.has(name)) removed.push(name);
1060
+ for (const name2 of apiMap.keys()) {
1061
+ if (!localMap.has(name2)) removed.push(name2);
1058
1062
  }
1059
1063
  added.sort((a, b) => a.name.localeCompare(b.name));
1060
1064
  removed.sort();
@@ -1068,22 +1072,22 @@ function diffIndexes(apiIndexes, localIndexes) {
1068
1072
  const added = [];
1069
1073
  const removed = [];
1070
1074
  const changed = [];
1071
- for (const [name, local] of localMap.entries()) {
1072
- if (!apiMap.has(name)) {
1075
+ for (const [name2, local] of localMap.entries()) {
1076
+ if (!apiMap.has(name2)) {
1073
1077
  added.push(local);
1074
1078
  continue;
1075
1079
  }
1076
- const api = apiMap.get(name);
1080
+ const api = apiMap.get(name2);
1077
1081
  const apiType = api.type ?? "DEFAULT";
1078
1082
  const localType = local.type ?? "DEFAULT";
1079
1083
  const apiScore = api.minimumScore;
1080
1084
  const localScore = local.minimumScore;
1081
1085
  if (apiType !== localType || apiScore !== localScore) {
1082
- changed.push({ name, from: api, to: local });
1086
+ changed.push({ name: name2, from: api, to: local });
1083
1087
  }
1084
1088
  }
1085
- for (const name of apiMap.keys()) {
1086
- if (!localMap.has(name)) removed.push(name);
1089
+ for (const name2 of apiMap.keys()) {
1090
+ if (!localMap.has(name2)) removed.push(name2);
1087
1091
  }
1088
1092
  added.sort((a, b) => a.name.localeCompare(b.name));
1089
1093
  removed.sort();
@@ -1097,18 +1101,18 @@ function diffResolvers(apiResolvers, localResolvers) {
1097
1101
  const added = [];
1098
1102
  const removed = [];
1099
1103
  const changed = [];
1100
- for (const [name, local] of localMap.entries()) {
1101
- if (!apiMap.has(name)) {
1104
+ for (const [name2, local] of localMap.entries()) {
1105
+ if (!apiMap.has(name2)) {
1102
1106
  added.push(local);
1103
1107
  continue;
1104
1108
  }
1105
- const api = apiMap.get(name);
1109
+ const api = apiMap.get(name2);
1106
1110
  if (api.resolver !== local.resolver) {
1107
- changed.push({ name, from: api, to: local });
1111
+ changed.push({ name: name2, from: api, to: local });
1108
1112
  }
1109
1113
  }
1110
- for (const name of apiMap.keys()) {
1111
- if (!localMap.has(name)) removed.push(name);
1114
+ for (const name2 of apiMap.keys()) {
1115
+ if (!localMap.has(name2)) removed.push(name2);
1112
1116
  }
1113
1117
  added.sort((a, b) => a.name.localeCompare(b.name));
1114
1118
  removed.sort();
@@ -1122,18 +1126,18 @@ function diffTriggers(apiTriggers, localTriggers) {
1122
1126
  const added = [];
1123
1127
  const removed = [];
1124
1128
  const changed = [];
1125
- for (const [name, local] of localMap.entries()) {
1126
- if (!apiMap.has(name)) {
1129
+ for (const [name2, local] of localMap.entries()) {
1130
+ if (!apiMap.has(name2)) {
1127
1131
  added.push(local);
1128
1132
  continue;
1129
1133
  }
1130
- const api = apiMap.get(name);
1134
+ const api = apiMap.get(name2);
1131
1135
  if (api.event !== local.event || api.trigger !== local.trigger) {
1132
- changed.push({ name, from: api, to: local });
1136
+ changed.push({ name: name2, from: api, to: local });
1133
1137
  }
1134
1138
  }
1135
- for (const name of apiMap.keys()) {
1136
- if (!localMap.has(name)) removed.push(name);
1139
+ for (const name2 of apiMap.keys()) {
1140
+ if (!localMap.has(name2)) removed.push(name2);
1137
1141
  }
1138
1142
  added.sort((a, b) => a.name.localeCompare(b.name));
1139
1143
  removed.sort();
@@ -1149,13 +1153,13 @@ function computeSchemaDiff(apiSchema, localSchema) {
1149
1153
  const newTables = [];
1150
1154
  const removedTables = [];
1151
1155
  const changedTables = [];
1152
- for (const [name, localEntity] of localMap.entries()) {
1153
- if (!apiMap.has(name)) {
1154
- newTables.push(name);
1156
+ for (const [name2, localEntity] of localMap.entries()) {
1157
+ if (!apiMap.has(name2)) {
1158
+ newTables.push(name2);
1155
1159
  continue;
1156
1160
  }
1157
- const apiEntity = apiMap.get(name);
1158
- const tableDiff = { name };
1161
+ const apiEntity = apiMap.get(name2);
1162
+ const tableDiff = { name: name2 };
1159
1163
  const partitionFrom = normalizePartition(apiEntity.partition);
1160
1164
  const partitionTo = normalizePartition(localEntity.partition);
1161
1165
  if (partitionFrom !== partitionTo) {
@@ -1180,8 +1184,8 @@ function computeSchemaDiff(apiSchema, localSchema) {
1180
1184
  changedTables.push(tableDiff);
1181
1185
  }
1182
1186
  }
1183
- for (const name of apiMap.keys()) {
1184
- if (!localMap.has(name)) removedTables.push(name);
1187
+ for (const name2 of apiMap.keys()) {
1188
+ if (!localMap.has(name2)) removedTables.push(name2);
1185
1189
  }
1186
1190
  newTables.sort();
1187
1191
  removedTables.sort();
@@ -2325,12 +2329,9 @@ var upper = (attribute) => `upper(${attribute})`;
2325
2329
  var lower = (attribute) => `lower(${attribute})`;
2326
2330
  var substring = (attribute, from, length) => `substring(${attribute},${from},${length})`;
2327
2331
  var replace = (attribute, pattern, repl) => `replace(${attribute}, '${pattern.replace(/'/g, "\\'")}', '${repl.replace(/'/g, "\\'")}')`;
2332
+ var format = (attribute, formatter) => `format(${attribute}, '${formatter.replace(/'/g, "\\'")}')`;
2328
2333
  var percentile = (attribute, p) => `percentile(${attribute}, ${p})`;
2329
2334
 
2330
- // src/index.ts
2331
- var sdkName = "@onyx.dev/onyx-database";
2332
- var sdkVersion = "0.1.0";
2333
-
2334
- 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 };
2335
+ export { QueryResults, asc, avg, between, contains, containsIgnoreCase, count, desc, eq, format, gt, gte, inOp, isNull, like, lower, lt, lte, matches, max, median, min, neq, notContains, notContainsIgnoreCase, notIn, notLike, notMatches, notNull, notStartsWith, notWithin, onyx, percentile, replace, name as sdkName, version as sdkVersion, search, startsWith, std, substring, sum, upper, variance, within };
2335
2336
  //# sourceMappingURL=index.js.map
2336
2337
  //# sourceMappingURL=index.js.map