express-ext 0.6.0 → 0.6.2
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/lib/index.js +4 -7
- package/package.json +1 -1
- package/src/index.ts +5 -8
package/lib/index.js
CHANGED
|
@@ -40,9 +40,8 @@ __export(require("./search"))
|
|
|
40
40
|
__export(require("./SearchController"))
|
|
41
41
|
__export(require("./view"))
|
|
42
42
|
var SavedController = (function () {
|
|
43
|
-
function SavedController(savedService,
|
|
43
|
+
function SavedController(savedService, id, userId) {
|
|
44
44
|
this.savedService = savedService
|
|
45
|
-
this.log = log
|
|
46
45
|
this.userId = userId && userId.length > 0 ? userId : "userId"
|
|
47
46
|
this.id = id && id.length > 0 ? id : "id"
|
|
48
47
|
this.save = this.save.bind(this)
|
|
@@ -94,9 +93,8 @@ var SavedController = (function () {
|
|
|
94
93
|
})()
|
|
95
94
|
exports.SavedController = SavedController
|
|
96
95
|
var FollowController = (function () {
|
|
97
|
-
function FollowController(service,
|
|
96
|
+
function FollowController(service, id, userId) {
|
|
98
97
|
this.service = service
|
|
99
|
-
this.log = log
|
|
100
98
|
this.userId = userId && userId.length > 0 ? userId : "userId"
|
|
101
99
|
this.id = id && id.length > 0 ? id : "id"
|
|
102
100
|
this.follow = this.follow.bind(this)
|
|
@@ -148,8 +146,7 @@ var FollowController = (function () {
|
|
|
148
146
|
})()
|
|
149
147
|
exports.FollowController = FollowController
|
|
150
148
|
var UserReactionController = (function () {
|
|
151
|
-
function UserReactionController(
|
|
152
|
-
this.log = log
|
|
149
|
+
function UserReactionController(service, author, id, reaction) {
|
|
153
150
|
this.service = service
|
|
154
151
|
this.author = author
|
|
155
152
|
this.reaction = reaction
|
|
@@ -369,7 +366,7 @@ function escapeHTML(input) {
|
|
|
369
366
|
exports.escapeHTML = escapeHTML
|
|
370
367
|
function generateChip(value, text, noClose, hasStar) {
|
|
371
368
|
var s = noClose ? "" : '<span class="close" onclick="removeChip(event)"></span>'
|
|
372
|
-
var t = hasStar ? '<i class="star
|
|
369
|
+
var t = hasStar ? '<i class="star"></i>' : ""
|
|
373
370
|
return '<div class="chip" data-value="' + escapeHTML(value) + '">' + escapeHTML(text) + t + s + "</div>"
|
|
374
371
|
}
|
|
375
372
|
exports.generateChip = generateChip
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Request, Response } from "express"
|
|
|
2
2
|
import { GenericController } from "./GenericController"
|
|
3
3
|
import { GenericSearchController } from "./GenericSearchController"
|
|
4
4
|
import { HealthController } from "./HealthController"
|
|
5
|
-
import { handleError,
|
|
5
|
+
import { handleError, query } from "./http"
|
|
6
6
|
import { LoadController } from "./LoadController"
|
|
7
7
|
import { LoadSearchController } from "./LoadSearchController"
|
|
8
8
|
import { LogController } from "./LogController"
|
|
@@ -49,7 +49,6 @@ export interface SavedService {
|
|
|
49
49
|
export class SavedController {
|
|
50
50
|
constructor(
|
|
51
51
|
protected savedService: SavedService,
|
|
52
|
-
protected log: (msg: string) => void,
|
|
53
52
|
id?: string,
|
|
54
53
|
userId?: string,
|
|
55
54
|
) {
|
|
@@ -107,7 +106,6 @@ export interface FollowService {
|
|
|
107
106
|
export class FollowController {
|
|
108
107
|
constructor(
|
|
109
108
|
protected service: FollowService,
|
|
110
|
-
protected log: Log,
|
|
111
109
|
id?: string,
|
|
112
110
|
userId?: string,
|
|
113
111
|
) {
|
|
@@ -165,11 +163,10 @@ export interface ReactService {
|
|
|
165
163
|
// tslint:disable-next-line:max-classes-per-file
|
|
166
164
|
export class UserReactionController {
|
|
167
165
|
constructor(
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
public author: string,
|
|
166
|
+
protected service: ReactService,
|
|
167
|
+
protected author: string,
|
|
171
168
|
id: string,
|
|
172
|
-
|
|
169
|
+
protected reaction: string,
|
|
173
170
|
) {
|
|
174
171
|
this.id = id && id.length > 0 ? id : "id"
|
|
175
172
|
this.react = this.react.bind(this)
|
|
@@ -375,7 +372,7 @@ export function escapeHTML(input: string): string {
|
|
|
375
372
|
}
|
|
376
373
|
export function generateChip(value: string, text: string, noClose?: boolean, hasStar?: boolean): string {
|
|
377
374
|
const s = noClose ? "" : `<span class="close" onclick="removeChip(event)"></span>`
|
|
378
|
-
const t = hasStar ? `<i class="star
|
|
375
|
+
const t = hasStar ? `<i class="star"></i>` : ""
|
|
379
376
|
return `<div class="chip" data-value="${escapeHTML(value)}">${escapeHTML(text)}${t}${s}</div>`
|
|
380
377
|
}
|
|
381
378
|
export function generateTags(v?: string[] | null, noClose?: boolean): string {
|