@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,70 @@
|
|
|
1
|
+
import EqualToOrNull from '../../../Types/BaseDatabase/EqualToOrNull';
|
|
2
|
+
import BadDataException from '../../../Types/Exception/BadDataException';
|
|
3
|
+
import { JSONObject } from '../../../Types/JSON';
|
|
4
|
+
|
|
5
|
+
describe('EqualToOrNull', () => {
|
|
6
|
+
it('should create an EqualToOrNull object with a valid value', () => {
|
|
7
|
+
const value: string = 'oneuptime';
|
|
8
|
+
const equalObj: EqualToOrNull = new EqualToOrNull(value);
|
|
9
|
+
expect(equalObj.value).toBe(value);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('should get the value property of an EqualToOrNull object', () => {
|
|
13
|
+
const value: string = 'oneuptime';
|
|
14
|
+
const equalObj: EqualToOrNull = new EqualToOrNull(value);
|
|
15
|
+
expect(equalObj.value).toBe(value);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should set the value property of an EqualToOrNull object', () => {
|
|
19
|
+
const equalObj: EqualToOrNull = new EqualToOrNull('oldValue');
|
|
20
|
+
equalObj.value = 'newValue';
|
|
21
|
+
expect(equalObj.value).toBe('newValue');
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('should return the correct string representation using toString method', () => {
|
|
25
|
+
const equalObj: EqualToOrNull = new EqualToOrNull('oneuptime');
|
|
26
|
+
expect(equalObj.toString()).toBe('oneuptime');
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('should generate the correct JSON representation using toJSON method', () => {
|
|
30
|
+
const equalObj: EqualToOrNull = new EqualToOrNull('oneuptime');
|
|
31
|
+
const expectedJSON: JSONObject = {
|
|
32
|
+
_type: 'EqualToOrNull',
|
|
33
|
+
value: 'oneuptime',
|
|
34
|
+
};
|
|
35
|
+
expect(equalObj.toJSON()).toEqual(expectedJSON);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('should create an EqualToOrNull object from valid JSON input', () => {
|
|
39
|
+
const jsonInput: JSONObject = {
|
|
40
|
+
_type: 'EqualToOrNull',
|
|
41
|
+
value: 'oneuptime',
|
|
42
|
+
};
|
|
43
|
+
const equalObj: EqualToOrNull = EqualToOrNull.fromJSON(jsonInput);
|
|
44
|
+
expect(equalObj.value).toBe('oneuptime');
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('should throw a BadDataException when using invalid JSON input', () => {
|
|
48
|
+
const jsonInput: JSONObject = {
|
|
49
|
+
_type: 'InvalidType',
|
|
50
|
+
value: 'oneuptime',
|
|
51
|
+
};
|
|
52
|
+
expect(() => {
|
|
53
|
+
return EqualToOrNull.fromJSON(jsonInput);
|
|
54
|
+
}).toThrow(BadDataException);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it('should be a type of EqualToOrNull', () => {
|
|
58
|
+
const equalObj: EqualToOrNull = new EqualToOrNull('oneuptime');
|
|
59
|
+
expect(equalObj).toBeInstanceOf(EqualToOrNull);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('should handle null value when using fromJSON method', () => {
|
|
63
|
+
const jsonInput: JSONObject = {
|
|
64
|
+
_type: 'EqualToOrNull',
|
|
65
|
+
value: null,
|
|
66
|
+
};
|
|
67
|
+
const equalObj: EqualToOrNull = EqualToOrNull.fromJSON(jsonInput);
|
|
68
|
+
expect(equalObj.value).toBeNull();
|
|
69
|
+
});
|
|
70
|
+
});
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import InBetween from '../../../Types/BaseDatabase/InBetween';
|
|
2
|
+
import BadDataException from '../../../Types/Exception/BadDataException';
|
|
3
|
+
import { JSONObject } from '../../../Types/JSON';
|
|
4
|
+
|
|
5
|
+
describe('InBetween', () => {
|
|
6
|
+
it('should create an InBetween object with valid start and end values', () => {
|
|
7
|
+
const startValue: number = 10;
|
|
8
|
+
const endValue: number = 20;
|
|
9
|
+
const betweenObj: InBetween = new InBetween(startValue, endValue);
|
|
10
|
+
expect(betweenObj.startValue).toBe(10);
|
|
11
|
+
expect(betweenObj.endValue).toBe(20);
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it('should generate the correct JSON representation using toJSON method', () => {
|
|
15
|
+
const startValue: number = 10;
|
|
16
|
+
const endValue: number = 20;
|
|
17
|
+
const betweenObj: InBetween = new InBetween(startValue, endValue);
|
|
18
|
+
const expectedJSON: JSONObject = {
|
|
19
|
+
_type: 'InBetween',
|
|
20
|
+
startValue: 10,
|
|
21
|
+
endValue: 20,
|
|
22
|
+
};
|
|
23
|
+
expect(betweenObj.toJSON()).toEqual(expectedJSON);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('should create an InBetween object from valid JSON input', () => {
|
|
27
|
+
const jsonInput: JSONObject = {
|
|
28
|
+
_type: 'InBetween',
|
|
29
|
+
startValue: 10,
|
|
30
|
+
endValue: 20,
|
|
31
|
+
};
|
|
32
|
+
const betweenObj: InBetween = InBetween.fromJSON(jsonInput);
|
|
33
|
+
expect(betweenObj.startValue).toBe(10);
|
|
34
|
+
expect(betweenObj.endValue).toBe(20);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('should throw a BadDataException when using invalid JSON input', () => {
|
|
38
|
+
const jsonInput: JSONObject = {
|
|
39
|
+
_type: 'InvalidType',
|
|
40
|
+
startValue: 10,
|
|
41
|
+
endValue: 20,
|
|
42
|
+
};
|
|
43
|
+
expect(() => {
|
|
44
|
+
return InBetween.fromJSON(jsonInput);
|
|
45
|
+
}).toThrow(BadDataException);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('should return a string with start and end values matching', () => {
|
|
49
|
+
const startValue: number = 15;
|
|
50
|
+
const endValue: number = 15;
|
|
51
|
+
const betweenObj: InBetween = new InBetween(startValue, endValue);
|
|
52
|
+
expect(betweenObj.toString()).toBe('15');
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('should return a string with start and end values different', () => {
|
|
56
|
+
const startValue: number = 10;
|
|
57
|
+
const endValue: number = 20;
|
|
58
|
+
const betweenObj: InBetween = new InBetween(startValue, endValue);
|
|
59
|
+
expect(betweenObj.toString()).toBe('10 - 20');
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('should return the start value as a string', () => {
|
|
63
|
+
const startValue: number = 10;
|
|
64
|
+
const endValue: number = 20;
|
|
65
|
+
const betweenObj: InBetween = new InBetween(startValue, endValue);
|
|
66
|
+
expect(betweenObj.toStartValueString()).toBe('10');
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it('should return the end value as a string', () => {
|
|
70
|
+
const startValue: number = 10;
|
|
71
|
+
const endValue: number = 20;
|
|
72
|
+
const betweenObj: InBetween = new InBetween(startValue, endValue);
|
|
73
|
+
expect(betweenObj.toEndValueString()).toBe('20');
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it('should be a type of InBetween', () => {
|
|
77
|
+
const inBetweenObj: InBetween = new InBetween(10, 15);
|
|
78
|
+
expect(inBetweenObj).toBeInstanceOf(InBetween);
|
|
79
|
+
});
|
|
80
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import LIMIT_MAX, { LIMIT_PER_PROJECT } from '../../../Types/Database/LimitMax';
|
|
2
|
+
|
|
3
|
+
describe('LIMIT_MAX', () => {
|
|
4
|
+
test('it should be number', () => {
|
|
5
|
+
expect(typeof LIMIT_MAX).toBe('number');
|
|
6
|
+
});
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
describe('LIMIT_MAX', () => {
|
|
10
|
+
test('it be positive', () => {
|
|
11
|
+
expect(LIMIT_MAX).toBeGreaterThan(0);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
describe('LIMIT_PER_PROJECT', () => {
|
|
16
|
+
test('should be positive number', () => {
|
|
17
|
+
expect(typeof LIMIT_PER_PROJECT).toBe('number');
|
|
18
|
+
expect(LIMIT_PER_PROJECT).toBeGreaterThan(0);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import NotEqual from '../../../Types/BaseDatabase/NotEqual';
|
|
2
|
+
|
|
3
|
+
describe('NotEqual', () => {
|
|
4
|
+
describe('constructor', () => {
|
|
5
|
+
it('should set the value property', () => {
|
|
6
|
+
const value: string = 'test';
|
|
7
|
+
const notEqual: NotEqual = new NotEqual(value);
|
|
8
|
+
expect(notEqual.value).toBe(value);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
describe('toString', () => {
|
|
12
|
+
it('should return the string value', () => {
|
|
13
|
+
const value: string = 'test';
|
|
14
|
+
const notEqual: NotEqual = new NotEqual(value);
|
|
15
|
+
expect(notEqual.toString()).toBe(value);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import Search from '../../../Types/BaseDatabase/Search';
|
|
2
|
+
|
|
3
|
+
describe('Search', () => {
|
|
4
|
+
test('new Search() should return a valid object', () => {
|
|
5
|
+
expect(new Search('Demo').toString()).toBe('Demo');
|
|
6
|
+
});
|
|
7
|
+
test('value should return a valid string', () => {
|
|
8
|
+
expect(new Search('Item1').value).toBe('Item1');
|
|
9
|
+
});
|
|
10
|
+
});
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import moment, { isMoment } from 'moment';
|
|
2
|
+
import OneUptimeDate from '../../Types/Date';
|
|
3
|
+
import PositiveNumber from '../../Types/PositiveNumber';
|
|
4
|
+
|
|
5
|
+
describe('class OneUptimeDate', () => {
|
|
6
|
+
test('OneUptimeDate.getCurrentDate should return current date', () => {
|
|
7
|
+
expect(OneUptimeDate.getCurrentDate().getFullYear()).toEqual(
|
|
8
|
+
new Date().getFullYear()
|
|
9
|
+
);
|
|
10
|
+
expect(OneUptimeDate.getCurrentDate().getDay()).toEqual(
|
|
11
|
+
new Date().getDay()
|
|
12
|
+
);
|
|
13
|
+
expect(OneUptimeDate.getCurrentDate().getDate()).toEqual(
|
|
14
|
+
new Date().getDate()
|
|
15
|
+
);
|
|
16
|
+
expect(OneUptimeDate.getCurrentDate().getHours()).toEqual(
|
|
17
|
+
new Date().getHours()
|
|
18
|
+
);
|
|
19
|
+
expect(isMoment(OneUptimeDate.getCurrentDate())).toBeFalsy();
|
|
20
|
+
});
|
|
21
|
+
test('OneUptimeDAte.getCurrentMomentDate() should return moment Date', () => {
|
|
22
|
+
expect(isMoment(OneUptimeDate.getCurrentMomentDate())).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
test('OneUptimeDAte.getSomeMinutesAgo should return someMinutes ago Date from current time', () => {
|
|
25
|
+
expect(
|
|
26
|
+
OneUptimeDate.getSomeMinutesAgo(new PositiveNumber(4)).getMinutes()
|
|
27
|
+
).toEqual(moment().add(-4, 'minutes').toDate().getMinutes());
|
|
28
|
+
});
|
|
29
|
+
test('OneUptimeDAte.getOneMinAgo should return one minute age Date from current time', () => {
|
|
30
|
+
expect(OneUptimeDate.getOneMinAgo().getMinutes()).toEqual(
|
|
31
|
+
moment().add(-1, 'minute').toDate().getMinutes()
|
|
32
|
+
);
|
|
33
|
+
});
|
|
34
|
+
test('OneUptimeDAte.getOneDayAgo should return oneDate ago Date', () => {
|
|
35
|
+
expect(OneUptimeDate.getOneDayAgo().getDay()).toEqual(
|
|
36
|
+
moment().add(-1, 'day').toDate().getDay()
|
|
37
|
+
);
|
|
38
|
+
});
|
|
39
|
+
test('OneUptimeDAte.getSomeHoursAgo should return moment Date', () => {
|
|
40
|
+
expect(
|
|
41
|
+
OneUptimeDate.getSomeHoursAgo(new PositiveNumber(4)).getHours()
|
|
42
|
+
).toEqual(moment().add(-4, 'hours').toDate().getHours());
|
|
43
|
+
});
|
|
44
|
+
test('OneUptimeDAte.getSomeDaysAgo should return moment Date', () => {
|
|
45
|
+
expect(
|
|
46
|
+
OneUptimeDate.getSomeDaysAgo(new PositiveNumber(4)).getDay()
|
|
47
|
+
).toEqual(moment().add(-4, 'days').toDate().getDay());
|
|
48
|
+
});
|
|
49
|
+
test('OneUptimeDAte.getSomeSecondsAgo should return moment Date', () => {
|
|
50
|
+
expect(
|
|
51
|
+
OneUptimeDate.getSomeSecondsAgo(new PositiveNumber(4)).getSeconds()
|
|
52
|
+
).toEqual(moment().add(-4, 'seconds').toDate().getSeconds());
|
|
53
|
+
});
|
|
54
|
+
test('OneUptimeDAte.getOneMinAfter should return moment Date', () => {
|
|
55
|
+
expect(OneUptimeDate.getOneMinAfter().getMinutes()).toEqual(
|
|
56
|
+
moment().add(1, 'minute').toDate().getMinutes()
|
|
57
|
+
);
|
|
58
|
+
});
|
|
59
|
+
test('OneUptimeDAte.getOneDayAfter should return moment Date', () => {
|
|
60
|
+
expect(OneUptimeDate.getOneDayAfter().getDay()).toEqual(
|
|
61
|
+
moment().add(1, 'day').toDate().getDay()
|
|
62
|
+
);
|
|
63
|
+
});
|
|
64
|
+
test('OneUptimeDAte.getSomeMinutesAfter should return moment Date', () => {
|
|
65
|
+
expect(
|
|
66
|
+
OneUptimeDate.getSomeMinutesAfter(
|
|
67
|
+
new PositiveNumber(4)
|
|
68
|
+
).getMinutes()
|
|
69
|
+
).toEqual(moment().add(4, 'minutes').toDate().getMinutes());
|
|
70
|
+
});
|
|
71
|
+
test('OneUptimeDAte.getSomeHoursAfter should return moment Date', () => {
|
|
72
|
+
expect(
|
|
73
|
+
OneUptimeDate.getSomeHoursAfter(new PositiveNumber(4)).getHours()
|
|
74
|
+
).toEqual(moment().add(4, 'hours').toDate().getHours());
|
|
75
|
+
});
|
|
76
|
+
test('OneUptimeDAte.getSomeDaysAfter should return moment Date', () => {
|
|
77
|
+
expect(
|
|
78
|
+
OneUptimeDate.getSomeDaysAfter(new PositiveNumber(4)).getDay()
|
|
79
|
+
).toEqual(moment().add(4, 'days').toDate().getDay());
|
|
80
|
+
});
|
|
81
|
+
test('OneUptimeDAte.getSomeSecondsAfter should return moment Date', () => {
|
|
82
|
+
expect(
|
|
83
|
+
OneUptimeDate.getSomeSecondsAfter(
|
|
84
|
+
new PositiveNumber(4)
|
|
85
|
+
).getSeconds()
|
|
86
|
+
).toEqual(moment().add(4, 'seconds').toDate().getSeconds());
|
|
87
|
+
});
|
|
88
|
+
test('OneUptimeDAte.getCurrentYear should return the current year', () => {
|
|
89
|
+
expect(
|
|
90
|
+
OneUptimeDate.getSomeSecondsAfter(
|
|
91
|
+
new PositiveNumber(4)
|
|
92
|
+
).getSeconds()
|
|
93
|
+
).toEqual(moment().add(4, 'seconds').toDate().getSeconds());
|
|
94
|
+
});
|
|
95
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import Dictionary from '../../Types/Dictionary';
|
|
2
|
+
describe('Dictionary', () => {
|
|
3
|
+
test('should allow basic types compile', () => {
|
|
4
|
+
const dictionary: Dictionary<string> = {
|
|
5
|
+
property: 'string',
|
|
6
|
+
};
|
|
7
|
+
const numberDictionary: Dictionary<number> = {
|
|
8
|
+
property: 1,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
expect(dictionary['property']).toEqual('string');
|
|
12
|
+
expect(numberDictionary['property']).toEqual(1);
|
|
13
|
+
});
|
|
14
|
+
test('should allow the complex type', () => {
|
|
15
|
+
const nestedDictionary: Dictionary<{ nested: string }> = {
|
|
16
|
+
property: { nested: 'stringValue' },
|
|
17
|
+
};
|
|
18
|
+
const nestedArrayDictionary: Dictionary<{ nested: Array<string> }> = {
|
|
19
|
+
property: { nested: ['stringValue'] },
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
expect(nestedDictionary['property']?.nested).toEqual('stringValue');
|
|
23
|
+
expect(nestedArrayDictionary['property']?.nested.length).toEqual(1);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import Domain from '../../Types/Domain';
|
|
2
|
+
import BadDataException from '../../Types/Exception/BadDataException';
|
|
3
|
+
|
|
4
|
+
describe('class Domain', () => {
|
|
5
|
+
test('new Domain() should return a valid object if domain is valid', () => {
|
|
6
|
+
expect(new Domain('example.com')).toBeInstanceOf(Domain);
|
|
7
|
+
expect(new Domain('example.com').toString()).toBe('example.com');
|
|
8
|
+
expect(new Domain('example.com.ac')).toBeInstanceOf(Domain);
|
|
9
|
+
expect(new Domain('example.com.ac').toString()).toBe('example.com.ac');
|
|
10
|
+
expect(new Domain('example.com.ac').domain).toBe('example.com.ac');
|
|
11
|
+
expect(new Domain('example.ac')).toBeInstanceOf(Domain);
|
|
12
|
+
expect(new Domain('example.ac').toString()).toBe('example.ac');
|
|
13
|
+
expect(new Domain('example.ac').domain).toBe('example.ac');
|
|
14
|
+
});
|
|
15
|
+
test('new Domain() should throw the BadDataException if domain is invalid', () => {
|
|
16
|
+
expect(() => {
|
|
17
|
+
return new Domain('example');
|
|
18
|
+
}).toThrowError(BadDataException);
|
|
19
|
+
expect(() => {
|
|
20
|
+
new Domain('example');
|
|
21
|
+
}).toThrowError(BadDataException);
|
|
22
|
+
expect(() => {
|
|
23
|
+
new Domain('example@com');
|
|
24
|
+
}).toThrowError(BadDataException);
|
|
25
|
+
|
|
26
|
+
expect(() => {
|
|
27
|
+
new Domain('example.invalid');
|
|
28
|
+
}).toThrowError(BadDataException);
|
|
29
|
+
expect(() => {
|
|
30
|
+
const validDomain: Domain = new Domain('example.valid');
|
|
31
|
+
validDomain.domain = 'example.invalid';
|
|
32
|
+
}).toThrowError(BadDataException);
|
|
33
|
+
});
|
|
34
|
+
test('Domain.domain should be mutable', () => {
|
|
35
|
+
const domain: Domain = new Domain('example.com');
|
|
36
|
+
domain.domain = 'example.io';
|
|
37
|
+
expect(domain.domain).toEqual('example.io');
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import Email from '../../../Types/Email';
|
|
2
|
+
|
|
3
|
+
describe('Email()', () => {
|
|
4
|
+
test('should create an email instance', () => {
|
|
5
|
+
expect(new Email('test@test.com')).toBeInstanceOf(Email);
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
test('should not create an email with invalid credentials', () => {
|
|
9
|
+
const invalidEmail: string = 'invalid email address';
|
|
10
|
+
expect(() => {
|
|
11
|
+
new Email(invalidEmail);
|
|
12
|
+
}).toThrow(`Email ${invalidEmail} is not in valid format.`);
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test('should be a business email', () => {
|
|
16
|
+
const email: Email = new Email('dev@oneuptime.com');
|
|
17
|
+
expect(email.isBusinessEmail()).toBeTruthy();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test('should not be a business email', () => {
|
|
21
|
+
const email: Email = new Email('dev@yahoo.co.uk');
|
|
22
|
+
expect(email.isBusinessEmail()).toBeFalsy();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test('should return the domain of the email address', () => {
|
|
26
|
+
expect(new Email('hello@oneuptime.com').getEmailDomain().hostname).toBe(
|
|
27
|
+
'oneuptime.com'
|
|
28
|
+
);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test('value of email instance should be mutable', () => {
|
|
32
|
+
const email: Email = new Email('test@test.com');
|
|
33
|
+
email.email = 'new@test.com';
|
|
34
|
+
expect(email.toString()).toBe('new@test.com');
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test('should read the value of email instance', () => {
|
|
38
|
+
expect(new Email('test@test.com').email).toBe('test@test.com');
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test('value of email instance should of type string', () => {
|
|
42
|
+
expect(typeof new Email('test@test.com').email).toBe('string');
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
test('should return a string', () => {
|
|
46
|
+
const email: Email = new Email('test@test.com');
|
|
47
|
+
expect(Email.toDatabase(email)).toBe('test@test.com');
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
test('should be an instance Email', () => {
|
|
51
|
+
expect(Email.fromDatabase('test@gmail.com')).toBeInstanceOf(Email);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
test('should not create an instance of Email', () => {
|
|
55
|
+
expect(Email.fromDatabase('')).toBeNull();
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
test('should return a string from the transformers to function', () => {
|
|
59
|
+
expect(Email.getDatabaseTransformer().to('test@gmail.com')).toBe(
|
|
60
|
+
'test@gmail.com'
|
|
61
|
+
);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
test('should create an instance of Email through the transformer', () => {
|
|
65
|
+
expect(
|
|
66
|
+
Email.getDatabaseTransformer().from(new Email('test@test.com'))
|
|
67
|
+
).toBeInstanceOf(Email);
|
|
68
|
+
});
|
|
69
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import Email from '../../Types/Email';
|
|
2
|
+
import EmailWithName from '../../Types/EmailWithName';
|
|
3
|
+
import BadDataException from '../../Types/Exception/BadDataException';
|
|
4
|
+
import Faker from '../../Utils/Faker';
|
|
5
|
+
|
|
6
|
+
describe('class EmailWithName', () => {
|
|
7
|
+
test('new EmailWithName() should return valid object if valid name and email is given', () => {
|
|
8
|
+
const name: string = Faker.generateName();
|
|
9
|
+
const email: Email = Faker.generateEmail();
|
|
10
|
+
expect(new EmailWithName(name, email).name).toEqual(name);
|
|
11
|
+
expect(new EmailWithName(name, email).email).toEqual(email);
|
|
12
|
+
});
|
|
13
|
+
test('EmailWithName.name should be mutable', () => {
|
|
14
|
+
const newName: string = Faker.generateName();
|
|
15
|
+
const emailWithName: EmailWithName = new EmailWithName(
|
|
16
|
+
Faker.generateName(),
|
|
17
|
+
Faker.generateEmail().toString()
|
|
18
|
+
);
|
|
19
|
+
emailWithName.name = newName;
|
|
20
|
+
expect(emailWithName.name).toEqual(newName);
|
|
21
|
+
});
|
|
22
|
+
test('EmailWithName.email should be mutable', () => {
|
|
23
|
+
const newEmail: Email = Faker.generateEmail();
|
|
24
|
+
const emailWithName: EmailWithName = new EmailWithName(
|
|
25
|
+
Faker.generateName(),
|
|
26
|
+
Faker.generateEmail()
|
|
27
|
+
);
|
|
28
|
+
emailWithName.email = newEmail;
|
|
29
|
+
expect(emailWithName.email).toEqual(newEmail);
|
|
30
|
+
});
|
|
31
|
+
test('mutating EmailWithName.email with invalid email should throw BadDataException', () => {
|
|
32
|
+
const emailWithName: EmailWithName = new EmailWithName(
|
|
33
|
+
Faker.generateName(),
|
|
34
|
+
Faker.generateEmail()
|
|
35
|
+
);
|
|
36
|
+
emailWithName.email = 'janedoe@example.com';
|
|
37
|
+
expect(() => {
|
|
38
|
+
emailWithName.email = 'Invalid email';
|
|
39
|
+
}).toThrowError(BadDataException);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
test('EmailWithName.toString() should return the name with email', () => {
|
|
43
|
+
const name: string = Faker.generateName();
|
|
44
|
+
const email: Email = Faker.generateEmail();
|
|
45
|
+
expect(new EmailWithName(name, email).toString()).toEqual(
|
|
46
|
+
`"${name}" <${email}>`
|
|
47
|
+
);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import APIException from '../../../Types/Exception/ApiException';
|
|
2
|
+
|
|
3
|
+
describe('ApiException', () => {
|
|
4
|
+
test('should return error message from ApiException', () => {
|
|
5
|
+
expect(
|
|
6
|
+
new APIException('Server responded with a status code of 5000')
|
|
7
|
+
.message
|
|
8
|
+
).toBe('Server responded with a status code of 5000');
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
test('should return 2 as the code for ApiException', () => {
|
|
12
|
+
expect(
|
|
13
|
+
new APIException('Server responded with a status code of 5000').code
|
|
14
|
+
).toBe(2);
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import BadDataException from '../../../Types/Exception/BadDataException';
|
|
2
|
+
|
|
3
|
+
describe('BadDataException', () => {
|
|
4
|
+
test('should throw a not bad data exception', () => {
|
|
5
|
+
expect(() => {
|
|
6
|
+
throw new BadDataException('This is not a valid IPv4 address');
|
|
7
|
+
}).toThrow('This is not a valid IPv4 address');
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
test('should return 400 as the code for BadDataException', () => {
|
|
11
|
+
expect(
|
|
12
|
+
new BadDataException('This is not a valid IPv4 address').code
|
|
13
|
+
).toBe(400);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import BadOperationException from '../../../Types/Exception/BadOperationException';
|
|
2
|
+
|
|
3
|
+
describe('BadOperationException', () => {
|
|
4
|
+
test('should return error message from BadOperationException', () => {
|
|
5
|
+
expect(
|
|
6
|
+
new BadOperationException('Cannot await a non-thenable code')
|
|
7
|
+
.message
|
|
8
|
+
).toBe('Cannot await a non-thenable code');
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
test('should return 5 as the code for BadOperationException', () => {
|
|
12
|
+
expect(
|
|
13
|
+
new BadOperationException('Cannot await a non-thenable code').code
|
|
14
|
+
).toBe(5);
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import BadRequestException from '../../../Types/Exception/BadRequestException';
|
|
2
|
+
|
|
3
|
+
describe('BadRequestException', () => {
|
|
4
|
+
test('should throw a bad request exception', () => {
|
|
5
|
+
expect(() => {
|
|
6
|
+
throw new BadRequestException('Forbidden. A token is needed');
|
|
7
|
+
}).toThrow('Forbidden. A token is needed');
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
test('should return 400 as the code for BadRequestException', () => {
|
|
11
|
+
expect(
|
|
12
|
+
new BadRequestException('Forbidden. A token is needed').code
|
|
13
|
+
).toBe(400);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import DatabaseNotConnectedException from '../../../Types/Exception/DatabaseNotConnectedException';
|
|
2
|
+
|
|
3
|
+
describe('DatabaseNotConnectedException', () => {
|
|
4
|
+
test('should return the error message set in database exception', () => {
|
|
5
|
+
expect(new DatabaseNotConnectedException().message).toBe(
|
|
6
|
+
'Database not connected'
|
|
7
|
+
);
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
test('should return 3 as the code for DatabaseNotConnectedException', () => {
|
|
11
|
+
expect(new DatabaseNotConnectedException().code).toBe(3);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import Exception from '../../../Types/Exception/Exception';
|
|
2
|
+
|
|
3
|
+
describe('Exception', () => {
|
|
4
|
+
test('should throw an exception from exception class', () => {
|
|
5
|
+
expect(() => {
|
|
6
|
+
throw new Exception(1, 'General exception error message');
|
|
7
|
+
}).toThrow('General exception error message');
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
test('should return error message', () => {
|
|
11
|
+
expect(
|
|
12
|
+
new Exception(0, 'This code has not been implemented').message
|
|
13
|
+
).toBe('This code has not been implemented');
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
test('should return 1 as the code for Exception', () => {
|
|
17
|
+
expect(new Exception(1, 'This is not a valid IPv4 address').code).toBe(
|
|
18
|
+
1
|
|
19
|
+
);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import NotImplementedException from '../../../Types/Exception/NotImplementedException';
|
|
2
|
+
|
|
3
|
+
describe('NotImplementedException', () => {
|
|
4
|
+
test('should throw a not implemented exception', () => {
|
|
5
|
+
expect(() => {
|
|
6
|
+
throw new NotImplementedException();
|
|
7
|
+
}).toThrow('This code is not implemented');
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
test('should return 0 as the code for NotImplementedException', () => {
|
|
11
|
+
expect(new NotImplementedException().code).toBe(0);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { File } from '../../Types/File';
|
|
2
|
+
|
|
3
|
+
describe('interface File', () => {
|
|
4
|
+
test('should have name and contentType property', () => {
|
|
5
|
+
const file: File = {
|
|
6
|
+
name: 'file',
|
|
7
|
+
contentType: 'text/html',
|
|
8
|
+
};
|
|
9
|
+
expect(file.name).toEqual('file');
|
|
10
|
+
expect(file.contentType).toEqual('text/html');
|
|
11
|
+
});
|
|
12
|
+
test('name and contentType property should be mutable', () => {
|
|
13
|
+
const file: File = {
|
|
14
|
+
name: 'file',
|
|
15
|
+
contentType: 'text/html',
|
|
16
|
+
};
|
|
17
|
+
file.name = 'updatedFile';
|
|
18
|
+
file.contentType = 'Text/html';
|
|
19
|
+
expect(file.name).toEqual('updatedFile');
|
|
20
|
+
expect(file.contentType).toEqual('Text/html');
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import HashedString from '../../Types/HashedString';
|
|
2
|
+
import ObjectID from '../../Types/ObjectID';
|
|
3
|
+
describe('class HashedString', () => {
|
|
4
|
+
test('HashedString.constructor() should return valid hashedString', () => {
|
|
5
|
+
const hashedString: HashedString = new HashedString('stringToHash');
|
|
6
|
+
expect(hashedString).toBeInstanceOf(HashedString);
|
|
7
|
+
expect(hashedString.isValueHashed()).toBe(false);
|
|
8
|
+
expect(hashedString.hashValue(ObjectID.generate())).toBeTruthy();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
// TODO: Make this test pass.
|
|
12
|
+
test.skip('should SHA256 hash', () => {
|
|
13
|
+
const hashedString: HashedString = new HashedString('stringToHash');
|
|
14
|
+
expect(hashedString).toBeInstanceOf(HashedString);
|
|
15
|
+
expect(hashedString.isValueHashed()).toBe(false);
|
|
16
|
+
expect(hashedString.hashValue(null)).toBe(
|
|
17
|
+
'd3cd003df301cb1adf26fd3af623a0d372403f71b23bd099511cee06e7029b37'
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
});
|