(type: string)
| 84 | } |
| 85 | |
| 86 | _pushEvent(type: string): Function { |
| 87 | return function ( |
| 88 | subscriptionId: number, |
| 89 | parseObjectJSON: any, |
| 90 | parseOriginalObjectJSON: any |
| 91 | ): void { |
| 92 | const response: Message = { |
| 93 | op: type, |
| 94 | clientId: this.id, |
| 95 | installationId: this.installationId, |
| 96 | }; |
| 97 | if (typeof subscriptionId !== 'undefined') { |
| 98 | response['requestId'] = subscriptionId; |
| 99 | } |
| 100 | if (typeof parseObjectJSON !== 'undefined') { |
| 101 | let keys; |
| 102 | if (this.subscriptionInfos.has(subscriptionId)) { |
| 103 | keys = this.subscriptionInfos.get(subscriptionId).keys; |
| 104 | } |
| 105 | response['object'] = this._toJSONWithFields(parseObjectJSON, keys); |
| 106 | if (parseOriginalObjectJSON) { |
| 107 | response['original'] = this._toJSONWithFields(parseOriginalObjectJSON, keys); |
| 108 | } |
| 109 | } |
| 110 | Client.pushResponse(this.parseWebSocket, JSON.stringify(response)); |
| 111 | }; |
| 112 | } |
| 113 | |
| 114 | _toJSONWithFields(parseObjectJSON: any, fields: any): FlattenedObjectData { |
| 115 | if (!fields) { |
no test coverage detected