@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.
Files changed (238) hide show
  1. package/dist/httpClient.d.ts +8 -12
  2. package/dist/index-BnWbLEt_.d.ts +22 -0
  3. package/dist/{index-CwkLEwUB.d.ts → index-DJzBywIl.d.ts} +13 -21
  4. package/dist/index.d.ts +11 -11
  5. package/dist/index.js +2 -0
  6. package/dist/index.js.map +1 -1
  7. package/dist/lib/deviceNotifications.d.ts +19 -0
  8. package/dist/lib/deviceNotifications.js +35 -0
  9. package/dist/lib/deviceNotifications.js.map +1 -0
  10. package/dist/lib/index.d.ts +3 -0
  11. package/dist/lib/index.js +23 -0
  12. package/dist/lib/index.js.map +1 -0
  13. package/dist/lib/policy-resolvers.d.ts +12 -0
  14. package/dist/lib/policy-resolvers.js +75 -0
  15. package/dist/lib/policy-resolvers.js.map +1 -0
  16. package/dist/lib/systemCategories.d.ts +10 -0
  17. package/dist/lib/systemCategories.js +61 -0
  18. package/dist/lib/systemCategories.js.map +1 -0
  19. package/dist/models/alarm.js +1 -0
  20. package/dist/models/alarm.js.map +1 -1
  21. package/dist/models/announcement.js +1 -0
  22. package/dist/models/announcement.js.map +1 -1
  23. package/dist/models/automation.js +1 -0
  24. package/dist/models/automation.js.map +1 -1
  25. package/dist/models/camera.js +1 -0
  26. package/dist/models/camera.js.map +1 -1
  27. package/dist/models/category.js +1 -0
  28. package/dist/models/category.js.map +1 -1
  29. package/dist/models/courtesy.js +1 -0
  30. package/dist/models/courtesy.js.map +1 -1
  31. package/dist/models/credential.js +1 -0
  32. package/dist/models/credential.js.map +1 -1
  33. package/dist/models/dimmer.js +1 -0
  34. package/dist/models/dimmer.js.map +1 -1
  35. package/dist/models/emailMessage.js +1 -0
  36. package/dist/models/emailMessage.js.map +1 -1
  37. package/dist/models/energyReport.js +1 -0
  38. package/dist/models/energyReport.js.map +1 -1
  39. package/dist/models/gateway.js +1 -0
  40. package/dist/models/gateway.js.map +1 -1
  41. package/dist/models/issue.d.ts +1 -1
  42. package/dist/models/issue.js +2 -7
  43. package/dist/models/issue.js.map +1 -1
  44. package/dist/models/lock.js +1 -0
  45. package/dist/models/lock.js.map +1 -1
  46. package/dist/models/log.js +1 -0
  47. package/dist/models/log.js.map +1 -1
  48. package/dist/models/mediaFile.js +1 -0
  49. package/dist/models/mediaFile.js.map +1 -1
  50. package/dist/models/mediaSource.js +1 -0
  51. package/dist/models/mediaSource.js.map +1 -1
  52. package/dist/models/motionSensor.js +1 -0
  53. package/dist/models/motionSensor.js.map +1 -1
  54. package/dist/models/notification.js +1 -0
  55. package/dist/models/notification.js.map +1 -1
  56. package/dist/models/order.js +1 -0
  57. package/dist/models/order.js.map +1 -1
  58. package/dist/models/organization.js +1 -2
  59. package/dist/models/organization.js.map +1 -1
  60. package/dist/models/payment.js +1 -0
  61. package/dist/models/payment.js.map +1 -1
  62. package/dist/models/policy.js +1 -0
  63. package/dist/models/policy.js.map +1 -1
  64. package/dist/models/product.js +1 -0
  65. package/dist/models/product.js.map +1 -1
  66. package/dist/models/property.js +1 -1
  67. package/dist/models/property.js.map +1 -1
  68. package/dist/models/reservation.js +1 -0
  69. package/dist/models/reservation.js.map +1 -1
  70. package/dist/models/shortLink.js +1 -0
  71. package/dist/models/shortLink.js.map +1 -1
  72. package/dist/models/smsMessage.js +1 -0
  73. package/dist/models/smsMessage.js.map +1 -1
  74. package/dist/models/space.js +1 -0
  75. package/dist/models/space.js.map +1 -1
  76. package/dist/models/switch.js +1 -0
  77. package/dist/models/switch.js.map +1 -1
  78. package/dist/models/thermostat.js +1 -0
  79. package/dist/models/thermostat.js.map +1 -1
  80. package/dist/models/ticket.js +1 -0
  81. package/dist/models/ticket.js.map +1 -1
  82. package/dist/models/timeSheet.js +1 -0
  83. package/dist/models/timeSheet.js.map +1 -1
  84. package/dist/models/user.js +0 -1
  85. package/dist/models/user.js.map +1 -1
  86. package/dist/models/vendor.js +2 -0
  87. package/dist/models/vendor.js.map +1 -1
  88. package/dist/models/windowCovering.js +1 -0
  89. package/dist/models/windowCovering.js.map +1 -1
  90. package/dist/schemas/alarm.d.ts +4 -0
  91. package/dist/schemas/alarm.js +4 -0
  92. package/dist/schemas/alarm.js.map +1 -1
  93. package/dist/schemas/announcement.d.ts +4 -0
  94. package/dist/schemas/announcement.js +4 -0
  95. package/dist/schemas/announcement.js.map +1 -1
  96. package/dist/schemas/automation.d.ts +4 -0
  97. package/dist/schemas/automation.js +4 -0
  98. package/dist/schemas/automation.js.map +1 -1
  99. package/dist/schemas/camera.d.ts +4 -0
  100. package/dist/schemas/camera.js +4 -0
  101. package/dist/schemas/camera.js.map +1 -1
  102. package/dist/schemas/category.d.ts +4 -0
  103. package/dist/schemas/category.js +4 -0
  104. package/dist/schemas/category.js.map +1 -1
  105. package/dist/schemas/courtesy.d.ts +4 -0
  106. package/dist/schemas/courtesy.js +4 -0
  107. package/dist/schemas/courtesy.js.map +1 -1
  108. package/dist/schemas/credential.d.ts +4 -1
  109. package/dist/schemas/credential.js +5 -1
  110. package/dist/schemas/credential.js.map +1 -1
  111. package/dist/schemas/definitions.d.ts +2 -2
  112. package/dist/schemas/definitions.js +8 -2
  113. package/dist/schemas/definitions.js.map +1 -1
  114. package/dist/schemas/dimmer.d.ts +4 -0
  115. package/dist/schemas/dimmer.js +4 -0
  116. package/dist/schemas/dimmer.js.map +1 -1
  117. package/dist/schemas/emailMessage.d.ts +4 -0
  118. package/dist/schemas/emailMessage.js +4 -0
  119. package/dist/schemas/emailMessage.js.map +1 -1
  120. package/dist/schemas/energyReport.d.ts +4 -0
  121. package/dist/schemas/energyReport.js +4 -0
  122. package/dist/schemas/energyReport.js.map +1 -1
  123. package/dist/schemas/gateway.d.ts +4 -0
  124. package/dist/schemas/gateway.js +4 -0
  125. package/dist/schemas/gateway.js.map +1 -1
  126. package/dist/schemas/issue.d.ts +126 -43
  127. package/dist/schemas/issue.js +88 -44
  128. package/dist/schemas/issue.js.map +1 -1
  129. package/dist/schemas/lock.d.ts +4 -0
  130. package/dist/schemas/lock.js +4 -0
  131. package/dist/schemas/lock.js.map +1 -1
  132. package/dist/schemas/log.d.ts +4 -0
  133. package/dist/schemas/log.js +4 -0
  134. package/dist/schemas/log.js.map +1 -1
  135. package/dist/schemas/mediaFile.d.ts +4 -0
  136. package/dist/schemas/mediaFile.js +4 -0
  137. package/dist/schemas/mediaFile.js.map +1 -1
  138. package/dist/schemas/mediaSource.d.ts +4 -0
  139. package/dist/schemas/mediaSource.js +4 -0
  140. package/dist/schemas/mediaSource.js.map +1 -1
  141. package/dist/schemas/motionSensor.d.ts +4 -0
  142. package/dist/schemas/motionSensor.js +4 -0
  143. package/dist/schemas/motionSensor.js.map +1 -1
  144. package/dist/schemas/notification.d.ts +4 -0
  145. package/dist/schemas/notification.js +4 -0
  146. package/dist/schemas/notification.js.map +1 -1
  147. package/dist/schemas/order.d.ts +4 -0
  148. package/dist/schemas/order.js +4 -0
  149. package/dist/schemas/order.js.map +1 -1
  150. package/dist/schemas/organization.d.ts +45 -13
  151. package/dist/schemas/organization.js +46 -10
  152. package/dist/schemas/organization.js.map +1 -1
  153. package/dist/schemas/payment.d.ts +4 -0
  154. package/dist/schemas/payment.js +4 -0
  155. package/dist/schemas/payment.js.map +1 -1
  156. package/dist/schemas/policy.d.ts +4 -0
  157. package/dist/schemas/policy.js +4 -0
  158. package/dist/schemas/policy.js.map +1 -1
  159. package/dist/schemas/product.d.ts +4 -0
  160. package/dist/schemas/product.js +4 -0
  161. package/dist/schemas/product.js.map +1 -1
  162. package/dist/schemas/property.d.ts +13 -11
  163. package/dist/schemas/property.js +13 -11
  164. package/dist/schemas/property.js.map +1 -1
  165. package/dist/schemas/reservation.d.ts +4 -0
  166. package/dist/schemas/reservation.js +4 -0
  167. package/dist/schemas/reservation.js.map +1 -1
  168. package/dist/schemas/shortLink.d.ts +4 -0
  169. package/dist/schemas/shortLink.js +4 -0
  170. package/dist/schemas/shortLink.js.map +1 -1
  171. package/dist/schemas/smsMessage.d.ts +4 -0
  172. package/dist/schemas/smsMessage.js +4 -0
  173. package/dist/schemas/smsMessage.js.map +1 -1
  174. package/dist/schemas/space.d.ts +4 -0
  175. package/dist/schemas/space.js +4 -0
  176. package/dist/schemas/space.js.map +1 -1
  177. package/dist/schemas/switch.d.ts +14 -0
  178. package/dist/schemas/switch.js +24 -10
  179. package/dist/schemas/switch.js.map +1 -1
  180. package/dist/schemas/thermostat.d.ts +4 -0
  181. package/dist/schemas/thermostat.js +4 -0
  182. package/dist/schemas/thermostat.js.map +1 -1
  183. package/dist/schemas/ticket.d.ts +4 -0
  184. package/dist/schemas/ticket.js +4 -0
  185. package/dist/schemas/ticket.js.map +1 -1
  186. package/dist/schemas/timeSheet.d.ts +4 -0
  187. package/dist/schemas/timeSheet.js +4 -0
  188. package/dist/schemas/timeSheet.js.map +1 -1
  189. package/dist/schemas/user.d.ts +0 -3
  190. package/dist/schemas/user.js +0 -3
  191. package/dist/schemas/user.js.map +1 -1
  192. package/dist/schemas/vendor.d.ts +12 -0
  193. package/dist/schemas/vendor.js +12 -0
  194. package/dist/schemas/vendor.js.map +1 -1
  195. package/dist/schemas/windowCovering.d.ts +4 -0
  196. package/dist/schemas/windowCovering.js +4 -0
  197. package/dist/schemas/windowCovering.js.map +1 -1
  198. package/dist/useCases/createApiKey.d.ts +38 -0
  199. package/dist/useCases/{sendSMS.js → createApiKey.js} +9 -9
  200. package/dist/useCases/createApiKey.js.map +1 -0
  201. package/dist/useCases/{describeIntegration.d.ts → getApiKey.d.ts} +10 -10
  202. package/dist/useCases/{listAnnouncements.js → getApiKey.js} +9 -9
  203. package/dist/useCases/getApiKey.js.map +1 -0
  204. package/dist/useCases/index.d.ts +6 -10
  205. package/dist/useCases/index.js +12 -20
  206. package/dist/useCases/index.js.map +1 -1
  207. package/dist/useCases/{deleteAnnouncement.d.ts → revokeApiKey.d.ts} +10 -10
  208. package/dist/useCases/{deleteAnnouncement.js → revokeApiKey.js} +9 -9
  209. package/dist/useCases/revokeApiKey.js.map +1 -0
  210. package/dist/useCases/{updateAnnouncement.d.ts → rotateApiKey.d.ts} +10 -10
  211. package/dist/useCases/{updateIntegration.js → rotateApiKey.js} +9 -9
  212. package/dist/useCases/rotateApiKey.js.map +1 -0
  213. package/dist/useCases/{updateIntegration.d.ts → updateOrganizationFeatures.d.ts} +6 -6
  214. package/dist/useCases/{updateAnnouncement.js → updateOrganizationFeatures.js} +8 -8
  215. package/dist/useCases/updateOrganizationFeatures.js.map +1 -0
  216. package/dist/useCases/{updatePropertySettings.d.ts → updatePropertyFeatures.d.ts} +6 -6
  217. package/dist/useCases/{updatePropertySettings.js → updatePropertyFeatures.js} +8 -8
  218. package/dist/useCases/{updatePropertySettings.js.map → updatePropertyFeatures.js.map} +1 -1
  219. package/dist/validate.d.ts +6 -6
  220. package/package.json +26 -18
  221. package/dist/useCases/createAnnouncement.d.ts +0 -29
  222. package/dist/useCases/createAnnouncement.js +0 -50
  223. package/dist/useCases/createAnnouncement.js.map +0 -1
  224. package/dist/useCases/createIntegration.d.ts +0 -29
  225. package/dist/useCases/createIntegration.js +0 -50
  226. package/dist/useCases/createIntegration.js.map +0 -1
  227. package/dist/useCases/deleteAnnouncement.js.map +0 -1
  228. package/dist/useCases/describeAnnouncement.d.ts +0 -38
  229. package/dist/useCases/describeAnnouncement.js +0 -50
  230. package/dist/useCases/describeAnnouncement.js.map +0 -1
  231. package/dist/useCases/describeIntegration.js +0 -50
  232. package/dist/useCases/describeIntegration.js.map +0 -1
  233. package/dist/useCases/listAnnouncements.d.ts +0 -29
  234. package/dist/useCases/listAnnouncements.js.map +0 -1
  235. package/dist/useCases/sendSMS.d.ts +0 -29
  236. package/dist/useCases/sendSMS.js.map +0 -1
  237. package/dist/useCases/updateAnnouncement.js.map +0 -1
  238. package/dist/useCases/updateIntegration.js.map +0 -1
