@kohost/api-client 7.22.0 → 7.23.1
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/lib/index.d.ts +1 -0
- package/dist/lib/index.js +6 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/serviceContracts.d.ts +27 -0
- package/dist/lib/serviceContracts.js +34 -0
- package/dist/lib/serviceContracts.js.map +1 -0
- package/dist/models/automation.js +1 -0
- package/dist/models/automation.js.map +1 -1
- package/dist/models/cost.js +5 -0
- package/dist/models/cost.js.map +1 -1
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +3 -1
- package/dist/models/index.js.map +1 -1
- package/dist/models/serviceContract.d.ts +17 -0
- package/dist/models/serviceContract.js +35 -0
- package/dist/models/serviceContract.js.map +1 -0
- package/dist/models/ticket.js +1 -0
- package/dist/models/ticket.js.map +1 -1
- package/dist/schemas/automation.d.ts +4 -0
- package/dist/schemas/automation.js +4 -0
- package/dist/schemas/automation.js.map +1 -1
- package/dist/schemas/bill.d.ts +11 -1
- package/dist/schemas/bill.js +17 -3
- package/dist/schemas/bill.js.map +1 -1
- package/dist/schemas/cost.d.ts +36 -1
- package/dist/schemas/cost.js +29 -2
- package/dist/schemas/cost.js.map +1 -1
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.js +2 -1
- package/dist/schemas/serviceContract.d.ts +272 -0
- package/dist/schemas/serviceContract.js +220 -0
- package/dist/schemas/serviceContract.js.map +1 -0
- package/dist/schemas/ticket.d.ts +20 -0
- package/dist/schemas/ticket.js +20 -0
- package/dist/schemas/ticket.js.map +1 -1
- package/dist/useCases/activateServiceContract.d.ts +36 -0
- package/dist/useCases/activateServiceContract.js +47 -0
- package/dist/useCases/activateServiceContract.js.map +1 -0
- package/dist/useCases/addDueContractCosts.d.ts +27 -0
- package/dist/useCases/addDueContractCosts.js +47 -0
- package/dist/useCases/addDueContractCosts.js.map +1 -0
- package/dist/useCases/addServiceContractTicketSchedule.d.ts +36 -0
- package/dist/useCases/addServiceContractTicketSchedule.js +47 -0
- package/dist/useCases/addServiceContractTicketSchedule.js.map +1 -0
- package/dist/useCases/cancelServiceContract.d.ts +36 -0
- package/dist/useCases/cancelServiceContract.js +47 -0
- package/dist/useCases/cancelServiceContract.js.map +1 -0
- package/dist/useCases/createServiceContract.d.ts +27 -0
- package/dist/useCases/createServiceContract.js +47 -0
- package/dist/useCases/createServiceContract.js.map +1 -0
- package/dist/useCases/deleteServiceContract.d.ts +36 -0
- package/dist/useCases/deleteServiceContract.js +47 -0
- package/dist/useCases/deleteServiceContract.js.map +1 -0
- package/dist/useCases/describeOrganizationServiceContract.d.ts +36 -0
- package/dist/useCases/describeOrganizationServiceContract.js +47 -0
- package/dist/useCases/describeOrganizationServiceContract.js.map +1 -0
- package/dist/useCases/describeServiceContract.d.ts +36 -0
- package/dist/useCases/describeServiceContract.js +47 -0
- package/dist/useCases/describeServiceContract.js.map +1 -0
- package/dist/useCases/duplicateServiceContract.d.ts +36 -0
- package/dist/useCases/duplicateServiceContract.js +47 -0
- package/dist/useCases/duplicateServiceContract.js.map +1 -0
- package/dist/useCases/index.d.ts +18 -2
- package/dist/useCases/index.js +37 -5
- package/dist/useCases/index.js.map +1 -1
- package/dist/useCases/listConciergeCostLedger.d.ts +27 -0
- package/dist/useCases/listConciergeCostLedger.js +47 -0
- package/dist/useCases/listConciergeCostLedger.js.map +1 -0
- package/dist/useCases/listConciergeServiceContracts.d.ts +27 -0
- package/dist/useCases/listConciergeServiceContracts.js +47 -0
- package/dist/useCases/listConciergeServiceContracts.js.map +1 -0
- package/dist/useCases/{listConciergeWorkspaceBillLines.d.ts → listOrganizationServiceContracts.d.ts} +6 -6
- package/dist/useCases/{listConciergeWorkspaceBillLines.js → listOrganizationServiceContracts.js} +9 -9
- package/dist/useCases/listOrganizationServiceContracts.js.map +1 -0
- package/dist/useCases/listServiceContractCosts.d.ts +36 -0
- package/dist/useCases/listServiceContractCosts.js +47 -0
- package/dist/useCases/listServiceContractCosts.js.map +1 -0
- package/dist/useCases/listServiceContractTicketSchedules.d.ts +36 -0
- package/dist/useCases/listServiceContractTicketSchedules.js +47 -0
- package/dist/useCases/listServiceContractTicketSchedules.js.map +1 -0
- package/dist/useCases/{describeConciergeBillsSummary.d.ts → listServiceContracts.d.ts} +6 -6
- package/dist/useCases/{describeConciergeBillsSummary.js → listServiceContracts.js} +9 -9
- package/dist/useCases/listServiceContracts.js.map +1 -0
- package/dist/useCases/removeServiceContractTicketSchedule.d.ts +39 -0
- package/dist/useCases/removeServiceContractTicketSchedule.js +47 -0
- package/dist/useCases/removeServiceContractTicketSchedule.js.map +1 -0
- package/dist/useCases/updateServiceContract.d.ts +36 -0
- package/dist/useCases/updateServiceContract.js +47 -0
- package/dist/useCases/updateServiceContract.js.map +1 -0
- package/dist/useCases/updateServiceContractTicketSchedule.d.ts +39 -0
- package/dist/useCases/updateServiceContractTicketSchedule.js +47 -0
- package/dist/useCases/updateServiceContractTicketSchedule.js.map +1 -0
- package/dist/validate.d.ts +23 -0
- package/dist/validate.js +4 -1
- package/dist/validate.js.map +1 -1
- package/package.json +6 -6
- package/dist/useCases/describeConciergeBillsSummary.js.map +0 -1
- package/dist/useCases/listConciergeWorkspaceBillLines.js.map +0 -1
package/dist/lib/index.d.ts
CHANGED
|
@@ -10,5 +10,6 @@ export { SIS_BUCKETS, type SISBucket, type SISHousehold, type SISHouseholdMember
|
|
|
10
10
|
export { MAX_MESSAGE_ATTACHMENTS } from "./messageAttachments.js";
|
|
11
11
|
export { DEFAULT_MARKUP_TIERS, DEFAULT_DNE_AMOUNT, resolveMarkupTierTable, keyedMarkupPercent, DEFAULT_TAX_RATE, derivePrice, markupPercentFromPrice, signedMarkupPercent, billTotal, billTaxAmount, billGrandTotal, formatMoney, } from "./money.js";
|
|
12
12
|
export { effectiveTaxRate, taxableSubtotal, billTotals, resolveBillTaxExempt, settledBillTotal, billEffectiveDate, type BillTaxFields, type TaxableLine, type SettledBillTotalSource, type BillEffectiveDateSource, } from "./bills.js";
|
|
13
|
+
export { ENDING_SOON_DAYS, daysUntilEnd, isEndingSoon, isExpired, } from "./serviceContracts.js";
|
|
13
14
|
export { KFC_STATS_TIMEZONE, KFC_STATS_DEFAULT_WINDOW_DAYS, KFC_STATS_MAX_RANGE_DAYS, resolveKfcStatsWindowBounds, type KfcStatsWindowBounds, } from "./kfcStatsWindow.js";
|
|
14
15
|
export { serializeRichTextBody, isWellFormedRichText, type RichTextContent, type RichTextBlockNode, type RichTextInlineNode, type RichTextListItemNode, type RichTextMentionNode, } from "./ticketRichText.js";
|
package/dist/lib/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import { SIS_BUCKETS } from "./sis.js";
|
|
|
10
10
|
import { MAX_MESSAGE_ATTACHMENTS } from "./messageAttachments.js";
|
|
11
11
|
import { DEFAULT_DNE_AMOUNT, DEFAULT_MARKUP_TIERS, DEFAULT_TAX_RATE, billGrandTotal, billTaxAmount, billTotal, derivePrice, formatMoney, keyedMarkupPercent, markupPercentFromPrice, resolveMarkupTierTable, signedMarkupPercent } from "./money.js";
|
|
12
12
|
import { billEffectiveDate, billTotals, effectiveTaxRate, resolveBillTaxExempt, settledBillTotal, taxableSubtotal } from "./bills.js";
|
|
13
|
+
import { ENDING_SOON_DAYS, daysUntilEnd, isEndingSoon, isExpired } from "./serviceContracts.js";
|
|
13
14
|
import { KFC_STATS_DEFAULT_WINDOW_DAYS, KFC_STATS_MAX_RANGE_DAYS, KFC_STATS_TIMEZONE, resolveKfcStatsWindowBounds } from "./kfcStatsWindow.js";
|
|
14
15
|
import { isWellFormedRichText, serializeRichTextBody } from "./ticketRichText.js";
|
|
15
16
|
//#region .generated/lib/index.ts
|
|
@@ -18,6 +19,7 @@ var lib_exports = /* @__PURE__ */ __exportAll({
|
|
|
18
19
|
DEFAULT_MARKUP_TIERS: () => DEFAULT_MARKUP_TIERS,
|
|
19
20
|
DEFAULT_TAX_RATE: () => DEFAULT_TAX_RATE,
|
|
20
21
|
DELIVERY_OUTCOMES: () => DELIVERY_OUTCOMES,
|
|
22
|
+
ENDING_SOON_DAYS: () => 30,
|
|
21
23
|
KFC_STATS_DEFAULT_WINDOW_DAYS: () => 30,
|
|
22
24
|
KFC_STATS_MAX_RANGE_DAYS: () => KFC_STATS_MAX_RANGE_DAYS,
|
|
23
25
|
KFC_STATS_TIMEZONE: () => KFC_STATS_TIMEZONE,
|
|
@@ -35,6 +37,7 @@ var lib_exports = /* @__PURE__ */ __exportAll({
|
|
|
35
37
|
billTotals: () => billTotals,
|
|
36
38
|
categoryForDevice: () => categoryForDevice,
|
|
37
39
|
categoryForMessageErrorCode: () => categoryForMessageErrorCode,
|
|
40
|
+
daysUntilEnd: () => daysUntilEnd,
|
|
38
41
|
deliveryOutcomeForStatus: () => deliveryOutcomeForStatus,
|
|
39
42
|
derivePrice: () => derivePrice,
|
|
40
43
|
effectiveTaxRate: () => effectiveTaxRate,
|
|
@@ -43,6 +46,8 @@ var lib_exports = /* @__PURE__ */ __exportAll({
|
|
|
43
46
|
getAllowedFeatures: () => getAllowedFeatures,
|
|
44
47
|
getAllowedResourceIds: () => getAllowedResourceIds,
|
|
45
48
|
inferDeviceNotifications: () => inferDeviceNotifications,
|
|
49
|
+
isEndingSoon: () => isEndingSoon,
|
|
50
|
+
isExpired: () => isExpired,
|
|
46
51
|
isMessageErrorCategory: () => isMessageErrorCategory,
|
|
47
52
|
isSISDriver: () => isSISDriver,
|
|
48
53
|
isWellFormedRichText: () => isWellFormedRichText,
|
|
@@ -57,6 +62,6 @@ var lib_exports = /* @__PURE__ */ __exportAll({
|
|
|
57
62
|
taxableSubtotal: () => taxableSubtotal
|
|
58
63
|
});
|
|
59
64
|
//#endregion
|
|
60
|
-
export { DEFAULT_DNE_AMOUNT, DEFAULT_MARKUP_TIERS, DEFAULT_TAX_RATE, DELIVERY_OUTCOMES, KFC_STATS_DEFAULT_WINDOW_DAYS, KFC_STATS_MAX_RANGE_DAYS, KFC_STATS_TIMEZONE, MAX_MESSAGE_ATTACHMENTS, MESSAGE_ERROR_CATEGORIES, SIS_BUCKETS, SIS_DRIVERS, SOS_AUDIENCES, SYSTEM_CATEGORIES, SYSTEM_CATEGORY_LABELS, billEffectiveDate, billGrandTotal, billTaxAmount, billTotal, billTotals, categoryForDevice, categoryForMessageErrorCode, deliveryOutcomeForStatus, derivePrice, effectiveTaxRate, formatMoney, getAllowedDeviceTypes, getAllowedFeatures, getAllowedResourceIds, inferDeviceNotifications, isMessageErrorCategory, isSISDriver, isWellFormedRichText, keyedMarkupPercent, lib_exports, markupPercentFromPrice, resolveBillTaxExempt, resolveKfcStatsWindowBounds, resolveMarkupTierTable, serializeRichTextBody, settledBillTotal, signedMarkupPercent, taxableSubtotal };
|
|
65
|
+
export { DEFAULT_DNE_AMOUNT, DEFAULT_MARKUP_TIERS, DEFAULT_TAX_RATE, DELIVERY_OUTCOMES, ENDING_SOON_DAYS, KFC_STATS_DEFAULT_WINDOW_DAYS, KFC_STATS_MAX_RANGE_DAYS, KFC_STATS_TIMEZONE, MAX_MESSAGE_ATTACHMENTS, MESSAGE_ERROR_CATEGORIES, SIS_BUCKETS, SIS_DRIVERS, SOS_AUDIENCES, SYSTEM_CATEGORIES, SYSTEM_CATEGORY_LABELS, billEffectiveDate, billGrandTotal, billTaxAmount, billTotal, billTotals, categoryForDevice, categoryForMessageErrorCode, daysUntilEnd, deliveryOutcomeForStatus, derivePrice, effectiveTaxRate, formatMoney, getAllowedDeviceTypes, getAllowedFeatures, getAllowedResourceIds, inferDeviceNotifications, isEndingSoon, isExpired, isMessageErrorCategory, isSISDriver, isWellFormedRichText, keyedMarkupPercent, lib_exports, markupPercentFromPrice, resolveBillTaxExempt, resolveKfcStatsWindowBounds, resolveMarkupTierTable, serializeRichTextBody, settledBillTotal, signedMarkupPercent, taxableSubtotal };
|
|
61
66
|
|
|
62
67
|
//# sourceMappingURL=index.js.map
|
package/dist/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../.generated/lib/index.ts"],"sourcesContent":["export {\n inferDeviceNotifications,\n type DeviceNotificationName,\n type InferDeviceNotificationsInput,\n} from \"./deviceNotifications.js\";\nexport {\n categoryForDevice,\n SYSTEM_CATEGORIES,\n SYSTEM_CATEGORY_LABELS,\n type SystemCategory,\n type CategoryForDeviceInput,\n} from \"./systemCategories.js\";\nexport {\n getAllowedResourceIds,\n getAllowedDeviceTypes,\n getAllowedFeatures,\n type PolicyLike,\n type PolicyPermissionLike,\n} from \"./policy-resolvers.js\";\nexport { SIS_DRIVERS, isSISDriver, type SISDriver } from \"./sisDrivers.js\";\nexport { SOS_AUDIENCES, type SOSAudience } from \"./sosAudiences.js\";\nexport {\n MESSAGE_ERROR_CATEGORIES,\n categoryForMessageErrorCode,\n isMessageErrorCategory,\n type MessageErrorCategory,\n} from \"./messageErrorCodes.js\";\nexport {\n DELIVERY_OUTCOMES,\n deliveryOutcomeForStatus,\n type DeliveryOutcome,\n} from \"./deliveryStatus.js\";\nexport type {\n EmergencyContactAudience,\n EmergencyContactPeople,\n EmergencyContactPerson,\n EmergencyContactRoleGroup,\n ExternalGroupCounts,\n} from \"./emergencyContacts.js\";\nexport {\n SIS_BUCKETS,\n type SISBucket,\n type SISHousehold,\n type SISHouseholdMember,\n type SISHouseholds,\n type SISHouseholdsQuery,\n type SISPage,\n type SISPeople,\n type SISPeopleQuery,\n type SISPeopleSort,\n type SISPerson,\n type SISSortDirection,\n type SISSyncResult,\n type SISSyncState,\n} from \"./sis.js\";\nexport { MAX_MESSAGE_ATTACHMENTS } from \"./messageAttachments.js\";\nexport {\n DEFAULT_MARKUP_TIERS,\n DEFAULT_DNE_AMOUNT,\n resolveMarkupTierTable,\n keyedMarkupPercent,\n DEFAULT_TAX_RATE,\n derivePrice,\n markupPercentFromPrice,\n signedMarkupPercent,\n billTotal,\n billTaxAmount,\n billGrandTotal,\n formatMoney,\n} from \"./money.js\";\nexport {\n effectiveTaxRate,\n taxableSubtotal,\n billTotals,\n resolveBillTaxExempt,\n settledBillTotal,\n billEffectiveDate,\n type BillTaxFields,\n type TaxableLine,\n type SettledBillTotalSource,\n type BillEffectiveDateSource,\n} from \"./bills.js\";\nexport {\n KFC_STATS_TIMEZONE,\n KFC_STATS_DEFAULT_WINDOW_DAYS,\n KFC_STATS_MAX_RANGE_DAYS,\n resolveKfcStatsWindowBounds,\n type KfcStatsWindowBounds,\n} from \"./kfcStatsWindow.js\";\nexport {\n serializeRichTextBody,\n isWellFormedRichText,\n type RichTextContent,\n type RichTextBlockNode,\n type RichTextInlineNode,\n type RichTextListItemNode,\n type RichTextMentionNode,\n} from \"./ticketRichText.js\";\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../.generated/lib/index.ts"],"sourcesContent":["export {\n inferDeviceNotifications,\n type DeviceNotificationName,\n type InferDeviceNotificationsInput,\n} from \"./deviceNotifications.js\";\nexport {\n categoryForDevice,\n SYSTEM_CATEGORIES,\n SYSTEM_CATEGORY_LABELS,\n type SystemCategory,\n type CategoryForDeviceInput,\n} from \"./systemCategories.js\";\nexport {\n getAllowedResourceIds,\n getAllowedDeviceTypes,\n getAllowedFeatures,\n type PolicyLike,\n type PolicyPermissionLike,\n} from \"./policy-resolvers.js\";\nexport { SIS_DRIVERS, isSISDriver, type SISDriver } from \"./sisDrivers.js\";\nexport { SOS_AUDIENCES, type SOSAudience } from \"./sosAudiences.js\";\nexport {\n MESSAGE_ERROR_CATEGORIES,\n categoryForMessageErrorCode,\n isMessageErrorCategory,\n type MessageErrorCategory,\n} from \"./messageErrorCodes.js\";\nexport {\n DELIVERY_OUTCOMES,\n deliveryOutcomeForStatus,\n type DeliveryOutcome,\n} from \"./deliveryStatus.js\";\nexport type {\n EmergencyContactAudience,\n EmergencyContactPeople,\n EmergencyContactPerson,\n EmergencyContactRoleGroup,\n ExternalGroupCounts,\n} from \"./emergencyContacts.js\";\nexport {\n SIS_BUCKETS,\n type SISBucket,\n type SISHousehold,\n type SISHouseholdMember,\n type SISHouseholds,\n type SISHouseholdsQuery,\n type SISPage,\n type SISPeople,\n type SISPeopleQuery,\n type SISPeopleSort,\n type SISPerson,\n type SISSortDirection,\n type SISSyncResult,\n type SISSyncState,\n} from \"./sis.js\";\nexport { MAX_MESSAGE_ATTACHMENTS } from \"./messageAttachments.js\";\nexport {\n DEFAULT_MARKUP_TIERS,\n DEFAULT_DNE_AMOUNT,\n resolveMarkupTierTable,\n keyedMarkupPercent,\n DEFAULT_TAX_RATE,\n derivePrice,\n markupPercentFromPrice,\n signedMarkupPercent,\n billTotal,\n billTaxAmount,\n billGrandTotal,\n formatMoney,\n} from \"./money.js\";\nexport {\n effectiveTaxRate,\n taxableSubtotal,\n billTotals,\n resolveBillTaxExempt,\n settledBillTotal,\n billEffectiveDate,\n type BillTaxFields,\n type TaxableLine,\n type SettledBillTotalSource,\n type BillEffectiveDateSource,\n} from \"./bills.js\";\nexport {\n ENDING_SOON_DAYS,\n daysUntilEnd,\n isEndingSoon,\n isExpired,\n} from \"./serviceContracts.js\";\nexport {\n KFC_STATS_TIMEZONE,\n KFC_STATS_DEFAULT_WINDOW_DAYS,\n KFC_STATS_MAX_RANGE_DAYS,\n resolveKfcStatsWindowBounds,\n type KfcStatsWindowBounds,\n} from \"./kfcStatsWindow.js\";\nexport {\n serializeRichTextBody,\n isWellFormedRichText,\n type RichTextContent,\n type RichTextBlockNode,\n type RichTextInlineNode,\n type RichTextListItemNode,\n type RichTextMentionNode,\n} from \"./ticketRichText.js\";\n"],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Service contract term rules the API and the app must apply identically:
|
|
3
|
+
* the cross-org ledger counts what is ending soon on the server, and every row
|
|
4
|
+
* the browser flags reads the same rule, so a count and the rows it counts
|
|
5
|
+
* cannot disagree.
|
|
6
|
+
*
|
|
7
|
+
* Contract dates are UTC calendar days.
|
|
8
|
+
*/
|
|
9
|
+
type DateLike = string | Date;
|
|
10
|
+
export declare const ENDING_SOON_DAYS = 30;
|
|
11
|
+
type TermSource = {
|
|
12
|
+
status: string;
|
|
13
|
+
endsAt?: DateLike | null;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Days from today to a contract's end, in whole UTC days. Negative once the
|
|
17
|
+
* end date has passed but the contract has not yet been read as ended.
|
|
18
|
+
*/
|
|
19
|
+
export declare function daysUntilEnd(endsAt: DateLike | null | undefined, today?: Date): number | null;
|
|
20
|
+
/** Only a live contract with an end date in sight; open-ended is never flagged, and an expired one reads as expired instead. */
|
|
21
|
+
export declare function isEndingSoon(contract: TermSource, today?: Date): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* An active contract past its last day. It stays active until billing staff
|
|
24
|
+
* add due contract costs, which ends it.
|
|
25
|
+
*/
|
|
26
|
+
export declare function isExpired(contract: TermSource, today?: Date): boolean;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//#region .generated/lib/serviceContracts.ts
|
|
2
|
+
const ENDING_SOON_DAYS = 30;
|
|
3
|
+
const DAY_MS = 864e5;
|
|
4
|
+
/**
|
|
5
|
+
* Days from today to a contract's end, in whole UTC days. Negative once the
|
|
6
|
+
* end date has passed but the contract has not yet been read as ended.
|
|
7
|
+
*/
|
|
8
|
+
function daysUntilEnd(endsAt, today = /* @__PURE__ */ new Date()) {
|
|
9
|
+
if (!endsAt) return null;
|
|
10
|
+
const end = new Date(endsAt);
|
|
11
|
+
if (Number.isNaN(end.getTime())) return null;
|
|
12
|
+
const endDay = Date.UTC(end.getUTCFullYear(), end.getUTCMonth(), end.getUTCDate());
|
|
13
|
+
const todayDay = Date.UTC(today.getUTCFullYear(), today.getUTCMonth(), today.getUTCDate());
|
|
14
|
+
return Math.round((endDay - todayDay) / DAY_MS);
|
|
15
|
+
}
|
|
16
|
+
/** Only a live contract with an end date in sight; open-ended is never flagged, and an expired one reads as expired instead. */
|
|
17
|
+
function isEndingSoon(contract, today = /* @__PURE__ */ new Date()) {
|
|
18
|
+
if (contract.status !== "active") return false;
|
|
19
|
+
const days = daysUntilEnd(contract.endsAt, today);
|
|
20
|
+
return days !== null && days >= 0 && days <= 30;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* An active contract past its last day. It stays active until billing staff
|
|
24
|
+
* add due contract costs, which ends it.
|
|
25
|
+
*/
|
|
26
|
+
function isExpired(contract, today = /* @__PURE__ */ new Date()) {
|
|
27
|
+
if (contract.status !== "active") return false;
|
|
28
|
+
const days = daysUntilEnd(contract.endsAt, today);
|
|
29
|
+
return days !== null && days < 0;
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { ENDING_SOON_DAYS, daysUntilEnd, isEndingSoon, isExpired };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=serviceContracts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serviceContracts.js","names":[],"sources":["../../.generated/lib/serviceContracts.ts"],"sourcesContent":["/**\n * The Service contract term rules the API and the app must apply identically:\n * the cross-org ledger counts what is ending soon on the server, and every row\n * the browser flags reads the same rule, so a count and the rows it counts\n * cannot disagree.\n *\n * Contract dates are UTC calendar days.\n */\n\ntype DateLike = string | Date;\n\nexport const ENDING_SOON_DAYS = 30;\n\nconst DAY_MS = 86_400_000;\n\ntype TermSource = {\n status: string;\n endsAt?: DateLike | null;\n};\n\n/**\n * Days from today to a contract's end, in whole UTC days. Negative once the\n * end date has passed but the contract has not yet been read as ended.\n */\nexport function daysUntilEnd(\n endsAt: DateLike | null | undefined,\n today: Date = new Date(),\n): number | null {\n if (!endsAt) return null;\n const end = new Date(endsAt);\n if (Number.isNaN(end.getTime())) return null;\n const endDay = Date.UTC(\n end.getUTCFullYear(),\n end.getUTCMonth(),\n end.getUTCDate(),\n );\n const todayDay = Date.UTC(\n today.getUTCFullYear(),\n today.getUTCMonth(),\n today.getUTCDate(),\n );\n return Math.round((endDay - todayDay) / DAY_MS);\n}\n\n/** Only a live contract with an end date in sight; open-ended is never flagged, and an expired one reads as expired instead. */\nexport function isEndingSoon(\n contract: TermSource,\n today: Date = new Date(),\n): boolean {\n if (contract.status !== \"active\") return false;\n const days = daysUntilEnd(contract.endsAt, today);\n return days !== null && days >= 0 && days <= ENDING_SOON_DAYS;\n}\n\n/**\n * An active contract past its last day. It stays active until billing staff\n * add due contract costs, which ends it.\n */\nexport function isExpired(\n contract: TermSource,\n today: Date = new Date(),\n): boolean {\n if (contract.status !== \"active\") return false;\n const days = daysUntilEnd(contract.endsAt, today);\n return days !== null && days < 0;\n}\n"],"mappings":";AAWA,MAAa,mBAAmB;AAEhC,MAAM,SAAS;;;;;AAWf,SAAgB,aACd,QACA,wBAAc,IAAI,KAAK,GACR;CACf,IAAI,CAAC,QAAQ,OAAO;CACpB,MAAM,MAAM,IAAI,KAAK,MAAM;CAC3B,IAAI,OAAO,MAAM,IAAI,QAAQ,CAAC,GAAG,OAAO;CACxC,MAAM,SAAS,KAAK,IAClB,IAAI,eAAe,GACnB,IAAI,YAAY,GAChB,IAAI,WAAW,CACjB;CACA,MAAM,WAAW,KAAK,IACpB,MAAM,eAAe,GACrB,MAAM,YAAY,GAClB,MAAM,WAAW,CACnB;CACA,OAAO,KAAK,OAAO,SAAS,YAAY,MAAM;AAChD;;AAGA,SAAgB,aACd,UACA,wBAAc,IAAI,KAAK,GACd;CACT,IAAI,SAAS,WAAW,UAAU,OAAO;CACzC,MAAM,OAAO,aAAa,SAAS,QAAQ,KAAK;CAChD,OAAO,SAAS,QAAQ,QAAQ,KAAK,QAAA;AACvC;;;;;AAMA,SAAgB,UACd,UACA,wBAAc,IAAI,KAAK,GACd;CACT,IAAI,SAAS,WAAW,UAAU,OAAO;CACzC,MAAM,OAAO,aAAa,SAAS,QAAQ,KAAK;CAChD,OAAO,SAAS,QAAQ,OAAO;AACjC"}
|
|
@@ -19,6 +19,7 @@ var Automation = class extends Entity {
|
|
|
19
19
|
if (data.lastRunAt !== void 0) this.lastRunAt = data.lastRunAt;
|
|
20
20
|
if (data.deletedAt !== void 0) this.deletedAt = data.deletedAt;
|
|
21
21
|
if (data.webhookUrl !== void 0) this.webhookUrl = data.webhookUrl;
|
|
22
|
+
if (data.serviceContractId !== void 0) this.serviceContractId = data.serviceContractId;
|
|
22
23
|
}
|
|
23
24
|
};
|
|
24
25
|
Object.defineProperty(Automation.prototype, "schema", { value: automationSchema });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"automation.js","names":["validate"],"sources":["../../.generated/models/automation.ts"],"sourcesContent":["/* This file is automatically generated. Do not modify it manually. */\n\nimport { Entity } from \"./entity.js\";\nimport { validateAutomation as validate } from \"../validate.js\";\nimport { automationSchema, type AutomationSchema } from \"../schemas/automation.js\";\n\n/**\n * Data type for Automation constructor - exported for backwards compatibility\n */\nexport type AutomationData = AutomationSchema;\n\n/**\n * An automation is a collection of triggers and actions\n */\nexport interface Automation extends AutomationSchema {}\nexport class Automation extends Entity {\n declare schema: typeof automationSchema;\n declare validator: typeof validate;\n\n constructor(data: AutomationSchema) {\n super(data);\n this.id = data.id;\n if (data.propertyId !== undefined) this.propertyId = data.propertyId;\n if (data.name !== undefined) this.name = data.name;\n this.type = data.type;\n if (data.isEnabled !== undefined) this.isEnabled = data.isEnabled;\n if (data.description !== undefined) this.description = data.description;\n this.trigger = data.trigger;\n this.actions = data.actions;\n if (data.createdAt !== undefined) this.createdAt = data.createdAt;\n if (data.updatedAt !== undefined) this.updatedAt = data.updatedAt;\n if (data.nextRunAt !== undefined) this.nextRunAt = data.nextRunAt;\n if (data.lastRunAt !== undefined) this.lastRunAt = data.lastRunAt;\n if (data.deletedAt !== undefined) this.deletedAt = data.deletedAt;\n if (data.webhookUrl !== undefined) this.webhookUrl = data.webhookUrl;\n }\n\n\n\n\n\n\n\n\n}\n\nObject.defineProperty(Automation.prototype, \"schema\", {\n value: automationSchema\n});\n\nObject.defineProperty(Automation.prototype, \"validator\", {\n get: function() { return validate; }\n});\n"],"mappings":";;;;AAeA,IAAa,aAAb,cAAgC,OAAO;CAIrC,YAAY,MAAwB;EAClC,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,KAAK,OAAO,KAAK;EACjB,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,gBAAgB,KAAA,GAAW,KAAK,cAAc,KAAK;EAC5D,KAAK,UAAU,KAAK;EACpB,KAAK,UAAU,KAAK;EACpB,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,eAAe,KAAA,GAAW,KAAK,aAAa,KAAK;
|
|
1
|
+
{"version":3,"file":"automation.js","names":["validate"],"sources":["../../.generated/models/automation.ts"],"sourcesContent":["/* This file is automatically generated. Do not modify it manually. */\n\nimport { Entity } from \"./entity.js\";\nimport { validateAutomation as validate } from \"../validate.js\";\nimport { automationSchema, type AutomationSchema } from \"../schemas/automation.js\";\n\n/**\n * Data type for Automation constructor - exported for backwards compatibility\n */\nexport type AutomationData = AutomationSchema;\n\n/**\n * An automation is a collection of triggers and actions\n */\nexport interface Automation extends AutomationSchema {}\nexport class Automation extends Entity {\n declare schema: typeof automationSchema;\n declare validator: typeof validate;\n\n constructor(data: AutomationSchema) {\n super(data);\n this.id = data.id;\n if (data.propertyId !== undefined) this.propertyId = data.propertyId;\n if (data.name !== undefined) this.name = data.name;\n this.type = data.type;\n if (data.isEnabled !== undefined) this.isEnabled = data.isEnabled;\n if (data.description !== undefined) this.description = data.description;\n this.trigger = data.trigger;\n this.actions = data.actions;\n if (data.createdAt !== undefined) this.createdAt = data.createdAt;\n if (data.updatedAt !== undefined) this.updatedAt = data.updatedAt;\n if (data.nextRunAt !== undefined) this.nextRunAt = data.nextRunAt;\n if (data.lastRunAt !== undefined) this.lastRunAt = data.lastRunAt;\n if (data.deletedAt !== undefined) this.deletedAt = data.deletedAt;\n if (data.webhookUrl !== undefined) this.webhookUrl = data.webhookUrl;\n if (data.serviceContractId !== undefined) this.serviceContractId = data.serviceContractId;\n }\n\n\n\n\n\n\n\n\n}\n\nObject.defineProperty(Automation.prototype, \"schema\", {\n value: automationSchema\n});\n\nObject.defineProperty(Automation.prototype, \"validator\", {\n get: function() { return validate; }\n});\n"],"mappings":";;;;AAeA,IAAa,aAAb,cAAgC,OAAO;CAIrC,YAAY,MAAwB;EAClC,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,KAAK,OAAO,KAAK;EACjB,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,gBAAgB,KAAA,GAAW,KAAK,cAAc,KAAK;EAC5D,KAAK,UAAU,KAAK;EACpB,KAAK,UAAU,KAAK;EACpB,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,eAAe,KAAA,GAAW,KAAK,aAAa,KAAK;EAC1D,IAAI,KAAK,sBAAsB,KAAA,GAAW,KAAK,oBAAoB,KAAK;CAC1E;AASF;AAEA,OAAO,eAAe,WAAW,WAAW,UAAU,EACpD,OAAO,iBACT,CAAC;AAED,OAAO,eAAe,WAAW,WAAW,aAAa,EACvD,KAAK,WAAW;CAAE,OAAOA;AAAU,EACrC,CAAC"}
|
package/dist/models/cost.js
CHANGED
|
@@ -21,6 +21,11 @@ var Cost = class extends Entity {
|
|
|
21
21
|
if (data.billingReview !== void 0) this.billingReview = data.billingReview;
|
|
22
22
|
if (data.type !== void 0) this.type = data.type;
|
|
23
23
|
if (data.source !== void 0) this.source = data.source;
|
|
24
|
+
if (data.serviceContractId !== void 0) this.serviceContractId = data.serviceContractId;
|
|
25
|
+
if (data.splitId !== void 0) this.splitId = data.splitId;
|
|
26
|
+
if (data.periodStart !== void 0) this.periodStart = data.periodStart;
|
|
27
|
+
if (data.customerPeriodStarts !== void 0) this.customerPeriodStarts = data.customerPeriodStarts;
|
|
28
|
+
if (data.vendorPeriodStarts !== void 0) this.vendorPeriodStarts = data.vendorPeriodStarts;
|
|
24
29
|
this.organizationId = data.organizationId;
|
|
25
30
|
if (data.propertyId !== void 0) this.propertyId = data.propertyId;
|
|
26
31
|
if (data.createdBy !== void 0) this.createdBy = data.createdBy;
|
package/dist/models/cost.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cost.js","names":["validate"],"sources":["../../.generated/models/cost.ts"],"sourcesContent":["/* This file is automatically generated. Do not modify it manually. */\n\nimport { Entity } from \"./entity.js\";\nimport { validateCost as validate } from \"../validate.js\";\nimport { costSchema, type CostSchema } from \"../schemas/cost.js\";\n\n/**\n * Data type for Cost constructor - exported for backwards compatibility\n */\nexport type CostData = CostSchema;\n\n/**\n * A OneBill cost entry that no ticket carries: a recurring vendor charge, an expense found while reconciling an invoice, a pass-through cost. It shares the money shape and reconciliation lifecycle of a ticket cost entry and moves through the uninvoiced pool the same way, but because no ticket carries it the DNE approval gate never applies. Stored platform-wide beside bills and stamped with its organization.\n */\nexport interface Cost extends CostSchema {}\nexport class Cost extends Entity {\n declare schema: typeof costSchema;\n declare validator: typeof validate;\n\n constructor(data: CostSchema) {\n super(data);\n this.id = data.id;\n this.description = data.description;\n this.currency = data.currency;\n this.price = data.price;\n this.estimate = data.estimate;\n if (data.actual !== undefined) this.actual = data.actual;\n this.markup = data.markup;\n if (data.vendorId !== undefined) this.vendorId = data.vendorId;\n if (data.categoryId !== undefined) this.categoryId = data.categoryId;\n if (data.vendorInvoices !== undefined) this.vendorInvoices = data.vendorInvoices;\n if (data.vendorInvoiceNumber !== undefined) this.vendorInvoiceNumber = data.vendorInvoiceNumber;\n if (data.billId !== undefined) this.billId = data.billId;\n if (data.writtenOff !== undefined) this.writtenOff = data.writtenOff;\n if (data.billingReview !== undefined) this.billingReview = data.billingReview;\n if (data.type !== undefined) this.type = data.type;\n if (data.source !== undefined) this.source = data.source;\n this.organizationId = data.organizationId;\n if (data.propertyId !== undefined) this.propertyId = data.propertyId;\n if (data.createdBy !== undefined) this.createdBy = data.createdBy;\n if (data.createdAt !== undefined) this.createdAt = data.createdAt;\n if (data.updatedAt !== undefined) this.updatedAt = data.updatedAt;\n }\n\n\n\n\n\n\n\n\n}\n\nObject.defineProperty(Cost.prototype, \"schema\", {\n value: costSchema\n});\n\nObject.defineProperty(Cost.prototype, \"validator\", {\n get: function() { return validate; }\n});\n"],"mappings":";;;;AAeA,IAAa,OAAb,cAA0B,OAAO;CAI/B,YAAY,MAAkB;EAC5B,MAAM,IAAI;EACV,KAAK,KAAK,KAAK;EACf,KAAK,cAAc,KAAK;EACxB,KAAK,WAAW,KAAK;EACrB,KAAK,QAAQ,KAAK;EAClB,KAAK,WAAW,KAAK;EACrB,IAAI,KAAK,WAAW,KAAA,GAAW,KAAK,SAAS,KAAK;EAClD,KAAK,SAAS,KAAK;EACnB,IAAI,KAAK,aAAa,KAAA,GAAW,KAAK,WAAW,KAAK;EACtD,IAAI,KAAK,eAAe,KAAA,GAAW,KAAK,aAAa,KAAK;EAC1D,IAAI,KAAK,mBAAmB,KAAA,GAAW,KAAK,iBAAiB,KAAK;EAClE,IAAI,KAAK,wBAAwB,KAAA,GAAW,KAAK,sBAAsB,KAAK;EAC5E,IAAI,KAAK,WAAW,KAAA,GAAW,KAAK,SAAS,KAAK;EAClD,IAAI,KAAK,eAAe,KAAA,GAAW,KAAK,aAAa,KAAK;EAC1D,IAAI,KAAK,kBAAkB,KAAA,GAAW,KAAK,gBAAgB,KAAK;EAChE,IAAI,KAAK,SAAS,KAAA,GAAW,KAAK,OAAO,KAAK;EAC9C,IAAI,KAAK,WAAW,KAAA,GAAW,KAAK,SAAS,KAAK;EAClD,KAAK,iBAAiB,KAAK;EAC3B,IAAI,KAAK,eAAe,KAAA,GAAW,KAAK,aAAa,KAAK;EAC1D,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;CAC1D;AASF;AAEA,OAAO,eAAe,KAAK,WAAW,UAAU,EAC9C,OAAO,WACT,CAAC;AAED,OAAO,eAAe,KAAK,WAAW,aAAa,EACjD,KAAK,WAAW;CAAE,OAAOA;AAAU,EACrC,CAAC"}
|
|
1
|
+
{"version":3,"file":"cost.js","names":["validate"],"sources":["../../.generated/models/cost.ts"],"sourcesContent":["/* This file is automatically generated. Do not modify it manually. */\n\nimport { Entity } from \"./entity.js\";\nimport { validateCost as validate } from \"../validate.js\";\nimport { costSchema, type CostSchema } from \"../schemas/cost.js\";\n\n/**\n * Data type for Cost constructor - exported for backwards compatibility\n */\nexport type CostData = CostSchema;\n\n/**\n * A OneBill cost entry that no ticket carries: a recurring vendor charge, an expense found while reconciling an invoice, a pass-through cost. It shares the money shape and reconciliation lifecycle of a ticket cost entry and moves through the uninvoiced pool the same way, but because no ticket carries it the DNE approval gate never applies. Stored platform-wide beside bills and stamped with its organization.\n */\nexport interface Cost extends CostSchema {}\nexport class Cost extends Entity {\n declare schema: typeof costSchema;\n declare validator: typeof validate;\n\n constructor(data: CostSchema) {\n super(data);\n this.id = data.id;\n this.description = data.description;\n this.currency = data.currency;\n this.price = data.price;\n this.estimate = data.estimate;\n if (data.actual !== undefined) this.actual = data.actual;\n this.markup = data.markup;\n if (data.vendorId !== undefined) this.vendorId = data.vendorId;\n if (data.categoryId !== undefined) this.categoryId = data.categoryId;\n if (data.vendorInvoices !== undefined) this.vendorInvoices = data.vendorInvoices;\n if (data.vendorInvoiceNumber !== undefined) this.vendorInvoiceNumber = data.vendorInvoiceNumber;\n if (data.billId !== undefined) this.billId = data.billId;\n if (data.writtenOff !== undefined) this.writtenOff = data.writtenOff;\n if (data.billingReview !== undefined) this.billingReview = data.billingReview;\n if (data.type !== undefined) this.type = data.type;\n if (data.source !== undefined) this.source = data.source;\n if (data.serviceContractId !== undefined) this.serviceContractId = data.serviceContractId;\n if (data.splitId !== undefined) this.splitId = data.splitId;\n if (data.periodStart !== undefined) this.periodStart = data.periodStart;\n if (data.customerPeriodStarts !== undefined) this.customerPeriodStarts = data.customerPeriodStarts;\n if (data.vendorPeriodStarts !== undefined) this.vendorPeriodStarts = data.vendorPeriodStarts;\n this.organizationId = data.organizationId;\n if (data.propertyId !== undefined) this.propertyId = data.propertyId;\n if (data.createdBy !== undefined) this.createdBy = data.createdBy;\n if (data.createdAt !== undefined) this.createdAt = data.createdAt;\n if (data.updatedAt !== undefined) this.updatedAt = data.updatedAt;\n }\n\n\n\n\n\n\n\n\n}\n\nObject.defineProperty(Cost.prototype, \"schema\", {\n value: costSchema\n});\n\nObject.defineProperty(Cost.prototype, \"validator\", {\n get: function() { return validate; }\n});\n"],"mappings":";;;;AAeA,IAAa,OAAb,cAA0B,OAAO;CAI/B,YAAY,MAAkB;EAC5B,MAAM,IAAI;EACV,KAAK,KAAK,KAAK;EACf,KAAK,cAAc,KAAK;EACxB,KAAK,WAAW,KAAK;EACrB,KAAK,QAAQ,KAAK;EAClB,KAAK,WAAW,KAAK;EACrB,IAAI,KAAK,WAAW,KAAA,GAAW,KAAK,SAAS,KAAK;EAClD,KAAK,SAAS,KAAK;EACnB,IAAI,KAAK,aAAa,KAAA,GAAW,KAAK,WAAW,KAAK;EACtD,IAAI,KAAK,eAAe,KAAA,GAAW,KAAK,aAAa,KAAK;EAC1D,IAAI,KAAK,mBAAmB,KAAA,GAAW,KAAK,iBAAiB,KAAK;EAClE,IAAI,KAAK,wBAAwB,KAAA,GAAW,KAAK,sBAAsB,KAAK;EAC5E,IAAI,KAAK,WAAW,KAAA,GAAW,KAAK,SAAS,KAAK;EAClD,IAAI,KAAK,eAAe,KAAA,GAAW,KAAK,aAAa,KAAK;EAC1D,IAAI,KAAK,kBAAkB,KAAA,GAAW,KAAK,gBAAgB,KAAK;EAChE,IAAI,KAAK,SAAS,KAAA,GAAW,KAAK,OAAO,KAAK;EAC9C,IAAI,KAAK,WAAW,KAAA,GAAW,KAAK,SAAS,KAAK;EAClD,IAAI,KAAK,sBAAsB,KAAA,GAAW,KAAK,oBAAoB,KAAK;EACxE,IAAI,KAAK,YAAY,KAAA,GAAW,KAAK,UAAU,KAAK;EACpD,IAAI,KAAK,gBAAgB,KAAA,GAAW,KAAK,cAAc,KAAK;EAC5D,IAAI,KAAK,yBAAyB,KAAA,GAAW,KAAK,uBAAuB,KAAK;EAC9E,IAAI,KAAK,uBAAuB,KAAA,GAAW,KAAK,qBAAqB,KAAK;EAC1E,KAAK,iBAAiB,KAAK;EAC3B,IAAI,KAAK,eAAe,KAAA,GAAW,KAAK,aAAa,KAAK;EAC1D,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;CAC1D;AASF;AAEA,OAAO,eAAe,KAAK,WAAW,UAAU,EAC9C,OAAO,WACT,CAAC;AAED,OAAO,eAAe,KAAK,WAAW,aAAa,EACjD,KAAK,WAAW;CAAE,OAAOA;AAAU,EACrC,CAAC"}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export { Property, type PropertyData } from "./property.js";
|
|
|
34
34
|
export { Reservation, type ReservationData } from "./reservation.js";
|
|
35
35
|
export { Resource, type ResourceData } from "./resource.js";
|
|
36
36
|
export { Server, type ServerData } from "./server.js";
|
|
37
|
+
export { ServiceContract, type ServiceContractData } from "./serviceContract.js";
|
|
37
38
|
export { Session, type SessionData } from "./session.js";
|
|
38
39
|
export { ShortLink, type ShortLinkData } from "./shortLink.js";
|
|
39
40
|
export { SmsMessage, type SmsMessageData } from "./smsMessage.js";
|
package/dist/models/index.js
CHANGED
|
@@ -35,6 +35,7 @@ import { Property } from "./property.js";
|
|
|
35
35
|
import { Reservation } from "./reservation.js";
|
|
36
36
|
import { Resource } from "./resource.js";
|
|
37
37
|
import { Server } from "./server.js";
|
|
38
|
+
import { ServiceContract } from "./serviceContract.js";
|
|
38
39
|
import { Session } from "./session.js";
|
|
39
40
|
import { ShortLink } from "./shortLink.js";
|
|
40
41
|
import { SmsMessage } from "./smsMessage.js";
|
|
@@ -90,6 +91,7 @@ var models_exports = /* @__PURE__ */ __exportAll({
|
|
|
90
91
|
SOSEvent: () => SOSEvent,
|
|
91
92
|
SOSType: () => SOSType,
|
|
92
93
|
Server: () => Server,
|
|
94
|
+
ServiceContract: () => ServiceContract,
|
|
93
95
|
Session: () => Session,
|
|
94
96
|
ShortLink: () => ShortLink,
|
|
95
97
|
SmsMessage: () => SmsMessage,
|
|
@@ -105,6 +107,6 @@ var models_exports = /* @__PURE__ */ __exportAll({
|
|
|
105
107
|
WindowCovering: () => WindowCovering
|
|
106
108
|
});
|
|
107
109
|
//#endregion
|
|
108
|
-
export { Alarm, Announcement, Automation, Bill, BillingCategory, Camera, Category, Cost, Courtesy, Credential, Department, Dimmer, DiscoveredDevice, EmailMessage, EnergyReport, EnergyReportShard, Entity, Gateway, Group, Identification, Integration, Issue, Lock, Log, MediaFile, MediaSource, MotionSensor, Notification, Organization, Payment, Policy, Product, Property, Reservation, Resource, SOSEvent, SOSType, Server, Session, ShortLink, SmsMessage, Space, Switch, System, SystemUser, Thermostat, Ticket, TimeSheet, User, Vendor, WindowCovering, models_exports };
|
|
110
|
+
export { Alarm, Announcement, Automation, Bill, BillingCategory, Camera, Category, Cost, Courtesy, Credential, Department, Dimmer, DiscoveredDevice, EmailMessage, EnergyReport, EnergyReportShard, Entity, Gateway, Group, Identification, Integration, Issue, Lock, Log, MediaFile, MediaSource, MotionSensor, Notification, Organization, Payment, Policy, Product, Property, Reservation, Resource, SOSEvent, SOSType, Server, ServiceContract, Session, ShortLink, SmsMessage, Space, Switch, System, SystemUser, Thermostat, Ticket, TimeSheet, User, Vendor, WindowCovering, models_exports };
|
|
109
111
|
|
|
110
112
|
//# sourceMappingURL=index.js.map
|
package/dist/models/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../.generated/models/index.ts"],"sourcesContent":["/* This file is automatically generated. Do not modify it manually. */\n\nexport { Entity } from \"./entity.js\";\n\nexport { Alarm, type AlarmData } from \"./alarm.js\";\nexport { Announcement, type AnnouncementData } from \"./announcement.js\";\nexport { Automation, type AutomationData } from \"./automation.js\";\nexport { Bill, type BillData } from \"./bill.js\";\nexport { BillingCategory, type BillingCategoryData } from \"./billingCategory.js\";\nexport { Camera, type CameraData } from \"./camera.js\";\nexport { Category, type CategoryData } from \"./category.js\";\nexport { Cost, type CostData } from \"./cost.js\";\nexport { Courtesy, type CourtesyData } from \"./courtesy.js\";\nexport { Credential, type CredentialData } from \"./credential.js\";\nexport { Department, type DepartmentData } from \"./department.js\";\nexport { Dimmer, type DimmerData } from \"./dimmer.js\";\nexport { DiscoveredDevice, type DiscoveredDeviceData } from \"./discoveredDevice.js\";\nexport { EmailMessage, type EmailMessageData } from \"./emailMessage.js\";\nexport { EnergyReport, type EnergyReportData } from \"./energyReport.js\";\nexport { EnergyReportShard, type EnergyReportShardData } from \"./energyReportShard.js\";\nexport { Gateway, type GatewayData } from \"./gateway.js\";\nexport { Group, type GroupData } from \"./group.js\";\nexport { Identification, type IdentificationData } from \"./identification.js\";\nexport { Integration, type IntegrationData } from \"./integration.js\";\nexport { Issue, type IssueData } from \"./issue.js\";\nexport { Lock, type LockData } from \"./lock.js\";\nexport { Log, type LogData } from \"./log.js\";\nexport { MediaFile, type MediaFileData } from \"./mediaFile.js\";\nexport { MediaSource, type MediaSourceData } from \"./mediaSource.js\";\nexport { MotionSensor, type MotionSensorData } from \"./motionSensor.js\";\nexport { Notification, type NotificationData } from \"./notification.js\";\nexport { Organization, type OrganizationData } from \"./organization.js\";\nexport { Payment, type PaymentData } from \"./payment.js\";\nexport { Policy, type PolicyData } from \"./policy.js\";\nexport { Product, type ProductData } from \"./product.js\";\nexport { Property, type PropertyData } from \"./property.js\";\nexport { Reservation, type ReservationData } from \"./reservation.js\";\nexport { Resource, type ResourceData } from \"./resource.js\";\nexport { Server, type ServerData } from \"./server.js\";\nexport { Session, type SessionData } from \"./session.js\";\nexport { ShortLink, type ShortLinkData } from \"./shortLink.js\";\nexport { SmsMessage, type SmsMessageData } from \"./smsMessage.js\";\nexport { SOSEvent, type SOSEventData } from \"./sosEvent.js\";\nexport { SOSType, type SOSTypeData } from \"./sosType.js\";\nexport { Space, type SpaceData } from \"./space.js\";\nexport { Switch, type SwitchData } from \"./switch.js\";\nexport { System, type SystemData } from \"./system.js\";\nexport { SystemUser, type SystemUserData } from \"./systemUser.js\";\nexport { Thermostat, type ThermostatData } from \"./thermostat.js\";\nexport { Ticket, type TicketData } from \"./ticket.js\";\nexport { TimeSheet, type TimeSheetData } from \"./timeSheet.js\";\nexport { User, type UserData } from \"./user.js\";\nexport { Vendor, type VendorData } from \"./vendor.js\";\nexport { WindowCovering, type WindowCoveringData } from \"./windowCovering.js\";\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../.generated/models/index.ts"],"sourcesContent":["/* This file is automatically generated. Do not modify it manually. */\n\nexport { Entity } from \"./entity.js\";\n\nexport { Alarm, type AlarmData } from \"./alarm.js\";\nexport { Announcement, type AnnouncementData } from \"./announcement.js\";\nexport { Automation, type AutomationData } from \"./automation.js\";\nexport { Bill, type BillData } from \"./bill.js\";\nexport { BillingCategory, type BillingCategoryData } from \"./billingCategory.js\";\nexport { Camera, type CameraData } from \"./camera.js\";\nexport { Category, type CategoryData } from \"./category.js\";\nexport { Cost, type CostData } from \"./cost.js\";\nexport { Courtesy, type CourtesyData } from \"./courtesy.js\";\nexport { Credential, type CredentialData } from \"./credential.js\";\nexport { Department, type DepartmentData } from \"./department.js\";\nexport { Dimmer, type DimmerData } from \"./dimmer.js\";\nexport { DiscoveredDevice, type DiscoveredDeviceData } from \"./discoveredDevice.js\";\nexport { EmailMessage, type EmailMessageData } from \"./emailMessage.js\";\nexport { EnergyReport, type EnergyReportData } from \"./energyReport.js\";\nexport { EnergyReportShard, type EnergyReportShardData } from \"./energyReportShard.js\";\nexport { Gateway, type GatewayData } from \"./gateway.js\";\nexport { Group, type GroupData } from \"./group.js\";\nexport { Identification, type IdentificationData } from \"./identification.js\";\nexport { Integration, type IntegrationData } from \"./integration.js\";\nexport { Issue, type IssueData } from \"./issue.js\";\nexport { Lock, type LockData } from \"./lock.js\";\nexport { Log, type LogData } from \"./log.js\";\nexport { MediaFile, type MediaFileData } from \"./mediaFile.js\";\nexport { MediaSource, type MediaSourceData } from \"./mediaSource.js\";\nexport { MotionSensor, type MotionSensorData } from \"./motionSensor.js\";\nexport { Notification, type NotificationData } from \"./notification.js\";\nexport { Organization, type OrganizationData } from \"./organization.js\";\nexport { Payment, type PaymentData } from \"./payment.js\";\nexport { Policy, type PolicyData } from \"./policy.js\";\nexport { Product, type ProductData } from \"./product.js\";\nexport { Property, type PropertyData } from \"./property.js\";\nexport { Reservation, type ReservationData } from \"./reservation.js\";\nexport { Resource, type ResourceData } from \"./resource.js\";\nexport { Server, type ServerData } from \"./server.js\";\nexport { ServiceContract, type ServiceContractData } from \"./serviceContract.js\";\nexport { Session, type SessionData } from \"./session.js\";\nexport { ShortLink, type ShortLinkData } from \"./shortLink.js\";\nexport { SmsMessage, type SmsMessageData } from \"./smsMessage.js\";\nexport { SOSEvent, type SOSEventData } from \"./sosEvent.js\";\nexport { SOSType, type SOSTypeData } from \"./sosType.js\";\nexport { Space, type SpaceData } from \"./space.js\";\nexport { Switch, type SwitchData } from \"./switch.js\";\nexport { System, type SystemData } from \"./system.js\";\nexport { SystemUser, type SystemUserData } from \"./systemUser.js\";\nexport { Thermostat, type ThermostatData } from \"./thermostat.js\";\nexport { Ticket, type TicketData } from \"./ticket.js\";\nexport { TimeSheet, type TimeSheetData } from \"./timeSheet.js\";\nexport { User, type UserData } from \"./user.js\";\nexport { Vendor, type VendorData } from \"./vendor.js\";\nexport { WindowCovering, type WindowCoveringData } from \"./windowCovering.js\";\n"],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Entity } from "./entity.js";
|
|
2
|
+
import { validateServiceContract as validate } from "../validate.js";
|
|
3
|
+
import { serviceContractSchema, type ServiceContractSchema } from "../schemas/serviceContract.js";
|
|
4
|
+
/**
|
|
5
|
+
* Data type for ServiceContract constructor - exported for backwards compatibility
|
|
6
|
+
*/
|
|
7
|
+
export type ServiceContractData = ServiceContractSchema;
|
|
8
|
+
/**
|
|
9
|
+
* Kohost's record of a recurring vendor service sold to an organization. One term bounds two money streams, customer and vendor, each with its own total, cadence and start, and any number of Ticket schedules. The customer stream splits its total across properties; each split also carries its share of the vendor total. Stored platform-wide beside bills and costs and stamped with its organization (ADR 0043, ADR 0044).
|
|
10
|
+
*/
|
|
11
|
+
export interface ServiceContract extends ServiceContractSchema {
|
|
12
|
+
}
|
|
13
|
+
export declare class ServiceContract extends Entity {
|
|
14
|
+
schema: typeof serviceContractSchema;
|
|
15
|
+
validator: typeof validate;
|
|
16
|
+
constructor(data: ServiceContractSchema);
|
|
17
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Entity } from "./entity.js";
|
|
2
|
+
import { serviceContractSchema } from "../schemas/serviceContract.js";
|
|
3
|
+
import { validateServiceContract } from "../validate.js";
|
|
4
|
+
//#region .generated/models/serviceContract.ts
|
|
5
|
+
var ServiceContract = class extends Entity {
|
|
6
|
+
constructor(data) {
|
|
7
|
+
super(data);
|
|
8
|
+
this.id = data.id;
|
|
9
|
+
this.type = data.type;
|
|
10
|
+
this.organizationId = data.organizationId;
|
|
11
|
+
this.name = data.name;
|
|
12
|
+
if (data.reference !== void 0) this.reference = data.reference;
|
|
13
|
+
if (data.description !== void 0) this.description = data.description;
|
|
14
|
+
this.startsAt = data.startsAt;
|
|
15
|
+
if (data.endsAt !== void 0) this.endsAt = data.endsAt;
|
|
16
|
+
this.customer = data.customer;
|
|
17
|
+
if (data.vendor !== void 0) this.vendor = data.vendor;
|
|
18
|
+
if (data.approval !== void 0) this.approval = data.approval;
|
|
19
|
+
if (data.documents !== void 0) this.documents = data.documents;
|
|
20
|
+
if (data.ticketSchedules !== void 0) this.ticketSchedules = data.ticketSchedules;
|
|
21
|
+
this.status = data.status;
|
|
22
|
+
if (data.cancelledReason !== void 0) this.cancelledReason = data.cancelledReason;
|
|
23
|
+
if (data.createdBy !== void 0) this.createdBy = data.createdBy;
|
|
24
|
+
if (data.createdAt !== void 0) this.createdAt = data.createdAt;
|
|
25
|
+
if (data.updatedAt !== void 0) this.updatedAt = data.updatedAt;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(ServiceContract.prototype, "schema", { value: serviceContractSchema });
|
|
29
|
+
Object.defineProperty(ServiceContract.prototype, "validator", { get: function() {
|
|
30
|
+
return validateServiceContract;
|
|
31
|
+
} });
|
|
32
|
+
//#endregion
|
|
33
|
+
export { ServiceContract };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=serviceContract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serviceContract.js","names":["validate"],"sources":["../../.generated/models/serviceContract.ts"],"sourcesContent":["/* This file is automatically generated. Do not modify it manually. */\n\nimport { Entity } from \"./entity.js\";\nimport { validateServiceContract as validate } from \"../validate.js\";\nimport { serviceContractSchema, type ServiceContractSchema } from \"../schemas/serviceContract.js\";\n\n/**\n * Data type for ServiceContract constructor - exported for backwards compatibility\n */\nexport type ServiceContractData = ServiceContractSchema;\n\n/**\n * Kohost's record of a recurring vendor service sold to an organization. One term bounds two money streams, customer and vendor, each with its own total, cadence and start, and any number of Ticket schedules. The customer stream splits its total across properties; each split also carries its share of the vendor total. Stored platform-wide beside bills and costs and stamped with its organization (ADR 0043, ADR 0044).\n */\nexport interface ServiceContract extends ServiceContractSchema {}\nexport class ServiceContract extends Entity {\n declare schema: typeof serviceContractSchema;\n declare validator: typeof validate;\n\n constructor(data: ServiceContractSchema) {\n super(data);\n this.id = data.id;\n this.type = data.type;\n this.organizationId = data.organizationId;\n this.name = data.name;\n if (data.reference !== undefined) this.reference = data.reference;\n if (data.description !== undefined) this.description = data.description;\n this.startsAt = data.startsAt;\n if (data.endsAt !== undefined) this.endsAt = data.endsAt;\n this.customer = data.customer;\n if (data.vendor !== undefined) this.vendor = data.vendor;\n if (data.approval !== undefined) this.approval = data.approval;\n if (data.documents !== undefined) this.documents = data.documents;\n if (data.ticketSchedules !== undefined) this.ticketSchedules = data.ticketSchedules;\n this.status = data.status;\n if (data.cancelledReason !== undefined) this.cancelledReason = data.cancelledReason;\n if (data.createdBy !== undefined) this.createdBy = data.createdBy;\n if (data.createdAt !== undefined) this.createdAt = data.createdAt;\n if (data.updatedAt !== undefined) this.updatedAt = data.updatedAt;\n }\n\n\n\n\n\n\n\n\n}\n\nObject.defineProperty(ServiceContract.prototype, \"schema\", {\n value: serviceContractSchema\n});\n\nObject.defineProperty(ServiceContract.prototype, \"validator\", {\n get: function() { return validate; }\n});\n"],"mappings":";;;;AAeA,IAAa,kBAAb,cAAqC,OAAO;CAI1C,YAAY,MAA6B;EACvC,MAAM,IAAI;EACV,KAAK,KAAK,KAAK;EACf,KAAK,OAAO,KAAK;EACjB,KAAK,iBAAiB,KAAK;EAC3B,KAAK,OAAO,KAAK;EACjB,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,gBAAgB,KAAA,GAAW,KAAK,cAAc,KAAK;EAC5D,KAAK,WAAW,KAAK;EACrB,IAAI,KAAK,WAAW,KAAA,GAAW,KAAK,SAAS,KAAK;EAClD,KAAK,WAAW,KAAK;EACrB,IAAI,KAAK,WAAW,KAAA,GAAW,KAAK,SAAS,KAAK;EAClD,IAAI,KAAK,aAAa,KAAA,GAAW,KAAK,WAAW,KAAK;EACtD,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,oBAAoB,KAAA,GAAW,KAAK,kBAAkB,KAAK;EACpE,KAAK,SAAS,KAAK;EACnB,IAAI,KAAK,oBAAoB,KAAA,GAAW,KAAK,kBAAkB,KAAK;EACpE,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;CAC1D;AASF;AAEA,OAAO,eAAe,gBAAgB,WAAW,UAAU,EACzD,OAAO,sBACT,CAAC;AAED,OAAO,eAAe,gBAAgB,WAAW,aAAa,EAC5D,KAAK,WAAW;CAAE,OAAOA;AAAU,EACrC,CAAC"}
|
package/dist/models/ticket.js
CHANGED
|
@@ -11,6 +11,7 @@ var Ticket = class extends Entity {
|
|
|
11
11
|
if (data.number !== void 0) this.number = data.number;
|
|
12
12
|
if (data.issueId !== void 0) this.issueId = data.issueId;
|
|
13
13
|
if (data.parentAutomationId !== void 0) this.parentAutomationId = data.parentAutomationId;
|
|
14
|
+
if (data.serviceContract !== void 0) this.serviceContract = data.serviceContract;
|
|
14
15
|
this.conversation = data.conversation;
|
|
15
16
|
if (data.subject !== void 0) this.subject = data.subject;
|
|
16
17
|
this.openedBy = data.openedBy;
|
|
@@ -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.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,SAAS,KAAK;EACnB,KAAK,WAAW,KAAK;EACrB,IAAI,KAAK,iBAAiB,KAAA,GAAW,KAAK,eAAe,KAAK;EAC9D,IAAI,KAAK,gBAAgB,KAAA,GAAW,KAAK,cAAc,KAAK;EAC5D,IAAI,KAAK,SAAS,KAAA,GAAW,KAAK,OAAO,KAAK;EAC9C,IAAI,KAAK,UAAU,KAAA,GAAW,KAAK,QAAQ,KAAK;EAChD,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,WAAW,KAAA,GAAW,KAAK,SAAS,KAAK;EAClD,IAAI,KAAK,kBAAkB,KAAA,GAAW,KAAK,gBAAgB,KAAK;EAChE,IAAI,KAAK,qBAAqB,KAAA,GAAW,KAAK,mBAAmB,KAAK;EACtE,KAAK,OAAO,KAAK;EACjB,IAAI,KAAK,WAAW,KAAA,GAAW,KAAK,SAAS,KAAK;EAClD,IAAI,KAAK,kBAAkB,KAAA,GAAW,KAAK,gBAAgB,KAAK;EAChE,IAAI,KAAK,iBAAiB,KAAA,GAAW,KAAK,eAAe,KAAK;EAC9D,KAAK,YAAY,KAAK;EACtB,KAAK,YAAY,KAAK;EACtB,IAAI,KAAK,aAAa,KAAA,GAAW,KAAK,WAAW,KAAK;EACtD,IAAI,KAAK,kBAAkB,KAAA,GAAW,KAAK,gBAAgB,KAAK;EAChE,IAAI,KAAK,aAAa,KAAA,GAAW,KAAK,WAAW,KAAK;EACtD,IAAI,KAAK,cAAc,KAAA,GAAW,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 if (data.serviceContract !== undefined) this.serviceContract = data.serviceContract;\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,IAAI,KAAK,oBAAoB,KAAA,GAAW,KAAK,kBAAkB,KAAK;EACpE,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,SAAS,KAAK;EACnB,KAAK,WAAW,KAAK;EACrB,IAAI,KAAK,iBAAiB,KAAA,GAAW,KAAK,eAAe,KAAK;EAC9D,IAAI,KAAK,gBAAgB,KAAA,GAAW,KAAK,cAAc,KAAK;EAC5D,IAAI,KAAK,SAAS,KAAA,GAAW,KAAK,OAAO,KAAK;EAC9C,IAAI,KAAK,UAAU,KAAA,GAAW,KAAK,QAAQ,KAAK;EAChD,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,WAAW,KAAA,GAAW,KAAK,SAAS,KAAK;EAClD,IAAI,KAAK,kBAAkB,KAAA,GAAW,KAAK,gBAAgB,KAAK;EAChE,IAAI,KAAK,qBAAqB,KAAA,GAAW,KAAK,mBAAmB,KAAK;EACtE,KAAK,OAAO,KAAK;EACjB,IAAI,KAAK,WAAW,KAAA,GAAW,KAAK,SAAS,KAAK;EAClD,IAAI,KAAK,kBAAkB,KAAA,GAAW,KAAK,gBAAgB,KAAK;EAChE,IAAI,KAAK,iBAAiB,KAAA,GAAW,KAAK,eAAe,KAAK;EAC9D,KAAK,YAAY,KAAK;EACtB,KAAK,YAAY,KAAK;EACtB,IAAI,KAAK,aAAa,KAAA,GAAW,KAAK,WAAW,KAAK;EACtD,IAAI,KAAK,kBAAkB,KAAA,GAAW,KAAK,gBAAgB,KAAK;EAChE,IAAI,KAAK,aAAa,KAAA,GAAW,KAAK,WAAW,KAAK;EACtD,IAAI,KAAK,cAAc,KAAA,GAAW,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"}
|
|
@@ -226,6 +226,10 @@ export declare const automationSchema: {
|
|
|
226
226
|
readonly description: "The URL of the webhook that triggers the automation";
|
|
227
227
|
readonly format: "uri";
|
|
228
228
|
};
|
|
229
|
+
readonly serviceContractId: {
|
|
230
|
+
readonly type: "string";
|
|
231
|
+
readonly description: "The Service contract whose Ticket schedule this automation is. Its contract page is the only writer.";
|
|
232
|
+
};
|
|
229
233
|
};
|
|
230
234
|
readonly additionalProperties: false;
|
|
231
235
|
};
|
|
@@ -256,6 +256,10 @@ const automationSchema = {
|
|
|
256
256
|
type: "string",
|
|
257
257
|
description: "The URL of the webhook that triggers the automation",
|
|
258
258
|
format: "uri"
|
|
259
|
+
},
|
|
260
|
+
serviceContractId: {
|
|
261
|
+
type: "string",
|
|
262
|
+
description: "The Service contract whose Ticket schedule this automation is. Its contract page is the only writer."
|
|
259
263
|
}
|
|
260
264
|
},
|
|
261
265
|
additionalProperties: false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"automation.js","names":[],"sources":["../../.generated/schemas/automation.ts"],"sourcesContent":["import type { FromSchema } from \"json-schema-to-ts\";\nimport defs, { ISODateString } from \"./definitions\";\n\nexport const automationSchema = {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"automation.json\",\n title: \"Automation\",\n description: \"An automation is a collection of triggers and actions\",\n type: \"object\",\n required: [\"id\", \"type\", \"trigger\", \"actions\"],\n properties: {\n id: {\n $ref: \"definitions.json#/definitions/id\",\n },\n propertyId: {\n type: \"string\",\n description: \"ID of the property this entity belongs to. Optional — used as a per-document filter inside the org-scoped database.\",\n },\n name: {\n type: \"string\",\n description: \"The friendly name of the automation\",\n },\n type: {\n type: \"string\",\n enum: [\"automation\"],\n default: \"automation\",\n },\n isEnabled: {\n type: \"boolean\",\n description: \"Whether the automation is currently enabled\",\n default: true,\n },\n description: {\n type: \"string\",\n description: \"The text description of the automation\",\n },\n trigger: {\n type: \"object\",\n description: \"The trigger that initiates the automation\",\n required: [\"discriminator\"],\n properties: {\n discriminator: {\n type: \"string\",\n enum: [\"schedule\", \"event\", \"rrule\"],\n description: \"Type of trigger\",\n },\n rrule: {\n type: \"object\",\n additionalProperties: false,\n description: \"RFC 5545 recurrence rule with solar time support\",\n required: [\"expression\", \"timezone\"],\n properties: {\n expression: {\n type: \"string\",\n description:\n \"RFC 5545 RRULE string. Use BYHOUR/BYMINUTE for time when timeMode is omitted. Must not contain BYHOUR/BYMINUTE when timeMode is provided.\",\n },\n timezone: {\n type: \"string\",\n description: \"IANA timezone for rule evaluation\",\n },\n timeMode: {\n type: \"object\",\n additionalProperties: false,\n required: [\"type\"],\n properties: {\n type: {\n type: \"string\",\n enum: [\"fixed\", \"sunrise\", \"sunset\"],\n description:\n \"How to determine execution time on matching days\",\n },\n time: {\n type: \"string\",\n description: \"HH:mm time for fixed mode\",\n },\n offsetSeconds: {\n type: \"integer\",\n description:\n \"Offset in seconds from time or solar event (negative = before)\",\n default: 0,\n },\n },\n },\n location: {\n type: \"object\",\n additionalProperties: false,\n description: \"Required when timeMode is sunrise or sunset\",\n required: [\"lat\", \"lng\"],\n properties: {\n lat: {\n type: \"number\",\n minimum: -90,\n maximum: 90,\n },\n lng: {\n type: \"number\",\n minimum: -180,\n maximum: 180,\n },\n },\n },\n },\n },\n // Time-based trigger properties\n schedule: {\n type: \"object\",\n additionalProperties: false,\n description: \"Schedule for time-based triggers\",\n required: [\"days\", \"time\", \"timezone\"],\n properties: {\n days: {\n type: \"array\",\n description: \"Days of the week (0 = Sunday, 6 = Saturday)\",\n items: {\n type: \"integer\",\n minimum: 0,\n maximum: 6,\n },\n },\n time: {\n type: \"string\",\n description: \"Time of day to trigger the automation\",\n },\n timeOffsetSeconds: {\n type: \"integer\",\n description: \"Offset in seconds from the scheduled time\",\n default: 0,\n },\n repeat: {\n type: \"boolean\",\n description: \"Whether the schedule repeats\",\n default: true,\n },\n timezone: {\n type: \"string\",\n description: \"Timezone for the schedule (IANA timezone format)\",\n },\n },\n },\n event: {\n type: \"object\",\n required: [\"eventType\", \"eventProperties\", \"match\"],\n additionalProperties: false,\n properties: {\n eventType: {\n type: \"string\",\n description:\n \"Name of the event that triggers the automation actions\",\n },\n eventProperties: {\n type: \"array\",\n description:\n \"Properties of the event that triggers the automation actions\",\n items: {\n type: \"object\",\n required: [\"property\", \"value\", \"operator\"],\n additionalProperties: false,\n properties: {\n property: {\n type: \"string\",\n description: \"Property of the event\",\n },\n value: {\n type: [\"string\", \"number\", \"boolean\"],\n description: \"Value of the property\",\n },\n operator: {\n type: \"string\",\n description: \"Operator of the property\",\n enum: [\n \"==\",\n \"!=\",\n \">\",\n \">=\",\n \"<\",\n \"<=\",\n \"contains\",\n \"notContains\",\n ],\n },\n },\n },\n },\n match: {\n type: \"string\",\n description:\n \"Match criteria for the event to trigger the automation actions\",\n enum: [\"any\", \"all\"],\n },\n },\n },\n },\n },\n actions: {\n type: \"array\",\n description: \"Actions to perform when the trigger conditions are met\",\n items: {\n type: \"object\",\n required: [\"useCase\", \"useCaseParams\"],\n additionalProperties: false,\n properties: {\n useCase: {\n type: \"string\",\n description: \"Name of the use case to call\",\n },\n useCaseParams: {\n type: \"object\",\n description: \"Parameters to pass to the use case\",\n required: [\"data\"],\n properties: {\n data: {\n type: [\"object\", \"array\"],\n description: \"Data to pass to the use case\",\n },\n },\n },\n },\n minItems: 1,\n },\n },\n createdAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the automation was created\",\n },\n updatedAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the automation was updated\",\n },\n nextRunAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the automation is scheduled to run next\",\n },\n lastRunAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the automation was last triggered\",\n },\n deletedAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n webhookUrl: {\n type: \"string\",\n description: \"The URL of the webhook that triggers the automation\",\n format: \"uri\",\n },\n },\n additionalProperties: false,\n} as const;\n\nexport type AutomationSchema = FromSchema<\n typeof automationSchema,\n {\n references: [typeof defs];\n deserialize: [\n {\n pattern: {\n format: \"date-time\";\n };\n output: Date | ISODateString;\n },\n ];\n }\n>;\n"],"mappings":";AAGA,MAAa,mBAAmB;CAC9B,SAAS;CACT,KAAK;CACL,OAAO;CACP,aAAa;CACb,MAAM;CACN,UAAU;EAAC;EAAM;EAAQ;EAAW;CAAS;CAC7C,YAAY;EACV,IAAI,EACF,MAAM,mCACR;EACA,YAAY;GACV,MAAM;GACN,aAAa;EACf;EACA,MAAM;GACJ,MAAM;GACN,aAAa;EACf;EACA,MAAM;GACJ,MAAM;GACN,MAAM,CAAC,YAAY;GACnB,SAAS;EACX;EACA,WAAW;GACT,MAAM;GACN,aAAa;GACb,SAAS;EACX;EACA,aAAa;GACX,MAAM;GACN,aAAa;EACf;EACA,SAAS;GACP,MAAM;GACN,aAAa;GACb,UAAU,CAAC,eAAe;GAC1B,YAAY;IACV,eAAe;KACb,MAAM;KACN,MAAM;MAAC;MAAY;MAAS;KAAO;KACnC,aAAa;IACf;IACA,OAAO;KACL,MAAM;KACN,sBAAsB;KACtB,aAAa;KACb,UAAU,CAAC,cAAc,UAAU;KACnC,YAAY;MACV,YAAY;OACV,MAAM;OACN,aACE;MACJ;MACA,UAAU;OACR,MAAM;OACN,aAAa;MACf;MACA,UAAU;OACR,MAAM;OACN,sBAAsB;OACtB,UAAU,CAAC,MAAM;OACjB,YAAY;QACV,MAAM;SACJ,MAAM;SACN,MAAM;UAAC;UAAS;UAAW;SAAQ;SACnC,aACE;QACJ;QACA,MAAM;SACJ,MAAM;SACN,aAAa;QACf;QACA,eAAe;SACb,MAAM;SACN,aACE;SACF,SAAS;QACX;OACF;MACF;MACA,UAAU;OACR,MAAM;OACN,sBAAsB;OACtB,aAAa;OACb,UAAU,CAAC,OAAO,KAAK;OACvB,YAAY;QACV,KAAK;SACH,MAAM;SACN,SAAS;SACT,SAAS;QACX;QACA,KAAK;SACH,MAAM;SACN,SAAS;SACT,SAAS;QACX;OACF;MACF;KACF;IACF;IAEA,UAAU;KACR,MAAM;KACN,sBAAsB;KACtB,aAAa;KACb,UAAU;MAAC;MAAQ;MAAQ;KAAU;KACrC,YAAY;MACV,MAAM;OACJ,MAAM;OACN,aAAa;OACb,OAAO;QACL,MAAM;QACN,SAAS;QACT,SAAS;OACX;MACF;MACA,MAAM;OACJ,MAAM;OACN,aAAa;MACf;MACA,mBAAmB;OACjB,MAAM;OACN,aAAa;OACb,SAAS;MACX;MACA,QAAQ;OACN,MAAM;OACN,aAAa;OACb,SAAS;MACX;MACA,UAAU;OACR,MAAM;OACN,aAAa;MACf;KACF;IACF;IACA,OAAO;KACL,MAAM;KACN,UAAU;MAAC;MAAa;MAAmB;KAAO;KAClD,sBAAsB;KACtB,YAAY;MACV,WAAW;OACT,MAAM;OACN,aACE;MACJ;MACA,iBAAiB;OACf,MAAM;OACN,aACE;OACF,OAAO;QACL,MAAM;QACN,UAAU;SAAC;SAAY;SAAS;QAAU;QAC1C,sBAAsB;QACtB,YAAY;SACV,UAAU;UACR,MAAM;UACN,aAAa;SACf;SACA,OAAO;UACL,MAAM;WAAC;WAAU;WAAU;UAAS;UACpC,aAAa;SACf;SACA,UAAU;UACR,MAAM;UACN,aAAa;UACb,MAAM;WACJ;WACA;WACA;WACA;WACA;WACA;WACA;WACA;UACF;SACF;QACF;OACF;MACF;MACA,OAAO;OACL,MAAM;OACN,aACE;OACF,MAAM,CAAC,OAAO,KAAK;MACrB;KACF;IACF;GACF;EACF;EACA,SAAS;GACP,MAAM;GACN,aAAa;GACb,OAAO;IACL,MAAM;IACN,UAAU,CAAC,WAAW,eAAe;IACrC,sBAAsB;IACtB,YAAY;KACV,SAAS;MACP,MAAM;MACN,aAAa;KACf;KACA,eAAe;MACb,MAAM;MACN,aAAa;MACb,UAAU,CAAC,MAAM;MACjB,YAAY,EACV,MAAM;OACJ,MAAM,CAAC,UAAU,OAAO;OACxB,aAAa;MACf,EACF;KACF;IACF;IACA,UAAU;GACZ;EACF;EACA,WAAW;GACT,MAAM;GACN,aAAa;EACf;EACA,WAAW;GACT,MAAM;GACN,aAAa;EACf;EACA,WAAW;GACT,MAAM;GACN,aAAa;EACf;EACA,WAAW;GACT,MAAM;GACN,aAAa;EACf;EACA,WAAW,EACT,MAAM,qCACR;EACA,YAAY;GACV,MAAM;GACN,aAAa;GACb,QAAQ;EACV;CACF;CACA,sBAAsB;AACxB"}
|
|
1
|
+
{"version":3,"file":"automation.js","names":[],"sources":["../../.generated/schemas/automation.ts"],"sourcesContent":["import type { FromSchema } from \"json-schema-to-ts\";\nimport defs, { ISODateString } from \"./definitions\";\n\nexport const automationSchema = {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"automation.json\",\n title: \"Automation\",\n description: \"An automation is a collection of triggers and actions\",\n type: \"object\",\n required: [\"id\", \"type\", \"trigger\", \"actions\"],\n properties: {\n id: {\n $ref: \"definitions.json#/definitions/id\",\n },\n propertyId: {\n type: \"string\",\n description: \"ID of the property this entity belongs to. Optional — used as a per-document filter inside the org-scoped database.\",\n },\n name: {\n type: \"string\",\n description: \"The friendly name of the automation\",\n },\n type: {\n type: \"string\",\n enum: [\"automation\"],\n default: \"automation\",\n },\n isEnabled: {\n type: \"boolean\",\n description: \"Whether the automation is currently enabled\",\n default: true,\n },\n description: {\n type: \"string\",\n description: \"The text description of the automation\",\n },\n trigger: {\n type: \"object\",\n description: \"The trigger that initiates the automation\",\n required: [\"discriminator\"],\n properties: {\n discriminator: {\n type: \"string\",\n enum: [\"schedule\", \"event\", \"rrule\"],\n description: \"Type of trigger\",\n },\n rrule: {\n type: \"object\",\n additionalProperties: false,\n description: \"RFC 5545 recurrence rule with solar time support\",\n required: [\"expression\", \"timezone\"],\n properties: {\n expression: {\n type: \"string\",\n description:\n \"RFC 5545 RRULE string. Use BYHOUR/BYMINUTE for time when timeMode is omitted. Must not contain BYHOUR/BYMINUTE when timeMode is provided.\",\n },\n timezone: {\n type: \"string\",\n description: \"IANA timezone for rule evaluation\",\n },\n timeMode: {\n type: \"object\",\n additionalProperties: false,\n required: [\"type\"],\n properties: {\n type: {\n type: \"string\",\n enum: [\"fixed\", \"sunrise\", \"sunset\"],\n description:\n \"How to determine execution time on matching days\",\n },\n time: {\n type: \"string\",\n description: \"HH:mm time for fixed mode\",\n },\n offsetSeconds: {\n type: \"integer\",\n description:\n \"Offset in seconds from time or solar event (negative = before)\",\n default: 0,\n },\n },\n },\n location: {\n type: \"object\",\n additionalProperties: false,\n description: \"Required when timeMode is sunrise or sunset\",\n required: [\"lat\", \"lng\"],\n properties: {\n lat: {\n type: \"number\",\n minimum: -90,\n maximum: 90,\n },\n lng: {\n type: \"number\",\n minimum: -180,\n maximum: 180,\n },\n },\n },\n },\n },\n // Time-based trigger properties\n schedule: {\n type: \"object\",\n additionalProperties: false,\n description: \"Schedule for time-based triggers\",\n required: [\"days\", \"time\", \"timezone\"],\n properties: {\n days: {\n type: \"array\",\n description: \"Days of the week (0 = Sunday, 6 = Saturday)\",\n items: {\n type: \"integer\",\n minimum: 0,\n maximum: 6,\n },\n },\n time: {\n type: \"string\",\n description: \"Time of day to trigger the automation\",\n },\n timeOffsetSeconds: {\n type: \"integer\",\n description: \"Offset in seconds from the scheduled time\",\n default: 0,\n },\n repeat: {\n type: \"boolean\",\n description: \"Whether the schedule repeats\",\n default: true,\n },\n timezone: {\n type: \"string\",\n description: \"Timezone for the schedule (IANA timezone format)\",\n },\n },\n },\n event: {\n type: \"object\",\n required: [\"eventType\", \"eventProperties\", \"match\"],\n additionalProperties: false,\n properties: {\n eventType: {\n type: \"string\",\n description:\n \"Name of the event that triggers the automation actions\",\n },\n eventProperties: {\n type: \"array\",\n description:\n \"Properties of the event that triggers the automation actions\",\n items: {\n type: \"object\",\n required: [\"property\", \"value\", \"operator\"],\n additionalProperties: false,\n properties: {\n property: {\n type: \"string\",\n description: \"Property of the event\",\n },\n value: {\n type: [\"string\", \"number\", \"boolean\"],\n description: \"Value of the property\",\n },\n operator: {\n type: \"string\",\n description: \"Operator of the property\",\n enum: [\n \"==\",\n \"!=\",\n \">\",\n \">=\",\n \"<\",\n \"<=\",\n \"contains\",\n \"notContains\",\n ],\n },\n },\n },\n },\n match: {\n type: \"string\",\n description:\n \"Match criteria for the event to trigger the automation actions\",\n enum: [\"any\", \"all\"],\n },\n },\n },\n },\n },\n actions: {\n type: \"array\",\n description: \"Actions to perform when the trigger conditions are met\",\n items: {\n type: \"object\",\n required: [\"useCase\", \"useCaseParams\"],\n additionalProperties: false,\n properties: {\n useCase: {\n type: \"string\",\n description: \"Name of the use case to call\",\n },\n useCaseParams: {\n type: \"object\",\n description: \"Parameters to pass to the use case\",\n required: [\"data\"],\n properties: {\n data: {\n type: [\"object\", \"array\"],\n description: \"Data to pass to the use case\",\n },\n },\n },\n },\n minItems: 1,\n },\n },\n createdAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the automation was created\",\n },\n updatedAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the automation was updated\",\n },\n nextRunAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the automation is scheduled to run next\",\n },\n lastRunAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the automation was last triggered\",\n },\n deletedAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n webhookUrl: {\n type: \"string\",\n description: \"The URL of the webhook that triggers the automation\",\n format: \"uri\",\n },\n serviceContractId: {\n type: \"string\",\n description:\n \"The Service contract whose Ticket schedule this automation is. Its contract page is the only writer.\",\n },\n },\n additionalProperties: false,\n} as const;\n\nexport type AutomationSchema = FromSchema<\n typeof automationSchema,\n {\n references: [typeof defs];\n deserialize: [\n {\n pattern: {\n format: \"date-time\";\n };\n output: Date | ISODateString;\n },\n ];\n }\n>;\n"],"mappings":";AAGA,MAAa,mBAAmB;CAC9B,SAAS;CACT,KAAK;CACL,OAAO;CACP,aAAa;CACb,MAAM;CACN,UAAU;EAAC;EAAM;EAAQ;EAAW;CAAS;CAC7C,YAAY;EACV,IAAI,EACF,MAAM,mCACR;EACA,YAAY;GACV,MAAM;GACN,aAAa;EACf;EACA,MAAM;GACJ,MAAM;GACN,aAAa;EACf;EACA,MAAM;GACJ,MAAM;GACN,MAAM,CAAC,YAAY;GACnB,SAAS;EACX;EACA,WAAW;GACT,MAAM;GACN,aAAa;GACb,SAAS;EACX;EACA,aAAa;GACX,MAAM;GACN,aAAa;EACf;EACA,SAAS;GACP,MAAM;GACN,aAAa;GACb,UAAU,CAAC,eAAe;GAC1B,YAAY;IACV,eAAe;KACb,MAAM;KACN,MAAM;MAAC;MAAY;MAAS;KAAO;KACnC,aAAa;IACf;IACA,OAAO;KACL,MAAM;KACN,sBAAsB;KACtB,aAAa;KACb,UAAU,CAAC,cAAc,UAAU;KACnC,YAAY;MACV,YAAY;OACV,MAAM;OACN,aACE;MACJ;MACA,UAAU;OACR,MAAM;OACN,aAAa;MACf;MACA,UAAU;OACR,MAAM;OACN,sBAAsB;OACtB,UAAU,CAAC,MAAM;OACjB,YAAY;QACV,MAAM;SACJ,MAAM;SACN,MAAM;UAAC;UAAS;UAAW;SAAQ;SACnC,aACE;QACJ;QACA,MAAM;SACJ,MAAM;SACN,aAAa;QACf;QACA,eAAe;SACb,MAAM;SACN,aACE;SACF,SAAS;QACX;OACF;MACF;MACA,UAAU;OACR,MAAM;OACN,sBAAsB;OACtB,aAAa;OACb,UAAU,CAAC,OAAO,KAAK;OACvB,YAAY;QACV,KAAK;SACH,MAAM;SACN,SAAS;SACT,SAAS;QACX;QACA,KAAK;SACH,MAAM;SACN,SAAS;SACT,SAAS;QACX;OACF;MACF;KACF;IACF;IAEA,UAAU;KACR,MAAM;KACN,sBAAsB;KACtB,aAAa;KACb,UAAU;MAAC;MAAQ;MAAQ;KAAU;KACrC,YAAY;MACV,MAAM;OACJ,MAAM;OACN,aAAa;OACb,OAAO;QACL,MAAM;QACN,SAAS;QACT,SAAS;OACX;MACF;MACA,MAAM;OACJ,MAAM;OACN,aAAa;MACf;MACA,mBAAmB;OACjB,MAAM;OACN,aAAa;OACb,SAAS;MACX;MACA,QAAQ;OACN,MAAM;OACN,aAAa;OACb,SAAS;MACX;MACA,UAAU;OACR,MAAM;OACN,aAAa;MACf;KACF;IACF;IACA,OAAO;KACL,MAAM;KACN,UAAU;MAAC;MAAa;MAAmB;KAAO;KAClD,sBAAsB;KACtB,YAAY;MACV,WAAW;OACT,MAAM;OACN,aACE;MACJ;MACA,iBAAiB;OACf,MAAM;OACN,aACE;OACF,OAAO;QACL,MAAM;QACN,UAAU;SAAC;SAAY;SAAS;QAAU;QAC1C,sBAAsB;QACtB,YAAY;SACV,UAAU;UACR,MAAM;UACN,aAAa;SACf;SACA,OAAO;UACL,MAAM;WAAC;WAAU;WAAU;UAAS;UACpC,aAAa;SACf;SACA,UAAU;UACR,MAAM;UACN,aAAa;UACb,MAAM;WACJ;WACA;WACA;WACA;WACA;WACA;WACA;WACA;UACF;SACF;QACF;OACF;MACF;MACA,OAAO;OACL,MAAM;OACN,aACE;OACF,MAAM,CAAC,OAAO,KAAK;MACrB;KACF;IACF;GACF;EACF;EACA,SAAS;GACP,MAAM;GACN,aAAa;GACb,OAAO;IACL,MAAM;IACN,UAAU,CAAC,WAAW,eAAe;IACrC,sBAAsB;IACtB,YAAY;KACV,SAAS;MACP,MAAM;MACN,aAAa;KACf;KACA,eAAe;MACb,MAAM;MACN,aAAa;MACb,UAAU,CAAC,MAAM;MACjB,YAAY,EACV,MAAM;OACJ,MAAM,CAAC,UAAU,OAAO;OACxB,aAAa;MACf,EACF;KACF;IACF;IACA,UAAU;GACZ;EACF;EACA,WAAW;GACT,MAAM;GACN,aAAa;EACf;EACA,WAAW;GACT,MAAM;GACN,aAAa;EACf;EACA,WAAW;GACT,MAAM;GACN,aAAa;EACf;EACA,WAAW;GACT,MAAM;GACN,aAAa;EACf;EACA,WAAW,EACT,MAAM,qCACR;EACA,YAAY;GACV,MAAM;GACN,aAAa;GACb,QAAQ;EACV;EACA,mBAAmB;GACjB,MAAM;GACN,aACE;EACJ;CACF;CACA,sBAAsB;AACxB"}
|
package/dist/schemas/bill.d.ts
CHANGED
|
@@ -106,7 +106,7 @@ export declare const billSchema: {
|
|
|
106
106
|
};
|
|
107
107
|
readonly source: {
|
|
108
108
|
readonly type: "string";
|
|
109
|
-
readonly enum: readonly ["ticket", "adhoc"];
|
|
109
|
+
readonly enum: readonly ["ticket", "adhoc", "contract"];
|
|
110
110
|
readonly default: "ticket";
|
|
111
111
|
readonly description: string;
|
|
112
112
|
};
|
|
@@ -130,6 +130,16 @@ export declare const billSchema: {
|
|
|
130
130
|
readonly default: null;
|
|
131
131
|
readonly description: string;
|
|
132
132
|
};
|
|
133
|
+
readonly serviceContractId: {
|
|
134
|
+
readonly type: readonly ["string", "null"];
|
|
135
|
+
readonly default: null;
|
|
136
|
+
readonly description: string;
|
|
137
|
+
};
|
|
138
|
+
readonly serviceContractName: {
|
|
139
|
+
readonly type: readonly ["string", "null"];
|
|
140
|
+
readonly default: null;
|
|
141
|
+
readonly description: string;
|
|
142
|
+
};
|
|
133
143
|
readonly categoryId: {
|
|
134
144
|
readonly type: readonly ["string", "null"];
|
|
135
145
|
readonly default: null;
|
package/dist/schemas/bill.js
CHANGED
|
@@ -107,9 +107,13 @@ const billSchema = {
|
|
|
107
107
|
},
|
|
108
108
|
source: {
|
|
109
109
|
type: "string",
|
|
110
|
-
enum: [
|
|
110
|
+
enum: [
|
|
111
|
+
"ticket",
|
|
112
|
+
"adhoc",
|
|
113
|
+
"contract"
|
|
114
|
+
],
|
|
111
115
|
default: "ticket",
|
|
112
|
-
description: "Where the claimed cost entry lives, and therefore how `costId` resolves: on a ticket, or in the costs collection."
|
|
116
|
+
description: "Where the claimed cost entry lives, and therefore how `costId` resolves: on a ticket, or in the costs collection. `contract` is a costs-collection entry a Service contract minted; it bills by the same rules as `adhoc`."
|
|
113
117
|
},
|
|
114
118
|
ticketId: {
|
|
115
119
|
type: ["string", "null"],
|
|
@@ -129,7 +133,17 @@ const billSchema = {
|
|
|
129
133
|
ticketNumber: {
|
|
130
134
|
type: ["string", "null"],
|
|
131
135
|
default: null,
|
|
132
|
-
description: "The source ticket's number, snapshotted at mark-sent. Null on
|
|
136
|
+
description: "The source ticket's number, snapshotted at mark-sent. Null on a ticket-less line. Internal, redacted org-side."
|
|
137
|
+
},
|
|
138
|
+
serviceContractId: {
|
|
139
|
+
type: ["string", "null"],
|
|
140
|
+
default: null,
|
|
141
|
+
description: "The Service contract that minted the claimed entry. Null on every other line. Customer-facing: the org bill links the line to the contract it recurs under."
|
|
142
|
+
},
|
|
143
|
+
serviceContractName: {
|
|
144
|
+
type: ["string", "null"],
|
|
145
|
+
default: null,
|
|
146
|
+
description: "The contract's name, snapshotted at mark-sent so a sent bill reads the same after the contract is renamed. Null while drafting, when it live-reads from the contract."
|
|
133
147
|
},
|
|
134
148
|
categoryId: {
|
|
135
149
|
type: ["string", "null"],
|