@devlider001/washlab-backend 1.0.6 → 1.0.7

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.
@@ -12,6 +12,7 @@ import type * as admin from "../admin.js";
12
12
  import type * as analytics from "../analytics.js";
13
13
  import type * as attendants from "../attendants.js";
14
14
  import type * as audit from "../audit.js";
15
+ import type * as branches from "../branches.js";
15
16
  import type * as clerk from "../clerk.js";
16
17
  import type * as customers from "../customers.js";
17
18
  import type * as http from "../http.js";
@@ -36,6 +37,7 @@ declare const fullApi: ApiFromModules<{
36
37
  analytics: typeof analytics;
37
38
  attendants: typeof attendants;
38
39
  audit: typeof audit;
40
+ branches: typeof branches;
39
41
  clerk: typeof clerk;
40
42
  customers: typeof customers;
41
43
  http: typeof http;
@@ -0,0 +1,23 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * Generated `api` utility.
4
+ *
5
+ * THIS CODE IS AUTOMATICALLY GENERATED.
6
+ *
7
+ * To regenerate, run `npx convex dev`.
8
+ * @module
9
+ */
10
+
11
+ import { anyApi, componentsGeneric } from "convex/server";
12
+
13
+ /**
14
+ * A utility for referencing Convex functions in your app's API.
15
+ *
16
+ * Usage:
17
+ * ```js
18
+ * const myFunctionReference = api.myModule.myFunction;
19
+ * ```
20
+ */
21
+ export const api = anyApi;
22
+ export const internal = anyApi;
23
+ export const components = componentsGeneric();
@@ -0,0 +1,93 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * Generated utilities for implementing server-side Convex query and mutation functions.
4
+ *
5
+ * THIS CODE IS AUTOMATICALLY GENERATED.
6
+ *
7
+ * To regenerate, run `npx convex dev`.
8
+ * @module
9
+ */
10
+
11
+ import {
12
+ actionGeneric,
13
+ httpActionGeneric,
14
+ queryGeneric,
15
+ mutationGeneric,
16
+ internalActionGeneric,
17
+ internalMutationGeneric,
18
+ internalQueryGeneric,
19
+ } from "convex/server";
20
+
21
+ /**
22
+ * Define a query in this Convex app's public API.
23
+ *
24
+ * This function will be allowed to read your Convex database and will be accessible from the client.
25
+ *
26
+ * @param func - The query function. It receives a {@link QueryCtx} as its first argument.
27
+ * @returns The wrapped query. Include this as an `export` to name it and make it accessible.
28
+ */
29
+ export const query = queryGeneric;
30
+
31
+ /**
32
+ * Define a query that is only accessible from other Convex functions (but not from the client).
33
+ *
34
+ * This function will be allowed to read from your Convex database. It will not be accessible from the client.
35
+ *
36
+ * @param func - The query function. It receives a {@link QueryCtx} as its first argument.
37
+ * @returns The wrapped query. Include this as an `export` to name it and make it accessible.
38
+ */
39
+ export const internalQuery = internalQueryGeneric;
40
+
41
+ /**
42
+ * Define a mutation in this Convex app's public API.
43
+ *
44
+ * This function will be allowed to modify your Convex database and will be accessible from the client.
45
+ *
46
+ * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
47
+ * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
48
+ */
49
+ export const mutation = mutationGeneric;
50
+
51
+ /**
52
+ * Define a mutation that is only accessible from other Convex functions (but not from the client).
53
+ *
54
+ * This function will be allowed to modify your Convex database. It will not be accessible from the client.
55
+ *
56
+ * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
57
+ * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
58
+ */
59
+ export const internalMutation = internalMutationGeneric;
60
+
61
+ /**
62
+ * Define an action in this Convex app's public API.
63
+ *
64
+ * An action is a function which can execute any JavaScript code, including non-deterministic
65
+ * code and code with side-effects, like calling third-party services.
66
+ * They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
67
+ * They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
68
+ *
69
+ * @param func - The action. It receives an {@link ActionCtx} as its first argument.
70
+ * @returns The wrapped action. Include this as an `export` to name it and make it accessible.
71
+ */
72
+ export const action = actionGeneric;
73
+
74
+ /**
75
+ * Define an action that is only accessible from other Convex functions (but not from the client).
76
+ *
77
+ * @param func - The function. It receives an {@link ActionCtx} as its first argument.
78
+ * @returns The wrapped function. Include this as an `export` to name it and make it accessible.
79
+ */
80
+ export const internalAction = internalActionGeneric;
81
+
82
+ /**
83
+ * Define an HTTP action.
84
+ *
85
+ * The wrapped function will be used to respond to HTTP requests received
86
+ * by a Convex deployment if the requests matches the path and method where
87
+ * this action is routed. Be sure to route your httpAction in `convex/http.js`.
88
+ *
89
+ * @param func - The function. It receives an {@link ActionCtx} as its first argument
90
+ * and a Fetch API `Request` object as its second.
91
+ * @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
92
+ */
93
+ export const httpAction = httpActionGeneric;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Branch Functions
3
+ *
4
+ * Handles branch information queries for customers and public access.
5
+ */
6
+ /**
7
+ * Get all active branches
8
+ * Public query - can be used by customers and guests
9
+ */
10
+ export declare const getActive: import("convex/server").RegisteredQuery<"public", {}, Promise<{
11
+ _id: import("convex/values").GenericId<"branches">;
12
+ name: string;
13
+ code: string;
14
+ address: string;
15
+ city: string;
16
+ country: string;
17
+ phoneNumber: string;
18
+ email: string | undefined;
19
+ pricingPerKg: number;
20
+ deliveryFee: number;
21
+ isActive: boolean;
22
+ createdAt: number;
23
+ }[]>>;
24
+ //# sourceMappingURL=branches.d.ts.map
@@ -1,58 +1,39 @@
1
+ import { Id } from "./_generated/dataModel";
1
2
  /**
2
- * Notification Functions
3
- *
4
- * Handles creating, reading, and managing system notifications
5
- * for customers, attendants, and admins.
6
- */
7
- /**
8
- * Get notifications for current user - Paginated
9
- * Supports usePaginatedQuery for infinite scroll
3
+ * Get notifications for current user
4
+ * Returns empty array if user not found
10
5
  */
11
6
  export declare const getMyNotifications: import("convex/server").RegisteredQuery<"public", {
12
7
  type?: "info" | "success" | "warning" | "error" | "order" | "payment" | "system" | undefined;
13
8
  isRead?: boolean | undefined;
14
- paginationOpts: {
15
- id?: number;
16
- endCursor?: string | null;
17
- maximumRowsRead?: number;
18
- maximumBytesRead?: number;
19
- numItems: number;
20
- cursor: string | null;
21
- };
9
+ limit?: number | undefined;
22
10
  }, Promise<{
23
- page: never[];
24
- isDone: boolean;
25
- continueCursor: null;
26
- } | {
27
- page: {
28
- _id: import("convex/values").GenericId<"notifications">;
29
- _creationTime: number;
30
- branchId?: import("convex/values").GenericId<"branches"> | undefined;
31
- entityType?: string | undefined;
32
- entityId?: string | undefined;
33
- actionUrl?: string | undefined;
34
- actionLabel?: string | undefined;
35
- readAt?: number | undefined;
36
- senderId?: string | undefined;
37
- senderType?: "admin" | "attendant" | "system" | undefined;
38
- expiresAt?: number | undefined;
39
- scheduledFor?: number | undefined;
40
- sentAt?: number | undefined;
41
- type: "info" | "success" | "warning" | "error" | "order" | "payment" | "system";
42
- createdAt: number;
43
- isDeleted: boolean;
44
- recipientId: string;
45
- recipientType: "admin" | "customer" | "attendant" | "all";
46
- title: string;
47
- message: string;
48
- priority: "low" | "normal" | "high" | "urgent";
49
- isRead: boolean;
50
- }[];
51
- isDone: boolean;
52
- continueCursor: string;
53
- }>>;
11
+ _id: Id<"notifications">;
12
+ _creationTime: number;
13
+ recipientId: string;
14
+ recipientType: string;
15
+ title: string;
16
+ message: string;
17
+ type: string;
18
+ priority: string;
19
+ isRead: boolean;
20
+ createdAt: number;
21
+ isDeleted: boolean;
22
+ readAt?: number;
23
+ actionUrl?: string;
24
+ actionLabel?: string;
25
+ entityType?: string;
26
+ entityId?: string;
27
+ senderId?: string;
28
+ senderType?: string;
29
+ branchId?: Id<"branches">;
30
+ expiresAt?: number;
31
+ scheduledFor?: number;
32
+ sentAt?: number;
33
+ }[]>>;
54
34
  /**
55
35
  * Get unread notification count for current user
36
+ * Returns 0 if user not found
56
37
  */
