From a6102840ab138554a60f0b264e269d67be52bf5d Mon Sep 17 00:00:00 2001 From: Tony Xiao Date: Sun, 19 Nov 2023 01:27:22 -0800 Subject: [PATCH] feat: Adding EndUser, User and Organization to the docs --- docs/images/models.svg | 2 +- docs/models.prisma | 34 +++++++++++++++++++++++++++++---- docs/technical/nomenclature.mdx | 27 +++++++++++++------------- 3 files changed, 45 insertions(+), 18 deletions(-) diff --git a/docs/images/models.svg b/docs/images/models.svg index 379f549c..bee88e3d 100644 --- a/docs/images/models.svg +++ b/docs/images/models.svg @@ -1,2 +1,2 @@ -ConnectorStringidConnectorTypetypeIntegrationStringidProviderStringidConnectorConfigStringidResourceStringidPipelineStringidproviderconnectorconnectorintegrationconnector_configsourcedestination \ No newline at end of file +ConnectorStringidConnectorTypetypeIntegrationStringidProviderStringidConnectorConfigStringidResourceStringidPipelineStringidEndUserStringidOrganizationStringidStringapikeyUserStringidproviderconnectorconnectorOrganizationintegrationconnector_configend_usersourcedestinationOrganizationOrganization \ No newline at end of file diff --git a/docs/models.prisma b/docs/models.prisma index 45ca0fb8..dbc31730 100644 --- a/docs/models.prisma +++ b/docs/models.prisma @@ -1,4 +1,5 @@ // Used for creating visualizations of the schema via https://prismaliser.app/ +// and https://prisma-erd.simonknott.de/ model Connector { id String @id type ConnectorType @@ -21,10 +22,12 @@ model Provider { } model ConnectorConfig { - id String @id - connector Connector @relation(fields: [connector_id], references: [id]) - connector_id String - resources Resource[] + id String @id + connector Connector @relation(fields: [connector_id], references: [id]) + connector_id String + resources Resource[] + Organization Organization? @relation(fields: [organizationId], references: [id]) + organizationId String? } model Resource { @@ -35,6 +38,8 @@ model Resource { connector_config_id String pipeline_sources Pipeline[] @relation(name: "source") pipeline_destinations Pipeline[] @relation(name: "destination") + end_user EndUser? @relation(fields: [end_user_id], references: [id]) + end_user_id String? } model Pipeline { @@ -49,3 +54,24 @@ enum ConnectorType { Direct Aggregator } + +model EndUser { + id String @id + resources Resource[] + Organization Organization? @relation(fields: [organizationId], references: [id]) + organizationId String? +} + +model Organization { + id String @id + apikey String + end_users EndUser[] + members User[] + connector_configs ConnectorConfig[] +} + +model User { + id String @id + Organization Organization? @relation(fields: [organizationId], references: [id]) + organizationId String? +} diff --git a/docs/technical/nomenclature.mdx b/docs/technical/nomenclature.mdx index ba8965ec..d09926ba 100644 --- a/docs/technical/nomenclature.mdx +++ b/docs/technical/nomenclature.mdx @@ -9,23 +9,24 @@ used throughout the documentation and code base. To that end, here's a list of what our primitives are and examples of how you can think of them in use. -## Lexicon - -Used in a sentence: -A Pipeline simply connects a data Resource to/from Venice which transmits data across the Pipeline protocol, storing any data in Venice's unified Database and making it available via an API. +![Visualized using Prisma model](../images/models.svg) -| Term | Description | Created by | -| :-------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | -| Provider | A product or service that your customers use (e.g. **Chase**, **Quickbooks**). This is a concept we may reference in docs / user interface but does not yet exist as an actual entity in the Venice API / Database. | N/A | -| Connector | Source code adhering to the Venice Protocol, can be a direct connector (e.g. **Quickbooks**) which provides a single `Integration` or an aggregator connector (e.g. **Plaid**) that provides many `Integration`'s | Venice Repo | -| Integration | An integration represents a `Provider` supported by a `Connector`. There can be multiple integrations for a single provider if multiple connectors support the same provider (e.g. Merge and Railz both gives you the ability to connect to Quickbooks, in addition we have a direct Quickbooks connector for a total of 3 Quickbooks Integrations). | Venice Connector | -| Connector Config | A specific configuration of a Connector. Contains developer account credentials (e.g. `client_id`, `client_secret`), and misc configs (`sandbox` vs. `production`). Some connectors does not require configuration (e.g. **Postgres**). In the future can also contain sync settings (e.g. Automatically sync all Plaid items using this config to our main postgres Resource). | Developer (You) | -| Resource | Associated with a specific `Connector Config`. Contains customer credentials (e.g. `access_token`) and gives you the ability to call `Provider` APIs. Resource can also be used as either a Source or Destination within a Pipeline | End User (Your customer) | -| Pipeline | Pipeline moves data from a Source to a Destination and contains persistent state used for incremental syncs. | Developer (You) | +| Term | Description | Created by | +| :-------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------ | +| Organization | An isolated Venice workspace with its own `Connector Config`s, `End User`'s and `User`s | Developer (You) | +| User | A developer using Venice to deliver great experiences! May belong to multiple `Organization`s. | Developer (You) | +| End User | A customer of yours gives you access to their `Resource` as part of using your product. | Developer (You) | +| Provider | A product or service that your customers use (e.g. **Chase**, **Quickbooks**). This is a concept we may reference in docs / user interface but does not yet exist as an actual entity in the Venice API / Database. | N/A | +| Connector | Source code adhering to the Venice Protocol, can be a direct connector (e.g. **Quickbooks**) which provides a single `Integration` or an aggregator connector (e.g. **Plaid**) that provides many `Integration`'s | Venice Repo | +| Integration | An integration represents a `Provider` supported by a `Connector`. There can be multiple integrations for a single provider if multiple connectors support the same provider (e.g. Merge and Railz both gives you the ability to connect to Quickbooks, in addition we have a direct Quickbooks connector for a total of 3 Quickbooks Integrations). | Venice Connector | +| Connector Config | A specific configuration of a Connector. Contains developer account credentials (e.g. `client_id`, `client_secret`), and misc configs (`sandbox` vs. `production`). Some connectors does not require configuration (e.g. **Postgres**). In the future can also contain sync settings (e.g. Automatically sync all Plaid items using this config to our main postgres Resource). | Developer (You) | +| Resource | Associated with a specific `Connector Config`. Contains customer credentials (e.g. `access_token`) and gives you the ability to call `Provider` APIs. Typically created by an `End User` but could also created by you in the dashboard (which then belongs to your organization). Resource can also be used as either a Source or Destination within a Pipeline | End User (Your customer) | +| Pipeline | Pipeline moves data from a Source to a Destination and contains persistent state used for incremental syncs. | Developer (You) | When we say "connect" in the user interface, we mean invoking a connector to create a resource. -![Visualized using Prisma model](../images/models.svg) +Used in a sentence: +A Pipeline simply connects a data Resource to/from Venice which transmits data across the Venice protocol. {/* Maybe we should support wikilinks if we want to really define nomenclature well */}