Skip to content

Instantly share code, notes, and snippets.

View mrtnzagustin's full-sized avatar

mrtnzagustin

View GitHub Profile
@mrtnzagustin
mrtnzagustin / index.d.ts
Created April 20, 2020 20:14 — forked from joeherold/index.d.ts
Sails Typings to work with Model, Controllers, ModelDefinition and so on...
// declare var ;
declare namespace Sails {
enum SortOption {
ASC,
DESC,
}
type SortOptions = keyof typeof SortOption;
interface Criteria {
or?: Criteria[];
@mrtnzagustin
mrtnzagustin / NativeQueryService.ts
Created April 20, 2020 20:14 — forked from joeherold/NativeQueryService.ts
A sample Service for Sails.js to transform a (in this case sails-postgres) raw result from sendNativeQuery to an regular model result
/*
* Created Date: Monday, April 20th 2020, 3:03:54 pm
* Author: Johannes Pichler
*
* Copyright (c) 2020 Webpixels e.U.
*/
let processAllRecords = require("waterline/lib/waterline/utils/query/process-all-records");
export type RawResult = {