@kohost/api-client 7.13.0 → 7.14.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 (54) hide show
  1. package/dist/.tsbuildinfo +1 -0
  2. package/dist/lib/index.d.ts +1 -1
  3. package/dist/lib/index.js +4 -2
  4. package/dist/lib/index.js.map +1 -1
  5. package/dist/lib/money.d.ts +21 -0
  6. package/dist/lib/money.js +29 -1
  7. package/dist/lib/money.js.map +1 -1
  8. package/dist/models/cost.d.ts +17 -0
  9. package/dist/models/cost.js +38 -0
  10. package/dist/models/cost.js.map +1 -0
  11. package/dist/models/emailMessage.js +2 -0
  12. package/dist/models/emailMessage.js.map +1 -1
  13. package/dist/models/index.d.ts +1 -0
  14. package/dist/models/index.js +3 -1
  15. package/dist/models/index.js.map +1 -1
  16. package/dist/schemas/bill.d.ts +14 -6
  17. package/dist/schemas/bill.js +14 -11
  18. package/dist/schemas/bill.js.map +1 -1
  19. package/dist/schemas/cost.d.ts +227 -0
  20. package/dist/schemas/cost.js +45 -0
  21. package/dist/schemas/cost.js.map +1 -0
  22. package/dist/schemas/costEntry.d.ts +222 -0
  23. package/dist/schemas/costEntry.js +162 -0
  24. package/dist/schemas/costEntry.js.map +1 -0
  25. package/dist/schemas/emailMessage.d.ts +12 -0
  26. package/dist/schemas/emailMessage.js +8 -0
  27. package/dist/schemas/emailMessage.js.map +1 -1
  28. package/dist/schemas/index.d.ts +7 -6
  29. package/dist/schemas/index.js +2 -1
  30. package/dist/schemas/ticket.d.ts +25 -26
  31. package/dist/schemas/ticket.js +60 -245
  32. package/dist/schemas/ticket.js.map +1 -1
  33. package/dist/useCases/createCost.d.ts +27 -0
  34. package/dist/useCases/createCost.js +47 -0
  35. package/dist/useCases/createCost.js.map +1 -0
  36. package/dist/useCases/editCost.d.ts +36 -0
  37. package/dist/useCases/editCost.js +47 -0
  38. package/dist/useCases/editCost.js.map +1 -0
  39. package/dist/useCases/index.d.ts +5 -0
  40. package/dist/useCases/index.js +11 -1
  41. package/dist/useCases/index.js.map +1 -1
  42. package/dist/useCases/reinstateCost.d.ts +36 -0
  43. package/dist/useCases/reinstateCost.js +47 -0
  44. package/dist/useCases/reinstateCost.js.map +1 -0
  45. package/dist/useCases/setCostInvoice.d.ts +36 -0
  46. package/dist/useCases/setCostInvoice.js +47 -0
  47. package/dist/useCases/setCostInvoice.js.map +1 -0
  48. package/dist/useCases/writeOffCost.d.ts +36 -0
  49. package/dist/useCases/writeOffCost.js +47 -0
  50. package/dist/useCases/writeOffCost.js.map +1 -0
  51. package/dist/validate.d.ts +23 -0
  52. package/dist/validate.js +4 -1
  53. package/dist/validate.js.map +1 -1
  54. package/package.json +1 -1
