diff --git a/apps/docs/components/CodeBlock/CodeBlock.tsx b/apps/docs/components/CodeBlock/CodeBlock.tsx index f4e962bb2aa..c29120c7bfb 100644 --- a/apps/docs/components/CodeBlock/CodeBlock.tsx +++ b/apps/docs/components/CodeBlock/CodeBlock.tsx @@ -6,6 +6,7 @@ import { Button, IconCheck, IconCopy } from 'ui' import js from 'react-syntax-highlighter/dist/cjs/languages/hljs/javascript' import ts from 'react-syntax-highlighter/dist/cjs/languages/hljs/typescript' +import csharp from 'react-syntax-highlighter/dist/cjs/languages/hljs/csharp' import py from 'react-syntax-highlighter/dist/cjs/languages/hljs/python' import sql from 'react-syntax-highlighter/dist/cjs/languages/hljs/sql' import bash from 'react-syntax-highlighter/dist/cjs/languages/hljs/bash' @@ -17,7 +18,7 @@ import { useTheme } from 'common/Providers' interface Props { title?: string - language: 'js' | 'jsx' | 'sql' | 'py' | 'bash' | 'ts' | 'dart' | 'json' + language: 'js' | 'jsx' | 'sql' | 'py' | 'bash' | 'ts' | 'dart' | 'json' | 'csharp' linesToHighlight?: number[] hideCopy?: boolean hideLineNumbers?: boolean @@ -62,6 +63,7 @@ const CodeBlock: FC = ({ SyntaxHighlighter.registerLanguage('sql', sql) SyntaxHighlighter.registerLanguage('bash', bash) SyntaxHighlighter.registerLanguage('dart', dart) + SyntaxHighlighter.registerLanguage('csharp', csharp) SyntaxHighlighter.registerLanguage('json', json) const large = false diff --git a/apps/docs/components/Navigation/NavigationMenu/HomeMenu.tsx b/apps/docs/components/Navigation/NavigationMenu/HomeMenu.tsx index dc2baf6ffbb..97ccceb5b3a 100644 --- a/apps/docs/components/Navigation/NavigationMenu/HomeMenu.tsx +++ b/apps/docs/components/Navigation/NavigationMenu/HomeMenu.tsx @@ -94,6 +94,12 @@ const home = [ href: '/reference/dart/introduction', level: 'reference_dart', }, + { + label: 'C#', + icon: '/img/icons/menu/reference-csharp', + href: '/reference/csharp/introduction', + level: 'reference_csharp', + }, { label: 'Python', icon: '/img/icons/menu/reference-python', diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts index 5b742d75b8f..bbf800c33b0 100644 --- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts +++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts @@ -22,6 +22,12 @@ export const REFERENCES: References = { versions: ['v1', 'v0'], icon: '/docs/img/libraries/flutter-icon.svg', }, + csharp: { + name: 'C#', + library: 'supabase-csharp', + versions: ['v0'], + icon: '/docs/img/libraries/c-sharp-icon.svg', + }, cli: { name: 'CLI', library: undefined, @@ -739,6 +745,20 @@ export const reference = { items: [], icon: '/img/icons/menu/reference-dart', }, + { + name: 'supabase-csharp', + url: '/reference/csharp/start', + level: 'reference_csharp', + items: [], + icon: '/img/icons/menu/reference-csharp', + }, + { + name: 'supbase-python', + url: '/reference/python/start', + level: 'reference_python', + items: [], + icon: 'docs/img/icons/javascript.svg', + }, // { // name: 'supabase-python', // url: '/reference/python/start', @@ -788,6 +808,7 @@ export const reference_dart_v0 = { url: '/guides/reference/dart', parent: '/reference', } + export const reference_dart_v1 = { icon: 'reference-dart', title: 'Flutter', @@ -795,6 +816,14 @@ export const reference_dart_v1 = { parent: '/reference', } + +export const reference_csharp_v0 = { + icon: 'reference-csharp', + title: 'c#', + url: 'guides/reference/csharp', + parent: '/reference', +} + export const reference_python_v2 = { icon: 'reference-python', title: 'Python', @@ -895,6 +924,13 @@ export const references = [ icon: '/docs/img/icons/dart-icon.svg', url: '/reference/dart/start', }, + { + label: 'supabase-csharp', + versions: ['v0'], + description: 'something about the reference', + icon: '/docs/img/icons/c-sharp-icon.svg', + url: '/reference/csharp/start', + }, ], }, { diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsx b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsx index ad8e934e6e6..f86f5d2441f 100644 --- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsx +++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsx @@ -12,6 +12,8 @@ import spec_dart_v1 from '~/../../spec/supabase_dart_v1.yml' assert { type: 'yml // @ts-expect-error import spec_dart_v0 from '~/../../spec/supabase_dart_v0.yml' assert { type: 'yml' } // @ts-expect-error +import spec_csharp_v0 from '~/../../spec/supabase_csharp_v0.yml' assert { type: 'yml' } +// @ts-expect-error import spec_python_v2 from '~/../../spec/supabase_py_v2.yml' assert { type: 'yml' } // import { gen_v3 } from '~/lib/refGenerator/helpers' @@ -50,6 +52,7 @@ export type RefIdOptions = | 'reference_javascript_v2' | 'reference_dart_v0' | 'reference_dart_v1' + | 'reference_csharp_v0' | 'reference_python_v2' | 'reference_cli' | 'reference_api' @@ -60,6 +63,7 @@ export type RefIdOptions = export type RefKeyOptions = | 'javascript' | 'dart' + | 'csharp' | 'python' | 'cli' | 'api' @@ -124,6 +128,10 @@ const NavigationMenu = () => { case url.includes(`/docs/reference/dart`) && url: menuState.setMenuLevelId('reference_dart_v1') break + // C# v0 (latest) + case url.includes(`/docs/reference/csharp`) && url: + menuState.setMenuLevelId('reference_csharp_v0') + break // puthon v2 (latest) case url.includes(`/docs/reference/python`) && url: menuState.setMenuLevelId('reference_python_v2') @@ -181,6 +189,7 @@ const NavigationMenu = () => { const isReference_Javascript_V2 = 'reference_javascript_v2' === level const isReference_Dart_V0 = 'reference_dart_v0' === level const isReference_Dart_V1 = 'reference_dart_v1' === level + const isReference_Csharp_V0 = 'reference_csharp_v0' === level const isReference_Python_V2 = 'reference_python_v2' === level const isReference_Cli = 'reference_cli' === level const isReference_Api = 'reference_api' === level @@ -237,6 +246,15 @@ const NavigationMenu = () => { lib="dart" spec={spec_dart_v1} /> + + { commonSections={libCommonSections} lib="python" spec={spec_python_v2} + /> {/* // Tools */} = (props) => { ? 'ts' : example?.code?.startsWith('```dart') ? 'dart' + : example?.code?.startsWith('```c#') + ? 'csharp' : 'js' // ` // import { createClient } from '@supabase/supabase-js' @@ -154,7 +156,8 @@ const RefFunctionSection: React.FC = (props) => { .replace(/```/g, '') .replace('js', '') .replace('ts', '') - .replace('dart', ''))} + .replace('dart', '') + .replace('c#', ''))} {((tables && tables.length > 0) || sql) && ( diff --git a/apps/docs/data/nav/supabase-csharp/v0.ts b/apps/docs/data/nav/supabase-csharp/v0.ts new file mode 100644 index 00000000000..bcb2833312b --- /dev/null +++ b/apps/docs/data/nav/supabase-csharp/v0.ts @@ -0,0 +1,134 @@ +const Nav = [ + { + label: 'Getting Started', + items: [ + { name: 'Supabase C# Library', url: '/reference/csharp', items: [] }, + { name: 'Installing', url: '/reference/csharp/installing', items: [] }, + { name: 'Initializing', url: '/reference/csharp/initializing', items: [] }, + ], + }, + { + label: 'Auth', + items: [ + { name: 'signUp()', url: '/reference/csharp/auth-signup', items: [] }, + { + name: 'signInWithPassword()', + url: '/reference/csharp/auth-signinwithpassword', + items: [], + }, + { name: 'signInWithOtp()', url: '/reference/csharp/auth-signinwithotp', items: [] }, + { name: 'signInWithOAuth()', url: '/reference/csharp/auth-signinwithoauth', items: [] }, + { name: 'signOut()', url: '/reference/csharp/auth-signout', items: [] }, + { name: 'verifyOtp()', url: '/reference/csharp/auth-verifyotp', items: [] }, + { name: 'currentSession', url: '/reference/csharp/auth-currentsession', items: [] }, + { name: 'currentUser', url: '/reference/csharp/auth-currentuser', items: [] }, + { name: 'updateUser()', url: '/reference/csharp/auth-updateuser', items: [] }, + { name: 'onAuthStateChange()', url: '/reference/csharp/auth-onauthstatechange', items: [] }, + { + name: 'resetPasswordForEmail()', + url: '/reference/csharp/auth-resetpasswordforemail', + items: [], + }, + ], + }, + { + label: 'Functions', + items: [{ name: 'invoke()', url: '/reference/csharp/invoke', items: [] }], + }, + { + label: 'Database', + items: [ + { name: 'Fetch data: select()', url: '/reference/csharp/select', items: [] }, + { name: 'Create data: insert()', url: '/reference/csharp/insert', items: [] }, + { name: 'Modify data: update()', url: '/reference/csharp/update', items: [] }, + { name: 'Upsert data: upsert()', url: '/reference/csharp/upsert', items: [] }, + { name: 'Delete data: delete()', url: '/reference/csharp/delete', items: [] }, + { name: 'Stored Procedures: rpc()', url: '/reference/csharp/rpc', items: [] }, + { + name: 'Filters', + url: undefined, + items: [ + { name: 'Using Filters', url: '/reference/csharp/using-filters', items: [] }, + { name: 'eq()', url: '/reference/csharp/eq', items: [] }, + { name: 'neq()', url: '/reference/csharp/neq', items: [] }, + { name: 'gt()', url: '/reference/csharp/gt', items: [] }, + { name: 'gte()', url: '/reference/csharp/gte', items: [] }, + { name: 'lt()', url: '/reference/csharp/lt', items: [] }, + { name: 'lte()', url: '/reference/csharp/lte', items: [] }, + { name: 'like()', url: '/reference/csharp/like', items: [] }, + { name: 'ilike()', url: '/reference/csharp/ilike', items: [] }, + { name: 'is_()', url: '/reference/csharp/is_', items: [] }, + { name: 'in_()', url: '/reference/csharp/in_', items: [] }, + { name: 'contains()', url: '/reference/csharp/contains', items: [] }, + { name: 'containedBy()', url: '/reference/csharp/containedby', items: [] }, + { name: 'rangeGt()', url: '/reference/csharp/rangegt', items: [] }, + { name: 'rangeGte()', url: '/reference/csharp/rangegte', items: [] }, + { name: 'rangeLt()', url: '/reference/csharp/rangelt', items: [] }, + { name: 'rangeLte()', url: '/reference/csharp/rangelte', items: [] }, + { name: 'rangeAdjacent()', url: '/reference/csharp/rangeadjacent', items: [] }, + { name: 'overlaps()', url: '/reference/csharp/overlaps', items: [] }, + { name: 'textSearch()', url: '/reference/csharp/textsearch', items: [] }, + { name: 'match()', url: '/reference/csharp/match', items: [] }, + { name: 'not()', url: '/reference/csharp/not', items: [] }, + { name: 'or()', url: '/reference/csharp/or', items: [] }, + { name: 'filter()', url: '/reference/csharp/filter', items: [] }, + ], + }, + { + name: 'Modifiers', + url: undefined, + items: [ + { name: 'Using Modifiers', url: '/reference/csharp/using-modifiers', items: [] }, + { name: 'order()', url: '/reference/csharp/order', items: [] }, + { name: 'limit()', url: '/reference/csharp/limit', items: [] }, + { name: 'range()', url: '/reference/csharp/range', items: [] }, + { name: 'single()', url: '/reference/csharp/single', items: [] }, + ], + }, + ], + }, + { + label: 'Realtime', + items: [ + { name: 'stream()', url: '/reference/csharp/stream', items: [] }, + { name: 'on().subscribe()', url: '/reference/csharp/subscribe', items: [] }, + { name: 'removeChannel()', url: '/reference/csharp/removechannel', items: [] }, + { name: 'removeAllChannels()', url: '/reference/csharp/removeallchannels', items: [] }, + { name: 'getChannels()', url: '/reference/csharp/getchannels', items: [] }, + ], + }, + { + label: 'Storage', + items: [ + { name: 'createBucket()', url: '/reference/csharp/storage-createbucket', items: [] }, + { name: 'getBucket()', url: '/reference/csharp/storage-getbucket', items: [] }, + { name: 'listBuckets()', url: '/reference/csharp/storage-listbuckets', items: [] }, + { name: 'updateBucket()', url: '/reference/csharp/storage-updatebucket', items: [] }, + { name: 'deleteBucket()', url: '/reference/csharp/storage-deletebucket', items: [] }, + { name: 'emptyBucket()', url: '/reference/csharp/storage-emptybucket', items: [] }, + { name: 'from.upload()', url: '/reference/csharp/storage-from-upload', items: [] }, + { name: 'from.download()', url: '/reference/csharp/storage-from-download', items: [] }, + { name: 'from.list()', url: '/reference/csharp/storage-from-list', items: [] }, + { name: 'from.update()', url: '/reference/csharp/storage-from-update', items: [] }, + { name: 'from.move()', url: '/reference/csharp/storage-from-move', items: [] }, + { name: 'from.remove()', url: '/reference/csharp/storage-from-remove', items: [] }, + { + name: 'from.createSignedUrl()', + url: '/reference/csharp/storage-from-createsignedurl', + items: [], + }, + { + name: 'from.createSignedUrls()', + url: '/reference/csharp/storage-from-createsignedurls', + items: [], + }, + { + name: 'from.getPublicUrl()', + url: '/reference/csharp/storage-from-getpublicurl', + items: [], + }, + ], + }, +] + +export default Nav diff --git a/apps/docs/data/nonGeneratedReferencePages.ts b/apps/docs/data/nonGeneratedReferencePages.ts index 01b060055c7..35ae2e4f540 100644 --- a/apps/docs/data/nonGeneratedReferencePages.ts +++ b/apps/docs/data/nonGeneratedReferencePages.ts @@ -13,6 +13,9 @@ const nonGeneratedReferencePages = [ 'docs/reference/dart/initializing', 'docs/reference/dart/v0/upgrade-guide', 'docs/reference/dart/v0', + 'docs/reference/csharp', + 'docs/reference/csharp/installing', + 'docs/reference/csharp/initializing', 'docs/reference/api', 'docs/reference/api/release-notes', 'docs/reference/cli', diff --git a/apps/docs/docs/ref/csharp/initializing.mdx b/apps/docs/docs/ref/csharp/initializing.mdx new file mode 100644 index 00000000000..ca29a5605a3 --- /dev/null +++ b/apps/docs/docs/ref/csharp/initializing.mdx @@ -0,0 +1,67 @@ +--- +id: initializing +title: 'Initializing' +slug: initializing +custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml +--- + +### Initializing a new Client + + + + +Initializing a new client is pretty straightforward. Find your project url and public key from the +admin panel and pass it into your client initialization function. + + + + + + + + + ```csharp + var url = Environment.GetEnvironmentVariable("SUPABASE_URL"); + var key = Environment.GetEnvironmentVariable("SUPABASE_KEY"); + + var options = new Supabase.SupabaseOptions + { + AutoConnectRealtime = true + }; + + var supabase = new Supabase.Client(url, key, options); + await supabase.InitializeAsync(); + ``` + + + + + + ```csharp + public static MauiApp CreateMauiApp() + { + // ... + var builder = MauiApp.CreateBuilder(); + + var url = Environment.GetEnvironmentVariable("SUPABASE_URL"); + var key = Environment.GetEnvironmentVariable("SUPABASE_KEY"); + var options = new SupabaseOptions + { + AutoRefreshToken = true, + AutoConnectRealtime = true, + SessionHandler = new SupabaseSessionHandler() + }; + + // Note the creation as a singleton. + builder.Services.AddSingleton(provider => new Supabase.Client(url, key, options)); + } + ``` + + + + + + diff --git a/apps/docs/docs/ref/csharp/installing.mdx b/apps/docs/docs/ref/csharp/installing.mdx new file mode 100644 index 00000000000..e274af8e280 --- /dev/null +++ b/apps/docs/docs/ref/csharp/installing.mdx @@ -0,0 +1,33 @@ +--- +id: installing +title: 'Installing & Initialization' +slug: installing +custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml +--- + +### Install from NuGet + + + + + You can install Supabase package from [nuget.org](https://www.nuget.org/packages/supabase-csharp/) + + + + + + + + + ```sh Terminal + dotnet add package supabase-csharp + ``` + + + + + + diff --git a/apps/docs/docs/ref/csharp/introduction.mdx b/apps/docs/docs/ref/csharp/introduction.mdx new file mode 100644 index 00000000000..6c699314937 --- /dev/null +++ b/apps/docs/docs/ref/csharp/introduction.mdx @@ -0,0 +1,20 @@ +--- +id: introduction +title: Introduction +hideTitle: true +--- + +
+ +
+

C# Client Library

+

supabase-csharp

+
+
+ +
+ This reference documents every object and method available in Supabase's C# + library, [supabase-csharp](https://www.nuget.org/packages/supabase-csharp). You can + use supabase-csharp to interact with your Postgres database, listen to database changes, invoke + Deno Edge Functions, build login and user management functionality, and manage large files. +
diff --git a/apps/docs/docs/ref/csharp/release-notes.mdx b/apps/docs/docs/ref/csharp/release-notes.mdx new file mode 100644 index 00000000000..2f30b2cbed8 --- /dev/null +++ b/apps/docs/docs/ref/csharp/release-notes.mdx @@ -0,0 +1,173 @@ +--- +id: release-notes +title: Release Notes +--- + +## 0.7.0 - 2023-01-16 + +- Update dependency: postgrest-csharp@3.1.0 + - [Minor] Breaking API Change: `PrimaryKey` attribute defaults to `shouldInsert: false` as most uses will have the Database generate the primary key. + - Merged [#60](https://github.com/supabase-community/postgrest-csharp/pull/60) which Added linq support for `Select`, `Where`, `OnConflict`, `Columns`, `Order`, `Update`, `Set`, and `Delete` + +## 0.6.2 - 2022-11-22 + +- Update dependency: postgrest-csharp@3.0.4 + - `GetHeaders` is now passed to `ModeledResponse` and `BaseModel` so that the default `Update` and `Delete` methods use the latest credentials + - `GetHeaders` is used in `Rpc` calls (re: [#39](https://github.com/supabase-community/supabase-csharp/issues/39)) + +## 0.6.1 - 2022-11-12 + +- [Hotfix] `GetHeaders` was not passing properly to `SupabaseTable` and `Gotrue.Api` + +## 0.6.0 - 2022-11-12 + +[BREAKING CHANGES] + +- `Client` is no longer a singleton, singleton interactions (if desired) are left to the developer to implement. +- `Client` supports injection of dependent clients after initialization via property: + - `Auth` + - `Functions` + - `Realtime` + - `Postgrest` + - `Storage` +- `SupabaseModel` contains no logic but remains for backwards compatibility. (Marked `Obsolete`) +- `ClientOptions.ShouldInitializeRealtime` was removed (no longer auto initialized) +- `ClientOptions` now references an `ISupabaseSessionHandler` which specifies expected functionality for session persistence on Gotrue (replaces `ClientOptions.SessionPersistor`, `ClientOptions.SessionRetriever`, and `ClientOptions.SessionDestroyer`). +- `supabase-csharp` and all child libraries now have support `nullity` + +Other Changes: + +- Update dependency: functions-csharp@1.2.1 +- Update dependency: gotrue-csharp@3.0.2 +- Update dependency: postgrest-csharp@3.0.2 +- Update dependency: realtime-csharp@4.0.1 +- Update dependency: supabase-storage-csharp@1.2.3 +- Update dependency: supabase-core@0.0.2 + +Big thank you to [@veleek](https://github.com/veleek) for his insight into these changes. + +Re: [#35](https://github.com/supabase-community/supabase-csharp/issues/35), [#34](https://github.com/supabase-community/supabase-csharp/issues/34), [#23](https://github.com/supabase-community/supabase-csharp/issues/23), [#36](https://github.com/supabase-community/supabase-csharp/pull/36) + +## 0.5.3 - 2022-10-11 + +- Update dependency: postgrest-csharp@2.1.0 + - [Minor] Breaking API change: Remove `BaseModel.PrimaryKeyValue` and `BaseModel.PrimaryKeyColumn` in favor of a `PrimaryKey` dictionary with support for composite keys. + - Re: [#48](https://github.com/supabase-community/postgrest-csharp/issues/48) - Add support for derived models on `ReferenceAttribute` + - Re: [#49](https://github.com/supabase-community/postgrest-csharp/issues/49) - Added `Match(T model)` + +## 0.5.2 - 2022-9-13 + +- Update dependency: postgrest-csharp@2.0.12 + - Merged [#47](https://github.com/supabase-community/postgrest-csharp/pull/49) which added cancellation token support to `Table` methods. Thanks [@devpikachu](https://github.com/devpikachu)! + +## 0.5.1 - 2022-8-1 + +- Update dependency: postgrest-csharp@2.0.11 +- Update dependency: supabase-storage-csharp@1.1.1 + +## 0.5.0 - 2022-7-17 + +- Update dependency: postgrest-csharp@2.0.9 +- Update dependency: realtime-csharp@3.0.1 +- Update dependency: supabase-storage-csharp@1.1.0 + - API Change [Breaking/Minor] Library no longer uses `WebClient` and instead leverages `HttpClient`. Progress events on `Upload` and `Download` are now handled with `EventHandler` instead of `WebClient` EventHandlers. + +## 0.4.4 - 2022-5-24 + +- Update dependency: gotrue-csharp@2.4.5 +- Update dependency: postgrest-csharp@2.0.8 + +## 0.4.3 - 2022-5-13 + +- Update dependency: gotrue-csharp@2.4.4 + +## 0.4.2 - 2022-4-30 + +- Update dependency: gotrue-csharp@2.4.3 + +## 0.4.1 - 2022-4-23 + +- Update dependency: gotrue-csharp@2.4.2 + +## 0.4.0 - 2022-4-12 + +- Add support for functions-csharp@1.0.1, giving access to invoking Supabase's edge functions. +- Update dependency: gotrue-csharp@2.4.1 + +## 0.3.5 - 2022-4-11 + +- Update dependency: postgres-csharp@2.0.7 + +## 0.3.4 - 2022-03-28 + +- Update dependency: gotrue-csharp@2.4.0 + +## 0.3.3 - 2022-02-27 + +- Update dependency: gotrue-csharp@2.3.6 +- Update dependency: supabase-storage-csharp@1.0.2 + +## 0.3.2 - 2022-02-18 + +- Update dependency: realtime-csharp@3.0.0 + - Exchange existing websocket client: [WebSocketSharp](https://github.com/sta/websocket-sharp) for [Marfusios/websocket-client](https://github.com/Marfusios/websocket-client) which adds support for Blazor WASM apps. + Ref: [#14](https://github.com/supabase-community/realtime-csharp/pull/14) + +## 0.3.1 - 2022-01-20 + +- Update dependency: gotrue-csharp@2.3.5 + - [#23](https://github.com/supabase-community/gotrue-csharp/pull/23) Added `redirect_url` option for MagicLink sign in (Thanks [@MisterJimson](https://github.com/MisterJimson)) + - [#21](https://github.com/supabase-community/gotrue-csharp/pull/21) Added SignOut method to Stateless Client (Thanks [@fplaras](https://github.com/fplaras)) + +## 0.3.0 - 2021-12-30 + +- Update dependency: postgrest-csharp@2.0.6 + - Add support for `NullValueHandling` to be specified on a `Column` Attribute and for it to be honored on Inserts and Updates. Defaults to: `NullValueHandling.Include`. + - Implements [#38](https://github.com/supabase-community/postgrest-csharp/issues/38) +- Update dependency: realtime-csharp@2.0.8 + - Implement Upstream Realtime RLS Error Broadcast Handler + - Implements [#12](https://github.com/supabase-community/realtime-csharp/issues/12) + - `SocketResponse` now exposes a method: `OldModel`, that hydrates the `OldRecord` property into a model. + +## 0.2.12 - 2021-12-29 + +- Update dependency: gotrue-csharp@2.3.3 + - `SignUp` will return a `Session` with a _populated `User` object_ on an unconfirmed signup. + - Fixes [#19](https://github.com/supabase-community/gotrue-csharp/issues/19) + - Developers who were using a `null` check on `Session.User` will need to adjust accordingly. +- Update dependency: postgrest-csharp@2.0.5 + - Fix for [#37](https://github.com/supabase-community/postgrest-csharp/issues/37) - Return Type `minimal` would fail to resolve because of incorrect `Accept` headers. Added header and test to verify for future. + - Fix for [#36](https://github.com/supabase-community/postgrest-csharp/issues/36) - Inserting/Upserting bulk records would fail while doing an unnecessary generic coercion. + +## 0.2.11 - 2021-12-24 + +- Update dependency: gotrue-csharp@2.3.2 (changes CreateUser parameters to conform to `AdminUserAttributes`) + - See [#15](https://github.com/supabase-community/supabase-csharp/issues/15) + - See [#16](https://github.com/supabase-community/supabase-csharp/issues/16) +- Update dependency: realtime-csharp@2.0.7 + - See [#13](https://github.com/supabase-community/supabase-csharp/issues/13) + +## 0.2.10 - 2021-12-23 + +- Update dependency: gotrue-csharp@2.3.0 (adds metadata support for user signup, see [#14](https://github.com/supabase/community/issues/14)) + +## 0.2.9 - 2021-12-9 + +- Separate Storage client from Supabase repo and into `storage-csharp`, `supabase-csharp` now references new repo. + +## 0.2.8 - 2021-12-4 + +- Update gotrue-csharp to 2.2.4 + - Adds support for `ListUsers` (paginate, sort, filter), `GetUserById`, `CreateUser`, and `UpdateById` + +## 0.2.7 - 2021-12-2 + +- Update gotrue-csharp to 2.2.3 + - Adds support for sending password resets to users. + +## 0.2.6 - 2021-11-29 + +- Support for [#12](https://github.com/supabase-community/supabase-csharp/issues/12) +- Update realtime-csharp to 2.0.6 +- Update gotrue-csharp to 2.2.2 +- Add `StatelessClient` re:[#7](https://github.com/supabase-community/supabase-csharp/issues/7) diff --git a/apps/docs/docs/ref/csharp/v0/release-notes.mdx b/apps/docs/docs/ref/csharp/v0/release-notes.mdx new file mode 100644 index 00000000000..2ecb0ef3990 --- /dev/null +++ b/apps/docs/docs/ref/csharp/v0/release-notes.mdx @@ -0,0 +1,6 @@ +--- +id: release-notes +title: Release Notes +--- + +## dart v0 this is the release notes file. diff --git a/apps/docs/docs/reference/csharp/generated/.gitkeep b/apps/docs/docs/reference/csharp/generated/.gitkeep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/apps/docs/docs/reference/csharp/initializing.mdx b/apps/docs/docs/reference/csharp/initializing.mdx new file mode 100644 index 00000000000..ca29a5605a3 --- /dev/null +++ b/apps/docs/docs/reference/csharp/initializing.mdx @@ -0,0 +1,67 @@ +--- +id: initializing +title: 'Initializing' +slug: initializing +custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml +--- + +### Initializing a new Client + + + + +Initializing a new client is pretty straightforward. Find your project url and public key from the +admin panel and pass it into your client initialization function. + + + + + + + + + ```csharp + var url = Environment.GetEnvironmentVariable("SUPABASE_URL"); + var key = Environment.GetEnvironmentVariable("SUPABASE_KEY"); + + var options = new Supabase.SupabaseOptions + { + AutoConnectRealtime = true + }; + + var supabase = new Supabase.Client(url, key, options); + await supabase.InitializeAsync(); + ``` + + + + + + ```csharp + public static MauiApp CreateMauiApp() + { + // ... + var builder = MauiApp.CreateBuilder(); + + var url = Environment.GetEnvironmentVariable("SUPABASE_URL"); + var key = Environment.GetEnvironmentVariable("SUPABASE_KEY"); + var options = new SupabaseOptions + { + AutoRefreshToken = true, + AutoConnectRealtime = true, + SessionHandler = new SupabaseSessionHandler() + }; + + // Note the creation as a singleton. + builder.Services.AddSingleton(provider => new Supabase.Client(url, key, options)); + } + ``` + + + + + + diff --git a/apps/docs/docs/reference/csharp/installing.mdx b/apps/docs/docs/reference/csharp/installing.mdx new file mode 100644 index 00000000000..e274af8e280 --- /dev/null +++ b/apps/docs/docs/reference/csharp/installing.mdx @@ -0,0 +1,33 @@ +--- +id: installing +title: 'Installing & Initialization' +slug: installing +custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml +--- + +### Install from NuGet + + + + + You can install Supabase package from [nuget.org](https://www.nuget.org/packages/supabase-csharp/) + + + + + + + + + ```sh Terminal + dotnet add package supabase-csharp + ``` + + + + + + diff --git a/apps/docs/docs/reference/csharp/introduction.mdx b/apps/docs/docs/reference/csharp/introduction.mdx new file mode 100644 index 00000000000..6c699314937 --- /dev/null +++ b/apps/docs/docs/reference/csharp/introduction.mdx @@ -0,0 +1,20 @@ +--- +id: introduction +title: Introduction +hideTitle: true +--- + +
+ +
+

C# Client Library

+

supabase-csharp

+
+
+ +
+ This reference documents every object and method available in Supabase's C# + library, [supabase-csharp](https://www.nuget.org/packages/supabase-csharp). You can + use supabase-csharp to interact with your Postgres database, listen to database changes, invoke + Deno Edge Functions, build login and user management functionality, and manage large files. +
diff --git a/apps/docs/docs/reference/csharp/v0/release-notes.mdx b/apps/docs/docs/reference/csharp/v0/release-notes.mdx new file mode 100644 index 00000000000..2ecb0ef3990 --- /dev/null +++ b/apps/docs/docs/reference/csharp/v0/release-notes.mdx @@ -0,0 +1,6 @@ +--- +id: release-notes +title: Release Notes +--- + +## dart v0 this is the release notes file. diff --git a/apps/docs/layouts/DefaultLayout.tsx b/apps/docs/layouts/DefaultLayout.tsx index db490d4c9e7..3e610896b8b 100644 --- a/apps/docs/layouts/DefaultLayout.tsx +++ b/apps/docs/layouts/DefaultLayout.tsx @@ -19,7 +19,7 @@ const Layout: FC = (props: Props) => { return ( <> - {props.meta?.title} | Supabase + {props.meta?.title} | Supabase Docs diff --git a/apps/docs/layouts/SiteLayout.tsx b/apps/docs/layouts/SiteLayout.tsx index cb31612a3da..18a1d960b4d 100644 --- a/apps/docs/layouts/SiteLayout.tsx +++ b/apps/docs/layouts/SiteLayout.tsx @@ -29,7 +29,7 @@ const levelsData = { }, functions: { icon: '/docs/img/icons/menu/functions', - name: 'Functions', + name: 'Edge Functions', }, realtime: { icon: '/docs/img/icons/menu/realtime', @@ -75,6 +75,10 @@ const levelsData = { icon: '/docs/img/icons/menu/reference-dart', name: 'Dart Reference v0.0', }, + reference_csharp_v0: { + icon: '/docs/img/icons/menu/reference-csharp', + name: 'C# Reference v0.0', + }, reference_python_v2: { icon: '/docs/img/icons/menu/reference-python', name: 'Python Reference v2.0', diff --git a/apps/docs/layouts/guides/index.tsx b/apps/docs/layouts/guides/index.tsx index 07ec7929195..d5c1c811305 100644 --- a/apps/docs/layouts/guides/index.tsx +++ b/apps/docs/layouts/guides/index.tsx @@ -65,12 +65,19 @@ const Layout: FC = (props) => { return ( <> = (props) => { ], }} /> -