5.4.0 • Published 2 years ago

@google/events v5.4.0

Weekly downloads
141
License
Apache-2.0
Repository
github
Last release
2 years ago

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.

5.4.0

2 years ago

5.3.0

2 years ago

5.2.0

3 years ago

5.1.1

3 years ago

5.1.0

3 years ago

5.0.0

3 years ago

4.0.1

3 years ago

4.0.0

3 years ago

3.2.1

3 years ago

3.2.0

3 years ago

3.1.0

4 years ago

3.0.0

4 years ago

2.0.0

4 years ago

1.5.0

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.1

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago