node-s3tables 0.0.6 → 0.0.7

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/README.md CHANGED
@@ -81,10 +81,10 @@ Adds a new schema to an S3 table and sets it as current.
81
81
  - `params.fields` (IcebergSchemaField[]) - Array of schema fields
82
82
  - `params.credentials` (AwsCredentialIdentity, optional) - AWS credentials
83
83
 
84
- **Returns:** Promise<string>
84
+ **Returns:** Promise<IcebergUpdateResponse>
85
85
 
86
86
  ```javascript
87
- await addSchema({
87
+ const result = await addSchema({
88
88
  tableBucketARN: 'arn:aws:s3tables:us-west-2:123456789012:bucket/my-bucket',
89
89
  namespace: 'sales',
90
90
  name: 'daily_sales',
@@ -95,6 +95,9 @@ await addSchema({
95
95
  { id: 3, name: 'sales_amount', required: false, type: 'double' },
96
96
  ],
97
97
  });
98
+
99
+ // result.metadata contains the updated table metadata
100
+ // result['metadata-location'] contains the S3 path to the new metadata file
98
101
  ```
99
102
 
100
103
  ### addPartitionSpec(params)
@@ -110,7 +113,7 @@ Adds a new partition specification to an S3 table and sets it as default.
110
113
  - `params.fields` (IcebergPartitionField[]) - Array of partition fields
111
114
  - `params.credentials` (AwsCredentialIdentity, optional) - AWS credentials
112
115
 
113
- **Returns:** Promise<string>
116
+ **Returns:** Promise<IcebergUpdateResponse>
114
117
 
115
118
  ```javascript
116
119
  await addPartitionSpec({
@@ -232,6 +235,15 @@ await setCurrentCommit({
232
235
 
233
236
  ## Type Definitions
234
237
 
238
+ ### IcebergUpdateResponse
239
+
240
+ ```typescript
241
+ interface IcebergUpdateResponse {
242
+ metadata: IcebergMetadata;
243
+ 'metadata-location': string;
244
+ }
245
+ ```
246
+
235
247
  ### AddFileList
236
248
 
237
249
  ```typescript
package/dist/index.d.ts CHANGED
@@ -119,13 +119,6 @@ interface AddManifestParams {
119
119
  }
120
120
  declare function addManifest(params: AddManifestParams): Promise<ManifestListRecord>;
121
121
 
122
- type JSONPrimitive = string | number | boolean | null | bigint | undefined;
123
- type JSONValue = JSONPrimitive | JSONObject | JSONArray;
124
- interface JSONObject {
125
- [key: string]: JSONValue;
126
- }
127
- type JSONArray = JSONValue[];
128
-
129
122
  type TableLocation = {
130
123
  tableArn: string;
131
124
  } | {
@@ -146,7 +139,11 @@ interface AddSchemaParams {
146
139
  schemaId: number;
147
140
  fields: IcebergSchemaField[];
148
141
  }
149
- declare function addSchema(params: AddSchemaParams): Promise<JSONObject>;
142
+ interface IcebergUpdateResponse {
143
+ metadata: IcebergMetadata;
144
+ 'metadata-location': string;
145
+ }
146
+ declare function addSchema(params: AddSchemaParams): Promise<IcebergUpdateResponse>;
150
147
  interface AddPartitionSpecParams {
151
148
  credentials?: AwsCredentialIdentity;
152
149
  tableBucketARN: string;
@@ -155,7 +152,14 @@ interface AddPartitionSpecParams {
155
152
  specId: number;
156
153
  fields: IcebergPartitionField[];
157
154
  }
158
- declare function addPartitionSpec(params: AddPartitionSpecParams): Promise<JSONObject>;
155
+ declare function addPartitionSpec(params: AddPartitionSpecParams): Promise<IcebergUpdateResponse>;
156
+
157
+ type JSONPrimitive = string | number | boolean | null | bigint | undefined;
158
+ type JSONValue = JSONPrimitive | JSONObject | JSONArray;
159
+ interface JSONObject {
160
+ [key: string]: JSONValue;
161
+ }
162
+ type JSONArray = JSONValue[];
159
163
 
160
164
  interface AddFileList {
161
165
  specId: number;
@@ -205,4 +209,4 @@ declare const _default: {
205
209
  };
206
210
 
207
211
  export { IcebergHttpError, addDataFiles, addManifest, addPartitionSpec, addSchema, _default as default, getMetadata, setCurrentCommit };
208
- export type { AddDataFilesParams, AddDataFilesResult, AddFile, AddFileList, AddManifestParams, AddPartitionSpecParams, AddSchemaParams, GetMetadataParams, IcebergComplexType, IcebergMetadata, IcebergPartitionField, IcebergPartitionSpec, IcebergPrimitiveType, IcebergSchema, IcebergSchemaField, IcebergSnapshot, IcebergSnapshotSummary, IcebergTransform, IcebergType, SetCurrentCommitParams, TableLocation };
212
+ export type { AddDataFilesParams, AddDataFilesResult, AddFile, AddFileList, AddManifestParams, AddPartitionSpecParams, AddSchemaParams, GetMetadataParams, IcebergComplexType, IcebergMetadata, IcebergPartitionField, IcebergPartitionSpec, IcebergPrimitiveType, IcebergSchema, IcebergSchemaField, IcebergSnapshot, IcebergSnapshotSummary, IcebergTransform, IcebergType, IcebergUpdateResponse, SetCurrentCommitParams, TableLocation };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-s3tables",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "node api for dealing with s3tables",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",