@narrative.io/data-collaboration-sdk-ts 0.0.9 → 0.0.11
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 -1
- package/build/datasets/index.d.ts +1 -1
- package/build/datasets/types.d.ts +43 -0
- package/build/datasets/types.js +1 -0
- package/build/health/index.d.ts +1 -1
- package/build/health/types.d.ts +11 -0
- package/build/health/types.js +1 -0
- package/build/index.d.ts +5 -1
- package/build/index.js +1 -1
- package/build/rosetta-stone/types.d.ts +10 -0
- package/build/rosetta-stone/types.js +1 -0
- package/build/types.d.ts +20 -0
- package/build/types.js +1 -0
- package/package.json +2 -5
package/build/base-api.d.ts
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface Dataset {
|
|
2
|
+
id: number;
|
|
3
|
+
company_id: number;
|
|
4
|
+
created_at: string;
|
|
5
|
+
description: string;
|
|
6
|
+
name: string;
|
|
7
|
+
retention_policy: RetentionPolicy;
|
|
8
|
+
schema: Schema;
|
|
9
|
+
status: DatasetStatus;
|
|
10
|
+
tags: string[];
|
|
11
|
+
updated_at: Date;
|
|
12
|
+
write_mode: DatasetWriteMode;
|
|
13
|
+
}
|
|
14
|
+
type SchemaFileConfigType = 'flat';
|
|
15
|
+
type SchemaPropertiesType = 'string' | 'number' | 'boolean';
|
|
16
|
+
type DatasetStatus = 'active' | 'archived';
|
|
17
|
+
type DatasetWriteMode = 'append' | 'overwrite';
|
|
18
|
+
type RetentionPolicyType = 'retain_everything';
|
|
19
|
+
type SchemaType = 'object' | 'value';
|
|
20
|
+
interface RetentionPolicy {
|
|
21
|
+
type: RetentionPolicyType;
|
|
22
|
+
}
|
|
23
|
+
interface SchemaFileConfig {
|
|
24
|
+
type: SchemaFileConfigType;
|
|
25
|
+
delimiter: string;
|
|
26
|
+
escape: string;
|
|
27
|
+
header: boolean;
|
|
28
|
+
quote: string;
|
|
29
|
+
}
|
|
30
|
+
type SchemaProperties = Record<string, {
|
|
31
|
+
order: number;
|
|
32
|
+
approximate_cardinality: number;
|
|
33
|
+
description?: string;
|
|
34
|
+
type: SchemaPropertiesType;
|
|
35
|
+
}>;
|
|
36
|
+
interface Schema {
|
|
37
|
+
file_config: SchemaFileConfig;
|
|
38
|
+
type: SchemaType;
|
|
39
|
+
properties: SchemaProperties;
|
|
40
|
+
required: string[];
|
|
41
|
+
primary: string;
|
|
42
|
+
}
|
|
43
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/build/health/index.d.ts
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface HealthCheckResult {
|
|
2
|
+
success: boolean;
|
|
3
|
+
checks: CheckResult[];
|
|
4
|
+
}
|
|
5
|
+
export interface CheckResult {
|
|
6
|
+
name: string;
|
|
7
|
+
type: HealthCheckResultType;
|
|
8
|
+
success: boolean;
|
|
9
|
+
error_message?: string | null;
|
|
10
|
+
}
|
|
11
|
+
export type HealthCheckResultType = 'postgresql' | 's3';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/build/index.d.ts
CHANGED
|
@@ -2,8 +2,12 @@ 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';
|
|
6
|
+
import { type Dataset } from './datasets/types';
|
|
7
|
+
import { type HealthCheckResult } from './health/types';
|
|
8
|
+
import { type SampleRecords } from './rosetta-stone/types';
|
|
5
9
|
declare class NarrativeApi extends BaseApi {
|
|
6
10
|
}
|
|
7
11
|
interface NarrativeApi extends BaseApi, HealthCheckApi, DatasetApi, RosettaStoneApi {
|
|
8
12
|
}
|
|
9
|
-
export
|
|
13
|
+
export { NarrativeApi, type Environment, type Config, type ApiRecords, type Dataset, type HealthCheckResult, type SampleRecords };
|
package/build/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/build/types.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment for the API.
|
|
3
|
+
*
|
|
4
|
+
* @typedef {'dev' | 'prod' | string} Environment
|
|
5
|
+
*/
|
|
6
|
+
export type Environment = 'dev' | 'prod' | string;
|
|
7
|
+
/**
|
|
8
|
+
* Configuration object for the BaseApi class.
|
|
9
|
+
*
|
|
10
|
+
* @typedef {Object} Config
|
|
11
|
+
* @property {string} [apiKey] - API key.
|
|
12
|
+
* @property {Environment} [environment='prod'] - Environment for the API (e.g. 'dev', 'prod').
|
|
13
|
+
*/
|
|
14
|
+
export interface Config {
|
|
15
|
+
apiKey?: string;
|
|
16
|
+
environment?: Environment;
|
|
17
|
+
}
|
|
18
|
+
export interface ApiRecords<T> {
|
|
19
|
+
records: T[];
|
|
20
|
+
}
|
package/build/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@narrative.io/data-collaboration-sdk-ts",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"main": "build/index.js",
|
|
5
5
|
"repository": "github:narrative-io/data-collaboration-sdk-ts",
|
|
6
6
|
"source": "src/index.ts",
|
|
7
7
|
"types": "build/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
"types": "./build/index.d.ts"
|
|
10
|
-
},
|
|
11
8
|
"description": "",
|
|
12
9
|
"scripts": {
|
|
13
10
|
"build": "tsc",
|
|
@@ -17,7 +14,7 @@
|
|
|
17
14
|
"preversion": "npm run lint",
|
|
18
15
|
"version": "npm run && git add -A src",
|
|
19
16
|
"postversion": "git push && git push --tags",
|
|
20
|
-
"test": "vitest --coverage"
|
|
17
|
+
"test": "vitest run --coverage"
|
|
21
18
|
},
|
|
22
19
|
"keywords": [],
|
|
23
20
|
"author": "",
|