pg-mvc-service 1.0.17 → 1.0.19

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/index.d.ts CHANGED
@@ -17,6 +17,9 @@ export { AwsS3Client } from './src/clients/AwsS3Client';
17
17
  // models class
18
18
  import ValidateClient from './src/models/ValidateClient';
19
19
 
20
+ import type { TableModel } from "./src/models/TableModel";
21
+ export type { TableModel } from "./src/models/TableModel";
22
+
20
23
  import { TColumnAttribute, TColumnType, TColumnArrayType, TColumn, TColumnDetail, TOperator, TColumnInfo, TQuery, TSelectExpression, TAggregateFuncType, TCondition, TNestedCondition, TSortKeyword, TKeyFormat } from './src/models/Type';
21
24
  export { TColumnAttribute, TColumnType, TColumnArrayType, TColumn, TColumnDetail, TOperator, TColumnInfo, TQuery, TSelectExpression, TAggregateFuncType, TCondition, TNestedCondition, TSortKeyword, TKeyFormat } from './src/models/Type';
22
25
 
@@ -143,86 +146,86 @@ declare module 'pg-mvc-service' {
143
146
  constructor(errorId: string, message?: string);
144
147
  }
145
148
 
146
- export class TableModel {
147
- protected readonly dbName: string;
148
- get DbName(): string;
149
- protected readonly tableName: string;
150
- get TableName(): string;
151
- protected readonly tableDescription: string;
152
- get TableDescription(): string;
153
- protected readonly comment: string;
154
- get Comment(): string;
155
- protected readonly columns: { [key: string]: TColumn };
156
- get Columns(): { [key: string]: TColumn };
157
- protected readonly references: Array<{table: string, columns: Array<{target: string, ref: string}>}>;
158
- get References(): Array<{table: string, columns: Array<{target: string, ref: string}>}>;
159
- public GetReferences(columnName: string): Array<{table: string, columns: Array<{target: string, ref: string}>}>;
160
- get TableAlias(): string;
161
- public IsOutputLog: boolean;
162
- public SortKeyword: TSortKeyword;
163
- public Offset: number;
164
- public Limit: number;
165
- public PageCount: number;
166
- set OffsetPage(value: number);
167
-
168
- constructor(client: Pool);
169
- constructor(client: Pool, tableAlias: string);
170
- constructor(client: PoolClient);
171
- constructor(client: PoolClient, tableAlias: string);
172
-
173
- public select(): void;
174
- public select(columls: Array<string | {name: string, alias?: string, func?: TAggregateFuncType}> | '*'): void;
175
- public select(columls: Array<string | {name: string, alias?: string, func?: TAggregateFuncType}> | '*', model: TableModel): void;
176
- public select(columls: Array<string | {name: string, alias?: string, func?: TAggregateFuncType}> | '*', keyFormat: TKeyFormat): void;
177
- public select(columls: Array<string | {name: string, alias?: string, func?: TAggregateFuncType}> | '*', model: TableModel, keyFormat: TKeyFormat): void;
178
- public select(expression: string, alias: string): void;
179
-
180
- public join(joinType: 'left' | 'inner', joinModel: TableModel, conditions: Array<TNestedCondition>): void;
181
-
182
- public where(expression: string): void;
183
- public where(conditions: Array<TNestedCondition>): void;
184
- public where(left: string, operator: TOperator, right: any | TColumnInfo): void;
185
- public where(left: TColumnInfo, operator: TOperator, right: any | TColumnInfo): void;
186
-
187
- public find<T = {[key: string]: any}>(pk: {[key: string]: any}, selectColumns: Array<string> | "*" | null, selectExpressions: Array<TSelectExpression> | null, keyFormat: TKeyFormat): Promise<T | null>;
188
- public find<T = {[key: string]: any}>(pk: {[key: string]: any}, selectColumns: Array<string> | "*" | null, selectExpressions: Array<TSelectExpression> | null): Promise<T | null>;
189
- public find<T = {[key: string]: any}>(pk: {[key: string]: any}, selectColumns: Array<string> | "*" | null): Promise<T | null>;
190
- public find<T = {[key: string]: any}>(pk: {[key: string]: any}): Promise<T | null>;
191
-
192
- public findId<T = {[key: string]: any}>(id: any, selectColumns: Array<string> | "*" | null, selectExpressions: Array<TSelectExpression> | null, keyFormat: TKeyFormat): Promise<T | null>;
193
- public findId<T = {[key: string]: any}>(id: any, selectColumns: Array<string> | "*" | null, selectExpressions: Array<TSelectExpression> | null): Promise<T | null>;
194
- public findId<T = {[key: string]: any}>(id: any, selectColumns: Array<string> | "*" | null): Promise<T | null>;
195
- public findId<T = {[key: string]: any}>(id: any): Promise<T | null>;
196
-
197
- protected readonly errorMessages: Record<TColumnType | 'length' | 'null' | 'notInput', string>
198
- protected throwValidationError(code: string, message: string): never;
199
- protected validateOptions(options: {[key: string]: any}, isInsert: boolean) : Promise<void>;
200
- protected validateInsert(options: {[key: string]: any}) : Promise<void>;
201
- protected validateUpdate(options: {[key: string]: any}) : Promise<void>;
202
- protected validateUpdateId(id: any, options: {[key: string]: any}) : Promise<void>;
203
- protected validateDelete() : Promise<void>;
204
- protected validateDeleteId(id: any) : Promise<void>;
205
-
206
- public executeInsert(options: {[key: string]: any}) : Promise<void>;
207
- public executeUpdate(options: {[key: string]: any}) : Promise<number>;
208
- public executeUpdateId(id: any, options: {[key: string]: any}) : Promise<void>;
209
- public executeDelete() : Promise<number>;
210
- public executeDeleteId(id: any) : Promise<void>;
211
-
212
- public executeSelect<T = {[key: string]: any}>(): Promise<Array<T>>;
213
- public executeSelectWithCount<T = any>(): Promise<{ datas: Array<T>, count: number, lastPage: number}>;
214
-
215
- protected executeQuery(param1: string, vars?: Array<any>) : Promise<any>;
216
- protected executeQuery(param1: TQuery) : Promise<any>;
217
-
218
- public orderBy(column: string | TColumnInfo, sortKeyword: TSortKeyword): void;
219
- public orderByList(column: string | TColumnInfo, list: Array<string | number | boolean | null>, sortKeyword: TSortKeyword): void;
220
- public orderBySentence(query: string, sortKeyword: TSortKeyword): void;
221
-
222
- public groupBy(column: string | TColumnInfo): void;
223
-
224
- get ValidateClient(): ValidateClient;
225
- }
149
+ // export class TableModel {
150
+ // protected readonly dbName: string;
151
+ // get DbName(): string;
152
+ // protected readonly tableName: string;
153
+ // get TableName(): string;
154
+ // protected readonly tableDescription: string;
155
+ // get TableDescription(): string;
156
+ // protected readonly comment: string;
157
+ // get Comment(): string;
158
+ // protected readonly columns: { [key: string]: TColumn };
159
+ // get Columns(): { [key: string]: TColumn };
160
+ // protected readonly references: Array<{table: string, columns: Array<{target: string, ref: string}>}>;
161
+ // get References(): Array<{table: string, columns: Array<{target: string, ref: string}>}>;
162
+ // public GetReferences(columnName: string): Array<{table: string, columns: Array<{target: string, ref: string}>}>;
163
+ // get TableAlias(): string;
164
+ // public IsOutputLog: boolean;
165
+ // public SortKeyword: TSortKeyword;
166
+ // public Offset: number;
167
+ // public Limit: number;
168
+ // public PageCount: number;
169
+ // set OffsetPage(value: number);
170
+
171
+ // constructor(client: Pool);
172
+ // constructor(client: Pool, tableAlias: string);
173
+ // constructor(client: PoolClient);
174
+ // constructor(client: PoolClient, tableAlias: string);
175
+
176
+ // public select(): void;
177
+ // public select(columls: Array<string | {name: string, alias?: string, func?: TAggregateFuncType}> | '*'): void;
178
+ // public select(columls: Array<string | {name: string, alias?: string, func?: TAggregateFuncType}> | '*', model: TableModel): void;
179
+ // public select(columls: Array<string | {name: string, alias?: string, func?: TAggregateFuncType}> | '*', keyFormat: TKeyFormat): void;
180
+ // public select(columls: Array<string | {name: string, alias?: string, func?: TAggregateFuncType}> | '*', model: TableModel, keyFormat: TKeyFormat): void;
181
+ // public select(expression: string, alias: string): void;
182
+
183
+ // public join(joinType: 'left' | 'inner', joinModel: TableModel, conditions: Array<TNestedCondition>): void;
184
+
185
+ // public where(expression: string): void;
186
+ // public where(conditions: Array<TNestedCondition>): void;
187
+ // public where(left: string, operator: TOperator, right: any | TColumnInfo): void;
188
+ // public where(left: TColumnInfo, operator: TOperator, right: any | TColumnInfo): void;
189
+
190
+ // public find<T = {[key: string]: any}>(pk: {[key: string]: any}, selectColumns: Array<string> | "*" | null, selectExpressions: Array<TSelectExpression> | null, keyFormat: TKeyFormat): Promise<T | null>;
191
+ // public find<T = {[key: string]: any}>(pk: {[key: string]: any}, selectColumns: Array<string> | "*" | null, selectExpressions: Array<TSelectExpression> | null): Promise<T | null>;
192
+ // public find<T = {[key: string]: any}>(pk: {[key: string]: any}, selectColumns: Array<string> | "*" | null): Promise<T | null>;
193
+ // public find<T = {[key: string]: any}>(pk: {[key: string]: any}): Promise<T | null>;
194
+
195
+ // public findId<T = {[key: string]: any}>(id: any, selectColumns: Array<string> | "*" | null, selectExpressions: Array<TSelectExpression> | null, keyFormat: TKeyFormat): Promise<T | null>;
196
+ // public findId<T = {[key: string]: any}>(id: any, selectColumns: Array<string> | "*" | null, selectExpressions: Array<TSelectExpression> | null): Promise<T | null>;
197
+ // public findId<T = {[key: string]: any}>(id: any, selectColumns: Array<string> | "*" | null): Promise<T | null>;
198
+ // public findId<T = {[key: string]: any}>(id: any): Promise<T | null>;
199
+
200
+ // protected readonly errorMessages: Record<TColumnType | 'length' | 'null' | 'notInput', string>
201
+ // protected throwValidationError(code: string, message: string): never;
202
+ // protected validateOptions(options: {[key: string]: any}, isInsert: boolean) : Promise<void>;
203
+ // protected validateInsert(options: {[key: string]: any}) : Promise<void>;
204
+ // protected validateUpdate(options: {[key: string]: any}) : Promise<void>;
205
+ // protected validateUpdateId(id: any, options: {[key: string]: any}) : Promise<void>;
206
+ // protected validateDelete() : Promise<void>;
207
+ // protected validateDeleteId(id: any) : Promise<void>;
208
+
209
+ // public executeInsert(options: {[key: string]: any}) : Promise<void>;
210
+ // public executeUpdate(options: {[key: string]: any}) : Promise<number>;
211
+ // public executeUpdateId(id: any, options: {[key: string]: any}) : Promise<void>;
212
+ // public executeDelete() : Promise<number>;
213
+ // public executeDeleteId(id: any) : Promise<void>;
214
+
215
+ // public executeSelect<T = {[key: string]: any}>(): Promise<Array<T>>;
216
+ // public executeSelectWithCount<T = any>(): Promise<{ datas: Array<T>, count: number, lastPage: number}>;
217
+
218
+ // protected executeQuery(param1: string, vars?: Array<any>) : Promise<any>;
219
+ // protected executeQuery(param1: TQuery) : Promise<any>;
220
+
221
+ // public orderBy(column: string | TColumnInfo, sortKeyword: TSortKeyword): void;
222
+ // public orderByList(column: string | TColumnInfo, list: Array<string | number | boolean | null>, sortKeyword: TSortKeyword): void;
223
+ // public orderBySentence(query: string, sortKeyword: TSortKeyword): void;
224
+
225
+ // public groupBy(column: string | TColumnInfo): void;
226
+
227
+ // get ValidateClient(): ValidateClient;
228
+ // }
226
229
 
227
230
  export function createTableDoc(models: Array<TableModel>, serviceName?: string): string;
228
231
  export function migrate(migrates: Array<MigrateTable>, poolParam: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pg-mvc-service",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/n-daira/npm-pack_mvc-service#readme",
6
6
  "bugs": {
@@ -1,4 +1,4 @@
1
- import { TableModel } from "./TableModel";
1
+ import type { TableModel } from "./TableModel";
2
2
 
3
3
  // column type
4
4
  export type TColumnAttribute = "primary" | "nullable" | "hasDefault" | "noDefault";
@@ -1,5 +1,4 @@
1
1
  import { UnprocessableException } from "../exceptions/Exception";
2
- import ValidateValueUtil from "./SqlUtils/ValidateValueUtil";
3
2
  import { TableModel } from "./TableModel";
4
3
 
5
4
  type TError = {code?: string; message?: string;};