@azure-rest/agrifood-farming 1.0.0-alpha.20250718.1 → 1.0.0-alpha.20250730.1

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.
Files changed (35) hide show
  1. package/dist/browser/farmBeats.js +13 -11
  2. package/dist/browser/farmBeats.js.map +1 -1
  3. package/dist/browser/isUnexpected.js +4 -5
  4. package/dist/browser/isUnexpected.js.map +1 -1
  5. package/dist/browser/paginateHelper.js +43 -73
  6. package/dist/browser/paginateHelper.js.map +1 -1
  7. package/dist/browser/pollingHelper.js +11 -8
  8. package/dist/browser/pollingHelper.js.map +1 -1
  9. package/dist/commonjs/farmBeats.js +13 -11
  10. package/dist/commonjs/farmBeats.js.map +1 -1
  11. package/dist/commonjs/isUnexpected.js +4 -5
  12. package/dist/commonjs/isUnexpected.js.map +1 -1
  13. package/dist/commonjs/paginateHelper.js +43 -73
  14. package/dist/commonjs/paginateHelper.js.map +1 -1
  15. package/dist/commonjs/pollingHelper.js +11 -8
  16. package/dist/commonjs/pollingHelper.js.map +1 -1
  17. package/dist/commonjs/tsdoc-metadata.json +11 -11
  18. package/dist/esm/farmBeats.js +13 -11
  19. package/dist/esm/farmBeats.js.map +1 -1
  20. package/dist/esm/isUnexpected.js +4 -5
  21. package/dist/esm/isUnexpected.js.map +1 -1
  22. package/dist/esm/paginateHelper.js +43 -73
  23. package/dist/esm/paginateHelper.js.map +1 -1
  24. package/dist/esm/pollingHelper.js +11 -8
  25. package/dist/esm/pollingHelper.js.map +1 -1
  26. package/dist/react-native/farmBeats.js +13 -11
  27. package/dist/react-native/farmBeats.js.map +1 -1
  28. package/dist/react-native/isUnexpected.js +4 -5
  29. package/dist/react-native/isUnexpected.js.map +1 -1
  30. package/dist/react-native/paginateHelper.js +43 -73
  31. package/dist/react-native/paginateHelper.js.map +1 -1
  32. package/dist/react-native/pollingHelper.js +11 -8
  33. package/dist/react-native/pollingHelper.js.map +1 -1
  34. package/package.json +2 -2
  35. package/review/agrifood-farming-node.api.md +11020 -11020
@@ -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
  /**
@@ -9,21 +8,24 @@ import { logger } from "./logger.js";
9
8
  * @param credentials - uniquely identify client credential
10
9
  * @param options - the parameter for all optional parameters
11
10
  */
