@narrative.io/data-collaboration-sdk-ts 0.0.13 → 0.0.15

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.
@@ -0,0 +1,6 @@
1
+ import { type ApiRecords } from '../types';
2
+ import { BaseApi } from '../base-api';
3
+ import { type Attribute } from './types';
4
+ export declare class AttributeApi extends BaseApi {
5
+ getAttributes(): Promise<ApiRecords<Attribute>>;
6
+ }
@@ -0,0 +1,7 @@
1
+ import { BaseApi } from '../base-api';
2
+ const resourceName = 'attributes';
3
+ export class AttributeApi extends BaseApi {
4
+ async getAttributes() {
5
+ return await this.get(resourceName);
6
+ }
7
+ }
@@ -0,0 +1,17 @@
1
+ export interface Attribute {
2
+ id: number;
3
+ name: string;
4
+ description?: string;
5
+ display_name: string;
6
+ type: string;
7
+ enum?: string[] | number[];
8
+ validations?: string[];
9
+ properties?: Record<string, {
10
+ type: string;
11
+ description?: string;
12
+ validations?: string[];
13
+ enum?: string[];
14
+ items?: unknown;
15
+ }>;
16
+ required?: string[];
17
+ }
@@ -0,0 +1 @@
1
+ export {};
package/build/index.d.ts CHANGED
@@ -6,8 +6,10 @@ import { type Environment, type Config, type ApiRecords } 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
+ import { AttributeApi } from './attributes';
10
+ import { type Attribute } from './attributes/types';
9
11
  declare class NarrativeApi extends BaseApi {
10
12
  }
11
- interface NarrativeApi extends BaseApi, HealthCheckApi, DatasetApi, RosettaStoneApi {
13
+ interface NarrativeApi extends BaseApi, HealthCheckApi, DatasetApi, RosettaStoneApi, AttributeApi {
12
14
  }
13
- export { NarrativeApi, type Environment, type Config, type ApiRecords, type Dataset, type HealthCheckResult, type SampleRecords, type DatasetTableSummary, type DatasetTableSummaryAPIResponse };
15
+ export { NarrativeApi, AttributeApi, HealthCheckApi, DatasetApi, type Attribute, type Environment, type Config, type ApiRecords, type Dataset, type HealthCheckResult, type SampleRecords, type DatasetTableSummary, type DatasetTableSummaryAPIResponse };
package/build/index.js CHANGED
@@ -3,7 +3,8 @@ import { DatasetApi } from './datasets';
3
3
  import { HealthCheckApi } from './health';
4
4
  import { RosettaStoneApi } from './rosetta-stone';
5
5
  import { applyMixins } from './utils';
6
+ import { AttributeApi } from './attributes';
6
7
  class NarrativeApi extends BaseApi {
7
8
  }
8
- applyMixins(NarrativeApi, [BaseApi, HealthCheckApi, DatasetApi, RosettaStoneApi]);
9
- export { NarrativeApi };
9
+ applyMixins(NarrativeApi, [BaseApi, HealthCheckApi, DatasetApi, RosettaStoneApi, AttributeApi]);
10
+ export { NarrativeApi, AttributeApi, HealthCheckApi, DatasetApi };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@narrative.io/data-collaboration-sdk-ts",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "main": "build/index.js",
5
5
  "repository": "github:narrative-io/data-collaboration-sdk-ts",
6
6
  "source": "src/index.ts",
@@ -27,10 +27,9 @@
27
27
  "eslint-plugin-import": "^2.27.5",
28
28
  "eslint-plugin-n": "^15.6.1",
29
29
  "eslint-plugin-promise": "^6.1.1",
30
- "microbundle": "^0.15.1",
30
+ "msw": "^1.0.1",
31
31
  "typescript": "^4.9.5",
32
- "vitest": "^0.28.4",
33
- "msw": "^1.0.1"
32
+ "vitest": "^0.28.4"
34
33
  },
35
34
  "dependencies": {
36
35
  "mande": "^2.0.3"