Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support Google Ads v15 #12

Merged
merged 29 commits into from
Nov 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4a8605e
disable source map
htdangkhoa Jan 25, 2023
448afad
test new workflows
htdangkhoa Jan 26, 2023
1df90df
fix rename workflow.yml to test.yml
htdangkhoa Jan 26, 2023
b25e0b2
update workflows
htdangkhoa Jan 26, 2023
a76232a
update workflows
htdangkhoa Jan 26, 2023
3991936
update workflows
htdangkhoa Jan 26, 2023
cc5b5a2
fix missing environment in template
htdangkhoa Jan 26, 2023
9845ad7
update workflows
htdangkhoa Jan 26, 2023
dc19caf
fix missing environment
htdangkhoa Jan 26, 2023
869cead
fix missing environment
htdangkhoa Jan 26, 2023
1a43fe6
fix missing environment
htdangkhoa Jan 26, 2023
5fb95c6
update workflows
htdangkhoa Jan 26, 2023
0ba2ba5
update workflows
htdangkhoa Jan 26, 2023
5eaad65
fix script with action/github-script
htdangkhoa Jan 26, 2023
06f6cca
fix cannot delete deployment
htdangkhoa Jan 26, 2023
85023d1
update workflows for production
htdangkhoa Jan 26, 2023
32a341b
fix conflict
htdangkhoa Jan 26, 2023
9543c63
implement v13
htdangkhoa May 23, 2023
f218a52
replace all of v12 to v13
htdangkhoa May 23, 2023
6cb75d5
Merge branches 'main' and 'develop' of https://github.com/htdangkhoa/…
htdangkhoa Nov 11, 2023
73a5d8b
feat: add Logging for summary and detail
htdangkhoa Nov 11, 2023
db08223
feat: support google ads v14
htdangkhoa Nov 11, 2023
4e09e67
chore: update dependencies
htdangkhoa Nov 12, 2023
177ebd8
feat: support node 20
htdangkhoa Nov 12, 2023
a8978e1
chore: update README.md
htdangkhoa Nov 12, 2023
fb603d8
chore: update pipeline
htdangkhoa Nov 12, 2023
642566a
feat: Google Ads API v14 & Logging interceptor (#10) (#11)
htdangkhoa Nov 12, 2023
1e432e5
feat: support google ads v15
htdangkhoa Nov 12, 2023
856dce7
Merge branches 'main' and 'develop' of https://github.com/htdangkhoa/…
htdangkhoa Nov 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<h1 align="center">Google Ads API Nodejs Client Library</h1>

<p align="center">
<a href="https://developers.google.com/google-ads/api/docs/release-notes#v14">
<img src="https://img.shields.io/badge/google%20ads-v14-009688.svg?style=flat-square">
<a href="https://developers.google.com/google-ads/api/docs/release-notes#v15">
<img src="https://img.shields.io/badge/google%20ads-v15-009688.svg?style=flat-square">
</a>
<a href="https://www.npmjs.com/package/@htdangkhoa/google-ads">
<img src="https://img.shields.io/npm/v/@htdangkhoa/google-ads.svg?style=flat-square">
Expand Down Expand Up @@ -234,19 +234,18 @@ const response = await service.search({ query });
# example
yarn generate v13
```
3. Make sure the version number in the `src` folder is correct (it should match the version number you passed to the `generate` command)

3. Run tests to make sure everything worked (you may need to update the version numbers here)
4. Run tests to make sure everything worked (you may need to update the version numbers here)

```sh
yarn test
```

4. Build the library
5. Build the library

```sh
yarn build
```

5. Make a pull request, get it approved and merged into master

6. Publish to npm
6. Make a pull request, get it approved and merged into `main`
2 changes: 1 addition & 1 deletion src/lib/Customer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { CustomerServiceClient } from '../generated/google';
import {
ListAccessibleCustomersRequest,
ListAccessibleCustomersResponse,
} from '../generated/google/ads/googleads/v14/services/customer_service';
} from '../generated/google/ads/googleads/v15/services/customer_service';

export class Customer extends Service {
protected get callMetadata(): Metadata {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/GoogleAds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
SearchGoogleAdsStreamResponse,
MutateGoogleAdsRequest,
MutateGoogleAdsResponse,
} from '../generated/google/ads/googleads/v14/services/google_ads_service';
} from '../generated/google/ads/googleads/v15/services/google_ads_service';

export class GoogleAds extends Service {
private customerOptions: CustomerOptions;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const HOST = 'googleads.googleapis.com' as const;

export const VERSION = 'v14' as const;
export const VERSION = 'v15' as const;

export const FAILURE_KEY = `google.ads.googleads.${VERSION}.errors.googleadsfailure-bin`;
2 changes: 1 addition & 1 deletion src/lib/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { credentials, OAuth2Client, ServiceError } from '@grpc/grpc-js';
import { GoogleAdsFailure } from '../generated/google/ads/googleads/v14/errors/errors';
import { GoogleAdsFailure } from '../generated/google/ads/googleads/v15/errors/errors';
import { FAILURE_KEY } from './constants';

export const getCredentials = (authClient: OAuth2Client) => {
Expand Down
8 changes: 4 additions & 4 deletions src/tests/google-ads.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { status, Metadata, ServiceError } from '@grpc/grpc-js';
import { AuthenticationErrorEnum_AuthenticationError } from '../generated/google/ads/googleads/v14/errors/authentication_error';
import { AuthenticationErrorEnum_AuthenticationError } from '../generated/google/ads/googleads/v15/errors/authentication_error';
import {
ErrorCode,
GoogleAdsFailure,
} from '../generated/google/ads/googleads/v14/errors/errors';
import { RequestErrorEnum_RequestError } from '../generated/google/ads/googleads/v14/errors/request_error';
import { GoogleAdsRow } from '../generated/google/ads/googleads/v14/services/google_ads_service';
} from '../generated/google/ads/googleads/v15/errors/errors';
import { RequestErrorEnum_RequestError } from '../generated/google/ads/googleads/v15/errors/request_error';
import { GoogleAdsRow } from '../generated/google/ads/googleads/v15/services/google_ads_service';
import { Status } from '../generated/google/rpc/status';
import { FAILURE_KEY, QueryBuilder, VERSION } from '../lib';
import { GoogleAds } from '../lib/GoogleAds';
Expand Down
8 changes: 4 additions & 4 deletions src/tests/protos.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CustomerServiceClient } from '../generated/google/ads/googleads/v14/services/customer_service';
import { GoogleAdsServiceClient } from '../generated/google/ads/googleads/v14/services/google_ads_service';
import { Campaign } from '../generated/google/ads/googleads/v14/resources/campaign';
import { AdvertisingChannelTypeEnum_AdvertisingChannelType } from '../generated/google/ads/googleads/v14/enums/advertising_channel_type';
import { CustomerServiceClient } from '../generated/google/ads/googleads/v15/services/customer_service';
import { GoogleAdsServiceClient } from '../generated/google/ads/googleads/v15/services/google_ads_service';
import { Campaign } from '../generated/google/ads/googleads/v15/resources/campaign';
import { AdvertisingChannelTypeEnum_AdvertisingChannelType } from '../generated/google/ads/googleads/v15/enums/advertising_channel_type';
import { MOCK_ADDRESS, MOCK_CREDENTIALS } from './test-utils';

describe('CustomerServiceClient', () => {
Expand Down
8 changes: 4 additions & 4 deletions src/tests/test-utils.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { credentials, Metadata, ServiceError } from '@grpc/grpc-js';
import { google } from 'googleapis';
import { AdGroupStatusEnum_AdGroupStatus } from '../generated/google/ads/googleads/v14/enums/ad_group_status';
import { AdGroupTypeEnum_AdGroupType } from '../generated/google/ads/googleads/v14/enums/ad_group_type';
import { ListAccessibleCustomersResponse } from '../generated/google/ads/googleads/v14/services/customer_service';
import { AdGroupStatusEnum_AdGroupStatus } from '../generated/google/ads/googleads/v15/enums/ad_group_status';
import { AdGroupTypeEnum_AdGroupType } from '../generated/google/ads/googleads/v15/enums/ad_group_type';
import { ListAccessibleCustomersResponse } from '../generated/google/ads/googleads/v15/services/customer_service';
import {
GoogleAdsRow,
MutateGoogleAdsRequest,
Expand All @@ -13,7 +13,7 @@ import {
SearchGoogleAdsResponse,
SearchGoogleAdsStreamRequest,
SearchGoogleAdsStreamResponse,
} from '../generated/google/ads/googleads/v14/services/google_ads_service';
} from '../generated/google/ads/googleads/v15/services/google_ads_service';
import { AllServices, Customer, GoogleAds, Service, ServiceName } from '../lib';

export const MOCK_ADDRESS = 'googleads.googleapis.com';
Expand Down