@narrative.io/data-collaboration-sdk-ts 2.13.0 → 2.15.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.
@@ -73,7 +73,6 @@ export interface DatasetTableSummaryAPIResponse {
73
73
  dataset_id: number;
74
74
  records: DatasetTableSummary[];
75
75
  }
76
- export type SchemaFileConfigType = "flat" | "json" | "parquet";
77
76
  export type SchemaPropertiesType = "string" | "boolean" | "double" | "long" | "timestamptz" | "object" | "array";
78
77
  export type DatasetStatus = "active" | "archived" | "pending";
79
78
  export type DatasetWriteMode = "append" | "overwrite";
@@ -96,13 +95,22 @@ export type RetentionPolicy = {
96
95
  period: string;
97
96
  };
98
97
  };
99
- export interface SchemaFileConfig {
100
- type: SchemaFileConfigType;
98
+ export type SchemaFileConfigType = "flat" | "json" | "parquet";
99
+ export interface FlatFileConfig {
100
+ type: "flat";
101
101
  delimiter?: string;
102
102
  escape?: string;
103
103
  header?: boolean;
104
104
  quote?: string;
105
105
  }
106
+ export interface JsonFileConfig {
107
+ type: "json";
108
+ normalize_field_names?: boolean;
109
+ }
110
+ export interface ParquetFileConfig {
111
+ type: "parquet";
112
+ }
113
+ export type SchemaFileConfig = FlatFileConfig | JsonFileConfig | ParquetFileConfig;
106
114
  export type SchemaProperties = Record<string, SchemaProperty>;
107
115
  export type SchemaProperty = SchemaPrimitiveProperty | SchemaArrayProperty | SchemaObjectProperty;
108
116
  export interface SchemaPrimitiveProperty {
@@ -82,6 +82,15 @@ declare class MappingsApi extends BaseApi {
82
82
  * @async
83
83
  */
84
84
  rejectMapping(mappingId: string): Promise<void>;
85
+ /**
86
+ * Promotes a mapping to global scope.
87
+ *
88
+ * @param {string} mappingId - The ID of the mapping to promote.
89
+ * @returns {Promise<void>} A promise that resolves when the mapping is succesfully promoted.
90
+ * @public
91
+ * @async
92
+ */
93
+ promoteMapping(mappingId: string): Promise<void>;
85
94
  /**
86
95
  * Updates a mapping.
87
96
  *
@@ -118,6 +118,17 @@ class MappingsApi extends BaseApi {
118
118
  async rejectMapping(mappingId) {
119
119
  await this.post(`${resourceName}/${mappingId}/reject`);
120
120
  }
121
+ /**
122
+ * Promotes a mapping to global scope.
123
+ *
124
+ * @param {string} mappingId - The ID of the mapping to promote.
125
+ * @returns {Promise<void>} A promise that resolves when the mapping is succesfully promoted.
126
+ * @public
127
+ * @async
128
+ */
129
+ async promoteMapping(mappingId) {
130
+ await this.post(`${resourceName}/${mappingId}/promote`);
131
+ }
121
132
  /**
122
133
  * Updates a mapping.
123
134
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@narrative.io/data-collaboration-sdk-ts",
3
- "version": "2.13.0",
3
+ "version": "2.15.0",
4
4
  "main": "build/index.js",
5
5
  "repository": "github:narrative-io/data-collaboration-sdk-ts",
6
6
  "source": "src/index.ts",
@@ -20,17 +20,17 @@
20
20
  "author": "",
21
21
  "license": "ISC",
22
22
  "devDependencies": {
23
- "@babel/core": "7.24.6",
24
- "@babel/preset-env": "7.24.6",
25
- "@babel/preset-typescript": "7.24.6",
26
- "@biomejs/biome": "1.7.3",
23
+ "@babel/core": "7.24.9",
24
+ "@babel/preset-env": "7.24.8",
25
+ "@babel/preset-typescript": "7.24.7",
26
+ "@biomejs/biome": "1.8.3",
27
27
  "@commitlint/cli": "19.3.0",
28
28
  "@commitlint/config-conventional": "19.2.2",
29
29
  "@types/jest": "29.5.12",
30
30
  "babel-jest": "29.7.0",
31
31
  "jest": "29.7.0",
32
- "lefthook": "1.6.15",
33
- "ts-jest": "29.1.4"
32
+ "lefthook": "1.7.5",
33
+ "ts-jest": "29.2.3"
34
34
  },
35
35
  "dependencies": {
36
36
  "mande": "2.0.9",