57
38
  export declare const getUnreadCount: import("convex/server").RegisteredQuery<"public", {}, Promise<number>>;
58
39
  /**
@@ -496,6 +496,21 @@ declare const _default: import("convex/server").SchemaDefinition<{
496
496
  by_branch: ["branchId", "_creationTime"];
497
497
  by_entity: ["entityType", "entityId", "_creationTime"];
498
498
  }, {}, {}>;
499
+ notificationReadStatus: import("convex/server").TableDefinition<import("convex/values").VObject<{
500
+ readAt: number;
501
+ notificationId: import("convex/values").GenericId<"notifications">;
502
+ userId: string;
503
+ userType: "admin" | "customer" | "attendant";
504
+ }, {
505
+ notificationId: import("convex/values").VId<import("convex/values").GenericId<"notifications">, "required">;
506
+ userId: import("convex/values").VString<string, "required">;
507
+ userType: import("convex/values").VUnion<"admin" | "customer" | "attendant", [import("convex/values").VLiteral<"customer", "required">, import("convex/values").VLiteral<"attendant", "required">, import("convex/values").VLiteral<"admin", "required">], "required", never>;
508
+ readAt: import("convex/values").VFloat64<number, "required">;
509
+ }, "required", "readAt" | "notificationId" | "userId" | "userType">, {
510
+ by_notification: ["notificationId", "_creationTime"];
511
+ by_user: ["userId", "userType", "_creationTime"];
512
+ by_notification_user: ["notificationId", "userId", "userType", "_creationTime"];
513
+ }, {}, {}>;
499
514
  }, true>;
500
515
  export default _default;
501
516
  //# sourceMappingURL=schema.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devlider001/washlab-backend",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Washlab backend - Convex API package for Lider Technology Ltd",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",