@rentcheck/biz 1.0.16 → 1.0.18

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 (62) hide show
  1. package/dist/{utils/subscriptions/integrations.d.ts → constants/addons.d.ts} +12 -10
  2. package/dist/constants/addons.js +46 -0
  3. package/dist/constants/index.d.ts +2 -2
  4. package/dist/constants/index.js +3 -3
  5. package/dist/constants/plans.d.ts +1 -1
  6. package/dist/constants/plans.js +4 -1
  7. package/dist/index.d.ts +1 -0
  8. package/dist/index.js +2 -1
  9. package/dist/permissions/account-settings/inspection-reports.d.ts +1 -1
  10. package/dist/permissions/account-settings/inspection-reports.js +27 -4
  11. package/dist/permissions/account-settings/maintenance-settings.d.ts +1 -1
  12. package/dist/permissions/account-settings/maintenance-settings.js +27 -4
  13. package/dist/permissions/account-settings/property-configuration.d.ts +1 -1
  14. package/dist/permissions/account-settings/property-configuration.js +27 -4
  15. package/dist/permissions/index.d.ts +2 -0
  16. package/dist/permissions/index.js +3 -1
  17. package/dist/permissions/inspections.d.ts +4 -0
  18. package/dist/permissions/inspections.js +57 -0
  19. package/dist/permissions/integrations/appfolio.d.ts +2 -0
  20. package/dist/permissions/integrations/appfolio.js +54 -0
  21. package/dist/permissions/integrations/index.d.ts +5 -0
  22. package/dist/permissions/integrations/index.js +31 -0
  23. package/dist/permissions/integrations/latchel.d.ts +2 -0
  24. package/dist/permissions/integrations/latchel.js +54 -0
  25. package/dist/permissions/integrations/rent-manager.d.ts +2 -0
  26. package/dist/permissions/integrations/rent-manager.js +54 -0
  27. package/dist/permissions/integrations/rentcheck-api.d.ts +2 -0
  28. package/dist/permissions/integrations/rentcheck-api.js +44 -0
  29. package/dist/permissions/integrations/zapier.d.ts +2 -0
  30. package/dist/permissions/integrations/zapier.js +44 -0
  31. package/dist/rules/features/index.d.ts +2 -0
  32. package/dist/rules/features/index.js +30 -0
  33. package/dist/rules/index.d.ts +1 -0
  34. package/dist/rules/index.js +27 -0
  35. package/dist/utils/inspection-features/sorting.js +26 -3
  36. package/dist/utils/inspection-templates/common.js +25 -2
  37. package/dist/utils/subscriptions/index.d.ts +4 -1
  38. package/dist/utils/subscriptions/index.js +20 -14
  39. package/package.json +1 -1
  40. package/src/constants/addons.ts +53 -0
  41. package/src/constants/index.ts +2 -2
  42. package/src/index.ts +1 -0
  43. package/src/permissions/account-settings/inspection-reports.ts +4 -4
  44. package/src/permissions/account-settings/maintenance-settings.ts +4 -4
  45. package/src/permissions/account-settings/property-configuration.ts +4 -4
  46. package/src/permissions/index.ts +2 -0
  47. package/src/permissions/inspections.ts +41 -0
  48. package/src/permissions/integrations/appfolio.ts +37 -0
  49. package/src/permissions/integrations/index.ts +5 -0
  50. package/src/permissions/integrations/latchel.ts +37 -0
  51. package/src/permissions/integrations/rent-manager.ts +37 -0
  52. package/src/permissions/integrations/rentcheck-api.ts +21 -0
  53. package/src/permissions/integrations/zapier.ts +21 -0
  54. package/src/rules/features/index.ts +44 -0
  55. package/src/rules/index.ts +1 -0
  56. package/src/utils/inspection-features/sorting.ts +3 -3
  57. package/src/utils/inspection-templates/common.ts +2 -2
  58. package/src/utils/subscriptions/index.ts +27 -1
  59. package/tsconfig.tsbuildinfo +1 -1
  60. package/dist/utils/subscriptions/integrations.js +0 -73
  61. package/src/constants/plans.ts +0 -2
  62. package/src/utils/subscriptions/integrations.ts +0 -101
@@ -1,23 +1,25 @@
1
- import { ApiSubscription, Subscription } from '@rentcheck/types';
2
1
  /**
3
2
  * Base AppFolio addons here plus we add support for 2 more
4
3
  * in order to support Atlas' billing setup
5
4
  */
