@kohost/api-client 7.14.1 → 7.16.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/dist/.tsbuildinfo +1 -1
- package/dist/models/ticket.js +2 -0
- package/dist/models/ticket.js.map +1 -1
- package/dist/schemas/bill.d.ts +25 -0
- package/dist/schemas/bill.js +25 -0
- package/dist/schemas/bill.js.map +1 -1
- package/dist/schemas/costEntry.d.ts +27 -0
- package/dist/schemas/costEntry.js +36 -21
- package/dist/schemas/costEntry.js.map +1 -1
- package/dist/schemas/definitions.d.ts +1 -1
- package/dist/schemas/definitions.js +1 -0
- package/dist/schemas/definitions.js.map +1 -1
- package/dist/schemas/ticket.d.ts +200 -44
- package/dist/schemas/ticket.js +179 -3
- package/dist/schemas/ticket.js.map +1 -1
- package/dist/useCases/clearAwaitingResponse.d.ts +36 -0
- package/dist/useCases/clearAwaitingResponse.js +47 -0
- package/dist/useCases/clearAwaitingResponse.js.map +1 -0
- package/dist/useCases/clearWorkItemVerification.d.ts +39 -0
- package/dist/useCases/clearWorkItemVerification.js +47 -0
- package/dist/useCases/clearWorkItemVerification.js.map +1 -0
- package/dist/useCases/describeConciergeBillsSummary.d.ts +27 -0
- package/dist/useCases/describeConciergeBillsSummary.js +47 -0
- package/dist/useCases/describeConciergeBillsSummary.js.map +1 -0
- package/dist/useCases/describeConciergeStageCounts.d.ts +27 -0
- package/dist/useCases/describeConciergeStageCounts.js +47 -0
- package/dist/useCases/describeConciergeStageCounts.js.map +1 -0
- package/dist/useCases/index.d.ts +7 -0
- package/dist/useCases/index.js +15 -1
- package/dist/useCases/index.js.map +1 -1
- package/dist/useCases/listConciergeWorkspaceBillLines.d.ts +27 -0
- package/dist/useCases/listConciergeWorkspaceBillLines.js +47 -0
- package/dist/useCases/listConciergeWorkspaceBillLines.js.map +1 -0
- package/dist/useCases/setAwaitingResponse.d.ts +36 -0
- package/dist/useCases/setAwaitingResponse.js +47 -0
- package/dist/useCases/setAwaitingResponse.js.map +1 -0
- package/dist/useCases/verifyWorkItem.d.ts +39 -0
- package/dist/useCases/verifyWorkItem.js +47 -0
- package/dist/useCases/verifyWorkItem.js.map +1 -0
- package/package.json +1 -1
package/dist/models/ticket.js
CHANGED
|
@@ -27,7 +27,9 @@ var Ticket = class extends Entity {
|
|
|
27
27
|
if (data.costs !== void 0) this.costs = data.costs;
|
|
28
28
|
if (data.approvals !== void 0) this.approvals = data.approvals;
|
|
29
29
|
if (data.dneAmount !== void 0) this.dneAmount = data.dneAmount;
|
|
30
|
+
if (data.stages !== void 0) this.stages = data.stages;
|
|
30
31
|
if (data.approvalState !== void 0) this.approvalState = data.approvalState;
|
|
32
|
+
if (data.awaitingResponse !== void 0) this.awaitingResponse = data.awaitingResponse;
|
|
31
33
|
this.tags = data.tags;
|
|
32
34
|
if (data.rating !== void 0) this.rating = data.rating;
|
|
33
35
|
if (data.ratingComment !== void 0) this.ratingComment = data.ratingComment;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ticket.js","names":["validate"],"sources":["../../.generated/models/ticket.ts"],"sourcesContent":["/* This file is automatically generated. Do not modify it manually. */\n\nimport { Entity } from \"./entity.js\";\nimport { validateTicket as validate } from \"../validate.js\";\nimport { ticketSchema, type TicketSchema } from \"../schemas/ticket.js\";\n\n/**\n * Data type for Ticket constructor - exported for backwards compatibility\n */\nexport type TicketData = TicketSchema;\n\n/**\n * A ticket is a request from a user.\n */\nexport interface Ticket extends TicketSchema {}\nexport class Ticket extends Entity {\n declare schema: typeof ticketSchema;\n declare validator: typeof validate;\n\n constructor(data: TicketSchema) {\n super(data);\n this.id = data.id;\n if (data.propertyId !== undefined) this.propertyId = data.propertyId;\n if (data.type !== undefined) this.type = data.type;\n if (data.number !== undefined) this.number = data.number;\n if (data.issueId !== undefined) this.issueId = data.issueId;\n if (data.parentAutomationId !== undefined) this.parentAutomationId = data.parentAutomationId;\n this.conversation = data.conversation;\n if (data.subject !== undefined) this.subject = data.subject;\n this.openedBy = data.openedBy;\n this.requester = data.requester;\n this.assignedTo = data.assignedTo;\n if (data.notify !== undefined) this.notify = data.notify;\n if (data.collaborators !== undefined) this.collaborators = data.collaborators;\n if (data.location !== undefined) this.location = data.location;\n this.status = data.status;\n this.priority = data.priority;\n if (data.priorityRank !== undefined) this.priorityRank = data.priorityRank;\n if (data.reopenCount !== undefined) this.reopenCount = data.reopenCount;\n if (data.work !== undefined) this.work = data.work;\n if (data.costs !== undefined) this.costs = data.costs;\n if (data.approvals !== undefined) this.approvals = data.approvals;\n if (data.dneAmount !== undefined) this.dneAmount = data.dneAmount;\n if (data.approvalState !== undefined) this.approvalState = data.approvalState;\n this.tags = data.tags;\n if (data.rating !== undefined) this.rating = data.rating;\n if (data.ratingComment !== undefined) this.ratingComment = data.ratingComment;\n if (data.scheduleDate !== undefined) this.scheduleDate = data.scheduleDate;\n this.createdAt = data.createdAt;\n this.updatedAt = data.updatedAt;\n if (data.solvedAt !== undefined) this.solvedAt = data.solvedAt;\n if (data.lastMessageAt !== undefined) this.lastMessageAt = data.lastMessageAt;\n if (data.closedAt !== undefined) this.closedAt = data.closedAt;\n if (data.deletedAt !== undefined) this.deletedAt = data.deletedAt;\n }\n\n\n\n\n\n\n\n\n}\n\nObject.defineProperty(Ticket.prototype, \"schema\", {\n value: ticketSchema\n});\n\nObject.defineProperty(Ticket.prototype, \"validator\", {\n get: function() { return validate; }\n});\n"],"mappings":";;;;AAeA,IAAa,SAAb,cAA4B,OAAO;CAIjC,YAAY,MAAoB;EAC9B,MAAM,IAAI;EACV,KAAK,KAAK,KAAK;EACf,IAAI,KAAK,eAAe,KAAA,GAAW,KAAK,aAAa,KAAK;EAC1D,IAAI,KAAK,SAAS,KAAA,GAAW,KAAK,OAAO,KAAK;EAC9C,IAAI,KAAK,WAAW,KAAA,GAAW,KAAK,SAAS,KAAK;EAClD,IAAI,KAAK,YAAY,KAAA,GAAW,KAAK,UAAU,KAAK;EACpD,IAAI,KAAK,uBAAuB,KAAA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W,KAAK,YAAY,KAAK;CAC1D;AASF;AAEA,OAAO,eAAe,OAAO,WAAW,UAAU,EAChD,OAAO,aACT,CAAC;AAED,OAAO,eAAe,OAAO,WAAW,aAAa,EACnD,KAAK,WAAW;CAAE,OAAOA;AAAU,EACrC,CAAC"}
|
|
1
|
+
{"version":3,"file":"ticket.js","names":["validate"],"sources":["../../.generated/models/ticket.ts"],"sourcesContent":["/* This file is automatically generated. Do not modify it manually. */\n\nimport { Entity } from \"./entity.js\";\nimport { validateTicket as validate } from \"../validate.js\";\nimport { ticketSchema, type TicketSchema } from \"../schemas/ticket.js\";\n\n/**\n * Data type for Ticket constructor - exported for backwards compatibility\n */\nexport type TicketData = TicketSchema;\n\n/**\n * A ticket is a request from a user.\n */\nexport interface Ticket extends TicketSchema {}\nexport class Ticket extends Entity {\n declare schema: typeof ticketSchema;\n declare validator: typeof validate;\n\n constructor(data: TicketSchema) {\n super(data);\n this.id = data.id;\n if (data.propertyId !== undefined) this.propertyId = data.propertyId;\n if (data.type !== undefined) this.type = data.type;\n if (data.number !== undefined) this.number = data.number;\n if (data.issueId !== undefined) this.issueId = data.issueId;\n if (data.parentAutomationId !== undefined) this.parentAutomationId = data.parentAutomationId;\n this.conversation = data.conversation;\n if (data.subject !== undefined) this.subject = data.subject;\n this.openedBy = data.openedBy;\n this.requester = data.requester;\n this.assignedTo = data.assignedTo;\n if (data.notify !== undefined) this.notify = data.notify;\n if (data.collaborators !== undefined) this.collaborators = data.collaborators;\n if (data.location !== undefined) this.location = data.location;\n this.status = data.status;\n this.priority = data.priority;\n if (data.priorityRank !== undefined) this.priorityRank = data.priorityRank;\n if (data.reopenCount !== undefined) this.reopenCount = data.reopenCount;\n if (data.work !== undefined) this.work = data.work;\n if (data.costs !== undefined) this.costs = data.costs;\n if (data.approvals !== undefined) this.approvals = data.approvals;\n if (data.dneAmount !== undefined) this.dneAmount = data.dneAmount;\n if (data.stages !== undefined) this.stages = data.stages;\n if (data.approvalState !== undefined) this.approvalState = data.approvalState;\n if (data.awaitingResponse !== undefined) this.awaitingResponse = data.awaitingResponse;\n this.tags = data.tags;\n if (data.rating !== undefined) this.rating = data.rating;\n if (data.ratingComment !== undefined) this.ratingComment = data.ratingComment;\n if (data.scheduleDate !== undefined) this.scheduleDate = data.scheduleDate;\n this.createdAt = data.createdAt;\n this.updatedAt = data.updatedAt;\n if (data.solvedAt !== undefined) this.solvedAt = data.solvedAt;\n if (data.lastMessageAt !== undefined) this.lastMessageAt = data.lastMessageAt;\n if (data.closedAt !== undefined) this.closedAt = data.closedAt;\n if (data.deletedAt !== undefined) this.deletedAt = data.deletedAt;\n }\n\n\n\n\n\n\n\n\n}\n\nObject.defineProperty(Ticket.prototype, \"schema\", {\n value: ticketSchema\n});\n\nObject.defineProperty(Ticket.prototype, \"validator\", {\n get: function() { return validate; }\n});\n"],"mappings":";;;;AAeA,IAAa,SAAb,cAA4B,OAAO;CAIjC,YAAY,MAAoB;EAC9B,MAAM,IAAI;EACV,KAAK,KAAK,KAAK;EACf,IAAI,KAAK,eAAe,KAAA,GAAW,KAAK,aAAa,KAAK;EAC1D,IAAI,KAAK,SAAS,KAAA,GAAW,KAAK,OAAO,KAAK;EAC9C,IAAI,KAAK,WAAW,KAAA,GAAW,KAAK,SAAS,KAAK;EAClD,IAAI,KAAK,YAAY,KAAA,GAAW,KAAK,UAAU,KAAK;EACpD,IAAI,KAAK,uBAAuB,KAAA,GAAW,KAAK,qBAAqB,KAAK;EAC1E,KAAK,eAAe,KAAK;EACzB,IAAI,KAAK,YAAY,KAAA,GAAW,KAAK,UAAU,KAAK;EACpD,KAAK,WAAW,KAAK;EACrB,KAAK,YAAY,KAAK;EACtB,KAAK,aAAa,KAAK;EACvB,IAAI,KAAK,WAAW,KAAA,GAAW,KAAK,SAAS,KAAK;EAClD,IAAI,KAAK,kBAAkB,KAAA,GAAW,KAAK,gBAAgB,KAAK;EAChE,IAAI,KAAK,aAAa,KAAA,GAAW,KAAK,WAAW,KAAK;EACtD,KAAK,SA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|
120
120
|
readonly default: null;
|
|
121
121
|
readonly description: string;
|
|
122
122
|
};
|
|
123
|
+
readonly propertyId: {
|
|
124
|
+
readonly type: readonly ["string", "null"];
|
|
125
|
+
readonly default: null;
|
|
126
|
+
readonly description: string;
|
|
127
|
+
};
|
|
128
|
+
readonly ticketNumber: {
|
|
129
|
+
readonly type: readonly ["string", "null"];
|
|
130
|
+
readonly default: null;
|
|
131
|
+
readonly description: string;
|
|
132
|
+
};
|
|
123
133
|
readonly categoryId: {
|
|
124
134
|
readonly type: readonly ["string", "null"];
|
|
125
135
|
readonly default: null;
|
|
@@ -151,6 +161,21 @@ export declare const billSchema: {
|
|
|
151
161
|
readonly default: null;
|
|
152
162
|
readonly description: string;
|
|
153
163
|
};
|
|
164
|
+
readonly vendorCost: {
|
|
165
|
+
readonly type: readonly ["integer", "null"];
|
|
166
|
+
readonly default: null;
|
|
167
|
+
readonly description: string;
|
|
168
|
+
};
|
|
169
|
+
readonly vendorId: {
|
|
170
|
+
readonly type: readonly ["string", "null"];
|
|
171
|
+
readonly default: null;
|
|
172
|
+
readonly description: string;
|
|
173
|
+
};
|
|
174
|
+
readonly hasActual: {
|
|
175
|
+
readonly type: "boolean";
|
|
176
|
+
readonly default: false;
|
|
177
|
+
readonly description: string;
|
|
178
|
+
};
|
|
154
179
|
readonly taxable: {
|
|
155
180
|
readonly type: "boolean";
|
|
156
181
|
readonly default: false;
|
package/dist/schemas/bill.js
CHANGED
|
@@ -121,6 +121,16 @@ const billSchema = {
|
|
|
121
121
|
default: null,
|
|
122
122
|
description: "The ID of the claimed cost entry: an entry within the ticket on a `ticket` line, a costs-collection document on an `adhoc` one."
|
|
123
123
|
},
|
|
124
|
+
propertyId: {
|
|
125
|
+
type: ["string", "null"],
|
|
126
|
+
default: null,
|
|
127
|
+
description: "The property the claimed entry belongs to, snapshotted at mark-sent: the source ticket's property on a `ticket` line, the ad hoc entry's attributed property on an `adhoc` one. Lets a cross-organization reader reach the ticket's property scope without a ticket read. Internal, redacted org-side."
|
|
128
|
+
},
|
|
129
|
+
ticketNumber: {
|
|
130
|
+
type: ["string", "null"],
|
|
131
|
+
default: null,
|
|
132
|
+
description: "The source ticket's number, snapshotted at mark-sent. Null on an `adhoc` line. Internal, redacted org-side."
|
|
133
|
+
},
|
|
124
134
|
categoryId: {
|
|
125
135
|
type: ["string", "null"],
|
|
126
136
|
default: null,
|
|
@@ -152,6 +162,21 @@ const billSchema = {
|
|
|
152
162
|
default: null,
|
|
153
163
|
description: "The line description, snapshotted at mark-sent. Null while drafting, when it live-reads from the cost entry."
|
|
154
164
|
},
|
|
165
|
+
vendorCost: {
|
|
166
|
+
type: ["integer", "null"],
|
|
167
|
+
default: null,
|
|
168
|
+
description: "What the claimed entry costs Kohost in integer cents, snapshotted at mark-sent: the vendor actual when recorded, else the estimate. Null while drafting or when the entry carries neither. Re-patched when a late actual lands. Internal, redacted org-side."
|
|
169
|
+
},
|
|
170
|
+
vendorId: {
|
|
171
|
+
type: ["string", "null"],
|
|
172
|
+
default: null,
|
|
173
|
+
description: "The org-scoped Vendor named on the claimed entry, snapshotted at mark-sent. Internal, redacted org-side."
|
|
174
|
+
},
|
|
175
|
+
hasActual: {
|
|
176
|
+
type: "boolean",
|
|
177
|
+
default: false,
|
|
178
|
+
description: "Whether `vendorCost` is the vendor's settled actual rather than the estimate, snapshotted at mark-sent and re-patched when the actual lands. Internal, redacted org-side."
|
|
179
|
+
},
|
|
155
180
|
taxable: {
|
|
156
181
|
type: "boolean",
|
|
157
182
|
default: false,
|
package/dist/schemas/bill.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bill.js","names":[],"sources":["../../.generated/schemas/bill.ts"],"sourcesContent":["import defs, { ISODateString } from \"./definitions\";\nimport type { FromSchema } from \"json-schema-to-ts\";\nimport { mediaFileSchema } from \"./mediaFile\";\n\n// One bill line is a discriminated union on `type`, so `lines.items` is their\n// `oneOf`. The two branches are disjoint via the `type` const plus\n// `additionalProperties: false`, so a line validates against exactly one.\n//\n// A cost line always names its entry by `costId`; `source` says which\n// collection to look it up in. A `ticket` line resolves through\n// `(ticketId, costId)`, an `adhoc` line reads `costId` straight off the costs\n// collection with `ticketId` null. The claim path is what pairs the two, since\n// JSON Schema cannot state the pairing without splitting the branch and\n// breaking the `type` discriminator every reader keys off.\n//\n// While the bill is a draft the line carries only the reference, the picked\n// `categoryId`, and any draft-time adjustment; the customer-facing `amount`,\n// `description`, and `categoryName` are live-read from the claimed entry and\n// snapshotted onto the line at mark-sent. The billed amount is the marked-up\n// actual (or the `adjustedAmount` override, floored at zero) — vendor truth on\n// the entry is never touched.\nconst costLineSchema = {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"type\"],\n properties: {\n id: {\n type: \"string\",\n description: \"Server-minted ID of the bill line.\",\n },\n type: {\n type: \"string\",\n enum: [\"cost\"],\n description: \"Discriminator: a line drawn from a recorded cost entry.\",\n },\n source: {\n type: \"string\",\n enum: [\"ticket\", \"adhoc\"],\n default: \"ticket\",\n description:\n \"Where the claimed cost entry lives, and therefore how `costId` \" +\n \"resolves: on a ticket, or in the costs collection.\",\n },\n ticketId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The ID of the ticket the claimed cost entry lives on. Null on an \" +\n \"`adhoc` line, which no ticket carries.\",\n },\n costId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The ID of the claimed cost entry: an entry within the ticket on a \" +\n \"`ticket` line, a costs-collection document on an `adhoc` one.\",\n },\n categoryId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The picked billing category, inherited from the claimed cost entry \" +\n \"when the claim does not name one. Optional while drafting, required \" +\n \"at mark-sent. Manual pick — never derived from the ticket's issue.\",\n },\n categoryName: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The category name snapshotted at mark-sent. Null while drafting, \" +\n \"when it live-reads from the category library.\",\n },\n adjustedAmount: {\n type: [\"integer\", \"null\"],\n minimum: 0,\n default: null,\n description:\n \"Optional draft-time override of the billed amount in integer cents, \" +\n \"floored at zero, replacing the marked-up actual at display and \" +\n \"snapshot. Requires `adjustmentReason`. A credit (below zero) is a \" +\n \"manual line instead.\",\n },\n adjustmentReason: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"Short required reason accompanying `adjustedAmount`, kept for the \" +\n \"internal record.\",\n },\n amount: {\n type: [\"integer\", \"null\"],\n default: null,\n description:\n \"The billed amount in integer cents, snapshotted at mark-sent. Null \" +\n \"while drafting, when it live-reads (marked-up actual or the \" +\n \"adjustment) from the cost entry.\",\n },\n description: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The line description, snapshotted at mark-sent. Null while drafting, \" +\n \"when it live-reads from the cost entry.\",\n },\n taxable: {\n type: \"boolean\",\n default: false,\n description:\n \"Whether the line's amount joins the bill's taxable subtotal. \" +\n \"Customer-facing: locks at mark-sent.\",\n },\n },\n} as const;\n\n// A manual line is a literal customer-facing row with no markup math: a\n// `description` and `amount` (which may be negative, serving as a credit) and\n// an optional `propertyId`. The independent internal fields — informational\n// `cost` (never derives the amount), `vendorId`, the vendor-invoice file, and\n// `vendorInvoiceNumber` — are redacted org-side via `canSeeCostSplit` and stay\n// editable in any bill state.\nconst manualLineSchema = {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"type\", \"description\", \"amount\"],\n properties: {\n id: {\n type: \"string\",\n description: \"Server-minted ID of the bill line.\",\n },\n type: {\n type: \"string\",\n enum: [\"manual\"],\n description: \"Discriminator: a literal, non-ticket line.\",\n },\n description: {\n type: \"string\",\n minLength: 1,\n description: \"The literal customer-facing description.\",\n },\n amount: {\n type: \"integer\",\n description:\n \"The billed amount in integer cents. May be negative, serving as a \" +\n \"credit (reference the reason in the description).\",\n },\n propertyId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The property the manual line is attributed to, when it concerns one.\",\n },\n categoryId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The picked billing category. Optional while drafting, required at \" +\n \"mark-sent.\",\n },\n categoryName: {\n type: [\"string\", \"null\"],\n default: null,\n description: \"The category name snapshotted at mark-sent.\",\n },\n cost: {\n type: [\"integer\", \"null\"],\n default: null,\n description:\n \"Informational internal vendor cost in integer cents. Never derives \" +\n \"the amount. Redacted org-side.\",\n },\n vendorId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"Optional reference to the org-scoped Vendor. Internal, redacted \" +\n \"org-side.\",\n },\n vendorInvoice: {\n anyOf: [{ $ref: \"mediaFile.json\" }, { type: \"null\" }],\n default: null,\n description:\n \"The vendor's invoice file backing the line, mirroring the cost-entry \" +\n \"field. Internal, redacted org-side.\",\n },\n vendorInvoiceNumber: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The vendor's own invoice number. Internal, redacted org-side.\",\n },\n taxable: {\n type: \"boolean\",\n default: false,\n description:\n \"Whether the line's amount joins the bill's taxable subtotal. \" +\n \"Customer-facing: locks at mark-sent.\",\n },\n },\n} as const;\n\nexport const billSchema = {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"bill.json\",\n title: \"Bill\",\n description:\n \"A OneBill bill, stored platform-wide and stamped with its organization: \" +\n \"KFC staff assemble billed lines from the \" +\n \"uninvoiced cost pool (plus manual lines) into a draft, then mark it sent \" +\n \"to freeze and reveal it to the customer. Lifecycle draft → sent → paid, \" +\n \"plus void. Customers see a bill in-app only once sent.\",\n type: \"object\",\n required: [\"id\", \"organizationId\", \"status\", \"currency\", \"lines\"],\n additionalProperties: false,\n properties: {\n id: {\n $ref: \"definitions.json#/definitions/id\",\n },\n type: {\n type: \"string\",\n enum: [\"bill\"],\n default: \"bill\",\n },\n organizationId: {\n type: \"string\",\n description:\n \"The organization the bill invoices. Bills live in one admin-database \" +\n \"collection across every organization, so each carries its owner \" +\n \"explicitly — stamped from the request context at creation, never \" +\n \"client-supplied.\",\n },\n status: {\n type: \"string\",\n enum: [\"draft\", \"sent\", \"paid\", \"void\"],\n default: \"draft\",\n description:\n \"Lifecycle state. `sent` freezes customer-facing fields and reveals \" +\n \"the bill to the org; `paid` records manual payment; `void` releases \" +\n \"cost-entry claims and hides the bill from the org view. Drafts \" +\n \"hard-delete rather than voiding.\",\n },\n invoiceNumber: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"Kohost's own invoice number, `KB-<n>` from a single global sequence. \" +\n \"System-assigned at mark-sent and never entered by hand: null while \" +\n \"the bill is a draft, immutable once set. A wrong bill is corrected \" +\n \"by void-and-reissue, so numbers gap and are never reused.\",\n },\n period: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n 'Display-only month label (e.g. \"July 2026\"). A UI hint; the bill\\'s ' +\n \"membership is defined by its lines, not a calendar bucket.\",\n },\n currency: {\n type: \"string\",\n enum: [\"USD\"],\n default: \"USD\",\n description: \"ISO 4217 currency code. USD only in v1.\",\n },\n fileId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The generated bill PDF's media-file ID, minted atomically at \" +\n \"mark-sent.\",\n },\n fileUrl: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The generated bill PDF's file-store URL, snapshotted at mark-sent \" +\n \"alongside fileId. Held so the sent-bill surface and the sent \" +\n \"notification email can mint a signed, unauthenticated download link \" +\n \"without a file lookup. Unsigned on its own (a bare link 401s).\",\n },\n memo: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"Internal KFC-only note. Never customer-facing; editable in any state.\",\n },\n billingAddress: {\n anyOf: [\n { $ref: \"definitions.json#/definitions/address\" },\n { type: \"null\" },\n ],\n default: null,\n description:\n \"The org billing address snapshotted at mark-sent. Null while \" +\n \"drafting, when it live-reads from the Organization. Mark-sent \" +\n \"requires a complete address (line1, city, state, postalCode).\",\n },\n taxRate: {\n type: [\"number\", \"null\"],\n default: null,\n minimum: 0,\n description:\n \"Tax rate as a plain float percent applied to the taxable line \" +\n \"subtotal. While drafting, null means the platform default rate; the \" +\n \"effective rate is snapshotted at mark-sent.\",\n },\n taxExempt: {\n type: \"boolean\",\n default: false,\n description:\n \"The organization's tax exemption snapshotted at mark-sent. While \" +\n \"drafting it live-reads from the Organization.\",\n },\n shippingAmount: {\n type: [\"integer\", \"null\"],\n default: null,\n minimum: 0,\n description:\n \"Shipping & handling in integer cents, added to the grand total on \" +\n \"top of the line subtotal and tax. Null means none.\",\n },\n lines: {\n type: \"array\",\n default: [],\n description:\n \"The bill's lines: cost lines claimed from the uninvoiced pool and \" +\n \"literal manual lines.\",\n items: {\n oneOf: [costLineSchema, manualLineSchema],\n },\n },\n sentAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the bill was marked sent. Absent until sent.\",\n },\n paidAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the bill was marked paid. Absent until paid.\",\n },\n voidedAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the bill was voided. Absent unless voided.\",\n },\n createdAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n updatedAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n },\n} as const;\n\nexport type BillSchema = FromSchema<\n typeof billSchema,\n {\n references: [typeof defs, typeof mediaFileSchema];\n deserialize: [\n {\n pattern: {\n format: \"date-time\";\n };\n output: Date | ISODateString;\n },\n ];\n }\n>;\n\n/** One line on a bill: a cost line or a manual line. */\nexport type BillLine = NonNullable<BillSchema[\"lines\"]>[number];\n"],"mappings":"AAwMA,MAAa,aAAa;CACxB,SAAS;CACT,KAAK;CACL,OAAO;CACP,aACE;CAKF,MAAM;CACN,UAAU;EAAC;EAAM;EAAkB;EAAU;EAAY;CAAO;CAChE,sBAAsB;CACtB,YAAY;EACV,IAAI,EACF,MAAM,mCACR;EACA,MAAM;GACJ,MAAM;GACN,MAAM,CAAC,MAAM;GACb,SAAS;EACX;EACA,gBAAgB;GACd,MAAM;GACN,aACE;EAIJ;EACA,QAAQ;GACN,MAAM;GACN,MAAM;IAAC;IAAS;IAAQ;IAAQ;GAAM;GACtC,SAAS;GACT,aACE;EAIJ;EACA,eAAe;GACb,MAAM,CAAC,UAAU,MAAM;GAC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MAAM;MACN,SAAS;MACT,aACE;KAEJ;IACF;GAiI8B,CAAgB,EAC1C;EACF;EACA,QAAQ;GACN,MAAM;GACN,aAAa;EACf;EACA,QAAQ;GACN,MAAM;GACN,aAAa;EACf;EACA,UAAU;GACR,MAAM;GACN,aAAa;EACf;EACA,WAAW,EACT,MAAM,qCACR;EACA,WAAW,EACT,MAAM,qCACR;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"bill.js","names":[],"sources":["../../.generated/schemas/bill.ts"],"sourcesContent":["import defs, { ISODateString } from \"./definitions\";\nimport type { FromSchema } from \"json-schema-to-ts\";\nimport { mediaFileSchema } from \"./mediaFile\";\n\n// One bill line is a discriminated union on `type`, so `lines.items` is their\n// `oneOf`. The two branches are disjoint via the `type` const plus\n// `additionalProperties: false`, so a line validates against exactly one.\n//\n// A cost line always names its entry by `costId`; `source` says which\n// collection to look it up in. A `ticket` line resolves through\n// `(ticketId, costId)`, an `adhoc` line reads `costId` straight off the costs\n// collection with `ticketId` null. The claim path is what pairs the two, since\n// JSON Schema cannot state the pairing without splitting the branch and\n// breaking the `type` discriminator every reader keys off.\n//\n// While the bill is a draft the line carries only the reference, the picked\n// `categoryId`, and any draft-time adjustment; the customer-facing `amount`,\n// `description`, and `categoryName` are live-read from the claimed entry and\n// snapshotted onto the line at mark-sent. The billed amount is the marked-up\n// actual (or the `adjustedAmount` override, floored at zero) — vendor truth on\n// the entry is never touched.\n//\n// `vendorCost`, `vendorId` and `hasActual` are a derived snapshot of that\n// vendor truth, written at mark-sent beside `amount` and re-patched when a\n// late actual lands on the claimed entry, so the transactions view and period\n// margin read one collection. `propertyId` and `ticketNumber` are snapshotted\n// beside them so that reader can address the source ticket's property without\n// resolving the ticket. The entry stays the source of truth; the vendor\n// invoice number and files are read live from it, never snapshotted.\nconst costLineSchema = {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"type\"],\n properties: {\n id: {\n type: \"string\",\n description: \"Server-minted ID of the bill line.\",\n },\n type: {\n type: \"string\",\n enum: [\"cost\"],\n description: \"Discriminator: a line drawn from a recorded cost entry.\",\n },\n source: {\n type: \"string\",\n enum: [\"ticket\", \"adhoc\"],\n default: \"ticket\",\n description:\n \"Where the claimed cost entry lives, and therefore how `costId` \" +\n \"resolves: on a ticket, or in the costs collection.\",\n },\n ticketId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The ID of the ticket the claimed cost entry lives on. Null on an \" +\n \"`adhoc` line, which no ticket carries.\",\n },\n costId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The ID of the claimed cost entry: an entry within the ticket on a \" +\n \"`ticket` line, a costs-collection document on an `adhoc` one.\",\n },\n propertyId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The property the claimed entry belongs to, snapshotted at \" +\n \"mark-sent: the source ticket's property on a `ticket` line, the \" +\n \"ad hoc entry's attributed property on an `adhoc` one. Lets a \" +\n \"cross-organization reader reach the ticket's property scope \" +\n \"without a ticket read. Internal, redacted org-side.\",\n },\n ticketNumber: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The source ticket's number, snapshotted at mark-sent. Null on an \" +\n \"`adhoc` line. Internal, redacted org-side.\",\n },\n categoryId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The picked billing category, inherited from the claimed cost entry \" +\n \"when the claim does not name one. Optional while drafting, required \" +\n \"at mark-sent. Manual pick — never derived from the ticket's issue.\",\n },\n categoryName: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The category name snapshotted at mark-sent. Null while drafting, \" +\n \"when it live-reads from the category library.\",\n },\n adjustedAmount: {\n type: [\"integer\", \"null\"],\n minimum: 0,\n default: null,\n description:\n \"Optional draft-time override of the billed amount in integer cents, \" +\n \"floored at zero, replacing the marked-up actual at display and \" +\n \"snapshot. Requires `adjustmentReason`. A credit (below zero) is a \" +\n \"manual line instead.\",\n },\n adjustmentReason: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"Short required reason accompanying `adjustedAmount`, kept for the \" +\n \"internal record.\",\n },\n amount: {\n type: [\"integer\", \"null\"],\n default: null,\n description:\n \"The billed amount in integer cents, snapshotted at mark-sent. Null \" +\n \"while drafting, when it live-reads (marked-up actual or the \" +\n \"adjustment) from the cost entry.\",\n },\n description: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The line description, snapshotted at mark-sent. Null while drafting, \" +\n \"when it live-reads from the cost entry.\",\n },\n vendorCost: {\n type: [\"integer\", \"null\"],\n default: null,\n description:\n \"What the claimed entry costs Kohost in integer cents, snapshotted \" +\n \"at mark-sent: the vendor actual when recorded, else the estimate. \" +\n \"Null while drafting or when the entry carries neither. Re-patched \" +\n \"when a late actual lands. Internal, redacted org-side.\",\n },\n vendorId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The org-scoped Vendor named on the claimed entry, snapshotted at \" +\n \"mark-sent. Internal, redacted org-side.\",\n },\n hasActual: {\n type: \"boolean\",\n default: false,\n description:\n \"Whether `vendorCost` is the vendor's settled actual rather than the \" +\n \"estimate, snapshotted at mark-sent and re-patched when the actual \" +\n \"lands. Internal, redacted org-side.\",\n },\n taxable: {\n type: \"boolean\",\n default: false,\n description:\n \"Whether the line's amount joins the bill's taxable subtotal. \" +\n \"Customer-facing: locks at mark-sent.\",\n },\n },\n} as const;\n\n// A manual line is a literal customer-facing row with no markup math: a\n// `description` and `amount` (which may be negative, serving as a credit) and\n// an optional `propertyId`. The independent internal fields — informational\n// `cost` (never derives the amount), `vendorId`, the vendor-invoice file, and\n// `vendorInvoiceNumber` — are redacted org-side via `canSeeCostSplit` and stay\n// editable in any bill state.\nconst manualLineSchema = {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"type\", \"description\", \"amount\"],\n properties: {\n id: {\n type: \"string\",\n description: \"Server-minted ID of the bill line.\",\n },\n type: {\n type: \"string\",\n enum: [\"manual\"],\n description: \"Discriminator: a literal, non-ticket line.\",\n },\n description: {\n type: \"string\",\n minLength: 1,\n description: \"The literal customer-facing description.\",\n },\n amount: {\n type: \"integer\",\n description:\n \"The billed amount in integer cents. May be negative, serving as a \" +\n \"credit (reference the reason in the description).\",\n },\n propertyId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The property the manual line is attributed to, when it concerns one.\",\n },\n categoryId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The picked billing category. Optional while drafting, required at \" +\n \"mark-sent.\",\n },\n categoryName: {\n type: [\"string\", \"null\"],\n default: null,\n description: \"The category name snapshotted at mark-sent.\",\n },\n cost: {\n type: [\"integer\", \"null\"],\n default: null,\n description:\n \"Informational internal vendor cost in integer cents. Never derives \" +\n \"the amount. Redacted org-side.\",\n },\n vendorId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"Optional reference to the org-scoped Vendor. Internal, redacted \" +\n \"org-side.\",\n },\n vendorInvoice: {\n anyOf: [{ $ref: \"mediaFile.json\" }, { type: \"null\" }],\n default: null,\n description:\n \"The vendor's invoice file backing the line, mirroring the cost-entry \" +\n \"field. Internal, redacted org-side.\",\n },\n vendorInvoiceNumber: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The vendor's own invoice number. Internal, redacted org-side.\",\n },\n taxable: {\n type: \"boolean\",\n default: false,\n description:\n \"Whether the line's amount joins the bill's taxable subtotal. \" +\n \"Customer-facing: locks at mark-sent.\",\n },\n },\n} as const;\n\nexport const billSchema = {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"bill.json\",\n title: \"Bill\",\n description:\n \"A OneBill bill, stored platform-wide and stamped with its organization: \" +\n \"KFC staff assemble billed lines from the \" +\n \"uninvoiced cost pool (plus manual lines) into a draft, then mark it sent \" +\n \"to freeze and reveal it to the customer. Lifecycle draft → sent → paid, \" +\n \"plus void. Customers see a bill in-app only once sent.\",\n type: \"object\",\n required: [\"id\", \"organizationId\", \"status\", \"currency\", \"lines\"],\n additionalProperties: false,\n properties: {\n id: {\n $ref: \"definitions.json#/definitions/id\",\n },\n type: {\n type: \"string\",\n enum: [\"bill\"],\n default: \"bill\",\n },\n organizationId: {\n type: \"string\",\n description:\n \"The organization the bill invoices. Bills live in one admin-database \" +\n \"collection across every organization, so each carries its owner \" +\n \"explicitly — stamped from the request context at creation, never \" +\n \"client-supplied.\",\n },\n status: {\n type: \"string\",\n enum: [\"draft\", \"sent\", \"paid\", \"void\"],\n default: \"draft\",\n description:\n \"Lifecycle state. `sent` freezes customer-facing fields and reveals \" +\n \"the bill to the org; `paid` records manual payment; `void` releases \" +\n \"cost-entry claims and hides the bill from the org view. Drafts \" +\n \"hard-delete rather than voiding.\",\n },\n invoiceNumber: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"Kohost's own invoice number, `KB-<n>` from a single global sequence. \" +\n \"System-assigned at mark-sent and never entered by hand: null while \" +\n \"the bill is a draft, immutable once set. A wrong bill is corrected \" +\n \"by void-and-reissue, so numbers gap and are never reused.\",\n },\n period: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n 'Display-only month label (e.g. \"July 2026\"). A UI hint; the bill\\'s ' +\n \"membership is defined by its lines, not a calendar bucket.\",\n },\n currency: {\n type: \"string\",\n enum: [\"USD\"],\n default: \"USD\",\n description: \"ISO 4217 currency code. USD only in v1.\",\n },\n fileId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The generated bill PDF's media-file ID, minted atomically at \" +\n \"mark-sent.\",\n },\n fileUrl: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The generated bill PDF's file-store URL, snapshotted at mark-sent \" +\n \"alongside fileId. Held so the sent-bill surface and the sent \" +\n \"notification email can mint a signed, unauthenticated download link \" +\n \"without a file lookup. Unsigned on its own (a bare link 401s).\",\n },\n memo: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"Internal KFC-only note. Never customer-facing; editable in any state.\",\n },\n billingAddress: {\n anyOf: [\n { $ref: \"definitions.json#/definitions/address\" },\n { type: \"null\" },\n ],\n default: null,\n description:\n \"The org billing address snapshotted at mark-sent. Null while \" +\n \"drafting, when it live-reads from the Organization. Mark-sent \" +\n \"requires a complete address (line1, city, state, postalCode).\",\n },\n taxRate: {\n type: [\"number\", \"null\"],\n default: null,\n minimum: 0,\n description:\n \"Tax rate as a plain float percent applied to the taxable line \" +\n \"subtotal. While drafting, null means the platform default rate; the \" +\n \"effective rate is snapshotted at mark-sent.\",\n },\n taxExempt: {\n type: \"boolean\",\n default: false,\n description:\n \"The organization's tax exemption snapshotted at mark-sent. While \" +\n \"drafting it live-reads from the Organization.\",\n },\n shippingAmount: {\n type: [\"integer\", \"null\"],\n default: null,\n minimum: 0,\n description:\n \"Shipping & handling in integer cents, added to the grand total on \" +\n \"top of the line subtotal and tax. Null means none.\",\n },\n lines: {\n type: \"array\",\n default: [],\n description:\n \"The bill's lines: cost lines claimed from the uninvoiced pool and \" +\n \"literal manual lines.\",\n items: {\n oneOf: [costLineSchema, manualLineSchema],\n },\n },\n sentAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the bill was marked sent. Absent until sent.\",\n },\n paidAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the bill was marked paid. Absent until paid.\",\n },\n voidedAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the bill was voided. Absent unless voided.\",\n },\n createdAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n updatedAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n },\n} as const;\n\nexport type BillSchema = FromSchema<\n typeof billSchema,\n {\n references: [typeof defs, typeof mediaFileSchema];\n deserialize: [\n {\n pattern: {\n format: \"date-time\";\n };\n output: Date | ISODateString;\n },\n ];\n }\n>;\n\n/** One line on a bill: a cost line or a manual line. */\nexport type BillLine = NonNullable<BillSchema[\"lines\"]>[number];\n"],"mappings":"AAyPA,MAAa,aAAa;CACxB,SAAS;CACT,KAAK;CACL,OAAO;CACP,aACE;CAKF,MAAM;CACN,UAAU;EAAC;EAAM;EAAkB;EAAU;EAAY;CAAO;CAChE,sBAAsB;CACtB,YAAY;EACV,IAAI,EACF,MAAM,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AAQ;MACN,MAAM;MACN,aACE;KAEJ;KACA,YAAY;MACV,MAAM,CAAC,UAAU,MAAM;MACvB,SAAS;MACT,aACE;KACJ;KACA,YAAY;MACV,MAAM,CAAC,UAAU,MAAM;MACvB,SAAS;MACT,aACE;KAEJ;KACA,cAAc;MACZ,MAAM,CAAC,UAAU,MAAM;MACvB,SAAS;MACT,aAAa;KACf;KACA,MAAM;MACJ,MAAM,CAAC,WAAW,MAAM;MACxB,SAAS;MACT,aACE;KAEJ;KACA,UAAU;MACR,MAAM,CAAC,UAAU,MAAM;MACvB,SAAS;MACT,aACE;KAEJ;KACA,eAAe;MACb,OAAO,CAAC,EAAE,MAAM,iBAAiB,GAAG,EAAE,MAAM,OAAO,CAAC;MACpD,SAAS;MACT,aACE;KAEJ;KACA,qBAAqB;MACnB,MAAM,CAAC,UAAU,MAAM;MACvB,SAAS;MACT,aACE;KACJ;KACA,SAAS;MACP,MAAM;MACN,SAAS;MACT,aACE;KAEJ;IACF;GAiI8B,CAAgB,EAC1C;EACF;EACA,QAAQ;GACN,MAAM;GACN,aAAa;EACf;EACA,QAAQ;GACN,MAAM;GACN,aAAa;EACf;EACA,UAAU;GACR,MAAM;GACN,aAAa;EACf;EACA,WAAW,EACT,MAAM,qCACR;EACA,WAAW,EACT,MAAM,qCACR;CACF;AACF"}
|
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The same phase on a host that admits a Pending cost, where `null` means the
|
|
3
|
+
* amount is not known yet. Only the ticket cost entry takes this shape: a
|
|
4
|
+
* ticket is what a vendor quote is awaited on.
|
|
5
|
+
*/
|
|
6
|
+
export declare const nullableMoney: (description: string) => {
|
|
7
|
+
readonly type: readonly ["object", "null"];
|
|
8
|
+
readonly additionalProperties: false;
|
|
9
|
+
readonly required: readonly ["amount", "recordedBy", "recordedAt"];
|
|
10
|
+
readonly default: null;
|
|
11
|
+
readonly description: string;
|
|
12
|
+
readonly properties: {
|
|
13
|
+
readonly amount: {
|
|
14
|
+
readonly type: "integer";
|
|
15
|
+
readonly minimum: 0;
|
|
16
|
+
readonly description: "The amount in integer cents.";
|
|
17
|
+
};
|
|
18
|
+
readonly recordedBy: {
|
|
19
|
+
readonly type: "string";
|
|
20
|
+
readonly description: "The ID of the user who recorded the amount.";
|
|
21
|
+
};
|
|
22
|
+
readonly recordedAt: {
|
|
23
|
+
readonly $ref: "definitions.json#/definitions/date";
|
|
24
|
+
readonly description: "When the amount was recorded.";
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
1
28
|
/**
|
|
2
29
|
* The append-only billing review history, over whichever actions the host
|
|
3
30
|
* admits. A ticket cost can be voided (withdrawn from the customer); a
|
|
@@ -1,28 +1,43 @@
|
|
|
1
1
|
//#region .generated/schemas/costEntry.ts
|
|
2
|
+
const moneyProperties = {
|
|
3
|
+
amount: {
|
|
4
|
+
type: "integer",
|
|
5
|
+
minimum: 0,
|
|
6
|
+
description: "The amount in integer cents."
|
|
7
|
+
},
|
|
8
|
+
recordedBy: {
|
|
9
|
+
type: "string",
|
|
10
|
+
description: "The ID of the user who recorded the amount."
|
|
11
|
+
},
|
|
12
|
+
recordedAt: {
|
|
13
|
+
$ref: "definitions.json#/definitions/date",
|
|
14
|
+
description: "When the amount was recorded."
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const moneyRequired = [
|
|
18
|
+
"amount",
|
|
19
|
+
"recordedBy",
|
|
20
|
+
"recordedAt"
|
|
21
|
+
];
|
|
2
22
|
const money = (description) => ({
|
|
3
23
|
type: "object",
|
|
4
24
|
additionalProperties: false,
|
|
5
|
-
required:
|
|
6
|
-
"amount",
|
|
7
|
-
"recordedBy",
|
|
8
|
-
"recordedAt"
|
|
9
|
-
],
|
|
25
|
+
required: moneyRequired,
|
|
10
26
|
description,
|
|
11
|
-
properties:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
27
|
+
properties: moneyProperties
|
|
28
|
+
});
|
|
29
|
+
/**
|
|
30
|
+
* The same phase on a host that admits a Pending cost, where `null` means the
|
|
31
|
+
* amount is not known yet. Only the ticket cost entry takes this shape: a
|
|
32
|
+
* ticket is what a vendor quote is awaited on.
|
|
33
|
+
*/
|
|
34
|
+
const nullableMoney = (description) => ({
|
|
35
|
+
type: ["object", "null"],
|
|
36
|
+
additionalProperties: false,
|
|
37
|
+
required: moneyRequired,
|
|
38
|
+
default: null,
|
|
39
|
+
description,
|
|
40
|
+
properties: moneyProperties
|
|
26
41
|
});
|
|
27
42
|
/**
|
|
28
43
|
* The append-only billing review history, over whichever actions the host
|
|
@@ -157,6 +172,6 @@ const costEntryProperties = {
|
|
|
157
172
|
])
|
|
158
173
|
};
|
|
159
174
|
//#endregion
|
|
160
|
-
export { costBillingReview, costEntryProperties, costEntryRequired };
|
|
175
|
+
export { costBillingReview, costEntryProperties, costEntryRequired, nullableMoney };
|
|
161
176
|
|
|
162
177
|
//# sourceMappingURL=costEntry.js.map
|
|
@@ -1 +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"}
|
|
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 moneyProperties = {\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} as const;\n\nconst moneyRequired = [\"amount\", \"recordedBy\", \"recordedAt\"] as const;\n\nconst money = (description: string) =>\n ({\n type: \"object\",\n additionalProperties: false,\n required: moneyRequired,\n description,\n properties: moneyProperties,\n }) as const;\n\n/**\n * The same phase on a host that admits a Pending cost, where `null` means the\n * amount is not known yet. Only the ticket cost entry takes this shape: a\n * ticket is what a vendor quote is awaited on.\n */\nexport const nullableMoney = (description: string) =>\n ({\n type: [\"object\", \"null\"],\n additionalProperties: false,\n required: moneyRequired,\n default: null,\n description,\n properties: moneyProperties,\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,kBAAkB;CACtB,QAAQ;EACN,MAAM;EACN,SAAS;EACT,aAAa;CACf;CACA,YAAY;EACV,MAAM;EACN,aAAa;CACf;CACA,YAAY;EACV,MAAM;EACN,aAAa;CACf;AACF;AAEA,MAAM,gBAAgB;CAAC;CAAU;CAAc;AAAY;AAE3D,MAAM,SAAS,iBACZ;CACC,MAAM;CACN,sBAAsB;CACtB,UAAU;CACV;CACA,YAAY;AACd;;;;;;AAOF,MAAa,iBAAiB,iBAC3B;CACC,MAAM,CAAC,UAAU,MAAM;CACvB,sBAAsB;CACtB,UAAU;CACV,SAAS;CACT;CACA,YAAY;AACd;;;;;;;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"}
|
|
@@ -93,7 +93,7 @@ declare const defs: {
|
|
|
93
93
|
readonly driver: {
|
|
94
94
|
readonly type: "string";
|
|
95
95
|
readonly description: "Driver used to communicate with the object.";
|
|
96
|
-
readonly enum: readonly ["adlink", "apex-american-audio", "avigilon-alta", "aws-kinesis", "bacnet", "benq", "butler", "comelit", "cool-automation", "crestron", "dell", "digital-watchdog", "distech", "dmp", "doorbird", "dormakaba", "dsc", "dsc-itv2", "earbridge", "ecobee", "epson", "geovision-rs", "geovision-as-manager", "hanwha", "honeywell-vista", "honeywell-resideo", "honeywell-total-connect", "igor", "inncom", "isapi", "kohost-k7", "kohost", "lapi", "lg", "lg-webos", "linortek", "lirc", "mews", "mht", "mobile-mule", "mock", "modbus", "napco", "newline", "obix", "one-roster", "onvif", "orchid-fusion", "paxton", "pdk", "pelican-wireless", "power-shades", "rachio", "rebrandly", "relay", "reolink", "rtsp", "salto", "salto-irn", "samsung", "se", "sendgrid", "singlewire", "smartboard", "sonifi", "stay-n-touch", "storable", "twilio", "unifi", "valcom", "veracross", "verkada", "vivotek", "vizio", "wisenet", "zkteco", "cloudflare-images", "cloudflare-stream", "insperia-privacy"];
|
|
96
|
+
readonly enum: readonly ["adlink", "apex-american-audio", "avigilon-alta", "aws-kinesis", "bacnet", "benq", "butler", "comelit", "cool-automation", "crestron", "dell", "digital-watchdog", "distech", "dmp", "doorbird", "dormakaba", "dsc", "dsc-itv2", "earbridge", "ecobee", "epson", "geovision-rs", "geovision-as-manager", "hanwha", "honeywell-vista", "honeywell-resideo", "honeywell-total-connect", "igor", "inncom", "isapi", "kohost-k7", "kohost", "lapi", "lg", "lg-webos", "linortek", "lirc", "mews", "mht", "mobile-mule", "mock", "modbus", "napco", "newline", "obix", "one-roster", "onvif", "orchid-fusion", "paxton", "pdk", "pelican-wireless", "power-shades", "rachio", "rebrandly", "relay", "reolink", "rtsp", "salto", "salto-irn", "samsung", "se", "sendgrid", "singlewire", "smartboard", "sonifi", "stay-n-touch", "storable", "twilio", "unifi", "unifi-access", "valcom", "veracross", "verkada", "vivotek", "vizio", "wisenet", "zkteco", "cloudflare-images", "cloudflare-stream", "insperia-privacy"];
|
|
97
97
|
};
|
|
98
98
|
readonly type: {
|
|
99
99
|
readonly type: "string";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","names":[],"sources":["../../.generated/schemas/definitions.ts"],"sourcesContent":["export const TICKET_NOTIFICATION_EVENTS = [\n \"ticketCreated\",\n \"ticketAssignedToMe\",\n \"addedAsCollaborator\",\n \"mentionedInTicket\",\n \"messageOnMyTicket\",\n \"ticketResolved\",\n \"ticketCreatedAsObserver\",\n \"messageAsObserver\",\n \"ticketResolvedAsObserver\",\n \"approvalRequested\",\n \"approvalDecided\",\n] as const;\n\nexport type TicketNotificationEvent =\n (typeof TICKET_NOTIFICATION_EVENTS)[number];\n\nexport const NOTIFICATION_CHANNELS = [\"email\", \"sms\", \"push\"] as const;\n\nexport type NotificationChannel = (typeof NOTIFICATION_CHANNELS)[number];\n\n/**\n * The platform roles an Audience may be selected by. The legacy `Guest` role a\n * permission entry may still carry is deliberately absent: nothing targets it.\n */\nexport const PLATFORM_ROLE_NAMES = [\n \"SuperAdmin\",\n \"Administrator\",\n \"Manager\",\n \"Agent\",\n \"User\",\n] as const;\n\nexport type PlatformRoleName = (typeof PLATFORM_ROLE_NAMES)[number];\n\n/**\n * The people outside the platform a broadcast may name, sourced from the SIS\n * roster. `students` is every system user the SIS marks as a Student;\n * `parents` is everybody else on the roster — every emergency-contact\n * relationship the source system carries, whatever it calls it.\n */\nexport const EXTERNAL_AUDIENCE_GROUPS = [\"students\", \"parents\"] as const;\n\nexport type ExternalAudienceGroup = (typeof EXTERNAL_AUDIENCE_GROUPS)[number];\n\nconst deliveryCountsNode = {\n type: \"object\",\n additionalProperties: false,\n required: [\"recipients\", \"sent\", \"failed\"],\n properties: {\n recipients: { type: \"integer\", minimum: 0 },\n sent: { type: \"integer\", minimum: 0 },\n failed: { type: \"integer\", minimum: 0 },\n },\n} as const;\n\nconst defs = {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"definitions.json\",\n title: \"Definitions\",\n definitions: {\n id: {\n type: \"string\",\n description: \"Identifier of the object.\",\n },\n systemId: {\n type: \"string\",\n description: \"Identifier of the object, directly related to the system.\",\n },\n systemData: {\n type: \"object\",\n },\n metadata: {\n type: \"object\",\n default: {},\n },\n date: {\n type: [\"string\", \"object\"],\n format: \"date-time\",\n },\n file: {\n type: \"object\",\n required: [\"name\", \"type\", \"data\"],\n properties: {\n name: {\n type: \"string\",\n description: \"Name of the file.\",\n },\n type: {\n type: \"string\",\n description: \"MIME type of the file (e.g. application/pdf).\",\n },\n data: {\n type: \"string\",\n description: \"Base64-encoded data of the file.\",\n },\n },\n },\n address: {\n type: \"object\",\n additionalProperties: false,\n properties: {\n id: {\n type: \"string\",\n },\n line1: {\n type: \"string\",\n },\n line2: {\n type: \"string\",\n },\n line3: {\n type: \"string\",\n },\n city: {\n type: \"string\",\n },\n state: {\n type: \"string\",\n },\n postalCode: {\n type: \"string\",\n },\n countryCode: {\n type: \"string\",\n minLength: 2,\n maxLength: 2,\n },\n },\n },\n driver: {\n type: \"string\",\n description: \"Driver used to communicate with the object.\",\n enum: [\n \"adlink\",\n \"apex-american-audio\",\n \"avigilon-alta\",\n \"aws-kinesis\",\n \"bacnet\",\n \"benq\",\n \"butler\",\n \"comelit\",\n \"cool-automation\",\n \"crestron\",\n \"dell\",\n \"digital-watchdog\",\n \"distech\",\n \"dmp\",\n \"doorbird\",\n \"dormakaba\",\n \"dsc\",\n \"dsc-itv2\",\n \"earbridge\",\n \"ecobee\",\n \"epson\",\n \"geovision-rs\",\n \"geovision-as-manager\",\n \"hanwha\",\n \"honeywell-vista\",\n \"honeywell-resideo\",\n \"honeywell-total-connect\",\n \"igor\",\n \"inncom\",\n \"isapi\",\n \"kohost-k7\",\n \"kohost\",\n \"lapi\",\n \"lg\",\n \"lg-webos\",\n \"linortek\",\n \"lirc\",\n \"mews\",\n \"mht\",\n \"mobile-mule\",\n \"mock\",\n \"modbus\",\n \"napco\",\n \"newline\",\n \"obix\",\n \"one-roster\",\n \"onvif\",\n \"orchid-fusion\",\n \"paxton\",\n \"pdk\",\n \"pelican-wireless\",\n \"power-shades\",\n \"rachio\",\n \"rebrandly\",\n \"relay\",\n \"reolink\",\n \"rtsp\",\n \"salto\",\n \"salto-irn\",\n \"samsung\",\n \"se\",\n \"sendgrid\",\n \"singlewire\",\n \"smartboard\",\n \"sonifi\",\n \"stay-n-touch\",\n \"storable\",\n \"twilio\",\n \"unifi\",\n \"valcom\",\n \"veracross\",\n \"verkada\",\n \"vivotek\",\n \"vizio\",\n \"wisenet\",\n \"zkteco\",\n \"cloudflare-images\",\n \"cloudflare-stream\",\n \"insperia-privacy\",\n ],\n },\n type: {\n type: \"string\",\n enum: [\n \"alarm\",\n \"camera\",\n \"courtesy\",\n \"dimmer\",\n \"gateway\",\n \"lock\",\n \"mediaSource\",\n \"motionSensor\",\n \"switch\",\n \"thermostat\",\n \"windowCovering\",\n ],\n },\n name: {\n type: \"string\",\n },\n alerts: {\n type: \"array\",\n uniqueItems: true,\n items: {\n type: \"object\",\n additionalProperties: false,\n required: [\"type\", \"status\", \"message\"],\n properties: {\n id: {\n type: \"string\",\n },\n type: {\n type: \"string\",\n enum: [\n \"Battery\",\n \"Button\",\n \"Communication\",\n \"Config\",\n \"Cost\",\n \"Door Ajar\",\n \"Equipment\",\n \"Maintenance\",\n \"Motion\",\n \"Registration\",\n \"Temperature\",\n ],\n },\n status: {\n type: \"string\",\n enum: [\"Active\", \"Resolved\"],\n },\n message: {\n type: \"string\",\n },\n },\n },\n },\n supportedNotifications: {\n type: \"array\",\n uniqueItems: true,\n items: {\n enum: [\n \"button 1\",\n \"button 2\",\n \"button 3\",\n \"button 4\",\n \"button 5\",\n \"idle\",\n \"powerHasBeedApplied\",\n \"acMainsDisconnected\",\n \"acMainsReconnected\",\n \"replaceBattery\",\n \"replaceBatterySoon\",\n \"replaceBatteryNow\",\n \"batteryOk\",\n \"hardwareFailure\",\n \"softwareFailure\",\n \"hardwareFailureWithCode\",\n \"softwareFailureWithCode\",\n \"motionDetection\",\n \"airFilterNeedsCleaned\",\n \"airFilterNeedsReplaced\",\n \"smokeDetected\",\n \"outsideSafeTemperatureRange\",\n \"outsideSafeHumidityRange\",\n \"scheduleMaintenance\",\n \"doorAjar\",\n \"communicationFailure\",\n \"communicationOk\",\n \"burglarAlarm\",\n \"fireAlarm\",\n \"powerTrouble\",\n \"monitoringTrouble\",\n \"bellTrouble\",\n \"configIssue\",\n ],\n },\n },\n notification: {\n type: [\"object\", \"null\"],\n properties: {\n name: {\n type: \"string\",\n $ref: \"#/definitions/supportedNotifications/items\",\n },\n timestamp: {\n type: \"number\",\n minimum: 1655907956593,\n },\n description: {\n type: \"string\",\n },\n },\n },\n batteryLevel: {\n type: \"number\",\n minimum: 0,\n maximum: 100,\n },\n watts: {\n type: \"number\",\n minimum: 0,\n },\n revenue: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n id: {\n $ref: \"definitions.json#/definitions/id\",\n },\n name: {\n type: \"string\",\n },\n date: {\n type: \"string\",\n format: \"date-time\",\n },\n price: {\n type: \"number\",\n },\n tax: {\n type: [\"number\", \"null\"],\n },\n },\n },\n },\n ticketNotificationEvent: {\n type: \"string\",\n enum: TICKET_NOTIFICATION_EVENTS,\n },\n notificationChannel: {\n type: \"string\",\n enum: NOTIFICATION_CHANNELS,\n },\n deliveryCounts: deliveryCountsNode,\n audience: {\n type: \"object\",\n additionalProperties: false,\n description:\n \"Who a people-facing broadcast was directed at, as the sender expressed it, plus the snapshot it resolved to. One shape for Announcements, SOS broadcasts and Automation notifications.\",\n properties: {\n to: {\n type: \"object\",\n additionalProperties: false,\n description:\n 'The User selector, one kind at a time. Absent or empty selects nobody; everyone is only ever the explicit `id: [\"*\"]` wildcard.',\n properties: {\n id: {\n type: \"array\",\n description:\n \"Named User ids, or the single wildcard `*` meaning everyone in scope.\",\n items: { type: \"string\" },\n },\n roles: {\n type: \"array\",\n items: { type: \"string\", enum: PLATFORM_ROLE_NAMES },\n },\n departmentIds: {\n type: \"array\",\n items: { type: \"string\" },\n },\n },\n },\n external: {\n type: \"array\",\n uniqueItems: true,\n description:\n \"Which groups of the external SIS roster were included. Human-triggered sends only; an Automation can never set it.\",\n items: { type: \"string\", enum: EXTERNAL_AUDIENCE_GROUPS },\n },\n emergencyContacts: {\n type: \"boolean\",\n description:\n 'Deprecated: superseded by `external`. A stored `true` reads as `external: [\"parents\"]`.',\n },\n users: {\n type: \"array\",\n description:\n \"Snapshot of the User ids the selector resolved to at send time.\",\n items: { type: \"string\" },\n },\n delivery: {\n type: \"object\",\n additionalProperties: false,\n description:\n \"Send-time delivery counts per audience. Absent for an audience that was not sent to.\",\n properties: {\n internal: deliveryCountsNode,\n external: {\n type: \"object\",\n additionalProperties: false,\n required: [\"recipients\", \"sent\", \"failed\"],\n properties: {\n ...deliveryCountsNode.properties,\n byChannel: {\n type: \"object\",\n additionalProperties: false,\n description:\n \"Per-channel counts, present only for the channels attempted.\",\n properties: {\n sms: deliveryCountsNode,\n email: deliveryCountsNode,\n },\n },\n },\n },\n emergencyContacts: {\n type: \"object\",\n additionalProperties: false,\n required: [\"recipients\", \"sent\", \"failed\"],\n description: \"Deprecated: superseded by `external`.\",\n properties: {\n ...deliveryCountsNode.properties,\n byChannel: {\n type: \"object\",\n additionalProperties: false,\n description:\n \"Per-channel counts, present only for the channels attempted.\",\n properties: {\n sms: deliveryCountsNode,\n email: deliveryCountsNode,\n },\n },\n },\n },\n },\n },\n },\n },\n },\n} as const;\n\nexport type ISODateString = ReturnType<Date[\"toISOString\"]>;\n\nexport { defs as definitionsSchema };\nexport default defs;\n"],"mappings":";AAAA,MAAa,6BAA6B;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAKA,MAAa,wBAAwB;CAAC;CAAS;CAAO;AAAM;;;;;AAQ5D,MAAa,sBAAsB;CACjC;CACA;CACA;CACA;CACA;AACF;;;;;;;AAUA,MAAa,2BAA2B,CAAC,YAAY,SAAS;AAI9D,MAAM,qBAAqB;CACzB,MAAM;CACN,sBAAsB;CACtB,UAAU;EAAC;EAAc;EAAQ;CAAQ;CACzC,YAAY;EACV,YAAY;GAAE,MAAM;GAAW,SAAS;EAAE;EAC1C,MAAM;GAAE,MAAM;GAAW,SAAS;EAAE;EACpC,QAAQ;GAAE,MAAM;GAAW,SAAS;EAAE;CACxC;AACF;AAEA,MAAM,OAAO;CACX,SAAS;CACT,KAAK;CACL,OAAO;CACP,aAAa;EACX,IAAI;GACF,MAAM;GACN,aAAa;EACf;EACA,UAAU;GACR,MAAM;GACN,aAAa;EACf;EACA,YAAY,EACV,MAAM,SACR;EACA,UAAU;GACR,MAAM;GACN,SAAS,CAAC;EACZ;EACA,MAAM;GACJ,MAAM,CAAC,UAAU,QAAQ;GACzB,QAAQ;EACV;EACA,MAAM;GACJ,MAAM;GACN,UAAU;IAAC;IAAQ;IAAQ;GAAM;GACjC,YAAY;IACV,MAAM;KACJ,MAAM;KACN,aAAa;IACf;IACA,MAAM;KACJ,MAAM;KACN,aAAa;IACf;IACA,MAAM;KACJ,MAAM;KACN,aAAa;IACf;GACF;EACF;EACA,SAAS;GACP,MAAM;GACN,sBAAsB;GACtB,YAAY;IACV,IAAI,EACF,MAAM,SACR;IACA,OAAO,EACL,MAAM,SACR;IACA,OAAO,EACL,MAAM,SACR;IACA,OAAO,EACL,MAAM,SACR;IACA,MAAM,EACJ,MAAM,SACR;IACA,OAAO,EACL,MAAM,SACR;IACA,YAAY,EACV,MAAM,SACR;IACA,aAAa;KACX,MAAM;KACN,WAAW;KACX,WAAW;IACb;GACF;EACF;EACA,QAAQ;GACN,MAAM;GACN,aAAa;GACb,MAAM;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;EACF;EACA,MAAM;GACJ,MAAM;GACN,MAAM;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;EACF;EACA,MAAM,EACJ,MAAM,SACR;EACA,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;IACL,MAAM;IACN,sBAAsB;IACtB,UAAU;KAAC;KAAQ;KAAU;IAAS;IACtC,YAAY;KACV,IAAI,EACF,MAAM,SACR;KACA,MAAM;MACJ,MAAM;MACN,MAAM;OACJ;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;MACF;KACF;KACA,QAAQ;MACN,MAAM;MACN,MAAM,CAAC,UAAU,UAAU;KAC7B;KACA,SAAS,EACP,MAAM,SACR;IACF;GACF;EACF;EACA,wBAAwB;GACtB,MAAM;GACN,aAAa;GACb,OAAO,EACL,MAAM;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF,EACF;EACF;EACA,cAAc;GACZ,MAAM,CAAC,UAAU,MAAM;GACvB,YAAY;IACV,MAAM;KACJ,MAAM;KACN,MAAM;IACR;IACA,WAAW;KACT,MAAM;KACN,SAAS;IACX;IACA,aAAa,EACX,MAAM,SACR;GACF;EACF;EACA,cAAc;GACZ,MAAM;GACN,SAAS;GACT,SAAS;EACX;EACA,OAAO;GACL,MAAM;GACN,SAAS;EACX;EACA,SAAS;GACP,MAAM;GACN,OAAO;IACL,MAAM;IACN,YAAY;KACV,IAAI,EACF,MAAM,mCACR;KACA,MAAM,EACJ,MAAM,SACR;KACA,MAAM;MACJ,MAAM;MACN,QAAQ;KACV;KACA,OAAO,EACL,MAAM,SACR;KACA,KAAK,EACH,MAAM,CAAC,UAAU,MAAM,EACzB;IACF;GACF;EACF;EACA,yBAAyB;GACvB,MAAM;GACN,MAAM;EACR;EACA,qBAAqB;GACnB,MAAM;GACN,MAAM;EACR;EACA,gBAAgB;EAChB,UAAU;GACR,MAAM;GACN,sBAAsB;GACtB,aACE;GACF,YAAY;IACV,IAAI;KACF,MAAM;KACN,sBAAsB;KACtB,aACE;KACF,YAAY;MACV,IAAI;OACF,MAAM;OACN,aACE;OACF,OAAO,EAAE,MAAM,SAAS;MAC1B;MACA,OAAO;OACL,MAAM;OACN,OAAO;QAAE,MAAM;QAAU,MAAM;OAAoB;MACrD;MACA,eAAe;OACb,MAAM;OACN,OAAO,EAAE,MAAM,SAAS;MAC1B;KACF;IACF;IACA,UAAU;KACR,MAAM;KACN,aAAa;KACb,aACE;KACF,OAAO;MAAE,MAAM;MAAU,MAAM;KAAyB;IAC1D;IACA,mBAAmB;KACjB,MAAM;KACN,aACE;IACJ;IACA,OAAO;KACL,MAAM;KACN,aACE;KACF,OAAO,EAAE,MAAM,SAAS;IAC1B;IACA,UAAU;KACR,MAAM;KACN,sBAAsB;KACtB,aACE;KACF,YAAY;MACV,UAAU;MACV,UAAU;OACR,MAAM;OACN,sBAAsB;OACtB,UAAU;QAAC;QAAc;QAAQ;OAAQ;OACzC,YAAY;QACV,GAAG,mBAAmB;QACtB,WAAW;SACT,MAAM;SACN,sBAAsB;SACtB,aACE;SACF,YAAY;UACV,KAAK;UACL,OAAO;SACT;QACF;OACF;MACF;MACA,mBAAmB;OACjB,MAAM;OACN,sBAAsB;OACtB,UAAU;QAAC;QAAc;QAAQ;OAAQ;OACzC,aAAa;OACb,YAAY;QACV,GAAG,mBAAmB;QACtB,WAAW;SACT,MAAM;SACN,sBAAsB;SACtB,aACE;SACF,YAAY;UACV,KAAK;UACL,OAAO;SACT;QACF;OACF;MACF;KACF;IACF;GACF;EACF;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"definitions.js","names":[],"sources":["../../.generated/schemas/definitions.ts"],"sourcesContent":["export const TICKET_NOTIFICATION_EVENTS = [\n \"ticketCreated\",\n \"ticketAssignedToMe\",\n \"addedAsCollaborator\",\n \"mentionedInTicket\",\n \"messageOnMyTicket\",\n \"ticketResolved\",\n \"ticketCreatedAsObserver\",\n \"messageAsObserver\",\n \"ticketResolvedAsObserver\",\n \"approvalRequested\",\n \"approvalDecided\",\n] as const;\n\nexport type TicketNotificationEvent =\n (typeof TICKET_NOTIFICATION_EVENTS)[number];\n\nexport const NOTIFICATION_CHANNELS = [\"email\", \"sms\", \"push\"] as const;\n\nexport type NotificationChannel = (typeof NOTIFICATION_CHANNELS)[number];\n\n/**\n * The platform roles an Audience may be selected by. The legacy `Guest` role a\n * permission entry may still carry is deliberately absent: nothing targets it.\n */\nexport const PLATFORM_ROLE_NAMES = [\n \"SuperAdmin\",\n \"Administrator\",\n \"Manager\",\n \"Agent\",\n \"User\",\n] as const;\n\nexport type PlatformRoleName = (typeof PLATFORM_ROLE_NAMES)[number];\n\n/**\n * The people outside the platform a broadcast may name, sourced from the SIS\n * roster. `students` is every system user the SIS marks as a Student;\n * `parents` is everybody else on the roster — every emergency-contact\n * relationship the source system carries, whatever it calls it.\n */\nexport const EXTERNAL_AUDIENCE_GROUPS = [\"students\", \"parents\"] as const;\n\nexport type ExternalAudienceGroup = (typeof EXTERNAL_AUDIENCE_GROUPS)[number];\n\nconst deliveryCountsNode = {\n type: \"object\",\n additionalProperties: false,\n required: [\"recipients\", \"sent\", \"failed\"],\n properties: {\n recipients: { type: \"integer\", minimum: 0 },\n sent: { type: \"integer\", minimum: 0 },\n failed: { type: \"integer\", minimum: 0 },\n },\n} as const;\n\nconst defs = {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"definitions.json\",\n title: \"Definitions\",\n definitions: {\n id: {\n type: \"string\",\n description: \"Identifier of the object.\",\n },\n systemId: {\n type: \"string\",\n description: \"Identifier of the object, directly related to the system.\",\n },\n systemData: {\n type: \"object\",\n },\n metadata: {\n type: \"object\",\n default: {},\n },\n date: {\n type: [\"string\", \"object\"],\n format: \"date-time\",\n },\n file: {\n type: \"object\",\n required: [\"name\", \"type\", \"data\"],\n properties: {\n name: {\n type: \"string\",\n description: \"Name of the file.\",\n },\n type: {\n type: \"string\",\n description: \"MIME type of the file (e.g. application/pdf).\",\n },\n data: {\n type: \"string\",\n description: \"Base64-encoded data of the file.\",\n },\n },\n },\n address: {\n type: \"object\",\n additionalProperties: false,\n properties: {\n id: {\n type: \"string\",\n },\n line1: {\n type: \"string\",\n },\n line2: {\n type: \"string\",\n },\n line3: {\n type: \"string\",\n },\n city: {\n type: \"string\",\n },\n state: {\n type: \"string\",\n },\n postalCode: {\n type: \"string\",\n },\n countryCode: {\n type: \"string\",\n minLength: 2,\n maxLength: 2,\n },\n },\n },\n driver: {\n type: \"string\",\n description: \"Driver used to communicate with the object.\",\n enum: [\n \"adlink\",\n \"apex-american-audio\",\n \"avigilon-alta\",\n \"aws-kinesis\",\n \"bacnet\",\n \"benq\",\n \"butler\",\n \"comelit\",\n \"cool-automation\",\n \"crestron\",\n \"dell\",\n \"digital-watchdog\",\n \"distech\",\n \"dmp\",\n \"doorbird\",\n \"dormakaba\",\n \"dsc\",\n \"dsc-itv2\",\n \"earbridge\",\n \"ecobee\",\n \"epson\",\n \"geovision-rs\",\n \"geovision-as-manager\",\n \"hanwha\",\n \"honeywell-vista\",\n \"honeywell-resideo\",\n \"honeywell-total-connect\",\n \"igor\",\n \"inncom\",\n \"isapi\",\n \"kohost-k7\",\n \"kohost\",\n \"lapi\",\n \"lg\",\n \"lg-webos\",\n \"linortek\",\n \"lirc\",\n \"mews\",\n \"mht\",\n \"mobile-mule\",\n \"mock\",\n \"modbus\",\n \"napco\",\n \"newline\",\n \"obix\",\n \"one-roster\",\n \"onvif\",\n \"orchid-fusion\",\n \"paxton\",\n \"pdk\",\n \"pelican-wireless\",\n \"power-shades\",\n \"rachio\",\n \"rebrandly\",\n \"relay\",\n \"reolink\",\n \"rtsp\",\n \"salto\",\n \"salto-irn\",\n \"samsung\",\n \"se\",\n \"sendgrid\",\n \"singlewire\",\n \"smartboard\",\n \"sonifi\",\n \"stay-n-touch\",\n \"storable\",\n \"twilio\",\n \"unifi\",\n \"unifi-access\",\n \"valcom\",\n \"veracross\",\n \"verkada\",\n \"vivotek\",\n \"vizio\",\n \"wisenet\",\n \"zkteco\",\n \"cloudflare-images\",\n \"cloudflare-stream\",\n \"insperia-privacy\",\n ],\n },\n type: {\n type: \"string\",\n enum: [\n \"alarm\",\n \"camera\",\n \"courtesy\",\n \"dimmer\",\n \"gateway\",\n \"lock\",\n \"mediaSource\",\n \"motionSensor\",\n \"switch\",\n \"thermostat\",\n \"windowCovering\",\n ],\n },\n name: {\n type: \"string\",\n },\n alerts: {\n type: \"array\",\n uniqueItems: true,\n items: {\n type: \"object\",\n additionalProperties: false,\n required: [\"type\", \"status\", \"message\"],\n properties: {\n id: {\n type: \"string\",\n },\n type: {\n type: \"string\",\n enum: [\n \"Battery\",\n \"Button\",\n \"Communication\",\n \"Config\",\n \"Cost\",\n \"Door Ajar\",\n \"Equipment\",\n \"Maintenance\",\n \"Motion\",\n \"Registration\",\n \"Temperature\",\n ],\n },\n status: {\n type: \"string\",\n enum: [\"Active\", \"Resolved\"],\n },\n message: {\n type: \"string\",\n },\n },\n },\n },\n supportedNotifications: {\n type: \"array\",\n uniqueItems: true,\n items: {\n enum: [\n \"button 1\",\n \"button 2\",\n \"button 3\",\n \"button 4\",\n \"button 5\",\n \"idle\",\n \"powerHasBeedApplied\",\n \"acMainsDisconnected\",\n \"acMainsReconnected\",\n \"replaceBattery\",\n \"replaceBatterySoon\",\n \"replaceBatteryNow\",\n \"batteryOk\",\n \"hardwareFailure\",\n \"softwareFailure\",\n \"hardwareFailureWithCode\",\n \"softwareFailureWithCode\",\n \"motionDetection\",\n \"airFilterNeedsCleaned\",\n \"airFilterNeedsReplaced\",\n \"smokeDetected\",\n \"outsideSafeTemperatureRange\",\n \"outsideSafeHumidityRange\",\n \"scheduleMaintenance\",\n \"doorAjar\",\n \"communicationFailure\",\n \"communicationOk\",\n \"burglarAlarm\",\n \"fireAlarm\",\n \"powerTrouble\",\n \"monitoringTrouble\",\n \"bellTrouble\",\n \"configIssue\",\n ],\n },\n },\n notification: {\n type: [\"object\", \"null\"],\n properties: {\n name: {\n type: \"string\",\n $ref: \"#/definitions/supportedNotifications/items\",\n },\n timestamp: {\n type: \"number\",\n minimum: 1655907956593,\n },\n description: {\n type: \"string\",\n },\n },\n },\n batteryLevel: {\n type: \"number\",\n minimum: 0,\n maximum: 100,\n },\n watts: {\n type: \"number\",\n minimum: 0,\n },\n revenue: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n id: {\n $ref: \"definitions.json#/definitions/id\",\n },\n name: {\n type: \"string\",\n },\n date: {\n type: \"string\",\n format: \"date-time\",\n },\n price: {\n type: \"number\",\n },\n tax: {\n type: [\"number\", \"null\"],\n },\n },\n },\n },\n ticketNotificationEvent: {\n type: \"string\",\n enum: TICKET_NOTIFICATION_EVENTS,\n },\n notificationChannel: {\n type: \"string\",\n enum: NOTIFICATION_CHANNELS,\n },\n deliveryCounts: deliveryCountsNode,\n audience: {\n type: \"object\",\n additionalProperties: false,\n description:\n \"Who a people-facing broadcast was directed at, as the sender expressed it, plus the snapshot it resolved to. One shape for Announcements, SOS broadcasts and Automation notifications.\",\n properties: {\n to: {\n type: \"object\",\n additionalProperties: false,\n description:\n 'The User selector, one kind at a time. Absent or empty selects nobody; everyone is only ever the explicit `id: [\"*\"]` wildcard.',\n properties: {\n id: {\n type: \"array\",\n description:\n \"Named User ids, or the single wildcard `*` meaning everyone in scope.\",\n items: { type: \"string\" },\n },\n roles: {\n type: \"array\",\n items: { type: \"string\", enum: PLATFORM_ROLE_NAMES },\n },\n departmentIds: {\n type: \"array\",\n items: { type: \"string\" },\n },\n },\n },\n external: {\n type: \"array\",\n uniqueItems: true,\n description:\n \"Which groups of the external SIS roster were included. Human-triggered sends only; an Automation can never set it.\",\n items: { type: \"string\", enum: EXTERNAL_AUDIENCE_GROUPS },\n },\n emergencyContacts: {\n type: \"boolean\",\n description:\n 'Deprecated: superseded by `external`. A stored `true` reads as `external: [\"parents\"]`.',\n },\n users: {\n type: \"array\",\n description:\n \"Snapshot of the User ids the selector resolved to at send time.\",\n items: { type: \"string\" },\n },\n delivery: {\n type: \"object\",\n additionalProperties: false,\n description:\n \"Send-time delivery counts per audience. Absent for an audience that was not sent to.\",\n properties: {\n internal: deliveryCountsNode,\n external: {\n type: \"object\",\n additionalProperties: false,\n required: [\"recipients\", \"sent\", \"failed\"],\n properties: {\n ...deliveryCountsNode.properties,\n byChannel: {\n type: \"object\",\n additionalProperties: false,\n description:\n \"Per-channel counts, present only for the channels attempted.\",\n properties: {\n sms: deliveryCountsNode,\n email: deliveryCountsNode,\n },\n },\n },\n },\n emergencyContacts: {\n type: \"object\",\n additionalProperties: false,\n required: [\"recipients\", \"sent\", \"failed\"],\n description: \"Deprecated: superseded by `external`.\",\n properties: {\n ...deliveryCountsNode.properties,\n byChannel: {\n type: \"object\",\n additionalProperties: false,\n description:\n \"Per-channel counts, present only for the channels attempted.\",\n properties: {\n sms: deliveryCountsNode,\n email: deliveryCountsNode,\n },\n },\n },\n },\n },\n },\n },\n },\n },\n} as const;\n\nexport type ISODateString = ReturnType<Date[\"toISOString\"]>;\n\nexport { defs as definitionsSchema };\nexport default defs;\n"],"mappings":";AAAA,MAAa,6BAA6B;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAKA,MAAa,wBAAwB;CAAC;CAAS;CAAO;AAAM;;;;;AAQ5D,MAAa,sBAAsB;CACjC;CACA;CACA;CACA;CACA;AACF;;;;;;;AAUA,MAAa,2BAA2B,CAAC,YAAY,SAAS;AAI9D,MAAM,qBAAqB;CACzB,MAAM;CACN,sBAAsB;CACtB,UAAU;EAAC;EAAc;EAAQ;CAAQ;CACzC,YAAY;EACV,YAAY;GAAE,MAAM;GAAW,SAAS;EAAE;EAC1C,MAAM;GAAE,MAAM;GAAW,SAAS;EAAE;EACpC,QAAQ;GAAE,MAAM;GAAW,SAAS;EAAE;CACxC;AACF;AAEA,MAAM,OAAO;CACX,SAAS;CACT,KAAK;CACL,OAAO;CACP,aAAa;EACX,IAAI;GACF,MAAM;GACN,aAAa;EACf;EACA,UAAU;GACR,MAAM;GACN,aAAa;EACf;EACA,YAAY,EACV,MAAM,SACR;EACA,UAAU;GACR,MAAM;GACN,SAAS,CAAC;EACZ;EACA,MAAM;GACJ,MAAM,CAAC,UAAU,QAAQ;GACzB,QAAQ;EACV;EACA,MAAM;GACJ,MAAM;GACN,UAAU;IAAC;IAAQ;IAAQ;GAAM;GACjC,YAAY;IACV,MAAM;KACJ,MAAM;KACN,aAAa;IACf;IACA,MAAM;KACJ,MAAM;KACN,aAAa;IACf;IACA,MAAM;KACJ,MAAM;KACN,aAAa;IACf;GACF;EACF;EACA,SAAS;GACP,MAAM;GACN,sBAAsB;GACtB,YAAY;IACV,IAAI,EACF,MAAM,SACR;IACA,OAAO,EACL,MAAM,SACR;IACA,OAAO,EACL,MAAM,SACR;IACA,OAAO,EACL,MAAM,SACR;IACA,MAAM,EACJ,MAAM,SACR;IACA,OAAO,EACL,MAAM,SACR;IACA,YAAY,EACV,MAAM,SACR;IACA,aAAa;KACX,MAAM;KACN,WAAW;KACX,WAAW;IACb;GACF;EACF;EACA,QAAQ;GACN,MAAM;GACN,aAAa;GACb,MAAM;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;EACF;EACA,MAAM;GACJ,MAAM;GACN,MAAM;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;EACF;EACA,MAAM,EACJ,MAAM,SACR;EACA,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;IACL,MAAM;IACN,sBAAsB;IACtB,UAAU;KAAC;KAAQ;KAAU;IAAS;IACtC,YAAY;KACV,IAAI,EACF,MAAM,SACR;KACA,MAAM;MACJ,MAAM;MACN,MAAM;OACJ;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;MACF;KACF;KACA,QAAQ;MACN,MAAM;MACN,MAAM,CAAC,UAAU,UAAU;KAC7B;KACA,SAAS,EACP,MAAM,SACR;IACF;GACF;EACF;EACA,wBAAwB;GACtB,MAAM;GACN,aAAa;GACb,OAAO,EACL,MAAM;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF,EACF;EACF;EACA,cAAc;GACZ,MAAM,CAAC,UAAU,MAAM;GACvB,YAAY;IACV,MAAM;KACJ,MAAM;KACN,MAAM;IACR;IACA,WAAW;KACT,MAAM;KACN,SAAS;IACX;IACA,aAAa,EACX,MAAM,SACR;GACF;EACF;EACA,cAAc;GACZ,MAAM;GACN,SAAS;GACT,SAAS;EACX;EACA,OAAO;GACL,MAAM;GACN,SAAS;EACX;EACA,SAAS;GACP,MAAM;GACN,OAAO;IACL,MAAM;IACN,YAAY;KACV,IAAI,EACF,MAAM,mCACR;KACA,MAAM,EACJ,MAAM,SACR;KACA,MAAM;MACJ,MAAM;MACN,QAAQ;KACV;KACA,OAAO,EACL,MAAM,SACR;KACA,KAAK,EACH,MAAM,CAAC,UAAU,MAAM,EACzB;IACF;GACF;EACF;EACA,yBAAyB;GACvB,MAAM;GACN,MAAM;EACR;EACA,qBAAqB;GACnB,MAAM;GACN,MAAM;EACR;EACA,gBAAgB;EAChB,UAAU;GACR,MAAM;GACN,sBAAsB;GACtB,aACE;GACF,YAAY;IACV,IAAI;KACF,MAAM;KACN,sBAAsB;KACtB,aACE;KACF,YAAY;MACV,IAAI;OACF,MAAM;OACN,aACE;OACF,OAAO,EAAE,MAAM,SAAS;MAC1B;MACA,OAAO;OACL,MAAM;OACN,OAAO;QAAE,MAAM;QAAU,MAAM;OAAoB;MACrD;MACA,eAAe;OACb,MAAM;OACN,OAAO,EAAE,MAAM,SAAS;MAC1B;KACF;IACF;IACA,UAAU;KACR,MAAM;KACN,aAAa;KACb,aACE;KACF,OAAO;MAAE,MAAM;MAAU,MAAM;KAAyB;IAC1D;IACA,mBAAmB;KACjB,MAAM;KACN,aACE;IACJ;IACA,OAAO;KACL,MAAM;KACN,aACE;KACF,OAAO,EAAE,MAAM,SAAS;IAC1B;IACA,UAAU;KACR,MAAM;KACN,sBAAsB;KACtB,aACE;KACF,YAAY;MACV,UAAU;MACV,UAAU;OACR,MAAM;OACN,sBAAsB;OACtB,UAAU;QAAC;QAAc;QAAQ;OAAQ;OACzC,YAAY;QACV,GAAG,mBAAmB;QACtB,WAAW;SACT,MAAM;SACN,sBAAsB;SACtB,aACE;SACF,YAAY;UACV,KAAK;UACL,OAAO;SACT;QACF;OACF;MACF;MACA,mBAAmB;OACjB,MAAM;OACN,sBAAsB;OACtB,UAAU;QAAC;QAAc;QAAQ;OAAQ;OACzC,aAAa;OACb,YAAY;QACV,GAAG,mBAAmB;QACtB,WAAW;SACT,MAAM;SACN,sBAAsB;SACtB,aACE;SACF,YAAY;UACV,KAAK;UACL,OAAO;SACT;QACF;OACF;MACF;KACF;IACF;GACF;EACF;CACF;AACF"}
|