@azure-rest/maps-search 2.0.0-beta.3 → 2.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import { __rest } from "tslib";
4
3
  import { getClient } from "@azure-rest/core-client";
5
4
  import { logger } from "./logger.js";
6
5
  /**
@@ -8,21 +7,24 @@ import { logger } from "./logger.js";
8
7
  * @param credentials - uniquely identify client credential
9
8
  * @param options - the parameter for all optional parameters
10
9
  */
11
- export default function createClient(credentials, _a = {}) {
12
- var _b, _c, _d, _e, _f, _g;
13
- var { apiVersion = "2023-06-01" } = _a, options = __rest(_a, ["apiVersion"]);
14
- const endpointUrl = (_c = (_b = options.endpoint) !== null && _b !== void 0 ? _b : options.baseUrl) !== null && _c !== void 0 ? _c : `https://atlas.microsoft.com`;
10
+ export default function createClient(credentials, { apiVersion = "2023-06-01", ...options } = {}) {
11
+ const endpointUrl = options.endpoint ?? options.baseUrl ?? `https://atlas.microsoft.com`;
15
12
  const userAgentInfo = `azsdk-js-maps-search-rest/2.0.0-beta.2`;
16
13
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
17
14
  ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
18
15
  : `${userAgentInfo}`;
19
- options = Object.assign(Object.assign({}, options), { userAgentOptions: {
16
+ options = {
17
+ ...options,
18
+ userAgentOptions: {
20
19
  userAgentPrefix,
21
- }, loggingOptions: {
22
- logger: (_e = (_d = options.loggingOptions) === null || _d === void 0 ? void 0 : _d.logger) !== null && _e !== void 0 ? _e : logger.info,
23
- }, credentials: {
24
- apiKeyHeaderName: (_g = (_f = options.credentials) === null || _f === void 0 ? void 0 : _f.apiKeyHeaderName) !== null && _g !== void 0 ? _g : "subscription-key",
25
- } });
20
+ },
21
+ loggingOptions: {
22
+ logger: options.loggingOptions?.logger ?? logger.info,
23
+ },
24
+ credentials: {
25
+ apiKeyHeaderName: options.credentials?.apiKeyHeaderName ?? "subscription-key",
26
+ },
27
+ };
26
28
  const client = getClient(endpointUrl, credentials, options);
27
29
  client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
28
30
  client.pipeline.addPolicy({
@@ -1 +1 @@
1
- {"version":3,"file":"mapsSearchClient.js","sourceRoot":"","sources":["../../../src/generated/mapsSearchClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAAE,SAAS,EAAiB,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,WAA0B,EAC1B,KAAqE,EAAE;;QAAvE,EAAE,UAAU,GAAG,YAAY,OAA4C,EAAvC,OAAO,cAAvC,cAAyC,CAAF;IAEvC,MAAM,WAAW,GACf,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC,OAAO,mCAAI,6BAA6B,CAAC;IACvE,MAAM,aAAa,GAAG,wCAAwC,CAAC;IAC/D,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;QAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,aAAa,EAAE;QAChE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC;IACzB,OAAO,mCACF,OAAO,KACV,gBAAgB,EAAE;YAChB,eAAe;SAChB,EACD,cAAc,EAAE;YACd,MAAM,EAAE,MAAA,MAAA,OAAO,CAAC,cAAc,0CAAE,MAAM,mCAAI,MAAM,CAAC,IAAI;SACtD,EACD,WAAW,EAAE;YACX,gBAAgB,EACd,MAAA,MAAA,OAAO,CAAC,WAAW,0CAAE,gBAAgB,mCAAI,kBAAkB;SAC9D,GACF,CAAC;IACF,MAAM,MAAM,GAAG,SAAS,CACtB,WAAW,EACX,WAAW,EACX,OAAO,CACY,CAAC;IAEtB,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAC3D,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;QACxB,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACzB,qDAAqD;YACrD,yEAAyE;YACzE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,UAAU,EAAE,CAAC;gBACvD,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { getClient, ClientOptions } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport { KeyCredential } from \"@azure/core-auth\";\nimport { MapsSearchClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface MapsSearchClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `MapsSearchClient`\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n credentials: KeyCredential,\n { apiVersion = \"2023-06-01\", ...options }: MapsSearchClientOptions = {},\n): MapsSearchClient {\n const endpointUrl =\n options.endpoint ?? options.baseUrl ?? `https://atlas.microsoft.com`;\n const userAgentInfo = `azsdk-js-maps-search-rest/2.0.0-beta.2`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n apiKeyHeaderName:\n options.credentials?.apiKeyHeaderName ?? \"subscription-key\",\n },\n };\n const client = getClient(\n endpointUrl,\n credentials,\n options,\n ) as MapsSearchClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n client.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && apiVersion) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n\n return client;\n}\n"]}
1
+ {"version":3,"file":"mapsSearchClient.js","sourceRoot":"","sources":["../../../src/generated/mapsSearchClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,SAAS,EAAiB,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,WAA0B,EAC1B,EAAE,UAAU,GAAG,YAAY,EAAE,GAAG,OAAO,KAA8B,EAAE;IAEvE,MAAM,WAAW,GACf,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,OAAO,IAAI,6BAA6B,CAAC;IACvE,MAAM,aAAa,GAAG,wCAAwC,CAAC;IAC/D,MAAM,eAAe,GACnB,OAAO,CAAC,gBA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CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { getClient, ClientOptions } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport { KeyCredential } from \"@azure/core-auth\";\nimport { MapsSearchClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface MapsSearchClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `MapsSearchClient`\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n credentials: KeyCredential,\n { apiVersion = \"2023-06-01\", ...options }: MapsSearchClientOptions = {},\n): MapsSearchClient {\n const endpointUrl =\n options.endpoint ?? options.baseUrl ?? `https://atlas.microsoft.com`;\n const userAgentInfo = `azsdk-js-maps-search-rest/2.0.0-beta.2`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n apiKeyHeaderName:\n options.credentials?.apiKeyHeaderName ?? \"subscription-key\",\n },\n };\n const client = getClient(\n endpointUrl,\n credentials,\n options,\n ) as MapsSearchClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n client.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && apiVersion) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n\n return client;\n}\n"]}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@azure-rest/maps-search",
3
3
  "sdk-type": "client",
4
4
  "author": "Microsoft Corporation",
5
- "version": "2.0.0-beta.3",
5
+ "version": "2.0.0-beta.4",
6
6
  "description": "A generated SDK for MapsSearchClient.",
7
7
  "keywords": [
8
8
  "node",
@@ -23,37 +23,12 @@
23
23
  "files": [
24
24
  "dist/",
25
25
  "README.md",
26
- "LICENSE"
26
+ "LICENSE",
27
+ "review/",
28
+ "CHANGELOG.md"
27
29
  ],
28
30
  "engines": {
29
- "node": ">=18.0.0"
30
- },
31
- "scripts": {
32
- "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api",
33
- "build:browser": "dev-tool run build-package && dev-tool run bundle",
34
- "build:debug": "dev-tool run build-package && dev-tool run bundle && dev-tool run extract-api",
35
- "build:node": "dev-tool run build-package && dev-tool run bundle --browser-test false",
36
- "build:samples": "dev-tool samples publish --force",
37
- "build:test": "dev-tool run build-package && dev-tool run bundle",
38
- "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
39
- "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
40
- "execute:samples": "dev-tool samples run samples-dev",
41
- "extract-api": "dev-tool run vendored rimraf review && dev-tool run extract-api",
42
- "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
43
- "generate:client": "autorest --typescript swagger/README.md && npm run format",
44
- "integration-test": "npm run integration-test:node && npm run integration-test:browser",
45
- "integration-test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser",
46
- "integration-test:node": "dev-tool run test:vitest --esm",
47
- "lint": "eslint package.json api-extractor.json src test",
48
- "lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]",
49
- "pack": "npm pack 2>&1",
50
- "test": "npm run clean && npm run build:test && npm run unit-test",
51
- "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser",
52
- "test:node": "npm run clean && npm run build:test && npm run unit-test:node",
53
- "unit-test": "npm run unit-test:node && npm run unit-test:browser",
54
- "unit-test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser",
55
- "unit-test:node": "dev-tool run test:vitest",
56
- "update-snippets": "dev-tool run update-snippets"
31
+ "node": ">=20.0.0"
57
32
  },
58
33
  "sideEffects": false,
59
34
  "autoPublish": false,
@@ -67,22 +42,22 @@
67
42
  "tslib": "^2.8.1"
68
43
  },
69
44
  "devDependencies": {
70
- "@azure-tools/test-credential": "^2.0.0",
71
- "@azure-tools/test-recorder": "^4.1.0",
72
- "@azure-tools/test-utils-vitest": "^1.0.0",
73
- "@azure/core-util": "^1.11.0",
74
- "@azure/dev-tool": "^1.0.0",
75
- "@azure/eslint-plugin-azure-sdk": "^3.0.0",
76
- "@azure/identity": "^4.6.0",
77
- "@types/node": "^18.0.0",
78
- "@vitest/browser": "^3.0.5",
79
- "@vitest/coverage-istanbul": "^3.0.5",
45
+ "@azure/identity": "4.11.1",
46
+ "@types/node": "^20.19.0",
47
+ "@vitest/browser": "^3.2.3",
48
+ "@vitest/coverage-istanbul": "^3.2.3",
80
49
  "autorest": "latest",
81
50
  "dotenv": "^16.0.0",
82
- "eslint": "^9.9.0",
51
+ "eslint": "^9.33.0",
83
52
  "playwright": "^1.50.1",
84
- "typescript": "~5.7.2",
85
- "vitest": "^3.0.5"
53
+ "typescript": "~5.8.3",
54
+ "vitest": "^3.2.3",
55
+ "@azure-tools/test-credential": "^2.1.1",
56
+ "@azure-tools/test-utils-vitest": "^1.0.0",
57
+ "@azure-tools/test-recorder": "^4.1.0",
58
+ "@azure/eslint-plugin-azure-sdk": "^3.0.0",
59
+ "@azure/core-util": "^1.13.1",
60
+ "@azure/dev-tool": "^1.0.0"
86
61
  },
87
62
  "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/maps/maps-search-rest/README.md",
88
63
  "//metadata": {
@@ -108,7 +83,7 @@
108
83
  },
109
84
  "type": "module",
110
85
  "tshy": {
111
- "project": "./tsconfig.src.json",
86
+ "project": "../../../tsconfig.src.build.json",
112
87
  "exports": {
113
88
  "./package.json": "./package.json",
114
89
  ".": "./src/index.ts"
@@ -144,5 +119,23 @@
144
119
  }
145
120
  }
146
121
  },
147
- "react-native": "./dist/react-native/index.js"
148
- }
122
+ "react-native": "./dist/react-native/index.js",
123
+ "scripts": {
124
+ "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api",
125
+ "build:samples": "tsc -p tsconfig.samples.json",
126
+ "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
127
+ "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
128
+ "execute:samples": "dev-tool samples run samples-dev",
129
+ "extract-api": "dev-tool run vendored rimraf review && dev-tool run extract-api",
130
+ "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
131
+ "generate:client": "autorest --typescript swagger/README.md && npm run format",
132
+ "lint": "eslint package.json src test",
133
+ "lint:fix": "eslint package.json src test --fix --fix-type [problem,suggestion]",
134
+ "pack": "pnpm pack 2>&1",
135
+ "test": "npm run test:node && npm run test:browser",
136
+ "test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser",
137
+ "test:node": "dev-tool run test:vitest",
138
+ "test:node:esm": "dev-tool run test:vitest --esm",
139
+ "update-snippets": "dev-tool run update-snippets"
140
+ }
141
+ }