@narrative.io/data-collaboration-sdk-ts 0.26.0 → 1.0.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.
Files changed (50) hide show
  1. package/build/access-rules/index.d.ts +1 -1
  2. package/build/access-rules/types.d.ts +1 -1
  3. package/build/access-tokens/index.d.ts +2 -2
  4. package/build/apps/index.d.ts +2 -2
  5. package/build/attributes/index.d.ts +2 -2
  6. package/build/authentication/index.d.ts +1 -1
  7. package/build/base-api.d.ts +3 -3
  8. package/build/company-info/index.d.ts +2 -2
  9. package/build/connections/index.d.ts +1 -1
  10. package/build/contracts/index.d.ts +1 -1
  11. package/build/data-planes/index.d.ts +1 -1
  12. package/build/data-streams/index.d.ts +2 -2
  13. package/build/data-streams/index.js +1 -3
  14. package/build/data-streams/types.d.ts +1 -1
  15. package/build/datasets/index.d.ts +15 -15
  16. package/build/datasets/index.js +12 -12
  17. package/build/datasets/types.d.ts +1 -1
  18. package/build/forecast/index.d.ts +1 -1
  19. package/build/forecast/types.d.ts +1 -1
  20. package/build/health/index.d.ts +1 -1
  21. package/build/index.d.ts +36 -36
  22. package/build/index.js +23 -23
  23. package/build/installations/index.d.ts +2 -2
  24. package/build/jobs/index.d.ts +2 -2
  25. package/build/jobs/types.d.ts +3 -3
  26. package/build/mappings/index.d.ts +2 -2
  27. package/build/mappings/index.js +3 -3
  28. package/build/nql/AstParser.js +10 -15
  29. package/build/nql/AstTraverse.d.ts +1 -1
  30. package/build/nql/AstTraverse.js +4 -4
  31. package/build/nql/DataRulesConverter.d.ts +2 -2
  32. package/build/nql/DataRulesConverter.js +20 -23
  33. package/build/nql/NQLParser.js +23 -31
  34. package/build/nql/NqlBuilder.d.ts +3 -2
  35. package/build/nql/NqlBuilder.js +28 -26
  36. package/build/nql/SubstraitParser.d.ts +1 -2
  37. package/build/nql/SubstraitParser.js +27 -39
  38. package/build/nql/index.d.ts +2 -2
  39. package/build/nql/types.d.ts +1 -1
  40. package/build/ping/index.d.ts +1 -1
  41. package/build/products/index.d.ts +1 -1
  42. package/build/resources/index.d.ts +3 -3
  43. package/build/rosetta-stone/index.d.ts +1 -1
  44. package/build/subscriptions/index.d.ts +2 -2
  45. package/build/subscriptions/types.d.ts +2 -2
  46. package/build/uploads/index.d.ts +1 -1
  47. package/build/uploads/index.js +1 -3
  48. package/build/utils.js +7 -11
  49. package/build/whoami/index.d.ts +1 -1
  50. package/package.json +43 -45
@@ -1,5 +1,5 @@
1
- import type { ApiRecords, ApiRecordsV2, PaginationOptions } from "../types";
2
1
  import { BaseApi } from "../base-api";
2
+ import type { ApiRecords, ApiRecordsV2, PaginationOptions } from "../types";
3
3
  import type { AccessRule, AccessRuleV2, OwnedAccessRule, SharedAccessRule } from "./types";
4
4
  /**
5
5
  * Represents the parameters used to retrieve access rules.
@@ -1,4 +1,4 @@
1
- import { type Schema } from "src/datasets";
1
+ import type { Schema } from "src/datasets";
2
2
  export interface AccessRule {
3
3
  id: number;
4
4
  dataset_id?: AccessRuleDatasetId;
@@ -1,11 +1,11 @@
1
+ import { BaseApi } from "../base-api";
1
2
  /**
2
3
  * `AccessTokensApi` class provides methods to interact with the access tokens API.
3
4
  * It extends `BaseApi` to utilize common HTTP request methods for CRUD operations.
4
5
  * This class includes methods to get, create, update, and delete access tokens.
5
6
  */
6
7
  import type { ApiRecords } from "../types";
