@narrative.io/data-collaboration-sdk-ts 0.0.54 → 0.0.55

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/build/index.d.ts CHANGED
@@ -16,7 +16,7 @@ import { type PingStatus } from './ping/types';
16
16
  import { type Product, ProductsApi } from './products';
17
17
  import { CompanyInfoApi, type CompanyInfo } from './company-info';
18
18
  import { InstallationsApi, type Installation } from './installations';
19
- import { NqlApi, type Nql, type NqlResult, type NqlQueryInput, type NqlCompileResult, type NqlWhere, type NqlFilterExpression, type NqlBooleanExpression, type NqlFilterBinaryExpression } from './nql';
19
+ import { NqlApi, type Nql, type NqlField, type NqlResult, type NqlQueryInput, type NqlCompileResult, type NqlExpression, type NqlWhere, type NqlFilterExpression, type NqlBooleanExpression, type NqlFilterBinaryExpression, type NqlFilterUnaryExpression } from './nql';
20
20
  import { DataStreamsApi, type DataStream } from './data-streams';
21
21
  import { ForecastApi, type ForecastRequest, type ForecastResponse, type CostForecastRequest, type CostForecastResponse, type JobState } from './forecast';
22
22
  import { ContractsApi, type ContractDetails, type CustomerContract, type PaymentMethod, type ContractRateView } from './contracts';
@@ -25,4 +25,4 @@ declare class NarrativeApi extends BaseApi {
25
25
  }
26
26
  interface NarrativeApi extends BaseApi, HealthCheckApi, DatasetApi, RosettaStoneApi, AttributeApi, PingApi, CompanyInfoApi, InstallationsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi, ContractsApi {
27
27
  }
28
- export { NarrativeApi, AttributeApi, HealthCheckApi, DatasetApi, PingApi, ProductsApi, CompanyInfoApi, InstallationsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi, ContractsApi, type Resource, type UploadsResponse, type PingStatus, type Attribute, type Environment, type Config, type ApiRecords, type Dataset, type HealthCheckResult, type SampleRecords, type DatasetTableSummary, type DatasetTableSummaryAPIResponse, type Product, type MonetaryAmount, type CompanyInfo, type Installation, type FilePerSnapshotResponse, type BucketCreationRequest, type UpdateAccessTypeRequest, type Nql, type NqlQueryInput, type NqlResult, type NqlCompileResult, type NqlWhere, type NqlFilterExpression, type NqlBooleanExpression, type NqlFilterBinaryExpression, type DataStream, type ForecastRequest, type ForecastResponse, type CostForecastRequest, type CostForecastResponse, type JobState, type ContractDetails, type CustomerContract, type PaymentMethod, type ContractRateView, getNqlObject, buildNql };
28
+ export { NarrativeApi, AttributeApi, HealthCheckApi, DatasetApi, PingApi, ProductsApi, CompanyInfoApi, InstallationsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi, ContractsApi, type Resource, type UploadsResponse, type PingStatus, type Attribute, type Environment, type Config, type ApiRecords, type Dataset, type HealthCheckResult, type SampleRecords, type DatasetTableSummary, type DatasetTableSummaryAPIResponse, type Product, type MonetaryAmount, type CompanyInfo, type Installation, type FilePerSnapshotResponse, type BucketCreationRequest, type UpdateAccessTypeRequest, type Nql, type NqlField, type NqlResult, type NqlQueryInput, type NqlCompileResult, type NqlExpression, type NqlWhere, type NqlFilterExpression, type NqlBooleanExpression, type NqlFilterBinaryExpression, type NqlFilterUnaryExpression, type DataStream, type ForecastRequest, type ForecastResponse, type CostForecastRequest, type CostForecastResponse, type JobState, type ContractDetails, type CustomerContract, type PaymentMethod, type ContractRateView, getNqlObject, buildNql };
@@ -1,6 +1,6 @@
1
1
  import { BaseApi } from '../base-api';
2
2
  import type { Plan } from './SubstraitParser';
3
- import type { Nql, NqlCompileResult, NqlQueryInput, NqlResult, NqlWhere, NqlFilterBinaryExpression, NqlBooleanExpression, NqlFilterExpression } from './types';
3
+ import type { Nql, NqlField, NqlResult, NqlCompileResult, NqlQueryInput, NqlExpression, NqlWhere, NqlFilterBinaryExpression, NqlBooleanExpression, NqlFilterExpression, NqlFilterUnaryExpression } from './types';
4
4
  /**
5
5
  * A class for accessing the NQL API.
6
6
  * @extends BaseApi
@@ -35,4 +35,4 @@ declare class NqlApi extends BaseApi {
35
35
  */
