@narrative.io/data-collaboration-sdk-ts 0.27.0 → 1.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/build/access-rules/index.d.ts +1 -1
- package/build/access-rules/types.d.ts +1 -1
- package/build/access-tokens/index.d.ts +2 -2
- package/build/apps/index.d.ts +2 -2
- package/build/attributes/index.d.ts +2 -2
- package/build/authentication/index.d.ts +1 -1
- package/build/base-api.d.ts +3 -3
- package/build/company-info/index.d.ts +2 -2
- package/build/connections/index.d.ts +1 -1
- package/build/contracts/index.d.ts +1 -1
- package/build/data-planes/index.d.ts +1 -1
- package/build/data-streams/index.d.ts +2 -2
- package/build/data-streams/index.js +1 -3
- package/build/data-streams/types.d.ts +1 -1
- package/build/datasets/index.d.ts +15 -15
- package/build/datasets/index.js +12 -12
- package/build/datasets/types.d.ts +1 -1
- package/build/forecast/index.d.ts +1 -1
- package/build/forecast/types.d.ts +1 -1
- package/build/health/index.d.ts +1 -1
- package/build/index.d.ts +35 -35
- package/build/index.js +25 -23
- package/build/installations/index.d.ts +2 -2
- package/build/jobs/index.d.ts +2 -2
- package/build/jobs/types.d.ts +3 -3
- package/build/mappings/index.d.ts +2 -2
- package/build/mappings/index.js +3 -3
- package/build/nql/AstParser.js +10 -15
- package/build/nql/AstTraverse.d.ts +1 -1
- package/build/nql/AstTraverse.js +4 -4
- package/build/nql/DataRulesConverter.d.ts +2 -2
- package/build/nql/DataRulesConverter.js +20 -23
- package/build/nql/NQLParser.js +23 -31
- package/build/nql/NqlBuilder.d.ts +2 -2
- package/build/nql/NqlBuilder.js +8 -21
- package/build/nql/SubstraitParser.d.ts +1 -2
- package/build/nql/SubstraitParser.js +27 -39
- package/build/nql/index.d.ts +2 -2
- package/build/nql/types.d.ts +1 -1
- package/build/ping/index.d.ts +1 -1
- package/build/products/index.d.ts +1 -1
- package/build/resources/index.d.ts +3 -3
- package/build/rosetta-stone/index.d.ts +1 -1
- package/build/subscriptions/index.d.ts +2 -2
- package/build/subscriptions/types.d.ts +2 -2
- package/build/uploads/index.d.ts +1 -1
- package/build/uploads/index.js +1 -3
- package/build/utils.js +7 -11
- package/build/whoami/index.d.ts +1 -1
- 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,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 {
|
|
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.
|
package/build/apps/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type ApiRecords } from "../types";
|
|
2
1
|
import { BaseApi } from "../base-api";
|
|
3
|
-
import
|
|
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
|
|
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 {
|
|
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
|
package/build/base-api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type MandeInstance } from "mande";
|
|
2
|
-
import {
|
|
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,
|
|
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,
|
|
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 {
|
|
3
|
-
import {
|
|
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,5 +1,5 @@
|
|
|
1
1
|
import { BaseApi } from "../base-api";
|
|
2
|
-
import {
|
|
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
|
|
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.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type ApiRecords } from "../types";
|
|
2
1
|
import { BaseApi } from "../base-api";
|
|
3
|
-
import type {
|
|
4
|
-
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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.
|
package/build/datasets/index.js
CHANGED
|
@@ -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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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?:
|
|
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
|
|
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
|
package/build/health/index.d.ts
CHANGED
package/build/index.d.ts
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
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 {
|
|
5
|
-
import type
|
|
6
|
-
import {
|
|
7
|
-
import { type
|
|
8
|
-
import type {
|
|
9
|
-
import { type
|
|
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 {
|
|
31
|
-
import { AppsApi, type App } from "./apps";
|
|
27
|
+
import { buildNql, getNqlObject } from "./nql/NQLParser";
|
|
32
28
|
import type { ForecastBody } from "./nql/types";
|
|
33
|
-
import {
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import { type
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import { type
|
|
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 {
|
|
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 {
|
package/build/index.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import {
|
|
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 {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
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 {
|
|
16
|
-
import {
|
|
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 {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
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 {
|
|
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 {
|
|
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,6 @@ applyMixins(NarrativeApi, [
|
|
|
56
56
|
JobsApi,
|
|
57
57
|
WhoAmIApi,
|
|
58
58
|
]);
|
|
59
|
-
export {
|
|
59
|
+
export {
|
|
60
|
+
// biome-ignore lint/style/useExportType: We need to export the class
|
|
61
|
+
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, };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type ApiRecords } from "../types";
|
|
2
1
|
import { BaseApi } from "../base-api";
|
|
3
|
-
import type {
|
|
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.
|
package/build/jobs/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type ApiRecords } from "../types";
|
|
2
1
|
import { BaseApi } from "../base-api";
|
|
3
|
-
import {
|
|
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;
|
package/build/jobs/types.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
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:
|
|
7
|
+
input: unknown;
|
|
8
8
|
executor?: string;
|
|
9
9
|
idempotency_key: string;
|
|
10
|
-
result?:
|
|
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 {
|
|
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.
|
package/build/mappings/index.js
CHANGED
|
@@ -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
|
-
|
|
51
|
-
if (
|
|
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/${
|
|
53
|
+
const resource = `${resourceName}/companies/${hydratedCompanyId}`;
|
|
54
54
|
return await this.post(resource, mapping);
|
|
55
55
|
}
|
|
56
56
|
/**
|
package/build/nql/AstParser.js
CHANGED
|
@@ -63,7 +63,7 @@ export function parseWhere(n) {
|
|
|
63
63
|
return parseBooleanExpression(n);
|
|
64
64
|
}
|
|
65
65
|
catch (e) {
|
|
66
|
-
console.debug(
|
|
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" &&
|
|
283
|
-
|
|
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
|
-
|
|
458
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 {
|
|
1
|
+
import type { Node } from "./AstParser";
|
|
2
2
|
export declare function traverseParsedAst(node: Node, callback: (node: Node) => void): void;
|
package/build/nql/AstTraverse.js
CHANGED
|
@@ -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
|
|
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)
|
|
76
|
+
for (const childNode of findTraversalTargets(node)) {
|
|
77
77
|
traverseParsedAst(childNode, callback);
|
|
78
|
-
}
|
|
78
|
+
}
|
|
79
79
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
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.
|