@rentcheck/biz 1.0.23 → 1.0.25

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.
Files changed (69) hide show
  1. package/dist/constants/addons.js +46 -0
  2. package/dist/constants/index.js +4 -2
  3. package/dist/constants/plans.js +4 -0
  4. package/dist/index.js +3 -1
  5. package/dist/permissions/account-settings/index.js +29 -0
  6. package/dist/permissions/account-settings/inspection-reports.js +49 -0
  7. package/dist/permissions/account-settings/maintenance-settings.js +40 -0
  8. package/dist/permissions/account-settings/property-configuration.js +40 -0
  9. package/dist/permissions/index.js +30 -0
  10. package/dist/permissions/inspections.d.ts +5 -0
  11. package/dist/permissions/inspections.js +63 -0
  12. package/dist/permissions/integrations/appfolio.js +54 -0
  13. package/dist/permissions/integrations/index.js +31 -0
  14. package/dist/permissions/integrations/latchel.js +54 -0
  15. package/dist/permissions/integrations/rent-manager.js +54 -0
  16. package/dist/permissions/integrations/rentcheck-api.js +44 -0
  17. package/dist/permissions/integrations/zapier.js +44 -0
  18. package/dist/permissions/residents/index.js +13 -0
  19. package/dist/rules/features/index.d.ts +2 -0
  20. package/dist/rules/features/index.js +27 -0
  21. package/dist/rules/index.js +27 -0
  22. package/dist/utils/dates/index.js +22 -0
  23. package/dist/utils/index.js +5 -1
  24. package/dist/utils/inspection-features/sorting.js +26 -3
  25. package/dist/utils/inspection-templates/common.js +25 -2
  26. package/dist/utils/properties/index.js +17 -0
  27. package/dist/utils/properties/validations.js +11 -0
  28. package/dist/utils/subscriptions/index.d.ts +4 -0
  29. package/dist/utils/subscriptions/index.js +23 -0
  30. package/dist/utils/tenants/index.d.ts +2 -0
  31. package/dist/utils/tenants/index.js +17 -0
  32. package/package.json +1 -1
  33. package/src/constants/addons.ts +53 -0
  34. package/src/constants/index.ts +3 -1
  35. package/src/constants/plans.ts +2 -0
  36. package/src/index.ts +2 -0
  37. package/src/permissions/account-settings/index.ts +3 -0
  38. package/src/permissions/account-settings/inspection-reports.ts +31 -0
  39. package/src/permissions/account-settings/maintenance-settings.ts +17 -0
  40. package/src/permissions/account-settings/property-configuration.ts +17 -0
  41. package/src/permissions/index.ts +4 -0
  42. package/src/permissions/inspections.ts +49 -0
  43. package/src/permissions/integrations/appfolio.ts +37 -0
  44. package/src/permissions/integrations/index.ts +5 -0
  45. package/src/permissions/integrations/latchel.ts +37 -0
  46. package/src/permissions/integrations/rent-manager.ts +37 -0
  47. package/src/permissions/integrations/rentcheck-api.ts +21 -0
  48. package/src/permissions/integrations/zapier.ts +21 -0
  49. package/src/permissions/residents/index.ts +13 -0
  50. package/src/rules/features/index.ts +41 -0
  51. package/src/rules/index.ts +1 -0
  52. package/src/utils/dates/index.ts +25 -0
  53. package/src/utils/index.ts +4 -0
  54. package/src/utils/inspection-features/sorting.ts +3 -3
  55. package/src/utils/inspection-templates/common.ts +2 -2
  56. package/src/utils/properties/index.ts +1 -0
  57. package/src/utils/properties/validations.ts +11 -0
  58. package/src/utils/subscriptions/index.ts +27 -0
  59. package/src/utils/tenants/index.ts +34 -0
  60. package/tsconfig.tsbuildinfo +1 -1
  61. package/dist/constants/index.d.ts +0 -2
  62. package/dist/constants/rooms.d.ts +0 -1
  63. package/dist/constants/skills.d.ts +0 -2
  64. package/dist/index.d.ts +0 -2
  65. package/dist/utils/index.d.ts +0 -2
  66. package/dist/utils/inspection-features/index.d.ts +0 -1
  67. package/dist/utils/inspection-templates/build-template-features.d.ts +0 -8
  68. package/dist/utils/inspection-templates/common.d.ts +0 -36
  69. package/dist/utils/inspection-templates/index.d.ts +0 -3
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.inspectionTemplateAddonIds = exports.inspectionTemplateFreeTrialAddonId = exports.inspectionTemplatePerUnitAddonId = exports.rentManagerWorkOrderAddonIds = exports.rentManagerAddonIds = exports.jenarkWorkOrderAddonIds = exports.latchelWorkOrderAddonIds = exports.appFolioWorkOrderAddonIds = exports.appFolioAddonIds = void 0;
4
+ /**
5
+ * Base AppFolio addons here plus we add support for 2 more
6
+ * in order to support Atlas' billing setup
7
+ */
8
+ exports.appFolioAddonIds = [
9
+ 'appfolio-integration---two-way-data-sync',
10
+ 'appfolio-data-sync-plus-workorders',
11
+ 'atlas-appfolio-integration---two-way-data-sync',
12
+ 'atlas-appfolio-data-sync-plus-workorders',
13
+ ];
14
+ exports.appFolioWorkOrderAddonIds = [
15
+ 'appfolio-data-sync-plus-workorders',
16
+ 'atlas-appfolio-data-sync-plus-workorders',
17
+ ];
18
+ /**
19
+ * Latchel Addon Ids
20
+ */
21
+ exports.latchelWorkOrderAddonIds = ['latchel-integration'];
22
+ /**
23
+ * Jenark (365) Addon Ids
24
+ */
25
+ exports.jenarkWorkOrderAddonIds = ['jenark-integration'];
26
+ /**
27
+ * Rent Manager Addon Ids
28
+ */
29
+ exports.rentManagerAddonIds = [
30
+ 'rm-integration---two-way-data-sync',
31
+ 'rentmanager-integration---two-way-data-sync',
32
+ ];
33
+ exports.rentManagerWorkOrderAddonIds = [
34
+ 'rm-integration---work-orders',
35
+ 'rentmanager-integration---work-orders',
36
+ ];
37
+ /**
38
+ * Inspection Template Addon Ids
39
+ */
40
+ exports.inspectionTemplatePerUnitAddonId = 'inspection-template-customization-2';
41
+ exports.inspectionTemplateFreeTrialAddonId = 'inspection-template-customization-free-trial';
42
+ exports.inspectionTemplateAddonIds = [
43
+ 'inspection-template-customization',
44
+ exports.inspectionTemplateFreeTrialAddonId,
45
+ exports.inspectionTemplatePerUnitAddonId,
46
+ ];
@@ -23,6 +23,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.Skills = exports.RoomConstants = void 0;
27
- exports.RoomConstants = __importStar(require("./rooms"));
26
+ exports.Skills = exports.Rooms = exports.Plans = exports.Addons = void 0;
27
+ exports.Addons = __importStar(require("./addons"));
28
+ exports.Plans = __importStar(require("./plans"));
29
+ exports.Rooms = __importStar(require("./rooms"));
28
30
  exports.Skills = __importStar(require("./skills"));
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.essentialsPlanId = void 0;
4
+ exports.essentialsPlanId = 'essential-plan---$1.00-(includes-30-day-free-trial)';
package/dist/index.js CHANGED
@@ -23,6 +23,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.Utils = exports.Constants = void 0;
26
+ exports.Rules = exports.Utils = exports.Permissions = exports.Constants = void 0;
27
27
  exports.Constants = __importStar(require("./constants"));