@@ -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 autoAssign: {
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 userId: {
39
+ readonly category: {
38
40
  readonly type: "string";
39
- readonly description: "The user ID to assign tickets with this issue to.";
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 vendorId: {
42
- readonly type: "string";
43
- readonly description: "The vendor ID to assign tickets with this issue to.";
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 priority: {
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 notify: {
58
- readonly type: "array";
59
- readonly description: "A list of entities to notify when this issue is triggered.";
60
- readonly default: readonly [];
61
- readonly items: {
62
- readonly type: "object";
63
- readonly required: readonly ["id", "discriminator"];
64
- readonly additionalProperties: false;
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 id: {
67
- readonly type: "string";
68
- readonly description: "The ID of the entity to notify.";
69
- };
70
- readonly discriminator: {
71
- readonly type: "string";
72
- readonly enum: readonly ["user"];
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
  };
@@ -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
- autoAssign: {
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
- userId: {
94
+ category: {
33
95
  type: "string",
34
- description: "The user ID to assign tickets with this issue to."
96
+ enum: SYSTEM_CATEGORIES,
97
+ description: "Canonical System Category slug. Derived from (device.type, device.discriminator) at notification time."
35
98
  },
36
- vendorId: {
37
- type: "string",
38
- description: "The vendor ID to assign tickets with this issue to."
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
- tags: {
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
- notify: {
53
- type: "array",
54
- description: "A list of entities to notify when this issue is triggered.",
55
- default: [],
56
- items: {
57
- type: "object",
58
- required: ["id", "discriminator"],
59
- additionalProperties: false,
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
- id: {
62
- type: "string",
63
- description: "The ID of the entity to notify."
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 type { FromSchema } from \"json-schema-to-ts\";\nimport { ticketSchema } from \"./ticket\";\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.\",\n },\n autoAssign: {\n type: \"object\",\n additionalProperties: false,\n properties: {\n userId: {\n type: \"string\",\n description: \"The user ID to assign tickets with this issue to.\",\n },\n vendorId: {\n type: \"string\",\n description: \"The vendor ID to assign tickets with this issue to.\",\n },\n priority: {\n $ref: \"ticket.json#/properties/priority\",\n description: \"The priority to assign tickets with this issue to.\",\n },\n tags: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n },\n },\n notify: {\n type: \"array\",\n description: \"A list of entities to notify when this issue is triggered.\",\n default: [],\n items: {\n type: \"object\",\n required: [\"id\", \"discriminator\"],\n additionalProperties: false,\n properties: {\n id: {\n type: \"string\",\n description: \"The ID of the entity to notify.\",\n },\n discriminator: {\n type: \"string\",\n enum: [\"user\"],\n },\n },\n },\n },\n systemKey: {\n type: \"string\",\n },\n autoCreateTicket: {\n type: \"boolean\",\n default: true,\n },\n excludedResources: {\n type: \"array\",\n description:\n \"A list of resources that should not trigger notifications of this issue\",\n items: {\n type: \"string\",\n },\n default: [],\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":"AAIO,MAAM,cAAc;AAAA,EACzB,SAAS;AAAA,EACT,KAAK;AAAA,EACL,OAAO;AAAA,EACP,aAAa;AAAA,EACb,MAAM;AAAA,EACN,UAAU,CAAC,MAAM,QAAQ,MAAM;AAAA,EAC/B,sBAAsB;AAAA,EACtB,YAAY;AAAA,IACV,IAAI;AAAA,MACF,MAAM;AAAA,IACR;AAAA,IACA,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,MAAM,CAAC,OAAO;AAAA,MACd,SAAS;AAAA,IACX;AAAA,IACA,MAAM;AAAA,MACJ,MAAM;AAAA,IACR;AAAA,IACA,aAAa;AAAA,MACX,MAAM;AAAA,IACR;AAAA,IACA,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,aACE;AAAA,IACJ;AAAA,IACA,YAAY;AAAA,MACV,MAAM;AAAA,MACN,sBAAsB;AAAA,MACtB,YAAY;AAAA,QACV,QAAQ;AAAA,UACN,MAAM;AAAA,UACN,aAAa;AAAA,QACf;AAAA,QACA,UAAU;AAAA,UACR,MAAM;AAAA,UACN,aAAa;AAAA,QACf;AAAA,QACA,UAAU;AAAA,UACR,MAAM;AAAA,UACN,aAAa;AAAA,QACf;AAAA,QACA,MAAM;AAAA,UACJ,MAAM;AAAA,UACN,OAAO;AAAA,YACL,MAAM;AAAA,UACR;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,IACA,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,aAAa;AAAA,MACb,SAAS,CAAC;AAAA,MACV,OAAO;AAAA,QACL,MAAM;AAAA,QACN,UAAU,CAAC,MAAM,eAAe;AAAA,QAChC,sBAAsB;AAAA,QACtB,YAAY;AAAA,UACV,IAAI;AAAA,YACF,MAAM;AAAA,YACN,aAAa;AAAA,UACf;AAAA,UACA,eAAe;AAAA,YACb,MAAM;AAAA,YACN,MAAM,CAAC,MAAM;AAAA,UACf;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,IACA,WAAW;AAAA,MACT,MAAM;AAAA,IACR;AAAA,IACA,kBAAkB;AAAA,MAChB,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IACA,mBAAmB;AAAA,MACjB,MAAM;AAAA,MACN,aACE;AAAA,MACF,OAAO;AAAA,QACL,MAAM;AAAA,MACR;AAAA,MACA,SAAS,CAAC;AAAA,IACZ;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":[]}
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;AAEA,MAAM,wBAAwB;AAAA,EAC5B,MAAM;AAAA,EACN,sBAAsB;AAAA,EACtB,YAAY;AAAA,IACV,YAAY;AAAA,MACV,MAAM,CAAC,UAAU,MAAM;AAAA,MACvB,sBAAsB;AAAA,MACtB,UAAU,CAAC,MAAM,eAAe;AAAA,MAChC,YAAY;AAAA,QACV,IAAI;AAAA,UACF,MAAM;AAAA,QACR;AAAA,QACA,eAAe;AAAA,UACb,MAAM;AAAA,UACN,MAAM,CAAC,QAAQ,QAAQ;AAAA,QACzB;AAAA,MACF;AAAA,IACF;AAAA,IACA,UAAU;AAAA,MACR,MAAM;AAAA,IACR;AAAA,IACA,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,QACL,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,QACL,MAAM;AAAA,QACN,UAAU,CAAC,MAAM,eAAe;AAAA,QAChC,sBAAsB;AAAA,QACtB,YAAY;AAAA,UACV,IAAI;AAAA,YACF,MAAM;AAAA,UACR;AAAA,UACA,eAAe;AAAA,YACb,MAAM;AAAA,YACN,MAAM,CAAC,MAAM;AAAA,UACf;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEA,MAAM,gCAAgC;AAAA,EACpC,OAAO,CAAC,uBAAuB,EAAE,MAAM,OAAO,CAAC;AACjD;AAEO,MAAM,cAAc;AAAA,EACzB,SAAS;AAAA,EACT,KAAK;AAAA,EACL,OAAO;AAAA,EACP,aAAa;AAAA,EACb,MAAM;AAAA,EACN,UAAU,CAAC,MAAM,QAAQ,MAAM;AAAA,EAC/B,sBAAsB;AAAA,EACtB,YAAY;AAAA,IACV,IAAI;AAAA,MACF,MAAM;AAAA,IACR;AAAA,IACA,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,MAAM,CAAC,OAAO;AAAA,MACd,SAAS;AAAA,IACX;AAAA,IACA,MAAM;AAAA,MACJ,MAAM;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":[]}
@@ -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
  };
@@ -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
  },
@@ -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,MAAM;AAAA,IACR;AAAA,IACA,YAAY;AAAA,MACV,MAAM;AAAA,MACN,aAAa;AAAA,IACf;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":[]}
@@ -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
  };
@@ -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
  },
@@ -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,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,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,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":[]}
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;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,YAAY;AAAA,MACV,MAAM;AAAA,MACN,aAAa;AAAA,IACf;AAAA,IACA,QAAQ;AAAA,MACN,MAAM;AAAA,IACR;AAAA,IACA,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,aAAa;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,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,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,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":[]}
@@ -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",