deere-sdk 0.1.0
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.
- package/CHANGELOG.md +38 -0
- package/LICENSE +21 -0
- package/README.md +253 -0
- package/dist/api/assets.d.ts +78 -0
- package/dist/api/assets.d.ts.map +1 -0
- package/dist/api/assets.js +115 -0
- package/dist/api/assets.js.map +1 -0
- package/dist/api/boundaries.d.ts +69 -0
- package/dist/api/boundaries.d.ts.map +1 -0
- package/dist/api/boundaries.js +102 -0
- package/dist/api/boundaries.js.map +1 -0
- package/dist/api/clients.d.ts +71 -0
- package/dist/api/clients.d.ts.map +1 -0
- package/dist/api/clients.js +104 -0
- package/dist/api/clients.js.map +1 -0
- package/dist/api/connection-management.d.ts +41 -0
- package/dist/api/connection-management.d.ts.map +1 -0
- package/dist/api/connection-management.js +56 -0
- package/dist/api/connection-management.js.map +1 -0
- package/dist/api/crop-types.d.ts +48 -0
- package/dist/api/crop-types.d.ts.map +1 -0
- package/dist/api/crop-types.js +69 -0
- package/dist/api/crop-types.js.map +1 -0
- package/dist/api/equipment.d.ts +138 -0
- package/dist/api/equipment.d.ts.map +1 -0
- package/dist/api/equipment.js +214 -0
- package/dist/api/equipment.js.map +1 -0
- package/dist/api/farms.d.ts +69 -0
- package/dist/api/farms.d.ts.map +1 -0
- package/dist/api/farms.js +100 -0
- package/dist/api/farms.js.map +1 -0
- package/dist/api/field-operations-api.d.ts +56 -0
- package/dist/api/field-operations-api.d.ts.map +1 -0
- package/dist/api/field-operations-api.js +88 -0
- package/dist/api/field-operations-api.js.map +1 -0
- package/dist/api/field-operations.d.ts +83 -0
- package/dist/api/field-operations.d.ts.map +1 -0
- package/dist/api/field-operations.js +134 -0
- package/dist/api/field-operations.js.map +1 -0
- package/dist/api/fields.d.ts +73 -0
- package/dist/api/fields.d.ts.map +1 -0
- package/dist/api/fields.js +113 -0
- package/dist/api/fields.js.map +1 -0
- package/dist/api/files.d.ts +63 -0
- package/dist/api/files.d.ts.map +1 -0
- package/dist/api/files.js +96 -0
- package/dist/api/files.js.map +1 -0
- package/dist/api/flags.d.ts +96 -0
- package/dist/api/flags.d.ts.map +1 -0
- package/dist/api/flags.js +159 -0
- package/dist/api/flags.js.map +1 -0
- package/dist/api/guidance-lines.d.ts +52 -0
- package/dist/api/guidance-lines.d.ts.map +1 -0
- package/dist/api/guidance-lines.js +77 -0
- package/dist/api/guidance-lines.js.map +1 -0
- package/dist/api/index.d.ts +43 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +25 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/map-layers.d.ts +49 -0
- package/dist/api/map-layers.d.ts.map +1 -0
- package/dist/api/map-layers.js +69 -0
- package/dist/api/map-layers.js.map +1 -0
- package/dist/api/operators.d.ts +67 -0
- package/dist/api/operators.d.ts.map +1 -0
- package/dist/api/operators.js +99 -0
- package/dist/api/operators.js.map +1 -0
- package/dist/api/organizations.d.ts +45 -0
- package/dist/api/organizations.d.ts.map +1 -0
- package/dist/api/organizations.js +64 -0
- package/dist/api/organizations.js.map +1 -0
- package/dist/api/products.d.ts +88 -0
- package/dist/api/products.d.ts.map +1 -0
- package/dist/api/products.js +132 -0
- package/dist/api/products.js.map +1 -0
- package/dist/api/users.d.ts +22 -0
- package/dist/api/users.d.ts.map +1 -0
- package/dist/api/users.js +26 -0
- package/dist/api/users.js.map +1 -0
- package/dist/api/webhook.d.ts +42 -0
- package/dist/api/webhook.d.ts.map +1 -0
- package/dist/api/webhook.js +57 -0
- package/dist/api/webhook.js.map +1 -0
- package/dist/client.d.ts +114 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +224 -0
- package/dist/client.js.map +1 -0
- package/dist/deere.d.ts +98 -0
- package/dist/deere.d.ts.map +1 -0
- package/dist/deere.js +120 -0
- package/dist/deere.js.map +1 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -0
- package/dist/types/generated/assets.d.ts +839 -0
- package/dist/types/generated/assets.d.ts.map +1 -0
- package/dist/types/generated/assets.js +6 -0
- package/dist/types/generated/assets.js.map +1 -0
- package/dist/types/generated/boundaries.d.ts +734 -0
- package/dist/types/generated/boundaries.d.ts.map +1 -0
- package/dist/types/generated/boundaries.js +6 -0
- package/dist/types/generated/boundaries.js.map +1 -0
- package/dist/types/generated/clients.d.ts +602 -0
- package/dist/types/generated/clients.d.ts.map +1 -0
- package/dist/types/generated/clients.js +6 -0
- package/dist/types/generated/clients.js.map +1 -0
- package/dist/types/generated/connection-management.d.ts +210 -0
- package/dist/types/generated/connection-management.d.ts.map +1 -0
- package/dist/types/generated/connection-management.js +6 -0
- package/dist/types/generated/connection-management.js.map +1 -0
- package/dist/types/generated/crop-types.d.ts +541 -0
- package/dist/types/generated/crop-types.d.ts.map +1 -0
- package/dist/types/generated/crop-types.js +6 -0
- package/dist/types/generated/crop-types.js.map +1 -0
- package/dist/types/generated/equipment.d.ts +2599 -0
- package/dist/types/generated/equipment.d.ts.map +1 -0
- package/dist/types/generated/equipment.js +6 -0
- package/dist/types/generated/equipment.js.map +1 -0
- package/dist/types/generated/farms.d.ts +520 -0
- package/dist/types/generated/farms.d.ts.map +1 -0
- package/dist/types/generated/farms.js +6 -0
- package/dist/types/generated/farms.js.map +1 -0
- package/dist/types/generated/field-operations-api.d.ts +1724 -0
- package/dist/types/generated/field-operations-api.d.ts.map +1 -0
- package/dist/types/generated/field-operations-api.js +6 -0
- package/dist/types/generated/field-operations-api.js.map +1 -0
- package/dist/types/generated/fields.d.ts +904 -0
- package/dist/types/generated/fields.d.ts.map +1 -0
- package/dist/types/generated/fields.js +6 -0
- package/dist/types/generated/fields.js.map +1 -0
- package/dist/types/generated/files.d.ts +598 -0
- package/dist/types/generated/files.d.ts.map +1 -0
- package/dist/types/generated/files.js +6 -0
- package/dist/types/generated/files.js.map +1 -0
- package/dist/types/generated/flags.d.ts +593 -0
- package/dist/types/generated/flags.d.ts.map +1 -0
- package/dist/types/generated/flags.js +6 -0
- package/dist/types/generated/flags.js.map +1 -0
- package/dist/types/generated/guidance-lines.d.ts +405 -0
- package/dist/types/generated/guidance-lines.d.ts.map +1 -0
- package/dist/types/generated/guidance-lines.js +6 -0
- package/dist/types/generated/guidance-lines.js.map +1 -0
- package/dist/types/generated/index.d.ts +44 -0
- package/dist/types/generated/index.d.ts.map +1 -0
- package/dist/types/generated/index.js +26 -0
- package/dist/types/generated/index.js.map +1 -0
- package/dist/types/generated/map-layers.d.ts +696 -0
- package/dist/types/generated/map-layers.d.ts.map +1 -0
- package/dist/types/generated/map-layers.js +6 -0
- package/dist/types/generated/map-layers.js.map +1 -0
- package/dist/types/generated/operators.d.ts +361 -0
- package/dist/types/generated/operators.d.ts.map +1 -0
- package/dist/types/generated/operators.js +6 -0
- package/dist/types/generated/operators.js.map +1 -0
- package/dist/types/generated/organizations.d.ts +308 -0
- package/dist/types/generated/organizations.d.ts.map +1 -0
- package/dist/types/generated/organizations.js +6 -0
- package/dist/types/generated/organizations.js.map +1 -0
- package/dist/types/generated/products.d.ts +1165 -0
- package/dist/types/generated/products.d.ts.map +1 -0
- package/dist/types/generated/products.js +6 -0
- package/dist/types/generated/products.js.map +1 -0
- package/dist/types/generated/users.d.ts +96 -0
- package/dist/types/generated/users.d.ts.map +1 -0
- package/dist/types/generated/users.js +6 -0
- package/dist/types/generated/users.js.map +1 -0
- package/dist/types/generated/webhook.d.ts +475 -0
- package/dist/types/generated/webhook.d.ts.map +1 -0
- package/dist/types/generated/webhook.js +6 -0
- package/dist/types/generated/webhook.js.map +1 -0
- package/dist/types/index.d.ts +25 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +25 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +70 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.1.0] - 2024-XX-XX
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Initial release
|
|
15
|
+
- TypeScript SDK for John Deere Operations Center API
|
|
16
|
+
- Auto-generated types from OpenAPI specifications
|
|
17
|
+
- Support for 18 John Deere APIs:
|
|
18
|
+
- Organizations
|
|
19
|
+
- Fields
|
|
20
|
+
- Farms
|
|
21
|
+
- Boundaries
|
|
22
|
+
- Clients
|
|
23
|
+
- Equipment
|
|
24
|
+
- Field Operations
|
|
25
|
+
- Crop Types
|
|
26
|
+
- Products
|
|
27
|
+
- Map Layers
|
|
28
|
+
- Files
|
|
29
|
+
- Flags
|
|
30
|
+
- Guidance Lines
|
|
31
|
+
- Operators
|
|
32
|
+
- Users
|
|
33
|
+
- Assets
|
|
34
|
+
- Webhook
|
|
35
|
+
- Connection Management
|
|
36
|
+
- DeereClient with automatic pagination support
|
|
37
|
+
- Error handling with typed errors (DeereError, RateLimitError, AuthError)
|
|
38
|
+
- Support for all John Deere environments (production, sandbox, partner, cert)
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 ProductOfAmerica
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
# John Deere TypeScript SDK
|
|
2
|
+
|
|
3
|
+
> **Unofficial** TypeScript SDK for John Deere Operations Center API
|
|
4
|
+
|
|
5
|
+
This SDK provides typed access to John Deere's agricultural APIs, auto-generated from their OpenAPI specifications.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install deere-sdk
|
|
11
|
+
# or
|
|
12
|
+
pnpm add deere-sdk
|
|
13
|
+
# or
|
|
14
|
+
yarn add deere-sdk
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import { Deere } from 'deere-sdk';
|
|
21
|
+
|
|
22
|
+
const deere = new Deere({
|
|
23
|
+
accessToken: 'your-oauth-access-token',
|
|
24
|
+
environment: 'sandbox', // or 'production'
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// List all organizations
|
|
28
|
+
const orgs = await deere.organizations.listAll();
|
|
29
|
+
console.log('Organizations:', orgs);
|
|
30
|
+
|
|
31
|
+
// Get fields for an organization
|
|
32
|
+
const fields = await deere.fields.listAll(orgs[0].id);
|
|
33
|
+
console.log('Fields:', fields);
|
|
34
|
+
|
|
35
|
+
// Get farms
|
|
36
|
+
const farms = await deere.farms.listAll(orgs[0].id);
|
|
37
|
+
console.log('Farms:', farms);
|
|
38
|
+
|
|
39
|
+
// Get equipment
|
|
40
|
+
const equipment = await deere.equipment.get();
|
|
41
|
+
console.log('Equipment:', equipment);
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Authentication
|
|
45
|
+
|
|
46
|
+
This SDK requires an OAuth 2.0 access token from John Deere. You'll need to:
|
|
47
|
+
|
|
48
|
+
1. Register as a developer at [developer.deere.com](https://developer.deere.com)
|
|
49
|
+
2. Create an application and get your client ID/secret
|
|
50
|
+
3. Implement the OAuth 2.0 flow to obtain access tokens
|
|
51
|
+
4. Use the `accessToken` in the SDK configuration
|
|
52
|
+
|
|
53
|
+
### OAuth Scopes
|
|
54
|
+
|
|
55
|
+
Common scopes you may need:
|
|
56
|
+
- `ag1` - Read access to agricultural data
|
|
57
|
+
- `ag2` - Write access to agricultural data
|
|
58
|
+
- `ag3` - Additional agricultural data access
|
|
59
|
+
- `offline_access` - Refresh token support
|
|
60
|
+
|
|
61
|
+
## Available APIs
|
|
62
|
+
|
|
63
|
+
The SDK provides access to 18 John Deere APIs:
|
|
64
|
+
|
|
65
|
+
| API | Property | Description |
|
|
66
|
+
|-----|----------|-------------|
|
|
67
|
+
| Organizations | `deere.organizations` | Organization management |
|
|
68
|
+
| Fields | `deere.fields` | Field CRUD and boundaries |
|
|
69
|
+
| Farms | `deere.farms` | Farm management |
|
|
70
|
+
| Boundaries | `deere.boundaries` | Field boundary management |
|
|
71
|
+
| Clients | `deere.clients` | Client/customer management |
|
|
72
|
+
| Equipment | `deere.equipment` | Machines and implements |
|
|
73
|
+
| Field Operations | `deere.fieldOperations` | Harvests, plantings, applications |
|
|
74
|
+
| Crop Types | `deere.cropTypes` | Crop type catalog |
|
|
75
|
+
| Products | `deere.products` | Product catalog (seeds, chemicals) |
|
|
76
|
+
| Map Layers | `deere.mapLayers` | Map layer management |
|
|
77
|
+
| Files | `deere.files` | File management |
|
|
78
|
+
| Flags | `deere.flags` | Field flags/markers |
|
|
79
|
+
| Guidance Lines | `deere.guidanceLines` | GPS guidance lines |
|
|
80
|
+
| Operators | `deere.operators` | Machine operator management |
|
|
81
|
+
| Users | `deere.users` | User management |
|
|
82
|
+
| Assets | `deere.assets` | Asset management |
|
|
83
|
+
| Webhook | `deere.webhook` | Webhook subscriptions |
|
|
84
|
+
| Connection Management | `deere.connectionManagement` | OAuth connection management |
|
|
85
|
+
|
|
86
|
+
## API Examples
|
|
87
|
+
|
|
88
|
+
### Organizations
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
// List all organizations
|
|
92
|
+
const orgs = await deere.organizations.listAll();
|
|
93
|
+
|
|
94
|
+
// Get specific organization
|
|
95
|
+
const org = await deere.organizations.get('org-id');
|
|
96
|
+
|
|
97
|
+
// Search organizations
|
|
98
|
+
const filtered = await deere.organizations.list({ orgName: 'Farm' });
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Fields
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
// List all fields
|
|
105
|
+
const fields = await deere.fields.listAll('org-id');
|
|
106
|
+
|
|
107
|
+
// Get field details
|
|
108
|
+
const field = await deere.fields.get('org-id', 'field-id');
|
|
109
|
+
|
|
110
|
+
// Create a field
|
|
111
|
+
await deere.fields.create('org-id', { name: 'North Field', ... });
|
|
112
|
+
|
|
113
|
+
// Update a field
|
|
114
|
+
await deere.fields.update('org-id', 'field-id', { name: 'Updated Name' });
|
|
115
|
+
|
|
116
|
+
// Delete a field
|
|
117
|
+
await deere.fields.delete('org-id', 'field-id');
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Farms
|
|
121
|
+
|
|
122
|
+
```typescript
|
|
123
|
+
// List all farms
|
|
124
|
+
const farms = await deere.farms.listAll('org-id');
|
|
125
|
+
|
|
126
|
+
// Get farm with archived filter
|
|
127
|
+
const allFarms = await deere.farms.list('org-id', { recordFilter: 'all' });
|
|
128
|
+
|
|
129
|
+
// Create a farm
|
|
130
|
+
await deere.farms.create('org-id', { name: 'Smith Farm', clientUri: '...' });
|
|
131
|
+
|
|
132
|
+
// Get fields for a farm
|
|
133
|
+
const farmFields = await deere.farms.listFields('org-id', 'farm-id');
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Equipment
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
// Get all equipment
|
|
140
|
+
const equipment = await deere.equipment.get();
|
|
141
|
+
|
|
142
|
+
// Filter by organization
|
|
143
|
+
const orgEquipment = await deere.equipment.get({ organizationIds: [123] });
|
|
144
|
+
|
|
145
|
+
// Filter by type
|
|
146
|
+
const machines = await deere.equipment.get({ categories: 'Machine' });
|
|
147
|
+
|
|
148
|
+
// Get equipment details
|
|
149
|
+
const machine = await deere.equipment.getEquipment('equipment-id');
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Field Operations
|
|
153
|
+
|
|
154
|
+
```typescript
|
|
155
|
+
// Get field operations
|
|
156
|
+
const ops = await deere.fieldOperations.list('org-id');
|
|
157
|
+
|
|
158
|
+
// Filter by crop season and type
|
|
159
|
+
const harvests = await deere.fieldOperations.list('org-id', {
|
|
160
|
+
cropSeason: '2024',
|
|
161
|
+
fieldOperationTypes: 'harvest'
|
|
162
|
+
});
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Boundaries
|
|
166
|
+
|
|
167
|
+
```typescript
|
|
168
|
+
// List boundaries for a field
|
|
169
|
+
const boundaries = await deere.boundaries.listAll('org-id', 'field-id');
|
|
170
|
+
|
|
171
|
+
// Get active boundary
|
|
172
|
+
const active = await deere.boundaries.getActiveBoundary('org-id', 'field-id');
|
|
173
|
+
|
|
174
|
+
// Create boundary
|
|
175
|
+
await deere.boundaries.create('org-id', 'field-id', {
|
|
176
|
+
name: 'Main Boundary',
|
|
177
|
+
multipolygons: [...]
|
|
178
|
+
});
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Low-Level Client
|
|
182
|
+
|
|
183
|
+
For endpoints not covered by the typed APIs:
|
|
184
|
+
|
|
185
|
+
```typescript
|
|
186
|
+
import { DeereClient } from 'deere-sdk';
|
|
187
|
+
|
|
188
|
+
const client = new DeereClient({
|
|
189
|
+
accessToken: 'your-token',
|
|
190
|
+
environment: 'sandbox',
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
// Make raw requests
|
|
194
|
+
const response = await client.get<CustomType>('/some/endpoint');
|
|
195
|
+
const created = await client.post('/some/endpoint', { data: 'value' });
|
|
196
|
+
|
|
197
|
+
// Follow HAL links
|
|
198
|
+
const nextPage = await client.followLink(response.links[0]);
|
|
199
|
+
|
|
200
|
+
// Automatic pagination
|
|
201
|
+
for await (const items of client.paginate('/large/collection')) {
|
|
202
|
+
console.log(items);
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Error Handling
|
|
207
|
+
|
|
208
|
+
```typescript
|
|
209
|
+
import { DeereError, RateLimitError, AuthError } from 'deere-sdk';
|
|
210
|
+
|
|
211
|
+
try {
|
|
212
|
+
const fields = await deere.fields.listAll('org-id');
|
|
213
|
+
} catch (error) {
|
|
214
|
+
if (error instanceof RateLimitError) {
|
|
215
|
+
console.log(`Rate limited. Retry after ${error.retryAfter} seconds`);
|
|
216
|
+
} else if (error instanceof AuthError) {
|
|
217
|
+
console.log('Authentication failed. Token may be expired.');
|
|
218
|
+
} else if (error instanceof DeereError) {
|
|
219
|
+
console.log(`API error: ${error.status} ${error.message}`);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
## Environments
|
|
225
|
+
|
|
226
|
+
| Environment | URL | Use Case |
|
|
227
|
+
|-------------|-----|----------|
|
|
228
|
+
| `production` | api.deere.com | Live production data |
|
|
229
|
+
| `sandbox` | sandboxapi.deere.com | Development/testing |
|
|
230
|
+
| `partner` | partnerapi.deere.com | Partner integrations |
|
|
231
|
+
| `cert` | apicert.deere.com | Certification testing |
|
|
232
|
+
|
|
233
|
+
## TypeScript Support
|
|
234
|
+
|
|
235
|
+
The SDK is fully typed. You can access the OpenAPI-generated types:
|
|
236
|
+
|
|
237
|
+
```typescript
|
|
238
|
+
import { Types } from 'deere-sdk';
|
|
239
|
+
|
|
240
|
+
// Access specific API types
|
|
241
|
+
type Farm = Types.Farms.components['schemas']['GetFarm'];
|
|
242
|
+
type Field = Types.Fields.components['schemas']['FieldsResponse'];
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## Disclaimer
|
|
246
|
+
|
|
247
|
+
This is an **unofficial** SDK and is not affiliated with, endorsed by, or connected to John Deere or Deere & Company. Use at your own risk.
|
|
248
|
+
|
|
249
|
+
John Deere and Operations Center are trademarks of Deere & Company.
|
|
250
|
+
|
|
251
|
+
## License
|
|
252
|
+
|
|
253
|
+
MIT
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AssetsApi
|
|
3
|
+
*
|
|
4
|
+
* Auto-generated SDK wrapper for John Deere assets API.
|
|
5
|
+
* @generated from assets.yaml
|
|
6
|
+
*/
|
|
7
|
+
import type { DeereClient, RequestOptions, PaginatedResponse } from '../client.js';
|
|
8
|
+
import type { components } from '../types/generated/assets.js';
|
|
9
|
+
export declare class AssetsApi {
|
|
10
|
+
private readonly client;
|
|
11
|
+
constructor(client: DeereClient);
|
|
12
|
+
/**
|
|
13
|
+
* Get all assets
|
|
14
|
+
* @description This endpoint will retrieve all assets for an organization.
|
|
15
|
+
* @generated from GET /organizations/{orgId}/assets
|
|
16
|
+
*/
|
|
17
|
+
list(orgId: string, params?: {
|
|
18
|
+
embed?: string;
|
|
19
|
+
}, options?: RequestOptions): Promise<unknown>;
|
|
20
|
+
/**
|
|
21
|
+
* Get all items (follows pagination automatically)
|
|
22
|
+
* @generated from GET /organizations/{orgId}/assets
|
|
23
|
+
*/
|
|
24
|
+
listAll(orgId: string, params?: {
|
|
25
|
+
embed?: string;
|
|
26
|
+
}, options?: RequestOptions): Promise<unknown[]>;
|
|
27
|
+
/**
|
|
28
|
+
* Create a new asset
|
|
29
|
+
* @description This endpoint will create a new asset.
|
|
30
|
+
* @generated from POST /organizations/{orgId}/assets
|
|
31
|
+
*/
|
|
32
|
+
create(orgId: string, data: Record<string, unknown>, options?: RequestOptions): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Get a specific asset
|
|
35
|
+
* @description This endpoint will retrieve a specific asset by its unique ID.
|
|
36
|
+
* @generated from GET /assets/{assetId}
|
|
37
|
+
*/
|
|
38
|
+
get(assetId: string, params?: {
|
|
39
|
+
embed?: string;
|
|
40
|
+
}, options?: RequestOptions): Promise<unknown>;
|
|
41
|
+
/**
|
|
42
|
+
* Update an asset
|
|
43
|
+
* @description This endpoint will update the asset by its unique id.
|
|
44
|
+
* @generated from PUT /assets/{assetId}
|
|
45
|
+
*/
|
|
46
|
+
update(assetId: string, data: Record<string, unknown>, options?: RequestOptions): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Delete an Asset
|
|
49
|
+
* @description This endpoint will delete an asset by its unique id.
|
|
50
|
+
* @generated from DELETE /assets/{assetId}
|
|
51
|
+
*/
|
|
52
|
+
delete(assetId: string, options?: RequestOptions): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Get all locations for an asset
|
|
55
|
+
* @description This endpoint will retrieve all locations for an asset. If you provide startDate and endDate then it will retrieve all the results of the given time range.
|
|
56
|
+
* @generated from GET /assets/{assetId}/locations
|
|
57
|
+
*/
|
|
58
|
+
listLocations(assetId: string, params?: {
|
|
59
|
+
startDate?: string;
|
|
60
|
+
endDate?: string;
|
|
61
|
+
count?: string;
|
|
62
|
+
pageKey?: string;
|
|
63
|
+
}, options?: RequestOptions): Promise<unknown>;
|
|
64
|
+
/**
|
|
65
|
+
* Create new asset location
|
|
66
|
+
* @description This endpoint will create a new Asset Location.<br/><br/><b>We provide <a href="#markdown">Markdown support</a> for measurementData name.</b><br/><br/> <b>Please Note:</b> Only <i>links</i> are supported for a measurementData name.<br/><br/>Additionally, Asset Locations do not honor fractional seconds in their <mark>timestamps</mark>. So <mark>2019-01-01T12:34:56.900Z</mark> and <mark>2019-01-01T12:34:56Z</mark> are considered equivalent.
|
|
67
|
+
* @generated from POST /assets/{assetId}/locations
|
|
68
|
+
*/
|
|
69
|
+
createLocations(assetId: string, data: Record<string, unknown>, options?: RequestOptions): Promise<void>;
|
|
70
|
+
/**
|
|
71
|
+
* Get Asset Catalog List
|
|
72
|
+
* @description This endpoint will retrieve the Asset Catalog List.
|
|
73
|
+
* @generated from GET /assetCatalog
|
|
74
|
+
*/
|
|
75
|
+
getAssetcatalog(options?: RequestOptions): Promise<PaginatedResponse<components['schemas']['AssetCatalogGet']>>;
|
|
76
|
+
}
|
|
77
|
+
export type { components as AssetsTypes } from '../types/generated/assets.js';
|
|
78
|
+
//# sourceMappingURL=assets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../src/api/assets.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACnF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE/D,qBAAa,SAAS;IACR,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAEhD;;;;OAIG;IACG,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAOlG;;;OAGG;IACG,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MA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iBAAiB,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC;CAItH;AAGD,YAAY,EAAE,UAAU,IAAI,WAAW,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AssetsApi
|
|
3
|
+
*
|
|
4
|
+
* Auto-generated SDK wrapper for John Deere assets API.
|
|
5
|
+
* @generated from assets.yaml
|
|
6
|
+
*/
|
|
7
|
+
export class AssetsApi {
|
|
8
|
+
client;
|
|
9
|
+
constructor(client) {
|
|
10
|
+
this.client = client;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Get all assets
|
|
14
|
+
* @description This endpoint will retrieve all assets for an organization.
|
|
15
|
+
* @generated from GET /organizations/{orgId}/assets
|
|
16
|
+
*/
|
|
17
|
+
async list(orgId, params, options) {
|
|
18
|
+
const query = new URLSearchParams();
|
|
19
|
+
if (params?.embed !== undefined)
|
|
20
|
+
query.set('embed', String(params.embed));
|
|
21
|
+
const queryString = query.toString();
|
|
22
|
+
const path = `/organizations/${orgId}/assets${queryString ? `?${queryString}` : ''}`;
|
|
23
|
+
return this.client.get(path, options);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get all items (follows pagination automatically)
|
|
27
|
+
* @generated from GET /organizations/{orgId}/assets
|
|
28
|
+
*/
|
|
29
|
+
async listAll(orgId, params, options) {
|
|
30
|
+
const query = new URLSearchParams();
|
|
31
|
+
if (params?.embed !== undefined)
|
|
32
|
+
query.set('embed', String(params.embed));
|
|
33
|
+
const queryString = query.toString();
|
|
34
|
+
const path = `/organizations/${orgId}/assets${queryString ? `?${queryString}` : ''}`;
|
|
35
|
+
return this.client.getAll(path, options);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Create a new asset
|
|
39
|
+
* @description This endpoint will create a new asset.
|
|
40
|
+
* @generated from POST /organizations/{orgId}/assets
|
|
41
|
+
*/
|
|
42
|
+
async create(orgId, data, options) {
|
|
43
|
+
const path = `/organizations/${orgId}/assets`;
|
|
44
|
+
await this.client.post(path, data, options);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Get a specific asset
|
|
48
|
+
* @description This endpoint will retrieve a specific asset by its unique ID.
|
|
49
|
+
* @generated from GET /assets/{assetId}
|
|
50
|
+
*/
|
|
51
|
+
async get(assetId, params, options) {
|
|
52
|
+
const query = new URLSearchParams();
|
|
53
|
+
if (params?.embed !== undefined)
|
|
54
|
+
query.set('embed', String(params.embed));
|
|
55
|
+
const queryString = query.toString();
|
|
56
|
+
const path = `/assets/${assetId}${queryString ? `?${queryString}` : ''}`;
|
|
57
|
+
return this.client.get(path, options);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Update an asset
|
|
61
|
+
* @description This endpoint will update the asset by its unique id.
|
|
62
|
+
* @generated from PUT /assets/{assetId}
|
|
63
|
+
*/
|
|
64
|
+
async update(assetId, data, options) {
|
|
65
|
+
const path = `/assets/${assetId}`;
|
|
66
|
+
await this.client.put(path, data, options);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Delete an Asset
|
|
70
|
+
* @description This endpoint will delete an asset by its unique id.
|
|
71
|
+
* @generated from DELETE /assets/{assetId}
|
|
72
|
+
*/
|
|
73
|
+
async delete(assetId, options) {
|
|
74
|
+
const path = `/assets/${assetId}`;
|
|
75
|
+
await this.client.delete(path, options);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Get all locations for an asset
|
|
79
|
+
* @description This endpoint will retrieve all locations for an asset. If you provide startDate and endDate then it will retrieve all the results of the given time range.
|
|
80
|
+
* @generated from GET /assets/{assetId}/locations
|
|
81
|
+
*/
|
|
82
|
+
async listLocations(assetId, params, options) {
|
|
83
|
+
const query = new URLSearchParams();
|
|
84
|
+
if (params?.startDate !== undefined)
|
|
85
|
+
query.set('startDate', String(params.startDate));
|
|
86
|
+
if (params?.endDate !== undefined)
|
|
87
|
+
query.set('endDate', String(params.endDate));
|
|
88
|
+
if (params?.count !== undefined)
|
|
89
|
+
query.set('count', String(params.count));
|
|
90
|
+
if (params?.pageKey !== undefined)
|
|
91
|
+
query.set('pageKey', String(params.pageKey));
|
|
92
|
+
const queryString = query.toString();
|
|
93
|
+
const path = `/assets/${assetId}/locations${queryString ? `?${queryString}` : ''}`;
|
|
94
|
+
return this.client.get(path, options);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Create new asset location
|
|
98
|
+
* @description This endpoint will create a new Asset Location.<br/><br/><b>We provide <a href="#markdown">Markdown support</a> for measurementData name.</b><br/><br/> <b>Please Note:</b> Only <i>links</i> are supported for a measurementData name.<br/><br/>Additionally, Asset Locations do not honor fractional seconds in their <mark>timestamps</mark>. So <mark>2019-01-01T12:34:56.900Z</mark> and <mark>2019-01-01T12:34:56Z</mark> are considered equivalent.
|
|
99
|
+
* @generated from POST /assets/{assetId}/locations
|
|
100
|
+
*/
|
|
101
|
+
async createLocations(assetId, data, options) {
|
|
102
|
+
const path = `/assets/${assetId}/locations`;
|
|
103
|
+
await this.client.post(path, data, options);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Get Asset Catalog List
|
|
107
|
+
* @description This endpoint will retrieve the Asset Catalog List.
|
|
108
|
+
* @generated from GET /assetCatalog
|
|
109
|
+
*/
|
|
110
|
+
async getAssetcatalog(options) {
|
|
111
|
+
const path = `/assetCatalog`;
|
|
112
|
+
return this.client.get(path, options);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=assets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.js","sourceRoot":"","sources":["../../src/api/assets.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,OAAO,SAAS;IACS;IAA7B,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD;;;;OAIG;IACH,KAA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aries.yaml
|
|
6
|
+
*/
|
|
7
|
+
import type { DeereClient, RequestOptions } from '../client.js';
|
|
8
|
+
export declare class BoundariesApi {
|
|
9
|
+
private readonly client;
|
|
10
|
+
constructor(client: DeereClient);
|
|
11
|
+
/**
|
|
12
|
+
* View Boundaries in an Org
|
|
13
|
+
* @description View boundaries in an organization. <ul> <li><b>fields</b>: View the field associated with these boundaries.</li> <li><b>owningOrganizations</b>: View the organization that owns the field.</li> </ul>
|
|
14
|
+
* @generated from GET /organizations/{orgId}/boundaries
|
|
15
|
+
*/
|
|
16
|
+
list(orgId: string, params?: {
|
|
17
|
+
embed?: string;
|
|
18
|
+
recordFilter?: string;
|
|
19
|
+
}, options?: RequestOptions): Promise<unknown>;
|
|
20
|
+
/**
|
|
21
|
+
* Get all items (follows pagination automatically)
|
|
22
|
+
* @generated from GET /organizations/{orgId}/boundaries
|
|
23
|
+
*/
|
|
24
|
+
listAll(orgId: string, params?: {
|
|
25
|
+
embed?: string;
|
|
26
|
+
recordFilter?: string;
|
|
27
|
+
}, options?: RequestOptions): Promise<unknown[]>;
|
|
28
|
+
/**
|
|
29
|
+
* View the Boundaries of a Field
|
|
30
|
+
* @description View the boundaries of a specified field.
|
|
31
|
+
* @generated from GET /organizations/{orgId}/fields/{fieldId}/boundaries
|
|
32
|
+
*/
|
|
33
|
+
listBoundaries(orgId: string, fieldId: string, params?: {
|
|
34
|
+
embed?: string;
|
|
35
|
+
recordFilter?: string;
|
|
36
|
+
}, options?: RequestOptions): Promise<unknown>;
|
|
37
|
+
/**
|
|
38
|
+
* Create a Boundary
|
|
39
|
+
* @description Create a boundary with a geometry collection for a field.
|
|
40
|
+
* @generated from POST /organizations/{orgId}/fields/{fieldId}/boundaries
|
|
41
|
+
*/
|
|
42
|
+
create(orgId: string, fieldId: string, data: Record<string, unknown>, options?: RequestOptions): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Generate a Boundary from a FieldOperation
|
|
45
|
+
* @description Given a <a href='/dev-docs/field-operations#overviews' target='_blank'>field operation</a>, this endpoint will generate and return a boundary that surrounds the area worked by that field operation. Any gaps in that field operation will be treated as interior rings. This endpoint returns the generated boundary, giving you the opportunity to change the boundary name, clean up any unwanted interiors, etc. before <a href='/dev-docs/boundaries#/organizations/{orgId}/fields/{fieldId}/boundaries/post' target='_blank'>POST'ing the generated boundary</a> back into Operations Center. <p>There are two cases where this API will return an HTTP 400 - Bad Request:</p> <ul> <li><b>If the field already has an active boundary.</b> In this case, please use the existing boundary - it is likely more accurate than a generated boundary.</li> <li><b>If the field has been merged.</b> In this case, a FieldOperation may only cover one part of the merged field, resulting in an inaccurate boundary.</li> </ul>
|
|
46
|
+
* @generated from GET /fieldOperations/{operationId}/boundary
|
|
47
|
+
*/
|
|
48
|
+
get(operationId: string, options?: RequestOptions): Promise<unknown>;
|
|
49
|
+
/**
|
|
50
|
+
* Get a specific boundary
|
|
51
|
+
* @description This endpoint will retrieve a specific boundary.
|
|
52
|
+
* @generated from GET /organizations/{orgId}/fields/{fieldId}/boundaries/{boundaryId}
|
|
53
|
+
*/
|
|
54
|
+
getBoundaries(orgId: string, fieldId: string, boundaryId: string, options?: RequestOptions): Promise<unknown>;
|
|
55
|
+
/**
|
|
56
|
+
* Update a boundary
|
|
57
|
+
* @description This endpoint will update a boundary. The shape of the object must include name, active, irrigated, sourceType, and multipolygons. All these fields can be updated, however a license is required to set sourceType to a value other than "External". If the boundary is set to active, it will mark all other boundaries in this field inactive.
|
|
58
|
+
* @generated from PUT /organizations/{orgId}/fields/{fieldId}/boundaries/{boundaryId}
|
|
59
|
+
*/
|
|
60
|
+
update(orgId: string, fieldId: string, boundaryId: string, data: Record<string, unknown>, options?: RequestOptions): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Delete a boundary
|
|
63
|
+
* @description This endpoint will delete a boundary.
|
|
64
|
+
* @generated from DELETE /organizations/{orgId}/fields/{fieldId}/boundaries/{boundaryId}
|
|
65
|
+
*/
|
|
66
|
+
delete(orgId: string, fieldId: string, boundaryId: string, options?: RequestOptions): Promise<void>;
|
|
67
|
+
}
|
|
68
|
+
export type { components as BoundariesTypes } from '../types/generated/boundaries.js';
|
|
69
|
+
//# sourceMappingURL=boundaries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boundaries.d.ts","sourceRoot":"","sources":["../../src/api/boundaries.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAqB,MAAM,cAAc,CAAC;AAGnF,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAEhD;;;;OAIG;IACG,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAQzH;;;OAGG;IACG,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAS9H;;;;OAIG;IACG,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IASpJ;;;;OAIG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,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