@bizmap/sdk 0.0.1
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/dist/main.d.ts +1958 -0
- package/dist/main.js +161 -0
- package/package.json +26 -0
package/dist/main.js
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
// src/schemas/Billing.ts
|
|
2
|
+
import * as z2 from "zod";
|
|
3
|
+
|
|
4
|
+
// src/schemas/utils.ts
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
var TimeLog = z.object({
|
|
7
|
+
createdAt: z.number(),
|
|
8
|
+
lastModified: z.number()
|
|
9
|
+
});
|
|
10
|
+
var Time = z.string().regex(/[0-9]{1,2}:[0-9]{2} (am|pm)/);
|
|
11
|
+
|
|
12
|
+
// src/schemas/Billing.ts
|
|
13
|
+
var PricingRate = z2.object({
|
|
14
|
+
companyRegistration: z2.object({
|
|
15
|
+
flatFee: z2.number(),
|
|
16
|
+
feePerUser: z2.number(),
|
|
17
|
+
lastModified: z2.number()
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
var PriceAdjustment = z2.object({
|
|
21
|
+
fixedAmount: z2.number(),
|
|
22
|
+
percentage: z2.number()
|
|
23
|
+
});
|
|
24
|
+
var PriceTag = z2.object({
|
|
25
|
+
uid: z2.string(),
|
|
26
|
+
name: z2.string(),
|
|
27
|
+
cost: z2.number()
|
|
28
|
+
}).extend(TimeLog.shape);
|
|
29
|
+
|
|
30
|
+
// src/schemas/Company.ts
|
|
31
|
+
import {
|
|
32
|
+
Address,
|
|
33
|
+
Currencies,
|
|
34
|
+
FileDetails,
|
|
35
|
+
PhoneNumber,
|
|
36
|
+
UserModel as UserModel2
|
|
37
|
+
} from "@wavy/util";
|
|
38
|
+
import * as z4 from "zod";
|
|
39
|
+
|
|
40
|
+
// src/schemas/User.ts
|
|
41
|
+
import * as z3 from "zod";
|
|
42
|
+
import { UserModel } from "@wavy/util";
|
|
43
|
+
var UserCompaniesDTO = z3.object({
|
|
44
|
+
companies: CompanyInfo.shape
|
|
45
|
+
});
|
|
46
|
+
var companyUserRoles = z3.enum([
|
|
47
|
+
"doc",
|
|
48
|
+
"physAsst",
|
|
49
|
+
"rcpst",
|
|
50
|
+
"cshr",
|
|
51
|
+
"fdc",
|
|
52
|
+
"admin"
|
|
53
|
+
]);
|
|
54
|
+
var CompanyUser = z3.object({
|
|
55
|
+
...UserModel.shape,
|
|
56
|
+
lastActive: z3.number(),
|
|
57
|
+
status: z3.enum(["inviteSent", "active", "inactive"]),
|
|
58
|
+
roles: companyUserRoles,
|
|
59
|
+
...TimeLog.shape
|
|
60
|
+
});
|
|
61
|
+
var CompanyUsersOverviewDTO = z3.object({
|
|
62
|
+
users: z3.array(CompanyUser),
|
|
63
|
+
/**doc (one) -> physAsst (many) */
|
|
64
|
+
partnerMap: z3.record(z3.email(), z3.array(z3.email()))
|
|
65
|
+
});
|
|
66
|
+
var companyPartnerRoles = CompanyUser.shape.roles.extract([
|
|
67
|
+
"doc",
|
|
68
|
+
"physAsst"
|
|
69
|
+
]);
|
|
70
|
+
var employeeRoles = CompanyUser.shape.roles.exclude(["admin"]);
|
|
71
|
+
|
|
72
|
+
// src/schemas/Company.ts
|
|
73
|
+
var CompanyInfo = z4.object({
|
|
74
|
+
uid: z4.string(),
|
|
75
|
+
displayName: z4.string(),
|
|
76
|
+
logo: z4.string().nullish(),
|
|
77
|
+
slogan: z4.string(),
|
|
78
|
+
email: z4.email(),
|
|
79
|
+
address: Address,
|
|
80
|
+
phoneNumber: PhoneNumber.optional(),
|
|
81
|
+
...TimeLog.shape
|
|
82
|
+
});
|
|
83
|
+
var CompanyOpState = z4.object({
|
|
84
|
+
uid: z4.string(),
|
|
85
|
+
availableBalance: z4.number(),
|
|
86
|
+
isOffline: z4.boolean(),
|
|
87
|
+
// Required to determine:
|
|
88
|
+
// [1] when the working directory on the server should reset
|
|
89
|
+
// [2] the time that company session requests are cut-off
|
|
90
|
+
// (the cutoff time affects non-admins)
|
|
91
|
+
workingHours: z4.object({
|
|
92
|
+
start: Time,
|
|
93
|
+
end: Time
|
|
94
|
+
})
|
|
95
|
+
}).extend(TimeLog.shape);
|
|
96
|
+
var appointmentDistAlgs = z4.enum(["RR", "LOR"]);
|
|
97
|
+
var CompanyPreferences = z4.object({
|
|
98
|
+
uid: z4.string(),
|
|
99
|
+
/** The amount of user provisions made for this company */
|
|
100
|
+
userProvisions: z4.number(),
|
|
101
|
+
/**
|
|
102
|
+
* @property RR (Round Robin): Even distribution.
|
|
103
|
+
* @property LOR (Least Outstanding Requests): Distribute based on availability.
|
|
104
|
+
*/
|
|
105
|
+
apptDistAlg: appointmentDistAlgs
|
|
106
|
+
}).extend(TimeLog.shape);
|
|
107
|
+
var CompanyBillingModel = z4.object({
|
|
108
|
+
uid: z4.string(),
|
|
109
|
+
trn: z4.string().nullish(),
|
|
110
|
+
gctRegNo: z4.string().nullish(),
|
|
111
|
+
billingProvider: CompanyUser.shape.roles.extract(["doc", "physAsst"]),
|
|
112
|
+
primaryCurrency: Currencies,
|
|
113
|
+
additionalFees: z4.array(
|
|
114
|
+
z4.object({
|
|
115
|
+
...PriceAdjustment.shape,
|
|
116
|
+
description: z4.string().nullish(),
|
|
117
|
+
createdAt: z4.number()
|
|
118
|
+
})
|
|
119
|
+
),
|
|
120
|
+
get discounts() {
|
|
121
|
+
return this.additionalFees;
|
|
122
|
+
},
|
|
123
|
+
services: z4.array(PriceTag),
|
|
124
|
+
acceptedCurrencies: z4.array(Currencies)
|
|
125
|
+
}).extend(TimeLog.shape);
|
|
126
|
+
var RegisterCompanyForm = z4.object({
|
|
127
|
+
regNo: z4.string(),
|
|
128
|
+
userProvisions: z4.number(),
|
|
129
|
+
slogan: z4.string(),
|
|
130
|
+
email: z4.email(),
|
|
131
|
+
phoneNumber: z4.string(),
|
|
132
|
+
workingHours: CompanyOpState.shape.workingHours,
|
|
133
|
+
logo: FileDetails,
|
|
134
|
+
receipt: FileDetails,
|
|
135
|
+
_claims: z4.string()
|
|
136
|
+
});
|
|
137
|
+
var CompanyRegistrationClaims = z4.object({
|
|
138
|
+
sender: UserModel2,
|
|
139
|
+
pricingRate: PricingRate.shape.companyRegistration,
|
|
140
|
+
timestamp: z4.number()
|
|
141
|
+
});
|
|
142
|
+
export {
|
|
143
|
+
CompanyBillingModel,
|
|
144
|
+
CompanyInfo,
|
|
145
|
+
CompanyOpState,
|
|
146
|
+
CompanyPreferences,
|
|
147
|
+
CompanyRegistrationClaims,
|
|
148
|
+
CompanyUser,
|
|
149
|
+
CompanyUsersOverviewDTO,
|
|
150
|
+
PriceAdjustment,
|
|
151
|
+
PriceTag,
|
|
152
|
+
PricingRate,
|
|
153
|
+
RegisterCompanyForm,
|
|
154
|
+
Time,
|
|
155
|
+
TimeLog,
|
|
156
|
+
UserCompaniesDTO,
|
|
157
|
+
appointmentDistAlgs,
|
|
158
|
+
companyPartnerRoles,
|
|
159
|
+
companyUserRoles,
|
|
160
|
+
employeeRoles
|
|
161
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bizmap/sdk",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"main": "./dist/main.js",
|
|
5
|
+
"types": "./dist/main.d.ts",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist/"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsup",
|
|
12
|
+
"publish-success": "echo ✨ Successfully published package! ✨",
|
|
13
|
+
"publisher": "npm run build && npm version patch && npm publish && npm run publish-success"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [],
|
|
16
|
+
"author": "",
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"description": "",
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@wavy/types": "^0.0.46",
|
|
21
|
+
"@wavy/util": "^0.0.3",
|
|
22
|
+
"tsup": "^8.5.0",
|
|
23
|
+
"typescript": "^5.9.2",
|
|
24
|
+
"zod": "^4.2.1"
|
|
25
|
+
}
|
|
26
|
+
}
|