Skip to content
This repository was archived by the owner on Aug 26, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 3 additions & 33 deletions sdk/agrifood/agrifood-farming-rest/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,7 @@
# Release History

## 1.0.0-beta.3 (2024-12-16)

### Features Added
- Refresh @azure-rest/agrifood-farming SDK

## 1.0.0-beta.2 (2023-02-24)

## 1.0.0 (2025-02-20)

### Features Added

- Adding clients for Sensor Integration which includes crud operations on DeviceDataModels, Devices, SensorDataModels, Sensors, SensorMappings, SensorPartnerIntegration and get Sensor events.
- Adding new APIs for STAC search and get feature
- Adding breedingMethods and Measurements as part of Crop Entity
- Adding geographicIdentifier as part of Season Entity
- Adding trait, relativeMeasurements and treatments as part of CropVariety Entity
- Adding type, crs, centroid and bbox(bounding box of the geometry) as part of Boundary Entity
- Adding Source field in Party, Farm, Field, Seasonal Field, Boundary, Crop, Crop variety, Season and Attachment
- CreatedBy and ModifiedBy in all entities
- Measure renamed to measurements in Prescription & Crop
- Acreage renamed to area in Boundary
- Get Feature and Search Feature APIs for Sentinel 2 L2A and Sentinel 2 L1C STAC collections
- Adding Weather Data APIs to fetch IBM weather data
- 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)
- Export pagination helper function. [#15831](https://github.com/Azure/azure-sdk-for-js/pull/15831)

### Breaking Changes

- Removing primaryBoundaryId & boundaryIds from Field and Seasonal Field
- Removing isPrimary flag from Boundary
- Removing avgYields from Seasonal Field
- Renaming Farmer to Party
- Renaming CropVariety to CropProduct

## 1.0.0-beta.1 (2021-05-26)

- First release of package, see README.md for details.
The package of @azure-rest/agrifood-farming is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart).
2 changes: 1 addition & 1 deletion sdk/agrifood/agrifood-farming-rest/api-extractor.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
}
}
}
}
}
24 changes: 12 additions & 12 deletions sdk/agrifood/agrifood-farming-rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"sdk-type": "client",
"author": "Microsoft Corporation",
"description": "An isomorphic REST client library for the Azure FarmBeats Service.",
"version": "1.0.0-beta.3",
"version": "1.0.0",
"keywords": [
"node",
"azure",
Expand Down Expand Up @@ -79,28 +79,27 @@
"autoPublish": false,
"dependencies": {
"@azure-rest/core-client": "^1.0.0",
"@azure/core-auth": "^1.3.0",
"@azure/abort-controller": "^2.1.2",
"@azure/core-auth": "^1.9.0",
"@azure/core-lro": "^3.1.0",
"@azure/logger": "^1.0.0",
"tslib": "^2.2.0",
"@azure/abort-controller": "^2.1.2"
"@azure/logger": "^1.1.4",
"tslib": "^2.8.1"
},
"devDependencies": {
"@azure-tools/test-utils": "^1.0.1",
"@azure/core-rest-pipeline": "^1.9.2",
"@azure-tools/test-credential": "^2.0.0",
"@azure-tools/test-recorder": "^4.1.0",
"@azure-tools/test-utils-vitest": "^1.0.0",
"@azure/core-util": "^1.0.0",
"@azure/core-rest-pipeline": "^1.9.2",
"@azure/core-util": "^1.11.0",
"@azure/dev-tool": "^1.0.0",
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure/identity": "^4.0.1",
"@azure/identity": "^4.7.0",
"@types/node": "^18.0.0",
"@vitest/browser": "^3.0.3",
"@vitest/coverage-istanbul": "^3.0.3",
"dotenv": "^16.0.0",
"eslint": "^9.9.0",
"playwright": "^1.49.0",
"playwright": "^1.50.1",
"typescript": "~5.7.2",
"vitest": "^3.0.3"
},
Expand Down Expand Up @@ -141,5 +140,6 @@
"default": "./dist/commonjs/index.js"
}
}
}
}
},
"react-native": "./dist/react-native/index.js"
}
7 changes: 2 additions & 5 deletions sdk/agrifood/agrifood-farming-rest/samples-dev/createParty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,10 @@

import FarmBeats, { isUnexpected } from "@azure-rest/agrifood-farming";
import { DefaultAzureCredential } from "@azure/identity";
import dotenv from "dotenv";

dotenv.config();

import "dotenv/config";
const endpoint = process.env["FARMBEATS_ENDPOINT"] || "";

