@tamu-dor/famis-db 3.0.0-beta.1 → 3.0.0-beta.3
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/{manifest.json → .vite/manifest.json} +2 -2
- package/dist/index.d.mts +70 -31
- package/dist/index.d.ts +70 -31
- package/dist/main.cjs +159 -60
- package/dist/main.cjs.map +1 -1
- package/dist/main.js +159 -60
- package/dist/main.js.map +1 -1
- package/package.json +10 -11
- package/readme.wiki +0 -332
package/dist/index.d.mts
CHANGED
|
@@ -67,21 +67,21 @@ export declare interface Contact {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
export declare interface Core {
|
|
70
|
-
id
|
|
71
|
-
account
|
|
72
|
-
effective
|
|
73
|
-
facility
|
|
70
|
+
id?: number;
|
|
71
|
+
account?: string;
|
|
72
|
+
effective?: string;
|
|
73
|
+
facility?: string;
|
|
74
74
|
contact: string;
|
|
75
75
|
contactEmail: string;
|
|
76
76
|
systemId: number;
|
|
77
77
|
enabled: boolean;
|
|
78
78
|
deleted: string | null;
|
|
79
|
-
coreEmail
|
|
79
|
+
coreEmail?: string | null;
|
|
80
80
|
corePhone: string | null;
|
|
81
81
|
coreAddress: string | null;
|
|
82
82
|
from_email: string | null;
|
|
83
83
|
invoice_email: string | null;
|
|
84
|
-
systemPart
|
|
84
|
+
systemPart?: SystemPart;
|
|
85
85
|
system_part?: string;
|
|
86
86
|
system_name?: string;
|
|
87
87
|
system_abbrev?: string;
|
|
@@ -90,17 +90,19 @@ export declare interface Core {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
export declare interface CoreAccount {
|
|
93
|
-
id
|
|
94
|
-
account
|
|
93
|
+
id?: number;
|
|
94
|
+
account?: string;
|
|
95
95
|
coreId: number;
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
coreAccountId?: number;
|
|
97
|
+
coreAccountActive?: boolean | null;
|
|
98
|
+
effective?: Date | null;
|
|
99
|
+
active?: boolean | null;
|
|
98
100
|
}
|
|
99
101
|
|
|
100
102
|
export declare interface CoreAccountEmail {
|
|
101
|
-
uid
|
|
102
|
-
core_id
|
|
103
|
-
account_number
|
|
103
|
+
uid?: string;
|
|
104
|
+
core_id?: number;
|
|
105
|
+
account_number?: string;
|
|
104
106
|
email: string;
|
|
105
107
|
created?: Date | null;
|
|
106
108
|
deleted?: Date | null;
|
|
@@ -113,8 +115,9 @@ export declare interface CorePayload {
|
|
|
113
115
|
|
|
114
116
|
export declare interface CoreUser {
|
|
115
117
|
id?: number;
|
|
116
|
-
userId
|
|
118
|
+
userId?: string;
|
|
117
119
|
coreId: number;
|
|
120
|
+
coreUserId?: number;
|
|
118
121
|
email?: boolean | null;
|
|
119
122
|
}
|
|
120
123
|
|
|
@@ -279,7 +282,14 @@ declare class FAMISDb {
|
|
|
279
282
|
private db;
|
|
280
283
|
private people;
|
|
281
284
|
constructor(config: any, people: any);
|
|
282
|
-
|
|
285
|
+
/**
|
|
286
|
+
* Initializes the database connection and sets up the Knex instance for interacting with PostgreSQL database.
|
|
287
|
+
*
|
|
288
|
+
* @param {any} config - The configuration object that includes details about how to connect to a PostgreSQL database. This should include properties such as `host`, `user`, `password`, etc.
|
|
289
|
+
* @param {any} people - The data related to the 'people' entity. It could be an array of person objects or any other format depending on your application requirements.
|
|
290
|
+
* @param {boolean} debug - A flag indicating whether to enable debugging for Knex queries. Defaults to `false`. If set to `true`, it will log all SQL queries that are executed against the database in the console.
|
|
291
|
+
*/
|
|
292
|
+
init(config: any, people?: any, debug?: boolean): void;
|
|
283
293
|
/**
|
|
284
294
|
*
|
|
285
295
|
* Extract customer account and po number
|
|
@@ -673,7 +683,7 @@ declare class FAMISDb {
|
|
|
673
683
|
* @returns {Promise<Core>} core object
|
|
674
684
|
* @memberof FAMISDb
|
|
675
685
|
*/
|
|
676
|
-
updateCore(core: Core): Promise<Core>;
|
|
686
|
+
updateCore(core: Core): Promise<Core | undefined>;
|
|
677
687
|
/**
|
|
678
688
|
*
|
|
679
689
|
* Add core
|
|
@@ -698,6 +708,14 @@ declare class FAMISDb {
|
|
|
698
708
|
* @memberof FAMISDb
|
|
699
709
|
*/
|
|
700
710
|
addCoreAccount(account: CoreAccount): Promise<CoreAccount>;
|
|
711
|
+
/**
|
|
712
|
+
*
|
|
713
|
+
* Delete core account
|
|
714
|
+
* @param {coreAccountId} string core account id
|
|
715
|
+
* @returns {Promise<CoreAccount>} core account object
|
|
716
|
+
* @memberof FAMISDb
|
|
717
|
+
*/
|
|
718
|
+
deleteCoreAccount(coreAccountId: string): Promise<CoreAccount>;
|
|
701
719
|
/**
|
|
702
720
|
*
|
|
703
721
|
* Get system part by ID
|
|
@@ -749,15 +767,21 @@ declare class FAMISDb {
|
|
|
749
767
|
* @memberof FAMISDb
|
|
750
768
|
*/
|
|
751
769
|
updateCoreUser(user: CoreUser): Promise<CoreUser>;
|
|
770
|
+
/**
|
|
771
|
+
* This function adds a new CoreUser to the database. If the user already exists, it updates the existing record.
|
|
772
|
+
* @param {CoreUser} coreUser - The CoreUser object containing details about the user.
|
|
773
|
+
* @param {User} [user] - An optional User object that could contain additional details.
|
|
774
|
+
* @return {Promise<CoreUser>} A Promise that resolves to the newly added or updated CoreUser, if successfully added and returned from the database; otherwise it rejects with an error.
|
|
775
|
+
*/
|
|
776
|
+
addCoreUser(coreUser: CoreUser, user?: User): Promise<CoreUser>;
|
|
752
777
|
/**
|
|
753
778
|
*
|
|
754
|
-
*
|
|
755
|
-
* @param {
|
|
756
|
-
* @param {User} user user object
|
|
779
|
+
* Delete core user
|
|
780
|
+
* @param {coreUserId} string core user object
|
|
757
781
|
* @returns {Promise<CoreUser>} core user object
|
|
758
782
|
* @memberof FAMISDb
|
|
759
783
|
*/
|
|
760
|
-
|
|
784
|
+
deleteCoreUser(coreUserId: string): Promise<CoreUser>;
|
|
761
785
|
/**
|
|
762
786
|
*
|
|
763
787
|
* Get a user's cores they manage
|
|
@@ -901,6 +925,13 @@ declare class FAMISDb {
|
|
|
901
925
|
* @property {date} created - created date
|
|
902
926
|
* @property {date} deleted - deleted date
|
|
903
927
|
*/
|
|
928
|
+
/**
|
|
929
|
+
* Create an invoice comment file.
|
|
930
|
+
* @param {InvoiceCommentFile} file - JSON object representing the comment file
|
|
931
|
+
* @returns {Promise<InvoiceCommentFile>} - Promise that resolves to the comment file object
|
|
932
|
+
* @memberof FAMISDb
|
|
933
|
+
*/
|
|
934
|
+
saveCommentFile(file: InvoiceCommentFile): Promise<InvoiceCommentFile | null>;
|
|
904
935
|
/**
|
|
905
936
|
* Get invoice comment files.
|
|
906
937
|
* @param {string} commentUid - Comment UID
|
|
@@ -948,21 +979,28 @@ declare class FAMISDb {
|
|
|
948
979
|
*/
|
|
949
980
|
getCoreAccountAdditionalEmailsByAccount(accountNumber: string): Promise<CoreAccountEmail[] | []>;
|
|
950
981
|
/**
|
|
951
|
-
*
|
|
952
|
-
*
|
|
982
|
+
* Get additional delivery emails to expense accounts for a core by core id
|
|
983
|
+
* and account number
|
|
953
984
|
* @param {number} coreId - Core ID
|
|
954
|
-
* @param {string}
|
|
985
|
+
* @param {string} account - account number
|
|
986
|
+
* @returns {Promise<CoreAccountEmail[]|[]>} - Promise that resolves to an account object
|
|
987
|
+
* @memberof FAMISDb
|
|
988
|
+
*/
|
|
989
|
+
getCoreAccountAdditionalEmailsByCoreIdAccount(coreId: number, account: string): Promise<CoreAccountEmail[] | []>;
|
|
990
|
+
/**
|
|
991
|
+
* Add an additional delivery email to an expense account for a core
|
|
992
|
+
* @param {CoreAccountEmail} record - core account email delivery record
|
|
955
993
|
* @returns {Promise<CoreAccountEmail>} - Promise that resolves to an account object
|
|
956
994
|
* @memberof FAMISDb
|
|
957
995
|
*/
|
|
958
|
-
|
|
996
|
+
addCoreAccountAdditionalEmail(record: CoreAccountEmail): Promise<CoreAccountEmail | null>;
|
|
959
997
|
/**
|
|
960
998
|
* Remove an additional delivery email to an expense account for a core
|
|
961
999
|
* @param {string} uid - uid for core account email record
|
|
962
1000
|
* @returns {Promise<CoreAccountEmail>} - Promise that resolves to an account object
|
|
963
1001
|
* @memberof FAMISDb
|
|
964
1002
|
*/
|
|
965
|
-
|
|
1003
|
+
removeCoreAccountAdditionalEmail(uid: string): Promise<CoreAccountEmail | null>;
|
|
966
1004
|
}
|
|
967
1005
|
export default FAMISDb;
|
|
968
1006
|
|
|
@@ -1022,9 +1060,9 @@ declare class FAMISDb {
|
|
|
1022
1060
|
|
|
1023
1061
|
export declare interface InvoiceComment {
|
|
1024
1062
|
id?: number;
|
|
1025
|
-
uid
|
|
1063
|
+
uid?: string;
|
|
1026
1064
|
invoice_id: string;
|
|
1027
|
-
user_id
|
|
1065
|
+
user_id?: string | null;
|
|
1028
1066
|
comment: string | null;
|
|
1029
1067
|
type: string | null;
|
|
1030
1068
|
created: string | null;
|
|
@@ -1032,7 +1070,7 @@ declare class FAMISDb {
|
|
|
1032
1070
|
}
|
|
1033
1071
|
|
|
1034
1072
|
export declare type InvoiceCommentFile = {
|
|
1035
|
-
id
|
|
1073
|
+
id?: number;
|
|
1036
1074
|
uid: string;
|
|
1037
1075
|
invoice_id: string;
|
|
1038
1076
|
comment_id: string;
|
|
@@ -1102,9 +1140,9 @@ declare class FAMISDb {
|
|
|
1102
1140
|
fein: string;
|
|
1103
1141
|
agency: string;
|
|
1104
1142
|
checkAddress: string;
|
|
1105
|
-
credit
|
|
1106
|
-
creditUrl
|
|
1107
|
-
creditFee
|
|
1143
|
+
credit?: boolean | null;
|
|
1144
|
+
creditUrl?: string | null;
|
|
1145
|
+
creditFee?: string | null;
|
|
1108
1146
|
part: string;
|
|
1109
1147
|
abbrev: string;
|
|
1110
1148
|
aggiebuy: string;
|
|
@@ -1133,6 +1171,7 @@ declare class FAMISDb {
|
|
|
1133
1171
|
usersSystemId?: number | null;
|
|
1134
1172
|
systemId?: number | null;
|
|
1135
1173
|
coreId?: number | null;
|
|
1174
|
+
coreUserId?: number | null;
|
|
1136
1175
|
cores?: CorePayload | null;
|
|
1137
1176
|
systems?: SystemPart[] | [] | null;
|
|
1138
1177
|
deleted?: Date | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -67,21 +67,21 @@ export declare interface Contact {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
export declare interface Core {
|
|
70
|
-
id
|
|
71
|
-
account
|
|
72
|
-
effective
|
|
73
|
-
facility
|
|
70
|
+
id?: number;
|
|
71
|
+
account?: string;
|
|
72
|
+
effective?: string;
|
|
73
|
+
facility?: string;
|
|
74
74
|
contact: string;
|
|
75
75
|
contactEmail: string;
|
|
76
76
|
systemId: number;
|
|
77
77
|
enabled: boolean;
|
|
78
78
|
deleted: string | null;
|
|
79
|
-
coreEmail
|
|
79
|
+
coreEmail?: string | null;
|
|
80
80
|
corePhone: string | null;
|
|
81
81
|
coreAddress: string | null;
|
|
82
82
|
from_email: string | null;
|
|
83
83
|
invoice_email: string | null;
|
|
84
|
-
systemPart
|
|
84
|
+
systemPart?: SystemPart;
|
|
85
85
|
system_part?: string;
|
|
86
86
|
system_name?: string;
|
|
87
87
|
system_abbrev?: string;
|
|
@@ -90,17 +90,19 @@ export declare interface Core {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
export declare interface CoreAccount {
|
|
93
|
-
id
|
|
94
|
-
account
|
|
93
|
+
id?: number;
|
|
94
|
+
account?: string;
|
|
95
95
|
coreId: number;
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
coreAccountId?: number;
|
|
97
|
+
coreAccountActive?: boolean | null;
|
|
98
|
+
effective?: Date | null;
|
|
99
|
+
active?: boolean | null;
|
|
98
100
|
}
|
|
99
101
|
|
|
100
102
|
export declare interface CoreAccountEmail {
|
|
101
|
-
uid
|
|
102
|
-
core_id
|
|
103
|
-
account_number
|
|
103
|
+
uid?: string;
|
|
104
|
+
core_id?: number;
|
|
105
|
+
account_number?: string;
|
|
104
106
|
email: string;
|
|
105
107
|
created?: Date | null;
|
|
106
108
|
deleted?: Date | null;
|
|
@@ -113,8 +115,9 @@ export declare interface CorePayload {
|
|
|
113
115
|
|
|
114
116
|
export declare interface CoreUser {
|
|
115
117
|
id?: number;
|
|
116
|
-
userId
|
|
118
|
+
userId?: string;
|
|
117
119
|
coreId: number;
|
|
120
|
+
coreUserId?: number;
|
|
118
121
|
email?: boolean | null;
|
|
119
122
|
}
|
|
120
123
|
|
|
@@ -279,7 +282,14 @@ declare class FAMISDb {
|
|
|
279
282
|
private db;
|
|
280
283
|
private people;
|
|
281
284
|
constructor(config: any, people: any);
|
|
282
|
-
|
|
285
|
+
/**
|
|
286
|
+
* Initializes the database connection and sets up the Knex instance for interacting with PostgreSQL database.
|
|
287
|
+
*
|
|
288
|
+
* @param {any} config - The configuration object that includes details about how to connect to a PostgreSQL database. This should include properties such as `host`, `user`, `password`, etc.
|
|
289
|
+
* @param {any} people - The data related to the 'people' entity. It could be an array of person objects or any other format depending on your application requirements.
|
|
290
|
+
* @param {boolean} debug - A flag indicating whether to enable debugging for Knex queries. Defaults to `false`. If set to `true`, it will log all SQL queries that are executed against the database in the console.
|
|
291
|
+
*/
|
|
292
|
+
init(config: any, people?: any, debug?: boolean): void;
|
|
283
293
|
/**
|
|
284
294
|
*
|
|
285
295
|
* Extract customer account and po number
|
|
@@ -673,7 +683,7 @@ declare class FAMISDb {
|
|
|
673
683
|
* @returns {Promise<Core>} core object
|
|
674
684
|
* @memberof FAMISDb
|
|
675
685
|
*/
|
|
676
|
-
updateCore(core: Core): Promise<Core>;
|
|
686
|
+
updateCore(core: Core): Promise<Core | undefined>;
|
|
677
687
|
/**
|
|
678
688
|
*
|
|
679
689
|
* Add core
|
|
@@ -698,6 +708,14 @@ declare class FAMISDb {
|
|
|
698
708
|
* @memberof FAMISDb
|
|
699
709
|
*/
|
|
700
710
|
addCoreAccount(account: CoreAccount): Promise<CoreAccount>;
|
|
711
|
+
/**
|
|
712
|
+
*
|
|
713
|
+
* Delete core account
|
|
714
|
+
* @param {coreAccountId} string core account id
|
|
715
|
+
* @returns {Promise<CoreAccount>} core account object
|
|
716
|
+
* @memberof FAMISDb
|
|
717
|
+
*/
|
|
718
|
+
deleteCoreAccount(coreAccountId: string): Promise<CoreAccount>;
|
|
701
719
|
/**
|
|
702
720
|
*
|
|
703
721
|
* Get system part by ID
|
|
@@ -749,15 +767,21 @@ declare class FAMISDb {
|
|
|
749
767
|
* @memberof FAMISDb
|
|
750
768
|
*/
|
|
751
769
|
updateCoreUser(user: CoreUser): Promise<CoreUser>;
|
|
770
|
+
/**
|
|
771
|
+
* This function adds a new CoreUser to the database. If the user already exists, it updates the existing record.
|
|
772
|
+
* @param {CoreUser} coreUser - The CoreUser object containing details about the user.
|
|
773
|
+
* @param {User} [user] - An optional User object that could contain additional details.
|
|
774
|
+
* @return {Promise<CoreUser>} A Promise that resolves to the newly added or updated CoreUser, if successfully added and returned from the database; otherwise it rejects with an error.
|
|
775
|
+
*/
|
|
776
|
+
addCoreUser(coreUser: CoreUser, user?: User): Promise<CoreUser>;
|
|
752
777
|
/**
|
|
753
778
|
*
|
|
754
|
-
*
|
|
755
|
-
* @param {
|
|
756
|
-
* @param {User} user user object
|
|
779
|
+
* Delete core user
|
|
780
|
+
* @param {coreUserId} string core user object
|
|
757
781
|
* @returns {Promise<CoreUser>} core user object
|
|
758
782
|
* @memberof FAMISDb
|
|
759
783
|
*/
|
|
760
|
-
|
|
784
|
+
deleteCoreUser(coreUserId: string): Promise<CoreUser>;
|
|
761
785
|
/**
|
|
762
786
|
*
|
|
763
787
|
* Get a user's cores they manage
|
|
@@ -901,6 +925,13 @@ declare class FAMISDb {
|
|
|
901
925
|
* @property {date} created - created date
|
|
902
926
|
* @property {date} deleted - deleted date
|
|
903
927
|
*/
|
|
928
|
+
/**
|
|
929
|
+
* Create an invoice comment file.
|
|
930
|
+
* @param {InvoiceCommentFile} file - JSON object representing the comment file
|
|
931
|
+
* @returns {Promise<InvoiceCommentFile>} - Promise that resolves to the comment file object
|
|
932
|
+
* @memberof FAMISDb
|
|
933
|
+
*/
|
|
934
|
+
saveCommentFile(file: InvoiceCommentFile): Promise<InvoiceCommentFile | null>;
|
|
904
935
|
/**
|
|
905
936
|
* Get invoice comment files.
|
|
906
937
|
* @param {string} commentUid - Comment UID
|
|
@@ -948,21 +979,28 @@ declare class FAMISDb {
|
|
|
948
979
|
*/
|
|
949
980
|
getCoreAccountAdditionalEmailsByAccount(accountNumber: string): Promise<CoreAccountEmail[] | []>;
|
|
950
981
|
/**
|
|
951
|
-
*
|
|
952
|
-
*
|
|
982
|
+
* Get additional delivery emails to expense accounts for a core by core id
|
|
983
|
+
* and account number
|
|
953
984
|
* @param {number} coreId - Core ID
|
|
954
|
-
* @param {string}
|
|
985
|
+
* @param {string} account - account number
|
|
986
|
+
* @returns {Promise<CoreAccountEmail[]|[]>} - Promise that resolves to an account object
|
|
987
|
+
* @memberof FAMISDb
|
|
988
|
+
*/
|
|
989
|
+
getCoreAccountAdditionalEmailsByCoreIdAccount(coreId: number, account: string): Promise<CoreAccountEmail[] | []>;
|
|
990
|
+
/**
|
|
991
|
+
* Add an additional delivery email to an expense account for a core
|
|
992
|
+
* @param {CoreAccountEmail} record - core account email delivery record
|
|
955
993
|
* @returns {Promise<CoreAccountEmail>} - Promise that resolves to an account object
|
|
956
994
|
* @memberof FAMISDb
|
|
957
995
|
*/
|
|
958
|
-
|
|
996
|
+
addCoreAccountAdditionalEmail(record: CoreAccountEmail): Promise<CoreAccountEmail | null>;
|
|
959
997
|
/**
|
|
960
998
|
* Remove an additional delivery email to an expense account for a core
|
|
961
999
|
* @param {string} uid - uid for core account email record
|
|
962
1000
|
* @returns {Promise<CoreAccountEmail>} - Promise that resolves to an account object
|
|
963
1001
|
* @memberof FAMISDb
|
|
964
1002
|
*/
|
|
965
|
-
|
|
1003
|
+
removeCoreAccountAdditionalEmail(uid: string): Promise<CoreAccountEmail | null>;
|
|
966
1004
|
}
|
|
967
1005
|
export default FAMISDb;
|
|
968
1006
|
|
|
@@ -1022,9 +1060,9 @@ declare class FAMISDb {
|
|
|
1022
1060
|
|
|
1023
1061
|
export declare interface InvoiceComment {
|
|
1024
1062
|
id?: number;
|
|
1025
|
-
uid
|
|
1063
|
+
uid?: string;
|
|
1026
1064
|
invoice_id: string;
|
|
1027
|
-
user_id
|
|
1065
|
+
user_id?: string | null;
|
|
1028
1066
|
comment: string | null;
|
|
1029
1067
|
type: string | null;
|
|
1030
1068
|
created: string | null;
|
|
@@ -1032,7 +1070,7 @@ declare class FAMISDb {
|
|
|
1032
1070
|
}
|
|
1033
1071
|
|
|
1034
1072
|
export declare type InvoiceCommentFile = {
|
|
1035
|
-
id
|
|
1073
|
+
id?: number;
|
|
1036
1074
|
uid: string;
|
|
1037
1075
|
invoice_id: string;
|
|
1038
1076
|
comment_id: string;
|
|
@@ -1102,9 +1140,9 @@ declare class FAMISDb {
|
|
|
1102
1140
|
fein: string;
|
|
1103
1141
|
agency: string;
|
|
1104
1142
|
checkAddress: string;
|
|
1105
|
-
credit
|
|
1106
|
-
creditUrl
|
|
1107
|
-
creditFee
|
|
1143
|
+
credit?: boolean | null;
|
|
1144
|
+
creditUrl?: string | null;
|
|
1145
|
+
creditFee?: string | null;
|
|
1108
1146
|
part: string;
|
|
1109
1147
|
abbrev: string;
|
|
1110
1148
|
aggiebuy: string;
|
|
@@ -1133,6 +1171,7 @@ declare class FAMISDb {
|
|
|
1133
1171
|
usersSystemId?: number | null;
|
|
1134
1172
|
systemId?: number | null;
|
|
1135
1173
|
coreId?: number | null;
|
|
1174
|
+
coreUserId?: number | null;
|
|
1136
1175
|
cores?: CorePayload | null;
|
|
1137
1176
|
systems?: SystemPart[] | [] | null;
|
|
1138
1177
|
deleted?: Date | null;
|