deere-sdk 1.0.10 → 2.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.
Files changed (159) hide show
  1. package/CHANGELOG.md +223 -0
  2. package/README.md +130 -20
  3. package/dist/api/aemp.d.ts +4 -0
  4. package/dist/api/aemp.d.ts.map +1 -1
  5. package/dist/api/aemp.js +5 -1
  6. package/dist/api/aemp.js.map +1 -1
  7. package/dist/api/assets.d.ts +4 -0
  8. package/dist/api/assets.d.ts.map +1 -1
  9. package/dist/api/assets.js +13 -9
  10. package/dist/api/assets.js.map +1 -1
  11. package/dist/api/boundaries.d.ts +4 -0
  12. package/dist/api/boundaries.d.ts.map +1 -1
  13. package/dist/api/boundaries.js +12 -8
  14. package/dist/api/boundaries.js.map +1 -1
  15. package/dist/api/clients.d.ts +4 -0
  16. package/dist/api/clients.d.ts.map +1 -1
  17. package/dist/api/clients.js +12 -8
  18. package/dist/api/clients.js.map +1 -1
  19. package/dist/api/connection-management.d.ts +4 -0
  20. package/dist/api/connection-management.d.ts.map +1 -1
  21. package/dist/api/connection-management.js +8 -4
  22. package/dist/api/connection-management.js.map +1 -1
  23. package/dist/api/crop-types.d.ts +4 -0
  24. package/dist/api/crop-types.d.ts.map +1 -1
  25. package/dist/api/crop-types.js +9 -5
  26. package/dist/api/crop-types.js.map +1 -1
  27. package/dist/api/equipment-measurement.d.ts +4 -0
  28. package/dist/api/equipment-measurement.d.ts.map +1 -1
  29. package/dist/api/equipment-measurement.js +5 -1
  30. package/dist/api/equipment-measurement.js.map +1 -1
  31. package/dist/api/equipment.d.ts +4 -0
  32. package/dist/api/equipment.d.ts.map +1 -1
  33. package/dist/api/equipment.js +20 -16
  34. package/dist/api/equipment.js.map +1 -1
  35. package/dist/api/farms.d.ts +4 -0
  36. package/dist/api/farms.d.ts.map +1 -1
  37. package/dist/api/farms.js +12 -8
  38. package/dist/api/farms.js.map +1 -1
  39. package/dist/api/field-operations-api.d.ts +4 -0
  40. package/dist/api/field-operations-api.d.ts.map +1 -1
  41. package/dist/api/field-operations-api.js +8 -4
  42. package/dist/api/field-operations-api.js.map +1 -1
  43. package/dist/api/fields.d.ts +4 -0
  44. package/dist/api/fields.d.ts.map +1 -1
  45. package/dist/api/fields.js +12 -8
  46. package/dist/api/fields.js.map +1 -1
  47. package/dist/api/files.d.ts +4 -0
  48. package/dist/api/files.d.ts.map +1 -1
  49. package/dist/api/files.js +10 -6
  50. package/dist/api/files.js.map +1 -1
  51. package/dist/api/flags.d.ts +4 -0
  52. package/dist/api/flags.d.ts.map +1 -1
  53. package/dist/api/flags.js +11 -7
  54. package/dist/api/flags.js.map +1 -1
  55. package/dist/api/guidance-lines.d.ts +4 -0
  56. package/dist/api/guidance-lines.d.ts.map +1 -1
  57. package/dist/api/guidance-lines.js +9 -5
  58. package/dist/api/guidance-lines.js.map +1 -1
  59. package/dist/api/harvest-id.d.ts +4 -0
  60. package/dist/api/harvest-id.d.ts.map +1 -1
  61. package/dist/api/harvest-id.js +7 -3
  62. package/dist/api/harvest-id.js.map +1 -1
  63. package/dist/api/machine-alerts.d.ts +4 -0
  64. package/dist/api/machine-alerts.d.ts.map +1 -1
  65. package/dist/api/machine-alerts.js +6 -2
  66. package/dist/api/machine-alerts.js.map +1 -1
  67. package/dist/api/machine-device-state-reports.d.ts +4 -0
  68. package/dist/api/machine-device-state-reports.d.ts.map +1 -1
  69. package/dist/api/machine-device-state-reports.js +5 -1
  70. package/dist/api/machine-device-state-reports.js.map +1 -1
  71. package/dist/api/machine-engine-hours.d.ts +4 -0
  72. package/dist/api/machine-engine-hours.d.ts.map +1 -1
  73. package/dist/api/machine-engine-hours.js +6 -2
  74. package/dist/api/machine-engine-hours.js.map +1 -1
  75. package/dist/api/machine-hours-of-operation.d.ts +4 -0
  76. package/dist/api/machine-hours-of-operation.d.ts.map +1 -1
  77. package/dist/api/machine-hours-of-operation.js +6 -2
  78. package/dist/api/machine-hours-of-operation.js.map +1 -1
  79. package/dist/api/machine-locations.d.ts +4 -0
  80. package/dist/api/machine-locations.d.ts.map +1 -1
  81. package/dist/api/machine-locations.js +5 -1
  82. package/dist/api/machine-locations.js.map +1 -1
  83. package/dist/api/map-layers.d.ts +4 -0
  84. package/dist/api/map-layers.d.ts.map +1 -1
  85. package/dist/api/map-layers.js +9 -5
  86. package/dist/api/map-layers.js.map +1 -1
  87. package/dist/api/notifications.d.ts +4 -0
  88. package/dist/api/notifications.d.ts.map +1 -1
  89. package/dist/api/notifications.js +9 -5
  90. package/dist/api/notifications.js.map +1 -1
  91. package/dist/api/operators.d.ts +4 -0
  92. package/dist/api/operators.d.ts.map +1 -1
  93. package/dist/api/operators.js +11 -7
  94. package/dist/api/operators.js.map +1 -1
  95. package/dist/api/organizations.d.ts +4 -0
  96. package/dist/api/organizations.d.ts.map +1 -1
  97. package/dist/api/organizations.js +9 -5
  98. package/dist/api/organizations.js.map +1 -1
  99. package/dist/api/partnerships.d.ts +4 -0
  100. package/dist/api/partnerships.d.ts.map +1 -1
  101. package/dist/api/partnerships.js +11 -7
  102. package/dist/api/partnerships.js.map +1 -1
  103. package/dist/api/products.d.ts +4 -0
  104. package/dist/api/products.d.ts.map +1 -1
  105. package/dist/api/products.js +14 -10
  106. package/dist/api/products.js.map +1 -1
  107. package/dist/api/users.d.ts +4 -0
  108. package/dist/api/users.d.ts.map +1 -1
  109. package/dist/api/users.js +5 -1
  110. package/dist/api/users.js.map +1 -1
  111. package/dist/api/webhook.d.ts +4 -0
  112. package/dist/api/webhook.d.ts.map +1 -1
  113. package/dist/api/webhook.js +9 -5
  114. package/dist/api/webhook.js.map +1 -1
  115. package/dist/api-servers.generated.d.ts +72 -0
  116. package/dist/api-servers.generated.d.ts.map +1 -0
  117. package/dist/api-servers.generated.js +344 -0
  118. package/dist/api-servers.generated.js.map +1 -0
  119. package/dist/client.d.ts +95 -47
  120. package/dist/client.d.ts.map +1 -1
  121. package/dist/client.js +196 -105
  122. package/dist/client.js.map +1 -1
  123. package/dist/deere.d.ts +14 -0
  124. package/dist/deere.d.ts.map +1 -1
  125. package/dist/deere.js +20 -0
  126. package/dist/deere.js.map +1 -1
  127. package/dist/environment-resolver.d.ts +40 -0
  128. package/dist/environment-resolver.d.ts.map +1 -0
  129. package/dist/environment-resolver.js +79 -0
  130. package/dist/environment-resolver.js.map +1 -0
  131. package/dist/errors.d.ts +36 -0
  132. package/dist/errors.d.ts.map +1 -0
  133. package/dist/errors.js +54 -0
  134. package/dist/errors.js.map +1 -0
  135. package/dist/hateoas-map.d.ts +9 -0
  136. package/dist/hateoas-map.d.ts.map +1 -1
  137. package/dist/hateoas-map.js +84 -37
  138. package/dist/hateoas-map.js.map +1 -1
  139. package/dist/index.d.ts +1 -0
  140. package/dist/index.d.ts.map +1 -1
  141. package/dist/index.js +3 -0
  142. package/dist/index.js.map +1 -1
  143. package/dist/safe/field-operations.d.ts +73 -0
  144. package/dist/safe/field-operations.d.ts.map +1 -0
  145. package/dist/safe/field-operations.js +74 -0
  146. package/dist/safe/field-operations.js.map +1 -0
  147. package/dist/safe/index.d.ts +41 -0
  148. package/dist/safe/index.d.ts.map +1 -0
  149. package/dist/safe/index.js +47 -0
  150. package/dist/safe/index.js.map +1 -0
  151. package/dist/types/generated/field-operations-api.d.ts +17 -0
  152. package/dist/types/generated/field-operations-api.d.ts.map +1 -1
  153. package/dist/types/generated/index.d.ts +1 -1
  154. package/dist/types/generated/index.js +1 -1
  155. package/package.json +3 -2
  156. package/dist/api/field-operations.d.ts +0 -83
  157. package/dist/api/field-operations.d.ts.map +0 -1
  158. package/dist/api/field-operations.js +0 -134
  159. package/dist/api/field-operations.js.map +0 -1
