@narrative.io/data-collaboration-sdk-ts 0.0.127 → 0.0.129

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,7 +1,7 @@
1
1
  import { type ApiRecords } from "../types";
2
2
  import { BaseApi } from "../base-api";
3
- import type { FilePerSnapshotResponse, Dataset, DatasetTableSummaryAPIResponse, ColumnStatistics, RetentionPolicy, DatasetTableSummary, RecalculationInfo, UpdateDatasetRequest, SchemaFileConfigType, SchemaPropertiesType, DatasetStatus, DatasetWriteMode, SchemaFileConfig, SchemaProperties, SchemaArrayProperty, Schema, AdvancedStatisticsMetadata, SnapshotRange, Configuration, Columns, ColumnSummary, BasicStatistics, AdvancedStatistics, Histogram, Value } from "./types";
4
- export { type FilePerSnapshotResponse, type Dataset, type RetentionPolicy, type DatasetTableSummaryAPIResponse, type ColumnStatistics, type UpdateDatasetRequest, type SchemaFileConfigType, type SchemaPropertiesType, type DatasetStatus, type DatasetWriteMode, type SchemaFileConfig, type SchemaProperties, type SchemaArrayProperty, type Schema, type AdvancedStatisticsMetadata, type SnapshotRange, type Configuration, type Columns, type ColumnSummary, type BasicStatistics, type AdvancedStatistics, type Histogram, type Value, };
3
+ import type { FilePerSnapshotResponse, Dataset, DatasetTableSummaryAPIResponse, ColumnStatistics, RetentionPolicy, DatasetTableSummary, RecalculationInfo, UpdateDatasetRequest, SchemaFileConfigType, SchemaPropertiesType, DatasetStatus, DatasetWriteMode, SchemaFileConfig, SchemaProperties, SchemaProperty, SchemaPrimitiveProperty, SchemaObjectProperty, SchemaArrayProperty, SchemaArrayItems, Schema, AdvancedStatisticsMetadata, SnapshotRange, Configuration, Columns, ColumnSummary, BasicStatistics, AdvancedStatistics, Histogram, Value } from "./types";
4
+ export { type FilePerSnapshotResponse, type Dataset, type RetentionPolicy, type DatasetTableSummaryAPIResponse, type ColumnStatistics, type UpdateDatasetRequest, type SchemaFileConfigType, type SchemaPropertiesType, type DatasetStatus, type DatasetWriteMode, type SchemaFileConfig, type SchemaProperties, type SchemaProperty, type SchemaPrimitiveProperty, type SchemaObjectProperty, type SchemaArrayProperty, type SchemaArrayItems, type Schema, type AdvancedStatisticsMetadata, type SnapshotRange, type Configuration, type Columns, type ColumnSummary, type BasicStatistics, type AdvancedStatistics, type Histogram, type Value, };
5
5
  /**
6
6
  * @module DatasetApi
7
7
  * @description This module provides methods for fetching datasets.
@@ -100,18 +100,29 @@ export interface SchemaFileConfig {
100
100
  header?: boolean;
101
101
  quote?: string;
102
102
  }
103
- export type SchemaProperties = Record<string, {
103
+ export type SchemaProperties = Record<string, SchemaProperty>;
104
+ export type SchemaProperty = SchemaPrimitiveProperty | SchemaArrayProperty | SchemaObjectProperty;
105
+ export interface SchemaPrimitiveProperty {
104
106
  type: SchemaPropertiesType;
105
107
  order?: number;
106
108
  approximate_cardinality?: number;
107
109
  description?: string;
108
- items?: SchemaArrayProperty;
109
- properties?: SchemaProperties;
110
- }>;
110
+ }
111
+ export interface SchemaObjectProperty {
112
+ type: SchemaPropertiesType;
113
+ order?: number;
114
+ approximate_cardinality?: number;
115
+ description?: string;
116
+ properties: SchemaProperties;
117
+ }
111
118
  export interface SchemaArrayProperty {
112
119
  type: SchemaPropertiesType;
113
- properties?: SchemaProperties;
120
+ order?: number;
121
+ approximate_cardinality?: number;
122
+ description?: string;
123
+ items: SchemaArrayItems;
114
124
  }
125
+ export type SchemaArrayItems = Omit<SchemaProperty, "description" | "order" | "approximate_cardinality">;
115
126
  export interface Schema {
116
127
  file_config: SchemaFileConfig;
117
128
  type: SchemaType;
package/build/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import { DatasetApi } from "./datasets";
3
3
  import { HealthCheckApi } from "./health";
4
4
  import { RosettaStoneApi } from "./rosetta-stone";
5
5
  import { type Environment, type Config, type ApiRecords, type MonetaryAmount } from "./types";
6
- import type { DatasetTableSummaryAPIResponse, Dataset, DatasetTableSummary, FilePerSnapshotResponse, RetentionPolicy, UpdateDatasetRequest, SchemaFileConfigType, SchemaPropertiesType, DatasetStatus, DatasetWriteMode, SchemaFileConfig, SchemaProperties, SchemaArrayProperty, Schema, AdvancedStatisticsMetadata, SnapshotRange, Configuration, Columns, ColumnSummary, ColumnStatistics, BasicStatistics, AdvancedStatistics, Histogram, Value } from "./datasets/types";
6
+ import type { DatasetTableSummaryAPIResponse, Dataset, DatasetTableSummary, FilePerSnapshotResponse, RetentionPolicy, UpdateDatasetRequest, SchemaFileConfigType, SchemaPropertiesType, DatasetStatus, DatasetWriteMode, SchemaFileConfig, SchemaProperties, SchemaProperty, SchemaPrimitiveProperty, SchemaObjectProperty, SchemaArrayProperty, SchemaArrayItems, Schema, AdvancedStatisticsMetadata, SnapshotRange, Configuration, Columns, ColumnSummary, ColumnStatistics, BasicStatistics, AdvancedStatistics, Histogram, Value } from "./datasets/types";
7
7
  import { type HealthCheckResult } from "./health/types";
8
8
  import { type SampleRecords } from "./rosetta-stone/types";
9
9
  import { AttributeApi } from "./attributes";
@@ -33,4 +33,4 @@ declare class NarrativeApi extends BaseApi {
33
33
  }
34
34
  interface NarrativeApi extends BaseApi, HealthCheckApi, DatasetApi, RosettaStoneApi, AttributeApi, PingApi, CompanyInfoApi, InstallationsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi, ContractsApi, AuthenticationApi, MappingsApi, AccessRulesApi, AppsApi, SubscriptionsApi {
35
35
  }
36
- export { NarrativeApi, AttributeApi, HealthCheckApi, DatasetApi, PingApi, ProductsApi, CompanyInfoApi, InstallationsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi, ContractsApi, AuthenticationApi, AppsApi, MappingsApi, AccessRulesApi, SubscriptionsApi, getNqlObject, buildNql, convertNqlObjectToForecastBody, isConversationAssistantMessage, isConversationFunctionMessage, isConversationInputMessage, isConversationMessage, isConversationMessageName, isConversationMessageRole, isConversationMessages, isConversationSystemMessage, isConversationUserMessage, isType, isConversationMessageFunctionCall, isConversationAssistantMessageWithFunctionCall, isRosettaRequestMessage, isConversationAssistantMessageWithoutFunctionCall, type App, type Resource, type UploadsResponse, type PingStatus, type Attribute, type ShallowAttribute, type RefAttribute, type SubAttribute, type PrimitiveAttribute, type ArrayAttribute, type ObjectAttribute, type Environment, type Config, type ApiRecords, type Dataset, type HealthCheckResult, type SampleRecords, type DatasetTableSummary, type DatasetTableSummaryAPIResponse, type UpdateDatasetRequest, type SchemaFileConfigType, type SchemaPropertiesType, type DatasetStatus, type DatasetWriteMode, type SchemaFileConfig, type SchemaProperties, type SchemaArrayProperty, type Schema, type AdvancedStatisticsMetadata, type SnapshotRange, type Configuration, type Columns, type ColumnSummary, type ColumnStatistics, type BasicStatistics, type AdvancedStatistics, type Histogram, type Value, type Product, type MonetaryAmount, type CompanyInfo, type Installation, type FilePerSnapshotResponse, type BucketCreationRequest, type UpdateAccessTypeRequest, type CompiledNql, type CreateMaterializedView, type Deduplication, type Explain, type Expression, type Raw, type Select, type Statement, type Table, type Nql, type NqlAst, type NqlField, type NqlResult, type NqlQueryInput, type NqlCompileResult, type NqlExpression, type NqlWhere, type NqlFilterExpression, type NqlBooleanExpression, type NqlFilterBinaryExpression, type NqlFilterUnaryExpression, type DataStream, type DataRules, type ColumnSet, type ColumnWithFilterAndExport, type AttributeSet, type ForecastRequest, type ForecastResponse, type CostForecastRequest, type CostForecastResponse, type JobState, type ContractDetails, type CustomerContract, type PaymentMethod, type ContractRateView, type LoginRequest, type LoginResponse, type RegisterRequest, type RegisterResponse, type LoggedInUser, type StytchToken, type ApiToken, type UserRole, type RegistrationStatus, type RegistrationStatusRequest, type RegistrationStatusResponse, type ForecastBody, type ConversationAssistantMessage, type ConversationFunctionMessage, type ConversationIOMessage, type ConversationMessage, type ConversationMessageName, type ConversationMessageRole, type ConversationMessages, type ConversationSystemMessage, type ConversationUserMessage, type RosettaRequestMessage, type ConversationMessageFunctionCall, type ConversationAssistantMessageWithFunctionCall, type RosettaResponseMessage, type ConversationAssistantMessageWithoutFunctionCall, type RetentionPolicy, type AccessRule, type Subscription, type SubscriptionDetails, type DataStreamSubscriptionDetails, type MarketplaceSubscriptionDetails, type SubscriptionOutput, type SubscriptionType, type SubscriptionStatus, type SubscriptionBudget, compileStatement, parseStatement, };
36
+ export { NarrativeApi, AttributeApi, HealthCheckApi, DatasetApi, PingApi, ProductsApi, CompanyInfoApi, InstallationsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi, ContractsApi, AuthenticationApi, AppsApi, MappingsApi, AccessRulesApi, SubscriptionsApi, getNqlObject, buildNql, convertNqlObjectToForecastBody, isConversationAssistantMessage, isConversationFunctionMessage, isConversationInputMessage, isConversationMessage, isConversationMessageName, isConversationMessageRole, isConversationMessages, isConversationSystemMessage, isConversationUserMessage, isType, isConversationMessageFunctionCall, isConversationAssistantMessageWithFunctionCall, isRosettaRequestMessage, isConversationAssistantMessageWithoutFunctionCall, type App, type Resource, type UploadsResponse, type PingStatus, type Attribute, type ShallowAttribute, type RefAttribute, type SubAttribute, type PrimitiveAttribute, type ArrayAttribute, type ObjectAttribute, type Environment, type Config, type ApiRecords, type Dataset, type HealthCheckResult, type SampleRecords, type DatasetTableSummary, type DatasetTableSummaryAPIResponse, type UpdateDatasetRequest, type SchemaFileConfigType, type SchemaPropertiesType, type DatasetStatus, type DatasetWriteMode, type SchemaFileConfig, type SchemaProperties, type SchemaProperty, type SchemaPrimitiveProperty, type SchemaObjectProperty, type SchemaArrayProperty, type SchemaArrayItems, type Schema, type AdvancedStatisticsMetadata, type SnapshotRange, type Configuration, type Columns, type ColumnSummary, type ColumnStatistics, type BasicStatistics, type AdvancedStatistics, type Histogram, type Value, type Product, type MonetaryAmount, type CompanyInfo, type Installation, type FilePerSnapshotResponse, type BucketCreationRequest, type UpdateAccessTypeRequest, type CompiledNql, type CreateMaterializedView, type Deduplication, type Explain, type Expression, type Raw, type Select, type Statement, type Table, type Nql, type NqlAst, type NqlField, type NqlResult, type NqlQueryInput, type NqlCompileResult, type NqlExpression, type NqlWhere, type NqlFilterExpression, type NqlBooleanExpression, type NqlFilterBinaryExpression, type NqlFilterUnaryExpression, type DataStream, type DataRules, type ColumnSet, type ColumnWithFilterAndExport, type AttributeSet, type ForecastRequest, type ForecastResponse, type CostForecastRequest, type CostForecastResponse, type JobState, type ContractDetails, type CustomerContract, type PaymentMethod, type ContractRateView, type LoginRequest, type LoginResponse, type RegisterRequest, type RegisterResponse, type LoggedInUser, type StytchToken, type ApiToken, type UserRole, type RegistrationStatus, type RegistrationStatusRequest, type RegistrationStatusResponse, type ForecastBody, type ConversationAssistantMessage, type ConversationFunctionMessage, type ConversationIOMessage, type ConversationMessage, type ConversationMessageName, type ConversationMessageRole, type ConversationMessages, type ConversationSystemMessage, type ConversationUserMessage, type RosettaRequestMessage, type ConversationMessageFunctionCall, type ConversationAssistantMessageWithFunctionCall, type RosettaResponseMessage, type ConversationAssistantMessageWithoutFunctionCall, type RetentionPolicy, type AccessRule, type Subscription, type SubscriptionDetails, type DataStreamSubscriptionDetails, type MarketplaceSubscriptionDetails, type SubscriptionOutput, type SubscriptionType, type SubscriptionStatus, type SubscriptionBudget, compileStatement, parseStatement, };
@@ -33,13 +33,14 @@ async function getAttributesFromFields(fields) {
33
33
  });
34
34
  const attributes = await attributesApi.getAttributes();
35
35
  const uniqueAttributes = [
36
- ...new Set(fields.map((field) => field.field.split(".")[0])),
36
+ ...new Set(fields.map((field) => stripQuotes(field.field).split(".")[0])),
37
37
  ].filter((att) => !att.startsWith("_"));
38
38
  uniqueAttributes.forEach((att) => {
39
39
  const isObjectProperty = isObject(attributes.records, att);
40
40
  const relevantFields = isObjectProperty != null
41
- ? fields.filter((field) => field.field.split(".")[0] === att && field.field !== att)
42
- : fields.filter((field) => field.field.split(".")[0] === att);
41
+ ? fields.filter((field) => stripQuotes(field.field).split(".")[0] === att &&
42
+ field.field !== att)
43
+ : fields.filter((field) => stripQuotes(field.field).split(".")[0] === att);
43
44
  const attributeId = attributes.records.find((attribute) => attribute.name === att)?.id;
44
45
  if (attributeId === undefined) {
45
46
  throw new Error(`Attribute ${att} not found`);
@@ -89,10 +90,10 @@ function ensureAtLeastOneRequired(dataRulesAttributes) {
89
90
  function getPriceFromNql(nqlObject) {
90
91
  const priceFilter = nqlObject.where.filterExpressions.filter((expr) => ("left" in expr &&
91
92
  typeof expr.left === "object" &&
92
- expr.left.field === "_price_cpm_usd") ||
93
+ stripQuotes(expr.left.field) === "_price_cpm_usd") ||
93
94
  ("right" in expr &&
94
95
  typeof expr.right === "object" &&
95
- expr.right.field === "_price_cpm_usd"));
96
+ stripQuotes(expr.right.field) === "_price_cpm_usd"));
96
97
  if (priceFilter.length !== 1) {
97
98
  throw new Error("Expected exactly one price filter");
98
99
  }
@@ -120,7 +121,7 @@ function getFieldsFromNql(nqlObject) {
120
121
  // Extract all fields from the 'select' section and mark them as exported.
121
122
  nqlObject.select.forEach((field) => {
122
123
  fieldsArray.push({
123
- field: field.field.replace('"value"', "value").replace('"type"', "type"),
124
+ field: stripQuotes(field.field),
124
125
  exported: true,
125
126
  });
126
127
  });
@@ -157,7 +158,7 @@ function handleFilterExpression(expression, fieldsArray) {
157
158
  * @param {any} filterExpression - The filter expression to add to the field.
158
159
  */
