@tamu-dor/famis-db 3.0.0-beta.3 → 3.0.0

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.
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "src/index.ts": {
3
3
  "file": "main.cjs",
4
+ "name": "index",
4
5
  "src": "src/index.ts",
5
6
  "isEntry": true
6
7
  }
package/dist/index.d.mts CHANGED
@@ -51,19 +51,19 @@ export declare interface AccountPayload {
51
51
  }
52
52
 
53
53
  export declare interface Contact {
54
- fax: string | null;
55
- city: string | null;
56
- name: string;
57
- email: string | null;
58
- phone: string | null;
59
- state: string | null;
60
- country: string | null;
61
- address1: string | null;
62
- address2: string | null;
63
- mailstop: string | null;
64
- department: string | null;
65
- postalCode: string | null;
66
- institution: string | null;
54
+ fax?: string | null;
55
+ city?: string | null;
56
+ name?: string;
57
+ email?: string | null;
58
+ phone?: string | null;
59
+ state?: string | null;
60
+ country?: string | null;
61
+ address1?: string | null;
62
+ address2?: string | null;
63
+ mailstop?: string | null;
64
+ department?: string | null;
65
+ postalCode?: string | null;
66
+ institution?: string | null;
67
67
  }
68
68
 
69
69
  export declare interface Core {
@@ -281,7 +281,7 @@ export declare interface Edge {
281
281
  declare class FAMISDb {
282
282
  private db;
283
283
  private people;
284
- constructor(config: any, people: any);
284
+ constructor(config: any, people: any, debug: boolean);
285
285
  /**
286
286
  * Initializes the database connection and sets up the Knex instance for interacting with PostgreSQL database.
287
287
  *
@@ -479,11 +479,11 @@ declare class FAMISDb {
479
479
  *
480
480
  * Updates an invoice
481
481
  * @param {string} uid
482
- * @param {object} invoice
483
- * @returns {Promise<object>} invoice object
482
+ * @param {Invoice} invoice
483
+ * @returns {Promise<Invoice>} invoice object
484
484
  * @memberof FAMISDb
485
485
  */
486
- updateInvoice(uid: string, invoice: any): Promise<any>;
486
+ updateInvoice(uid: string, invoice: Invoice): Promise<InvoicePayload>;
487
487
  /**
488
488
  *
489
489
  * Toggles an invoice as paid
@@ -646,10 +646,11 @@ declare class FAMISDb {
646
646
  * @param {string} [sortDirection='asc']
647
647
  * @param {integer} page - page of results to return
648
648
  * @param {integer} perPage - number of results per page to return
649
+ * @param {string[]} excludeFields - fields to exclude from results
649
650
  * @returns {Promise<CorePayload>} core objects
650
651
  * @memberof FAMISDb
651
652
  */
652
- queryCores(query: string, sortColumn?: string, sortDirection?: SortDirection | string, page?: number, perPage?: number): Promise<CorePayload>;
653
+ queryCores(query: string, sortColumn?: string, sortDirection?: SortDirection | string, page?: number, perPage?: number, excludeFields?: string[]): Promise<CorePayload>;
653
654
  /**
654
655
  *
655
656
  * Get core by specified attribute and search term
@@ -770,10 +771,9 @@ declare class FAMISDb {
770
771
  /**
771
772
  * This function adds a new CoreUser to the database. If the user already exists, it updates the existing record.
772
773
  * @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
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
775
  */
776
- addCoreUser(coreUser: CoreUser, user?: User): Promise<CoreUser>;
776
+ addCoreUser(coreUser: CoreUser): Promise<CoreUser>;
777
777
  /**
778
778
  *
779
779
  * Delete core user
@@ -1033,11 +1033,11 @@ declare class FAMISDb {
1033
1033
  }
1034
1034
 
1035
1035
  export declare interface Invoice {
1036
- uid: string;
1037
- number: string;
1038
- lab: string;
1039
- totalAmount: string;
1040
- date: string;
1036
+ uid?: string | null;
1037
+ number?: string | null;
1038
+ lab?: string | null;
1039
+ totalAmount?: string;
1040
+ date?: string;
1041
1041
  data: TransactionData;
1042
1042
  invoiced: boolean;
1043
1043
  type: string;
@@ -1048,14 +1048,14 @@ declare class FAMISDb {
1048
1048
  postedDate: string | null;
1049
1049
  emailed: boolean;
1050
1050
  replace_data?: object | null;
1051
- fingerprint: string;
1052
- core: Core;
1053
- customerAccountInfo: CustomerAccountInfo;
1054
- isIdt: boolean;
1055
- poNumber: string | null;
1056
- pi: PI;
1057
- highRiskInfo: HighRiskInfo;
1058
- comments: InvoiceComment[];
1051
+ fingerprint?: string | null;
1052
+ core?: Core | null;
1053
+ customerAccountInfo?: CustomerAccountInfo | null;
1054
+ isIdt?: boolean | null;
1055
+ poNumber?: string | null;
1056
+ pi?: PI | null;
1057
+ highRiskInfo?: HighRiskInfo | null;
1058
+ comments?: InvoiceComment[] | null;
1059
1059
  }
1060
1060
 
1061
1061
  export declare interface InvoiceComment {
@@ -1131,7 +1131,7 @@ declare class FAMISDb {
1131
1131
  tamuManualAddRDN: string | null;
1132
1132
  }
1133
1133
 
1134
- export declare type SortDirection = 'asc' | 'desc';
1134
+ export declare type SortDirection = "asc" | "desc";
1135
1135
 
1136
1136
  export declare interface SystemPart {
1137
1137
  id: number;
package/dist/index.d.ts CHANGED
@@ -51,19 +51,19 @@ export declare interface AccountPayload {
51
51
  }
52
52
 
53
53
  export declare interface Contact {
54
- fax: string | null;
55
- city: string | null;
56
- name: string;
57
- email: string | null;
58
- phone: string | null;
59
- state: string | null;
60
- country: string | null;
61
- address1: string | null;
62
- address2: string | null;
63
- mailstop: string | null;
64
- department: string | null;
65
- postalCode: string | null;
66
- institution: string | null;
54
+ fax?: string | null;
55
+ city?: string | null;
56
+ name?: string;
57
+ email?: string | null;
58
+ phone?: string | null;
59
+ state?: string | null;
60
+ country?: string | null;
61
+ address1?: string | null;
62
+ address2?: string | null;
63
+ mailstop?: string | null;
64
+ department?: string | null;
65
+ postalCode?: string | null;
66
+ institution?: string | null;
67
67
  }
68
68
 
69
69
  export declare interface Core {
@@ -281,7 +281,7 @@ export declare interface Edge {
281
281
  declare class FAMISDb {
282
282
  private db;
283
283
  private people;
284
- constructor(config: any, people: any);
284
+ constructor(config: any, people: any, debug: boolean);
285
285
  /**
286
286
  * Initializes the database connection and sets up the Knex instance for interacting with PostgreSQL database.
287
287
  *
@@ -479,11 +479,11 @@ declare class FAMISDb {
479
479
  *
480
480
  * Updates an invoice
481
481
  * @param {string} uid
482
- * @param {object} invoice
483
- * @returns {Promise<object>} invoice object
482
+ * @param {Invoice} invoice
483
+ * @returns {Promise<Invoice>} invoice object
484
484
  * @memberof FAMISDb
485
485
  */
486
- updateInvoice(uid: string, invoice: any): Promise<any>;
486
+ updateInvoice(uid: string, invoice: Invoice): Promise<InvoicePayload>;
487
487
  /**
488
488
  *
489
489
  * Toggles an invoice as paid
@@ -646,10 +646,11 @@ declare class FAMISDb {
646
646
  * @param {string} [sortDirection='asc']
647
647
  * @param {integer} page - page of results to return
648
648
  * @param {integer} perPage - number of results per page to return
649
+ * @param {string[]} excludeFields - fields to exclude from results
649
650
  * @returns {Promise<CorePayload>} core objects
650
651
  * @memberof FAMISDb
651
652
  */
652
- queryCores(query: string, sortColumn?: string, sortDirection?: SortDirection | string, page?: number, perPage?: number): Promise<CorePayload>;
653
+ queryCores(query: string, sortColumn?: string, sortDirection?: SortDirection | string, page?: number, perPage?: number, excludeFields?: string[]): Promise<CorePayload>;
653
654
  /**
654
655
  *
655
656
  * Get core by specified attribute and search term
@@ -770,10 +771,9 @@ declare class FAMISDb {
770
771
  /**
771
772
  * This function adds a new CoreUser to the database. If the user already exists, it updates the existing record.
772
773
  * @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
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
775
  */
776
- addCoreUser(coreUser: CoreUser, user?: User): Promise<CoreUser>;
776
+ addCoreUser(coreUser: CoreUser): Promise<CoreUser>;
777
777
  /**
778
778
  *
779
779
  * Delete core user
@@ -1033,11 +1033,11 @@ declare class FAMISDb {
1033
1033
  }
1034
1034
 
1035
1035
  export declare interface Invoice {
1036
- uid: string;
1037
- number: string;
1038
- lab: string;
1039
- totalAmount: string;
1040
- date: string;
1036
+ uid?: string | null;
1037
+ number?: string | null;
1038
+ lab?: string | null;
1039
+ totalAmount?: string;
1040
+ date?: string;
1041
1041
  data: TransactionData;
1042
1042
  invoiced: boolean;
1043
1043
  type: string;
@@ -1048,14 +1048,14 @@ declare class FAMISDb {
1048
1048
  postedDate: string | null;
1049
1049
  emailed: boolean;
1050
1050
  replace_data?: object | null;
1051
- fingerprint: string;
1052
- core: Core;
1053
- customerAccountInfo: CustomerAccountInfo;
1054
- isIdt: boolean;
1055
- poNumber: string | null;
1056
- pi: PI;
1057
- highRiskInfo: HighRiskInfo;
1058
- comments: InvoiceComment[];
1051
+ fingerprint?: string | null;
1052
+ core?: Core | null;
1053
+ customerAccountInfo?: CustomerAccountInfo | null;
1054
+ isIdt?: boolean | null;
1055
+ poNumber?: string | null;
1056
+ pi?: PI | null;
1057
+ highRiskInfo?: HighRiskInfo | null;
1058
+ comments?: InvoiceComment[] | null;
1059
1059
  }
1060
1060
 
1061
1061
  export declare interface InvoiceComment {
@@ -1131,7 +1131,7 @@ declare class FAMISDb {
1131
1131
  tamuManualAddRDN: string | null;
1132
1132
  }
1133
1133
 
1134
- export declare type SortDirection = 'asc' | 'desc';
1134
+ export declare type SortDirection = "asc" | "desc";
1135
1135
 
1136
1136
  export declare interface SystemPart {
1137
1137
  id: number;