@trakit/objects 0.0.15 → 0.0.16

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 (222) hide show
  1. package/Accounts/User.d.ts +25 -4
  2. package/Assets/Asset.d.ts +1 -3
  3. package/Companies/Company.d.ts +1 -20
  4. package/Providers/Provider.d.ts +1 -12
  5. package/README.md +24 -24
  6. package/index.d.ts +1 -1
  7. package/objects/API/Arrays.d.ts +46 -0
  8. package/objects/API/Base.d.ts +19 -0
  9. package/objects/API/BaseComponent.d.ts +40 -0
  10. package/objects/API/BaseCompound.d.ts +19 -0
  11. package/objects/API/Codifier.d.ts +15 -0
  12. package/objects/API/Constants.d.ts +39 -0
  13. package/objects/API/Conversion.d.ts +255 -0
  14. package/objects/API/Encoding.d.ts +9 -0
  15. package/objects/API/Files.d.ts +21 -0
  16. package/objects/API/Functions.d.ts +196 -0
  17. package/objects/API/Geography/Functions.d.ts +236 -0
  18. package/objects/API/Geography/Interfaces.d.ts +150 -0
  19. package/objects/API/Geography/LatLng.d.ts +86 -0
  20. package/objects/API/Geography/LatLngBounds.d.ts +146 -0
  21. package/objects/API/Geography/Position.d.ts +74 -0
  22. package/objects/API/Geography/StreetAddress.d.ts +59 -0
  23. package/objects/API/Geometry/Functions.d.ts +114 -0
  24. package/objects/API/Geometry/Interfaces.d.ts +111 -0
  25. package/objects/API/Geometry/Point.d.ts +81 -0
  26. package/objects/API/Geometry/Radial.d.ts +110 -0
  27. package/objects/API/Geometry/Rectangle.d.ts +159 -0
  28. package/objects/API/Geometry/Size.d.ts +58 -0
  29. package/objects/API/Guid.d.ts +4 -0
  30. package/objects/API/Interfaces/IAmCompany.d.ts +11 -0
  31. package/objects/API/Interfaces/IBelongAsset.d.ts +15 -0
  32. package/objects/API/Interfaces/IBelongBillingProfile.d.ts +15 -0
  33. package/objects/API/Interfaces/IBelongCompany.d.ts +15 -0
  34. package/objects/API/Interfaces/IDeserializable.d.ts +13 -0
  35. package/objects/API/Interfaces/IEnabled.d.ts +10 -0
  36. package/objects/API/Interfaces/IFileSize.d.ts +9 -0
  37. package/objects/API/Interfaces/IGlobal.d.ts +11 -0
  38. package/objects/API/Interfaces/IHavePermissions.d.ts +20 -0
  39. package/objects/API/Interfaces/IHavePreferences.d.ts +29 -0
  40. package/objects/API/Interfaces/IIconic.d.ts +15 -0
  41. package/objects/API/Interfaces/IIdUlong.d.ts +10 -0
  42. package/objects/API/Interfaces/ILabelled.d.ts +10 -0
  43. package/objects/API/Interfaces/INamed.d.ts +13 -0
  44. package/objects/API/Interfaces/IPictured.d.ts +15 -0
  45. package/objects/API/Interfaces/IRequestable.d.ts +22 -0
  46. package/objects/API/Interfaces/ISerializable.d.ts +10 -0
  47. package/objects/API/Interfaces/ISuspendable.d.ts +16 -0
  48. package/objects/API/Interfaces/IVisual.d.ts +18 -0
  49. package/objects/API/Maps.d.ts +28 -0
  50. package/objects/API/Objects.d.ts +5 -0
  51. package/objects/API/SearchPattern.d.ts +46 -0
  52. package/objects/API/TimeSpan.d.ts +109 -0
  53. package/objects/API/Timezone.d.ts +44 -0
  54. package/objects/API/Timezones.d.ts +7 -0
  55. package/objects/API/Types.d.ts +132 -0
  56. package/objects/Accounts/Contact.d.ts +139 -0
  57. package/objects/Accounts/Machine.d.ts +139 -0
  58. package/objects/Accounts/MultiFactorType.d.ts +17 -0
  59. package/objects/Accounts/NotificationMethod.d.ts +17 -0
  60. package/objects/Accounts/Permissions/Authorizer.d.ts +204 -0
  61. package/objects/Accounts/Permissions/Permission.d.ts +56 -0
  62. package/objects/Accounts/Permissions/PermissionEscalation.d.ts +41 -0
  63. package/objects/Accounts/Permissions/PermissionEscalationState.d.ts +19 -0
  64. package/objects/Accounts/Permissions/PermissionEscalationType.d.ts +13 -0
  65. package/objects/Accounts/Permissions/PermissionLevel.d.ts +17 -0
  66. package/objects/Accounts/Permissions/PermissionMethod.d.ts +13 -0
  67. package/objects/Accounts/Permissions/PermissionType.d.ts +280 -0
  68. package/objects/Accounts/SSOIdentityProvider.d.ts +25 -0
  69. package/objects/Accounts/Session.d.ts +89 -0
  70. package/objects/Accounts/SessionStatus.d.ts +29 -0
  71. package/objects/Accounts/SystemsOfUnits.d.ts +13 -0
  72. package/objects/Accounts/User.d.ts +167 -0
  73. package/objects/Accounts/UserAdvanced.d.ts +53 -0
  74. package/objects/Accounts/UserAuthentication.d.ts +55 -0
  75. package/objects/Accounts/UserGeneral.d.ts +98 -0
  76. package/objects/Accounts/UserGroup.d.ts +51 -0
  77. package/objects/Accounts/UserMFA.d.ts +47 -0
  78. package/objects/Accounts/UserNotifications.d.ts +76 -0
  79. package/objects/Accounts/UserSSO.d.ts +37 -0
  80. package/objects/Assets/Asset.d.ts +218 -0
  81. package/objects/Assets/AssetAdvanced.d.ts +77 -0
  82. package/objects/Assets/AssetAttribute.d.ts +71 -0
  83. package/objects/Assets/AssetDispatch.d.ts +55 -0
  84. package/objects/Assets/AssetGeneral.d.ts +127 -0
  85. package/objects/Assets/AssetPlaceStatus.d.ts +31 -0
  86. package/objects/Assets/AssetPlaceStatusType.d.ts +17 -0
  87. package/objects/Assets/AssetType.d.ts +21 -0
  88. package/objects/Behaviours/Behaviour.d.ts +78 -0
  89. package/objects/Behaviours/BehaviourLog.d.ts +95 -0
  90. package/objects/Behaviours/BehaviourLogType.d.ts +21 -0
  91. package/objects/Behaviours/BehaviourParameter.d.ts +38 -0
  92. package/objects/Behaviours/BehaviourParameterType.d.ts +21 -0
  93. package/objects/Behaviours/BehaviourScript.d.ts +83 -0
  94. package/objects/Billing/BillableBase.d.ts +83 -0
  95. package/objects/Billing/BillableSmsProfile.d.ts +26 -0
  96. package/objects/Billing/BillingCurrency.d.ts +17 -0
  97. package/objects/Billing/BillingCycle.d.ts +17 -0
  98. package/objects/Billing/BillingProfile.d.ts +104 -0
  99. package/objects/Billing/Hosting/BillableHostingBase.d.ts +41 -0
  100. package/objects/Billing/Hosting/BillableHostingLicense.d.ts +30 -0
  101. package/objects/Billing/Hosting/BillableHostingLicenseType.d.ts +20 -0
  102. package/objects/Billing/Hosting/BillableHostingRule.d.ts +30 -0
  103. package/objects/Billing/Hosting/BillableHostingType.d.ts +41 -0
  104. package/objects/Billing/Report/BillingReport.d.ts +112 -0
  105. package/objects/Billing/Report/BillingReportBreakdown.d.ts +34 -0
  106. package/objects/Billing/Report/BillingReportHostingSummary.d.ts +36 -0
  107. package/objects/Billing/Report/BillingReportLicenseBreakdown.d.ts +79 -0
  108. package/objects/Billing/Report/BillingReportServiceBreakdown.d.ts +124 -0
  109. package/objects/Billing/Report/BillingReportStatus.d.ts +25 -0
  110. package/objects/Billing/Report/BillingReportSummary.d.ts +49 -0
  111. package/objects/Companies/ColourStyle.d.ts +25 -0
  112. package/objects/Companies/Company.d.ts +167 -0
  113. package/objects/Companies/CompanyDirectory.d.ts +52 -0
  114. package/objects/Companies/CompanyGeneral.d.ts +55 -0
  115. package/objects/Companies/CompanyPolicy.d.ts +66 -0
  116. package/objects/Companies/CompanyReseller.d.ts +166 -0
  117. package/objects/Companies/CompanyStyle.d.ts +50 -0
  118. package/objects/Companies/LabelStyle.d.ts +46 -0
  119. package/objects/Companies/NotificationServerEmail.d.ts +99 -0
  120. package/objects/Companies/NotificationServerSms.d.ts +25 -0
  121. package/objects/Companies/PasswordExpiryMode.d.ts +17 -0
  122. package/objects/Companies/PasswordPolicy.d.ts +51 -0
  123. package/objects/Companies/SessionMultiUser.d.ts +17 -0
  124. package/objects/Companies/SessionPolicy.d.ts +47 -0
  125. package/objects/Dispatch/DispatchDirection.d.ts +53 -0
  126. package/objects/Dispatch/DispatchJob.d.ts +107 -0
  127. package/objects/Dispatch/DispatchJobPriority.d.ts +25 -0
  128. package/objects/Dispatch/DispatchStep.d.ts +99 -0
  129. package/objects/Dispatch/DispatchStepState.d.ts +27 -0
  130. package/objects/Dispatch/DispatchStepStatus.d.ts +21 -0
  131. package/objects/Dispatch/DispatchTask.d.ts +154 -0
  132. package/objects/Dispatch/DispatchTaskStatus.d.ts +50 -0
  133. package/objects/Hosting/Document.d.ts +70 -0
  134. package/objects/Hosting/Fields/FormFieldAttachments.d.ts +31 -0
  135. package/objects/Hosting/Fields/FormFieldBase.d.ts +56 -0
  136. package/objects/Hosting/Fields/FormFieldBase_fromJSON.d.ts +1 -0
  137. package/objects/Hosting/Fields/FormFieldBoolean.d.ts +38 -0
  138. package/objects/Hosting/Fields/FormFieldChoice.d.ts +46 -0
  139. package/objects/Hosting/Fields/FormFieldDate.d.ts +26 -0
  140. package/objects/Hosting/Fields/FormFieldNumeric.d.ts +54 -0
  141. package/objects/Hosting/Fields/FormFieldNumericSize.d.ts +32 -0
  142. package/objects/Hosting/Fields/FormFieldSignature.d.ts +17 -0
  143. package/objects/Hosting/Fields/FormFieldText.d.ts +32 -0
  144. package/objects/Hosting/Fields/FormFieldTime.d.ts +37 -0
  145. package/objects/Hosting/Fields/FormFieldTimezone.d.ts +14 -0
  146. package/objects/Hosting/FormFieldType.d.ts +127 -0
  147. package/objects/Hosting/FormResult.d.ts +95 -0
  148. package/objects/Hosting/FormTemplate.d.ts +80 -0
  149. package/objects/Images/Dashcam.d.ts +63 -0
  150. package/objects/Images/DashcamBase.d.ts +97 -0
  151. package/objects/Images/DashcamLive.d.ts +36 -0
  152. package/objects/Images/DashcamMediaType.d.ts +17 -0
  153. package/objects/Images/Icon.d.ts +66 -0
  154. package/objects/Images/IconGlyph.d.ts +47 -0
  155. package/objects/Images/IconLabel.d.ts +29 -0
  156. package/objects/Images/IconLayer.d.ts +33 -0
  157. package/objects/Images/Picture.d.ts +72 -0
  158. package/objects/Maintenance/MaintenanceInterval.d.ts +48 -0
  159. package/objects/Maintenance/MaintenanceJob.d.ts +134 -0
  160. package/objects/Maintenance/MaintenanceJobStatus.d.ts +21 -0
  161. package/objects/Maintenance/MaintenanceSchedule.d.ts +118 -0
  162. package/objects/Messaging/AlertPriority.d.ts +17 -0
  163. package/objects/Messaging/AssetAlert.d.ts +29 -0
  164. package/objects/Messaging/AssetMessage.d.ts +40 -0
  165. package/objects/Messaging/MessageBase.d.ts +99 -0
  166. package/objects/Messaging/MessageFolder.d.ts +13 -0
  167. package/objects/Messaging/MessageStatus.d.ts +29 -0
  168. package/objects/Messaging/MessageType.d.ts +33 -0
  169. package/objects/Places/Place.d.ts +114 -0
  170. package/objects/Places/PlaceType.d.ts +25 -0
  171. package/objects/Providers/Config/ProviderConfig.d.ts +70 -0
  172. package/objects/Providers/Config/ProviderRegistration.d.ts +119 -0
  173. package/objects/Providers/Config/ProviderScript.d.ts +86 -0
  174. package/objects/Providers/Config/ProviderScriptBlock.d.ts +41 -0
  175. package/objects/Providers/Config/ProviderScriptParameter.d.ts +49 -0
  176. package/objects/Providers/Config/ProviderScriptParameterType.d.ts +17 -0
  177. package/objects/Providers/Configuration/ProviderConfiguration.d.ts +66 -0
  178. package/objects/Providers/Configuration/ProviderConfigurationNode.d.ts +66 -0
  179. package/objects/Providers/Configuration/ProviderConfigurationType.d.ts +62 -0
  180. package/objects/Providers/Configuration/ProviderGeofenceBase.d.ts +29 -0
  181. package/objects/Providers/Configuration/ProviderGeofenceBase_fromJSON.d.ts +1 -0
  182. package/objects/Providers/Configuration/ProviderGeofenceCircular.d.ts +28 -0
  183. package/objects/Providers/Configuration/ProviderGeofencePoint.d.ts +12 -0
  184. package/objects/Providers/Configuration/ProviderGeofencePolygon.d.ts +23 -0
  185. package/objects/Providers/Configuration/ProviderGeofenceRectangle.d.ts +28 -0
  186. package/objects/Providers/Provider.d.ts +205 -0
  187. package/objects/Providers/ProviderAdvanced.d.ts +50 -0
  188. package/objects/Providers/ProviderCommand.d.ts +36 -0
  189. package/objects/Providers/ProviderCommandStatus.d.ts +29 -0
  190. package/objects/Providers/ProviderCommandType.d.ts +37 -0
  191. package/objects/Providers/ProviderControl.d.ts +41 -0
  192. package/objects/Providers/ProviderData.d.ts +30 -0
  193. package/objects/Providers/ProviderGeneral.d.ts +121 -0
  194. package/objects/Providers/ProviderType.d.ts +106 -0
  195. package/objects/Reports/ReportBreakdown.d.ts +49 -0
  196. package/objects/Reports/ReportBreakdownJob.d.ts +37 -0
  197. package/objects/Reports/ReportBreakdownMessage.d.ts +40 -0
  198. package/objects/Reports/ReportBreakdownTask.d.ts +46 -0
  199. package/objects/Reports/ReportBreakdown_fromJSON.d.ts +1 -0
  200. package/objects/Reports/ReportFilterMode.d.ts +17 -0
  201. package/objects/Reports/ReportNotifications.d.ts +31 -0
  202. package/objects/Reports/ReportOptions.d.ts +52 -0
  203. package/objects/Reports/ReportParameter.d.ts +26 -0
  204. package/objects/Reports/ReportParameterType.d.ts +59 -0
  205. package/objects/Reports/ReportRecurrence.d.ts +54 -0
  206. package/objects/Reports/ReportRecurrenceType.d.ts +34 -0
  207. package/objects/Reports/ReportResult.d.ts +169 -0
  208. package/objects/Reports/ReportResultData.d.ts +17 -0
  209. package/objects/Reports/ReportSchedule.d.ts +111 -0
  210. package/objects/Reports/ReportScorecard.d.ts +38 -0
  211. package/objects/Reports/ReportScorecardParameter.d.ts +31 -0
  212. package/objects/Reports/ReportScorecardRules.d.ts +26 -0
  213. package/objects/Reports/ReportStatus.d.ts +29 -0
  214. package/objects/Reports/ReportSummary.d.ts +90 -0
  215. package/objects/Reports/ReportSummaryReason.d.ts +27 -0
  216. package/objects/Reports/ReportTemplate.d.ts +81 -0
  217. package/objects/Reports/ReportTotal.d.ts +47 -0
  218. package/objects/Reports/ReportType.d.ts +42 -0
  219. package/objects/index.d.ts +406 -0
  220. package/objects/storage.d.ts +176 -0
  221. package/package.json +36 -36
  222. package/trakit-objects.min.js +2 -2
