diff --git a/reference.md b/reference.md index b91211987..70e0fa24a 100644 --- a/reference.md +++ b/reference.md @@ -10472,7 +10472,7 @@ await client.accounting.expenses.retrieve("id", { -
client.accounting.expenses.asyncBulkCreate({ ...params }) -> Merge.AsyncBulkCreateResponse +
client.accounting.expenses.bulkCreate({ ...params }) -> Merge.AsyncBulkCreateResponse
@@ -10484,7 +10484,7 @@ await client.accounting.expenses.retrieve("id", {
-Creates an `Expense` object with the given values. +Creates multiple `Expense` objects with the given values.
@@ -10499,9 +10499,7 @@ Creates an `Expense` object with the given values.
```typescript -await client.accounting.expenses.asyncBulkCreate({ - isDebugMode: true, - runAsync: true, +await client.accounting.expenses.bulkCreate({ batchItems: [{ itemId: "item_id", payload: {} @@ -10542,7 +10540,7 @@ await client.accounting.expenses.asyncBulkCreate({
-
client.accounting.expenses.batchObjectsList(batch_id, { ...params }) -> Merge.BatchObjectsResponse +
client.accounting.expenses.bulkRetrieve(batch_id) -> Merge.BatchObjectsResponse
@@ -10554,7 +10552,7 @@ await client.accounting.expenses.asyncBulkCreate({
-Returns a list of `Expense` objects. +Returns the status and results of an `Expense` bulk create batch.
@@ -10569,22 +10567,7 @@ Returns a list of `Expense` objects.
```typescript -await client.accounting.expenses.batchObjectsList("batch_id", { - companyId: "company_id", - createdAfter: new Date("2024-01-15T09:30:00.000Z"), - createdBefore: new Date("2024-01-15T09:30:00.000Z"), - cursor: "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", - includeDeletedData: true, - includeRemoteData: true, - includeRemoteFields: true, - includeShellData: true, - modifiedAfter: new Date("2024-01-15T09:30:00.000Z"), - modifiedBefore: new Date("2024-01-15T09:30:00.000Z"), - pageSize: 1, - remoteId: "remote_id", - transactionDateAfter: new Date("2024-01-15T09:30:00.000Z"), - transactionDateBefore: new Date("2024-01-15T09:30:00.000Z") -}); +await client.accounting.expenses.bulkRetrieve("batch_id"); ```
@@ -10608,14 +10591,6 @@ await client.accounting.expenses.batchObjectsList("batch_id", {
-**request:** `Merge.accounting.ExpensesBatchObjectsListRequest` - -
-
- -
-
- **requestOptions:** `ExpensesClient.RequestOptions`
@@ -12017,7 +11992,7 @@ await client.accounting.invoices.partialUpdate("id", {
-
client.accounting.invoices.asyncBulkCreate({ ...params }) -> Merge.AsyncBulkCreateResponse +
client.accounting.invoices.bulkCreate({ ...params }) -> Merge.AsyncBulkCreateResponse
@@ -12029,9 +12004,7 @@ await client.accounting.invoices.partialUpdate("id", {
-Creates an `Invoice` object with the given values. - Including a `PurchaseOrder` id in the `purchase_orders` property will generate an Accounts Payable Invoice from the specified Purchase Order(s). - +Creates multiple `Invoice` objects with the given values.
@@ -12046,9 +12019,7 @@ Creates an `Invoice` object with the given values.
```typescript -await client.accounting.invoices.asyncBulkCreate({ - isDebugMode: true, - runAsync: true, +await client.accounting.invoices.bulkCreate({ batchItems: [{ itemId: "item_id", payload: {} @@ -12089,7 +12060,7 @@ await client.accounting.invoices.asyncBulkCreate({
-
client.accounting.invoices.batchObjectsList(batch_id, { ...params }) -> Merge.BatchObjectsResponse +
client.accounting.invoices.bulkRetrieve(batch_id) -> Merge.BatchObjectsResponse
@@ -12101,7 +12072,7 @@ await client.accounting.invoices.asyncBulkCreate({
-Returns a list of `Invoice` objects. +Returns the status and results of an `Invoice` bulk create batch.
@@ -12116,28 +12087,7 @@ Returns a list of `Invoice` objects.
```typescript -await client.accounting.invoices.batchObjectsList("batch_id", { - companyId: "company_id", - contactId: "contact_id", - createdAfter: new Date("2024-01-15T09:30:00.000Z"), - createdBefore: new Date("2024-01-15T09:30:00.000Z"), - cursor: "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", - includeDeletedData: true, - includeRemoteData: true, - includeRemoteFields: true, - includeShellData: true, - issueDateAfter: new Date("2024-01-15T09:30:00.000Z"), - issueDateBefore: new Date("2024-01-15T09:30:00.000Z"), - modifiedAfter: new Date("2024-01-15T09:30:00.000Z"), - modifiedBefore: new Date("2024-01-15T09:30:00.000Z"), - number: "number", - pageSize: 1, - remoteFields: "type", - remoteId: "remote_id", - showEnumOrigins: "type", - status: "DRAFT", - type: "ACCOUNTS_PAYABLE" -}); +await client.accounting.invoices.bulkRetrieve("batch_id"); ```
@@ -12161,14 +12111,6 @@ await client.accounting.invoices.batchObjectsList("batch_id", {
-**request:** `Merge.accounting.InvoicesBatchObjectsListRequest` - -
-
- -
-
- **requestOptions:** `InvoicesClient.RequestOptions`
@@ -12888,7 +12830,7 @@ await client.accounting.itemFulfillments.retrieve("id", {
-
client.accounting.itemFulfillments.asyncBulkCreate({ ...params }) -> Merge.AsyncBulkCreateResponse +
client.accounting.itemFulfillments.bulkCreate({ ...params }) -> Merge.AsyncBulkCreateResponse
@@ -12900,7 +12842,7 @@ await client.accounting.itemFulfillments.retrieve("id", {
-Creates an `ItemFulfillment` object with the given values. +Creates multiple `ItemFulfillment` objects with the given values.
@@ -12915,9 +12857,7 @@ Creates an `ItemFulfillment` object with the given values.
```typescript -await client.accounting.itemFulfillments.asyncBulkCreate({ - isDebugMode: true, - runAsync: true, +await client.accounting.itemFulfillments.bulkCreate({ batchItems: [{ itemId: "item_id", payload: {} @@ -12958,7 +12898,7 @@ await client.accounting.itemFulfillments.asyncBulkCreate({
-
client.accounting.itemFulfillments.batchObjectsList(batch_id, { ...params }) -> Merge.BatchObjectsResponse +
client.accounting.itemFulfillments.bulkRetrieve(batch_id) -> Merge.BatchObjectsResponse
@@ -12970,7 +12910,7 @@ await client.accounting.itemFulfillments.asyncBulkCreate({
-Returns a list of `ItemFulfillment` objects. +Returns the status and results of an `ItemFulfillment` bulk create batch.
@@ -12985,16 +12925,7 @@ Returns a list of `ItemFulfillment` objects.
```typescript -await client.accounting.itemFulfillments.batchObjectsList("batch_id", { - cursor: "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", - includeDeletedData: true, - includeRemoteData: true, - includeRemoteFields: true, - includeShellData: true, - pageSize: 1, - remoteFields: "status", - showEnumOrigins: "status" -}); +await client.accounting.itemFulfillments.bulkRetrieve("batch_id"); ```
@@ -13018,14 +12949,6 @@ await client.accounting.itemFulfillments.batchObjectsList("batch_id", {
-**request:** `Merge.accounting.ItemFulfillmentsBatchObjectsListRequest` - -
-
- -
-
- **requestOptions:** `ItemFulfillmentsClient.RequestOptions`
@@ -16453,7 +16376,7 @@ await client.accounting.salesOrders.retrieve("id", {
-
client.accounting.salesOrders.asyncBulkCreate({ ...params }) -> Merge.AsyncBulkCreateResponse +
client.accounting.salesOrders.bulkCreate({ ...params }) -> Merge.AsyncBulkCreateResponse
@@ -16465,7 +16388,7 @@ await client.accounting.salesOrders.retrieve("id", {
-Creates a `SalesOrder` object with the given values. +Creates multiple `SalesOrder` objects with the given values.
@@ -16480,9 +16403,7 @@ Creates a `SalesOrder` object with the given values.
```typescript -await client.accounting.salesOrders.asyncBulkCreate({ - isDebugMode: true, - runAsync: true, +await client.accounting.salesOrders.bulkCreate({ batchItems: [{ itemId: "item_id", payload: {} @@ -16523,7 +16444,7 @@ await client.accounting.salesOrders.asyncBulkCreate({
-
client.accounting.salesOrders.batchObjectsList(batch_id, { ...params }) -> Merge.BatchObjectsResponse +
client.accounting.salesOrders.bulkRetrieve(batch_id) -> Merge.BatchObjectsResponse
@@ -16535,7 +16456,7 @@ await client.accounting.salesOrders.asyncBulkCreate({
-Returns a list of `SalesOrder` objects. +Returns the status and results of a `SalesOrder` bulk create batch.
@@ -16550,24 +16471,7 @@ Returns a list of `SalesOrder` objects.
```typescript -await client.accounting.salesOrders.batchObjectsList("batch_id", { - companyId: "company_id", - createdAfter: new Date("2024-01-15T09:30:00.000Z"), - createdBefore: new Date("2024-01-15T09:30:00.000Z"), - cursor: "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", - includeDeletedData: true, - includeRemoteData: true, - includeRemoteFields: true, - includeShellData: true, - issueDateAfter: new Date("2024-01-15T09:30:00.000Z"), - issueDateBefore: new Date("2024-01-15T09:30:00.000Z"), - modifiedAfter: new Date("2024-01-15T09:30:00.000Z"), - modifiedBefore: new Date("2024-01-15T09:30:00.000Z"), - pageSize: 1, - remoteFields: "status", - remoteId: "remote_id", - showEnumOrigins: "status" -}); +await client.accounting.salesOrders.bulkRetrieve("batch_id"); ```
@@ -16591,14 +16495,6 @@ await client.accounting.salesOrders.batchObjectsList("batch_id", {
-**request:** `Merge.accounting.SalesOrdersBatchObjectsListRequest` - -
-
- -
-
- **requestOptions:** `SalesOrdersClient.RequestOptions`
diff --git a/src/api/resources/accounting/resources/expenses/client/Client.ts b/src/api/resources/accounting/resources/expenses/client/Client.ts index 0d2409e50..929f3e328 100644 --- a/src/api/resources/accounting/resources/expenses/client/Client.ts +++ b/src/api/resources/accounting/resources/expenses/client/Client.ts @@ -335,37 +335,30 @@ export class ExpensesClient { } /** - * Creates an `Expense` object with the given values. + * Creates multiple `Expense` objects with the given values. * * @param {Merge.accounting.ExpenseBulkRequest} request * @param {ExpensesClient.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.accounting.expenses.asyncBulkCreate({ - * isDebugMode: true, - * runAsync: true, + * await client.accounting.expenses.bulkCreate({ * batchItems: [{ * itemId: "item_id", * payload: {} * }] * }) */ - public asyncBulkCreate( + public bulkCreate( request: Merge.accounting.ExpenseBulkRequest, requestOptions?: ExpensesClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__asyncBulkCreate(request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__bulkCreate(request, requestOptions)); } - private async __asyncBulkCreate( + private async __bulkCreate( request: Merge.accounting.ExpenseBulkRequest, requestOptions?: ExpensesClient.RequestOptions, ): Promise> { - const { isDebugMode, runAsync, ..._body } = request; - const _queryParams: Record = { - is_debug_mode: isDebugMode, - run_async: runAsync, - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -378,14 +371,14 @@ export class ExpensesClient { (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.MergeEnvironment.Production, - "accounting/v1/expenses/async/bulk", + "accounting/v1/expenses/bulk", ), method: "POST", headers: _headers, contentType: "application/json", - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.accounting.ExpenseBulkRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }), + body: serializers.accounting.ExpenseBulkRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -413,96 +406,29 @@ export class ExpensesClient { }); } - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "POST", - "/accounting/v1/expenses/async/bulk", - ); + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/accounting/v1/expenses/bulk"); } /** - * Returns a list of `Expense` objects. + * Returns the status and results of an `Expense` bulk create batch. * * @param {string} batch_id - * @param {Merge.accounting.ExpensesBatchObjectsListRequest} request * @param {ExpensesClient.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.accounting.expenses.batchObjectsList("batch_id", { - * companyId: "company_id", - * createdAfter: new Date("2024-01-15T09:30:00.000Z"), - * createdBefore: new Date("2024-01-15T09:30:00.000Z"), - * cursor: "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", - * includeDeletedData: true, - * includeRemoteData: true, - * includeRemoteFields: true, - * includeShellData: true, - * modifiedAfter: new Date("2024-01-15T09:30:00.000Z"), - * modifiedBefore: new Date("2024-01-15T09:30:00.000Z"), - * pageSize: 1, - * remoteId: "remote_id", - * transactionDateAfter: new Date("2024-01-15T09:30:00.000Z"), - * transactionDateBefore: new Date("2024-01-15T09:30:00.000Z") - * }) + * await client.accounting.expenses.bulkRetrieve("batch_id") */ - public batchObjectsList( + public bulkRetrieve( batch_id: string, - request: Merge.accounting.ExpensesBatchObjectsListRequest = {}, requestOptions?: ExpensesClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__batchObjectsList(batch_id, request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__bulkRetrieve(batch_id, requestOptions)); } - private async __batchObjectsList( + private async __bulkRetrieve( batch_id: string, - request: Merge.accounting.ExpensesBatchObjectsListRequest = {}, requestOptions?: ExpensesClient.RequestOptions, ): Promise> { - const { - companyId, - createdAfter, - createdBefore, - cursor, - expand, - includeDeletedData, - includeRemoteData, - includeRemoteFields, - includeShellData, - modifiedAfter, - modifiedBefore, - pageSize, - remoteId, - transactionDateAfter, - transactionDateBefore, - } = request; - const _queryParams: Record = { - company_id: companyId, - created_after: createdAfter?.toISOString(), - created_before: createdBefore?.toISOString(), - cursor, - expand: Array.isArray(expand) - ? expand.map((item) => - serializers.accounting.ExpensesBatchObjectsListRequestExpandItem.jsonOrThrow(item, { - unrecognizedObjectKeys: "strip", - }), - ) - : expand != null - ? serializers.accounting.ExpensesBatchObjectsListRequestExpandItem.jsonOrThrow(expand, { - unrecognizedObjectKeys: "strip", - }) - : undefined, - include_deleted_data: includeDeletedData, - include_remote_data: includeRemoteData, - include_remote_fields: includeRemoteFields, - include_shell_data: includeShellData, - modified_after: modifiedAfter?.toISOString(), - modified_before: modifiedBefore?.toISOString(), - page_size: pageSize, - remote_id: remoteId, - transaction_date_after: transactionDateAfter?.toISOString(), - transaction_date_before: transactionDateBefore?.toISOString(), - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -515,11 +441,11 @@ export class ExpensesClient { (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.MergeEnvironment.Production, - `accounting/v1/expenses/batch/${core.url.encodePathParam(batch_id)}/objects`, + `accounting/v1/expenses/bulk/${core.url.encodePathParam(batch_id)}`, ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryParameters: requestOptions?.queryParams, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -551,7 +477,7 @@ export class ExpensesClient { _response.error, _response.rawResponse, "GET", - "/accounting/v1/expenses/batch/{batch_id}/objects", + "/accounting/v1/expenses/bulk/{batch_id}", ); } diff --git a/src/api/resources/accounting/resources/expenses/client/requests/ExpenseBulkRequest.ts b/src/api/resources/accounting/resources/expenses/client/requests/ExpenseBulkRequest.ts index 8a66d212c..66d6d7151 100644 --- a/src/api/resources/accounting/resources/expenses/client/requests/ExpenseBulkRequest.ts +++ b/src/api/resources/accounting/resources/expenses/client/requests/ExpenseBulkRequest.ts @@ -5,8 +5,6 @@ import type * as Merge from "../../../../../../index"; /** * @example * { - * isDebugMode: true, - * runAsync: true, * batchItems: [{ * itemId: "item_id", * payload: {} @@ -14,9 +12,5 @@ import type * as Merge from "../../../../../../index"; * } */ export interface ExpenseBulkRequest { - /** Whether to include debug fields (such as log file links) in the response. */ - isDebugMode?: boolean; - /** Whether or not third-party updates should be run asynchronously. */ - runAsync?: boolean; batchItems: Merge.accounting.ExpenseBatchItemRequest[]; } diff --git a/src/api/resources/accounting/resources/expenses/client/requests/ExpensesBatchObjectsListRequest.ts b/src/api/resources/accounting/resources/expenses/client/requests/ExpensesBatchObjectsListRequest.ts deleted file mode 100644 index 48445693a..000000000 --- a/src/api/resources/accounting/resources/expenses/client/requests/ExpensesBatchObjectsListRequest.ts +++ /dev/null @@ -1,57 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Merge from "../../../../../../index"; - -/** - * @example - * { - * companyId: "company_id", - * createdAfter: new Date("2024-01-15T09:30:00.000Z"), - * createdBefore: new Date("2024-01-15T09:30:00.000Z"), - * cursor: "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", - * includeDeletedData: true, - * includeRemoteData: true, - * includeRemoteFields: true, - * includeShellData: true, - * modifiedAfter: new Date("2024-01-15T09:30:00.000Z"), - * modifiedBefore: new Date("2024-01-15T09:30:00.000Z"), - * pageSize: 1, - * remoteId: "remote_id", - * transactionDateAfter: new Date("2024-01-15T09:30:00.000Z"), - * transactionDateBefore: new Date("2024-01-15T09:30:00.000Z") - * } - */ -export interface ExpensesBatchObjectsListRequest { - /** If provided, will only return expenses for this company. */ - companyId?: string; - /** If provided, will only return objects created after this datetime. */ - createdAfter?: Date; - /** If provided, will only return objects created before this datetime. */ - createdBefore?: Date; - /** The pagination cursor value. */ - cursor?: string; - /** Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. */ - expand?: - | Merge.accounting.ExpensesBatchObjectsListRequestExpandItem - | Merge.accounting.ExpensesBatchObjectsListRequestExpandItem[]; - /** Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). */ - includeDeletedData?: boolean; - /** Whether to include the original data Merge fetched from the third-party to produce these models. */ - includeRemoteData?: boolean; - /** Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. */ - includeRemoteFields?: boolean; - /** Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). */ - includeShellData?: boolean; - /** If provided, only objects synced by Merge after this date time will be returned. */ - modifiedAfter?: Date; - /** If provided, only objects synced by Merge before this date time will be returned. */ - modifiedBefore?: Date; - /** Number of results to return per page. The maximum limit is 100. */ - pageSize?: number; - /** The API provider's ID for the given object. */ - remoteId?: string; - /** If provided, will only return objects created after this datetime. */ - transactionDateAfter?: Date; - /** If provided, will only return objects created before this datetime. */ - transactionDateBefore?: Date; -} diff --git a/src/api/resources/accounting/resources/expenses/client/requests/index.ts b/src/api/resources/accounting/resources/expenses/client/requests/index.ts index e2e3b87fa..3991d2e3d 100644 --- a/src/api/resources/accounting/resources/expenses/client/requests/index.ts +++ b/src/api/resources/accounting/resources/expenses/client/requests/index.ts @@ -1,6 +1,5 @@ export type { ExpenseBulkRequest } from "./ExpenseBulkRequest"; export type { ExpenseEndpointRequest } from "./ExpenseEndpointRequest"; -export type { ExpensesBatchObjectsListRequest } from "./ExpensesBatchObjectsListRequest"; export type { ExpensesLinesRemoteFieldClassesListRequest } from "./ExpensesLinesRemoteFieldClassesListRequest"; export type { ExpensesListRequest } from "./ExpensesListRequest"; export type { ExpensesRemoteFieldClassesListRequest } from "./ExpensesRemoteFieldClassesListRequest"; diff --git a/src/api/resources/accounting/resources/expenses/types/ExpensesBatchObjectsListRequestExpandItem.ts b/src/api/resources/accounting/resources/expenses/types/ExpensesBatchObjectsListRequestExpandItem.ts deleted file mode 100644 index 19b7d59ab..000000000 --- a/src/api/resources/accounting/resources/expenses/types/ExpensesBatchObjectsListRequestExpandItem.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const ExpensesBatchObjectsListRequestExpandItem = { - Account: "account", - AccountingPeriod: "accounting_period", - Company: "company", - Contact: "contact", - Employee: "employee", - TrackingCategories: "tracking_categories", -} as const; -export type ExpensesBatchObjectsListRequestExpandItem = - (typeof ExpensesBatchObjectsListRequestExpandItem)[keyof typeof ExpensesBatchObjectsListRequestExpandItem]; diff --git a/src/api/resources/accounting/resources/expenses/types/index.ts b/src/api/resources/accounting/resources/expenses/types/index.ts index 1c81575ae..d63e24e45 100644 --- a/src/api/resources/accounting/resources/expenses/types/index.ts +++ b/src/api/resources/accounting/resources/expenses/types/index.ts @@ -1,3 +1,2 @@ -export * from "./ExpensesBatchObjectsListRequestExpandItem"; export * from "./ExpensesListRequestExpandItem"; export * from "./ExpensesRetrieveRequestExpandItem"; diff --git a/src/api/resources/accounting/resources/invoices/client/Client.ts b/src/api/resources/accounting/resources/invoices/client/Client.ts index c2bc0c4e7..a8cc22d7f 100644 --- a/src/api/resources/accounting/resources/invoices/client/Client.ts +++ b/src/api/resources/accounting/resources/invoices/client/Client.ts @@ -459,39 +459,30 @@ export class InvoicesClient { } /** - * Creates an `Invoice` object with the given values. - * Including a `PurchaseOrder` id in the `purchase_orders` property will generate an Accounts Payable Invoice from the specified Purchase Order(s). - * + * Creates multiple `Invoice` objects with the given values. * * @param {Merge.accounting.InvoiceBulkRequest} request * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.accounting.invoices.asyncBulkCreate({ - * isDebugMode: true, - * runAsync: true, + * await client.accounting.invoices.bulkCreate({ * batchItems: [{ * itemId: "item_id", * payload: {} * }] * }) */ - public asyncBulkCreate( + public bulkCreate( request: Merge.accounting.InvoiceBulkRequest, requestOptions?: InvoicesClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__asyncBulkCreate(request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__bulkCreate(request, requestOptions)); } - private async __asyncBulkCreate( + private async __bulkCreate( request: Merge.accounting.InvoiceBulkRequest, requestOptions?: InvoicesClient.RequestOptions, ): Promise> { - const { isDebugMode, runAsync, ..._body } = request; - const _queryParams: Record = { - is_debug_mode: isDebugMode, - run_async: runAsync, - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -504,14 +495,14 @@ export class InvoicesClient { (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.MergeEnvironment.Production, - "accounting/v1/invoices/async/bulk", + "accounting/v1/invoices/bulk", ), method: "POST", headers: _headers, contentType: "application/json", - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.accounting.InvoiceBulkRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }), + body: serializers.accounting.InvoiceBulkRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -539,124 +530,29 @@ export class InvoicesClient { }); } - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "POST", - "/accounting/v1/invoices/async/bulk", - ); + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/accounting/v1/invoices/bulk"); } /** - * Returns a list of `Invoice` objects. + * Returns the status and results of an `Invoice` bulk create batch. * * @param {string} batch_id - * @param {Merge.accounting.InvoicesBatchObjectsListRequest} request * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.accounting.invoices.batchObjectsList("batch_id", { - * companyId: "company_id", - * contactId: "contact_id", - * createdAfter: new Date("2024-01-15T09:30:00.000Z"), - * createdBefore: new Date("2024-01-15T09:30:00.000Z"), - * cursor: "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", - * includeDeletedData: true, - * includeRemoteData: true, - * includeRemoteFields: true, - * includeShellData: true, - * issueDateAfter: new Date("2024-01-15T09:30:00.000Z"), - * issueDateBefore: new Date("2024-01-15T09:30:00.000Z"), - * modifiedAfter: new Date("2024-01-15T09:30:00.000Z"), - * modifiedBefore: new Date("2024-01-15T09:30:00.000Z"), - * number: "number", - * pageSize: 1, - * remoteFields: "type", - * remoteId: "remote_id", - * showEnumOrigins: "type", - * status: "DRAFT", - * type: "ACCOUNTS_PAYABLE" - * }) + * await client.accounting.invoices.bulkRetrieve("batch_id") */ - public batchObjectsList( + public bulkRetrieve( batch_id: string, - request: Merge.accounting.InvoicesBatchObjectsListRequest = {}, requestOptions?: InvoicesClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__batchObjectsList(batch_id, request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__bulkRetrieve(batch_id, requestOptions)); } - private async __batchObjectsList( + private async __bulkRetrieve( batch_id: string, - request: Merge.accounting.InvoicesBatchObjectsListRequest = {}, requestOptions?: InvoicesClient.RequestOptions, ): Promise> { - const { - companyId, - contactId, - createdAfter, - createdBefore, - cursor, - expand, - includeDeletedData, - includeRemoteData, - includeRemoteFields, - includeShellData, - issueDateAfter, - issueDateBefore, - modifiedAfter, - modifiedBefore, - number: number_, - pageSize, - remoteFields, - remoteId, - showEnumOrigins, - status, - type: type_, - } = request; - const _queryParams: Record = { - company_id: companyId, - contact_id: contactId, - created_after: createdAfter?.toISOString(), - created_before: createdBefore?.toISOString(), - cursor, - expand: Array.isArray(expand) - ? expand.map((item) => - serializers.accounting.InvoicesBatchObjectsListRequestExpandItem.jsonOrThrow(item, { - unrecognizedObjectKeys: "strip", - }), - ) - : expand != null - ? serializers.accounting.InvoicesBatchObjectsListRequestExpandItem.jsonOrThrow(expand, { - unrecognizedObjectKeys: "strip", - }) - : undefined, - include_deleted_data: includeDeletedData, - include_remote_data: includeRemoteData, - include_remote_fields: includeRemoteFields, - include_shell_data: includeShellData, - issue_date_after: issueDateAfter?.toISOString(), - issue_date_before: issueDateBefore?.toISOString(), - modified_after: modifiedAfter?.toISOString(), - modified_before: modifiedBefore?.toISOString(), - number: number_, - page_size: pageSize, - remote_fields: remoteFields != null ? remoteFields : undefined, - remote_id: remoteId, - show_enum_origins: showEnumOrigins != null ? showEnumOrigins : undefined, - status: - status != null - ? serializers.accounting.InvoicesBatchObjectsListRequestStatus.jsonOrThrow(status, { - unrecognizedObjectKeys: "strip", - }) - : undefined, - type: - type_ != null - ? serializers.accounting.InvoicesBatchObjectsListRequestType.jsonOrThrow(type_, { - unrecognizedObjectKeys: "strip", - }) - : undefined, - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -669,11 +565,11 @@ export class InvoicesClient { (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.MergeEnvironment.Production, - `accounting/v1/invoices/batch/${core.url.encodePathParam(batch_id)}/objects`, + `accounting/v1/invoices/bulk/${core.url.encodePathParam(batch_id)}`, ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryParameters: requestOptions?.queryParams, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -705,7 +601,7 @@ export class InvoicesClient { _response.error, _response.rawResponse, "GET", - "/accounting/v1/invoices/batch/{batch_id}/objects", + "/accounting/v1/invoices/bulk/{batch_id}", ); } diff --git a/src/api/resources/accounting/resources/invoices/client/requests/InvoiceBulkRequest.ts b/src/api/resources/accounting/resources/invoices/client/requests/InvoiceBulkRequest.ts index 02f3c8cd3..263af4992 100644 --- a/src/api/resources/accounting/resources/invoices/client/requests/InvoiceBulkRequest.ts +++ b/src/api/resources/accounting/resources/invoices/client/requests/InvoiceBulkRequest.ts @@ -5,8 +5,6 @@ import type * as Merge from "../../../../../../index"; /** * @example * { - * isDebugMode: true, - * runAsync: true, * batchItems: [{ * itemId: "item_id", * payload: {} @@ -14,9 +12,5 @@ import type * as Merge from "../../../../../../index"; * } */ export interface InvoiceBulkRequest { - /** Whether to include debug fields (such as log file links) in the response. */ - isDebugMode?: boolean; - /** Whether or not third-party updates should be run asynchronously. */ - runAsync?: boolean; batchItems: Merge.accounting.InvoiceBatchItemRequest[]; } diff --git a/src/api/resources/accounting/resources/invoices/client/requests/InvoicesBatchObjectsListRequest.ts b/src/api/resources/accounting/resources/invoices/client/requests/InvoicesBatchObjectsListRequest.ts deleted file mode 100644 index 4990656a9..000000000 --- a/src/api/resources/accounting/resources/invoices/client/requests/InvoicesBatchObjectsListRequest.ts +++ /dev/null @@ -1,89 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Merge from "../../../../../../index"; - -/** - * @example - * { - * companyId: "company_id", - * contactId: "contact_id", - * createdAfter: new Date("2024-01-15T09:30:00.000Z"), - * createdBefore: new Date("2024-01-15T09:30:00.000Z"), - * cursor: "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", - * includeDeletedData: true, - * includeRemoteData: true, - * includeRemoteFields: true, - * includeShellData: true, - * issueDateAfter: new Date("2024-01-15T09:30:00.000Z"), - * issueDateBefore: new Date("2024-01-15T09:30:00.000Z"), - * modifiedAfter: new Date("2024-01-15T09:30:00.000Z"), - * modifiedBefore: new Date("2024-01-15T09:30:00.000Z"), - * number: "number", - * pageSize: 1, - * remoteFields: "type", - * remoteId: "remote_id", - * showEnumOrigins: "type", - * status: "DRAFT", - * type: "ACCOUNTS_PAYABLE" - * } - */ -export interface InvoicesBatchObjectsListRequest { - /** If provided, will only return invoices for this company. */ - companyId?: string; - /** If provided, will only return invoices for this contact. */ - contactId?: string; - /** If provided, will only return objects created after this datetime. */ - createdAfter?: Date; - /** If provided, will only return objects created before this datetime. */ - createdBefore?: Date; - /** The pagination cursor value. */ - cursor?: string; - /** Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. */ - expand?: - | Merge.accounting.InvoicesBatchObjectsListRequestExpandItem - | Merge.accounting.InvoicesBatchObjectsListRequestExpandItem[]; - /** Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). */ - includeDeletedData?: boolean; - /** Whether to include the original data Merge fetched from the third-party to produce these models. */ - includeRemoteData?: boolean; - /** Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. */ - includeRemoteFields?: boolean; - /** Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). */ - includeShellData?: boolean; - /** If provided, will only return objects created after this datetime. */ - issueDateAfter?: Date; - /** If provided, will only return objects created before this datetime. */ - issueDateBefore?: Date; - /** If provided, only objects synced by Merge after this date time will be returned. */ - modifiedAfter?: Date; - /** If provided, only objects synced by Merge before this date time will be returned. */ - modifiedBefore?: Date; - /** If provided, will only return Invoices with this number. */ - number?: string; - /** Number of results to return per page. The maximum limit is 100. */ - pageSize?: number; - /** Deprecated. Use show_enum_origins. */ - remoteFields?: "type"; - /** The API provider's ID for the given object. */ - remoteId?: string; - /** A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) */ - showEnumOrigins?: "type"; - /** - * If provided, will only return Invoices with this status. - * - * * `PAID` - PAID - * * `DRAFT` - DRAFT - * * `SUBMITTED` - SUBMITTED - * * `PARTIALLY_PAID` - PARTIALLY_PAID - * * `OPEN` - OPEN - * * `VOID` - VOID - */ - status?: Merge.accounting.InvoicesBatchObjectsListRequestStatus; - /** - * If provided, will only return Invoices with this type. - * - * * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - * * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - */ - type?: Merge.accounting.InvoicesBatchObjectsListRequestType; -} diff --git a/src/api/resources/accounting/resources/invoices/client/requests/index.ts b/src/api/resources/accounting/resources/invoices/client/requests/index.ts index 53b2ae418..286f5a918 100644 --- a/src/api/resources/accounting/resources/invoices/client/requests/index.ts +++ b/src/api/resources/accounting/resources/invoices/client/requests/index.ts @@ -1,6 +1,5 @@ export type { InvoiceBulkRequest } from "./InvoiceBulkRequest"; export type { InvoiceEndpointRequest } from "./InvoiceEndpointRequest"; -export type { InvoicesBatchObjectsListRequest } from "./InvoicesBatchObjectsListRequest"; export type { InvoicesLineItemsRemoteFieldClassesListRequest } from "./InvoicesLineItemsRemoteFieldClassesListRequest"; export type { InvoicesListRequest } from "./InvoicesListRequest"; export type { InvoicesRemoteFieldClassesListRequest } from "./InvoicesRemoteFieldClassesListRequest"; diff --git a/src/api/resources/accounting/resources/invoices/types/InvoicesBatchObjectsListRequestExpandItem.ts b/src/api/resources/accounting/resources/invoices/types/InvoicesBatchObjectsListRequestExpandItem.ts deleted file mode 100644 index fce54ee3f..000000000 --- a/src/api/resources/accounting/resources/invoices/types/InvoicesBatchObjectsListRequestExpandItem.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const InvoicesBatchObjectsListRequestExpandItem = { - AccountingPeriod: "accounting_period", - AppliedCreditNotes: "applied_credit_notes", - AppliedPayments: "applied_payments", - AppliedVendorCredits: "applied_vendor_credits", - Company: "company", - Contact: "contact", - Employee: "employee", - LineItems: "line_items", - PaymentTerm: "payment_term", - Payments: "payments", - PurchaseOrders: "purchase_orders", - SalesOrders: "sales_orders", - TrackingCategories: "tracking_categories", -} as const; -export type InvoicesBatchObjectsListRequestExpandItem = - (typeof InvoicesBatchObjectsListRequestExpandItem)[keyof typeof InvoicesBatchObjectsListRequestExpandItem]; diff --git a/src/api/resources/accounting/resources/invoices/types/InvoicesBatchObjectsListRequestStatus.ts b/src/api/resources/accounting/resources/invoices/types/InvoicesBatchObjectsListRequestStatus.ts deleted file mode 100644 index d9c4ea2bf..000000000 --- a/src/api/resources/accounting/resources/invoices/types/InvoicesBatchObjectsListRequestStatus.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const InvoicesBatchObjectsListRequestStatus = { - Draft: "DRAFT", - Open: "OPEN", - Paid: "PAID", - PartiallyPaid: "PARTIALLY_PAID", - Submitted: "SUBMITTED", - Void: "VOID", -} as const; -export type InvoicesBatchObjectsListRequestStatus = - (typeof InvoicesBatchObjectsListRequestStatus)[keyof typeof InvoicesBatchObjectsListRequestStatus]; diff --git a/src/api/resources/accounting/resources/invoices/types/InvoicesBatchObjectsListRequestType.ts b/src/api/resources/accounting/resources/invoices/types/InvoicesBatchObjectsListRequestType.ts deleted file mode 100644 index bab89685d..000000000 --- a/src/api/resources/accounting/resources/invoices/types/InvoicesBatchObjectsListRequestType.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const InvoicesBatchObjectsListRequestType = { - AccountsPayable: "ACCOUNTS_PAYABLE", - AccountsReceivable: "ACCOUNTS_RECEIVABLE", -} as const; -export type InvoicesBatchObjectsListRequestType = - (typeof InvoicesBatchObjectsListRequestType)[keyof typeof InvoicesBatchObjectsListRequestType]; diff --git a/src/api/resources/accounting/resources/invoices/types/index.ts b/src/api/resources/accounting/resources/invoices/types/index.ts index d690b827a..35fff0ee5 100644 --- a/src/api/resources/accounting/resources/invoices/types/index.ts +++ b/src/api/resources/accounting/resources/invoices/types/index.ts @@ -1,6 +1,3 @@ -export * from "./InvoicesBatchObjectsListRequestExpandItem"; -export * from "./InvoicesBatchObjectsListRequestStatus"; -export * from "./InvoicesBatchObjectsListRequestType"; export * from "./InvoicesListRequestExpandItem"; export * from "./InvoicesListRequestStatus"; export * from "./InvoicesListRequestType"; diff --git a/src/api/resources/accounting/resources/itemFulfillments/client/Client.ts b/src/api/resources/accounting/resources/itemFulfillments/client/Client.ts index 8f36bad73..168a0b41c 100644 --- a/src/api/resources/accounting/resources/itemFulfillments/client/Client.ts +++ b/src/api/resources/accounting/resources/itemFulfillments/client/Client.ts @@ -334,37 +334,30 @@ export class ItemFulfillmentsClient { } /** - * Creates an `ItemFulfillment` object with the given values. + * Creates multiple `ItemFulfillment` objects with the given values. * * @param {Merge.accounting.ItemFulfillmentBulkRequest} request * @param {ItemFulfillmentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.accounting.itemFulfillments.asyncBulkCreate({ - * isDebugMode: true, - * runAsync: true, + * await client.accounting.itemFulfillments.bulkCreate({ * batchItems: [{ * itemId: "item_id", * payload: {} * }] * }) */ - public asyncBulkCreate( + public bulkCreate( request: Merge.accounting.ItemFulfillmentBulkRequest, requestOptions?: ItemFulfillmentsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__asyncBulkCreate(request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__bulkCreate(request, requestOptions)); } - private async __asyncBulkCreate( + private async __bulkCreate( request: Merge.accounting.ItemFulfillmentBulkRequest, requestOptions?: ItemFulfillmentsClient.RequestOptions, ): Promise> { - const { isDebugMode, runAsync, ..._body } = request; - const _queryParams: Record = { - is_debug_mode: isDebugMode, - run_async: runAsync, - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -377,14 +370,14 @@ export class ItemFulfillmentsClient { (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.MergeEnvironment.Production, - "accounting/v1/item-fulfillments/async/bulk", + "accounting/v1/item-fulfillments/bulk", ), method: "POST", headers: _headers, contentType: "application/json", - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.accounting.ItemFulfillmentBulkRequest.jsonOrThrow(_body, { + body: serializers.accounting.ItemFulfillmentBulkRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", }), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -418,74 +411,30 @@ export class ItemFulfillmentsClient { _response.error, _response.rawResponse, "POST", - "/accounting/v1/item-fulfillments/async/bulk", + "/accounting/v1/item-fulfillments/bulk", ); } /** - * Returns a list of `ItemFulfillment` objects. + * Returns the status and results of an `ItemFulfillment` bulk create batch. * * @param {string} batch_id - * @param {Merge.accounting.ItemFulfillmentsBatchObjectsListRequest} request * @param {ItemFulfillmentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.accounting.itemFulfillments.batchObjectsList("batch_id", { - * cursor: "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", - * includeDeletedData: true, - * includeRemoteData: true, - * includeRemoteFields: true, - * includeShellData: true, - * pageSize: 1, - * remoteFields: "status", - * showEnumOrigins: "status" - * }) + * await client.accounting.itemFulfillments.bulkRetrieve("batch_id") */ - public batchObjectsList( + public bulkRetrieve( batch_id: string, - request: Merge.accounting.ItemFulfillmentsBatchObjectsListRequest = {}, requestOptions?: ItemFulfillmentsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__batchObjectsList(batch_id, request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__bulkRetrieve(batch_id, requestOptions)); } - private async __batchObjectsList( + private async __bulkRetrieve( batch_id: string, - request: Merge.accounting.ItemFulfillmentsBatchObjectsListRequest = {}, requestOptions?: ItemFulfillmentsClient.RequestOptions, ): Promise> { - const { - cursor, - expand, - includeDeletedData, - includeRemoteData, - includeRemoteFields, - includeShellData, - pageSize, - remoteFields, - showEnumOrigins, - } = request; - const _queryParams: Record = { - cursor, - expand: Array.isArray(expand) - ? expand.map((item) => - serializers.accounting.ItemFulfillmentsBatchObjectsListRequestExpandItem.jsonOrThrow(item, { - unrecognizedObjectKeys: "strip", - }), - ) - : expand != null - ? serializers.accounting.ItemFulfillmentsBatchObjectsListRequestExpandItem.jsonOrThrow(expand, { - unrecognizedObjectKeys: "strip", - }) - : undefined, - include_deleted_data: includeDeletedData, - include_remote_data: includeRemoteData, - include_remote_fields: includeRemoteFields, - include_shell_data: includeShellData, - page_size: pageSize, - remote_fields: remoteFields != null ? remoteFields : undefined, - show_enum_origins: showEnumOrigins != null ? showEnumOrigins : undefined, - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -498,11 +447,11 @@ export class ItemFulfillmentsClient { (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.MergeEnvironment.Production, - `accounting/v1/item-fulfillments/batch/${core.url.encodePathParam(batch_id)}/objects`, + `accounting/v1/item-fulfillments/bulk/${core.url.encodePathParam(batch_id)}`, ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryParameters: requestOptions?.queryParams, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -534,7 +483,7 @@ export class ItemFulfillmentsClient { _response.error, _response.rawResponse, "GET", - "/accounting/v1/item-fulfillments/batch/{batch_id}/objects", + "/accounting/v1/item-fulfillments/bulk/{batch_id}", ); } diff --git a/src/api/resources/accounting/resources/itemFulfillments/client/requests/ItemFulfillmentBulkRequest.ts b/src/api/resources/accounting/resources/itemFulfillments/client/requests/ItemFulfillmentBulkRequest.ts index bd7c14a0a..5ecb5b617 100644 --- a/src/api/resources/accounting/resources/itemFulfillments/client/requests/ItemFulfillmentBulkRequest.ts +++ b/src/api/resources/accounting/resources/itemFulfillments/client/requests/ItemFulfillmentBulkRequest.ts @@ -5,8 +5,6 @@ import type * as Merge from "../../../../../../index"; /** * @example * { - * isDebugMode: true, - * runAsync: true, * batchItems: [{ * itemId: "item_id", * payload: {} @@ -14,9 +12,5 @@ import type * as Merge from "../../../../../../index"; * } */ export interface ItemFulfillmentBulkRequest { - /** Whether to include debug fields (such as log file links) in the response. */ - isDebugMode?: boolean; - /** Whether or not third-party updates should be run asynchronously. */ - runAsync?: boolean; batchItems: Merge.accounting.ItemFulfillmentBatchItemRequest[]; } diff --git a/src/api/resources/accounting/resources/itemFulfillments/client/requests/ItemFulfillmentsBatchObjectsListRequest.ts b/src/api/resources/accounting/resources/itemFulfillments/client/requests/ItemFulfillmentsBatchObjectsListRequest.ts deleted file mode 100644 index 8a8f7de3f..000000000 --- a/src/api/resources/accounting/resources/itemFulfillments/client/requests/ItemFulfillmentsBatchObjectsListRequest.ts +++ /dev/null @@ -1,39 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Merge from "../../../../../../index"; - -/** - * @example - * { - * cursor: "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", - * includeDeletedData: true, - * includeRemoteData: true, - * includeRemoteFields: true, - * includeShellData: true, - * pageSize: 1, - * remoteFields: "status", - * showEnumOrigins: "status" - * } - */ -export interface ItemFulfillmentsBatchObjectsListRequest { - /** The pagination cursor value. */ - cursor?: string; - /** Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. */ - expand?: - | Merge.accounting.ItemFulfillmentsBatchObjectsListRequestExpandItem - | Merge.accounting.ItemFulfillmentsBatchObjectsListRequestExpandItem[]; - /** Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). */ - includeDeletedData?: boolean; - /** Whether to include the original data Merge fetched from the third-party to produce these models. */ - includeRemoteData?: boolean; - /** Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. */ - includeRemoteFields?: boolean; - /** Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). */ - includeShellData?: boolean; - /** Number of results to return per page. The maximum limit is 100. */ - pageSize?: number; - /** Deprecated. Use show_enum_origins. */ - remoteFields?: "status"; - /** A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) */ - showEnumOrigins?: "status"; -} diff --git a/src/api/resources/accounting/resources/itemFulfillments/client/requests/index.ts b/src/api/resources/accounting/resources/itemFulfillments/client/requests/index.ts index 846f819b3..64c493b74 100644 --- a/src/api/resources/accounting/resources/itemFulfillments/client/requests/index.ts +++ b/src/api/resources/accounting/resources/itemFulfillments/client/requests/index.ts @@ -1,6 +1,5 @@ export type { ItemFulfillmentBulkRequest } from "./ItemFulfillmentBulkRequest"; export type { ItemFulfillmentEndpointRequest } from "./ItemFulfillmentEndpointRequest"; -export type { ItemFulfillmentsBatchObjectsListRequest } from "./ItemFulfillmentsBatchObjectsListRequest"; export type { ItemFulfillmentsLinesRemoteFieldClassesListRequest } from "./ItemFulfillmentsLinesRemoteFieldClassesListRequest"; export type { ItemFulfillmentsListRequest } from "./ItemFulfillmentsListRequest"; export type { ItemFulfillmentsRemoteFieldClassesListRequest } from "./ItemFulfillmentsRemoteFieldClassesListRequest"; diff --git a/src/api/resources/accounting/resources/itemFulfillments/types/ItemFulfillmentsBatchObjectsListRequestExpandItem.ts b/src/api/resources/accounting/resources/itemFulfillments/types/ItemFulfillmentsBatchObjectsListRequestExpandItem.ts deleted file mode 100644 index 26df5d834..000000000 --- a/src/api/resources/accounting/resources/itemFulfillments/types/ItemFulfillmentsBatchObjectsListRequestExpandItem.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const ItemFulfillmentsBatchObjectsListRequestExpandItem = { - Company: "company", - Customer: "customer", - Lines: "lines", - SalesOrder: "sales_order", -} as const; -export type ItemFulfillmentsBatchObjectsListRequestExpandItem = - (typeof ItemFulfillmentsBatchObjectsListRequestExpandItem)[keyof typeof ItemFulfillmentsBatchObjectsListRequestExpandItem]; diff --git a/src/api/resources/accounting/resources/itemFulfillments/types/index.ts b/src/api/resources/accounting/resources/itemFulfillments/types/index.ts index 64e091163..41b4a29c2 100644 --- a/src/api/resources/accounting/resources/itemFulfillments/types/index.ts +++ b/src/api/resources/accounting/resources/itemFulfillments/types/index.ts @@ -1,3 +1,2 @@ -export * from "./ItemFulfillmentsBatchObjectsListRequestExpandItem"; export * from "./ItemFulfillmentsListRequestExpandItem"; export * from "./ItemFulfillmentsRetrieveRequestExpandItem"; diff --git a/src/api/resources/accounting/resources/salesOrders/client/Client.ts b/src/api/resources/accounting/resources/salesOrders/client/Client.ts index 1a6a0f154..8a0a1d874 100644 --- a/src/api/resources/accounting/resources/salesOrders/client/Client.ts +++ b/src/api/resources/accounting/resources/salesOrders/client/Client.ts @@ -353,37 +353,30 @@ export class SalesOrdersClient { } /** - * Creates a `SalesOrder` object with the given values. + * Creates multiple `SalesOrder` objects with the given values. * * @param {Merge.accounting.SalesOrderBulkRequest} request * @param {SalesOrdersClient.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.accounting.salesOrders.asyncBulkCreate({ - * isDebugMode: true, - * runAsync: true, + * await client.accounting.salesOrders.bulkCreate({ * batchItems: [{ * itemId: "item_id", * payload: {} * }] * }) */ - public asyncBulkCreate( + public bulkCreate( request: Merge.accounting.SalesOrderBulkRequest, requestOptions?: SalesOrdersClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__asyncBulkCreate(request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__bulkCreate(request, requestOptions)); } - private async __asyncBulkCreate( + private async __bulkCreate( request: Merge.accounting.SalesOrderBulkRequest, requestOptions?: SalesOrdersClient.RequestOptions, ): Promise> { - const { isDebugMode, runAsync, ..._body } = request; - const _queryParams: Record = { - is_debug_mode: isDebugMode, - run_async: runAsync, - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -396,14 +389,16 @@ export class SalesOrdersClient { (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.MergeEnvironment.Production, - "accounting/v1/sales-orders/async/bulk", + "accounting/v1/sales-orders/bulk", ), method: "POST", headers: _headers, contentType: "application/json", - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.accounting.SalesOrderBulkRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }), + body: serializers.accounting.SalesOrderBulkRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + }), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -435,98 +430,30 @@ export class SalesOrdersClient { _response.error, _response.rawResponse, "POST", - "/accounting/v1/sales-orders/async/bulk", + "/accounting/v1/sales-orders/bulk", ); } /** - * Returns a list of `SalesOrder` objects. + * Returns the status and results of a `SalesOrder` bulk create batch. * * @param {string} batch_id - * @param {Merge.accounting.SalesOrdersBatchObjectsListRequest} request * @param {SalesOrdersClient.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.accounting.salesOrders.batchObjectsList("batch_id", { - * companyId: "company_id", - * createdAfter: new Date("2024-01-15T09:30:00.000Z"), - * createdBefore: new Date("2024-01-15T09:30:00.000Z"), - * cursor: "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", - * includeDeletedData: true, - * includeRemoteData: true, - * includeRemoteFields: true, - * includeShellData: true, - * issueDateAfter: new Date("2024-01-15T09:30:00.000Z"), - * issueDateBefore: new Date("2024-01-15T09:30:00.000Z"), - * modifiedAfter: new Date("2024-01-15T09:30:00.000Z"), - * modifiedBefore: new Date("2024-01-15T09:30:00.000Z"), - * pageSize: 1, - * remoteFields: "status", - * remoteId: "remote_id", - * showEnumOrigins: "status" - * }) + * await client.accounting.salesOrders.bulkRetrieve("batch_id") */ - public batchObjectsList( + public bulkRetrieve( batch_id: string, - request: Merge.accounting.SalesOrdersBatchObjectsListRequest = {}, requestOptions?: SalesOrdersClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__batchObjectsList(batch_id, request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__bulkRetrieve(batch_id, requestOptions)); } - private async __batchObjectsList( + private async __bulkRetrieve( batch_id: string, - request: Merge.accounting.SalesOrdersBatchObjectsListRequest = {}, requestOptions?: SalesOrdersClient.RequestOptions, ): Promise> { - const { - companyId, - createdAfter, - createdBefore, - cursor, - expand, - includeDeletedData, - includeRemoteData, - includeRemoteFields, - includeShellData, - issueDateAfter, - issueDateBefore, - modifiedAfter, - modifiedBefore, - pageSize, - remoteFields, - remoteId, - showEnumOrigins, - } = request; - const _queryParams: Record = { - company_id: companyId, - created_after: createdAfter?.toISOString(), - created_before: createdBefore?.toISOString(), - cursor, - expand: Array.isArray(expand) - ? expand.map((item) => - serializers.accounting.SalesOrdersBatchObjectsListRequestExpandItem.jsonOrThrow(item, { - unrecognizedObjectKeys: "strip", - }), - ) - : expand != null - ? serializers.accounting.SalesOrdersBatchObjectsListRequestExpandItem.jsonOrThrow(expand, { - unrecognizedObjectKeys: "strip", - }) - : undefined, - include_deleted_data: includeDeletedData, - include_remote_data: includeRemoteData, - include_remote_fields: includeRemoteFields, - include_shell_data: includeShellData, - issue_date_after: issueDateAfter?.toISOString(), - issue_date_before: issueDateBefore?.toISOString(), - modified_after: modifiedAfter?.toISOString(), - modified_before: modifiedBefore?.toISOString(), - page_size: pageSize, - remote_fields: remoteFields != null ? remoteFields : undefined, - remote_id: remoteId, - show_enum_origins: showEnumOrigins != null ? showEnumOrigins : undefined, - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -539,11 +466,11 @@ export class SalesOrdersClient { (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.MergeEnvironment.Production, - `accounting/v1/sales-orders/batch/${core.url.encodePathParam(batch_id)}/objects`, + `accounting/v1/sales-orders/bulk/${core.url.encodePathParam(batch_id)}`, ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryParameters: requestOptions?.queryParams, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -575,7 +502,7 @@ export class SalesOrdersClient { _response.error, _response.rawResponse, "GET", - "/accounting/v1/sales-orders/batch/{batch_id}/objects", + "/accounting/v1/sales-orders/bulk/{batch_id}", ); } diff --git a/src/api/resources/accounting/resources/salesOrders/client/requests/SalesOrderBulkRequest.ts b/src/api/resources/accounting/resources/salesOrders/client/requests/SalesOrderBulkRequest.ts index 38fedaa95..20b56dacd 100644 --- a/src/api/resources/accounting/resources/salesOrders/client/requests/SalesOrderBulkRequest.ts +++ b/src/api/resources/accounting/resources/salesOrders/client/requests/SalesOrderBulkRequest.ts @@ -5,8 +5,6 @@ import type * as Merge from "../../../../../../index"; /** * @example * { - * isDebugMode: true, - * runAsync: true, * batchItems: [{ * itemId: "item_id", * payload: {} @@ -14,9 +12,5 @@ import type * as Merge from "../../../../../../index"; * } */ export interface SalesOrderBulkRequest { - /** Whether to include debug fields (such as log file links) in the response. */ - isDebugMode?: boolean; - /** Whether or not third-party updates should be run asynchronously. */ - runAsync?: boolean; batchItems: Merge.accounting.SalesOrderBatchItemRequest[]; } diff --git a/src/api/resources/accounting/resources/salesOrders/client/requests/SalesOrdersBatchObjectsListRequest.ts b/src/api/resources/accounting/resources/salesOrders/client/requests/SalesOrdersBatchObjectsListRequest.ts deleted file mode 100644 index a11b48937..000000000 --- a/src/api/resources/accounting/resources/salesOrders/client/requests/SalesOrdersBatchObjectsListRequest.ts +++ /dev/null @@ -1,63 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Merge from "../../../../../../index"; - -/** - * @example - * { - * companyId: "company_id", - * createdAfter: new Date("2024-01-15T09:30:00.000Z"), - * createdBefore: new Date("2024-01-15T09:30:00.000Z"), - * cursor: "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", - * includeDeletedData: true, - * includeRemoteData: true, - * includeRemoteFields: true, - * includeShellData: true, - * issueDateAfter: new Date("2024-01-15T09:30:00.000Z"), - * issueDateBefore: new Date("2024-01-15T09:30:00.000Z"), - * modifiedAfter: new Date("2024-01-15T09:30:00.000Z"), - * modifiedBefore: new Date("2024-01-15T09:30:00.000Z"), - * pageSize: 1, - * remoteFields: "status", - * remoteId: "remote_id", - * showEnumOrigins: "status" - * } - */ -export interface SalesOrdersBatchObjectsListRequest { - /** If provided, will only return sales orders for this company. */ - companyId?: string; - /** If provided, will only return objects created after this datetime. */ - createdAfter?: Date; - /** If provided, will only return objects created before this datetime. */ - createdBefore?: Date; - /** The pagination cursor value. */ - cursor?: string; - /** Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. */ - expand?: - | Merge.accounting.SalesOrdersBatchObjectsListRequestExpandItem - | Merge.accounting.SalesOrdersBatchObjectsListRequestExpandItem[]; - /** Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). */ - includeDeletedData?: boolean; - /** Whether to include the original data Merge fetched from the third-party to produce these models. */ - includeRemoteData?: boolean; - /** Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. */ - includeRemoteFields?: boolean; - /** Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). */ - includeShellData?: boolean; - /** If provided, will only return objects created after this datetime. */ - issueDateAfter?: Date; - /** If provided, will only return objects created before this datetime. */ - issueDateBefore?: Date; - /** If provided, only objects synced by Merge after this date time will be returned. */ - modifiedAfter?: Date; - /** If provided, only objects synced by Merge before this date time will be returned. */ - modifiedBefore?: Date; - /** Number of results to return per page. The maximum limit is 100. */ - pageSize?: number; - /** Deprecated. Use show_enum_origins. */ - remoteFields?: "status"; - /** The API provider's ID for the given object. */ - remoteId?: string; - /** A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) */ - showEnumOrigins?: "status"; -} diff --git a/src/api/resources/accounting/resources/salesOrders/client/requests/index.ts b/src/api/resources/accounting/resources/salesOrders/client/requests/index.ts index 8335fc70b..607b9e377 100644 --- a/src/api/resources/accounting/resources/salesOrders/client/requests/index.ts +++ b/src/api/resources/accounting/resources/salesOrders/client/requests/index.ts @@ -1,6 +1,5 @@ export type { SalesOrderBulkRequest } from "./SalesOrderBulkRequest"; export type { SalesOrderEndpointRequest } from "./SalesOrderEndpointRequest"; -export type { SalesOrdersBatchObjectsListRequest } from "./SalesOrdersBatchObjectsListRequest"; export type { SalesOrdersLinesRemoteFieldClassesListRequest } from "./SalesOrdersLinesRemoteFieldClassesListRequest"; export type { SalesOrdersListRequest } from "./SalesOrdersListRequest"; export type { SalesOrdersRemoteFieldClassesListRequest } from "./SalesOrdersRemoteFieldClassesListRequest"; diff --git a/src/api/resources/accounting/resources/salesOrders/types/SalesOrdersBatchObjectsListRequestExpandItem.ts b/src/api/resources/accounting/resources/salesOrders/types/SalesOrdersBatchObjectsListRequestExpandItem.ts deleted file mode 100644 index 9f67c833a..000000000 --- a/src/api/resources/accounting/resources/salesOrders/types/SalesOrdersBatchObjectsListRequestExpandItem.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const SalesOrdersBatchObjectsListRequestExpandItem = { - Company: "company", - Customer: "customer", - Lines: "lines", - PaymentTerm: "payment_term", - ShippingAddress: "shipping_address", - TrackingCategories: "tracking_categories", -} as const; -export type SalesOrdersBatchObjectsListRequestExpandItem = - (typeof SalesOrdersBatchObjectsListRequestExpandItem)[keyof typeof SalesOrdersBatchObjectsListRequestExpandItem]; diff --git a/src/api/resources/accounting/resources/salesOrders/types/index.ts b/src/api/resources/accounting/resources/salesOrders/types/index.ts index df5f74cbe..20a37d0ed 100644 --- a/src/api/resources/accounting/resources/salesOrders/types/index.ts +++ b/src/api/resources/accounting/resources/salesOrders/types/index.ts @@ -1,3 +1,2 @@ -export * from "./SalesOrdersBatchObjectsListRequestExpandItem"; export * from "./SalesOrdersListRequestExpandItem"; export * from "./SalesOrdersRetrieveRequestExpandItem"; diff --git a/src/api/resources/accounting/types/AsyncBulkCreateResponse.ts b/src/api/resources/accounting/types/AsyncBulkCreateResponse.ts index c043a0613..92657e8cc 100644 --- a/src/api/resources/accounting/types/AsyncBulkCreateResponse.ts +++ b/src/api/resources/accounting/types/AsyncBulkCreateResponse.ts @@ -1,5 +1,9 @@ // This file was auto-generated by Fern from our API Definition. +/** + * Response serializer for POST bulk create - returns only batch_id + */ export interface AsyncBulkCreateResponse { + /** The ID of the batch. */ batchId: string; } diff --git a/src/api/resources/accounting/types/BankFeedTransactionRequestRequestBankFeedAccount.ts b/src/api/resources/accounting/types/BankFeedTransactionRequestRequestBankFeedAccount.ts index 6809d87f1..d1e9ad07d 100644 --- a/src/api/resources/accounting/types/BankFeedTransactionRequestRequestBankFeedAccount.ts +++ b/src/api/resources/accounting/types/BankFeedTransactionRequestRequestBankFeedAccount.ts @@ -5,4 +5,4 @@ import type * as Merge from "../../../index"; /** * The bank feed account associated with the transaction. */ -export type BankFeedTransactionRequestRequestBankFeedAccount = string | Merge.accounting.BankFeedAccountRequest; +export type BankFeedTransactionRequestRequestBankFeedAccount = string | Merge.accounting.BankFeedAccount; diff --git a/src/api/resources/accounting/types/BatchObject.ts b/src/api/resources/accounting/types/BatchObject.ts index 2c37f9e3c..e3c9af1fb 100644 --- a/src/api/resources/accounting/types/BatchObject.ts +++ b/src/api/resources/accounting/types/BatchObject.ts @@ -2,8 +2,22 @@ import type * as Merge from "../../../index"; +/** + * Individual batch object with status + */ export interface BatchObject { itemId: string; - status: string; + /** + * Possible per-object statuses: + * + * * `PENDING` - This object has not been processed yet + * * `SUCCESS` - This object was successfully POSTed + * * `FAILURE` - This object was not successfully POSTed + * + * * `PENDING` - PENDING + * * `SUCCESS` - SUCCESS + * * `FAILURE` - FAILURE + */ + status: Merge.accounting.BatchObjectStatus; response?: Merge.accounting.BatchObjectItemResponse; } diff --git a/src/api/resources/accounting/types/BatchObjectItemResponse.ts b/src/api/resources/accounting/types/BatchObjectItemResponse.ts index 9f77f2a69..6b837dad1 100644 --- a/src/api/resources/accounting/types/BatchObjectItemResponse.ts +++ b/src/api/resources/accounting/types/BatchObjectItemResponse.ts @@ -1,5 +1,8 @@ // This file was auto-generated by Fern from our API Definition. +/** + * Response for individual items within a batch + */ export interface BatchObjectItemResponse { mergeCommonModelId?: string; errorMessage?: string; diff --git a/src/api/resources/accounting/types/BatchObjectStatus.ts b/src/api/resources/accounting/types/BatchObjectStatus.ts new file mode 100644 index 000000000..3b3e46a22 --- /dev/null +++ b/src/api/resources/accounting/types/BatchObjectStatus.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Merge from "../../../index"; + +/** + * Possible per-object statuses: + * + * * `PENDING` - This object has not been processed yet + * * `SUCCESS` - This object was successfully POSTed + * * `FAILURE` - This object was not successfully POSTed + * + * * `PENDING` - PENDING + * * `SUCCESS` - SUCCESS + * * `FAILURE` - FAILURE + */ +export type BatchObjectStatus = Merge.accounting.BatchObjectStatusEnum | string; diff --git a/src/api/resources/accounting/types/BatchObjectStatusEnum.ts b/src/api/resources/accounting/types/BatchObjectStatusEnum.ts new file mode 100644 index 000000000..67bf37ede --- /dev/null +++ b/src/api/resources/accounting/types/BatchObjectStatusEnum.ts @@ -0,0 +1,17 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * * `PENDING` - This object has not been processed yet + * * `SUCCESS` - This object was successfully POSTed + * * `FAILURE` - This object was not successfully POSTed + * + * * `PENDING` - PENDING + * * `SUCCESS` - SUCCESS + * * `FAILURE` - FAILURE + */ +export const BatchObjectStatusEnum = { + Pending: "PENDING", + Success: "SUCCESS", + Failure: "FAILURE", +} as const; +export type BatchObjectStatusEnum = (typeof BatchObjectStatusEnum)[keyof typeof BatchObjectStatusEnum]; diff --git a/src/api/resources/accounting/types/BatchObjectsResponse.ts b/src/api/resources/accounting/types/BatchObjectsResponse.ts index b81faa38c..3eebf5259 100644 --- a/src/api/resources/accounting/types/BatchObjectsResponse.ts +++ b/src/api/resources/accounting/types/BatchObjectsResponse.ts @@ -2,9 +2,31 @@ import type * as Merge from "../../../index"; +/** + * Response serializer for GET bulk/{batch_id} - returns batch status and objects + */ export interface BatchObjectsResponse { + /** The ID of the batch. */ batchId: string; - status: string; + /** + * Possible overall statuses: + * + * * `ENQUEUED` - The request has been received and a task has been enqueued for processing + * * `IN_PROGRESS` - The enqueued task is being processed + * * `PARTIAL_SUCCESS` - The task has been processed, but not all objects were written successfully + * * `SUCCESS` - The task has been processed, and all objects were written successfully + * * `FAILED` - The task has been processed, but ran into an error while processing + * * `RATE_LIMITED` - The request was received but ran into rate limits while processing. The rate limited objects are being retried. + * + * * `ENQUEUED` - ENQUEUED + * * `IN_PROGRESS` - IN_PROGRESS + * * `PARTIAL_SUCCESS` - PARTIAL_SUCCESS + * * `SUCCESS` - SUCCESS + * * `FAILED` - FAILED + * * `RATE_LIMITED` - RATE_LIMITED + */ + status: Merge.accounting.BatchObjectsResponseStatus; + /** The total number of objects in the batch. */ totalCount: number; objects: Merge.accounting.BatchObject[]; } diff --git a/src/api/resources/accounting/types/BatchObjectsResponseStatus.ts b/src/api/resources/accounting/types/BatchObjectsResponseStatus.ts new file mode 100644 index 000000000..3520bf6f3 --- /dev/null +++ b/src/api/resources/accounting/types/BatchObjectsResponseStatus.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Merge from "../../../index"; + +/** + * Possible overall statuses: + * + * * `ENQUEUED` - The request has been received and a task has been enqueued for processing + * * `IN_PROGRESS` - The enqueued task is being processed + * * `PARTIAL_SUCCESS` - The task has been processed, but not all objects were written successfully + * * `SUCCESS` - The task has been processed, and all objects were written successfully + * * `FAILED` - The task has been processed, but ran into an error while processing + * * `RATE_LIMITED` - The request was received but ran into rate limits while processing. The rate limited objects are being retried. + * + * * `ENQUEUED` - ENQUEUED + * * `IN_PROGRESS` - IN_PROGRESS + * * `PARTIAL_SUCCESS` - PARTIAL_SUCCESS + * * `SUCCESS` - SUCCESS + * * `FAILED` - FAILED + * * `RATE_LIMITED` - RATE_LIMITED + */ +export type BatchObjectsResponseStatus = Merge.accounting.BatchObjectsResponseStatusEnum | string; diff --git a/src/api/resources/accounting/types/BatchObjectsResponseStatusEnum.ts b/src/api/resources/accounting/types/BatchObjectsResponseStatusEnum.ts new file mode 100644 index 000000000..245cc9e97 --- /dev/null +++ b/src/api/resources/accounting/types/BatchObjectsResponseStatusEnum.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * * `ENQUEUED` - The request has been received and a task has been enqueued for processing + * * `IN_PROGRESS` - The enqueued task is being processed + * * `PARTIAL_SUCCESS` - The task has been processed, but not all objects were written successfully + * * `SUCCESS` - The task has been processed, and all objects were written successfully + * * `FAILED` - The task has been processed, but ran into an error while processing + * * `RATE_LIMITED` - The request was received but ran into rate limits while processing. The rate limited objects are being retried. + * + * * `ENQUEUED` - ENQUEUED + * * `IN_PROGRESS` - IN_PROGRESS + * * `PARTIAL_SUCCESS` - PARTIAL_SUCCESS + * * `SUCCESS` - SUCCESS + * * `FAILED` - FAILED + * * `RATE_LIMITED` - RATE_LIMITED + */ +export const BatchObjectsResponseStatusEnum = { + Enqueued: "ENQUEUED", + InProgress: "IN_PROGRESS", + PartialSuccess: "PARTIAL_SUCCESS", + Success: "SUCCESS", + Failed: "FAILED", + RateLimited: "RATE_LIMITED", +} as const; +export type BatchObjectsResponseStatusEnum = + (typeof BatchObjectsResponseStatusEnum)[keyof typeof BatchObjectsResponseStatusEnum]; diff --git a/src/api/resources/accounting/types/ContactRequestAddressesItem.ts b/src/api/resources/accounting/types/ContactRequestAddressesItem.ts index ce38140ec..8a5e26c67 100644 --- a/src/api/resources/accounting/types/ContactRequestAddressesItem.ts +++ b/src/api/resources/accounting/types/ContactRequestAddressesItem.ts @@ -2,4 +2,4 @@ import type * as Merge from "../../../index"; -export type ContactRequestAddressesItem = string | Merge.accounting.AddressRequest; +export type ContactRequestAddressesItem = string | Merge.accounting.Address; diff --git a/src/api/resources/accounting/types/ContactRequestPhoneNumbersItem.ts b/src/api/resources/accounting/types/ContactRequestPhoneNumbersItem.ts index 2d12ec6cf..4c6cf70ea 100644 --- a/src/api/resources/accounting/types/ContactRequestPhoneNumbersItem.ts +++ b/src/api/resources/accounting/types/ContactRequestPhoneNumbersItem.ts @@ -2,4 +2,4 @@ import type * as Merge from "../../../index"; -export type ContactRequestPhoneNumbersItem = string | Merge.accounting.AccountingPhoneNumberRequest; +export type ContactRequestPhoneNumbersItem = string | Merge.accounting.AccountingPhoneNumber; diff --git a/src/api/resources/accounting/types/CreditNoteApplyLineForCreditNoteRequestInvoice.ts b/src/api/resources/accounting/types/CreditNoteApplyLineForCreditNoteRequestInvoice.ts index 796e84bdd..9017ebbe2 100644 --- a/src/api/resources/accounting/types/CreditNoteApplyLineForCreditNoteRequestInvoice.ts +++ b/src/api/resources/accounting/types/CreditNoteApplyLineForCreditNoteRequestInvoice.ts @@ -2,4 +2,4 @@ import type * as Merge from "../../../index"; -export type CreditNoteApplyLineForCreditNoteRequestInvoice = string | Merge.accounting.InvoiceRequest; +export type CreditNoteApplyLineForCreditNoteRequestInvoice = string | Merge.accounting.Invoice; diff --git a/src/api/resources/accounting/types/CreditNoteLineItemRequestContact.ts b/src/api/resources/accounting/types/CreditNoteLineItemRequestContact.ts index f8984c518..27340dad3 100644 --- a/src/api/resources/accounting/types/CreditNoteLineItemRequestContact.ts +++ b/src/api/resources/accounting/types/CreditNoteLineItemRequestContact.ts @@ -5,4 +5,4 @@ import type * as Merge from "../../../index"; /** * The credit note's contact. */ -export type CreditNoteLineItemRequestContact = string | Merge.accounting.ContactRequest; +export type CreditNoteLineItemRequestContact = string | Merge.accounting.Contact; diff --git a/src/api/resources/accounting/types/CreditNoteRequestAppliedPaymentsItem.ts b/src/api/resources/accounting/types/CreditNoteRequestAppliedPaymentsItem.ts index 66723fb32..b76318666 100644 --- a/src/api/resources/accounting/types/CreditNoteRequestAppliedPaymentsItem.ts +++ b/src/api/resources/accounting/types/CreditNoteRequestAppliedPaymentsItem.ts @@ -2,4 +2,4 @@ import type * as Merge from "../../../index"; -export type CreditNoteRequestAppliedPaymentsItem = string | Merge.accounting.PaymentLineItemRequest; +export type CreditNoteRequestAppliedPaymentsItem = string | Merge.accounting.PaymentLineItem; diff --git a/src/api/resources/accounting/types/CreditNoteRequestContact.ts b/src/api/resources/accounting/types/CreditNoteRequestContact.ts index 7459e502f..dee348da6 100644 --- a/src/api/resources/accounting/types/CreditNoteRequestContact.ts +++ b/src/api/resources/accounting/types/CreditNoteRequestContact.ts @@ -5,4 +5,4 @@ import type * as Merge from "../../../index"; /** * The credit note's contact. */ -export type CreditNoteRequestContact = string | Merge.accounting.ContactRequest; +export type CreditNoteRequestContact = string | Merge.accounting.Contact; diff --git a/src/api/resources/accounting/types/CreditNoteRequestLineItemsItem.ts b/src/api/resources/accounting/types/CreditNoteRequestLineItemsItem.ts index 1cbad2fd5..6aeda5e08 100644 --- a/src/api/resources/accounting/types/CreditNoteRequestLineItemsItem.ts +++ b/src/api/resources/accounting/types/CreditNoteRequestLineItemsItem.ts @@ -2,4 +2,4 @@ import type * as Merge from "../../../index"; -export type CreditNoteRequestLineItemsItem = string | Merge.accounting.CreditNoteLineItemRequest; +export type CreditNoteRequestLineItemsItem = string | Merge.accounting.CreditNoteLineItem; diff --git a/src/api/resources/accounting/types/CreditNoteRequestPaymentsItem.ts b/src/api/resources/accounting/types/CreditNoteRequestPaymentsItem.ts index 65875a0e2..323043b1b 100644 --- a/src/api/resources/accounting/types/CreditNoteRequestPaymentsItem.ts +++ b/src/api/resources/accounting/types/CreditNoteRequestPaymentsItem.ts @@ -2,4 +2,4 @@ import type * as Merge from "../../../index"; -export type CreditNoteRequestPaymentsItem = string | Merge.accounting.PaymentRequest; +export type CreditNoteRequestPaymentsItem = string | Merge.accounting.Payment; diff --git a/src/api/resources/accounting/types/DataPassthroughRequest.ts b/src/api/resources/accounting/types/DataPassthroughRequest.ts index a7c90a8cb..acb28fc99 100644 --- a/src/api/resources/accounting/types/DataPassthroughRequest.ts +++ b/src/api/resources/accounting/types/DataPassthroughRequest.ts @@ -11,7 +11,7 @@ import type * as Merge from "../../../index"; * Create a `DataPassthrough` to get team hierarchies from your Rippling integration. */ export interface DataPassthroughRequest { - method: Merge.accounting.DataPassthroughRequestMethod; + method: Merge.accounting.MethodEnum; /** The path of the request in the third party's platform. */ path: string; /** An optional override of the third party's base url for the request. */ @@ -22,7 +22,7 @@ export interface DataPassthroughRequest { multipartFormData?: Merge.accounting.MultipartFormFieldRequest[]; /** The headers to use for the request (Merge will handle the account's authorization headers). `Content-Type` header is required for passthrough. Choose content type corresponding to expected format of receiving server. */ headers?: Record; - requestFormat?: Merge.accounting.DataPassthroughRequestRequestFormat; + requestFormat?: Merge.accounting.RequestFormatEnum; /** Optional. If true, the response will always be an object of the form `{"type": T, "value": ...}` where `T` will be one of `string, boolean, number, null, array, object`. */ normalizeResponse?: boolean; } diff --git a/src/api/resources/accounting/types/DataPassthroughRequestMethod.ts b/src/api/resources/accounting/types/DataPassthroughRequestMethod.ts deleted file mode 100644 index 1c2fc3cad..000000000 --- a/src/api/resources/accounting/types/DataPassthroughRequestMethod.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Merge from "../../../index"; - -export type DataPassthroughRequestMethod = Merge.accounting.MethodEnum | string; diff --git a/src/api/resources/accounting/types/DataPassthroughRequestRequestFormat.ts b/src/api/resources/accounting/types/DataPassthroughRequestRequestFormat.ts deleted file mode 100644 index a2afa477e..000000000 --- a/src/api/resources/accounting/types/DataPassthroughRequestRequestFormat.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Merge from "../../../index"; - -export type DataPassthroughRequestRequestFormat = Merge.accounting.RequestFormatEnum | string; diff --git a/src/api/resources/accounting/types/ErrorValidationProblem.ts b/src/api/resources/accounting/types/ErrorValidationProblem.ts index e96cb0795..f587d113d 100644 --- a/src/api/resources/accounting/types/ErrorValidationProblem.ts +++ b/src/api/resources/accounting/types/ErrorValidationProblem.ts @@ -8,4 +8,6 @@ export interface ErrorValidationProblem { detail: string; problemType: string; blockMergeLink?: boolean; + rawError?: string; + errorCode?: number; } diff --git a/src/api/resources/accounting/types/ExpenseLineRequestAccount.ts b/src/api/resources/accounting/types/ExpenseLineRequestAccount.ts index 7d1855918..7f564d1a9 100644 --- a/src/api/resources/accounting/types/ExpenseLineRequestAccount.ts +++ b/src/api/resources/accounting/types/ExpenseLineRequestAccount.ts @@ -5,4 +5,4 @@ import type * as Merge from "../../../index"; /** * The expense's payment account. */ -export type ExpenseLineRequestAccount = string | Merge.accounting.AccountRequest; +export type ExpenseLineRequestAccount = string | Merge.accounting.Account; diff --git a/src/api/resources/accounting/types/ExpenseLineRequestContact.ts b/src/api/resources/accounting/types/ExpenseLineRequestContact.ts index a25ebe283..af51a7931 100644 --- a/src/api/resources/accounting/types/ExpenseLineRequestContact.ts +++ b/src/api/resources/accounting/types/ExpenseLineRequestContact.ts @@ -5,4 +5,4 @@ import type * as Merge from "../../../index"; /** * The expense's contact. */ -export type ExpenseLineRequestContact = string | Merge.accounting.ContactRequest; +export type ExpenseLineRequestContact = string | Merge.accounting.Contact; diff --git a/src/api/resources/accounting/types/ExpenseReportLineRequestAccount.ts b/src/api/resources/accounting/types/ExpenseReportLineRequestAccount.ts index f89c70241..174584261 100644 --- a/src/api/resources/accounting/types/ExpenseReportLineRequestAccount.ts +++ b/src/api/resources/accounting/types/ExpenseReportLineRequestAccount.ts @@ -2,4 +2,4 @@ import type * as Merge from "../../../index"; -export type ExpenseReportLineRequestAccount = string | Merge.accounting.AccountRequest; +export type ExpenseReportLineRequestAccount = string | Merge.accounting.Account; diff --git a/src/api/resources/accounting/types/ExpenseReportLineRequestContact.ts b/src/api/resources/accounting/types/ExpenseReportLineRequestContact.ts index 29a525466..b7a0b8ab8 100644 --- a/src/api/resources/accounting/types/ExpenseReportLineRequestContact.ts +++ b/src/api/resources/accounting/types/ExpenseReportLineRequestContact.ts @@ -2,4 +2,4 @@ import type * as Merge from "../../../index"; -export type ExpenseReportLineRequestContact = string | Merge.accounting.ContactRequest; +export type ExpenseReportLineRequestContact = string | Merge.accounting.Contact; diff --git a/src/api/resources/accounting/types/ExpenseRequestAccount.ts b/src/api/resources/accounting/types/ExpenseRequestAccount.ts index 1a2fca7f4..e227836cb 100644 --- a/src/api/resources/accounting/types/ExpenseRequestAccount.ts +++ b/src/api/resources/accounting/types/ExpenseRequestAccount.ts @@ -5,4 +5,4 @@ import type * as Merge from "../../../index"; /** * The expense's payment account. */ -export type ExpenseRequestAccount = string | Merge.accounting.AccountRequest; +export type ExpenseRequestAccount = string | Merge.accounting.Account; diff --git a/src/api/resources/accounting/types/ExpenseRequestContact.ts b/src/api/resources/accounting/types/ExpenseRequestContact.ts index 19f9838c8..62301ad13 100644 --- a/src/api/resources/accounting/types/ExpenseRequestContact.ts +++ b/src/api/resources/accounting/types/ExpenseRequestContact.ts @@ -5,4 +5,4 @@ import type * as Merge from "../../../index"; /** * The expense's contact. */ -export type ExpenseRequestContact = string | Merge.accounting.ContactRequest; +export type ExpenseRequestContact = string | Merge.accounting.Contact; diff --git a/src/api/resources/accounting/types/InvoiceLineItemRequestAccount.ts b/src/api/resources/accounting/types/InvoiceLineItemRequestAccount.ts index 6c733d7f1..b751b9c8d 100644 --- a/src/api/resources/accounting/types/InvoiceLineItemRequestAccount.ts +++ b/src/api/resources/accounting/types/InvoiceLineItemRequestAccount.ts @@ -2,4 +2,4 @@ import type * as Merge from "../../../index"; -export type InvoiceLineItemRequestAccount = string | Merge.accounting.AccountRequest; +export type InvoiceLineItemRequestAccount = string | Merge.accounting.Account; diff --git a/src/api/resources/accounting/types/InvoiceLineItemRequestContact.ts b/src/api/resources/accounting/types/InvoiceLineItemRequestContact.ts index ae4c289e8..2588517a4 100644 --- a/src/api/resources/accounting/types/InvoiceLineItemRequestContact.ts +++ b/src/api/resources/accounting/types/InvoiceLineItemRequestContact.ts @@ -5,4 +5,4 @@ import type * as Merge from "../../../index"; /** * The invoice's contact. */ -export type InvoiceLineItemRequestContact = string | Merge.accounting.ContactRequest; +export type InvoiceLineItemRequestContact = string | Merge.accounting.Contact; diff --git a/src/api/resources/accounting/types/InvoiceRequestContact.ts b/src/api/resources/accounting/types/InvoiceRequestContact.ts index 042175670..76f17e2d4 100644 --- a/src/api/resources/accounting/types/InvoiceRequestContact.ts +++ b/src/api/resources/accounting/types/InvoiceRequestContact.ts @@ -5,4 +5,4 @@ import type * as Merge from "../../../index"; /** * The invoice's contact. */ -export type InvoiceRequestContact = string | Merge.accounting.ContactRequest; +export type InvoiceRequestContact = string | Merge.accounting.Contact; diff --git a/src/api/resources/accounting/types/InvoiceRequestPaymentsItem.ts b/src/api/resources/accounting/types/InvoiceRequestPaymentsItem.ts index 8cdb7f6e9..bf019d862 100644 --- a/src/api/resources/accounting/types/InvoiceRequestPaymentsItem.ts +++ b/src/api/resources/accounting/types/InvoiceRequestPaymentsItem.ts @@ -2,4 +2,4 @@ import type * as Merge from "../../../index"; -export type InvoiceRequestPaymentsItem = string | Merge.accounting.PaymentRequest; +export type InvoiceRequestPaymentsItem = string | Merge.accounting.Payment; diff --git a/src/api/resources/accounting/types/InvoiceRequestPurchaseOrdersItem.ts b/src/api/resources/accounting/types/InvoiceRequestPurchaseOrdersItem.ts index a8e369849..f1c2dd198 100644 --- a/src/api/resources/accounting/types/InvoiceRequestPurchaseOrdersItem.ts +++ b/src/api/resources/accounting/types/InvoiceRequestPurchaseOrdersItem.ts @@ -2,4 +2,4 @@ import type * as Merge from "../../../index"; -export type InvoiceRequestPurchaseOrdersItem = string | Merge.accounting.PurchaseOrderRequest; +export type InvoiceRequestPurchaseOrdersItem = string | Merge.accounting.PurchaseOrder; diff --git a/src/api/resources/accounting/types/ItemFulfillmentLineRequestSalesOrderLine.ts b/src/api/resources/accounting/types/ItemFulfillmentLineRequestSalesOrderLine.ts index 67c808826..455080781 100644 --- a/src/api/resources/accounting/types/ItemFulfillmentLineRequestSalesOrderLine.ts +++ b/src/api/resources/accounting/types/ItemFulfillmentLineRequestSalesOrderLine.ts @@ -2,4 +2,4 @@ import type * as Merge from "../../../index"; -export type ItemFulfillmentLineRequestSalesOrderLine = string | Merge.accounting.SalesOrderLineRequest; +export type ItemFulfillmentLineRequestSalesOrderLine = string | Merge.accounting.SalesOrderLine; diff --git a/src/api/resources/accounting/types/ItemFulfillmentRequestRequestCustomer.ts b/src/api/resources/accounting/types/ItemFulfillmentRequestRequestCustomer.ts index 35d2cf109..5f6c099c3 100644 --- a/src/api/resources/accounting/types/ItemFulfillmentRequestRequestCustomer.ts +++ b/src/api/resources/accounting/types/ItemFulfillmentRequestRequestCustomer.ts @@ -5,4 +5,4 @@ import type * as Merge from "../../../index"; /** * The customer associated with the item fulfillment. */ -export type ItemFulfillmentRequestRequestCustomer = string | Merge.accounting.ContactRequest; +export type ItemFulfillmentRequestRequestCustomer = string | Merge.accounting.Contact; diff --git a/src/api/resources/accounting/types/ItemRequestRequestPurchaseAccount.ts b/src/api/resources/accounting/types/ItemRequestRequestPurchaseAccount.ts index 88af3207b..adfb9887f 100644 --- a/src/api/resources/accounting/types/ItemRequestRequestPurchaseAccount.ts +++ b/src/api/resources/accounting/types/ItemRequestRequestPurchaseAccount.ts @@ -5,4 +5,4 @@ import type * as Merge from "../../../index"; /** * References the default account used to record a purchase of the item. */ -export type ItemRequestRequestPurchaseAccount = string | Merge.accounting.AccountRequest; +export type ItemRequestRequestPurchaseAccount = string | Merge.accounting.Account; diff --git a/src/api/resources/accounting/types/ItemRequestRequestSalesAccount.ts b/src/api/resources/accounting/types/ItemRequestRequestSalesAccount.ts index b14a972d9..7b787038d 100644 --- a/src/api/resources/accounting/types/ItemRequestRequestSalesAccount.ts +++ b/src/api/resources/accounting/types/ItemRequestRequestSalesAccount.ts @@ -5,4 +5,4 @@ import type * as Merge from "../../../index"; /** * References the default account used to record a sale. */ -export type ItemRequestRequestSalesAccount = string | Merge.accounting.AccountRequest; +export type ItemRequestRequestSalesAccount = string | Merge.accounting.Account; diff --git a/src/api/resources/accounting/types/JournalEntryRequestLinesItem.ts b/src/api/resources/accounting/types/JournalEntryRequestLinesItem.ts index 8ac29b316..157b98a9c 100644 --- a/src/api/resources/accounting/types/JournalEntryRequestLinesItem.ts +++ b/src/api/resources/accounting/types/JournalEntryRequestLinesItem.ts @@ -2,4 +2,4 @@ import type * as Merge from "../../../index"; -export type JournalEntryRequestLinesItem = string | Merge.accounting.JournalLineRequest; +export type JournalEntryRequestLinesItem = string | Merge.accounting.JournalLine; diff --git a/src/api/resources/accounting/types/JournalEntryRequestPaymentsItem.ts b/src/api/resources/accounting/types/JournalEntryRequestPaymentsItem.ts index a8f1564fd..88069262d 100644 --- a/src/api/resources/accounting/types/JournalEntryRequestPaymentsItem.ts +++ b/src/api/resources/accounting/types/JournalEntryRequestPaymentsItem.ts @@ -2,4 +2,4 @@ import type * as Merge from "../../../index"; -export type JournalEntryRequestPaymentsItem = string | Merge.accounting.PaymentRequest; +export type JournalEntryRequestPaymentsItem = string | Merge.accounting.Payment; diff --git a/src/api/resources/accounting/types/JournalLineRequestAccount.ts b/src/api/resources/accounting/types/JournalLineRequestAccount.ts index bfc948472..285ea2147 100644 --- a/src/api/resources/accounting/types/JournalLineRequestAccount.ts +++ b/src/api/resources/accounting/types/JournalLineRequestAccount.ts @@ -2,4 +2,4 @@ import type * as Merge from "../../../index"; -export type JournalLineRequestAccount = string | Merge.accounting.AccountRequest; +export type JournalLineRequestAccount = string | Merge.accounting.Account; diff --git a/src/api/resources/accounting/types/PaymentRequestAccount.ts b/src/api/resources/accounting/types/PaymentRequestAccount.ts index 9eba3140d..b3f0a7fc1 100644 --- a/src/api/resources/accounting/types/PaymentRequestAccount.ts +++ b/src/api/resources/accounting/types/PaymentRequestAccount.ts @@ -5,4 +5,4 @@ import type * as Merge from "../../../index"; /** * The supplier’s or customer’s account in which the payment is made. */ -export type PaymentRequestAccount = string | Merge.accounting.AccountRequest; +export type PaymentRequestAccount = string | Merge.accounting.Account; diff --git a/src/api/resources/accounting/types/PaymentRequestAppliedToLinesItem.ts b/src/api/resources/accounting/types/PaymentRequestAppliedToLinesItem.ts index b909039fb..616ab65f3 100644 --- a/src/api/resources/accounting/types/PaymentRequestAppliedToLinesItem.ts +++ b/src/api/resources/accounting/types/PaymentRequestAppliedToLinesItem.ts @@ -2,4 +2,4 @@ import type * as Merge from "../../../index"; -export type PaymentRequestAppliedToLinesItem = string | Merge.accounting.PaymentLineItemRequest; +export type PaymentRequestAppliedToLinesItem = string | Merge.accounting.PaymentLineItem; diff --git a/src/api/resources/accounting/types/PaymentRequestContact.ts b/src/api/resources/accounting/types/PaymentRequestContact.ts index 36b70f45d..8db3a6e4b 100644 --- a/src/api/resources/accounting/types/PaymentRequestContact.ts +++ b/src/api/resources/accounting/types/PaymentRequestContact.ts @@ -5,4 +5,4 @@ import type * as Merge from "../../../index"; /** * The supplier, or customer involved in the payment. */ -export type PaymentRequestContact = string | Merge.accounting.ContactRequest; +export type PaymentRequestContact = string | Merge.accounting.Contact; diff --git a/src/api/resources/accounting/types/PurchaseOrderRequestDeliveryAddress.ts b/src/api/resources/accounting/types/PurchaseOrderRequestDeliveryAddress.ts index 33cca91d6..d590d3ff9 100644 --- a/src/api/resources/accounting/types/PurchaseOrderRequestDeliveryAddress.ts +++ b/src/api/resources/accounting/types/PurchaseOrderRequestDeliveryAddress.ts @@ -5,4 +5,4 @@ import type * as Merge from "../../../index"; /** * The purchase order's delivery address. */ -export type PurchaseOrderRequestDeliveryAddress = string | Merge.accounting.AddressRequest; +export type PurchaseOrderRequestDeliveryAddress = string | Merge.accounting.Address; diff --git a/src/api/resources/accounting/types/PurchaseOrderRequestLineItemsItem.ts b/src/api/resources/accounting/types/PurchaseOrderRequestLineItemsItem.ts index 9ba71ce7c..971420aae 100644 --- a/src/api/resources/accounting/types/PurchaseOrderRequestLineItemsItem.ts +++ b/src/api/resources/accounting/types/PurchaseOrderRequestLineItemsItem.ts @@ -2,4 +2,4 @@ import type * as Merge from "../../../index"; -export type PurchaseOrderRequestLineItemsItem = string | Merge.accounting.PurchaseOrderLineItemRequest; +export type PurchaseOrderRequestLineItemsItem = string | Merge.accounting.PurchaseOrderLineItem; diff --git a/src/api/resources/accounting/types/PurchaseOrderRequestVendor.ts b/src/api/resources/accounting/types/PurchaseOrderRequestVendor.ts index 015a0b539..7f03a26bc 100644 --- a/src/api/resources/accounting/types/PurchaseOrderRequestVendor.ts +++ b/src/api/resources/accounting/types/PurchaseOrderRequestVendor.ts @@ -5,4 +5,4 @@ import type * as Merge from "../../../index"; /** * The party fulfilling the purchase order. */ -export type PurchaseOrderRequestVendor = string | Merge.accounting.ContactRequest; +export type PurchaseOrderRequestVendor = string | Merge.accounting.Contact; diff --git a/src/api/resources/accounting/types/RemoteFieldApi.ts b/src/api/resources/accounting/types/RemoteFieldApi.ts index 19ef9a728..65692ecd8 100644 --- a/src/api/resources/accounting/types/RemoteFieldApi.ts +++ b/src/api/resources/accounting/types/RemoteFieldApi.ts @@ -7,6 +7,6 @@ export interface RemoteFieldApi { remoteKeyName: string; remoteEndpointInfo: Merge.accounting.RemoteEndpointInfo; exampleValues?: unknown[]; - advancedMetadata?: Merge.accounting.RemoteFieldApiAdvancedMetadata; + advancedMetadata?: Merge.accounting.AdvancedMetadata; coverage?: Merge.accounting.RemoteFieldApiCoverage; } diff --git a/src/api/resources/accounting/types/RemoteFieldApiAdvancedMetadata.ts b/src/api/resources/accounting/types/RemoteFieldApiAdvancedMetadata.ts deleted file mode 100644 index fab53c117..000000000 --- a/src/api/resources/accounting/types/RemoteFieldApiAdvancedMetadata.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Merge from "../../../index"; - -export type RemoteFieldApiAdvancedMetadata = Merge.accounting.AdvancedMetadata | string; diff --git a/src/api/resources/accounting/types/SalesOrderRequestRequestCustomer.ts b/src/api/resources/accounting/types/SalesOrderRequestRequestCustomer.ts index 2e6302ca5..6dcea5a97 100644 --- a/src/api/resources/accounting/types/SalesOrderRequestRequestCustomer.ts +++ b/src/api/resources/accounting/types/SalesOrderRequestRequestCustomer.ts @@ -5,4 +5,4 @@ import type * as Merge from "../../../index"; /** * The customer associated with the sales order. */ -export type SalesOrderRequestRequestCustomer = string | Merge.accounting.ContactRequest; +export type SalesOrderRequestRequestCustomer = string | Merge.accounting.Contact; diff --git a/src/api/resources/accounting/types/SalesOrderRequestRequestShippingAddress.ts b/src/api/resources/accounting/types/SalesOrderRequestRequestShippingAddress.ts index 68c5bbdc7..153fa59d2 100644 --- a/src/api/resources/accounting/types/SalesOrderRequestRequestShippingAddress.ts +++ b/src/api/resources/accounting/types/SalesOrderRequestRequestShippingAddress.ts @@ -5,4 +5,4 @@ import type * as Merge from "../../../index"; /** * The shipping address for the order. */ -export type SalesOrderRequestRequestShippingAddress = string | Merge.accounting.AddressRequest; +export type SalesOrderRequestRequestShippingAddress = string | Merge.accounting.Address; diff --git a/src/api/resources/accounting/types/VendorCreditApplyLineForVendorCreditRequestInvoice.ts b/src/api/resources/accounting/types/VendorCreditApplyLineForVendorCreditRequestInvoice.ts index 12282e881..d5c423523 100644 --- a/src/api/resources/accounting/types/VendorCreditApplyLineForVendorCreditRequestInvoice.ts +++ b/src/api/resources/accounting/types/VendorCreditApplyLineForVendorCreditRequestInvoice.ts @@ -2,4 +2,4 @@ import type * as Merge from "../../../index"; -export type VendorCreditApplyLineForVendorCreditRequestInvoice = string | Merge.accounting.InvoiceRequest; +export type VendorCreditApplyLineForVendorCreditRequestInvoice = string | Merge.accounting.Invoice; diff --git a/src/api/resources/accounting/types/VendorCreditLineRequestAccount.ts b/src/api/resources/accounting/types/VendorCreditLineRequestAccount.ts index 787ffd9c6..45736bf23 100644 --- a/src/api/resources/accounting/types/VendorCreditLineRequestAccount.ts +++ b/src/api/resources/accounting/types/VendorCreditLineRequestAccount.ts @@ -5,4 +5,4 @@ import type * as Merge from "../../../index"; /** * The line's account. */ -export type VendorCreditLineRequestAccount = string | Merge.accounting.AccountRequest; +export type VendorCreditLineRequestAccount = string | Merge.accounting.Account; diff --git a/src/api/resources/accounting/types/VendorCreditLineRequestContact.ts b/src/api/resources/accounting/types/VendorCreditLineRequestContact.ts index e80f3100d..7bae178ca 100644 --- a/src/api/resources/accounting/types/VendorCreditLineRequestContact.ts +++ b/src/api/resources/accounting/types/VendorCreditLineRequestContact.ts @@ -2,4 +2,4 @@ import type * as Merge from "../../../index"; -export type VendorCreditLineRequestContact = string | Merge.accounting.ContactRequest; +export type VendorCreditLineRequestContact = string | Merge.accounting.Contact; diff --git a/src/api/resources/accounting/types/VendorCreditRequestVendor.ts b/src/api/resources/accounting/types/VendorCreditRequestVendor.ts index 4f0ed45e8..81316ad06 100644 --- a/src/api/resources/accounting/types/VendorCreditRequestVendor.ts +++ b/src/api/resources/accounting/types/VendorCreditRequestVendor.ts @@ -5,4 +5,4 @@ import type * as Merge from "../../../index"; /** * The vendor that owes the gift or refund. */ -export type VendorCreditRequestVendor = string | Merge.accounting.ContactRequest; +export type VendorCreditRequestVendor = string | Merge.accounting.Contact; diff --git a/src/api/resources/accounting/types/WarningValidationProblem.ts b/src/api/resources/accounting/types/WarningValidationProblem.ts index 5266700fe..f0b378879 100644 --- a/src/api/resources/accounting/types/WarningValidationProblem.ts +++ b/src/api/resources/accounting/types/WarningValidationProblem.ts @@ -8,4 +8,6 @@ export interface WarningValidationProblem { detail: string; problemType: string; blockMergeLink?: boolean; + rawError?: string; + errorCode?: number; } diff --git a/src/api/resources/accounting/types/index.ts b/src/api/resources/accounting/types/index.ts index ea551ca32..4ae0bfdcb 100644 --- a/src/api/resources/accounting/types/index.ts +++ b/src/api/resources/accounting/types/index.ts @@ -69,7 +69,11 @@ export * from "./BankFeedTransactionRequestRequestCreditOrDebit"; export * from "./BankFeedTransactionResponse"; export * from "./BatchObject"; export * from "./BatchObjectItemResponse"; +export * from "./BatchObjectStatus"; +export * from "./BatchObjectStatusEnum"; export * from "./BatchObjectsResponse"; +export * from "./BatchObjectsResponseStatus"; +export * from "./BatchObjectsResponseStatusEnum"; export * from "./CashFlowStatement"; export * from "./CashFlowStatementCompany"; export * from "./CashFlowStatementCurrency"; @@ -137,8 +141,6 @@ export * from "./CreditNoteStatusEnum"; export * from "./CreditNoteTrackingCategoriesItem"; export * from "./CreditOrDebitEnum"; export * from "./DataPassthroughRequest"; -export * from "./DataPassthroughRequestMethod"; -export * from "./DataPassthroughRequestRequestFormat"; export * from "./DebugModeLog"; export * from "./DebugModelLogSummary"; export * from "./Employee"; @@ -494,7 +496,6 @@ export * from "./RemoteData"; export * from "./RemoteEndpointInfo"; export * from "./RemoteField"; export * from "./RemoteFieldApi"; -export * from "./RemoteFieldApiAdvancedMetadata"; export * from "./RemoteFieldApiCoverage"; export * from "./RemoteFieldApiResponse"; export * from "./RemoteFieldClass"; diff --git a/src/serialization/resources/accounting/resources/expenses/client/requests/ExpenseBulkRequest.ts b/src/serialization/resources/accounting/resources/expenses/client/requests/ExpenseBulkRequest.ts index 717f5f496..c5d4ae457 100644 --- a/src/serialization/resources/accounting/resources/expenses/client/requests/ExpenseBulkRequest.ts +++ b/src/serialization/resources/accounting/resources/expenses/client/requests/ExpenseBulkRequest.ts @@ -7,7 +7,7 @@ import { ExpenseBatchItemRequest } from "../../../../types/ExpenseBatchItemReque export const ExpenseBulkRequest: core.serialization.Schema< serializers.accounting.ExpenseBulkRequest.Raw, - Omit + Merge.accounting.ExpenseBulkRequest > = core.serialization.object({ batchItems: core.serialization.property("batch_items", core.serialization.list(ExpenseBatchItemRequest)), }); diff --git a/src/serialization/resources/accounting/resources/expenses/types/ExpensesBatchObjectsListRequestExpandItem.ts b/src/serialization/resources/accounting/resources/expenses/types/ExpensesBatchObjectsListRequestExpandItem.ts deleted file mode 100644 index f8163e2d6..000000000 --- a/src/serialization/resources/accounting/resources/expenses/types/ExpensesBatchObjectsListRequestExpandItem.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Merge from "../../../../../../api/index"; -import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; - -export const ExpensesBatchObjectsListRequestExpandItem: core.serialization.Schema< - serializers.accounting.ExpensesBatchObjectsListRequestExpandItem.Raw, - Merge.accounting.ExpensesBatchObjectsListRequestExpandItem -> = core.serialization.enum_(["account", "accounting_period", "company", "contact", "employee", "tracking_categories"]); - -export declare namespace ExpensesBatchObjectsListRequestExpandItem { - export type Raw = "account" | "accounting_period" | "company" | "contact" | "employee" | "tracking_categories"; -} diff --git a/src/serialization/resources/accounting/resources/expenses/types/index.ts b/src/serialization/resources/accounting/resources/expenses/types/index.ts index 1c81575ae..d63e24e45 100644 --- a/src/serialization/resources/accounting/resources/expenses/types/index.ts +++ b/src/serialization/resources/accounting/resources/expenses/types/index.ts @@ -1,3 +1,2 @@ -export * from "./ExpensesBatchObjectsListRequestExpandItem"; export * from "./ExpensesListRequestExpandItem"; export * from "./ExpensesRetrieveRequestExpandItem"; diff --git a/src/serialization/resources/accounting/resources/invoices/client/requests/InvoiceBulkRequest.ts b/src/serialization/resources/accounting/resources/invoices/client/requests/InvoiceBulkRequest.ts index 667ceb57a..c7946441d 100644 --- a/src/serialization/resources/accounting/resources/invoices/client/requests/InvoiceBulkRequest.ts +++ b/src/serialization/resources/accounting/resources/invoices/client/requests/InvoiceBulkRequest.ts @@ -7,7 +7,7 @@ import { InvoiceBatchItemRequest } from "../../../../types/InvoiceBatchItemReque export const InvoiceBulkRequest: core.serialization.Schema< serializers.accounting.InvoiceBulkRequest.Raw, - Omit + Merge.accounting.InvoiceBulkRequest > = core.serialization.object({ batchItems: core.serialization.property("batch_items", core.serialization.list(InvoiceBatchItemRequest)), }); diff --git a/src/serialization/resources/accounting/resources/invoices/types/InvoicesBatchObjectsListRequestExpandItem.ts b/src/serialization/resources/accounting/resources/invoices/types/InvoicesBatchObjectsListRequestExpandItem.ts deleted file mode 100644 index 1a3510603..000000000 --- a/src/serialization/resources/accounting/resources/invoices/types/InvoicesBatchObjectsListRequestExpandItem.ts +++ /dev/null @@ -1,41 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Merge from "../../../../../../api/index"; -import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; - -export const InvoicesBatchObjectsListRequestExpandItem: core.serialization.Schema< - serializers.accounting.InvoicesBatchObjectsListRequestExpandItem.Raw, - Merge.accounting.InvoicesBatchObjectsListRequestExpandItem -> = core.serialization.enum_([ - "accounting_period", - "applied_credit_notes", - "applied_payments", - "applied_vendor_credits", - "company", - "contact", - "employee", - "line_items", - "payment_term", - "payments", - "purchase_orders", - "sales_orders", - "tracking_categories", -]); - -export declare namespace InvoicesBatchObjectsListRequestExpandItem { - export type Raw = - | "accounting_period" - | "applied_credit_notes" - | "applied_payments" - | "applied_vendor_credits" - | "company" - | "contact" - | "employee" - | "line_items" - | "payment_term" - | "payments" - | "purchase_orders" - | "sales_orders" - | "tracking_categories"; -} diff --git a/src/serialization/resources/accounting/resources/invoices/types/InvoicesBatchObjectsListRequestStatus.ts b/src/serialization/resources/accounting/resources/invoices/types/InvoicesBatchObjectsListRequestStatus.ts deleted file mode 100644 index 630dc9d11..000000000 --- a/src/serialization/resources/accounting/resources/invoices/types/InvoicesBatchObjectsListRequestStatus.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Merge from "../../../../../../api/index"; -import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; - -export const InvoicesBatchObjectsListRequestStatus: core.serialization.Schema< - serializers.accounting.InvoicesBatchObjectsListRequestStatus.Raw, - Merge.accounting.InvoicesBatchObjectsListRequestStatus -> = core.serialization.enum_(["DRAFT", "OPEN", "PAID", "PARTIALLY_PAID", "SUBMITTED", "VOID"]); - -export declare namespace InvoicesBatchObjectsListRequestStatus { - export type Raw = "DRAFT" | "OPEN" | "PAID" | "PARTIALLY_PAID" | "SUBMITTED" | "VOID"; -} diff --git a/src/serialization/resources/accounting/resources/invoices/types/InvoicesBatchObjectsListRequestType.ts b/src/serialization/resources/accounting/resources/invoices/types/InvoicesBatchObjectsListRequestType.ts deleted file mode 100644 index fb56ce01e..000000000 --- a/src/serialization/resources/accounting/resources/invoices/types/InvoicesBatchObjectsListRequestType.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Merge from "../../../../../../api/index"; -import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; - -export const InvoicesBatchObjectsListRequestType: core.serialization.Schema< - serializers.accounting.InvoicesBatchObjectsListRequestType.Raw, - Merge.accounting.InvoicesBatchObjectsListRequestType -> = core.serialization.enum_(["ACCOUNTS_PAYABLE", "ACCOUNTS_RECEIVABLE"]); - -export declare namespace InvoicesBatchObjectsListRequestType { - export type Raw = "ACCOUNTS_PAYABLE" | "ACCOUNTS_RECEIVABLE"; -} diff --git a/src/serialization/resources/accounting/resources/invoices/types/index.ts b/src/serialization/resources/accounting/resources/invoices/types/index.ts index d690b827a..35fff0ee5 100644 --- a/src/serialization/resources/accounting/resources/invoices/types/index.ts +++ b/src/serialization/resources/accounting/resources/invoices/types/index.ts @@ -1,6 +1,3 @@ -export * from "./InvoicesBatchObjectsListRequestExpandItem"; -export * from "./InvoicesBatchObjectsListRequestStatus"; -export * from "./InvoicesBatchObjectsListRequestType"; export * from "./InvoicesListRequestExpandItem"; export * from "./InvoicesListRequestStatus"; export * from "./InvoicesListRequestType"; diff --git a/src/serialization/resources/accounting/resources/itemFulfillments/client/requests/ItemFulfillmentBulkRequest.ts b/src/serialization/resources/accounting/resources/itemFulfillments/client/requests/ItemFulfillmentBulkRequest.ts index 3f831bd98..f1a428c3b 100644 --- a/src/serialization/resources/accounting/resources/itemFulfillments/client/requests/ItemFulfillmentBulkRequest.ts +++ b/src/serialization/resources/accounting/resources/itemFulfillments/client/requests/ItemFulfillmentBulkRequest.ts @@ -7,7 +7,7 @@ import { ItemFulfillmentBatchItemRequest } from "../../../../types/ItemFulfillme export const ItemFulfillmentBulkRequest: core.serialization.Schema< serializers.accounting.ItemFulfillmentBulkRequest.Raw, - Omit + Merge.accounting.ItemFulfillmentBulkRequest > = core.serialization.object({ batchItems: core.serialization.property("batch_items", core.serialization.list(ItemFulfillmentBatchItemRequest)), }); diff --git a/src/serialization/resources/accounting/resources/itemFulfillments/types/ItemFulfillmentsBatchObjectsListRequestExpandItem.ts b/src/serialization/resources/accounting/resources/itemFulfillments/types/ItemFulfillmentsBatchObjectsListRequestExpandItem.ts deleted file mode 100644 index f81737e39..000000000 --- a/src/serialization/resources/accounting/resources/itemFulfillments/types/ItemFulfillmentsBatchObjectsListRequestExpandItem.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Merge from "../../../../../../api/index"; -import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; - -export const ItemFulfillmentsBatchObjectsListRequestExpandItem: core.serialization.Schema< - serializers.accounting.ItemFulfillmentsBatchObjectsListRequestExpandItem.Raw, - Merge.accounting.ItemFulfillmentsBatchObjectsListRequestExpandItem -> = core.serialization.enum_(["company", "customer", "lines", "sales_order"]); - -export declare namespace ItemFulfillmentsBatchObjectsListRequestExpandItem { - export type Raw = "company" | "customer" | "lines" | "sales_order"; -} diff --git a/src/serialization/resources/accounting/resources/itemFulfillments/types/index.ts b/src/serialization/resources/accounting/resources/itemFulfillments/types/index.ts index 64e091163..41b4a29c2 100644 --- a/src/serialization/resources/accounting/resources/itemFulfillments/types/index.ts +++ b/src/serialization/resources/accounting/resources/itemFulfillments/types/index.ts @@ -1,3 +1,2 @@ -export * from "./ItemFulfillmentsBatchObjectsListRequestExpandItem"; export * from "./ItemFulfillmentsListRequestExpandItem"; export * from "./ItemFulfillmentsRetrieveRequestExpandItem"; diff --git a/src/serialization/resources/accounting/resources/salesOrders/client/requests/SalesOrderBulkRequest.ts b/src/serialization/resources/accounting/resources/salesOrders/client/requests/SalesOrderBulkRequest.ts index dfd4d7b56..e400bb63c 100644 --- a/src/serialization/resources/accounting/resources/salesOrders/client/requests/SalesOrderBulkRequest.ts +++ b/src/serialization/resources/accounting/resources/salesOrders/client/requests/SalesOrderBulkRequest.ts @@ -7,7 +7,7 @@ import { SalesOrderBatchItemRequest } from "../../../../types/SalesOrderBatchIte export const SalesOrderBulkRequest: core.serialization.Schema< serializers.accounting.SalesOrderBulkRequest.Raw, - Omit + Merge.accounting.SalesOrderBulkRequest > = core.serialization.object({ batchItems: core.serialization.property("batch_items", core.serialization.list(SalesOrderBatchItemRequest)), }); diff --git a/src/serialization/resources/accounting/resources/salesOrders/types/SalesOrdersBatchObjectsListRequestExpandItem.ts b/src/serialization/resources/accounting/resources/salesOrders/types/SalesOrdersBatchObjectsListRequestExpandItem.ts deleted file mode 100644 index f1a6268b6..000000000 --- a/src/serialization/resources/accounting/resources/salesOrders/types/SalesOrdersBatchObjectsListRequestExpandItem.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Merge from "../../../../../../api/index"; -import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; - -export const SalesOrdersBatchObjectsListRequestExpandItem: core.serialization.Schema< - serializers.accounting.SalesOrdersBatchObjectsListRequestExpandItem.Raw, - Merge.accounting.SalesOrdersBatchObjectsListRequestExpandItem -> = core.serialization.enum_([ - "company", - "customer", - "lines", - "payment_term", - "shipping_address", - "tracking_categories", -]); - -export declare namespace SalesOrdersBatchObjectsListRequestExpandItem { - export type Raw = "company" | "customer" | "lines" | "payment_term" | "shipping_address" | "tracking_categories"; -} diff --git a/src/serialization/resources/accounting/resources/salesOrders/types/index.ts b/src/serialization/resources/accounting/resources/salesOrders/types/index.ts index df5f74cbe..20a37d0ed 100644 --- a/src/serialization/resources/accounting/resources/salesOrders/types/index.ts +++ b/src/serialization/resources/accounting/resources/salesOrders/types/index.ts @@ -1,3 +1,2 @@ -export * from "./SalesOrdersBatchObjectsListRequestExpandItem"; export * from "./SalesOrdersListRequestExpandItem"; export * from "./SalesOrdersRetrieveRequestExpandItem"; diff --git a/src/serialization/resources/accounting/types/BankFeedTransactionRequestRequestBankFeedAccount.ts b/src/serialization/resources/accounting/types/BankFeedTransactionRequestRequestBankFeedAccount.ts index aaba539a6..768ca2037 100644 --- a/src/serialization/resources/accounting/types/BankFeedTransactionRequestRequestBankFeedAccount.ts +++ b/src/serialization/resources/accounting/types/BankFeedTransactionRequestRequestBankFeedAccount.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { BankFeedAccountRequest } from "./BankFeedAccountRequest"; +import { BankFeedAccount } from "./BankFeedAccount"; export const BankFeedTransactionRequestRequestBankFeedAccount: core.serialization.Schema< serializers.accounting.BankFeedTransactionRequestRequestBankFeedAccount.Raw, Merge.accounting.BankFeedTransactionRequestRequestBankFeedAccount -> = core.serialization.undiscriminatedUnion([core.serialization.string(), BankFeedAccountRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), BankFeedAccount]); export declare namespace BankFeedTransactionRequestRequestBankFeedAccount { - export type Raw = string | BankFeedAccountRequest.Raw; + export type Raw = string | BankFeedAccount.Raw; } diff --git a/src/serialization/resources/accounting/types/BatchObject.ts b/src/serialization/resources/accounting/types/BatchObject.ts index 80f451cd1..693952728 100644 --- a/src/serialization/resources/accounting/types/BatchObject.ts +++ b/src/serialization/resources/accounting/types/BatchObject.ts @@ -4,20 +4,21 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; import { BatchObjectItemResponse } from "./BatchObjectItemResponse"; +import { BatchObjectStatus } from "./BatchObjectStatus"; export const BatchObject: core.serialization.ObjectSchema< serializers.accounting.BatchObject.Raw, Merge.accounting.BatchObject > = core.serialization.object({ itemId: core.serialization.property("item_id", core.serialization.string()), - status: core.serialization.string(), + status: BatchObjectStatus, response: BatchObjectItemResponse.optional(), }); export declare namespace BatchObject { export interface Raw { item_id: string; - status: string; + status: BatchObjectStatus.Raw; response?: BatchObjectItemResponse.Raw | null; } } diff --git a/src/serialization/resources/accounting/types/BatchObjectStatus.ts b/src/serialization/resources/accounting/types/BatchObjectStatus.ts new file mode 100644 index 000000000..292e33709 --- /dev/null +++ b/src/serialization/resources/accounting/types/BatchObjectStatus.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Merge from "../../../../api/index"; +import * as core from "../../../../core"; +import type * as serializers from "../../../index"; +import { BatchObjectStatusEnum } from "./BatchObjectStatusEnum"; + +export const BatchObjectStatus: core.serialization.Schema< + serializers.accounting.BatchObjectStatus.Raw, + Merge.accounting.BatchObjectStatus +> = core.serialization.undiscriminatedUnion([BatchObjectStatusEnum, core.serialization.string()]); + +export declare namespace BatchObjectStatus { + export type Raw = BatchObjectStatusEnum.Raw | string; +} diff --git a/src/serialization/resources/accounting/types/BatchObjectStatusEnum.ts b/src/serialization/resources/accounting/types/BatchObjectStatusEnum.ts new file mode 100644 index 000000000..1e92e8d9a --- /dev/null +++ b/src/serialization/resources/accounting/types/BatchObjectStatusEnum.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Merge from "../../../../api/index"; +import * as core from "../../../../core"; +import type * as serializers from "../../../index"; + +export const BatchObjectStatusEnum: core.serialization.Schema< + serializers.accounting.BatchObjectStatusEnum.Raw, + Merge.accounting.BatchObjectStatusEnum +> = core.serialization.enum_(["PENDING", "SUCCESS", "FAILURE"]); + +export declare namespace BatchObjectStatusEnum { + export type Raw = "PENDING" | "SUCCESS" | "FAILURE"; +} diff --git a/src/serialization/resources/accounting/types/BatchObjectsResponse.ts b/src/serialization/resources/accounting/types/BatchObjectsResponse.ts index 46762573c..fc05a8cab 100644 --- a/src/serialization/resources/accounting/types/BatchObjectsResponse.ts +++ b/src/serialization/resources/accounting/types/BatchObjectsResponse.ts @@ -4,13 +4,14 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; import { BatchObject } from "./BatchObject"; +import { BatchObjectsResponseStatus } from "./BatchObjectsResponseStatus"; export const BatchObjectsResponse: core.serialization.ObjectSchema< serializers.accounting.BatchObjectsResponse.Raw, Merge.accounting.BatchObjectsResponse > = core.serialization.object({ batchId: core.serialization.property("batch_id", core.serialization.string()), - status: core.serialization.string(), + status: BatchObjectsResponseStatus, totalCount: core.serialization.property("total_count", core.serialization.number()), objects: core.serialization.list(BatchObject), }); @@ -18,7 +19,7 @@ export const BatchObjectsResponse: core.serialization.ObjectSchema< export declare namespace BatchObjectsResponse { export interface Raw { batch_id: string; - status: string; + status: BatchObjectsResponseStatus.Raw; total_count: number; objects: BatchObject.Raw[]; } diff --git a/src/serialization/resources/accounting/types/BatchObjectsResponseStatus.ts b/src/serialization/resources/accounting/types/BatchObjectsResponseStatus.ts new file mode 100644 index 000000000..144566b95 --- /dev/null +++ b/src/serialization/resources/accounting/types/BatchObjectsResponseStatus.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Merge from "../../../../api/index"; +import * as core from "../../../../core"; +import type * as serializers from "../../../index"; +import { BatchObjectsResponseStatusEnum } from "./BatchObjectsResponseStatusEnum"; + +export const BatchObjectsResponseStatus: core.serialization.Schema< + serializers.accounting.BatchObjectsResponseStatus.Raw, + Merge.accounting.BatchObjectsResponseStatus +> = core.serialization.undiscriminatedUnion([BatchObjectsResponseStatusEnum, core.serialization.string()]); + +export declare namespace BatchObjectsResponseStatus { + export type Raw = BatchObjectsResponseStatusEnum.Raw | string; +} diff --git a/src/serialization/resources/accounting/types/BatchObjectsResponseStatusEnum.ts b/src/serialization/resources/accounting/types/BatchObjectsResponseStatusEnum.ts new file mode 100644 index 000000000..826356349 --- /dev/null +++ b/src/serialization/resources/accounting/types/BatchObjectsResponseStatusEnum.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Merge from "../../../../api/index"; +import * as core from "../../../../core"; +import type * as serializers from "../../../index"; + +export const BatchObjectsResponseStatusEnum: core.serialization.Schema< + serializers.accounting.BatchObjectsResponseStatusEnum.Raw, + Merge.accounting.BatchObjectsResponseStatusEnum +> = core.serialization.enum_(["ENQUEUED", "IN_PROGRESS", "PARTIAL_SUCCESS", "SUCCESS", "FAILED", "RATE_LIMITED"]); + +export declare namespace BatchObjectsResponseStatusEnum { + export type Raw = "ENQUEUED" | "IN_PROGRESS" | "PARTIAL_SUCCESS" | "SUCCESS" | "FAILED" | "RATE_LIMITED"; +} diff --git a/src/serialization/resources/accounting/types/ContactRequestAddressesItem.ts b/src/serialization/resources/accounting/types/ContactRequestAddressesItem.ts index 14b617139..111ed8199 100644 --- a/src/serialization/resources/accounting/types/ContactRequestAddressesItem.ts +++ b/src/serialization/resources/accounting/types/ContactRequestAddressesItem.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { AddressRequest } from "./AddressRequest"; +import { Address } from "./Address"; export const ContactRequestAddressesItem: core.serialization.Schema< serializers.accounting.ContactRequestAddressesItem.Raw, Merge.accounting.ContactRequestAddressesItem -> = core.serialization.undiscriminatedUnion([core.serialization.string(), AddressRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), Address]); export declare namespace ContactRequestAddressesItem { - export type Raw = string | AddressRequest.Raw; + export type Raw = string | Address.Raw; } diff --git a/src/serialization/resources/accounting/types/ContactRequestPhoneNumbersItem.ts b/src/serialization/resources/accounting/types/ContactRequestPhoneNumbersItem.ts index 04e108b9f..2572bdb37 100644 --- a/src/serialization/resources/accounting/types/ContactRequestPhoneNumbersItem.ts +++ b/src/serialization/resources/accounting/types/ContactRequestPhoneNumbersItem.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { AccountingPhoneNumberRequest } from "./AccountingPhoneNumberRequest"; +import { AccountingPhoneNumber } from "./AccountingPhoneNumber"; export const ContactRequestPhoneNumbersItem: core.serialization.Schema< serializers.accounting.ContactRequestPhoneNumbersItem.Raw, Merge.accounting.ContactRequestPhoneNumbersItem -> = core.serialization.undiscriminatedUnion([core.serialization.string(), AccountingPhoneNumberRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), AccountingPhoneNumber]); export declare namespace ContactRequestPhoneNumbersItem { - export type Raw = string | AccountingPhoneNumberRequest.Raw; + export type Raw = string | AccountingPhoneNumber.Raw; } diff --git a/src/serialization/resources/accounting/types/CreditNoteApplyLineForCreditNoteRequestInvoice.ts b/src/serialization/resources/accounting/types/CreditNoteApplyLineForCreditNoteRequestInvoice.ts index c7d507930..c05ab3515 100644 --- a/src/serialization/resources/accounting/types/CreditNoteApplyLineForCreditNoteRequestInvoice.ts +++ b/src/serialization/resources/accounting/types/CreditNoteApplyLineForCreditNoteRequestInvoice.ts @@ -2,14 +2,16 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; -import { InvoiceRequest } from "./InvoiceRequest"; +import * as serializers from "../../../index"; export const CreditNoteApplyLineForCreditNoteRequestInvoice: core.serialization.Schema< serializers.accounting.CreditNoteApplyLineForCreditNoteRequestInvoice.Raw, Merge.accounting.CreditNoteApplyLineForCreditNoteRequestInvoice -> = core.serialization.undiscriminatedUnion([core.serialization.string(), InvoiceRequest]); +> = core.serialization.undiscriminatedUnion([ + core.serialization.string(), + core.serialization.lazyObject(() => serializers.accounting.Invoice), +]); export declare namespace CreditNoteApplyLineForCreditNoteRequestInvoice { - export type Raw = string | InvoiceRequest.Raw; + export type Raw = string | serializers.accounting.Invoice.Raw; } diff --git a/src/serialization/resources/accounting/types/CreditNoteLineItemRequestContact.ts b/src/serialization/resources/accounting/types/CreditNoteLineItemRequestContact.ts index 039caae77..5c16007cb 100644 --- a/src/serialization/resources/accounting/types/CreditNoteLineItemRequestContact.ts +++ b/src/serialization/resources/accounting/types/CreditNoteLineItemRequestContact.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { ContactRequest } from "./ContactRequest"; +import { Contact } from "./Contact"; export const CreditNoteLineItemRequestContact: core.serialization.Schema< serializers.accounting.CreditNoteLineItemRequestContact.Raw, Merge.accounting.CreditNoteLineItemRequestContact -> = core.serialization.undiscriminatedUnion([core.serialization.string(), ContactRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), Contact]); export declare namespace CreditNoteLineItemRequestContact { - export type Raw = string | ContactRequest.Raw; + export type Raw = string | Contact.Raw; } diff --git a/src/serialization/resources/accounting/types/CreditNoteRequestAppliedPaymentsItem.ts b/src/serialization/resources/accounting/types/CreditNoteRequestAppliedPaymentsItem.ts index e9d211073..37aaea371 100644 --- a/src/serialization/resources/accounting/types/CreditNoteRequestAppliedPaymentsItem.ts +++ b/src/serialization/resources/accounting/types/CreditNoteRequestAppliedPaymentsItem.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { PaymentLineItemRequest } from "./PaymentLineItemRequest"; +import { PaymentLineItem } from "./PaymentLineItem"; export const CreditNoteRequestAppliedPaymentsItem: core.serialization.Schema< serializers.accounting.CreditNoteRequestAppliedPaymentsItem.Raw, Merge.accounting.CreditNoteRequestAppliedPaymentsItem -> = core.serialization.undiscriminatedUnion([core.serialization.string(), PaymentLineItemRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), PaymentLineItem]); export declare namespace CreditNoteRequestAppliedPaymentsItem { - export type Raw = string | PaymentLineItemRequest.Raw; + export type Raw = string | PaymentLineItem.Raw; } diff --git a/src/serialization/resources/accounting/types/CreditNoteRequestContact.ts b/src/serialization/resources/accounting/types/CreditNoteRequestContact.ts index 5b84cb3b7..54b98b94b 100644 --- a/src/serialization/resources/accounting/types/CreditNoteRequestContact.ts +++ b/src/serialization/resources/accounting/types/CreditNoteRequestContact.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { ContactRequest } from "./ContactRequest"; +import { Contact } from "./Contact"; export const CreditNoteRequestContact: core.serialization.Schema< serializers.accounting.CreditNoteRequestContact.Raw, Merge.accounting.CreditNoteRequestContact -> = core.serialization.undiscriminatedUnion([core.serialization.string(), ContactRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), Contact]); export declare namespace CreditNoteRequestContact { - export type Raw = string | ContactRequest.Raw; + export type Raw = string | Contact.Raw; } diff --git a/src/serialization/resources/accounting/types/CreditNoteRequestLineItemsItem.ts b/src/serialization/resources/accounting/types/CreditNoteRequestLineItemsItem.ts index 384b163d5..d6afd6a22 100644 --- a/src/serialization/resources/accounting/types/CreditNoteRequestLineItemsItem.ts +++ b/src/serialization/resources/accounting/types/CreditNoteRequestLineItemsItem.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { CreditNoteLineItemRequest } from "./CreditNoteLineItemRequest"; +import { CreditNoteLineItem } from "./CreditNoteLineItem"; export const CreditNoteRequestLineItemsItem: core.serialization.Schema< serializers.accounting.CreditNoteRequestLineItemsItem.Raw, Merge.accounting.CreditNoteRequestLineItemsItem -> = core.serialization.undiscriminatedUnion([core.serialization.string(), CreditNoteLineItemRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), CreditNoteLineItem]); export declare namespace CreditNoteRequestLineItemsItem { - export type Raw = string | CreditNoteLineItemRequest.Raw; + export type Raw = string | CreditNoteLineItem.Raw; } diff --git a/src/serialization/resources/accounting/types/CreditNoteRequestPaymentsItem.ts b/src/serialization/resources/accounting/types/CreditNoteRequestPaymentsItem.ts index 5f878648e..2fa6f78c0 100644 --- a/src/serialization/resources/accounting/types/CreditNoteRequestPaymentsItem.ts +++ b/src/serialization/resources/accounting/types/CreditNoteRequestPaymentsItem.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { PaymentRequest } from "./PaymentRequest"; +import { Payment } from "./Payment"; export const CreditNoteRequestPaymentsItem: core.serialization.Schema< serializers.accounting.CreditNoteRequestPaymentsItem.Raw, Merge.accounting.CreditNoteRequestPaymentsItem -> = core.serialization.undiscriminatedUnion([core.serialization.string(), PaymentRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), Payment]); export declare namespace CreditNoteRequestPaymentsItem { - export type Raw = string | PaymentRequest.Raw; + export type Raw = string | Payment.Raw; } diff --git a/src/serialization/resources/accounting/types/DataPassthroughRequest.ts b/src/serialization/resources/accounting/types/DataPassthroughRequest.ts index 6acb4d9ff..bea54e42d 100644 --- a/src/serialization/resources/accounting/types/DataPassthroughRequest.ts +++ b/src/serialization/resources/accounting/types/DataPassthroughRequest.ts @@ -3,15 +3,15 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { DataPassthroughRequestMethod } from "./DataPassthroughRequestMethod"; -import { DataPassthroughRequestRequestFormat } from "./DataPassthroughRequestRequestFormat"; +import { MethodEnum } from "./MethodEnum"; import { MultipartFormFieldRequest } from "./MultipartFormFieldRequest"; +import { RequestFormatEnum } from "./RequestFormatEnum"; export const DataPassthroughRequest: core.serialization.ObjectSchema< serializers.accounting.DataPassthroughRequest.Raw, Merge.accounting.DataPassthroughRequest > = core.serialization.object({ - method: DataPassthroughRequestMethod, + method: MethodEnum, path: core.serialization.string(), baseUrlOverride: core.serialization.property("base_url_override", core.serialization.string().optional()), data: core.serialization.string().optional(), @@ -20,19 +20,19 @@ export const DataPassthroughRequest: core.serialization.ObjectSchema< core.serialization.list(MultipartFormFieldRequest).optional(), ), headers: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - requestFormat: core.serialization.property("request_format", DataPassthroughRequestRequestFormat.optional()), + requestFormat: core.serialization.property("request_format", RequestFormatEnum.optional()), normalizeResponse: core.serialization.property("normalize_response", core.serialization.boolean().optional()), }); export declare namespace DataPassthroughRequest { export interface Raw { - method: DataPassthroughRequestMethod.Raw; + method: MethodEnum.Raw; path: string; base_url_override?: string | null; data?: string | null; multipart_form_data?: MultipartFormFieldRequest.Raw[] | null; headers?: Record | null; - request_format?: DataPassthroughRequestRequestFormat.Raw | null; + request_format?: RequestFormatEnum.Raw | null; normalize_response?: boolean | null; } } diff --git a/src/serialization/resources/accounting/types/DataPassthroughRequestMethod.ts b/src/serialization/resources/accounting/types/DataPassthroughRequestMethod.ts deleted file mode 100644 index 137a96e09..000000000 --- a/src/serialization/resources/accounting/types/DataPassthroughRequestMethod.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Merge from "../../../../api/index"; -import * as core from "../../../../core"; -import type * as serializers from "../../../index"; -import { MethodEnum } from "./MethodEnum"; - -export const DataPassthroughRequestMethod: core.serialization.Schema< - serializers.accounting.DataPassthroughRequestMethod.Raw, - Merge.accounting.DataPassthroughRequestMethod -> = core.serialization.undiscriminatedUnion([MethodEnum, core.serialization.string()]); - -export declare namespace DataPassthroughRequestMethod { - export type Raw = MethodEnum.Raw | string; -} diff --git a/src/serialization/resources/accounting/types/DataPassthroughRequestRequestFormat.ts b/src/serialization/resources/accounting/types/DataPassthroughRequestRequestFormat.ts deleted file mode 100644 index 66a5758c7..000000000 --- a/src/serialization/resources/accounting/types/DataPassthroughRequestRequestFormat.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Merge from "../../../../api/index"; -import * as core from "../../../../core"; -import type * as serializers from "../../../index"; -import { RequestFormatEnum } from "./RequestFormatEnum"; - -export const DataPassthroughRequestRequestFormat: core.serialization.Schema< - serializers.accounting.DataPassthroughRequestRequestFormat.Raw, - Merge.accounting.DataPassthroughRequestRequestFormat -> = core.serialization.undiscriminatedUnion([RequestFormatEnum, core.serialization.string()]); - -export declare namespace DataPassthroughRequestRequestFormat { - export type Raw = RequestFormatEnum.Raw | string; -} diff --git a/src/serialization/resources/accounting/types/ErrorValidationProblem.ts b/src/serialization/resources/accounting/types/ErrorValidationProblem.ts index c9b8c0f28..3015986d4 100644 --- a/src/serialization/resources/accounting/types/ErrorValidationProblem.ts +++ b/src/serialization/resources/accounting/types/ErrorValidationProblem.ts @@ -14,6 +14,8 @@ export const ErrorValidationProblem: core.serialization.ObjectSchema< detail: core.serialization.string(), problemType: core.serialization.property("problem_type", core.serialization.string()), blockMergeLink: core.serialization.property("block_merge_link", core.serialization.boolean().optional()), + rawError: core.serialization.property("raw_error", core.serialization.string().optional()), + errorCode: core.serialization.property("error_code", core.serialization.number().optional()), }); export declare namespace ErrorValidationProblem { @@ -23,5 +25,7 @@ export declare namespace ErrorValidationProblem { detail: string; problem_type: string; block_merge_link?: boolean | null; + raw_error?: string | null; + error_code?: number | null; } } diff --git a/src/serialization/resources/accounting/types/ExpenseLineRequestAccount.ts b/src/serialization/resources/accounting/types/ExpenseLineRequestAccount.ts index 20b8c0106..f8b5a75dd 100644 --- a/src/serialization/resources/accounting/types/ExpenseLineRequestAccount.ts +++ b/src/serialization/resources/accounting/types/ExpenseLineRequestAccount.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { AccountRequest } from "./AccountRequest"; +import { Account } from "./Account"; export const ExpenseLineRequestAccount: core.serialization.Schema< serializers.accounting.ExpenseLineRequestAccount.Raw, Merge.accounting.ExpenseLineRequestAccount -> = core.serialization.undiscriminatedUnion([core.serialization.string(), AccountRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), Account]); export declare namespace ExpenseLineRequestAccount { - export type Raw = string | AccountRequest.Raw; + export type Raw = string | Account.Raw; } diff --git a/src/serialization/resources/accounting/types/ExpenseLineRequestContact.ts b/src/serialization/resources/accounting/types/ExpenseLineRequestContact.ts index 79408ed0a..fcde8338c 100644 --- a/src/serialization/resources/accounting/types/ExpenseLineRequestContact.ts +++ b/src/serialization/resources/accounting/types/ExpenseLineRequestContact.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { ContactRequest } from "./ContactRequest"; +import { Contact } from "./Contact"; export const ExpenseLineRequestContact: core.serialization.Schema< serializers.accounting.ExpenseLineRequestContact.Raw, Merge.accounting.ExpenseLineRequestContact -> = core.serialization.undiscriminatedUnion([core.serialization.string(), ContactRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), Contact]); export declare namespace ExpenseLineRequestContact { - export type Raw = string | ContactRequest.Raw; + export type Raw = string | Contact.Raw; } diff --git a/src/serialization/resources/accounting/types/ExpenseReportLineRequestAccount.ts b/src/serialization/resources/accounting/types/ExpenseReportLineRequestAccount.ts index 88a8a5c92..ffbd60667 100644 --- a/src/serialization/resources/accounting/types/ExpenseReportLineRequestAccount.ts +++ b/src/serialization/resources/accounting/types/ExpenseReportLineRequestAccount.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { AccountRequest } from "./AccountRequest"; +import { Account } from "./Account"; export const ExpenseReportLineRequestAccount: core.serialization.Schema< serializers.accounting.ExpenseReportLineRequestAccount.Raw, Merge.accounting.ExpenseReportLineRequestAccount -> = core.serialization.undiscriminatedUnion([core.serialization.string(), AccountRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), Account]); export declare namespace ExpenseReportLineRequestAccount { - export type Raw = string | AccountRequest.Raw; + export type Raw = string | Account.Raw; } diff --git a/src/serialization/resources/accounting/types/ExpenseReportLineRequestContact.ts b/src/serialization/resources/accounting/types/ExpenseReportLineRequestContact.ts index 58a59da87..6a773b555 100644 --- a/src/serialization/resources/accounting/types/ExpenseReportLineRequestContact.ts +++ b/src/serialization/resources/accounting/types/ExpenseReportLineRequestContact.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { ContactRequest } from "./ContactRequest"; +import { Contact } from "./Contact"; export const ExpenseReportLineRequestContact: core.serialization.Schema< serializers.accounting.ExpenseReportLineRequestContact.Raw, Merge.accounting.ExpenseReportLineRequestContact -> = core.serialization.undiscriminatedUnion([core.serialization.string(), ContactRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), Contact]); export declare namespace ExpenseReportLineRequestContact { - export type Raw = string | ContactRequest.Raw; + export type Raw = string | Contact.Raw; } diff --git a/src/serialization/resources/accounting/types/ExpenseRequestAccount.ts b/src/serialization/resources/accounting/types/ExpenseRequestAccount.ts index ca377f9f1..a439907cf 100644 --- a/src/serialization/resources/accounting/types/ExpenseRequestAccount.ts +++ b/src/serialization/resources/accounting/types/ExpenseRequestAccount.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { AccountRequest } from "./AccountRequest"; +import { Account } from "./Account"; export const ExpenseRequestAccount: core.serialization.Schema< serializers.accounting.ExpenseRequestAccount.Raw, Merge.accounting.ExpenseRequestAccount -> = core.serialization.undiscriminatedUnion([core.serialization.string(), AccountRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), Account]); export declare namespace ExpenseRequestAccount { - export type Raw = string | AccountRequest.Raw; + export type Raw = string | Account.Raw; } diff --git a/src/serialization/resources/accounting/types/ExpenseRequestContact.ts b/src/serialization/resources/accounting/types/ExpenseRequestContact.ts index 50bccf034..188b3355b 100644 --- a/src/serialization/resources/accounting/types/ExpenseRequestContact.ts +++ b/src/serialization/resources/accounting/types/ExpenseRequestContact.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { ContactRequest } from "./ContactRequest"; +import { Contact } from "./Contact"; export const ExpenseRequestContact: core.serialization.Schema< serializers.accounting.ExpenseRequestContact.Raw, Merge.accounting.ExpenseRequestContact -> = core.serialization.undiscriminatedUnion([core.serialization.string(), ContactRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), Contact]); export declare namespace ExpenseRequestContact { - export type Raw = string | ContactRequest.Raw; + export type Raw = string | Contact.Raw; } diff --git a/src/serialization/resources/accounting/types/InvoiceLineItemRequestAccount.ts b/src/serialization/resources/accounting/types/InvoiceLineItemRequestAccount.ts index 815512a70..c8a45cdc1 100644 --- a/src/serialization/resources/accounting/types/InvoiceLineItemRequestAccount.ts +++ b/src/serialization/resources/accounting/types/InvoiceLineItemRequestAccount.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { AccountRequest } from "./AccountRequest"; +import { Account } from "./Account"; export const InvoiceLineItemRequestAccount: core.serialization.Schema< serializers.accounting.InvoiceLineItemRequestAccount.Raw, Merge.accounting.InvoiceLineItemRequestAccount -> = core.serialization.undiscriminatedUnion([core.serialization.string(), AccountRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), Account]); export declare namespace InvoiceLineItemRequestAccount { - export type Raw = string | AccountRequest.Raw; + export type Raw = string | Account.Raw; } diff --git a/src/serialization/resources/accounting/types/InvoiceLineItemRequestContact.ts b/src/serialization/resources/accounting/types/InvoiceLineItemRequestContact.ts index b711c53ca..34706b30e 100644 --- a/src/serialization/resources/accounting/types/InvoiceLineItemRequestContact.ts +++ b/src/serialization/resources/accounting/types/InvoiceLineItemRequestContact.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { ContactRequest } from "./ContactRequest"; +import { Contact } from "./Contact"; export const InvoiceLineItemRequestContact: core.serialization.Schema< serializers.accounting.InvoiceLineItemRequestContact.Raw, Merge.accounting.InvoiceLineItemRequestContact -> = core.serialization.undiscriminatedUnion([core.serialization.string(), ContactRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), Contact]); export declare namespace InvoiceLineItemRequestContact { - export type Raw = string | ContactRequest.Raw; + export type Raw = string | Contact.Raw; } diff --git a/src/serialization/resources/accounting/types/InvoiceRequestContact.ts b/src/serialization/resources/accounting/types/InvoiceRequestContact.ts index 65accf9e3..217a03e92 100644 --- a/src/serialization/resources/accounting/types/InvoiceRequestContact.ts +++ b/src/serialization/resources/accounting/types/InvoiceRequestContact.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { ContactRequest } from "./ContactRequest"; +import { Contact } from "./Contact"; export const InvoiceRequestContact: core.serialization.Schema< serializers.accounting.InvoiceRequestContact.Raw, Merge.accounting.InvoiceRequestContact -> = core.serialization.undiscriminatedUnion([core.serialization.string(), ContactRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), Contact]); export declare namespace InvoiceRequestContact { - export type Raw = string | ContactRequest.Raw; + export type Raw = string | Contact.Raw; } diff --git a/src/serialization/resources/accounting/types/InvoiceRequestPaymentsItem.ts b/src/serialization/resources/accounting/types/InvoiceRequestPaymentsItem.ts index 2f726cd21..f23b7978d 100644 --- a/src/serialization/resources/accounting/types/InvoiceRequestPaymentsItem.ts +++ b/src/serialization/resources/accounting/types/InvoiceRequestPaymentsItem.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { PaymentRequest } from "./PaymentRequest"; +import { Payment } from "./Payment"; export const InvoiceRequestPaymentsItem: core.serialization.Schema< serializers.accounting.InvoiceRequestPaymentsItem.Raw, Merge.accounting.InvoiceRequestPaymentsItem -> = core.serialization.undiscriminatedUnion([core.serialization.string(), PaymentRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), Payment]); export declare namespace InvoiceRequestPaymentsItem { - export type Raw = string | PaymentRequest.Raw; + export type Raw = string | Payment.Raw; } diff --git a/src/serialization/resources/accounting/types/InvoiceRequestPurchaseOrdersItem.ts b/src/serialization/resources/accounting/types/InvoiceRequestPurchaseOrdersItem.ts index f04d45a68..747b45e9c 100644 --- a/src/serialization/resources/accounting/types/InvoiceRequestPurchaseOrdersItem.ts +++ b/src/serialization/resources/accounting/types/InvoiceRequestPurchaseOrdersItem.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { PurchaseOrderRequest } from "./PurchaseOrderRequest"; +import { PurchaseOrder } from "./PurchaseOrder"; export const InvoiceRequestPurchaseOrdersItem: core.serialization.Schema< serializers.accounting.InvoiceRequestPurchaseOrdersItem.Raw, Merge.accounting.InvoiceRequestPurchaseOrdersItem -> = core.serialization.undiscriminatedUnion([core.serialization.string(), PurchaseOrderRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), PurchaseOrder]); export declare namespace InvoiceRequestPurchaseOrdersItem { - export type Raw = string | PurchaseOrderRequest.Raw; + export type Raw = string | PurchaseOrder.Raw; } diff --git a/src/serialization/resources/accounting/types/ItemFulfillmentLineRequestSalesOrderLine.ts b/src/serialization/resources/accounting/types/ItemFulfillmentLineRequestSalesOrderLine.ts index d9dac42e9..b73366448 100644 --- a/src/serialization/resources/accounting/types/ItemFulfillmentLineRequestSalesOrderLine.ts +++ b/src/serialization/resources/accounting/types/ItemFulfillmentLineRequestSalesOrderLine.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { SalesOrderLineRequest } from "./SalesOrderLineRequest"; +import { SalesOrderLine } from "./SalesOrderLine"; export const ItemFulfillmentLineRequestSalesOrderLine: core.serialization.Schema< serializers.accounting.ItemFulfillmentLineRequestSalesOrderLine.Raw, Merge.accounting.ItemFulfillmentLineRequestSalesOrderLine -> = core.serialization.undiscriminatedUnion([core.serialization.string(), SalesOrderLineRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), SalesOrderLine]); export declare namespace ItemFulfillmentLineRequestSalesOrderLine { - export type Raw = string | SalesOrderLineRequest.Raw; + export type Raw = string | SalesOrderLine.Raw; } diff --git a/src/serialization/resources/accounting/types/ItemFulfillmentRequestRequestCustomer.ts b/src/serialization/resources/accounting/types/ItemFulfillmentRequestRequestCustomer.ts index b48b4b430..239a9d321 100644 --- a/src/serialization/resources/accounting/types/ItemFulfillmentRequestRequestCustomer.ts +++ b/src/serialization/resources/accounting/types/ItemFulfillmentRequestRequestCustomer.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { ContactRequest } from "./ContactRequest"; +import { Contact } from "./Contact"; export const ItemFulfillmentRequestRequestCustomer: core.serialization.Schema< serializers.accounting.ItemFulfillmentRequestRequestCustomer.Raw, Merge.accounting.ItemFulfillmentRequestRequestCustomer -> = core.serialization.undiscriminatedUnion([core.serialization.string(), ContactRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), Contact]); export declare namespace ItemFulfillmentRequestRequestCustomer { - export type Raw = string | ContactRequest.Raw; + export type Raw = string | Contact.Raw; } diff --git a/src/serialization/resources/accounting/types/ItemRequestRequestPurchaseAccount.ts b/src/serialization/resources/accounting/types/ItemRequestRequestPurchaseAccount.ts index afe28ea06..ccbdc43ab 100644 --- a/src/serialization/resources/accounting/types/ItemRequestRequestPurchaseAccount.ts +++ b/src/serialization/resources/accounting/types/ItemRequestRequestPurchaseAccount.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { AccountRequest } from "./AccountRequest"; +import { Account } from "./Account"; export const ItemRequestRequestPurchaseAccount: core.serialization.Schema< serializers.accounting.ItemRequestRequestPurchaseAccount.Raw, Merge.accounting.ItemRequestRequestPurchaseAccount -> = core.serialization.undiscriminatedUnion([core.serialization.string(), AccountRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), Account]); export declare namespace ItemRequestRequestPurchaseAccount { - export type Raw = string | AccountRequest.Raw; + export type Raw = string | Account.Raw; } diff --git a/src/serialization/resources/accounting/types/ItemRequestRequestSalesAccount.ts b/src/serialization/resources/accounting/types/ItemRequestRequestSalesAccount.ts index 6d66c3d52..b86b32446 100644 --- a/src/serialization/resources/accounting/types/ItemRequestRequestSalesAccount.ts +++ b/src/serialization/resources/accounting/types/ItemRequestRequestSalesAccount.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { AccountRequest } from "./AccountRequest"; +import { Account } from "./Account"; export const ItemRequestRequestSalesAccount: core.serialization.Schema< serializers.accounting.ItemRequestRequestSalesAccount.Raw, Merge.accounting.ItemRequestRequestSalesAccount -> = core.serialization.undiscriminatedUnion([core.serialization.string(), AccountRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), Account]); export declare namespace ItemRequestRequestSalesAccount { - export type Raw = string | AccountRequest.Raw; + export type Raw = string | Account.Raw; } diff --git a/src/serialization/resources/accounting/types/JournalEntryRequestLinesItem.ts b/src/serialization/resources/accounting/types/JournalEntryRequestLinesItem.ts index 8b90f8891..54adb3d6c 100644 --- a/src/serialization/resources/accounting/types/JournalEntryRequestLinesItem.ts +++ b/src/serialization/resources/accounting/types/JournalEntryRequestLinesItem.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { JournalLineRequest } from "./JournalLineRequest"; +import { JournalLine } from "./JournalLine"; export const JournalEntryRequestLinesItem: core.serialization.Schema< serializers.accounting.JournalEntryRequestLinesItem.Raw, Merge.accounting.JournalEntryRequestLinesItem -> = core.serialization.undiscriminatedUnion([core.serialization.string(), JournalLineRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), JournalLine]); export declare namespace JournalEntryRequestLinesItem { - export type Raw = string | JournalLineRequest.Raw; + export type Raw = string | JournalLine.Raw; } diff --git a/src/serialization/resources/accounting/types/JournalEntryRequestPaymentsItem.ts b/src/serialization/resources/accounting/types/JournalEntryRequestPaymentsItem.ts index 369341e52..fcd672112 100644 --- a/src/serialization/resources/accounting/types/JournalEntryRequestPaymentsItem.ts +++ b/src/serialization/resources/accounting/types/JournalEntryRequestPaymentsItem.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { PaymentRequest } from "./PaymentRequest"; +import { Payment } from "./Payment"; export const JournalEntryRequestPaymentsItem: core.serialization.Schema< serializers.accounting.JournalEntryRequestPaymentsItem.Raw, Merge.accounting.JournalEntryRequestPaymentsItem -> = core.serialization.undiscriminatedUnion([core.serialization.string(), PaymentRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), Payment]); export declare namespace JournalEntryRequestPaymentsItem { - export type Raw = string | PaymentRequest.Raw; + export type Raw = string | Payment.Raw; } diff --git a/src/serialization/resources/accounting/types/JournalLineRequestAccount.ts b/src/serialization/resources/accounting/types/JournalLineRequestAccount.ts index 55f36d36f..6dff35c7e 100644 --- a/src/serialization/resources/accounting/types/JournalLineRequestAccount.ts +++ b/src/serialization/resources/accounting/types/JournalLineRequestAccount.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { AccountRequest } from "./AccountRequest"; +import { Account } from "./Account"; export const JournalLineRequestAccount: core.serialization.Schema< serializers.accounting.JournalLineRequestAccount.Raw, Merge.accounting.JournalLineRequestAccount -> = core.serialization.undiscriminatedUnion([core.serialization.string(), AccountRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), Account]); export declare namespace JournalLineRequestAccount { - export type Raw = string | AccountRequest.Raw; + export type Raw = string | Account.Raw; } diff --git a/src/serialization/resources/accounting/types/PaymentRequestAccount.ts b/src/serialization/resources/accounting/types/PaymentRequestAccount.ts index bbe187c30..063b18da4 100644 --- a/src/serialization/resources/accounting/types/PaymentRequestAccount.ts +++ b/src/serialization/resources/accounting/types/PaymentRequestAccount.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { AccountRequest } from "./AccountRequest"; +import { Account } from "./Account"; export const PaymentRequestAccount: core.serialization.Schema< serializers.accounting.PaymentRequestAccount.Raw, Merge.accounting.PaymentRequestAccount -> = core.serialization.undiscriminatedUnion([core.serialization.string(), AccountRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), Account]); export declare namespace PaymentRequestAccount { - export type Raw = string | AccountRequest.Raw; + export type Raw = string | Account.Raw; } diff --git a/src/serialization/resources/accounting/types/PaymentRequestAppliedToLinesItem.ts b/src/serialization/resources/accounting/types/PaymentRequestAppliedToLinesItem.ts index c8c25a108..e3f45b348 100644 --- a/src/serialization/resources/accounting/types/PaymentRequestAppliedToLinesItem.ts +++ b/src/serialization/resources/accounting/types/PaymentRequestAppliedToLinesItem.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { PaymentLineItemRequest } from "./PaymentLineItemRequest"; +import { PaymentLineItem } from "./PaymentLineItem"; export const PaymentRequestAppliedToLinesItem: core.serialization.Schema< serializers.accounting.PaymentRequestAppliedToLinesItem.Raw, Merge.accounting.PaymentRequestAppliedToLinesItem -> = core.serialization.undiscriminatedUnion([core.serialization.string(), PaymentLineItemRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), PaymentLineItem]); export declare namespace PaymentRequestAppliedToLinesItem { - export type Raw = string | PaymentLineItemRequest.Raw; + export type Raw = string | PaymentLineItem.Raw; } diff --git a/src/serialization/resources/accounting/types/PaymentRequestContact.ts b/src/serialization/resources/accounting/types/PaymentRequestContact.ts index 808a88797..2dfb94a03 100644 --- a/src/serialization/resources/accounting/types/PaymentRequestContact.ts +++ b/src/serialization/resources/accounting/types/PaymentRequestContact.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { ContactRequest } from "./ContactRequest"; +import { Contact } from "./Contact"; export const PaymentRequestContact: core.serialization.Schema< serializers.accounting.PaymentRequestContact.Raw, Merge.accounting.PaymentRequestContact -> = core.serialization.undiscriminatedUnion([core.serialization.string(), ContactRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), Contact]); export declare namespace PaymentRequestContact { - export type Raw = string | ContactRequest.Raw; + export type Raw = string | Contact.Raw; } diff --git a/src/serialization/resources/accounting/types/PurchaseOrderRequestDeliveryAddress.ts b/src/serialization/resources/accounting/types/PurchaseOrderRequestDeliveryAddress.ts index 0c3edb0a2..0ab428fb5 100644 --- a/src/serialization/resources/accounting/types/PurchaseOrderRequestDeliveryAddress.ts +++ b/src/serialization/resources/accounting/types/PurchaseOrderRequestDeliveryAddress.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { AddressRequest } from "./AddressRequest"; +import { Address } from "./Address"; export const PurchaseOrderRequestDeliveryAddress: core.serialization.Schema< serializers.accounting.PurchaseOrderRequestDeliveryAddress.Raw, Merge.accounting.PurchaseOrderRequestDeliveryAddress -> = core.serialization.undiscriminatedUnion([core.serialization.string(), AddressRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), Address]); export declare namespace PurchaseOrderRequestDeliveryAddress { - export type Raw = string | AddressRequest.Raw; + export type Raw = string | Address.Raw; } diff --git a/src/serialization/resources/accounting/types/PurchaseOrderRequestLineItemsItem.ts b/src/serialization/resources/accounting/types/PurchaseOrderRequestLineItemsItem.ts index 52c047300..a8fc3831a 100644 --- a/src/serialization/resources/accounting/types/PurchaseOrderRequestLineItemsItem.ts +++ b/src/serialization/resources/accounting/types/PurchaseOrderRequestLineItemsItem.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { PurchaseOrderLineItemRequest } from "./PurchaseOrderLineItemRequest"; +import { PurchaseOrderLineItem } from "./PurchaseOrderLineItem"; export const PurchaseOrderRequestLineItemsItem: core.serialization.Schema< serializers.accounting.PurchaseOrderRequestLineItemsItem.Raw, Merge.accounting.PurchaseOrderRequestLineItemsItem -> = core.serialization.undiscriminatedUnion([core.serialization.string(), PurchaseOrderLineItemRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), PurchaseOrderLineItem]); export declare namespace PurchaseOrderRequestLineItemsItem { - export type Raw = string | PurchaseOrderLineItemRequest.Raw; + export type Raw = string | PurchaseOrderLineItem.Raw; } diff --git a/src/serialization/resources/accounting/types/PurchaseOrderRequestVendor.ts b/src/serialization/resources/accounting/types/PurchaseOrderRequestVendor.ts index 701e20141..8ae65faf5 100644 --- a/src/serialization/resources/accounting/types/PurchaseOrderRequestVendor.ts +++ b/src/serialization/resources/accounting/types/PurchaseOrderRequestVendor.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { ContactRequest } from "./ContactRequest"; +import { Contact } from "./Contact"; export const PurchaseOrderRequestVendor: core.serialization.Schema< serializers.accounting.PurchaseOrderRequestVendor.Raw, Merge.accounting.PurchaseOrderRequestVendor -> = core.serialization.undiscriminatedUnion([core.serialization.string(), ContactRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), Contact]); export declare namespace PurchaseOrderRequestVendor { - export type Raw = string | ContactRequest.Raw; + export type Raw = string | Contact.Raw; } diff --git a/src/serialization/resources/accounting/types/RemoteFieldApi.ts b/src/serialization/resources/accounting/types/RemoteFieldApi.ts index 3ee08d00b..5d37bb44c 100644 --- a/src/serialization/resources/accounting/types/RemoteFieldApi.ts +++ b/src/serialization/resources/accounting/types/RemoteFieldApi.ts @@ -3,8 +3,8 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; +import { AdvancedMetadata } from "./AdvancedMetadata"; import { RemoteEndpointInfo } from "./RemoteEndpointInfo"; -import { RemoteFieldApiAdvancedMetadata } from "./RemoteFieldApiAdvancedMetadata"; import { RemoteFieldApiCoverage } from "./RemoteFieldApiCoverage"; export const RemoteFieldApi: core.serialization.ObjectSchema< @@ -18,7 +18,7 @@ export const RemoteFieldApi: core.serialization.ObjectSchema< "example_values", core.serialization.list(core.serialization.unknown()).optional(), ), - advancedMetadata: core.serialization.property("advanced_metadata", RemoteFieldApiAdvancedMetadata.optional()), + advancedMetadata: core.serialization.property("advanced_metadata", AdvancedMetadata.optional()), coverage: RemoteFieldApiCoverage.optional(), }); @@ -28,7 +28,7 @@ export declare namespace RemoteFieldApi { remote_key_name: string; remote_endpoint_info: RemoteEndpointInfo.Raw; example_values?: unknown[] | null; - advanced_metadata?: RemoteFieldApiAdvancedMetadata.Raw | null; + advanced_metadata?: AdvancedMetadata.Raw | null; coverage?: RemoteFieldApiCoverage.Raw | null; } } diff --git a/src/serialization/resources/accounting/types/RemoteFieldApiAdvancedMetadata.ts b/src/serialization/resources/accounting/types/RemoteFieldApiAdvancedMetadata.ts deleted file mode 100644 index 75d615377..000000000 --- a/src/serialization/resources/accounting/types/RemoteFieldApiAdvancedMetadata.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Merge from "../../../../api/index"; -import * as core from "../../../../core"; -import type * as serializers from "../../../index"; -import { AdvancedMetadata } from "./AdvancedMetadata"; - -export const RemoteFieldApiAdvancedMetadata: core.serialization.Schema< - serializers.accounting.RemoteFieldApiAdvancedMetadata.Raw, - Merge.accounting.RemoteFieldApiAdvancedMetadata -> = core.serialization.undiscriminatedUnion([AdvancedMetadata, core.serialization.string()]); - -export declare namespace RemoteFieldApiAdvancedMetadata { - export type Raw = AdvancedMetadata.Raw | string; -} diff --git a/src/serialization/resources/accounting/types/SalesOrderRequestRequestCustomer.ts b/src/serialization/resources/accounting/types/SalesOrderRequestRequestCustomer.ts index 293e456ab..19ee60148 100644 --- a/src/serialization/resources/accounting/types/SalesOrderRequestRequestCustomer.ts +++ b/src/serialization/resources/accounting/types/SalesOrderRequestRequestCustomer.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { ContactRequest } from "./ContactRequest"; +import { Contact } from "./Contact"; export const SalesOrderRequestRequestCustomer: core.serialization.Schema< serializers.accounting.SalesOrderRequestRequestCustomer.Raw, Merge.accounting.SalesOrderRequestRequestCustomer -> = core.serialization.undiscriminatedUnion([core.serialization.string(), ContactRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), Contact]); export declare namespace SalesOrderRequestRequestCustomer { - export type Raw = string | ContactRequest.Raw; + export type Raw = string | Contact.Raw; } diff --git a/src/serialization/resources/accounting/types/SalesOrderRequestRequestShippingAddress.ts b/src/serialization/resources/accounting/types/SalesOrderRequestRequestShippingAddress.ts index 2d4af027f..bb38e54fc 100644 --- a/src/serialization/resources/accounting/types/SalesOrderRequestRequestShippingAddress.ts +++ b/src/serialization/resources/accounting/types/SalesOrderRequestRequestShippingAddress.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { AddressRequest } from "./AddressRequest"; +import { Address } from "./Address"; export const SalesOrderRequestRequestShippingAddress: core.serialization.Schema< serializers.accounting.SalesOrderRequestRequestShippingAddress.Raw, Merge.accounting.SalesOrderRequestRequestShippingAddress -> = core.serialization.undiscriminatedUnion([core.serialization.string(), AddressRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), Address]); export declare namespace SalesOrderRequestRequestShippingAddress { - export type Raw = string | AddressRequest.Raw; + export type Raw = string | Address.Raw; } diff --git a/src/serialization/resources/accounting/types/VendorCreditApplyLineForVendorCreditRequestInvoice.ts b/src/serialization/resources/accounting/types/VendorCreditApplyLineForVendorCreditRequestInvoice.ts index a22513563..4ed67b028 100644 --- a/src/serialization/resources/accounting/types/VendorCreditApplyLineForVendorCreditRequestInvoice.ts +++ b/src/serialization/resources/accounting/types/VendorCreditApplyLineForVendorCreditRequestInvoice.ts @@ -2,14 +2,16 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; -import { InvoiceRequest } from "./InvoiceRequest"; +import * as serializers from "../../../index"; export const VendorCreditApplyLineForVendorCreditRequestInvoice: core.serialization.Schema< serializers.accounting.VendorCreditApplyLineForVendorCreditRequestInvoice.Raw, Merge.accounting.VendorCreditApplyLineForVendorCreditRequestInvoice -> = core.serialization.undiscriminatedUnion([core.serialization.string(), InvoiceRequest]); +> = core.serialization.undiscriminatedUnion([ + core.serialization.string(), + core.serialization.lazyObject(() => serializers.accounting.Invoice), +]); export declare namespace VendorCreditApplyLineForVendorCreditRequestInvoice { - export type Raw = string | InvoiceRequest.Raw; + export type Raw = string | serializers.accounting.Invoice.Raw; } diff --git a/src/serialization/resources/accounting/types/VendorCreditLineRequestAccount.ts b/src/serialization/resources/accounting/types/VendorCreditLineRequestAccount.ts index 8189a08c6..57b939bdb 100644 --- a/src/serialization/resources/accounting/types/VendorCreditLineRequestAccount.ts +++ b/src/serialization/resources/accounting/types/VendorCreditLineRequestAccount.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { AccountRequest } from "./AccountRequest"; +import { Account } from "./Account"; export const VendorCreditLineRequestAccount: core.serialization.Schema< serializers.accounting.VendorCreditLineRequestAccount.Raw, Merge.accounting.VendorCreditLineRequestAccount -> = core.serialization.undiscriminatedUnion([core.serialization.string(), AccountRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), Account]); export declare namespace VendorCreditLineRequestAccount { - export type Raw = string | AccountRequest.Raw; + export type Raw = string | Account.Raw; } diff --git a/src/serialization/resources/accounting/types/VendorCreditLineRequestContact.ts b/src/serialization/resources/accounting/types/VendorCreditLineRequestContact.ts index b485a7d31..d368a2a7c 100644 --- a/src/serialization/resources/accounting/types/VendorCreditLineRequestContact.ts +++ b/src/serialization/resources/accounting/types/VendorCreditLineRequestContact.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { ContactRequest } from "./ContactRequest"; +import { Contact } from "./Contact"; export const VendorCreditLineRequestContact: core.serialization.Schema< serializers.accounting.VendorCreditLineRequestContact.Raw, Merge.accounting.VendorCreditLineRequestContact -> = core.serialization.undiscriminatedUnion([core.serialization.string(), ContactRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), Contact]); export declare namespace VendorCreditLineRequestContact { - export type Raw = string | ContactRequest.Raw; + export type Raw = string | Contact.Raw; } diff --git a/src/serialization/resources/accounting/types/VendorCreditRequestVendor.ts b/src/serialization/resources/accounting/types/VendorCreditRequestVendor.ts index e2e77f178..a43c54616 100644 --- a/src/serialization/resources/accounting/types/VendorCreditRequestVendor.ts +++ b/src/serialization/resources/accounting/types/VendorCreditRequestVendor.ts @@ -3,13 +3,13 @@ import type * as Merge from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { ContactRequest } from "./ContactRequest"; +import { Contact } from "./Contact"; export const VendorCreditRequestVendor: core.serialization.Schema< serializers.accounting.VendorCreditRequestVendor.Raw, Merge.accounting.VendorCreditRequestVendor -> = core.serialization.undiscriminatedUnion([core.serialization.string(), ContactRequest]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), Contact]); export declare namespace VendorCreditRequestVendor { - export type Raw = string | ContactRequest.Raw; + export type Raw = string | Contact.Raw; } diff --git a/src/serialization/resources/accounting/types/WarningValidationProblem.ts b/src/serialization/resources/accounting/types/WarningValidationProblem.ts index cc2292f20..c57b51cbd 100644 --- a/src/serialization/resources/accounting/types/WarningValidationProblem.ts +++ b/src/serialization/resources/accounting/types/WarningValidationProblem.ts @@ -14,6 +14,8 @@ export const WarningValidationProblem: core.serialization.ObjectSchema< detail: core.serialization.string(), problemType: core.serialization.property("problem_type", core.serialization.string()), blockMergeLink: core.serialization.property("block_merge_link", core.serialization.boolean().optional()), + rawError: core.serialization.property("raw_error", core.serialization.string().optional()), + errorCode: core.serialization.property("error_code", core.serialization.number().optional()), }); export declare namespace WarningValidationProblem { @@ -23,5 +25,7 @@ export declare namespace WarningValidationProblem { detail: string; problem_type: string; block_merge_link?: boolean | null; + raw_error?: string | null; + error_code?: number | null; } } diff --git a/src/serialization/resources/accounting/types/index.ts b/src/serialization/resources/accounting/types/index.ts index ea551ca32..4ae0bfdcb 100644 --- a/src/serialization/resources/accounting/types/index.ts +++ b/src/serialization/resources/accounting/types/index.ts @@ -69,7 +69,11 @@ export * from "./BankFeedTransactionRequestRequestCreditOrDebit"; export * from "./BankFeedTransactionResponse"; export * from "./BatchObject"; export * from "./BatchObjectItemResponse"; +export * from "./BatchObjectStatus"; +export * from "./BatchObjectStatusEnum"; export * from "./BatchObjectsResponse"; +export * from "./BatchObjectsResponseStatus"; +export * from "./BatchObjectsResponseStatusEnum"; export * from "./CashFlowStatement"; export * from "./CashFlowStatementCompany"; export * from "./CashFlowStatementCurrency"; @@ -137,8 +141,6 @@ export * from "./CreditNoteStatusEnum"; export * from "./CreditNoteTrackingCategoriesItem"; export * from "./CreditOrDebitEnum"; export * from "./DataPassthroughRequest"; -export * from "./DataPassthroughRequestMethod"; -export * from "./DataPassthroughRequestRequestFormat"; export * from "./DebugModeLog"; export * from "./DebugModelLogSummary"; export * from "./Employee"; @@ -494,7 +496,6 @@ export * from "./RemoteData"; export * from "./RemoteEndpointInfo"; export * from "./RemoteField"; export * from "./RemoteFieldApi"; -export * from "./RemoteFieldApiAdvancedMetadata"; export * from "./RemoteFieldApiCoverage"; export * from "./RemoteFieldApiResponse"; export * from "./RemoteFieldClass"; diff --git a/tests/wire/Accounting/accounts.test.ts b/tests/wire/Accounting/accounts.test.ts index efd1c3364..b1b271385 100644 --- a/tests/wire/Accounting/accounts.test.ts +++ b/tests/wire/Accounting/accounts.test.ts @@ -154,6 +154,8 @@ describe("AccountsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problem_type: "UNRECOGNIZED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], errors: [ @@ -163,6 +165,8 @@ describe("AccountsClient", () => { detail: "custom_fields is a required field on model.", problem_type: "MISSING_REQUIRED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], logs: [ @@ -233,6 +237,8 @@ describe("AccountsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problemType: "UNRECOGNIZED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], errors: [ @@ -244,6 +250,8 @@ describe("AccountsClient", () => { detail: "custom_fields is a required field on model.", problemType: "MISSING_REQUIRED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], logs: [ diff --git a/tests/wire/Accounting/attachments.test.ts b/tests/wire/Accounting/attachments.test.ts index fdd0cf445..9b10705d0 100644 --- a/tests/wire/Accounting/attachments.test.ts +++ b/tests/wire/Accounting/attachments.test.ts @@ -124,6 +124,8 @@ describe("AttachmentsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problem_type: "UNRECOGNIZED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], errors: [ @@ -133,6 +135,8 @@ describe("AttachmentsClient", () => { detail: "custom_fields is a required field on model.", problem_type: "MISSING_REQUIRED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], logs: [ @@ -195,6 +199,8 @@ describe("AttachmentsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problemType: "UNRECOGNIZED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], errors: [ @@ -206,6 +212,8 @@ describe("AttachmentsClient", () => { detail: "custom_fields is a required field on model.", problemType: "MISSING_REQUIRED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], logs: [ diff --git a/tests/wire/Accounting/bankFeedAccounts.test.ts b/tests/wire/Accounting/bankFeedAccounts.test.ts index c26e59769..01d78408e 100644 --- a/tests/wire/Accounting/bankFeedAccounts.test.ts +++ b/tests/wire/Accounting/bankFeedAccounts.test.ts @@ -139,6 +139,8 @@ describe("BankFeedAccountsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problem_type: "UNRECOGNIZED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], errors: [ @@ -148,6 +150,8 @@ describe("BankFeedAccountsClient", () => { detail: "custom_fields is a required field on model.", problem_type: "MISSING_REQUIRED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], logs: [ @@ -217,6 +221,8 @@ describe("BankFeedAccountsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problemType: "UNRECOGNIZED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], errors: [ @@ -228,6 +234,8 @@ describe("BankFeedAccountsClient", () => { detail: "custom_fields is a required field on model.", problemType: "MISSING_REQUIRED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], logs: [ diff --git a/tests/wire/Accounting/bankFeedTransactions.test.ts b/tests/wire/Accounting/bankFeedTransactions.test.ts index 7b3bb4e98..dcc9d394c 100644 --- a/tests/wire/Accounting/bankFeedTransactions.test.ts +++ b/tests/wire/Accounting/bankFeedTransactions.test.ts @@ -121,6 +121,8 @@ describe("BankFeedTransactionsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problem_type: "UNRECOGNIZED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], errors: [ @@ -130,6 +132,8 @@ describe("BankFeedTransactionsClient", () => { detail: "custom_fields is a required field on model.", problem_type: "MISSING_REQUIRED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], logs: [ @@ -185,6 +189,8 @@ describe("BankFeedTransactionsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problemType: "UNRECOGNIZED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], errors: [ @@ -196,6 +202,8 @@ describe("BankFeedTransactionsClient", () => { detail: "custom_fields is a required field on model.", problemType: "MISSING_REQUIRED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], logs: [ diff --git a/tests/wire/Accounting/contacts.test.ts b/tests/wire/Accounting/contacts.test.ts index 7952f9a84..6b619823a 100644 --- a/tests/wire/Accounting/contacts.test.ts +++ b/tests/wire/Accounting/contacts.test.ts @@ -187,6 +187,8 @@ describe("ContactsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problem_type: "UNRECOGNIZED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], errors: [ @@ -196,6 +198,8 @@ describe("ContactsClient", () => { detail: "custom_fields is a required field on model.", problem_type: "MISSING_REQUIRED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], logs: [ @@ -281,6 +285,8 @@ describe("ContactsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problemType: "UNRECOGNIZED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], errors: [ @@ -292,6 +298,8 @@ describe("ContactsClient", () => { detail: "custom_fields is a required field on model.", problemType: "MISSING_REQUIRED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], logs: [ @@ -460,6 +468,8 @@ describe("ContactsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problem_type: "UNRECOGNIZED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], errors: [ @@ -469,6 +479,8 @@ describe("ContactsClient", () => { detail: "custom_fields is a required field on model.", problem_type: "MISSING_REQUIRED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], logs: [ @@ -554,6 +566,8 @@ describe("ContactsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problemType: "UNRECOGNIZED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], errors: [ @@ -565,6 +579,8 @@ describe("ContactsClient", () => { detail: "custom_fields is a required field on model.", problemType: "MISSING_REQUIRED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], logs: [ diff --git a/tests/wire/Accounting/creditNotes.test.ts b/tests/wire/Accounting/creditNotes.test.ts index df418c06b..4c2a53acd 100644 --- a/tests/wire/Accounting/creditNotes.test.ts +++ b/tests/wire/Accounting/creditNotes.test.ts @@ -70,6 +70,7 @@ describe("CreditNotesClient", () => { accounting_period: "accounting_period", applied_to_lines: [ { + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", invoice: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -151,6 +152,7 @@ describe("CreditNotesClient", () => { accountingPeriod: "accounting_period", appliedToLines: [ { + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), invoice: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -263,6 +265,7 @@ describe("CreditNotesClient", () => { accounting_period: "accounting_period", applied_to_lines: [ { + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", invoice: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -284,6 +287,8 @@ describe("CreditNotesClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problem_type: "UNRECOGNIZED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], errors: [ @@ -293,6 +298,8 @@ describe("CreditNotesClient", () => { detail: "custom_fields is a required field on model.", problem_type: "MISSING_REQUIRED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], logs: [ @@ -375,6 +382,7 @@ describe("CreditNotesClient", () => { accountingPeriod: "accounting_period", appliedToLines: [ { + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), invoice: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -407,6 +415,8 @@ describe("CreditNotesClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problemType: "UNRECOGNIZED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], errors: [ @@ -418,6 +428,8 @@ describe("CreditNotesClient", () => { detail: "custom_fields is a required field on model.", problemType: "MISSING_REQUIRED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], logs: [ @@ -496,7 +508,7 @@ describe("CreditNotesClient", () => { accounting_period: "accounting_period", applied_to_lines: [ { - remote_id: "remote_id", + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", invoice: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -579,7 +591,7 @@ describe("CreditNotesClient", () => { accountingPeriod: "accounting_period", appliedToLines: [ { - remoteId: "remote_id", + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), invoice: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -669,6 +681,7 @@ describe("CreditNotesClient", () => { accounting_period: "accounting_period", applied_to_lines: [ { + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", invoice: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -690,6 +703,8 @@ describe("CreditNotesClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problem_type: "UNRECOGNIZED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], errors: [ @@ -699,6 +714,8 @@ describe("CreditNotesClient", () => { detail: "custom_fields is a required field on model.", problem_type: "MISSING_REQUIRED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], logs: [ @@ -781,6 +798,7 @@ describe("CreditNotesClient", () => { accountingPeriod: "accounting_period", appliedToLines: [ { + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), invoice: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -813,6 +831,8 @@ describe("CreditNotesClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problemType: "UNRECOGNIZED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], errors: [ @@ -824,6 +844,8 @@ describe("CreditNotesClient", () => { detail: "custom_fields is a required field on model.", problemType: "MISSING_REQUIRED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], logs: [ @@ -903,6 +925,7 @@ describe("CreditNotesClient", () => { accounting_period: "accounting_period", applied_to_lines: [ { + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", invoice: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -924,6 +947,8 @@ describe("CreditNotesClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problem_type: "UNRECOGNIZED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], errors: [ @@ -933,6 +958,8 @@ describe("CreditNotesClient", () => { detail: "custom_fields is a required field on model.", problem_type: "MISSING_REQUIRED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], logs: [ @@ -1016,6 +1043,7 @@ describe("CreditNotesClient", () => { accountingPeriod: "accounting_period", appliedToLines: [ { + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), invoice: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -1048,6 +1076,8 @@ describe("CreditNotesClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problemType: "UNRECOGNIZED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], errors: [ @@ -1059,6 +1089,8 @@ describe("CreditNotesClient", () => { detail: "custom_fields is a required field on model.", problemType: "MISSING_REQUIRED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], logs: [ diff --git a/tests/wire/Accounting/expenseReports.test.ts b/tests/wire/Accounting/expenseReports.test.ts index 5912b64d0..a8a792939 100644 --- a/tests/wire/Accounting/expenseReports.test.ts +++ b/tests/wire/Accounting/expenseReports.test.ts @@ -247,6 +247,8 @@ describe("ExpenseReportsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problem_type: "UNRECOGNIZED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], errors: [ @@ -256,6 +258,8 @@ describe("ExpenseReportsClient", () => { detail: "custom_fields is a required field on model.", problem_type: "MISSING_REQUIRED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], logs: [ @@ -362,6 +366,8 @@ describe("ExpenseReportsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problemType: "UNRECOGNIZED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], errors: [ @@ -373,6 +379,8 @@ describe("ExpenseReportsClient", () => { detail: "custom_fields is a required field on model.", problemType: "MISSING_REQUIRED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], logs: [ diff --git a/tests/wire/Accounting/expenses.test.ts b/tests/wire/Accounting/expenses.test.ts index 3d3949a41..a204d1061 100644 --- a/tests/wire/Accounting/expenses.test.ts +++ b/tests/wire/Accounting/expenses.test.ts @@ -19,7 +19,7 @@ describe("ExpensesClient", () => { results: [ { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remote_id: "remote_id", + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", transaction_date: "2024-01-15T09:30:00Z", @@ -109,7 +109,7 @@ describe("ExpensesClient", () => { results: [ { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remoteId: "remote_id", + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), transactionDate: new Date("2024-01-15T09:30:00.000Z"), @@ -236,7 +236,7 @@ describe("ExpensesClient", () => { const rawResponseBody = { model: { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remote_id: "remote_id", + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", transaction_date: "2024-01-15T09:30:00Z", @@ -317,6 +317,8 @@ describe("ExpensesClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problem_type: "UNRECOGNIZED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], errors: [ @@ -326,6 +328,8 @@ describe("ExpensesClient", () => { detail: "custom_fields is a required field on model.", problem_type: "MISSING_REQUIRED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], logs: [ @@ -357,7 +361,7 @@ describe("ExpensesClient", () => { expect(response).toEqual({ model: { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remoteId: "remote_id", + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), transactionDate: new Date("2024-01-15T09:30:00.000Z"), @@ -456,6 +460,8 @@ describe("ExpensesClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problemType: "UNRECOGNIZED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], errors: [ @@ -467,6 +473,8 @@ describe("ExpensesClient", () => { detail: "custom_fields is a required field on model.", problemType: "MISSING_REQUIRED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], logs: [ @@ -494,7 +502,7 @@ describe("ExpensesClient", () => { const rawResponseBody = { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remote_id: "remote_id", + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", transaction_date: "2024-01-15T09:30:00Z", @@ -591,7 +599,7 @@ describe("ExpensesClient", () => { }); expect(response).toEqual({ id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remoteId: "remote_id", + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), transactionDate: new Date("2024-01-15T09:30:00.000Z"), @@ -691,7 +699,7 @@ describe("ExpensesClient", () => { }); }); - test("asyncBulkCreate", async () => { + test("bulkCreate", async () => { const server = mockServerPool.createServer(); const client = new MergeClient({ maxRetries: 0, @@ -700,19 +708,17 @@ describe("ExpensesClient", () => { environment: server.baseUrl, }); const rawRequestBody = { batch_items: [{ item_id: "item_id", payload: {} }] }; - const rawResponseBody = { batch_id: "batch_id" }; + const rawResponseBody = { batch_id: "d0a3ca3e-2d7a-44cd-a94b-bda805f23b5" }; server .mockEndpoint() - .post("/accounting/v1/expenses/async/bulk") + .post("/accounting/v1/expenses/bulk") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.accounting.expenses.asyncBulkCreate({ - isDebugMode: true, - runAsync: true, + const response = await client.accounting.expenses.bulkCreate({ batchItems: [ { itemId: "item_id", @@ -721,11 +727,11 @@ describe("ExpensesClient", () => { ], }); expect(response).toEqual({ - batchId: "batch_id", + batchId: "d0a3ca3e-2d7a-44cd-a94b-bda805f23b5", }); }); - test("batchObjectsList", async () => { + test("bulkRetrieve", async () => { const server = mockServerPool.createServer(); const client = new MergeClient({ maxRetries: 0, @@ -735,43 +741,28 @@ describe("ExpensesClient", () => { }); const rawResponseBody = { - batch_id: "batch_id", - status: "status", + batch_id: "d0a3ca3e-2d7a-44cd-a94b-bda805f23b5", + status: "ENQUEUED", total_count: 1, - objects: [{ item_id: "item_id", status: "status" }], + objects: [{ item_id: "item_id", status: "PENDING" }], }; server .mockEndpoint() - .get("/accounting/v1/expenses/batch/batch_id/objects") + .get("/accounting/v1/expenses/bulk/batch_id") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.accounting.expenses.batchObjectsList("batch_id", { - companyId: "company_id", - createdAfter: new Date("2024-01-15T09:30:00.000Z"), - createdBefore: new Date("2024-01-15T09:30:00.000Z"), - cursor: "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", - includeDeletedData: true, - includeRemoteData: true, - includeRemoteFields: true, - includeShellData: true, - modifiedAfter: new Date("2024-01-15T09:30:00.000Z"), - modifiedBefore: new Date("2024-01-15T09:30:00.000Z"), - pageSize: 1, - remoteId: "remote_id", - transactionDateAfter: new Date("2024-01-15T09:30:00.000Z"), - transactionDateBefore: new Date("2024-01-15T09:30:00.000Z"), - }); + const response = await client.accounting.expenses.bulkRetrieve("batch_id"); expect(response).toEqual({ - batchId: "batch_id", - status: "status", + batchId: "d0a3ca3e-2d7a-44cd-a94b-bda805f23b5", + status: "ENQUEUED", totalCount: 1, objects: [ { itemId: "item_id", - status: "status", + status: "PENDING", }, ], }); diff --git a/tests/wire/Accounting/fieldMapping.test.ts b/tests/wire/Accounting/fieldMapping.test.ts index c70a37801..b792f0a49 100644 --- a/tests/wire/Accounting/fieldMapping.test.ts +++ b/tests/wire/Accounting/fieldMapping.test.ts @@ -1362,6 +1362,8 @@ describe("FieldMappingClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problem_type: "UNRECOGNIZED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], errors: [ @@ -1371,6 +1373,8 @@ describe("FieldMappingClient", () => { detail: "custom_fields is a required field on model.", problem_type: "MISSING_REQUIRED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], logs: [ @@ -1436,6 +1440,8 @@ describe("FieldMappingClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problemType: "UNRECOGNIZED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], errors: [ @@ -1447,6 +1453,8 @@ describe("FieldMappingClient", () => { detail: "custom_fields is a required field on model.", problemType: "MISSING_REQUIRED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], logs: [ @@ -1500,6 +1508,8 @@ describe("FieldMappingClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problem_type: "UNRECOGNIZED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], errors: [ @@ -1509,6 +1519,8 @@ describe("FieldMappingClient", () => { detail: "custom_fields is a required field on model.", problem_type: "MISSING_REQUIRED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], logs: [ @@ -1564,6 +1576,8 @@ describe("FieldMappingClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problemType: "UNRECOGNIZED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], errors: [ @@ -1575,6 +1589,8 @@ describe("FieldMappingClient", () => { detail: "custom_fields is a required field on model.", problemType: "MISSING_REQUIRED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], logs: [ @@ -1628,6 +1644,8 @@ describe("FieldMappingClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problem_type: "UNRECOGNIZED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], errors: [ @@ -1637,6 +1655,8 @@ describe("FieldMappingClient", () => { detail: "custom_fields is a required field on model.", problem_type: "MISSING_REQUIRED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], logs: [ @@ -1695,6 +1715,8 @@ describe("FieldMappingClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problemType: "UNRECOGNIZED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], errors: [ @@ -1706,6 +1728,8 @@ describe("FieldMappingClient", () => { detail: "custom_fields is a required field on model.", problemType: "MISSING_REQUIRED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], logs: [ diff --git a/tests/wire/Accounting/invoices.test.ts b/tests/wire/Accounting/invoices.test.ts index 143b508e2..a569add04 100644 --- a/tests/wire/Accounting/invoices.test.ts +++ b/tests/wire/Accounting/invoices.test.ts @@ -91,6 +91,7 @@ describe("InvoicesClient", () => { ], applied_credit_notes: [ { + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", credit_note: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -100,6 +101,7 @@ describe("InvoicesClient", () => { ], applied_vendor_credits: [ { + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", vendor_credit: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -208,6 +210,7 @@ describe("InvoicesClient", () => { ], appliedCreditNotes: [ { + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), creditNote: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -217,6 +220,7 @@ describe("InvoicesClient", () => { ], appliedVendorCredits: [ { + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), vendorCredit: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -364,6 +368,7 @@ describe("InvoicesClient", () => { ], applied_credit_notes: [ { + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", credit_note: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -373,6 +378,7 @@ describe("InvoicesClient", () => { ], applied_vendor_credits: [ { + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", vendor_credit: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -396,6 +402,8 @@ describe("InvoicesClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problem_type: "UNRECOGNIZED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], errors: [ @@ -405,6 +413,8 @@ describe("InvoicesClient", () => { detail: "custom_fields is a required field on model.", problem_type: "MISSING_REQUIRED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], logs: [ @@ -512,6 +522,7 @@ describe("InvoicesClient", () => { ], appliedCreditNotes: [ { + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), creditNote: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -521,6 +532,7 @@ describe("InvoicesClient", () => { ], appliedVendorCredits: [ { + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), vendorCredit: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -562,6 +574,8 @@ describe("InvoicesClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problemType: "UNRECOGNIZED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], errors: [ @@ -573,6 +587,8 @@ describe("InvoicesClient", () => { detail: "custom_fields is a required field on model.", problemType: "MISSING_REQUIRED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], logs: [ @@ -674,7 +690,7 @@ describe("InvoicesClient", () => { ], applied_credit_notes: [ { - remote_id: "remote_id", + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", credit_note: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -685,7 +701,7 @@ describe("InvoicesClient", () => { ], applied_vendor_credits: [ { - remote_id: "remote_id", + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", vendor_credit: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -805,7 +821,7 @@ describe("InvoicesClient", () => { ], appliedCreditNotes: [ { - remoteId: "remote_id", + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), creditNote: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -816,7 +832,7 @@ describe("InvoicesClient", () => { ], appliedVendorCredits: [ { - remoteId: "remote_id", + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), vendorCredit: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -936,6 +952,7 @@ describe("InvoicesClient", () => { ], applied_credit_notes: [ { + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", credit_note: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -945,6 +962,7 @@ describe("InvoicesClient", () => { ], applied_vendor_credits: [ { + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", vendor_credit: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -968,6 +986,8 @@ describe("InvoicesClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problem_type: "UNRECOGNIZED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], errors: [ @@ -977,6 +997,8 @@ describe("InvoicesClient", () => { detail: "custom_fields is a required field on model.", problem_type: "MISSING_REQUIRED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], logs: [ @@ -1084,6 +1106,7 @@ describe("InvoicesClient", () => { ], appliedCreditNotes: [ { + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), creditNote: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -1093,6 +1116,7 @@ describe("InvoicesClient", () => { ], appliedVendorCredits: [ { + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), vendorCredit: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -1134,6 +1158,8 @@ describe("InvoicesClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problemType: "UNRECOGNIZED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], errors: [ @@ -1145,6 +1171,8 @@ describe("InvoicesClient", () => { detail: "custom_fields is a required field on model.", problemType: "MISSING_REQUIRED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], logs: [ @@ -1161,7 +1189,7 @@ describe("InvoicesClient", () => { }); }); - test("asyncBulkCreate", async () => { + test("bulkCreate", async () => { const server = mockServerPool.createServer(); const client = new MergeClient({ maxRetries: 0, @@ -1170,19 +1198,17 @@ describe("InvoicesClient", () => { environment: server.baseUrl, }); const rawRequestBody = { batch_items: [{ item_id: "item_id", payload: {} }] }; - const rawResponseBody = { batch_id: "batch_id" }; + const rawResponseBody = { batch_id: "d0a3ca3e-2d7a-44cd-a94b-bda805f23b5" }; server .mockEndpoint() - .post("/accounting/v1/invoices/async/bulk") + .post("/accounting/v1/invoices/bulk") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.accounting.invoices.asyncBulkCreate({ - isDebugMode: true, - runAsync: true, + const response = await client.accounting.invoices.bulkCreate({ batchItems: [ { itemId: "item_id", @@ -1191,11 +1217,11 @@ describe("InvoicesClient", () => { ], }); expect(response).toEqual({ - batchId: "batch_id", + batchId: "d0a3ca3e-2d7a-44cd-a94b-bda805f23b5", }); }); - test("batchObjectsList", async () => { + test("bulkRetrieve", async () => { const server = mockServerPool.createServer(); const client = new MergeClient({ maxRetries: 0, @@ -1205,49 +1231,28 @@ describe("InvoicesClient", () => { }); const rawResponseBody = { - batch_id: "batch_id", - status: "status", + batch_id: "d0a3ca3e-2d7a-44cd-a94b-bda805f23b5", + status: "ENQUEUED", total_count: 1, - objects: [{ item_id: "item_id", status: "status" }], + objects: [{ item_id: "item_id", status: "PENDING" }], }; server .mockEndpoint() - .get("/accounting/v1/invoices/batch/batch_id/objects") + .get("/accounting/v1/invoices/bulk/batch_id") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.accounting.invoices.batchObjectsList("batch_id", { - companyId: "company_id", - contactId: "contact_id", - createdAfter: new Date("2024-01-15T09:30:00.000Z"), - createdBefore: new Date("2024-01-15T09:30:00.000Z"), - cursor: "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", - includeDeletedData: true, - includeRemoteData: true, - includeRemoteFields: true, - includeShellData: true, - issueDateAfter: new Date("2024-01-15T09:30:00.000Z"), - issueDateBefore: new Date("2024-01-15T09:30:00.000Z"), - modifiedAfter: new Date("2024-01-15T09:30:00.000Z"), - modifiedBefore: new Date("2024-01-15T09:30:00.000Z"), - number: "number", - pageSize: 1, - remoteFields: "type", - remoteId: "remote_id", - showEnumOrigins: "type", - status: "DRAFT", - type: "ACCOUNTS_PAYABLE", - }); + const response = await client.accounting.invoices.bulkRetrieve("batch_id"); expect(response).toEqual({ - batchId: "batch_id", - status: "status", + batchId: "d0a3ca3e-2d7a-44cd-a94b-bda805f23b5", + status: "ENQUEUED", totalCount: 1, objects: [ { itemId: "item_id", - status: "status", + status: "PENDING", }, ], }); diff --git a/tests/wire/Accounting/itemFulfillments.test.ts b/tests/wire/Accounting/itemFulfillments.test.ts index 41d80ab21..491c927df 100644 --- a/tests/wire/Accounting/itemFulfillments.test.ts +++ b/tests/wire/Accounting/itemFulfillments.test.ts @@ -151,6 +151,8 @@ describe("ItemFulfillmentsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problem_type: "UNRECOGNIZED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], errors: [ @@ -160,6 +162,8 @@ describe("ItemFulfillmentsClient", () => { detail: "custom_fields is a required field on model.", problem_type: "MISSING_REQUIRED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], logs: [ @@ -238,6 +242,8 @@ describe("ItemFulfillmentsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problemType: "UNRECOGNIZED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], errors: [ @@ -249,6 +255,8 @@ describe("ItemFulfillmentsClient", () => { detail: "custom_fields is a required field on model.", problemType: "MISSING_REQUIRED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], logs: [ @@ -353,7 +361,7 @@ describe("ItemFulfillmentsClient", () => { }); }); - test("asyncBulkCreate", async () => { + test("bulkCreate", async () => { const server = mockServerPool.createServer(); const client = new MergeClient({ maxRetries: 0, @@ -362,19 +370,17 @@ describe("ItemFulfillmentsClient", () => { environment: server.baseUrl, }); const rawRequestBody = { batch_items: [{ item_id: "item_id", payload: {} }] }; - const rawResponseBody = { batch_id: "batch_id" }; + const rawResponseBody = { batch_id: "d0a3ca3e-2d7a-44cd-a94b-bda805f23b5" }; server .mockEndpoint() - .post("/accounting/v1/item-fulfillments/async/bulk") + .post("/accounting/v1/item-fulfillments/bulk") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.accounting.itemFulfillments.asyncBulkCreate({ - isDebugMode: true, - runAsync: true, + const response = await client.accounting.itemFulfillments.bulkCreate({ batchItems: [ { itemId: "item_id", @@ -383,11 +389,11 @@ describe("ItemFulfillmentsClient", () => { ], }); expect(response).toEqual({ - batchId: "batch_id", + batchId: "d0a3ca3e-2d7a-44cd-a94b-bda805f23b5", }); }); - test("batchObjectsList", async () => { + test("bulkRetrieve", async () => { const server = mockServerPool.createServer(); const client = new MergeClient({ maxRetries: 0, @@ -397,37 +403,28 @@ describe("ItemFulfillmentsClient", () => { }); const rawResponseBody = { - batch_id: "batch_id", - status: "status", + batch_id: "d0a3ca3e-2d7a-44cd-a94b-bda805f23b5", + status: "ENQUEUED", total_count: 1, - objects: [{ item_id: "item_id", status: "status" }], + objects: [{ item_id: "item_id", status: "PENDING" }], }; server .mockEndpoint() - .get("/accounting/v1/item-fulfillments/batch/batch_id/objects") + .get("/accounting/v1/item-fulfillments/bulk/batch_id") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.accounting.itemFulfillments.batchObjectsList("batch_id", { - cursor: "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", - includeDeletedData: true, - includeRemoteData: true, - includeRemoteFields: true, - includeShellData: true, - pageSize: 1, - remoteFields: "status", - showEnumOrigins: "status", - }); + const response = await client.accounting.itemFulfillments.bulkRetrieve("batch_id"); expect(response).toEqual({ - batchId: "batch_id", - status: "status", + batchId: "d0a3ca3e-2d7a-44cd-a94b-bda805f23b5", + status: "ENQUEUED", totalCount: 1, objects: [ { itemId: "item_id", - status: "status", + status: "PENDING", }, ], }); diff --git a/tests/wire/Accounting/items.test.ts b/tests/wire/Accounting/items.test.ts index df28e3d37..43e345f5d 100644 --- a/tests/wire/Accounting/items.test.ts +++ b/tests/wire/Accounting/items.test.ts @@ -151,6 +151,8 @@ describe("ItemsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problem_type: "UNRECOGNIZED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], errors: [ @@ -160,6 +162,8 @@ describe("ItemsClient", () => { detail: "custom_fields is a required field on model.", problem_type: "MISSING_REQUIRED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], logs: [ @@ -230,6 +234,8 @@ describe("ItemsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problemType: "UNRECOGNIZED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], errors: [ @@ -241,6 +247,8 @@ describe("ItemsClient", () => { detail: "custom_fields is a required field on model.", problemType: "MISSING_REQUIRED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], logs: [ @@ -377,6 +385,8 @@ describe("ItemsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problem_type: "UNRECOGNIZED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], errors: [ @@ -386,6 +396,8 @@ describe("ItemsClient", () => { detail: "custom_fields is a required field on model.", problem_type: "MISSING_REQUIRED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], logs: [ @@ -456,6 +468,8 @@ describe("ItemsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problemType: "UNRECOGNIZED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], errors: [ @@ -467,6 +481,8 @@ describe("ItemsClient", () => { detail: "custom_fields is a required field on model.", problemType: "MISSING_REQUIRED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], logs: [ diff --git a/tests/wire/Accounting/journalEntries.test.ts b/tests/wire/Accounting/journalEntries.test.ts index 697132eff..40a6b0625 100644 --- a/tests/wire/Accounting/journalEntries.test.ts +++ b/tests/wire/Accounting/journalEntries.test.ts @@ -19,7 +19,7 @@ describe("JournalEntriesClient", () => { results: [ { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remote_id: "remote_id", + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", transaction_date: "2020-03-31T00:00:00Z", @@ -88,7 +88,7 @@ describe("JournalEntriesClient", () => { results: [ { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remoteId: "remote_id", + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), transactionDate: new Date("2020-03-31T00:00:00.000Z"), @@ -194,7 +194,7 @@ describe("JournalEntriesClient", () => { const rawResponseBody = { model: { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remote_id: "remote_id", + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", transaction_date: "2020-03-31T00:00:00Z", @@ -254,6 +254,8 @@ describe("JournalEntriesClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problem_type: "UNRECOGNIZED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], errors: [ @@ -263,6 +265,8 @@ describe("JournalEntriesClient", () => { detail: "custom_fields is a required field on model.", problem_type: "MISSING_REQUIRED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], logs: [ @@ -294,7 +298,7 @@ describe("JournalEntriesClient", () => { expect(response).toEqual({ model: { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remoteId: "remote_id", + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), transactionDate: new Date("2020-03-31T00:00:00.000Z"), @@ -372,6 +376,8 @@ describe("JournalEntriesClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problemType: "UNRECOGNIZED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], errors: [ @@ -383,6 +389,8 @@ describe("JournalEntriesClient", () => { detail: "custom_fields is a required field on model.", problemType: "MISSING_REQUIRED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], logs: [ @@ -410,7 +418,7 @@ describe("JournalEntriesClient", () => { const rawResponseBody = { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remote_id: "remote_id", + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", transaction_date: "2020-03-31T00:00:00Z", @@ -480,7 +488,7 @@ describe("JournalEntriesClient", () => { }); expect(response).toEqual({ id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remoteId: "remote_id", + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), transactionDate: new Date("2020-03-31T00:00:00.000Z"), diff --git a/tests/wire/Accounting/paymentMethods.test.ts b/tests/wire/Accounting/paymentMethods.test.ts index 73a296aeb..9e1487f9f 100644 --- a/tests/wire/Accounting/paymentMethods.test.ts +++ b/tests/wire/Accounting/paymentMethods.test.ts @@ -19,7 +19,7 @@ describe("PaymentMethodsClient", () => { results: [ { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remote_id: "remote_id", + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", method_type: "CREDIT_CARD", @@ -48,7 +48,7 @@ describe("PaymentMethodsClient", () => { results: [ { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remoteId: "remote_id", + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), methodType: "CREDIT_CARD", @@ -97,7 +97,7 @@ describe("PaymentMethodsClient", () => { const rawResponseBody = { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remote_id: "remote_id", + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", method_type: "CREDIT_CARD", @@ -124,7 +124,7 @@ describe("PaymentMethodsClient", () => { }); expect(response).toEqual({ id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remoteId: "remote_id", + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), methodType: "CREDIT_CARD", diff --git a/tests/wire/Accounting/paymentTerms.test.ts b/tests/wire/Accounting/paymentTerms.test.ts index f69d6be78..e35a5a937 100644 --- a/tests/wire/Accounting/paymentTerms.test.ts +++ b/tests/wire/Accounting/paymentTerms.test.ts @@ -19,7 +19,7 @@ describe("PaymentTermsClient", () => { results: [ { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remote_id: "remote_id", + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", name: "Net 30", @@ -50,7 +50,7 @@ describe("PaymentTermsClient", () => { results: [ { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remoteId: "remote_id", + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), name: "Net 30", @@ -101,7 +101,7 @@ describe("PaymentTermsClient", () => { const rawResponseBody = { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remote_id: "remote_id", + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", name: "Net 30", @@ -130,7 +130,7 @@ describe("PaymentTermsClient", () => { }); expect(response).toEqual({ id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remoteId: "remote_id", + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), name: "Net 30", diff --git a/tests/wire/Accounting/payments.test.ts b/tests/wire/Accounting/payments.test.ts index 6493db780..abee178dc 100644 --- a/tests/wire/Accounting/payments.test.ts +++ b/tests/wire/Accounting/payments.test.ts @@ -244,6 +244,8 @@ describe("PaymentsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problem_type: "UNRECOGNIZED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], errors: [ @@ -253,6 +255,8 @@ describe("PaymentsClient", () => { detail: "custom_fields is a required field on model.", problem_type: "MISSING_REQUIRED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], logs: [ @@ -358,6 +362,8 @@ describe("PaymentsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problemType: "UNRECOGNIZED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], errors: [ @@ -369,6 +375,8 @@ describe("PaymentsClient", () => { detail: "custom_fields is a required field on model.", problemType: "MISSING_REQUIRED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], logs: [ @@ -595,6 +603,8 @@ describe("PaymentsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problem_type: "UNRECOGNIZED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], errors: [ @@ -604,6 +614,8 @@ describe("PaymentsClient", () => { detail: "custom_fields is a required field on model.", problem_type: "MISSING_REQUIRED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], logs: [ @@ -709,6 +721,8 @@ describe("PaymentsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problemType: "UNRECOGNIZED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], errors: [ @@ -720,6 +734,8 @@ describe("PaymentsClient", () => { detail: "custom_fields is a required field on model.", problemType: "MISSING_REQUIRED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], logs: [ diff --git a/tests/wire/Accounting/projects.test.ts b/tests/wire/Accounting/projects.test.ts index 93a426780..eb874dca4 100644 --- a/tests/wire/Accounting/projects.test.ts +++ b/tests/wire/Accounting/projects.test.ts @@ -19,7 +19,7 @@ describe("ProjectsClient", () => { results: [ { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remote_id: "remote_id", + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", name: "Permissions Mapping", @@ -48,7 +48,7 @@ describe("ProjectsClient", () => { results: [ { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remoteId: "remote_id", + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), name: "Permissions Mapping", @@ -103,7 +103,7 @@ describe("ProjectsClient", () => { const rawResponseBody = { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remote_id: "remote_id", + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", name: "Permissions Mapping", @@ -130,7 +130,7 @@ describe("ProjectsClient", () => { }); expect(response).toEqual({ id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remoteId: "remote_id", + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), name: "Permissions Mapping", diff --git a/tests/wire/Accounting/purchaseOrders.test.ts b/tests/wire/Accounting/purchaseOrders.test.ts index 06d1db63f..9d5578acf 100644 --- a/tests/wire/Accounting/purchaseOrders.test.ts +++ b/tests/wire/Accounting/purchaseOrders.test.ts @@ -328,6 +328,8 @@ describe("PurchaseOrdersClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problem_type: "UNRECOGNIZED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], errors: [ @@ -337,6 +339,8 @@ describe("PurchaseOrdersClient", () => { detail: "custom_fields is a required field on model.", problem_type: "MISSING_REQUIRED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], logs: [ @@ -470,6 +474,8 @@ describe("PurchaseOrdersClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problemType: "UNRECOGNIZED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], errors: [ @@ -481,6 +487,8 @@ describe("PurchaseOrdersClient", () => { detail: "custom_fields is a required field on model.", problemType: "MISSING_REQUIRED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], logs: [ diff --git a/tests/wire/Accounting/salesOrders.test.ts b/tests/wire/Accounting/salesOrders.test.ts index c65ba0ccd..cbad93c61 100644 --- a/tests/wire/Accounting/salesOrders.test.ts +++ b/tests/wire/Accounting/salesOrders.test.ts @@ -235,6 +235,8 @@ describe("SalesOrdersClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problem_type: "UNRECOGNIZED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], errors: [ @@ -244,6 +246,8 @@ describe("SalesOrdersClient", () => { detail: "custom_fields is a required field on model.", problem_type: "MISSING_REQUIRED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], logs: [ @@ -345,6 +349,8 @@ describe("SalesOrdersClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problemType: "UNRECOGNIZED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], errors: [ @@ -356,6 +362,8 @@ describe("SalesOrdersClient", () => { detail: "custom_fields is a required field on model.", problemType: "MISSING_REQUIRED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], logs: [ @@ -518,7 +526,7 @@ describe("SalesOrdersClient", () => { }); }); - test("asyncBulkCreate", async () => { + test("bulkCreate", async () => { const server = mockServerPool.createServer(); const client = new MergeClient({ maxRetries: 0, @@ -527,19 +535,17 @@ describe("SalesOrdersClient", () => { environment: server.baseUrl, }); const rawRequestBody = { batch_items: [{ item_id: "item_id", payload: {} }] }; - const rawResponseBody = { batch_id: "batch_id" }; + const rawResponseBody = { batch_id: "d0a3ca3e-2d7a-44cd-a94b-bda805f23b5" }; server .mockEndpoint() - .post("/accounting/v1/sales-orders/async/bulk") + .post("/accounting/v1/sales-orders/bulk") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.accounting.salesOrders.asyncBulkCreate({ - isDebugMode: true, - runAsync: true, + const response = await client.accounting.salesOrders.bulkCreate({ batchItems: [ { itemId: "item_id", @@ -548,11 +554,11 @@ describe("SalesOrdersClient", () => { ], }); expect(response).toEqual({ - batchId: "batch_id", + batchId: "d0a3ca3e-2d7a-44cd-a94b-bda805f23b5", }); }); - test("batchObjectsList", async () => { + test("bulkRetrieve", async () => { const server = mockServerPool.createServer(); const client = new MergeClient({ maxRetries: 0, @@ -562,45 +568,28 @@ describe("SalesOrdersClient", () => { }); const rawResponseBody = { - batch_id: "batch_id", - status: "status", + batch_id: "d0a3ca3e-2d7a-44cd-a94b-bda805f23b5", + status: "ENQUEUED", total_count: 1, - objects: [{ item_id: "item_id", status: "status" }], + objects: [{ item_id: "item_id", status: "PENDING" }], }; server .mockEndpoint() - .get("/accounting/v1/sales-orders/batch/batch_id/objects") + .get("/accounting/v1/sales-orders/bulk/batch_id") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.accounting.salesOrders.batchObjectsList("batch_id", { - companyId: "company_id", - createdAfter: new Date("2024-01-15T09:30:00.000Z"), - createdBefore: new Date("2024-01-15T09:30:00.000Z"), - cursor: "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", - includeDeletedData: true, - includeRemoteData: true, - includeRemoteFields: true, - includeShellData: true, - issueDateAfter: new Date("2024-01-15T09:30:00.000Z"), - issueDateBefore: new Date("2024-01-15T09:30:00.000Z"), - modifiedAfter: new Date("2024-01-15T09:30:00.000Z"), - modifiedBefore: new Date("2024-01-15T09:30:00.000Z"), - pageSize: 1, - remoteFields: "status", - remoteId: "remote_id", - showEnumOrigins: "status", - }); + const response = await client.accounting.salesOrders.bulkRetrieve("batch_id"); expect(response).toEqual({ - batchId: "batch_id", - status: "status", + batchId: "d0a3ca3e-2d7a-44cd-a94b-bda805f23b5", + status: "ENQUEUED", totalCount: 1, objects: [ { itemId: "item_id", - status: "status", + status: "PENDING", }, ], }); diff --git a/tests/wire/Accounting/taxRates.test.ts b/tests/wire/Accounting/taxRates.test.ts index 3047964a4..c73de71db 100644 --- a/tests/wire/Accounting/taxRates.test.ts +++ b/tests/wire/Accounting/taxRates.test.ts @@ -19,7 +19,7 @@ describe("TaxRatesClient", () => { results: [ { id: "b82302de-852e-4e60-b050-edf9da3b7c02", - remote_id: "remote_id", + remote_id: "039111", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", company: "company", @@ -33,7 +33,7 @@ describe("TaxRatesClient", () => { tax_components: [ { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remote_id: "remote_id", + remote_id: "039111", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", name: "Drink Tax Component", @@ -65,7 +65,7 @@ describe("TaxRatesClient", () => { results: [ { id: "b82302de-852e-4e60-b050-edf9da3b7c02", - remoteId: "remote_id", + remoteId: "039111", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), company: "company", @@ -79,7 +79,7 @@ describe("TaxRatesClient", () => { taxComponents: [ { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remoteId: "remote_id", + remoteId: "039111", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), name: "Drink Tax Component", @@ -138,7 +138,7 @@ describe("TaxRatesClient", () => { const rawResponseBody = { id: "b82302de-852e-4e60-b050-edf9da3b7c02", - remote_id: "remote_id", + remote_id: "039111", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", company: "company", @@ -152,7 +152,7 @@ describe("TaxRatesClient", () => { tax_components: [ { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remote_id: "remote_id", + remote_id: "039111", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", name: "Drink Tax Component", @@ -183,7 +183,7 @@ describe("TaxRatesClient", () => { }); expect(response).toEqual({ id: "b82302de-852e-4e60-b050-edf9da3b7c02", - remoteId: "remote_id", + remoteId: "039111", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), company: "company", @@ -197,7 +197,7 @@ describe("TaxRatesClient", () => { taxComponents: [ { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remoteId: "remote_id", + remoteId: "039111", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), name: "Drink Tax Component", diff --git a/tests/wire/Accounting/vendorCredits.test.ts b/tests/wire/Accounting/vendorCredits.test.ts index 711892214..23ca135ef 100644 --- a/tests/wire/Accounting/vendorCredits.test.ts +++ b/tests/wire/Accounting/vendorCredits.test.ts @@ -19,7 +19,7 @@ describe("VendorCreditsClient", () => { results: [ { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remote_id: "remote_id", + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", number: "6", @@ -76,6 +76,7 @@ describe("VendorCreditsClient", () => { ], applied_to_lines: [ { + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", invoice: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -107,7 +108,7 @@ describe("VendorCreditsClient", () => { results: [ { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remoteId: "remote_id", + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), number: "6", @@ -164,6 +165,7 @@ describe("VendorCreditsClient", () => { ], appliedToLines: [ { + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), invoice: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -224,7 +226,7 @@ describe("VendorCreditsClient", () => { const rawResponseBody = { model: { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remote_id: "remote_id", + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", number: "6", @@ -281,6 +283,7 @@ describe("VendorCreditsClient", () => { ], applied_to_lines: [ { + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", invoice: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -303,6 +306,8 @@ describe("VendorCreditsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problem_type: "UNRECOGNIZED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], errors: [ @@ -312,6 +317,8 @@ describe("VendorCreditsClient", () => { detail: "custom_fields is a required field on model.", problem_type: "MISSING_REQUIRED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], logs: [ @@ -343,7 +350,7 @@ describe("VendorCreditsClient", () => { expect(response).toEqual({ model: { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remoteId: "remote_id", + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), number: "6", @@ -400,6 +407,7 @@ describe("VendorCreditsClient", () => { ], appliedToLines: [ { + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), invoice: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -433,6 +441,8 @@ describe("VendorCreditsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problemType: "UNRECOGNIZED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], errors: [ @@ -444,6 +454,8 @@ describe("VendorCreditsClient", () => { detail: "custom_fields is a required field on model.", problemType: "MISSING_REQUIRED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], logs: [ @@ -471,7 +483,7 @@ describe("VendorCreditsClient", () => { const rawResponseBody = { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remote_id: "remote_id", + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", number: "6", @@ -531,7 +543,7 @@ describe("VendorCreditsClient", () => { ], applied_to_lines: [ { - remote_id: "remote_id", + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", invoice: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -562,7 +574,7 @@ describe("VendorCreditsClient", () => { }); expect(response).toEqual({ id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remoteId: "remote_id", + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), number: "6", @@ -622,7 +634,7 @@ describe("VendorCreditsClient", () => { ], appliedToLines: [ { - remoteId: "remote_id", + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), invoice: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -662,7 +674,7 @@ describe("VendorCreditsClient", () => { const rawResponseBody = { model: { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remote_id: "remote_id", + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", number: "6", @@ -719,6 +731,7 @@ describe("VendorCreditsClient", () => { ], applied_to_lines: [ { + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", invoice: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -741,6 +754,8 @@ describe("VendorCreditsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problem_type: "UNRECOGNIZED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], errors: [ @@ -750,6 +765,8 @@ describe("VendorCreditsClient", () => { detail: "custom_fields is a required field on model.", problem_type: "MISSING_REQUIRED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], logs: [ @@ -781,7 +798,7 @@ describe("VendorCreditsClient", () => { expect(response).toEqual({ model: { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remoteId: "remote_id", + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), number: "6", @@ -838,6 +855,7 @@ describe("VendorCreditsClient", () => { ], appliedToLines: [ { + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), invoice: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -871,6 +889,8 @@ describe("VendorCreditsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problemType: "UNRECOGNIZED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], errors: [ @@ -882,6 +902,8 @@ describe("VendorCreditsClient", () => { detail: "custom_fields is a required field on model.", problemType: "MISSING_REQUIRED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], logs: [ @@ -910,7 +932,7 @@ describe("VendorCreditsClient", () => { const rawResponseBody = { model: { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remote_id: "remote_id", + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", number: "6", @@ -967,6 +989,7 @@ describe("VendorCreditsClient", () => { ], applied_to_lines: [ { + remote_id: "088899", created_at: "2021-09-15T00:00:00Z", modified_at: "2021-10-16T00:00:00Z", invoice: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -989,6 +1012,8 @@ describe("VendorCreditsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problem_type: "UNRECOGNIZED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], errors: [ @@ -998,6 +1023,8 @@ describe("VendorCreditsClient", () => { detail: "custom_fields is a required field on model.", problem_type: "MISSING_REQUIRED_FIELD", block_merge_link: true, + raw_error: "raw_error", + error_code: 1, }, ], logs: [ @@ -1030,7 +1057,7 @@ describe("VendorCreditsClient", () => { expect(response).toEqual({ model: { id: "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4", - remoteId: "remote_id", + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), number: "6", @@ -1087,6 +1114,7 @@ describe("VendorCreditsClient", () => { ], appliedToLines: [ { + remoteId: "088899", createdAt: new Date("2021-09-15T00:00:00.000Z"), modifiedAt: new Date("2021-10-16T00:00:00.000Z"), invoice: "5b3c1341-a20f-4e51-b72c-f3830a16c97b", @@ -1120,6 +1148,8 @@ describe("VendorCreditsClient", () => { detail: "An unrecognized field, age, was passed in with request data.", problemType: "UNRECOGNIZED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], errors: [ @@ -1131,6 +1161,8 @@ describe("VendorCreditsClient", () => { detail: "custom_fields is a required field on model.", problemType: "MISSING_REQUIRED_FIELD", blockMergeLink: true, + rawError: "raw_error", + errorCode: 1, }, ], logs: [