@@ -0,0 +1,222 @@
1
+ /**
2
+ * The append-only billing review history, over whichever actions the host
3
+ * admits. A ticket cost can be voided (withdrawn from the customer); a
4
+ * standalone cost has no ticket to withdraw it from, so its history stops at
5
+ * write-offs and divergence acknowledgements.
6
+ */
7
+ export declare const costBillingReview: <const Actions extends readonly string[]>(actions: Actions) => {
8
+ readonly type: "array";
9
+ readonly default: readonly [];
10
+ readonly description: string;
11
+ readonly items: {
12
+ readonly type: "object";
13
+ readonly additionalProperties: false;
14
+ readonly required: readonly ["id", "action", "performedAt"];
15
+ readonly properties: {
16
+ readonly id: {
17
+ readonly type: "string";
18
+ readonly description: "The ID of the billing review entry.";
19
+ };
20
+ readonly action: {
21
+ readonly type: "string";
22
+ readonly enum: Actions;
23
+ };
24
+ readonly performedBy: {
25
+ readonly type: readonly ["string", "null"];
26
+ readonly default: null;
27
+ readonly description: string;
28
+ };
29
+ readonly performedAt: {
30
+ readonly $ref: "definitions.json#/definitions/date";
31
+ readonly description: "When the entry was appended.";
32
+ };
33
+ readonly note: {
34
+ readonly type: readonly ["string", "null"];
35
+ readonly default: null;
36
+ readonly description: "Free-text rationale for the action.";
37
+ };
38
+ readonly billedAmount: {
39
+ readonly type: "integer";
40
+ readonly minimum: 0;
41
+ readonly description: string;
42
+ };
43
+ readonly priceAmount: {
44
+ readonly type: "integer";
45
+ readonly minimum: 0;
46
+ readonly description: string;
47
+ };
48
+ };
49
+ };
50
+ };
51
+ export declare const costEntryRequired: readonly ["id", "description", "currency", "price", "estimate", "markup"];
52
+ export declare const costEntryProperties: {
53
+ readonly id: {
54
+ readonly type: "string";
55
+ readonly description: "The ID of the cost entry.";
56
+ };
57
+ readonly description: {
58
+ readonly type: "string";
59
+ readonly description: "What the cost covers.";
60
+ };
61
+ readonly currency: {
62
+ readonly type: "string";
63
+ readonly default: "USD";
64
+ readonly description: "ISO 4217 currency code of the entry's amounts.";
65
+ };
66
+ readonly price: {
67
+ readonly type: "object";
68
+ readonly additionalProperties: false;
69
+ readonly required: readonly ["amount", "recordedBy", "recordedAt"];
70
+ readonly description: string;
71
+ readonly properties: {
72
+ readonly amount: {
73
+ readonly type: "integer";
74
+ readonly minimum: 0;
75
+ readonly description: "The amount in integer cents.";
76
+ };
77
+ readonly recordedBy: {
78
+ readonly type: "string";
79
+ readonly description: "The ID of the user who recorded the amount.";
80
+ };
81
+ readonly recordedAt: {
82
+ readonly $ref: "definitions.json#/definitions/date";
83
+ readonly description: "When the amount was recorded.";
84
+ };
85
+ };
86
+ };
87
+ readonly estimate: {
88
+ readonly type: "object";
89
+ readonly additionalProperties: false;
90
+ readonly required: readonly ["amount", "recordedBy", "recordedAt"];
91
+ readonly description: string;
92
+ readonly properties: {
93
+ readonly amount: {
94
+ readonly type: "integer";
95
+ readonly minimum: 0;
96
+ readonly description: "The amount in integer cents.";
97
+ };
98
+ readonly recordedBy: {
99
+ readonly type: "string";
100
+ readonly description: "The ID of the user who recorded the amount.";
101
+ };
102
+ readonly recordedAt: {
103
+ readonly $ref: "definitions.json#/definitions/date";
104
+ readonly description: "When the amount was recorded.";
105
+ };
106
+ };
107
+ };
108
+ readonly actual: {
109
+ readonly type: "object";
110
+ readonly additionalProperties: false;
111
+ readonly required: readonly ["amount", "recordedBy", "recordedAt"];
112
+ readonly description: string;
113
+ readonly properties: {
114
+ readonly amount: {
115
+ readonly type: "integer";
116
+ readonly minimum: 0;
117
+ readonly description: "The amount in integer cents.";
118
+ };
119
+ readonly recordedBy: {
120
+ readonly type: "string";
121
+ readonly description: "The ID of the user who recorded the amount.";
122
+ };
123
+ readonly recordedAt: {
124
+ readonly $ref: "definitions.json#/definitions/date";
125
+ readonly description: "When the amount was recorded.";
126
+ };
127
+ };
128
+ };
129
+ readonly markup: {
130
+ readonly type: "object";
131
+ readonly additionalProperties: false;
132
+ readonly required: readonly ["percent"];
133
+ readonly properties: {
134
+ readonly percent: {
135
+ readonly type: "number";
136
+ readonly description: string;
137
+ };
138
+ readonly custom: {
139
+ readonly type: "boolean";
140
+ readonly default: false;
141
+ readonly description: string;
142
+ };
143
+ };
144
+ };
145
+ readonly vendorId: {
146
+ readonly type: readonly ["string", "null"];
147
+ readonly default: null;
148
+ readonly description: string;
149
+ };
150
+ readonly categoryId: {
151
+ readonly type: readonly ["string", "null"];
152
+ readonly default: null;
153
+ readonly description: string;
154
+ };
155
+ readonly vendorInvoices: {
156
+ readonly type: "array";
157
+ readonly items: {
158
+ readonly $ref: "mediaFile.json";
159
+ };
160
+ readonly default: readonly [];
161
+ readonly description: string;
162
+ };
163
+ readonly vendorInvoiceNumber: {
164
+ readonly type: readonly ["string", "null"];
165
+ readonly default: null;
166
+ readonly description: string;
167
+ };
168
+ readonly billId: {
169
+ readonly type: readonly ["string", "null"];
170
+ readonly default: null;
171
+ readonly description: string;
172
+ };
173
+ readonly writtenOff: {
174
+ readonly type: "boolean";
175
+ readonly default: false;
176
+ readonly description: string;
177
+ };
178
+ readonly billingReview: {
179
+ readonly type: "array";
180
+ readonly default: readonly [];
181
+ readonly description: string;
182
+ readonly items: {
183
+ readonly type: "object";
184
+ readonly additionalProperties: false;
185
+ readonly required: readonly ["id", "action", "performedAt"];
186
+ readonly properties: {
187
+ readonly id: {
188
+ readonly type: "string";
189
+ readonly description: "The ID of the billing review entry.";
190
+ };
191
+ readonly action: {
192
+ readonly type: "string";
193
+ readonly enum: readonly ["writtenOff", "reinstated", "divergenceAcknowledged"];
194
+ };
195
+ readonly performedBy: {
196
+ readonly type: readonly ["string", "null"];
197
+ readonly default: null;
198
+ readonly description: string;
199
+ };
200
+ readonly performedAt: {
201
+ readonly $ref: "definitions.json#/definitions/date";
202
+ readonly description: "When the entry was appended.";
203
+ };
204
+ readonly note: {
205
+ readonly type: readonly ["string", "null"];
206
+ readonly default: null;
207
+ readonly description: "Free-text rationale for the action.";
208
+ };
209
+ readonly billedAmount: {
210
+ readonly type: "integer";
211
+ readonly minimum: 0;
212
+ readonly description: string;
213
+ };
214
+ readonly priceAmount: {
215
+ readonly type: "integer";
216
+ readonly minimum: 0;
217
+ readonly description: string;
218
+ };
219
+ };
220
+ };
221
+ };
222
+ };
@@ -0,0 +1,162 @@
1
+ //#region .generated/schemas/costEntry.ts
2
+ const money = (description) => ({
3
+ type: "object",
4
+ additionalProperties: false,
5
+ required: [
6
+ "amount",
7
+ "recordedBy",
8
+ "recordedAt"
9
+ ],
10
+ description,
11
+ properties: {
12
+ amount: {
13
+ type: "integer",
14
+ minimum: 0,
15
+ description: "The amount in integer cents."
16
+ },
17
+ recordedBy: {
18
+ type: "string",
19
+ description: "The ID of the user who recorded the amount."
20
+ },
21
+ recordedAt: {
22
+ $ref: "definitions.json#/definitions/date",
23
+ description: "When the amount was recorded."
24
+ }
25
+ }
26
+ });
27
+ /**
28
+ * The append-only billing review history, over whichever actions the host
29
+ * admits. A ticket cost can be voided (withdrawn from the customer); a
30
+ * standalone cost has no ticket to withdraw it from, so its history stops at
31
+ * write-offs and divergence acknowledgements.
32
+ */
33
+ const costBillingReview = (actions) => ({
34
+ type: "array",
35
+ default: [],
36
+ description: "Append-only billing review history for the entry (approval-history pattern): reversible write-offs, and billed-vs-price divergence acknowledgements. Internal, redacted org-side.",
37
+ items: {
38
+ type: "object",
39
+ additionalProperties: false,
40
+ required: [
41
+ "id",
42
+ "action",
43
+ "performedAt"
44
+ ],
45
+ properties: {
46
+ id: {
47
+ type: "string",
48
+ description: "The ID of the billing review entry."
49
+ },
50
+ action: {
51
+ type: "string",
52
+ enum: actions
53
+ },
54
+ performedBy: {
55
+ type: ["string", "null"],
56
+ default: null,
57
+ description: "The ID of the user whose write appended this entry. Null when the write was not user-attributable."
58
+ },
59
+ performedAt: {
60
+ $ref: "definitions.json#/definitions/date",
61
+ description: "When the entry was appended."
62
+ },
63
+ note: {
64
+ type: ["string", "null"],
65
+ default: null,
66
+ description: "Free-text rationale for the action."
67
+ },
68
+ billedAmount: {
69
+ type: "integer",
70
+ minimum: 0,
71
+ description: "divergenceAcknowledged only: the amount a bill line already charged for this entry, in integer cents, frozen at ack time."
72
+ },
73
+ priceAmount: {
74
+ type: "integer",
75
+ minimum: 0,
76
+ description: "divergenceAcknowledged only: the entry's stored customer price in integer cents at ack time. A divergence is a billed line that no longer matches the price behind it — a price corrected after the cost was claimed — so the ack silences this one pair and any later price move re-flags it. A vendor actual arriving after billing is not a divergence: it moves margin, not what the customer owes."
77
+ }
78
+ }
79
+ }
80
+ });
81
+ const costEntryRequired = [
82
+ "id",
83
+ "description",
84
+ "currency",
85
+ "price",
86
+ "estimate",
87
+ "markup"
88
+ ];
89
+ const costEntryProperties = {
90
+ id: {
91
+ type: "string",
92
+ description: "The ID of the cost entry."
93
+ },
94
+ description: {
95
+ type: "string",
96
+ description: "What the cost covers."
97
+ },
98
+ currency: {
99
+ type: "string",
100
+ default: "USD",
101
+ description: "ISO 4217 currency code of the entry's amounts."
102
+ },
103
+ price: money("The authoritative customer price — what the org is charged, what the approval gate totals, and what a bill line bills. Seeded at recording from the estimate and the markup, and from then on independent of all three: editing `estimate`, `actual`, or `markup` never moves it. Only an explicit price write does."),
104
+ estimate: money("The vendor cost estimate phase of the entry."),
105
+ actual: money("The settled vendor cost, recorded once the vendor's figure is known."),
106
+ markup: {
107
+ type: "object",
108
+ additionalProperties: false,
109
+ required: ["percent"],
110
+ properties: {
111
+ percent: {
112
+ type: "number",
113
+ description: "Markup percent the price was derived at, uncapped in either direction. Context for how the price was arrived at, not the source of truth for any amount: `price` is stored, so re-keying this percent prices nothing. A biller may charge under the vendor cost as a deliberate comp, and this records that as the negative percent it is rather than as a floor of zero the price never came from."
114
+ },
115
+ custom: {
116
+ type: "boolean",
117
+ default: false,
118
+ description: "Whether the percent was overridden by hand rather than keyed from the configured markup tiers. Custom percents are never re-keyed on estimate edits."
119
+ }
120
+ }
121
+ },
122
+ vendorId: {
123
+ type: ["string", "null"],
124
+ default: null,
125
+ description: "The Vendor the charge is owed to. A plain reference — no rollups — resolved inside the entry's own organization. Internal, redacted org-side with the rest of the cost split."
126
+ },
127
+ categoryId: {
128
+ type: ["string", "null"],
129
+ default: null,
130
+ description: "The billing category classifying this cost. `AddBillLine` snapshots it onto the claiming line, which owns its own category from then on. Internal, redacted org-side with the rest of the cost split."
131
+ },
132
+ vendorInvoices: {
133
+ type: "array",
134
+ items: { $ref: "mediaFile.json" },
135
+ default: [],
136
+ description: "The vendor's paperwork backing the entry's amounts — an invoice plus whatever came with it. Internal: the file-store cannot enforce roster-only reads, so the boundary is this field living on the full shape only, and the redacted projection never carries it."
137
+ },
138
+ vendorInvoiceNumber: {
139
+ type: ["string", "null"],
140
+ default: null,
141
+ description: "The vendor's own invoice number. Internal, redacted org-side like the rest of the cost split."
142
+ },
143
+ billId: {
144
+ type: ["string", "null"],
145
+ default: null,
146
+ description: "Backlink to the bill whose draft claimed this cost as a line. Written when a draft bill adds the line, cleared on line removal, draft delete, or bill void; a claimed cost leaves the uninvoiced pool, making double-invoicing structurally impossible. Server-maintained at the repository, never set by clients."
147
+ },
148
+ writtenOff: {
149
+ type: "boolean",
150
+ default: false,
151
+ description: "Server-maintained denormalization of billingReview (approvalState pattern): true after a writtenOff entry until a reinstated entry follows. A written-off cost leaves the uninvoiced pool. Never set by clients."
152
+ },
153
+ billingReview: costBillingReview([
154
+ "writtenOff",
155
+ "reinstated",
156
+ "divergenceAcknowledged"
157
+ ])
158
+ };
159
+ //#endregion
160
+ export { costBillingReview, costEntryProperties, costEntryRequired };
161
+
162
+ //# sourceMappingURL=costEntry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"costEntry.js","names":[],"sources":["../../.generated/schemas/costEntry.ts"],"sourcesContent":["// The cost-entry core: the money shape and reconciliation lifecycle every\n// OneBill cost carries, whether a Ticket embeds it or it stands alone in the\n// costs collection. Both hosts spread these consts into their own `properties`\n// and `required` rather than `$ref`-ing this file: draft-07 resolves `allOf`\n// against `additionalProperties: false` per subschema, so a composed entry\n// would reject every field the other half declared, and `FromSchema` derives\n// nothing useful from a reference it cannot inline.\n//\n// Nothing here is exported with a name ending in \"Schema\" and the model\n// generator skips this file by name (`scripts/generate-source-models.js`):\n// these are fragments, not an entity.\n\nconst money = (description: string) =>\n ({\n type: \"object\",\n additionalProperties: false,\n required: [\"amount\", \"recordedBy\", \"recordedAt\"],\n description,\n properties: {\n amount: {\n type: \"integer\",\n minimum: 0,\n description: \"The amount in integer cents.\",\n },\n recordedBy: {\n type: \"string\",\n description: \"The ID of the user who recorded the amount.\",\n },\n recordedAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the amount was recorded.\",\n },\n },\n }) as const;\n\n/**\n * The append-only billing review history, over whichever actions the host\n * admits. A ticket cost can be voided (withdrawn from the customer); a\n * standalone cost has no ticket to withdraw it from, so its history stops at\n * write-offs and divergence acknowledgements.\n */\nexport const costBillingReview = <const Actions extends readonly string[]>(\n actions: Actions,\n) =>\n ({\n type: \"array\",\n default: [],\n description:\n \"Append-only billing review history for the entry (approval-history \" +\n \"pattern): reversible write-offs, and billed-vs-price divergence \" +\n \"acknowledgements. Internal, redacted org-side.\",\n items: {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"action\", \"performedAt\"],\n properties: {\n id: {\n type: \"string\",\n description: \"The ID of the billing review entry.\",\n },\n action: {\n type: \"string\",\n enum: actions,\n },\n performedBy: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The ID of the user whose write appended this entry. Null when \" +\n \"the write was not user-attributable.\",\n },\n performedAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the entry was appended.\",\n },\n note: {\n type: [\"string\", \"null\"],\n default: null,\n description: \"Free-text rationale for the action.\",\n },\n billedAmount: {\n type: \"integer\",\n minimum: 0,\n description:\n \"divergenceAcknowledged only: the amount a bill line already \" +\n \"charged for this entry, in integer cents, frozen at ack time.\",\n },\n priceAmount: {\n type: \"integer\",\n minimum: 0,\n description:\n \"divergenceAcknowledged only: the entry's stored customer price \" +\n \"in integer cents at ack time. A divergence is a billed line \" +\n \"that no longer matches the price behind it — a price corrected \" +\n \"after the cost was claimed — so the ack silences this one pair \" +\n \"and any later price move re-flags it. A vendor actual arriving \" +\n \"after billing is not a divergence: it moves margin, not what \" +\n \"the customer owes.\",\n },\n },\n },\n }) as const;\n\nexport const costEntryRequired = [\n \"id\",\n \"description\",\n \"currency\",\n \"price\",\n \"estimate\",\n \"markup\",\n] as const;\n\nexport const costEntryProperties = {\n id: {\n type: \"string\",\n description: \"The ID of the cost entry.\",\n },\n description: {\n type: \"string\",\n description: \"What the cost covers.\",\n },\n currency: {\n type: \"string\",\n default: \"USD\",\n description: \"ISO 4217 currency code of the entry's amounts.\",\n },\n price: money(\n \"The authoritative customer price — what the org is charged, what the \" +\n \"approval gate totals, and what a bill line bills. Seeded at recording \" +\n \"from the estimate and the markup, and from then on independent of all \" +\n \"three: editing `estimate`, `actual`, or `markup` never moves it. Only \" +\n \"an explicit price write does.\",\n ),\n estimate: money(\"The vendor cost estimate phase of the entry.\"),\n actual: money(\n \"The settled vendor cost, recorded once the vendor's figure is known.\",\n ),\n markup: {\n type: \"object\",\n additionalProperties: false,\n required: [\"percent\"],\n properties: {\n percent: {\n type: \"number\",\n description:\n \"Markup percent the price was derived at, uncapped in either \" +\n \"direction. Context for how the price was arrived at, not the \" +\n \"source of truth for any amount: `price` is stored, so re-keying \" +\n \"this percent prices nothing. A biller may charge under the vendor \" +\n \"cost as a deliberate comp, and this records that as the negative \" +\n \"percent it is rather than as a floor of zero the price never came \" +\n \"from.\",\n },\n custom: {\n type: \"boolean\",\n default: false,\n description:\n \"Whether the percent was overridden by hand rather than keyed from \" +\n \"the configured markup tiers. Custom percents are never re-keyed on \" +\n \"estimate edits.\",\n },\n },\n },\n vendorId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The Vendor the charge is owed to. A plain reference — no rollups — \" +\n \"resolved inside the entry's own organization. Internal, redacted \" +\n \"org-side with the rest of the cost split.\",\n },\n categoryId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The billing category classifying this cost. `AddBillLine` snapshots \" +\n \"it onto the claiming line, which owns its own category from then on. \" +\n \"Internal, redacted org-side with the rest of the cost split.\",\n },\n vendorInvoices: {\n type: \"array\",\n items: { $ref: \"mediaFile.json\" },\n default: [],\n description:\n \"The vendor's paperwork backing the entry's amounts — an invoice plus \" +\n \"whatever came with it. Internal: the file-store cannot enforce \" +\n \"roster-only reads, so the boundary is this field living on the full \" +\n \"shape only, and the redacted projection never carries it.\",\n },\n vendorInvoiceNumber: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The vendor's own invoice number. Internal, redacted org-side like the \" +\n \"rest of the cost split.\",\n },\n billId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"Backlink to the bill whose draft claimed this cost as a line. Written \" +\n \"when a draft bill adds the line, cleared on line removal, draft \" +\n \"delete, or bill void; a claimed cost leaves the uninvoiced pool, \" +\n \"making double-invoicing structurally impossible. Server-maintained at \" +\n \"the repository, never set by clients.\",\n },\n writtenOff: {\n type: \"boolean\",\n default: false,\n description:\n \"Server-maintained denormalization of billingReview (approvalState \" +\n \"pattern): true after a writtenOff entry until a reinstated entry \" +\n \"follows. A written-off cost leaves the uninvoiced pool. Never set by \" +\n \"clients.\",\n },\n billingReview: costBillingReview([\n \"writtenOff\",\n \"reinstated\",\n \"divergenceAcknowledged\",\n ]),\n} as const;\n"],"mappings":";AAYA,MAAM,SAAS,iBACZ;CACC,MAAM;CACN,sBAAsB;CACtB,UAAU;EAAC;EAAU;EAAc;CAAY;CAC/C;CACA,YAAY;EACV,QAAQ;GACN,MAAM;GACN,SAAS;GACT,aAAa;EACf;EACA,YAAY;GACV,MAAM;GACN,aAAa;EACf;EACA,YAAY;GACV,MAAM;GACN,aAAa;EACf;CACF;AACF;;;;;;;AAQF,MAAa,qBACX,aAEC;CACC,MAAM;CACN,SAAS,CAAC;CACV,aACE;CAGF,OAAO;EACL,MAAM;EACN,sBAAsB;EACtB,UAAU;GAAC;GAAM;GAAU;EAAa;EACxC,YAAY;GACV,IAAI;IACF,MAAM;IACN,aAAa;GACf;GACA,QAAQ;IACN,MAAM;IACN,MAAM;GACR;GACA,aAAa;IACX,MAAM,CAAC,UAAU,MAAM;IACvB,SAAS;IACT,aACE;GAEJ;GACA,aAAa;IACX,MAAM;IACN,aAAa;GACf;GACA,MAAM;IACJ,MAAM,CAAC,UAAU,MAAM;IACvB,SAAS;IACT,aAAa;GACf;GACA,cAAc;IACZ,MAAM;IACN,SAAS;IACT,aACE;GAEJ;GACA,aAAa;IACX,MAAM;IACN,SAAS;IACT,aACE;GAOJ;EACF;CACF;AACF;AAEF,MAAa,oBAAoB;CAC/B;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAa,sBAAsB;CACjC,IAAI;EACF,MAAM;EACN,aAAa;CACf;CACA,aAAa;EACX,MAAM;EACN,aAAa;CACf;CACA,UAAU;EACR,MAAM;EACN,SAAS;EACT,aAAa;CACf;CACA,OAAO,MACL,sTAKF;CACA,UAAU,MAAM,8CAA8C;CAC9D,QAAQ,MACN,sEACF;CACA,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,UAAU,CAAC,SAAS;EACpB,YAAY;GACV,SAAS;IACP,MAAM;IACN,aACE;GAOJ;GACA,QAAQ;IACN,MAAM;IACN,SAAS;IACT,aACE;GAGJ;EACF;CACF;CACA,UAAU;EACR,MAAM,CAAC,UAAU,MAAM;EACvB,SAAS;EACT,aACE;CAGJ;CACA,YAAY;EACV,MAAM,CAAC,UAAU,MAAM;EACvB,SAAS;EACT,aACE;CAGJ;CACA,gBAAgB;EACd,MAAM;EACN,OAAO,EAAE,MAAM,iBAAiB;EAChC,SAAS,CAAC;EACV,aACE;CAIJ;CACA,qBAAqB;EACnB,MAAM,CAAC,UAAU,MAAM;EACvB,SAAS;EACT,aACE;CAEJ;CACA,QAAQ;EACN,MAAM,CAAC,UAAU,MAAM;EACvB,SAAS;EACT,aACE;CAKJ;CACA,YAAY;EACV,MAAM;EACN,SAAS;EACT,aACE;CAIJ;CACA,eAAe,kBAAkB;EAC/B;EACA;EACA;CACF,CAAC;AACH"}
@@ -60,6 +60,18 @@ export declare const emailMessageSchema: {
60
60
  readonly replyTo: {
61
61
  readonly type: readonly ["string", "array"];
62
62
  };
63
+ readonly cc: {
64
+ readonly type: readonly ["string", "array"];
65
+ readonly items: {
66
+ readonly type: "string";
67
+ };
68
+ };
69
+ readonly bcc: {
70
+ readonly type: readonly ["string", "array"];
71
+ readonly items: {
72
+ readonly type: "string";
73
+ };
74
+ };
63
75
  readonly appData: {
64
76
  readonly type: "object";
65
77
  readonly additionalProperties: true;
@@ -63,6 +63,14 @@ const emailMessageSchema = {
63
63
  description: "Additional headers for the email message, key/value pairs"
64
64
  },
65
65
  replyTo: { type: ["string", "array"] },
66
+ cc: {
67
+ type: ["string", "array"],
68
+ items: { type: "string" }
69
+ },
70
+ bcc: {
71
+ type: ["string", "array"],
72
+ items: { type: "string" }
73
+ },
66
74
  appData: {
67
75
  type: "object",
68
76
  additionalProperties: true,
@@ -1 +1 @@
1
- {"version":3,"file":"emailMessage.js","names":[],"sources":["../../.generated/schemas/emailMessage.ts"],"sourcesContent":["import defs, { ISODateString } from \"./definitions\";\nimport type { FromSchema } from \"json-schema-to-ts\";\n\nexport const emailMessageSchema = {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"emailMessage.json\",\n title: \"Email Message\",\n type: \"object\",\n required: [\"id\", \"type\", \"to\", \"from\", \"status\", \"subject\"],\n additionalProperties: false,\n properties: {\n id: {\n $ref: \"definitions.json#/definitions/id\",\n },\n propertyId: {\n type: \"string\",\n description: \"ID of the property this entity belongs to. Optional — used as a per-document filter inside the org-scoped database.\",\n },\n type: {\n type: \"string\",\n default: \"emailMessage\",\n enum: [\"emailMessage\"],\n },\n to: {\n type: \"string\",\n },\n from: {\n type: \"string\",\n description: \"Must be in the format of 'Sender <email@example.com>\",\n },\n subject: {\n type: \"string\",\n },\n status: {\n type: \"string\",\n enum: [\n \"queued\",\n \"sending\",\n \"sent\",\n \"deferred\",\n \"delivered\",\n \"undelivered\",\n \"bounced\",\n \"blocked\",\n \"receiving\",\n \"received\",\n \"opened\",\n \"clicked\",\n \"unsubscribed\",\n \"spamReport\",\n ],\n },\n statusMessage: {\n type: \"string\",\n },\n errorCode: {\n type: \"string\",\n description: \"Raw vendor delivery-failure code, e.g. Twilio 21610.\",\n },\n html: {\n type: \"string\",\n },\n text: {\n type: \"string\",\n },\n driver: {\n type: \"string\",\n },\n headers: {\n type: \"object\",\n additionalProperties: { type: \"string\" },\n description: \"Additional headers for the email message, key/value pairs\",\n },\n replyTo: {\n type: [\"string\", \"array\"],\n },\n appData: {\n type: \"object\",\n additionalProperties: true,\n description:\n \"Additional data for the email message, used for custom data\",\n },\n createdAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n updatedAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n deletedAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n systemId: {\n $ref: \"definitions.json#/definitions/systemId\",\n },\n },\n} as const;\n\nexport type EmailMessageSchema = FromSchema<\n typeof emailMessageSchema,\n {\n references: [typeof defs];\n deserialize: [\n {\n pattern: {\n format: \"date-time\";\n };\n output: Date | ISODateString;\n },\n ];\n }\n>;\n"],"mappings":";AAGA,MAAa,qBAAqB;CAChC,SAAS;CACT,KAAK;CACL,OAAO;CACP,MAAM;CACN,UAAU;EAAC;EAAM;EAAQ;EAAM;EAAQ;EAAU;CAAS;CAC1D,sBAAsB;CACtB,YAAY;EACV,IAAI,EACF,MAAM,mCACR;EACA,YAAY;GACV,MAAM;GACN,aAAa;EACf;EACA,MAAM;GACJ,MAAM;GACN,SAAS;GACT,MAAM,CAAC,cAAc;EACvB;EACA,IAAI,EACF,MAAM,SACR;EACA,MAAM;GACJ,MAAM;GACN,aAAa;EACf;EACA,SAAS,EACP,MAAM,SACR;EACA,QAAQ;GACN,MAAM;GACN,MAAM;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;EACF;EACA,eAAe,EACb,MAAM,SACR;EACA,WAAW;GACT,MAAM;GACN,aAAa;EACf;EACA,MAAM,EACJ,MAAM,SACR;EACA,MAAM,EACJ,MAAM,SACR;EACA,QAAQ,EACN,MAAM,SACR;EACA,SAAS;GACP,MAAM;GACN,sBAAsB,EAAE,MAAM,SAAS;GACvC,aAAa;EACf;EACA,SAAS,EACP,MAAM,CAAC,UAAU,OAAO,EAC1B;EACA,SAAS;GACP,MAAM;GACN,sBAAsB;GACtB,aACE;EACJ;EACA,WAAW,EACT,MAAM,qCACR;EACA,WAAW,EACT,MAAM,qCACR;EACA,WAAW,EACT,MAAM,qCACR;EACA,UAAU,EACR,MAAM,yCACR;CACF;AACF"}
1
+ {"version":3,"file":"emailMessage.js","names":[],"sources":["../../.generated/schemas/emailMessage.ts"],"sourcesContent":["import defs, { ISODateString } from \"./definitions\";\nimport type { FromSchema } from \"json-schema-to-ts\";\n\nexport const emailMessageSchema = {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"emailMessage.json\",\n title: \"Email Message\",\n type: \"object\",\n required: [\"id\", \"type\", \"to\", \"from\", \"status\", \"subject\"],\n additionalProperties: false,\n properties: {\n id: {\n $ref: \"definitions.json#/definitions/id\",\n },\n propertyId: {\n type: \"string\",\n description: \"ID of the property this entity belongs to. Optional — used as a per-document filter inside the org-scoped database.\",\n },\n type: {\n type: \"string\",\n default: \"emailMessage\",\n enum: [\"emailMessage\"],\n },\n to: {\n type: \"string\",\n },\n from: {\n type: \"string\",\n description: \"Must be in the format of 'Sender <email@example.com>\",\n },\n subject: {\n type: \"string\",\n },\n status: {\n type: \"string\",\n enum: [\n \"queued\",\n \"sending\",\n \"sent\",\n \"deferred\",\n \"delivered\",\n \"undelivered\",\n \"bounced\",\n \"blocked\",\n \"receiving\",\n \"received\",\n \"opened\",\n \"clicked\",\n \"unsubscribed\",\n \"spamReport\",\n ],\n },\n statusMessage: {\n type: \"string\",\n },\n errorCode: {\n type: \"string\",\n description: \"Raw vendor delivery-failure code, e.g. Twilio 21610.\",\n },\n html: {\n type: \"string\",\n },\n text: {\n type: \"string\",\n },\n driver: {\n type: \"string\",\n },\n headers: {\n type: \"object\",\n additionalProperties: { type: \"string\" },\n description: \"Additional headers for the email message, key/value pairs\",\n },\n replyTo: {\n type: [\"string\", \"array\"],\n },\n cc: {\n type: [\"string\", \"array\"],\n items: { type: \"string\" },\n },\n bcc: {\n type: [\"string\", \"array\"],\n items: { type: \"string\" },\n },\n appData: {\n type: \"object\",\n additionalProperties: true,\n description:\n \"Additional data for the email message, used for custom data\",\n },\n createdAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n updatedAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n deletedAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n systemId: {\n $ref: \"definitions.json#/definitions/systemId\",\n },\n },\n} as const;\n\nexport type EmailMessageSchema = FromSchema<\n typeof emailMessageSchema,\n {\n references: [typeof defs];\n deserialize: [\n {\n pattern: {\n format: \"date-time\";\n };\n output: Date | ISODateString;\n },\n ];\n }\n>;\n"],"mappings":";AAGA,MAAa,qBAAqB;CAChC,SAAS;CACT,KAAK;CACL,OAAO;CACP,MAAM;CACN,UAAU;EAAC;EAAM;EAAQ;EAAM;EAAQ;EAAU;CAAS;CAC1D,sBAAsB;CACtB,YAAY;EACV,IAAI,EACF,MAAM,mCACR;EACA,YAAY;GACV,MAAM;GACN,aAAa;EACf;EACA,MAAM;GACJ,MAAM;GACN,SAAS;GACT,MAAM,CAAC,cAAc;EACvB;EACA,IAAI,EACF,MAAM,SACR;EACA,MAAM;GACJ,MAAM;GACN,aAAa;EACf;EACA,SAAS,EACP,MAAM,SACR;EACA,QAAQ;GACN,MAAM;GACN,MAAM;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;EACF;EACA,eAAe,EACb,MAAM,SACR;EACA,WAAW;GACT,MAAM;GACN,aAAa;EACf;EACA,MAAM,EACJ,MAAM,SACR;EACA,MAAM,EACJ,MAAM,SACR;EACA,QAAQ,EACN,MAAM,SACR;EACA,SAAS;GACP,MAAM;GACN,sBAAsB,EAAE,MAAM,SAAS;GACvC,aAAa;EACf;EACA,SAAS,EACP,MAAM,CAAC,UAAU,OAAO,EAC1B;EACA,IAAI;GACF,MAAM,CAAC,UAAU,OAAO;GACxB,OAAO,EAAE,MAAM,SAAS;EAC1B;EACA,KAAK;GACH,MAAM,CAAC,UAAU,OAAO;GACxB,OAAO,EAAE,MAAM,SAAS;EAC1B;EACA,SAAS;GACP,MAAM;GACN,sBAAsB;GACtB,aACE;EACJ;EACA,WAAW,EACT,MAAM,qCACR;EACA,WAAW,EACT,MAAM,qCACR;EACA,WAAW,EACT,MAAM,qCACR;EACA,UAAU,EACR,MAAM,yCACR;CACF;AACF"}
@@ -2,25 +2,26 @@ export { alarmSchema, type AlarmSchema } from "./alarm.js";
2
2
  export { announcementSchema, type AnnouncementSchema } from "./announcement.js";
3
3
  export { automationSchema, type AutomationSchema } from "./automation.js";
4
4
  export { billSchema, type BillSchema, type BillLine } from "./bill.js";
5
- export { billingCategorySchema, type BillingCategorySchema } from "./billingCategory.js";
5
+ export { billingCategorySchema, type BillingCategorySchema, } from "./billingCategory.js";
6
6
  export { cameraSchema, type CameraSchema } from "./camera.js";
7
7
  export { categorySchema, type CategorySchema } from "./category.js";
8
+ export { costSchema, type CostSchema, type CostBillingReviewEntry, } from "./cost.js";
8
9
  export { courtesySchema, type CourtesySchema } from "./courtesy.js";
9
10
  export { credentialSchema, type CredentialSchema } from "./credential.js";
10
11
  export { departmentSchema, type DepartmentSchema } from "./department.js";
11
12
  export { dimmerSchema, type DimmerSchema } from "./dimmer.js";
12
- export { discoveredDeviceSchema, type DiscoveredDeviceSchema } from "./discoveredDevice.js";
13
+ export { discoveredDeviceSchema, type DiscoveredDeviceSchema, } from "./discoveredDevice.js";
13
14
  export { emailMessageSchema, type EmailMessageSchema } from "./emailMessage.js";
14
15
  export { energyReportSchema, type EnergyReportSchema } from "./energyReport.js";
15
- export { energyReportShardSchema, type EnergyReportShardSchema } from "./energyReportShard.js";
16
+ export { energyReportShardSchema, type EnergyReportShardSchema, } from "./energyReportShard.js";
16
17
  export { gatewaySchema, type GatewaySchema } from "./gateway.js";
17
18
  export { groupSchema, type GroupSchema } from "./group.js";
18
- export { identificationSchema, type IdentificationSchema } from "./identification.js";
19
+ export { identificationSchema, type IdentificationSchema, } from "./identification.js";
19
20
  export { integrationSchema, type IntegrationSchema } from "./integration.js";
20
21
  export { issueSchema, type IssueSchema } from "./issue.js";
21
22
  export { lockSchema, type LockSchema } from "./lock.js";
22
23
  export { logSchema, type LogSchema } from "./log.js";
23
- export { mediaFileSchema, type MediaFileSchema, methods as mediaFileMethods } from "./mediaFile.js";
24
+ export { mediaFileSchema, type MediaFileSchema, methods as mediaFileMethods, } from "./mediaFile.js";
24
25
  export { mediaSourceSchema, type MediaSourceSchema } from "./mediaSource.js";
25
26
  export { motionSensorSchema, type MotionSensorSchema } from "./motionSensor.js";
26
27
  export { notificationSchema, type NotificationSchema } from "./notification.js";
@@ -46,4 +47,4 @@ export { ticketSchema, type TicketSchema } from "./ticket.js";
46
47
  export { timeSheetSchema, type TimeSheetSchema } from "./timeSheet.js";
47
48
  export { userSchema, type UserSchema, getters as userGetters } from "./user.js";
48
49
  export { vendorSchema, type VendorSchema } from "./vendor.js";
49
- export { windowCoveringSchema, type WindowCoveringSchema } from "./windowCovering.js";
50
+ export { windowCoveringSchema, type WindowCoveringSchema, } from "./windowCovering.js";
@@ -5,6 +5,7 @@ import { billSchema } from "./bill.js";
5
5
  import { billingCategorySchema } from "./billingCategory.js";
6
6
  import { cameraSchema } from "./camera.js";
7
7
  import { categorySchema } from "./category.js";
8
+ import { costSchema } from "./cost.js";
8
9
  import { courtesySchema } from "./courtesy.js";
9
10
  import { credentialSchema } from "./credential.js";
10
11
  import { departmentSchema } from "./department.js";
@@ -47,4 +48,4 @@ import { timeSheetSchema } from "./timeSheet.js";
47
48
  import { getters, userSchema } from "./user.js";
48
49
  import { vendorSchema } from "./vendor.js";
49
50
  import { windowCoveringSchema } from "./windowCovering.js";
50
- export { alarmSchema, announcementSchema, automationSchema, billSchema, billingCategorySchema, cameraSchema, categorySchema, courtesySchema, credentialSchema, departmentSchema, dimmerSchema, discoveredDeviceSchema, emailMessageSchema, energyReportSchema, energyReportShardSchema, gatewaySchema, groupSchema, identificationSchema, integrationSchema, issueSchema, lockSchema, logSchema, methods as mediaFileMethods, mediaFileSchema, mediaSourceSchema, motionSensorSchema, notificationSchema, organizationSchema, paymentSchema, policySchema, productSchema, propertySchema, reservationSchema, resourceSchema, serverSchema, sessionSchema, shortLinkSchema, smsMessageSchema, sosEventSchema, sosTypeSchema, spaceSchema, switchSchema, systemSchema, systemUserSchema, thermostatSchema, ticketSchema, timeSheetSchema, getters as userGetters, userSchema, vendorSchema, windowCoveringSchema };
51
+ export { alarmSchema, announcementSchema, automationSchema, billSchema, billingCategorySchema, cameraSchema, categorySchema, costSchema, courtesySchema, credentialSchema, departmentSchema, dimmerSchema, discoveredDeviceSchema, emailMessageSchema, energyReportSchema, energyReportShardSchema, gatewaySchema, groupSchema, identificationSchema, integrationSchema, issueSchema, lockSchema, logSchema, methods as mediaFileMethods, mediaFileSchema, mediaSourceSchema, motionSensorSchema, notificationSchema, organizationSchema, paymentSchema, policySchema, productSchema, propertySchema, reservationSchema, resourceSchema, serverSchema, sessionSchema, shortLinkSchema, smsMessageSchema, sosEventSchema, sosTypeSchema, spaceSchema, switchSchema, systemSchema, systemUserSchema, thermostatSchema, ticketSchema, timeSheetSchema, getters as userGetters, userSchema, vendorSchema, windowCoveringSchema };
@@ -693,7 +693,7 @@ export declare const ticketSchema: {
693
693
  readonly amount: {
694
694
  readonly type: "integer";
695
695
  readonly minimum: 0;
696
- readonly description: "Customer price in integer cents.";
696
+ readonly description: "The amount in integer cents.";
697
697
  };
698
698
  readonly recordedBy: {
699
699
  readonly type: "string";
@@ -709,12 +709,12 @@ export declare const ticketSchema: {
709
709
  readonly type: "object";
710
710
  readonly additionalProperties: false;
711
711
  readonly required: readonly ["amount", "recordedBy", "recordedAt"];
712
- readonly description: "The vendor cost estimate phase of the entry.";
712
+ readonly description: string;
713
713
  readonly properties: {
714
714
  readonly amount: {
715
715
  readonly type: "integer";
716
716
  readonly minimum: 0;
717
- readonly description: "Vendor cost estimate in integer cents.";
717
+ readonly description: "The amount in integer cents.";
718
718
  };
719
719
  readonly recordedBy: {
720
720
  readonly type: "string";
@@ -730,12 +730,12 @@ export declare const ticketSchema: {
730
730
  readonly type: "object";
731
731
  readonly additionalProperties: false;
732
732
  readonly required: readonly ["amount", "recordedBy", "recordedAt"];
733
- readonly description: "The actual vendor cost phase of the entry, recorded after the work.";
733
+ readonly description: string;
734
734
  readonly properties: {
735
735
  readonly amount: {
736
736
  readonly type: "integer";
737
737
  readonly minimum: 0;
738
- readonly description: "Actual vendor cost in integer cents.";
738
+ readonly description: "The amount in integer cents.";
739
739
  };
740
740
  readonly recordedBy: {
741
741
  readonly type: "string";
@@ -754,40 +754,34 @@ export declare const ticketSchema: {
754
754
  readonly properties: {
755
755
  readonly percent: {
756
756
  readonly type: "number";
757
- readonly minimum: 0;
758
757
  readonly description: string;
759
758
  };
760
759
  readonly custom: {
761
760
  readonly type: "boolean";
762
761
  readonly default: false;
763
- readonly description: "Whether the percent was manually overridden rather than keyed from the configured markup tiers. Custom percents are never re-keyed on estimate edits.";
762
+ readonly description: string;
764
763
  };
765
764
  };
766
765
  };
767
- readonly vendorInvoices: {
768
- readonly type: "array";
769
- readonly items: {
770
- readonly $ref: "mediaFile.json";
771
- };
772
- readonly default: readonly [];
773
- readonly description: string;
774
- };
775
- readonly vendorInvoiceNumber: {
766
+ readonly vendorId: {
776
767
  readonly type: readonly ["string", "null"];
777
768
  readonly default: null;
778
769
  readonly description: string;
779
770
  };
780
- readonly vendorId: {
771
+ readonly categoryId: {
781
772
  readonly type: readonly ["string", "null"];
782
773
  readonly default: null;
783
774
  readonly description: string;
784
775
  };
785
- readonly workItemId: {
786
- readonly type: readonly ["string", "null"];
787
- readonly default: null;
776
+ readonly vendorInvoices: {
777
+ readonly type: "array";
778
+ readonly items: {
779
+ readonly $ref: "mediaFile.json";
780
+ };
781
+ readonly default: readonly [];
788
782
  readonly description: string;
789
783
  };
790
- readonly categoryId: {
784
+ readonly vendorInvoiceNumber: {
791
785
  readonly type: readonly ["string", "null"];
792
786
  readonly default: null;
793
787
  readonly description: string;
@@ -802,11 +796,6 @@ export declare const ticketSchema: {
802
796
  readonly default: false;
803
797
  readonly description: string;
804
798
  };
805
- readonly voided: {
806
- readonly type: "boolean";
807
- readonly default: false;
808
- readonly description: string;
809
- };
810
799
  readonly billingReview: {
811
800
  readonly type: "array";
812
801
  readonly default: readonly [];
@@ -851,6 +840,16 @@ export declare const ticketSchema: {
851
840
  };
852
841
  };
853
842
  };
843
+ readonly workItemId: {
844
+ readonly type: readonly ["string", "null"];
845
+ readonly default: null;
846
+ readonly description: string;
847
+ };
848
+ readonly voided: {
849
+ readonly type: "boolean";
850
+ readonly default: false;
851
+ readonly description: string;
852
+ };
854
853
  };
855
854
  }, {
856
855
  readonly type: "object";