159
160
  function updateFieldsArray(field, fieldsArray, filterExpression) {
160
- const existingEntry = fieldsArray.find((entry) => entry.field === field.field);
161
+ const existingEntry = fieldsArray.find((entry) => entry.field === stripQuotes(field.field));
161
162
  if (existingEntry !== undefined) {
162
163
  if (existingEntry.filter !== undefined &&
163
164
  typeof existingEntry.filter === "object" &&
@@ -173,7 +174,7 @@ function updateFieldsArray(field, fieldsArray, filterExpression) {
173
174
  else {
174
175
  // If this field does not exist in the fieldsArray, add it with the new filter expression.
175
176
  fieldsArray.push({
176
- field: field.field,
177
+ field: stripQuotes(field.field),
177
178
  exported: false,
178
179
  filter: { expressions: [filterExpression] },
179
180
  });
@@ -185,7 +186,7 @@ function updateFieldsArray(field, fieldsArray, filterExpression) {
185
186
  * @returns {string} - Returns a string representation of the unary filter expression.
186
187
  */
187
188
  function constructUnaryFilterExpression(filter) {
188
- return `${expressionToString(filter.field.field)} ${filter.operator}`;
189
+ return `${expressionToString(stripQuotes(filter.field.field))} ${filter.operator}`;
189
190
  }
190
191
  /**
191
192
  * Constructs a string representing a binary filter expression.
@@ -193,7 +194,7 @@ function constructUnaryFilterExpression(filter) {
193
194
  * @returns {string} - Returns a string representation of the binary filter expression.
194
195
  */
195
196
  function constructBinaryFilterExpression(filter) {
196
- return `${expressionToString(filter.left)} ${filter.operator} ${expressionToString(filter.right)}`;
197
+ return `${stripQuotes(expressionToString(filter.left))} ${filter.operator} ${stripQuotes(expressionToString(filter.right))}`;
197
198
  }
198
199
  /**
199
200
  * Converts an expression to a string.
@@ -448,3 +449,12 @@ function generateWhereClause(dataRules) {
448
449
  }
449
450
  return `WHERE ${whereConditions.join(" AND ")}`;
450
451
  }
452
+ /**
453
+ * Removes all double quotes from the given string.
454
+ *
455
+ * @param {string} str - The input string.
456
+ * @returns {string} The string without double quotes.
457
+ */
458
+ function stripQuotes(str) {
459
+ return str.replace(/"/g, "");
460
+ }
@@ -69,7 +69,7 @@ export declare const NqlTableObject: z.ZodObject<{
69
69
  }>;
70
70
  export type NqlTable = z.infer<typeof NqlTableObject>;
71
71
  export declare const NqlFieldObj: z.ZodObject<{
72
- field: z.ZodString;
72
+ field: z.ZodEffects<z.ZodString, string, string>;
73
73
  table: z.ZodObject<{
74
74
  database: z.ZodEffects<z.ZodString, string, string>;
75
75
  table: z.ZodEffects<z.ZodString, string, string>;
@@ -95,7 +95,7 @@ export declare const NqlFieldObj: z.ZodObject<{
95
95
  }>;
96
96
  export declare const NqlFilterUnaryExpressionObj: z.ZodObject<{
97
97
  field: z.ZodObject<{
98
- field: z.ZodString;
98
+ field: z.ZodEffects<z.ZodString, string, string>;
99
99
  table: z.ZodObject<{
100
100
  database: z.ZodEffects<z.ZodString, string, string>;
101
101
  table: z.ZodEffects<z.ZodString, string, string>;
@@ -141,7 +141,7 @@ export declare const NqlFilterUnaryExpressionObj: z.ZodObject<{
141
141
  }>;
142
142
  export type NqlFilterUnaryExpression = z.infer<typeof NqlFilterUnaryExpressionObj>;
143
143
  declare const NqlExpressionObj: z.ZodUnion<[z.ZodObject<{
144
- field: z.ZodString;
144
+ field: z.ZodEffects<z.ZodString, string, string>;
145
145
  table: z.ZodObject<{
146
146
  database: z.ZodEffects<z.ZodString, string, string>;
147
147
  table: z.ZodEffects<z.ZodString, string, string>;
@@ -168,7 +168,7 @@ declare const NqlExpressionObj: z.ZodUnion<[z.ZodObject<{
168
168
  export type NqlExpression = z.infer<typeof NqlExpressionObj>;
169
169
  export declare const NqlFilterBinaryExpressionObj: z.ZodObject<{
170
170
  left: z.ZodUnion<[z.ZodObject<{
171
- field: z.ZodString;
171
+ field: z.ZodEffects<z.ZodString, string, string>;
172
172
  table: z.ZodObject<{
173
173
  database: z.ZodEffects<z.ZodString, string, string>;
174
174
  table: z.ZodEffects<z.ZodString, string, string>;
@@ -194,7 +194,7 @@ export declare const NqlFilterBinaryExpressionObj: z.ZodObject<{
194
194
  }>, z.ZodString, z.ZodNumber, z.ZodBoolean]>;
195
195
  operator: z.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "IN", "NOT IN", "LIKE", "NOT LIKE"]>;
196
196
  right: z.ZodUnion<[z.ZodObject<{
197
- field: z.ZodString;
197
+ field: z.ZodEffects<z.ZodString, string, string>;
198
198
  table: z.ZodObject<{
199
199
  database: z.ZodEffects<z.ZodString, string, string>;
200
200
  table: z.ZodEffects<z.ZodString, string, string>;
@@ -277,7 +277,7 @@ export declare const NqlFilterBinaryExpressionObj: z.ZodObject<{
277
277
  }>;
278
278
  export declare const NqlFilterExpressionObj: z.ZodUnion<[z.ZodObject<{
279
279
  field: z.ZodObject<{
280
- field: z.ZodString;
280
+ field: z.ZodEffects<z.ZodString, string, string>;
281
281
  table: z.ZodObject<{
282
282
  database: z.ZodEffects<z.ZodString, string, string>;
283
283
  table: z.ZodEffects<z.ZodString, string, string>;
@@ -322,7 +322,7 @@ export declare const NqlFilterExpressionObj: z.ZodUnion<[z.ZodObject<{
322
322
  };
323
323
  }>, z.ZodObject<{
324
324
  left: z.ZodUnion<[z.ZodObject<{
325
- field: z.ZodString;
325
+ field: z.ZodEffects<z.ZodString, string, string>;
326
326
  table: z.ZodObject<{
327
327
  database: z.ZodEffects<z.ZodString, string, string>;
328
328
  table: z.ZodEffects<z.ZodString, string, string>;
@@ -348,7 +348,7 @@ export declare const NqlFilterExpressionObj: z.ZodUnion<[z.ZodObject<{
348
348
  }>, z.ZodString, z.ZodNumber, z.ZodBoolean]>;
349
349
  operator: z.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "IN", "NOT IN", "LIKE", "NOT LIKE"]>;
350
350
  right: z.ZodUnion<[z.ZodObject<{
351
- field: z.ZodString;
351
+ field: z.ZodEffects<z.ZodString, string, string>;
352
352
  table: z.ZodObject<{
353
353
  database: z.ZodEffects<z.ZodString, string, string>;
354
354
  table: z.ZodEffects<z.ZodString, string, string>;
@@ -436,7 +436,7 @@ export declare const NqlWhereObj: z.ZodEffects<z.ZodObject<{
436
436
  booleanExpressions: z.ZodArray<z.ZodEnum<["AND", "OR"]>, "many">;
437
437
  filterExpressions: z.ZodArray<z.ZodUnion<[z.ZodObject<{
438
438
  field: z.ZodObject<{
439
- field: z.ZodString;
439
+ field: z.ZodEffects<z.ZodString, string, string>;
440
440
  table: z.ZodObject<{
441
441
  database: z.ZodEffects<z.ZodString, string, string>;
442
442
  table: z.ZodEffects<z.ZodString, string, string>;
@@ -481,7 +481,7 @@ export declare const NqlWhereObj: z.ZodEffects<z.ZodObject<{
481
481
  };
482
482
  }>, z.ZodObject<{
483
483
  left: z.ZodUnion<[z.ZodObject<{
484
- field: z.ZodString;
484
+ field: z.ZodEffects<z.ZodString, string, string>;
485
485
  table: z.ZodObject<{
486
486
  database: z.ZodEffects<z.ZodString, string, string>;
487
487
  table: z.ZodEffects<z.ZodString, string, string>;
@@ -507,7 +507,7 @@ export declare const NqlWhereObj: z.ZodEffects<z.ZodObject<{
507
507
  }>, z.ZodString, z.ZodNumber, z.ZodBoolean]>;
508
508
  operator: z.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "IN", "NOT IN", "LIKE", "NOT LIKE"]>;
509
509
  right: z.ZodUnion<[z.ZodObject<{
510
- field: z.ZodString;
510
+ field: z.ZodEffects<z.ZodString, string, string>;
511
511
  table: z.ZodObject<{
512
512
  database: z.ZodEffects<z.ZodString, string, string>;
513
513
  table: z.ZodEffects<z.ZodString, string, string>;
@@ -754,7 +754,7 @@ export type NqlFilterBinaryExpression = z.infer<typeof NqlFilterBinaryExpression
754
754
  export declare const NqlObj: z.ZodObject<{
755
755
  explain: z.ZodOptional<z.ZodEnum<["EXPLAIN"]>>;
756
756
  select: z.ZodArray<z.ZodObject<{
757
- field: z.ZodString;
757
+ field: z.ZodEffects<z.ZodString, string, string>;
758
758
  table: z.ZodObject<{
759
759
  database: z.ZodEffects<z.ZodString, string, string>;
760
760
  table: z.ZodEffects<z.ZodString, string, string>;
@@ -792,7 +792,7 @@ export declare const NqlObj: z.ZodObject<{
792
792
  booleanExpressions: z.ZodArray<z.ZodEnum<["AND", "OR"]>, "many">;
793
793
  filterExpressions: z.ZodArray<z.ZodUnion<[z.ZodObject<{
794
794
  field: z.ZodObject<{
795
- field: z.ZodString;
795
+ field: z.ZodEffects<z.ZodString, string, string>;
796
796
  table: z.ZodObject<{
797
797
  database: z.ZodEffects<z.ZodString, string, string>;
798
798
  table: z.ZodEffects<z.ZodString, string, string>;
@@ -837,7 +837,7 @@ export declare const NqlObj: z.ZodObject<{
837
837
  };
838
838
  }>, z.ZodObject<{
839
839
  left: z.ZodUnion<[z.ZodObject<{
840
- field: z.ZodString;
840
+ field: z.ZodEffects<z.ZodString, string, string>;
841
841
  table: z.ZodObject<{
842
842
  database: z.ZodEffects<z.ZodString, string, string>;
843
843
  table: z.ZodEffects<z.ZodString, string, string>;
@@ -863,7 +863,7 @@ export declare const NqlObj: z.ZodObject<{
863
863
  }>, z.ZodString, z.ZodNumber, z.ZodBoolean]>;
864
864
  operator: z.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "IN", "NOT IN", "LIKE", "NOT LIKE"]>;
865
865
  right: z.ZodUnion<[z.ZodObject<{
866
- field: z.ZodString;
866
+ field: z.ZodEffects<z.ZodString, string, string>;
867
867
  table: z.ZodObject<{
868
868
  database: z.ZodEffects<z.ZodString, string, string>;
869
869
  table: z.ZodEffects<z.ZodString, string, string>;
@@ -58,7 +58,7 @@ export const NqlTableObject = z.object({
58
58
  .refine((x) => x.replaceAll('"', "").toLowerCase() === "rosetta_stone", "Table must be `rosetta_stone`."),
59
59
  });
60
60
  export const NqlFieldObj = z.object({
61
- field: z.string().trim(),
61
+ field: z.string().refine((x) => x.replaceAll('"', "").trim()),
62
62
  table: NqlTableObject,
63
63
  });
64
64
  export const NqlFilterUnaryExpressionObj = z.object({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@narrative.io/data-collaboration-sdk-ts",
3
- "version": "0.0.127",
3
+ "version": "0.0.129",
4
4
  "main": "build/index.js",
5
5
  "repository": "github:narrative-io/data-collaboration-sdk-ts",
6
6
  "source": "src/index.ts",