@oneuptime/common 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dockerignore +56 -0
- package/AnalyticsModels/BaseModel.ts +456 -0
- package/AnalyticsModels/CommonModel.ts +250 -0
- package/AnalyticsModels/NestedModel.ts +8 -0
- package/Models/AccessControlModel.ts +12 -0
- package/Models/BaseModel.ts +736 -0
- package/Models/FileModel.ts +111 -0
- package/Models/GlobalConfig.ts +8 -0
- package/Models/TenantModel.ts +12 -0
- package/Models/UserModel.ts +12 -0
- package/ServiceRoute.ts +31 -0
- package/Tests/Types/API/ErrorResponse.test.ts +16 -0
- package/Tests/Types/API/HTTPErrorResponse.test.ts +61 -0
- package/Tests/Types/API/HTTPMethod.test.ts +16 -0
- package/Tests/Types/API/Headers.test.ts +14 -0
- package/Tests/Types/API/Hostname.test.ts +21 -0
- package/Tests/Types/API/Protocal.test.ts +19 -0
- package/Tests/Types/API/Response.test.ts +21 -0
- package/Tests/Types/API/ResponseType.test.ts +12 -0
- package/Tests/Types/API/Route.test.ts +29 -0
- package/Tests/Types/API/StatusCode.test.ts +25 -0
- package/Tests/Types/API/URL.test.ts +42 -0
- package/Tests/Types/Alerts/AlertEventType.test.ts +49 -0
- package/Tests/Types/Alerts/AlertType.test.ts +19 -0
- package/Tests/Types/AppEnvironment.test.ts +12 -0
- package/Tests/Types/ApplicationLog/ApplicationLogType.test.ts +13 -0
- package/Tests/Types/ArrayUtil.test.ts +90 -0
- package/Tests/Types/Billing/SubscriptionPlan.test.ts +298 -0
- package/Tests/Types/BrandColors.test.ts +140 -0
- package/Tests/Types/Char.test.ts +83 -0
- package/Tests/Types/Code/CodeType.test.ts +13 -0
- package/Tests/Types/Color.test.ts +44 -0
- package/Tests/Types/Company/CompanySize.test.ts +21 -0
- package/Tests/Types/Company/JobRole.test.ts +22 -0
- package/Tests/Types/Countries.test.ts +303 -0
- package/Tests/Types/Database/ColumnLength.test.ts +55 -0
- package/Tests/Types/Database/ColumnType.test.ts +103 -0
- package/Tests/Types/Database/Columns.test.ts +22 -0
- package/Tests/Types/Database/CompareBase.test.ts +40 -0
- package/Tests/Types/Database/Date.test.ts +82 -0
- package/Tests/Types/Database/EqualToOrNull.test.ts +70 -0
- package/Tests/Types/Database/InBetween.test.ts +80 -0
- package/Tests/Types/Database/LimitMax.test.ts +20 -0
- package/Tests/Types/Database/NotEqual.test.ts +18 -0
- package/Tests/Types/Database/Search.test.ts +10 -0
- package/Tests/Types/DatabaseType.test.ts +7 -0
- package/Tests/Types/Date.test.ts +95 -0
- package/Tests/Types/Dictionary.test.ts +25 -0
- package/Tests/Types/Domain.test.ts +39 -0
- package/Tests/Types/Email/Email.test.ts +69 -0
- package/Tests/Types/EmailWithName.test.ts +49 -0
- package/Tests/Types/EncryptionAlgorithm.test.ts +7 -0
- package/Tests/Types/Exception/ApiException.test.ts +16 -0
- package/Tests/Types/Exception/BadDataException.test.ts +15 -0
- package/Tests/Types/Exception/BadOperationException.test.ts +16 -0
- package/Tests/Types/Exception/BadRequestException.test.ts +15 -0
- package/Tests/Types/Exception/DatabaseNotConnectedException.test.ts +13 -0
- package/Tests/Types/Exception/Exception.test.ts +21 -0
- package/Tests/Types/Exception/NotImplementedException.test.ts +13 -0
- package/Tests/Types/File.test.ts +22 -0
- package/Tests/Types/HashedString.test.ts +20 -0
- package/Tests/Types/Html.test.ts +8 -0
- package/Tests/Types/IP/IP.test.ts +83 -0
- package/Tests/Types/IP/IPType.test.ts +11 -0
- package/Tests/Types/IP/IPv4.test.ts +19 -0
- package/Tests/Types/IP/IPv6.test.ts +19 -0
- package/Tests/Types/JSON.test.ts +38 -0
- package/Tests/Types/JSONFunctions.test.ts +52 -0
- package/Tests/Types/ListData.test.ts +40 -0
- package/Tests/Types/Name.test.ts +26 -0
- package/Tests/Types/ObjectID.test.ts +12 -0
- package/Tests/Types/Permission.test.ts +11 -0
- package/Tests/Types/Phone.test.ts +40 -0
- package/Tests/Types/Port.test.ts +39 -0
- package/Tests/Types/PositiveNumber.test.ts +142 -0
- package/Tests/Types/SecuritySeverity.test.ts +16 -0
- package/Tests/Types/SerializableObject.test.ts +44 -0
- package/Tests/Types/Sleep.test.ts +25 -0
- package/Tests/Types/Text.test.ts +10 -0
- package/Tests/Types/Timezone.test.ts +676 -0
- package/Tests/Types/Typeof.test.ts +19 -0
- package/Tests/Types/UserType.test.ts +16 -0
- package/Tests/Types/Version.test.ts +35 -0
- package/Tests/Types/XML.test.ts +36 -0
- package/Tests/Utils/API.test.ts +425 -0
- package/Tests/Utils/Analytics.test.ts +85 -0
- package/Tests/Utils/CronTime.test.ts +34 -0
- package/Tests/Utils/Faker.test.ts +38 -0
- package/Tests/Utils/Slug.test.ts +22 -0
- package/Tests/Utils/UUID.test.ts +12 -0
- package/Types/API/EmptyResponse.ts +3 -0
- package/Types/API/HTTPErrorResponse.ts +28 -0
- package/Types/API/HTTPMethod.ts +9 -0
- package/Types/API/HTTPResponse.ts +128 -0
- package/Types/API/Headers.ts +4 -0
- package/Types/API/Hostname.ts +118 -0
- package/Types/API/Protocol.ts +10 -0
- package/Types/API/ResponseType.ts +7 -0
- package/Types/API/Route.ts +93 -0
- package/Types/API/StatusCode.ts +45 -0
- package/Types/API/URL.ts +273 -0
- package/Types/Alerts/AlertEventType.ts +14 -0
- package/Types/Alerts/AlertType.ts +9 -0
- package/Types/AnalyticsDatabase/AnalyticsTableEngine.ts +5 -0
- package/Types/AnalyticsDatabase/TableColumn.ts +163 -0
- package/Types/AnalyticsDatabase/TableColumnType.ts +15 -0
- package/Types/AppEnvironment.ts +7 -0
- package/Types/ApplicationLog/ApplicationLogType.ts +7 -0
- package/Types/ArrayUtil.ts +54 -0
- package/Types/BaseDatabase/AccessControl.ts +11 -0
- package/Types/BaseDatabase/ColumnBillingAccessControl.ts +7 -0
- package/Types/BaseDatabase/DatabaseCommonInteractionProps.ts +24 -0
- package/Types/BaseDatabase/DatabaseCommonInteractionPropsUtil.ts +73 -0
- package/Types/BaseDatabase/DatabaseType.ts +6 -0
- package/Types/BaseDatabase/EnableWorkflowOn.ts +6 -0
- package/Types/BaseDatabase/EqualToOrNull.ts +37 -0
- package/Types/BaseDatabase/GreaterThan.ts +24 -0
- package/Types/BaseDatabase/GreaterThanOrEqual.ts +24 -0
- package/Types/BaseDatabase/InBetween.ts +77 -0
- package/Types/BaseDatabase/Includes.ts +47 -0
- package/Types/BaseDatabase/IsNull.ts +28 -0
- package/Types/BaseDatabase/LessThan.ts +24 -0
- package/Types/BaseDatabase/LessThanOrEqual.ts +24 -0
- package/Types/BaseDatabase/ModelPermission.ts +37 -0
- package/Types/BaseDatabase/NotEqual.ts +37 -0
- package/Types/BaseDatabase/NotNull.ts +28 -0
- package/Types/BaseDatabase/Search.ts +39 -0
- package/Types/BaseDatabase/SortOrder.ts +6 -0
- package/Types/BaseDatabase/TableBillingAccessControl.ts +8 -0
- package/Types/Billing/MeteredPlan.ts +27 -0
- package/Types/Billing/SubscriptionPlan.ts +241 -0
- package/Types/Billing/SubscriptionStatus.ts +32 -0
- package/Types/BrandColors.ts +35 -0
- package/Types/Calendar/CalendarEvent.ts +12 -0
- package/Types/Call/CallRequest.ts +43 -0
- package/Types/Call/CallStatus.ts +9 -0
- package/Types/CallAndSMS/TwilioConfig.ts +7 -0
- package/Types/Char.ts +65 -0
- package/Types/Code/CodeType.ts +11 -0
- package/Types/Color.ts +108 -0
- package/Types/Company/CompanySize.ts +9 -0
- package/Types/Company/JobRole.ts +10 -0
- package/Types/Countries.ts +247 -0
- package/Types/Currency.ts +34 -0
- package/Types/CustomField/CustomFieldType.ts +7 -0
- package/Types/Database/AccessControl/AllowAccessIfSubscriptionIsUnpaid.ts +7 -0
- package/Types/Database/AccessControl/ColumnAccessControl.ts +49 -0
- package/Types/Database/AccessControl/ColumnBillingAccessControl.ts +51 -0
- package/Types/Database/AccessControl/TableAccessControl.ts +22 -0
- package/Types/Database/AccessControl/TableBillingAccessControl.ts +22 -0
- package/Types/Database/AccessControlColumn.ts +7 -0
- package/Types/Database/AllowUserQueryWithoutTenant.ts +7 -0
- package/Types/Database/CanAccessIfCanReadOn.ts +10 -0
- package/Types/Database/ColumnLength.ts +72 -0
- package/Types/Database/ColumnType.ts +37 -0
- package/Types/Database/Columns.ts +21 -0
- package/Types/Database/CompareBase.ts +38 -0
- package/Types/Database/CrudApiEndpoint.ts +8 -0
- package/Types/Database/CurrentUserCanAccessRecordBy.ts +7 -0
- package/Types/Database/DatabaseProperty.ts +51 -0
- package/Types/Database/Date.ts +28 -0
- package/Types/Database/EnableDocumentation.ts +13 -0
- package/Types/Database/EnableWorkflow.ts +8 -0
- package/Types/Database/IsPermissionsIf.ts +18 -0
- package/Types/Database/LabelsColumn.ts +7 -0
- package/Types/Database/LimitMax.ts +4 -0
- package/Types/Database/MultiTenentQueryAllowed.ts +7 -0
- package/Types/Database/PartialEntity.ts +3 -0
- package/Types/Database/SlugifyColumn.ts +8 -0
- package/Types/Database/TableColumn.ts +66 -0
- package/Types/Database/TableColumnType.ts +43 -0
- package/Types/Database/TableMetadata.ts +18 -0
- package/Types/Database/TenantColumn.ts +7 -0
- package/Types/Database/TotalItemsBy.ts +13 -0
- package/Types/Database/UniqueColumnBy.ts +49 -0
- package/Types/DatabaseType.ts +6 -0
- package/Types/Date.ts +1032 -0
- package/Types/Day/DayOfWeek.ts +32 -0
- package/Types/Decimal.ts +78 -0
- package/Types/Dictionary.ts +3 -0
- package/Types/DiskSize.ts +46 -0
- package/Types/Domain.ts +94 -0
- package/Types/Email/EmailBody.ts +4 -0
- package/Types/Email/EmailMessage.ts +14 -0
- package/Types/Email/EmailServer.ts +15 -0
- package/Types/Email/EmailTemplate.ts +8 -0
- package/Types/Email/EmailTemplateType.ts +39 -0
- package/Types/Email.ts +121 -0
- package/Types/EmailWithName.ts +35 -0
- package/Types/EncryptionAlgorithm.ts +5 -0
- package/Types/Events/EventInterval.ts +9 -0
- package/Types/Events/Recurring.ts +119 -0
- package/Types/Exception/ApiException.ts +8 -0
- package/Types/Exception/BadDataException.ts +8 -0
- package/Types/Exception/BadOperationException.ts +8 -0
- package/Types/Exception/BadRequestException.ts +8 -0
- package/Types/Exception/DatabaseNotConnectedException.ts +11 -0
- package/Types/Exception/Exception.ts +22 -0
- package/Types/Exception/ExceptionCode.ts +21 -0
- package/Types/Exception/NotAuthenticatedException.ts +8 -0
- package/Types/Exception/NotAuthorizedException.ts +8 -0
- package/Types/Exception/NotFoundException.ts +8 -0
- package/Types/Exception/NotImplementedException.ts +11 -0
- package/Types/Exception/PaymentRequiredException.ts +8 -0
- package/Types/Exception/ServerException.ts +8 -0
- package/Types/Exception/SsoAuthorizationException.ts +17 -0
- package/Types/Exception/TenantNotFoundException.ts +8 -0
- package/Types/Exception/TimeoutException.ts +8 -0
- package/Types/Exception/UnableToReachServer.ts +8 -0
- package/Types/Exception/WebsiteRequestException.ts +8 -0
- package/Types/File/MimeType.ts +12 -0
- package/Types/File.ts +4 -0
- package/Types/Filter/Filter.ts +1 -0
- package/Types/Filter/FilterCondition.ts +6 -0
- package/Types/Filter/FilterType.ts +10 -0
- package/Types/FunctionTypes.ts +4 -0
- package/Types/GenericFunction.ts +4 -0
- package/Types/GenericObject.ts +4 -0
- package/Types/HashCode.ts +11 -0
- package/Types/HashedString.ts +105 -0
- package/Types/Html.ts +17 -0
- package/Types/IP/IP.ts +114 -0
- package/Types/IP/IPType.ts +6 -0
- package/Types/IP/IPv4.ts +12 -0
- package/Types/IP/IPv6.ts +12 -0
- package/Types/Icon/IconProp.ts +125 -0
- package/Types/IncomingRequest/IncomingRequestCustomFields.ts +1 -0
- package/Types/Infrastructure/BasicMetrics.ts +26 -0
- package/Types/Infrastructure/OSType.ts +8 -0
- package/Types/JSON.ts +151 -0
- package/Types/JSONFunctions.ts +265 -0
- package/Types/JsonWebTokenData.ts +13 -0
- package/Types/Link.ts +8 -0
- package/Types/ListData.ts +32 -0
- package/Types/Mail/MailStatus.ts +6 -0
- package/Types/Mixins.ts +5 -0
- package/Types/Monitor/CriteriaFilter.ts +52 -0
- package/Types/Monitor/CriteriaIncident.ts +10 -0
- package/Types/Monitor/IncomingMonitor/IncomingMonitorRequest.ts +11 -0
- package/Types/Monitor/MonitorCriteria.ts +188 -0
- package/Types/Monitor/MonitorCriteriaInstance.ts +520 -0
- package/Types/Monitor/MonitorStep.ts +306 -0
- package/Types/Monitor/MonitorSteps.ts +192 -0
- package/Types/Monitor/MonitorType.ts +114 -0
- package/Types/Monitor/ServerMonitor/ServerMonitorResponse.ts +9 -0
- package/Types/Monitor/schema.json +39 -0
- package/Types/Name.ts +86 -0
- package/Types/NotificationRule/NotificationRuleType.ts +7 -0
- package/Types/NotificationSetting/NotificationSettingEventType.ts +25 -0
- package/Types/ObjectID.ts +94 -0
- package/Types/ObjectUtil.ts +0 -0
- package/Types/OnCallDutyPolicy/Layer.ts +1018 -0
- package/Types/OnCallDutyPolicy/OnCalDutyExecutionLogTimelineStatus.ts +10 -0
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyAlertStatus.ts +7 -0
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyStatus.ts +9 -0
- package/Types/OnCallDutyPolicy/RestrictionTimes.ts +193 -0
- package/Types/Operation/OperationResult.ts +6 -0
- package/Types/Operation/OperationStatus.ts +9 -0
- package/Types/Permission.ts +3293 -0
- package/Types/Phone.ts +75 -0
- package/Types/Port.ts +92 -0
- package/Types/PositiveNumber.ts +79 -0
- package/Types/PricingPlan.ts +7 -0
- package/Types/Probe/ProbeApiIngestResponse.ts +9 -0
- package/Types/Probe/ProbeMonitorResponse.ts +15 -0
- package/Types/Reflection.ts +7 -0
- package/Types/SMS/SMS.ts +9 -0
- package/Types/SMS/SmsTemplateType.ts +13 -0
- package/Types/SSO/DigestMethod.ts +8 -0
- package/Types/SSO/SignatureMethod.ts +8 -0
- package/Types/ScheduledEvent/ScheduledEventState.ts +8 -0
- package/Types/SecuritySeverity.ts +8 -0
- package/Types/SerializableObject.ts +18 -0
- package/Types/SerializableObjectDictionary.ts +63 -0
- package/Types/Sleep.ts +9 -0
- package/Types/SmsStatus.ts +7 -0
- package/Types/StatusPage/StatusPageChartType.ts +10 -0
- package/Types/Text.ts +152 -0
- package/Types/Time/StartAndEndTime.ts +4 -0
- package/Types/Timezone.ts +595 -0
- package/Types/Typeof.ts +8 -0
- package/Types/UserNotification/UserNotificationEventType.ts +5 -0
- package/Types/UserNotification/UserNotificationExecutionStatus.ts +9 -0
- package/Types/UserNotification/UserNotificationStatus.ts +9 -0
- package/Types/UserType.ts +8 -0
- package/Types/Version.ts +66 -0
- package/Types/WebsiteRequest.ts +66 -0
- package/Types/Workflow/Component.ts +99 -0
- package/Types/Workflow/ComponentID.ts +20 -0
- package/Types/Workflow/Components/API.ts +363 -0
- package/Types/Workflow/Components/BaseModel.ts +590 -0
- package/Types/Workflow/Components/Condition.ts +66 -0
- package/Types/Workflow/Components/Email.ts +109 -0
- package/Types/Workflow/Components/JSON.ts +162 -0
- package/Types/Workflow/Components/JavaScript.ts +67 -0
- package/Types/Workflow/Components/Log.ts +45 -0
- package/Types/Workflow/Components/Manual.ts +40 -0
- package/Types/Workflow/Components/MicrosoftTeams.ts +69 -0
- package/Types/Workflow/Components/Schedule.ts +38 -0
- package/Types/Workflow/Components/Slack.ts +70 -0
- package/Types/Workflow/Components/Webhook.ts +58 -0
- package/Types/Workflow/Components/Workflow.ts +44 -0
- package/Types/Workflow/Components.ts +78 -0
- package/Types/Workflow/WorkflowPlan.ts +8 -0
- package/Types/Workflow/WorkflowStatus.ts +10 -0
- package/Types/XML.ts +21 -0
- package/Typings/Index.d.ts +3 -0
- package/Utils/API.ts +348 -0
- package/Utils/Analytics.ts +42 -0
- package/Utils/CronTime.ts +6 -0
- package/Utils/Faker.ts +34 -0
- package/Utils/Realtime.ts +39 -0
- package/Utils/Slug.ts +21 -0
- package/Utils/UUID.ts +7 -0
- package/build/dist/AnalyticsModels/BaseModel.js +310 -0
- package/build/dist/AnalyticsModels/BaseModel.js.map +1 -0
- package/build/dist/AnalyticsModels/CommonModel.js +135 -0
- package/build/dist/AnalyticsModels/CommonModel.js.map +1 -0
- package/build/dist/AnalyticsModels/NestedModel.js +7 -0
- package/build/dist/AnalyticsModels/NestedModel.js.map +1 -0
- package/build/dist/Models/AccessControlModel.js +10 -0
- package/build/dist/Models/AccessControlModel.js.map +1 -0
- package/build/dist/Models/BaseModel.js +454 -0
- package/build/dist/Models/BaseModel.js.map +1 -0
- package/build/dist/Models/FileModel.js +133 -0
- package/build/dist/Models/FileModel.js.map +1 -0
- package/build/dist/Models/GlobalConfig.js +7 -0
- package/build/dist/Models/GlobalConfig.js.map +1 -0
- package/build/dist/Models/TenantModel.js +10 -0
- package/build/dist/Models/TenantModel.js.map +1 -0
- package/build/dist/Models/UserModel.js +10 -0
- package/build/dist/Models/UserModel.js.map +1 -0
- package/build/dist/ServiceRoute.js +17 -0
- package/build/dist/ServiceRoute.js.map +1 -0
- package/build/dist/Tests/Types/API/ErrorResponse.test.js +13 -0
- package/build/dist/Tests/Types/API/ErrorResponse.test.js.map +1 -0
- package/build/dist/Tests/Types/API/HTTPErrorResponse.test.js +32 -0
- package/build/dist/Tests/Types/API/HTTPErrorResponse.test.js.map +1 -0
- package/build/dist/Tests/Types/API/HTTPMethod.test.js +16 -0
- package/build/dist/Tests/Types/API/HTTPMethod.test.js.map +1 -0
- package/build/dist/Tests/Types/API/Headers.test.js +14 -0
- package/build/dist/Tests/Types/API/Headers.test.js.map +1 -0
- package/build/dist/Tests/Types/API/Hostname.test.js +22 -0
- package/build/dist/Tests/Types/API/Hostname.test.js.map +1 -0
- package/build/dist/Tests/Types/API/Protocal.test.js +19 -0
- package/build/dist/Tests/Types/API/Protocal.test.js.map +1 -0
- package/build/dist/Tests/Types/API/Response.test.js +14 -0
- package/build/dist/Tests/Types/API/Response.test.js.map +1 -0
- package/build/dist/Tests/Types/API/ResponseType.test.js +13 -0
- package/build/dist/Tests/Types/API/ResponseType.test.js.map +1 -0
- package/build/dist/Tests/Types/API/Route.test.js +30 -0
- package/build/dist/Tests/Types/API/Route.test.js.map +1 -0
- package/build/dist/Tests/Types/API/StatusCode.test.js +26 -0
- package/build/dist/Tests/Types/API/StatusCode.test.js.map +1 -0
- package/build/dist/Tests/Types/API/URL.test.js +33 -0
- package/build/dist/Tests/Types/API/URL.test.js.map +1 -0
- package/build/dist/Tests/Types/Alerts/AlertEventType.test.js +34 -0
- package/build/dist/Tests/Types/Alerts/AlertEventType.test.js.map +1 -0
- package/build/dist/Tests/Types/Alerts/AlertType.test.js +19 -0
- package/build/dist/Tests/Types/Alerts/AlertType.test.js.map +1 -0
- package/build/dist/Tests/Types/AppEnvironment.test.js +13 -0
- package/build/dist/Tests/Types/AppEnvironment.test.js.map +1 -0
- package/build/dist/Tests/Types/ApplicationLog/ApplicationLogType.test.js +13 -0
- package/build/dist/Tests/Types/ApplicationLog/ApplicationLogType.test.js.map +1 -0
- package/build/dist/Tests/Types/ArrayUtil.test.js +71 -0
- package/build/dist/Tests/Types/ArrayUtil.test.js.map +1 -0
- package/build/dist/Tests/Types/Billing/SubscriptionPlan.test.js +178 -0
- package/build/dist/Tests/Types/Billing/SubscriptionPlan.test.js.map +1 -0
- package/build/dist/Tests/Types/BrandColors.test.js +123 -0
- package/build/dist/Tests/Types/BrandColors.test.js.map +1 -0
- package/build/dist/Tests/Types/Char.test.js +82 -0
- package/build/dist/Tests/Types/Char.test.js.map +1 -0
- package/build/dist/Tests/Types/Code/CodeType.test.js +13 -0
- package/build/dist/Tests/Types/Code/CodeType.test.js.map +1 -0
- package/build/dist/Tests/Types/Color.test.js +44 -0
- package/build/dist/Tests/Types/Color.test.js.map +1 -0
- package/build/dist/Tests/Types/Company/CompanySize.test.js +20 -0
- package/build/dist/Tests/Types/Company/CompanySize.test.js.map +1 -0
- package/build/dist/Tests/Types/Company/JobRole.test.js +22 -0
- package/build/dist/Tests/Types/Company/JobRole.test.js.map +1 -0
- package/build/dist/Tests/Types/Countries.test.js +249 -0
- package/build/dist/Tests/Types/Countries.test.js.map +1 -0
- package/build/dist/Tests/Types/Database/ColumnLength.test.js +43 -0
- package/build/dist/Tests/Types/Database/ColumnLength.test.js.map +1 -0
- package/build/dist/Tests/Types/Database/ColumnType.test.js +79 -0
- package/build/dist/Tests/Types/Database/ColumnType.test.js.map +1 -0
- package/build/dist/Tests/Types/Database/Columns.test.js +20 -0
- package/build/dist/Tests/Types/Database/Columns.test.js.map +1 -0
- package/build/dist/Tests/Types/Database/CompareBase.test.js +36 -0
- package/build/dist/Tests/Types/Database/CompareBase.test.js.map +1 -0
- package/build/dist/Tests/Types/Database/Date.test.js +61 -0
- package/build/dist/Tests/Types/Database/Date.test.js.map +1 -0
- package/build/dist/Tests/Types/Database/EqualToOrNull.test.js +61 -0
- package/build/dist/Tests/Types/Database/EqualToOrNull.test.js.map +1 -0
- package/build/dist/Tests/Types/Database/InBetween.test.js +71 -0
- package/build/dist/Tests/Types/Database/InBetween.test.js.map +1 -0
- package/build/dist/Tests/Types/Database/LimitMax.test.js +18 -0
- package/build/dist/Tests/Types/Database/LimitMax.test.js.map +1 -0
- package/build/dist/Tests/Types/Database/NotEqual.test.js +18 -0
- package/build/dist/Tests/Types/Database/NotEqual.test.js.map +1 -0
- package/build/dist/Tests/Types/Database/Search.test.js +10 -0
- package/build/dist/Tests/Types/Database/Search.test.js.map +1 -0
- package/build/dist/Tests/Types/DatabaseType.test.js +7 -0
- package/build/dist/Tests/Types/DatabaseType.test.js.map +1 -0
- package/build/dist/Tests/Types/Date.test.js +55 -0
- package/build/dist/Tests/Types/Date.test.js.map +1 -0
- package/build/dist/Tests/Types/Dictionary.test.js +25 -0
- package/build/dist/Tests/Types/Dictionary.test.js.map +1 -0
- package/build/dist/Tests/Types/Domain.test.js +38 -0
- package/build/dist/Tests/Types/Domain.test.js.map +1 -0
- package/build/dist/Tests/Types/Email/Email.test.js +51 -0
- package/build/dist/Tests/Types/Email/Email.test.js.map +1 -0
- package/build/dist/Tests/Types/EmailWithName.test.js +36 -0
- package/build/dist/Tests/Types/EmailWithName.test.js.map +1 -0
- package/build/dist/Tests/Types/EncryptionAlgorithm.test.js +7 -0
- package/build/dist/Tests/Types/EncryptionAlgorithm.test.js.map +1 -0
- package/build/dist/Tests/Types/Exception/ApiException.test.js +11 -0
- package/build/dist/Tests/Types/Exception/ApiException.test.js.map +1 -0
- package/build/dist/Tests/Types/Exception/BadDataException.test.js +12 -0
- package/build/dist/Tests/Types/Exception/BadDataException.test.js.map +1 -0
- package/build/dist/Tests/Types/Exception/BadOperationException.test.js +11 -0
- package/build/dist/Tests/Types/Exception/BadOperationException.test.js.map +1 -0
- package/build/dist/Tests/Types/Exception/BadRequestException.test.js +12 -0
- package/build/dist/Tests/Types/Exception/BadRequestException.test.js.map +1 -0
- package/build/dist/Tests/Types/Exception/DatabaseNotConnectedException.test.js +10 -0
- package/build/dist/Tests/Types/Exception/DatabaseNotConnectedException.test.js.map +1 -0
- package/build/dist/Tests/Types/Exception/Exception.test.js +15 -0
- package/build/dist/Tests/Types/Exception/Exception.test.js.map +1 -0
- package/build/dist/Tests/Types/Exception/NotImplementedException.test.js +12 -0
- package/build/dist/Tests/Types/Exception/NotImplementedException.test.js.map +1 -0
- package/build/dist/Tests/Types/File.test.js +22 -0
- package/build/dist/Tests/Types/File.test.js.map +1 -0
- package/build/dist/Tests/Types/HashedString.test.js +18 -0
- package/build/dist/Tests/Types/HashedString.test.js.map +1 -0
- package/build/dist/Tests/Types/Html.test.js +8 -0
- package/build/dist/Tests/Types/Html.test.js.map +1 -0
- package/build/dist/Tests/Types/IP/IP.test.js +65 -0
- package/build/dist/Tests/Types/IP/IP.test.js.map +1 -0
- package/build/dist/Tests/Types/IP/IPType.test.js +10 -0
- package/build/dist/Tests/Types/IP/IPType.test.js.map +1 -0
- package/build/dist/Tests/Types/IP/IPv4.test.js +17 -0
- package/build/dist/Tests/Types/IP/IPv4.test.js.map +1 -0
- package/build/dist/Tests/Types/IP/IPv6.test.js +17 -0
- package/build/dist/Tests/Types/IP/IPv6.test.js.map +1 -0
- package/build/dist/Tests/Types/JSON.test.js +34 -0
- package/build/dist/Tests/Types/JSON.test.js.map +1 -0
- package/build/dist/Tests/Types/JSONFunctions.test.js +38 -0
- package/build/dist/Tests/Types/JSONFunctions.test.js.map +1 -0
- package/build/dist/Tests/Types/ListData.test.js +34 -0
- package/build/dist/Tests/Types/ListData.test.js.map +1 -0
- package/build/dist/Tests/Types/Name.test.js +26 -0
- package/build/dist/Tests/Types/Name.test.js.map +1 -0
- package/build/dist/Tests/Types/ObjectID.test.js +12 -0
- package/build/dist/Tests/Types/ObjectID.test.js.map +1 -0
- package/build/dist/Tests/Types/Permission.test.js +10 -0
- package/build/dist/Tests/Types/Permission.test.js.map +1 -0
- package/build/dist/Tests/Types/Phone.test.js +37 -0
- package/build/dist/Tests/Types/Phone.test.js.map +1 -0
- package/build/dist/Tests/Types/Port.test.js +35 -0
- package/build/dist/Tests/Types/Port.test.js.map +1 -0
- package/build/dist/Tests/Types/PositiveNumber.test.js +101 -0
- package/build/dist/Tests/Types/PositiveNumber.test.js.map +1 -0
- package/build/dist/Tests/Types/SecuritySeverity.test.js +16 -0
- package/build/dist/Tests/Types/SecuritySeverity.test.js.map +1 -0
- package/build/dist/Tests/Types/SerializableObject.test.js +35 -0
- package/build/dist/Tests/Types/SerializableObject.test.js.map +1 -0
- package/build/dist/Tests/Types/Sleep.test.js +18 -0
- package/build/dist/Tests/Types/Sleep.test.js.map +1 -0
- package/build/dist/Tests/Types/Text.test.js +8 -0
- package/build/dist/Tests/Types/Text.test.js.map +1 -0
- package/build/dist/Tests/Types/Timezone.test.js +596 -0
- package/build/dist/Tests/Types/Timezone.test.js.map +1 -0
- package/build/dist/Tests/Types/Typeof.test.js +16 -0
- package/build/dist/Tests/Types/Typeof.test.js.map +1 -0
- package/build/dist/Tests/Types/UserType.test.js +16 -0
- package/build/dist/Tests/Types/UserType.test.js.map +1 -0
- package/build/dist/Tests/Types/Version.test.js +35 -0
- package/build/dist/Tests/Types/Version.test.js.map +1 -0
- package/build/dist/Tests/Types/XML.test.js +35 -0
- package/build/dist/Tests/Types/XML.test.js.map +1 -0
- package/build/dist/Tests/Utils/API.test.js +286 -0
- package/build/dist/Tests/Utils/API.test.js.map +1 -0
- package/build/dist/Tests/Utils/Analytics.test.js +66 -0
- package/build/dist/Tests/Utils/Analytics.test.js.map +1 -0
- package/build/dist/Tests/Utils/CronTime.test.js +22 -0
- package/build/dist/Tests/Utils/CronTime.test.js.map +1 -0
- package/build/dist/Tests/Utils/Faker.test.js +26 -0
- package/build/dist/Tests/Utils/Faker.test.js.map +1 -0
- package/build/dist/Tests/Utils/Slug.test.js +20 -0
- package/build/dist/Tests/Utils/Slug.test.js.map +1 -0
- package/build/dist/Tests/Utils/UUID.test.js +10 -0
- package/build/dist/Tests/Utils/UUID.test.js.map +1 -0
- package/build/dist/Types/API/EmptyResponse.js +2 -0
- package/build/dist/Types/API/EmptyResponse.js.map +1 -0
- package/build/dist/Types/API/HTTPErrorResponse.js +21 -0
- package/build/dist/Types/API/HTTPErrorResponse.js.map +1 -0
- package/build/dist/Types/API/HTTPMethod.js +10 -0
- package/build/dist/Types/API/HTTPMethod.js.map +1 -0
- package/build/dist/Types/API/HTTPResponse.js +96 -0
- package/build/dist/Types/API/HTTPResponse.js.map +1 -0
- package/build/dist/Types/API/Headers.js +2 -0
- package/build/dist/Types/API/Headers.js.map +1 -0
- package/build/dist/Types/API/Hostname.js +93 -0
- package/build/dist/Types/API/Hostname.js.map +1 -0
- package/build/dist/Types/API/Protocol.js +11 -0
- package/build/dist/Types/API/Protocol.js.map +1 -0
- package/build/dist/Types/API/ResponseType.js +8 -0
- package/build/dist/Types/API/ResponseType.js.map +1 -0
- package/build/dist/Types/API/Route.js +74 -0
- package/build/dist/Types/API/Route.js.map +1 -0
- package/build/dist/Types/API/StatusCode.js +38 -0
- package/build/dist/Types/API/StatusCode.js.map +1 -0
- package/build/dist/Types/API/URL.js +206 -0
- package/build/dist/Types/API/URL.js.map +1 -0
- package/build/dist/Types/Alerts/AlertEventType.js +15 -0
- package/build/dist/Types/Alerts/AlertEventType.js.map +1 -0
- package/build/dist/Types/Alerts/AlertType.js +10 -0
- package/build/dist/Types/Alerts/AlertType.js.map +1 -0
- package/build/dist/Types/AnalyticsDatabase/AnalyticsTableEngine.js +6 -0
- package/build/dist/Types/AnalyticsDatabase/AnalyticsTableEngine.js.map +1 -0
- package/build/dist/Types/AnalyticsDatabase/TableColumn.js +114 -0
- package/build/dist/Types/AnalyticsDatabase/TableColumn.js.map +1 -0
- package/build/dist/Types/AnalyticsDatabase/TableColumnType.js +16 -0
- package/build/dist/Types/AnalyticsDatabase/TableColumnType.js.map +1 -0
- package/build/dist/Types/AppEnvironment.js +8 -0
- package/build/dist/Types/AppEnvironment.js.map +1 -0
- package/build/dist/Types/ApplicationLog/ApplicationLogType.js +8 -0
- package/build/dist/Types/ApplicationLog/ApplicationLogType.js.map +1 -0
- package/build/dist/Types/ArrayUtil.js +44 -0
- package/build/dist/Types/ArrayUtil.js.map +1 -0
- package/build/dist/Types/BaseDatabase/AccessControl.js +2 -0
- package/build/dist/Types/BaseDatabase/AccessControl.js.map +1 -0
- package/build/dist/Types/BaseDatabase/ColumnBillingAccessControl.js +2 -0
- package/build/dist/Types/BaseDatabase/ColumnBillingAccessControl.js.map +1 -0
- package/build/dist/Types/BaseDatabase/DatabaseCommonInteractionProps.js +2 -0
- package/build/dist/Types/BaseDatabase/DatabaseCommonInteractionProps.js.map +1 -0
- package/build/dist/Types/BaseDatabase/DatabaseCommonInteractionPropsUtil.js +49 -0
- package/build/dist/Types/BaseDatabase/DatabaseCommonInteractionPropsUtil.js.map +1 -0
- package/build/dist/Types/BaseDatabase/DatabaseType.js +7 -0
- package/build/dist/Types/BaseDatabase/DatabaseType.js.map +1 -0
- package/build/dist/Types/BaseDatabase/EnableWorkflowOn.js +2 -0
- package/build/dist/Types/BaseDatabase/EnableWorkflowOn.js.map +1 -0
- package/build/dist/Types/BaseDatabase/EqualToOrNull.js +31 -0
- package/build/dist/Types/BaseDatabase/EqualToOrNull.js.map +1 -0
- package/build/dist/Types/BaseDatabase/GreaterThan.js +21 -0
- package/build/dist/Types/BaseDatabase/GreaterThan.js.map +1 -0
- package/build/dist/Types/BaseDatabase/GreaterThanOrEqual.js +21 -0
- package/build/dist/Types/BaseDatabase/GreaterThanOrEqual.js.map +1 -0
- package/build/dist/Types/BaseDatabase/InBetween.js +57 -0
- package/build/dist/Types/BaseDatabase/InBetween.js.map +1 -0
- package/build/dist/Types/BaseDatabase/Includes.js +34 -0
- package/build/dist/Types/BaseDatabase/Includes.js.map +1 -0
- package/build/dist/Types/BaseDatabase/IsNull.js +24 -0
- package/build/dist/Types/BaseDatabase/IsNull.js.map +1 -0
- package/build/dist/Types/BaseDatabase/LessThan.js +21 -0
- package/build/dist/Types/BaseDatabase/LessThan.js.map +1 -0
- package/build/dist/Types/BaseDatabase/LessThanOrEqual.js +21 -0
- package/build/dist/Types/BaseDatabase/LessThanOrEqual.js.map +1 -0
- package/build/dist/Types/BaseDatabase/ModelPermission.js +19 -0
- package/build/dist/Types/BaseDatabase/ModelPermission.js.map +1 -0
- package/build/dist/Types/BaseDatabase/NotEqual.js +31 -0
- package/build/dist/Types/BaseDatabase/NotEqual.js.map +1 -0
- package/build/dist/Types/BaseDatabase/NotNull.js +24 -0
- package/build/dist/Types/BaseDatabase/NotNull.js.map +1 -0
- package/build/dist/Types/BaseDatabase/Search.js +31 -0
- package/build/dist/Types/BaseDatabase/Search.js.map +1 -0
- package/build/dist/Types/BaseDatabase/SortOrder.js +7 -0
- package/build/dist/Types/BaseDatabase/SortOrder.js.map +1 -0
- package/build/dist/Types/BaseDatabase/TableBillingAccessControl.js +2 -0
- package/build/dist/Types/BaseDatabase/TableBillingAccessControl.js.map +1 -0
- package/build/dist/Types/BaseDatabase/TableColumnType.js +44 -0
- package/build/dist/Types/BaseDatabase/TableColumnType.js.map +1 -0
- package/build/dist/Types/Billing/MeteredPlan.js +17 -0
- package/build/dist/Types/Billing/MeteredPlan.js.map +1 -0
- package/build/dist/Types/Billing/SubscriptionPlan.js +139 -0
- package/build/dist/Types/Billing/SubscriptionPlan.js.map +1 -0
- package/build/dist/Types/Billing/SubscriptionStatus.js +24 -0
- package/build/dist/Types/Billing/SubscriptionStatus.js.map +1 -0
- package/build/dist/Types/BrandColors.js +31 -0
- package/build/dist/Types/BrandColors.js.map +1 -0
- package/build/dist/Types/Calendar/CalendarEvent.js +2 -0
- package/build/dist/Types/Calendar/CalendarEvent.js.map +1 -0
- package/build/dist/Types/Call/CallRequest.js +11 -0
- package/build/dist/Types/Call/CallRequest.js.map +1 -0
- package/build/dist/Types/Call/CallStatus.js +10 -0
- package/build/dist/Types/Call/CallStatus.js.map +1 -0
- package/build/dist/Types/CallAndSMS/TwilioConfig.js +2 -0
- package/build/dist/Types/CallAndSMS/TwilioConfig.js.map +1 -0
- package/build/dist/Types/Char.js +2 -0
- package/build/dist/Types/Char.js.map +1 -0
- package/build/dist/Types/Code/CodeType.js +12 -0
- package/build/dist/Types/Code/CodeType.js.map +1 -0
- package/build/dist/Types/Color.js +78 -0
- package/build/dist/Types/Color.js.map +1 -0
- package/build/dist/Types/Company/CompanySize.js +10 -0
- package/build/dist/Types/Company/CompanySize.js.map +1 -0
- package/build/dist/Types/Company/JobRole.js +11 -0
- package/build/dist/Types/Company/JobRole.js.map +1 -0
- package/build/dist/Types/Countries.js +248 -0
- package/build/dist/Types/Countries.js.map +1 -0
- package/build/dist/Types/Currency.js +21 -0
- package/build/dist/Types/Currency.js.map +1 -0
- package/build/dist/Types/CustomField/CustomFieldType.js +8 -0
- package/build/dist/Types/CustomField/CustomFieldType.js.map +1 -0
- package/build/dist/Types/Database/AccessControl/AccessControl.js +2 -0
- package/build/dist/Types/Database/AccessControl/AccessControl.js.map +1 -0
- package/build/dist/Types/Database/AccessControl/AllowAccessIfSubscriptionIsUnpaid.js +6 -0
- package/build/dist/Types/Database/AccessControl/AllowAccessIfSubscriptionIsUnpaid.js.map +1 -0
- package/build/dist/Types/Database/AccessControl/ColumnAccessControl.js +19 -0
- package/build/dist/Types/Database/AccessControl/ColumnAccessControl.js.map +1 -0
- package/build/dist/Types/Database/AccessControl/ColumnBillingAccessControl.js +19 -0
- package/build/dist/Types/Database/AccessControl/ColumnBillingAccessControl.js.map +1 -0
- package/build/dist/Types/Database/AccessControl/TableAccessControl.js +17 -0
- package/build/dist/Types/Database/AccessControl/TableAccessControl.js.map +1 -0
- package/build/dist/Types/Database/AccessControl/TableBillingAccessControl.js +17 -0
- package/build/dist/Types/Database/AccessControl/TableBillingAccessControl.js.map +1 -0
- package/build/dist/Types/Database/AccessControlColumn.js +6 -0
- package/build/dist/Types/Database/AccessControlColumn.js.map +1 -0
- package/build/dist/Types/Database/AllowUserQueryWithoutTenant.js +6 -0
- package/build/dist/Types/Database/AllowUserQueryWithoutTenant.js.map +1 -0
- package/build/dist/Types/Database/CanAccessIfCanReadOn.js +8 -0
- package/build/dist/Types/Database/CanAccessIfCanReadOn.js.map +1 -0
- package/build/dist/Types/Database/ColumnLength.js +65 -0
- package/build/dist/Types/Database/ColumnLength.js.map +1 -0
- package/build/dist/Types/Database/ColumnType.js +38 -0
- package/build/dist/Types/Database/ColumnType.js.map +1 -0
- package/build/dist/Types/Database/Columns.js +19 -0
- package/build/dist/Types/Database/Columns.js.map +1 -0
- package/build/dist/Types/Database/CompareBase.js +31 -0
- package/build/dist/Types/Database/CompareBase.js.map +1 -0
- package/build/dist/Types/Database/CrudApiEndpoint.js +6 -0
- package/build/dist/Types/Database/CrudApiEndpoint.js.map +1 -0
- package/build/dist/Types/Database/CurrentUserCanAccessRecordBy.js +6 -0
- package/build/dist/Types/Database/CurrentUserCanAccessRecordBy.js.map +1 -0
- package/build/dist/Types/Database/DatabaseCommonInteractionProps.js +2 -0
- package/build/dist/Types/Database/DatabaseCommonInteractionProps.js.map +1 -0
- package/build/dist/Types/Database/DatabaseProperty.js +34 -0
- package/build/dist/Types/Database/DatabaseProperty.js.map +1 -0
- package/build/dist/Types/Database/Date.js +18 -0
- package/build/dist/Types/Database/Date.js.map +1 -0
- package/build/dist/Types/Database/EnableDocumentation.js +8 -0
- package/build/dist/Types/Database/EnableDocumentation.js.map +1 -0
- package/build/dist/Types/Database/EnableWorkflow.js +6 -0
- package/build/dist/Types/Database/EnableWorkflow.js.map +1 -0
- package/build/dist/Types/Database/EqualToOrNull.js +31 -0
- package/build/dist/Types/Database/EqualToOrNull.js.map +1 -0
- package/build/dist/Types/Database/GreaterThan.js +21 -0
- package/build/dist/Types/Database/GreaterThan.js.map +1 -0
- package/build/dist/Types/Database/GreaterThanOrEqual.js +21 -0
- package/build/dist/Types/Database/GreaterThanOrEqual.js.map +1 -0
- package/build/dist/Types/Database/InBetween.js +57 -0
- package/build/dist/Types/Database/InBetween.js.map +1 -0
- package/build/dist/Types/Database/IsNull.js +24 -0
- package/build/dist/Types/Database/IsNull.js.map +1 -0
- package/build/dist/Types/Database/IsPermissionsIf.js +11 -0
- package/build/dist/Types/Database/IsPermissionsIf.js.map +1 -0
- package/build/dist/Types/Database/LabelsColumn.js +6 -0
- package/build/dist/Types/Database/LabelsColumn.js.map +1 -0
- package/build/dist/Types/Database/LessThan.js +21 -0
- package/build/dist/Types/Database/LessThan.js.map +1 -0
- package/build/dist/Types/Database/LessThanOrEqual.js +21 -0
- package/build/dist/Types/Database/LessThanOrEqual.js.map +1 -0
- package/build/dist/Types/Database/LimitMax.js +5 -0
- package/build/dist/Types/Database/LimitMax.js.map +1 -0
- package/build/dist/Types/Database/MultiTenentQueryAllowed.js +6 -0
- package/build/dist/Types/Database/MultiTenentQueryAllowed.js.map +1 -0
- package/build/dist/Types/Database/NotEqual.js +31 -0
- package/build/dist/Types/Database/NotEqual.js.map +1 -0
- package/build/dist/Types/Database/NotNull.js +24 -0
- package/build/dist/Types/Database/NotNull.js.map +1 -0
- package/build/dist/Types/Database/PartialEntity.js +2 -0
- package/build/dist/Types/Database/PartialEntity.js.map +1 -0
- package/build/dist/Types/Database/Search.js +31 -0
- package/build/dist/Types/Database/Search.js.map +1 -0
- package/build/dist/Types/Database/SingularPluralName.js +7 -0
- package/build/dist/Types/Database/SingularPluralName.js.map +1 -0
- package/build/dist/Types/Database/SlugifyColumn.js +7 -0
- package/build/dist/Types/Database/SlugifyColumn.js.map +1 -0
- package/build/dist/Types/Database/SortOrder.js +7 -0
- package/build/dist/Types/Database/SortOrder.js.map +1 -0
- package/build/dist/Types/Database/TableColumn.js +19 -0
- package/build/dist/Types/Database/TableColumn.js.map +1 -0
- package/build/dist/Types/Database/TableColumnType.js +44 -0
- package/build/dist/Types/Database/TableColumnType.js.map +1 -0
- package/build/dist/Types/Database/TableMetadata.js +10 -0
- package/build/dist/Types/Database/TableMetadata.js.map +1 -0
- package/build/dist/Types/Database/TenantColumn.js +6 -0
- package/build/dist/Types/Database/TenantColumn.js.map +1 -0
- package/build/dist/Types/Database/TotalItemsBy.js +8 -0
- package/build/dist/Types/Database/TotalItemsBy.js.map +1 -0
- package/build/dist/Types/Database/UniqueColumnBy.js +19 -0
- package/build/dist/Types/Database/UniqueColumnBy.js.map +1 -0
- package/build/dist/Types/DatabaseType.js +7 -0
- package/build/dist/Types/DatabaseType.js.map +1 -0
- package/build/dist/Types/Date.js +698 -0
- package/build/dist/Types/Date.js.map +1 -0
- package/build/dist/Types/Day/DayOfWeek.js +32 -0
- package/build/dist/Types/Day/DayOfWeek.js.map +1 -0
- package/build/dist/Types/Decimal.js +59 -0
- package/build/dist/Types/Decimal.js.map +1 -0
- package/build/dist/Types/Dictionary.js +2 -0
- package/build/dist/Types/Dictionary.js.map +1 -0
- package/build/dist/Types/DiskSize.js +30 -0
- package/build/dist/Types/DiskSize.js.map +1 -0
- package/build/dist/Types/Domain.js +71 -0
- package/build/dist/Types/Domain.js.map +1 -0
- package/build/dist/Types/Email/EmailBody.js +2 -0
- package/build/dist/Types/Email/EmailBody.js.map +1 -0
- package/build/dist/Types/Email/EmailMessage.js +2 -0
- package/build/dist/Types/Email/EmailMessage.js.map +1 -0
- package/build/dist/Types/Email/EmailServer.js +2 -0
- package/build/dist/Types/Email/EmailServer.js.map +1 -0
- package/build/dist/Types/Email/EmailTemplate.js +2 -0
- package/build/dist/Types/Email/EmailTemplate.js.map +1 -0
- package/build/dist/Types/Email/EmailTemplateType.js +40 -0
- package/build/dist/Types/Email/EmailTemplateType.js.map +1 -0
- package/build/dist/Types/Email.js +101 -0
- package/build/dist/Types/Email.js.map +1 -0
- package/build/dist/Types/EmailWithName.js +31 -0
- package/build/dist/Types/EmailWithName.js.map +1 -0
- package/build/dist/Types/EncryptionAlgorithm.js +6 -0
- package/build/dist/Types/EncryptionAlgorithm.js.map +1 -0
- package/build/dist/Types/Events/EventInterval.js +10 -0
- package/build/dist/Types/Events/EventInterval.js.map +1 -0
- package/build/dist/Types/Events/Recurring.js +86 -0
- package/build/dist/Types/Events/Recurring.js.map +1 -0
- package/build/dist/Types/Exception/ApiException.js +8 -0
- package/build/dist/Types/Exception/ApiException.js.map +1 -0
- package/build/dist/Types/Exception/BadDataException.js +8 -0
- package/build/dist/Types/Exception/BadDataException.js.map +1 -0
- package/build/dist/Types/Exception/BadOperationException.js +8 -0
- package/build/dist/Types/Exception/BadOperationException.js.map +1 -0
- package/build/dist/Types/Exception/BadRequestException.js +8 -0
- package/build/dist/Types/Exception/BadRequestException.js.map +1 -0
- package/build/dist/Types/Exception/DatabaseNotConnectedException.js +8 -0
- package/build/dist/Types/Exception/DatabaseNotConnectedException.js.map +1 -0
- package/build/dist/Types/Exception/Exception.js +18 -0
- package/build/dist/Types/Exception/Exception.js.map +1 -0
- package/build/dist/Types/Exception/ExceptionCode.js +22 -0
- package/build/dist/Types/Exception/ExceptionCode.js.map +1 -0
- package/build/dist/Types/Exception/NotAuthenticatedException.js +8 -0
- package/build/dist/Types/Exception/NotAuthenticatedException.js.map +1 -0
- package/build/dist/Types/Exception/NotAuthorizedException.js +8 -0
- package/build/dist/Types/Exception/NotAuthorizedException.js.map +1 -0
- package/build/dist/Types/Exception/NotFoundException.js +8 -0
- package/build/dist/Types/Exception/NotFoundException.js.map +1 -0
- package/build/dist/Types/Exception/NotImplementedException.js +8 -0
- package/build/dist/Types/Exception/NotImplementedException.js.map +1 -0
- package/build/dist/Types/Exception/PaymentRequiredException.js +8 -0
- package/build/dist/Types/Exception/PaymentRequiredException.js.map +1 -0
- package/build/dist/Types/Exception/ServerException.js +8 -0
- package/build/dist/Types/Exception/ServerException.js.map +1 -0
- package/build/dist/Types/Exception/SsoAuthorizationException.js +12 -0
- package/build/dist/Types/Exception/SsoAuthorizationException.js.map +1 -0
- package/build/dist/Types/Exception/TenantNotFoundException.js +8 -0
- package/build/dist/Types/Exception/TenantNotFoundException.js.map +1 -0
- package/build/dist/Types/Exception/TimeoutException.js +8 -0
- package/build/dist/Types/Exception/TimeoutException.js.map +1 -0
- package/build/dist/Types/Exception/UnableToReachServer.js +8 -0
- package/build/dist/Types/Exception/UnableToReachServer.js.map +1 -0
- package/build/dist/Types/Exception/WebsiteRequestException.js +8 -0
- package/build/dist/Types/Exception/WebsiteRequestException.js.map +1 -0
- package/build/dist/Types/File/MimeType.js +11 -0
- package/build/dist/Types/File/MimeType.js.map +1 -0
- package/build/dist/Types/File.js +2 -0
- package/build/dist/Types/File.js.map +1 -0
- package/build/dist/Types/Filter/Filter.js +3 -0
- package/build/dist/Types/Filter/Filter.js.map +1 -0
- package/build/dist/Types/Filter/FilterCondition.js +7 -0
- package/build/dist/Types/Filter/FilterCondition.js.map +1 -0
- package/build/dist/Types/Filter/FilterType.js +11 -0
- package/build/dist/Types/Filter/FilterType.js.map +1 -0
- package/build/dist/Types/FunctionTypes.js +2 -0
- package/build/dist/Types/FunctionTypes.js.map +1 -0
- package/build/dist/Types/GenericFunction.js +2 -0
- package/build/dist/Types/GenericFunction.js.map +1 -0
- package/build/dist/Types/GenericObject.js +2 -0
- package/build/dist/Types/GenericObject.js.map +1 -0
- package/build/dist/Types/HashCode.js +12 -0
- package/build/dist/Types/HashCode.js.map +1 -0
- package/build/dist/Types/HashedString.js +77 -0
- package/build/dist/Types/HashedString.js.map +1 -0
- package/build/dist/Types/Html.js +16 -0
- package/build/dist/Types/Html.js.map +1 -0
- package/build/dist/Types/IP/IP.js +93 -0
- package/build/dist/Types/IP/IP.js.map +1 -0
- package/build/dist/Types/IP/IPType.js +7 -0
- package/build/dist/Types/IP/IPType.js.map +1 -0
- package/build/dist/Types/IP/IPv4.js +11 -0
- package/build/dist/Types/IP/IPv4.js.map +1 -0
- package/build/dist/Types/IP/IPv6.js +11 -0
- package/build/dist/Types/IP/IPv6.js.map +1 -0
- package/build/dist/Types/Icon/IconProp.js +126 -0
- package/build/dist/Types/Icon/IconProp.js.map +1 -0
- package/build/dist/Types/Incident/IncidentCustomFields.js +3 -0
- package/build/dist/Types/Incident/IncidentCustomFields.js.map +1 -0
- package/build/dist/Types/IncomingRequest/IncomingRequestCustomFields.js +3 -0
- package/build/dist/Types/IncomingRequest/IncomingRequestCustomFields.js.map +1 -0
- package/build/dist/Types/JSON.js +39 -0
- package/build/dist/Types/JSON.js.map +1 -0
- package/build/dist/Types/JSONFunctions.js +189 -0
- package/build/dist/Types/JSONFunctions.js.map +1 -0
- package/build/dist/Types/JsonWebTokenData.js +2 -0
- package/build/dist/Types/JsonWebTokenData.js.map +1 -0
- package/build/dist/Types/Link.js +2 -0
- package/build/dist/Types/Link.js.map +1 -0
- package/build/dist/Types/ListData.js +18 -0
- package/build/dist/Types/ListData.js.map +1 -0
- package/build/dist/Types/Mail/MailStatus.js +7 -0
- package/build/dist/Types/Mail/MailStatus.js.map +1 -0
- package/build/dist/Types/Mixins.js +3 -0
- package/build/dist/Types/Mixins.js.map +1 -0
- package/build/dist/Types/Monitor/CriteriaFilter.js +40 -0
- package/build/dist/Types/Monitor/CriteriaFilter.js.map +1 -0
- package/build/dist/Types/Monitor/CriteriaIncident.js +2 -0
- package/build/dist/Types/Monitor/CriteriaIncident.js.map +1 -0
- package/build/dist/Types/Monitor/IncomingMonitor/IncomingMonitorRequest.js +2 -0
- package/build/dist/Types/Monitor/IncomingMonitor/IncomingMonitorRequest.js.map +1 -0
- package/build/dist/Types/Monitor/MonitorCriteria.js +120 -0
- package/build/dist/Types/Monitor/MonitorCriteria.js.map +1 -0
- package/build/dist/Types/Monitor/MonitorCriteriaInstance.js +375 -0
- package/build/dist/Types/Monitor/MonitorCriteriaInstance.js.map +1 -0
- package/build/dist/Types/Monitor/MonitorCustomFields.js +3 -0
- package/build/dist/Types/Monitor/MonitorCustomFields.js.map +1 -0
- package/build/dist/Types/Monitor/MonitorStep.js +205 -0
- package/build/dist/Types/Monitor/MonitorStep.js.map +1 -0
- package/build/dist/Types/Monitor/MonitorSteps.js +126 -0
- package/build/dist/Types/Monitor/MonitorSteps.js.map +1 -0
- package/build/dist/Types/Monitor/MonitorType.js +80 -0
- package/build/dist/Types/Monitor/MonitorType.js.map +1 -0
- package/build/dist/Types/Name.js +69 -0
- package/build/dist/Types/Name.js.map +1 -0
- package/build/dist/Types/NotificationRule/NotificationRuleType.js +8 -0
- package/build/dist/Types/NotificationRule/NotificationRuleType.js.map +1 -0
- package/build/dist/Types/NotificationSetting/NotificationSettingEventType.js +23 -0
- package/build/dist/Types/NotificationSetting/NotificationSettingEventType.js.map +1 -0
- package/build/dist/Types/ObjectID.js +75 -0
- package/build/dist/Types/ObjectID.js.map +1 -0
- package/build/dist/Types/ObjectUtil.js +2 -0
- package/build/dist/Types/ObjectUtil.js.map +1 -0
- package/build/dist/Types/OnCallDutyPolicy/Layer.js +566 -0
- package/build/dist/Types/OnCallDutyPolicy/Layer.js.map +1 -0
- package/build/dist/Types/OnCallDutyPolicy/OnCalDutyExecutionLogTimelineStatus.js +11 -0
- package/build/dist/Types/OnCallDutyPolicy/OnCalDutyExecutionLogTimelineStatus.js.map +1 -0
- package/build/dist/Types/OnCallDutyPolicy/OnCallDutyPolicyAlertStatus.js +8 -0
- package/build/dist/Types/OnCallDutyPolicy/OnCallDutyPolicyAlertStatus.js.map +1 -0
- package/build/dist/Types/OnCallDutyPolicy/OnCallDutyPolicyStatus.js +10 -0
- package/build/dist/Types/OnCallDutyPolicy/OnCallDutyPolicyStatus.js.map +1 -0
- package/build/dist/Types/OnCallDutyPolicy/RestrictionTimes.js +137 -0
- package/build/dist/Types/OnCallDutyPolicy/RestrictionTimes.js.map +1 -0
- package/build/dist/Types/Operation/OperationResult.js +7 -0
- package/build/dist/Types/Operation/OperationResult.js.map +1 -0
- package/build/dist/Types/Operation/OperationStatus.js +10 -0
- package/build/dist/Types/Operation/OperationStatus.js.map +1 -0
- package/build/dist/Types/Permission.js +2701 -0
- package/build/dist/Types/Permission.js.map +1 -0
- package/build/dist/Types/Phone.js +61 -0
- package/build/dist/Types/Phone.js.map +1 -0
- package/build/dist/Types/Port.js +77 -0
- package/build/dist/Types/Port.js.map +1 -0
- package/build/dist/Types/PositiveNumber.js +59 -0
- package/build/dist/Types/PositiveNumber.js.map +1 -0
- package/build/dist/Types/PricingPlan.js +2 -0
- package/build/dist/Types/PricingPlan.js.map +1 -0
- package/build/dist/Types/Probe/ProbeApiIngestResponse.js +2 -0
- package/build/dist/Types/Probe/ProbeApiIngestResponse.js.map +1 -0
- package/build/dist/Types/Probe/ProbeMonitorResponse.js +2 -0
- package/build/dist/Types/Probe/ProbeMonitorResponse.js.map +1 -0
- package/build/dist/Types/Reflection.js +2 -0
- package/build/dist/Types/Reflection.js.map +1 -0
- package/build/dist/Types/Role.js +26 -0
- package/build/dist/Types/Role.js.map +1 -0
- package/build/dist/Types/SMS/SMS.js +2 -0
- package/build/dist/Types/SMS/SMS.js.map +1 -0
- package/build/dist/Types/SMS/SmsTemplateType.js +14 -0
- package/build/dist/Types/SMS/SmsTemplateType.js.map +1 -0
- package/build/dist/Types/SSO/DigestMethod.js +9 -0
- package/build/dist/Types/SSO/DigestMethod.js.map +1 -0
- package/build/dist/Types/SSO/SignatureMethod.js +9 -0
- package/build/dist/Types/SSO/SignatureMethod.js.map +1 -0
- package/build/dist/Types/ScheduledEvent/ScheduledEventState.js +9 -0
- package/build/dist/Types/ScheduledEvent/ScheduledEventState.js.map +1 -0
- package/build/dist/Types/SecuritySeverity.js +9 -0
- package/build/dist/Types/SecuritySeverity.js.map +1 -0
- package/build/dist/Types/SerializableObject.js +14 -0
- package/build/dist/Types/SerializableObject.js.map +1 -0
- package/build/dist/Types/SerializableObjectDictionary.js +61 -0
- package/build/dist/Types/SerializableObjectDictionary.js.map +1 -0
- package/build/dist/Types/Sleep.js +8 -0
- package/build/dist/Types/Sleep.js.map +1 -0
- package/build/dist/Types/SmsStatus.js +8 -0
- package/build/dist/Types/SmsStatus.js.map +1 -0
- package/build/dist/Types/StatusPage/StatusPageChartType.js +11 -0
- package/build/dist/Types/StatusPage/StatusPageChartType.js.map +1 -0
- package/build/dist/Types/Text.js +109 -0
- package/build/dist/Types/Text.js.map +1 -0
- package/build/dist/Types/Time/StartAndEndTime.js +2 -0
- package/build/dist/Types/Time/StartAndEndTime.js.map +1 -0
- package/build/dist/Types/Timezone.js +597 -0
- package/build/dist/Types/Timezone.js.map +1 -0
- package/build/dist/Types/Typeof.js +9 -0
- package/build/dist/Types/Typeof.js.map +1 -0
- package/build/dist/Types/UserNotification/UserNotificationEventType.js +6 -0
- package/build/dist/Types/UserNotification/UserNotificationEventType.js.map +1 -0
- package/build/dist/Types/UserNotification/UserNotificationExecutionStatus.js +10 -0
- package/build/dist/Types/UserNotification/UserNotificationExecutionStatus.js.map +1 -0
- package/build/dist/Types/UserNotification/UserNotificationStatus.js +10 -0
- package/build/dist/Types/UserNotification/UserNotificationStatus.js.map +1 -0
- package/build/dist/Types/UserType.js +9 -0
- package/build/dist/Types/UserType.js.map +1 -0
- package/build/dist/Types/Version.js +52 -0
- package/build/dist/Types/Version.js.map +1 -0
- package/build/dist/Types/WebsiteRequest.js +41 -0
- package/build/dist/Types/WebsiteRequest.js.map +1 -0
- package/build/dist/Types/Workflow/Component.js +37 -0
- package/build/dist/Types/Workflow/Component.js.map +1 -0
- package/build/dist/Types/Workflow/ComponentID.js +21 -0
- package/build/dist/Types/Workflow/ComponentID.js.map +1 -0
- package/build/dist/Types/Workflow/Components/API.js +343 -0
- package/build/dist/Types/Workflow/Components/API.js.map +1 -0
- package/build/dist/Types/Workflow/Components/BaseModel.js +546 -0
- package/build/dist/Types/Workflow/Components/BaseModel.js.map +1 -0
- package/build/dist/Types/Workflow/Components/Condition.js +61 -0
- package/build/dist/Types/Workflow/Components/Condition.js.map +1 -0
- package/build/dist/Types/Workflow/Components/Email.js +102 -0
- package/build/dist/Types/Workflow/Components/Email.js.map +1 -0
- package/build/dist/Types/Workflow/Components/JSON.js +149 -0
- package/build/dist/Types/Workflow/Components/JSON.js.map +1 -0
- package/build/dist/Types/Workflow/Components/JavaScript.js +61 -0
- package/build/dist/Types/Workflow/Components/JavaScript.js.map +1 -0
- package/build/dist/Types/Workflow/Components/Log.js +39 -0
- package/build/dist/Types/Workflow/Components/Log.js.map +1 -0
- package/build/dist/Types/Workflow/Components/Manual.js +34 -0
- package/build/dist/Types/Workflow/Components/Manual.js.map +1 -0
- package/build/dist/Types/Workflow/Components/MicrosoftTeams.js +61 -0
- package/build/dist/Types/Workflow/Components/MicrosoftTeams.js.map +1 -0
- package/build/dist/Types/Workflow/Components/Schedule.js +33 -0
- package/build/dist/Types/Workflow/Components/Schedule.js.map +1 -0
- package/build/dist/Types/Workflow/Components/Slack.js +61 -0
- package/build/dist/Types/Workflow/Components/Slack.js.map +1 -0
- package/build/dist/Types/Workflow/Components/Webhook.js +52 -0
- package/build/dist/Types/Workflow/Components/Webhook.js.map +1 -0
- package/build/dist/Types/Workflow/Components/Workflow.js +38 -0
- package/build/dist/Types/Workflow/Components/Workflow.js.map +1 -0
- package/build/dist/Types/Workflow/Components.js +74 -0
- package/build/dist/Types/Workflow/Components.js.map +1 -0
- package/build/dist/Types/Workflow/WorkflowPlan.js +9 -0
- package/build/dist/Types/Workflow/WorkflowPlan.js.map +1 -0
- package/build/dist/Types/Workflow/WorkflowStatus.js +11 -0
- package/build/dist/Types/Workflow/WorkflowStatus.js.map +1 -0
- package/build/dist/Types/XML.js +20 -0
- package/build/dist/Types/XML.js.map +1 -0
- package/build/dist/Utils/API.js +135 -0
- package/build/dist/Utils/API.js.map +1 -0
- package/build/dist/Utils/Analytics.js +35 -0
- package/build/dist/Utils/Analytics.js.map +1 -0
- package/build/dist/Utils/CronTime.js +7 -0
- package/build/dist/Utils/CronTime.js.map +1 -0
- package/build/dist/Utils/Faker.js +29 -0
- package/build/dist/Utils/Faker.js.map +1 -0
- package/build/dist/Utils/ObjectUtil.js +2 -0
- package/build/dist/Utils/ObjectUtil.js.map +1 -0
- package/build/dist/Utils/Realtime.js +16 -0
- package/build/dist/Utils/Realtime.js.map +1 -0
- package/build/dist/Utils/Slug.js +18 -0
- package/build/dist/Utils/Slug.js.map +1 -0
- package/build/dist/Utils/UUID.js +7 -0
- package/build/dist/Utils/UUID.js.map +1 -0
- package/jest.config.json +39 -0
- package/package.json +36 -0
- package/tsconfig.json +113 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import HTML from '../../Types/Html';
|
|
2
|
+
|
|
3
|
+
describe('class HTML', () => {
|
|
4
|
+
test('new HTML should return a valid html object a valid html is given', () => {
|
|
5
|
+
const html: HTML = new HTML('<!DOCTYPE><head><title></head>');
|
|
6
|
+
expect(html.html).toBe('<!DOCTYPE><head><title></head>');
|
|
7
|
+
});
|
|
8
|
+
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import IP from '../../../Types/IP/IP';
|
|
2
|
+
|
|
3
|
+
describe('IP()', () => {
|
|
4
|
+
test('expect ip to be defined', () => {
|
|
5
|
+
const ip: IP = new IP('196.223.149.8');
|
|
6
|
+
expect(ip.toString()).toBe('196.223.149.8');
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
test('expects type of ip to be a string', () => {
|
|
10
|
+
const ip: IP = new IP('196.223.149.8');
|
|
11
|
+
expect(typeof ip.toString()).toBe('string');
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
test('expects ip address to be mutable', () => {
|
|
15
|
+
const ip: IP = new IP('196.223.149.8');
|
|
16
|
+
const newIp: string = '127.0.0.1';
|
|
17
|
+
ip.ip = newIp;
|
|
18
|
+
expect(ip.ip).not.toBe('196.223.149.8');
|
|
19
|
+
expect(ip.ip).toBe('127.0.0.1');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('expects ip address to be 127.0.0.1', () => {
|
|
23
|
+
const ip: IP = new IP('196.223.149.8');
|
|
24
|
+
const newIp: string = '127.0.0.1';
|
|
25
|
+
ip.ip = newIp;
|
|
26
|
+
expect(ip.ip).toBe('127.0.0.1');
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
test('is valid IPv6 address', () => {
|
|
30
|
+
const ip: IP = new IP('::11.22.33.44');
|
|
31
|
+
expect(ip.isIPv6()).toBeTruthy();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test('should throw an error for invalid IP', () => {
|
|
35
|
+
expect(() => {
|
|
36
|
+
new IP('');
|
|
37
|
+
}).toThrow('IP is not a valid address');
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
test('should return a string', () => {
|
|
41
|
+
expect(IP.toDatabase(new IP('127.0.0.1'))).toBe('127.0.0.1');
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
test('should be an instance IP', () => {
|
|
45
|
+
expect(IP.fromDatabase('127.0.0.1')).toBeInstanceOf(IP);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
test('should not create an instance of IP', () => {
|
|
49
|
+
expect(IP.fromDatabase('')).toBeNull();
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
test('should create an IP of type IPv4 from database', () => {
|
|
53
|
+
expect(IP.fromDatabase('127.0.0.1')?.isIPv4()).toBeTruthy();
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
test('should create an IP of type IPv6 from database', () => {
|
|
57
|
+
expect(
|
|
58
|
+
IP.fromDatabase('2001:0db8:85a3:0000:0000:8a2e:0370:7334')?.isIPv6()
|
|
59
|
+
).toBeTruthy();
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test('should create an IP of type IPv4 through the transformer', () => {
|
|
63
|
+
expect(
|
|
64
|
+
IP.getDatabaseTransformer().from('127.0.0.1').isIPv4()
|
|
65
|
+
).toBeTruthy();
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
test('should create an IP of type IPv6 through the transformer', () => {
|
|
69
|
+
expect(
|
|
70
|
+
IP.getDatabaseTransformer()
|
|
71
|
+
.from('2001:0db8:85a3:0000:0000:8a2e:0370:7334')
|
|
72
|
+
.isIPv6()
|
|
73
|
+
).toBeTruthy();
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
test('should return a string from the transformers to function', () => {
|
|
77
|
+
expect(IP.getDatabaseTransformer().to('127.0.0.1')).toBe('127.0.0.1');
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
test('should return null from the transformers to function', () => {
|
|
81
|
+
expect(IP.getDatabaseTransformer().to('')).toBe(null);
|
|
82
|
+
});
|
|
83
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import IPType from '../../../Types/IP/IPType';
|
|
2
|
+
|
|
3
|
+
describe('IPType', () => {
|
|
4
|
+
test('should have a type of IPv4', () => {
|
|
5
|
+
expect(IPType.IPv4).toBe('IPv4');
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
test('should have a type of IPv6', () => {
|
|
9
|
+
expect(IPType.IPv6).toBe('IPv6');
|
|
10
|
+
});
|
|
11
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import IP from '../../../Types/IP/IPv4';
|
|
2
|
+
|
|
3
|
+
describe('IPv4()', () => {
|
|
4
|
+
test('should be IPv4', () => {
|
|
5
|
+
const ip: IP = new IP('196.223.149.8');
|
|
6
|
+
expect(ip.isIPv4()).toBeTruthy();
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
test('should not be IPv6', () => {
|
|
10
|
+
const ip: IP = new IP('196.223.149.8');
|
|
11
|
+
expect(ip.isIPv6()).toBeFalsy();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
test('Is not a valid address', () => {
|
|
15
|
+
expect(() => {
|
|
16
|
+
new IP('Invalid IP');
|
|
17
|
+
}).toThrow('IP is not a valid address');
|
|
18
|
+
});
|
|
19
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import IP from '../../../Types/IP/IPv6';
|
|
2
|
+
|
|
3
|
+
describe('IPv6()', () => {
|
|
4
|
+
test('should be IPv6', () => {
|
|
5
|
+
const ip: IP = new IP('2001:0db8:85a3:::8a2e:0370:7334');
|
|
6
|
+
expect(ip.isIPv6()).toBeTruthy();
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
test('should not be IPv4', () => {
|
|
10
|
+
const ip: IP = new IP('2001:0db8:85a3:0000:0000:8a2e:0370:7334');
|
|
11
|
+
expect(ip.isIPv4()).toBeFalsy();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
test('Is not a valid address', () => {
|
|
15
|
+
expect(() => {
|
|
16
|
+
new IP('Invalid Ip');
|
|
17
|
+
}).toThrow('IP is not a valid address');
|
|
18
|
+
});
|
|
19
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ObjectType } from '../../Types/JSON';
|
|
2
|
+
|
|
3
|
+
describe('ObjectType', () => {
|
|
4
|
+
const expectedFields: Array<keyof typeof ObjectType> = [
|
|
5
|
+
'ObjectID',
|
|
6
|
+
'Name',
|
|
7
|
+
'EqualToOrNull',
|
|
8
|
+
'NotEqual',
|
|
9
|
+
'Email',
|
|
10
|
+
'Phone',
|
|
11
|
+
'Color',
|
|
12
|
+
'Domain',
|
|
13
|
+
'Version',
|
|
14
|
+
'Route',
|
|
15
|
+
'URL',
|
|
16
|
+
'Permission',
|
|
17
|
+
'Search',
|
|
18
|
+
'GreaterThan',
|
|
19
|
+
'GreaterThanOrEqual',
|
|
20
|
+
'LessThan',
|
|
21
|
+
'LessThanOrEqual',
|
|
22
|
+
'Port',
|
|
23
|
+
'Hostname',
|
|
24
|
+
'HashedString',
|
|
25
|
+
'DateTime',
|
|
26
|
+
'Buffer',
|
|
27
|
+
'InBetween',
|
|
28
|
+
'NotNull',
|
|
29
|
+
'IsNull',
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
test.each(expectedFields)(
|
|
33
|
+
'ObjectType has %s',
|
|
34
|
+
(field: keyof typeof ObjectType) => {
|
|
35
|
+
expect(ObjectType[field]).toBe(field);
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import BaseModel from '../../Models/BaseModel';
|
|
2
|
+
import { JSONObject } from '../../Types/JSON';
|
|
3
|
+
import JSONFunctions from '../../Types/JSONFunctions';
|
|
4
|
+
|
|
5
|
+
describe('JSONFunctions Class', () => {
|
|
6
|
+
let baseModel: BaseModel;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
baseModel = new BaseModel();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
describe('isEmptyObject Method', () => {
|
|
13
|
+
test('Returns true for an empty object', () => {
|
|
14
|
+
const emptyObj: JSONObject = {};
|
|
15
|
+
expect(JSONFunctions.isEmptyObject(emptyObj)).toBe(true);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test('Returns false for a non-empty object', () => {
|
|
19
|
+
const nonEmptyObj: JSONObject = { key: 'value' };
|
|
20
|
+
expect(JSONFunctions.isEmptyObject(nonEmptyObj)).toBe(false);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
test('Returns true for null or undefined', () => {
|
|
24
|
+
expect(JSONFunctions.isEmptyObject(null)).toBe(true);
|
|
25
|
+
expect(JSONFunctions.isEmptyObject(undefined)).toBe(true);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
describe('toJSON and fromJSON Methods', () => {
|
|
30
|
+
test('toJSON returns a valid JSON object', () => {
|
|
31
|
+
const json: JSONObject = BaseModel.toJSON(baseModel, BaseModel);
|
|
32
|
+
expect(json).toEqual(expect.objectContaining({}));
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test('toJSONObject returns a valid JSON object', () => {
|
|
36
|
+
const json: JSONObject = BaseModel.toJSONObject(
|
|
37
|
+
baseModel,
|
|
38
|
+
BaseModel
|
|
39
|
+
);
|
|
40
|
+
expect(json).toEqual(expect.objectContaining({}));
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
test('fromJSON returns a BaseModel instance', () => {
|
|
44
|
+
const json: JSONObject = { name: 'oneuptime' };
|
|
45
|
+
const result: BaseModel | BaseModel[] = BaseModel.fromJSON(
|
|
46
|
+
json,
|
|
47
|
+
BaseModel
|
|
48
|
+
);
|
|
49
|
+
expect(result).toBeInstanceOf(BaseModel);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { JSONArray, JSONObject } from '../../Types/JSON';
|
|
2
|
+
import ListData from '../../Types/ListData';
|
|
3
|
+
import PositiveNumber from '../../Types/PositiveNumber';
|
|
4
|
+
|
|
5
|
+
describe('ListData', () => {
|
|
6
|
+
test('should create a ListData instance', () => {
|
|
7
|
+
const data: JSONArray = [{ foo: 1 }, { foo: 2 }];
|
|
8
|
+
const skip: PositiveNumber = new PositiveNumber(0);
|
|
9
|
+
const count: PositiveNumber = new PositiveNumber(0);
|
|
10
|
+
const limit: PositiveNumber = new PositiveNumber(0);
|
|
11
|
+
|
|
12
|
+
const listData: ListData = new ListData({
|
|
13
|
+
data,
|
|
14
|
+
count,
|
|
15
|
+
skip,
|
|
16
|
+
limit,
|
|
17
|
+
});
|
|
18
|
+
expect(listData).toBeInstanceOf(ListData);
|
|
19
|
+
|
|
20
|
+
expect(listData.count.toNumber()).toBe(count.toNumber());
|
|
21
|
+
expect(listData.skip.toNumber()).toBe(skip.toNumber());
|
|
22
|
+
expect(listData.limit.toNumber()).toBe(limit.toNumber());
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test('toJSON converts ListData to JSONObject', () => {
|
|
26
|
+
const listData: ListData = new ListData({
|
|
27
|
+
data: [{ foo: 'bar' }],
|
|
28
|
+
count: new PositiveNumber(0),
|
|
29
|
+
skip: new PositiveNumber(0),
|
|
30
|
+
limit: new PositiveNumber(0),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const jsonObject: JSONObject = listData.toJSON();
|
|
34
|
+
|
|
35
|
+
expect(jsonObject['data']).toEqual([{ foo: 'bar' }]);
|
|
36
|
+
expect(jsonObject['count']).toEqual(0);
|
|
37
|
+
expect(jsonObject['skip']).toEqual(0);
|
|
38
|
+
expect(jsonObject['limit']).toEqual(0);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import Name from '../../Types/Name';
|
|
2
|
+
|
|
3
|
+
describe('class Name', () => {
|
|
4
|
+
test('new Name() should return a valid object if valid name is given', () => {
|
|
5
|
+
expect(new Name('Dua Lipa').toString()).toBe('Dua Lipa');
|
|
6
|
+
});
|
|
7
|
+
test('should return the First Name', () => {
|
|
8
|
+
expect(new Name('Louis Harry Liam').getFirstName()).toBe('Louis');
|
|
9
|
+
});
|
|
10
|
+
test('should return the Last Name', () => {
|
|
11
|
+
expect(new Name('Louis Harry Liam').getLastName()).toBe('Liam');
|
|
12
|
+
});
|
|
13
|
+
test('should return the Midlle Name', () => {
|
|
14
|
+
expect(new Name('Louis Harry Liam').getMiddleName()).toBe('Harry');
|
|
15
|
+
});
|
|
16
|
+
test('Name should return String', () => {
|
|
17
|
+
const nam: Name = new Name('Taylor Swift');
|
|
18
|
+
expect(Name.toDatabase(nam)).toBe('Taylor Swift');
|
|
19
|
+
});
|
|
20
|
+
test('should read the value of Name instance', () => {
|
|
21
|
+
expect(new Name('Kriti Sanon').name).toBe('Kriti Sanon');
|
|
22
|
+
});
|
|
23
|
+
test('should not create an instance of Name', () => {
|
|
24
|
+
expect(Name.fromDatabase('')).toBeNull();
|
|
25
|
+
});
|
|
26
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import ObjectID from '../../Types/ObjectID';
|
|
2
|
+
|
|
3
|
+
describe('class ObjectID', () => {
|
|
4
|
+
test('ObjectID.constructor should return a valid ObjectID object', () => {
|
|
5
|
+
const objectID: ObjectID = new ObjectID('id');
|
|
6
|
+
expect(objectID.id).toBe('id');
|
|
7
|
+
});
|
|
8
|
+
test('ObjectID.fromString() should create ObjectID', () => {
|
|
9
|
+
expect(ObjectID.fromString('id')).toBeInstanceOf(ObjectID);
|
|
10
|
+
});
|
|
11
|
+
test('Should create ObjectId through transformer', () => {});
|
|
12
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Permission from '../../Types/Permission';
|
|
2
|
+
|
|
3
|
+
describe('Permission', () => {
|
|
4
|
+
test('Permission.ProjectMember should be ProjectMember', () => {
|
|
5
|
+
expect(Permission.ProjectMember).toBe('ProjectMember');
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
test('Permission.Public should be Public', () => {
|
|
9
|
+
expect(Permission.Public).toBe('Public');
|
|
10
|
+
});
|
|
11
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import BadDataException from '../../Types/Exception/BadDataException';
|
|
2
|
+
import Phone from '../../Types/Phone';
|
|
3
|
+
|
|
4
|
+
describe('Testing Class Phone', () => {
|
|
5
|
+
test('Should create a phone if the phone is valid phone number', () => {
|
|
6
|
+
expect(new Phone('+251912974103').toString()).toEqual('+251912974103');
|
|
7
|
+
expect(new Phone('961-770-7727').phone).toEqual('961-770-7727');
|
|
8
|
+
expect(new Phone('943-627-0355').phone).toEqual('943-627-0355');
|
|
9
|
+
expect(new Phone('282.652.3201').phone).toEqual('282.652.3201');
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
test('Phone.phone should be mutatable', () => {
|
|
13
|
+
const value: Phone = new Phone('+251912974103');
|
|
14
|
+
value.phone = '+251925974121';
|
|
15
|
+
expect(value.phone).toEqual('+251925974121');
|
|
16
|
+
expect(value.toString()).toEqual('+251925974121');
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
test('Creating phone number with invalid format should throw BadDataException', () => {
|
|
20
|
+
expect(() => {
|
|
21
|
+
new Phone('25192599879079074121');
|
|
22
|
+
}).toThrowError(BadDataException);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test('try to mutating Phone.phone with invalid value should throw a BadDataException', () => {
|
|
26
|
+
const valid: string = '+251912974103';
|
|
27
|
+
const invalid: string = '278@$90> ';
|
|
28
|
+
const value: Phone = new Phone(valid);
|
|
29
|
+
expect(() => {
|
|
30
|
+
value.phone = invalid;
|
|
31
|
+
}).toThrowError(BadDataException);
|
|
32
|
+
expect(() => {
|
|
33
|
+
value.phone = '278@$90> ';
|
|
34
|
+
}).toThrow('Phone is not in valid format: 278@$90>');
|
|
35
|
+
expect(value.phone).toBe(valid);
|
|
36
|
+
expect(() => {
|
|
37
|
+
value.phone = 'hgjuit879';
|
|
38
|
+
}).toThrowError(BadDataException);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import BadDataException from '../../Types/Exception/BadDataException';
|
|
2
|
+
import Port from '../../Types/Port';
|
|
3
|
+
import PositiveNumber from '../../Types/PositiveNumber';
|
|
4
|
+
|
|
5
|
+
describe('Testing class port', () => {
|
|
6
|
+
test('should return a posetive number', () => {
|
|
7
|
+
const value: Port = new Port(3000);
|
|
8
|
+
expect(value.port.positiveNumber).toBeGreaterThanOrEqual(0);
|
|
9
|
+
expect(new Port('6000').port.positiveNumber).toEqual(6000);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
test('should throw exception "Port is not in valid format."', () => {
|
|
13
|
+
expect(() => {
|
|
14
|
+
new Port(67000);
|
|
15
|
+
}).toThrow('Port is not in valid format.');
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test('Port.port should be mutatable', () => {
|
|
19
|
+
const value: Port = new Port(5000);
|
|
20
|
+
value.port = new PositiveNumber(7000);
|
|
21
|
+
expect(value.port.positiveNumber).toEqual(7000);
|
|
22
|
+
expect(value.port.toNumber()).toEqual(7000);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test('try to mutating Port.port with invalid value should throw an BadDataException', () => {
|
|
26
|
+
const value: Port = new Port(3000);
|
|
27
|
+
expect(() => {
|
|
28
|
+
value.port = new PositiveNumber('hj567');
|
|
29
|
+
}).toThrowError(BadDataException);
|
|
30
|
+
expect(() => {
|
|
31
|
+
value.port = new PositiveNumber(-6000);
|
|
32
|
+
}).toThrow(BadDataException);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test('If the supplied port is string type, is should convert it to number before creating port', () => {
|
|
36
|
+
const value: Port = new Port('6000');
|
|
37
|
+
expect(typeof value.port.positiveNumber).toBe('number');
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import BadDataException from '../../Types/Exception/BadDataException';
|
|
2
|
+
import PositiveNumber from '../../Types/PositiveNumber';
|
|
3
|
+
|
|
4
|
+
describe('PositiveNumber constructor', () => {
|
|
5
|
+
test('should create PositiveNumber', () => {
|
|
6
|
+
const value: number = 42;
|
|
7
|
+
const n: PositiveNumber = new PositiveNumber(value);
|
|
8
|
+
|
|
9
|
+
expect(n).toBeInstanceOf(PositiveNumber);
|
|
10
|
+
expect(n.positiveNumber).toBe(value);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const validNumbers: Array<[number | string, number]> = [
|
|
14
|
+
[0, 0],
|
|
15
|
+
[1, 1],
|
|
16
|
+
[Infinity, Infinity],
|
|
17
|
+
[NaN, NaN],
|
|
18
|
+
['255.0', 255],
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
test.each(validNumbers)(
|
|
22
|
+
'(new PositiveNumber(%p)).positiveNumber == %p',
|
|
23
|
+
(value: number | string, expected: number) => {
|
|
24
|
+
const n: PositiveNumber = new PositiveNumber(value);
|
|
25
|
+
|
|
26
|
+
expect(n).toBeInstanceOf(PositiveNumber);
|
|
27
|
+
expect(n.positiveNumber).toBe(expected);
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
const invalidNumbers: Array<number | string> = ['', 'hello', -1, 'NaN'];
|
|
32
|
+
|
|
33
|
+
test.each(invalidNumbers)(
|
|
34
|
+
'should throw error for new PositiveNumber(%p)',
|
|
35
|
+
(value: number | string) => {
|
|
36
|
+
expect(() => {
|
|
37
|
+
new PositiveNumber(value);
|
|
38
|
+
}).toThrowError(BadDataException);
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
interface TestCase {
|
|
44
|
+
value: number | string;
|
|
45
|
+
stringValue: string;
|
|
46
|
+
numberValue: number;
|
|
47
|
+
isZero: boolean;
|
|
48
|
+
isOne: boolean;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const tests: Array<TestCase> = [
|
|
52
|
+
{
|
|
53
|
+
value: 0,
|
|
54
|
+
stringValue: '0',
|
|
55
|
+
numberValue: 0,
|
|
56
|
+
isZero: true,
|
|
57
|
+
isOne: false,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
value: 1,
|
|
61
|
+
stringValue: '1',
|
|
62
|
+
numberValue: 1,
|
|
63
|
+
isZero: false,
|
|
64
|
+
isOne: true,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
value: 42,
|
|
68
|
+
stringValue: '42',
|
|
69
|
+
numberValue: 42,
|
|
70
|
+
isZero: false,
|
|
71
|
+
isOne: false,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
value: Infinity,
|
|
75
|
+
stringValue: 'Infinity',
|
|
76
|
+
numberValue: Infinity,
|
|
77
|
+
isZero: false,
|
|
78
|
+
isOne: false,
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
value: NaN,
|
|
82
|
+
stringValue: 'NaN',
|
|
83
|
+
numberValue: NaN,
|
|
84
|
+
isZero: false,
|
|
85
|
+
isOne: false,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
value: '255.0',
|
|
89
|
+
stringValue: '255',
|
|
90
|
+
numberValue: 255,
|
|
91
|
+
isZero: false,
|
|
92
|
+
isOne: false,
|
|
93
|
+
},
|
|
94
|
+
];
|
|
95
|
+
|
|
96
|
+
describe('PositiveNumber.toString', () => {
|
|
97
|
+
test.each(tests)(
|
|
98
|
+
`(new PositiveNumber($value)).toString() == $stringValue`,
|
|
99
|
+
({ value, stringValue }: TestCase) => {
|
|
100
|
+
const n: PositiveNumber = new PositiveNumber(value);
|
|
101
|
+
|
|
102
|
+
expect(n).toBeInstanceOf(PositiveNumber);
|
|
103
|
+
expect(n.toString()).toBe(stringValue);
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
describe('PositiveNumber.isZero', () => {
|
|
109
|
+
test.each(tests)(
|
|
110
|
+
`(new PositiveNumber($value)).isZero() == $isZero`,
|
|
111
|
+
({ value, isZero }: TestCase) => {
|
|
112
|
+
const n: PositiveNumber = new PositiveNumber(value);
|
|
113
|
+
|
|
114
|
+
expect(n).toBeInstanceOf(PositiveNumber);
|
|
115
|
+
expect(n.isZero()).toBe(isZero);
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
describe('PositiveNumber.isOne', () => {
|
|
121
|
+
test.each(tests)(
|
|
122
|
+
`(new PositiveNumber($value)).isOne() == $isOne`,
|
|
123
|
+
({ value, isOne }: TestCase) => {
|
|
124
|
+
const n: PositiveNumber = new PositiveNumber(value);
|
|
125
|
+
|
|
126
|
+
expect(n).toBeInstanceOf(PositiveNumber);
|
|
127
|
+
expect(n.isOne()).toBe(isOne);
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
describe('PositiveNumber.toNumber', () => {
|
|
133
|
+
test.each(tests)(
|
|
134
|
+
`(new PositiveNumber($value)).toNumber() == $numberValue`,
|
|
135
|
+
({ value, numberValue }: TestCase) => {
|
|
136
|
+
const n: PositiveNumber = new PositiveNumber(value);
|
|
137
|
+
|
|
138
|
+
expect(n).toBeInstanceOf(PositiveNumber);
|
|
139
|
+
expect(n.toNumber()).toBe(numberValue);
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import SecuritySeverity from '../../Types/SecuritySeverity';
|
|
2
|
+
|
|
3
|
+
describe('enum SecuritySeverity', () => {
|
|
4
|
+
test('SecuritySeverity.Critical should be Critical', () => {
|
|
5
|
+
expect(SecuritySeverity.Critical).toEqual('Critical');
|
|
6
|
+
});
|
|
7
|
+
test('SecuritySeverity.High should be High', () => {
|
|
8
|
+
expect(SecuritySeverity.High).toEqual('High');
|
|
9
|
+
});
|
|
10
|
+
test('SecuritySeverity.Medium should be Medium', () => {
|
|
11
|
+
expect(SecuritySeverity.Medium).toEqual('Medium');
|
|
12
|
+
});
|
|
13
|
+
test('SecuritySeverity.Low should be Low', () => {
|
|
14
|
+
expect(SecuritySeverity.Low).toEqual('Low');
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import NotImplementedException from '../../Types/Exception/NotImplementedException';
|
|
2
|
+
import { JSONObject } from '../../Types/JSON';
|
|
3
|
+
import SerializableObject from '../../Types/SerializableObject';
|
|
4
|
+
|
|
5
|
+
describe('SerializableObject Class', () => {
|
|
6
|
+
let serializableObject: SerializableObject;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
serializableObject = new SerializableObject();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
test('Constructor initializes an instance of SerializableObject', () => {
|
|
13
|
+
expect(serializableObject).toBeInstanceOf(SerializableObject);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
describe('toJSON Method', () => {
|
|
17
|
+
test('Throws NotImplementedException when called', () => {
|
|
18
|
+
expect(() => {
|
|
19
|
+
return serializableObject.toJSON();
|
|
20
|
+
}).toThrow(NotImplementedException);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
describe('fromJSON Method', () => {
|
|
25
|
+
test('Throws NotImplementedException when called', () => {
|
|
26
|
+
expect(() => {
|
|
27
|
+
return SerializableObject.fromJSON({});
|
|
28
|
+
}).toThrow(NotImplementedException);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
describe('fromJSON Instance Method', () => {
|
|
33
|
+
test('Returns the result from the static fromJSON method', () => {
|
|
34
|
+
const json: JSONObject = { key: 'value' };
|
|
35
|
+
const expectedResult: SerializableObject = new SerializableObject();
|
|
36
|
+
jest.spyOn(SerializableObject, 'fromJSON').mockReturnValue(
|
|
37
|
+
expectedResult
|
|
38
|
+
);
|
|
39
|
+
const result: SerializableObject =
|
|
40
|
+
serializableObject.fromJSON(json);
|
|
41
|
+
expect(result).toBe(expectedResult);
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import Sleep from '../../Types/Sleep';
|
|
2
|
+
|
|
3
|
+
describe('Sleep.sleep', () => {
|
|
4
|
+
test('should delay by given duration', async () => {
|
|
5
|
+
jest.useFakeTimers();
|
|
6
|
+
jest.spyOn(global, 'setTimeout');
|
|
7
|
+
|
|
8
|
+
const delay: number = 100;
|
|
9
|
+
|
|
10
|
+
// See - https://stackoverflow.com/a/51132058
|
|
11
|
+
Promise.resolve()
|
|
12
|
+
.then(() => {
|
|
13
|
+
jest.advanceTimersByTime(delay);
|
|
14
|
+
})
|
|
15
|
+
.catch(() => {});
|
|
16
|
+
|
|
17
|
+
await Sleep.sleep(delay);
|
|
18
|
+
|
|
19
|
+
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
20
|
+
expect(setTimeout).toHaveBeenLastCalledWith(
|
|
21
|
+
expect.any(Function),
|
|
22
|
+
delay
|
|
23
|
+
);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import Text from '../../Types/Text';
|
|
2
|
+
|
|
3
|
+
describe('class Text', () => {
|
|
4
|
+
test('Text.uppercaseFirstLetter should make string first letter Uppercase', () => {
|
|
5
|
+
expect(Text.uppercaseFirstLetter('text')).toEqual('Text');
|
|
6
|
+
expect(Text.uppercaseFirstLetter('another test')).toEqual(
|
|
7
|
+
'Another test'
|
|
8
|
+
);
|
|
9
|
+
});
|
|
10
|
+
});
|