36
36
  getNqlByJobId(id: string): Promise<NqlResult>;
37
37
  }
38
- export { NqlApi, type NqlResult, type NqlQueryInput, type NqlCompileResult, type Nql, type NqlWhere, type NqlFilterExpression, type NqlBooleanExpression, type NqlFilterBinaryExpression };
38
+ export { NqlApi, type Nql, type NqlField, type NqlResult, type NqlQueryInput, type NqlCompileResult, type NqlExpression, type NqlWhere, type NqlFilterExpression, type NqlBooleanExpression, type NqlFilterBinaryExpression, type NqlFilterUnaryExpression };
@@ -140,6 +140,32 @@ export declare const NqlFilterUnaryExpressionObj: z.ZodObject<{
140
140
  operator: "IS NULL" | "IS NOT NULL";
141
141
  }>;
142
142
  export type NqlFilterUnaryExpression = z.infer<typeof NqlFilterUnaryExpressionObj>;
143
+ declare const NqlExpressionObj: z.ZodUnion<[z.ZodObject<{
144
+ field: z.ZodString;
145
+ table: z.ZodObject<{
146
+ database: z.ZodEnum<["narrative"]>;
147
+ table: z.ZodEnum<["rosetta_stone"]>;
148
+ }, "strip", z.ZodTypeAny, {
149
+ database: "narrative";
150
+ table: "rosetta_stone";
151
+ }, {
152
+ database: "narrative";
153
+ table: "rosetta_stone";
154
+ }>;
155
+ }, "strip", z.ZodTypeAny, {
156
+ field: string;
157
+ table: {
158
+ database: "narrative";
159
+ table: "rosetta_stone";
160
+ };
161
+ }, {
162
+ field: string;
163
+ table: {
164
+ database: "narrative";
165
+ table: "rosetta_stone";
166
+ };
167
+ }>, z.ZodString, z.ZodNumber, z.ZodBoolean]>;
168
+ export type NqlExpression = z.infer<typeof NqlExpressionObj>;
143
169
  export declare const NqlFilterBinaryExpressionObj: z.ZodObject<{
144
170
  left: z.ZodUnion<[z.ZodObject<{
145
171
  field: z.ZodString;
@@ -1256,3 +1282,4 @@ export interface NqlCompileResult {
1256
1282
  sql: string;
1257
1283
  mappingErrors?: NqlMappingErrors;
1258
1284
  }
1285
+ export {};
@@ -51,11 +51,11 @@ export const NqlFilterUnaryExpressionObj = z.object({
51
51
  field: NqlFieldObj,
52
52
  operator: z.enum(['IS NULL', 'IS NOT NULL']).describe('The operator to use for the filter. As a standalone operator it only expects the field to be defined.')
53
53
  });
54
- const NqlExpression = z.union([NqlFieldObj, z.string(), z.number(), z.boolean()]);
54
+ const NqlExpressionObj = z.union([NqlFieldObj, z.string(), z.number(), z.boolean()]);
55
55
  export const NqlFilterBinaryExpressionObj = z.object({
56
- left: NqlExpression,
56
+ left: NqlExpressionObj,
57
57
  operator: z.enum(['=', '!=', '>', '<', '>=', '<=', 'IN', 'NOT IN', 'LIKE', 'NOT LIKE']).describe('The operator to use for the filter. As a binary operator it expects both a left and right expression'),
58
- right: NqlExpression
58
+ right: NqlExpressionObj
59
59
  });
60
60
  export const NqlFilterExpressionObj = z.union([NqlFilterUnaryExpressionObj, NqlFilterBinaryExpressionObj]);
61
61
  export const NqlBooleanExpressionObj = z.enum(['AND', 'OR']).describe('The operator to use for the filter. As a standalone operator it only expects the field to be defined.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@narrative.io/data-collaboration-sdk-ts",
3
- "version": "0.0.54",
3
+ "version": "0.0.55",
4
4
  "main": "build/index.js",
5
5
  "repository": "github:narrative-io/data-collaboration-sdk-ts",
6
6
  "source": "src/index.ts",