6
5
  export declare const appFolioAddonIds: string[];
7
6
  export declare const appFolioWorkOrderAddonIds: string[];
7
+ /**
8
+ * Latchel Addon Ids
9
+ */
8
10
  export declare const latchelWorkOrderAddonIds: string[];
9
- export declare const yardiWorkOrderAddonIds: string[];
11
+ /**
12
+ * Jenark (365) Addon Ids
13
+ */
10
14
  export declare const jenarkWorkOrderAddonIds: string[];
11
- export declare const appFolioAddons: {
12
- twoWaySync: string;
13
- workOrders: string;
14
- };
15
+ /**
16
+ * Rent Manager Addon Ids
17
+ */
15
18
  export declare const rentManagerAddonIds: string[];
16
19
  export declare const rentManagerWorkOrderAddonIds: string[];
20
+ /**
21
+ * Inspection Template Addon Ids
22
+ */
17
23
  export declare const inspectionTemplatePerUnitAddonId = "inspection-template-customization-2";
18
24
  export declare const inspectionTemplateFreeTrialAddonId = "inspection-template-customization-free-trial";
19
25
  export declare const inspectionTemplateAddonIds: string[];
20
- export declare const hasAppfolioAddons: (subscription: ApiSubscription | Subscription | null) => boolean;
21
- export declare const hasRentManagerAddons: (subscription: ApiSubscription | Subscription | null) => boolean;
22
- export declare const hasWorkOrderAddons: (subscription: ApiSubscription | Subscription | null) => boolean;
23
- export declare const hasPropertySyncIntegrationAddons: (subscription: ApiSubscription | Subscription | null) => boolean;
@@ -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
+ ];
@@ -1,3 +1,3 @@
1
- export * as Plans from './plans';
2
- export * as RoomConstants from './rooms';
1
+ export * as Addons from './addons';
2
+ export * as Rooms from './rooms';
3
3
  export * as Skills from './skills';
@@ -23,7 +23,7 @@ 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 = exports.Plans = void 0;
27
- exports.Plans = __importStar(require("./plans"));
28
- exports.RoomConstants = __importStar(require("./rooms"));
26
+ exports.Skills = exports.Rooms = exports.Addons = void 0;
27
+ exports.Addons = __importStar(require("./addons"));
28
+ exports.Rooms = __importStar(require("./rooms"));
29
29
  exports.Skills = __importStar(require("./skills"));
@@ -1 +1 @@
1
- export declare const essentialsPlanId = "essential-plan---$1.00-(includes-30-day-free-trial)";
1
+ export declare const essentialsPlanId: string[];
@@ -1,4 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.essentialsPlanId = void 0;
4
- exports.essentialsPlanId = 'essential-plan---$1.00-(includes-30-day-free-trial)';
4
+ exports.essentialsPlanId = [
5
+ 'essential-plan---$1.00-(includes-30-day-free-trial)',
6
+ 'essential-plan---$1.00-(without-30-day-free-trial)',
7
+ ];
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * as Constants from './constants';
2
2
  export * as Permissions from './permissions';
3
3
  export * as Utils from './utils';
4
+ export * as Rules from './rules';
package/dist/index.js CHANGED
@@ -23,7 +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.Permissions = exports.Constants = void 0;
26
+ exports.Rules = exports.Utils = exports.Permissions = exports.Constants = void 0;
27
27
  exports.Constants = __importStar(require("./constants"));
28
28
  exports.Permissions = __importStar(require("./permissions"));
29
29
  exports.Utils = __importStar(require("./utils"));
30
+ exports.Rules = __importStar(require("./rules"));
@@ -1,2 +1,2 @@
1
1
  import { ApiSubscription, Profile } from '@rentcheck/types';
