@timbereye/sdk 0.0.0-stage → 0.2.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 +123 -0
- package/LICENSE +202 -0
- package/README.md +346 -2
- package/dist/cjs/case.d.ts +23 -0
- package/dist/cjs/case.js +54 -0
- package/dist/cjs/client.d.ts +98 -0
- package/dist/cjs/client.js +132 -0
- package/dist/cjs/errors.d.ts +63 -0
- package/dist/cjs/errors.js +107 -0
- package/dist/cjs/generated/schema.d.ts +14862 -0
- package/dist/cjs/generated/schema.js +6 -0
- package/dist/cjs/http.d.ts +104 -0
- package/dist/cjs/http.js +253 -0
- package/dist/cjs/index.d.ts +14 -0
- package/dist/cjs/index.js +29 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/pagination.d.ts +31 -0
- package/dist/cjs/pagination.js +52 -0
- package/dist/cjs/resources.d.ts +11195 -0
- package/dist/cjs/resources.js +506 -0
- package/dist/cjs/runtime.d.ts +20 -0
- package/dist/cjs/runtime.js +74 -0
- package/dist/cjs/types.d.ts +649 -0
- package/dist/cjs/types.js +2 -0
- package/dist/cjs/units.d.ts +26 -0
- package/dist/cjs/units.js +45 -0
- package/dist/cjs/webhooks.d.ts +67 -0
- package/dist/cjs/webhooks.js +213 -0
- package/dist/esm/case.d.ts +23 -0
- package/dist/esm/case.js +47 -0
- package/dist/esm/client.d.ts +98 -0
- package/dist/esm/client.js +128 -0
- package/dist/esm/errors.d.ts +63 -0
- package/dist/esm/errors.js +93 -0
- package/dist/esm/generated/schema.d.ts +14862 -0
- package/dist/esm/generated/schema.js +5 -0
- package/dist/esm/http.d.ts +104 -0
- package/dist/esm/http.js +247 -0
- package/dist/esm/index.d.ts +14 -0
- package/dist/esm/index.js +6 -0
- package/dist/esm/pagination.d.ts +31 -0
- package/dist/esm/pagination.js +49 -0
- package/dist/esm/resources.d.ts +11195 -0
- package/dist/esm/resources.js +503 -0
- package/dist/esm/runtime.d.ts +20 -0
- package/dist/esm/runtime.js +46 -0
- package/dist/esm/types.d.ts +649 -0
- package/dist/esm/types.js +1 -0
- package/dist/esm/units.d.ts +26 -0
- package/dist/esm/units.js +38 -0
- package/dist/esm/webhooks.d.ts +67 -0
- package/dist/esm/webhooks.js +208 -0
- package/package.json +51 -5
|
@@ -0,0 +1,649 @@
|
|
|
1
|
+
import type { Camel } from "./case.js";
|
|
2
|
+
import type { components, operations } from "./generated/schema.js";
|
|
3
|
+
type S = components["schemas"];
|
|
4
|
+
/** Every schema of the API, camelCased. Generated mechanically from the OpenAPI types. */
|
|
5
|
+
export type Schemas = {
|
|
6
|
+
[K in keyof S]: Camel<S[K]>;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* A group. Lumber and panel groups also carry `spec`, `bundle`, `rule`, `expected`,
|
|
10
|
+
* `totalsConvention`, `photos` and `images`, and `summary.pieces` and `summary.tally`. Every group's
|
|
11
|
+
* `summary.products` says what it holds, product by product (a group may hold logs, bundles and units).
|
|
12
|
+
*/
|
|
13
|
+
export type Group = Omit<Schemas["Group"], "spec" | "bundle" | "rule" | "expected" | "summary" | "parent"> & {
|
|
14
|
+
summary: Omit<Schemas["Group"]["summary"], "tally"> & {
|
|
15
|
+
tally?: LumberTotals | null;
|
|
16
|
+
};
|
|
17
|
+
/** The parent group, present only with `expand[]=parent`. */
|
|
18
|
+
parent?: Group | null;
|
|
19
|
+
spec?: Record<string, unknown> | null;
|
|
20
|
+
bundle?: Record<string, unknown> | null;
|
|
21
|
+
rule?: TallyRuleApplied | null;
|
|
22
|
+
expected?: LumberExpected | null;
|
|
23
|
+
photos?: PhotosStatus;
|
|
24
|
+
images?: Record<string, unknown>[];
|
|
25
|
+
};
|
|
26
|
+
export type Item = Schemas["Item"];
|
|
27
|
+
export type Scan = Schemas["Scan"];
|
|
28
|
+
export type Measurement = Schemas["Measurement"];
|
|
29
|
+
export type Image = Schemas["Image"];
|
|
30
|
+
export type GroupImage = Schemas["GroupImage"];
|
|
31
|
+
export type ItemImage = Schemas["ItemImage"];
|
|
32
|
+
export type UploadSession = Schemas["UploadSession"];
|
|
33
|
+
export type Place = Schemas["Place"];
|
|
34
|
+
export type PlaceValidation = Schemas["PlaceValidation"];
|
|
35
|
+
export type Species = Schemas["Species"];
|
|
36
|
+
export type Volume = Schemas["Volume"];
|
|
37
|
+
/** One log's volume on an item (`item.volume`): rule, ruleVersion and m3, null while unmeasured. */
|
|
38
|
+
export type ItemVolume = Schemas["ItemVolume"];
|
|
39
|
+
export type VolumeRule = Schemas["VolumeRule"];
|
|
40
|
+
export type Origin = Schemas["Origin"];
|
|
41
|
+
export type Event = Schemas["Event"];
|
|
42
|
+
export type EventType = Schemas["EventType"];
|
|
43
|
+
export type WebhookEndpoint = Schemas["WebhookEndpoint"];
|
|
44
|
+
export type WebhookEndpointDeleted = Schemas["WebhookEndpointDeleted"];
|
|
45
|
+
export type GroupDeleted = Schemas["GroupDeleted"];
|
|
46
|
+
export type PlaceDeleted = Schemas["PlaceDeleted"];
|
|
47
|
+
export type LabelTemplateDeleted = Schemas["LabelTemplateDeleted"];
|
|
48
|
+
export type CaptureToken = Schemas["CaptureToken"];
|
|
49
|
+
export type ApiKey = Schemas["ApiKey"];
|
|
50
|
+
/**
|
|
51
|
+
* Metered usage. Lumber and panels: `lumber` and `panels` hold the period's figures; only `m3` is
|
|
52
|
+
* billed (at the one price per m³), the rest are counts for display.
|
|
53
|
+
*/
|
|
54
|
+
export type Usage = Omit<Schemas["Usage"], "lumber" | "panels"> & {
|
|
55
|
+
lumber?: {
|
|
56
|
+
m3: number;
|
|
57
|
+
boardFeet: number;
|
|
58
|
+
pieces: number;
|
|
59
|
+
photos: number;
|
|
60
|
+
};
|
|
61
|
+
panels?: {
|
|
62
|
+
m3: number;
|
|
63
|
+
m2: number;
|
|
64
|
+
pieces: number;
|
|
65
|
+
photos: number;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
export type UsageRecord = Schemas["UsageRecord"];
|
|
69
|
+
export type DetectorModel = Schemas["DetectorModel"];
|
|
70
|
+
export type BoardEndCounterModel = Schemas["BoardEndCounterModel"];
|
|
71
|
+
export type BulkUpdateResult = Schemas["BulkUpdateResult"];
|
|
72
|
+
export type GroupMembership = Schemas["GroupMembership"];
|
|
73
|
+
export type TeamMember = Schemas["TeamMember"];
|
|
74
|
+
export type TeamMemberDeleted = Schemas["TeamMemberDeleted"];
|
|
75
|
+
export type TeamRole = Schemas["TeamMember"]["role"];
|
|
76
|
+
export type Invitation = Schemas["Invitation"];
|
|
77
|
+
export type InvitationStatus = S["InvitationStatus"];
|
|
78
|
+
export type InvitationAcceptance = Schemas["InvitationAcceptance"];
|
|
79
|
+
export type TeamScanner = Schemas["TeamScanner"];
|
|
80
|
+
export type DeviceSignIn = Schemas["DeviceSignIn"];
|
|
81
|
+
export type AuditLogEntry = Schemas["AuditLogEntry"];
|
|
82
|
+
export type LengthUnit = S["LengthUnit"];
|
|
83
|
+
export type WeightUnit = S["WeightUnit"];
|
|
84
|
+
/** The union of events a webhook delivers or `events` lists; narrow on `type`. */
|
|
85
|
+
export type WebhookEvent = Event;
|
|
86
|
+
export type ItemLengthInput = Schemas["ItemLengthInput"];
|
|
87
|
+
export type LengthInput = Schemas["LengthInput"];
|
|
88
|
+
export type GroupWeightInput = Schemas["GroupWeightInput"];
|
|
89
|
+
/**
|
|
90
|
+
* A group's shipping details, as stored (`group.shipping`): the parties, references, voyage, ports and seal the packing
|
|
91
|
+
* list PDF prints. Display only: Timbereye prints them as given and does not issue, validate or file shipping documents.
|
|
92
|
+
*/
|
|
93
|
+
export type GroupShipping = Schemas["GroupShipping"];
|
|
94
|
+
/** `shipping` on create, open and update: each field optional; on update a field you send replaces it, null removes it. */
|
|
95
|
+
export type GroupShippingInput = Schemas["GroupShippingInput"];
|
|
96
|
+
export type ShippingParty = Schemas["ShippingParty"];
|
|
97
|
+
export type ItemRefSelector = Schemas["ItemRefSelector"];
|
|
98
|
+
export type ItemPatch = Schemas["ItemPatch"];
|
|
99
|
+
export type ScanItemInput = Schemas["ScanItemInput"];
|
|
100
|
+
export type ScanItemResult = Schemas["ScanItemResult"];
|
|
101
|
+
export type ScanItemStatus = Schemas["ScanItemStatus"];
|
|
102
|
+
export type KeyRights = Schemas["KeyRights"];
|
|
103
|
+
export type BulkUpdateParams = Schemas["BulkUpdateRequest"];
|
|
104
|
+
export type Geometry = Schemas["Geometry"];
|
|
105
|
+
export type Account = Schemas["Account"];
|
|
106
|
+
export type WebhookTest = Schemas["WebhookTest"];
|
|
107
|
+
export type WebhookDelivery = Schemas["WebhookDelivery"];
|
|
108
|
+
export type WebhookDeliveryDetail = Schemas["WebhookDeliveryDetail"];
|
|
109
|
+
export type WebhookDeliveryAttempt = Schemas["WebhookDeliveryAttempt"];
|
|
110
|
+
export type ConsoleBootstrap = Schemas["ConsoleBootstrap"];
|
|
111
|
+
export type ConsoleOnboarding = Schemas["ConsoleOnboarding"];
|
|
112
|
+
export type OnboardingUseCase = Schemas["OnboardingUseCase"];
|
|
113
|
+
export type OnboardingStep = Schemas["OnboardingStep"];
|
|
114
|
+
export type OnboardingAboutYou = Schemas["OnboardingAboutYou"];
|
|
115
|
+
export type OnboardingOrganisation = Schemas["OnboardingOrganisation"];
|
|
116
|
+
export type OnboardingMeasures = Schemas["OnboardingMeasures"];
|
|
117
|
+
export type ConsoleOrganisation = Schemas["ConsoleOrganisation"];
|
|
118
|
+
export type AccountDataUse = Schemas["AccountDataUse"];
|
|
119
|
+
export type AccountLumberSettings = Schemas["AccountLumberSettings"];
|
|
120
|
+
export type AccountLumberSettingsObject = Schemas["AccountLumberSettingsObject"];
|
|
121
|
+
export type AccountLogo = Camel<Schemas["AccountLogo"]>;
|
|
122
|
+
export type AccountLogoSetParams = Schemas["AccountLogoSet"];
|
|
123
|
+
export type AccountLogoDeleted = Schemas["AccountLogoDeleted"];
|
|
124
|
+
export type AccountLumberSettingsUpdateParams = Schemas["AccountLumberSettingsUpdate"];
|
|
125
|
+
export type AccountDataRequest = Schemas["AccountDataRequest"];
|
|
126
|
+
export type AccountDataRequestList = Schemas["AccountDataRequestList"];
|
|
127
|
+
export type SupportRequest = Schemas["SupportRequest"];
|
|
128
|
+
export type SupportRequestList = Schemas["SupportRequestList"];
|
|
129
|
+
export type SupportRequestCategory = Schemas["SupportRequestCategory"];
|
|
130
|
+
export type SupportRequestContext = Schemas["SupportRequestContext"];
|
|
131
|
+
export type LegalAgreement = Schemas["LegalAgreement"];
|
|
132
|
+
export type ConsoleAgreement = Schemas["ConsoleAgreement"];
|
|
133
|
+
export type LiveAccess = Schemas["LiveAccess"];
|
|
134
|
+
/** Billing. `currentPeriod` gains `lumberM3` and `panelM3` where the server reports them. */
|
|
135
|
+
export type Billing = Omit<Schemas["Billing"], "currentPeriod"> & {
|
|
136
|
+
currentPeriod: Schemas["Billing"]["currentPeriod"] & {
|
|
137
|
+
lumberM3?: number;
|
|
138
|
+
panelM3?: number;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
export type BillingInvoice = Schemas["BillingInvoice"];
|
|
142
|
+
export type BillingRedirect = Schemas["BillingRedirect"];
|
|
143
|
+
export type LiveWrites = S["LiveWrites"];
|
|
144
|
+
export type AccountBilling = Schemas["AccountBilling"];
|
|
145
|
+
export type LabelTemplate = Schemas["LabelTemplate"];
|
|
146
|
+
export type TagBatch = Schemas["TagBatch"];
|
|
147
|
+
export type PrintedTag = Schemas["PrintedTag"];
|
|
148
|
+
export type PrintFile = Schemas["PrintFile"];
|
|
149
|
+
export type TagQrGeometry = Schemas["TagQrGeometry"];
|
|
150
|
+
/** The fields of `POST /groups`, with the lumber and panel fields typed (see `LumberGroupFields`). */
|
|
151
|
+
export type GroupCreateParams = Omit<Schemas["GroupCreate"], keyof LumberGroupFields> & LumberGroupFields;
|
|
152
|
+
export type GroupUpdateParams = Schemas["GroupUpdate"];
|
|
153
|
+
export type ScanCreateParams = Schemas["ScanCreate"];
|
|
154
|
+
export type SimulateScanParams = Schemas["SimulateScanCreate"];
|
|
155
|
+
export type SimulatedRefinementRun = Schemas["SimulatedRefinementRun"];
|
|
156
|
+
export type PlaceCreateParams = Schemas["PlaceCreate"];
|
|
157
|
+
export type PlaceUpdateParams = Schemas["PlaceUpdate"];
|
|
158
|
+
export type SpeciesCreateParams = Schemas["SpeciesCreate"];
|
|
159
|
+
export type SpeciesUpdateParams = Schemas["SpeciesUpdate"];
|
|
160
|
+
export type ManualMeasurementParams = Schemas["ManualMeasurementRequest"];
|
|
161
|
+
export type CreateImageParams = Schemas["CreateImageRequest"];
|
|
162
|
+
export type ItemPhoto = Schemas["ItemPhoto"];
|
|
163
|
+
export type WebhookEndpointCreateParams = Schemas["WebhookEndpointCreate"];
|
|
164
|
+
export type WebhookEndpointUpdateParams = Schemas["WebhookEndpointUpdate"];
|
|
165
|
+
export type WebhookTestParams = Schemas["WebhookTestRequest"];
|
|
166
|
+
export type CaptureTokenCreateParams = Schemas["CaptureTokenCreate"];
|
|
167
|
+
export type ApiKeyCreateParams = Schemas["ApiKeyCreate"];
|
|
168
|
+
export type ApiKeyRollParams = Schemas["ApiKeyRoll"];
|
|
169
|
+
export type ApiKeyRevealParams = Schemas["ApiKeyRevealRequest"];
|
|
170
|
+
export type ApiKeySecret = Schemas["ApiKeySecret"];
|
|
171
|
+
export type CliLoginRequest = Schemas["CliLoginRequest"];
|
|
172
|
+
export type ApiKeyUpdateParams = Schemas["ApiKeyUpdate"];
|
|
173
|
+
export type ApiKeyRecordsVoidParams = Schemas["ApiKeyRecordsVoid"];
|
|
174
|
+
export type ApiKeyRecordsVoidResult = Schemas["ApiKeyRecordsVoidResult"];
|
|
175
|
+
export type GroupOpenParams = Schemas["GroupOpen"];
|
|
176
|
+
export type GroupLookup = Schemas["GroupLookup"];
|
|
177
|
+
export type GroupLookupParams = {
|
|
178
|
+
kind: string;
|
|
179
|
+
externalRef: string;
|
|
180
|
+
};
|
|
181
|
+
export type CaptureGroup = Schemas["CaptureGroup"];
|
|
182
|
+
export type TeamMemberUpdateParams = Schemas["TeamMemberUpdate"];
|
|
183
|
+
export type OwnershipTransferParams = Schemas["OwnershipTransfer"];
|
|
184
|
+
export type InvitationCreateParams = Schemas["InvitationCreate"];
|
|
185
|
+
export type InvitationAcceptParams = Schemas["InvitationAccept"];
|
|
186
|
+
export type TeamScannerCreateParams = Schemas["TeamScannerCreate"];
|
|
187
|
+
export type ConsoleOnboardingUpdateParams = Schemas["ConsoleOnboardingUpdate"];
|
|
188
|
+
export type ConsoleOrganisationCreateParams = Schemas["ConsoleOrganisationCreate"];
|
|
189
|
+
export type ConsoleDataUseUpdateParams = Schemas["ConsoleDataUseUpdate"];
|
|
190
|
+
export type AccountDataRequestCreateParams = Schemas["AccountDataRequestCreate"];
|
|
191
|
+
export type SupportRequestCreateParams = Schemas["SupportRequestCreate"];
|
|
192
|
+
export type ConsoleAgreementCreateParams = Schemas["ConsoleAgreementCreate"];
|
|
193
|
+
export type LiveAccessUpdateParams = Schemas["LiveAccessUpdate"];
|
|
194
|
+
export type BillingUpdateParams = Schemas["BillingUpdate"];
|
|
195
|
+
export type BillingTermsAcceptanceParams = Schemas["BillingTermsAcceptance"];
|
|
196
|
+
export type BillingReturnUrlParams = Schemas["BillingReturnUrl"];
|
|
197
|
+
export type BillingCardSetupConfirmParams = Schemas["BillingCardSetupConfirm"];
|
|
198
|
+
export type BillingTestCardParams = Schemas["BillingTestCard"];
|
|
199
|
+
export type BillingPlanUpdateParams = Schemas["BillingPlanUpdate"];
|
|
200
|
+
export type LabelTemplateCreateParams = Schemas["LabelTemplateCreate"];
|
|
201
|
+
export type LabelTemplateUpdateParams = Schemas["LabelTemplateUpdate"];
|
|
202
|
+
export type TagBatchCreateParams = Schemas["TagBatchCreate"];
|
|
203
|
+
export type PrintFileParams = QueryParams<"getTagBatchPrintFile">;
|
|
204
|
+
/** Every invitation is on one page; `startingAfter` is accepted for the list iterator's sake. */
|
|
205
|
+
export type InvitationListParams = ListParams<"listInvitations"> & {
|
|
206
|
+
startingAfter?: string;
|
|
207
|
+
};
|
|
208
|
+
/** Every phone is on one page; `startingAfter` is accepted for the list iterator's sake. */
|
|
209
|
+
export type DeviceSignInListParams = ListParams<"listTeamDeviceSignIns"> & {
|
|
210
|
+
startingAfter?: string;
|
|
211
|
+
};
|
|
212
|
+
export type ObservationsParams = Schemas["ObservationsRequest"];
|
|
213
|
+
export type LumberProduct = S["LumberProduct"];
|
|
214
|
+
export type GroupImageKind = S["GroupImageKind"];
|
|
215
|
+
export type LumberDimension = Schemas["LumberDimension"];
|
|
216
|
+
export type LumberSpecInput = Schemas["LumberSpecInput"];
|
|
217
|
+
export type BundleAttributes = Schemas["BundleAttributes"];
|
|
218
|
+
/** A tally rule and its policies (see `volumeRules.list`); omitted policies take the rule's defaults. */
|
|
219
|
+
export type TallyRuleInput = {
|
|
220
|
+
id: string;
|
|
221
|
+
version?: string;
|
|
222
|
+
policies?: Record<string, string | number | boolean>;
|
|
223
|
+
};
|
|
224
|
+
/** What you expect a bundle to hold; compared on the tally, never used in a figure. */
|
|
225
|
+
export type LumberExpected = {
|
|
226
|
+
pieces?: number;
|
|
227
|
+
m3?: number;
|
|
228
|
+
boardFeet?: number;
|
|
229
|
+
m2?: number;
|
|
230
|
+
};
|
|
231
|
+
/**
|
|
232
|
+
* The photographs a lumber or panel tally needs before it can finish. By default `bundle_end` and `label` for
|
|
233
|
+
* lumber, `label` and `unit_edge` for panels. `{ required: false, reason }` waives them for this group.
|
|
234
|
+
*/
|
|
235
|
+
export type PhotosPolicyInput = {
|
|
236
|
+
required: false;
|
|
237
|
+
reason: string;
|
|
238
|
+
} | {
|
|
239
|
+
required: GroupImageKind[];
|
|
240
|
+
};
|
|
241
|
+
/** The lumber and panel fields of a group create (`groups.create` and each entry of `groups.createBatch`). */
|
|
242
|
+
export type LumberGroupFields = {
|
|
243
|
+
product?: LumberProduct;
|
|
244
|
+
spec?: LumberSpecInput;
|
|
245
|
+
bundle?: BundleAttributes;
|
|
246
|
+
rule?: TallyRuleInput;
|
|
247
|
+
expected?: LumberExpected;
|
|
248
|
+
/** A packing list's totals convention: `exact` (sum of unrounded volumes) or `reported` (sum of printed ones). */
|
|
249
|
+
totals?: "exact" | "reported";
|
|
250
|
+
photos?: PhotosPolicyInput;
|
|
251
|
+
};
|
|
252
|
+
/** One group of a batch: the fields of `groups.create`, including the lumber and panel fields. */
|
|
253
|
+
export type LumberGroupCreateParams = Omit<Schemas["LumberGroupCreate"], keyof LumberGroupFields> & LumberGroupFields;
|
|
254
|
+
export type GroupBatchCreateParams = {
|
|
255
|
+
/** A parent created in the same call (a container, truck load or stack). */
|
|
256
|
+
parent?: LumberGroupCreateParams;
|
|
257
|
+
/** Or an existing parent. */
|
|
258
|
+
parentId?: string;
|
|
259
|
+
/** Up to 500 groups; `externalRef` must be unique within the batch. */
|
|
260
|
+
groups: LumberGroupCreateParams[];
|
|
261
|
+
};
|
|
262
|
+
export type GroupBatch = Omit<Schemas["GroupBatch"], "parent" | "data"> & {
|
|
263
|
+
parent: Group | null;
|
|
264
|
+
data: Group[];
|
|
265
|
+
};
|
|
266
|
+
type Source = "vision" | "operator" | "corrected" | "group_default" | "bulk";
|
|
267
|
+
/** A dimension of a tally line. `source` says who entered it; `measured` keeps a machine's original value. */
|
|
268
|
+
export type TallyLineDimension = {
|
|
269
|
+
value: number;
|
|
270
|
+
unit: "in" | "ft" | "mm" | "cm" | "m";
|
|
271
|
+
source?: Source;
|
|
272
|
+
actual?: number;
|
|
273
|
+
measured?: {
|
|
274
|
+
value: number;
|
|
275
|
+
unit: string;
|
|
276
|
+
source?: string;
|
|
277
|
+
model?: string;
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
/** One tally line: a board, a counted run of identical boards, a width class, or a count of sheets. */
|
|
281
|
+
export type TallyLineInput = {
|
|
282
|
+
clientId?: string;
|
|
283
|
+
count?: number;
|
|
284
|
+
width?: TallyLineDimension;
|
|
285
|
+
length?: TallyLineDimension;
|
|
286
|
+
thickness?: TallyLineDimension;
|
|
287
|
+
/** Surface measure read off a board rule, kept as entered (no width needed). */
|
|
288
|
+
surfaceMeasure?: number;
|
|
289
|
+
countSource?: Source;
|
|
290
|
+
species?: string;
|
|
291
|
+
grade?: string;
|
|
292
|
+
panelType?: string;
|
|
293
|
+
evidence?: Record<string, unknown>;
|
|
294
|
+
};
|
|
295
|
+
export type GroupTallySubmitParams = {
|
|
296
|
+
/** Your id for this submission: the same tally sent again returns the same result. */
|
|
297
|
+
clientId: string;
|
|
298
|
+
lines: TallyLineInput[];
|
|
299
|
+
/** The submission this one replaces; 409 `tally_replaced` when it is not the current one. */
|
|
300
|
+
replaces?: string;
|
|
301
|
+
/**
|
|
302
|
+
* The bundle's revision the sender last saw (0: no final tally yet); any other current revision is 409
|
|
303
|
+
* `tally_replaced`, so a re-tally never silently replaces a correction made meanwhile.
|
|
304
|
+
*/
|
|
305
|
+
replacesRevision?: number;
|
|
306
|
+
/** Pieces counted on a photo or read off the label, beside the tally's pieces. */
|
|
307
|
+
visionCount?: {
|
|
308
|
+
countedPieces: number;
|
|
309
|
+
imageId?: string;
|
|
310
|
+
regions?: unknown[];
|
|
311
|
+
model?: string;
|
|
312
|
+
confirmed?: boolean;
|
|
313
|
+
/** Who counted: a counting `model`, the operator tapping board ends (`operator_taps`), or the label (`operator_label`). */
|
|
314
|
+
method?: "model" | "operator_taps" | "operator_label";
|
|
315
|
+
};
|
|
316
|
+
/** Photos of the bundle already uploaded with `images.createUploadSession` (subject group). */
|
|
317
|
+
imageIds?: string[];
|
|
318
|
+
device?: Record<string, unknown>;
|
|
319
|
+
sdk?: Record<string, unknown>;
|
|
320
|
+
location?: Schemas["Location"];
|
|
321
|
+
capturedAt?: string;
|
|
322
|
+
};
|
|
323
|
+
export type TallyCorrection = {
|
|
324
|
+
action: "update" | "split" | "remove" | "add";
|
|
325
|
+
itemId?: string;
|
|
326
|
+
/** Fields to set: width, length, thickness, count, surfaceMeasure, species or grade. */
|
|
327
|
+
set?: Partial<Omit<TallyLineInput, "clientId" | "evidence">>;
|
|
328
|
+
/** `split`: how many pieces move to the new line. */
|
|
329
|
+
count?: number;
|
|
330
|
+
/** `add`: the new line. */
|
|
331
|
+
line?: TallyLineInput;
|
|
332
|
+
reason: string;
|
|
333
|
+
};
|
|
334
|
+
export type GroupTallyCorrectionsParams = {
|
|
335
|
+
corrections: TallyCorrection[];
|
|
336
|
+
};
|
|
337
|
+
export type GroupTallyParams = {
|
|
338
|
+
rule?: string;
|
|
339
|
+
lines?: "all" | "none";
|
|
340
|
+
limit?: number;
|
|
341
|
+
startingAfter?: string;
|
|
342
|
+
};
|
|
343
|
+
export type TallySheetParams = {
|
|
344
|
+
format?: "json" | "html";
|
|
345
|
+
rule?: string;
|
|
346
|
+
};
|
|
347
|
+
export type PackingListParams = {
|
|
348
|
+
totals?: "exact" | "reported";
|
|
349
|
+
include?: "tally_sheets";
|
|
350
|
+
/** `pdf`: the document itself (a `BinaryResponse`). */
|
|
351
|
+
format?: "json" | "html" | "pdf";
|
|
352
|
+
/** With `format: "pdf"`: by default Letter for lumber in inches and feet, else A4. */
|
|
353
|
+
paper?: "a4" | "letter";
|
|
354
|
+
/** With `format: "pdf"`: `tally` adds each bundle's tally lines. */
|
|
355
|
+
detail?: "tally";
|
|
356
|
+
};
|
|
357
|
+
export type { BinaryResponse } from "./http.js";
|
|
358
|
+
export type TallyRevisionListParams = {
|
|
359
|
+
itemId?: string;
|
|
360
|
+
limit?: number;
|
|
361
|
+
startingAfter?: string;
|
|
362
|
+
};
|
|
363
|
+
/** Totals in the rule's units: reported numbers plus `*Exact` strings (`m3` and `m3Exact`, `boardFeet`...). */
|
|
364
|
+
export type LumberTotals = {
|
|
365
|
+
pieces: number;
|
|
366
|
+
boardFeet?: number;
|
|
367
|
+
boardFeetExact?: string;
|
|
368
|
+
m3?: number;
|
|
369
|
+
m3Exact?: string;
|
|
370
|
+
m2?: number;
|
|
371
|
+
/** MSF by thickness basis, e.g. `{ "3/4 in": 2.31 }`. */
|
|
372
|
+
msf?: Record<string, number>;
|
|
373
|
+
[quantity: string]: unknown;
|
|
374
|
+
};
|
|
375
|
+
export type PhotosStatus = {
|
|
376
|
+
required: string[];
|
|
377
|
+
waived: boolean;
|
|
378
|
+
waivedReason: string | null;
|
|
379
|
+
/** The photos were waived and none were taken. */
|
|
380
|
+
noPhoto: boolean;
|
|
381
|
+
missing: string[];
|
|
382
|
+
count: number;
|
|
383
|
+
/** The count per image kind, keyed by the kind as the API writes it (`bundle_end`), not camelCased. */
|
|
384
|
+
byKind: Record<string, number>;
|
|
385
|
+
ids: string[];
|
|
386
|
+
};
|
|
387
|
+
export type TallyLine = {
|
|
388
|
+
itemId: string;
|
|
389
|
+
line: number;
|
|
390
|
+
clientId: string | null;
|
|
391
|
+
type: "board" | "sheet";
|
|
392
|
+
count: number;
|
|
393
|
+
width: TallyLineDimension | null;
|
|
394
|
+
length: TallyLineDimension | null;
|
|
395
|
+
thickness: TallyLineDimension | null;
|
|
396
|
+
[field: string]: unknown;
|
|
397
|
+
};
|
|
398
|
+
export type TallyRuleApplied = {
|
|
399
|
+
id: string;
|
|
400
|
+
version: string;
|
|
401
|
+
policies: Record<string, unknown>;
|
|
402
|
+
primary: string | null;
|
|
403
|
+
basis: string | null;
|
|
404
|
+
unconfirmedPolicies: string[];
|
|
405
|
+
};
|
|
406
|
+
type DocumentBlock = {
|
|
407
|
+
generatedAt: string;
|
|
408
|
+
contentSha256: string;
|
|
409
|
+
[field: string]: unknown;
|
|
410
|
+
};
|
|
411
|
+
/** A bundle's or unit's tally (`object: group_tally`, or `tally_sheet` with a `document` block). */
|
|
412
|
+
export type GroupTally = Omit<Schemas["LumberGroupTally"], "totals" | "lines"> & {
|
|
413
|
+
kind: string;
|
|
414
|
+
name: string | null;
|
|
415
|
+
externalRef: string | null;
|
|
416
|
+
/** When the tally (at this revision) became final; a tally is final when submitted. */
|
|
417
|
+
settledAt: string | null;
|
|
418
|
+
/** 1 for the first submitted tally, +1 for each re-tally or correction; 0 for none. */
|
|
419
|
+
revision: number;
|
|
420
|
+
/** Pieces counted on a photo (a vision count sent with the tally), beside the tally's `pieces`. */
|
|
421
|
+
countedPieces: number | null;
|
|
422
|
+
/** Who counted (`visionCount.method`), or null when nothing was counted. */
|
|
423
|
+
countMethod: "model" | "operator_taps" | "operator_label" | null;
|
|
424
|
+
countMatches: boolean | null;
|
|
425
|
+
countDifference: number | null;
|
|
426
|
+
rule: TallyRuleApplied | null;
|
|
427
|
+
spec: Record<string, unknown>;
|
|
428
|
+
bundle: Record<string, unknown>;
|
|
429
|
+
label: Record<string, unknown> | null;
|
|
430
|
+
expected: LumberExpected | null;
|
|
431
|
+
lineCount: number;
|
|
432
|
+
totals: LumberTotals | null;
|
|
433
|
+
byLength: {
|
|
434
|
+
length: {
|
|
435
|
+
value: number;
|
|
436
|
+
unit: string;
|
|
437
|
+
};
|
|
438
|
+
pieces: number;
|
|
439
|
+
[quantity: string]: unknown;
|
|
440
|
+
}[];
|
|
441
|
+
byWidth: {
|
|
442
|
+
width: {
|
|
443
|
+
value: number;
|
|
444
|
+
unit: string;
|
|
445
|
+
};
|
|
446
|
+
pieces: number;
|
|
447
|
+
}[];
|
|
448
|
+
widthDevM: number | null;
|
|
449
|
+
sources: Record<string, number>;
|
|
450
|
+
submission: {
|
|
451
|
+
id: string;
|
|
452
|
+
clientId: string;
|
|
453
|
+
lineCount: number;
|
|
454
|
+
imageIds: string[];
|
|
455
|
+
visionCount: {
|
|
456
|
+
countedPieces: number;
|
|
457
|
+
imageId: string | null;
|
|
458
|
+
regions: unknown[] | null;
|
|
459
|
+
model: string | null;
|
|
460
|
+
confirmed: boolean;
|
|
461
|
+
method?: "model" | "operator_taps" | "operator_label";
|
|
462
|
+
} | null;
|
|
463
|
+
pieces: number;
|
|
464
|
+
createdAt: string;
|
|
465
|
+
} | null;
|
|
466
|
+
photos: PhotosStatus;
|
|
467
|
+
images: Record<string, unknown>[];
|
|
468
|
+
lines?: TallyLine[];
|
|
469
|
+
linesHasMore?: boolean;
|
|
470
|
+
document?: DocumentBlock;
|
|
471
|
+
[field: string]: unknown;
|
|
472
|
+
};
|
|
473
|
+
/** One row of a packing list: a bundle with its pieces, figures and (for width-class tallies) its histogram. */
|
|
474
|
+
export type PackingListRow = {
|
|
475
|
+
groupId: string;
|
|
476
|
+
/** A group may hold bundles and units together: `lumber` or `panel`. */
|
|
477
|
+
product: LumberProduct;
|
|
478
|
+
kind: string | null;
|
|
479
|
+
externalRef: string | null;
|
|
480
|
+
number: string | null;
|
|
481
|
+
qualityCode: string | null;
|
|
482
|
+
drying: string | null;
|
|
483
|
+
species: string | null;
|
|
484
|
+
final: boolean;
|
|
485
|
+
rule: string | null;
|
|
486
|
+
pieces: number;
|
|
487
|
+
/** The lengths its tally has, shortest first (empty before a tally). */
|
|
488
|
+
lengths?: {
|
|
489
|
+
value: number;
|
|
490
|
+
unit: string;
|
|
491
|
+
}[];
|
|
492
|
+
histogram: Record<string, number> | null;
|
|
493
|
+
/**
|
|
494
|
+
* The group inside the list's group that this row sits in (a shipment's container), or null for a bundle or unit
|
|
495
|
+
* directly in the list's group.
|
|
496
|
+
*/
|
|
497
|
+
inGroup: {
|
|
498
|
+
groupId: string;
|
|
499
|
+
kind: string | null;
|
|
500
|
+
name: string | null;
|
|
501
|
+
externalRef: string | null;
|
|
502
|
+
} | null;
|
|
503
|
+
[field: string]: unknown;
|
|
504
|
+
};
|
|
505
|
+
export type PackingListTotals = LumberTotals & {
|
|
506
|
+
convention: "exact" | "reported";
|
|
507
|
+
bundles: number;
|
|
508
|
+
};
|
|
509
|
+
/** One log of a packing list, as stored: tag, species, grade, length, small-end diameters and JAS volume. */
|
|
510
|
+
export type PackingListLog = {
|
|
511
|
+
itemId: string;
|
|
512
|
+
product: "sawlog";
|
|
513
|
+
/** The tag's payload; null for an untagged log. */
|
|
514
|
+
tag: string | null;
|
|
515
|
+
species: string;
|
|
516
|
+
grade: string | null;
|
|
517
|
+
lengthM: number;
|
|
518
|
+
diameterShortM: number;
|
|
519
|
+
diameterLongM: number;
|
|
520
|
+
/** JAS volume as recorded for the log. */
|
|
521
|
+
m3: number;
|
|
522
|
+
inGroup: PackingListRow["inGroup"];
|
|
523
|
+
};
|
|
524
|
+
/** A group's weighbridge net weight on a packing list. */
|
|
525
|
+
export type PackingListWeight = {
|
|
526
|
+
netKg: number;
|
|
527
|
+
ticketRef: string | null;
|
|
528
|
+
};
|
|
529
|
+
/** A packing list's logs, per group or in all: how many and their JAS volume. */
|
|
530
|
+
export type PackingListSawlogTotals = {
|
|
531
|
+
count: number;
|
|
532
|
+
totals: {
|
|
533
|
+
rule: "jas";
|
|
534
|
+
logs: number;
|
|
535
|
+
m3: number;
|
|
536
|
+
};
|
|
537
|
+
};
|
|
538
|
+
export type PackingList = {
|
|
539
|
+
object: "packing_list";
|
|
540
|
+
livemode: boolean;
|
|
541
|
+
groupId: string;
|
|
542
|
+
kind: string;
|
|
543
|
+
name: string | null;
|
|
544
|
+
externalRef: string | null;
|
|
545
|
+
product: LumberProduct | null;
|
|
546
|
+
/** Every bundle has a final (submitted) tally. */
|
|
547
|
+
complete: boolean;
|
|
548
|
+
rules: TallyRuleApplied[];
|
|
549
|
+
totalsConvention: "exact" | "reported";
|
|
550
|
+
bundles: PackingListRow[];
|
|
551
|
+
widthClasses: {
|
|
552
|
+
value: number;
|
|
553
|
+
unit: string;
|
|
554
|
+
}[];
|
|
555
|
+
pivot: Record<string, unknown>[];
|
|
556
|
+
/**
|
|
557
|
+
* Under the list's convention: the list's own product's, or, for a group without a product, the one product it
|
|
558
|
+
* holds. Null while a group without a product holds bundles and units (see `totalsByProduct`).
|
|
559
|
+
*/
|
|
560
|
+
totals: PackingListTotals | null;
|
|
561
|
+
/** Under the other convention. */
|
|
562
|
+
totalsAlternative: PackingListTotals | null;
|
|
563
|
+
/** Per product, never added together: how many bundles or units, and their totals under both conventions. */
|
|
564
|
+
totalsByProduct: Partial<Record<LumberProduct, {
|
|
565
|
+
count: number;
|
|
566
|
+
totals: PackingListTotals;
|
|
567
|
+
totalsAlternative: PackingListTotals;
|
|
568
|
+
}>> & {
|
|
569
|
+
sawlog?: PackingListSawlogTotals;
|
|
570
|
+
};
|
|
571
|
+
/** The logs in the group and in the groups inside it, oldest first within each group. */
|
|
572
|
+
logs: PackingListLog[];
|
|
573
|
+
/** More logs than a packing list lists (5,000). */
|
|
574
|
+
logsHasMore: boolean;
|
|
575
|
+
/** The group's weighbridge net weight, when it has one. */
|
|
576
|
+
weight: PackingListWeight | null;
|
|
577
|
+
/**
|
|
578
|
+
* The groups inside this one that hold rows (a shipment's containers), in row order, each with its own totals
|
|
579
|
+
* per product. Empty for a group whose bundles and units sit directly in it.
|
|
580
|
+
*/
|
|
581
|
+
groups: {
|
|
582
|
+
groupId: string;
|
|
583
|
+
kind: string | null;
|
|
584
|
+
name: string | null;
|
|
585
|
+
externalRef: string | null;
|
|
586
|
+
totalsByProduct: PackingList["totalsByProduct"];
|
|
587
|
+
weight: PackingListWeight | null;
|
|
588
|
+
}[];
|
|
589
|
+
tallySheets?: GroupTally[];
|
|
590
|
+
document?: DocumentBlock;
|
|
591
|
+
[field: string]: unknown;
|
|
592
|
+
};
|
|
593
|
+
/** A tally sheet or packing list as a self-contained printable HTML page (`format: "html"`). */
|
|
594
|
+
export type LumberHtmlDocument = {
|
|
595
|
+
object: "document";
|
|
596
|
+
livemode: boolean;
|
|
597
|
+
format: "html";
|
|
598
|
+
content: string;
|
|
599
|
+
[field: string]: unknown;
|
|
600
|
+
};
|
|
601
|
+
export type TallyRevision = Camel<Schemas["TallyRevisionList"]["data"][number]> & {
|
|
602
|
+
itemId?: string | null;
|
|
603
|
+
field?: string | null;
|
|
604
|
+
from?: unknown;
|
|
605
|
+
to?: unknown;
|
|
606
|
+
createdAt?: string;
|
|
607
|
+
[field: string]: unknown;
|
|
608
|
+
};
|
|
609
|
+
export type GroupParent = Schemas["GroupParentList"]["data"][number];
|
|
610
|
+
export type SimulatePackingListParams = Schemas["SimulatePackingListCreate"];
|
|
611
|
+
export type SimulatedPackingList = Omit<Schemas["SimulatedPackingList"], "packingList"> & {
|
|
612
|
+
packingList: PackingList;
|
|
613
|
+
};
|
|
614
|
+
type QueryOf<K extends keyof operations> = operations[K] extends {
|
|
615
|
+
parameters: {
|
|
616
|
+
query?: infer Q;
|
|
617
|
+
};
|
|
618
|
+
} ? NonNullable<Q> : object;
|
|
619
|
+
/** Query parameters of an operation, camelCased. `expand[]` becomes `expand: string[]`. */
|
|
620
|
+
export type QueryParams<K extends keyof operations> = Camel<Omit<QueryOf<K>, "expand[]">> & ("expand[]" extends keyof QueryOf<K> ? {
|
|
621
|
+
expand?: string[];
|
|
622
|
+
} : object);
|
|
623
|
+
/** Parameters of every list operation also accept `limit` (1 to 100) and `startingAfter`; the iterators set the latter. */
|
|
624
|
+
export type ListParams<K extends keyof operations> = QueryParams<K>;
|
|
625
|
+
export type ScanImageParams = {
|
|
626
|
+
subject: "group" | "item";
|
|
627
|
+
/** A group image kind (`subject: "group"`) or an item image kind (`subject: "item"`). */
|
|
628
|
+
kind: string;
|
|
629
|
+
/** An item image names its item by `itemId` or by `itemClientId` (exactly one). */
|
|
630
|
+
itemId?: string;
|
|
631
|
+
/** The `clientId` the item was sent with in this scan. */
|
|
632
|
+
itemClientId?: string;
|
|
633
|
+
clientId?: string;
|
|
634
|
+
capturedAt?: string;
|
|
635
|
+
/** Lowercase hex SHA-256 of the file; the server refuses a difference with 409 `upload_hash_mismatch`. */
|
|
636
|
+
sha256?: string;
|
|
637
|
+
width?: number;
|
|
638
|
+
height?: number;
|
|
639
|
+
/** The GPS fix at capture. */
|
|
640
|
+
location?: Schemas["Location"];
|
|
641
|
+
/** Item images: where the crop lies in its source image. */
|
|
642
|
+
region?: Schemas["NormalizedBox"];
|
|
643
|
+
sourceImageId?: string;
|
|
644
|
+
/** Group images: the logs the device found in it. */
|
|
645
|
+
detections?: Schemas["ImageDetectionsInput"];
|
|
646
|
+
/** The JPEG, at most 10 MB. */
|
|
647
|
+
file: Blob | Uint8Array | ArrayBuffer;
|
|
648
|
+
filename?: string;
|
|
649
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Display-only helpers. The API stores and returns SI values; an account's `display_units`
|
|
3
|
+
* (`metric` or `imperial`) says how a UI should show them. Nothing here is used for requests.
|
|
4
|
+
*/
|
|
5
|
+
export type DisplayUnits = "metric" | "imperial";
|
|
6
|
+
/** Either the units themselves or anything carrying them, such as the object from `te.account.retrieve()`. */
|
|
7
|
+
export type UnitsSource = DisplayUnits | {
|
|
8
|
+
displayUnits: DisplayUnits;
|
|
9
|
+
};
|
|
10
|
+
export declare const M_PER_FOOT = 0.3048;
|
|
11
|
+
export declare const M_PER_INCH = 0.0254;
|
|
12
|
+
export declare const KG_PER_POUND = 0.45359237;
|
|
13
|
+
export declare const KG_PER_SHORT_TON = 907.18474;
|
|
14
|
+
export declare const M3_PER_CUBIC_FOOT = 0.028316846592;
|
|
15
|
+
export interface Formatted {
|
|
16
|
+
value: number;
|
|
17
|
+
unit: string;
|
|
18
|
+
}
|
|
19
|
+
/** Lengths: metres, or feet. */
|
|
20
|
+
export declare function formatLength(valueM: number, source: UnitsSource, digits?: number): string;
|
|
21
|
+
/** Diameters: centimetres, or inches. */
|
|
22
|
+
export declare function formatDiameter(valueM: number, source: UnitsSource, digits?: number): string;
|
|
23
|
+
/** Weights: kilograms below one tonne and tonnes above; pounds below one short ton and short tons above. */
|
|
24
|
+
export declare function formatWeight(valueKg: number, source: UnitsSource, digits?: number): string;
|
|
25
|
+
/** Volumes: cubic metres, or cubic feet. Board-foot rule outputs are shown from `volume.native`, not converted. */
|
|
26
|
+
export declare function formatVolume(valueM3: number, source: UnitsSource, digits?: number): string;
|