@kohost/api-client 6.4.1 → 7.0.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/httpClient.d.ts +8 -12
- package/dist/index-BnWbLEt_.d.ts +22 -0
- package/dist/{index-CwkLEwUB.d.ts → index-DJzBywIl.d.ts} +13 -21
- package/dist/index.d.ts +11 -11
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/deviceNotifications.d.ts +19 -0
- package/dist/lib/deviceNotifications.js +35 -0
- package/dist/lib/deviceNotifications.js.map +1 -0
- package/dist/lib/index.d.ts +3 -0
- package/dist/lib/index.js +23 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/policy-resolvers.d.ts +12 -0
- package/dist/lib/policy-resolvers.js +75 -0
- package/dist/lib/policy-resolvers.js.map +1 -0
- package/dist/lib/systemCategories.d.ts +10 -0
- package/dist/lib/systemCategories.js +61 -0
- package/dist/lib/systemCategories.js.map +1 -0
- package/dist/models/alarm.js +1 -0
- package/dist/models/alarm.js.map +1 -1
- package/dist/models/announcement.js +1 -0
- package/dist/models/announcement.js.map +1 -1
- package/dist/models/automation.js +1 -0
- package/dist/models/automation.js.map +1 -1
- package/dist/models/camera.js +1 -0
- package/dist/models/camera.js.map +1 -1
- package/dist/models/category.js +1 -0
- package/dist/models/category.js.map +1 -1
- package/dist/models/courtesy.js +1 -0
- package/dist/models/courtesy.js.map +1 -1
- package/dist/models/credential.js +1 -0
- package/dist/models/credential.js.map +1 -1
- package/dist/models/dimmer.js +1 -0
- package/dist/models/dimmer.js.map +1 -1
- package/dist/models/emailMessage.js +1 -0
- package/dist/models/emailMessage.js.map +1 -1
- package/dist/models/energyReport.js +1 -0
- package/dist/models/energyReport.js.map +1 -1
- package/dist/models/gateway.js +1 -0
- package/dist/models/gateway.js.map +1 -1
- package/dist/models/issue.d.ts +1 -1
- package/dist/models/issue.js +2 -7
- package/dist/models/issue.js.map +1 -1
- package/dist/models/lock.js +1 -0
- package/dist/models/lock.js.map +1 -1
- package/dist/models/log.js +1 -0
- package/dist/models/log.js.map +1 -1
- package/dist/models/mediaFile.js +1 -0
- package/dist/models/mediaFile.js.map +1 -1
- package/dist/models/mediaSource.js +1 -0
- package/dist/models/mediaSource.js.map +1 -1
- package/dist/models/motionSensor.js +1 -0
- package/dist/models/motionSensor.js.map +1 -1
- package/dist/models/notification.js +1 -0
- package/dist/models/notification.js.map +1 -1
- package/dist/models/order.js +1 -0
- package/dist/models/order.js.map +1 -1
- package/dist/models/organization.js +1 -2
- package/dist/models/organization.js.map +1 -1
- package/dist/models/payment.js +1 -0
- package/dist/models/payment.js.map +1 -1
- package/dist/models/policy.js +1 -0
- package/dist/models/policy.js.map +1 -1
- package/dist/models/product.js +1 -0
- package/dist/models/product.js.map +1 -1
- package/dist/models/property.js +1 -1
- package/dist/models/property.js.map +1 -1
- package/dist/models/reservation.js +1 -0
- package/dist/models/reservation.js.map +1 -1
- package/dist/models/shortLink.js +1 -0
- package/dist/models/shortLink.js.map +1 -1
- package/dist/models/smsMessage.js +1 -0
- package/dist/models/smsMessage.js.map +1 -1
- package/dist/models/space.js +1 -0
- package/dist/models/space.js.map +1 -1
- package/dist/models/switch.js +1 -0
- package/dist/models/switch.js.map +1 -1
- package/dist/models/thermostat.js +1 -0
- package/dist/models/thermostat.js.map +1 -1
- package/dist/models/ticket.js +1 -0
- package/dist/models/ticket.js.map +1 -1
- package/dist/models/timeSheet.js +1 -0
- package/dist/models/timeSheet.js.map +1 -1
- package/dist/models/user.js +0 -1
- package/dist/models/user.js.map +1 -1
- package/dist/models/vendor.js +2 -0
- package/dist/models/vendor.js.map +1 -1
- package/dist/models/windowCovering.js +1 -0
- package/dist/models/windowCovering.js.map +1 -1
- package/dist/schemas/alarm.d.ts +4 -0
- package/dist/schemas/alarm.js +4 -0
- package/dist/schemas/alarm.js.map +1 -1
- package/dist/schemas/announcement.d.ts +4 -0
- package/dist/schemas/announcement.js +4 -0
- package/dist/schemas/announcement.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/camera.d.ts +4 -0
- package/dist/schemas/camera.js +4 -0
- package/dist/schemas/camera.js.map +1 -1
- package/dist/schemas/category.d.ts +4 -0
- package/dist/schemas/category.js +4 -0
- package/dist/schemas/category.js.map +1 -1
- package/dist/schemas/courtesy.d.ts +4 -0
- package/dist/schemas/courtesy.js +4 -0
- package/dist/schemas/courtesy.js.map +1 -1
- package/dist/schemas/credential.d.ts +4 -1
- package/dist/schemas/credential.js +5 -1
- package/dist/schemas/credential.js.map +1 -1
- package/dist/schemas/definitions.d.ts +2 -2
- package/dist/schemas/definitions.js +8 -2
- package/dist/schemas/definitions.js.map +1 -1
- package/dist/schemas/dimmer.d.ts +4 -0
- package/dist/schemas/dimmer.js +4 -0
- package/dist/schemas/dimmer.js.map +1 -1
- package/dist/schemas/emailMessage.d.ts +4 -0
- package/dist/schemas/emailMessage.js +4 -0
- package/dist/schemas/emailMessage.js.map +1 -1
- package/dist/schemas/energyReport.d.ts +4 -0
- package/dist/schemas/energyReport.js +4 -0
- package/dist/schemas/energyReport.js.map +1 -1
- package/dist/schemas/gateway.d.ts +4 -0
- package/dist/schemas/gateway.js +4 -0
- package/dist/schemas/gateway.js.map +1 -1
- package/dist/schemas/issue.d.ts +126 -43
- package/dist/schemas/issue.js +88 -44
- package/dist/schemas/issue.js.map +1 -1
- package/dist/schemas/lock.d.ts +4 -0
- package/dist/schemas/lock.js +4 -0
- package/dist/schemas/lock.js.map +1 -1
- package/dist/schemas/log.d.ts +4 -0
- package/dist/schemas/log.js +4 -0
- package/dist/schemas/log.js.map +1 -1
- package/dist/schemas/mediaFile.d.ts +4 -0
- package/dist/schemas/mediaFile.js +4 -0
- package/dist/schemas/mediaFile.js.map +1 -1
- package/dist/schemas/mediaSource.d.ts +4 -0
- package/dist/schemas/mediaSource.js +4 -0
- package/dist/schemas/mediaSource.js.map +1 -1
- package/dist/schemas/motionSensor.d.ts +4 -0
- package/dist/schemas/motionSensor.js +4 -0
- package/dist/schemas/motionSensor.js.map +1 -1
- package/dist/schemas/notification.d.ts +4 -0
- package/dist/schemas/notification.js +4 -0
- package/dist/schemas/notification.js.map +1 -1
- package/dist/schemas/order.d.ts +4 -0
- package/dist/schemas/order.js +4 -0
- package/dist/schemas/order.js.map +1 -1
- package/dist/schemas/organization.d.ts +45 -13
- package/dist/schemas/organization.js +46 -10
- package/dist/schemas/organization.js.map +1 -1
- package/dist/schemas/payment.d.ts +4 -0
- package/dist/schemas/payment.js +4 -0
- package/dist/schemas/payment.js.map +1 -1
- package/dist/schemas/policy.d.ts +4 -0
- package/dist/schemas/policy.js +4 -0
- package/dist/schemas/policy.js.map +1 -1
- package/dist/schemas/product.d.ts +4 -0
- package/dist/schemas/product.js +4 -0
- package/dist/schemas/product.js.map +1 -1
- package/dist/schemas/property.d.ts +13 -11
- package/dist/schemas/property.js +13 -11
- package/dist/schemas/property.js.map +1 -1
- package/dist/schemas/reservation.d.ts +4 -0
- package/dist/schemas/reservation.js +4 -0
- package/dist/schemas/reservation.js.map +1 -1
- package/dist/schemas/shortLink.d.ts +4 -0
- package/dist/schemas/shortLink.js +4 -0
- package/dist/schemas/shortLink.js.map +1 -1
- package/dist/schemas/smsMessage.d.ts +4 -0
- package/dist/schemas/smsMessage.js +4 -0
- package/dist/schemas/smsMessage.js.map +1 -1
- package/dist/schemas/space.d.ts +4 -0
- package/dist/schemas/space.js +4 -0
- package/dist/schemas/space.js.map +1 -1
- package/dist/schemas/switch.d.ts +14 -0
- package/dist/schemas/switch.js +24 -10
- package/dist/schemas/switch.js.map +1 -1
- package/dist/schemas/thermostat.d.ts +4 -0
- package/dist/schemas/thermostat.js +4 -0
- package/dist/schemas/thermostat.js.map +1 -1
- package/dist/schemas/ticket.d.ts +4 -0
- package/dist/schemas/ticket.js +4 -0
- package/dist/schemas/ticket.js.map +1 -1
- package/dist/schemas/timeSheet.d.ts +4 -0
- package/dist/schemas/timeSheet.js +4 -0
- package/dist/schemas/timeSheet.js.map +1 -1
- package/dist/schemas/user.d.ts +0 -3
- package/dist/schemas/user.js +0 -3
- package/dist/schemas/user.js.map +1 -1
- package/dist/schemas/vendor.d.ts +12 -0
- package/dist/schemas/vendor.js +12 -0
- package/dist/schemas/vendor.js.map +1 -1
- package/dist/schemas/windowCovering.d.ts +4 -0
- package/dist/schemas/windowCovering.js +4 -0
- package/dist/schemas/windowCovering.js.map +1 -1
- package/dist/useCases/createApiKey.d.ts +38 -0
- package/dist/useCases/{sendSMS.js → createApiKey.js} +9 -9
- package/dist/useCases/createApiKey.js.map +1 -0
- package/dist/useCases/{describeIntegration.d.ts → getApiKey.d.ts} +10 -10
- package/dist/useCases/{listAnnouncements.js → getApiKey.js} +9 -9
- package/dist/useCases/getApiKey.js.map +1 -0
- package/dist/useCases/index.d.ts +6 -10
- package/dist/useCases/index.js +12 -20
- package/dist/useCases/index.js.map +1 -1
- package/dist/useCases/{deleteAnnouncement.d.ts → revokeApiKey.d.ts} +10 -10
- package/dist/useCases/{deleteAnnouncement.js → revokeApiKey.js} +9 -9
- package/dist/useCases/revokeApiKey.js.map +1 -0
- package/dist/useCases/{updateAnnouncement.d.ts → rotateApiKey.d.ts} +10 -10
- package/dist/useCases/{updateIntegration.js → rotateApiKey.js} +9 -9
- package/dist/useCases/rotateApiKey.js.map +1 -0
- package/dist/useCases/{updateIntegration.d.ts → updateOrganizationFeatures.d.ts} +6 -6
- package/dist/useCases/{updateAnnouncement.js → updateOrganizationFeatures.js} +8 -8
- package/dist/useCases/updateOrganizationFeatures.js.map +1 -0
- package/dist/useCases/{updatePropertySettings.d.ts → updatePropertyFeatures.d.ts} +6 -6
- package/dist/useCases/{updatePropertySettings.js → updatePropertyFeatures.js} +8 -8
- package/dist/useCases/{updatePropertySettings.js.map → updatePropertyFeatures.js.map} +1 -1
- package/dist/validate.d.ts +6 -6
- package/package.json +26 -18
- package/dist/useCases/createAnnouncement.d.ts +0 -29
- package/dist/useCases/createAnnouncement.js +0 -50
- package/dist/useCases/createAnnouncement.js.map +0 -1
- package/dist/useCases/createIntegration.d.ts +0 -29
- package/dist/useCases/createIntegration.js +0 -50
- package/dist/useCases/createIntegration.js.map +0 -1
- package/dist/useCases/deleteAnnouncement.js.map +0 -1
- package/dist/useCases/describeAnnouncement.d.ts +0 -38
- package/dist/useCases/describeAnnouncement.js +0 -50
- package/dist/useCases/describeAnnouncement.js.map +0 -1
- package/dist/useCases/describeIntegration.js +0 -50
- package/dist/useCases/describeIntegration.js.map +0 -1
- package/dist/useCases/listAnnouncements.d.ts +0 -29
- package/dist/useCases/listAnnouncements.js.map +0 -1
- package/dist/useCases/sendSMS.d.ts +0 -29
- package/dist/useCases/sendSMS.js.map +0 -1
- package/dist/useCases/updateAnnouncement.js.map +0 -1
- package/dist/useCases/updateIntegration.js.map +0 -1
package/dist/schemas/issue.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import defs, { ISODateString } from './definitions.js';
|
|
2
1
|
import { FromSchema } from 'json-schema-to-ts';
|
|
2
|
+
import defs, { ISODateString } from './definitions.js';
|
|
3
3
|
import { ticketSchema } from './ticket.js';
|
|
4
4
|
import './mediaFile.js';
|
|
5
5
|
|
|
@@ -28,67 +28,150 @@ declare const issueSchema: {
|
|
|
28
28
|
};
|
|
29
29
|
readonly departmentId: {
|
|
30
30
|
readonly type: "string";
|
|
31
|
-
readonly description: "The ID of the department that this issue is associated with.";
|
|
31
|
+
readonly description: "The ID of the department that this issue is associated with. Departments are org-level entities, so this is one value per issue (no per-property override).";
|
|
32
32
|
};
|
|
33
|
-
readonly
|
|
33
|
+
readonly system: {
|
|
34
34
|
readonly type: "object";
|
|
35
|
+
readonly description: "Present if this is a System Issue (driven by a device notification). Absence means User Issue.";
|
|
35
36
|
readonly additionalProperties: false;
|
|
37
|
+
readonly required: readonly ["category", "notification"];
|
|
36
38
|
readonly properties: {
|
|
37
|
-
readonly
|
|
39
|
+
readonly category: {
|
|
38
40
|
readonly type: "string";
|
|
39
|
-
readonly
|
|
41
|
+
readonly enum: readonly ["hvac", "access-control", "lighting", "shades", "irrigation", "cameras", "alarms", "pa", "media"];
|
|
42
|
+
readonly description: "Canonical System Category slug. Derived from (device.type, device.discriminator) at notification time.";
|
|
40
43
|
};
|
|
41
|
-
readonly
|
|
42
|
-
readonly
|
|
43
|
-
readonly description: "The
|
|
44
|
+
readonly notification: {
|
|
45
|
+
readonly $ref: "definitions.json#/definitions/supportedNotifications/items";
|
|
46
|
+
readonly description: "The device notification name this issue corresponds to.";
|
|
44
47
|
};
|
|
45
|
-
readonly
|
|
46
|
-
readonly $ref: "ticket.json#/properties/priority";
|
|
47
|
-
readonly description: "The priority to assign tickets with this issue to.";
|
|
48
|
-
};
|
|
49
|
-
readonly tags: {
|
|
48
|
+
readonly excludedEntities: {
|
|
50
49
|
readonly type: "array";
|
|
50
|
+
readonly description: "Device IDs muted for this issue. Devices in this list never trigger ticket creation.";
|
|
51
51
|
readonly items: {
|
|
52
52
|
readonly type: "string";
|
|
53
53
|
};
|
|
54
|
+
readonly default: readonly [];
|
|
54
55
|
};
|
|
55
56
|
};
|
|
56
57
|
};
|
|
57
|
-
readonly
|
|
58
|
-
readonly type: "
|
|
59
|
-
readonly
|
|
60
|
-
readonly
|
|
61
|
-
readonly
|
|
62
|
-
readonly
|
|
63
|
-
readonly
|
|
64
|
-
|
|
58
|
+
readonly routing: {
|
|
59
|
+
readonly type: "object";
|
|
60
|
+
readonly additionalProperties: false;
|
|
61
|
+
readonly description: "Per-property routing overrides on top of a single org-level default. null at any level means suppressed.";
|
|
62
|
+
readonly default: {
|
|
63
|
+
readonly default: {};
|
|
64
|
+
readonly properties: {};
|
|
65
|
+
};
|
|
66
|
+
readonly properties: {
|
|
67
|
+
readonly default: {
|
|
68
|
+
readonly description: "Org-level default routing applied to every property unless overridden. null means suppressed org-wide.";
|
|
69
|
+
readonly oneOf: readonly [{
|
|
70
|
+
readonly type: "object";
|
|
71
|
+
readonly additionalProperties: false;
|
|
72
|
+
readonly properties: {
|
|
73
|
+
readonly assignedTo: {
|
|
74
|
+
readonly type: readonly ["object", "null"];
|
|
75
|
+
readonly additionalProperties: false;
|
|
76
|
+
readonly required: readonly ["id", "discriminator"];
|
|
77
|
+
readonly properties: {
|
|
78
|
+
readonly id: {
|
|
79
|
+
readonly type: "string";
|
|
80
|
+
};
|
|
81
|
+
readonly discriminator: {
|
|
82
|
+
readonly type: "string";
|
|
83
|
+
readonly enum: readonly ["user", "vendor"];
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
readonly priority: {
|
|
88
|
+
readonly $ref: "ticket.json#/properties/priority";
|
|
89
|
+
};
|
|
90
|
+
readonly tags: {
|
|
91
|
+
readonly type: "array";
|
|
92
|
+
readonly items: {
|
|
93
|
+
readonly type: "string";
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
readonly notify: {
|
|
97
|
+
readonly type: "array";
|
|
98
|
+
readonly items: {
|
|
99
|
+
readonly type: "object";
|
|
100
|
+
readonly required: readonly ["id", "discriminator"];
|
|
101
|
+
readonly additionalProperties: false;
|
|
102
|
+
readonly properties: {
|
|
103
|
+
readonly id: {
|
|
104
|
+
readonly type: "string";
|
|
105
|
+
};
|
|
106
|
+
readonly discriminator: {
|
|
107
|
+
readonly type: "string";
|
|
108
|
+
readonly enum: readonly ["user"];
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
}, {
|
|
115
|
+
readonly type: "null";
|
|
116
|
+
}];
|
|
117
|
+
};
|
|
65
118
|
readonly properties: {
|
|
66
|
-
readonly
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
119
|
+
readonly type: "object";
|
|
120
|
+
readonly description: "Sparse per-property overrides keyed by propertyId. Fields omitted from an entry fall back to the org-level default. null entry means suppressed at that property.";
|
|
121
|
+
readonly additionalProperties: {
|
|
122
|
+
readonly oneOf: readonly [{
|
|
123
|
+
readonly type: "object";
|
|
124
|
+
readonly additionalProperties: false;
|
|
125
|
+
readonly properties: {
|
|
126
|
+
readonly assignedTo: {
|
|
127
|
+
readonly type: readonly ["object", "null"];
|
|
128
|
+
readonly additionalProperties: false;
|
|
129
|
+
readonly required: readonly ["id", "discriminator"];
|
|
130
|
+
readonly properties: {
|
|
131
|
+
readonly id: {
|
|
132
|
+
readonly type: "string";
|
|
133
|
+
};
|
|
134
|
+
readonly discriminator: {
|
|
135
|
+
readonly type: "string";
|
|
136
|
+
readonly enum: readonly ["user", "vendor"];
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
readonly priority: {
|
|
141
|
+
readonly $ref: "ticket.json#/properties/priority";
|
|
142
|
+
};
|
|
143
|
+
readonly tags: {
|
|
144
|
+
readonly type: "array";
|
|
145
|
+
readonly items: {
|
|
146
|
+
readonly type: "string";
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
readonly notify: {
|
|
150
|
+
readonly type: "array";
|
|
151
|
+
readonly items: {
|
|
152
|
+
readonly type: "object";
|
|
153
|
+
readonly required: readonly ["id", "discriminator"];
|
|
154
|
+
readonly additionalProperties: false;
|
|
155
|
+
readonly properties: {
|
|
156
|
+
readonly id: {
|
|
157
|
+
readonly type: "string";
|
|
158
|
+
};
|
|
159
|
+
readonly discriminator: {
|
|
160
|
+
readonly type: "string";
|
|
161
|
+
readonly enum: readonly ["user"];
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
}, {
|
|
168
|
+
readonly type: "null";
|
|
169
|
+
}];
|
|
73
170
|
};
|
|
171
|
+
readonly default: {};
|
|
74
172
|
};
|
|
75
173
|
};
|
|
76
174
|
};
|
|
77
|
-
readonly systemKey: {
|
|
78
|
-
readonly type: "string";
|
|
79
|
-
};
|
|
80
|
-
readonly autoCreateTicket: {
|
|
81
|
-
readonly type: "boolean";
|
|
82
|
-
readonly default: true;
|
|
83
|
-
};
|
|
84
|
-
readonly excludedResources: {
|
|
85
|
-
readonly type: "array";
|
|
86
|
-
readonly description: "A list of resources that should not trigger notifications of this issue";
|
|
87
|
-
readonly items: {
|
|
88
|
-
readonly type: "string";
|
|
89
|
-
};
|
|
90
|
-
readonly default: readonly [];
|
|
91
|
-
};
|
|
92
175
|
readonly createdAt: {
|
|
93
176
|
readonly $ref: "definitions.json#/definitions/date";
|
|
94
177
|
};
|
package/dist/schemas/issue.js
CHANGED
|
@@ -1,3 +1,63 @@
|
|
|
1
|
+
const SYSTEM_CATEGORIES = [
|
|
2
|
+
"hvac",
|
|
3
|
+
"access-control",
|
|
4
|
+
"lighting",
|
|
5
|
+
"shades",
|
|
6
|
+
"irrigation",
|
|
7
|
+
"cameras",
|
|
8
|
+
"alarms",
|
|
9
|
+
"pa",
|
|
10
|
+
"media"
|
|
11
|
+
];
|
|
12
|
+
const routingOverrideSchema = {
|
|
13
|
+
type: "object",
|
|
14
|
+
additionalProperties: false,
|
|
15
|
+
properties: {
|
|
16
|
+
assignedTo: {
|
|
17
|
+
type: ["object", "null"],
|
|
18
|
+
additionalProperties: false,
|
|
19
|
+
required: ["id", "discriminator"],
|
|
20
|
+
properties: {
|
|
21
|
+
id: {
|
|
22
|
+
type: "string"
|
|
23
|
+
},
|
|
24
|
+
discriminator: {
|
|
25
|
+
type: "string",
|
|
26
|
+
enum: ["user", "vendor"]
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
priority: {
|
|
31
|
+
$ref: "ticket.json#/properties/priority"
|
|
32
|
+
},
|
|
33
|
+
tags: {
|
|
34
|
+
type: "array",
|
|
35
|
+
items: {
|
|
36
|
+
type: "string"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
notify: {
|
|
40
|
+
type: "array",
|
|
41
|
+
items: {
|
|
42
|
+
type: "object",
|
|
43
|
+
required: ["id", "discriminator"],
|
|
44
|
+
additionalProperties: false,
|
|
45
|
+
properties: {
|
|
46
|
+
id: {
|
|
47
|
+
type: "string"
|
|
48
|
+
},
|
|
49
|
+
discriminator: {
|
|
50
|
+
type: "string",
|
|
51
|
+
enum: ["user"]
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
const nullableRoutingOverrideSchema = {
|
|
59
|
+
oneOf: [routingOverrideSchema, { type: "null" }]
|
|
60
|
+
};
|
|
1
61
|
const issueSchema = {
|
|
2
62
|
$schema: "http://json-schema.org/draft-07/schema",
|
|
3
63
|
$id: "issue.json",
|
|
@@ -23,67 +83,51 @@ const issueSchema = {
|
|
|
23
83
|
},
|
|
24
84
|
departmentId: {
|
|
25
85
|
type: "string",
|
|
26
|
-
description: "The ID of the department that this issue is associated with."
|
|
86
|
+
description: "The ID of the department that this issue is associated with. Departments are org-level entities, so this is one value per issue (no per-property override)."
|
|
27
87
|
},
|
|
28
|
-
|
|
88
|
+
system: {
|
|
29
89
|
type: "object",
|
|
90
|
+
description: "Present if this is a System Issue (driven by a device notification). Absence means User Issue.",
|
|
30
91
|
additionalProperties: false,
|
|
92
|
+
required: ["category", "notification"],
|
|
31
93
|
properties: {
|
|
32
|
-
|
|
94
|
+
category: {
|
|
33
95
|
type: "string",
|
|
34
|
-
|
|
96
|
+
enum: SYSTEM_CATEGORIES,
|
|
97
|
+
description: "Canonical System Category slug. Derived from (device.type, device.discriminator) at notification time."
|
|
35
98
|
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
description: "The
|
|
39
|
-
},
|
|
40
|
-
priority: {
|
|
41
|
-
$ref: "ticket.json#/properties/priority",
|
|
42
|
-
description: "The priority to assign tickets with this issue to."
|
|
99
|
+
notification: {
|
|
100
|
+
$ref: "definitions.json#/definitions/supportedNotifications/items",
|
|
101
|
+
description: "The device notification name this issue corresponds to."
|
|
43
102
|
},
|
|
44
|
-
|
|
103
|
+
excludedEntities: {
|
|
45
104
|
type: "array",
|
|
105
|
+
description: "Device IDs muted for this issue. Devices in this list never trigger ticket creation.",
|
|
46
106
|
items: {
|
|
47
107
|
type: "string"
|
|
48
|
-
}
|
|
108
|
+
},
|
|
109
|
+
default: []
|
|
49
110
|
}
|
|
50
111
|
}
|
|
51
112
|
},
|
|
52
|
-
|
|
53
|
-
type: "
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
113
|
+
routing: {
|
|
114
|
+
type: "object",
|
|
115
|
+
additionalProperties: false,
|
|
116
|
+
description: "Per-property routing overrides on top of a single org-level default. null at any level means suppressed.",
|
|
117
|
+
default: { default: {}, properties: {} },
|
|
118
|
+
properties: {
|
|
119
|
+
default: {
|
|
120
|
+
...nullableRoutingOverrideSchema,
|
|
121
|
+
description: "Org-level default routing applied to every property unless overridden. null means suppressed org-wide."
|
|
122
|
+
},
|
|
60
123
|
properties: {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
discriminator: {
|
|
66
|
-
type: "string",
|
|
67
|
-
enum: ["user"]
|
|
68
|
-
}
|
|
124
|
+
type: "object",
|
|
125
|
+
description: "Sparse per-property overrides keyed by propertyId. Fields omitted from an entry fall back to the org-level default. null entry means suppressed at that property.",
|
|
126
|
+
additionalProperties: nullableRoutingOverrideSchema,
|
|
127
|
+
default: {}
|
|
69
128
|
}
|
|
70
129
|
}
|
|
71
130
|
},
|
|
72
|
-
systemKey: {
|
|
73
|
-
type: "string"
|
|
74
|
-
},
|
|
75
|
-
autoCreateTicket: {
|
|
76
|
-
type: "boolean",
|
|
77
|
-
default: true
|
|
78
|
-
},
|
|
79
|
-
excludedResources: {
|
|
80
|
-
type: "array",
|
|
81
|
-
description: "A list of resources that should not trigger notifications of this issue",
|
|
82
|
-
items: {
|
|
83
|
-
type: "string"
|
|
84
|
-
},
|
|
85
|
-
default: []
|
|
86
|
-
},
|
|
87
131
|
createdAt: {
|
|
88
132
|
$ref: "definitions.json#/definitions/date"
|
|
89
133
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../.generated/schemas/issue.ts"],"sourcesContent":["import defs, { ISODateString } from \"./definitions\";\nimport
|
|
1
|
+
{"version":3,"sources":["../../.generated/schemas/issue.ts"],"sourcesContent":["import type { FromSchema } from \"json-schema-to-ts\";\nimport defs, { ISODateString } from \"./definitions\";\nimport { ticketSchema } from \"./ticket\";\n\nconst SYSTEM_CATEGORIES = [\n \"hvac\",\n \"access-control\",\n \"lighting\",\n \"shades\",\n \"irrigation\",\n \"cameras\",\n \"alarms\",\n \"pa\",\n \"media\",\n] as const;\n\nconst routingOverrideSchema = {\n type: \"object\",\n additionalProperties: false,\n properties: {\n assignedTo: {\n type: [\"object\", \"null\"],\n additionalProperties: false,\n required: [\"id\", \"discriminator\"],\n properties: {\n id: {\n type: \"string\",\n },\n discriminator: {\n type: \"string\",\n enum: [\"user\", \"vendor\"],\n },\n },\n },\n priority: {\n $ref: \"ticket.json#/properties/priority\",\n },\n tags: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n notify: {\n type: \"array\",\n items: {\n type: \"object\",\n required: [\"id\", \"discriminator\"],\n additionalProperties: false,\n properties: {\n id: {\n type: \"string\",\n },\n discriminator: {\n type: \"string\",\n enum: [\"user\"],\n },\n },\n },\n },\n },\n} as const;\n\nconst nullableRoutingOverrideSchema = {\n oneOf: [routingOverrideSchema, { type: \"null\" }],\n} as const;\n\nexport const issueSchema = {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"issue.json\",\n title: \"Issue\",\n description: \"An issue associated with ticketing and concierge.\",\n type: \"object\",\n required: [\"id\", \"type\", \"name\"],\n additionalProperties: false,\n properties: {\n id: {\n $ref: \"definitions.json#/definitions/id\",\n },\n type: {\n type: \"string\",\n enum: [\"issue\"],\n default: \"issue\",\n },\n name: {\n type: \"string\",\n },\n description: {\n type: \"string\",\n },\n departmentId: {\n type: \"string\",\n description:\n \"The ID of the department that this issue is associated with. Departments are org-level entities, so this is one value per issue (no per-property override).\",\n },\n system: {\n type: \"object\",\n description:\n \"Present if this is a System Issue (driven by a device notification). Absence means User Issue.\",\n additionalProperties: false,\n required: [\"category\", \"notification\"],\n properties: {\n category: {\n type: \"string\",\n enum: SYSTEM_CATEGORIES,\n description:\n \"Canonical System Category slug. Derived from (device.type, device.discriminator) at notification time.\",\n },\n notification: {\n $ref: \"definitions.json#/definitions/supportedNotifications/items\",\n description:\n \"The device notification name this issue corresponds to.\",\n },\n excludedEntities: {\n type: \"array\",\n description:\n \"Device IDs muted for this issue. Devices in this list never trigger ticket creation.\",\n items: {\n type: \"string\",\n },\n default: [],\n },\n },\n },\n routing: {\n type: \"object\",\n additionalProperties: false,\n description:\n \"Per-property routing overrides on top of a single org-level default. null at any level means suppressed.\",\n default: { default: {}, properties: {} },\n properties: {\n default: {\n ...nullableRoutingOverrideSchema,\n description:\n \"Org-level default routing applied to every property unless overridden. null means suppressed org-wide.\",\n },\n properties: {\n type: \"object\",\n description:\n \"Sparse per-property overrides keyed by propertyId. Fields omitted from an entry fall back to the org-level default. null entry means suppressed at that property.\",\n additionalProperties: nullableRoutingOverrideSchema,\n default: {},\n },\n },\n },\n createdAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n updatedAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n deletedAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n },\n} as const;\n\nexport type IssueSchema = FromSchema<\n typeof issueSchema,\n {\n references: [typeof defs, typeof ticketSchema];\n deserialize: [\n {\n pattern: {\n format: \"date-time\";\n };\n output: Date | ISODateString;\n },\n ];\n }\n>;\n"],"mappings":"AAIA,MAAM,oBAAoB;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;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M;AAAA,IACR;AAAA,IACA,aAAa;AAAA,MACX,MAAM;AAAA,IACR;AAAA,IACA,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,aACE;AAAA,IACJ;AAAA,IACA,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,aACE;AAAA,MACF,sBAAsB;AAAA,MACtB,UAAU,CAAC,YAAY,cAAc;AAAA,MACrC,YAAY;AAAA,QACV,UAAU;AAAA,UACR,MAAM;AAAA,UACN,MAAM;AAAA,UACN,aACE;AAAA,QACJ;AAAA,QACA,cAAc;AAAA,UACZ,MAAM;AAAA,UACN,aACE;AAAA,QACJ;AAAA,QACA,kBAAkB;AAAA,UAChB,MAAM;AAAA,UACN,aACE;AAAA,UACF,OAAO;AAAA,YACL,MAAM;AAAA,UACR;AAAA,UACA,SAAS,CAAC;AAAA,QACZ;AAAA,MACF;AAAA,IACF;AAAA,IACA,SAAS;AAAA,MACP,MAAM;AAAA,MACN,sBAAsB;AAAA,MACtB,aACE;AAAA,MACF,SAAS,EAAE,SAAS,CAAC,GAAG,YAAY,CAAC,EAAE;AAAA,MACvC,YAAY;AAAA,QACV,SAAS;AAAA,UACP,GAAG;AAAA,UACH,aACE;AAAA,QACJ;AAAA,QACA,YAAY;AAAA,UACV,MAAM;AAAA,UACN,aACE;AAAA,UACF,sBAAsB;AAAA,UACtB,SAAS,CAAC;AAAA,QACZ;AAAA,MACF;AAAA,IACF;AAAA,IACA,WAAW;AAAA,MACT,MAAM;AAAA,IACR;AAAA,IACA,WAAW;AAAA,MACT,MAAM;AAAA,IACR;AAAA,IACA,WAAW;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;","names":[]}
|
package/dist/schemas/lock.d.ts
CHANGED
|
@@ -12,6 +12,10 @@ declare const lockSchema: {
|
|
|
12
12
|
readonly id: {
|
|
13
13
|
readonly $ref: "definitions.json#/definitions/id";
|
|
14
14
|
};
|
|
15
|
+
readonly propertyId: {
|
|
16
|
+
readonly type: "string";
|
|
17
|
+
readonly description: "ID of the property this entity belongs to. Optional — used as a per-document filter inside the org-scoped database.";
|
|
18
|
+
};
|
|
15
19
|
readonly name: {
|
|
16
20
|
readonly type: "string";
|
|
17
21
|
};
|
package/dist/schemas/lock.js
CHANGED
|
@@ -9,6 +9,10 @@ const lockSchema = {
|
|
|
9
9
|
id: {
|
|
10
10
|
$ref: "definitions.json#/definitions/id"
|
|
11
11
|
},
|
|
12
|
+
propertyId: {
|
|
13
|
+
type: "string",
|
|
14
|
+
description: "ID of the property this entity belongs to. Optional \u2014 used as a per-document filter inside the org-scoped database."
|
|
15
|
+
},
|
|
12
16
|
name: {
|
|
13
17
|
type: "string"
|
|
14
18
|
},
|
package/dist/schemas/lock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../.generated/schemas/lock.ts"],"sourcesContent":["import defs, { ISODateString } from \"./definitions\";\nimport type { FromSchema } from \"json-schema-to-ts\";\n\nexport const lockSchema = {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"lock.json\",\n title: \"Lock\",\n description: \"Any smart lock\",\n type: \"object\",\n additionalProperties: false,\n properties: {\n id: {\n $ref: \"definitions.json#/definitions/id\",\n },\n name: {\n type: \"string\",\n },\n type: {\n type: \"string\",\n enum: [\"lock\"],\n default: \"lock\",\n },\n offline: {\n type: \"boolean\",\n },\n supportedNotifications: {\n $ref: \"definitions.json#/definitions/supportedNotifications\",\n },\n notification: {\n $ref: \"definitions.json#/definitions/notification\",\n },\n driver: {\n $ref: \"definitions.json#/definitions/driver\",\n },\n alerts: {\n $ref: \"definitions.json#/definitions/alerts\"\n },\n state: {\n type: [\"string\", \"null\"],\n enum: [\"locked\", \"unlocked\", null],\n },\n mode: {\n type: [\"string\", \"null\"],\n enum: [\n \"normal\",\n \"autoLock\",\n \"emergencyOpen\",\n \"emergencyClose\",\n \"holdOpen\",\n \"lockdown\",\n null,\n ],\n description:\n \"emergencyOpen and emergencyClose are deprecated and can be removed once Salto, Paxton and Geovision drivers are updated\",\n default: null,\n },\n supportedModes: {\n type: \"array\",\n uniqueItems: true,\n items: {\n enum: [\n \"normal\",\n \"autoLock\",\n \"emergencyOpen\",\n \"emergencyClose\",\n \"holdOpen\",\n \"lockdown\",\n null,\n ],\n },\n },\n batteryLevel: {\n $ref: \"definitions.json#/definitions/batteryLevel\",\n },\n systemId: {\n $ref: \"definitions.json#/definitions/systemId\",\n },\n watts: {\n $ref: \"definitions.json#/definitions/watts\",\n },\n icon: {\n type: \"string\",\n },\n manufacturer: {\n type: \"string\",\n },\n modelNumber: {\n type: \"string\",\n },\n serialNumber: {\n type: \"string\",\n },\n firmwareVersion: {\n type: \"string\",\n },\n },\n required: [\"id\", \"type\", \"state\", \"driver\"],\n} as const;\n\nexport type LockSchema = FromSchema<\n typeof lockSchema,\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":"AAGO,MAAM,aAAa;AAAA,EACxB,SAAS;AAAA,EACT,KAAK;AAAA,EACL,OAAO;AAAA,EACP,aAAa;AAAA,EACb,MAAM;AAAA,EACN,sBAAsB;AAAA,EACtB,YAAY;AAAA,IACV,IAAI;AAAA,MACF,MAAM;AAAA,IACR;AAAA,IACA,MAAM;AAAA,MACJ,MAAM;AAAA,IACR;AAAA,IACA,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,MAAM,CAAC,MAAM;AAAA,MACb,SAAS;AAAA,IACX;AAAA,IACA,SAAS;AAAA,MACP,MAAM;AAAA,IACR;AAAA,IACA,wBAAwB;AAAA,MACtB,MAAM;AAAA,IACR;AAAA,IACA,cAAc;AAAA,MACZ,MAAM;AAAA,IACR;AAAA,IACA,QAAQ;AAAA,MACN,MAAM;AAAA,IACR;AAAA,IACA,QAAQ;AAAA,MACN,MAAM;AAAA,IACR;AAAA,IACA,OAAO;AAAA,MACL,MAAM,CAAC,UAAU,MAAM;AAAA,MACvB,MAAM,CAAC,UAAU,YAAY,IAAI;AAAA,IACnC;AAAA,IACA,MAAM;AAAA,MACJ,MAAM,CAAC,UAAU,MAAM;AAAA,MACvB,MAAM;AAAA,QACJ;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,aACE;AAAA,MACF,SAAS;AAAA,IACX;AAAA,IACA,gBAAgB;AAAA,MACd,MAAM;AAAA,MACN,aAAa;AAAA,MACb,OAAO;AAAA,QACL,MAAM;AAAA,UACJ;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ,MAAM;AAAA,IACR;AAAA,IACA,UAAU;AAAA,MACR,MAAM;AAAA,IACR;AAAA,IACA,OAAO;AAAA,MACL,MAAM;AAAA,IACR;AAAA,IACA,MAAM;AAAA,MACJ,MAAM;AAAA,IACR;AAAA,IACA,cAAc;AAAA,MACZ,MAAM;AAAA,IACR;AAAA,IACA,aAAa;AAAA,MACX,MAAM;AAAA,IACR;AAAA,IACA,cAAc;AAAA,MACZ,MAAM;AAAA,IACR;AAAA,IACA,iBAAiB;AAAA,MACf,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA,UAAU,CAAC,MAAM,QAAQ,SAAS,QAAQ;AAC5C;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../.generated/schemas/lock.ts"],"sourcesContent":["import defs, { ISODateString } from \"./definitions\";\nimport type { FromSchema } from \"json-schema-to-ts\";\n\nexport const lockSchema = {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"lock.json\",\n title: \"Lock\",\n description: \"Any smart lock\",\n type: \"object\",\n additionalProperties: false,\n properties: {\n id: {\n $ref: \"definitions.json#/definitions/id\",\n },\n propertyId: {\n type: \"string\",\n description: \"ID of the property this entity belongs to. Optional — used as a per-document filter inside the org-scoped database.\",\n },\n name: {\n type: \"string\",\n },\n type: {\n type: \"string\",\n enum: [\"lock\"],\n default: \"lock\",\n },\n offline: {\n type: \"boolean\",\n },\n supportedNotifications: {\n $ref: \"definitions.json#/definitions/supportedNotifications\",\n },\n notification: {\n $ref: \"definitions.json#/definitions/notification\",\n },\n driver: {\n $ref: \"definitions.json#/definitions/driver\",\n },\n alerts: {\n $ref: \"definitions.json#/definitions/alerts\"\n },\n state: {\n type: [\"string\", \"null\"],\n enum: [\"locked\", \"unlocked\", null],\n },\n mode: {\n type: [\"string\", \"null\"],\n enum: [\n \"normal\",\n \"autoLock\",\n \"emergencyOpen\",\n \"emergencyClose\",\n \"holdOpen\",\n \"lockdown\",\n null,\n ],\n description:\n \"emergencyOpen and emergencyClose are deprecated and can be removed once Salto, Paxton and Geovision drivers are updated\",\n default: null,\n },\n supportedModes: {\n type: \"array\",\n uniqueItems: true,\n items: {\n enum: [\n \"normal\",\n \"autoLock\",\n \"emergencyOpen\",\n \"emergencyClose\",\n \"holdOpen\",\n \"lockdown\",\n null,\n ],\n },\n },\n batteryLevel: {\n $ref: \"definitions.json#/definitions/batteryLevel\",\n },\n systemId: {\n $ref: \"definitions.json#/definitions/systemId\",\n },\n watts: {\n $ref: \"definitions.json#/definitions/watts\",\n },\n icon: {\n type: \"string\",\n },\n manufacturer: {\n type: \"string\",\n },\n modelNumber: {\n type: \"string\",\n },\n serialNumber: {\n type: \"string\",\n },\n firmwareVersion: {\n type: \"string\",\n },\n },\n required: [\"id\", \"type\", \"state\", \"driver\"],\n} as const;\n\nexport type LockSchema = FromSchema<\n typeof lockSchema,\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":"AAGO,MAAM,aAAa;AAAA,EACxB,SAAS;AAAA,EACT,KAAK;AAAA,EACL,OAAO;AAAA,EACP,aAAa;AAAA,EACb,MAAM;AAAA,EACN,sBAAsB;AAAA,EACtB,YAAY;AAAA,IACV,IAAI;AAAA,MACF,MA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c;AAAA,MACZ,MAAM;AAAA,IACR;AAAA,IACA,iBAAiB;AAAA,MACf,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA,UAAU,CAAC,MAAM,QAAQ,SAAS,QAAQ;AAC5C;","names":[]}
|
package/dist/schemas/log.d.ts
CHANGED
|
@@ -20,6 +20,10 @@ declare const logSchema: {
|
|
|
20
20
|
readonly id: {
|
|
21
21
|
readonly $ref: "definitions.json#/definitions/id";
|
|
22
22
|
};
|
|
23
|
+
readonly propertyId: {
|
|
24
|
+
readonly type: "string";
|
|
25
|
+
readonly description: "ID of the property this entity belongs to. Optional — used as a per-document filter inside the org-scoped database.";
|
|
26
|
+
};
|
|
23
27
|
readonly driver: {
|
|
24
28
|
readonly $ref: "definitions.json#/definitions/driver";
|
|
25
29
|
};
|
package/dist/schemas/log.js
CHANGED
|
@@ -17,6 +17,10 @@ const logSchema = {
|
|
|
17
17
|
id: {
|
|
18
18
|
$ref: "definitions.json#/definitions/id"
|
|
19
19
|
},
|
|
20
|
+
propertyId: {
|
|
21
|
+
type: "string",
|
|
22
|
+
description: "ID of the property this entity belongs to. Optional \u2014 used as a per-document filter inside the org-scoped database."
|
|
23
|
+
},
|
|
20
24
|
driver: {
|
|
21
25
|
$ref: "definitions.json#/definitions/driver"
|
|
22
26
|
},
|
package/dist/schemas/log.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../.generated/schemas/log.ts"],"sourcesContent":["import defs, { ISODateString } from \"./definitions\";\nimport type { FromSchema } from \"json-schema-to-ts\";\n\nexport const logSchema = {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"log.json\",\n title: \"Log\",\n type: \"object\",\n required: [\"type\", \"timestamp\", \"id\", \"driver\", \"name\"],\n properties: {\n type: {\n type: \"string\",\n default: \"log\",\n enum: [\"log\"],\n },\n timestamp: {\n type: \"number\",\n minimum: 1655907956593,\n },\n id: {\n $ref: \"definitions.json#/definitions/id\",\n },\n driver: {\n $ref: \"definitions.json#/definitions/driver\",\n },\n name: {\n type: \"string\",\n description: \"Event name\",\n },\n field1: {\n type: \"object\",\n required: [\"name\", \"value\"],\n properties: {\n name: {\n type: \"string\",\n },\n value: {\n type: \"string\",\n },\n },\n },\n field2: {\n type: \"object\",\n required: [\"name\", \"value\"],\n properties: {\n name: {\n type: \"string\",\n },\n value: {\n type: \"string\",\n },\n },\n },\n field3: {\n type: \"object\",\n required: [\"name\", \"value\"],\n properties: {\n name: {\n type: \"string\",\n },\n value: {\n type: \"string\",\n },\n },\n },\n field4: {\n type: \"object\",\n required: [\"name\", \"value\"],\n properties: {\n name: {\n type: \"string\",\n },\n value: {\n type: \"string\",\n },\n },\n },\n field5: {\n type: \"object\",\n required: [\"name\", \"value\"],\n properties: {\n name: {\n type: \"string\",\n },\n value: {\n type: \"string\",\n },\n },\n },\n field6: {\n type: \"object\",\n required: [\"name\", \"value\"],\n properties: {\n name: {\n type: \"string\",\n },\n value: {\n type: \"string\",\n },\n },\n },\n },\n} as const;\n\nexport type LogSchema = FromSchema<\n typeof logSchema,\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":"AAGO,MAAM,YAAY;AAAA,EACvB,SAAS;AAAA,EACT,KAAK;AAAA,EACL,OAAO;AAAA,EACP,MAAM;AAAA,EACN,UAAU,CAAC,QAAQ,aAAa,MAAM,UAAU,MAAM;AAAA,EACtD,YAAY;AAAA,IACV,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,MACT,MAAM,CAAC,KAAK;AAAA,IACd;AAAA,IACA,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IACA,IAAI;AAAA,MACF,MAAM;AAAA,IACR;AAAA,IACA,QAAQ;AAAA,MACN,MAAM;AAAA,IACR;AAAA,IACA,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,aAAa;AAAA,IACf;AAAA,IAC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
1
|
+
{"version":3,"sources":["../../.generated/schemas/log.ts"],"sourcesContent":["import defs, { ISODateString } from \"./definitions\";\nimport type { FromSchema } from \"json-schema-to-ts\";\n\nexport const logSchema = {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"log.json\",\n title: \"Log\",\n type: \"object\",\n required: [\"type\", \"timestamp\", \"id\", \"driver\", \"name\"],\n properties: {\n type: {\n type: \"string\",\n default: \"log\",\n enum: [\"log\"],\n },\n timestamp: {\n type: \"number\",\n minimum: 1655907956593,\n },\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 driver: {\n $ref: \"definitions.json#/definitions/driver\",\n },\n name: {\n type: \"string\",\n description: \"Event name\",\n },\n field1: {\n type: \"object\",\n required: [\"name\", \"value\"],\n properties: {\n name: {\n type: \"string\",\n },\n value: {\n type: \"string\",\n },\n },\n },\n field2: {\n type: \"object\",\n required: [\"name\", \"value\"],\n properties: {\n name: {\n type: \"string\",\n },\n value: {\n type: \"string\",\n },\n },\n },\n field3: {\n type: \"object\",\n required: [\"name\", \"value\"],\n properties: {\n name: {\n type: \"string\",\n },\n value: {\n type: \"string\",\n },\n },\n },\n field4: {\n type: \"object\",\n required: [\"name\", \"value\"],\n properties: {\n name: {\n type: \"string\",\n },\n value: {\n type: \"string\",\n },\n },\n },\n field5: {\n type: \"object\",\n required: [\"name\", \"value\"],\n properties: {\n name: {\n type: \"string\",\n },\n value: {\n type: \"string\",\n },\n },\n },\n field6: {\n type: \"object\",\n required: [\"name\", \"value\"],\n properties: {\n name: {\n type: \"string\",\n },\n value: {\n type: \"string\",\n },\n },\n },\n },\n} as const;\n\nexport type LogSchema = FromSchema<\n typeof logSchema,\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":"AAGO,MAAM,YAAY;AA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AAM;AAAA,QACR;AAAA,QACA,OAAO;AAAA,UACL,MAAM;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAAA,IACA,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,UAAU,CAAC,QAAQ,OAAO;AAAA,MAC1B,YAAY;AAAA,QACV,MAAM;AAAA,UACJ,MAAM;AAAA,QACR;AAAA,QACA,OAAO;AAAA,UACL,MAAM;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAAA,IACA,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,UAAU,CAAC,QAAQ,OAAO;AAAA,MAC1B,YAAY;AAAA,QACV,MAAM;AAAA,UACJ,MAAM;AAAA,QACR;AAAA,QACA,OAAO;AAAA,UACL,MAAM;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
|
@@ -12,6 +12,10 @@ declare const mediaFileSchema: {
|
|
|
12
12
|
readonly type: "string";
|
|
13
13
|
readonly default: "";
|
|
14
14
|
};
|
|
15
|
+
readonly propertyId: {
|
|
16
|
+
readonly type: "string";
|
|
17
|
+
readonly description: "ID of the property this entity belongs to. Optional — used as a per-document filter inside the org-scoped database.";
|
|
18
|
+
};
|
|
15
19
|
readonly type: {
|
|
16
20
|
readonly type: "string";
|
|
17
21
|
readonly default: "mediaFile";
|
|
@@ -11,6 +11,10 @@ const mediaFileSchema = {
|
|
|
11
11
|
type: "string",
|
|
12
12
|
default: ""
|
|
13
13
|
},
|
|
14
|
+
propertyId: {
|
|
15
|
+
type: "string",
|
|
16
|
+
description: "ID of the property this entity belongs to. Optional \u2014 used as a per-document filter inside the org-scoped database."
|
|
17
|
+
},
|
|
14
18
|
type: {
|
|
15
19
|
type: "string",
|
|
16
20
|
default: "mediaFile",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../.generated/schemas/mediaFile.ts"],"sourcesContent":["import defs, { ISODateString } from \"./definitions\";\nimport type { FromSchema } from \"json-schema-to-ts\";\n\nexport const mediaFileSchema = {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"mediaFile.json\",\n title: \"Media File\",\n description: \"Any media file\",\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n default: \"\",\n },\n type: {\n type: \"string\",\n default: \"mediaFile\",\n enum: [\"mediaFile\"],\n },\n name: {\n type: \"string\",\n },\n fileHash: {\n type: \"string\",\n },\n category: {\n type: \"string\",\n description: \"This is the category id\",\n },\n mimeType: {\n type: \"string\",\n enum: [\n \"image/*\",\n \"image/jpeg\",\n \"image/png\",\n \"image/gif\",\n \"image/webp\",\n \"image/avif\",\n \"image/svg+xml\",\n \"application/pdf\",\n ],\n },\n data: {\n type: \"string\",\n },\n url: {\n type: \"string\",\n format: \"uri\",\n },\n width: {\n type: \"integer\",\n minimum: 0,\n },\n height: {\n type: \"integer\",\n minimum: 0,\n },\n size: {\n type: \"integer\",\n minimum: 0,\n description: \"Size in bytes\",\n },\n uploadUrl: {\n type: \"string\",\n format: \"uri\",\n },\n uploadUrlExpires: {\n $ref: \"definitions.json#/definitions/date\",\n },\n createdBy: {\n type: \"string\",\n },\n systemId: {\n $ref: \"definitions.json#/definitions/systemId\",\n },\n createdAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n updatedAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n deletedAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n },\n additionalProperties: false,\n required: [\"id\", \"type\"],\n} as const;\n\nexport type MediaFileSchema = FromSchema<\n typeof mediaFileSchema,\n {\n references: [typeof defs];\n deserialize: [\n {\n pattern: {\n format: \"date-time\";\n };\n output: Date | ISODateString;\n },\n ];\n }\n>;\n\nfunction createImageVariant(params) {\n if (this.mimeType != \"image/*\")\n throw new Error(\"Only dynamic images can have variants\");\n if (!this.url) throw new Error(\"MediaFile has no url\");\n // convert params to \"key=value\" pairs\n const query = Object.keys(params)\n .map((key) => `${key}=${params[key]}`)\n .join(\",\");\n\n // replace the final /public with the query above\n return this.url.replace(/\\/public$/, `/${query}`);\n}\n\nexport const methods = {\n createImageVariant: createImageVariant,\n};\n"],"mappings":";;AAGO,MAAM,kBAAkB;AAAA,EAC7B,SAAS;AAAA,EACT,KAAK;AAAA,EACL,OAAO;AAAA,EACP,aAAa;AAAA,EACb,MAAM;AAAA,EACN,YAAY;AAAA,IACV,IAAI;AAAA,MACF,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IACA,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,MACT,MAAM,CAAC,WAAW;AAAA,IACpB;AAAA,IACA,MAAM;AAAA,MACJ,MAAM;AAAA,IACR;AAAA,IACA,UAAU;AAAA,MACR,MAAM;AAAA,IACR;AAAA,IACA,UAAU;AAAA,MACR,MAAM;AAAA,MACN,aAAa;AAAA,IACf;AAAA,IACA,UAAU;AAAA,MACR,MAAM;AAAA,MACN,MAAM;AAAA,QACJ;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,IACA,MAAM;AAAA,MACJ,MAAM;AAAA,IACR;AAAA,IACA,KAAK;AAAA,MACH,MAAM;AAAA,MACN,QAAQ;AAAA,IACV;AAAA,IACA,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IACA,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IACA,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,MACT,aAAa;AAAA,IACf;AAAA,IACA,WAAW;AAAA,MACT,MAAM;AAAA,MACN,QAAQ;AAAA,IACV;AAAA,IACA,kBAAkB;AAAA,MAChB,MAAM;AAAA,IACR;AAAA,IACA,WAAW;AAAA,MACT,MAAM;AAAA,IACR;AAAA,IACA,UAAU;AAAA,MACR,MAAM;AAAA,IACR;AAAA,IACA,WAAW;AAAA,MACT,MAAM;AAAA,IACR;AAAA,IACA,WAAW;AAAA,MACT,MAAM;AAAA,IACR;AAAA,IACA,WAAW;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA,sBAAsB;AAAA,EACtB,UAAU,CAAC,MAAM,MAAM;AACzB;AAiBA,SAAS,mBAAmB,QAAQ;AAClC,MAAI,KAAK,YAAY;AACnB,UAAM,IAAI,MAAM,uCAAuC;AACzD,MAAI,CAAC,KAAK,IAAK,OAAM,IAAI,MAAM,sBAAsB;AAErD,QAAM,QAAQ,OAAO,KAAK,MAAM,EAC7B,IAAI,CAAC,QAAQ,GAAG,GAAG,IAAI,OAAO,GAAG,CAAC,EAAE,EACpC,KAAK,GAAG;AAGX,SAAO,KAAK,IAAI,QAAQ,aAAa,IAAI,KAAK,EAAE;AAClD;AAXS;AAaF,MAAM,UAAU;AAAA,EACrB;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../.generated/schemas/mediaFile.ts"],"sourcesContent":["import defs, { ISODateString } from \"./definitions\";\nimport type { FromSchema } from \"json-schema-to-ts\";\n\nexport const mediaFileSchema = {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"mediaFile.json\",\n title: \"Media File\",\n description: \"Any media file\",\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n default: \"\",\n },\n propertyId: {\n type: \"string\",\n description: \"ID of the property this entity belongs to. Optional — used as a per-document filter inside the org-scoped database.\",\n },\n type: {\n type: \"string\",\n default: \"mediaFile\",\n enum: [\"mediaFile\"],\n },\n name: {\n type: \"string\",\n },\n fileHash: {\n type: \"string\",\n },\n category: {\n type: \"string\",\n description: \"This is the category id\",\n },\n mimeType: {\n type: \"string\",\n enum: [\n \"image/*\",\n \"image/jpeg\",\n \"image/png\",\n \"image/gif\",\n \"image/webp\",\n \"image/avif\",\n \"image/svg+xml\",\n \"application/pdf\",\n ],\n },\n data: {\n type: \"string\",\n },\n url: {\n type: \"string\",\n format: \"uri\",\n },\n width: {\n type: \"integer\",\n minimum: 0,\n },\n height: {\n type: \"integer\",\n minimum: 0,\n },\n size: {\n type: \"integer\",\n minimum: 0,\n description: \"Size in bytes\",\n },\n uploadUrl: {\n type: \"string\",\n format: \"uri\",\n },\n uploadUrlExpires: {\n $ref: \"definitions.json#/definitions/date\",\n },\n createdBy: {\n type: \"string\",\n },\n systemId: {\n $ref: \"definitions.json#/definitions/systemId\",\n },\n createdAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n updatedAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n deletedAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n },\n additionalProperties: false,\n required: [\"id\", \"type\"],\n} as const;\n\nexport type MediaFileSchema = FromSchema<\n typeof mediaFileSchema,\n {\n references: [typeof defs];\n deserialize: [\n {\n pattern: {\n format: \"date-time\";\n };\n output: Date | ISODateString;\n },\n ];\n }\n>;\n\nfunction createImageVariant(params) {\n if (this.mimeType != \"image/*\")\n throw new Error(\"Only dynamic images can have variants\");\n if (!this.url) throw new Error(\"MediaFile has no url\");\n // convert params to \"key=value\" pairs\n const query = Object.keys(params)\n .map((key) => `${key}=${params[key]}`)\n .join(\",\");\n\n // replace the final /public with the query above\n return this.url.replace(/\\/public$/, `/${query}`);\n}\n\nexport const methods = {\n createImageVariant: createImageVariant,\n};\n"],"mappings":";;AAGO,MAAM,kBAAkB;AAAA,EAC7B,SAAS;AAAA,EACT,KAAK;AAAA,EACL,OAAO;AAAA,EACP,aAAa;AAAA,EACb,MAAM;AAAA,EACN,YAAY;AAAA,IACV,IAAI;AAAA,MACF,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IACA,YAAY;AAAA,MACV,MAAM;AAAA,MACN,aAAa;AAAA,IACf;AAAA,IACA,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,MACT,MAAM,CAAC,WAAW;AAAA,IACpB;AAAA,IACA,MAAM;AAAA,MACJ,MAAM;AAAA,IACR;AAAA,IACA,UAAU;AAAA,MACR,MAAM;AAAA,IACR;AAAA,IACA,UAAU;AAAA,M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AE;AAClD;AAXS;AAaF,MAAM,UAAU;AAAA,EACrB;AACF;","names":[]}
|
|
@@ -12,6 +12,10 @@ declare const mediaSourceSchema: {
|
|
|
12
12
|
readonly id: {
|
|
13
13
|
readonly $ref: "definitions.json#/definitions/id";
|
|
14
14
|
};
|
|
15
|
+
readonly propertyId: {
|
|
16
|
+
readonly type: "string";
|
|
17
|
+
readonly description: "ID of the property this entity belongs to. Optional — used as a per-document filter inside the org-scoped database.";
|
|
18
|
+
};
|
|
15
19
|
readonly type: {
|
|
16
20
|
readonly type: "string";
|
|
17
21
|
readonly default: "mediaSource";
|
|
@@ -9,6 +9,10 @@ const mediaSourceSchema = {
|
|
|
9
9
|
id: {
|
|
10
10
|
$ref: "definitions.json#/definitions/id"
|
|
11
11
|
},
|
|
12
|
+
propertyId: {
|
|
13
|
+
type: "string",
|
|
14
|
+
description: "ID of the property this entity belongs to. Optional \u2014 used as a per-document filter inside the org-scoped database."
|
|
15
|
+
},
|
|
12
16
|
type: {
|
|
13
17
|
type: "string",
|
|
14
18
|
default: "mediaSource",
|