@narrative.io/data-collaboration-sdk-ts 0.0.24 → 0.0.25

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,11 @@
1
+ import { type ApiRecords } from 'src/types';
2
+ import { BaseApi } from '../base-api';
3
+ import { type Mapping } from './types';
4
+ /**
5
+ * A class for accessing the Mappings API.
6
+ * @extends BaseApi
7
+ */
8
+ declare class MappingsApi extends BaseApi {
9
+ getMappings(): Promise<ApiRecords<Mapping>>;
10
+ }
11
+ export { type Mapping, MappingsApi };
@@ -0,0 +1,18 @@
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 = 'mappings';
9
+ /**
10
+ * A class for accessing the Mappings API.
11
+ * @extends BaseApi
12
+ */
13
+ class MappingsApi extends BaseApi {
14
+ async getMappings() {
15
+ return await this.get(resourceName);
16
+ }
17
+ }
18
+ export { MappingsApi };
@@ -0,0 +1,31 @@
1
+ export interface Mapping {
2
+ id: string;
3
+ attribute_id: number;
4
+ created_at: string;
5
+ dataset_id: number;
6
+ mapping: ObjectMapping | ValueMapping;
7
+ status: MappingStatus;
8
+ updated_at: string;
9
+ created_by: number;
10
+ updated_by: number;
11
+ company_id: number;
12
+ scope: MappingScope;
13
+ source: MappingSource;
14
+ derived_from: string;
15
+ }
16
+ type MappingStatus = 'active' | 'archived' | 'pending';
17
+ type MappingScope = 'global' | 'private';
18
+ type MappingSource = 'system' | 'admin' | 'company';
19
+ interface PropertyMapping {
20
+ path: string;
21
+ expression: string;
22
+ }
23
+ interface ObjectMapping {
24
+ type: 'object_mapping';
25
+ property_mappings: PropertyMapping[];
26
+ }
27
+ interface ValueMapping {
28
+ type: 'value_mapping';
29
+ expression: string;
30
+ }
31
+ export {};
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@narrative.io/data-collaboration-sdk-ts",
3
- "version": "0.0.24",
3
+ "version": "0.0.25",
4
4
  "main": "build/index.js",
5
5
  "repository": "github:narrative-io/data-collaboration-sdk-ts",
6
6
  "source": "src/index.ts",