Skip to content

Commit

Permalink
Merge pull request #459 from HubSpot/feature/11.0.0
Browse files Browse the repository at this point in the history
11.0.0 beta
  • Loading branch information
ksvirkou-hubspot authored Jan 31, 2024
2 parents 6e33fac + 5cd7a30 commit 13a0191
Show file tree
Hide file tree
Showing 1,524 changed files with 49,436 additions and 21,800 deletions.
87 changes: 81 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,75 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased](https://github.com/HubSpot/hubspot-api-nodejs/compare/10.2.0...HEAD)

## [11.0.0] - 2024-02-01

## Updated

- `automation.actions.definitionsAPI.create(appId: number, extensionActionDefinitionInput: ExtensionActionDefinitionInput):Promise<ExtensionActionDefinition>` => `automation.actions.definitionsAPI.create(appId: number, publicActionDefinitionEgg: PublicActionDefinitionEgg):Promise<PublicActionDefinition>`.
- `automation.actions.definitionsAPI.getById():Promise<ExtensionActionDefinition>` => `automation.actions.definitionsAPI.getById():Promise<PublicActionDefinition>`.
- `automation.actions.definitionsAPI.update(definitionId: string, appId: number, extensionActionDefinitionPatch: ExtensionActionDefinitionPatch):Promise<ExtensionActionDefinition>` => `automation.actions.definitionsAPI.update(definitionId: string, appId: number, publicActionDefinitionPatch: PublicActionDefinitionPatch):Promise<PublicActionDefinition>`.
- `automation.actions.definitionsAPI.getPage():Promise<CollectionResponseExtensionActionDefinitionForwardPaging>` => `automation.actions.definitionsAPI.getPage():Promise<CollectionResponsePublicActionDefinitionForwardPaging>`.
- Added new function type `POST_ACTION_EXECUTION` to all methods of `automation.actions.functionsApi`.
- `automation.actions.functionsApi.createOrReplace():Promise<ActionFunctionIdentifier>` => `automation.actions.functionsApi.createOrReplace():Promise<PublicActionFunctionIdentifier >`.
- `automation.actions.functionsApi.createOrReplaceByFunctionType():Promise<ActionFunctionIdentifier>` => `automation.actions.functionsApi.createOrReplaceByFunctionType():Promise<PublicActionFunctionIdentifier >`.
- `automation.actions.functionsApi.getByFunctionType():Promise<ActionFunction>` => `automation.actions.functionsApi.getByFunctionType():Promise<PublicActionFunction>`.
- `automation.actions.functionsApi.getById():Promise<ActionFunction>` => `automation.actions.functionsApi.getById():Promise<PublicActionFunction>`.
- `automation.actions.functionsApi.getPage():Promise<CollectionResponseActionFunctionIdentifierNoPaging>` => `automation.actions.functionsApi.getPage():Promise<CollectionResponsePublicActionFunctionIdentifierNoPaging>`.
- `automation.actions.revisionsApi.getById():Promise<ActionRevision>` => `automation.actions.revisionsApi.getById():Promise<PublicActionRevision>`.
- `automation.actions.revisionsApi.getPage():Promise<CollectionResponseActionRevisionForwardPaging>` => `automation.actions.revisionsApi.getPage():Promise<CollectionResponsePublicActionRevisionForwardPaging>`.
- Added param `property` to `cms.blogs.authors.blogAuthorsApi.getById()`.
- Added param `property` to `cms.blogs.authors.blogAuthorsApi.getPage()`.
- Changed type from laguages enum to `string` in `cms/blogs/authors/models/AttachToLangPrimaryRequestVNext::language` and `cms/blogs/authors/models/AttachToLangPrimaryRequestVNext::primaryLanguage`.
- Added param `property` to `cms.blogs.blogPosts.blogPostsApi.getById()`.
- Added param `property` to `cms.blogs.blogPosts.blogPostsApi.getPage()`.
- Changed type from laguages enum to `string` in `cms/blogs/blog_posts/models/AttachToLangPrimaryRequestVNext::language` and `cms/blogs/blog_posts/models/AttachToLangPrimaryRequestVNext::primaryLanguage`.
- Cnange type from `SideOrCornerVerticalSideEnum` to `string` in `cms/blogs/blog_posts/models/SideOrCorner::verticalSide`.
- Cnange type from `SideOrCornerHorizontalSideEnum` to `string` in `cms/blogs/blog_posts/models/SideOrCorner::horizontalSide`.
- Cnange type from `StylesVerticalAlignmentEnum` to `string` in `cms/blogs/blog_posts/models/Styles::verticalAlignment`.
- Cnange type from `StylesFlexboxPositioningEnum` to `string` in `cms/blogs/blog_posts/models/Styles::flexboxPositioning`.
- Added param `property` to `cms.blogs.tags.blogTagsApi.getById()`.
- Added param `property` to `cms.blogs.tags.blogTagsApi.getPage()`.
- Changed type from laguages enum to `string` in `cms/blogs/tags/models/AttachToLangPrimaryRequestVNext::language` and `cms/blogs/tags/models/AttachToLangPrimaryRequestVNext::primaryLanguage`.
- Cnange type from `ErrorCategory` to `string` in `crm/associations/models/StandardError::category`.
- `crm.associations.v4.basicApi.create(): Promise<LabelsBetweenObjectPair>` => `crm.associations.v4.basicApi.create(): Promise<LabelsBetweenObjectPair1>`
- Cnange type from `StandardError1[]` to `StandardError[]` in `crm/associations/v4/models/BatchResponseSimplePublicObjectWithErrors::errors`.
- Cnange type from `ErrorCategory` to `string` in `crm/associations/v4/models/StandardError::category`.
- Rename `crm.associations.v4.schema.definitionsApi._delete()` => `crm.associations.v4.schema.definitionsApi.archive()`.
- Removed `crm.objects.associationsApi`.
- Cnange type from `number` to `string` in `PublicObjectSearchRequest::after` in all CRM clients.
- `crm.objects.postalMail.basicApi.archive(postalMail: string, _options?: Configuration)` => `crm.objects.postalMail.basicApi.archive(postalMailId: string, _options?: Configuration)`.
- `crm.objects.postalMail.basicApi.getById(postalMail: string, properties?: Array<string>, propertiesWithHistory?: Array<string>, associations?: Array<string>, archived?: boolean, idProperty?: string, _options?: Configuration)` => `crm.objects.postalMail.basicApi.getById(postalMailId: string, properties?: Array<string>, propertiesWithHistory?: Array<string>, associations?: Array<string>, archived?: boolean, idProperty?: string, _options?: Configuration)`.
- `crm.objects.postalMail.basicApi.update(postalMail: string, simplePublicObjectInput: SimplePublicObjectInput, idProperty?: string, _options?: Configuration)` => `crm.objects.postalMail.basicApi.update(postalMailId: string, simplePublicObjectInput: SimplePublicObjectInput, idProperty?: string, _options?: Configuration)`.
- Added param `validateDealStageUsagesBeforeDelete` to `cms.pipelines.pipelinesApi.archive()`, `cms.pipelines.pipelinesApi.replace()` and `cms.pipelines.pipelinesApi.update()`.
- `events.eventsApi.getPage(occurredAfter?: Date, occurredBefore?: Date, objectType?: string, objectId?: number, eventType?: string, after?: string, before?: string, limit?: number, sort?: Array<string>, _options?: Configuration)` => `events.eventsApi.getPage(objectType?: string, eventType?: string, occurredAfter?: Date, occurredBefore?: Date, objectId?: number, indexTableName?: string, indexSpecificMetadata?: string, after?: string, before?: string, limit?: number, sort?: Array<string>, objectPropertyPropname?: any, propertyPropname?: any, id?: Array<string>, _options?: Configuration)`
- Rewrite all enums from type to enum.
```typescript
export type Enum = "OPTION1" | "OPTION2";
// =>
export enum Enum {
Option1 = 'OPTION1',
Option2 = 'OPTION2'
}
```

## Added

- `crm.companies.gdprApi` API client.
- `crm.deals.gdprApi` API client.
- `crm.extensions.calling.recordingSettingsApi` API client.
- `crm.line_items.gdprApi` API client.
- `crm.objects.calls.gdprApi` API client.
- `crm.objects.communications.gdprApi` API client.
- `crm.objects.emails.gdprApi` API client.
- `crm.objects.feedbackSubmissions.gdprApi` API client.
- `crm.objects.meetings.gdprApi` API client.
- `crm.objects.notes.gdprApi` API client.
- `crm.objects.postalMail.gdprApi` API client.
- `crm.objects.tasks.gdprApi` API client.
- `crm.products.gdprApi` API client.
- `crm.quotes.gdprApi` API client.
- `crm.tickets.gdprApi` API client.

## [10.2.0] - 2023-12-13

## Added
Expand Down Expand Up @@ -51,6 +120,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Move method `doUpsertById` from `marketing.events.marketingEventsExternalApi` to `marketing.events.subscriberStateChanges`.
- Rename `marketing.events.settingsExternalApi` => `marketing.events.settingsApi`
- Cnange type from `ErrorCategory` to `string` in `marketing/events/models/StandardError::category`.
- `crm.extensions.cards.cardsApi.archive(appId: number, cardId: string, _options?: Configuration)` => `crm.extensions.cards.cardsApi.archive(cardId: string, appId: number, _options?: Configuration)`
- `crm.extensions.cards.cardsApi.getById(appId: number, cardId: string, _options?: Configuration): Promise<CardResponse >` => `crm.extensions.cards.cardsApi.getById(cardId: string, appId: number, _options?: Configuration): Promise<PublicCardResponse >`
- `crm.extensions.cards.cardsApi.update(appId: number, cardId: string, cardPatchRequest: CardPatchRequest, _options?: Configuration): Promise<CardResponse >` => `crm.extensions.cards.cardsApi.update(cardId: string, appId: number, cardPatchRequest: CardPatchRequest, _options?: Configuration): Promise<PublicCardResponse >`
- `crm.extensions.cards.cardsApi.create(): Promise<CardResponse >` => `crm.extensions.cards.cardsApi.create(): Promise<PublicCardResponse >`
- `crm.extensions.cards.cardsApi.getAll(): Promise<CardListResponse >` => `crm.extensions.cards.cardsApi.getAll(): Promise<PublicCardListResponse >`:


## Added

Expand Down Expand Up @@ -149,12 +224,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Updated

- Rename `cms.hubdb.rowsBatchApi.batchCloneDraftTableRows()` => `cms.hubdb.rowsBatchApi.cloneDraftTableRows()`.
- Rename `cms.hubdb.rowsBatchApi.batchCreateDraftTableRows()` => `cms.hubdb.rowsBatchApi. createDraftTableRows()`.
- Rename `cms.hubdb.rowsBatchApi.batchPurgeDraftTableRows()` => `cms.hubdb.rowsBatchApi. purgeDraftTableRows()`.
- Rename `cms.hubdb.rowsBatchApi.batchReadDraftTableRows()` => `cms.hubdb.rowsBatchApi. readDraftTableRows()`.
- Rename `cms.hubdb.rowsBatchApi.batchReadTableRows()` => `cms.hubdb.rowsBatchApi. readTableRows()`.
- Rename `cms.hubdb.rowsBatchApi.batchReplaceDraftTableRows()` => `cms.hubdb.rowsBatchApi. replaceDraftTableRows()`.
- Rename `cms.hubdb.rowsBatchApi.batchUpdateDraftTableRows()` => `cms.hubdb.rowsBatchApi. updateDraftTableRows()`.
- Rename `cms.hubdb.rowsBatchApi.batchCreateDraftTableRows()` => `cms.hubdb.rowsBatchApi.createDraftTableRows()`.
- Rename `cms.hubdb.rowsBatchApi.batchPurgeDraftTableRows()` => `cms.hubdb.rowsBatchApi.purgeDraftTableRows()`.
- Rename `cms.hubdb.rowsBatchApi.batchReadDraftTableRows()` => `cms.hubdb.rowsBatchApi.readDraftTableRows()`.
- Rename `cms.hubdb.rowsBatchApi.batchReadTableRows()` => `cms.hubdb.rowsBatchApi.readTableRows()`.
- Rename `cms.hubdb.rowsBatchApi.batchReplaceDraftTableRows()` => `cms.hubdb.rowsBatchApi.replaceDraftTableRows()`.
- Rename `cms.hubdb.rowsBatchApi.batchUpdateDraftTableRows()` => `cms.hubdb.rowsBatchApi.updateDraftTableRows()`.
- `cms.hubdb.tablesApi.getDraftTableDetailsById(tableIdOrName: string, archived?: boolean, includeForeignIds?: boolean, _options?: Configuration)` => `cms.hubdb.tablesApi.getDraftTableDetailsById(tableIdOrName: string, includeForeignIds?: boolean, archived?: boolean, _options?: Configuration)`
- `cms.hubdb.tablesApi.getTableDetails(tableIdOrName: string, archived?: boolean, includeForeignIds?: boolean, _options?: Configuration)` => `cms.hubdb.tablesApi.getTableDetails(tableIdOrName: string, includeForeignIds?: boolean, archived?: boolean, _options?: Configuration)`
- `cms.hubdb.tablesApi.updateDraftTable(tableIdOrName: string, hubDbTableV3Request: HubDbTableV3Request, archived?: boolean, includeForeignIds?: boolean, _options?: Configuration)` => `cms.hubdb.tablesApi.updateDraftTable(tableIdOrName: string, hubDbTableV3Request: HubDbTableV3Request, includeForeignIds?: boolean, archived?: boolean, _options?: Configuration)`
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ await hubspotClient.crm.associations.v4.basicApi.create(
[
{
"associationCategory": "HUBSPOT_DEFINED",
"associationTypeId": AssociationTypes.companyToContact
"associationTypeId": AssociationTypes.companyToContact
// AssociationTypes contains the most popular HubSpot defined association types
}
]
Expand Down Expand Up @@ -258,7 +258,7 @@ const publicObjectSearchRequest = {
operator: 'GTE',
value: `${Date.now() - 30 * 60000}`
}
]
]
}
],
sorts: [{ propertyName: 'createdate', direction: 'DESCENDING' }],
Expand Down Expand Up @@ -321,7 +321,7 @@ const response = await hubspotClient.files.filesApi.upload(
'/folder',
'photo.jpg',
undefined,
JSON.stringify({
JSON.stringify({
access: 'PRIVATE',
overwrite: false,
duplicateValidationStrategy: 'NONE',
Expand Down Expand Up @@ -410,11 +410,11 @@ console.log(response);

## Reserved words

The SDK has reserved words(e.g. `from`). [Full list of reserved words.](https://openapi-generator.tech/docs/generators/typescript#reserved-words)
When you face with a reserved word you have to add `_` before the word(e.g. `_from`).
The SDK has reserved words(e.g. `from`, `in`). [Full list of reserved words.](https://openapi-generator.tech/docs/generators/typescript#reserved-words)
When you face with a reserved word you have to add `_` before the word(e.g. `_from`, `_in`).

```javascript
const BatchInputPublicAssociation = {
const BatchInputPublicAssociation = {
inputs: [
{
_from: {
Expand All @@ -425,7 +425,7 @@ const BatchInputPublicAssociation = {
},
type: 'contact_to_company'
}
]
]
};

const response = await hubspotClient.crm.associations.batchApi.create(
Expand Down
26 changes: 12 additions & 14 deletions codegen/automation/actions/apis/CallbacksApi.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// TODO: better import syntax?
import {BaseAPIRequestFactory, RequiredError} from './baseapi';
import {Configuration} from '../configuration';
import {RequestContext, HttpMethod, ResponseContext} from '../http/http';
import {RequestContext, HttpMethod, ResponseContext, HttpInfo} from '../http/http';
import {ObjectSerializer} from '../models/ObjectSerializer';
import {ApiException} from './exception';
import { isCodeInRange} from '../util';
Expand All @@ -17,10 +17,9 @@ import { CallbackCompletionRequest } from '../models/CallbackCompletionRequest';
export class CallbacksApiRequestFactory extends BaseAPIRequestFactory {

/**
* Completes the given action callback.
* Complete a callback
* @param callbackId The ID of the target app.
* @param callbackCompletionRequest The result of the completed action.
* Completes a single callback
* @param callbackId
* @param callbackCompletionRequest
*/
public async complete(callbackId: string, callbackCompletionRequest: CallbackCompletionRequest, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
Expand Down Expand Up @@ -73,9 +72,8 @@ export class CallbacksApiRequestFactory extends BaseAPIRequestFactory {
}

/**
* Completes the given action callbacks.
* Complete a batch of callbacks
* @param batchInputCallbackCompletionBatchRequest The result of the completed action.
* Completes a batch of callbacks
* @param batchInputCallbackCompletionBatchRequest
*/
public async completeBatch(batchInputCallbackCompletionBatchRequest: BatchInputCallbackCompletionBatchRequest, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
Expand Down Expand Up @@ -131,10 +129,10 @@ export class CallbacksApiResponseProcessor {
* @params response Response returned by the server for a request to complete
* @throws ApiException if the response code was not in [200, 299]
*/
public async complete(response: ResponseContext): Promise<void > {
public async completeWithHttpInfo(response: ResponseContext): Promise<HttpInfo<void >> {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("204", response.httpStatusCode)) {
return;
return new HttpInfo(response.httpStatusCode, response.headers, response.body, undefined);
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: Error = ObjectSerializer.deserialize(
Expand All @@ -150,7 +148,7 @@ export class CallbacksApiResponseProcessor {
ObjectSerializer.parse(await response.body.text(), contentType),
"void", ""
) as void;
return body;
return new HttpInfo(response.httpStatusCode, response.headers, response.body, body);
}

throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
Expand All @@ -163,10 +161,10 @@ export class CallbacksApiResponseProcessor {
* @params response Response returned by the server for a request to completeBatch
* @throws ApiException if the response code was not in [200, 299]
*/
public async completeBatch(response: ResponseContext): Promise<void > {
public async completeBatchWithHttpInfo(response: ResponseContext): Promise<HttpInfo<void >> {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("204", response.httpStatusCode)) {
return;
return new HttpInfo(response.httpStatusCode, response.headers, response.body, undefined);
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: Error = ObjectSerializer.deserialize(
Expand All @@ -182,7 +180,7 @@ export class CallbacksApiResponseProcessor {
ObjectSerializer.parse(await response.body.text(), contentType),
"void", ""
) as void;
return body;
return new HttpInfo(response.httpStatusCode, response.headers, response.body, body);
}

throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
Expand Down
Loading

0 comments on commit 13a0191

Please sign in to comment.