@rentcheck/biz 1.0.227 → 1.0.229
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/dist/constants/plans.js +3 -2
- package/dist/permissions/inspections.d.ts +2 -2
- package/dist/rules/account-screen/index.d.ts +1 -1
- package/dist/rules/application-settings/index.d.ts +0 -1
- package/dist/rules/features/index.d.ts +2 -3
- package/dist/rules/inspections/index.d.ts +2 -1
- package/dist/rules/inspections/index.js +12 -1
- package/dist/rules/properties/index.d.ts +1 -1
- package/dist/rules/sections/index.d.ts +1 -2
- package/dist/rules/teammates/index.d.ts +1 -1
- package/dist/rules/work-orders/index.d.ts +2 -2
- package/dist/utils/filters/index.d.ts +1 -1
- package/dist/utils/flags/index.d.ts +0 -1
- package/dist/utils/inspection-features/index.d.ts +2 -6
- package/dist/utils/inspection-features/sorting.d.ts +1 -1
- package/dist/utils/inspection-templates/common.d.ts +2 -2
- package/dist/utils/inspection-templates/template-logic.d.ts +1 -1
- package/dist/utils/inspections/index.d.ts +3 -3
- package/dist/utils/integrations/index.d.ts +1 -2
- package/dist/utils/permission-groups/index.d.ts +0 -1
- package/dist/utils/properties/validations.d.ts +1 -1
- package/dist/utils/subscriptions/index.d.ts +2 -2
- package/dist/utils/tenants/index.d.ts +0 -1
- package/package.json +1 -1
- package/src/constants/plans.ts +5 -2
- package/src/rules/inspections/index.ts +18 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/constants/emails.d.ts +0 -2
- package/dist/constants/index.d.ts +0 -8
- package/dist/constants/notification-preferences.d.ts +0 -2
- package/dist/constants/plans.d.ts +0 -1
- package/dist/constants/rooms.d.ts +0 -16
- package/dist/constants/skills.d.ts +0 -2
- package/dist/constants/sync-info.d.ts +0 -1
- package/dist/constants/user-settings.d.ts +0 -2
- package/dist/errors/admin.d.ts +0 -10
- package/dist/errors/appfolio.d.ts +0 -4
- package/dist/errors/automations.d.ts +0 -13
- package/dist/errors/http.d.ts +0 -28
- package/dist/errors/imports.d.ts +0 -13
- package/dist/errors/index.d.ts +0 -27
- package/dist/errors/inspection-invites.d.ts +0 -4
- package/dist/errors/inspection-templates.d.ts +0 -10
- package/dist/errors/inspections.d.ts +0 -68
- package/dist/errors/integrations.d.ts +0 -10
- package/dist/errors/permission-groups.d.ts +0 -4
- package/dist/errors/properties.d.ts +0 -7
- package/dist/errors/propexo.d.ts +0 -20
- package/dist/errors/subscriptions.d.ts +0 -4
- package/dist/errors/syncs.d.ts +0 -16
- package/dist/errors/take-over-requests.d.ts +0 -7
- package/dist/errors/team-invites.d.ts +0 -4
- package/dist/errors/validations.d.ts +0 -19
- package/dist/errors/vitally.d.ts +0 -10
- package/dist/errors/work-orders.d.ts +0 -7
- package/dist/errors/zapier.d.ts +0 -7
- package/dist/index.d.ts +0 -5
- package/dist/permissions/account-settings/index.d.ts +0 -2
- package/dist/permissions/account-settings/inspection-reports.d.ts +0 -2
- package/dist/permissions/account-settings/maintenance-settings.d.ts +0 -2
- package/dist/permissions/index.d.ts +0 -3
- package/dist/permissions/integrations/appfolio.d.ts +0 -2
- package/dist/permissions/integrations/index.d.ts +0 -6
- package/dist/permissions/integrations/latchel.d.ts +0 -2
- package/dist/permissions/integrations/rent-manager.d.ts +0 -2
- package/dist/permissions/integrations/rentcheck-api.d.ts +0 -2
- package/dist/permissions/integrations/rentvine.d.ts +0 -2
- package/dist/permissions/integrations/zapier.d.ts +0 -2
- package/dist/rules/automations/index.d.ts +0 -9
- package/dist/rules/billing/index.d.ts +0 -8
- package/dist/rules/common/index.d.ts +0 -5
- package/dist/rules/index.d.ts +0 -15
- package/dist/rules/notification-preferences/index.d.ts +0 -7
- package/dist/rules/permission-groups/index.d.ts +0 -5
- package/dist/rules/residents/index.d.ts +0 -11
- package/dist/rules/subscriptions/index.d.ts +0 -2
- package/dist/rules/users/index.d.ts +0 -31
- package/dist/utils/address/index.d.ts +0 -13
- package/dist/utils/address/index.js +0 -16
- package/dist/utils/dates/index.d.ts +0 -11
- package/dist/utils/helpers/index.d.ts +0 -9
- package/dist/utils/index.d.ts +0 -19
- package/dist/utils/inspection-templates/index.d.ts +0 -3
- package/dist/utils/properties/index.d.ts +0 -5
- package/dist/utils/query-params/index.d.ts +0 -2
package/dist/constants/plans.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
3
|
+
exports.professionalFreePlanId = exports.essentialFreePlanId = void 0;
|
|
4
|
+
exports.essentialFreePlanId = 'essential-plan---$1.00-(includes-14-day-free-trial)-website';
|
|
5
|
+
exports.professionalFreePlanId = 'professional-plan-14-day-free-trial-website';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AccountSettings, ApiSubscription, Inspection, InspectionEdit, PermissionGroup, Profile } from '@rentcheck/types';
|
|
2
2
|
export declare const canRecordVideo: (subscription?: ApiSubscription | null) => boolean;
|
|
3
3
|
export declare const canTake360Photos: (subscription?: ApiSubscription | null) => boolean;
|
|
4
|
-
export declare const canRenterReportMaintenance: (accountSettings?: AccountSettings | null, subscription?: ApiSubscription | null) =>
|
|
5
|
-
export declare const areFlagDefaultPhotosEnabled: (accountSettings?: AccountSettings | null) =>
|
|
4
|
+
export declare const canRenterReportMaintenance: (accountSettings?: AccountSettings | null, subscription?: ApiSubscription | null) => any;
|
|
5
|
+
export declare const areFlagDefaultPhotosEnabled: (accountSettings?: AccountSettings | null) => any;
|
|
6
6
|
type CanAccessParams = {
|
|
7
7
|
user: Profile;
|
|
8
8
|
inspection: Inspection;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ApiSubscription
|
|
1
|
+
import { ApiSubscription } from '@rentcheck/types';
|
|
2
2
|
export declare const canViewInspectionMessaging: (subscription: ApiSubscription | null, profile?: ApiUser) => boolean;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const noteIsRequired: (feature: Feature, inspection?: ApiInspectionWithTemplate) => boolean;
|
|
1
|
+
export declare const anAnswerRequiresPhoto: (feature: Feature) => any;
|
|
2
|
+
export declare const noteIsRequired: (feature: Feature, inspection?: ApiInspectionWithTemplate) => any;
|
|
4
3
|
export declare const canRotateImage: (image: string) => boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ApiAutomation, ApiInspection, Feature, MaintenanceFlag, Property } from '@rentcheck/types';
|
|
2
2
|
import { UserIsInvitedTeammateParams } from '../../utils/inspections';
|
|
3
3
|
export declare const shouldShowLibraryOption: (inspection?: ApiInspection, profile?: Profile) => boolean;
|
|
4
4
|
export declare const shouldShow360Option: (inspection?: ApiInspection) => boolean;
|
|
@@ -50,4 +50,5 @@ export declare const canReOpen: (inspection: ApiInspection) => boolean;
|
|
|
50
50
|
export declare const inspectionIsInProgress: (inspection: Pick<ApiInspection, 'inspection_status'>) => boolean;
|
|
51
51
|
export declare const canEditFeature: (inspection: ApiInspection, feature: Feature) => boolean;
|
|
52
52
|
export declare const findConflictingAutomation: (template: InspectionTemplate, automations: ApiAutomation[], units: Property[]) => ApiAutomation;
|
|
53
|
+
export declare const canShowAIDamage: (inspection: ApiInspectionWithTemplate, accountSettings?: AccountSettings) => boolean;
|
|
53
54
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.findConflictingAutomation = exports.canEditFeature = exports.inspectionIsInProgress = exports.canReOpen = exports.canShowViewModeToggle = exports.canMakeUnitEdits = exports.canPerformFeatureActions = exports.canShowFlaggedItems = exports.canShowSyncStatus = exports.canManualSync = exports.canCopyInspectionDeeplink = exports.canDownloadReport = exports.canShare = exports.canEditDueDate = exports.canShowHyperlinkToPropertyPage = exports.canShowReviewDueDate = exports.canShowRevisionDueDate = exports.canShowInviteDate = exports.canEditAssignee = exports.canShowAssignee = exports.canShowDueDate = exports.canShowCompletedBy = exports.canShowCompletedDate = exports.canCreateMaintenanceReport = exports.canRequestSignatures = exports.canDownloadMaintenanceFlags = exports.canDownloadImages = exports.canMarkAsComplete = exports.canSendReminder = exports.canDelete = exports.canUnarchive = exports.canArchive = exports.canCancelRevisionRequest = exports.canCancelReviewRequest = exports.canEditLabel = exports.canSetRevisionNotes = exports.canReject = exports.canUndoFirstStepReview = exports.canCompleteFirstStepReview = exports.canApprove = exports.canReview = exports.shouldShowVideoOption = exports.shouldShow360Option = exports.shouldShowLibraryOption = void 0;
|
|
3
|
+
exports.canShowAIDamage = exports.findConflictingAutomation = exports.canEditFeature = exports.inspectionIsInProgress = exports.canReOpen = exports.canShowViewModeToggle = exports.canMakeUnitEdits = exports.canPerformFeatureActions = exports.canShowFlaggedItems = exports.canShowSyncStatus = exports.canManualSync = exports.canCopyInspectionDeeplink = exports.canDownloadReport = exports.canShare = exports.canEditDueDate = exports.canShowHyperlinkToPropertyPage = exports.canShowReviewDueDate = exports.canShowRevisionDueDate = exports.canShowInviteDate = exports.canEditAssignee = exports.canShowAssignee = exports.canShowDueDate = exports.canShowCompletedBy = exports.canShowCompletedDate = exports.canCreateMaintenanceReport = exports.canRequestSignatures = exports.canDownloadMaintenanceFlags = exports.canDownloadImages = exports.canMarkAsComplete = exports.canSendReminder = exports.canDelete = exports.canUnarchive = exports.canArchive = exports.canCancelRevisionRequest = exports.canCancelReviewRequest = exports.canEditLabel = exports.canSetRevisionNotes = exports.canReject = exports.canUndoFirstStepReview = exports.canCompleteFirstStepReview = exports.canApprove = exports.canReview = exports.shouldShowVideoOption = exports.shouldShow360Option = exports.shouldShowLibraryOption = void 0;
|
|
4
4
|
const utils_1 = require("../../utils");
|
|
5
5
|
const inspections_1 = require("../../utils/inspections");
|
|
6
6
|
const shouldShowLibraryOption = (inspection, profile) => {
|
|
@@ -622,3 +622,14 @@ const findConflictingAutomation = (template, automations, units) => {
|
|
|
622
622
|
});
|
|
623
623
|
};
|
|
624
624
|
exports.findConflictingAutomation = findConflictingAutomation;
|
|
625
|
+
const canShowAIDamage = (inspection, accountSettings) => {
|
|
626
|
+
var _a, _b;
|
|
627
|
+
if (!accountSettings)
|
|
628
|
+
return false;
|
|
629
|
+
if (!((_b = (_a = accountSettings.ai_settings) === null || _a === void 0 ? void 0 : _a.damage_detection) === null || _b === void 0 ? void 0 : _b.enabled)) {
|
|
630
|
+
return false;
|
|
631
|
+
}
|
|
632
|
+
const validRoles = ['creator', 'self-perform'];
|
|
633
|
+
return (validRoles.includes(inspection.role) || (0, inspections_1.userIsInvitedTeammate)(inspection));
|
|
634
|
+
};
|
|
635
|
+
exports.canShowAIDamage = canShowAIDamage;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiAppFolioIntegration, ApiRentManagerIntegration, AppFolioIntegration,
|
|
1
|
+
import { ApiAppFolioIntegration, ApiRentManagerIntegration, AppFolioIntegration, Property, RentmanagerIntegration, RentvineIntegration, ApiRentvineIntegration, SyncData, BaseIntegration } from '@rentcheck/types';
|
|
2
2
|
/**
|
|
3
3
|
* Checks if user is an internal admin or its id/organization ids are within the
|
|
4
4
|
* `property.authorized_user_ids`.
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const canBeMarkedNotApplicable: (section: Feature['section']) => boolean;
|
|
1
|
+
export declare const canBeMarkedNotApplicable: (section: Feature) => boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiSubscription, ApiUser
|
|
1
|
+
import { ApiSubscription, ApiUser } from '@rentcheck/types';
|
|
2
2
|
import { RuleEvaluation } from '../common';
|
|
3
3
|
export declare const canAccess: (user?: ApiUser | null, subscription?: ApiSubscription | null) => boolean;
|
|
4
4
|
export declare const canEdit: (user?: ApiUser | null, subscription?: ApiSubscription | null) => RuleEvaluation;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ApiSubscription, ApiAppFolioIntegration, ApiRentManagerIntegration, ApiRentvineIntegration } from '@rentcheck/types';
|
|
2
2
|
type CreateWorkOrderResult = 'not allowed' | 'allowed' | 'not synced';
|
|
3
3
|
/**
|
|
4
4
|
* A user can create work orders if they have an active integration with work order sync turn on and
|
|
@@ -12,5 +12,5 @@ type CreateWorkOrderResult = 'not allowed' | 'allowed' | 'not synced';
|
|
|
12
12
|
* @returns 'allowed' if all requirements are met, 'not synced' if only the propery sync is missing,
|
|
13
13
|
* 'not allowed' otherwise
|
|
14
14
|
*/
|
|
15
|
-
export declare const canCreateWorkOrders: (vendor: SyncData
|
|
15
|
+
export declare const canCreateWorkOrders: (vendor: SyncData, integration: ApiAppFolioIntegration | ApiRentManagerIntegration[] | ApiRentvineIntegration | undefined | null, subscription: ApiSubscription | null, property: APIProperty) => CreateWorkOrderResult;
|
|
16
16
|
export {};
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import { Feature } from '@rentcheck/types';
|
|
2
1
|
export * from './sorting';
|
|
3
|
-
export declare const getFlagsForMedia: (feature: Feature, image: string) =>
|
|
4
|
-
export declare const getLinkedQuestionsForMedia: (feature: Feature, image: string) =>
|
|
5
|
-
question: import("@rentcheck/types").TemplateQuestion;
|
|
6
|
-
answer: string;
|
|
7
|
-
}[];
|
|
2
|
+
export declare const getFlagsForMedia: (feature: Feature, image: string) => any;
|
|
3
|
+
export declare const getLinkedQuestionsForMedia: (feature: Feature, image: string) => any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InspectionTemplate } from '@rentcheck/types';
|
|
2
2
|
export declare const sortFeaturesBySection: <T extends Feature>(features: T[], template: Pick<InspectionTemplate, 'sections'>) => T[];
|
|
3
3
|
/**
|
|
4
4
|
* Converts the template room name from plural to singular, this is to
|
|
@@ -33,6 +33,6 @@ export declare const parseSelectedSectionName: (name: string) => string;
|
|
|
33
33
|
* is less than the second argument, zero if they're equal, and a positive
|
|
34
34
|
* value otherwise
|
|
35
35
|
*/
|
|
36
|
-
export declare const sortFn: (a: InspectionTemplate | ApiInspectionTemplateDigest, b: InspectionTemplate | ApiInspectionTemplateDigest) =>
|
|
36
|
+
export declare const sortFn: (a: InspectionTemplate | ApiInspectionTemplateDigest, b: InspectionTemplate | ApiInspectionTemplateDigest) => any;
|
|
37
37
|
export declare const hasCustomTemplates: (templates: (ApiInspectionTemplateDigest | InspectionTemplate)[]) => boolean;
|
|
38
|
-
export declare const isPublished: (template: InspectionTemplate) =>
|
|
38
|
+
export declare const isPublished: (template: InspectionTemplate) => any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Feature, InspectionTemplate, TemplateFeatureLogic, TemplateSectionLogic } from '@rentcheck/types';
|
|
2
|
-
export declare const getQuestionIdsAttachedToLogic: (inspectionTemplate: Pick<InspectionTemplate, 'sections'>) =>
|
|
2
|
+
export declare const getQuestionIdsAttachedToLogic: (inspectionTemplate: Pick<InspectionTemplate, 'sections'>) => any;
|
|
3
3
|
export declare const isTriggeredForDisplay: (logic: TemplateFeatureLogic | TemplateSectionLogic, otherFeatures: Feature[]) => boolean;
|
|
4
4
|
export declare const featureShouldBeVisible: (feature: Feature, otherFeatures: Feature[], template: Pick<InspectionTemplate, 'sections'>) => boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ApiInspection, Inspection } from '@rentcheck/types';
|
|
2
2
|
export type UserIsInvitedTeammateParams = Pick<ApiInspection, 'role' | 'assigned_recipients'>;
|
|
3
3
|
export declare const userIsInvitedTeammate: (inspection: UserIsInvitedTeammateParams) => boolean;
|
|
4
4
|
export declare const requiresApproval: (inspection: ApiInspection | Inspection) => boolean;
|
|
@@ -6,9 +6,9 @@ export declare const isTwoStepApprovalRequired: (inspection: {
|
|
|
6
6
|
inspection_template: {
|
|
7
7
|
id: string;
|
|
8
8
|
};
|
|
9
|
-
}, accountSettings: AccountSettings) =>
|
|
9
|
+
}, accountSettings: AccountSettings) => any;
|
|
10
10
|
export declare const isCustomMaintenanceFieldAvailable: (inspection: {
|
|
11
11
|
inspection_template: {
|
|
12
12
|
id: string;
|
|
13
13
|
};
|
|
14
|
-
}, customMaintenanceField: CustomMaintenanceFieldSetting) =>
|
|
14
|
+
}, customMaintenanceField: CustomMaintenanceFieldSetting) => any;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const getTeamIdFromMapping: (teamMapping: BaseIntegration['team_mappings'], externalTeamId: string) => string;
|
|
1
|
+
export declare const getTeamIdFromMapping: (teamMapping: BaseIntegration, externalTeamId: string) => any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AccountSettings, ApiAppFolioIntegration,
|
|
1
|
+
import { AccountSettings, ApiAppFolioIntegration, ApiRentManagerIntegration, AppFolioIntegration, Inspection, RentmanagerIntegration } from '@rentcheck/types';
|
|
2
2
|
import { Utils } from '../..';
|
|
3
3
|
export type PropertyHasIntegrationSyncIntegrations = {
|
|
4
4
|
appFolioIntegration?: AppFolioIntegration | ApiAppFolioIntegration;
|
|
@@ -6,8 +6,8 @@ export declare const planIdIsLegacy: (planId?: string) => boolean;
|
|
|
6
6
|
export declare const isOnEssentialsPlan: (subscription?: ApiSubscription | Subscription | null) => boolean;
|
|
7
7
|
export declare const isOnProPlan: (subscription?: ApiSubscription | ChargebeeEventSubscription | Subscription | Pick<ChargebeeSubscription, 'plan_id'> | null) => boolean;
|
|
8
8
|
export declare const hasPropertySyncIntegrationAddons: (subscription: ApiSubscription | Subscription | null) => boolean;
|
|
9
|
-
export declare const hasPremiumVideoAddons: (subscription: ApiSubscription | Subscription | null) =>
|
|
10
|
-
export declare const hasInspectionAutomationAddons: (subscription: ApiSubscription | Subscription | null) =>
|
|
9
|
+
export declare const hasPremiumVideoAddons: (subscription: ApiSubscription | Subscription | null) => any;
|
|
10
|
+
export declare const hasInspectionAutomationAddons: (subscription: ApiSubscription | Subscription | null) => any;
|
|
11
11
|
export declare const isActive: (subscription: ApiSubscription | Subscription | null) => boolean;
|
|
12
12
|
export declare const isCancelled: (subscription: ApiSubscription | Subscription | null) => boolean;
|
|
13
13
|
export declare const isInTrial: (subscription: ApiSubscription | Subscription | null) => boolean;
|
package/package.json
CHANGED
package/src/constants/plans.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
export const
|
|
2
|
-
'essential-plan---$1.00-(includes-
|
|
1
|
+
export const essentialFreePlanId =
|
|
2
|
+
'essential-plan---$1.00-(includes-14-day-free-trial)-website';
|
|
3
|
+
|
|
4
|
+
export const professionalFreePlanId =
|
|
5
|
+
'professional-plan-14-day-free-trial-website';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
APIProperty,
|
|
3
|
+
AccountSettings,
|
|
3
4
|
ApiAutomation,
|
|
4
5
|
ApiInspection,
|
|
5
6
|
ApiInspectionWithTemplate,
|
|
@@ -759,3 +760,20 @@ export const findConflictingAutomation = (
|
|
|
759
760
|
return undefined;
|
|
760
761
|
});
|
|
761
762
|
};
|
|
763
|
+
|
|
764
|
+
export const canShowAIDamage = (
|
|
765
|
+
inspection: ApiInspectionWithTemplate,
|
|
766
|
+
accountSettings?: AccountSettings
|
|
767
|
+
) => {
|
|
768
|
+
if (!accountSettings) return false;
|
|
769
|
+
|
|
770
|
+
if (!accountSettings.ai_settings?.damage_detection?.enabled) {
|
|
771
|
+
return false;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
const validRoles: InspectionRole[] = ['creator', 'self-perform'];
|
|
775
|
+
|
|
776
|
+
return (
|
|
777
|
+
validRoles.includes(inspection.role) || userIsInvitedTeammate(inspection)
|
|
778
|
+
);
|
|
779
|
+
};
|