@@ -0,0 +1,72 @@
1
+ /**
2
+ * API server configuration per spec — single source of truth for URL resolution.
3
+ *
4
+ * @generated by scripts/generate-api-servers.ts — do not edit manually
5
+ * Last generated: 2026-04-14T19:26:59.403Z
6
+ *
7
+ * Env coverage matrix (X = supported, - = throws UnsupportedEnvironmentError):
8
+ *
9
+ * api sandboxapi partnerapi apicert apiqa.tal partnerapicert partnerapiqa sandboxapiqa apidev.tal
10
+ * aemp X X X - - - - - -
11
+ * assets X X X X X - - - -
12
+ * boundaries X X X X X X X X -
13
+ * clients X X X X X - - - -
14
+ * connection-management X X - X X - - - -
15
+ * crop-types X X X X X X X X -
16
+ * equipment-measurement X - X X X X X X -
17
+ * equipment X - X - - - - - -
18
+ * farms X X X X X - - - -
19
+ * field-operations-api X X X X X X X X -
20
+ * fields X X X X X - - - -
21
+ * files X X X X X X X X X
22
+ * flags X X X X X X X X X
23
+ * guidance-lines X X X X X - - - X
24
+ * harvest-id X X X X X X X X -
25
+ * machine-alerts X X X X X X X X X
26
+ * machine-device-state-reports X X X X X - - - -
27
+ * machine-engine-hours X X X X X - - - -
28
+ * machine-hours-of-operation X X X X X - - - -
29
+ * machine-locations X X X X X X X X X
30
+ * map-layers X X X X X - - - -
31
+ * notifications X X X X X X X X X
32
+ * operators X X - X X - - - -
33
+ * organizations X X X X X X X X X
34
+ * partnerships X X X X X X X X X
35
+ * products X X X X X - - - X
36
+ * users X X X X X - - - -
37
+ * webhook X X X X X - - - X
38
+ *
39
+ * A dash (-) means the env is NOT supported for that spec. Calling a method
40
+ * on that API with that env throws UnsupportedEnvironmentError at request
41
+ * time, before any HTTP call — no silent cross-tier routing.
42
+ */
43
+ export type SpecName = 'aemp' | 'assets' | 'boundaries' | 'clients' | 'connection-management' | 'crop-types' | 'equipment-measurement' | 'equipment' | 'farms' | 'field-operations-api' | 'fields' | 'files' | 'flags' | 'guidance-lines' | 'harvest-id' | 'machine-alerts' | 'machine-device-state-reports' | 'machine-engine-hours' | 'machine-hours-of-operation' | 'machine-locations' | 'map-layers' | 'notifications' | 'operators' | 'organizations' | 'partnerships' | 'products' | 'users' | 'webhook';
44
+ export type Environment = 'api' | 'sandboxapi' | 'partnerapi' | 'apicert' | 'apiqa.tal' | 'partnerapicert' | 'partnerapiqa' | 'sandboxapiqa' | 'apidev.tal';
45
+ export declare const KNOWN_ENVIRONMENTS: readonly Environment[];
46
+ /**
47
+ * Default environment for new DeereClient instances when config.environment
48
+ * is not specified. 'sandboxapi' is safe-by-default — never silently hits
49
+ * production data.
50
+ */
51
+ export declare const DEFAULT_ENVIRONMENT: Environment;
52
+ export type SpecServerConfig = {
53
+ kind: 'templated';
54
+ /** URL template with `{environment}` placeholder. */
55
+ urlTemplate: string;
56
+ /** Envs declared in the spec's servers.variables.environment.enum. */
57
+ supportedEnvironments: readonly Environment[];
58
+ } | {
59
+ kind: 'static';
60
+ /**
61
+ * PARTIAL map — envs we can't confidently serve are OMITTED. Runtime
62
+ * throws UnsupportedEnvironmentError on missing keys. See
63
+ * scripts/generate-api-servers.ts for the env-to-tier classifier.
64
+ */
65
+ urlByEnvironment: Readonly<Partial<Record<Environment, string>>>;
66
+ } | {
67
+ kind: 'unavailable';
68
+ /** Human-readable explanation for diagnostics. */
69
+ reason: string;
70
+ };
71
+ export declare const API_SERVERS: Record<SpecName, SpecServerConfig>;
72
+ //# sourceMappingURL=api-servers.generated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-servers.generated.d.ts","sourceRoot":"","sources":["../src/api-servers.generated.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAMH,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,QAAQ,GACR,YAAY,GACZ,SAAS,GACT,uBAAuB,GACvB,YAAY,GACZ,uBAAuB,GACvB,WAAW,GACX,OAAO,GACP,sBAAsB,GACtB,QAAQ,GACR,OAAO,GACP,OAAO,GACP,gBAAgB,GAChB,YAAY,GACZ,gBAAgB,GAChB,8BAA8B,GAC9B,sBAAsB,GACtB,4BAA4B,GAC5B,mBAAmB,GACnB,YAAY,GACZ,eAAe,GACf,WAAW,GACX,eAAe,GACf,cAAc,GACd,UAAU,GACV,OAAO,GACP,SAAS,CAAC;AAQd,MAAM,MAAM,WAAW,GACnB,KAAK,GACL,YAAY,GACZ,YAAY,GACZ,SAAS,GACT,WAAW,GACX,gBAAgB,GAChB,cAAc,GACd,cAAc,GACd,YAAY,CAAC;AAEjB,eAAO,MAAM,kBAAkB,EAAE,SAAS,WAAW,EAU3C,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,WAA0B,CAAC;AAM7D,MAAM,MAAM,gBAAgB,GACxB;IACE,IAAI,EAAE,WAAW,CAAC;IAClB,qDAAqD;IACrD,WAAW,EAAE,MAAM,CAAC;IACpB,sEAAsE;IACtE,qBAAqB,EAAE,SAAS,WAAW,EAAE,CAAC;CAC/C,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;IACf;;;;OAIG;IACH,gBAAgB,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;CAClE,GACD;IACE,IAAI,EAAE,aAAa,CAAC;IACpB,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAMN,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAwR1D,CAAC"}
@@ -0,0 +1,344 @@
1
+ /**
2
+ * API server configuration per spec — single source of truth for URL resolution.
3
+ *
4
+ * @generated by scripts/generate-api-servers.ts — do not edit manually
5
+ * Last generated: 2026-04-14T19:26:59.403Z
6
+ *
7
+ * Env coverage matrix (X = supported, - = throws UnsupportedEnvironmentError):
8
+ *
9
+ * api sandboxapi partnerapi apicert apiqa.tal partnerapicert partnerapiqa sandboxapiqa apidev.tal
10
+ * aemp X X X - - - - - -
11
+ * assets X X X X X - - - -
12
+ * boundaries X X X X X X X X -
13
+ * clients X X X X X - - - -
14
+ * connection-management X X - X X - - - -
15
+ * crop-types X X X X X X X X -
16
+ * equipment-measurement X - X X X X X X -
17
+ * equipment X - X - - - - - -
18
+ * farms X X X X X - - - -
19
+ * field-operations-api X X X X X X X X -
20
+ * fields X X X X X - - - -
21
+ * files X X X X X X X X X
22
+ * flags X X X X X X X X X
23
+ * guidance-lines X X X X X - - - X
24
+ * harvest-id X X X X X X X X -
25
+ * machine-alerts X X X X X X X X X
26
+ * machine-device-state-reports X X X X X - - - -
27
+ * machine-engine-hours X X X X X - - - -
28
+ * machine-hours-of-operation X X X X X - - - -
29
+ * machine-locations X X X X X X X X X
30
+ * map-layers X X X X X - - - -
31
+ * notifications X X X X X X X X X
32
+ * operators X X - X X - - - -
33
+ * organizations X X X X X X X X X
34
+ * partnerships X X X X X X X X X
35
+ * products X X X X X - - - X
36
+ * users X X X X X - - - -
37
+ * webhook X X X X X - - - X
38
+ *
39
+ * A dash (-) means the env is NOT supported for that spec. Calling a method
40
+ * on that API with that env throws UnsupportedEnvironmentError at request
41
+ * time, before any HTTP call — no silent cross-tier routing.
42
+ */
43
+ export const KNOWN_ENVIRONMENTS = [
44
+ 'api',
45
+ 'sandboxapi',
46
+ 'partnerapi',
47
+ 'apicert',
48
+ 'apiqa.tal',
49
+ 'partnerapicert',
50
+ 'partnerapiqa',
51
+ 'sandboxapiqa',
52
+ 'apidev.tal',
53
+ ];
54
+ /**
55
+ * Default environment for new DeereClient instances when config.environment
56
+ * is not specified. 'sandboxapi' is safe-by-default — never silently hits
57
+ * production data.
58
+ */
59
+ export const DEFAULT_ENVIRONMENT = 'sandboxapi';
60
+ // ============================================================================
61
+ // API_SERVERS — the resolver's lookup table, keyed by spec name
62
+ // ============================================================================
63
+ export const API_SERVERS = {
64
+ aemp: {
65
+ kind: 'static',
66
+ urlByEnvironment: {
67
+ api: 'https://partneraemp.deere.com',
68
+ partnerapi: 'https://partneraemp.deere.com',
69
+ sandboxapi: 'https://sandboxaemp.deere.com',
70
+ },
71
+ },
72
+ assets: {
73
+ kind: 'templated',
74
+ urlTemplate: 'https://{environment}.deere.com/platform',
75
+ supportedEnvironments: ['api', 'apicert', 'apiqa.tal', 'sandboxapi', 'partnerapi'],
76
+ },
77
+ boundaries: {
78
+ kind: 'templated',
79
+ urlTemplate: 'https://{environment}.deere.com/platform',
80
+ supportedEnvironments: [
81
+ 'api',
82
+ 'partnerapi',
83
+ 'sandboxapi',
84
+ 'apicert',
85
+ 'partnerapicert',
86
+ 'apiqa.tal',
87
+ 'partnerapiqa',
88
+ 'sandboxapiqa',
89
+ ],
90
+ },
91
+ clients: {
92
+ kind: 'templated',
93
+ urlTemplate: 'https://{environment}.deere.com/platform',
94
+ supportedEnvironments: ['api', 'apicert', 'apiqa.tal', 'sandboxapi', 'partnerapi'],
95
+ },
96
+ 'connection-management': {
97
+ kind: 'templated',
98
+ urlTemplate: 'https://{environment}.deere.com/platform',
99
+ supportedEnvironments: ['api', 'apicert', 'apiqa.tal', 'sandboxapi'],
100
+ },
101
+ 'crop-types': {
102
+ kind: 'templated',
103
+ urlTemplate: 'https://{environment}.deere.com/platform',
104
+ supportedEnvironments: [
105
+ 'api',
106
+ 'partnerapi',
107
+ 'sandboxapi',
108
+ 'apicert',
109
+ 'partnerapicert',
110
+ 'apiqa.tal',
111
+ 'partnerapiqa',
112
+ 'sandboxapiqa',
113
+ ],
114
+ },
115
+ 'equipment-measurement': {
116
+ kind: 'static',
117
+ urlByEnvironment: {
118
+ api: 'https://equipmentapi.deere.com/isg',
119
+ partnerapi: 'https://equipmentapi.deere.com/isg',
120
+ apicert: 'https://equipmentapi-cert.deere.com/isg',
121
+ partnerapicert: 'https://equipmentapi-cert.deere.com/isg',
122
+ 'apiqa.tal': 'https://equipmentapi-qual.deere.com/isg',
123
+ partnerapiqa: 'https://equipmentapi-qual.deere.com/isg',
124
+ sandboxapiqa: 'https://equipmentapi-qual.deere.com/isg',
125
+ },
126
+ },
127
+ equipment: {
128
+ kind: 'static',
129
+ urlByEnvironment: {
130
+ api: 'https://equipmentapi.deere.com/isg',
131
+ partnerapi: 'https://equipmentapi.deere.com/isg',
132
+ },
133
+ },
134
+ farms: {
135
+ kind: 'templated',
136
+ urlTemplate: 'https://{environment}.deere.com/platform',
137
+ supportedEnvironments: ['api', 'apicert', 'apiqa.tal', 'sandboxapi', 'partnerapi'],
138
+ },
139
+ 'field-operations-api': {
140
+ kind: 'templated',
141
+ urlTemplate: 'https://{environment}.deere.com/platform',
142
+ supportedEnvironments: [
143
+ 'api',
144
+ 'partnerapi',
145
+ 'sandboxapi',
146
+ 'apicert',
147
+ 'partnerapicert',
148
+ 'apiqa.tal',
149
+ 'partnerapiqa',
150
+ 'sandboxapiqa',
151
+ ],
152
+ },
153
+ fields: {
154
+ kind: 'templated',
155
+ urlTemplate: 'https://{environment}.deere.com/platform',
156
+ supportedEnvironments: ['api', 'apicert', 'apiqa.tal', 'sandboxapi', 'partnerapi'],
157
+ },
158
+ files: {
159
+ kind: 'templated',
160
+ urlTemplate: 'https://{environment}.deere.com/platform',
161
+ supportedEnvironments: [
162
+ 'api',
163
+ 'sandboxapi',
164
+ 'partnerapi',
165
+ 'apicert',
166
+ 'apiqa.tal',
167
+ 'apidev.tal',
168
+ 'partnerapicert',
169
+ 'partnerapiqa',
170
+ 'sandboxapiqa',
171
+ ],
172
+ },
173
+ flags: {
174
+ kind: 'templated',
175
+ urlTemplate: 'https://{environment}.deere.com/platform',
176
+ supportedEnvironments: [
177
+ 'api',
178
+ 'sandboxapi',
179
+ 'partnerapi',
180
+ 'apicert',
181
+ 'apiqa.tal',
182
+ 'apidev.tal',
183
+ 'partnerapicert',
184
+ 'partnerapiqa',
185
+ 'sandboxapiqa',
186
+ ],
187
+ },
188
+ 'guidance-lines': {
189
+ kind: 'templated',
190
+ urlTemplate: 'https://{environment}.deere.com/platform',
191
+ supportedEnvironments: [
192
+ 'partnerapi',
193
+ 'sandboxapi',
194
+ 'api',
195
+ 'apicert',
196
+ 'apiqa.tal',
197
+ 'apidev.tal',
198
+ ],
199
+ },
200
+ 'harvest-id': {
201
+ kind: 'templated',
202
+ urlTemplate: 'https://{environment}.deere.com/platform',
203
+ supportedEnvironments: [
204
+ 'api',
205
+ 'partnerapi',
206
+ 'sandboxapi',
207
+ 'apicert',
208
+ 'partnerapicert',
209
+ 'apiqa.tal',
210
+ 'partnerapiqa',
211
+ 'sandboxapiqa',
212
+ ],
213
+ },
214
+ 'machine-alerts': {
215
+ kind: 'templated',
216
+ urlTemplate: 'https://{environment}.deere.com/platform',
217
+ supportedEnvironments: [
218
+ 'api',
219
+ 'sandboxapi',
220
+ 'partnerapi',
221
+ 'apicert',
222
+ 'apiqa.tal',
223
+ 'apidev.tal',
224
+ 'partnerapicert',
225
+ 'partnerapiqa',
226
+ 'sandboxapiqa',
227
+ ],
228
+ },
229
+ 'machine-device-state-reports': {
230
+ kind: 'templated',
231
+ urlTemplate: 'https://{environment}.deere.com/platform',
232
+ supportedEnvironments: ['api', 'apicert', 'apiqa.tal', 'sandboxapi', 'partnerapi'],
233
+ },
234
+ 'machine-engine-hours': {
235
+ kind: 'templated',
236
+ urlTemplate: 'https://{environment}.deere.com/platform',
237
+ supportedEnvironments: ['api', 'apicert', 'apiqa.tal', 'sandboxapi', 'partnerapi'],
238
+ },
239
+ 'machine-hours-of-operation': {
240
+ kind: 'templated',
241
+ urlTemplate: 'https://{environment}.deere.com/platform',
242
+ supportedEnvironments: ['api', 'apicert', 'apiqa.tal', 'sandboxapi', 'partnerapi'],
243
+ },
244
+ 'machine-locations': {
245
+ kind: 'templated',
246
+ urlTemplate: 'https://{environment}.deere.com/platform',
247
+ supportedEnvironments: [
248
+ 'api',
249
+ 'sandboxapi',
250
+ 'partnerapi',
251
+ 'apicert',
252
+ 'apiqa.tal',
253
+ 'apidev.tal',
254
+ 'partnerapicert',
255
+ 'partnerapiqa',
256
+ 'sandboxapiqa',
257
+ ],
258
+ },
259
+ 'map-layers': {
260
+ kind: 'templated',
261
+ urlTemplate: 'https://{environment}.deere.com/platform',
262
+ supportedEnvironments: ['api', 'apicert', 'apiqa.tal', 'sandboxapi', 'partnerapi'],
263
+ },
264
+ notifications: {
265
+ kind: 'templated',
266
+ urlTemplate: 'https://{environment}.deere.com/platform',
267
+ supportedEnvironments: [
268
+ 'api',
269
+ 'sandboxapi',
270
+ 'partnerapi',
271
+ 'apicert',
272
+ 'apiqa.tal',
273
+ 'apidev.tal',
274
+ 'partnerapicert',
275
+ 'partnerapiqa',
276
+ 'sandboxapiqa',
277
+ ],
278
+ },
279
+ operators: {
280
+ kind: 'templated',
281
+ urlTemplate: 'https://{environment}.deere.com/platform',
282
+ supportedEnvironments: ['api', 'apicert', 'apiqa.tal', 'sandboxapi'],
283
+ },
284
+ organizations: {
285
+ kind: 'templated',
286
+ urlTemplate: 'https://{environment}.deere.com/platform',
287
+ supportedEnvironments: [
288
+ 'api',
289
+ 'sandboxapi',
290
+ 'partnerapi',
291
+ 'apicert',
292
+ 'apiqa.tal',
293
+ 'apidev.tal',
294
+ 'partnerapicert',
295
+ 'partnerapiqa',
296
+ 'sandboxapiqa',
297
+ ],
298
+ },
299
+ partnerships: {
300
+ kind: 'templated',
301
+ urlTemplate: 'https://{environment}.deere.com/platform',
302
+ supportedEnvironments: [
303
+ 'api',
304
+ 'sandboxapi',
305
+ 'partnerapi',
306
+ 'apicert',
307
+ 'apiqa.tal',
308
+ 'apidev.tal',
309
+ 'partnerapicert',
310
+ 'partnerapiqa',
311
+ 'sandboxapiqa',
312
+ ],
313
+ },
314
+ products: {
315
+ kind: 'templated',
316
+ urlTemplate: 'https://{environment}.deere.com/platform',
317
+ supportedEnvironments: [
318
+ 'partnerapi',
319
+ 'sandboxapi',
320
+ 'api',
321
+ 'apicert',
322
+ 'apiqa.tal',
323
+ 'apidev.tal',
324
+ ],
325
+ },
326
+ users: {
327
+ kind: 'templated',
328
+ urlTemplate: 'https://{environment}.deere.com/platform',
329
+ supportedEnvironments: ['api', 'apicert', 'apiqa.tal', 'sandboxapi', 'partnerapi'],
330
+ },
331
+ webhook: {
332
+ kind: 'templated',
333
+ urlTemplate: 'https://{environment}.deere.com/platform',
334
+ supportedEnvironments: [
335
+ 'api',
336
+ 'apicert',
337
+ 'apiqa.tal',
338
+ 'apidev.tal',
339
+ 'sandboxapi',
340
+ 'partnerapi',
341
+ ],
342
+ },
343
+ };
344
+ //# sourceMappingURL=api-servers.generated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-servers.generated.js","sourceRoot":"","sources":["../src/api-servers.generated.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAqDH,MAAM,CAAC,MAAM,kBAAkB,GAA2B;IACxD,KAAK;IACL,YAAY;IACZ,YAAY;IACZ,SAAS;IACT,WAAW;IACX,gBAAgB;IAChB,cAAc;IACd,cAAc;IACd,YAAY;CACJ,CAAC;AAEX;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAgB,YAAY,CAAC;AA6B7D,+EAA+E;AAC/E,gEAAgE;AAChE,+EAA+E;AAE/E,MAAM,CAAC,MAAM,WAAW,GAAuC;IAC7D,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,gBAAgB,EAAE;YAChB,GAAG,EAAE,+BAA+B;YACpC,UAAU,EAAE,+BAA+B;YAC3C,UAAU,EAAE,+BAA+B;SAC5C;KACF;IACD,MAAM,EAAE;QACN,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,0CAA0C;QACvD,qBAAqB,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,CAAC;KACnF;IACD,UAAU,EAAE;QACV,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,0CAA0C;QACvD,qBAAqB,EAAE;YACrB,KAAK;YACL,YAAY;YACZ,YAAY;YACZ,SAAS;YACT,gBAAgB;YAChB,WAAW;YACX,cAAc;YACd,cAAc;SACf;KACF;IACD,OAAO,EAAE;QACP,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,0CAA0C;QACvD,qBAAqB,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,CAAC;KACnF;IACD,uBAAuB,EAAE;QACvB,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,0CAA0C;QACvD,q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,gBAAgB;YAChB,cAAc;YACd,cAAc;SACf;KACF;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,0CAA0C;QACvD,qBAAqB,EAAE;YACrB,YAAY;YACZ,YAAY;YACZ,KAAK;YACL,SAAS;YACT,WAAW;YACX,YAAY;SACb;KACF;IACD,KAAK,EAAE;QACL,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,0CAA0C;QACvD,qBAAqB,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,CAAC;KACnF;IACD,OAAO,EAAE;QACP,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,0CAA0C;QACvD,qBAAqB,EAAE;YACrB,KAAK;YACL,SAAS;YACT,WAAW;YACX,YAAY;YACZ,YAAY;YACZ,YAAY;SACb;KACF;CACF,CAAC"}
package/dist/client.d.ts CHANGED
@@ -2,16 +2,49 @@
2
2
  * John Deere API Client
