Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@google/events

googleapis102.3kApache-2.05.4.0TypeScript support: included

Client library for CloudEvents issued by Google.

google, events, cloudevents

readme

Google CloudEvents – Node.js npm version github ci

This repository contains types for CloudEvents issued by Google, enabling you to have autocompletion in JavaScript or TypeScript projects.

Note: This repo is auto-generated from schemas in https://github.com/googleapis/google-cloudevents

Prerequisites

  • Node 10+

Install

Install the library from npm:

npm i @google/events

Features

This library is meant to provide types for Node projects accepting CloudEvent data, typically sent through a HTTP request's POST body.

For every event type, this library contains:

  • Exports a JavaScript function to[DataType].
  • Exports a TypeScript type interface DataType.

This provides autocompletion and inline IDE documentation for event types.

Example Usage

Require or import the module. Here is an example JS and TS file:

JS

const {toLogEntryData} = require('@google/events/cloud/audit/v1/LogEntryData');

const data = {
  // ...
};

const jsExample = toLogEntryData(data);
console.log(jsExample);

TS

import {LogEntryData} from '@google/events/cloud/audit/v1/LogEntryData';

const data = {
  // ...
};

const tsExample: LogEntryData = data;
console.log(tsExample);

Reference

The reference.md file has detailed examples for how to use every event data type.

changelog

Changelog

5.4.0 (2022-02-17)

Features

5.3.0 (2021-12-14)

Features

5.2.0 (2021-10-15)

Features

5.1.1 (2021-09-03)

Bug Fixes

5.1.0 (2021-07-12)

Features

  • improve types for protobuf duration fields (#101) (7355dcf)

5.0.0 (2021-06-15)

⚠ BREAKING CHANGES

  • allow date types to be strings (#93)

Bug Fixes

4.0.1 (2021-02-09)

Bug Fixes

4.0.0 (2021-01-20)

⚠ BREAKING CHANGES

  • run the generator 2020/12 (#83)

Features

3.2.1 (2020-12-03)

Bug Fixes

3.2.0 (2020-12-02)

Features

  • build: split release PR and publish step (#76) (1fe21d5)

Bug Fixes

  • build: Update release-please.yml (#73) (87aa569)

3.1.0 (2020-11-06)

Features

3.0.0 (2020-10-29)

⚠ BREAKING CHANGES

  • gen events from proto, more events (#63) (ee25a88)

2.0.0 (2020-10-05)

⚠ BREAKING CHANGES

  • update cal types to use camelCase (#54)

Bug Fixes

  • update cal types to use camelCase (#54) (2c60859)

1.5.0 (2020-10-01)

Features

  • rework the gen and postgen setup with separate jsonschema dir (#50) (3f7f70b)

1.4.2 (2020-09-09)

Bug Fixes

1.4.1 (2020-09-09)

Bug Fixes

1.4.0 (2020-09-09)

Features

1.3.1 (2020-09-03)

Bug Fixes

1.3.0 (2020-09-03)

Features

  • docs: add note about feat in contributing guide (#32) (9df8ed1)

1.2.1 (2020-08-27)

Bug Fixes

1.2.0 (2020-08-26)

Features

  • add better typescript types for pubsub (#18) (fbde74c)

1.1.0 (2020-08-13)

Features

1.0.0 (2020-08-04)

Features

Bug Fixes