masterypath-sdk 0.0.13 → 0.1.2

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 (75) hide show
  1. package/dist/MasterypathSDK.d.ts +8 -8
  2. package/dist/MasterypathSDK.js +8 -8
  3. package/dist/cli/cli.d.ts +1 -1
  4. package/dist/cli/cli.d.ts.map +1 -1
  5. package/dist/cli/cli.js +1 -1
  6. package/dist/cli/cli.js.map +1 -1
  7. package/dist/cli/commands/chat.d.ts.map +1 -1
  8. package/dist/cli/commands/chat.js +10 -5
  9. package/dist/cli/commands/chat.js.map +1 -1
  10. package/dist/cli/commands/organizations.d.ts.map +1 -1
  11. package/dist/cli/commands/organizations.js +9 -70
  12. package/dist/cli/commands/organizations.js.map +1 -1
  13. package/dist/cli/commands/uploads.d.ts +2 -2
  14. package/dist/cli/commands/uploads.d.ts.map +1 -1
  15. package/dist/cli/commands/uploads.js +8 -8
  16. package/dist/cli/commands/uploads.js.map +1 -1
  17. package/dist/cli/output.d.ts.map +1 -1
  18. package/dist/cli/output.js +15 -13
  19. package/dist/cli/output.js.map +1 -1
  20. package/dist/domains/chat/ChatClient.d.ts +8 -8
  21. package/dist/domains/chat/ChatClient.d.ts.map +1 -1
  22. package/dist/domains/chat/ChatClient.js +24 -16
  23. package/dist/domains/chat/ChatClient.js.map +1 -1
  24. package/dist/domains/chat/types.d.ts +6 -0
  25. package/dist/domains/chat/types.d.ts.map +1 -1
  26. package/dist/domains/containers/ContainersClient.d.ts +187 -63
  27. package/dist/domains/containers/ContainersClient.js +542 -376
  28. package/dist/domains/index.d.ts +9 -9
  29. package/dist/domains/index.d.ts.map +1 -1
  30. package/dist/domains/index.js +5 -5
  31. package/dist/domains/listings/ListingsClient.d.ts +35 -12
  32. package/dist/domains/listings/ListingsClient.js +100 -84
  33. package/dist/domains/merchants/MerchantsClient.d.ts +124 -31
  34. package/dist/domains/merchants/MerchantsClient.js +420 -303
  35. package/dist/domains/mindmaps/MindmapsClient.d.ts +6 -6
  36. package/dist/domains/mindmaps/MindmapsClient.d.ts.map +1 -1
  37. package/dist/domains/mindmaps/MindmapsClient.js +12 -13
  38. package/dist/domains/mindmaps/MindmapsClient.js.map +1 -1
  39. package/dist/domains/mindmaps/types.d.ts.map +1 -1
  40. package/dist/domains/orders/OrdersClient.d.ts +327 -94
  41. package/dist/domains/orders/OrdersClient.js +934 -662
  42. package/dist/domains/orders/types.d.ts +45 -36
  43. package/dist/domains/orders/types.js +1 -1
  44. package/dist/domains/organizations/OrganizationsClient.d.ts +8 -5
  45. package/dist/domains/organizations/OrganizationsClient.d.ts.map +1 -1
  46. package/dist/domains/organizations/OrganizationsClient.js +21 -30
  47. package/dist/domains/organizations/OrganizationsClient.js.map +1 -1
  48. package/dist/domains/plants/PlantsClient.d.ts +43 -28
  49. package/dist/domains/plants/PlantsClient.js +51 -47
  50. package/dist/domains/products/ProductsClient.d.ts +34 -12
  51. package/dist/domains/products/ProductsClient.js +94 -83
  52. package/dist/domains/public-api/PublicApiClient.d.ts +22 -0
  53. package/dist/domains/public-api/PublicApiClient.d.ts.map +1 -1
  54. package/dist/domains/public-api/PublicApiClient.js +51 -0
  55. package/dist/domains/public-api/PublicApiClient.js.map +1 -1
  56. package/dist/domains/uploads/UploadsClient.d.ts.map +1 -1
  57. package/dist/domains/uploads/UploadsClient.js +1 -3
  58. package/dist/domains/uploads/UploadsClient.js.map +1 -1
  59. package/dist/domains/usdazones/UsdazonesClient.d.ts +6 -6
  60. package/dist/domains/usdazones/UsdazonesClient.js +15 -15
  61. package/dist/domains/users/UsersClient.d.ts +4 -4
  62. package/dist/domains/users/UsersClient.d.ts.map +1 -1
  63. package/dist/domains/users/UsersClient.js +24 -22
  64. package/dist/domains/users/UsersClient.js.map +1 -1
  65. package/dist/generated/graphql.d.ts +1172 -1079
  66. package/dist/generated/graphql.d.ts.map +1 -1
  67. package/dist/generated/graphql.js +5622 -84
  68. package/dist/generated/graphql.js.map +1 -1
  69. package/dist/index.d.ts +4 -4
  70. package/dist/index.d.ts.map +1 -1
  71. package/dist/index.js +3 -3
  72. package/dist/index.js.map +1 -1
  73. package/dist/shared/fulfillmentWindows.js +4 -4
  74. package/dist/utils/errors.js +3 -3
  75. package/package.json +1 -1