3
3
  *
4
4
  * Unofficial TypeScript SDK for John Deere Operations Center API.
5
- * Provides typed access to all John Deere agricultural APIs.
5
+ *
6
+ * URL resolution flow (v2.0):
7
+ *
8
+ * User code
9
+ * │
10
+ * ▼
11
+ * deere.equipmentMeasurement.post(params)
12
+ * │
13
+ * ▼
14
+ * this.client.post('equipment-measurement', '/orgs/.../measurements', data, options)
15
+ * │
16
+ * ▼
17
+ * DeereClient.post()
18
+ * ├─ resolveRequestUrl(spec, path, this.environment)
19
+ * │ ├─ API_SERVERS[spec] lookup
20
+ * │ ├─ templated → urlTemplate.replace('{environment}', env)
21
+ * │ ├─ static → urlByEnvironment[env] (throws UnsupportedEnvironmentError if missing)
22
+ * │ └─ unavailable → throws NoServerConfigError
23
+ * └─ requestUrl('POST', url, body, options)
24
+ * └─ fetch(url, ...) with retry + timeout
25
+ *
26
+ * Absolute URLs bypass the resolver via fetchUrl() — used for HATEOAS next-page
27
+ * links and power-user escape hatches. fetchUrl attaches the Bearer token ONLY
28
+ * to *.deere.com hosts; third-party URLs get no Authorization header.
29
+ *
30
+ * URL data lives in src/api-servers.generated.ts, built from OpenAPI specs at
31
+ * build time by scripts/generate-api-servers.ts. Never hand-edit that file.
6
32
  */
