@react-pakistan/util-functions 1.23.32 → 1.23.34
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/api/cors/index.js +6 -6
- package/api/stellar-solutions/app-user/index.js +97 -38
- package/api/stellar-solutions/banking-detail/index.js +107 -48
- package/api/stellar-solutions/branch/index.js +107 -48
- package/api/stellar-solutions/company/index.js +124 -57
- package/api/stellar-solutions/company-report/index.js +48 -13
- package/api/stellar-solutions/contact/index.js +132 -65
- package/api/stellar-solutions/currency/index.js +101 -42
- package/api/stellar-solutions/customer/index.js +149 -74
- package/api/stellar-solutions/expense/index.js +132 -65
- package/api/stellar-solutions/expense-category/index.js +133 -66
- package/api/stellar-solutions/lead/index.js +132 -65
- package/api/stellar-solutions/menu-order/index.js +97 -38
- package/api/stellar-solutions/payment/index.js +135 -77
- package/api/stellar-solutions/payment-mode/index.js +90 -31
- package/api/stellar-solutions/preference/index.js +71 -28
- package/api/stellar-solutions/product/index.js +144 -77
- package/api/stellar-solutions/product-category/index.js +130 -63
- package/api/stellar-solutions/profile/index.js +152 -77
- package/api/stellar-solutions/quote-invoice/index.js +280 -201
- package/api/stellar-solutions/quote-invoice-report/index.js +48 -13
- package/api/stellar-solutions/tax/index.js +103 -44
- package/constants/react-pakistan.js +11 -22
- package/constants/social-media-sizes.js +33 -32
- package/general/basic-get.js +68 -6
- package/general/basic-post.js +55 -6
- package/general/camel-to-sentence-case.js +3 -3
- package/general/check-even-odd-length.js +1 -1
- package/general/create-date.js +4 -4
- package/general/dynamic-page-limit.js +15 -4
- package/general/enum-to-text.js +2 -2
- package/general/fetch-supabase-image.js +53 -15
- package/general/format-date.js +13 -12
- package/general/generate-blog-schema.js +10 -9
- package/general/generate-breadcrumb-schema.js +5 -4
- package/general/generate-faq-schema.js +5 -3
- package/general/generate-grid.js +2 -2
- package/general/generate-organization-schema.js +14 -13
- package/general/get-day-name.js +1 -1
- package/general/get-full-name.js +4 -1
- package/general/get-href.js +1 -1
- package/general/get-month-name.js +1 -1
- package/general/get-pathname.js +1 -1
- package/general/index.d.ts +2 -2
- package/general/index.js +2 -2
- package/general/is-next-button-disabled.js +1 -1
- package/general/is-odd.js +1 -1
- package/general/is-previous-button-disabled.js +1 -1
- package/general/remove-data-image-prefix.js +2 -2
- package/general/repeat-times.js +3 -3
- package/general/resolve-anchor-link.js +4 -4
- package/general/resolve-current-date.js +2 -2
- package/general/resolve-grid.js +1 -1
- package/general/resolve-initials.js +2 -2
- package/general/set-timezone.js +6 -3
- package/general/slugify.js +2 -2
- package/general/text-to-enum.js +1 -1
- package/general/text-to-sentence-case.js +1 -1
- package/general/truncate-text.js +1 -1
- package/general/upload-blob-to-private-supabase.d.ts +11 -0
- package/general/upload-blob-to-private-supabase.js +62 -0
- package/general/upload-blob-to-public-supabase.d.ts +11 -0
- package/general/upload-blob-to-public-supabase.js +62 -0
- package/general/upload-image-to-private-supabase.js +51 -15
- package/general/upload-image-to-public-supabase.js +51 -15
- package/general/url-to-sentence-case.js +4 -4
- package/general/validate-comment.js +1 -1
- package/general/validate-email.js +2 -2
- package/general/validate-name.js +1 -1
- package/hooks/index.d.ts +0 -1
- package/hooks/index.js +0 -1
- package/hooks/use-change.js +14 -5
- package/hooks/use-debounce.js +7 -6
- package/hooks/use-fetch.js +82 -31
- package/hooks/use-force-render.js +3 -3
- package/hooks/use-ip-geo-location.js +57 -22
- package/hooks/use-is-mobile.js +6 -6
- package/hooks/use-position.js +16 -16
- package/hooks/use-sticky.js +9 -8
- package/hooks/use-toggle-state.js +6 -5
- package/hooks/use-window-event-listener.js +4 -4
- package/local-storage/get-storage-value.js +2 -2
- package/local-storage/remove-storage-value.js +1 -1
- package/local-storage/set-storage-value.js +1 -1
- package/package.json +1 -1
- package/storybook/generate-sitemap.js +6 -22
- package/storybook/preview.js +13 -2
- package/storybook/react-design-story-script.js +7 -11
- package/storybook/react-emoji-collection.js +23 -33
- package/storybook/react-emoji-story-script.js +9 -13
- package/storybook/react-emoji-story-template.js +1 -46
- package/storybook/react-icon-collection.js +17 -27
- package/storybook/react-icon-story-script.js +9 -13
- package/storybook/react-icon-story-template.js +1 -46
- package/storybook/react-logo-collection.js +17 -27
- package/storybook/react-logo-story-script.js +9 -13
- package/storybook/react-logo-story-template.js +1 -46
- package/storybook/responsive-component.js +11 -46
- package/storybook/theme.js +4 -4
- package/general/upload-image-blob-to-private-supabase.d.ts +0 -11
- package/general/upload-image-blob-to-private-supabase.js +0 -27
- package/general/upload-image-blob-to-public-supabase.d.ts +0 -11
- package/general/upload-image-blob-to-public-supabase.js +0 -27
- package/hooks/with-seo.d.ts +0 -9
- package/hooks/with-seo.js +0 -43
|
@@ -9,93 +9,168 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
13
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
14
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
15
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
16
|
+
function step(op) {
|
|
17
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
18
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
19
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
20
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
21
|
+
switch (op[0]) {
|
|
22
|
+
case 0: case 1: t = op; break;
|
|
23
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
24
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
25
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
26
|
+
default:
|
|
27
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
28
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
29
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
30
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
31
|
+
if (t[2]) _.ops.pop();
|
|
32
|
+
_.trys.pop(); continue;
|
|
33
|
+
}
|
|
34
|
+
op = body.call(thisArg, _);
|
|
35
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
36
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
37
|
+
}
|
|
38
|
+
};
|
|
12
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
40
|
exports.deleteProfile = exports.postProfile = exports.postProfiles = exports.getProfileByUserId = exports.getProfileById = exports.getProfiles = void 0;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
41
|
+
var getProfiles = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
42
|
+
var profiles;
|
|
43
|
+
var prisma = _b.prisma;
|
|
44
|
+
return __generator(this, function (_c) {
|
|
45
|
+
switch (_c.label) {
|
|
46
|
+
case 0: return [4 /*yield*/, prisma.profile.findMany({
|
|
47
|
+
orderBy: {
|
|
48
|
+
createdAt: 'desc',
|
|
49
|
+
},
|
|
50
|
+
})];
|
|
51
|
+
case 1:
|
|
52
|
+
profiles = _c.sent();
|
|
53
|
+
return [2 /*return*/, profiles];
|
|
54
|
+
}
|
|
19
55
|
});
|
|
20
|
-
|
|
21
|
-
});
|
|
56
|
+
}); };
|
|
22
57
|
exports.getProfiles = getProfiles;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
58
|
+
var getProfileById = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
59
|
+
var profile;
|
|
60
|
+
var prisma = _b.prisma, id = _b.id;
|
|
61
|
+
return __generator(this, function (_c) {
|
|
62
|
+
switch (_c.label) {
|
|
63
|
+
case 0: return [4 /*yield*/, prisma.profile.findUnique({
|
|
64
|
+
where: {
|
|
65
|
+
id: id,
|
|
66
|
+
},
|
|
67
|
+
})];
|
|
68
|
+
case 1:
|
|
69
|
+
profile = _c.sent();
|
|
70
|
+
return [2 /*return*/, profile];
|
|
71
|
+
}
|
|
28
72
|
});
|
|
29
|
-
|
|
30
|
-
});
|
|
73
|
+
}); };
|
|
31
74
|
exports.getProfileById = getProfileById;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
75
|
+
var getProfileByUserId = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
76
|
+
var profile;
|
|
77
|
+
var prisma = _b.prisma, userId = _b.userId;
|
|
78
|
+
return __generator(this, function (_c) {
|
|
79
|
+
switch (_c.label) {
|
|
80
|
+
case 0: return [4 /*yield*/, prisma.profile.findFirst({
|
|
81
|
+
where: {
|
|
82
|
+
userId: userId,
|
|
83
|
+
},
|
|
84
|
+
})];
|
|
85
|
+
case 1:
|
|
86
|
+
profile = _c.sent();
|
|
87
|
+
return [2 /*return*/, profile];
|
|
88
|
+
}
|
|
37
89
|
});
|
|
38
|
-
|
|
39
|
-
});
|
|
90
|
+
}); };
|
|
40
91
|
exports.getProfileByUserId = getProfileByUserId;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
92
|
+
var postProfiles = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
93
|
+
var profiles;
|
|
94
|
+
var currentPage = _b.currentPage, pageLimit = _b.pageLimit, prisma = _b.prisma, queryWhere = _b.queryWhere;
|
|
95
|
+
return __generator(this, function (_c) {
|
|
96
|
+
switch (_c.label) {
|
|
97
|
+
case 0: return [4 /*yield*/, prisma.$transaction([
|
|
98
|
+
prisma.profile.count({
|
|
99
|
+
where: queryWhere,
|
|
100
|
+
}),
|
|
101
|
+
prisma.profile.findMany({
|
|
102
|
+
orderBy: {
|
|
103
|
+
createdAt: 'desc',
|
|
104
|
+
},
|
|
105
|
+
where: queryWhere,
|
|
106
|
+
take: pageLimit,
|
|
107
|
+
skip: (currentPage - 1) * pageLimit,
|
|
108
|
+
}),
|
|
109
|
+
])];
|
|
110
|
+
case 1:
|
|
111
|
+
profiles = _c.sent();
|
|
112
|
+
return [2 /*return*/, profiles];
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}); };
|
|
57
116
|
exports.postProfiles = postProfiles;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
117
|
+
var postProfile = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
118
|
+
var profile;
|
|
119
|
+
var avatar = _b.avatar, dob = _b.dob, email = _b.email, firstName = _b.firstName, gender = _b.gender, id = _b.id, language = _b.language, lastName = _b.lastName, location = _b.location, phone = _b.phone, prisma = _b.prisma, skill = _b.skill, userId = _b.userId;
|
|
120
|
+
return __generator(this, function (_c) {
|
|
121
|
+
switch (_c.label) {
|
|
122
|
+
case 0: return [4 /*yield*/, prisma.profile.upsert({
|
|
123
|
+
where: {
|
|
124
|
+
id: id,
|
|
125
|
+
},
|
|
126
|
+
update: {
|
|
127
|
+
avatar: avatar,
|
|
128
|
+
dob: dob,
|
|
129
|
+
email: email,
|
|
130
|
+
firstName: firstName,
|
|
131
|
+
gender: gender,
|
|
132
|
+
language: language,
|
|
133
|
+
lastName: lastName,
|
|
134
|
+
location: location,
|
|
135
|
+
phone: phone,
|
|
136
|
+
skill: skill,
|
|
137
|
+
userId: userId,
|
|
138
|
+
},
|
|
139
|
+
create: {
|
|
140
|
+
avatar: avatar,
|
|
141
|
+
dob: dob,
|
|
142
|
+
email: email,
|
|
143
|
+
firstName: firstName,
|
|
144
|
+
gender: gender,
|
|
145
|
+
language: language,
|
|
146
|
+
lastName: lastName,
|
|
147
|
+
location: location,
|
|
148
|
+
phone: phone,
|
|
149
|
+
skill: skill,
|
|
150
|
+
userId: userId,
|
|
151
|
+
},
|
|
152
|
+
})];
|
|
153
|
+
case 1:
|
|
154
|
+
profile = _c.sent();
|
|
155
|
+
return [2 /*return*/, profile];
|
|
156
|
+
}
|
|
89
157
|
});
|
|
90
|
-
|
|
91
|
-
});
|
|
158
|
+
}); };
|
|
92
159
|
exports.postProfile = postProfile;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
160
|
+
var deleteProfile = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
161
|
+
var profile;
|
|
162
|
+
var prisma = _b.prisma, id = _b.id;
|
|
163
|
+
return __generator(this, function (_c) {
|
|
164
|
+
switch (_c.label) {
|
|
165
|
+
case 0: return [4 /*yield*/, prisma.profile.delete({
|
|
166
|
+
where: {
|
|
167
|
+
id: id,
|
|
168
|
+
},
|
|
169
|
+
})];
|
|
170
|
+
case 1:
|
|
171
|
+
profile = _c.sent();
|
|
172
|
+
return [2 /*return*/, profile];
|
|
173
|
+
}
|
|
98
174
|
});
|
|
99
|
-
|
|
100
|
-
});
|
|
175
|
+
}); };
|
|
101
176
|
exports.deleteProfile = deleteProfile;
|