Skip to content

Commit f262b10

Browse files
authored
Merge branch 'main' into owl-bot-copy-packages-google-cloud-modelarmor
2 parents 5eb38f7 + a21356f commit f262b10

232 files changed

Lines changed: 482 additions & 112 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515
/handwritten/bigquery-storage @googleapis/bigquery-team
1616
/handwritten/pubsub @googleapis/pubsub-team
1717
/handwritten/bigtable @googleapis/bigtable-team
18+
/core/packages/google-auth-library-nodejs @googleapis/aion-team

core/generator/gapic-generator-typescript/package-lock.json

Lines changed: 30 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/generator/gapic-generator-typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"long": "^5.3.2",
5757
"object-hash": "^3.0.0",
5858
"proto3-json-serializer": "^3.0.3",
59-
"protobufjs": "^7.5.4",
59+
"protobufjs": "^7.5.5",
6060
"protobufjs-cli": "^1.2.0",
6161
"yargs": "^17.7.2"
6262
},

core/generator/gapic-generator-typescript/pnpm-lock.yaml

Lines changed: 31 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/generator/gapic-generator-typescript/yarn.lock

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3196,7 +3196,7 @@ protobufjs-cli@^1.2.0:
31963196
tmp "^0.2.1"
31973197
uglify-js "^3.7.7"
31983198

3199-
protobufjs@7.5.4, protobufjs@^7.2.5, protobufjs@^7.4.0, protobufjs@^7.5.3, protobufjs@^7.5.4:
3199+
protobufjs@7.5.4:
32003200
version "7.5.4"
32013201
resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.4.tgz"
32023202
integrity sha512-CvexbZtbov6jW2eXAvLukXjXUW1TzFaivC46BpWc/3BpcCysb5Vffu+B3XHMm8lVEuy2Mm4XGex8hBSg1yapPg==
@@ -3214,6 +3214,24 @@ protobufjs@7.5.4, protobufjs@^7.2.5, protobufjs@^7.4.0, protobufjs@^7.5.3, proto
32143214
"@types/node" ">=13.7.0"
32153215
long "^5.0.0"
32163216

3217+
protobufjs@^7.2.5, protobufjs@^7.4.0, protobufjs@^7.5.3, protobufjs@^7.5.5:
3218+
version "7.5.5"
3219+
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.5.5.tgz#b7089ca4410374c75150baf277353ef76db69f96"
3220+
integrity sha512-3wY1AxV+VBNW8Yypfd1yQY9pXnqTAN+KwQxL8iYm3/BjKYMNg4i0owhEe26PWDOMaIrzeeF98Lqd5NGz4omiIg==
3221+
dependencies:
3222+
"@protobufjs/aspromise" "^1.1.2"
3223+
"@protobufjs/base64" "^1.1.2"
3224+
"@protobufjs/codegen" "^2.0.4"
3225+
"@protobufjs/eventemitter" "^1.1.0"
3226+
"@protobufjs/fetch" "^1.1.0"
3227+
"@protobufjs/float" "^1.0.2"
3228+
"@protobufjs/inquire" "^1.1.0"
3229+
"@protobufjs/path" "^1.1.2"
3230+
"@protobufjs/pool" "^1.1.0"
3231+
"@protobufjs/utf8" "^1.1.0"
3232+
"@types/node" ">=13.7.0"
3233+
long "^5.0.0"
3234+
32173235
punycode.js@^2.3.1:
32183236
version "2.3.1"
32193237
resolved "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz"

handwritten/bigquery-storage/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"@types/extend": "^3.0.4",
4949
"@types/mocha": "^10.0.10",
5050
"@types/node": "^22.13.14",
51-
"@types/sinon": "^17.0.4",
51+
"@types/sinon": "^21.0.0",
5252
"@types/uuid": "^10.0.0",
5353
"avsc": "^5.7.9",
5454
"c8": "^10.1.3",

handwritten/datastore/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"extend": "^3.0.2",
5353
"google-gax": "^5.0.2-rc.1",
5454
"is": "^3.3.0",
55-
"protobufjs": "7.4.0",
55+
"protobufjs": "^7.5.5",
5656
"split-array-stream": "^2.0.0",
5757
"stream-events": "^1.0.5"
5858
},

handwritten/datastore/src/entity.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,6 +1302,14 @@ export namespace entity {
13021302
path.join(__dirname, '..', 'protos', 'app_engine_key.proto'),
13031303
);
13041304
loadedRoot.resolveAll();
1305+
1306+
// Ensure all types are initialized and setup correctly.
1307+
// In newer versions of protobufjs, this ensures group support
1308+
// is preserved for legacy keys.
1309+
for (const typeName of ['Reference', 'Path', 'Element']) {
1310+
loadedRoot.lookupType(typeName).setup();
1311+
}
1312+
13051313
return loadedRoot.nested;
13061314
}
13071315