7
- export type Environment = 'production' | 'sandbox' | 'partner' | 'cert' | 'qa';
33
+ import { type Environment, type SpecName } from './api-servers.generated.js';
34
+ export type { Environment, SpecName };
8
35
  export interface DeereClientConfig {
9
36
  /** OAuth access token */
10
37
  accessToken: string;
11
- /** API environment. Defaults to 'sandbox' */
38
+ /**
39
+ * API environment — uses raw JD subdomain names. Defaults to 'sandboxapi'.
40
+ *
41
+ * Valid values: 'api' | 'sandboxapi' | 'partnerapi' | 'apicert' | 'apiqa.tal'
42
+ * | 'partnerapicert' | 'partnerapiqa' | 'sandboxapiqa' | 'apidev.tal'
43
+ *
44
+ * Migration from v1: 'production' → 'api', 'sandbox' → 'sandboxapi',
45
+ * 'partner' → 'partnerapi', 'cert' → 'apicert', 'qa' → 'apiqa.tal'.
46
+ */
12
47
  environment?: Environment;
13
- /** Custom base URL (overrides environment) */
14
- baseUrl?: string;
15
48
  /** Custom fetch implementation */
16
49
  fetch?: typeof fetch;
17
50
  /** Default headers to include in all requests */
@@ -56,24 +89,8 @@ export interface Link {
56
89
  rel: string;
57
90
  uri: string;
58
91
  }
59
- export declare class DeereError extends Error {
60
- readonly status: number;
61
- readonly statusText: string;
62
- readonly body?: unknown | undefined;
63
- constructor(message: string, status: number, statusText: string, body?: unknown | undefined);
64
- }
65
- export declare class RateLimitError extends DeereError {
66
- readonly retryAfter?: number | undefined;
67
- constructor(message: string, status: number, statusText: string, retryAfter?: number | undefined, body?: unknown);
68
- }
69
- export declare class AuthError extends DeereError {
70
- constructor(message: string, status: number, statusText: string, body?: unknown);
71
- }
72
- export declare class HateoasError extends Error {
73
- readonly path: string;
74
- readonly cause?: Error | undefined;
75
- constructor(message: string, path: string, cause?: Error | undefined);
76
- }
92
+ import { AuthError, DeereError, HateoasError, RateLimitError } from './errors.js';
93
+ export { AuthError, DeereError, HateoasError, RateLimitError };
77
94
  /**
78
95
  * John Deere API Client
79
96
  *
@@ -81,11 +98,12 @@ export declare class HateoasError extends Error {
81
98
  * ```typescript
82
99
  * const client = new DeereClient({
83
100
  * accessToken: 'your-token',
84
- * environment: 'sandbox',
101
+ * environment: 'sandboxapi', // v2: raw JD subdomain, not 'sandbox'
85
102
  * maxRetries: 3, // Retries with exponential backoff (default: 3)
86
103
  * });
87
104
  *
88
- * const orgs = await client.get('/organizations');
105
+ * // v2: first arg is the spec name (generated classes do this for you)
106
+ * const orgs = await client.get('organizations', '/organizations');
89
107
  * ```
90
108
  *
91
109
  * @remarks
@@ -95,7 +113,7 @@ export declare class HateoasError extends Error {
95
113
  * Set `maxRetries: 0` to disable automatic retries.
96
114
  */
97
115
  export declare class DeereClient {
98
- private readonly baseUrl;
116
+ private readonly environment;
99
117
  private readonly accessToken;
100
118
  private readonly fetchFn;
101
119
  private readonly defaultHeaders;
@@ -106,37 +124,58 @@ export declare class DeereClient {
106
124
  private readonly linkCache;
107
125
  constructor(config: DeereClientConfig);
108
126
  /**
109
- * Make a GET request to the John Deere API
127
+ * Validates the environment string from config. Throws at construction
128
+ * time with a migration hint if the user passed a v1 friendly name or an
129
+ * unknown string — catches errors immediately instead of at first request.
130
+ */
131
+ private validateEnvironment;
132
+ /**
133
+ * GET request, spec-aware. Generated API classes call this with their own
134
+ * `spec` as the first argument — consumers don't normally call it directly.
135
+ */
136
+ get<T = unknown>(specName: SpecName, path: string, options?: RequestOptions): Promise<T>;
137
+ /**
138
+ * POST request, spec-aware.
110
139
  */
111
- get<T = unknown>(path: string, options?: RequestOptions): Promise<T>;
140
+ post<T = unknown>(specName: SpecName, path: string, body?: unknown, options?: RequestOptions): Promise<T>;
112
141
  /**
113
- * Make a POST request to the John Deere API
142
+ * PUT request, spec-aware.
114
143
  */
115
- post<T = unknown>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
144
+ put<T = unknown>(specName: SpecName, path: string, body?: unknown, options?: RequestOptions): Promise<T>;
116
145
  /**
117
- * Make a PUT request to the John Deere API
146
+ * DELETE request, spec-aware.
118
147
  */
119
- put<T = unknown>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
148
+ delete<T = unknown>(specName: SpecName, path: string, options?: RequestOptions): Promise<T>;
120
149
  /**
121
- * Make a DELETE request to the John Deere API
150
+ * PATCH request, spec-aware.
122
151
  */
123
- delete<T = unknown>(path: string, options?: RequestOptions): Promise<T>;
152
+ patch<T = unknown>(specName: SpecName, path: string, body?: unknown, options?: RequestOptions): Promise<T>;
124
153
  /**
125
- * Make a PATCH request to the John Deere API
154
+ * Fetch an absolute URL directly. Escape hatch for HATEOAS next-page links,
155
+ * HAL link traversal, and power users with pre-resolved URLs.
156
+ *
157
+ * **Security**: Attaches the Bearer token ONLY when the target hostname
158
+ * matches a trusted `*.deere.com` origin. Third-party URLs get NO
159
+ * Authorization header — prevents accidental token leakage to tracking or
160
+ * proxy services. If you need to send auth to a non-JD host, set
161
+ * `Authorization` explicitly via `options.headers`.
126
162
  */
127
- patch<T = unknown>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
163
+ fetchUrl<T = unknown>(method: string, url: string, body?: unknown, options?: RequestOptions): Promise<T>;
128
164
  /**
129
- * Follow a HAL link from a response
165
+ * Follow a HAL link from a response. Accepts a Link object or a raw URL
166
+ * string. Delegates to fetchUrl() so the trusted-host check applies.
130
167
  */
131
168
  followLink<T = unknown>(link: Link | string, options?: RequestOptions): Promise<T>;
132
169
  /**
133
- * Paginate through all results following nextPage links
170
+ * Paginate through all results following nextPage links. First page is
171
+ * resolved via the spec's URL config; subsequent pages use the absolute
172
+ * URLs returned by the API in `response.links`.
134
173
  */
135
- paginate<T>(path: string, options?: RequestOptions): AsyncGenerator<T[], void, unknown>;
174
+ paginate<T>(specName: SpecName, path: string, options?: RequestOptions): AsyncGenerator<T[], void, unknown>;
136
175
  /**
137
- * Get all items from a paginated endpoint
176
+ * Get all items from a paginated endpoint, spec-aware.
138
177
  */
139
- getAll<T>(path: string, options?: RequestOptions): Promise<T[]>;
178
+ getAll<T>(specName: SpecName, path: string, options?: RequestOptions): Promise<T[]>;
140
179
  private request;
141
180
  private requestUrl;
142
181
  /**
@@ -146,18 +185,27 @@ export declare class DeereClient {
146
185
  /**
147
186
  * Pre-fetch parent resources to warm the HATEOAS link cache.
148
187
  * Reduces latency for subsequent HATEOAS-resolved requests.
149
- * @param paths - Parent resource paths to pre-fetch (defaults to common roots)
188
+ *
189
+ * @param specName - Spec that owns the paths (e.g. 'organizations')
190
+ * @param paths - Parent resource paths to pre-fetch (defaults to '/organizations')
150
191
  */
151
- warmLinkCache(paths?: string[]): Promise<void>;
192
+ warmLinkCache(specName: SpecName, paths?: string[]): Promise<void>;
152
193
  /**
153
194
  * Match a concrete path against the HATEOAS route map.
154
- * Returns the concrete parent path and rel name, or null if no match.
195
+ * Returns the concrete parent path, rel name, and optional parentSpec
196
+ * (which spec owns the parent resource — used for cross-spec HATEOAS).
197
+ * Returns null if no map entry matches.
155
198
  */
156
199
  private matchHateoasPattern;
157
200
  /**
158
- * Resolve a path via HATEOAS link traversal.
159
- * Fetches the parent resource, finds the matching link rel, and returns the discovered URL.
160
- * Throws HateoasError if resolution fails (strict mode).
201
+ * Resolve a path via HATEOAS link traversal, spec-aware.
202
+ *
203
+ * Fetches the parent resource (via the parent's own spec host, not the
204
+ * child's — critical for cross-spec flows like equipment.yaml's org-scoped
205
+ * endpoints whose parent `/organizations/{orgId}` lives on the platform
206
+ * host, not equipmentapi.deere.com/isg).
207
+ *
208
+ * Throws HateoasError if resolution fails.
161
209
  */
162
210
  private resolveHateoasUrl;
163
211
  /**