@@ -21,6 +21,7 @@ import { UserSSO } from "./UserSSO";
21
21
  * A grouping of credentials, information, preferences, and permissions for a person or machine to login to the system and access its resources.
22
22
  */
23
23
  export declare class User extends BaseCompound implements IEnabled, IBelongCompany, IHavePermissions, IHavePreferences {
24
+ #private;
24
25
  /**
25
26
  *
26
27
  */
@@ -39,7 +40,6 @@ export declare class User extends BaseCompound implements IEnabled, IBelongCompa
39
40
  * The {@link Company} to which this user belongs.
40
41
  */
41
42
  get company(): Company;
42
- protected _general: UserGeneral;
43
43
  /**
44
44
  *
45
45
  */
@@ -96,7 +96,6 @@ export declare class User extends BaseCompound implements IEnabled, IBelongCompa
96
96
  */
97
97
  get notify(): UserNotifications[];
98
98
  set notify(value: UserNotifications[]);
99
- protected _advanced: UserAdvanced;
100
99
  /**
101
100
  *
102
101
  */
@@ -117,7 +116,6 @@ export declare class User extends BaseCompound implements IEnabled, IBelongCompa
117
116
  */
118
117
  get permissions(): Permission[];
119
118
  set permissions(value: Permission[]);
120
- protected _authentication: UserAuthentication;
121
119
  /**
122
120
  *
123
121
  */
@@ -138,7 +136,30 @@ export declare class User extends BaseCompound implements IEnabled, IBelongCompa
138
136
  get sso(): UserSSO;
139
137
  set sso(value: UserSSO);
140
138
  constructor(json?: JsonObject | nothing);
141
- toJSON(): any;
139
+ toJSON(): {
140
+ v: number[];
141
+ login: string;
142
+ company: number;
143
+ passwordExpired: boolean;
144
+ mfa: any[];
145
+ sso: {
146
+ enabled: boolean;
147
+ provider: import("./SSOIdentityProvider").SSOIdentityProvider;
148
+ lastAuthentication: string | null;
149
+ externalId: string | null;
150
+ };
151
+ groups: number[];
152
+ permissions: any[];
153
+ nickname: string;
154
+ enabled: boolean;
155
+ contact: boolean;
156
+ timezone: string;
157
+ language: string;
158
+ formats: JsonObject;
159
+ measurements: JsonObject;
160
+ options: JsonObject;
161
+ notify: any[];
162
+ };
142
163
  fromJSON(json: JsonObject, force?: boolean): boolean;
143
164
  /**
144
165
  * The {@link login} is the key.
package/Assets/Asset.d.ts CHANGED
@@ -24,6 +24,7 @@ import { AssetType } from "./AssetType";
24
24
  * The full details of an Asset, containing all the properties from the {@link AssetGeneral} and {@link AssetAdvanced} objects.
25
25
  */
26
26
  export declare class Asset extends BaseCompound implements IIdUlong, INamed, IIconic, IBelongCompany, ILabelled, IPictured, ISuspendable {
27
+ #private;
27
28
  /**
28
29
  *
29
30
  */
@@ -45,7 +46,6 @@ export declare class Asset extends BaseCompound implements IIdUlong, INamed, IIc
45
46
  * Type of asset.
46
47
  */
47
48
  get kind(): AssetType;
48
- protected _general: AssetGeneral;
49
49
  /**
50
50
  *
51
51
  */
@@ -143,7 +143,6 @@ export declare class Asset extends BaseCompound implements IIdUlong, INamed, IIc
143
143
  */
144
144
  get serial(): string;
145
145
  set serial(value: string);
146
- protected _advanced: AssetAdvanced;
147
146
  /**
148
147
  *
149
148
  */
@@ -198,7 +197,6 @@ export declare class Asset extends BaseCompound implements IIdUlong, INamed, IIc
198
197
  */
199
198
  get engineHours(): double;
200
199
  set engineHours(value: double);
201
- protected _dispatch: AssetDispatch;
202
200
  /**
203
201
  *
204
202
  */
@@ -7,11 +7,7 @@ import { IIdUlong } from '../API/Interfaces/IIdUlong';
7
7
  import { INamed } from '../API/Interfaces/INamed';
8
8
  import { JsonObject, codified, nothing, ulong } from '../API/Types';
9
9
  import { Picture } from '../Images/Picture';
10
- import { CompanyDirectory } from './CompanyDirectory';
11
- import { CompanyGeneral } from './CompanyGeneral';
12
- import { CompanyPolicy } from './CompanyPolicy';
13
10
  import { CompanyReseller } from './CompanyReseller';
14
- import { CompanyStyle } from './CompanyStyle';
15
11
  import { LabelStyle } from './LabelStyle';
16
12
  import { PasswordPolicy } from './PasswordPolicy';
17
13
  import { SessionPolicy } from './SessionPolicy';
@@ -19,6 +15,7 @@ import { SessionPolicy } from './SessionPolicy';
19
15
  * The full company object which contains all fields.
20
16
  */
21
17
  export declare class Company extends BaseCompound implements IIdUlong, INamed, IAmCompany, IBelongCompany {
18
+ #private;
22
19
  /**
23
20
  *
24
21
  */
@@ -38,10 +35,6 @@ export declare class Company extends BaseCompound implements IIdUlong, INamed, I
38
35
  */
39
36
  get parentId(): number;
40
37
  set parentId(value: number);
41
- /**
42
- *
43
- */
44
- protected _general: CompanyGeneral;
45
38
  /**
46
39
  * The organizational name.
47
40
  */
@@ -57,19 +50,11 @@ export declare class Company extends BaseCompound implements IIdUlong, INamed, I
57
50
  */
58
51
  get references(): Map<string, string>;
59
52
  set references(value: Map<string, string>);
60
- /**
61
- *
62
- */
63
- protected _directory: CompanyDirectory;
64
53
  /**
65
54
  * The list of Contacts from this and other companies broken down by contact role.
66
55
  */
67
56
  get employees(): Map<string, ulong[]>;
68
57
  set employees(value: Map<string, ulong[]>);
69
- /**
70
- *
71
- */
72
- protected _policy: CompanyPolicy;
73
58
  /**
74
59
  * The session lifetime policy.
75
60
  */
@@ -80,10 +65,6 @@ export declare class Company extends BaseCompound implements IIdUlong, INamed, I
80
65
  */
81
66
  get passwordPolicy(): PasswordPolicy;
82
67
  set passwordPolicy(value: PasswordPolicy);
83
- /**
84
- *
85
- */
86
- protected _style: CompanyStyle;
87
68
  /**
88
69
  * The styles for labels added to Assets, Places, and other things.
89
70
  */
@@ -19,6 +19,7 @@ import { ProviderType } from "./ProviderType";
19
19
  * A device, modem, or service which provides events from the field.
20
20
  */
21
21
  export declare class Provider extends BaseCompound implements INamed, IBelongCompany, ISuspendable {
22
+ #private;
22
23
  /**
23
24
  *
24
25
  */
@@ -40,10 +41,6 @@ export declare class Provider extends BaseCompound implements INamed, IBelongCom
40
41
  * The kind of communication protocol this device uses.
41
42
  */
42
43
  get kind(): ProviderType;
43
- /**
44
- *
45
- */
46
- protected _general: ProviderGeneral;
47
44
  get general(): ProviderGeneral;
48
45
  /**
49
46
  * This thing's name.
@@ -103,10 +100,6 @@ export declare class Provider extends BaseCompound implements INamed, IBelongCom
103
100
  */
104
101
  get sim(): string;
105
102
  set sim(value: string);
106
- /**
107
- *
108
- */
109
- protected _advanced: ProviderAdvanced;
110
103
  get advanced(): ProviderAdvanced;
111
104
  /**
112
105
  * The last IP address of the device.
@@ -123,10 +116,6 @@ export declare class Provider extends BaseCompound implements INamed, IBelongCom
123
116
  */
124
117
  get snf(): Map<string, string>;
125
118
  set snf(value: Map<string, string>);
126
- /**
127
- *
128
- */
129
- protected _control: ProviderControl;
130
119
  get control(): ProviderControl;
131
120
  /**
132
121
  * Collection of commands for this provider.
package/README.md CHANGED
@@ -1,24 +1,24 @@
1
- # Trak-iT API Object Model
2
-
3
- All of the Trak-iT APIs use the same object definitions.
4
- Other Trak-iT API libraries are available on [GitHub](https://github.com/trakitwireless) and [npm](https://www.npmjs.com/org/trakit).
5
-
6
- ### Prerequisites
7
-
8
- We do not require any other packages, however, we are targetting `ESNext`, so if your project uses CommonJS or another module manager, you will need to account for that yourself.
9
-
10
- ### Building
11
-
12
- In order to build this project, you need to install the RollupJS, and plugins for TypeScript and Minifying.
13
- ```
14
- npm i rollup rollup-plugin-typescript2 @rollup/plugin-terser
15
- ```
16
- After those have been installed, build the project normally.
17
- ```
18
- rollup --config rollup.config.js
19
- ```
20
-
21
- ## Questions and Feedback
22
-
23
- If you have any questions, please start for the project on GitHub
24
- https://github.com/trakitwireless/trakit-ts-objects/issues
1
+ # Trak-iT API Object Model
2
+
3
+ All of the Trak-iT APIs use the same object definitions.
4
+ Other Trak-iT API libraries are available on [GitHub](https://github.com/trakitwireless) and [npm](https://www.npmjs.com/org/trakit).
5
+
6
+ ### Prerequisites
7
+
8
+ We do not require any other packages, however, we are targetting `ESNext`, so if your project uses CommonJS or another module manager, you will need to account for that yourself.
9
+
10
+ ### Building
11
+
12
+ In order to build this project, you need to install the RollupJS, and plugins for TypeScript and Minifying.
13
+ ```
14
+ npm i rollup rollup-plugin-typescript2 @rollup/plugin-terser
15
+ ```
16
+ After those have been installed, build the project normally.
17
+ ```
18
+ rollup --config rollup.config.js
19
+ ```
20
+
21
+ ## Questions and Feedback
22
+
23
+ If you have any questions, please start for the project on GitHub
24
+ https://github.com/trakitwireless/trakit-ts-objects/issues
package/index.d.ts CHANGED
@@ -204,7 +204,7 @@ import { ReportType } from "./Reports/ReportType";
204
204
  /**
205
205
  * Version number for this release.
206
206
  */
207
- export declare const version = "0.0.15";
207
+ export declare const version = "0.0.16";
208
208
  /**
209
209
  * The names of all main object types in the Trak-iT Object Model.
210
210
  */
@@ -0,0 +1,46 @@
1
+ import { IIdUlong } from "./Interfaces/IIdUlong";
2
+ import { ISerializable } from "./Interfaces/ISerializable";
3
+ import { ulong } from "./Types";
4
+ /**
5
+ * Returns the unique values from an array.
6
+ * @template T
7
+ * @param array
8
+ */
9
+ export declare function ARRAY_UNIQUE<T>(array: T[]): T[];
10
+ /**
11
+ * Returns an array of only those elements that existed in both input arrays.
12
+ * @template T
13
+ * @param array1
14
+ * @param array2
15
+ */
16
+ export declare function ARRAY_INTERSECT<T>(array1: T[], array2: T[]): T[];
17
+ /**
18
+ * Returns an array of only those elements that existe in both array1, and not in array2.
19
+ * @template T
20
+ * @param array1
21
+ * @param array2
22
+ */
23
+ export declare function ARRAY_EXCEPT<T>(array1: T[], array2: T[]): T[];
24
+ /**
25
+ * Given as the first argument to {@link Array#map}, the {@link IIdUlong.id}s are returned.
26
+ * @param object
27
+ */
28
+ export declare function ARRAY_TO_IDS(object: IIdUlong): ulong;
29
+ /**
30
+ * Given as the first argument to {@link Array#map}, the {@link IIdUlong.id}s are returned.
31
+ * @param object
32
+ */
33
+ export declare function ARRAY_TO_JSON(object: ISerializable): any;
34
+ /**
35
+ *
36
+ * @param type
37
+ * @param array
38
+ */
39
+ export declare function ARRAY_TO_ENUMS<T>(type: any, array: string[]): T[];
40
+ /**
41
+ * Given as the first argument to {@link Array#filter} where the second argument is a {@link boolean[]}.
42
+ * @param this The array of booleans to use to filter the source array.
43
+ * @param object Unused.
44
+ * @param index The index of the obect in the source array.
45
+ */
46
+ export declare function FILTER_BY_BOOLEAN_ARRAY(this: boolean[], object: unknown, index: number): boolean;
@@ -0,0 +1,19 @@
1
+ import { IDeserializable } from './Interfaces/IDeserializable';
2
+ import { JsonObject, nothing } from './Types';
3
+ /**
4
+ * A base class used to construct objects from the sync system.
5
+ */
6
+ export declare abstract class Base implements IDeserializable {
7
+ /**
8
+ * Almost all objects can be constructed using a simple JSON object.
9
+ * @param json
10
+ */
11
+ constructor(json?: JsonObject | nothing);
12
+ /**
13
+ * Updates this class from the given input.
14
+ * @param json A JSON value used to update this class.
15
+ * @param forced When true, forces the update.
16
+ * @returns True when an update was completed.
17
+ */
18
+ abstract fromJSON(json: JsonObject, force?: boolean): boolean;
19
+ }
@@ -0,0 +1,40 @@
1
+ import { Base } from './Base';
2
+ import { IRequestable } from './Interfaces/IRequestable';
3
+ import { ISerializable } from './Interfaces/ISerializable';
4
+ import { email, guid, int, ulong } from './Types';
5
+ /**
6
+ * Any derived class can/should be serialized and given to a user.
7
+ */
8
+ export declare abstract class BaseComponent extends Base implements IRequestable, ISerializable {
9
+ /**
10
+ * Object version keys used to validate synchronization for all object properties.
11
+ */
12
+ private _version;
13
+ /**
14
+ * Object version keys used to validate synchronization for all object properties.
15
+ */
16
+ get v(): int[];
17
+ /**
18
+ *
19
+ * @param version
20
+ * @returns
21
+ */
22
+ protected updateVersion(version: int | int[]): boolean;
23
+ /**
24
+ *
25
+ * @param version
26
+ * @returns
27
+ */
28
+ protected updateVersions(versions?: int[]): boolean[];
29
+ /**
30
+ * Returns a value which can be used as a unique identifier for this object.
31
+ * Values are unique for each type of object, but can be identical for different object types.
32
+ * @returns A value unique for this type of object.
33
+ */
34
+ abstract getKey(): ulong | email | guid | string;
35
+ /**
36
+ * Creates a literal of this {@link BaseComponent}.
37
+ * Used internally by {@link JSON.stringify}.
38
+ */
39
+ abstract toJSON(): any;
40
+ }
@@ -0,0 +1,19 @@
1
+ import { BaseComponent } from './BaseComponent';
2
+ import { int } from './Types';
3
+ /**
4
+ * Some objects are made up of the pieces of many objects.
5
+ * {@link Asset}
6
+ * {@link Company}
7
+ * {@link Provider}
8
+ * {@link User}
9
+ */
10
+ export declare abstract class BaseCompound extends BaseComponent {
11
+ /**
12
+ * A list of individually subscribable objects that make up the compound object.
13
+ */
14
+ abstract get pieces(): BaseComponent[];
15
+ /**
16
+ * Compound objects have multiple {@link v} values; one for each part of the object.
17
+ */
18
+ get v(): int[];
19
+ }
@@ -0,0 +1,15 @@
1
+ import { codified } from "./Types";
2
+ /**
3
+ * Creates a searchable/coded string based on a user inputted string. Quotation marks, apostrophes, and accents are removed.
4
+ * @param input
5
+ */
6
+ export declare function CODIFY(input: string): codified;
7
+ /**
8
+ * Wraps the {@code input} using the codified {@code terms} with the {@code prefix}s and {@code suffix}s.
9
+ * When a term is found beside a quotation mark or apostrophe, the mark is included inside the highlight.
10
+ * @param input The string to add HTML highlights to.
11
+ * @param terms Codified search terms from {@link CODIFY}.
12
+ * @param prefix Added to the beginning of each of the {@code terms}.
13
+ * @param suffix Added to the end of each of the {@code terms}.
14
+ */
15
+ export declare function HIGHLIGHT(input: string, terms: codified[], [prefix, suffix]?: [string, string]): string;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Timer methods that get used many places.
3
+ */
4
+ export declare const SET_TIMER: typeof setTimeout, SET_EVERY: typeof setInterval, CLEAR_TIMER: typeof clearTimeout, CLEAR_EVERY: typeof clearInterval;
5
+ /**
6
+ * Parsing functions that get used all over.
7
+ */
8
+ export declare const INT: typeof parseInt, FLOAT: typeof parseFloat;
9
+ /**
10
+ *
11
+ */
12
+ export declare const OBJECT: ObjectConstructor, KEYS: {
13
+ (o: object): string[];
14
+ (o: {}): string[];
15
+ }, FREEZE: {
16
+ <T extends Function>(f: T): T;
17
+ <T extends {
18
+ [idx: string]: U | null | undefined | object;
19
+ }, U extends string | bigint | number | boolean | symbol>(o: T): Readonly<T>;
20
+ <T>(o: T): Readonly<T>;
21
+ }, JSON_PARSE: (text: string, reviver?: (this: any, key: string, value: any) => any) => any, JSON_STRINGIFY: {
22
+ (value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
23
+ (value: any, replacer?: (number | string)[] | null, space?: string | number): string;
24
+ };
25
+ /**
26
+ * Maths (as the Brits would say).
27
+ */
28
+ export declare const MATH: Math, PI: number, ABS: (x: number) => number, ACOS: (x: number) => number, ASIN: (x: number) => number, ATAN: (x: number) => number, ATAN2: (y: number, x: number) => number, CEIL: (x: number) => number, COS: (x: number) => number, EXP: (x: number) => number, FLOOR: (x: number) => number, LOG: (x: number) => number, MAX: (...values: number[]) => number, MIN: (...values: number[]) => number, POW: (x: number, y: number) => number, RANDOM: () => number, ROUND: (x: number) => number, SIN: (x: number) => number, SQRT: (x: number) => number, TAN: (x: number) => number;
29
+ /**
30
+ * Constant values used for calculations in geometry and geography.
31
+ * half of pi (used in mercator projects)
32
+ * radians to degrees: value * (180 / pi)
33
+ * degrees to radians: value * (pi / 180)
34
+ */
35
+ export declare const HALF_PI: number, RADIANS_TO_DEGREES: number, DEGREES_TO_RADIANS: number;
36
+ /**
37
+ *
38
+ */
39
+ export declare const WIN: typeof globalThis, DOC: Document, LOC: Location;