12
- export default function createClient($host, credentials, _a = {}) {
13
- var _b, _c, _d, _e, _f, _g;
14
- var { apiVersion = "2022-11-01-preview" } = _a, options = __rest(_a, ["apiVersion"]);
15
- const endpointUrl = (_c = (_b = options.endpoint) !== null && _b !== void 0 ? _b : options.baseUrl) !== null && _c !== void 0 ? _c : `${$host}`;
11
+ export default function createClient($host, credentials, { apiVersion = "2022-11-01-preview", ...options } = {}) {
12
+ const endpointUrl = options.endpoint ?? options.baseUrl ?? `${$host}`;
16
13
  const userAgentInfo = `azsdk-js-agrifood-farming-rest/1.0.0-beta.3`;
17
14
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
18
15
  ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
19
16
  : `${userAgentInfo}`;
20
- options = Object.assign(Object.assign({}, options), { userAgentOptions: {
17
+ options = {
18
+ ...options,
19
+ userAgentOptions: {
21
20
  userAgentPrefix,
22
- }, loggingOptions: {
23
- logger: (_e = (_d = options.loggingOptions) === null || _d === void 0 ? void 0 : _d.logger) !== null && _e !== void 0 ? _e : logger.info,
24
- }, credentials: {
25
- scopes: (_g = (_f = options.credentials) === null || _f === void 0 ? void 0 : _f.scopes) !== null && _g !== void 0 ? _g : ["https://farmbeats.azure.net/.default"],
26
- } });
21
+ },
22
+ loggingOptions: {
23
+ logger: options.loggingOptions?.logger ?? logger.info,
24
+ },
25
+ credentials: {
26
+ scopes: options.credentials?.scopes ?? ["https://farmbeats.azure.net/.default"],
27
+ },
28
+ };
27
29
  const client = getClient(endpointUrl, credentials, options);
28
30
  client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
29
31
  client.pipeline.addPolicy({
@@ -1 +1 @@
1
- {"version":3,"file":"farmBeats.js","sourceRoot":"","sources":["../../src/farmBeats.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,KAAa,EACb,WAA4B,EAC5B,KAA4E,EAAE;;QAA9E,EAAE,UAAU,GAAG,oBAAoB,OAA2C,EAAtC,OAAO,cAA/C,cAAiD,CAAF;IAE/C,MAAM,WAAW,GAAG,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC,OAAO,mCAAI,GAAG,KAAK,EAAE,CAAC;IACtE,MAAM,aAAa,GAAG,6CAA6C,CAAC;IACpE,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,MAAM,EAAE,MAAA,MAAA,OAAO,CAAC,WAAW,0CAAE,MAAM,mCAAI,CAAC,sCAAsC,CAAC;SAChF,GACF,CAAC;IACF,MAAM,MAAM,GAAG,SAAS,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,CAAoB,CAAC;IAE/E,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 type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { FarmBeatsClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface FarmBeatsClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `FarmBeatsClient`\n * @param $host - server parameter\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n $host: string,\n credentials: TokenCredential,\n { apiVersion = \"2022-11-01-preview\", ...options }: FarmBeatsClientOptions = {},\n): FarmBeatsClient {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? `${$host}`;\n const userAgentInfo = `azsdk-js-agrifood-farming-rest/1.0.0-beta.3`;\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 scopes: options.credentials?.scopes ?? [\"https://farmbeats.azure.net/.default\"],\n },\n };\n const client = getClient(endpointUrl, credentials, options) as FarmBeatsClient;\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":"farmBeats.js","sourceRoot":"","sources":["../../src/farmBeats.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,KAAa,EACb,WAA4B,EAC5B,EAAE,UAAU,GAAG,oBAAoB,EAAE,GAAG,OAAO,KAA6B,EAAE;IAE9E,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,OAAO,IAAI,GAAG,KAAK,EAAE,CAAC;IACtE,MAAM,aAAa,GAAG,6CAA6C,CAAC;IACpE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,C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cesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { FarmBeatsClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface FarmBeatsClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `FarmBeatsClient`\n * @param $host - server parameter\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n $host: string,\n credentials: TokenCredential,\n { apiVersion = \"2022-11-01-preview\", ...options }: FarmBeatsClientOptions = {},\n): FarmBeatsClient {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? `${$host}`;\n const userAgentInfo = `azsdk-js-agrifood-farming-rest/1.0.0-beta.3`;\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 scopes: options.credentials?.scopes ?? [\"https://farmbeats.azure.net/.default\"],\n },\n };\n const client = getClient(endpointUrl, credentials, options) as FarmBeatsClient;\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"]}
@@ -204,7 +204,7 @@ const responseMap = {
204
204
  };
205
205
  export function isUnexpected(response) {
206
206
  const lroOriginal = response.headers["x-ms-original-url"];
207
- const url = new URL(lroOriginal !== null && lroOriginal !== void 0 ? lroOriginal : response.request.url);
207
+ const url = new URL(lroOriginal ?? response.request.url);
208
208
  const method = response.request.method;
209
209
  let pathDetails = responseMap[`${method} ${url.pathname}`];
210
210
  if (!pathDetails) {
@@ -213,7 +213,6 @@ export function isUnexpected(response) {
213
213
  return !pathDetails.includes(response.status);
214
214
  }
215
215
  function getParametrizedPathSuccess(method, path) {
216
- var _a, _b, _c, _d;
217
216
  const pathParts = path.split("/");
218
217
  // Traverse list to match the longest candidate
219
218
  // matchedLen: the length of candidate path
@@ -232,13 +231,13 @@ function getParametrizedPathSuccess(method, path) {
232
231
  // track if we have found a match to return the values found.
233
232
  let found = true;
234
233
  for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
235
- if (((_a = candidateParts[i]) === null || _a === void 0 ? void 0 : _a.startsWith("{")) && ((_b = candidateParts[i]) === null || _b === void 0 ? void 0 : _b.indexOf("}")) !== -1) {
236
- const start = candidateParts[i].indexOf("}") + 1, end = (_c = candidateParts[i]) === null || _c === void 0 ? void 0 : _c.length;
234
+ if (candidateParts[i]?.startsWith("{") && candidateParts[i]?.indexOf("}") !== -1) {
235
+ const start = candidateParts[i].indexOf("}") + 1, end = candidateParts[i]?.length;
237
236
  // If the current part of the candidate is a "template" part
238
237
  // Try to use the suffix of pattern to match the path
239
238
  // {guid} ==> $
240
239
  // {guid}:export ==> :export$
241
- const isMatched = new RegExp(`${(_d = candidateParts[i]) === null || _d === void 0 ? void 0 : _d.slice(start, end)}`).test(pathParts[j] || "");
240
+ const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(pathParts[j] || "");
242
241
  if (!isMatched) {
243
242
  found = false;
244
243
  break;