Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enhances jsonschema #112

Merged
merged 3 commits into from
Nov 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion jsonschema/google/events/cloud/audit/v1/LogEntryData.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"$id": "https://googleapis.github.io/google-cloudevents/jsonschema/google/events/cloud/audit/v1/LogEntryData.json",
"name": "LogEntryData",
"cloudevent": "google.events.cloud.audit.v1",
"package": "google.events.cloud.audit.v1",
"datatype": "google.events.cloud.audit.v1.LogEntryData",
"cloudeventTypes": [
"google.cloud.audit.log.v1.written"
],
"product": "Cloud Audit Logs",
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"logName": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"$id": "https://googleapis.github.io/google-cloudevents/jsonschema/google/events/cloud/cloudbuild/v1/BuildEventData.json",
"name": "BuildEventData",
"cloudevent": "google.events.cloud.cloudbuild.v1",
"package": "google.events.cloud.cloudbuild.v1",
"datatype": "google.events.cloud.cloudbuild.v1.BuildEventData",
"cloudeventTypes": [
"google.cloud.cloudbuild.build.v1.statusChanged"
],
"product": "Cloud Build",
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"id": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
{
"$id": "https://googleapis.github.io/google-cloudevents/jsonschema/google/events/cloud/firestore/v1/DocumentEventData.json",
"name": "DocumentEventData",
"cloudevent": "google.events.cloud.firestore.v1",
"package": "google.events.cloud.firestore.v1",
"datatype": "google.events.cloud.firestore.v1.DocumentEventData",
"cloudeventTypes": [
"google.cloud.firestore.document.v1.created",
"google.cloud.firestore.document.v1.updated",
"google.cloud.firestore.document.v1.deleted",
"google.cloud.firestore.document.v1.written"
],
"product": "Cloud Firestore",
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"value": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"$id": "https://googleapis.github.io/google-cloudevents/jsonschema/google/events/cloud/pubsub/v1/MessagePublishedData.json",
"name": "MessagePublishedData",
"cloudevent": "google.events.cloud.pubsub.v1",
"package": "google.events.cloud.pubsub.v1",
"datatype": "google.events.cloud.pubsub.v1.MessagePublishedData",
"cloudeventTypes": [
"google.cloud.pubsub.topic.v1.messagePublished"
],
"product": "Cloud Pub/Sub",
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"message": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"$id": "https://googleapis.github.io/google-cloudevents/jsonschema/google/events/cloud/scheduler/v1/SchedulerJobData.json",
"name": "SchedulerJobData",
"cloudevent": "google.events.cloud.scheduler.v1",
"package": "google.events.cloud.scheduler.v1",
"datatype": "google.events.cloud.scheduler.v1.SchedulerJobData",
"cloudeventTypes": [
"google.cloud.scheduler.job.v1.executed"
],
"product": "Cloud Scheduler",
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"customData": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
{
"$id": "https://googleapis.github.io/google-cloudevents/jsonschema/google/events/cloud/storage/v1/StorageObjectData.json",
"name": "StorageObjectData",
"cloudevent": "google.events.cloud.storage.v1",
"package": "google.events.cloud.storage.v1",
"datatype": "google.events.cloud.storage.v1.StorageObjectData",
"cloudeventTypes": [
"google.cloud.storage.object.v1.finalized",
"google.cloud.storage.object.v1.archived",
"google.cloud.storage.object.v1.deleted",
"google.cloud.storage.object.v1.metadataUpdated"
],
"product": "Cloud Storage",
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"contentEncoding": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"$id": "https://googleapis.github.io/google-cloudevents/jsonschema/google/events/firebase/analytics/v1/AnalyticsLogData.json",
"name": "AnalyticsLogData",
"cloudevent": "google.events.firebase.analytics.v1",
"package": "google.events.firebase.analytics.v1",
"datatype": "google.events.firebase.analytics.v1.AnalyticsLogData",
"cloudeventTypes": [
"google.firebase.analytics.log.v1.written"
],
"product": "Google Analytics for Firebase",
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"userDim": {
Expand Down
8 changes: 7 additions & 1 deletion jsonschema/google/events/firebase/auth/v1/AuthEventData.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
{
"$id": "https://googleapis.github.io/google-cloudevents/jsonschema/google/events/firebase/auth/v1/AuthEventData.json",
"name": "AuthEventData",
"cloudevent": "google.events.firebase.auth.v1",
"package": "google.events.firebase.auth.v1",
"datatype": "google.events.firebase.auth.v1.AuthEventData",
"cloudeventTypes": [
"google.firebase.auth.user.v1.created",
"google.firebase.auth.user.v1.deleted"
],
"product": "Firebase Authentication",
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"uid": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
{
"$id": "https://googleapis.github.io/google-cloudevents/jsonschema/google/events/firebase/database/v1/ReferenceEventData.json",
"name": "ReferenceEventData",
"cloudevent": "google.events.firebase.database.v1",
"package": "google.events.firebase.database.v1",
"datatype": "google.events.firebase.database.v1.ReferenceEventData",
"cloudeventTypes": [
"google.firebase.database.ref.v1.created",
"google.firebase.database.ref.v1.updated",
"google.firebase.database.ref.v1.deleted",
"google.firebase.database.ref.v1.written"
],
"product": "Firebase Realtime Database",
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"data": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"$id": "https://googleapis.github.io/google-cloudevents/jsonschema/google/events/firebase/remoteconfig/v1/RemoteConfigEventData.json",
"name": "RemoteConfigEventData",
"cloudevent": "google.events.firebase.remoteconfig.v1",
"package": "google.events.firebase.remoteconfig.v1",
"datatype": "google.events.firebase.remoteconfig.v1.RemoteConfigEventData",
"cloudeventTypes": [
"google.firebase.remoteconfig.remoteConfig.v1.updated"
],
"product": "Firebase Remote Config",
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"versionNumber": {
Expand Down
21 changes: 7 additions & 14 deletions tools/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
# Tools
# Google CloudEvent Repo Tools

The tools in this directory are not required in order to *use* the
rest of the content of this repository. They are present to help
create or maintain the content.

While they are *currently* written in C#, requiring .NET Core 3.1 to
build and run, this is purely incidental. Pull requests to rewrite
the tools in languages more commonly used at Google (e.g. Java, Go
or Python) are welcome.
## [registry](./registry/readme.md)

## registry
This tool edits the top-level [README](../README.md) event list.
grant marked this conversation as resolved.
Show resolved Hide resolved

This tool edits the top-level [README](../README.md) to maintain the
event registry. It requires that the protobuf descriptor set (a
protobuf representation of all the .proto files) is already
compiled via protoc. (The [root compile.sh script](../compile.sh)
does this.)
## [quicktype-wrapper](./quicktype-wrapper/README.md)

## quicktype-wrapper
This tool wraps the `quicktype` tool to generate any language using JSON schemas.

This tool wraps the quicktype tool to generate code using JSON Schema.
## [proto2jsonschema](./proto2jsonschema/README.md)

See [`quicktype-wrapper/`](./quicktype-wrapper/README.md).
This tool converts protobufs to JSON schemas.
94 changes: 94 additions & 0 deletions tools/proto2jsonschema/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions tools/proto2jsonschema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
},
"dependencies": {
"camelcase-keys": "^6.2.2",
"flat": "^5.0.2",
"protobufjs": "^6.10.2",
"recursive-readdir": "^2.2.2"
}
}
Loading