@azure-rest/agrifood-farming 1.0.0-beta.3 → 1.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.
Files changed (37) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/LICENSE +21 -0
  3. package/dist/browser/farmBeats.js +13 -11
  4. package/dist/browser/farmBeats.js.map +1 -1
  5. package/dist/browser/isUnexpected.js +4 -5
  6. package/dist/browser/isUnexpected.js.map +1 -1
  7. package/dist/browser/paginateHelper.js +43 -73
  8. package/dist/browser/paginateHelper.js.map +1 -1
  9. package/dist/browser/pollingHelper.js +11 -8
  10. package/dist/browser/pollingHelper.js.map +1 -1
  11. package/dist/commonjs/farmBeats.js +13 -11
  12. package/dist/commonjs/farmBeats.js.map +1 -1
  13. package/dist/commonjs/isUnexpected.js +4 -5
  14. package/dist/commonjs/isUnexpected.js.map +1 -1
  15. package/dist/commonjs/paginateHelper.js +43 -73
  16. package/dist/commonjs/paginateHelper.js.map +1 -1
  17. package/dist/commonjs/pollingHelper.js +11 -8
  18. package/dist/commonjs/pollingHelper.js.map +1 -1
  19. package/dist/commonjs/tsdoc-metadata.json +11 -11
  20. package/dist/esm/farmBeats.js +13 -11
  21. package/dist/esm/farmBeats.js.map +1 -1
  22. package/dist/esm/isUnexpected.js +4 -5
  23. package/dist/esm/isUnexpected.js.map +1 -1
  24. package/dist/esm/paginateHelper.js +43 -73
  25. package/dist/esm/paginateHelper.js.map +1 -1
  26. package/dist/esm/pollingHelper.js +11 -8
  27. package/dist/esm/pollingHelper.js.map +1 -1
  28. package/dist/react-native/farmBeats.js +13 -11
  29. package/dist/react-native/farmBeats.js.map +1 -1
  30. package/dist/react-native/isUnexpected.js +4 -5
  31. package/dist/react-native/isUnexpected.js.map +1 -1
  32. package/dist/react-native/paginateHelper.js +43 -73
  33. package/dist/react-native/paginateHelper.js.map +1 -1
  34. package/dist/react-native/pollingHelper.js +11 -8
  35. package/dist/react-native/pollingHelper.js.map +1 -1
  36. package/package.json +40 -48
  37. package/review/agrifood-farming-node.api.md +11020 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,47 @@
1
+ # Release History
2
+
3
+ ## 1.0.0-beta.4 (Unreleased)
4
+
5
+ ### Features Added
6
+
7
+ ### Breaking Changes
8
+
9
+ ### Bugs Fixed
10
+
11
+ ### Other Changes
12
+
13
+ ## 1.0.0-beta.3 (2025-02-10)
14
+
15
+ ### Features Added
16
+ - Refresh @azure-rest/agrifood-farming SDK
17
+
18
+ ## 1.0.0-beta.2 (2023-02-24)
19
+
20
+ ### Features Added
21
+
22
+ - Adding clients for Sensor Integration which includes crud operations on DeviceDataModels, Devices, SensorDataModels, Sensors, SensorMappings, SensorPartnerIntegration and get Sensor events.
23
+ - Adding new APIs for STAC search and get feature
24
+ - Adding breedingMethods and Measurements as part of Crop Entity
25
+ - Adding geographicIdentifier as part of Season Entity
26
+ - Adding trait, relativeMeasurements and treatments as part of CropVariety Entity
27
+ - Adding type, crs, centroid and bbox(bounding box of the geometry) as part of Boundary Entity
28
+ - Adding Source field in Party, Farm, Field, Seasonal Field, Boundary, Crop, Crop variety, Season and Attachment
29
+ - CreatedBy and ModifiedBy in all entities
30
+ - Measure renamed to measurements in Prescription & Crop
31
+ - Acreage renamed to area in Boundary
32
+ - Get Feature and Search Feature APIs for Sentinel 2 L2A and Sentinel 2 L1C STAC collections
33
+ - Adding Weather Data APIs to fetch IBM weather data
34
+ - Re-generate with latest generator version. This contains splitting models into input and output models and typing improvements [#20059](https://github.com/Azure/azure-sdk-for-js/pull/20059)
35
+ - Export pagination helper function. [#15831](https://github.com/Azure/azure-sdk-for-js/pull/15831)
36
+
37
+ ### Breaking Changes
38
+
39
+ - Removing primaryBoundaryId & boundaryIds from Field and Seasonal Field
40
+ - Removing isPrimary flag from Boundary
41
+ - Removing avgYields from Seasonal Field
42
+ - Renaming Farmer to Party
43
+ - Renaming CropVariety to CropProduct
44
+
45
+ ## 1.0.0-beta.1 (2021-05-26)
46
+
47
+ - First release of package, see README.md for details.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Microsoft
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -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,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AAE,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,CAAC,eAAe;QAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,aAAa,EAAE;QAChE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC;IACzB,OAAO,GAAG;QACR,GAAG,OAAO;QACV,gBAAgB,EAAE;YAChB,eAAe;SAChB;QACD,cAAc,EAAE;YACd,MAAM,EAAE,OAAO,CAAC,cAAc,EAAE,MAAM,IAAI,MAAM,CAAC,IAAI;SACtD;QACD,WAAW,EAAE;YACX,MAAM,EAAE,OAAO,CAAC,WAAW,EAAE,MAAM,IAAI,CAAC,sCAAsC,CAAC;SAChF;KACF,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"]}
@@ -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;