@react-pakistan/util-functions 1.22.35 → 1.22.36

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.
@@ -0,0 +1,31 @@
1
+ interface AppUserBE {
2
+ createdAt: string;
3
+ email: string;
4
+ firstName: string;
5
+ id: string;
6
+ lastName: string;
7
+ updatedAt: string;
8
+ }
9
+ interface GetAppUsersArgs {
10
+ prisma: any;
11
+ }
12
+ interface GetAppUserByIdArgs {
13
+ id: string;
14
+ prisma: any;
15
+ }
16
+ interface PostAppUserArgs {
17
+ prisma: any;
18
+ id: string;
19
+ email: string;
20
+ firstName: string;
21
+ lastName: string;
22
+ }
23
+ interface DeleteAppUserArgs {
24
+ prisma: any;
25
+ id: string;
26
+ }
27
+ export declare const getAppUsers: ({ prisma }: GetAppUsersArgs) => Promise<Array<AppUserBE>>;
28
+ export declare const getAppUserById: ({ prisma, id }: GetAppUserByIdArgs) => Promise<AppUserBE>;
29
+ export declare const postAppUser: ({ prisma, id, email, firstName, lastName, }: PostAppUserArgs) => Promise<Array<AppUserBE>>;
30
+ export declare const deleteAppUser: ({ prisma, id }: DeleteAppUserArgs) => Promise<AppUserBE>;
31
+ export {};
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
+ return new (P || (P = Promise))(function (resolve, reject) {
6
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
10
+ });
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.deleteAppUser = exports.postAppUser = exports.getAppUserById = exports.getAppUsers = void 0;
14
+ const getAppUsers = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma }) {
15
+ const appUsers = yield prisma.stellarAppUser.findMany({
16
+ orderBy: {
17
+ createdAt: 'desc',
18
+ },
19
+ });
20
+ return appUsers;
21
+ });
22
+ exports.getAppUsers = getAppUsers;
23
+ const getAppUserById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ prisma, id }) {
24
+ const appUser = yield prisma.stellarAppUser.findUnique({
25
+ where: {
26
+ id,
27
+ },
28
+ });
29
+ return appUser;
30
+ });
31
+ exports.getAppUserById = getAppUserById;
32
+ const postAppUser = (_c) => __awaiter(void 0, [_c], void 0, function* ({ prisma, id, email, firstName, lastName, }) {
33
+ const appUser = yield prisma.stellarAppUser.upsert({
34
+ where: {
35
+ id,
36
+ },
37
+ update: {
38
+ email,
39
+ firstName,
40
+ lastName,
41
+ },
42
+ create: {
43
+ email,
44
+ firstName,
45
+ lastName,
46
+ },
47
+ });
48
+ return appUser;
49
+ });
50
+ exports.postAppUser = postAppUser;
51
+ const deleteAppUser = (_d) => __awaiter(void 0, [_d], void 0, function* ({ prisma, id }) {
52
+ const appUser = yield prisma.stellarAppUser.delete({
53
+ where: {
54
+ id,
55
+ },
56
+ });
57
+ return appUser;
58
+ });
59
+ exports.deleteAppUser = deleteAppUser;
@@ -0,0 +1,41 @@
1
+ interface BankingDetailBE {
2
+ accountNumber: string;
3
+ accountTitle: string;
4
+ bankAddress: string;
5
+ bankName: string;
6
+ createdAt: string;
7
+ enabled: boolean;
8
+ iban: string;
9
+ id: string;
10
+ swiftCode: string;
11
+ updatedAt: string;
12
+ }
13
+ interface GetBankingDetailsArgs {
14
+ prisma: any;
15
+ }
16
+ interface GetBankingDetailByIdArgs {
17
+ id: string;
18
+ prisma: any;
19
+ }
20
+ interface PostBankingDetailArgs {
21
+ accountNumber: string;
22
+ accountTitle: string;
23
+ bankAddress: string;
24
+ bankName: string;
25
+ createdAt: string;
26
+ enabled: boolean;
27
+ iban: string;
28
+ id: string;
29
+ preferenceId: string;
30
+ prisma: any;
31
+ swiftCode: string;
32
+ }
33
+ interface DeleteBankingDetailArgs {
34
+ id: string;
35
+ prisma: any;
36
+ }
37
+ export declare const getBankingDetails: ({ prisma }: GetBankingDetailsArgs) => Promise<Array<BankingDetailBE>>;
38
+ export declare const getBankingDetailById: ({ prisma, id }: GetBankingDetailByIdArgs) => Promise<BankingDetailBE>;
39
+ export declare const postBankingDetail: ({ prisma, accountNumber, accountTitle, bankAddress, bankName, enabled, iban, id, preferenceId, swiftCode, }: PostBankingDetailArgs) => Promise<Array<BankingDetailBE>>;
40
+ export declare const deleteBankingDetail: ({ prisma, id, }: DeleteBankingDetailArgs) => Promise<BankingDetailBE>;
41
+ export {};
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
+ return new (P || (P = Promise))(function (resolve, reject) {
6
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
10
+ });
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.deleteBankingDetail = exports.postBankingDetail = exports.getBankingDetailById = exports.getBankingDetails = void 0;
14
+ const getBankingDetails = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma }) {
15
+ const bankingDetails = yield prisma.stellarBankingDetail.findMany({
16
+ orderBy: {
17
+ createdAt: 'desc',
18
+ },
19
+ });
20
+ return bankingDetails;
21
+ });
22
+ exports.getBankingDetails = getBankingDetails;
23
+ const getBankingDetailById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ prisma, id }) {
24
+ const bankingDetail = yield prisma.stellarBankingDetail.findUnique({
25
+ where: {
26
+ id,
27
+ },
28
+ });
29
+ return bankingDetail;
30
+ });
31
+ exports.getBankingDetailById = getBankingDetailById;
32
+ const postBankingDetail = (_c) => __awaiter(void 0, [_c], void 0, function* ({ prisma, accountNumber, accountTitle, bankAddress, bankName, enabled, iban, id, preferenceId, swiftCode, }) {
33
+ const bankingDetail = yield prisma.stellarBankingDetail.upsert({
34
+ where: {
35
+ id,
36
+ },
37
+ update: {
38
+ accountNumber,
39
+ accountTitle,
40
+ bankAddress,
41
+ bankName,
42
+ enabled,
43
+ iban,
44
+ preferenceId,
45
+ swiftCode,
46
+ },
47
+ create: {
48
+ accountNumber,
49
+ accountTitle,
50
+ bankAddress,
51
+ bankName,
52
+ enabled,
53
+ iban,
54
+ preferenceId,
55
+ swiftCode,
56
+ },
57
+ });
58
+ return bankingDetail;
59
+ });
60
+ exports.postBankingDetail = postBankingDetail;
61
+ const deleteBankingDetail = (_d) => __awaiter(void 0, [_d], void 0, function* ({ prisma, id, }) {
62
+ const bankingDetail = yield prisma.stellarBankingDetail.delete({
63
+ where: {
64
+ id,
65
+ },
66
+ });
67
+ return bankingDetail;
68
+ });
69
+ exports.deleteBankingDetail = deleteBankingDetail;
package/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ export * from './api/stellar-solutions/app-user';
2
+ export * from './api/stellar-solutions/banking-detail';
1
3
  export * from './api/stellar-solutions/customer';
2
4
  export * from './api/cors';
3
5
  export * from './constants';
package/index.js CHANGED
@@ -14,6 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./api/stellar-solutions/app-user"), exports);
18
+ __exportStar(require("./api/stellar-solutions/banking-detail"), exports);
17
19
  __exportStar(require("./api/stellar-solutions/customer"), exports);
18
20
  __exportStar(require("./api/cors"), exports);
19
21
  __exportStar(require("./constants"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-pakistan/util-functions",
3
- "version": "1.22.35",
3
+ "version": "1.22.36",
4
4
  "description": "A library of all util functions",
5
5
  "main": "index.js",
6
6
  "scripts": {