@narrative.io/data-collaboration-sdk-ts 0.5.0 → 0.7.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/base-api.d.ts +1 -0
- package/build/base-api.js +14 -0
- package/build/index.d.ts +2 -2
- package/build/jobs/index.d.ts +7 -2
- package/build/jobs/index.js +3 -2
- package/build/mappings/index.d.ts +70 -8
- package/build/mappings/index.js +72 -8
- package/package.json +2 -2
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
|
@@ -31,11 +31,11 @@ import { MappingsApi, type Mapping, type MappingTestResult } from "./mappings";
|
|
|
31
31
|
import type { ValueMapping, ObjectMapping, CreateMapping } from "./mappings/types";
|
|
32
32
|
import { type AccessRule, AccessRulesApi } 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 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/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
|
|
@@ -3,30 +3,58 @@ import { BaseApi } from "../base-api";
|
|
|
3
3
|
import type { CreateMapping, Mapping, MappingTestResult, MappingTestResults } from "./types";
|
|
4
4
|
import { CompanyInfoApi } from "../company-info";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Class representing the Mappings API.
|
|
7
|
+
* Extends the BaseApi to provide functionalities specific to mappings.
|
|
7
8
|
* @extends BaseApi
|
|
8
9
|
*/
|
|
9
10
|
declare class MappingsApi extends BaseApi {
|
|
10
11
|
private readonly companyInfoApi?;
|
|
11
12
|
constructor(config: Config, companyInfoApi?: CompanyInfoApi | undefined);
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
14
|
+
* Retrieves all mappings.
|
|
15
|
+
*
|
|
16
|
+
* @returns {Promise<ApiRecords<Mapping>>} A promise that resolves to a collection of Mapping records.
|
|
17
|
+
* @public
|
|
18
|
+
* @async
|
|
15
19
|
*/
|
|
16
20
|
getMappings(): Promise<ApiRecords<Mapping>>;
|
|
17
21
|
/**
|
|
18
|
-
* Creates a
|
|
22
|
+
* Creates a new mapping specific to a company.
|
|
19
23
|
*
|
|
20
|
-
* @param {CreateMapping} mapping - The mapping to be created.
|
|
21
|
-
* @param {number} [companyId] -
|
|
22
|
-
* @returns {Promise<Mapping>}
|
|
24
|
+
* @param {CreateMapping} mapping - The mapping configuration to be created.
|
|
25
|
+
* @param {number} [companyId] - Optional company ID. If not provided, it will be fetched from the API.
|
|
26
|
+
* @returns {Promise<Mapping>} A promise that resolves to the created mapping.
|
|
23
27
|
* @public
|
|
24
|
-
* @throws {Error} - If the company ID is undefined and cannot be fetched from the API.
|
|
25
28
|
* @async
|
|
29
|
+
* @throws {Error} Throws an error if the company ID is undefined and cannot be fetched.
|
|
26
30
|
*/
|
|
27
31
|
createPrivateMapping(mapping: CreateMapping, companyId?: number): Promise<Mapping>;
|
|
32
|
+
/**
|
|
33
|
+
* Tests a mapping configuration and returns the results.
|
|
34
|
+
*
|
|
35
|
+
* @param {CreateMapping} mapping - The mapping configuration to test.
|
|
36
|
+
* @returns {Promise<MappingTestResults>} A promise that resolves to the test results of the mapping.
|
|
37
|
+
* @public
|
|
38
|
+
* @async
|
|
39
|
+
*/
|
|
28
40
|
testMapping(mapping: CreateMapping): Promise<MappingTestResults>;
|
|
41
|
+
/**
|
|
42
|
+
* Previews a sample of the mapping results.
|
|
43
|
+
*
|
|
44
|
+
* @param {string} mappingId - The ID of the mapping to preview.
|
|
45
|
+
* @returns {Promise<MappingTestResults>} A promise that resolves to the sample test results of the mapping.
|
|
46
|
+
* @public
|
|
47
|
+
* @async
|
|
48
|
+
*/
|
|
29
49
|
previewMapping(mappingId: string): Promise<MappingTestResults>;
|
|
50
|
+
/**
|
|
51
|
+
* Deletes a mapping.
|
|
52
|
+
*
|
|
53
|
+
* @param {string} mappingId - The ID of the mapping to delete.
|
|
54
|
+
* @returns {Promise<void>} A promise that resolves when the mapping is successfully deleted.
|
|
55
|
+
* @public
|
|
56
|
+
* @async
|
|
57
|
+
*/
|
|
30
58
|
deleteMapping(mappingId: string): Promise<void>;
|
|
31
59
|
/**
|
|
32
60
|
* Retrieves the company ID from the API.
|
|
@@ -36,8 +64,42 @@ declare class MappingsApi extends BaseApi {
|
|
|
36
64
|
* @async
|
|
37
65
|
*/
|
|
38
66
|
private getCompanyId;
|
|
67
|
+
/**
|
|
68
|
+
* Accepts a mapping.
|
|
69
|
+
*
|
|
70
|
+
* @param {string} mappingId - The ID of the mapping to accept.
|
|
71
|
+
* @returns {Promise<void>} A promise that resolves when the mapping is accepted.
|
|
72
|
+
* @public
|
|
73
|
+
* @async
|
|
74
|
+
*/
|
|
39
75
|
acceptMapping(mappingId: string): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Rejects a mapping.
|
|
78
|
+
*
|
|
79
|
+
* @param {string} mappingId - The ID of the mapping to reject.
|
|
80
|
+
* @returns {Promise<void>} A promise that resolves when the mapping is rejected.
|
|
81
|
+
* @public
|
|
82
|
+
* @async
|
|
83
|
+
*/
|
|
40
84
|
rejectMapping(mappingId: string): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Updates a mapping.
|
|
87
|
+
*
|
|
88
|
+
* @param {string} mappingId - The ID of the mapping to update.
|
|
89
|
+
* @param {CreateMapping} mapping - The mapping configuration to update.
|
|
90
|
+
* @returns {Promise<Mapping>} A promise that resolves to the updated mapping.
|
|
91
|
+
* @public
|
|
92
|
+
* @async
|
|
93
|
+
*/
|
|
41
94
|
updateMapping(mappingId: string, mapping: Pick<CreateMapping, "mapping">): Promise<Mapping>;
|
|
95
|
+
/**
|
|
96
|
+
* Retrieves a mapping.
|
|
97
|
+
*
|
|
98
|
+
* @param {string} mappingId - The ID of the mapping to retrieve.
|
|
99
|
+
* @returns {Promise<Mapping>} A promise that resolves to the retrieved mapping.
|
|
100
|
+
* @public
|
|
101
|
+
* @async
|
|
102
|
+
*/
|
|
103
|
+
getMapping(mappingId: string): Promise<Mapping>;
|
|
42
104
|
}
|
|
43
105
|
export { type Mapping, MappingsApi, type CreateMapping, type MappingTestResult, type MappingTestResults, };
|
package/build/mappings/index.js
CHANGED
|
@@ -8,7 +8,8 @@ import { CompanyInfoApi } from "../company-info";
|
|
|
8
8
|
*/
|
|
9
9
|
const resourceName = "mappings";
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Class representing the Mappings API.
|
|
12
|
+
* Extends the BaseApi to provide functionalities specific to mappings.
|
|
12
13
|
* @extends BaseApi
|
|
13
14
|
*/
|
|
14
15
|
class MappingsApi extends BaseApi {
|
|
@@ -26,21 +27,24 @@ class MappingsApi extends BaseApi {
|
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
30
|
+
* Retrieves all mappings.
|
|
31
|
+
*
|
|
32
|
+
* @returns {Promise<ApiRecords<Mapping>>} A promise that resolves to a collection of Mapping records.
|
|
33
|
+
* @public
|
|
34
|
+
* @async
|
|
31
35
|
*/
|
|
32
36
|
async getMappings() {
|
|
33
37
|
return await this.get(resourceName);
|
|
34
38
|
}
|
|
35
39
|
/**
|
|
36
|
-
* Creates a
|
|
40
|
+
* Creates a new mapping specific to a company.
|
|
37
41
|
*
|
|
38
|
-
* @param {CreateMapping} mapping - The mapping to be created.
|
|
39
|
-
* @param {number} [companyId] -
|
|
40
|
-
* @returns {Promise<Mapping>}
|
|
42
|
+
* @param {CreateMapping} mapping - The mapping configuration to be created.
|
|
43
|
+
* @param {number} [companyId] - Optional company ID. If not provided, it will be fetched from the API.
|
|
44
|
+
* @returns {Promise<Mapping>} A promise that resolves to the created mapping.
|
|
41
45
|
* @public
|
|
42
|
-
* @throws {Error} - If the company ID is undefined and cannot be fetched from the API.
|
|
43
46
|
* @async
|
|
47
|
+
* @throws {Error} Throws an error if the company ID is undefined and cannot be fetched.
|
|
44
48
|
*/
|
|
45
49
|
async createPrivateMapping(mapping, companyId) {
|
|
46
50
|
companyId = companyId ?? (await this.getCompanyId());
|
|
@@ -49,12 +53,36 @@ class MappingsApi extends BaseApi {
|
|
|
49
53
|
const resource = `${resourceName}/companies/${companyId}`;
|
|
50
54
|
return await this.post(resource, mapping);
|
|
51
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Tests a mapping configuration and returns the results.
|
|
58
|
+
*
|
|
59
|
+
* @param {CreateMapping} mapping - The mapping configuration to test.
|
|
60
|
+
* @returns {Promise<MappingTestResults>} A promise that resolves to the test results of the mapping.
|
|
61
|
+
* @public
|
|
62
|
+
* @async
|
|
63
|
+
*/
|
|
52
64
|
async testMapping(mapping) {
|
|
53
65
|
return await this.post(`${resourceName}/test`, mapping);
|
|
54
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Previews a sample of the mapping results.
|
|
69
|
+
*
|
|
70
|
+
* @param {string} mappingId - The ID of the mapping to preview.
|
|
71
|
+
* @returns {Promise<MappingTestResults>} A promise that resolves to the sample test results of the mapping.
|
|
72
|
+
* @public
|
|
73
|
+
* @async
|
|
74
|
+
*/
|
|
55
75
|
async previewMapping(mappingId) {
|
|
56
76
|
return await this.get(`${resourceName}/${mappingId}/sample`);
|
|
57
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Deletes a mapping.
|
|
80
|
+
*
|
|
81
|
+
* @param {string} mappingId - The ID of the mapping to delete.
|
|
82
|
+
* @returns {Promise<void>} A promise that resolves when the mapping is successfully deleted.
|
|
83
|
+
* @public
|
|
84
|
+
* @async
|
|
85
|
+
*/
|
|
58
86
|
async deleteMapping(mappingId) {
|
|
59
87
|
await this.delete(`${resourceName}/${mappingId}`);
|
|
60
88
|
}
|
|
@@ -68,14 +96,50 @@ class MappingsApi extends BaseApi {
|
|
|
68
96
|
async getCompanyId() {
|
|
69
97
|
return await this.companyInfoApi?.companyId();
|
|
70
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* Accepts a mapping.
|
|
101
|
+
*
|
|
102
|
+
* @param {string} mappingId - The ID of the mapping to accept.
|
|
103
|
+
* @returns {Promise<void>} A promise that resolves when the mapping is accepted.
|
|
104
|
+
* @public
|
|
105
|
+
* @async
|
|
106
|
+
*/
|
|
71
107
|
async acceptMapping(mappingId) {
|
|
72
108
|
await this.post(`${resourceName}/${mappingId}/accept`);
|
|
73
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* Rejects a mapping.
|
|
112
|
+
*
|
|
113
|
+
* @param {string} mappingId - The ID of the mapping to reject.
|
|
114
|
+
* @returns {Promise<void>} A promise that resolves when the mapping is rejected.
|
|
115
|
+
* @public
|
|
116
|
+
* @async
|
|
117
|
+
*/
|
|
74
118
|
async rejectMapping(mappingId) {
|
|
75
119
|
await this.post(`${resourceName}/${mappingId}/reject`);
|
|
76
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* Updates a mapping.
|
|
123
|
+
*
|
|
124
|
+
* @param {string} mappingId - The ID of the mapping to update.
|
|
125
|
+
* @param {CreateMapping} mapping - The mapping configuration to update.
|
|
126
|
+
* @returns {Promise<Mapping>} A promise that resolves to the updated mapping.
|
|
127
|
+
* @public
|
|
128
|
+
* @async
|
|
129
|
+
*/
|
|
77
130
|
async updateMapping(mappingId, mapping) {
|
|
78
131
|
return await this.put(`${resourceName}/${mappingId}`, mapping);
|
|
79
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Retrieves a mapping.
|
|
135
|
+
*
|
|
136
|
+
* @param {string} mappingId - The ID of the mapping to retrieve.
|
|
137
|
+
* @returns {Promise<Mapping>} A promise that resolves to the retrieved mapping.
|
|
138
|
+
* @public
|
|
139
|
+
* @async
|
|
140
|
+
*/
|
|
141
|
+
async getMapping(mappingId) {
|
|
142
|
+
return await this.get(`${resourceName}/${mappingId}`);
|
|
143
|
+
}
|
|
80
144
|
}
|
|
81
145
|
export { MappingsApi, };
|
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.7.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",
|