@@ -1,404 +1,570 @@
1
- import { print } from 'graphql';
2
- import { CreateContainerDocument, CreateContainerAndIterationDocument, UpdateRectangularContainerDocument, UpdateCircularContainerDocument, DeleteContainerDocument, GetContainerDocument, GetContainersDocument, GetContainersWithCurrentIterationDocument, CreateIterationDocument, UpdateIterationDocument, DeleteIterationDocument, AddPlantToIterationDocument, UpdatePlantQtyInIterationDocument, RemovePlantFromIterationDocument, RotateContainerDocument, CreateSoilTestDocument, ListSoilTestsByContainerDocument, ListSoilTestsByIterationDocument, DeleteSoilTestDocument, CreateContainerLogDocument, GetContainerLogsDocument, UpdateContainerLogDocument, CreateTaskDocument, UpdateTaskDocument, DeleteTaskDocument, ListTasksDocument, ListAllUserTasksDocument, ListIterationPlantsDocument, } from '../../generated/graphql';
1
+ import { print } from "graphql";
2
+ import {
3
+ CreateContainerDocument,
4
+ CreateContainerAndIterationDocument,
5
+ UpdateRectangularContainerDocument,
6
+ UpdateCircularContainerDocument,
7
+ DeleteContainerDocument,
8
+ GetContainerDocument,
9
+ GetContainersDocument,
10
+ GetContainersWithCurrentIterationDocument,
11
+ CreateIterationDocument,
12
+ UpdateIterationDocument,
13
+ DeleteIterationDocument,
14
+ AddPlantToIterationDocument,
15
+ UpdatePlantQtyInIterationDocument,
16
+ RemovePlantFromIterationDocument,
17
+ RotateContainerDocument,
18
+ CreateSoilTestDocument,
19
+ ListSoilTestsByContainerDocument,
20
+ ListSoilTestsByIterationDocument,
21
+ DeleteSoilTestDocument,
22
+ CreateContainerLogDocument,
23
+ GetContainerLogsDocument,
24
+ UpdateContainerLogDocument,
25
+ CreateTaskDocument,
26
+ UpdateTaskDocument,
27
+ DeleteTaskDocument,
28
+ ListTasksDocument,
29
+ ListAllUserTasksDocument,
30
+ ListIterationPlantsDocument,
31
+ } from "../../generated/graphql";
3
32
  export class ContainersClient {
4
- constructor(httpClient) {
5
- this.httpClient = httpClient;
33
+ constructor(httpClient) {
34
+ this.httpClient = httpClient;
35
+ }
36
+ async createContainer(
37
+ name,
38
+ kind,
39
+ length,
40
+ width,
41
+ diameter,
42
+ locationId,
43
+ merchantId,
44
+ ) {
45
+ const response = await this.httpClient.request(
46
+ "/graphql-containers",
47
+ {
48
+ query: print(CreateContainerDocument),
49
+ variables: {
50
+ name,
51
+ kind,
52
+ length,
53
+ width,
54
+ diameter,
55
+ locationId,
56
+ },
57
+ },
58
+ merchantId,
59
+ );
60
+ if (!response.data?.createContainer) {
61
+ throw new Error("Failed to create container: No data returned");
6
62
  }
7
- async createContainer(name, kind, length, width, diameter, locationId, merchantId) {
8
- const response = await this.httpClient.request('/graphql-containers', {
9
- query: print(CreateContainerDocument),
10
- variables: {
11
- name,
12
- kind,
13
- length,
14
- width,
15
- diameter,
16
- locationId,
17
- },
18
- }, merchantId);
19
- if (!response.data?.createContainer) {
20
- throw new Error('Failed to create container: No data returned');
21
- }
22
- return response.data.createContainer;
63
+ return response.data.createContainer;
64
+ }
65
+ async createContainerAndIteration(
66
+ name,
67
+ kind,
68
+ iterationName,
69
+ startDate,
70
+ length,
71
+ width,
72
+ diameter,
73
+ locationId,
74
+ merchantId,
75
+ ) {
76
+ const response = await this.httpClient.request(
77
+ "/graphql-containers",
78
+ {
79
+ query: print(CreateContainerAndIterationDocument),
80
+ variables: {
81
+ name,
82
+ kind,
83
+ iterationName,
84
+ startDate,
85
+ length,
86
+ width,
87
+ diameter,
88
+ locationId,
89
+ },
90
+ },
91
+ merchantId,
92
+ );
93
+ if (!response.data?.createContainerAndIteration) {
94
+ throw new Error(
95
+ "Failed to create container and iteration: No data returned",
96
+ );
23
97
  }
24
- async createContainerAndIteration(name, kind, iterationName, startDate, length, width, diameter, locationId, merchantId) {
25
- const response = await this.httpClient.request('/graphql-containers', {
26
- query: print(CreateContainerAndIterationDocument),
27
- variables: {
28
- name,
29
- kind,
30
- iterationName,
31
- startDate,
32
- length,
33
- width,
34
- diameter,
35
- locationId,
36
- },
37
- }, merchantId);
38
- if (!response.data?.createContainerAndIteration) {
39
- throw new Error('Failed to create container and iteration: No data returned');
40
- }
41
- return response.data.createContainerAndIteration;
98
+ return response.data.createContainerAndIteration;
99
+ }
100
+ async updateContainer(
101
+ id,
102
+ name,
103
+ kind,
104
+ length,
105
+ width,
106
+ diameter,
107
+ locationId,
108
+ merchantId,
109
+ ) {
110
+ if (diameter !== undefined && length === undefined && width === undefined) {
111
+ const response = await this.httpClient.request(
112
+ "/graphql-containers",
113
+ {
114
+ query: print(UpdateCircularContainerDocument),
115
+ variables: {
116
+ id,
117
+ name,
118
+ kind,
119
+ diameter,
120
+ locationId,
121
+ },
122
+ },
123
+ merchantId,
124
+ );
125
+ if (!response.data?.updateContainer) {
126
+ throw new Error("Failed to update container: No data returned");
127
+ }
128
+ return response.data.updateContainer;
129
+ } else {
130
+ const response = await this.httpClient.request(
131
+ "/graphql-containers",
132
+ {
133
+ query: print(UpdateRectangularContainerDocument),
134
+ variables: {
135
+ id,
136
+ name,
137
+ kind,
138
+ length,
139
+ width,
140
+ locationId,
141
+ },
142
+ },
143
+ merchantId,
144
+ );
145
+ if (!response.data?.updateContainer) {
146
+ throw new Error("Failed to update container: No data returned");
147
+ }
148
+ return response.data.updateContainer;
42
149
  }
43
- async updateContainer(id, name, kind, length, width, diameter, locationId, merchantId) {
44
- if (diameter !== undefined && length === undefined && width === undefined) {
45
- const response = await this.httpClient.request('/graphql-containers', {
46
- query: print(UpdateCircularContainerDocument),
47
- variables: {
48
- id,
49
- name,
50
- kind,
51
- diameter,
52
- locationId,
53
- },
54
- }, merchantId);
55
- if (!response.data?.updateContainer) {
56
- throw new Error('Failed to update container: No data returned');
57
- }
58
- return response.data.updateContainer;
59
- }
60
- else {
61
- const response = await this.httpClient.request('/graphql-containers', {
62
- query: print(UpdateRectangularContainerDocument),
63
- variables: {
64
- id,
65
- name,
66
- kind,
67
- length,
68
- width,
69
- locationId,
70
- },
71
- }, merchantId);
72
- if (!response.data?.updateContainer) {
73
- throw new Error('Failed to update container: No data returned');
74
- }
75
- return response.data.updateContainer;
76
- }
150
+ }
151
+ async deleteContainer(id, merchantId) {
152
+ const response = await this.httpClient.request(
153
+ "/graphql-containers",
154
+ {
155
+ query: print(DeleteContainerDocument),
156
+ variables: {
157
+ id,
158
+ },
159
+ },
160
+ merchantId,
161
+ );
162
+ if (
163
+ response.data?.deleteContainer === undefined ||
164
+ response.data.deleteContainer === null
165
+ ) {
166
+ throw new Error("Failed to delete container: No data returned");
77
167
  }
78
- async deleteContainer(id, merchantId) {
79
- const response = await this.httpClient.request('/graphql-containers', {
80
- query: print(DeleteContainerDocument),
81
- variables: {
82
- id,
83
- },
84
- }, merchantId);
85
- if (response.data?.deleteContainer === undefined || response.data.deleteContainer === null) {
86
- throw new Error('Failed to delete container: No data returned');
87
- }
88
- return response.data.deleteContainer;
168
+ return response.data.deleteContainer;
169
+ }
170
+ async getContainer(id, merchantId) {
171
+ const response = await this.httpClient.request(
172
+ "/graphql-containers",
173
+ {
174
+ query: print(GetContainerDocument),
175
+ variables: {
176
+ id,
177
+ },
178
+ },
179
+ merchantId,
180
+ );
181
+ return response.data?.getContainer ?? null;
182
+ }
183
+ async getAllContainers(merchantId) {
184
+ const response = await this.httpClient.request(
185
+ "/graphql-containers",
186
+ {
187
+ query: print(GetContainersDocument),
188
+ variables: {},
189
+ },
190
+ merchantId,
191
+ );
192
+ if (!response.data?.getAllContainers) {
193
+ throw new Error("Failed to get containers: No data returned");
89
194
  }
90
- async getContainer(id, merchantId) {
91
- const response = await this.httpClient.request('/graphql-containers', {
92
- query: print(GetContainerDocument),
93
- variables: {
94
- id,
95
- },
96
- }, merchantId);
97
- return response.data?.getContainer ?? null;
195
+ return response.data.getAllContainers;
196
+ }
197
+ async listContainersWithCurrentIteration(merchantId) {
198
+ const response = await this.httpClient.request(
199
+ "/graphql-containers",
200
+ {
201
+ query: print(GetContainersWithCurrentIterationDocument),
202
+ variables: {},
203
+ },
204
+ merchantId,
205
+ );
206
+ if (!response.data?.listContainersWithCurrentIteration) {
207
+ throw new Error(
208
+ "Failed to list containers with current iteration: No data returned",
209
+ );
98
210
  }
99
- async getAllContainers(merchantId) {
100
- const response = await this.httpClient.request('/graphql-containers', {
101
- query: print(GetContainersDocument),
102
- variables: {},
103
- }, merchantId);
104
- if (!response.data?.getAllContainers) {
105
- throw new Error('Failed to get containers: No data returned');
106
- }
107
- return response.data.getAllContainers;
211
+ return response.data.listContainersWithCurrentIteration;
212
+ }
213
+ async createIteration(containerId, startDate, name, phase, note, endDate) {
214
+ const response = await this.httpClient.request("/graphql-containers", {
215
+ query: print(CreateIterationDocument),
216
+ variables: {
217
+ containerId,
218
+ startDate,
219
+ name,
220
+ phase,
221
+ note,
222
+ endDate,
223
+ },
224
+ });
225
+ if (!response.data?.createIteration) {
226
+ throw new Error("Failed to create iteration: No data returned");
108
227
  }
109
- async listContainersWithCurrentIteration(merchantId) {
110
- const response = await this.httpClient.request('/graphql-containers', {
111
- query: print(GetContainersWithCurrentIterationDocument),
112
- variables: {},
113
- }, merchantId);
114
- if (!response.data?.listContainersWithCurrentIteration) {
115
- throw new Error('Failed to list containers with current iteration: No data returned');
116
- }
117
- return response.data.listContainersWithCurrentIteration;
228
+ return response.data.createIteration;
229
+ }
230
+ async updateIteration(id, name, phase, note, endDate) {
231
+ const response = await this.httpClient.request("/graphql-containers", {
232
+ query: print(UpdateIterationDocument),
233
+ variables: {
234
+ id,
235
+ name,
236
+ phase,
237
+ note,
238
+ endDate,
239
+ },
240
+ });
241
+ if (!response.data?.updateIteration) {
242
+ throw new Error("Failed to update iteration: No data returned");
118
243
  }
119
- async createIteration(containerId, startDate, name, phase, note, endDate) {
120
- const response = await this.httpClient.request('/graphql-containers', {
121
- query: print(CreateIterationDocument),
122
- variables: {
123
- containerId,
124
- startDate,
125
- name,
126
- phase,
127
- note,
128
- endDate,
129
- },
130
- });
131
- if (!response.data?.createIteration) {
132
- throw new Error('Failed to create iteration: No data returned');
133
- }
134
- return response.data.createIteration;
244
+ return response.data.updateIteration;
245
+ }
246
+ async deleteIteration(id) {
247
+ const response = await this.httpClient.request("/graphql-containers", {
248
+ query: print(DeleteIterationDocument),
249
+ variables: {
250
+ id,
251
+ },
252
+ });
253
+ if (
254
+ response.data?.deleteIteration === undefined ||
255
+ response.data.deleteIteration === null
256
+ ) {
257
+ throw new Error("Failed to delete iteration: No data returned");
135
258
  }
136
- async updateIteration(id, name, phase, note, endDate) {
137
- const response = await this.httpClient.request('/graphql-containers', {
138
- query: print(UpdateIterationDocument),
139
- variables: {
140
- id,
141
- name,
142
- phase,
143
- note,
144
- endDate,
145
- },
146
- });
147
- if (!response.data?.updateIteration) {
148
- throw new Error('Failed to update iteration: No data returned');
149
- }
150
- return response.data.updateIteration;
259
+ return response.data.deleteIteration;
260
+ }
261
+ async addPlantToIteration(iterationId, plantId, qty) {
262
+ const response = await this.httpClient.request("/graphql-containers", {
263
+ query: print(AddPlantToIterationDocument),
264
+ variables: {
265
+ iterationId,
266
+ plantId,
267
+ qty,
268
+ },
269
+ });
270
+ if (
271
+ response.data?.addPlantToIteration === undefined ||
272
+ response.data.addPlantToIteration === null
273
+ ) {
274
+ throw new Error("Failed to add plant to iteration: No data returned");
151
275
  }
152
- async deleteIteration(id) {
153
- const response = await this.httpClient.request('/graphql-containers', {
154
- query: print(DeleteIterationDocument),
155
- variables: {
156
- id,
157
- },
158
- });
159
- if (response.data?.deleteIteration === undefined || response.data.deleteIteration === null) {
160
- throw new Error('Failed to delete iteration: No data returned');
161
- }
162
- return response.data.deleteIteration;
276
+ return response.data.addPlantToIteration;
277
+ }
278
+ async updatePlantQtyInIteration(iterationId, plantId, qty) {
279
+ const response = await this.httpClient.request("/graphql-containers", {
280
+ query: print(UpdatePlantQtyInIterationDocument),
281
+ variables: {
282
+ iterationId,
283
+ plantId,
284
+ qty,
285
+ },
286
+ });
287
+ if (
288
+ response.data?.updatePlantQtyInIteration === undefined ||
289
+ response.data.updatePlantQtyInIteration === null
290
+ ) {
291
+ throw new Error(
292
+ "Failed to update plant quantity in iteration: No data returned",
293
+ );
163
294
  }
164
- async addPlantToIteration(iterationId, plantId, qty) {
165
- const response = await this.httpClient.request('/graphql-containers', {
166
- query: print(AddPlantToIterationDocument),
167
- variables: {
168
- iterationId,
169
- plantId,
170
- qty,
171
- },
172
- });
173
- if (response.data?.addPlantToIteration === undefined || response.data.addPlantToIteration === null) {
174
- throw new Error('Failed to add plant to iteration: No data returned');
175
- }
176
- return response.data.addPlantToIteration;
295
+ return response.data.updatePlantQtyInIteration;
296
+ }
297
+ async removePlantFromIteration(iterationId, plantId) {
298
+ const response = await this.httpClient.request("/graphql-containers", {
299
+ query: print(RemovePlantFromIterationDocument),
300
+ variables: {
301
+ iterationId,
302
+ plantId,
303
+ },
304
+ });
305
+ if (
306
+ response.data?.removePlantFromIteration === undefined ||
307
+ response.data.removePlantFromIteration === null
308
+ ) {
309
+ throw new Error(
310
+ "Failed to remove plant from iteration: No data returned",
311
+ );
177
312
  }
178
- async updatePlantQtyInIteration(iterationId, plantId, qty) {
179
- const response = await this.httpClient.request('/graphql-containers', {
180
- query: print(UpdatePlantQtyInIterationDocument),
181
- variables: {
182
- iterationId,
183
- plantId,
184
- qty,
185
- },
186
- });
187
- if (response.data?.updatePlantQtyInIteration === undefined || response.data.updatePlantQtyInIteration === null) {
188
- throw new Error('Failed to update plant quantity in iteration: No data returned');
189
- }
190
- return response.data.updatePlantQtyInIteration;
313
+ return response.data.removePlantFromIteration;
314
+ }
315
+ async listIterationPlants(iterationId) {
316
+ const response = await this.httpClient.request("/graphql-containers", {
317
+ query: print(ListIterationPlantsDocument),
318
+ variables: {
319
+ iterationId,
320
+ },
321
+ });
322
+ if (!response.data?.listIterationPlants) {
323
+ throw new Error("Failed to list iteration plants: No data returned");
191
324
  }
192
- async removePlantFromIteration(iterationId, plantId) {
193
- const response = await this.httpClient.request('/graphql-containers', {
194
- query: print(RemovePlantFromIterationDocument),
195
- variables: {
196
- iterationId,
197
- plantId,
198
- },
199
- });
200
- if (response.data?.removePlantFromIteration === undefined || response.data.removePlantFromIteration === null) {
201
- throw new Error('Failed to remove plant from iteration: No data returned');
202
- }
203
- return response.data.removePlantFromIteration;
325
+ return response.data.listIterationPlants;
326
+ }
327
+ async rotateContainer(containerId, name, note, newPlants, merchantId) {
328
+ const response = await this.httpClient.request(
329
+ "/graphql-containers",
330
+ {
331
+ query: print(RotateContainerDocument),
332
+ variables: {
333
+ containerId,
334
+ name,
335
+ note,
336
+ newPlants,
337
+ },
338
+ },
339
+ merchantId,
340
+ );
341
+ if (!response.data?.rotateContainer) {
342
+ throw new Error("Failed to rotate container: No data returned");
204
343
  }
205
- async listIterationPlants(iterationId) {
206
- const response = await this.httpClient.request('/graphql-containers', {
207
- query: print(ListIterationPlantsDocument),
208
- variables: {
209
- iterationId,
210
- },
211
- });
212
- if (!response.data?.listIterationPlants) {
213
- throw new Error('Failed to list iteration plants: No data returned');
214
- }
215
- return response.data.listIterationPlants;
344
+ return response.data.rotateContainer;
345
+ }
346
+ async createSoilTest(input, merchantId) {
347
+ const response = await this.httpClient.request(
348
+ "/graphql-containers",
349
+ {
350
+ query: print(CreateSoilTestDocument),
351
+ variables: {
352
+ input: {
353
+ containerId: input.containerId,
354
+ iterationId: input.iterationId,
355
+ location: input.location,
356
+ testDate: input.testDate,
357
+ sampleDepth: input.sampleDepth,
358
+ soilTexture: input.soilTexture,
359
+ moistureLevel: input.moistureLevel,
360
+ pHLevel: input.pHLevel,
361
+ drainageRate: input.drainageRate,
362
+ organicMatterEstimate: input.organicMatterEstimate,
363
+ },
364
+ },
365
+ },
366
+ merchantId,
367
+ );
368
+ if (!response.data?.createSoilTest) {
369
+ throw new Error("Failed to create soil test: No data returned");
216
370
  }
217
- async rotateContainer(containerId, name, note, newPlants, merchantId) {
218
- const response = await this.httpClient.request('/graphql-containers', {
219
- query: print(RotateContainerDocument),
220
- variables: {
221
- containerId,
222
- name,
223
- note,
224
- newPlants,
225
- },
226
- }, merchantId);
227
- if (!response.data?.rotateContainer) {
228
- throw new Error('Failed to rotate container: No data returned');
229
- }
230
- return response.data.rotateContainer;
371
+ return response.data.createSoilTest;
372
+ }
373
+ async listSoilTestsByContainer(containerId, merchantId) {
374
+ const response = await this.httpClient.request(
375
+ "/graphql-containers",
376
+ {
377
+ query: print(ListSoilTestsByContainerDocument),
378
+ variables: {
379
+ containerId,
380
+ },
381
+ },
382
+ merchantId,
383
+ );
384
+ if (!response.data?.listSoilTestsByContainer) {
385
+ throw new Error(
386
+ "Failed to list soil tests by container: No data returned",
387
+ );
231
388
  }
232
- async createSoilTest(input, merchantId) {
233
- const response = await this.httpClient.request('/graphql-containers', {
234
- query: print(CreateSoilTestDocument),
235
- variables: {
236
- input: {
237
- containerId: input.containerId,
238
- iterationId: input.iterationId,
239
- location: input.location,
240
- testDate: input.testDate,
241
- sampleDepth: input.sampleDepth,
242
- soilTexture: input.soilTexture,
243
- moistureLevel: input.moistureLevel,
244
- pHLevel: input.pHLevel,
245
- drainageRate: input.drainageRate,
246
- organicMatterEstimate: input.organicMatterEstimate,
247
- },
248
- },
249
- }, merchantId);
250
- if (!response.data?.createSoilTest) {
251
- throw new Error('Failed to create soil test: No data returned');
252
- }
253
- return response.data.createSoilTest;
389
+ return response.data.listSoilTestsByContainer;
390
+ }
391
+ async listSoilTestsByIteration(iterationId) {
392
+ const response = await this.httpClient.request("/graphql-containers", {
393
+ query: print(ListSoilTestsByIterationDocument),
394
+ variables: {
395
+ iterationId,
396
+ },
397
+ });
398
+ if (!response.data?.listSoilTestsByIteration) {
399
+ throw new Error(
400
+ "Failed to list soil tests by iteration: No data returned",
401
+ );
254
402
  }
255
- async listSoilTestsByContainer(containerId, merchantId) {
256
- const response = await this.httpClient.request('/graphql-containers', {
257
- query: print(ListSoilTestsByContainerDocument),
258
- variables: {
259
- containerId,
260
- },
261
- }, merchantId);
262
- if (!response.data?.listSoilTestsByContainer) {
263
- throw new Error('Failed to list soil tests by container: No data returned');
264
- }
265
- return response.data.listSoilTestsByContainer;
403
+ return response.data.listSoilTestsByIteration;
404
+ }
405
+ async deleteSoilTest(id) {
406
+ const response = await this.httpClient.request("/graphql-containers", {
407
+ query: print(DeleteSoilTestDocument),
408
+ variables: {
409
+ id,
410
+ },
411
+ });
412
+ if (
413
+ response.data?.deleteSoilTest === undefined ||
414
+ response.data.deleteSoilTest === null
415
+ ) {
416
+ throw new Error("Failed to delete soil test: No data returned");
266
417
  }
267
- async listSoilTestsByIteration(iterationId) {
268
- const response = await this.httpClient.request('/graphql-containers', {
269
- query: print(ListSoilTestsByIterationDocument),
270
- variables: {
271
- iterationId,
272
- },
273
- });
274
- if (!response.data?.listSoilTestsByIteration) {
275
- throw new Error('Failed to list soil tests by iteration: No data returned');
276
- }
277
- return response.data.listSoilTestsByIteration;
418
+ return response.data.deleteSoilTest;
419
+ }
420
+ async createContainerLog(input, merchantId) {
421
+ const response = await this.httpClient.request(
422
+ "/graphql-containers",
423
+ {
424
+ query: print(CreateContainerLogDocument),
425
+ variables: {
426
+ input: {
427
+ containerId: input.containerId,
428
+ iterationId: input.iterationId,
429
+ note: input.note,
430
+ },
431
+ },
432
+ },
433
+ merchantId,
434
+ );
435
+ if (!response.data?.createContainerLog) {
436
+ throw new Error("Failed to create container log: No data returned");
278
437
  }
279
- async deleteSoilTest(id) {
280
- const response = await this.httpClient.request('/graphql-containers', {
281
- query: print(DeleteSoilTestDocument),
282
- variables: {
283
- id,
284
- },
285
- });
286
- if (response.data?.deleteSoilTest === undefined || response.data.deleteSoilTest === null) {
287
- throw new Error('Failed to delete soil test: No data returned');
288
- }
289
- return response.data.deleteSoilTest;
438
+ return response.data.createContainerLog;
439
+ }
440
+ async getContainerLogs(containerId, merchantId) {
441
+ const response = await this.httpClient.request(
442
+ "/graphql-containers",
443
+ {
444
+ query: print(GetContainerLogsDocument),
445
+ variables: {
446
+ containerId,
447
+ },
448
+ },
449
+ merchantId,
450
+ );
451
+ if (!response.data?.getContainerLogs) {
452
+ throw new Error("Failed to get container logs: No data returned");
290
453
  }
291
- async createContainerLog(input, merchantId) {
292
- const response = await this.httpClient.request('/graphql-containers', {
293
- query: print(CreateContainerLogDocument),
294
- variables: {
295
- input: {
296
- containerId: input.containerId,
297
- iterationId: input.iterationId,
298
- note: input.note,
299
- },
300
- },
301
- }, merchantId);
302
- if (!response.data?.createContainerLog) {
303
- throw new Error('Failed to create container log: No data returned');
304
- }
305
- return response.data.createContainerLog;
454
+ return response.data.getContainerLogs;
455
+ }
456
+ async updateContainerLog(id, note, merchantId) {
457
+ const response = await this.httpClient.request(
458
+ "/graphql-containers",
459
+ {
460
+ query: print(UpdateContainerLogDocument),
461
+ variables: {
462
+ id,
463
+ note,
464
+ },
465
+ },
466
+ merchantId,
467
+ );
468
+ if (!response.data?.updateContainerLog) {
469
+ throw new Error("Failed to update container log: No data returned");
306
470
  }
307
- async getContainerLogs(containerId, merchantId) {
308
- const response = await this.httpClient.request('/graphql-containers', {
309
- query: print(GetContainerLogsDocument),
310
- variables: {
311
- containerId,
312
- },
313
- }, merchantId);
314
- if (!response.data?.getContainerLogs) {
315
- throw new Error('Failed to get container logs: No data returned');
316
- }
317
- return response.data.getContainerLogs;
471
+ return response.data.updateContainerLog;
472
+ }
473
+ async createTask(input, merchantId) {
474
+ const response = await this.httpClient.request(
475
+ "/graphql-containers",
476
+ {
477
+ query: print(CreateTaskDocument),
478
+ variables: {
479
+ input: {
480
+ containerId: input.containerId,
481
+ iterationId: input.iterationId,
482
+ name: input.name,
483
+ description: input.description,
484
+ status: input.status,
485
+ dueDate: input.dueDate,
486
+ },
487
+ },
488
+ },
489
+ merchantId,
490
+ );
491
+ if (!response.data?.createTask) {
492
+ throw new Error("Failed to create task: No data returned");
318
493
  }
319
- async updateContainerLog(id, note, merchantId) {
320
- const response = await this.httpClient.request('/graphql-containers', {
321
- query: print(UpdateContainerLogDocument),
322
- variables: {
323
- id,
324
- note,
325
- },
326
- }, merchantId);
327
- if (!response.data?.updateContainerLog) {
328
- throw new Error('Failed to update container log: No data returned');
329
- }
330
- return response.data.updateContainerLog;
494
+ return response.data.createTask;
495
+ }
496
+ async updateTask(input, merchantId) {
497
+ const response = await this.httpClient.request(
498
+ "/graphql-containers",
499
+ {
500
+ query: print(UpdateTaskDocument),
501
+ variables: {
502
+ input: {
503
+ id: input.id,
504
+ ...(input.name !== undefined ? { name: input.name } : {}),
505
+ ...(input.description !== undefined
506
+ ? { description: input.description }
507
+ : {}),
508
+ ...(input.status !== undefined ? { status: input.status } : {}),
509
+ ...(input.dueDate !== undefined ? { dueDate: input.dueDate } : {}),
510
+ },
511
+ },
512
+ },
513
+ merchantId,
514
+ );
515
+ if (!response.data?.updateTask) {
516
+ throw new Error("Failed to update task: No data returned");
331
517
  }
332
- async createTask(input, merchantId) {
333
- const response = await this.httpClient.request('/graphql-containers', {
334
- query: print(CreateTaskDocument),
335
- variables: {
336
- input: {
337
- containerId: input.containerId,
338
- iterationId: input.iterationId,
339
- name: input.name,
340
- description: input.description,
341
- status: input.status,
342
- dueDate: input.dueDate,
343
- },
344
- },
345
- }, merchantId);
346
- if (!response.data?.createTask) {
347
- throw new Error('Failed to create task: No data returned');
348
- }
349
- return response.data.createTask;
518
+ return response.data.updateTask;
519
+ }
520
+ async deleteTask(id, merchantId) {
521
+ const response = await this.httpClient.request(
522
+ "/graphql-containers",
523
+ {
524
+ query: print(DeleteTaskDocument),
525
+ variables: {
526
+ id,
527
+ },
528
+ },
529
+ merchantId,
530
+ );
531
+ if (
532
+ response.data?.deleteTask === undefined ||
533
+ response.data.deleteTask === null
534
+ ) {
535
+ throw new Error("Failed to delete task: No data returned");
350
536
  }
351
- async updateTask(input, merchantId) {
352
- const response = await this.httpClient.request('/graphql-containers', {
353
- query: print(UpdateTaskDocument),
354
- variables: {
355
- input: {
356
- id: input.id,
357
- ...(input.name !== undefined ? { name: input.name } : {}),
358
- ...(input.description !== undefined ? { description: input.description } : {}),
359
- ...(input.status !== undefined ? { status: input.status } : {}),
360
- ...(input.dueDate !== undefined ? { dueDate: input.dueDate } : {}),
361
- },
362
- },
363
- }, merchantId);
364
- if (!response.data?.updateTask) {
365
- throw new Error('Failed to update task: No data returned');
366
- }
367
- return response.data.updateTask;
537
+ return response.data.deleteTask;
538
+ }
539
+ async listTasks(containerId, merchantId) {
540
+ const response = await this.httpClient.request(
541
+ "/graphql-containers",
542
+ {
543
+ query: print(ListTasksDocument),
544
+ variables: {
545
+ containerId,
546
+ },
547
+ },
548
+ merchantId,
549
+ );
550
+ if (!response.data?.listTasks) {
551
+ throw new Error("Failed to list tasks: No data returned");
368
552
  }
369
- async deleteTask(id, merchantId) {
370
- const response = await this.httpClient.request('/graphql-containers', {
371
- query: print(DeleteTaskDocument),
372
- variables: {
373
- id,
374
- },
375
- }, merchantId);
376
- if (response.data?.deleteTask === undefined || response.data.deleteTask === null) {
377
- throw new Error('Failed to delete task: No data returned');
378
- }
379
- return response.data.deleteTask;
380
- }
381
- async listTasks(containerId, merchantId) {
382
- const response = await this.httpClient.request('/graphql-containers', {
383
- query: print(ListTasksDocument),
384
- variables: {
385
- containerId,
386
- },
387
- }, merchantId);
388
- if (!response.data?.listTasks) {
389
- throw new Error('Failed to list tasks: No data returned');
390
- }
391
- return response.data.listTasks;
392
- }
393
- async listAllUserTasks(merchantId) {
394
- const response = await this.httpClient.request('/graphql-containers', {
395
- query: print(ListAllUserTasksDocument),
396
- variables: {},
397
- }, merchantId);
398
- if (!response.data?.listAllUserTasks) {
399
- throw new Error('Failed to list all user tasks: No data returned');
400
- }
401
- return response.data.listAllUserTasks;
553
+ return response.data.listTasks;
554
+ }
555
+ async listAllUserTasks(merchantId) {
556
+ const response = await this.httpClient.request(
557
+ "/graphql-containers",
558
+ {
559
+ query: print(ListAllUserTasksDocument),
560
+ variables: {},
561
+ },
562
+ merchantId,
563
+ );
564
+ if (!response.data?.listAllUserTasks) {
565
+ throw new Error("Failed to list all user tasks: No data returned");
402
566
  }
567
+ return response.data.listAllUserTasks;
568
+ }
403
569
  }
404
- //# sourceMappingURL=ContainersClient.js.map
570
+ //# sourceMappingURL=ContainersClient.js.map