@google/events
Advanced tools
| /** | ||
| * Copyright 2021 Google LLC | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| /** | ||
| * The data within all Firebase Alerts. | ||
| */ | ||
| export interface AlertData { | ||
| /** | ||
| * Time that the event has created | ||
| */ | ||
| createTime?: Date | string; | ||
| /** | ||
| * Time that the event has ended. Optional, only present for alertsthat are | ||
| * ongoing | ||
| */ | ||
| endTime?: Date | string; | ||
| /** | ||
| * Payload of the event, which includes the details of the specific alert. | ||
| * It's a map of keys of String type and values of various types | ||
| */ | ||
| payload?: { | ||
| [key: string]: any; | ||
| }; | ||
| } | ||
| /** | ||
| * Cast a raw JSON object to a typed event (useful for IDE autocompletion). | ||
| * @param {object} json The JSON object | ||
| * @return {AlertData} The object with type annotations | ||
| */ | ||
| export declare const toAlertData: (json: object) => AlertData; |
| "use strict"; | ||
| /** | ||
| * Copyright 2021 Google LLC | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.toAlertData = void 0; | ||
| /** | ||
| * Cast a raw JSON object to a typed event (useful for IDE autocompletion). | ||
| * @param {object} json The JSON object | ||
| * @return {AlertData} The object with type annotations | ||
| */ | ||
| const toAlertData = (json) => { | ||
| return json; | ||
| }; | ||
| exports.toAlertData = toAlertData; |
| /** | ||
| * Copyright 2021 Google LLC | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| /** | ||
| * The data within all Firebase Alerts. | ||
| */ | ||
| export interface AlertData { | ||
| /** | ||
| * Time that the event has created | ||
| */ | ||
| createTime?: Date | string; | ||
| /** | ||
| * Time that the event has ended. Optional, only present for alertsthat are | ||
| * ongoing | ||
| */ | ||
| endTime?: Date | string; | ||
| /** | ||
| * Payload of the event, which includes the details of the specific alert. | ||
| * It's a map of keys of String type and values of various types | ||
| */ | ||
| payload?: {[key: string]: any}; | ||
| } | ||
| /** | ||
| * Cast a raw JSON object to a typed event (useful for IDE autocompletion). | ||
| * @param {object} json The JSON object | ||
| * @return {AlertData} The object with type annotations | ||
| */ | ||
| export const toAlertData = (json: object) => { | ||
| return json as AlertData; | ||
| }; |
+7
-0
| # Changelog | ||
| ## [5.3.0](https://www.github.com/googleapis/google-cloudevents-nodejs/compare/v5.2.0...v5.3.0) (2021-12-14) | ||
| ### Features | ||
| * run generator (12-14-2021) ([#122](https://www.github.com/googleapis/google-cloudevents-nodejs/issues/122)) ([f1b91c2](https://www.github.com/googleapis/google-cloudevents-nodejs/commit/f1b91c222ef13221efa8896d1e33d0c09a2a0c77)) | ||
| ## [5.2.0](https://www.github.com/googleapis/google-cloudevents-nodejs/compare/v5.1.1...v5.2.0) (2021-10-15) | ||
@@ -4,0 +11,0 @@ |
@@ -45,2 +45,6 @@ /** | ||
| state?: StateEnum | number; | ||
| /** | ||
| * ID of the test matrix this event belongs to. | ||
| */ | ||
| testMatrixId?: string; | ||
| } | ||
@@ -47,0 +51,0 @@ /** |
@@ -46,2 +46,6 @@ /** | ||
| state?: StateEnum | number; | ||
| /** | ||
| * ID of the test matrix this event belongs to. | ||
| */ | ||
| testMatrixId?: string; | ||
| } | ||
@@ -48,0 +52,0 @@ |
+1
-1
| { | ||
| "name": "@google/events", | ||
| "version": "5.2.0", | ||
| "version": "5.3.0", | ||
| "description": "Client library for CloudEvents issued by Google.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
+2
-3
@@ -16,5 +16,4 @@ "use strict"; | ||
| }; | ||
| // Commented fields are waiting on https://github.com/googleapis/google-cloudevents/issues/250 | ||
| const BUILD_EVENT_DATA = { | ||
| // "timeout": "660s", | ||
| timeout: '660s', | ||
| createTime: '1993-07-25T02:32:41.388Z', | ||
@@ -26,3 +25,3 @@ tags: ['dolor exercitation', 'sit id consequat', 'dolore eu sit irure esse'], | ||
| projectId: 'quis minim est laborum ex', | ||
| // "queueTtl": "660s" | ||
| queueTtl: '660s', | ||
| }; | ||
@@ -29,0 +28,0 @@ const FIRESTORE_DATA = { |
+2
-3
@@ -29,5 +29,4 @@ import {expect} from 'chai'; | ||
| }; | ||
| // Commented fields are waiting on https://github.com/googleapis/google-cloudevents/issues/250 | ||
| const BUILD_EVENT_DATA: BuildEventData = { | ||
| // "timeout": "660s", | ||
| timeout: '660s', | ||
| createTime: '1993-07-25T02:32:41.388Z', | ||
@@ -39,3 +38,3 @@ tags: ['dolor exercitation', 'sit id consequat', 'dolore eu sit irure esse'], | ||
| projectId: 'quis minim est laborum ex', | ||
| // "queueTtl": "660s" | ||
| queueTtl: '660s', | ||
| }; | ||
@@ -42,0 +41,0 @@ const FIRESTORE_DATA: DocumentEventData = { |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
276605
1.47%61
5.17%7418
1.6%