@rentcheck/biz 1.0.359 → 1.0.360
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/index.d.ts +8 -0
- package/dist/constants/notification-preferences.d.ts +2 -0
- package/dist/constants/plans.d.ts +2 -0
- package/dist/constants/skills.d.ts +4 -0
- package/dist/constants/sync-info.d.ts +1 -0
- package/dist/constants/user-settings.d.ts +2 -0
- package/dist/errors/admin.d.ts +13 -0
- package/dist/errors/appfolio.d.ts +4 -0
- package/dist/errors/automations.d.ts +13 -0
- package/dist/errors/http.d.ts +35 -0
- package/dist/errors/imports.d.ts +13 -0
- package/dist/errors/index.d.ts +28 -0
- package/dist/errors/inspection-invites.d.ts +4 -0
- package/dist/errors/inspection-templates.d.ts +10 -0
- package/dist/errors/inspections.d.ts +80 -0
- package/dist/errors/integrations.d.ts +10 -0
- package/dist/errors/permission-groups.d.ts +4 -0
- package/dist/errors/properties.d.ts +7 -0
- package/dist/errors/propexo.d.ts +20 -0
- package/dist/errors/subscriptions.d.ts +4 -0
- package/dist/errors/syncs.d.ts +19 -0
- package/dist/errors/take-over-requests.d.ts +7 -0
- package/dist/errors/team-invites.d.ts +4 -0
- package/dist/errors/user.d.ts +4 -0
- package/dist/errors/validations.d.ts +19 -0
- package/dist/errors/vitally.d.ts +10 -0
- package/dist/errors/work-orders.d.ts +7 -0
- package/dist/errors/zapier.d.ts +7 -0
- package/dist/index.d.ts +5 -0
- package/dist/permissions/account-settings/index.d.ts +2 -0
- package/dist/permissions/account-settings/inspection-reports.d.ts +2 -0
- package/dist/permissions/account-settings/maintenance-settings.d.ts +2 -0
- package/dist/permissions/index.d.ts +3 -0
- package/dist/permissions/integrations/appfolio.d.ts +2 -0
- package/dist/permissions/integrations/index.d.ts +6 -0
- package/dist/permissions/integrations/latchel.d.ts +2 -0
- package/dist/permissions/integrations/rent-manager.d.ts +2 -0
- package/dist/permissions/integrations/rentcheck-api.d.ts +2 -0
- package/dist/permissions/integrations/rentvine.d.ts +2 -0
- package/dist/permissions/integrations/zapier.d.ts +2 -0
- package/dist/rules/account-screen/index.d.ts +2 -0
- package/dist/rules/application-settings/index.d.ts +8 -0
- package/dist/rules/automations/index.d.ts +9 -0
- package/dist/rules/billing/index.d.ts +8 -0
- package/dist/rules/common/index.d.ts +5 -0
- package/dist/rules/index.d.ts +18 -0
- package/dist/rules/inspection-templates/index.d.ts +2 -0
- package/dist/rules/notification-preferences/index.d.ts +7 -0
- package/dist/rules/permission-groups/index.d.ts +5 -0
- package/dist/rules/properties/index.d.ts +58 -0
- package/dist/rules/residents/index.d.ts +11 -0
- package/dist/rules/sections/index.d.ts +2 -0
- package/dist/rules/subscriptions/index.d.ts +2 -0
- package/dist/rules/teammates/index.d.ts +7 -0
- package/dist/rules/users/index.d.ts +31 -0
- package/dist/rules/work-orders/index.d.ts +16 -0
- package/dist/utils/address/index.d.ts +13 -0
- package/dist/utils/environments/index.d.ts +6 -0
- package/dist/utils/file-requests/index.d.ts +7 -0
- package/dist/utils/filters/index.d.ts +8 -0
- package/dist/utils/flags/index.d.ts +2 -0
- package/dist/utils/helpers/index.d.ts +15 -0
- package/dist/utils/imports/index.d.ts +7 -0
- package/dist/utils/index.d.ts +21 -0
- package/dist/utils/inspection-features/sorting.d.ts +10 -0
- package/dist/utils/inspection-templates/build-template-features.d.ts +19 -0
- package/dist/utils/inspection-templates/index.d.ts +3 -0
- package/dist/utils/permission-groups/index.d.ts +2 -0
- package/dist/utils/properties/index.d.ts +5 -0
- package/dist/utils/query-params/index.d.ts +2 -0
- package/dist/utils/tenants/index.d.ts +2 -0
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * as Addons from './addons';
|
|
2
|
+
export * as Emails from './emails';
|
|
3
|
+
export * as NotificationPreferences from './notification-preferences';
|
|
4
|
+
export * as Plans from './plans';
|
|
5
|
+
export * as Rooms from './rooms';
|
|
6
|
+
export * as Skills from './skills';
|
|
7
|
+
export * as UserSettings from './user-settings';
|
|
8
|
+
export * as SyncInfo from './sync-info';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ApiInspectionSkill, Skill } from '@rentcheck/types';
|
|
2
|
+
export declare const getDefaultInspectionSkills: () => Skill[];
|
|
3
|
+
export declare const getAllLatchelSkills: () => Skill[];
|
|
4
|
+
export declare const getInspectionSkills: (vendor?: ApiInspectionSkill["vendor"]) => ApiInspectionSkill[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const propertySyncExpirationDays = 7;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BadRequest } from './http';
|
|
2
|
+
export declare class DocumentWithNoTeam extends BadRequest {
|
|
3
|
+
constructor(collection: 'inspection' | 'property');
|
|
4
|
+
}
|
|
5
|
+
export declare class InspectionWithoutRenter extends BadRequest {
|
|
6
|
+
constructor();
|
|
7
|
+
}
|
|
8
|
+
export declare class InspectionRestore extends BadRequest {
|
|
9
|
+
constructor(reason: string);
|
|
10
|
+
}
|
|
11
|
+
export declare class MissingBaseEmailCustomizationsIds extends BadRequest {
|
|
12
|
+
constructor();
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BadRequest, NotFound } from './http';
|
|
2
|
+
export declare class NoTeammateForTeam extends BadRequest {
|
|
3
|
+
constructor();
|
|
4
|
+
}
|
|
5
|
+
export declare class InspectionTemplateNotPublished extends BadRequest {
|
|
6
|
+
constructor();
|
|
7
|
+
}
|
|
8
|
+
export declare class InspectionTemplateDeleted extends NotFound {
|
|
9
|
+
constructor();
|
|
10
|
+
}
|
|
11
|
+
export declare class InspectionTemplateNoFastTrack extends BadRequest {
|
|
12
|
+
constructor();
|
|
13
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { RentCheckException } from '.';
|
|
2
|
+
export declare class BadRequest extends RentCheckException {
|
|
3
|
+
constructor(message: string);
|
|
4
|
+
}
|
|
5
|
+
export declare class Unauthorized extends RentCheckException {
|
|
6
|
+
constructor(message?: string);
|
|
7
|
+
}
|
|
8
|
+
export declare class Forbidden extends RentCheckException {
|
|
9
|
+
constructor(message?: string);
|
|
10
|
+
}
|
|
11
|
+
export declare class NotFound extends RentCheckException {
|
|
12
|
+
constructor(documentName: string, id?: string);
|
|
13
|
+
}
|
|
14
|
+
export declare class MethodNotAllowed extends RentCheckException {
|
|
15
|
+
constructor();
|
|
16
|
+
}
|
|
17
|
+
export declare class Conflict extends RentCheckException {
|
|
18
|
+
constructor(message?: string, resource?: string);
|
|
19
|
+
}
|
|
20
|
+
export declare class TooManyRequests extends RentCheckException {
|
|
21
|
+
retryAfter?: number;
|
|
22
|
+
constructor(message?: string, retryAfter?: number);
|
|
23
|
+
}
|
|
24
|
+
export declare class InternalServer extends RentCheckException {
|
|
25
|
+
constructor(message?: string);
|
|
26
|
+
}
|
|
27
|
+
export declare class BadGateway extends RentCheckException {
|
|
28
|
+
constructor(message?: string);
|
|
29
|
+
}
|
|
30
|
+
export declare class ServiceUnavailable extends RentCheckException {
|
|
31
|
+
constructor(message?: string);
|
|
32
|
+
}
|
|
33
|
+
export declare class PayloadTooLarge extends RentCheckException {
|
|
34
|
+
constructor(message?: string);
|
|
35
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BadRequest } from './http';
|
|
2
|
+
export declare class InvalidImportModel extends BadRequest {
|
|
3
|
+
constructor(model?: string);
|
|
4
|
+
}
|
|
5
|
+
export declare class OperationNotSupportedForModel extends BadRequest {
|
|
6
|
+
constructor(operation: string, model: string);
|
|
7
|
+
}
|
|
8
|
+
export declare class InvalidMoveDates extends BadRequest {
|
|
9
|
+
constructor(startDate: string, endDate: string, fullName: string);
|
|
10
|
+
}
|
|
11
|
+
export declare class InvalidLeaseDates extends BadRequest {
|
|
12
|
+
constructor(startDate: string, endDate: string, fullName: string);
|
|
13
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare class RentCheckException extends Error {
|
|
2
|
+
/**
|
|
3
|
+
* Status code to return to the client. For example 404 for not found.
|
|
4
|
+
*/
|
|
5
|
+
statusCode: number;
|
|
6
|
+
constructor(message: string, statusCode: number);
|
|
7
|
+
}
|
|
8
|
+
export * from './http';
|
|
9
|
+
export * as Admin from './admin';
|
|
10
|
+
export * as AppFolio from './appfolio';
|
|
11
|
+
export * as Automations from './automations';
|
|
12
|
+
export * as Imports from './imports';
|
|
13
|
+
export * as InspectionInvites from './inspection-invites';
|
|
14
|
+
export * as InspectionTemplates from './inspection-templates';
|
|
15
|
+
export * as Inspections from './inspections';
|
|
16
|
+
export * as Integrations from './integrations';
|
|
17
|
+
export * as PermissionGroups from './permission-groups';
|
|
18
|
+
export * as Properties from './properties';
|
|
19
|
+
export * as Propexo from './propexo';
|
|
20
|
+
export * as Subscriptions from './subscriptions';
|
|
21
|
+
export * as Syncs from './syncs';
|
|
22
|
+
export * as TakeOverRequests from './take-over-requests';
|
|
23
|
+
export * as TeamInvites from './team-invites';
|
|
24
|
+
export * as User from './user';
|
|
25
|
+
export * as Validations from './validations';
|
|
26
|
+
export * as Vitally from './vitally';
|
|
27
|
+
export * as WorkOrders from './work-orders';
|
|
28
|
+
export * as Zapier from './zapier';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BadRequest, Forbidden } from './http';
|
|
2
|
+
export declare class InspectionTemplateNotPublished extends Forbidden {
|
|
3
|
+
constructor();
|
|
4
|
+
}
|
|
5
|
+
export declare class InspectionTemplateNotAllowed extends Forbidden {
|
|
6
|
+
constructor();
|
|
7
|
+
}
|
|
8
|
+
export declare class InspectionTemplateHasNoFeatures extends BadRequest {
|
|
9
|
+
constructor();
|
|
10
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { AssignMethod, Occupancy } from '@rentcheck/types';
|
|
2
|
+
import { BadRequest, Conflict, PayloadTooLarge } from './http';
|
|
3
|
+
export declare class NoResidents extends BadRequest {
|
|
4
|
+
constructor(type: Occupancy['status']);
|
|
5
|
+
}
|
|
6
|
+
export declare class XIdAlreadyExists extends Conflict {
|
|
7
|
+
constructor(value: string | number);
|
|
8
|
+
}
|
|
9
|
+
export declare class NoneInProgressInspections extends BadRequest {
|
|
10
|
+
constructor();
|
|
11
|
+
}
|
|
12
|
+
export declare class MissingFeatures extends BadRequest {
|
|
13
|
+
constructor(type: string);
|
|
14
|
+
}
|
|
15
|
+
export declare class MissingRooms extends BadRequest {
|
|
16
|
+
constructor(inspectionTemplateName: string);
|
|
17
|
+
}
|
|
18
|
+
export declare class InvalidTemplateForSubscription extends BadRequest {
|
|
19
|
+
constructor(field: string);
|
|
20
|
+
}
|
|
21
|
+
export declare class InvalidCompletedInspectionField extends BadRequest {
|
|
22
|
+
constructor(field: string);
|
|
23
|
+
}
|
|
24
|
+
export declare class InvalidInspectionStatusForReviewRequest extends BadRequest {
|
|
25
|
+
constructor();
|
|
26
|
+
}
|
|
27
|
+
export declare class InvalidAssignmentTypeForCancelReview extends BadRequest {
|
|
28
|
+
constructor();
|
|
29
|
+
}
|
|
30
|
+
export declare class InvalidAssignmentTypeForReviewRequest extends BadRequest {
|
|
31
|
+
constructor();
|
|
32
|
+
}
|
|
33
|
+
export declare class InvalidInspectionStatusForCancelReview extends BadRequest {
|
|
34
|
+
constructor();
|
|
35
|
+
}
|
|
36
|
+
export declare class InvalidInspectionStatusForCancelRevision extends BadRequest {
|
|
37
|
+
constructor();
|
|
38
|
+
}
|
|
39
|
+
export declare class InvalidAreaForProperty extends BadRequest {
|
|
40
|
+
constructor(area: string);
|
|
41
|
+
}
|
|
42
|
+
export declare class InvalidInspectionTypeFromPropertyType extends BadRequest {
|
|
43
|
+
constructor(propertyType: string, inspectionType: string);
|
|
44
|
+
}
|
|
45
|
+
export declare class NoRecipients extends BadRequest {
|
|
46
|
+
constructor(recipientsType: AssignMethod);
|
|
47
|
+
}
|
|
48
|
+
export declare class InvalidSelectedFeaturesOnInspectionTemplate extends BadRequest {
|
|
49
|
+
constructor();
|
|
50
|
+
}
|
|
51
|
+
export declare class InvalidInviteDateAfterDueDate extends BadRequest {
|
|
52
|
+
constructor();
|
|
53
|
+
}
|
|
54
|
+
export declare class InviteDateWithSelfPerform extends BadRequest {
|
|
55
|
+
constructor();
|
|
56
|
+
}
|
|
57
|
+
export declare class InvalidInspectionStatusForInvite extends BadRequest {
|
|
58
|
+
constructor();
|
|
59
|
+
}
|
|
60
|
+
export declare class InvalidFastTrackInspectionType extends BadRequest {
|
|
61
|
+
constructor();
|
|
62
|
+
}
|
|
63
|
+
export declare class InvalidAreaNameNoOrdinal extends BadRequest {
|
|
64
|
+
constructor(simplifiedAreaName: string);
|
|
65
|
+
}
|
|
66
|
+
export declare class UnableToCompleteInitialReview extends BadRequest {
|
|
67
|
+
constructor();
|
|
68
|
+
}
|
|
69
|
+
export declare class UnableToUndoInitialReview extends BadRequest {
|
|
70
|
+
constructor();
|
|
71
|
+
}
|
|
72
|
+
export declare class InvalidRoleForAction extends BadRequest {
|
|
73
|
+
constructor(action: string);
|
|
74
|
+
}
|
|
75
|
+
export declare class InvalidCursorWithLegacyPagination extends BadRequest {
|
|
76
|
+
constructor();
|
|
77
|
+
}
|
|
78
|
+
export declare class FeatureExceedsMaxPayloadSize extends PayloadTooLarge {
|
|
79
|
+
constructor();
|
|
80
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BadRequest } from './http';
|
|
2
|
+
export declare class IntegrationAlreadyExists extends BadRequest {
|
|
3
|
+
constructor();
|
|
4
|
+
}
|
|
5
|
+
export declare class IntegrationAlreadyExistsForSubscription extends BadRequest {
|
|
6
|
+
constructor();
|
|
7
|
+
}
|
|
8
|
+
export declare class InvalidCredentials extends BadRequest {
|
|
9
|
+
constructor();
|
|
10
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { RentmanagerIntegration } from '@rentcheck/types';
|
|
2
|
+
import { RentCheckException } from '.';
|
|
3
|
+
export declare class PropexoSyncError extends RentCheckException {
|
|
4
|
+
name: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class IntegrationNotFound extends PropexoSyncError {
|
|
7
|
+
constructor(id: RentmanagerIntegration['id']);
|
|
8
|
+
}
|
|
9
|
+
export declare class LocationNotEnabled extends PropexoSyncError {
|
|
10
|
+
constructor(id: RentmanagerIntegration['enabled_locations'][number]['id']);
|
|
11
|
+
}
|
|
12
|
+
export declare class LocationNotMapped extends PropexoSyncError {
|
|
13
|
+
constructor(id: RentmanagerIntegration['enabled_locations'][number]['id']);
|
|
14
|
+
}
|
|
15
|
+
export declare class IntegrationWithNoSyncDetails extends PropexoSyncError {
|
|
16
|
+
constructor();
|
|
17
|
+
}
|
|
18
|
+
export declare class IntegrationWithNoTeamMappings extends PropexoSyncError {
|
|
19
|
+
constructor();
|
|
20
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BadRequest } from './http';
|
|
2
|
+
export declare class InspectionAlreadySynced extends BadRequest {
|
|
3
|
+
constructor();
|
|
4
|
+
}
|
|
5
|
+
export declare class InspectionPDFReportNotFound extends BadRequest {
|
|
6
|
+
constructor();
|
|
7
|
+
}
|
|
8
|
+
export declare class PropertyNotFromIntegration extends BadRequest {
|
|
9
|
+
constructor();
|
|
10
|
+
}
|
|
11
|
+
export declare class NotSyncedWithRentManager extends BadRequest {
|
|
12
|
+
constructor(object: string);
|
|
13
|
+
}
|
|
14
|
+
export declare class PropertyNotSyncedWithIntegration extends BadRequest {
|
|
15
|
+
constructor();
|
|
16
|
+
}
|
|
17
|
+
export declare class InspectionStatusNotAllowed extends BadRequest {
|
|
18
|
+
constructor(status: string);
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BadRequest, Unauthorized } from './http';
|
|
2
|
+
export declare class BlankField extends BadRequest {
|
|
3
|
+
constructor(field: string);
|
|
4
|
+
}
|
|
5
|
+
export declare class MissingField extends BadRequest {
|
|
6
|
+
constructor(field: string);
|
|
7
|
+
}
|
|
8
|
+
export declare class InvalidValue extends BadRequest {
|
|
9
|
+
constructor(field: string, value?: string | number);
|
|
10
|
+
}
|
|
11
|
+
export declare class MissingPermissions extends Unauthorized {
|
|
12
|
+
constructor(action: 'access' | 'create' | 'update' | 'delete' | 'get', resource: string);
|
|
13
|
+
}
|
|
14
|
+
export declare class UnsupportedValue extends BadRequest {
|
|
15
|
+
constructor(field: string, value?: string | number);
|
|
16
|
+
}
|
|
17
|
+
export declare class NotArray extends BadRequest {
|
|
18
|
+
constructor(field?: string);
|
|
19
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NotFound } from './http';
|
|
2
|
+
export declare class NoChargebeeId extends NotFound {
|
|
3
|
+
constructor(id: string);
|
|
4
|
+
}
|
|
5
|
+
export declare class NoChargebeeCustomerId extends NotFound {
|
|
6
|
+
constructor(id: string);
|
|
7
|
+
}
|
|
8
|
+
export declare class NoOrganizationsForSubscription extends NotFound {
|
|
9
|
+
constructor(id: string);
|
|
10
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Profile } from '@rentcheck/types';
|
|
2
|
+
/**
|
|
3
|
+
* Simply verifies if the user is an internal admin or not.
|
|
4
|
+
*
|
|
5
|
+
* @param caller user trying to access.
|
|
6
|
+
* @returns boolean wether the operation can be fulfilled or not.
|
|
7
|
+
*/
|
|
8
|
+
export declare const canAccess: (caller?: Profile) => boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ApiPermissionGroupDigest, ApiSubscription, ApiUser, PermissionGroup, Profile, Subscription } from '@rentcheck/types';
|
|
2
|
+
type CanEditAutomationParams = {
|
|
3
|
+
user: ApiUser | Profile;
|
|
4
|
+
subscription?: Subscription | ApiSubscription | null;
|
|
5
|
+
permissionGroups?: Pick<PermissionGroup | ApiPermissionGroupDigest, 'id' | 'allow_automation_editing'>[];
|
|
6
|
+
};
|
|
7
|
+
export declare const canEditAutomation: ({ user, subscription, permissionGroups, }: CanEditAutomationParams) => boolean;
|
|
8
|
+
export declare const canCreateAutomation: ({ user, subscription, permissionGroups, }: CanEditAutomationParams) => boolean;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ApiSubscription, ApiUser, PermissionGroup, Profile, Subscription } from '@rentcheck/types';
|
|
2
|
+
type CanEditPlanParams = {
|
|
3
|
+
user: ApiUser | Profile;
|
|
4
|
+
subscription?: Subscription | ApiSubscription | null;
|
|
5
|
+
permissionGroups?: Pick<PermissionGroup, 'id' | 'name' | 'allow_billing_plan_editing'>[];
|
|
6
|
+
};
|
|
7
|
+
export declare const canEditPlan: ({ user, subscription, permissionGroups, }: CanEditPlanParams) => boolean;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * as AccountScreen from './account-screen';
|
|
2
|
+
export * as AI from './ai';
|
|
3
|
+
export * as AccountSettings from './account-settings';
|
|
4
|
+
export * as Billing from './billing';
|
|
5
|
+
export * as Features from './features';
|
|
6
|
+
export * as Inspections from './inspections';
|
|
7
|
+
export * as PermissionGroups from './permission-groups';
|
|
8
|
+
export * as Properties from './properties';
|
|
9
|
+
export * as Residents from './residents';
|
|
10
|
+
export * as Sections from './sections';
|
|
11
|
+
export * as Subscriptions from './subscriptions';
|
|
12
|
+
export * as Teammates from './teammates';
|
|
13
|
+
export * as ApplicationSettings from './application-settings';
|
|
14
|
+
export * as Automations from './automations';
|
|
15
|
+
export * as InspectionTemplates from './inspection-templates';
|
|
16
|
+
export * as Users from './users';
|
|
17
|
+
export * as WorkOrders from './work-orders';
|
|
18
|
+
export * as NotificationPreferences from './notification-preferences';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { ApiInspectionTemplateDigest, ApiSubscription, InspectionTemplate, Subscription } from '@rentcheck/types';
|
|
2
|
+
export declare const hasProTemplateAccess: (template: ApiInspectionTemplateDigest | InspectionTemplate, subscription?: ApiSubscription | Subscription | null) => boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ApiPermissionGroupDigest, ApiUser, PermissionGroup, Profile } from '@rentcheck/types';
|
|
2
|
+
type CanEditNotificationPreferencesParams = {
|
|
3
|
+
user: ApiUser | Profile;
|
|
4
|
+
permissionGroups?: Pick<PermissionGroup | ApiPermissionGroupDigest, 'id' | 'allow_notifications_preferences_editing'>[];
|
|
5
|
+
};
|
|
6
|
+
export declare const canEditNotificationPreferences: ({ user, permissionGroups, }: CanEditNotificationPreferencesParams) => boolean;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ApiUser, Profile } from '@rentcheck/types';
|
|
2
|
+
import { RuleEvaluation } from '../common';
|
|
3
|
+
export declare const canCreate: (user: Profile) => boolean;
|
|
4
|
+
export declare const canDelete: (totalPGs: number, numberToDelete: number, user?: Profile | ApiUser) => RuleEvaluation;
|
|
5
|
+
export declare const canEdit: (user?: Profile | ApiUser) => RuleEvaluation;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ApiAppFolioIntegration, ApiRentManagerIntegration, AppFolioIntegration, Profile, Property, RentmanagerIntegration, RentvineIntegration, ApiRentvineIntegration, SyncData, BaseIntegration } from '@rentcheck/types';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if user is an internal admin or its id/organization ids are within the
|
|
4
|
+
* `property.authorized_user_ids`.
|
|
5
|
+
*
|
|
6
|
+
* @param property property to be evaluated.
|
|
7
|
+
* @param user user that's calling the function.
|
|
8
|
+
* @returns boolean wether the operation can be fulfilled or not.
|
|
9
|
+
*/
|
|
10
|
+
export declare const canAccess: (property: Pick<Property, "authorized_user_ids">, user: Profile) => boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Evaluates wether the property can be restored or not. User must be an internal admin.
|
|
13
|
+
*
|
|
14
|
+
* If property has no `organization_id` or its `organization_id` is already contained
|
|
15
|
+
* within the `property.authorized_user_ids`, it will also fail.
|
|
16
|
+
*
|
|
17
|
+
* @param property property to be evaluated.
|
|
18
|
+
* @param user user that's calling the function. Must be an internal admin.
|
|
19
|
+
* @returns boolean wether the operation can be fulfilled or not.
|
|
20
|
+
*/
|
|
21
|
+
export declare const canRestore: (property: Property, user: Profile) => boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Checks if the user can delete a property. Validations are the same as
|
|
24
|
+
* `Rules.Properties.canAccess`.
|
|
25
|
+
*
|
|
26
|
+
* @param user user that's calling the function. Must be an internal admin.
|
|
27
|
+
* @returns boolean wether the operation can be fulfilled or not.
|
|
28
|
+
*/
|
|
29
|
+
export declare const canDelete: (property: Pick<Property, "authorized_user_ids" | "property_type"> & {
|
|
30
|
+
sync_data: Pick<SyncData, "vendor" | "last_sync">;
|
|
31
|
+
}, user: Profile, integrations: Record<SyncData["vendor"], BaseIntegration>) => boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Simply checks if the user is an internal admin.
|
|
34
|
+
*
|
|
35
|
+
* @param user user that's calling the function. Must be an internal admin.
|
|
36
|
+
* @returns boolean wether the operation can be fulfilled or not.
|
|
37
|
+
*/
|
|
38
|
+
export declare const canTransferAsAdmin: (user: Profile) => boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Simply checks if the user is an internal admin.
|
|
41
|
+
*
|
|
42
|
+
* @param user user that's calling the function. Must be an internal admin.
|
|
43
|
+
* @returns boolean wether the operation can be fulfilled or not.
|
|
44
|
+
*/
|
|
45
|
+
export declare const canMergeAsAdmin: (user: Profile) => boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Checks if the user is enabled to import properties.
|
|
48
|
+
* The user must not have an AppFolio integration or RentManager integrations.
|
|
49
|
+
*
|
|
50
|
+
* @param appfolioIntegration AppFolio Integration for the user's account
|
|
51
|
+
* @param rentmanagerIntegrations RentManager Integrations for the user's account
|
|
52
|
+
* @param rentvineIntegrations Rentvine Integrations for the user's account
|
|
53
|
+
* @param loading Optional loading state, if provided the function will return false until it's no longer loading
|
|
54
|
+
* @returns `true` if the user can import units, `false` otherwise
|
|
55
|
+
*/
|
|
56
|
+
export declare const canImport: (appfolioIntegration?: AppFolioIntegration | ApiAppFolioIntegration | undefined, rentmanagerIntegrations?: RentmanagerIntegration[] | ApiRentManagerIntegration[] | undefined, rentvineIntegration?: RentvineIntegration | ApiRentvineIntegration | null, loading?: boolean) => boolean;
|
|
57
|
+
export declare const canAddToParentProperty: (property: Pick<Property, "property_type">) => boolean;
|
|
58
|
+
export declare const canReassignTeam: (property: Pick<Property, "authorized_user_ids">, user: Profile) => boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ApiAppFolioIntegration, ApiRentManagerIntegration, AppFolioIntegration, RentmanagerIntegration } from '@rentcheck/types';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if the user is enabled to import residents.
|
|
4
|
+
* The user must not have an AppFolio integration or RentManager integrations.
|
|
5
|
+
*
|
|
6
|
+
* @param appfolioIntegration AppFolio Integration for the user's account
|
|
7
|
+
* @param rentmanagerIntegrations RentManager Integrations for the user's account
|
|
8
|
+
* @param loading Optional loading state, if provided the function will return false until it's no longer loading
|
|
9
|
+
* @returns `true` if the user can import residents, `false` otherwise
|
|
10
|
+
*/
|
|
11
|
+
export declare const canImport: (appfolioIntegration?: AppFolioIntegration | ApiAppFolioIntegration | undefined, rentmanagerIntegrations?: RentmanagerIntegration[] | ApiRentManagerIntegration[] | undefined, loading?: boolean) => boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ApiSubscription, ApiUser, ApiUserDigest } from '@rentcheck/types';
|
|
2
|
+
import { RuleEvaluation } from '../common';
|
|
3
|
+
export declare const canAccess: (user?: ApiUser | null, subscription?: ApiSubscription | null) => boolean;
|
|
4
|
+
export declare const canEdit: (user?: ApiUser | null, subscription?: ApiSubscription | null) => RuleEvaluation;
|
|
5
|
+
export declare const canDeactivate: (user?: ApiUser | null, subscription?: ApiSubscription | null) => RuleEvaluation;
|
|
6
|
+
export declare const canBeDeactivated: (target: ApiUserDigest, user?: ApiUser) => RuleEvaluation;
|
|
7
|
+
export declare const canShowDeactivate: (target: ApiUserDigest, user?: ApiUser | null) => RuleEvaluation;
|