async function main() {
async function main(): Promise<void> {
const farmbeatsClient = FarmBeats(endpoint, new DefaultAzureCredential());
const partyId = "test_party";
const result = await farmbeatsClient.path("/parties/{partyId}", partyId).patch({
Expand Down
7 changes: 2 additions & 5 deletions sdk/agrifood/agrifood-farming-rest/samples-dev/deleteParty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,10 @@

import FarmBeats, { isUnexpected } from "@azure-rest/agrifood-farming";
import { DefaultAzureCredential } from "@azure/identity";
import dotenv from "dotenv";

dotenv.config();

import "dotenv/config";
const endpoint = process.env["FARMBEATS_ENDPOINT"] || "";

async function main() {
async function main(): Promise<void> {
const farmbeatsClient = FarmBeats(endpoint, new DefaultAzureCredential());
const partyId = "test_party";
const result = await farmbeatsClient.path("/parties/{partyId}", partyId).delete();
Expand Down
7 changes: 2 additions & 5 deletions sdk/agrifood/agrifood-farming-rest/samples-dev/listParties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,10 @@

import FarmBeats, { isUnexpected, paginate } from "@azure-rest/agrifood-farming";
import { DefaultAzureCredential } from "@azure/identity";
import dotenv from "dotenv";

dotenv.config();

import "dotenv/config";
const endpoint = process.env["FARMBEATS_ENDPOINT"] || "";

async function main() {
async function main(): Promise<void> {
const farmbeatsClient = FarmBeats(endpoint, new DefaultAzureCredential());
const response = await farmbeatsClient.path("/parties").get();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@
* @summary creates a party
*/

import FarmBeats, { PartyOutput, isUnexpected } from "@azure-rest/agrifood-farming";
import FarmBeats, { isUnexpected } from "@azure-rest/agrifood-farming";
import { DefaultAzureCredential } from "@azure/identity";
import dotenv from "dotenv";

dotenv.config();

import "dotenv/config";
const endpoint = process.env["FARMBEATS_ENDPOINT"] || "";

async function main() {
async function main(): Promise<void> {
const farmbeatsClient = FarmBeats(endpoint, new DefaultAzureCredential());
const partyId = "test_party";
const result = await farmbeatsClient.path("/parties/{partyId}", partyId).patch({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@

import FarmBeats, { isUnexpected } from "@azure-rest/agrifood-farming";
import { DefaultAzureCredential } from "@azure/identity";
import dotenv from "dotenv";

dotenv.config();

import "dotenv/config";
const endpoint = process.env["FARMBEATS_ENDPOINT"] || "";

async function main() {
async function main(): Promise<void> {
const farming = FarmBeats(endpoint, new DefaultAzureCredential());
const partyId = "test_party";
const result = await farming.path("/parties/{partyId}", partyId).delete();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@
* @summary gets a list of parties
*/

import FarmBeats, { isUnexpected, PartyOutput, paginate } from "@azure-rest/agrifood-farming";
import FarmBeats, { isUnexpected, paginate } from "@azure-rest/agrifood-farming";
import { DefaultAzureCredential } from "@azure/identity";
import dotenv from "dotenv";

dotenv.config();

import "dotenv/config";
const endpoint = process.env["FARMBEATS_ENDPOINT"] || "";

async function main() {
async function main(): Promise<void> {
const farming = FarmBeats(endpoint, new DefaultAzureCredential());
const response = await farming.path("/parties").get();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@

import FarmBeats from "@azure-rest/agrifood-farming";
import { DefaultAzureCredential } from "@azure/identity";
import dotenv from "dotenv";

dotenv.config();

import "dotenv/config";
const endpoint = process.env["FARMBEATS_ENDPOINT"] || "";

async function main() {
async function main(): Promise<void> {
const farmbeatsClient = FarmBeats(endpoint, new DefaultAzureCredential());
const partyId = "test_party";
const result = await farmbeatsClient.path("/parties/{partyId}", partyId).patch({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@

import FarmBeats from "@azure-rest/agrifood-farming";
import { DefaultAzureCredential } from "@azure/identity";
import dotenv from "dotenv";

dotenv.config();

import "dotenv/config";
const endpoint = process.env["FARMBEATS_ENDPOINT"] || "";

async function main() {
async function main(): Promise<void> {
const farmbeatsClient = FarmBeats(endpoint, new DefaultAzureCredential());
const partyId = "test_party";
const result = await farmbeatsClient.path("/parties/{partyId}", partyId).delete();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@

import FarmBeats, { Party } from "@azure-rest/agrifood-farming";
import { DefaultAzureCredential } from "@azure/identity";
import dotenv from "dotenv";

dotenv.config();

import "dotenv/config";
const endpoint = process.env["FARMBEATS_ENDPOINT"] || "";

async function main() {
async function main(): Promise<void> {
const farmbeatsClient = FarmBeats(endpoint, new DefaultAzureCredential());

const result = await farmbeatsClient.path("/parties").get();
Expand Down
22 changes: 22 additions & 0 deletions sdk/agrifood/agrifood-farming-rest/test/public/sampleTest.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { Recorder } from "@azure-tools/test-recorder";
import { createRecorder } from "./utils/recordedClient.js";
import { describe, it, assert, beforeEach, afterEach } from "vitest";

describe("My test", () => {
let recorder: Recorder;

beforeEach(async () => {
recorder = await createRecorder(this);
});

afterEach(async () => {
await recorder.stop();
});

it("sample test", async function () {
assert.equal(1, 1);
});
});
4 changes: 2 additions & 2 deletions sdk/agrifood/agrifood-farming-rest/test/public/smoke.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ describe("List parties", () => {
let recorder: Recorder;
let client: FarmBeatsClient;

beforeEach(async function (ctx) {
beforeEach(async (ctx) => {
recorder = await createRecorder(ctx);
client = createClient(recorder.configureClientOptions({}));
});

afterEach(async function () {
afterEach(async () => {
await recorder.stop();
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,23 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import type { RecorderStartOptions, TestInfo } from "@azure-tools/test-recorder";
import { Recorder, env } from "@azure-tools/test-recorder";
import type { FarmBeatsClient } from "../../../src/index.js";
import FarmBeats from "../../../src/index.js";
import { createTestCredential } from "@azure-tools/test-credential";
import type { ClientOptions } from "@azure-rest/core-client";
import { Recorder, RecorderStartOptions } from "@azure-tools/test-recorder";

const envSetupForPlayback: Record<string, string> = {
FARMBEATS_ENDPOINT: "https://fakeaccount.farmbeats.azure.net",
AZURE_CLIENT_ID: "azure_client_id",
AZURE_CLIENT_SECRET: "azure_client_secret",
AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888",
const replaceableVariables: Record<string, string> = {
SUBSCRIPTION_ID: "azure_subscription_id",
};

const recorderEnvSetup: RecorderStartOptions = {
envSetupForPlayback,
removeCentralSanitizers: ["AZSDK3430", "AZSDK3493", "AZSDK2030"],
envSetupForPlayback: replaceableVariables,
};

/**
* creates the recorder and reads the environment variables from the `.env` file.
* Should be called first in the test suite to make sure environment variables are
* read before they are being used.
*/
export async function createRecorder(context: TestInfo): Promise<Recorder> {
const recorder = new Recorder(context);

export async function createRecorder(context: Context): Promise<Recorder> {
const recorder = new Recorder(context.currentTest);
await recorder.start(recorderEnvSetup);
return recorder;
}

export function createClient(options?: ClientOptions): FarmBeatsClient {
const credential = createTestCredential();

return FarmBeats(env.FARMBEATS_ENDPOINT as string, credential, { ...options });
}
14 changes: 10 additions & 4 deletions sdk/agrifood/agrifood-farming-rest/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
{
"references": [
{ "path": "./tsconfig.src.json" },
{ "path": "./tsconfig.samples.json" },
{ "path": "./tsconfig.test.json" }
{
"path": "./tsconfig.src.json"
},
{
"path": "./tsconfig.samples.json"
},
{
"path": "./tsconfig.test.json"
}
]
}
}
2 changes: 1 addition & 1 deletion sdk/agrifood/agrifood-farming-rest/tsconfig.samples.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../../tsconfig.samples.base.json",
"compilerOptions": {
"paths": {
"@azure/openai": ["./dist/esm"]
"@azure-rest/agrifood-farming": ["./dist/esm"]
}
}
}
7 changes: 1 addition & 6 deletions sdk/agrifood/agrifood-farming-rest/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
{
"extends": ["./tsconfig.src.json", "../../../tsconfig.test.base.json"],
"compilerOptions": {
"paths": {
"@azure-rest/agrifood-farming": ["./src/index.ts"]
}
}
"extends": ["./tsconfig.src.json", "../../../tsconfig.test.base.json"]
}
6 changes: 3 additions & 3 deletions sdk/agrifood/agrifood-farming-rest/vitest.browser.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export default mergeConfig(
viteConfig,
defineConfig({
test: {
include: [
"dist-test/browser/test/**/*.spec.js",
],
include: ["dist-test/browser/test/**/*.spec.js",],
testTimeout: 1200000,
hookTimeout: 1200000,
},
}),
);
1 change: 1 addition & 0 deletions sdk/agrifood/agrifood-farming-rest/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

Expand Down
1 change: 1 addition & 0 deletions sdk/agrifood/agrifood-farming-rest/vitest.esm.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

Expand Down
Loading