28
+ exports.Permissions = __importStar(require("./permissions"));
28
29
  exports.Utils = __importStar(require("./utils"));
30
+ exports.Rules = __importStar(require("./rules"));
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.PropertyConfiguration = exports.MaintenanceSettings = exports.InspectionReports = void 0;
27
+ exports.InspectionReports = __importStar(require("./inspection-reports"));
28
+ exports.MaintenanceSettings = __importStar(require("./maintenance-settings"));
29
+ exports.PropertyConfiguration = __importStar(require("./property-configuration"));
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.canEdit = void 0;
27
+ const Utils = __importStar(require("../../utils"));
28
+ const canEdit = (profile, subscription) => {
29
+ if (!subscription) {
30
+ return false;
31
+ }
32
+ if (!profile) {
33
+ return false;
34
+ }
35
+ /**
36
+ * User must be an admin of at least one team they belong to
37
+ */
38
+ if (!profile.organizations.some((o) => o.role === 'admin')) {
39
+ return false;
40
+ }
41
+ /**
42
+ * User must be on a plan that is not the essentials plan
43
+ */
44
+ if (Utils.Subscriptions.isOnEssentialsPlan(subscription)) {
45
+ return false;
46
+ }
47
+ return true;
48
+ };
49
+ exports.canEdit = canEdit;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.canEdit = void 0;
27
+ const Utils = __importStar(require("../../utils"));
28
+ const canEdit = (subscription) => {
29
+ if (!subscription) {
30
+ return false;
31
+ }
32
+ /**
33
+ * User must be on a plan that is not the essentials plan
34
+ */
35
+ if (Utils.Subscriptions.isOnEssentialsPlan(subscription)) {
36
+ return false;
37
+ }
38
+ return true;
39
+ };
40
+ exports.canEdit = canEdit;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.canEdit = void 0;
27
+ const Utils = __importStar(require("../../utils"));
28
+ const canEdit = (subscription) => {
29
+ if (!subscription) {
30
+ return false;
31
+ }
32
+ /**
33
+ * User must be on a plan that is not the essentials plan
34
+ */
35
+ if (Utils.Subscriptions.isOnEssentialsPlan(subscription)) {
36
+ return false;
37
+ }
38
+ return true;
39
+ };
40
+ exports.canEdit = canEdit;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.Residents = exports.Integrations = exports.Inspections = exports.AccountSettings = void 0;
27
+ exports.AccountSettings = __importStar(require("./account-settings"));
28
+ exports.Inspections = __importStar(require("./inspections"));
29
+ exports.Integrations = __importStar(require("./integrations"));
30
+ exports.Residents = __importStar(require("./residents"));
@@ -0,0 +1,5 @@
1
+ import { AccountSettings, ApiSubscription } from '@rentcheck/types';
2
+ export declare const canRecordVideo: (subscription?: ApiSubscription | null) => boolean;
3
+ export declare const canTake360Photos: (subscription?: ApiSubscription | null) => boolean;
4
+ export declare const canRenterReportMaintenance: (accountSettings?: AccountSettings | null, subscription?: ApiSubscription | null) => boolean;
5
+ export declare const areFlagDefaultPhotosEnabled: (accountSettings?: AccountSettings | null) => boolean;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.areFlagDefaultPhotosEnabled = exports.canRenterReportMaintenance = exports.canTake360Photos = exports.canRecordVideo = void 0;
27
+ const Utils = __importStar(require("../utils"));
28
+ const canRecordVideo = (subscription) => {
29
+ if (!subscription) {
30
+ return false;
31
+ }
32
+ if (Utils.Subscriptions.isOnEssentialsPlan(subscription)) {
33
+ return false;
34
+ }
35
+ return true;
36
+ };
37
+ exports.canRecordVideo = canRecordVideo;
38
+ const canTake360Photos = (subscription) => {
39
+ if (!subscription) {
40
+ return false;
41
+ }
42
+ if (Utils.Subscriptions.isOnEssentialsPlan(subscription)) {
43
+ return false;
44
+ }
45
+ return true;
46
+ };
47
+ exports.canTake360Photos = canTake360Photos;
48
+ const canRenterReportMaintenance = (accountSettings, subscription) => {
49
+ if (!subscription) {
50
+ return false;
51
+ }
52
+ if (Utils.Subscriptions.isOnEssentialsPlan(subscription)) {
53
+ return false;
54
+ }
55
+ return accountSettings === null || accountSettings === void 0 ? void 0 : accountSettings.is_resident_reported_maintenance_enabled;
56
+ };
57
+ exports.canRenterReportMaintenance = canRenterReportMaintenance;
58
+ const areFlagDefaultPhotosEnabled = (accountSettings) => {
59
+ if (!accountSettings)
60
+ return false;
61
+ return accountSettings.is_maintenance_flag_default_photos_enabled;
62
+ };
63
+ exports.areFlagDefaultPhotosEnabled = areFlagDefaultPhotosEnabled;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.canInstall = void 0;
27
+ const __1 = require("../..");
28
+ const Utils = __importStar(require("../../utils"));
29
+ const canInstall = (subscription) => {
30
+ if (!subscription) {
31
+ return false;
32
+ }
33
+ /**
34
+ * User must be on a plan that is not the essentials plan
35
+ */
36
+ if (Utils.Subscriptions.isOnEssentialsPlan(subscription)) {
37
+ return false;
38
+ }
39
+ /**
40
+ * If user is part of the Professional plan then they can install any addon
41
+ */
42
+ if (Utils.Subscriptions.isOnProPlan(subscription)) {
43
+ return true;
44
+ }
45
+ /**
46
+ * If user in on a legacy plan but has the AppFolio addon then they can install the
47
+ * integration
48
+ */
49
+ if (subscription.addons.some((addon) => __1.Constants.Addons.appFolioAddonIds.includes(addon.id))) {
50
+ return true;
51
+ }
52
+ return false;
53
+ };
54
+ exports.canInstall = canInstall;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.Zapier = exports.RentCheckApi = exports.RentManager = exports.Latchel = exports.AppFolio = void 0;
27
+ exports.AppFolio = __importStar(require("./appfolio"));
28
+ exports.Latchel = __importStar(require("./latchel"));
29
+ exports.RentManager = __importStar(require("./rent-manager"));
30
+ exports.RentCheckApi = __importStar(require("./rentcheck-api"));
31
+ exports.Zapier = __importStar(require("./zapier"));
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.canInstall = void 0;
27
+ const __1 = require("../..");
28
+ const Utils = __importStar(require("../../utils"));
29
+ const canInstall = (subscription) => {
30
+ if (!subscription) {
31
+ return false;
32
+ }
33
+ /**
34
+ * User must be on a plan that is not the essentials plan
35
+ */
36
+ if (Utils.Subscriptions.isOnEssentialsPlan(subscription)) {
37
+ return false;
38
+ }
39
+ /**
40
+ * If user is part of the Professional plan then they can install any addon
41
+ */
42
+ if (Utils.Subscriptions.isOnProPlan(subscription)) {
43
+ return true;
44
+ }
45
+ /**
46
+ * If user in on a legacy plan but has the Latchel addon they can install
47
+ * the integration
48
+ */
49
+ if (subscription.addons.some((addon) => __1.Constants.Addons.latchelWorkOrderAddonIds.includes(addon.id))) {
50
+ return true;
51
+ }
52
+ return false;
53
+ };
54
+ exports.canInstall = canInstall;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.canInstall = void 0;
27
+ const __1 = require("../..");
28
+ const Utils = __importStar(require("../../utils"));
29
+ const canInstall = (subscription) => {
30
+ if (!subscription) {
31
+ return false;
32
+ }
33
+ /**
34
+ * User must be on a plan that is not the essentials plan
35
+ */
36
+ if (Utils.Subscriptions.isOnEssentialsPlan(subscription)) {
37
+ return false;
38
+ }
39
+ /**
40
+ * If user is part of the Professional plan then they can install any addon
41
+ */
42
+ if (Utils.Subscriptions.isOnProPlan(subscription)) {
43
+ return true;
44
+ }
45
+ /**
46
+ * If user in on a legacy plan but has the Rent Manager addon they
47
+ * can install the integration
48
+ */
49
+ if (subscription.addons.some((addon) => __1.Constants.Addons.rentManagerAddonIds.includes(addon.id))) {
50
+ return true;
51
+ }
52
+ return false;
53
+ };
54
+ exports.canInstall = canInstall;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.canAccess = void 0;
27
+ const Utils = __importStar(require("../../utils"));
28
+ const canAccess = (subscription) => {
29
+ if (!subscription) {
30
+ return false;
31
+ }
32
+ /**
33
+ * User must be on a plan that is not the essentials plan
34
+ */
35
+ if (Utils.Subscriptions.isOnEssentialsPlan(subscription)) {
36
+ return false;
37
+ }
38
+ /**
39
+ * Otherwise anyone with a valid subscription can use
40
+ * the RentCheck API
41
+ */
42
+ return true;
43
+ };
44
+ exports.canAccess = canAccess;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.canAccess = void 0;
27
+ const Utils = __importStar(require("../../utils"));
28
+ const canAccess = (subscription) => {
29
+ if (!subscription) {
30
+ return false;
31
+ }
32
+ /**
33
+ * User must be on a plan that is not the essentials plan
34
+ */
35
+ if (Utils.Subscriptions.isOnEssentialsPlan(subscription)) {
36
+ return false;
37
+ }
38
+ /**
39
+ * Otherwise anyone with a valid subscription can use
40
+ * the Zapier integration
41
+ */
42
+ return true;
43
+ };
44
+ exports.canAccess = canAccess;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.canUpload = void 0;
4
+ const canUpload = (susbscription) => {
5
+ if (!susbscription) {
6
+ return false;
7
+ }
8
+ if (susbscription.status !== 'active') {
9
+ return false;
10
+ }
11
+ return true;
12
+ };
13
+ exports.canUpload = canUpload;
@@ -0,0 +1,2 @@
1
+ import { Feature, ApiInspectionWithTemplate } from '@rentcheck/types';
2
+ export declare const noteIsRequired: (feature: Feature, inspection?: ApiInspectionWithTemplate) => boolean;