@narrative.io/data-collaboration-sdk-ts 0.6.0 → 0.8.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.
- package/build/access-rules/index.d.ts +70 -2
- package/build/access-rules/index.js +43 -1
- package/build/access-rules/types.d.ts +49 -0
- package/build/base-api.d.ts +1 -0
- package/build/base-api.js +14 -0
- package/build/index.d.ts +3 -3
- package/build/index.js +1 -1
- package/build/jobs/index.d.ts +7 -2
- package/build/jobs/index.js +3 -2
- package/package.json +2 -2
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
import type { ApiRecords } from "../types";
|
|
2
2
|
import { BaseApi } from "../base-api";
|
|
3
|
-
import type { AccessRule } from "./types";
|
|
3
|
+
import type { AccessRule, AccessRuleV2 } from "./types";
|
|
4
|
+
/**
|
|
5
|
+
* Represents the parameters used to retrieve access rules.
|
|
6
|
+
* This interface extends a generic record allowing for string, number, boolean, or undefined values.
|
|
7
|
+
*
|
|
8
|
+
* @interface GetAccessRulesParameters
|
|
9
|
+
* @extends {Record<string, string | number | boolean | undefined>}
|
|
10
|
+
*
|
|
11
|
+
* @property {boolean} [owned_only] - Optional filter to retrieve only the access rules owned by the user.
|
|
12
|
+
* Setting this to true will fetch only the access rules that are owned.
|
|
13
|
+
*
|
|
14
|
+
* @property {boolean} [shared_only] - Optional filter to retrieve only the access rules shared with the user.
|
|
15
|
+
* Setting this to true will fetch only the access rules that are shared.
|
|
16
|
+
*
|
|
17
|
+
* @property {string} [tag] - Optional filter to retrieve access rules that are tagged with a specific tag.
|
|
18
|
+
* Provide the tag string to fetch access rules associated with it.
|
|
19
|
+
*
|
|
20
|
+
* @property {number} [company_id] - Optional filter to retrieve access rules associated with a specific company.
|
|
21
|
+
* Provide the company ID to fetch access rules related to that company.
|
|
22
|
+
*
|
|
23
|
+
* @property {number} [offset] - Optional pagination parameter that specifies the starting point for the list of results.
|
|
24
|
+
* Provide an offset number to skip a specific number of records in the result set.
|
|
25
|
+
*
|
|
26
|
+
* @property {number} [per_page] - Optional pagination parameter that specifies the number of records to return per page.
|
|
27
|
+
* Provide a number to set the maximum number of records returned in one page of results.
|
|
28
|
+
*/
|
|
29
|
+
interface GetAccessRulesParameters extends Record<string, string | number | boolean | undefined> {
|
|
30
|
+
owned_only?: boolean;
|
|
31
|
+
shared_only?: boolean;
|
|
32
|
+
tag?: string;
|
|
33
|
+
company_id?: number;
|
|
34
|
+
offset?: number;
|
|
35
|
+
per_page?: number;
|
|
36
|
+
}
|
|
4
37
|
/**
|
|
5
38
|
* @module AccessRulesApi
|
|
6
39
|
* @description This module provides methods for working with access rules.
|
|
@@ -12,6 +45,7 @@ declare class AccessRulesApi extends BaseApi {
|
|
|
12
45
|
*
|
|
13
46
|
* @returns {Promise<ApiRecords<AccessRule>>} A promise that resolves to an object containing access rules.
|
|
14
47
|
* @example
|
|
48
|
+
* @deprecated This method is deprecated. Use getAccessableAccessRules() instead.
|
|
15
49
|
* const api = new AccessRulesApi();
|
|
16
50
|
* api.getAccessRules().then(rules => {
|
|
17
51
|
* console.log(rules);
|
|
@@ -40,5 +74,39 @@ declare class AccessRulesApi extends BaseApi {
|
|
|
40
74
|
* @returns {Promise<AccessRule>} A promise that resolves to the updated access rule.
|
|
41
75
|
*/
|
|
42
76
|
updateAccessRule(id: number, rule: Partial<Omit<AccessRule, "id" | "created_at" | "updated_at" | "dataset_id">>): Promise<AccessRule>;
|
|
77
|
+
/**
|
|
78
|
+
* Retrieves a specific access rule by its ID.
|
|
79
|
+
*
|
|
80
|
+
* @public
|
|
81
|
+
* @async
|
|
82
|
+
* @param {number} id - The unique identifier of the access rule to retrieve.
|
|
83
|
+
* @returns {Promise<AccessRuleV2>} A promise that resolves to an AccessRuleV2 object.
|
|
84
|
+
* @description This method fetches a single access rule based on the provided ID. It returns a promise
|
|
85
|
+
* that resolves to the detailed information of the access rule.
|
|
86
|
+
*/
|
|
87
|
+
getAccessRule(id: number): Promise<AccessRuleV2>;
|
|
88
|
+
/**
|
|
89
|
+
* Retrieves a specific access rule by the company slug and access rule name.
|
|
90
|
+
*
|
|
91
|
+
* @public
|
|
92
|
+
* @async
|
|
93
|
+
* @param {string} companySlug - The slug of the company that owns the access rule.
|
|
94
|
+
* @param {string} accessRuleName - The name of the access rule to retrieve.
|
|
95
|
+
* @returns {Promise<AccessRuleV2>} A promise that resolves to an AccessRuleV2 object.
|
|
96
|
+
* @description This method fetches a single access rule based on the company slug and the access rule's name.
|
|
97
|
+
* It's particularly useful when access rule IDs are not known or used.
|
|
98
|
+
*/
|
|
99
|
+
getAccessRuleByName(companySlug: string, accessRuleName: string): Promise<AccessRuleV2>;
|
|
100
|
+
/**
|
|
101
|
+
* Retrieves a list of access rules that a user has access to, based on the provided parameters.
|
|
102
|
+
*
|
|
103
|
+
* @public
|
|
104
|
+
* @async
|
|
105
|
+
* @param {GetAccessRulesParameters} parameters - Parameters to filter and paginate the list of access rules.
|
|
106
|
+
* @returns {Promise<ApiRecords<AccessRuleV2>>} A promise that resolves to a collection of AccessRuleV2 objects.
|
|
107
|
+
* @description This method fetches access rules based on the specified filters and pagination options provided in the parameters.
|
|
108
|
+
* It returns a promise that resolves to a list of access rules that match the criteria.
|
|
109
|
+
*/
|
|
110
|
+
getAccessableAccessRules(parameters: GetAccessRulesParameters): Promise<ApiRecords<AccessRuleV2>>;
|
|
43
111
|
}
|
|
44
|
-
export { AccessRulesApi, type AccessRule };
|
|
112
|
+
export { AccessRulesApi, type AccessRule, type AccessRuleV2, type GetAccessRulesParameters, };
|
|
@@ -11,6 +11,7 @@ class AccessRulesApi extends BaseApi {
|
|
|
11
11
|
*
|
|
12
12
|
* @returns {Promise<ApiRecords<AccessRule>>} A promise that resolves to an object containing access rules.
|
|
13
13
|
* @example
|
|
14
|
+
* @deprecated This method is deprecated. Use getAccessableAccessRules() instead.
|
|
14
15
|
* const api = new AccessRulesApi();
|
|
15
16
|
* api.getAccessRules().then(rules => {
|
|
16
17
|
* console.log(rules);
|
|
@@ -50,5 +51,46 @@ class AccessRulesApi extends BaseApi {
|
|
|
50
51
|
async updateAccessRule(id, rule) {
|
|
51
52
|
return await this.put(`${resourceName}/${id}`, rule);
|
|
52
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Retrieves a specific access rule by its ID.
|
|
56
|
+
*
|
|
57
|
+
* @public
|
|
58
|
+
* @async
|
|
59
|
+
* @param {number} id - The unique identifier of the access rule to retrieve.
|
|
60
|
+
* @returns {Promise<AccessRuleV2>} A promise that resolves to an AccessRuleV2 object.
|
|
61
|
+
* @description This method fetches a single access rule based on the provided ID. It returns a promise
|
|
62
|
+
* that resolves to the detailed information of the access rule.
|
|
63
|
+
*/
|
|
64
|
+
async getAccessRule(id) {
|
|
65
|
+
return await this.get(`v2/${resourceName}/${id}`);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Retrieves a specific access rule by the company slug and access rule name.
|
|
69
|
+
*
|
|
70
|
+
* @public
|
|
71
|
+
* @async
|
|
72
|
+
* @param {string} companySlug - The slug of the company that owns the access rule.
|
|
73
|
+
* @param {string} accessRuleName - The name of the access rule to retrieve.
|
|
74
|
+
* @returns {Promise<AccessRuleV2>} A promise that resolves to an AccessRuleV2 object.
|
|
75
|
+
* @description This method fetches a single access rule based on the company slug and the access rule's name.
|
|
76
|
+
* It's particularly useful when access rule IDs are not known or used.
|
|
77
|
+
*/
|
|
78
|
+
async getAccessRuleByName(companySlug, accessRuleName) {
|
|
79
|
+
return await this.get(`v2/${resourceName}/${companySlug}/${accessRuleName}`);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Retrieves a list of access rules that a user has access to, based on the provided parameters.
|
|
83
|
+
*
|
|
84
|
+
* @public
|
|
85
|
+
* @async
|
|
86
|
+
* @param {GetAccessRulesParameters} parameters - Parameters to filter and paginate the list of access rules.
|
|
87
|
+
* @returns {Promise<ApiRecords<AccessRuleV2>>} A promise that resolves to a collection of AccessRuleV2 objects.
|
|
88
|
+
* @description This method fetches access rules based on the specified filters and pagination options provided in the parameters.
|
|
89
|
+
* It returns a promise that resolves to a list of access rules that match the criteria.
|
|
90
|
+
*/
|
|
91
|
+
async getAccessableAccessRules(parameters) {
|
|
92
|
+
const queryString = this.constructQueryString(parameters);
|
|
93
|
+
return await this.get(`v2/${resourceName}${queryString}`);
|
|
94
|
+
}
|
|
53
95
|
}
|
|
54
|
-
export { AccessRulesApi };
|
|
96
|
+
export { AccessRulesApi, };
|
|
@@ -26,4 +26,53 @@ interface AccessRuleCompanyConstraint {
|
|
|
26
26
|
type AccessRuleConstraints = string[];
|
|
27
27
|
type AccessRuleDescription = string;
|
|
28
28
|
type AccessRulePricing = number;
|
|
29
|
+
interface AccessRuleMetadata {
|
|
30
|
+
created_at: string;
|
|
31
|
+
updated_at: string;
|
|
32
|
+
}
|
|
33
|
+
type AccessRuleCollaboratorsType = "inclusion" | "exclusion";
|
|
34
|
+
interface AccessRuleCollaborators {
|
|
35
|
+
type: AccessRuleCollaboratorsType;
|
|
36
|
+
company_ids: number[];
|
|
37
|
+
}
|
|
38
|
+
interface AccessRuleSchema {
|
|
39
|
+
type: string;
|
|
40
|
+
properties: Record<string, any>;
|
|
41
|
+
required?: string[];
|
|
42
|
+
}
|
|
43
|
+
type AccessRuleStatus = "active" | "archived";
|
|
44
|
+
interface SharedAccessRule {
|
|
45
|
+
name?: string;
|
|
46
|
+
id: number;
|
|
47
|
+
company_id: number;
|
|
48
|
+
company_name: string;
|
|
49
|
+
company_slug?: string;
|
|
50
|
+
display_name?: string;
|
|
51
|
+
description?: string;
|
|
52
|
+
image?: string;
|
|
53
|
+
tags?: string[];
|
|
54
|
+
schema: AccessRuleSchema;
|
|
55
|
+
price_cpm_usd: number;
|
|
56
|
+
metadata: AccessRuleMetadata;
|
|
57
|
+
type: "shared";
|
|
58
|
+
}
|
|
59
|
+
interface OwnedAccessRule {
|
|
60
|
+
name?: string;
|
|
61
|
+
id: number;
|
|
62
|
+
company_id: number;
|
|
63
|
+
company_name: string;
|
|
64
|
+
company_slug?: string;
|
|
65
|
+
display_name?: string;
|
|
66
|
+
description?: string;
|
|
67
|
+
image?: string;
|
|
68
|
+
status: AccessRuleStatus;
|
|
69
|
+
tags?: string[];
|
|
70
|
+
nql?: string;
|
|
71
|
+
schema: AccessRuleSchema;
|
|
72
|
+
collaborators: AccessRuleCollaborators;
|
|
73
|
+
price_cpm_usd: number;
|
|
74
|
+
metadata: AccessRuleMetadata;
|
|
75
|
+
type: "owned";
|
|
76
|
+
}
|
|
77
|
+
export type AccessRuleV2 = OwnedAccessRule | SharedAccessRule;
|
|
29
78
|
export {};
|
package/build/base-api.d.ts
CHANGED
package/build/base-api.js
CHANGED
|
@@ -151,4 +151,18 @@ export class BaseApi {
|
|
|
151
151
|
}
|
|
152
152
|
return headers;
|
|
153
153
|
}
|
|
154
|
+
constructQueryString(parameters) {
|
|
155
|
+
const queryParameters = [];
|
|
156
|
+
if (parameters !== undefined) {
|
|
157
|
+
Object.keys(parameters)
|
|
158
|
+
.filter((key) => key in parameters)
|
|
159
|
+
.forEach((key) => queryParameters.push({ [key]: String(parameters[key]) }));
|
|
160
|
+
}
|
|
161
|
+
const queryString = queryParameters.length > 0
|
|
162
|
+
? queryParameters
|
|
163
|
+
.map((param) => Object.entries(param).map(([key, value]) => `${key}=${value}`))
|
|
164
|
+
.join("&")
|
|
165
|
+
: "";
|
|
166
|
+
return queryString.length > 0 ? `?${queryString}` : "";
|
|
167
|
+
}
|
|
154
168
|
}
|
package/build/index.d.ts
CHANGED
|
@@ -29,13 +29,13 @@ import type { ForecastBody } from "./nql/types";
|
|
|
29
29
|
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";
|
|
30
30
|
import { MappingsApi, type Mapping, type MappingTestResult } from "./mappings";
|
|
31
31
|
import type { ValueMapping, ObjectMapping, CreateMapping } from "./mappings/types";
|
|
32
|
-
import { type AccessRule, AccessRulesApi } from "./access-rules/";
|
|
32
|
+
import { type AccessRule, AccessRulesApi, type GetAccessRulesParameters, type AccessRuleV2 } from "./access-rules/";
|
|
33
33
|
import { type Subscription, type SubscriptionDetails, type DataStreamSubscriptionDetails, type MarketplaceSubscriptionDetails, type SubscriptionOutput, type SubscriptionType, type SubscriptionStatus, type SubscriptionBudget, SubscriptionsApi } from "./subscriptions";
|
|
34
|
-
import { type Job, JobsApi } from "./jobs";
|
|
34
|
+
import { type Job, type GetJobsParameters, JobsApi } from "./jobs";
|
|
35
35
|
import { WhoAmIApi } from "./whoami";
|
|
36
36
|
import { ConnectionsApi, type Connection } from "./connections";
|
|
37
37
|
declare class NarrativeApi extends BaseApi {
|
|
38
38
|
}
|
|
39
39
|
interface NarrativeApi extends BaseApi, HealthCheckApi, DatasetApi, RosettaStoneApi, AttributeApi, PingApi, CompanyInfoApi, InstallationsApi, ConnectionsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi, ContractsApi, AuthenticationApi, MappingsApi, AccessRulesApi, AppsApi, SubscriptionsApi, JobsApi, WhoAmIApi {
|
|
40
40
|
}
|
|
41
|
-
export { NarrativeApi, AttributeApi, 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, type App, type Resource, 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 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 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 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, type Job, type User, type Mapping, type MappingTestResult, type ValueMapping, type ObjectMapping, type CreateMapping, compileStatement, parseStatement, };
|
|
41
|
+
export { NarrativeApi, AttributeApi, 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, 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 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 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 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, type Job, type User, type Mapping, type MappingTestResult, type ValueMapping, type ObjectMapping, type CreateMapping, compileStatement, parseStatement, };
|
package/build/index.js
CHANGED
|
@@ -20,7 +20,7 @@ import { AuthenticationApi, } from "./authentication";
|
|
|
20
20
|
import { AppsApi } from "./apps";
|
|
21
21
|
import { isConversationMessageRole, isConversationMessageName, isConversationUserMessage, isConversationAssistantMessage, isConversationSystemMessage, isConversationFunctionMessage, isConversationMessage, isConversationInputMessage, isConversationMessages, isType, isRosettaRequestMessage, isConversationMessageFunctionCall, isConversationAssistantMessageWithFunctionCall, isConversationAssistantMessageWithoutFunctionCall, } from "./rosetta/types";
|
|
22
22
|
import { MappingsApi } from "./mappings";
|
|
23
|
-
import { AccessRulesApi } from "./access-rules/";
|
|
23
|
+
import { AccessRulesApi, } from "./access-rules/";
|
|
24
24
|
import { SubscriptionsApi, } from "./subscriptions";
|
|
25
25
|
import { JobsApi } from "./jobs";
|
|
26
26
|
import { WhoAmIApi } from "./whoami";
|
package/build/jobs/index.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { type ApiRecords } from "../types";
|
|
2
2
|
import { BaseApi } from "../base-api";
|
|
3
3
|
import { type Job } from "./types";
|
|
4
|
+
interface GetJobsParameters extends Record<string, string | number | boolean | undefined> {
|
|
5
|
+
dataset_id?: number;
|
|
6
|
+
per_page?: number;
|
|
7
|
+
offset?: number;
|
|
8
|
+
}
|
|
4
9
|
/**
|
|
5
10
|
* @module JobsApi
|
|
6
11
|
* @description This module provides methods for fetching jobs records.
|
|
@@ -11,11 +16,11 @@ declare class JobsApi extends BaseApi {
|
|
|
11
16
|
* Get all jobs for the current company
|
|
12
17
|
* @returns {Promise<ApiRecords<Job>>} - Promise resolving with the list of jobs.
|
|
13
18
|
*/
|
|
14
|
-
getJobs(): Promise<ApiRecords<Job>>;
|
|
19
|
+
getJobs(parameters?: GetJobsParameters): Promise<ApiRecords<Job>>;
|
|
15
20
|
/**
|
|
16
21
|
* Get a specific job by id
|
|
17
22
|
* @returns {Promise<Job>} - Promise resolving with the job.
|
|
18
23
|
*/
|
|
19
24
|
getJob(jobId: string): Promise<Job>;
|
|
20
25
|
}
|
|
21
|
-
export { type Job, JobsApi };
|
|
26
|
+
export { type Job, JobsApi, type GetJobsParameters };
|
package/build/jobs/index.js
CHANGED
|
@@ -10,8 +10,9 @@ class JobsApi extends BaseApi {
|
|
|
10
10
|
* Get all jobs for the current company
|
|
11
11
|
* @returns {Promise<ApiRecords<Job>>} - Promise resolving with the list of jobs.
|
|
12
12
|
*/
|
|
13
|
-
async getJobs() {
|
|
14
|
-
|
|
13
|
+
async getJobs(parameters) {
|
|
14
|
+
const queryString = this.constructQueryString(parameters);
|
|
15
|
+
return await this.get(`${resourceName}${queryString}`);
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
17
18
|
* Get a specific job by id
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@narrative.io/data-collaboration-sdk-ts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"main": "build/index.js",
|
|
5
5
|
"repository": "github:narrative-io/data-collaboration-sdk-ts",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@types/jest": "^29.5.0",
|
|
29
29
|
"babel-jest": "^29.4.3",
|
|
30
30
|
"eslint-config-prettier": "^9.0.0",
|
|
31
|
-
"eslint-config-standard-with-typescript": "^
|
|
31
|
+
"eslint-config-standard-with-typescript": "^43.0.0",
|
|
32
32
|
"eslint-plugin-prettier": "^5.0.0",
|
|
33
33
|
"husky": "^8.0.0",
|
|
34
34
|
"jest": "^29.4.3",
|