@narrative.io/data-collaboration-sdk-ts 0.0.15 → 0.0.18
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/attributes/index.d.ts +32 -1
- package/build/attributes/index.js +44 -1
- package/build/attributes/types.d.ts +2 -0
- package/build/base-api.d.ts +16 -0
- package/build/base-api.js +20 -0
- package/build/contracts/index.d.ts +32 -0
- package/build/contracts/index.js +44 -0
- package/build/contracts/types.d.ts +29 -0
- package/build/contracts/types.js +1 -0
- package/build/health/index.d.ts +9 -0
- package/build/health/index.js +15 -0
- package/build/index.d.ts +6 -3
- package/build/index.js +4 -2
- package/build/ping/index.d.ts +14 -0
- package/build/ping/index.js +22 -0
- package/build/ping/types.d.ts +1 -0
- package/build/ping/types.js +1 -0
- package/build/products/index.d.ts +15 -0
- package/build/products/index.js +23 -0
- package/build/products/types.d.ts +34 -0
- package/build/products/types.js +1 -0
- package/build/types.d.ts +11 -0
- package/package.json +4 -2
|
@@ -1,6 +1,37 @@
|
|
|
1
1
|
import { type ApiRecords } from '../types';
|
|
2
2
|
import { BaseApi } from '../base-api';
|
|
3
3
|
import { type Attribute } from './types';
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* A class for accessing the Attribute API.
|
|
6
|
+
* @extends BaseApi
|
|
7
|
+
*/
|
|
8
|
+
declare class AttributeApi extends BaseApi {
|
|
9
|
+
/**
|
|
10
|
+
* Gets a list of attributes from the API.
|
|
11
|
+
*
|
|
12
|
+
* @returns {Promise<ApiRecords<Attribute>>} A promise that resolves with the list of attributes.
|
|
13
|
+
*/
|
|
5
14
|
getAttributes(): Promise<ApiRecords<Attribute>>;
|
|
15
|
+
/**
|
|
16
|
+
* Gets a single attribute from the API by its ID.
|
|
17
|
+
*
|
|
18
|
+
* @param {number} attributeId - The ID of the attribute to retrieve.
|
|
19
|
+
* @returns {Promise<Attribute>} A promise that resolves with the attribute.
|
|
20
|
+
*/
|
|
21
|
+
getAttribute(attributeId: number): Promise<Attribute>;
|
|
22
|
+
/**
|
|
23
|
+
* Deletes a single attribute from the API by its ID.
|
|
24
|
+
*
|
|
25
|
+
* @param {number} attributeId - The ID of the attribute to delete.
|
|
26
|
+
* @returns {Promise<void>} A promise that resolves when the delete operation is complete.
|
|
27
|
+
*/
|
|
28
|
+
deleteAttribute(attributeId: number): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Creates a new attribute on the API.
|
|
31
|
+
*
|
|
32
|
+
* @param {Attribute} data - The data for the new attribute.
|
|
33
|
+
* @returns {Promise<Attribute>} A promise that resolves with the newly created attribute.
|
|
34
|
+
*/
|
|
35
|
+
createAttribute(data: Attribute): Promise<Attribute>;
|
|
6
36
|
}
|
|
37
|
+
export { AttributeApi, type Attribute };
|
|
@@ -1,7 +1,50 @@
|
|
|
1
1
|
import { BaseApi } from '../base-api';
|
|
2
|
+
/**
|
|
3
|
+
* The name of the resource to be used in API requests.
|
|
4
|
+
* @constant
|
|
5
|
+
* @private
|
|
6
|
+
* @type {string}
|
|
7
|
+
*/
|
|
2
8
|
const resourceName = 'attributes';
|
|
3
|
-
|
|
9
|
+
/**
|
|
10
|
+
* A class for accessing the Attribute API.
|
|
11
|
+
* @extends BaseApi
|
|
12
|
+
*/
|
|
13
|
+
class AttributeApi extends BaseApi {
|
|
14
|
+
/**
|
|
15
|
+
* Gets a list of attributes from the API.
|
|
16
|
+
*
|
|
17
|
+
* @returns {Promise<ApiRecords<Attribute>>} A promise that resolves with the list of attributes.
|
|
18
|
+
*/
|
|
4
19
|
async getAttributes() {
|
|
5
20
|
return await this.get(resourceName);
|
|
6
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Gets a single attribute from the API by its ID.
|
|
24
|
+
*
|
|
25
|
+
* @param {number} attributeId - The ID of the attribute to retrieve.
|
|
26
|
+
* @returns {Promise<Attribute>} A promise that resolves with the attribute.
|
|
27
|
+
*/
|
|
28
|
+
async getAttribute(attributeId) {
|
|
29
|
+
return await this.get(`${resourceName}/${attributeId}`);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Deletes a single attribute from the API by its ID.
|
|
33
|
+
*
|
|
34
|
+
* @param {number} attributeId - The ID of the attribute to delete.
|
|
35
|
+
* @returns {Promise<void>} A promise that resolves when the delete operation is complete.
|
|
36
|
+
*/
|
|
37
|
+
async deleteAttribute(attributeId) {
|
|
38
|
+
await this.delete(`${resourceName}/${attributeId}`);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Creates a new attribute on the API.
|
|
42
|
+
*
|
|
43
|
+
* @param {Attribute} data - The data for the new attribute.
|
|
44
|
+
* @returns {Promise<Attribute>} A promise that resolves with the newly created attribute.
|
|
45
|
+
*/
|
|
46
|
+
async createAttribute(data) {
|
|
47
|
+
return await this.post(`${resourceName}`, data);
|
|
48
|
+
}
|
|
7
49
|
}
|
|
50
|
+
export { AttributeApi };
|
|
@@ -6,12 +6,14 @@ export interface Attribute {
|
|
|
6
6
|
type: string;
|
|
7
7
|
enum?: string[] | number[];
|
|
8
8
|
validations?: string[];
|
|
9
|
+
is_join_key?: boolean;
|
|
9
10
|
properties?: Record<string, {
|
|
10
11
|
type: string;
|
|
11
12
|
description?: string;
|
|
12
13
|
validations?: string[];
|
|
13
14
|
enum?: string[];
|
|
14
15
|
items?: unknown;
|
|
16
|
+
is_join_key?: boolean;
|
|
15
17
|
}>;
|
|
16
18
|
required?: string[];
|
|
17
19
|
}
|
package/build/base-api.d.ts
CHANGED
|
@@ -30,6 +30,22 @@ export declare abstract class BaseApi {
|
|
|
30
30
|
* @template T - Type of the response data.
|
|
31
31
|
*/
|
|
32
32
|
protected post<I, T>(endpoint: string, data: I): Promise<T>;
|
|
33
|
+
/**
|
|
34
|
+
* Sends a DELETE request to the specified endpoint.
|
|
35
|
+
*
|
|
36
|
+
* @param {string} endpoint - The endpoint to send the request to.
|
|
37
|
+
* @returns {Promise<void>} A promise that resolves when the DELETE request is complete.
|
|
38
|
+
* @protected
|
|
39
|
+
*/
|
|
40
|
+
protected delete(endpoint: string): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Makes a PUT request to the specified endpoint with the given data.
|
|
43
|
+
*
|
|
44
|
+
* @param endpoint - The endpoint to make the request to.
|
|
45
|
+
* @param data - The data to send in the request body.
|
|
46
|
+
* @returns A Promise that resolves to the data returned by the server.
|
|
47
|
+
*/
|
|
48
|
+
protected put<I, T>(endpoint: string, data: I): Promise<T>;
|
|
33
49
|
/**
|
|
34
50
|
* Returns the base URL for the API based on the environment.
|
|
35
51
|
*
|
package/build/base-api.js
CHANGED
|
@@ -40,6 +40,26 @@ export class BaseApi {
|
|
|
40
40
|
async post(endpoint, data) {
|
|
41
41
|
return await this.base_api.post(endpoint, data);
|
|
42
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Sends a DELETE request to the specified endpoint.
|
|
45
|
+
*
|
|
46
|
+
* @param {string} endpoint - The endpoint to send the request to.
|
|
47
|
+
* @returns {Promise<void>} A promise that resolves when the DELETE request is complete.
|
|
48
|
+
* @protected
|
|
49
|
+
*/
|
|
50
|
+
async delete(endpoint) {
|
|
51
|
+
await this.base_api.delete(endpoint);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Makes a PUT request to the specified endpoint with the given data.
|
|
55
|
+
*
|
|
56
|
+
* @param endpoint - The endpoint to make the request to.
|
|
57
|
+
* @param data - The data to send in the request body.
|
|
58
|
+
* @returns A Promise that resolves to the data returned by the server.
|
|
59
|
+
*/
|
|
60
|
+
async put(endpoint, data) {
|
|
61
|
+
return await this.base_api.put(endpoint, data);
|
|
62
|
+
}
|
|
43
63
|
/**
|
|
44
64
|
* Returns the base URL for the API based on the environment.
|
|
45
65
|
*
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { BaseApi } from '../base-api';
|
|
2
|
+
import { type CustomerContract, type PaymentMethod } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* A class for accessing the Contracts API.
|
|
5
|
+
* @extends BaseApi
|
|
6
|
+
*/
|
|
7
|
+
declare class ContractsApi extends BaseApi {
|
|
8
|
+
/**
|
|
9
|
+
* Gets a list of contracts from the API.
|
|
10
|
+
*
|
|
11
|
+
* @returns {Promise<CustomerContract[]>} A promise that resolves with the list of contracts.
|
|
12
|
+
*/
|
|
13
|
+
getContracts(): Promise<CustomerContract[]>;
|
|
14
|
+
/**
|
|
15
|
+
* Get a customer contract based on the contract ID
|
|
16
|
+
*
|
|
17
|
+
* @param contractId - ID of the customer contract
|
|
18
|
+
* @returns Promise that resolves to the customer contract
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
getContract(contractId: string): Promise<CustomerContract>;
|
|
22
|
+
/**
|
|
23
|
+
* Update a customer contract's payment method based on the contract ID
|
|
24
|
+
*
|
|
25
|
+
* @param contractId - ID of the customer contract
|
|
26
|
+
* @param paymentMethod - the updated payment method
|
|
27
|
+
* @returns Promise that resolves to the updated customer contract
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
updatePaymentMethod(contractId: string, paymentMethod: PaymentMethod): Promise<CustomerContract>;
|
|
31
|
+
}
|
|
32
|
+
export { ContractsApi, type CustomerContract, type PaymentMethod };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { BaseApi } from '../base-api';
|
|
2
|
+
/**
|
|
3
|
+
* The name of the resource to be used in API requests.
|
|
4
|
+
* @constant
|
|
5
|
+
* @private
|
|
6
|
+
* @type {string}
|
|
7
|
+
*/
|
|
8
|
+
const resourceName = 'contracts';
|
|
9
|
+
/**
|
|
10
|
+
* A class for accessing the Contracts API.
|
|
11
|
+
* @extends BaseApi
|
|
12
|
+
*/
|
|
13
|
+
class ContractsApi extends BaseApi {
|
|
14
|
+
/**
|
|
15
|
+
* Gets a list of contracts from the API.
|
|
16
|
+
*
|
|
17
|
+
* @returns {Promise<CustomerContract[]>} A promise that resolves with the list of contracts.
|
|
18
|
+
*/
|
|
19
|
+
async getContracts() {
|
|
20
|
+
return await this.get(resourceName);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Get a customer contract based on the contract ID
|
|
24
|
+
*
|
|
25
|
+
* @param contractId - ID of the customer contract
|
|
26
|
+
* @returns Promise that resolves to the customer contract
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
async getContract(contractId) {
|
|
30
|
+
return await this.get(`${resourceName}/${contractId}`);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Update a customer contract's payment method based on the contract ID
|
|
34
|
+
*
|
|
35
|
+
* @param contractId - ID of the customer contract
|
|
36
|
+
* @param paymentMethod - the updated payment method
|
|
37
|
+
* @returns Promise that resolves to the updated customer contract
|
|
38
|
+
*
|
|
39
|
+
*/
|
|
40
|
+
async updatePaymentMethod(contractId, paymentMethod) {
|
|
41
|
+
return await this.put(`${resourceName}/${contractId}`, paymentMethod);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export { ContractsApi };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface CustomerContract {
|
|
2
|
+
id: CustomerContractId;
|
|
3
|
+
payableCompanyId: CompanyId;
|
|
4
|
+
paymentMethod: PaymentMethod;
|
|
5
|
+
internalNotes?: string;
|
|
6
|
+
revision: Revision;
|
|
7
|
+
revisionNotes?: string;
|
|
8
|
+
revisionStart: string;
|
|
9
|
+
revisionEnd?: string;
|
|
10
|
+
updatedBy: UserId;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
updatedAt: string;
|
|
13
|
+
}
|
|
14
|
+
interface CustomerContractId {
|
|
15
|
+
value: string;
|
|
16
|
+
}
|
|
17
|
+
interface Revision {
|
|
18
|
+
value: number;
|
|
19
|
+
}
|
|
20
|
+
export interface PaymentMethod {
|
|
21
|
+
type: 'credit_card' | 'invoice';
|
|
22
|
+
}
|
|
23
|
+
interface UserId {
|
|
24
|
+
value: string;
|
|
25
|
+
}
|
|
26
|
+
interface CompanyId {
|
|
27
|
+
value: string;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/build/health/index.d.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { BaseApi } from '../base-api';
|
|
2
2
|
import { type HealthCheckResult } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* A class for accessing the Health Check API.
|
|
5
|
+
* @extends BaseApi
|
|
6
|
+
*/
|
|
3
7
|
export declare class HealthCheckApi extends BaseApi {
|
|
8
|
+
/**
|
|
9
|
+
* Gets the result of a health check from the API.
|
|
10
|
+
*
|
|
11
|
+
* @returns {Promise<HealthCheckResult>} A promise that resolves with the result of the health check.
|
|
12
|
+
*/
|
|
4
13
|
getHealthCheck(): Promise<HealthCheckResult>;
|
|
5
14
|
}
|
package/build/health/index.js
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import { BaseApi } from '../base-api';
|
|
2
|
+
/**
|
|
3
|
+
* The name of the resource to be used in API requests.
|
|
4
|
+
* @constant
|
|
5
|
+
* @private
|
|
6
|
+
* @type {string}
|
|
7
|
+
*/
|
|
2
8
|
const resourceName = 'health';
|
|
9
|
+
/**
|
|
10
|
+
* A class for accessing the Health Check API.
|
|
11
|
+
* @extends BaseApi
|
|
12
|
+
*/
|
|
3
13
|
export class HealthCheckApi extends BaseApi {
|
|
14
|
+
/**
|
|
15
|
+
* Gets the result of a health check from the API.
|
|
16
|
+
*
|
|
17
|
+
* @returns {Promise<HealthCheckResult>} A promise that resolves with the result of the health check.
|
|
18
|
+
*/
|
|
4
19
|
async getHealthCheck() {
|
|
5
20
|
return await this.get(resourceName);
|
|
6
21
|
}
|
package/build/index.d.ts
CHANGED
|
@@ -2,14 +2,17 @@ import { BaseApi } from './base-api';
|
|
|
2
2
|
import { DatasetApi } from './datasets';
|
|
3
3
|
import { HealthCheckApi } from './health';
|
|
4
4
|
import { RosettaStoneApi } from './rosetta-stone';
|
|
5
|
-
import { type Environment, type Config, type ApiRecords } from './types';
|
|
5
|
+
import { type Environment, type Config, type ApiRecords, type MonetaryAmount } from './types';
|
|
6
6
|
import { type DatasetTableSummaryAPIResponse, type Dataset, type DatasetTableSummary } from './datasets/types';
|
|
7
7
|
import { type HealthCheckResult } from './health/types';
|
|
8
8
|
import { type SampleRecords } from './rosetta-stone/types';
|
|
9
9
|
import { AttributeApi } from './attributes';
|
|
10
10
|
import { type Attribute } from './attributes/types';
|
|
11
|
+
import { PingApi } from './ping';
|
|
12
|
+
import { type PingStatus } from './ping/types';
|
|
13
|
+
import { type Product, ProductsApi } from './products';
|
|
11
14
|
declare class NarrativeApi extends BaseApi {
|
|
12
15
|
}
|
|
13
|
-
interface NarrativeApi extends BaseApi, HealthCheckApi, DatasetApi, RosettaStoneApi, AttributeApi {
|
|
16
|
+
interface NarrativeApi extends BaseApi, HealthCheckApi, DatasetApi, RosettaStoneApi, AttributeApi, PingApi {
|
|
14
17
|
}
|
|
15
|
-
export { NarrativeApi, AttributeApi, HealthCheckApi, DatasetApi, type Attribute, type Environment, type Config, type ApiRecords, type Dataset, type HealthCheckResult, type SampleRecords, type DatasetTableSummary, type DatasetTableSummaryAPIResponse };
|
|
18
|
+
export { NarrativeApi, AttributeApi, HealthCheckApi, DatasetApi, PingApi, ProductsApi, type PingStatus, type Attribute, type Environment, type Config, type ApiRecords, type Dataset, type HealthCheckResult, type SampleRecords, type DatasetTableSummary, type DatasetTableSummaryAPIResponse, type Product, type MonetaryAmount };
|
package/build/index.js
CHANGED
|
@@ -4,7 +4,9 @@ import { HealthCheckApi } from './health';
|
|
|
4
4
|
import { RosettaStoneApi } from './rosetta-stone';
|
|
5
5
|
import { applyMixins } from './utils';
|
|
6
6
|
import { AttributeApi } from './attributes';
|
|
7
|
+
import { PingApi } from './ping';
|
|
8
|
+
import { ProductsApi } from './products';
|
|
7
9
|
class NarrativeApi extends BaseApi {
|
|
8
10
|
}
|
|
9
|
-
applyMixins(NarrativeApi, [BaseApi, HealthCheckApi, DatasetApi, RosettaStoneApi, AttributeApi]);
|
|
10
|
-
export { NarrativeApi, AttributeApi, HealthCheckApi, DatasetApi };
|
|
11
|
+
applyMixins(NarrativeApi, [BaseApi, HealthCheckApi, DatasetApi, RosettaStoneApi, AttributeApi, PingApi]);
|
|
12
|
+
export { NarrativeApi, AttributeApi, HealthCheckApi, DatasetApi, PingApi, ProductsApi };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseApi } from '../base-api';
|
|
2
|
+
import { type PingStatus } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* A class for accessing the Ping API.
|
|
5
|
+
* @extends BaseApi
|
|
6
|
+
*/
|
|
7
|
+
export declare class PingApi extends BaseApi {
|
|
8
|
+
/**
|
|
9
|
+
* Gets the result of a ping from the API.
|
|
10
|
+
*
|
|
11
|
+
* @returns {Promise<HealthCheckResult>} A promise that resolves with the result of the ping.
|
|
12
|
+
*/
|
|
13
|
+
ping(): Promise<PingStatus>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseApi } from '../base-api';
|
|
2
|
+
/**
|
|
3
|
+
* The name of the resource to be used in API requests.
|
|
4
|
+
* @constant
|
|
5
|
+
* @private
|
|
6
|
+
* @type {string}
|
|
7
|
+
*/
|
|
8
|
+
const resourceName = 'ping';
|
|
9
|
+
/**
|
|
10
|
+
* A class for accessing the Ping API.
|
|
11
|
+
* @extends BaseApi
|
|
12
|
+
*/
|
|
13
|
+
export class PingApi extends BaseApi {
|
|
14
|
+
/**
|
|
15
|
+
* Gets the result of a ping from the API.
|
|
16
|
+
*
|
|
17
|
+
* @returns {Promise<HealthCheckResult>} A promise that resolves with the result of the ping.
|
|
18
|
+
*/
|
|
19
|
+
async ping() {
|
|
20
|
+
return await this.get(resourceName);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type PingStatus = 'healthy' | unknown;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseApi } from '../base-api';
|
|
2
|
+
import { type Product } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* A class for accessing the Products API.
|
|
5
|
+
* @extends BaseApi
|
|
6
|
+
*/
|
|
7
|
+
declare class ProductsApi extends BaseApi {
|
|
8
|
+
/**
|
|
9
|
+
* Gets the result of a product from the API.
|
|
10
|
+
*
|
|
11
|
+
* @returns {Promise<Product[]>} A promise that resolves with the products.
|
|
12
|
+
*/
|
|
13
|
+
getHealthCheck(): Promise<Product[]>;
|
|
14
|
+
}
|
|
15
|
+
export { ProductsApi, type Product };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BaseApi } from '../base-api';
|
|
2
|
+
/**
|
|
3
|
+
* The name of the resource to be used in API requests.
|
|
4
|
+
* @constant
|
|
5
|
+
* @private
|
|
6
|
+
* @type {string}
|
|
7
|
+
*/
|
|
8
|
+
const resourceName = 'admin/products';
|
|
9
|
+
/**
|
|
10
|
+
* A class for accessing the Products API.
|
|
11
|
+
* @extends BaseApi
|
|
12
|
+
*/
|
|
13
|
+
class ProductsApi extends BaseApi {
|
|
14
|
+
/**
|
|
15
|
+
* Gets the result of a product from the API.
|
|
16
|
+
*
|
|
17
|
+
* @returns {Promise<Product[]>} A promise that resolves with the products.
|
|
18
|
+
*/
|
|
19
|
+
async getHealthCheck() {
|
|
20
|
+
return await this.get(resourceName);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export { ProductsApi };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
type ProductId = string;
|
|
2
|
+
type ProductSkuType = 'processing' | 'storage' | 'transfer';
|
|
3
|
+
type ProductCloudType = 'aws' | 'gcp' | 'azure';
|
|
4
|
+
type ProductUnitType = 'bytes' | 'average-bytes-per-month';
|
|
5
|
+
type ProductStatus = 'active' | 'archived';
|
|
6
|
+
interface ProductRate {
|
|
7
|
+
type: string;
|
|
8
|
+
unitPrice: {
|
|
9
|
+
type: string;
|
|
10
|
+
currency: string;
|
|
11
|
+
priceInMicroCents: number;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface ProductUnitPrice {
|
|
15
|
+
type: string;
|
|
16
|
+
currency: string;
|
|
17
|
+
priceInMicroCents: number;
|
|
18
|
+
}
|
|
19
|
+
export interface Product {
|
|
20
|
+
id: ProductId;
|
|
21
|
+
sku: string;
|
|
22
|
+
skuType: ProductSkuType;
|
|
23
|
+
payableCompanyId: number;
|
|
24
|
+
name: string;
|
|
25
|
+
description?: string | null;
|
|
26
|
+
cloud?: ProductCloudType | null;
|
|
27
|
+
region?: string | null;
|
|
28
|
+
unit: ProductUnitType;
|
|
29
|
+
defaultRate: ProductRate;
|
|
30
|
+
status: ProductStatus;
|
|
31
|
+
createdAt: string;
|
|
32
|
+
updatedAt: string;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/build/types.d.ts
CHANGED
|
@@ -18,3 +18,14 @@ export interface Config {
|
|
|
18
18
|
export interface ApiRecords<T> {
|
|
19
19
|
records: T[];
|
|
20
20
|
}
|
|
21
|
+
export interface MonetaryAmount {
|
|
22
|
+
value: {
|
|
23
|
+
amount: number;
|
|
24
|
+
currency: {
|
|
25
|
+
code: CurrencyCode;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
microCentsUsd: number;
|
|
29
|
+
}
|
|
30
|
+
type CurrencyCode = 'USD';
|
|
31
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@narrative.io/data-collaboration-sdk-ts",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
4
4
|
"main": "build/index.js",
|
|
5
5
|
"repository": "github:narrative-io/data-collaboration-sdk-ts",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "tsc",
|
|
11
11
|
"lint": "npx eslint . --fix",
|
|
12
|
-
"prepare": "npm run build",
|
|
12
|
+
"prepare": "npx eslint . --fix && npm run build",
|
|
13
13
|
"prepublishOnly": "npm test && npm run lint",
|
|
14
14
|
"preversion": "npm run lint",
|
|
15
15
|
"version": "npm run && git add -A src",
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
"author": "",
|
|
21
21
|
"license": "ISC",
|
|
22
22
|
"devDependencies": {
|
|
23
|
+
"@commitlint/cli": "^17.4.2",
|
|
24
|
+
"@commitlint/config-conventional": "^17.4.2",
|
|
23
25
|
"@typescript-eslint/eslint-plugin": "^5.51.0",
|
|
24
26
|
"@vitest/coverage-c8": "^0.28.4",
|
|
25
27
|
"eslint": "^8.33.0",
|