@justins-home/mocks 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +14 -0
- package/CHANGELOG.md +21 -0
- package/dist/index.js +117 -0
- package/dist/index.mjs +87 -0
- package/package.json +19 -0
- package/src/index.ts +5 -0
- package/src/inspections.mock.ts +17 -0
- package/src/listings.mock.ts +34 -0
- package/src/notifications.mock.ts +15 -0
- package/src/tenancies.mock.ts +27 -0
- package/src/users.mock.ts +14 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
WARN Issue while reading "/home/runner/work/justins-home-platform-ui/justins-home-platform-ui/.npmrc". Failed to replace env in config: ${NODE_AUTH_TOKEN}
|
|
2
|
+
|
|
3
|
+
> @justins-home/mocks@0.1.0 build /home/runner/work/justins-home-platform-ui/justins-home-platform-ui/packages/mocks
|
|
4
|
+
> tsup src/index.ts --format esm,cjs
|
|
5
|
+
|
|
6
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
7
|
+
[34mCLI[39m tsup v8.5.1
|
|
8
|
+
[34mCLI[39m Target: node16
|
|
9
|
+
[34mESM[39m Build start
|
|
10
|
+
[34mCJS[39m Build start
|
|
11
|
+
[32mCJS[39m [1mdist/index.js [22m[32m2.67 KB[39m
|
|
12
|
+
[32mCJS[39m ⚡️ Build success in 47ms
|
|
13
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m1.51 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 47ms
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# @justins-home/mocks
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- aced108: added minor pumb
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [aced108]
|
|
12
|
+
- Updated dependencies [26690e2]
|
|
13
|
+
- @justins-home/enums@0.1.0
|
|
14
|
+
- @justins-home/types@1.0.0
|
|
15
|
+
|
|
16
|
+
## 0.0.1
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies [3f39ece]
|
|
21
|
+
- @justins-home/types@0.0.2
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/index.ts
|
|
20
|
+
var index_exports = {};
|
|
21
|
+
__export(index_exports, {
|
|
22
|
+
mockInspections: () => mockInspections,
|
|
23
|
+
mockListings: () => mockListings,
|
|
24
|
+
mockNotifications: () => mockNotifications,
|
|
25
|
+
mockTenancies: () => mockTenancies,
|
|
26
|
+
mockUsers: () => mockUsers
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(index_exports);
|
|
29
|
+
|
|
30
|
+
// src/users.mock.ts
|
|
31
|
+
var mockUsers = [
|
|
32
|
+
{
|
|
33
|
+
id: 1,
|
|
34
|
+
uid: "usr_1",
|
|
35
|
+
name: "John Landlord"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: 2,
|
|
39
|
+
uid: "usr_2",
|
|
40
|
+
name: "Sarah Tenant"
|
|
41
|
+
}
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
// src/listings.mock.ts
|
|
45
|
+
var import_enums = require("@justins-home/enums");
|
|
46
|
+
var mockListings = [
|
|
47
|
+
{
|
|
48
|
+
uid: "lst_1",
|
|
49
|
+
vertical: "property",
|
|
50
|
+
listing_type: "rent",
|
|
51
|
+
state: import_enums.ListingEnums.ListingState.PUBLISHED,
|
|
52
|
+
is_visible: true,
|
|
53
|
+
price: {
|
|
54
|
+
amount: "1200",
|
|
55
|
+
currency: "GBP"
|
|
56
|
+
},
|
|
57
|
+
owner: {
|
|
58
|
+
id: 1,
|
|
59
|
+
uid: "usr_1",
|
|
60
|
+
name: "John Landlord"
|
|
61
|
+
},
|
|
62
|
+
summary: {
|
|
63
|
+
property_type: "apartment",
|
|
64
|
+
bedrooms: 2,
|
|
65
|
+
bathrooms: 1,
|
|
66
|
+
city: "London"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
];
|
|
70
|
+
|
|
71
|
+
// src/tenancies.mock.ts
|
|
72
|
+
var mockTenancies = [
|
|
73
|
+
{
|
|
74
|
+
uid: "ten_1",
|
|
75
|
+
listing_id: 1,
|
|
76
|
+
landlord_id: 1,
|
|
77
|
+
tenant_id: 2,
|
|
78
|
+
rent_amount: "1200",
|
|
79
|
+
deposit_amount: "1200",
|
|
80
|
+
state: "active",
|
|
81
|
+
start_date: "2025-01-01",
|
|
82
|
+
end_date: "2026-01-01",
|
|
83
|
+
is_periodic: false,
|
|
84
|
+
created_at: "2025-01-01"
|
|
85
|
+
}
|
|
86
|
+
];
|
|
87
|
+
|
|
88
|
+
// src/notifications.mock.ts
|
|
89
|
+
var mockNotifications = [
|
|
90
|
+
{
|
|
91
|
+
id: "not_1",
|
|
92
|
+
type: "LISTING_APPROVED",
|
|
93
|
+
title: "Listing Approved",
|
|
94
|
+
body: "Your listing has been approved.",
|
|
95
|
+
created_at: "2026-03-01"
|
|
96
|
+
}
|
|
97
|
+
];
|
|
98
|
+
|
|
99
|
+
// src/inspections.mock.ts
|
|
100
|
+
var mockInspections = [
|
|
101
|
+
{
|
|
102
|
+
uid: "insp_1",
|
|
103
|
+
inspection_type: "routine",
|
|
104
|
+
status: "scheduled",
|
|
105
|
+
scheduled_date: "2026-04-01",
|
|
106
|
+
summary: "Routine inspection",
|
|
107
|
+
created_at: "2026-03-01"
|
|
108
|
+
}
|
|
109
|
+
];
|
|
110
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
111
|
+
0 && (module.exports = {
|
|
112
|
+
mockInspections,
|
|
113
|
+
mockListings,
|
|
114
|
+
mockNotifications,
|
|
115
|
+
mockTenancies,
|
|
116
|
+
mockUsers
|
|
117
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// src/users.mock.ts
|
|
2
|
+
var mockUsers = [
|
|
3
|
+
{
|
|
4
|
+
id: 1,
|
|
5
|
+
uid: "usr_1",
|
|
6
|
+
name: "John Landlord"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
id: 2,
|
|
10
|
+
uid: "usr_2",
|
|
11
|
+
name: "Sarah Tenant"
|
|
12
|
+
}
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
// src/listings.mock.ts
|
|
16
|
+
import { ListingEnums } from "@justins-home/enums";
|
|
17
|
+
var mockListings = [
|
|
18
|
+
{
|
|
19
|
+
uid: "lst_1",
|
|
20
|
+
vertical: "property",
|
|
21
|
+
listing_type: "rent",
|
|
22
|
+
state: ListingEnums.ListingState.PUBLISHED,
|
|
23
|
+
is_visible: true,
|
|
24
|
+
price: {
|
|
25
|
+
amount: "1200",
|
|
26
|
+
currency: "GBP"
|
|
27
|
+
},
|
|
28
|
+
owner: {
|
|
29
|
+
id: 1,
|
|
30
|
+
uid: "usr_1",
|
|
31
|
+
name: "John Landlord"
|
|
32
|
+
},
|
|
33
|
+
summary: {
|
|
34
|
+
property_type: "apartment",
|
|
35
|
+
bedrooms: 2,
|
|
36
|
+
bathrooms: 1,
|
|
37
|
+
city: "London"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
// src/tenancies.mock.ts
|
|
43
|
+
var mockTenancies = [
|
|
44
|
+
{
|
|
45
|
+
uid: "ten_1",
|
|
46
|
+
listing_id: 1,
|
|
47
|
+
landlord_id: 1,
|
|
48
|
+
tenant_id: 2,
|
|
49
|
+
rent_amount: "1200",
|
|
50
|
+
deposit_amount: "1200",
|
|
51
|
+
state: "active",
|
|
52
|
+
start_date: "2025-01-01",
|
|
53
|
+
end_date: "2026-01-01",
|
|
54
|
+
is_periodic: false,
|
|
55
|
+
created_at: "2025-01-01"
|
|
56
|
+
}
|
|
57
|
+
];
|
|
58
|
+
|
|
59
|
+
// src/notifications.mock.ts
|
|
60
|
+
var mockNotifications = [
|
|
61
|
+
{
|
|
62
|
+
id: "not_1",
|
|
63
|
+
type: "LISTING_APPROVED",
|
|
64
|
+
title: "Listing Approved",
|
|
65
|
+
body: "Your listing has been approved.",
|
|
66
|
+
created_at: "2026-03-01"
|
|
67
|
+
}
|
|
68
|
+
];
|
|
69
|
+
|
|
70
|
+
// src/inspections.mock.ts
|
|
71
|
+
var mockInspections = [
|
|
72
|
+
{
|
|
73
|
+
uid: "insp_1",
|
|
74
|
+
inspection_type: "routine",
|
|
75
|
+
status: "scheduled",
|
|
76
|
+
scheduled_date: "2026-04-01",
|
|
77
|
+
summary: "Routine inspection",
|
|
78
|
+
created_at: "2026-03-01"
|
|
79
|
+
}
|
|
80
|
+
];
|
|
81
|
+
export {
|
|
82
|
+
mockInspections,
|
|
83
|
+
mockListings,
|
|
84
|
+
mockNotifications,
|
|
85
|
+
mockTenancies,
|
|
86
|
+
mockUsers
|
|
87
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@justins-home/mocks",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"main": "src/index.ts",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@justins-home/types": "1.0.0",
|
|
11
|
+
"@justins-home/enums": "0.1.0"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"lint": "eslint src",
|
|
15
|
+
"check-types": "tsc --noEmit -p ../../tsconfig.base.json",
|
|
16
|
+
"build": "tsup src/index.ts --format esm,cjs",
|
|
17
|
+
"test": "vitest"
|
|
18
|
+
}
|
|
19
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { InspectionResource } from '@justins-home/types';
|
|
2
|
+
|
|
3
|
+
export const mockInspections: InspectionResource[] = [
|
|
4
|
+
{
|
|
5
|
+
uid: 'insp_1',
|
|
6
|
+
|
|
7
|
+
inspection_type: 'routine',
|
|
8
|
+
|
|
9
|
+
status: 'scheduled',
|
|
10
|
+
|
|
11
|
+
scheduled_date: '2026-04-01',
|
|
12
|
+
|
|
13
|
+
summary: 'Routine inspection',
|
|
14
|
+
|
|
15
|
+
created_at: '2026-03-01',
|
|
16
|
+
},
|
|
17
|
+
];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ListingResource } from '@justins-home/types';
|
|
2
|
+
import { ListingEnums } from '@justins-home/enums';
|
|
3
|
+
|
|
4
|
+
export const mockListings: ListingResource[] = [
|
|
5
|
+
{
|
|
6
|
+
uid: 'lst_1',
|
|
7
|
+
|
|
8
|
+
vertical: 'property',
|
|
9
|
+
|
|
10
|
+
listing_type: 'rent',
|
|
11
|
+
|
|
12
|
+
state: ListingEnums.ListingState.PUBLISHED,
|
|
13
|
+
|
|
14
|
+
is_visible: true,
|
|
15
|
+
|
|
16
|
+
price: {
|
|
17
|
+
amount: '1200',
|
|
18
|
+
currency: 'GBP',
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
owner: {
|
|
22
|
+
id: 1,
|
|
23
|
+
uid: 'usr_1',
|
|
24
|
+
name: 'John Landlord',
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
summary: {
|
|
28
|
+
property_type: 'apartment',
|
|
29
|
+
bedrooms: 2,
|
|
30
|
+
bathrooms: 1,
|
|
31
|
+
city: 'London',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NotificationResource } from '@justins-home/types';
|
|
2
|
+
|
|
3
|
+
export const mockNotifications: NotificationResource[] = [
|
|
4
|
+
{
|
|
5
|
+
id: 'not_1',
|
|
6
|
+
|
|
7
|
+
type: 'LISTING_APPROVED',
|
|
8
|
+
|
|
9
|
+
title: 'Listing Approved',
|
|
10
|
+
|
|
11
|
+
body: 'Your listing has been approved.',
|
|
12
|
+
|
|
13
|
+
created_at: '2026-03-01',
|
|
14
|
+
},
|
|
15
|
+
];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { TenancyResource } from '@justins-home/types';
|
|
2
|
+
|
|
3
|
+
export const mockTenancies: TenancyResource[] = [
|
|
4
|
+
{
|
|
5
|
+
uid: 'ten_1',
|
|
6
|
+
|
|
7
|
+
listing_id: 1,
|
|
8
|
+
|
|
9
|
+
landlord_id: 1,
|
|
10
|
+
|
|
11
|
+
tenant_id: 2,
|
|
12
|
+
|
|
13
|
+
rent_amount: '1200',
|
|
14
|
+
|
|
15
|
+
deposit_amount: '1200',
|
|
16
|
+
|
|
17
|
+
state: 'active',
|
|
18
|
+
|
|
19
|
+
start_date: '2025-01-01',
|
|
20
|
+
|
|
21
|
+
end_date: '2026-01-01',
|
|
22
|
+
|
|
23
|
+
is_periodic: false,
|
|
24
|
+
|
|
25
|
+
created_at: '2025-01-01',
|
|
26
|
+
},
|
|
27
|
+
];
|