2
- export declare const canEdit: (profile?: Profile | null, susbscription?: ApiSubscription | null) => boolean;
2
+ export declare const canEdit: (profile?: Profile | null, subscription?: ApiSubscription | null) => boolean;
@@ -1,9 +1,32 @@
1
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
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.canEdit = void 0;
4
- const __1 = require("../..");
5
- const canEdit = (profile, susbscription) => {
6
- if (!susbscription) {
27
+ const Utils = __importStar(require("../../utils"));
28
+ const canEdit = (profile, subscription) => {
29
+ if (!subscription) {
7
30
  return false;
8
31
  }
9
32
  if (!profile) {
@@ -18,7 +41,7 @@ const canEdit = (profile, susbscription) => {
18
41
  /**
19
42
  * User must be on a plan that is not the essentials plan
20
43
  */
21
- if (susbscription.plan.plan_id === __1.Constants.Plans.essentialsPlanId) {
44
+ if (Utils.Subscriptions.isOnEssentialsPlan(subscription)) {
22
45
  return false;
23
46
  }
24
47
  return true;
@@ -1,2 +1,2 @@
1
1
  import { ApiSubscription } from '@rentcheck/types';
2
- export declare const canEdit: (susbscription?: ApiSubscription | null) => boolean;
2
+ export declare const canEdit: (subscription?: ApiSubscription | null) => boolean;
@@ -1,15 +1,38 @@
1
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
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.canEdit = void 0;
4
- const __1 = require("../..");
5
- const canEdit = (susbscription) => {
6
- if (!susbscription) {
27
+ const Utils = __importStar(require("../../utils"));
28
+ const canEdit = (subscription) => {
29
+ if (!subscription) {
7
30
  return false;
8
31
  }
9
32
  /**
10
33
  * User must be on a plan that is not the essentials plan
11
34
  */
12
- if (susbscription.plan.plan_id === __1.Constants.Plans.essentialsPlanId) {
35
+ if (Utils.Subscriptions.isOnEssentialsPlan(subscription)) {
13
36
  return false;
14
37
  }
15
38
  return true;
@@ -1,2 +1,2 @@
1
1
  import { ApiSubscription } from '@rentcheck/types';
2
- export declare const canEdit: (susbscription?: ApiSubscription | null) => boolean;
2
+ export declare const canEdit: (subscription?: ApiSubscription | null) => boolean;
@@ -1,15 +1,38 @@
1
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
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.canEdit = void 0;
4
- const __1 = require("../..");
5
- const canEdit = (susbscription) => {
6
- if (!susbscription) {
27
+ const Utils = __importStar(require("../../utils"));
28
+ const canEdit = (subscription) => {
29
+ if (!subscription) {
7
30
  return false;
8
31
  }
9
32
  /**
10
33
  * User must be on a plan that is not the essentials plan
11
34
  */
12
- if (susbscription.plan.plan_id === __1.Constants.Plans.essentialsPlanId) {
35
+ if (Utils.Subscriptions.isOnEssentialsPlan(subscription)) {
13
36
  return false;
14
37
  }
15
38
  return true;
@@ -1 +1,3 @@
1
1
  export * as AccountSettings from './account-settings';
2
+ export * as Inspections from './inspections';
3
+ export * as Integrations from './integrations';
@@ -23,5 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.AccountSettings = void 0;
26
+ exports.Integrations = exports.Inspections = exports.AccountSettings = void 0;
27
27
  exports.AccountSettings = __importStar(require("./account-settings"));
28
+ exports.Inspections = __importStar(require("./inspections"));
29
+ exports.Integrations = __importStar(require("./integrations"));
@@ -0,0 +1,4 @@
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;
@@ -0,0 +1,57 @@
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.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;
@@ -0,0 +1,2 @@
1
+ import { ApiSubscription } from '@rentcheck/types';
2
+ export declare const canInstall: (subscription?: ApiSubscription | null) => boolean;
@@ -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,5 @@
1
+ export * as AppFolio from './appfolio';
2
+ export * as Latchel from './latchel';
3
+ export * as RentManager from './rent-manager';
4
+ export * as RentCheckApi from './rentcheck-api';
5
+ export * as Zapier from './zapier';
@@ -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,2 @@
1
+ import { ApiSubscription } from '@rentcheck/types';
2
+ export declare const canInstall: (subscription?: ApiSubscription | null) => boolean;
@@ -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,2 @@
1
+ import { ApiSubscription } from '@rentcheck/types';
2
+ export declare const canInstall: (subscription?: ApiSubscription | null) => boolean;
@@ -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,2 @@
1
+ import { ApiSubscription } from '@rentcheck/types';
2
+ export declare const canAccess: (subscription?: ApiSubscription | null) => boolean;
@@ -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,2 @@
1
+ import { ApiSubscription } from '@rentcheck/types';
2
+ export declare const canAccess: (subscription?: ApiSubscription | null) => boolean;