@oneuptime/common 7.0.2513 → 7.0.2550
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/AnalyticsModels/BaseModel.ts +437 -443
- package/AnalyticsModels/CommonModel.ts +216 -226
- package/AnalyticsModels/NestedModel.ts +5 -5
- package/Models/AccessControlModel.ts +10 -10
- package/Models/BaseModel.ts +662 -670
- package/Models/FileModel.ts +102 -102
- package/Models/GlobalConfig.ts +5 -5
- package/Models/TenantModel.ts +8 -8
- package/Models/UserModel.ts +8 -8
- package/ServiceRoute.ts +17 -17
- package/Tests/MockType.ts +9 -0
- package/Tests/Spy.ts +11 -0
- package/Tests/Types/API/ErrorResponse.test.ts +14 -14
- package/Tests/Types/API/HTTPErrorResponse.test.ts +55 -55
- package/Tests/Types/API/HTTPMethod.test.ts +14 -14
- package/Tests/Types/API/Headers.test.ts +13 -13
- package/Tests/Types/API/Hostname.test.ts +20 -20
- package/Tests/Types/API/Protocal.test.ts +17 -17
- package/Tests/Types/API/Response.test.ts +19 -19
- package/Tests/Types/API/ResponseType.test.ts +11 -11
- package/Tests/Types/API/Route.test.ts +28 -28
- package/Tests/Types/API/StatusCode.test.ts +24 -24
- package/Tests/Types/API/URL.test.ts +39 -39
- package/Tests/Types/Alerts/AlertEventType.test.ts +46 -46
- package/Tests/Types/Alerts/AlertType.test.ts +17 -17
- package/Tests/Types/AppEnvironment.test.ts +11 -11
- package/Tests/Types/ApplicationLog/ApplicationLogType.test.ts +11 -11
- package/Tests/Types/ArrayUtil.test.ts +77 -77
- package/Tests/Types/Billing/SubscriptionPlan.test.ts +255 -270
- package/Tests/Types/BrandColors.test.ts +138 -138
- package/Tests/Types/Char.test.ts +81 -81
- package/Tests/Types/Code/CodeType.test.ts +11 -11
- package/Tests/Types/Color.test.ts +42 -42
- package/Tests/Types/Company/CompanySize.test.ts +17 -17
- package/Tests/Types/Company/JobRole.test.ts +20 -20
- package/Tests/Types/Countries.test.ts +287 -301
- package/Tests/Types/Database/ColumnLength.test.ts +41 -41
- package/Tests/Types/Database/ColumnType.test.ts +77 -77
- package/Tests/Types/Database/Columns.test.ts +18 -18
- package/Tests/Types/Database/CompareBase.test.ts +32 -32
- package/Tests/Types/Database/Date.test.ts +73 -75
- package/Tests/Types/Database/EqualToOrNull.test.ts +61 -61
- package/Tests/Types/Database/InBetween.test.ts +71 -71
- package/Tests/Types/Database/LimitMax.test.ts +14 -14
- package/Tests/Types/Database/NotEqual.test.ts +15 -15
- package/Tests/Types/Database/Search.test.ts +8 -8
- package/Tests/Types/DatabaseType.test.ts +5 -5
- package/Tests/Types/Date.test.ts +87 -93
- package/Tests/Types/Dictionary.test.ts +22 -22
- package/Tests/Types/Domain.test.ts +36 -36
- package/Tests/Types/Email/Email.test.ts +55 -55
- package/Tests/Types/EmailWithName.test.ts +46 -46
- package/Tests/Types/EncryptionAlgorithm.test.ts +5 -5
- package/Tests/Types/Exception/ApiException.test.ts +12 -13
- package/Tests/Types/Exception/BadDataException.test.ts +12 -12
- package/Tests/Types/Exception/BadOperationException.test.ts +12 -13
- package/Tests/Types/Exception/BadRequestException.test.ts +12 -12
- package/Tests/Types/Exception/DatabaseNotConnectedException.test.ts +10 -10
- package/Tests/Types/Exception/Exception.test.ts +15 -17
- package/Tests/Types/Exception/NotImplementedException.test.ts +10 -10
- package/Tests/Types/File.test.ts +20 -20
- package/Tests/Types/HashedString.test.ts +18 -18
- package/Tests/Types/Html.test.ts +6 -6
- package/Tests/Types/IP/IP.test.ts +65 -67
- package/Tests/Types/IP/IPType.test.ts +8 -8
- package/Tests/Types/IP/IPv4.test.ts +15 -15
- package/Tests/Types/IP/IPv6.test.ts +15 -15
- package/Tests/Types/JSON.test.ts +35 -35
- package/Tests/Types/JSONFunctions.test.ts +41 -44
- package/Tests/Types/ListData.test.ts +33 -33
- package/Tests/Types/Name.test.ts +24 -24
- package/Tests/Types/ObjectID.test.ts +10 -10
- package/Tests/Types/Permission.test.ts +8 -8
- package/Tests/Types/Phone.test.ts +35 -35
- package/Tests/Types/Port.test.ts +33 -33
- package/Tests/Types/PositiveNumber.test.ts +123 -123
- package/Tests/Types/SecuritySeverity.test.ts +14 -14
- package/Tests/Types/SerializableObject.test.ts +33 -34
- package/Tests/Types/Sleep.test.ts +16 -19
- package/Tests/Types/Text.test.ts +6 -8
- package/Tests/Types/Timezone.test.ts +644 -674
- package/Tests/Types/Typeof.test.ts +14 -14
- package/Tests/Types/UserType.test.ts +14 -14
- package/Tests/Types/Version.test.ts +33 -33
- package/Tests/Types/XML.test.ts +33 -33
- package/Tests/Utils/API.test.ts +339 -342
- package/Tests/Utils/Analytics.test.ts +65 -65
- package/Tests/Utils/CronTime.test.ts +26 -26
- package/Tests/Utils/Faker.test.ts +30 -32
- package/Tests/Utils/Slug.test.ts +20 -20
- package/Tests/Utils/UUID.test.ts +10 -10
- package/Types/API/EmptyResponse.ts +1 -1
- package/Types/API/HTTPErrorResponse.ts +18 -21
- package/Types/API/HTTPMethod.ts +5 -5
- package/Types/API/HTTPResponse.ts +108 -110
- package/Types/API/Headers.ts +1 -1
- package/Types/API/Hostname.ts +94 -94
- package/Types/API/Protocol.ts +6 -6
- package/Types/API/ResponseType.ts +3 -3
- package/Types/API/Route.ts +76 -76
- package/Types/API/StatusCode.ts +31 -34
- package/Types/API/URL.ts +217 -221
- package/Types/Alerts/AlertEventType.ts +10 -10
- package/Types/Alerts/AlertType.ts +5 -5
- package/Types/AnalyticsDatabase/AnalyticsTableEngine.ts +1 -1
- package/Types/AnalyticsDatabase/TableColumn.ts +157 -160
- package/Types/AnalyticsDatabase/TableColumnType.ts +12 -12
- package/Types/AppEnvironment.ts +3 -3
- package/Types/ApplicationLog/ApplicationLogType.ts +3 -3
- package/Types/ArrayUtil.ts +68 -70
- package/Types/BaseDatabase/AccessControl.ts +5 -5
- package/Types/BaseDatabase/ColumnBillingAccessControl.ts +4 -4
- package/Types/BaseDatabase/DatabaseCommonInteractionProps.ts +20 -20
- package/Types/BaseDatabase/DatabaseCommonInteractionPropsUtil.ts +75 -76
- package/Types/BaseDatabase/DatabaseType.ts +2 -2
- package/Types/BaseDatabase/EnableWorkflowOn.ts +4 -4
- package/Types/BaseDatabase/EqualToOrNull.ts +29 -29
- package/Types/BaseDatabase/GreaterThan.ts +18 -18
- package/Types/BaseDatabase/GreaterThanOrEqual.ts +18 -18
- package/Types/BaseDatabase/InBetween.ts +61 -61
- package/Types/BaseDatabase/Includes.ts +32 -34
- package/Types/BaseDatabase/IsNull.ts +21 -21
- package/Types/BaseDatabase/LessThan.ts +18 -18
- package/Types/BaseDatabase/LessThanOrEqual.ts +18 -18
- package/Types/BaseDatabase/ModelPermission.ts +31 -31
- package/Types/BaseDatabase/NotEqual.ts +29 -29
- package/Types/BaseDatabase/NotNull.ts +21 -21
- package/Types/BaseDatabase/Search.ts +34 -34
- package/Types/BaseDatabase/SortOrder.ts +2 -2
- package/Types/BaseDatabase/TableBillingAccessControl.ts +5 -5
- package/Types/Billing/MeteredPlan.ts +21 -21
- package/Types/Billing/SubscriptionPlan.ts +223 -228
- package/Types/Billing/SubscriptionStatus.ts +23 -23
- package/Types/BrandColors.ts +60 -60
- package/Types/BrowserType.ts +3 -3
- package/Types/Calendar/CalendarEvent.ts +9 -9
- package/Types/Call/CallRequest.ts +19 -19
- package/Types/Call/CallStatus.ts +5 -5
- package/Types/CallAndSMS/TwilioConfig.ts +4 -4
- package/Types/Char.ts +62 -62
- package/Types/Code/CodeType.ts +7 -7
- package/Types/CodeRepository/CodeRepositoryType.ts +6 -0
- package/Types/CodeRepository/PullRequest.ts +16 -0
- package/Types/CodeRepository/PullRequestState.ts +7 -0
- package/Types/Color.ts +88 -88
- package/Types/Company/CompanySize.ts +5 -5
- package/Types/Company/JobRole.ts +6 -6
- package/Types/Copilot/CopilotEventStatus.ts +6 -0
- package/Types/Copilot/CopilotEventType.ts +6 -0
- package/Types/Countries.ts +243 -243
- package/Types/Currency.ts +23 -23
- package/Types/CustomField/CustomFieldType.ts +3 -3
- package/Types/Database/AccessControl/AllowAccessIfSubscriptionIsUnpaid.ts +4 -4
- package/Types/Database/AccessControl/ColumnAccessControl.ts +33 -33
- package/Types/Database/AccessControl/ColumnBillingAccessControl.ts +34 -36
- package/Types/Database/AccessControl/TableAccessControl.ts +16 -16
- package/Types/Database/AccessControl/TableBillingAccessControl.ts +16 -16
- package/Types/Database/AccessControlColumn.ts +4 -4
- package/Types/Database/AllowUserQueryWithoutTenant.ts +4 -4
- package/Types/Database/CanAccessIfCanReadOn.ts +6 -6
- package/Types/Database/ColumnLength.ts +61 -61
- package/Types/Database/ColumnType.ts +33 -33
- package/Types/Database/Columns.ts +16 -16
- package/Types/Database/CompareBase.ts +28 -28
- package/Types/Database/CrudApiEndpoint.ts +5 -5
- package/Types/Database/CurrentUserCanAccessRecordBy.ts +4 -4
- package/Types/Database/DatabaseProperty.ts +42 -42
- package/Types/Database/Date.ts +20 -20
- package/Types/Database/EnableDocumentation.ts +6 -7
- package/Types/Database/EnableWorkflow.ts +5 -5
- package/Types/Database/IsPermissionsIf.ts +12 -12
- package/Types/Database/LabelsColumn.ts +4 -4
- package/Types/Database/MultiTenentQueryAllowed.ts +4 -4
- package/Types/Database/PartialEntity.ts +1 -1
- package/Types/Database/SlugifyColumn.ts +5 -5
- package/Types/Database/TableColumn.ts +42 -42
- package/Types/Database/TableColumnType.ts +39 -39
- package/Types/Database/TableMetadata.ts +14 -14
- package/Types/Database/TenantColumn.ts +4 -4
- package/Types/Database/TotalItemsBy.ts +9 -9
- package/Types/Database/UniqueColumnBy.ts +27 -27
- package/Types/DatabaseType.ts +2 -2
- package/Types/Date.ts +965 -978
- package/Types/Day/DayOfWeek.ts +24 -24
- package/Types/Decimal.ts +57 -57
- package/Types/Dictionary.ts +1 -1
- package/Types/DiskSize.ts +32 -32
- package/Types/Domain.ts +74 -74
- package/Types/Email/EmailBody.ts +2 -2
- package/Types/Email/EmailMessage.ts +8 -8
- package/Types/Email/EmailServer.ts +12 -12
- package/Types/Email/EmailTemplate.ts +5 -5
- package/Types/Email/EmailTemplateType.ts +36 -36
- package/Types/Email.ts +99 -101
- package/Types/EmailWithName.ts +26 -26
- package/Types/EncryptionAlgorithm.ts +1 -1
- package/Types/Events/EventInterval.ts +5 -5
- package/Types/Events/Recurring.ts +90 -92
- package/Types/Exception/ApiException.ts +5 -5
- package/Types/Exception/BadDataException.ts +5 -5
- package/Types/Exception/BadOperationException.ts +5 -5
- package/Types/Exception/BadRequestException.ts +5 -5
- package/Types/Exception/DatabaseNotConnectedException.ts +8 -8
- package/Types/Exception/Exception.ts +15 -15
- package/Types/Exception/ExceptionCode.ts +17 -17
- package/Types/Exception/NotAuthenticatedException.ts +5 -5
- package/Types/Exception/NotAuthorizedException.ts +5 -5
- package/Types/Exception/NotFoundException.ts +5 -5
- package/Types/Exception/NotImplementedException.ts +8 -8
- package/Types/Exception/PaymentRequiredException.ts +5 -5
- package/Types/Exception/ServerException.ts +5 -5
- package/Types/Exception/SsoAuthorizationException.ts +12 -12
- package/Types/Exception/TenantNotFoundException.ts +5 -5
- package/Types/Exception/TimeoutException.ts +5 -5
- package/Types/Exception/UnableToReachServer.ts +5 -5
- package/Types/Exception/WebsiteRequestException.ts +5 -5
- package/Types/File/MimeType.ts +5 -5
- package/Types/File.ts +2 -2
- package/Types/Filter/FilterCondition.ts +2 -2
- package/Types/Filter/FilterType.ts +6 -6
- package/Types/HashCode.ts +8 -8
- package/Types/HashedString.ts +80 -82
- package/Types/Html.ts +13 -13
- package/Types/IP/IP.ts +93 -93
- package/Types/IP/IPType.ts +2 -2
- package/Types/IP/IPv4.ts +7 -7
- package/Types/IP/IPv6.ts +7 -7
- package/Types/Icon/IconProp.ts +122 -122
- package/Types/Infrastructure/BasicMetrics.ts +15 -15
- package/Types/Infrastructure/OSType.ts +4 -4
- package/Types/IsolatedVM/ReturnResult.ts +2 -2
- package/Types/JSON.ts +139 -139
- package/Types/JSONFunctions.ts +310 -320
- package/Types/JsonWebTokenData.ts +11 -11
- package/Types/Link.ts +5 -5
- package/Types/ListData.ts +26 -26
- package/Types/Mail/MailStatus.ts +2 -2
- package/Types/MeteredPlan/ProductType.ts +4 -4
- package/Types/Mixins.ts +1 -1
- package/Types/Monitor/CriteriaFilter.ts +107 -107
- package/Types/Monitor/CriteriaIncident.ts +7 -7
- package/Types/Monitor/CustomCodeMonitor/CustomCodeMonitorResponse.ts +5 -5
- package/Types/Monitor/IncomingMonitor/IncomingMonitorRequest.ts +10 -10
- package/Types/Monitor/MonitorCriteria.ts +151 -162
- package/Types/Monitor/MonitorCriteriaInstance.ts +622 -628
- package/Types/Monitor/MonitorStep.ts +314 -319
- package/Types/Monitor/MonitorSteps.ts +156 -161
- package/Types/Monitor/MonitorType.ts +164 -154
- package/Types/Monitor/SSLMonitor/SslMonitorResponse.ts +12 -12
- package/Types/Monitor/ServerMonitor/ServerMonitorResponse.ts +10 -10
- package/Types/Monitor/SyntheticMonitors/BrowserType.ts +1 -1
- package/Types/Monitor/SyntheticMonitors/ScreenSizeType.ts +1 -1
- package/Types/Monitor/SyntheticMonitors/Screenshot.ts +1 -1
- package/Types/Monitor/SyntheticMonitors/SyntheticMonitorResponse.ts +8 -8
- package/Types/Name.ts +65 -65
- package/Types/NotificationRule/NotificationRuleType.ts +3 -3
- package/Types/NotificationSetting/NotificationSettingEventType.ts +18 -18
- package/Types/ObjectID.ts +73 -73
- package/Types/OnCallDutyPolicy/Layer.ts +782 -824
- package/Types/OnCallDutyPolicy/OnCalDutyExecutionLogTimelineStatus.ts +6 -6
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyAlertStatus.ts +3 -3
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyStatus.ts +5 -5
- package/Types/OnCallDutyPolicy/RestrictionTimes.ts +177 -179
- package/Types/Operation/OperationResult.ts +2 -2
- package/Types/Operation/OperationStatus.ts +5 -5
- package/Types/Permission.ts +3373 -3412
- package/Types/Phone.ts +58 -59
- package/Types/Port.ts +73 -73
- package/Types/PositiveNumber.ts +53 -61
- package/Types/PricingPlan.ts +5 -5
- package/Types/Probe/ProbeApiIngestResponse.ts +6 -6
- package/Types/Probe/ProbeMonitorResponse.ts +25 -25
- package/Types/Probe/ProbeStatusReport.ts +4 -4
- package/Types/Reflection.ts +4 -4
- package/Types/SMS/SMS.ts +3 -3
- package/Types/SMS/SmsTemplateType.ts +9 -9
- package/Types/SSO/DigestMethod.ts +4 -4
- package/Types/SSO/SignatureMethod.ts +4 -4
- package/Types/ScheduledEvent/ScheduledEventState.ts +4 -4
- package/Types/ScreenSizeType.ts +3 -3
- package/Types/SecuritySeverity.ts +4 -4
- package/Types/SerializableObject.ts +12 -12
- package/Types/SerializableObjectDictionary.ts +58 -58
- package/Types/ServiceCatalog/ServiceLanguage.ts +20 -0
- package/Types/Sleep.ts +6 -6
- package/Types/SmsStatus.ts +3 -3
- package/Types/StatusPage/StatusPageChartType.ts +6 -6
- package/Types/Text.ts +126 -130
- package/Types/Time/StartAndEndTime.ts +2 -2
- package/Types/Timezone.ts +592 -592
- package/Types/TimezoneCode.ts +63 -0
- package/Types/Typeof.ts +4 -4
- package/Types/UserNotification/UserNotificationEventType.ts +1 -1
- package/Types/UserNotification/UserNotificationExecutionStatus.ts +5 -5
- package/Types/UserNotification/UserNotificationStatus.ts +5 -5
- package/Types/UserType.ts +4 -4
- package/Types/Version.ts +50 -50
- package/Types/WebsiteRequest.ts +55 -55
- package/Types/Workflow/Component.ts +72 -72
- package/Types/Workflow/ComponentID.ts +16 -16
- package/Types/Workflow/Components/API.ts +349 -357
- package/Types/Workflow/Components/BaseModel.ts +572 -573
- package/Types/Workflow/Components/Condition.ts +60 -60
- package/Types/Workflow/Components/Email.ts +102 -103
- package/Types/Workflow/Components/JSON.ts +151 -156
- package/Types/Workflow/Components/JavaScript.ts +61 -61
- package/Types/Workflow/Components/Log.ts +39 -39
- package/Types/Workflow/Components/Manual.ts +33 -34
- package/Types/Workflow/Components/MicrosoftTeams.ts +61 -62
- package/Types/Workflow/Components/Schedule.ts +32 -32
- package/Types/Workflow/Components/Slack.ts +63 -64
- package/Types/Workflow/Components/Webhook.ts +51 -51
- package/Types/Workflow/Components/Workflow.ts +38 -38
- package/Types/Workflow/Components.ts +76 -76
- package/Types/Workflow/WorkflowPlan.ts +4 -4
- package/Types/Workflow/WorkflowStatus.ts +6 -6
- package/Types/XML.ts +16 -16
- package/Typings/Index.d.ts +3 -3
- package/Utils/API.ts +355 -309
- package/Utils/Analytics.ts +31 -31
- package/Utils/CronTime.ts +7 -7
- package/Utils/Enum.ts +14 -0
- package/Utils/Faker.ts +25 -25
- package/Utils/ObjectUtil.ts +5 -5
- package/Utils/Realtime.ts +24 -24
- package/Utils/Slug.ts +15 -15
- package/Utils/UUID.ts +4 -4
- package/build/dist/AnalyticsModels/BaseModel.js +32 -32
- package/build/dist/AnalyticsModels/BaseModel.js.map +1 -1
- package/build/dist/AnalyticsModels/CommonModel.js +14 -17
- package/build/dist/AnalyticsModels/CommonModel.js.map +1 -1
- package/build/dist/AnalyticsModels/NestedModel.js +1 -1
- package/build/dist/AnalyticsModels/NestedModel.js.map +1 -1
- package/build/dist/Models/AccessControlModel.js +1 -1
- package/build/dist/Models/AccessControlModel.js.map +1 -1
- package/build/dist/Models/BaseModel.js +28 -28
- package/build/dist/Models/BaseModel.js.map +1 -1
- package/build/dist/Models/FileModel.js +14 -14
- package/build/dist/Models/FileModel.js.map +1 -1
- package/build/dist/Models/GlobalConfig.js +1 -1
- package/build/dist/Models/GlobalConfig.js.map +1 -1
- package/build/dist/Models/TenantModel.js +1 -1
- package/build/dist/Models/TenantModel.js.map +1 -1
- package/build/dist/Models/UserModel.js +1 -1
- package/build/dist/Models/UserModel.js.map +1 -1
- package/build/dist/ServiceRoute.js +17 -17
- package/build/dist/Tests/MockType.js +5 -0
- package/build/dist/Tests/MockType.js.map +1 -0
- package/build/dist/Tests/Spy.js +4 -0
- package/build/dist/Tests/Spy.js.map +1 -0
- package/build/dist/Tests/Types/API/ErrorResponse.test.js +5 -5
- package/build/dist/Tests/Types/API/ErrorResponse.test.js.map +1 -1
- package/build/dist/Tests/Types/API/HTTPErrorResponse.test.js +18 -18
- package/build/dist/Tests/Types/API/HTTPErrorResponse.test.js.map +1 -1
- package/build/dist/Tests/Types/API/HTTPMethod.test.js +10 -10
- package/build/dist/Tests/Types/API/HTTPMethod.test.js.map +1 -1
- package/build/dist/Tests/Types/API/Headers.test.js +8 -8
- package/build/dist/Tests/Types/API/Headers.test.js.map +1 -1
- package/build/dist/Tests/Types/API/Hostname.test.js +11 -11
- package/build/dist/Tests/Types/API/Hostname.test.js.map +1 -1
- package/build/dist/Tests/Types/API/Protocal.test.js +12 -12
- package/build/dist/Tests/Types/API/Protocal.test.js.map +1 -1
- package/build/dist/Tests/Types/API/Response.test.js +7 -7
- package/build/dist/Tests/Types/API/Response.test.js.map +1 -1
- package/build/dist/Tests/Types/API/ResponseType.test.js +8 -8
- package/build/dist/Tests/Types/API/ResponseType.test.js.map +1 -1
- package/build/dist/Tests/Types/API/Route.test.js +15 -15
- package/build/dist/Tests/Types/API/Route.test.js.map +1 -1
- package/build/dist/Tests/Types/API/StatusCode.test.js +14 -14
- package/build/dist/Tests/Types/API/StatusCode.test.js.map +1 -1
- package/build/dist/Tests/Types/API/URL.test.js +20 -20
- package/build/dist/Tests/Types/API/URL.test.js.map +1 -1
- package/build/dist/Tests/Types/Alerts/AlertEventType.test.js +22 -22
- package/build/dist/Tests/Types/Alerts/AlertEventType.test.js.map +1 -1
- package/build/dist/Tests/Types/Alerts/AlertType.test.js +12 -12
- package/build/dist/Tests/Types/Alerts/AlertType.test.js.map +1 -1
- package/build/dist/Tests/Types/AppEnvironment.test.js +8 -8
- package/build/dist/Tests/Types/AppEnvironment.test.js.map +1 -1
- package/build/dist/Tests/Types/ApplicationLog/ApplicationLogType.test.js +8 -8
- package/build/dist/Tests/Types/ApplicationLog/ApplicationLogType.test.js.map +1 -1
- package/build/dist/Tests/Types/ArrayUtil.test.js +9 -9
- package/build/dist/Tests/Types/ArrayUtil.test.js.map +1 -1
- package/build/dist/Tests/Types/Billing/SubscriptionPlan.test.js +75 -77
- package/build/dist/Tests/Types/Billing/SubscriptionPlan.test.js.map +1 -1
- package/build/dist/Tests/Types/BrandColors.test.js +55 -55
- package/build/dist/Tests/Types/BrandColors.test.js.map +1 -1
- package/build/dist/Tests/Types/Char.test.js +72 -72
- package/build/dist/Tests/Types/Char.test.js.map +1 -1
- package/build/dist/Tests/Types/Code/CodeType.test.js +8 -8
- package/build/dist/Tests/Types/Code/CodeType.test.js.map +1 -1
- package/build/dist/Tests/Types/Color.test.js +24 -24
- package/build/dist/Tests/Types/Color.test.js.map +1 -1
- package/build/dist/Tests/Types/Company/CompanySize.test.js +12 -12
- package/build/dist/Tests/Types/Company/CompanySize.test.js.map +1 -1
- package/build/dist/Tests/Types/Company/JobRole.test.js +14 -14
- package/build/dist/Tests/Types/Company/JobRole.test.js.map +1 -1
- package/build/dist/Tests/Types/Countries.test.js +244 -244
- package/build/dist/Tests/Types/Countries.test.js.map +1 -1
- package/build/dist/Tests/Types/Database/ColumnLength.test.js +15 -15
- package/build/dist/Tests/Types/Database/ColumnLength.test.js.map +1 -1
- package/build/dist/Tests/Types/Database/ColumnType.test.js +52 -52
- package/build/dist/Tests/Types/Database/ColumnType.test.js.map +1 -1
- package/build/dist/Tests/Types/Database/Columns.test.js +14 -14
- package/build/dist/Tests/Types/Database/Columns.test.js.map +1 -1
- package/build/dist/Tests/Types/Database/CompareBase.test.js +13 -13
- package/build/dist/Tests/Types/Database/CompareBase.test.js.map +1 -1
- package/build/dist/Tests/Types/Database/Date.test.js +32 -32
- package/build/dist/Tests/Types/Database/Date.test.js.map +1 -1
- package/build/dist/Tests/Types/Database/EqualToOrNull.test.js +30 -30
- package/build/dist/Tests/Types/Database/EqualToOrNull.test.js.map +1 -1
- package/build/dist/Tests/Types/Database/InBetween.test.js +20 -20
- package/build/dist/Tests/Types/Database/InBetween.test.js.map +1 -1
- package/build/dist/Tests/Types/Database/LimitMax.test.js +9 -9
- package/build/dist/Tests/Types/Database/LimitMax.test.js.map +1 -1
- package/build/dist/Tests/Types/Database/NotEqual.test.js +9 -9
- package/build/dist/Tests/Types/Database/NotEqual.test.js.map +1 -1
- package/build/dist/Tests/Types/Database/Search.test.js +6 -6
- package/build/dist/Tests/Types/Database/Search.test.js.map +1 -1
- package/build/dist/Tests/Types/DatabaseType.test.js +4 -4
- package/build/dist/Tests/Types/DatabaseType.test.js.map +1 -1
- package/build/dist/Tests/Types/Date.test.js +32 -32
- package/build/dist/Tests/Types/Date.test.js.map +1 -1
- package/build/dist/Tests/Types/Dictionary.test.js +10 -10
- package/build/dist/Tests/Types/Dictionary.test.js.map +1 -1
- package/build/dist/Tests/Types/Domain.test.js +23 -23
- package/build/dist/Tests/Types/Domain.test.js.map +1 -1
- package/build/dist/Tests/Types/Email/Email.test.js +31 -31
- package/build/dist/Tests/Types/Email/Email.test.js.map +1 -1
- package/build/dist/Tests/Types/EmailWithName.test.js +11 -11
- package/build/dist/Tests/Types/EmailWithName.test.js.map +1 -1
- package/build/dist/Tests/Types/EncryptionAlgorithm.test.js +4 -4
- package/build/dist/Tests/Types/EncryptionAlgorithm.test.js.map +1 -1
- package/build/dist/Tests/Types/Exception/ApiException.test.js +6 -7
- package/build/dist/Tests/Types/Exception/ApiException.test.js.map +1 -1
- package/build/dist/Tests/Types/Exception/BadDataException.test.js +7 -7
- package/build/dist/Tests/Types/Exception/BadDataException.test.js.map +1 -1
- package/build/dist/Tests/Types/Exception/BadOperationException.test.js +6 -7
- package/build/dist/Tests/Types/Exception/BadOperationException.test.js.map +1 -1
- package/build/dist/Tests/Types/Exception/BadRequestException.test.js +7 -7
- package/build/dist/Tests/Types/Exception/BadRequestException.test.js.map +1 -1
- package/build/dist/Tests/Types/Exception/DatabaseNotConnectedException.test.js +5 -5
- package/build/dist/Tests/Types/Exception/DatabaseNotConnectedException.test.js.map +1 -1
- package/build/dist/Tests/Types/Exception/Exception.test.js +9 -9
- package/build/dist/Tests/Types/Exception/Exception.test.js.map +1 -1
- package/build/dist/Tests/Types/Exception/NotImplementedException.test.js +5 -5
- package/build/dist/Tests/Types/Exception/NotImplementedException.test.js.map +1 -1
- package/build/dist/Tests/Types/File.test.js +13 -13
- package/build/dist/Tests/Types/File.test.js.map +1 -1
- package/build/dist/Tests/Types/HashedString.test.js +8 -8
- package/build/dist/Tests/Types/HashedString.test.js.map +1 -1
- package/build/dist/Tests/Types/Html.test.js +5 -5
- package/build/dist/Tests/Types/Html.test.js.map +1 -1
- package/build/dist/Tests/Types/IP/IP.test.js +40 -40
- package/build/dist/Tests/Types/IP/IP.test.js.map +1 -1
- package/build/dist/Tests/Types/IP/IPType.test.js +6 -6
- package/build/dist/Tests/Types/IP/IPType.test.js.map +1 -1
- package/build/dist/Tests/Types/IP/IPv4.test.js +9 -9
- package/build/dist/Tests/Types/IP/IPv4.test.js.map +1 -1
- package/build/dist/Tests/Types/IP/IPv6.test.js +9 -9
- package/build/dist/Tests/Types/IP/IPv6.test.js.map +1 -1
- package/build/dist/Tests/Types/JSON.test.js +28 -28
- package/build/dist/Tests/Types/JSON.test.js.map +1 -1
- package/build/dist/Tests/Types/JSONFunctions.test.js +13 -13
- package/build/dist/Tests/Types/JSONFunctions.test.js.map +1 -1
- package/build/dist/Tests/Types/ListData.test.js +10 -10
- package/build/dist/Tests/Types/ListData.test.js.map +1 -1
- package/build/dist/Tests/Types/Name.test.js +17 -17
- package/build/dist/Tests/Types/Name.test.js.map +1 -1
- package/build/dist/Tests/Types/ObjectID.test.js +8 -8
- package/build/dist/Tests/Types/ObjectID.test.js.map +1 -1
- package/build/dist/Tests/Types/Permission.test.js +6 -6
- package/build/dist/Tests/Types/Permission.test.js.map +1 -1
- package/build/dist/Tests/Types/Phone.test.js +21 -21
- package/build/dist/Tests/Types/Phone.test.js.map +1 -1
- package/build/dist/Tests/Types/Port.test.js +13 -13
- package/build/dist/Tests/Types/Port.test.js.map +1 -1
- package/build/dist/Tests/Types/PositiveNumber.test.js +19 -19
- package/build/dist/Tests/Types/PositiveNumber.test.js.map +1 -1
- package/build/dist/Tests/Types/SecuritySeverity.test.js +10 -10
- package/build/dist/Tests/Types/SecuritySeverity.test.js.map +1 -1
- package/build/dist/Tests/Types/SerializableObject.test.js +14 -12
- package/build/dist/Tests/Types/SerializableObject.test.js.map +1 -1
- package/build/dist/Tests/Types/Sleep.test.js +4 -4
- package/build/dist/Tests/Types/Sleep.test.js.map +1 -1
- package/build/dist/Tests/Types/Text.test.js +5 -5
- package/build/dist/Tests/Types/Text.test.js.map +1 -1
- package/build/dist/Tests/Types/Timezone.test.js +593 -593
- package/build/dist/Tests/Types/Timezone.test.js.map +1 -1
- package/build/dist/Tests/Types/Typeof.test.js +10 -10
- package/build/dist/Tests/Types/Typeof.test.js.map +1 -1
- package/build/dist/Tests/Types/UserType.test.js +10 -10
- package/build/dist/Tests/Types/UserType.test.js.map +1 -1
- package/build/dist/Tests/Types/Version.test.js +21 -21
- package/build/dist/Tests/Types/Version.test.js.map +1 -1
- package/build/dist/Tests/Types/XML.test.js +17 -17
- package/build/dist/Tests/Types/XML.test.js.map +1 -1
- package/build/dist/Tests/Utils/API.test.js +83 -83
- package/build/dist/Tests/Utils/API.test.js.map +1 -1
- package/build/dist/Tests/Utils/Analytics.test.js +25 -25
- package/build/dist/Tests/Utils/Analytics.test.js.map +1 -1
- package/build/dist/Tests/Utils/CronTime.test.js +14 -14
- package/build/dist/Tests/Utils/CronTime.test.js.map +1 -1
- package/build/dist/Tests/Utils/Faker.test.js +10 -10
- package/build/dist/Tests/Utils/Faker.test.js.map +1 -1
- package/build/dist/Tests/Utils/Slug.test.js +12 -12
- package/build/dist/Tests/Utils/Slug.test.js.map +1 -1
- package/build/dist/Tests/Utils/UUID.test.js +3 -3
- package/build/dist/Tests/Utils/UUID.test.js.map +1 -1
- package/build/dist/Types/API/HTTPErrorResponse.js +10 -11
- package/build/dist/Types/API/HTTPErrorResponse.js.map +1 -1
- package/build/dist/Types/API/HTTPMethod.js.map +1 -1
- package/build/dist/Types/API/HTTPResponse.js +9 -9
- package/build/dist/Types/API/HTTPResponse.js.map +1 -1
- package/build/dist/Types/API/Hostname.js +14 -14
- package/build/dist/Types/API/Hostname.js.map +1 -1
- package/build/dist/Types/API/Protocol.js.map +1 -1
- package/build/dist/Types/API/ResponseType.js.map +1 -1
- package/build/dist/Types/API/Route.js +11 -11
- package/build/dist/Types/API/Route.js.map +1 -1
- package/build/dist/Types/API/StatusCode.js +3 -4
- package/build/dist/Types/API/StatusCode.js.map +1 -1
- package/build/dist/Types/API/URL.js +44 -44
- package/build/dist/Types/API/URL.js.map +1 -1
- package/build/dist/Types/Alerts/AlertEventType.js.map +1 -1
- package/build/dist/Types/Alerts/AlertType.js.map +1 -1
- package/build/dist/Types/AnalyticsDatabase/AnalyticsTableEngine.js.map +1 -1
- package/build/dist/Types/AnalyticsDatabase/TableColumn.js +6 -7
- package/build/dist/Types/AnalyticsDatabase/TableColumn.js.map +1 -1
- package/build/dist/Types/AnalyticsDatabase/TableColumnType.js.map +1 -1
- package/build/dist/Types/AppEnvironment.js.map +1 -1
- package/build/dist/Types/ApplicationLog/ApplicationLogType.js.map +1 -1
- package/build/dist/Types/ArrayUtil.js.map +1 -1
- package/build/dist/Types/BaseDatabase/DatabaseCommonInteractionPropsUtil.js +10 -11
- package/build/dist/Types/BaseDatabase/DatabaseCommonInteractionPropsUtil.js.map +1 -1
- package/build/dist/Types/BaseDatabase/DatabaseType.js.map +1 -1
- package/build/dist/Types/BaseDatabase/EqualToOrNull.js +6 -6
- package/build/dist/Types/BaseDatabase/EqualToOrNull.js.map +1 -1
- package/build/dist/Types/BaseDatabase/GreaterThan.js +6 -6
- package/build/dist/Types/BaseDatabase/GreaterThan.js.map +1 -1
- package/build/dist/Types/BaseDatabase/GreaterThanOrEqual.js +6 -6
- package/build/dist/Types/BaseDatabase/GreaterThanOrEqual.js.map +1 -1
- package/build/dist/Types/BaseDatabase/InBetween.js +8 -8
- package/build/dist/Types/BaseDatabase/InBetween.js.map +1 -1
- package/build/dist/Types/BaseDatabase/Includes.js +7 -7
- package/build/dist/Types/BaseDatabase/Includes.js.map +1 -1
- package/build/dist/Types/BaseDatabase/IsNull.js +6 -6
- package/build/dist/Types/BaseDatabase/IsNull.js.map +1 -1
- package/build/dist/Types/BaseDatabase/LessThan.js +6 -6
- package/build/dist/Types/BaseDatabase/LessThan.js.map +1 -1
- package/build/dist/Types/BaseDatabase/LessThanOrEqual.js +6 -6
- package/build/dist/Types/BaseDatabase/LessThanOrEqual.js.map +1 -1
- package/build/dist/Types/BaseDatabase/ModelPermission.js +1 -1
- package/build/dist/Types/BaseDatabase/ModelPermission.js.map +1 -1
- package/build/dist/Types/BaseDatabase/NotEqual.js +6 -6
- package/build/dist/Types/BaseDatabase/NotEqual.js.map +1 -1
- package/build/dist/Types/BaseDatabase/NotNull.js +6 -6
- package/build/dist/Types/BaseDatabase/NotNull.js.map +1 -1
- package/build/dist/Types/BaseDatabase/Search.js +6 -6
- package/build/dist/Types/BaseDatabase/Search.js.map +1 -1
- package/build/dist/Types/BaseDatabase/SortOrder.js.map +1 -1
- package/build/dist/Types/Billing/MeteredPlan.js.map +1 -1
- package/build/dist/Types/Billing/SubscriptionPlan.js +15 -16
- package/build/dist/Types/Billing/SubscriptionPlan.js.map +1 -1
- package/build/dist/Types/Billing/SubscriptionStatus.js.map +1 -1
- package/build/dist/Types/BrandColors.js +40 -40
- package/build/dist/Types/BrandColors.js.map +1 -1
- package/build/dist/Types/BrowserType.js.map +1 -1
- package/build/dist/Types/Call/CallRequest.js +1 -1
- package/build/dist/Types/Call/CallRequest.js.map +1 -1
- package/build/dist/Types/Call/CallStatus.js.map +1 -1
- package/build/dist/Types/Code/CodeType.js.map +1 -1
- package/build/dist/Types/CodeRepository/CodeRepositoryType.js +7 -0
- package/build/dist/Types/CodeRepository/CodeRepositoryType.js.map +1 -0
- package/build/dist/Types/CodeRepository/PullRequest.js +2 -0
- package/build/dist/Types/CodeRepository/PullRequest.js.map +1 -0
- package/build/dist/Types/CodeRepository/PullRequestState.js +8 -0
- package/build/dist/Types/CodeRepository/PullRequestState.js.map +1 -0
- package/build/dist/Types/Color.js +13 -13
- package/build/dist/Types/Color.js.map +1 -1
- package/build/dist/Types/Company/CompanySize.js.map +1 -1
- package/build/dist/Types/Company/JobRole.js.map +1 -1
- package/build/dist/Types/Copilot/CopilotEventStatus.js +7 -0
- package/build/dist/Types/Copilot/CopilotEventStatus.js.map +1 -0
- package/build/dist/Types/Copilot/CopilotEventType.js +7 -0
- package/build/dist/Types/Copilot/CopilotEventType.js.map +1 -0
- package/build/dist/Types/Countries.js.map +1 -1
- package/build/dist/Types/Currency.js +3 -3
- package/build/dist/Types/Currency.js.map +1 -1
- package/build/dist/Types/CustomField/CustomFieldType.js.map +1 -1
- package/build/dist/Types/Database/AccessControl/AllowAccessIfSubscriptionIsUnpaid.js.map +1 -1
- package/build/dist/Types/Database/AccessControl/ColumnAccessControl.js +2 -2
- package/build/dist/Types/Database/AccessControl/ColumnAccessControl.js.map +1 -1
- package/build/dist/Types/Database/AccessControl/ColumnBillingAccessControl.js +2 -2
- package/build/dist/Types/Database/AccessControl/ColumnBillingAccessControl.js.map +1 -1
- package/build/dist/Types/Database/AccessControl/TableAccessControl.js.map +1 -1
- package/build/dist/Types/Database/AccessControl/TableBillingAccessControl.js.map +1 -1
- package/build/dist/Types/Database/AccessControlColumn.js.map +1 -1
- package/build/dist/Types/Database/AllowUserQueryWithoutTenant.js.map +1 -1
- package/build/dist/Types/Database/CanAccessIfCanReadOn.js.map +1 -1
- package/build/dist/Types/Database/ColumnLength.js +1 -1
- package/build/dist/Types/Database/ColumnLength.js.map +1 -1
- package/build/dist/Types/Database/ColumnType.js.map +1 -1
- package/build/dist/Types/Database/Columns.js.map +1 -1
- package/build/dist/Types/Database/CompareBase.js +5 -5
- package/build/dist/Types/Database/CompareBase.js.map +1 -1
- package/build/dist/Types/Database/CrudApiEndpoint.js.map +1 -1
- package/build/dist/Types/Database/CurrentUserCanAccessRecordBy.js.map +1 -1
- package/build/dist/Types/Database/DatabaseProperty.js +3 -3
- package/build/dist/Types/Database/DatabaseProperty.js.map +1 -1
- package/build/dist/Types/Database/Date.js +2 -2
- package/build/dist/Types/Database/Date.js.map +1 -1
- package/build/dist/Types/Database/EnableDocumentation.js +1 -2
- package/build/dist/Types/Database/EnableDocumentation.js.map +1 -1
- package/build/dist/Types/Database/EnableWorkflow.js.map +1 -1
- package/build/dist/Types/Database/IsPermissionsIf.js.map +1 -1
- package/build/dist/Types/Database/LabelsColumn.js.map +1 -1
- package/build/dist/Types/Database/MultiTenentQueryAllowed.js.map +1 -1
- package/build/dist/Types/Database/SlugifyColumn.js.map +1 -1
- package/build/dist/Types/Database/TableColumn.js +2 -2
- package/build/dist/Types/Database/TableColumn.js.map +1 -1
- package/build/dist/Types/Database/TableColumnType.js.map +1 -1
- package/build/dist/Types/Database/TableMetadata.js.map +1 -1
- package/build/dist/Types/Database/TenantColumn.js.map +1 -1
- package/build/dist/Types/Database/TotalItemsBy.js.map +1 -1
- package/build/dist/Types/Database/UniqueColumnBy.js +2 -2
- package/build/dist/Types/Database/UniqueColumnBy.js.map +1 -1
- package/build/dist/Types/DatabaseType.js.map +1 -1
- package/build/dist/Types/Date.js +132 -136
- package/build/dist/Types/Date.js.map +1 -1
- package/build/dist/Types/Day/DayOfWeek.js.map +1 -1
- package/build/dist/Types/Decimal.js +8 -8
- package/build/dist/Types/Decimal.js.map +1 -1
- package/build/dist/Types/DiskSize.js +3 -3
- package/build/dist/Types/DiskSize.js.map +1 -1
- package/build/dist/Types/Domain.js +13 -13
- package/build/dist/Types/Domain.js.map +1 -1
- package/build/dist/Types/Email/EmailTemplateType.js.map +1 -1
- package/build/dist/Types/Email.js +32 -32
- package/build/dist/Types/Email.js.map +1 -1
- package/build/dist/Types/EmailWithName.js +4 -4
- package/build/dist/Types/EmailWithName.js.map +1 -1
- package/build/dist/Types/EncryptionAlgorithm.js.map +1 -1
- package/build/dist/Types/Events/EventInterval.js.map +1 -1
- package/build/dist/Types/Events/Recurring.js +15 -15
- package/build/dist/Types/Events/Recurring.js.map +1 -1
- package/build/dist/Types/Exception/ApiException.js +2 -2
- package/build/dist/Types/Exception/ApiException.js.map +1 -1
- package/build/dist/Types/Exception/BadDataException.js +2 -2
- package/build/dist/Types/Exception/BadDataException.js.map +1 -1
- package/build/dist/Types/Exception/BadOperationException.js +2 -2
- package/build/dist/Types/Exception/BadOperationException.js.map +1 -1
- package/build/dist/Types/Exception/BadRequestException.js +2 -2
- package/build/dist/Types/Exception/BadRequestException.js.map +1 -1
- package/build/dist/Types/Exception/DatabaseNotConnectedException.js +3 -3
- package/build/dist/Types/Exception/DatabaseNotConnectedException.js.map +1 -1
- package/build/dist/Types/Exception/Exception.js +1 -1
- package/build/dist/Types/Exception/Exception.js.map +1 -1
- package/build/dist/Types/Exception/ExceptionCode.js.map +1 -1
- package/build/dist/Types/Exception/NotAuthenticatedException.js +2 -2
- package/build/dist/Types/Exception/NotAuthenticatedException.js.map +1 -1
- package/build/dist/Types/Exception/NotAuthorizedException.js +2 -2
- package/build/dist/Types/Exception/NotAuthorizedException.js.map +1 -1
- package/build/dist/Types/Exception/NotFoundException.js +2 -2
- package/build/dist/Types/Exception/NotFoundException.js.map +1 -1
- package/build/dist/Types/Exception/NotImplementedException.js +3 -3
- package/build/dist/Types/Exception/NotImplementedException.js.map +1 -1
- package/build/dist/Types/Exception/PaymentRequiredException.js +2 -2
- package/build/dist/Types/Exception/PaymentRequiredException.js.map +1 -1
- package/build/dist/Types/Exception/ServerException.js +3 -3
- package/build/dist/Types/Exception/ServerException.js.map +1 -1
- package/build/dist/Types/Exception/SsoAuthorizationException.js +3 -3
- package/build/dist/Types/Exception/SsoAuthorizationException.js.map +1 -1
- package/build/dist/Types/Exception/TenantNotFoundException.js +2 -2
- package/build/dist/Types/Exception/TenantNotFoundException.js.map +1 -1
- package/build/dist/Types/Exception/TimeoutException.js +2 -2
- package/build/dist/Types/Exception/TimeoutException.js.map +1 -1
- package/build/dist/Types/Exception/UnableToReachServer.js +2 -2
- package/build/dist/Types/Exception/UnableToReachServer.js.map +1 -1
- package/build/dist/Types/Exception/WebsiteRequestException.js +2 -2
- package/build/dist/Types/Exception/WebsiteRequestException.js.map +1 -1
- package/build/dist/Types/File/MimeType.js.map +1 -1
- package/build/dist/Types/Filter/FilterCondition.js.map +1 -1
- package/build/dist/Types/Filter/FilterType.js.map +1 -1
- package/build/dist/Types/HashCode.js.map +1 -1
- package/build/dist/Types/HashedString.js +14 -14
- package/build/dist/Types/HashedString.js.map +1 -1
- package/build/dist/Types/Html.js +1 -1
- package/build/dist/Types/Html.js.map +1 -1
- package/build/dist/Types/IP/IP.js +13 -13
- package/build/dist/Types/IP/IP.js.map +1 -1
- package/build/dist/Types/IP/IPType.js.map +1 -1
- package/build/dist/Types/IP/IPv4.js +3 -3
- package/build/dist/Types/IP/IPv4.js.map +1 -1
- package/build/dist/Types/IP/IPv6.js +3 -3
- package/build/dist/Types/IP/IPv6.js.map +1 -1
- package/build/dist/Types/Icon/IconProp.js.map +1 -1
- package/build/dist/Types/Infrastructure/OSType.js.map +1 -1
- package/build/dist/Types/JSON.js.map +1 -1
- package/build/dist/Types/JSONFunctions.js +33 -35
- package/build/dist/Types/JSONFunctions.js.map +1 -1
- package/build/dist/Types/ListData.js.map +1 -1
- package/build/dist/Types/Mail/MailStatus.js.map +1 -1
- package/build/dist/Types/MeteredPlan/ProductType.js.map +1 -1
- package/build/dist/Types/Monitor/CriteriaFilter.js +1 -1
- package/build/dist/Types/Monitor/CriteriaFilter.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorCriteria.js +17 -19
- package/build/dist/Types/Monitor/MonitorCriteria.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorCriteriaInstance.js +54 -55
- package/build/dist/Types/Monitor/MonitorCriteriaInstance.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStep.js +48 -52
- package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorSteps.js +19 -19
- package/build/dist/Types/Monitor/MonitorSteps.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorType.js +37 -23
- package/build/dist/Types/Monitor/MonitorType.js.map +1 -1
- package/build/dist/Types/Monitor/SyntheticMonitors/BrowserType.js +1 -1
- package/build/dist/Types/Monitor/SyntheticMonitors/ScreenSizeType.js +1 -1
- package/build/dist/Types/Name.js +16 -16
- package/build/dist/Types/Name.js.map +1 -1
- package/build/dist/Types/NotificationRule/NotificationRuleType.js.map +1 -1
- package/build/dist/Types/NotificationSetting/NotificationSettingEventType.js.map +1 -1
- package/build/dist/Types/ObjectID.js +15 -15
- package/build/dist/Types/ObjectID.js.map +1 -1
- package/build/dist/Types/OnCallDutyPolicy/Layer.js +14 -18
- package/build/dist/Types/OnCallDutyPolicy/Layer.js.map +1 -1
- package/build/dist/Types/OnCallDutyPolicy/OnCalDutyExecutionLogTimelineStatus.js.map +1 -1
- package/build/dist/Types/OnCallDutyPolicy/OnCallDutyPolicyAlertStatus.js.map +1 -1
- package/build/dist/Types/OnCallDutyPolicy/OnCallDutyPolicyStatus.js.map +1 -1
- package/build/dist/Types/OnCallDutyPolicy/RestrictionTimes.js +14 -14
- package/build/dist/Types/OnCallDutyPolicy/RestrictionTimes.js.map +1 -1
- package/build/dist/Types/Operation/OperationResult.js.map +1 -1
- package/build/dist/Types/Operation/OperationStatus.js.map +1 -1
- package/build/dist/Types/Permission.js +726 -686
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/Phone.js +8 -8
- package/build/dist/Types/Phone.js.map +1 -1
- package/build/dist/Types/Port.js +11 -11
- package/build/dist/Types/Port.js.map +1 -1
- package/build/dist/Types/PositiveNumber.js +7 -8
- package/build/dist/Types/PositiveNumber.js.map +1 -1
- package/build/dist/Types/SMS/SmsTemplateType.js.map +1 -1
- package/build/dist/Types/SSO/DigestMethod.js.map +1 -1
- package/build/dist/Types/SSO/SignatureMethod.js.map +1 -1
- package/build/dist/Types/ScheduledEvent/ScheduledEventState.js.map +1 -1
- package/build/dist/Types/ScreenSizeType.js.map +1 -1
- package/build/dist/Types/SecuritySeverity.js.map +1 -1
- package/build/dist/Types/SerializableObject.js +1 -1
- package/build/dist/Types/SerializableObject.js.map +1 -1
- package/build/dist/Types/SerializableObjectDictionary.js +29 -29
- package/build/dist/Types/SerializableObjectDictionary.js.map +1 -1
- package/build/dist/Types/ServiceCatalog/ServiceLanguage.js +21 -0
- package/build/dist/Types/ServiceCatalog/ServiceLanguage.js.map +1 -0
- package/build/dist/Types/Sleep.js.map +1 -1
- package/build/dist/Types/SmsStatus.js.map +1 -1
- package/build/dist/Types/StatusPage/StatusPageChartType.js.map +1 -1
- package/build/dist/Types/Text.js +35 -35
- package/build/dist/Types/Text.js.map +1 -1
- package/build/dist/Types/Timezone.js.map +1 -1
- package/build/dist/Types/TimezoneCode.js +64 -0
- package/build/dist/Types/TimezoneCode.js.map +1 -0
- package/build/dist/Types/Typeof.js.map +1 -1
- package/build/dist/Types/UserNotification/UserNotificationEventType.js.map +1 -1
- package/build/dist/Types/UserNotification/UserNotificationExecutionStatus.js.map +1 -1
- package/build/dist/Types/UserNotification/UserNotificationStatus.js.map +1 -1
- package/build/dist/Types/UserType.js.map +1 -1
- package/build/dist/Types/Version.js +9 -9
- package/build/dist/Types/Version.js.map +1 -1
- package/build/dist/Types/WebsiteRequest.js +3 -3
- package/build/dist/Types/WebsiteRequest.js.map +1 -1
- package/build/dist/Types/Workflow/Component.js.map +1 -1
- package/build/dist/Types/Workflow/ComponentID.js.map +1 -1
- package/build/dist/Types/Workflow/Components/API.js +139 -139
- package/build/dist/Types/Workflow/Components/API.js.map +1 -1
- package/build/dist/Types/Workflow/Components/BaseModel.js +139 -139
- package/build/dist/Types/Workflow/Components/BaseModel.js.map +1 -1
- package/build/dist/Types/Workflow/Components/Condition.js +27 -27
- package/build/dist/Types/Workflow/Components/Condition.js.map +1 -1
- package/build/dist/Types/Workflow/Components/Email.js +44 -44
- package/build/dist/Types/Workflow/Components/Email.js.map +1 -1
- package/build/dist/Types/Workflow/Components/JSON.js +60 -60
- package/build/dist/Types/Workflow/Components/JSON.js.map +1 -1
- package/build/dist/Types/Workflow/Components/JavaScript.js +26 -26
- package/build/dist/Types/Workflow/Components/JavaScript.js.map +1 -1
- package/build/dist/Types/Workflow/Components/Log.js +15 -15
- package/build/dist/Types/Workflow/Components/Log.js.map +1 -1
- package/build/dist/Types/Workflow/Components/Manual.js +12 -12
- package/build/dist/Types/Workflow/Components/Manual.js.map +1 -1
- package/build/dist/Types/Workflow/Components/MicrosoftTeams.js +26 -26
- package/build/dist/Types/Workflow/Components/MicrosoftTeams.js.map +1 -1
- package/build/dist/Types/Workflow/Components/Schedule.js +12 -12
- package/build/dist/Types/Workflow/Components/Schedule.js.map +1 -1
- package/build/dist/Types/Workflow/Components/Slack.js +26 -26
- package/build/dist/Types/Workflow/Components/Slack.js.map +1 -1
- package/build/dist/Types/Workflow/Components/Webhook.js +20 -20
- package/build/dist/Types/Workflow/Components/Webhook.js.map +1 -1
- package/build/dist/Types/Workflow/Components/Workflow.js +15 -15
- package/build/dist/Types/Workflow/Components/Workflow.js.map +1 -1
- package/build/dist/Types/Workflow/Components.js +33 -33
- package/build/dist/Types/Workflow/Components.js.map +1 -1
- package/build/dist/Types/Workflow/WorkflowPlan.js.map +1 -1
- package/build/dist/Types/Workflow/WorkflowStatus.js.map +1 -1
- package/build/dist/Types/XML.js +3 -3
- package/build/dist/Types/XML.js.map +1 -1
- package/build/dist/Utils/API.js +66 -16
- package/build/dist/Utils/API.js.map +1 -1
- package/build/dist/Utils/Analytics.js +1 -1
- package/build/dist/Utils/Analytics.js.map +1 -1
- package/build/dist/Utils/CronTime.js +7 -7
- package/build/dist/Utils/Enum.js +9 -0
- package/build/dist/Utils/Enum.js.map +1 -0
- package/build/dist/Utils/Faker.js +5 -5
- package/build/dist/Utils/Faker.js.map +1 -1
- package/build/dist/Utils/ObjectUtil.js.map +1 -1
- package/build/dist/Utils/Realtime.js +1 -1
- package/build/dist/Utils/Realtime.js.map +1 -1
- package/build/dist/Utils/Slug.js +3 -3
- package/build/dist/Utils/Slug.js.map +1 -1
- package/build/dist/Utils/UUID.js +1 -1
- package/build/dist/Utils/UUID.js.map +1 -1
- package/jest.config.json +6 -1
- package/package.json +3 -3
package/Types/JSONFunctions.ts
CHANGED
|
@@ -1,399 +1,389 @@
|
|
|
1
|
-
import BaseModel from
|
|
2
|
-
import DatabaseProperty from
|
|
3
|
-
import OneUptimeDate from
|
|
4
|
-
import { JSONArray, JSONObject, JSONValue, ObjectType } from
|
|
5
|
-
import SerializableObject from
|
|
6
|
-
import SerializableObjectDictionary from
|
|
7
|
-
import Typeof from
|
|
8
|
-
import JSON5 from
|
|
1
|
+
import BaseModel from "../Models/BaseModel";
|
|
2
|
+
import DatabaseProperty from "./Database/DatabaseProperty";
|
|
3
|
+
import OneUptimeDate from "./Date";
|
|
4
|
+
import { JSONArray, JSONObject, JSONValue, ObjectType } from "./JSON";
|
|
5
|
+
import SerializableObject from "./SerializableObject";
|
|
6
|
+
import SerializableObjectDictionary from "./SerializableObjectDictionary";
|
|
7
|
+
import Typeof from "./Typeof";
|
|
8
|
+
import JSON5 from "json5";
|
|
9
9
|
|
|
10
10
|
export default class JSONFunctions {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
public static nestJson(obj: JSONObject): JSONObject {
|
|
12
|
+
// obj could be in this format:
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
15
|
* {
|
|
16
16
|
"http.url.protocol": "http",
|
|
17
17
|
"http.url.hostname": "localhost",
|
|
18
18
|
"http.host": "localhost",
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
21
|
+
// we want to convert it to this format:
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* {
|
|
25
|
+
*
|
|
26
|
+
* "http": {
|
|
27
|
+
* "url": {
|
|
28
|
+
* "protocol": "http",
|
|
29
|
+
* "hostname": "localhost"
|
|
30
|
+
* },
|
|
31
|
+
* "host": "localhost",
|
|
32
|
+
* "method": "POST",
|
|
33
|
+
* "scheme": "http",
|
|
34
|
+
* "client_ip": "
|
|
35
|
+
* ...
|
|
36
|
+
*
|
|
37
|
+
* },
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
const result: JSONObject = {};
|
|
41
|
+
|
|
42
|
+
for (const key in obj) {
|
|
43
|
+
const keys: Array<string> = key.split(".");
|
|
44
|
+
|
|
45
|
+
let currentObj: JSONObject = result;
|
|
46
|
+
|
|
47
|
+
for (let i: number = 0; i < keys.length; i++) {
|
|
48
|
+
const k: string | undefined = keys[i];
|
|
49
|
+
|
|
50
|
+
if (!k) {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
44
53
|
|
|
45
|
-
|
|
54
|
+
if (i === keys.length - 1) {
|
|
55
|
+
currentObj[k] = obj[key];
|
|
56
|
+
} else {
|
|
57
|
+
if (!currentObj[k]) {
|
|
58
|
+
currentObj[k] = {};
|
|
59
|
+
}
|
|
46
60
|
|
|
47
|
-
|
|
48
|
-
|
|
61
|
+
currentObj = currentObj[k] as JSONObject;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
49
65
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
53
68
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
69
|
+
public static isEmptyObject(
|
|
70
|
+
obj: JSONObject | BaseModel | null | undefined,
|
|
71
|
+
): boolean {
|
|
72
|
+
if (!obj) {
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
60
75
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
}
|
|
76
|
+
return Object.keys(obj).length === 0;
|
|
77
|
+
}
|
|
65
78
|
|
|
66
|
-
|
|
67
|
-
|
|
79
|
+
public static removeCircularReferences(obj: JSONObject): JSONObject {
|
|
80
|
+
const cache: any[] = [];
|
|
81
|
+
const returnValue: string = JSON.stringify(
|
|
82
|
+
obj,
|
|
83
|
+
(_key: string, value: any) => {
|
|
84
|
+
if (typeof value === "object" && value !== null) {
|
|
85
|
+
if (cache.includes(value)) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
68
88
|
|
|
69
|
-
|
|
70
|
-
obj: JSONObject | BaseModel | null | undefined
|
|
71
|
-
): boolean {
|
|
72
|
-
if (!obj) {
|
|
73
|
-
return true;
|
|
89
|
+
cache.push(value);
|
|
74
90
|
}
|
|
75
91
|
|
|
76
|
-
return
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
public static removeCircularReferences(obj: JSONObject): JSONObject {
|
|
80
|
-
const cache: any[] = [];
|
|
81
|
-
const returnValue: string = JSON.stringify(
|
|
82
|
-
obj,
|
|
83
|
-
(_key: string, value: any) => {
|
|
84
|
-
if (typeof value === 'object' && value !== null) {
|
|
85
|
-
if (cache.includes(value)) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
92
|
+
return value;
|
|
93
|
+
},
|
|
94
|
+
);
|
|
88
95
|
|
|
89
|
-
|
|
90
|
-
|
|
96
|
+
return JSON.parse(returnValue);
|
|
97
|
+
}
|
|
91
98
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
99
|
+
public static isEqualObject(
|
|
100
|
+
obj1: JSONObject | undefined,
|
|
101
|
+
obj2: JSONObject | undefined,
|
|
102
|
+
): boolean {
|
|
103
|
+
// check if all the keys are the same
|
|
95
104
|
|
|
96
|
-
|
|
105
|
+
if (!obj1 && !obj2) {
|
|
106
|
+
return true;
|
|
97
107
|
}
|
|
98
108
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
): boolean {
|
|
103
|
-
// check if all the keys are the same
|
|
109
|
+
if (!obj1 || !obj2) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
104
112
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
113
|
+
const keys1: Array<string> = Object.keys(obj1);
|
|
114
|
+
const keys2: Array<string> = Object.keys(obj2);
|
|
108
115
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
116
|
+
if (keys1.length !== keys2.length) {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
112
119
|
|
|
113
|
-
|
|
114
|
-
|
|
120
|
+
for (const key of keys1) {
|
|
121
|
+
if (!keys2.includes(key)) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
115
125
|
|
|
116
|
-
|
|
117
|
-
return false;
|
|
118
|
-
}
|
|
126
|
+
// check if all the values are the same
|
|
119
127
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
128
|
+
for (const key of keys1) {
|
|
129
|
+
if (obj1[key] !== obj2[key]) {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
125
133
|
|
|
126
|
-
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
127
136
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
}
|
|
137
|
+
public static toCompressedString(val: JSONValue): string {
|
|
138
|
+
return JSON.stringify(val, null, 2);
|
|
139
|
+
}
|
|
133
140
|
|
|
134
|
-
|
|
141
|
+
public static toString(val: JSONValue): string {
|
|
142
|
+
if (typeof val === Typeof.String) {
|
|
143
|
+
return val as string;
|
|
135
144
|
}
|
|
136
145
|
|
|
137
|
-
|
|
138
|
-
|
|
146
|
+
return JSON.stringify(val);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
public static getJSONValueInPath(
|
|
150
|
+
obj: JSONObject,
|
|
151
|
+
path: string,
|
|
152
|
+
): JSONValue | null {
|
|
153
|
+
const paths: Array<string> = path.split(".");
|
|
154
|
+
let returnValue: JSONObject = obj as JSONObject;
|
|
155
|
+
for (const p of paths) {
|
|
156
|
+
if (!p) {
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if (returnValue && returnValue[p as string]!) {
|
|
161
|
+
returnValue = returnValue[p] as JSONObject;
|
|
162
|
+
} else {
|
|
163
|
+
return null;
|
|
164
|
+
}
|
|
139
165
|
}
|
|
140
166
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
return val as string;
|
|
144
|
-
}
|
|
167
|
+
return returnValue as JSONValue;
|
|
168
|
+
}
|
|
145
169
|
|
|
146
|
-
|
|
147
|
-
|
|
170
|
+
// this function serializes JSON with Common Objects to JSON that can be stringified.
|
|
171
|
+
public static serialize(val: JSONObject): JSONObject {
|
|
172
|
+
const newVal: JSONObject = {};
|
|
148
173
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
const paths: Array<string> = path.split('.');
|
|
154
|
-
let returnValue: JSONObject = obj as JSONObject;
|
|
155
|
-
for (const p of paths) {
|
|
156
|
-
if (!p) {
|
|
157
|
-
continue;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
if (returnValue && returnValue[p as string]!) {
|
|
161
|
-
returnValue = returnValue[p] as JSONObject;
|
|
162
|
-
} else {
|
|
163
|
-
return null;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
174
|
+
for (const key in val) {
|
|
175
|
+
if (val[key] === undefined) {
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
166
178
|
|
|
167
|
-
|
|
168
|
-
|
|
179
|
+
if (val[key] === null) {
|
|
180
|
+
newVal[key] = val[key];
|
|
181
|
+
}
|
|
169
182
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
for (const key in val) {
|
|
175
|
-
if (val[key] === undefined) {
|
|
176
|
-
continue;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
if (val[key] === null) {
|
|
180
|
-
newVal[key] = val[key];
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
if (Array.isArray(val[key])) {
|
|
184
|
-
const arraySerialize: Array<JSONValue> = [];
|
|
185
|
-
for (const arrVal of val[key] as Array<JSONValue>) {
|
|
186
|
-
arraySerialize.push(this.serializeValue(arrVal));
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
newVal[key] = arraySerialize;
|
|
190
|
-
} else {
|
|
191
|
-
newVal[key] = this.serializeValue(val[key] as JSONValue);
|
|
192
|
-
}
|
|
183
|
+
if (Array.isArray(val[key])) {
|
|
184
|
+
const arraySerialize: Array<JSONValue> = [];
|
|
185
|
+
for (const arrVal of val[key] as Array<JSONValue>) {
|
|
186
|
+
arraySerialize.push(this.serializeValue(arrVal));
|
|
193
187
|
}
|
|
194
188
|
|
|
195
|
-
|
|
189
|
+
newVal[key] = arraySerialize;
|
|
190
|
+
} else {
|
|
191
|
+
newVal[key] = this.serializeValue(val[key] as JSONValue);
|
|
192
|
+
}
|
|
196
193
|
}
|
|
197
194
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
} else if (typeof val === Typeof.Object) {
|
|
231
|
-
return this.serialize(val as JSONObject);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
return val;
|
|
195
|
+
return newVal;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
public static serializeValue(val: JSONValue): JSONValue {
|
|
199
|
+
if (val === null || val === undefined) {
|
|
200
|
+
return val;
|
|
201
|
+
} else if (typeof val === Typeof.String && val.toString().trim() === "") {
|
|
202
|
+
return val;
|
|
203
|
+
} else if (val instanceof BaseModel) {
|
|
204
|
+
return BaseModel.toJSON(val, BaseModel);
|
|
205
|
+
} else if (typeof val === Typeof.Number) {
|
|
206
|
+
return val;
|
|
207
|
+
} else if (ArrayBuffer.isView(val)) {
|
|
208
|
+
return {
|
|
209
|
+
_type: ObjectType.Buffer,
|
|
210
|
+
value: val as Uint8Array,
|
|
211
|
+
};
|
|
212
|
+
} else if (val && val instanceof SerializableObject) {
|
|
213
|
+
return val.toJSON();
|
|
214
|
+
} else if (val && val instanceof Date) {
|
|
215
|
+
return {
|
|
216
|
+
_type: ObjectType.DateTime,
|
|
217
|
+
value: OneUptimeDate.toString(val as Date).toString(),
|
|
218
|
+
};
|
|
219
|
+
} else if (
|
|
220
|
+
typeof val === Typeof.Object &&
|
|
221
|
+
(val as JSONObject)["_type"] &&
|
|
222
|
+
Object.keys(ObjectType).includes((val as JSONObject)["_type"] as string)
|
|
223
|
+
) {
|
|
224
|
+
return val;
|
|
225
|
+
} else if (typeof val === Typeof.Object) {
|
|
226
|
+
return this.serialize(val as JSONObject);
|
|
235
227
|
}
|
|
236
228
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
)
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
return arr;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
return val;
|
|
229
|
+
return val;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
public static deserializeValue(val: JSONValue): JSONValue {
|
|
233
|
+
if (val === null || val === undefined) {
|
|
234
|
+
return val;
|
|
235
|
+
} else if (typeof val === Typeof.String && val.toString().trim() === "") {
|
|
236
|
+
return val;
|
|
237
|
+
} else if (
|
|
238
|
+
val &&
|
|
239
|
+
typeof val === Typeof.Object &&
|
|
240
|
+
(val as JSONObject)["_type"] &&
|
|
241
|
+
(val as JSONObject)["value"] &&
|
|
242
|
+
((val as JSONObject)["value"] as JSONObject)["data"] &&
|
|
243
|
+
((val as JSONObject)["value"] as JSONObject)["type"] &&
|
|
244
|
+
((val as JSONObject)["value"] as JSONObject)["type"] ===
|
|
245
|
+
ObjectType.Buffer &&
|
|
246
|
+
((val as JSONObject)["_type"] as string) === ObjectType.Buffer
|
|
247
|
+
) {
|
|
248
|
+
return Buffer.from(
|
|
249
|
+
((val as JSONObject)["value"] as JSONObject)["data"] as Uint8Array,
|
|
250
|
+
);
|
|
251
|
+
} else if (val && ArrayBuffer.isView(val)) {
|
|
252
|
+
return Buffer.from(val as Uint8Array);
|
|
253
|
+
} else if (typeof val === Typeof.Number) {
|
|
254
|
+
return val;
|
|
255
|
+
} else if (val instanceof DatabaseProperty) {
|
|
256
|
+
return val;
|
|
257
|
+
} else if (
|
|
258
|
+
val &&
|
|
259
|
+
typeof val === Typeof.Object &&
|
|
260
|
+
(val as JSONObject)["_type"] &&
|
|
261
|
+
SerializableObjectDictionary[(val as JSONObject)["_type"] as string]
|
|
262
|
+
) {
|
|
263
|
+
return SerializableObjectDictionary[
|
|
264
|
+
(val as JSONObject)["_type"] as string
|
|
265
|
+
].fromJSON(val);
|
|
266
|
+
} else if (val instanceof Date) {
|
|
267
|
+
return val;
|
|
268
|
+
} else if (typeof val === Typeof.Object) {
|
|
269
|
+
return this.deserialize(val as JSONObject);
|
|
270
|
+
} else if (Array.isArray(val)) {
|
|
271
|
+
const arr: Array<JSONValue> = [];
|
|
272
|
+
|
|
273
|
+
for (const v of val) {
|
|
274
|
+
arr.push(this.deserializeValue(v));
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
return arr;
|
|
291
278
|
}
|
|
292
279
|
|
|
293
|
-
|
|
294
|
-
|
|
280
|
+
return val;
|
|
281
|
+
}
|
|
295
282
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
}
|
|
283
|
+
public static deserializeArray(array: JSONArray): JSONArray {
|
|
284
|
+
const returnArr: JSONArray = [];
|
|
299
285
|
|
|
300
|
-
|
|
286
|
+
for (const obj of array) {
|
|
287
|
+
returnArr.push(this.deserialize(obj));
|
|
301
288
|
}
|
|
302
289
|
|
|
303
|
-
|
|
304
|
-
|
|
290
|
+
return returnArr;
|
|
291
|
+
}
|
|
305
292
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
}
|
|
293
|
+
public static serializeArray(array: JSONArray): JSONArray {
|
|
294
|
+
const returnArr: JSONArray = [];
|
|
309
295
|
|
|
310
|
-
|
|
296
|
+
for (const obj of array) {
|
|
297
|
+
returnArr.push(this.serialize(obj));
|
|
311
298
|
}
|
|
312
299
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
}
|
|
300
|
+
return returnArr;
|
|
301
|
+
}
|
|
316
302
|
|
|
317
|
-
|
|
318
|
-
|
|
303
|
+
public static parse(val: string): JSONObject | JSONArray {
|
|
304
|
+
return JSON5.parse(val);
|
|
305
|
+
}
|
|
319
306
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
}
|
|
307
|
+
public static parseJSONObject(val: string): JSONObject {
|
|
308
|
+
const result: JSONObject | JSONArray = this.parse(val);
|
|
323
309
|
|
|
324
|
-
|
|
310
|
+
if (Array.isArray(result)) {
|
|
311
|
+
throw new Error("Expected JSONObject, but got JSONArray");
|
|
325
312
|
}
|
|
326
313
|
|
|
327
|
-
|
|
328
|
-
|
|
314
|
+
return result;
|
|
315
|
+
}
|
|
329
316
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
}
|
|
317
|
+
public static parseJSONArray(val: string): JSONArray {
|
|
318
|
+
const result: JSONObject | JSONArray = this.parse(val);
|
|
333
319
|
|
|
334
|
-
|
|
320
|
+
if (!Array.isArray(result)) {
|
|
321
|
+
throw new Error("Expected JSONArray, but got JSONObject");
|
|
335
322
|
}
|
|
336
323
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
} else {
|
|
352
|
-
newVal[key] = this.deserializeValue(val[key] as JSONValue);
|
|
353
|
-
}
|
|
324
|
+
return result;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
public static deserialize(val: JSONObject): JSONObject {
|
|
328
|
+
const newVal: JSONObject = {};
|
|
329
|
+
for (const key in val) {
|
|
330
|
+
if (val[key] === null || val[key] === undefined) {
|
|
331
|
+
newVal[key] = val[key];
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
if (Array.isArray(val[key])) {
|
|
335
|
+
const arraySerialize: Array<JSONValue> = [];
|
|
336
|
+
for (const arrVal of val[key] as Array<JSONValue>) {
|
|
337
|
+
arraySerialize.push(this.deserializeValue(arrVal));
|
|
354
338
|
}
|
|
355
339
|
|
|
356
|
-
|
|
340
|
+
newVal[key] = arraySerialize;
|
|
341
|
+
} else {
|
|
342
|
+
newVal[key] = this.deserializeValue(val[key] as JSONValue);
|
|
343
|
+
}
|
|
357
344
|
}
|
|
358
345
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
}
|
|
346
|
+
return newVal;
|
|
347
|
+
}
|
|
362
348
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
349
|
+
public static toFormattedString(val: JSONValue): string {
|
|
350
|
+
return JSON.stringify(val, null, 4);
|
|
351
|
+
}
|
|
366
352
|
|
|
367
|
-
|
|
368
|
-
|
|
353
|
+
public static anyObjectToJSONObject(val: any): JSONObject {
|
|
354
|
+
return JSON.parse(JSON.stringify(val));
|
|
355
|
+
}
|
|
369
356
|
|
|
370
|
-
|
|
357
|
+
public static flattenObject(val: JSONObject): JSONObject {
|
|
358
|
+
const returnObj: JSONObject = {};
|
|
371
359
|
|
|
372
|
-
|
|
373
|
-
obj: JSONObject,
|
|
374
|
-
prefix: string
|
|
375
|
-
): void => {
|
|
376
|
-
for (const key in obj) {
|
|
377
|
-
if (typeof obj[key] === Typeof.Object) {
|
|
378
|
-
flatten(obj[key] as JSONObject, `${prefix}${key}.`);
|
|
379
|
-
} else {
|
|
380
|
-
returnObj[`${prefix}${key}`] = obj[key];
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
};
|
|
360
|
+
type FlattenFunction = (obj: JSONObject, prefix: string) => void;
|
|
384
361
|
|
|
385
|
-
|
|
362
|
+
const flatten: FlattenFunction = (
|
|
363
|
+
obj: JSONObject,
|
|
364
|
+
prefix: string,
|
|
365
|
+
): void => {
|
|
366
|
+
for (const key in obj) {
|
|
367
|
+
if (typeof obj[key] === Typeof.Object) {
|
|
368
|
+
flatten(obj[key] as JSONObject, `${prefix}${key}.`);
|
|
369
|
+
} else {
|
|
370
|
+
returnObj[`${prefix}${key}`] = obj[key];
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
};
|
|
386
374
|
|
|
387
|
-
|
|
388
|
-
}
|
|
375
|
+
flatten(val, "");
|
|
389
376
|
|
|
390
|
-
|
|
391
|
-
|
|
377
|
+
return returnObj;
|
|
378
|
+
}
|
|
392
379
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
}
|
|
380
|
+
public static flattenArray(val: JSONArray): JSONArray {
|
|
381
|
+
const returnArr: JSONArray = [];
|
|
396
382
|
|
|
397
|
-
|
|
383
|
+
for (const obj of val) {
|
|
384
|
+
returnArr.push(this.flattenObject(obj as JSONObject));
|
|
398
385
|
}
|
|
386
|
+
|
|
387
|
+
return returnArr;
|
|
388
|
+
}
|
|
399
389
|
}
|