@brownandroot/api 0.5.0 → 0.6.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.
package/dist/index.d.ts CHANGED
@@ -71,6 +71,82 @@ export interface UpdateLlmLogInput {
71
71
  tokensOut?: number;
72
72
  totalTokens?: number;
73
73
  }
74
+ export interface BusinessUnit {
75
+ id: string;
76
+ companyId: string;
77
+ description: string;
78
+ clientId: string | null;
79
+ clientDescription: string | null;
80
+ workOrderRequired: boolean;
81
+ isActive: boolean;
82
+ expirationDate: string | null;
83
+ createdBy: string;
84
+ createdAt: string;
85
+ updatedBy: string | null;
86
+ updatedAt: string | null;
87
+ subsector: string | null;
88
+ }
89
+ export interface Costcode {
90
+ id: string;
91
+ jdeCostCode: string | null;
92
+ description: string | null;
93
+ businessUnitId: string;
94
+ objectAccount: string | null;
95
+ suba: string | null;
96
+ isActive: boolean;
97
+ expirationDate: string | null;
98
+ createdBy: string;
99
+ createdAt: string;
100
+ updatedBy: string | null;
101
+ updatedAt: string | null;
102
+ billFlag: string | null;
103
+ entryEffectiveDate: string | null;
104
+ entryFlag: boolean;
105
+ }
106
+ export interface Paytype {
107
+ id: string;
108
+ companyCode: string | null;
109
+ payClass: string | null;
110
+ description: string;
111
+ isActive: boolean;
112
+ sortOrder: string | null;
113
+ objectAccount: string | null;
114
+ category: string | null;
115
+ perDiemPayType: boolean;
116
+ type: string | null;
117
+ }
118
+ export interface Shift {
119
+ drky: string;
120
+ drsy: string | null;
121
+ drrt: string | null;
122
+ drdl01: string | null;
123
+ drdl02: string | null;
124
+ drsphd: string | null;
125
+ drudco: string | null;
126
+ drhrdc: string | null;
127
+ druser: string | null;
128
+ drpid: string | null;
129
+ drumpmj: string | null;
130
+ drjobn: string | null;
131
+ drupmt: string | null;
132
+ }
133
+ export interface Workorder {
134
+ id: string;
135
+ businessUnitId: string;
136
+ costCodeId: string | null;
137
+ clientWorkOrderId: string | null;
138
+ description: string | null;
139
+ completed: boolean;
140
+ area: string | null;
141
+ isActive: boolean;
142
+ expirationDate: string | null;
143
+ createdBy: string;
144
+ createdAt: string;
145
+ updatedBy: string | null;
146
+ updatedAt: string | null;
147
+ parentWorkOrder: string | null;
148
+ workOrder2: string | null;
149
+ }
74
150
  export declare class ApiHubClient {
75
151
  private baseUrl;
76
152
  private apiKey;
@@ -100,4 +176,29 @@ export declare class ApiHubClient {
100
176
  createLlmLog(input: CreateLlmLogInput): Promise<LlmLog>;
101
177
  /** Update an existing LLM log entry */
102
178
  updateLlmLog(id: number, input: UpdateLlmLogInput): Promise<LlmLog>;
179
+ getBusinessUnits(): Promise<BusinessUnit[]>;
180
+ getBusinessUnit(id: string): Promise<BusinessUnit>;
181
+ createBusinessUnit(input: Partial<BusinessUnit>): Promise<BusinessUnit>;
182
+ updateBusinessUnit(id: string, input: Partial<BusinessUnit>): Promise<BusinessUnit>;
183
+ deleteBusinessUnit(id: string): Promise<BusinessUnit>;
184
+ getCostcodes(): Promise<Costcode[]>;
185
+ getCostcode(id: string): Promise<Costcode>;
186
+ createCostcode(input: Partial<Costcode>): Promise<Costcode>;
187
+ updateCostcode(id: string, input: Partial<Costcode>): Promise<Costcode>;
188
+ deleteCostcode(id: string): Promise<Costcode>;
189
+ getPaytypes(): Promise<Paytype[]>;
190
+ getPaytype(id: string): Promise<Paytype>;
191
+ createPaytype(input: Partial<Paytype>): Promise<Paytype>;
192
+ updatePaytype(id: string, input: Partial<Paytype>): Promise<Paytype>;
193
+ deletePaytype(id: string): Promise<Paytype>;
194
+ getShifts(): Promise<Shift[]>;
195
+ getShift(id: string): Promise<Shift>;
196
+ createShift(input: Partial<Shift>): Promise<Shift>;
197
+ updateShift(id: string, input: Partial<Shift>): Promise<Shift>;
198
+ deleteShift(id: string): Promise<Shift>;
199
+ getWorkorders(): Promise<Workorder[]>;
200
+ getWorkorder(id: string): Promise<Workorder>;
201
+ createWorkorder(input: Partial<Workorder>): Promise<Workorder>;
202
+ updateWorkorder(id: string, input: Partial<Workorder>): Promise<Workorder>;
203
+ deleteWorkorder(id: string): Promise<Workorder>;
103
204
  }
package/dist/index.js CHANGED
@@ -70,4 +70,94 @@ export class ApiHubClient {
70
70
  async updateLlmLog(id, input) {
71
71
  return this.requestWithBody(`/llm-logs/${id}`, 'PATCH', input);
72
72
  }
73
+ // -----------------------------------------------------------------------
74
+ // Business Units
75
+ // -----------------------------------------------------------------------
76
+ async getBusinessUnits() {
77
+ return this.request('/business-units');
78
+ }
79
+ async getBusinessUnit(id) {
80
+ return this.request(`/business-units/${encodeURIComponent(id)}`);
81
+ }
82
+ async createBusinessUnit(input) {
83
+ return this.requestWithBody('/business-units', 'POST', input);
84
+ }
85
+ async updateBusinessUnit(id, input) {
86
+ return this.requestWithBody(`/business-units/${encodeURIComponent(id)}`, 'PATCH', input);
87
+ }
88
+ async deleteBusinessUnit(id) {
89
+ return this.requestWithBody(`/business-units/${encodeURIComponent(id)}`, 'DELETE', {});
90
+ }
91
+ // -----------------------------------------------------------------------
92
+ // Cost Codes
93
+ // -----------------------------------------------------------------------
94
+ async getCostcodes() {
95
+ return this.request('/costcodes');
96
+ }
97
+ async getCostcode(id) {
98
+ return this.request(`/costcodes/${encodeURIComponent(id)}`);
99
+ }
100
+ async createCostcode(input) {
101
+ return this.requestWithBody('/costcodes', 'POST', input);
102
+ }
103
+ async updateCostcode(id, input) {
104
+ return this.requestWithBody(`/costcodes/${encodeURIComponent(id)}`, 'PATCH', input);
105
+ }
106
+ async deleteCostcode(id) {
107
+ return this.requestWithBody(`/costcodes/${encodeURIComponent(id)}`, 'DELETE', {});
108
+ }
109
+ // -----------------------------------------------------------------------
110
+ // Pay Types
111
+ // -----------------------------------------------------------------------
112
+ async getPaytypes() {
113
+ return this.request('/paytypes');
114
+ }
115
+ async getPaytype(id) {
116
+ return this.request(`/paytypes/${encodeURIComponent(id)}`);
117
+ }
118
+ async createPaytype(input) {
119
+ return this.requestWithBody('/paytypes', 'POST', input);
120
+ }
121
+ async updatePaytype(id, input) {
122
+ return this.requestWithBody(`/paytypes/${encodeURIComponent(id)}`, 'PATCH', input);
123
+ }
124
+ async deletePaytype(id) {
125
+ return this.requestWithBody(`/paytypes/${encodeURIComponent(id)}`, 'DELETE', {});
126
+ }
127
+ // -----------------------------------------------------------------------
128
+ // Shifts
129
+ // -----------------------------------------------------------------------
130
+ async getShifts() {
131
+ return this.request('/shifts');
132
+ }
133
+ async getShift(id) {
134
+ return this.request(`/shifts/${encodeURIComponent(id)}`);
135
+ }
136
+ async createShift(input) {
137
+ return this.requestWithBody('/shifts', 'POST', input);
138
+ }
139
+ async updateShift(id, input) {
140
+ return this.requestWithBody(`/shifts/${encodeURIComponent(id)}`, 'PATCH', input);
141
+ }
142
+ async deleteShift(id) {
143
+ return this.requestWithBody(`/shifts/${encodeURIComponent(id)}`, 'DELETE', {});
144
+ }
145
+ // -----------------------------------------------------------------------
146
+ // Work Orders
147
+ // -----------------------------------------------------------------------
148
+ async getWorkorders() {
149
+ return this.request('/workorders');
150
+ }
151
+ async getWorkorder(id) {
152
+ return this.request(`/workorders/${encodeURIComponent(id)}`);
153
+ }
154
+ async createWorkorder(input) {
155
+ return this.requestWithBody('/workorders', 'POST', input);
156
+ }
157
+ async updateWorkorder(id, input) {
158
+ return this.requestWithBody(`/workorders/${encodeURIComponent(id)}`, 'PATCH', input);
159
+ }
160
+ async deleteWorkorder(id) {
161
+ return this.requestWithBody(`/workorders/${encodeURIComponent(id)}`, 'DELETE', {});
162
+ }
73
163
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brownandroot/api",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",