minikai 1.0.2 → 1.1.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.
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/records/client/Client.d.ts +18 -0
- package/dist/cjs/api/resources/records/client/Client.js +64 -0
- package/dist/cjs/api/resources/records/client/requests/BatchUpdateAttachmentsRequest.d.ts +12 -0
- package/dist/cjs/api/resources/records/client/requests/BatchUpdateAttachmentsRequest.js +3 -0
- package/dist/cjs/api/resources/records/client/requests/index.d.ts +1 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/records/client/Client.d.mts +18 -0
- package/dist/esm/api/resources/records/client/Client.mjs +64 -0
- package/dist/esm/api/resources/records/client/requests/BatchUpdateAttachmentsRequest.d.mts +12 -0
- package/dist/esm/api/resources/records/client/requests/BatchUpdateAttachmentsRequest.mjs +2 -0
- package/dist/esm/api/resources/records/client/requests/index.d.mts +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +66 -0
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "minikai",
|
|
46
|
-
"X-Fern-SDK-Version": "1.0
|
|
47
|
-
"User-Agent": "minikai/1.0
|
|
46
|
+
"X-Fern-SDK-Version": "1.1.0",
|
|
47
|
+
"User-Agent": "minikai/1.1.0",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -226,6 +226,24 @@ export declare class RecordsClient {
|
|
|
226
226
|
*/
|
|
227
227
|
batchAddAttachments(request: Minikai.BatchAddAttachmentsRequest, requestOptions?: RecordsClient.RequestOptions): core.HttpResponsePromise<Minikai.BatchAttachmentResult>;
|
|
228
228
|
private __batchAddAttachments;
|
|
229
|
+
/**
|
|
230
|
+
* Replace the attachments on many Records in one request. Each Record's attachments are overwritten with the files supplied for it, reusing files whose name and checksum already match and removing the rest.
|
|
231
|
+
*
|
|
232
|
+
* @param {Minikai.BatchUpdateAttachmentsRequest} request
|
|
233
|
+
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
234
|
+
*
|
|
235
|
+
* @throws {@link Minikai.BadRequestError}
|
|
236
|
+
* @throws {@link Minikai.UnprocessableEntityError}
|
|
237
|
+
*
|
|
238
|
+
* @example
|
|
239
|
+
* import { createReadStream } from "fs";
|
|
240
|
+
* await client.records.batchUpdateAttachments({
|
|
241
|
+
* files: [fs.createReadStream("/path/to/your/file")],
|
|
242
|
+
* items: "items"
|
|
243
|
+
* })
|
|
244
|
+
*/
|
|
245
|
+
batchUpdateAttachments(request: Minikai.BatchUpdateAttachmentsRequest, requestOptions?: RecordsClient.RequestOptions): core.HttpResponsePromise<Minikai.BatchAttachmentResult>;
|
|
246
|
+
private __batchUpdateAttachments;
|
|
229
247
|
/**
|
|
230
248
|
* @deprecated
|
|
231
249
|
*
|
|
@@ -875,6 +875,70 @@ class RecordsClient {
|
|
|
875
875
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/api/v1/Records/batch/attachments");
|
|
876
876
|
});
|
|
877
877
|
}
|
|
878
|
+
/**
|
|
879
|
+
* Replace the attachments on many Records in one request. Each Record's attachments are overwritten with the files supplied for it, reusing files whose name and checksum already match and removing the rest.
|
|
880
|
+
*
|
|
881
|
+
* @param {Minikai.BatchUpdateAttachmentsRequest} request
|
|
882
|
+
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
883
|
+
*
|
|
884
|
+
* @throws {@link Minikai.BadRequestError}
|
|
885
|
+
* @throws {@link Minikai.UnprocessableEntityError}
|
|
886
|
+
*
|
|
887
|
+
* @example
|
|
888
|
+
* import { createReadStream } from "fs";
|
|
889
|
+
* await client.records.batchUpdateAttachments({
|
|
890
|
+
* files: [fs.createReadStream("/path/to/your/file")],
|
|
891
|
+
* items: "items"
|
|
892
|
+
* })
|
|
893
|
+
*/
|
|
894
|
+
batchUpdateAttachments(request, requestOptions) {
|
|
895
|
+
return core.HttpResponsePromise.fromPromise(this.__batchUpdateAttachments(request, requestOptions));
|
|
896
|
+
}
|
|
897
|
+
__batchUpdateAttachments(request, requestOptions) {
|
|
898
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
899
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
900
|
+
const _body = yield core.newFormData();
|
|
901
|
+
for (const _file of request.files) {
|
|
902
|
+
yield _body.appendFile("files", _file);
|
|
903
|
+
}
|
|
904
|
+
_body.append("items", request.items);
|
|
905
|
+
const _maybeEncodedRequest = yield _body.getRequest();
|
|
906
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
907
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
908
|
+
const _response = yield core.fetcher({
|
|
909
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MinikaiEnvironment.Default, "api/v1/Records/batch/attachments"),
|
|
910
|
+
method: "PUT",
|
|
911
|
+
headers: _headers,
|
|
912
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
913
|
+
requestType: "file",
|
|
914
|
+
duplex: _maybeEncodedRequest.duplex,
|
|
915
|
+
body: _maybeEncodedRequest.body,
|
|
916
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
917
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
918
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
919
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
920
|
+
logging: this._options.logging,
|
|
921
|
+
});
|
|
922
|
+
if (_response.ok) {
|
|
923
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
924
|
+
}
|
|
925
|
+
if (_response.error.reason === "status-code") {
|
|
926
|
+
switch (_response.error.statusCode) {
|
|
927
|
+
case 400:
|
|
928
|
+
throw new Minikai.BadRequestError(_response.error.body, _response.rawResponse);
|
|
929
|
+
case 422:
|
|
930
|
+
throw new Minikai.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
931
|
+
default:
|
|
932
|
+
throw new errors.MinikaiError({
|
|
933
|
+
statusCode: _response.error.statusCode,
|
|
934
|
+
body: _response.error.body,
|
|
935
|
+
rawResponse: _response.rawResponse,
|
|
936
|
+
});
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/api/v1/Records/batch/attachments");
|
|
940
|
+
});
|
|
941
|
+
}
|
|
878
942
|
/**
|
|
879
943
|
* @deprecated
|
|
880
944
|
*
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * as core from "../../../../../core/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* files: [fs.createReadStream("/path/to/your/file")],
|
|
6
|
+
* items: "items"
|
|
7
|
+
* }
|
|
8
|
+
*/
|
|
9
|
+
export interface BatchUpdateAttachmentsRequest {
|
|
10
|
+
files: core.file.Uploadable[];
|
|
11
|
+
items: string;
|
|
12
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type { AddAttachmentsRequest } from "./AddAttachmentsRequest.js";
|
|
2
2
|
export type { BatchAddAttachmentsRequest } from "./BatchAddAttachmentsRequest.js";
|
|
3
|
+
export type { BatchUpdateAttachmentsRequest } from "./BatchUpdateAttachmentsRequest.js";
|
|
3
4
|
export type { BatchUploadRecordsRequest } from "./BatchUploadRecordsRequest.js";
|
|
4
5
|
export type { CreateDraftRecordCommand } from "./CreateDraftRecordCommand.js";
|
|
5
6
|
export type { CreateRecordCommand } from "./CreateRecordCommand.js";
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.0
|
|
1
|
+
export declare const SDK_VERSION = "1.1.0";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "minikai",
|
|
9
|
-
"X-Fern-SDK-Version": "1.0
|
|
10
|
-
"User-Agent": "minikai/1.0
|
|
9
|
+
"X-Fern-SDK-Version": "1.1.0",
|
|
10
|
+
"User-Agent": "minikai/1.1.0",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -226,6 +226,24 @@ export declare class RecordsClient {
|
|
|
226
226
|
*/
|
|
227
227
|
batchAddAttachments(request: Minikai.BatchAddAttachmentsRequest, requestOptions?: RecordsClient.RequestOptions): core.HttpResponsePromise<Minikai.BatchAttachmentResult>;
|
|
228
228
|
private __batchAddAttachments;
|
|
229
|
+
/**
|
|
230
|
+
* Replace the attachments on many Records in one request. Each Record's attachments are overwritten with the files supplied for it, reusing files whose name and checksum already match and removing the rest.
|
|
231
|
+
*
|
|
232
|
+
* @param {Minikai.BatchUpdateAttachmentsRequest} request
|
|
233
|
+
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
234
|
+
*
|
|
235
|
+
* @throws {@link Minikai.BadRequestError}
|
|
236
|
+
* @throws {@link Minikai.UnprocessableEntityError}
|
|
237
|
+
*
|
|
238
|
+
* @example
|
|
239
|
+
* import { createReadStream } from "fs";
|
|
240
|
+
* await client.records.batchUpdateAttachments({
|
|
241
|
+
* files: [fs.createReadStream("/path/to/your/file")],
|
|
242
|
+
* items: "items"
|
|
243
|
+
* })
|
|
244
|
+
*/
|
|
245
|
+
batchUpdateAttachments(request: Minikai.BatchUpdateAttachmentsRequest, requestOptions?: RecordsClient.RequestOptions): core.HttpResponsePromise<Minikai.BatchAttachmentResult>;
|
|
246
|
+
private __batchUpdateAttachments;
|
|
229
247
|
/**
|
|
230
248
|
* @deprecated
|
|
231
249
|
*
|
|
@@ -839,6 +839,70 @@ export class RecordsClient {
|
|
|
839
839
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/v1/Records/batch/attachments");
|
|
840
840
|
});
|
|
841
841
|
}
|
|
842
|
+
/**
|
|
843
|
+
* Replace the attachments on many Records in one request. Each Record's attachments are overwritten with the files supplied for it, reusing files whose name and checksum already match and removing the rest.
|
|
844
|
+
*
|
|
845
|
+
* @param {Minikai.BatchUpdateAttachmentsRequest} request
|
|
846
|
+
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
847
|
+
*
|
|
848
|
+
* @throws {@link Minikai.BadRequestError}
|
|
849
|
+
* @throws {@link Minikai.UnprocessableEntityError}
|
|
850
|
+
*
|
|
851
|
+
* @example
|
|
852
|
+
* import { createReadStream } from "fs";
|
|
853
|
+
* await client.records.batchUpdateAttachments({
|
|
854
|
+
* files: [fs.createReadStream("/path/to/your/file")],
|
|
855
|
+
* items: "items"
|
|
856
|
+
* })
|
|
857
|
+
*/
|
|
858
|
+
batchUpdateAttachments(request, requestOptions) {
|
|
859
|
+
return core.HttpResponsePromise.fromPromise(this.__batchUpdateAttachments(request, requestOptions));
|
|
860
|
+
}
|
|
861
|
+
__batchUpdateAttachments(request, requestOptions) {
|
|
862
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
863
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
864
|
+
const _body = yield core.newFormData();
|
|
865
|
+
for (const _file of request.files) {
|
|
866
|
+
yield _body.appendFile("files", _file);
|
|
867
|
+
}
|
|
868
|
+
_body.append("items", request.items);
|
|
869
|
+
const _maybeEncodedRequest = yield _body.getRequest();
|
|
870
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
871
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
872
|
+
const _response = yield core.fetcher({
|
|
873
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MinikaiEnvironment.Default, "api/v1/Records/batch/attachments"),
|
|
874
|
+
method: "PUT",
|
|
875
|
+
headers: _headers,
|
|
876
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
877
|
+
requestType: "file",
|
|
878
|
+
duplex: _maybeEncodedRequest.duplex,
|
|
879
|
+
body: _maybeEncodedRequest.body,
|
|
880
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
881
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
882
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
883
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
884
|
+
logging: this._options.logging,
|
|
885
|
+
});
|
|
886
|
+
if (_response.ok) {
|
|
887
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
888
|
+
}
|
|
889
|
+
if (_response.error.reason === "status-code") {
|
|
890
|
+
switch (_response.error.statusCode) {
|
|
891
|
+
case 400:
|
|
892
|
+
throw new Minikai.BadRequestError(_response.error.body, _response.rawResponse);
|
|
893
|
+
case 422:
|
|
894
|
+
throw new Minikai.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
895
|
+
default:
|
|
896
|
+
throw new errors.MinikaiError({
|
|
897
|
+
statusCode: _response.error.statusCode,
|
|
898
|
+
body: _response.error.body,
|
|
899
|
+
rawResponse: _response.rawResponse,
|
|
900
|
+
});
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/api/v1/Records/batch/attachments");
|
|
904
|
+
});
|
|
905
|
+
}
|
|
842
906
|
/**
|
|
843
907
|
* @deprecated
|
|
844
908
|
*
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * as core from "../../../../../core/index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* files: [fs.createReadStream("/path/to/your/file")],
|
|
6
|
+
* items: "items"
|
|
7
|
+
* }
|
|
8
|
+
*/
|
|
9
|
+
export interface BatchUpdateAttachmentsRequest {
|
|
10
|
+
files: core.file.Uploadable[];
|
|
11
|
+
items: string;
|
|
12
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type { AddAttachmentsRequest } from "./AddAttachmentsRequest.mjs";
|
|
2
2
|
export type { BatchAddAttachmentsRequest } from "./BatchAddAttachmentsRequest.mjs";
|
|
3
|
+
export type { BatchUpdateAttachmentsRequest } from "./BatchUpdateAttachmentsRequest.mjs";
|
|
3
4
|
export type { BatchUploadRecordsRequest } from "./BatchUploadRecordsRequest.mjs";
|
|
4
5
|
export type { CreateDraftRecordCommand } from "./CreateDraftRecordCommand.mjs";
|
|
5
6
|
export type { CreateRecordCommand } from "./CreateRecordCommand.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.0
|
|
1
|
+
export declare const SDK_VERSION = "1.1.0";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "1.0
|
|
1
|
+
export const SDK_VERSION = "1.1.0";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -2174,6 +2174,72 @@ await client.records.batchAddAttachments({
|
|
|
2174
2174
|
</dl>
|
|
2175
2175
|
|
|
2176
2176
|
|
|
2177
|
+
</dd>
|
|
2178
|
+
</dl>
|
|
2179
|
+
</details>
|
|
2180
|
+
|
|
2181
|
+
<details><summary><code>client.records.<a href="/src/api/resources/records/client/Client.ts">batchUpdateAttachments</a>({ ...params }) -> Minikai.BatchAttachmentResult</code></summary>
|
|
2182
|
+
<dl>
|
|
2183
|
+
<dd>
|
|
2184
|
+
|
|
2185
|
+
#### 📝 Description
|
|
2186
|
+
|
|
2187
|
+
<dl>
|
|
2188
|
+
<dd>
|
|
2189
|
+
|
|
2190
|
+
<dl>
|
|
2191
|
+
<dd>
|
|
2192
|
+
|
|
2193
|
+
Replace the attachments on many Records in one request. Each Record's attachments are overwritten with the files supplied for it, reusing files whose name and checksum already match and removing the rest.
|
|
2194
|
+
</dd>
|
|
2195
|
+
</dl>
|
|
2196
|
+
</dd>
|
|
2197
|
+
</dl>
|
|
2198
|
+
|
|
2199
|
+
#### 🔌 Usage
|
|
2200
|
+
|
|
2201
|
+
<dl>
|
|
2202
|
+
<dd>
|
|
2203
|
+
|
|
2204
|
+
<dl>
|
|
2205
|
+
<dd>
|
|
2206
|
+
|
|
2207
|
+
```typescript
|
|
2208
|
+
await client.records.batchUpdateAttachments({
|
|
2209
|
+
files: [fs.createReadStream("/path/to/your/file")],
|
|
2210
|
+
items: "items"
|
|
2211
|
+
});
|
|
2212
|
+
|
|
2213
|
+
```
|
|
2214
|
+
</dd>
|
|
2215
|
+
</dl>
|
|
2216
|
+
</dd>
|
|
2217
|
+
</dl>
|
|
2218
|
+
|
|
2219
|
+
#### ⚙️ Parameters
|
|
2220
|
+
|
|
2221
|
+
<dl>
|
|
2222
|
+
<dd>
|
|
2223
|
+
|
|
2224
|
+
<dl>
|
|
2225
|
+
<dd>
|
|
2226
|
+
|
|
2227
|
+
**request:** `Minikai.BatchUpdateAttachmentsRequest`
|
|
2228
|
+
|
|
2229
|
+
</dd>
|
|
2230
|
+
</dl>
|
|
2231
|
+
|
|
2232
|
+
<dl>
|
|
2233
|
+
<dd>
|
|
2234
|
+
|
|
2235
|
+
**requestOptions:** `RecordsClient.RequestOptions`
|
|
2236
|
+
|
|
2237
|
+
</dd>
|
|
2238
|
+
</dl>
|
|
2239
|
+
</dd>
|
|
2240
|
+
</dl>
|
|
2241
|
+
|
|
2242
|
+
|
|
2177
2243
|
</dd>
|
|
2178
2244
|
</dl>
|
|
2179
2245
|
</details>
|