Skip to content

Commit

Permalink
update to v17.1
Browse files Browse the repository at this point in the history
  • Loading branch information
avermeil committed Sep 6, 2024
1 parent c8e40bb commit 30841f4
Show file tree
Hide file tree
Showing 1,472 changed files with 382,581 additions and 209,137 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ARG GOOGLE_ADS_VERSION
# Install dependencies
RUN apt update --allow-releaseinfo-change
RUN apt-get update -y
RUN apt-get install git wget pkg-config zip g++ zlib1g-dev unzip python-is-python3 -y
RUN apt-get install git wget pkg-config zip g++ zlib1g-dev unzip python-is-python3 software-properties-common default-jre -y
RUN apt-get install \
python3 \
python3-distutils \
Expand Down Expand Up @@ -50,7 +50,7 @@ RUN tar -xvzf googleads-nodejs.tar.gz -C .

RUN cd googleads-nodejs && \
npm uninstall google-gax && \
npm install opteo/gax-nodejs && \
npm install google-gax && \
rm -rf test/ system-test/

# horrible hack but no easy way to resolve this
Expand All @@ -61,4 +61,5 @@ RUN sed -i 's/request.keywordPlan/request.keyword_plan/' googleads-nodejs/src/${
sed -i 's/request.campaignExperiment/request.campaign_experiment/' googleads-nodejs/src/${GOOGLE_ADS_VERSION}/*.ts && \
sed -i 's/request.campaignDraft/request.campaign_draft/' googleads-nodejs/src/${GOOGLE_ADS_VERSION}/*.ts && \
sed -i 's/request.resourceName/request.resource_name/' googleads-nodejs/src/${GOOGLE_ADS_VERSION}/*.ts && \
sed -i 's/request.customerId/request.customer_id/' googleads-nodejs/src/${GOOGLE_ADS_VERSION}/*.ts
sed -i 's/request.customerId/request.customer_id/' googleads-nodejs/src/${GOOGLE_ADS_VERSION}/*.ts && \
sed -i 's/request.adGroupAd/request.ad_group_ad/' googleads-nodejs/src/${GOOGLE_ADS_VERSION}/*.ts
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Google Ads API version
# This only needs changing for major versions e.g. v8 -> v9
GOOGLE_ADS_VERSION=v16
GOOGLE_ADS_VERSION=v17

BUNDLE=googleads-nodejs.tar.gz
PACKAGE_BUILD=/package/googleads-nodejs
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<p align="center">
<a href="https://developers.google.com/google-ads/api/docs/release-notes">
<img src="https://img.shields.io/badge/google%20ads-v16-009688.svg?style=flat-square">
<img src="https://img.shields.io/badge/google%20ads-v17-009688.svg?style=flat-square">
</a>
<a href="https://www.npmjs.com/package/google-ads-node">
<img src="https://img.shields.io/npm/v/google-ads-node.svg?style=flat-square">
Expand Down Expand Up @@ -40,10 +40,10 @@ npm install google-ads-node

## Upgrading API Versions

1. Fetch the latest changes in [Opteo/gax-nodejs](https://github.com/Opteo/gax-nodejs).
1. Update the official google-gax dependency to the latest version in `package.json`.
1. Update to the latest `gapic-tools` version in `/package/googleads-nodejs/package.json`.
1. Update to the latest `google-gax` version in `/package/googleads-nodejs/package.json` & `/package.json`.
1. Update `GOOGLE_ADS_VERSION` in the Makefile to the latest version (if required).
1. Run `make protos` to pull in the new protos and compile them.
1. Run `make protos` to pull in the new protos and compile them. This command will take around 10 minutes. There are often errors here that need to be fixed due to changes in bazel, the docker image, or the protos themselves. Fix these errors as they come up.
1. If upgrading to a new major version delete the old version folders from `package/googleads-nodejs/protos/google/ads/googleads/{OLD_VERSION}`, `package/googleads-nodejs/src/{OLD_VERSION}` and `package/googleads-nodejs/samples/generated/{OLD_VERSION}`.
1. Run `yarn` to prepare the package and install the latest dependencies.
1. Run `yarn test` to make sure everything worked (you may need to update the version numbers here).
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
"prepare": "sh ./init.sh"
},
"dependencies": {
"google-gax": "^4.3.1",
"google-gax": "^4.4.1",
"lru-cache": "^10.2.0"
},
"devDependencies": {
"prettier": "^2.2.1",
"typescript": "^4.1.3"
"typescript": "^5.5.4"
},
"keywords": [
"google ads api",
Expand Down
21 changes: 12 additions & 9 deletions package/googleads-nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
"keyword plan service",
"keyword theme constant service",
"label service",
"local services lead service",
"offline user data job service",
"payments account service",
"product link invitation service",
Expand All @@ -124,19 +125,21 @@
"recommendation service",
"recommendation subscription service",
"remarketing action service",
"shareable preview service",
"shared criterion service",
"shared set service",
"smart campaign setting service",
"smart campaign suggest service",
"third party app analytics link service",
"travel asset suggestion service",
"user data service",
"user list customer type service",
"user list service"
],
"scripts": {
"clean": "gts clean",
"compile": "tsc -p . && cp -r protos build/ && minifyProtoJson",
"compile-protos": "compileProtos src ",
"compile-protos": "compileProtos --keep-case --force-number src",
"docs": "jsdoc -c .jsdoc.js",
"fix": "gts fix",
"lint": "gts check",
Expand All @@ -146,19 +149,19 @@
},
"devDependencies": {
"@types/mocha": "^10.0.6",
"@types/node": "^20.11.20",
"@types/node": "^20.12.12",
"@types/sinon": "^10.0.20",
"c8": "^8.0.1",
"google-gax": "^4.3.1",
"gts": "5.2.0",
"jsdoc": "^4.0.2",
"c8": "^9.1.0",
"gapic-tools": "^0.4.2",
"google-gax": "^4.4.1",
"gts": "5.3.0",
"jsdoc": "^4.0.3",
"jsdoc-fresh": "^3.0.0",
"jsdoc-region-tag": "^3.0.0",
"mocha": "^10.3.0",
"mocha": "^10.4.0",
"pack-n-play": "^2.0.3",
"sinon": "^15.2.0",
"typescript": "5.1.6",
"gapic-tools": "https://gitpkg.now.sh/Opteo/gax-nodejs/tools?keep-case"
"typescript": "5.1.6"
},
"engines": {
"node": ">=v14"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.ads.googleads.v17.common;

import "google/ads/googleads/v17/common/asset_policy.proto";
import "google/ads/googleads/v17/enums/asset_performance_label.proto";
import "google/ads/googleads/v17/enums/served_asset_field_type.proto";

option csharp_namespace = "Google.Ads.GoogleAds.V17.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v17/common;common";
option java_multiple_files = true;
option java_outer_classname = "AdAssetProto";
option java_package = "com.google.ads.googleads.v17.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V17\\Common";
option ruby_package = "Google::Ads::GoogleAds::V17::Common";

// Proto file describing assets used inside an ad.

// A text asset used inside an ad.
message AdTextAsset {
// Asset text.
optional string text = 4;

// The pinned field of the asset. This restricts the asset to only serve
// within this field. Multiple assets can be pinned to the same field. An
// asset that is unpinned or pinned to a different field will not serve in a
// field where some other asset has been pinned.
google.ads.googleads.v17.enums.ServedAssetFieldTypeEnum.ServedAssetFieldType
pinned_field = 2;

// The performance label of this text asset.
google.ads.googleads.v17.enums.AssetPerformanceLabelEnum.AssetPerformanceLabel
asset_performance_label = 5;

// The policy summary of this text asset.
AdAssetPolicySummary policy_summary_info = 6;
}

// An image asset used inside an ad.
message AdImageAsset {
// The Asset resource name of this image.
optional string asset = 2;
}

// A video asset used inside an ad.
message AdVideoAsset {
// The Asset resource name of this video.
optional string asset = 2;

// Contains info fields for this AdVideoAsset.
optional AdVideoAssetInfo ad_video_asset_info = 4;
}

// Contains info fields for AdVideoAssets.
message AdVideoAssetInfo {
// List of inventory preferences for this AdVideoAsset. This field can only be
// set for DiscoveryVideoResponsiveAd. The video assets with an inventory
// asset preference set will be preferred over other videos from the same ad
// during serving time. For example, consider this ad being served for a
// specific inventory. The server will first try to match an eligible video
// with a matching preference for that inventory. Videos with no preferences
// are chosen only when a video with matching preference and eligible for a
// given ad slot can be found.
optional AdVideoAssetInventoryPreferences
ad_video_asset_inventory_preferences = 1;
}

// YouTube Video Asset inventory preferences.
message AdVideoAssetInventoryPreferences {
// When true, YouTube Video Asset with this inventory preference will be
// preferred when choosing a video to serve In Feed.
optional bool in_feed_preference = 1;

// When true, YouTube Video Asset with this inventory preference will be
// preferred when choosing a video to serve In Stream.
optional bool in_stream_preference = 2;

// When true, YouTube Video Asset with this inventory preference will be
// preferred when choosing a video to serve on YouTube Shorts.
optional bool shorts_preference = 3;
}

// A media bundle asset used inside an ad.
message AdMediaBundleAsset {
// The Asset resource name of this media bundle.
optional string asset = 2;
}

// A Demand Gen carousel card asset used inside an ad.
message AdDemandGenCarouselCardAsset {
// The Asset resource name of this discovery carousel card.
optional string asset = 1;
}

// A call to action asset used inside an ad.
message AdCallToActionAsset {
// The Asset resource name of this call to action asset.
optional string asset = 1;
}
Loading

0 comments on commit 30841f4

Please sign in to comment.