@restura/core 1.3.0 → 1.5.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 +14 -2
- package/dist/index.js +321 -255
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -984,6 +984,7 @@ declare class ResturaEngine {
|
|
|
984
984
|
private responseValidator;
|
|
985
985
|
private authenticationHandler;
|
|
986
986
|
private customTypeValidation;
|
|
987
|
+
private standardTypeValidation;
|
|
987
988
|
private psqlConnectionPool;
|
|
988
989
|
private psqlEngine;
|
|
989
990
|
/**
|
|
@@ -992,7 +993,7 @@ declare class ResturaEngine {
|
|
|
992
993
|
* @param app - The Express application instance to initialize with Restura.
|
|
993
994
|
* @returns A promise that resolves when the initialization is complete.
|
|
994
995
|
*/
|
|
995
|
-
init(app: express.
|
|
996
|
+
init(app: express.Express, authenticationHandler: AuthenticateHandler, psqlConnectionPool: PsqlPool): Promise<void>;
|
|
996
997
|
/**
|
|
997
998
|
* Determines if a given endpoint is public based on the HTTP method and full URL. This
|
|
998
999
|
* is determined on whether the endpoint in the schema has no roles or scopes assigned to it.
|
|
@@ -1116,6 +1117,16 @@ declare class PsqlEngine extends SqlEngine {
|
|
|
1116
1117
|
protected createNestedSelect(req: RsRequest<unknown>, schema: ResturaSchema, item: ResponseData, routeData: StandardRouteData, sqlParams: string[]): string;
|
|
1117
1118
|
protected executeCreateRequest(req: RsRequest<unknown>, routeData: StandardRouteData, schema: ResturaSchema): Promise<DynamicObject>;
|
|
1118
1119
|
protected executeGetRequest(req: RsRequest<unknown>, routeData: StandardRouteData, schema: ResturaSchema): Promise<DynamicObject | any[]>;
|
|
1120
|
+
/**
|
|
1121
|
+
* Executes an update request. The request will pull out the id and baseSyncVersion from the request body.
|
|
1122
|
+
* (If Present) The baseSyncVersion is used to check if the record has been modified since the last sync.
|
|
1123
|
+
* If the update fails because the baseSyncVersion has changed, a conflict error will be thrown.
|
|
1124
|
+
* IDs can not be updated using this method.
|
|
1125
|
+
* @param req - The request object.
|
|
1126
|
+
* @param routeData - The route data object.
|
|
1127
|
+
* @param schema - The schema object.
|
|
1128
|
+
* @returns The response object.
|
|
1129
|
+
*/
|
|
1119
1130
|
protected executeUpdateRequest(req: RsRequest<unknown>, routeData: StandardRouteData, schema: ResturaSchema): Promise<DynamicObject>;
|
|
1120
1131
|
protected executeDeleteRequest(req: RsRequest<unknown>, routeData: StandardRouteData, schema: ResturaSchema): Promise<boolean>;
|
|
1121
1132
|
protected generateJoinStatements(req: RsRequest<unknown>, joins: JoinData[], baseTable: string, routeData: StandardRouteData | CustomRouteData, schema: ResturaSchema, sqlParams: string[]): string;
|
|
@@ -1171,9 +1182,10 @@ declare function insertObjectQuery(table: string, obj: DynamicObject): string;
|
|
|
1171
1182
|
* @param table Table name to update the object in
|
|
1172
1183
|
* @param obj Data to update in the table
|
|
1173
1184
|
* @param whereStatement Where clause to determine which rows to update
|
|
1185
|
+
* @param incrementSyncVersion Whether to increment the syncVersion column
|
|
1174
1186
|
* @returns the query to update the object in the table
|
|
1175
1187
|
*/
|
|
1176
|
-
declare function updateObjectQuery(table: string, obj: DynamicObject, whereStatement: string): string;
|
|
1188
|
+
declare function updateObjectQuery(table: string, obj: DynamicObject, whereStatement: string, incrementSyncVersion?: boolean): string;
|
|
1177
1189
|
declare function isValueNumber(value: unknown): value is number;
|
|
1178
1190
|
/**
|
|
1179
1191
|
* This method is used to format a query and escape user input.
|