7
- import { BaseApi } from "../base-api";
8
- import { type CreateSystemAccessTokenRequest, type CreateSystemAccessTokenResponse, type AccessTokenMetadata, type UpdateSystemAccessTokenRequest } from "./types";
8
+ import type { AccessTokenMetadata, CreateSystemAccessTokenRequest, CreateSystemAccessTokenResponse, UpdateSystemAccessTokenRequest } from "./types";
9
9
  declare class AccessTokensApi extends BaseApi {
10
10
  /**
11
11
  * Retrieves a list of access tokens.
@@ -1,6 +1,6 @@
1
- import { type ApiRecords } from "../types";
2
1
  import { BaseApi } from "../base-api";
3
- import { type App, type Installation } from "./types";
2
+ import type { ApiRecords } from "../types";
3
+ import type { App, Installation } from "./types";
4
4
  /**
5
5
  * @module AppsApi
6
6
  * @description This module provides methods for fetching app records.
@@ -1,6 +1,6 @@
1
- import { type ApiRecords } from "../types";
2
1
  import { BaseApi } from "../base-api";
3
- import { type Attribute, type ShallowAttribute, type RefAttribute, type SubAttribute, type PrimitiveAttribute, type ObjectAttribute, type ArrayAttribute } from "./types";
2
+ import type { ApiRecords } from "../types";
3
+ import type { ArrayAttribute, Attribute, ObjectAttribute, PrimitiveAttribute, RefAttribute, ShallowAttribute, SubAttribute } from "./types";
4
4
  /**
5
5
  * A class for accessing the Attribute API.
6
6
  * @extends BaseApi
@@ -1,5 +1,5 @@
1
1
  import { BaseApi } from "../base-api";
2
- import { type LoginRequest, type LoginResponse, type RegisterRequest, type RegisterResponse, type LoggedInUser, type StytchToken, type ApiToken, type UserRole, type RegistrationStatus, type RegistrationStatusRequest, type RegistrationStatusResponse } from "./types";
2
+ import type { ApiToken, LoggedInUser, LoginRequest, LoginResponse, RegisterRequest, RegisterResponse, RegistrationStatus, RegistrationStatusRequest, RegistrationStatusResponse, StytchToken, UserRole } from "./types";
3
3
  /**
4
4
  * A class for accessing the Authentication API
5
5
  * @extends BaseApi
@@ -1,5 +1,5 @@
1
1
  import { type MandeInstance } from "mande";
2
- import { type PaginationOptions, type Config } from "./types";
2
+ import type { Config, PaginationOptions } from "./types";
3
3
  /**
4
4
  * BaseApi class provides basic functionality for making API requests.
5
5
  */
@@ -52,7 +52,7 @@ export declare abstract class BaseApi {
52
52
  * @returns {Promise<T>} - Promise that resolves with the response data.
53
53
  * @template T - Type of the response data.
54
54
  */
55
- protected get<T>(endpoint: string, params?: Record<string, any> & PaginationOptions): Promise<T>;
55
+ protected get<T>(endpoint: string, params?: Record<string, unknown> & PaginationOptions): Promise<T>;
56
56
  /**
57
57
  * Makes a POST request to the given endpoint with the given data.
58
58
  *
@@ -93,6 +93,6 @@ export declare abstract class BaseApi {
93
93
  * @private
94
94
  */
95
95
  private constructHeaders;
96
- protected constructQueryString<T extends Record<string, any>>(parameters?: T): string;
96
+ protected constructQueryString<T extends Record<string, unknown>>(parameters?: T): string;
97
97
  protected drawLogo(): void;
98
98
  }
@@ -1,6 +1,6 @@
1
1
  import { BaseApi } from "../base-api";
2
- import { type ApiRecords } from "../types";
3
- import { type CompanyInfo, type WhoAmI } from "./types";
2
+ import type { ApiRecords } from "../types";
3
+ import type { CompanyInfo, WhoAmI } from "./types";
4
4
  /**
5
5
  * A class for accessing the Company Info API
6
6
  * @extends BaseApi
@@ -1,6 +1,6 @@
1
1
  import { BaseApi } from "../base-api";
2
- import type { Connection } from "./types";
3
2
  import type { ApiRecords } from "../types";
3
+ import type { Connection } from "./types";
4
4
  /**
5
5
  * Class representing the API for connections.
6
6
  *
@@ -1,5 +1,5 @@
1
1
  import { BaseApi } from "../base-api";
2
- import { type ContractDetails, type CustomerContract, type PaymentMethod, type ContractRateView } from "./types";
2
+ import type { ContractDetails, ContractRateView, CustomerContract, PaymentMethod } from "./types";
3
3
  /**
4
4
  * A class for accessing the Contracts API.
5
5
  * @extends BaseApi
@@ -1,6 +1,6 @@
1
1
  import type { ApiRecords } from "src/types";
2
- import type { DataPlane } from "./types";
3
2
  import { BaseApi } from "../base-api";
3
+ import type { DataPlane } from "./types";
4
4
  export declare class DataPlaneApi extends BaseApi {
5
5
  getDataPlanes(): Promise<ApiRecords<DataPlane>>;
6
6
  getDataPlane(dataPlaneId: string): Promise<DataPlane>;
@@ -1,6 +1,6 @@
1
- import { type ApiRecords } from "../types";
2
1
  import { BaseApi } from "../base-api";
3
- import { type DataStream, type DataRules, type ColumnSet, type ColumnWithFilterAndExport, type AttributeSet } from "./types";
2
+ import type { ApiRecords } from "../types";
3
+ import type { AttributeSet, ColumnSet, ColumnWithFilterAndExport, DataRules, DataStream } from "./types";
4
4
  /**
5
5
  * @module DataStreamsApi
6
6
  * @description This module provides methods for interacting with Data Streams.
@@ -29,9 +29,7 @@ class DataStreamsApi extends BaseApi {
29
29
  if (authenticated) {
30
30
  return resourceName;
31
31
  }
32
- else {
33
- return `public/${resourceName}`;
34
- }
32
+ return `public/${resourceName}`;
35
33
  }
36
34
  }
37
35
  export { DataStreamsApi, };
@@ -1,4 +1,4 @@
1
- import { type Dataset } from "../datasets/types";
1
+ import type { Dataset } from "../datasets/types";
2
2
  export interface DataStream {
3
3
  id: string;
4
4
  company_id: number;
@@ -1,7 +1,7 @@
1
- import { type ApiRecords } from "../types";
2
1
  import { BaseApi } from "../base-api";
3
- import type { FilePerSnapshotResponse, Dataset, DatasetTableSummaryAPIResponse, ColumnStatistics, RetentionPolicy, DatasetTableSummary, RecalculationInfo, UpdateDatasetRequest, SchemaFileConfigType, SchemaPropertiesType, DatasetStatus, DatasetWriteMode, SchemaFileConfig, SchemaProperties, SchemaProperty, SchemaPrimitiveProperty, SchemaObjectProperty, SchemaArrayProperty, SchemaArrayItems, SchemaArrayItemsPrimitive, SchemaArrayItemsObject, SchemaArrayItemsArray, Schema, AdvancedStatisticsMetadata, SnapshotRange, Configuration, Columns, ColumnSummary, BasicStatistics, AdvancedStatistics, Histogram, Value, CreateDatasetRequest, IngestDatasetFileRequest } 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 SchemaArrayItemsPrimitive, type SchemaArrayItemsObject, type SchemaArrayItemsArray, type Schema, type AdvancedStatisticsMetadata, type SnapshotRange, type Configuration, type Columns, type ColumnSummary, type BasicStatistics, type AdvancedStatistics, type Histogram, type Value, type CreateDatasetRequest, };
2
+ import type { ApiRecords } from "../types";
3
+ import type { AdvancedStatistics, AdvancedStatisticsMetadata, BasicStatistics, ColumnStatistics, ColumnSummary, Columns, Configuration, CreateDatasetRequest, Dataset, DatasetStatus, DatasetTableSummary, DatasetTableSummaryAPIResponse, DatasetWriteMode, FilePerSnapshotResponse, Histogram, IngestDatasetFileRequest, RecalculationInfo, RetentionPolicy, Schema, SchemaArrayItems, SchemaArrayItemsArray, SchemaArrayItemsObject, SchemaArrayItemsPrimitive, SchemaArrayProperty, SchemaFileConfig, SchemaFileConfigType, SchemaObjectProperty, SchemaPrimitiveProperty, SchemaProperties, SchemaPropertiesType, SchemaProperty, SnapshotRange, UpdateDatasetRequest, Value } from "./types";
4
+ export type { FilePerSnapshotResponse, Dataset, RetentionPolicy, DatasetTableSummaryAPIResponse, ColumnStatistics, UpdateDatasetRequest, SchemaFileConfigType, SchemaPropertiesType, DatasetStatus, DatasetWriteMode, SchemaFileConfig, SchemaProperties, SchemaProperty, SchemaPrimitiveProperty, SchemaObjectProperty, SchemaArrayProperty, SchemaArrayItems, SchemaArrayItemsPrimitive, SchemaArrayItemsObject, SchemaArrayItemsArray, Schema, AdvancedStatisticsMetadata, SnapshotRange, Configuration, Columns, ColumnSummary, BasicStatistics, AdvancedStatistics, Histogram, Value, CreateDatasetRequest, };
5
5
  /**
6
6
  * @module DatasetApi
7
7
  * @description This module provides methods for fetching datasets.
@@ -69,18 +69,18 @@ export declare class DatasetApi extends BaseApi {
69
69
  */
70
70
  getDatasetSummary(datasetId: number, allRecords?: boolean, perPage?: number, offset?: number): Promise<DatasetTableSummaryAPIResponse>;
71
71
  /**
72
- Retrieve a sample of records from a specified dataset by its ID.
73
- @async
74
- @function
75
- @param {number} datasetId - The ID of the dataset to retrieve records from.
76
- @param {number} [size=1000] - The number of records to retrieve. Defaults to 1000 if not specified.
77
- @returns {Promise<ApiRecords<{[key: string]: string}>>} A Promise that resolves with an object containing the requested records and additional metadata.
78
- @throws {Error} If the request fails or if the response is not in the expected format.
79
- @example
80
- const datasetId = 1234;
81
- const size = 500;
82
- const records = await getDatasetSample(datasetId, size);
83
- */
72
+ Retrieve a sample of records from a specified dataset by its ID.
73
+ @async
74
+ @function
75
+ @param {number} datasetId - The ID of the dataset to retrieve records from.
76
+ @param {number} [size=1000] - The number of records to retrieve. Defaults to 1000 if not specified.
77
+ @returns {Promise<ApiRecords<{[key: string]: string}>>} A Promise that resolves with an object containing the requested records and additional metadata.
78
+ @throws {Error} If the request fails or if the response is not in the expected format.
79
+ @example
80
+ const datasetId = 1234;
81
+ const size = 500;
82
+ const records = await getDatasetSample(datasetId, size);
83
+ */
84
84
  getDatasetSample(datasetId: number, size?: number): Promise<ApiRecords<Record<string, string>>>;
85
85
  /**
86
86
  * Fetches a list of dataset files based on the provided parameters.
@@ -83,18 +83,18 @@ export class DatasetApi extends BaseApi {
83
83
  return await this.get(`${resourceName}/${datasetId}/stats?all_records=${String(allRecords)}&per_page=${perPage}&offset=${offset}`);
84
84
  }
85
85
  /**
86
- Retrieve a sample of records from a specified dataset by its ID.
87
- @async
88
- @function
89
- @param {number} datasetId - The ID of the dataset to retrieve records from.
90
- @param {number} [size=1000] - The number of records to retrieve. Defaults to 1000 if not specified.
91
- @returns {Promise<ApiRecords<{[key: string]: string}>>} A Promise that resolves with an object containing the requested records and additional metadata.
92
- @throws {Error} If the request fails or if the response is not in the expected format.
93
- @example
94
- const datasetId = 1234;
95
- const size = 500;
96
- const records = await getDatasetSample(datasetId, size);
97
- */
86
+ Retrieve a sample of records from a specified dataset by its ID.
87
+ @async
88
+ @function
89
+ @param {number} datasetId - The ID of the dataset to retrieve records from.
90
+ @param {number} [size=1000] - The number of records to retrieve. Defaults to 1000 if not specified.
91
+ @returns {Promise<ApiRecords<{[key: string]: string}>>} A Promise that resolves with an object containing the requested records and additional metadata.
92
+ @throws {Error} If the request fails or if the response is not in the expected format.
93
+ @example
94
+ const datasetId = 1234;
95
+ const size = 500;
96
+ const records = await getDatasetSample(datasetId, size);
97
+ */
98
98
  async getDatasetSample(datasetId, size = 1000) {
99
99
  return await this.get(`${resourceName}/${datasetId}/sample?size=${size}`);
100
100
  }
@@ -111,7 +111,7 @@ export interface SchemaPrimitiveProperty {
111
111
  order?: number;
112
112
  approximate_cardinality?: number;
113
113
  description?: string;
114
- enum?: any[];
114
+ enum?: (string | number)[];
115
115
  }
116
116
  export interface SchemaObjectProperty {
117
117
  display_name: string;
@@ -1,5 +1,5 @@
1
1
  import { BaseApi } from "../base-api";
2
- import { type ForecastRequest, type ForecastResponse, type CostForecastRequest, type CostForecastResponse, type CostForecastResult, type ForecastResult, type ForecastResultFailure, type JobState } from "./types";
2
+ import type { CostForecastRequest, CostForecastResponse, CostForecastResult, ForecastRequest, ForecastResponse, ForecastResult, ForecastResultFailure, JobState } from "./types";
3
3
  /**
4
4
  * @module ForecastApi
5
5
  * @description This module provides methods for generating forecasts from a subscription
@@ -1,4 +1,4 @@
1
- import { type DataRules } from "../data-streams/types";
1
+ import type { DataRules } from "../data-streams/types";
2
2
  export interface CostForecastRequest {
3
3
  as_of?: Date;
4
4
  details: ForecastDetails;
@@ -1,5 +1,5 @@
1
1
  import { BaseApi } from "../base-api";
2
- import { type HealthCheckResult } from "./types";
2
+ import type { HealthCheckResult } from "./types";
3
3
  /**
4
4
  * A class for accessing the Health Check API.
5
5
  * @extends BaseApi
package/build/index.d.ts CHANGED
@@ -1,46 +1,46 @@
1
+ import { type AccessRule, type AccessRuleV2, AccessRulesApi, type GetAccessRulesParameters, type OwnedAccessRule, type SharedAccessRule } from "./access-rules/";
2
+ import type { AccessRuleSchema } from "./access-rules/types";
3
+ import { type AccessTokenMetadata, AccessTokensApi, type CreateSystemAccessTokenRequest, type CreateSystemAccessTokenResponse, type UpdateSystemAccessTokenRequest } from "./access-tokens";
4
+ import { type Permission, resources } from "./access-tokens/types";
5
+ import { type App, AppsApi } from "./apps";
6
+ import { AttributeApi } from "./attributes";
7
+ import type { ArrayAttribute, Attribute, ObjectAttribute, PrimitiveAttribute, RefAttribute, ShallowAttribute, SubAttribute } from "./attributes/types";
8
+ import { type ApiToken, AuthenticationApi, type LoggedInUser, type LoginRequest, type LoginResponse, type RegisterRequest, type RegisterResponse, type RegistrationStatus, type RegistrationStatusRequest, type RegistrationStatusResponse, type StytchToken, type UserRole } from "./authentication";
1
9
  import { BaseApi } from "./base-api";
10
+ import { type CompanyInfo, CompanyInfoApi } from "./company-info";
11
+ import { type Connection, ConnectionsApi } from "./connections";
12
+ import { type ContractDetails, type ContractRateView, ContractsApi, type CustomerContract, type PaymentMethod } from "./contracts";
13
+ import { DataPlaneApi } from "./data-planes";
14
+ import type { DataPlane } from "./data-planes/types";
15
+ import { type AttributeSet, type ColumnSet, type ColumnWithFilterAndExport, type DataRules, type DataStream, DataStreamsApi } from "./data-streams";
2
16
  import { DatasetApi } from "./datasets";
17
+ import type { AdvancedStatistics, AdvancedStatisticsMetadata, BasicStatistics, ColumnStatistics, ColumnSummary, Columns, Configuration, CreateDatasetRequest, Dataset, DatasetStatus, DatasetTableSummary, DatasetTableSummaryAPIResponse, DatasetWriteMode, FilePerSnapshotResponse, Histogram, IngestDatasetFileRequest, RetentionPolicy, Schema, SchemaArrayItems, SchemaArrayItemsArray, SchemaArrayItemsObject, SchemaArrayItemsPrimitive, SchemaArrayProperty, SchemaFileConfig, SchemaFileConfigType, SchemaObjectProperty, SchemaPrimitiveProperty, SchemaProperties, SchemaPropertiesType, SchemaProperty, SnapshotRange, UpdateDatasetRequest, Value } from "./datasets/types";
18
+ import { type CostForecastRequest, type CostForecastResponse, type CostForecastResult, ForecastApi, type ForecastRequest, type ForecastResponse, type ForecastResult, type ForecastResultFailure, type JobState } from "./forecast";
3
19
  import { HealthCheckApi } from "./health";
4
- import { RosettaStoneApi } from "./rosetta-stone";
5
- import type { DataPlane } from "./data-planes/types";
6
- import { DataPlaneApi } from "./data-planes";
7
- import { type Environment, type Config, type ApiRecords, type ApiRecordsV2, type MonetaryAmount } from "./types";
8
- import type { DatasetTableSummaryAPIResponse, Dataset, DatasetTableSummary, FilePerSnapshotResponse, RetentionPolicy, UpdateDatasetRequest, SchemaFileConfigType, SchemaPropertiesType, DatasetStatus, DatasetWriteMode, SchemaFileConfig, SchemaProperties, SchemaProperty, SchemaPrimitiveProperty, SchemaObjectProperty, SchemaArrayProperty, SchemaArrayItems, SchemaArrayItemsPrimitive, SchemaArrayItemsObject, SchemaArrayItemsArray, Schema, AdvancedStatisticsMetadata, SnapshotRange, Configuration, Columns, ColumnSummary, ColumnStatistics, BasicStatistics, AdvancedStatistics, Histogram, Value, CreateDatasetRequest, IngestDatasetFileRequest } from "./datasets/types";
9
- import { type User } from "./whoami/types";
10
- import { type HealthCheckResult } from "./health/types";
11
- import { type SampleRecords } from "./rosetta-stone/types";
12
- import { AttributeApi } from "./attributes";
13
- import { type Resource, ResourceApi, type BucketCreationRequest, type UpdateAccessTypeRequest } from "./resources";
14
- import { type AccessTokenMetadata, type CreateSystemAccessTokenRequest, type CreateSystemAccessTokenResponse, type UpdateSystemAccessTokenRequest, AccessTokensApi } from "./access-tokens";
15
- import { resources, type Permission } from "./access-tokens/types";
16
- import { type Attribute, type ShallowAttribute, type RefAttribute, type SubAttribute, type PrimitiveAttribute, type ArrayAttribute, type ObjectAttribute } from "./attributes/types";
17
- import { PingApi } from "./ping";
18
- import { UploadsApi } from "./uploads";
19
- import { type UploadsResponse } from "./uploads/types";
20
- import { type PingStatus } from "./ping/types";
21
- import { type Product, ProductsApi } from "./products";
22
- import { CompanyInfoApi, type CompanyInfo } from "./company-info";
23
- import { InstallationsApi, type Installation, type Profile } from "./installations";
24
- import { NqlApi, 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, compileStatement, parseStatement } from "./nql";
25
- import { DataStreamsApi, type DataStream, type DataRules, type ColumnSet, type ColumnWithFilterAndExport, type AttributeSet } from "./data-streams";
26
- import { ForecastApi, type ForecastRequest, type ForecastResponse, type CostForecastRequest, type CostForecastResponse, type CostForecastResult, type ForecastResult, type ForecastResultFailure, type JobState } from "./forecast";
27
- import { ContractsApi, type ContractDetails, type CustomerContract, type PaymentMethod, type ContractRateView } from "./contracts";
28
- import { getNqlObject, buildNql } from "./nql/NQLParser";
20
+ import type { HealthCheckResult } from "./health/types";
21
+ import { type Installation, InstallationsApi, type Profile } from "./installations";
22
+ import { type GetJobsParameters, type Job, JobsApi } from "./jobs";
23
+ import { type Mapping, type MappingTestResult, MappingsApi } from "./mappings";
24
+ import type { CreateMapping, ObjectMapping, ValueMapping } from "./mappings/types";
25
+ import { type CompiledNql, type CreateMaterializedView, type Deduplication, type Explain, type Expression, type Nql, NqlApi, type NqlAst, type NqlBooleanExpression, type NqlCompileResult, type NqlExpression, type NqlField, type NqlFilterBinaryExpression, type NqlFilterExpression, type NqlFilterUnaryExpression, type NqlQueryInput, type NqlResult, type NqlWhere, type Raw, type Select, type Statement, type Table, compileStatement, parseStatement } from "./nql";
29
26
  import { convertNqlObjectToForecastBody } from "./nql/DataRulesConverter";
30
- import { AuthenticationApi, type LoginRequest, type LoginResponse, type RegisterRequest, type RegisterResponse, type LoggedInUser, type StytchToken, type ApiToken, type UserRole, type RegistrationStatus, type RegistrationStatusRequest, type RegistrationStatusResponse } from "./authentication";
31
- import { AppsApi, type App } from "./apps";
27
+ import { buildNql, getNqlObject } from "./nql/NQLParser";
32
28
  import type { ForecastBody } from "./nql/types";
33
- import { type ConversationMessageRole, isConversationMessageRole, type ConversationMessageName, isConversationMessageName, type ConversationUserMessage, isConversationUserMessage, type ConversationAssistantMessage, isConversationAssistantMessage, type ConversationSystemMessage, isConversationSystemMessage, type ConversationFunctionMessage, isConversationFunctionMessage, type ConversationMessage, isConversationMessage, type ConversationIOMessage, isConversationInputMessage, type ConversationMessages, isConversationMessages, isType, type RosettaRequestMessage, isRosettaRequestMessage, type ConversationMessageFunctionCall, isConversationMessageFunctionCall, type ConversationAssistantMessageWithFunctionCall, isConversationAssistantMessageWithFunctionCall, type RosettaResponseMessage, type ConversationAssistantMessageWithoutFunctionCall, isConversationAssistantMessageWithoutFunctionCall } from "./rosetta/types";
34
- import { MappingsApi, type Mapping, type MappingTestResult } from "./mappings";
35
- import type { ValueMapping, ObjectMapping, CreateMapping } from "./mappings/types";
36
- import { type AccessRule, AccessRulesApi, type GetAccessRulesParameters, type AccessRuleV2, type OwnedAccessRule, type SharedAccessRule } from "./access-rules/";
37
- import type { AccessRuleSchema } from "./access-rules/types";
38
- import { type Subscription, type SubscriptionDetails, type DataStreamSubscriptionDetails, type MarketplaceSubscriptionDetails, type SubscriptionOutput, type SubscriptionType, type SubscriptionStatus, type SubscriptionBudget, SubscriptionsApi } from "./subscriptions";
39
- import { type Job, type GetJobsParameters, JobsApi } from "./jobs";
29
+ import { PingApi } from "./ping";
30
+ import type { PingStatus } from "./ping/types";
31
+ import { type Product, ProductsApi } from "./products";
32
+ import { type BucketCreationRequest, type Resource, ResourceApi, type UpdateAccessTypeRequest } from "./resources";
33
+ import { RosettaStoneApi } from "./rosetta-stone";
34
+ import type { SampleRecords } from "./rosetta-stone/types";
35
+ import { type ConversationAssistantMessage, type ConversationAssistantMessageWithFunctionCall, type ConversationAssistantMessageWithoutFunctionCall, type ConversationFunctionMessage, type ConversationIOMessage, type ConversationMessage, type ConversationMessageFunctionCall, type ConversationMessageName, type ConversationMessageRole, type ConversationMessages, type ConversationSystemMessage, type ConversationUserMessage, type RosettaRequestMessage, type RosettaResponseMessage, isConversationAssistantMessage, isConversationAssistantMessageWithFunctionCall, isConversationAssistantMessageWithoutFunctionCall, isConversationFunctionMessage, isConversationInputMessage, isConversationMessage, isConversationMessageFunctionCall, isConversationMessageName, isConversationMessageRole, isConversationMessages, isConversationSystemMessage, isConversationUserMessage, isRosettaRequestMessage, isType } from "./rosetta/types";
36
+ import { type DataStreamSubscriptionDetails, type MarketplaceSubscriptionDetails, type Subscription, type SubscriptionBudget, type SubscriptionDetails, type SubscriptionOutput, type SubscriptionStatus, type SubscriptionType, SubscriptionsApi } from "./subscriptions";
37
+ import type { ApiRecords, ApiRecordsV2, Config, Environment, MonetaryAmount } from "./types";
38
+ import { UploadsApi } from "./uploads";
39
+ import type { UploadsResponse } from "./uploads/types";
40
40
  import { WhoAmIApi } from "./whoami";
41
- import { ConnectionsApi, type Connection } from "./connections";
41
+ import type { User } from "./whoami/types";
42
42
  declare class NarrativeApi extends BaseApi {
43
43
  }
44
44
  interface NarrativeApi extends BaseApi, HealthCheckApi, AccessTokensApi, DataPlaneApi, DatasetApi, RosettaStoneApi, AttributeApi, PingApi, CompanyInfoApi, InstallationsApi, ConnectionsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi, ContractsApi, AuthenticationApi, MappingsApi, AccessRulesApi, AppsApi, SubscriptionsApi, JobsApi, WhoAmIApi {
45
45
  }
46
- export { NarrativeApi, AttributeApi, AccessTokensApi, DataPlaneApi, HealthCheckApi, DatasetApi, PingApi, ProductsApi, CompanyInfoApi, InstallationsApi, ConnectionsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi, ContractsApi, AuthenticationApi, AppsApi, MappingsApi, AccessRulesApi, SubscriptionsApi, JobsApi, WhoAmIApi, getNqlObject, buildNql, convertNqlObjectToForecastBody, isConversationAssistantMessage, isConversationFunctionMessage, isConversationInputMessage, isConversationMessage, isConversationMessageName, isConversationMessageRole, isConversationMessages, isConversationSystemMessage, isConversationUserMessage, isType, isConversationMessageFunctionCall, isConversationAssistantMessageWithFunctionCall, isRosettaRequestMessage, isConversationAssistantMessageWithoutFunctionCall, resources, type DataPlane, type AccessTokenMetadata, type CreateSystemAccessTokenRequest, type CreateSystemAccessTokenResponse, type UpdateSystemAccessTokenRequest, type App, type Resource, type AccessRuleV2, type GetAccessRulesParameters, type UploadsResponse, type PingStatus, type Attribute, type ShallowAttribute, type Connection, type RefAttribute, type SubAttribute, type PrimitiveAttribute, type ArrayAttribute, type ObjectAttribute, type Environment, type Config, type ApiRecords, type ApiRecordsV2, type Dataset, type HealthCheckResult, type SampleRecords, type Permission, 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 SchemaArrayItemsPrimitive, type SchemaArrayItemsObject, type SchemaArrayItemsArray, type Schema, type AdvancedStatisticsMetadata, type SnapshotRange, type Configuration, type Columns, type ColumnSummary, type ColumnStatistics, type BasicStatistics, type AdvancedStatistics, type Histogram, type Value, type CreateDatasetRequest, type IngestDatasetFileRequest, type Product, type MonetaryAmount, type CompanyInfo, type Installation, type Profile, type FilePerSnapshotResponse, type BucketCreationRequest, type UpdateAccessTypeRequest, type CompiledNql, type CreateMaterializedView, type GetJobsParameters, 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 ForecastResult, type CostForecastResult, type ForecastResultFailure, 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 SharedAccessRule, type OwnedAccessRule, type ConversationAssistantMessage, type ConversationFunctionMessage, type ConversationIOMessage, type ConversationMessage, type ConversationMessageName, type ConversationMessageRole, type AccessRuleSchema, 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, type Job, type User, type Mapping, type MappingTestResult, type ValueMapping, type ObjectMapping, type CreateMapping, compileStatement, parseStatement, };
46
+ export { type NarrativeApi, AttributeApi, AccessTokensApi, DataPlaneApi, HealthCheckApi, DatasetApi, PingApi, ProductsApi, CompanyInfoApi, InstallationsApi, ConnectionsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi, ContractsApi, AuthenticationApi, AppsApi, MappingsApi, AccessRulesApi, SubscriptionsApi, JobsApi, WhoAmIApi, getNqlObject, buildNql, convertNqlObjectToForecastBody, isConversationAssistantMessage, isConversationFunctionMessage, isConversationInputMessage, isConversationMessage, isConversationMessageName, isConversationMessageRole, isConversationMessages, isConversationSystemMessage, isConversationUserMessage, isType, isConversationMessageFunctionCall, isConversationAssistantMessageWithFunctionCall, isRosettaRequestMessage, isConversationAssistantMessageWithoutFunctionCall, resources, type DataPlane, type AccessTokenMetadata, type CreateSystemAccessTokenRequest, type CreateSystemAccessTokenResponse, type UpdateSystemAccessTokenRequest, type App, type Resource, type AccessRuleV2, type GetAccessRulesParameters, type UploadsResponse, type PingStatus, type Attribute, type ShallowAttribute, type Connection, type RefAttribute, type SubAttribute, type PrimitiveAttribute, type ArrayAttribute, type ObjectAttribute, type Environment, type Config, type ApiRecords, type ApiRecordsV2, type Dataset, type HealthCheckResult, type SampleRecords, type Permission, 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 SchemaArrayItemsPrimitive, type SchemaArrayItemsObject, type SchemaArrayItemsArray, type Schema, type AdvancedStatisticsMetadata, type SnapshotRange, type Configuration, type Columns, type ColumnSummary, type ColumnStatistics, type BasicStatistics, type AdvancedStatistics, type Histogram, type Value, type CreateDatasetRequest, type IngestDatasetFileRequest, type Product, type MonetaryAmount, type CompanyInfo, type Installation, type Profile, type FilePerSnapshotResponse, type BucketCreationRequest, type UpdateAccessTypeRequest, type CompiledNql, type CreateMaterializedView, type GetJobsParameters, 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 ForecastResult, type CostForecastResult, type ForecastResultFailure, 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 SharedAccessRule, type OwnedAccessRule, type ConversationAssistantMessage, type ConversationFunctionMessage, type ConversationIOMessage, type ConversationMessage, type ConversationMessageName, type ConversationMessageRole, type AccessRuleSchema, 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, type Job, type User, type Mapping, type MappingTestResult, type ValueMapping, type ObjectMapping, type CreateMapping, compileStatement, parseStatement, };
package/build/index.js CHANGED
@@ -1,33 +1,33 @@
1
- import { BaseApi } from "./base-api";
2
- import { DatasetApi } from "./datasets";
3
- import { HealthCheckApi } from "./health";
4
- import { RosettaStoneApi } from "./rosetta-stone";
5
- import { applyMixins } from "./utils";
6
- import { DataPlaneApi } from "./data-planes";
7
- import { AttributeApi } from "./attributes";
8
- import { ResourceApi, } from "./resources";
1
+ import { AccessRulesApi, } from "./access-rules/";
9
2
  import { AccessTokensApi, } from "./access-tokens";
10
3
  import { resources } from "./access-tokens/types";
11
- import { PingApi } from "./ping";
12
- import { UploadsApi } from "./uploads";
13
- import { ProductsApi } from "./products";
4
+ import { AppsApi } from "./apps";
5
+ import { AttributeApi } from "./attributes";
6
+ import { AuthenticationApi, } from "./authentication";
7
+ import { BaseApi } from "./base-api";
14
8
  import { CompanyInfoApi } from "./company-info";
15
- import { InstallationsApi, } from "./installations";
16
- import { NqlApi, compileStatement, parseStatement, } from "./nql";
9
+ import { ConnectionsApi } from "./connections";
10
+ import { ContractsApi, } from "./contracts";
11
+ import { DataPlaneApi } from "./data-planes";
17
12
  import { DataStreamsApi, } from "./data-streams";
13
+ import { DatasetApi } from "./datasets";
18
14
  import { ForecastApi, } from "./forecast";
19
- import { ContractsApi, } from "./contracts";
20
- import { getNqlObject, buildNql } from "./nql/NQLParser";
21
- import { convertNqlObjectToForecastBody } from "./nql/DataRulesConverter";
22
- import { AuthenticationApi, } from "./authentication";
23
- import { AppsApi } from "./apps";
24
- import { isConversationMessageRole, isConversationMessageName, isConversationUserMessage, isConversationAssistantMessage, isConversationSystemMessage, isConversationFunctionMessage, isConversationMessage, isConversationInputMessage, isConversationMessages, isType, isRosettaRequestMessage, isConversationMessageFunctionCall, isConversationAssistantMessageWithFunctionCall, isConversationAssistantMessageWithoutFunctionCall, } from "./rosetta/types";
15
+ import { HealthCheckApi } from "./health";
16
+ import { InstallationsApi, } from "./installations";
17
+ import { JobsApi } from "./jobs";
25
18
  import { MappingsApi } from "./mappings";
26
- import { AccessRulesApi, } from "./access-rules/";
19
+ import { NqlApi, compileStatement, parseStatement, } from "./nql";
20
+ import { convertNqlObjectToForecastBody } from "./nql/DataRulesConverter";
21
+ import { buildNql, getNqlObject } from "./nql/NQLParser";
22
+ import { PingApi } from "./ping";
23
+ import { ProductsApi } from "./products";
24
+ import { ResourceApi, } from "./resources";
25
+ import { RosettaStoneApi } from "./rosetta-stone";
26
+ import { isConversationAssistantMessage, isConversationAssistantMessageWithFunctionCall, isConversationAssistantMessageWithoutFunctionCall, isConversationFunctionMessage, isConversationInputMessage, isConversationMessage, isConversationMessageFunctionCall, isConversationMessageName, isConversationMessageRole, isConversationMessages, isConversationSystemMessage, isConversationUserMessage, isRosettaRequestMessage, isType, } from "./rosetta/types";
27
27
  import { SubscriptionsApi, } from "./subscriptions";
28
- import { JobsApi } from "./jobs";
28
+ import { UploadsApi } from "./uploads";
29
+ import { applyMixins } from "./utils";
29
30
  import { WhoAmIApi } from "./whoami";
30
- import { ConnectionsApi } from "./connections";
31
31
  class NarrativeApi extends BaseApi {
32
32
  }
33
33
  applyMixins(NarrativeApi, [
@@ -56,4 +56,4 @@ applyMixins(NarrativeApi, [
56
56
  JobsApi,
57
57
  WhoAmIApi,
58
58
  ]);
59
- export { NarrativeApi, AttributeApi, AccessTokensApi, DataPlaneApi, HealthCheckApi, DatasetApi, PingApi, ProductsApi, CompanyInfoApi, InstallationsApi, ConnectionsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi, ContractsApi, AuthenticationApi, AppsApi, MappingsApi, AccessRulesApi, SubscriptionsApi, JobsApi, WhoAmIApi, getNqlObject, buildNql, convertNqlObjectToForecastBody, isConversationAssistantMessage, isConversationFunctionMessage, isConversationInputMessage, isConversationMessage, isConversationMessageName, isConversationMessageRole, isConversationMessages, isConversationSystemMessage, isConversationUserMessage, isType, isConversationMessageFunctionCall, isConversationAssistantMessageWithFunctionCall, isRosettaRequestMessage, isConversationAssistantMessageWithoutFunctionCall, resources, compileStatement, parseStatement, };
59
+ export { AttributeApi, AccessTokensApi, DataPlaneApi, HealthCheckApi, DatasetApi, PingApi, ProductsApi, CompanyInfoApi, InstallationsApi, ConnectionsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi, ContractsApi, AuthenticationApi, AppsApi, MappingsApi, AccessRulesApi, SubscriptionsApi, JobsApi, WhoAmIApi, getNqlObject, buildNql, convertNqlObjectToForecastBody, isConversationAssistantMessage, isConversationFunctionMessage, isConversationInputMessage, isConversationMessage, isConversationMessageName, isConversationMessageRole, isConversationMessages, isConversationSystemMessage, isConversationUserMessage, isType, isConversationMessageFunctionCall, isConversationAssistantMessageWithFunctionCall, isRosettaRequestMessage, isConversationAssistantMessageWithoutFunctionCall, resources, compileStatement, parseStatement, };
@@ -1,6 +1,6 @@
1
- import { type ApiRecords } from "../types";
2
1
  import { BaseApi } from "../base-api";
3
- import type { Profile, Installation } from "./types";
2
+ import type { ApiRecords } from "../types";
3
+ import type { Installation, Profile } from "./types";
4
4
  /**
5
5
  * @module InstallationsApi
6
6
  * @description This module provides methods for fetching installation records.
@@ -1,6 +1,6 @@
1
- import { type ApiRecords } from "../types";
2
1
  import { BaseApi } from "../base-api";
3
- import { type Job } from "./types";
2
+ import type { ApiRecords } from "../types";
3
+ import type { Job } from "./types";
4
4
  interface GetJobsParameters extends Record<string, string | number | boolean | undefined> {
5
5
  dataset_id?: number;
6
6
  per_page?: number;
@@ -1,13 +1,13 @@
1
- import { type JobState } from "src/forecast";
1
+ import type { JobState } from "src/forecast";
2
2
  export interface Job {
3
3
  job_id: string;
4
4
  request_source: JobRequestSource;
5
5
  state: JobState;
6
6
  type: string;
7
- input: any;
7
+ input: unknown;
8
8
  executor?: string;
9
9
  idempotency_key: string;
10
- result?: any;
10
+ result?: unknown;
11
11
  created_at: string;
12
12
  updated_at: string;
13
13
  ended_at?: string;
@@ -1,7 +1,7 @@
1
- import type { Config, ApiRecords } from "src/types";
1
+ import type { ApiRecords, Config } from "src/types";
2
2
  import { BaseApi } from "../base-api";
3
- import type { CreateMapping, Mapping, MappingTestResult, MappingTestResults } from "./types";
4
3
  import { CompanyInfoApi } from "../company-info";
4
+ import type { CreateMapping, Mapping, MappingTestResult, MappingTestResults } from "./types";
5
5
  /**
6
6
  * Class representing the Mappings API.
7
7
  * Extends the BaseApi to provide functionalities specific to mappings.
@@ -47,10 +47,10 @@ class MappingsApi extends BaseApi {
47
47
  * @throws {Error} Throws an error if the company ID is undefined and cannot be fetched.
48
48
  */
49
49
  async createPrivateMapping(mapping, companyId) {
50
- companyId = companyId ?? (await this.getCompanyId());
51
- if (companyId === undefined)
50
+ const hydratedCompanyId = companyId ?? (await this.getCompanyId());
51
+ if (hydratedCompanyId === undefined)
52
52
  throw new Error("Company ID is undefined");
53
- const resource = `${resourceName}/companies/${companyId}`;
53
+ const resource = `${resourceName}/companies/${hydratedCompanyId}`;
54
54
  return await this.post(resource, mapping);
55
55
  }
56
56
  /**
@@ -63,7 +63,7 @@ export function parseWhere(n) {
63
63
  return parseBooleanExpression(n);
64
64
  }
65
65
  catch (e) {
66
- console.debug(`failed to where from clause`, e);
66
+ console.debug("failed to where from clause", e);
67
67
  return nqlOrFail(n);
68
68
  }
69
69
  }
@@ -279,8 +279,9 @@ function parseColumnRef(n) {
279
279
  };
280
280
  return attrRef;
281
281
  }
282
- if (n.schema === "company_data" && !isNaN(parseInt(n.table))) {
283
- const datasetId = parseInt(n.table);
282
+ if (n.schema === "company_data" &&
283
+ !Number.isNaN(Number.parseInt(n.table))) {
284
+ const datasetId = Number.parseInt(n.table);
284
285
  const datasetColumnRef = {
285
286
  type: "dataset_column_ref",
286
287
  as: n.as,
@@ -454,10 +455,8 @@ function parseLike(n, negated) {
454
455
  };
455
456
  return like;
456
457
  }
457
- else {
458
- // if the pattern is not a string literal, fail parsing of the entire expression
459
- return nqlOrFail(n);
460
- }
458
+ // if the pattern is not a string literal, fail parsing of the entire expression
459
+ return nqlOrFail(n);
461
460
  }
462
461
  default:
463
462
  return nqlOrFail(n);
@@ -531,8 +530,8 @@ function parseTable(n) {
531
530
  };
532
531
  return table;
533
532
  }
534
- if (n.schema === "company_data" && !isNaN(parseInt(n.table))) {
535
- const datasetId = parseInt(n.table);
533
+ if (n.schema === "company_data" && !Number.isNaN(Number.parseInt(n.table))) {
534
+ const datasetId = Number.parseInt(n.table);
536
535
  const table = {
537
536
  type: "dataset",
538
537
  as: n.as,
@@ -586,9 +585,7 @@ function oneOf(...fs) {
586
585
  if (successes.length > 0) {
587
586
  return successes[0];
588
587
  }
589
- else {
590
- return expressions[0];
591
- }
588
+ return expressions[0];
592
589
  };
593
590
  }
594
591
  function nqlOrFail(n) {
@@ -601,7 +598,5 @@ function nqlOrFail(n) {
601
598
  };
602
599
  return nql;
603
600
  }
604
- else {
605
- throw new Error(`no raw nql available for node '${n.type}'`);
606
- }
601
+ throw new Error(`no raw nql available for node '${n.type}'`);
607
602
  }
@@ -1,2 +1,2 @@
1
- import { type Node } from "./AstParser";
1
+ import type { Node } from "./AstParser";
2
2
  export declare function traverseParsedAst(node: Node, callback: (node: Node) => void): void;
@@ -48,9 +48,9 @@ function findTraversalTargets(node) {
48
48
  selectTargets.push(node.deduplication);
49
49
  }
50
50
  if (Array.isArray(node.from)) {
51
- node.from.forEach((table) => {
51
+ for (const table of node.from) {
52
52
  selectTargets.push(table);
53
- });
53
+ }
54
54
  }
55
55
  return selectTargets;
56
56
  }
@@ -73,7 +73,7 @@ function findTraversalTargets(node) {
73
73
  }
74
74
  export function traverseParsedAst(node, callback) {
75
75
  callback(node);
76
- findTraversalTargets(node).forEach((childNode) => {
76
+ for (const childNode of findTraversalTargets(node)) {
77
77
  traverseParsedAst(childNode, callback);
78
- });
78
+ }
79
79
  }
@@ -1,7 +1,7 @@
1
- import { type ObjectAttribute } from "src/attributes/types";
1
+ import type { ObjectAttribute } from "src/attributes/types";
2
2
  import { type Attribute } from "../attributes";
3
- import type { DataRulesAttributesField, ForecastBody, Nql } from "./types";
4
3
  import type { DataRules } from "../data-streams/types";
4
+ import type { DataRulesAttributesField, ForecastBody, Nql } from "./types";
5
5
  /**
6
6
  * Convert an NQL object to a Forecast body.
7
7
  * @param {Nql} nqlObject - The NQL object to convert.