@7365admin1/layer-common 1.11.19 → 1.11.21

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.
@@ -100,7 +100,7 @@ export default function useFeedback() {
100
100
  status,
101
101
  provider,
102
102
  service,
103
- ...(currentUser.value.type != "site" && {
103
+ ...(currentUser.value?.type != "site" && {
104
104
  userId,
105
105
  }),
106
106
  },
@@ -112,6 +112,21 @@ export default function useOrg() {
112
112
  });
113
113
  }
114
114
 
115
+ function addOnboardingOrg(
116
+ value: Partial<Pick<TOrg, "name" | "email" | "nature" | "contact">>
117
+ ) {
118
+ return useNuxtApp()
119
+ .$api<Record<string, any>>("/api/organizations/onboarding-org", {
120
+ method: "POST",
121
+ body: value,
122
+ })
123
+ .then((response: Record<string, any>) => {
124
+ return (
125
+ response?.organization ?? response?.org ?? response?.data ?? response
126
+ ) as TOrg;
127
+ });
128
+ }
129
+
115
130
  return {
116
131
  org,
117
132
  getOrgs,
@@ -125,5 +140,6 @@ export default function useOrg() {
125
140
  getById,
126
141
  getAll,
127
142
  add,
143
+ addOnboardingOrg,
128
144
  };
129
145
  }
@@ -140,6 +140,33 @@ export default function () {
140
140
  );
141
141
  }
142
142
 
143
+ async function getOvernightParkingAvailabilityV2(
144
+ siteId: string,
145
+ userType = "site"
146
+ ) {
147
+ return await useNuxtApp().$api<Record<string, any>>(
148
+ `/api/overnight-parking-approval-settings2/v1`,
149
+ {
150
+ method: "PATCH",
151
+ body: JSON.stringify({ site: siteId, userType }),
152
+ }
153
+ );
154
+ }
155
+
156
+ async function createOrUpdateOvernightParkingAvailabilityV2(
157
+ siteId: string,
158
+ payload: Record<string, any>,
159
+ userType = "site"
160
+ ) {
161
+ return await useNuxtApp().$api<Record<string, any>>(
162
+ `/api/overnight-parking-approval-settings2/v1`,
163
+ {
164
+ method: "POST",
165
+ body: JSON.stringify({ site: siteId, userType, ...payload }),
166
+ }
167
+ );
168
+ }
169
+
143
170
  return {
144
171
  getSiteById,
145
172
  getSiteLevels,
@@ -153,6 +180,8 @@ export default function () {
153
180
  updateSitebyId,
154
181
  updateSiteInformation,
155
182
  getOvernightParkingAvailability,
156
- updateOvernightParkingAvailability
183
+ updateOvernightParkingAvailability,
184
+ getOvernightParkingAvailabilityV2,
185
+ createOrUpdateOvernightParkingAvailabilityV2,
157
186
  };
158
187
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@7365admin1/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "1.11.19",
5
+ "version": "1.11.21",
6
6
  "author": "7365admin1",
7
7
  "main": "./nuxt.config.ts",
8
8
  "publishConfig": {
@@ -0,0 +1,8 @@
1
+ // plugins/html5-qrcode.client.js
2
+ import { defineNuxtPlugin } from "#app";
3
+ import { Html5Qrcode } from "html5-qrcode";
4
+
5
+ export default defineNuxtPlugin((nuxtApp) => {
6
+ // Attach Html5Qrcode to the global Vue instance
7
+ nuxtApp.provide("Html5Qrcode", Html5Qrcode);
8
+ });
@@ -12,6 +12,7 @@ declare type TOvernightParkingAvailability = {
12
12
  friday: TOvernightParkingDay;
13
13
  saturday: TOvernightParkingDay;
14
14
  sunday: TOvernightParkingDay;
15
+ isAllowPlateNumberOpenBarrier?: boolean;
15
16
  autoApproveOvernightParking?: boolean;
16
17
  };
17
18
 
@@ -35,9 +36,9 @@ declare type TOvernightParkingRequest = {
35
36
  invitedBy: {
36
37
  _id: string | ObjectId;
37
38
  name: string;
38
- }
39
+ };
39
40
  createdAt?: string | Date;
40
41
  updatedAt?: string | Date;
41
42
  deletedAt?: string | Date;
42
43
  remarks?: string;
43
- };
44
+ };