handwritten/datastore/test/entity.ts

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1800,6 +1800,10 @@ describe('entity', () => {
18001800
const key = urlSafeKey.legacyDecode(encodedKey);
18011801
assert.strictEqual(key.namespace, 'NS');
18021802
assert.deepStrictEqual(key.path, ['Task', 'sampletask1']);
1803+
assert.strictEqual(
1804+
urlSafeKey.legacyEncode(PROJECT_ID, key, LOCATION_PREFIX),
1805+
encodedKey,
1806+
);
18031807
});
18041808

18051809
it('should decode key with single path element string type', () => {
@@ -1808,6 +1812,10 @@ describe('entity', () => {
18081812
const key = urlSafeKey.legacyDecode(encodedKey);
18091813
assert.strictEqual(key.namespace, undefined);
18101814
assert.deepStrictEqual(key.path, ['Task', 'sampletask1']);
1815+
assert.strictEqual(
1816+
urlSafeKey.legacyEncode(PROJECT_ID, key),
1817+
encodedKey,
1818+
);
18111819
});
18121820

18131821
it('should decode key with single path element long int type', () => {
@@ -1816,6 +1824,10 @@ describe('entity', () => {
18161824
const key = urlSafeKey.legacyDecode(encodedKey);
18171825
assert.strictEqual(key.namespace, undefined);
18181826
assert.deepStrictEqual(key.path, ['Task', '5754248394440704']);
1827+
assert.strictEqual(
1828+
urlSafeKey.legacyEncode(PROJECT_ID, key, LOCATION_PREFIX),
1829+
encodedKey,
1830+
);
18191831
});
18201832

18211833
it('should decode key with parent path', () => {
@@ -1831,6 +1843,69 @@ describe('entity', () => {
18311843
]);
18321844
assert.strictEqual(key.parent!.name, 'sampletask1');
18331845
assert.deepStrictEqual(key.parent!.path, ['Task', 'sampletask1']);
1846+
assert.strictEqual(
1847+
urlSafeKey.legacyEncode(PROJECT_ID, key, LOCATION_PREFIX),
1848+
encodedKey,
1849+
);
1850+
});
1851+
1852+
describe('should ensure that decode inverses encode and decoding is correct', () => {
1853+
const TEST_PROJECT = 'test-project';
1854+
const testCases = [
1855+
{name: 'numeric ID', path: ['Kind', '123']},
1856+
{name: 'string name with spaces', path: ['Kind', 'name with spaces']},
1857+
{name: 'special characters', path: ['Kind', 'special!@#$%^&*()']},
1858+
{
1859+
name: '3-level parent',
1860+
path: ['Grandparent', '1', 'Parent', 'p1', 'Child', '2'],
1861+
},
1862+
{
1863+
name: 'namespace and numeric ID',
1864+
path: ['Kind', '456'],
1865+
namespace: 'MyNS',
1866+
},
1867+
{
1868+
name: 'namespace and parent',
1869+
path: ['Parent', '1', 'Child', 'c1'],
1870+
namespace: 'MyNS',
1871+
},
1872+
{
1873+
name: 'long integer ID as string',
1874+
path: ['Kind', '9223372036854775807'],
1875+
},
1876+
{name: 'kind with hyphens', path: ['My-Kind', '1']},
1877+
{
1878+
name: 'different kinds in path',
1879+
path: ['User', 'user1', 'Post', '100', 'Comment', 'c1'],
1880+
},
1881+
{
1882+
name: 'same kinds in path',
1883+
path: ['Node', '1', 'Node', '2', 'Node', '3'],
1884+
},
1885+
];
1886+
1887+
testCases.forEach(tc => {
1888+
it(`should decode and re-encode ${tc.name} correctly`, () => {
1889+
const key = new testEntity.Key({
1890+
path: tc.path,
1891+
namespace: tc.namespace,
1892+
});
1893+
const encoded = urlSafeKey.legacyEncode(
1894+
TEST_PROJECT,
1895+
key,
1896+
LOCATION_PREFIX,
1897+
);
1898+
const decoded = urlSafeKey.legacyDecode(encoded);
1899+
assert.strictEqual(decoded.namespace, tc.namespace);
1900+
assert.deepStrictEqual(decoded.path, tc.path);
1901+
const reEncoded = urlSafeKey.legacyEncode(
1902+
TEST_PROJECT,
1903+
decoded,
1904+
LOCATION_PREFIX,
1905+
);
1906+
assert.strictEqual(reEncoded, encoded);
1907+
});
1908+
});
18341909
});
18351910
});
18361911
});

packages/google-ads-admanager/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"author": "Google LLC",
1212
"main": "build/src/index.js",
1313
"files": [
14-
"build/src"
14+
"build/src",
15+
"build/protos"
1516
],
1617
"homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-ads-admanager",
1718
"keywords": [

0 commit comments

Comments
 (0)