From bb7ab7e253428d62d50b4f0bc87aab1b739c9376 Mon Sep 17 00:00:00 2001 From: Angelico Date: Wed, 11 Mar 2020 20:07:21 +0800 Subject: [PATCH 01/14] Get Examples for #21 - Creation of examples folder since the number of examples will just grow from here. - Examples for Reading --- web/docs/common/filters/eq.mdx | 11 - web/docs/common/filters/filter.mdx | 12 - web/docs/common/filters/gt.mdx | 11 - web/docs/common/filters/gte.mdx | 11 - web/docs/common/filters/ilike.mdx | 12 - web/docs/common/filters/in.mdx | 11 - web/docs/common/filters/is.mdx | 12 - web/docs/common/filters/like.mdx | 12 - web/docs/common/filters/lt.mdx | 11 - web/docs/common/filters/lte.mdx | 11 - web/docs/common/filters/match.mdx | 14 +- web/docs/common/filters/not.mdx | 11 - web/docs/library/delete.mdx | 2 +- web/docs/library/examples/delete.js | 22 ++ web/docs/library/examples/get.js | 351 ++++++++++++++++++++++++ web/docs/library/examples/patch.js | 22 ++ web/docs/library/examples/post.js | 42 +++ web/docs/library/examples/stored.js | 54 ++++ web/docs/library/examples/subscribe.js | 128 +++++++++ web/docs/library/get.mdx | 295 ++++++++++++++++++++- web/docs/library/getExamples.js | 353 ------------------------- web/docs/library/patch.mdx | 6 +- web/docs/library/post.mdx | 2 +- web/docs/library/stored-procedures.mdx | 2 +- web/docs/library/subscribe.mdx | 2 +- web/package-lock.json | 123 ++++++--- 26 files changed, 1012 insertions(+), 531 deletions(-) create mode 100644 web/docs/library/examples/delete.js create mode 100644 web/docs/library/examples/get.js create mode 100644 web/docs/library/examples/patch.js create mode 100644 web/docs/library/examples/post.js create mode 100644 web/docs/library/examples/stored.js create mode 100644 web/docs/library/examples/subscribe.js delete mode 100644 web/docs/library/getExamples.js diff --git a/web/docs/common/filters/eq.mdx b/web/docs/common/filters/eq.mdx index 695596c7e2d..3607c2417cf 100644 --- a/web/docs/common/filters/eq.mdx +++ b/web/docs/common/filters/eq.mdx @@ -9,17 +9,6 @@ supabase Finds all rows whose value on the stated columnName exactly matches the specified filterValue. Equivalent of `filter(columName, 'eq', criteria)`. - - - -```js {3} -supabase - .from('countries') - .eq('name', 'New Zealand') -``` - - - #### `columnName: string` Name of the database column. diff --git a/web/docs/common/filters/filter.mdx b/web/docs/common/filters/filter.mdx index fdba909fd1a..aec385f123a 100644 --- a/web/docs/common/filters/filter.mdx +++ b/web/docs/common/filters/filter.mdx @@ -9,18 +9,6 @@ supabase This allows you to apply various filters on your query. Filters can also be chained together. - - - -```js {3-5} -supabase - .from('countries') - .filter('name', 'in', ['China', 'France']) - .filter('status', 'eq', 'ACTIVE') -``` - - - #### `columnName: string` Name of the database column. diff --git a/web/docs/common/filters/gt.mdx b/web/docs/common/filters/gt.mdx index 8d3ec19950c..8470390ad04 100644 --- a/web/docs/common/filters/gt.mdx +++ b/web/docs/common/filters/gt.mdx @@ -8,17 +8,6 @@ supabase ``` Finds all rows whose value on the stated columnName is greater than the specified filterValue. Eqiuvalent of `filter(columnName, 'gt', criteria)`. - - - -```js {3} -supabase - .from('countries') - .gt('id', 20) -``` - - - #### `columnName: string` Name of database column. diff --git a/web/docs/common/filters/gte.mdx b/web/docs/common/filters/gte.mdx index 4e9e237bc79..ed5eae2d38f 100644 --- a/web/docs/common/filters/gte.mdx +++ b/web/docs/common/filters/gte.mdx @@ -8,17 +8,6 @@ supabase ``` Finds all rows whose value on the stated columnName is greater than or equal to the specified filterValue. Eqiuvalent of `filter(columnName, 'gte', criteria)`. - - - -```js {3} -supabase - .from('countries') - .gte('id', 20) -``` - - - #### `columnName: string` Name of database column. diff --git a/web/docs/common/filters/ilike.mdx b/web/docs/common/filters/ilike.mdx index b8a53782361..0fe84b25193 100644 --- a/web/docs/common/filters/ilike.mdx +++ b/web/docs/common/filters/ilike.mdx @@ -9,18 +9,6 @@ supabase A case-sensitive version of `like()`. Equivalent of `filter(columnName, 'ilike', stringPattern)`. - - - -```js {3} -supabase - .from('countries') - .ilike('name', '%united%') -``` - - - - #### `columnName: string` Name of database column. diff --git a/web/docs/common/filters/in.mdx b/web/docs/common/filters/in.mdx index f5f2d8b1cdd..d59a5981a73 100644 --- a/web/docs/common/filters/in.mdx +++ b/web/docs/common/filters/in.mdx @@ -9,17 +9,6 @@ supabase Finds all rows whose value on the stated columnName is found on the specified filterArray. Equivalent of `filter(columnName, 'in', criteria)`. - - - -```js {3} -supabase - .from('countries') - .in('name', ['China', 'France']) -``` - - - #### `columnName: string` Name of database column. diff --git a/web/docs/common/filters/is.mdx b/web/docs/common/filters/is.mdx index 9aebdf18934..821c832333d 100644 --- a/web/docs/common/filters/is.mdx +++ b/web/docs/common/filters/is.mdx @@ -10,18 +10,6 @@ supabase A check for exact equality (**null**, **true**, **false**), finds all rows whose value on the state columnName exactly match the specified filterValue. Equivalent of `filter(columnName, 'is', filterValue)`. - - - -```js {3} -supabase - .from('countries') - .is('name', null) -``` - - - - #### `columnName: string` Name of database column. diff --git a/web/docs/common/filters/like.mdx b/web/docs/common/filters/like.mdx index 197edd22e3e..e8d288e3fcb 100644 --- a/web/docs/common/filters/like.mdx +++ b/web/docs/common/filters/like.mdx @@ -9,18 +9,6 @@ supabase Finds all rows whose value in the stated columnName matches the supplied pattern. Equivalent of `filter(columnName, 'like', stringPattern)`. - - - -```js {3} -supabase - .from('countries') - .like('name', '%United%') -``` - - - - #### `columnName: string` Name of database column. diff --git a/web/docs/common/filters/lt.mdx b/web/docs/common/filters/lt.mdx index 437984b372a..c35aba41fb5 100644 --- a/web/docs/common/filters/lt.mdx +++ b/web/docs/common/filters/lt.mdx @@ -8,17 +8,6 @@ supabase ``` Finds all rows whose value on the stated columnName is less than the specified filterValue. Eqiuvalent of `filter(columnName, 'lt', criteria)`. - - - -```js {3} -supabase - .from('countries') - .lt('id', 20) -``` - - - #### `columnName: string` Name of database column. diff --git a/web/docs/common/filters/lte.mdx b/web/docs/common/filters/lte.mdx index 6477ac050be..3d6997332d6 100644 --- a/web/docs/common/filters/lte.mdx +++ b/web/docs/common/filters/lte.mdx @@ -8,17 +8,6 @@ supabase ``` Finds all rows whose value on the stated columnName is less than or equal to the specified filterValue. Eqiuvalent of `filter(columnName, 'lte', criteria)`. - - - -```js {3} -supabase - .from('countries') - .lte('id', 20) -``` - - - #### `columnName: string` Name of database column. diff --git a/web/docs/common/filters/match.mdx b/web/docs/common/filters/match.mdx index 1f7c030b15f..0d1fff63ec0 100644 --- a/web/docs/common/filters/match.mdx +++ b/web/docs/common/filters/match.mdx @@ -7,19 +7,7 @@ supabase .match(filterObject) ``` -Finds rows that exactly match the specified filterObject. Equivilent of `filter('columnName', 'eq', criteria)`. - - - - -```js {3} -supabase - .from('countries') - .match({ 'continent': 'Asia' }) -``` - - - +Finds rows that exactly match the specified filterObject. Equivalent of multiple `filter('columnName', 'eq', criteria)`. #### `filterObject: object` An object of `{ 'columnName': 'criteria' }` diff --git a/web/docs/common/filters/not.mdx b/web/docs/common/filters/not.mdx index 33fcd5044f6..9d2ca22f21c 100644 --- a/web/docs/common/filters/not.mdx +++ b/web/docs/common/filters/not.mdx @@ -9,17 +9,6 @@ supabase Finds all rows whose value on the stated columnName does not match the specified filterValue. Equivalent of `filter(columnName, 'not', criteria)`. - - - -```js {3} -supabase - .from('countries') - .not('name', 'China') -``` - - - #### `columnName: string` Name of database column. diff --git a/web/docs/library/delete.mdx b/web/docs/library/delete.mdx index b5e96bf730b..0b2f5519ca0 100644 --- a/web/docs/library/delete.mdx +++ b/web/docs/library/delete.mdx @@ -10,7 +10,7 @@ import CommonResponses from '../common/CommonResponses.mdx' import CommonFilters from '../common/CommonFilters' import FromFunction from '../common/FromFunction.mdx' import CustomCodeBlock from '../../src/components/CustomCodeBlock' -import { deleteRecordJs } from './getExamples' +import { deleteRecordJs } from './examples/delete' diff --git a/web/docs/library/examples/delete.js b/web/docs/library/examples/delete.js new file mode 100644 index 00000000000..c8502ec1847 --- /dev/null +++ b/web/docs/library/examples/delete.js @@ -0,0 +1,22 @@ +/** + * delete.mdx examples + */ + +export const deleteRecordJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') + +const updateCountryName = async () => { + try { + let values = await supabase + .from('cities') + .match({ id: 666 }) + .delete() + + return values + } catch (error) { + console.log('Error: ', error) + } +} +` \ No newline at end of file diff --git a/web/docs/library/examples/get.js b/web/docs/library/examples/get.js new file mode 100644 index 00000000000..dd8ee91465c --- /dev/null +++ b/web/docs/library/examples/get.js @@ -0,0 +1,351 @@ +/** + * get.mdx examples + */ + +export const getSimpleJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const getCities = async () => { + try { + let cities = await supabase + .from('cities') + .select('*') + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const getColumnsJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const getCities = async () => { + try { + let cities = await supabase + .from('cities') + .select('name') + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const getForeignJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const getCountries = async () => { + try { + let countries = await supabase + .from('countries') + .select(\` + name, + cities ( + name + ) + \`) + return countries + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const getForeignMultipleJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://shop.supabase.co', 'public-key-bOYapLADERfE') + +const getProducts = async () => { + try { + let products = await supabase + .from('products') + .select(\` + id, + supplier:supplier_id ( name ), + purchaser:purchaser_id ( name ) + \`) + return products + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const getOrderJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const getCities = async () => { + try { + let cities = await supabase + .from('cities') + .order('id') + .select('*') + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const getRangeJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const getCities = async () => { + try { + let cities = await supabase + .from('cities') + .range(0,3) + .select('*') + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const getSingleJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const getCities = async () => { + try { + let cities = await supabase + .from('cities') + .range(0) + .single() + .select('*') + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const getFilterJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const getCities = async () => { + try { + let cities = await supabase + .from('cities') + .filter({'name', 'eq', 'Paris}) + .select('*') + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const getMatchJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const getCities = async () => { + try { + let cities = await supabase + .from('cities') + .match({name: 'Beijing', country_id: 156}) + .select('*') + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const getEqJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const getCities = async () => { + try { + let cities = await supabase + .from('cities') + .eq('name', 'San Francisco') + .select('*') + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const getGtJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const getCities = async () => { + try { + let cities = await supabase + .from('cities') + .gt('country_id', 250) + .select('*') + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const getLtJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const getCities = async () => { + try { + let cities = await supabase + .from('cities') + .lt('country_id', 250) + .select('*') + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const getGteJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const getCities = async () => { + try { + let cities = await supabase + .from('cities') + .gte('country_id', 250) + .select('*') + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const getLteJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const getCities = async () => { + try { + let cities = await supabase + .from('cities') + .lte('country_id', 250) + .select('*') + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const getLikeJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const getCities = async () => { + try { + let cities = await supabase + .from('cities') + .like('name', '%la%') + .select('*') + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const getIlikeJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const getCities = async () => { + try { + let cities = await supabase + .from('cities') + .ilike('name', '%la%') + .select('*') + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const getIsJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const getCities = async () => { + try { + let cities = await supabase + .from('cities') + .is('name', null) + .select('*') + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const getInJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const getCities = async () => { + try { + let cities = await supabase + .from('cities') + .in('name', ['Rio de Janeiro', 'San Francisco']) + .select('*') + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const getNotJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const getCities = async () => { + try { + let cities = await supabase + .from('cities') + .not('name', 'Lagos') + .select('*') + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` diff --git a/web/docs/library/examples/patch.js b/web/docs/library/examples/patch.js new file mode 100644 index 00000000000..b11195dab8e --- /dev/null +++ b/web/docs/library/examples/patch.js @@ -0,0 +1,22 @@ +/** + * patch.mdx examples + */ + +export const patchRecordJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') + +const updateCountryName = async () => { + try { + let updates = await supabase + .from('countries') + .update({ name: 'Middle Earth' }) + .match({ name: 'New Zealand' }) + + return updates + } catch (error) { + console.log('Error: ', error) + } +} +` \ No newline at end of file diff --git a/web/docs/library/examples/post.js b/web/docs/library/examples/post.js new file mode 100644 index 00000000000..cb23c309327 --- /dev/null +++ b/web/docs/library/examples/post.js @@ -0,0 +1,42 @@ +/** + * post.mdx examples + */ + +export const postSingleJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') + +const getCities = async () => { + try { + let cities = await supabase + .from('cities') + .insert([ + { name: 'The Shire', country_id: 554 } + ]) + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const postBulkJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') + +const createCities = async () => { + try { + let cities = await supabase + .from('cities') + .insert([ + { name: 'The Shire', country_id: 554 }, + { name: 'Rohan', country_id: 555 }, + ]) + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` \ No newline at end of file diff --git a/web/docs/library/examples/stored.js b/web/docs/library/examples/stored.js new file mode 100644 index 00000000000..f60788ab198 --- /dev/null +++ b/web/docs/library/examples/stored.js @@ -0,0 +1,54 @@ +/** + * stored-procedures.mdx examples + */ + +export const storedSingleJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') + +const echoCity = async () => { + try{ + let city = await supabase + .rpc('echo_city', { name: 'The Shire' }) + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const storedBulkJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') + +const echoCities = async () => { + try{ + let cities = await supabase + .rpc('echo_city', [ + { name: 'The Shire' }, + { name: 'Mordor' } + ]) + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const storedReadingJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') + +const echoCities = async () => { + try{ + let cities = await supabase + .rpc('asian_pacific_countries') + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` diff --git a/web/docs/library/examples/subscribe.js b/web/docs/library/examples/subscribe.js new file mode 100644 index 00000000000..bf2eff37e0e --- /dev/null +++ b/web/docs/library/examples/subscribe.js @@ -0,0 +1,128 @@ +/** + * subscribe.mdx examples + */ + +export const subscribeAllJs = ` +import { createClient } from '@supabase/supabase-js' + +// Create a single supabase client for interacting with your database +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') + +// Listen to changes +const mySubscription = supabase + .from('*') + .on('*', payload => { + console.log('Change received!', payload) + }) + .subscribe() +` + +export const subscribeTableJs = ` +import { createClient } from '@supabase/supabase-js' + +// Create a single supabase client for interacting with your database +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') + +// Listen to changes +const mySubscription = supabase + .from('countries') + .on('*', payload => { + console.log('Change received!', payload) + }) + .subscribe() +` + +export const subscribeInsertsJs = ` +import { createClient } from '@supabase/supabase-js' + +// Create a single supabase client for interacting with your database +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') + +// Listen to changes +const mySubscription = supabase + .from('countries') + .on('INSERT', payload => { + console.log('Change received!', payload) + }) + .subscribe() +` + +export const subscribeUpdatesJs = ` +import { createClient } from '@supabase/supabase-js' + +// Create a single supabase client for interacting with your database +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') + +// Listen to changes +const mySubscription = supabase + .from('countries') + .on('UPDATE', payload => { + console.log('Change received!', payload) + }) + .subscribe() +` + +export const subscribeDeletesJs = ` +import { createClient } from '@supabase/supabase-js' + +// Create a single supabase client for interacting with your database +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') + +// Listen to changes +const mySubscription = supabase + .from('countries') + .on('DELETE', payload => { + console.log('Change received!', payload) + }) + .subscribe() +` + +export const subscribeMultipleJs = ` +import { createClient } from '@supabase/supabase-js' + +// Create a single supabase client for interacting with your database +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') + +// Listen to changes +const mySubscription = supabase + .from('countries') + .on('INSERT', handleRecordInserted) + .on('DELETE', handleRecordDeleted) + .subscribe() +` + +export const subscribeUnsubscribeJs = ` +import { createClient } from '@supabase/supabase-js' + +// Create a single supabase client for interacting with your database +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') + +// Listen to changes +const mySubscription = supabase + .from('countries') + .on('*', payload => { + console.log('Change received!', payload) + }) + .subscribe() + +// Unsubscribe from changes +mySubscription.unsubscribe() +` + +export const subscribeRemoveJs = ` +import { createClient } from '@supabase/supabase-js' + +// Create a single supabase client for interacting with your database +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') + +// Listen to changes +const mySubscription = supabase + .from('countries') + .on('*', payload => { + console.log('Change received!', payload) + }) + .subscribe() + +// Disconnect mySubscription +supabase.removeSubscription(mySubscription) +` diff --git a/web/docs/library/get.mdx b/web/docs/library/get.mdx index f6cf76b9e5b..9bae9c789c0 100644 --- a/web/docs/library/get.mdx +++ b/web/docs/library/get.mdx @@ -12,7 +12,26 @@ import Collapsable from '../../src/components/Collapsable' import FromFunction from '../common/FromFunction.mdx' import DummyData from '../common/DummyData.mdx' import CustomCodeBlock from '../../src/components/CustomCodeBlock' -import { getSimpleJs, getColumnsJs, getForeignJs, getForeignMultipleJs } from './getExamples' +import { getSimpleJs, + getColumnsJs, + getForeignJs, + getForeignMultipleJs, + getOrderJs, + getRangeJs, + getSingleJs, + getFilterJs, + getMatchJs, + getEqJs, + getGtJs, + getLtJs, + getGteJs, + getLteJs, + getLikeJs, + getIlikeJs, + getIsJs, + getInJs, + getNotJs + } from './examples/get' @@ -188,6 +207,27 @@ supabase ### `order()` + + +
+ ```js {3} supabase @@ -210,6 +250,25 @@ Specifies whether null values will be displayed first. ### `range()` + + +
+ ```js {3} supabase @@ -229,6 +288,22 @@ Index or position of the end of the specified range. If not stated, all remainin ### `single()` + + +
+ ```js {3} supabase @@ -244,39 +319,257 @@ with `200 OK`. Otherwise, it will return an error with `406 Not Acceptable`. ## Filtering ### `filter()` + + + +
+ ### `match()` + + + +
+ ### `eq()` + + + +
+ ### `gt()` + + + +
+ ### `lt()` + + + +
+ ### `gte()` + + + +
+ ### `lte()` + + + +
+ ### `like()` + + + +
+ ### `ilike()` + + + +
+ ### `is()` + + + +
+ ### `in()` + + + +
+ ### `not()` + + + +
+ ## Responses diff --git a/web/docs/library/getExamples.js b/web/docs/library/getExamples.js deleted file mode 100644 index 2be78a1459c..00000000000 --- a/web/docs/library/getExamples.js +++ /dev/null @@ -1,353 +0,0 @@ -/** - * subscribe.mdx examples - */ - -export const subscribeAllJs = ` -import { createClient } from '@supabase/supabase-js' - -// Create a single supabase client for interacting with your database -const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') - -// Listen to changes -const mySubscription = supabase - .from('*') - .on('*', payload => { - console.log('Change received!', payload) - }) - .subscribe() -` - -export const subscribeTableJs = ` -import { createClient } from '@supabase/supabase-js' - -// Create a single supabase client for interacting with your database -const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') - -// Listen to changes -const mySubscription = supabase - .from('countries') - .on('*', payload => { - console.log('Change received!', payload) - }) - .subscribe() -` - -export const subscribeInsertsJs = ` -import { createClient } from '@supabase/supabase-js' - -// Create a single supabase client for interacting with your database -const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') - -// Listen to changes -const mySubscription = supabase - .from('countries') - .on('INSERT', payload => { - console.log('Change received!', payload) - }) - .subscribe() -` - -export const subscribeUpdatesJs = ` -import { createClient } from '@supabase/supabase-js' - -// Create a single supabase client for interacting with your database -const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') - -// Listen to changes -const mySubscription = supabase - .from('countries') - .on('UPDATE', payload => { - console.log('Change received!', payload) - }) - .subscribe() -` - -export const subscribeDeletesJs = ` -import { createClient } from '@supabase/supabase-js' - -// Create a single supabase client for interacting with your database -const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') - -// Listen to changes -const mySubscription = supabase - .from('countries') - .on('DELETE', payload => { - console.log('Change received!', payload) - }) - .subscribe() -` - -export const subscribeMultipleJs = ` -import { createClient } from '@supabase/supabase-js' - -// Create a single supabase client for interacting with your database -const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') - -// Listen to changes -const mySubscription = supabase - .from('countries') - .on('INSERT', handleRecordInserted) - .on('DELETE', handleRecordDeleted) - .subscribe() -` - -export const subscribeUnsubscribeJs = ` -import { createClient } from '@supabase/supabase-js' - -// Create a single supabase client for interacting with your database -const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') - -// Listen to changes -const mySubscription = supabase - .from('countries') - .on('*', payload => { - console.log('Change received!', payload) - }) - .subscribe() - -// Unsubscribe from changes -mySubscription.unsubscribe() -` - -export const subscribeRemoveJs = ` -import { createClient } from '@supabase/supabase-js' - -// Create a single supabase client for interacting with your database -const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') - -// Listen to changes -const mySubscription = supabase - .from('countries') - .on('*', payload => { - console.log('Change received!', payload) - }) - .subscribe() - -// Disconnect mySubscription -supabase.removeSubscription(mySubscription) -` - -/** - * get.mdx examples - */ - -export const getSimpleJs = ` -import { createClient } from '@supabase/supabase-js' - -const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') - -const getCities = async () => { - try { - let cities = await supabase - .from('cities') - .select('*') - return cities - } catch (error) { - console.log('Error: ', error) - } -} -` - -export const getColumnsJs = ` -import { createClient } from '@supabase/supabase-js' - -const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') - -const getCities = async () => { - try { - let cities = await supabase - .from('cities') - .select('name') - return cities - } catch (error) { - console.log('Error: ', error) - } -} -` - -export const getForeignJs = ` -import { createClient } from '@supabase/supabase-js' - -const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') - -const getCountries = async () => { - try { - let countries = await supabase - .from('countries') - .select(\` - name, - cities ( - name - ) - \`) - return countries - } catch (error) { - console.log('Error: ', error) - } -} -` - -export const getForeignMultipleJs = ` -import { createClient } from '@supabase/supabase-js' - -const supabase = createClient('https://shop.supabase.co', 'public-key-bOYapLADERfE') - -const getProducts = async () => { - try { - let products = await supabase - .from('products') - .select(\` - id, - supplier:supplier_id ( name ), - purchaser:purchaser_id ( name ) - \`) - return products - } catch (error) { - console.log('Error: ', error) - } -} -` - -/** - * post.mdx examples - */ - -export const postSingleJs = ` -import { createClient } from '@supabase/supabase-js' - -const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') - -const getCities = async () => { - try { - let cities = await supabase - .from('cities') - .insert([ - { name: 'The Shire', country_id: 554 } - ]) - return cities - } catch (error) { - console.log('Error: ', error) - } -} -` - -export const postBulkJs = ` -import { createClient } from '@supabase/supabase-js' - -const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') - -const createCities = async () => { - try { - let cities = await supabase - .from('cities') - .insert([ - { name: 'The Shire', country_id: 554 }, - { name: 'Rohan', country_id: 555 }, - ]) - return cities - } catch (error) { - console.log('Error: ', error) - } -} -` - -/** - * patch.mdx examples - */ - -export const patchRecordJs = ` -import { createClient } from '@supabase/supabase-js' - -const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') - -const updateCountryName = async () => { - try { - let updates = await supabase - .from('countries') - .update({ name: 'Middle Earth' }) - .match({ name: 'New Zealand' }) - - return updates - } catch (error) { - console.log('Error: ', error) - } -} -` - -/** - * delete.mdx examples - */ - -export const deleteRecordJs = ` -import { createClient } from '@supabase/supabase-js' - -const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') - -const updateCountryName = async () => { - try { - let values = await supabase - .from('cities') - .match({ id: 666 }) - .delete() - - return values - } catch (error) { - console.log('Error: ', error) - } -} -` - -/** - * stored-procedures.mdx examples - */ - -export const storedSingleJs = ` -import { createClient } from '@supabase/supabase-js' - -const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') - -const echoCity = async () => { - try{ - let city = await supabase - .rpc('echo_city', { name: 'The Shire' }) - return cities - } catch (error) { - console.log('Error: ', error) - } -} -` - -export const storedBulkJs = ` -import { createClient } from '@supabase/supabase-js' - -const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') - -const echoCities = async () => { - try{ - let cities = await supabase - .rpc('echo_city', [ - { name: 'The Shire' }, - { name: 'Mordor' } - ]) - return cities - } catch (error) { - console.log('Error: ', error) - } -} -` - -export const storedReadingJs = ` -import { createClient } from '@supabase/supabase-js' - -const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') - -const echoCities = async () => { - try{ - let cities = await supabase - .rpc('asian_pacific_countries') - return cities - } catch (error) { - console.log('Error: ', error) - } -} -` diff --git a/web/docs/library/patch.mdx b/web/docs/library/patch.mdx index 34f894b0f83..b1d835a7c8f 100644 --- a/web/docs/library/patch.mdx +++ b/web/docs/library/patch.mdx @@ -11,7 +11,7 @@ import CommonResponses from '../common/CommonResponses.mdx' import CommonFilters from '../common/CommonFilters' import FromFunction from '../common/FromFunction.mdx' import CustomCodeBlock from '../../src/components/CustomCodeBlock' -import { patchRecordJs } from './getExamples' +import { patchRecordJs } from './examples/patch' @@ -22,7 +22,9 @@ import { patchRecordJs } from './getExamples' js={patchRecordJs} jsHighlight="{7-10}" response={`{ - "body": null, + "body": [ + {"id": 554, "name": "Middle Earth", "iso2": "NZ", "continent": "Oceania"} + ], "status": 204, "statusCode": 204, "statusText": "No Content" diff --git a/web/docs/library/post.mdx b/web/docs/library/post.mdx index d9c51555896..ed2e85486cc 100644 --- a/web/docs/library/post.mdx +++ b/web/docs/library/post.mdx @@ -10,7 +10,7 @@ import Collapsable from '../../src/components/Collapsable' import CommonResponses from '../common/CommonResponses.mdx' import FromFunction from '../common/FromFunction.mdx' import CustomCodeBlock from '../../src/components/CustomCodeBlock' -import { postSingleJs, postBulkJs } from './getExamples' +import { postSingleJs, postBulkJs } from './examples/post' diff --git a/web/docs/library/stored-procedures.mdx b/web/docs/library/stored-procedures.mdx index 6137bba9af4..a08910ee9ea 100644 --- a/web/docs/library/stored-procedures.mdx +++ b/web/docs/library/stored-procedures.mdx @@ -9,7 +9,7 @@ import CommonFilters from '../common/CommonFilters' import CommonResponses from '../common/CommonResponses.mdx' import DummyData from '../common/DummyData.mdx' import CustomCodeBlock from '../../src/components/CustomCodeBlock' -import { storedSingleJs, storedBulkJs, storedReadingJs } from './getExamples' +import { storedSingleJs, storedBulkJs, storedReadingJs } from './examples/stored' You can call stored procedures as a "Remote Procedure Call". diff --git a/web/docs/library/subscribe.mdx b/web/docs/library/subscribe.mdx index f7d2c9f669e..34746e099a5 100644 --- a/web/docs/library/subscribe.mdx +++ b/web/docs/library/subscribe.mdx @@ -8,7 +8,7 @@ import DummyData from '../common/DummyData.mdx' import FromFunction from '../common/FromFunction.mdx' import Collapsable from '../../src/components/Collapsable' import CustomCodeBlock from '../../src/components/CustomCodeBlock' -import { subscribeAllJs, subscribeTableJs, subscribeInsertsJs, subscribeUpdatesJs, subscribeDeletesJs, subscribeMultipleJs, subscribeUnsubscribeJs, subscribeRemoveJs } from './getExamples' +import { subscribeAllJs, subscribeTableJs, subscribeInsertsJs, subscribeUpdatesJs, subscribeDeletesJs, subscribeMultipleJs, subscribeUnsubscribeJs, subscribeRemoveJs } from './examples/subscribe' Subscribe to realtime changes in your own database. diff --git a/web/package-lock.json b/web/package-lock.json index ef0fb5076cd..c125c3d69e8 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -4993,7 +4993,8 @@ }, "ansi-regex": { "version": "2.1.1", - "bundled": true + "bundled": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -5011,11 +5012,13 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true + "bundled": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5028,15 +5031,18 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "concat-map": { "version": "0.0.1", - "bundled": true + "bundled": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -5139,7 +5145,8 @@ }, "inherits": { "version": "2.0.4", - "bundled": true + "bundled": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -5149,6 +5156,7 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -5161,17 +5169,20 @@ "minimatch": { "version": "3.0.4", "bundled": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true + "bundled": true, + "optional": true }, "minipass": { "version": "2.9.0", "bundled": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -5188,6 +5199,7 @@ "mkdirp": { "version": "0.5.1", "bundled": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -5268,7 +5280,8 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true + "bundled": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -5278,6 +5291,7 @@ "once": { "version": "1.4.0", "bundled": true, + "optional": true, "requires": { "wrappy": "1" } @@ -5353,7 +5367,8 @@ }, "safe-buffer": { "version": "5.1.2", - "bundled": true + "bundled": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -5383,6 +5398,7 @@ "string-width": { "version": "1.0.2", "bundled": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -5400,6 +5416,7 @@ "strip-ansi": { "version": "3.0.1", "bundled": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -5438,11 +5455,13 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true + "bundled": true, + "optional": true }, "yallist": { "version": "3.1.1", - "bundled": true + "bundled": true, + "optional": true } } }, @@ -12547,7 +12566,8 @@ }, "ansi-regex": { "version": "2.1.1", - "bundled": true + "bundled": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -12565,11 +12585,13 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true + "bundled": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -12582,15 +12604,18 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "concat-map": { "version": "0.0.1", - "bundled": true + "bundled": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -12693,7 +12718,8 @@ }, "inherits": { "version": "2.0.4", - "bundled": true + "bundled": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -12703,6 +12729,7 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -12715,17 +12742,20 @@ "minimatch": { "version": "3.0.4", "bundled": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true + "bundled": true, + "optional": true }, "minipass": { "version": "2.9.0", "bundled": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -12742,6 +12772,7 @@ "mkdirp": { "version": "0.5.1", "bundled": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -12822,7 +12853,8 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true + "bundled": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -12832,6 +12864,7 @@ "once": { "version": "1.4.0", "bundled": true, + "optional": true, "requires": { "wrappy": "1" } @@ -12907,7 +12940,8 @@ }, "safe-buffer": { "version": "5.1.2", - "bundled": true + "bundled": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -12937,6 +12971,7 @@ "string-width": { "version": "1.0.2", "bundled": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -12954,6 +12989,7 @@ "strip-ansi": { "version": "3.0.1", "bundled": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -12992,11 +13028,13 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true + "bundled": true, + "optional": true }, "yallist": { "version": "3.1.1", - "bundled": true + "bundled": true, + "optional": true } } }, @@ -13546,7 +13584,8 @@ }, "ansi-regex": { "version": "2.1.1", - "bundled": true + "bundled": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -13564,11 +13603,13 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true + "bundled": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -13581,15 +13622,18 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "concat-map": { "version": "0.0.1", - "bundled": true + "bundled": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -13692,7 +13736,8 @@ }, "inherits": { "version": "2.0.4", - "bundled": true + "bundled": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -13702,6 +13747,7 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -13714,17 +13760,20 @@ "minimatch": { "version": "3.0.4", "bundled": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true + "bundled": true, + "optional": true }, "minipass": { "version": "2.9.0", "bundled": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -13741,6 +13790,7 @@ "mkdirp": { "version": "0.5.1", "bundled": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -13821,7 +13871,8 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true + "bundled": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -13831,6 +13882,7 @@ "once": { "version": "1.4.0", "bundled": true, + "optional": true, "requires": { "wrappy": "1" } @@ -13906,7 +13958,8 @@ }, "safe-buffer": { "version": "5.1.2", - "bundled": true + "bundled": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -13936,6 +13989,7 @@ "string-width": { "version": "1.0.2", "bundled": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -13953,6 +14007,7 @@ "strip-ansi": { "version": "3.0.1", "bundled": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -13991,11 +14046,13 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true + "bundled": true, + "optional": true }, "yallist": { "version": "3.1.1", - "bundled": true + "bundled": true, + "optional": true } } }, From 63038efe7ac1e8b12de9a4365c0049c986835335 Mon Sep 17 00:00:00 2001 From: Angelico Date: Wed, 11 Mar 2020 20:26:42 +0800 Subject: [PATCH 02/14] Patch examples for #21 --- web/docs/library/examples/get.js | 2 +- web/docs/library/examples/patch.js | 222 +++++++++++++++++++++++++- web/docs/library/patch.mdx | 243 ++++++++++++++++++++++++++++- 3 files changed, 457 insertions(+), 10 deletions(-) diff --git a/web/docs/library/examples/get.js b/web/docs/library/examples/get.js index dd8ee91465c..aea77d3b59e 100644 --- a/web/docs/library/examples/get.js +++ b/web/docs/library/examples/get.js @@ -143,7 +143,7 @@ const getCities = async () => { try { let cities = await supabase .from('cities') - .filter({'name', 'eq', 'Paris}) + .filter({'name', 'eq', 'Paris'}) .select('*') return cities } catch (error) { diff --git a/web/docs/library/examples/patch.js b/web/docs/library/examples/patch.js index b11195dab8e..997e073ce9b 100644 --- a/web/docs/library/examples/patch.js +++ b/web/docs/library/examples/patch.js @@ -7,16 +7,232 @@ import { createClient } from '@supabase/supabase-js' const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') -const updateCountryName = async () => { +const updateCityName = async () => { try { let updates = await supabase - .from('countries') + .from('cities') .update({ name: 'Middle Earth' }) - .match({ name: 'New Zealand' }) + .match({ name: 'Auckland' }) return updates } catch (error) { console.log('Error: ', error) } } +` + +export const patchFilterJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const updateCityName = async () => { + try { + let cities = await supabase + .from('cities') + .filter({'name', 'eq', 'Paris'}) + .update({ name: 'Mordor' }) + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const patchMatchJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const updateCityName = async () => { + try { + let cities = await supabase + .from('cities') + .match({name: 'Beijing', country_id: 156}) + .update({ name: 'Mordor' }) + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const patchEqJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const updateCityName = async () => { + try { + let cities = await supabase + .from('cities') + .eq('name', 'San Francisco') + .update({ name: 'Mordor' }) + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const patchGtJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const updateCityName = async () => { + try { + let cities = await supabase + .from('cities') + .gt('country_id', 250) + .update({ name: 'Mordor' }) + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const patchLtJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const updateCityName = async () => { + try { + let cities = await supabase + .from('cities') + .lt('country_id', 250) + .update({ name: 'Mordor' }) + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const patchGteJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const updateCityName = async () => { + try { + let cities = await supabase + .from('cities') + .gte('country_id', 250) + .update({ name: 'Mordor' }) + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const patchLteJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const updateCityName = async () => { + try { + let cities = await supabase + .from('cities') + .lte('country_id', 250) + .update({ name: 'Mordor' }) + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const patchLikeJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const updateCityName = async () => { + try { + let cities = await supabase + .from('cities') + .like('name', '%la%') + .update({ name: 'Mordor' }) + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const patchIlikeJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const updateCityName = async () => { + try { + let cities = await supabase + .from('cities') + .ilike('name', '%la%') + .update({ name: 'Mordor' }) + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const patchIsJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const updateCityName = async () => { + try { + let cities = await supabase + .from('cities') + .is('name', null) + .update({ name: 'Mordor' }) + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const patchInJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const updateCityName = async () => { + try { + let cities = await supabase + .from('cities') + .in('name', ['Rio de Janeiro', 'San Francisco']) + .update({ name: 'Mordor' }) + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const patchNotJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const updateCityName = async () => { + try { + let cities = await supabase + .from('cities') + .not('name', 'Lagos') + .update({ name: 'Mordor' }) + return cities + } catch (error) { + console.log('Error: ', error) + } +} ` \ No newline at end of file diff --git a/web/docs/library/patch.mdx b/web/docs/library/patch.mdx index b1d835a7c8f..dcce29e3100 100644 --- a/web/docs/library/patch.mdx +++ b/web/docs/library/patch.mdx @@ -11,7 +11,20 @@ import CommonResponses from '../common/CommonResponses.mdx' import CommonFilters from '../common/CommonFilters' import FromFunction from '../common/FromFunction.mdx' import CustomCodeBlock from '../../src/components/CustomCodeBlock' -import { patchRecordJs } from './examples/patch' +import { patchRecordJs, + patchFilterJs, + patchMatchJs, + patchEqJs, + patchGtJs, + patchLtJs, + patchGteJs, + patchLteJs, + patchLikeJs, + patchIlikeJs, + patchIsJs, + patchInJs, + patchNotJs + } from './examples/patch' @@ -23,11 +36,11 @@ import { patchRecordJs } from './examples/patch' jsHighlight="{7-10}" response={`{ "body": [ - {"id": 554, "name": "Middle Earth", "iso2": "NZ", "continent": "Oceania"} + { "name": "Middle Earth", "country_id": 554 }, ], - "status": 204, - "statusCode": 204, - "statusText": "No Content" + "status": 200, + "statusCode": 200, + "statusText": "OK" }`} /> @@ -59,44 +72,262 @@ const options = { ## Filtering ### `filter()` + + + +
+ ### `match()` + + + +
+ ### `eq()` + + + +
+ ### `gt()` + + + +
+ ### `lt()` + + + +
+ ### `gte()` + + + +
+ ### `lte()` + + + +
+ ### `like()` + + + +
+ ### `ilike()` + + + +
+ ### `is()` + + + +
+ ### `in()` + + + +
+ ### `not()` + + + +
+ ## Responses #### 200 OK -Successful +Successful request \ No newline at end of file From b68685403cc5bc689a29d320086289a5a8d8a3bb Mon Sep 17 00:00:00 2001 From: Angelico Date: Wed, 11 Mar 2020 20:34:32 +0800 Subject: [PATCH 03/14] Delete examples for #21 --- web/docs/library/delete.mdx | 198 ++++++++++++++++++++++++- web/docs/library/examples/delete.js | 220 +++++++++++++++++++++++++++- 2 files changed, 413 insertions(+), 5 deletions(-) diff --git a/web/docs/library/delete.mdx b/web/docs/library/delete.mdx index 0b2f5519ca0..aacddd7ec15 100644 --- a/web/docs/library/delete.mdx +++ b/web/docs/library/delete.mdx @@ -10,7 +10,20 @@ import CommonResponses from '../common/CommonResponses.mdx' import CommonFilters from '../common/CommonFilters' import FromFunction from '../common/FromFunction.mdx' import CustomCodeBlock from '../../src/components/CustomCodeBlock' -import { deleteRecordJs } from './examples/delete' +import { deleteRecordJs, + deleteFilterJs, + deleteMatchJs, + deleteEqJs, + deleteGtJs, + deleteLtJs, + deleteGteJs, + deleteLteJs, + deleteLikeJs, + deleteIlikeJs, + deleteIsJs, + deleteInJs, + deleteNotJs + } from './examples/delete' @@ -56,48 +69,227 @@ const options = { ---- - ## Filtering ### `filter()` + + + +
+ ### `match()` + + + +
+ ### `eq()` + + + +
+ ### `gt()` + + + +
+ ### `lt()` + + + +
+ ### `gte()` + + + +
+ ### `lte()` + + + +
+ ### `like()` + + + +
+ ### `ilike()` + + + +
+ ### `is()` + + + +
+ ### `in()` + + + +
+ ### `not()` + + + +
+ ## Responses #### 200 OK -Successful +Successful request \ No newline at end of file diff --git a/web/docs/library/examples/delete.js b/web/docs/library/examples/delete.js index c8502ec1847..a462656bd7b 100644 --- a/web/docs/library/examples/delete.js +++ b/web/docs/library/examples/delete.js @@ -7,7 +7,7 @@ import { createClient } from '@supabase/supabase-js' const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') -const updateCountryName = async () => { +const deleteCity = async () => { try { let values = await supabase .from('cities') @@ -19,4 +19,220 @@ const updateCountryName = async () => { console.log('Error: ', error) } } -` \ No newline at end of file +` + +export const deleteFilterJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const deleteCIty = async () => { + try { + let cities = await supabase + .from('cities') + .filter({'name', 'eq', 'Paris'}) + .delete() + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const deleteMatchJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const deleteCIty = async () => { + try { + let cities = await supabase + .from('cities') + .match({name: 'Beijing', country_id: 156}) + .delete() + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const deleteEqJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const deleteCIty = async () => { + try { + let cities = await supabase + .from('cities') + .eq('name', 'San Francisco') + .delete() + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const deleteGtJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const deleteCIty = async () => { + try { + let cities = await supabase + .from('cities') + .gt('country_id', 250) + .delete() + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const deleteLtJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const deleteCIty = async () => { + try { + let cities = await supabase + .from('cities') + .lt('country_id', 250) + .delete() + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const deleteGteJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const deleteCIty = async () => { + try { + let cities = await supabase + .from('cities') + .gte('country_id', 250) + .delete() + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const deleteLteJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const deleteCIty = async () => { + try { + let cities = await supabase + .from('cities') + .lte('country_id', 250) + .delete() + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const deleteLikeJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const deleteCIty = async () => { + try { + let cities = await supabase + .from('cities') + .like('name', '%la%') + .delete() + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const deleteIlikeJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const deleteCIty = async () => { + try { + let cities = await supabase + .from('cities') + .ilike('name', '%la%') + .delete() + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const deleteIsJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const deleteCIty = async () => { + try { + let cities = await supabase + .from('cities') + .is('name', null) + .delete() + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const deleteInJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const deleteCIty = async () => { + try { + let cities = await supabase + .from('cities') + .in('name', ['Rio de Janeiro', 'San Francisco']) + .delete() + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` + +export const deleteNotJs = ` +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE') + +const deleteCIty = async () => { + try { + let cities = await supabase + .from('cities') + .not('name', 'Lagos') + .delete() + return cities + } catch (error) { + console.log('Error: ', error) + } +} +` From 9cf3b4e2d68f1ecaed30c50ddde6b42233baaeb1 Mon Sep 17 00:00:00 2001 From: Paul Copplestone Date: Sun, 15 Mar 2020 15:28:45 +0800 Subject: [PATCH 04/14] Adds tawk --- web/docusaurus.config.js | 65 +++++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/web/docusaurus.config.js b/web/docusaurus.config.js index 917d5111d13..d8b7bb15f82 100755 --- a/web/docusaurus.config.js +++ b/web/docusaurus.config.js @@ -90,15 +90,6 @@ module.exports = { // } ], }, - // { - // title: "Social", - // items: [ - // { - // label: "Blog", - // to: "blog" - // } - // ] - // } ], // logo: { // alt: "Flock", @@ -121,26 +112,38 @@ module.exports = { }, ], ], - // customFields: { - // headerJs: ` - // // FULLSTORY - Please remove after initial user testing. - // window['_fs_debug'] = false; - // window['_fs_host'] = 'fullstory.com'; - // window['_fs_script'] = 'edge.fullstory.com/s/fs.js'; - // window['_fs_org'] = 'R5A9Z'; - // window['_fs_namespace'] = 'FS'; - // (function(m,n,e,t,l,o,g,y){ - // if (e in m) {if(m.console && m.console.log) { m.console.log('FullStory namespace conflict. Please set window["_fs_namespace"].');} return;} - // g=m[e]=function(a,b,s){g.q?g.q.push([a,b,s]):g._api(a,b,s);};g.q=[]; - // o=n.createElement(t);o.async=1;o.crossOrigin='anonymous';o.src='https://'+_fs_script; - // y=n.getElementsByTagName(t)[0];y.parentNode.insertBefore(o,y); - // g.identify=function(i,v,s){g(l,{uid:i},s);if(v)g(l,v,s)};g.setUserVars=function(v,s){g(l,v,s)};g.event=function(i,v,s){g('event',{n:i,p:v},s)}; - // g.shutdown=function(){g("rec",!1)};g.restart=function(){g("rec",!0)}; - // g.log = function(a,b) { g("log", [a,b]) }; - // g.consent=function(a){g("consent",!arguments.length||a)}; - // g.identifyAccount=function(i,v){o='account';v=v||{};v.acctId=i;g(o,v)}; - // g.clearUserCookie=function(){}; - // })(window,document,window['_fs_namespace'],'script','user'); - // `, - // }, + customFields: { + headerJs: ` + + var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date(); + (function(){ + var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0]; + s1.async=true; + s1.src='https://embed.tawk.to/5e0f4c517e39ea1242a2e675/default'; + s1.charset='UTF-8'; + s1.setAttribute('crossorigin','*'); + s0.parentNode.insertBefore(s1,s0); + })(); + + + // FULLSTORY - Please remove after initial user testing. + // window['_fs_debug'] ~= false; + // window['_fs_host'] = 'fullstory.com'; + // window['_fs_script'] = 'edge.fullstory.com/s/fs.js'; + // window['_fs_org'] = 'R5A9Z'; + // window['_fs_namespace'] = 'FS'; + // (function(m,n,e,t,l,o,g,y){ + // if (e in m) {if(m.console && m.console.log) { m.console.log('FullStory namespace conflict. Please set window["_fs_namespace"].');} return;} + // g=m[e]=function(a,b,s){g.q?g.q.push([a,b,s]):g._api(a,b,s);};g.q=[]; + // o=n.createElement(t);o.async=1;o.crossOrigin='anonymous';o.src='https://'+_fs_script; + // y=n.getElementsByTagName(t)[0];y.parentNode.insertBefore(o,y); + // g.identify=function(i,v,s){g(l,{uid:i},s);if(v)g(l,v,s)};g.setUserVars=function(v,s){g(l,v,s)};g.event=function(i,v,s){g('event',{n:i,p:v},s)}; + // g.shutdown=function(){g("rec",!1)};g.restart=function(){g("rec",!0)}; + // g.log = function(a,b) { g("log", [a,b]) }; + // g.consent=function(a){g("consent",!arguments.length||a)}; + // g.identifyAccount=function(i,v){o='account';v=v||{};v.acctId=i;g(o,v)}; + // g.clearUserCookie=function(){}; + // })(window,document,window['_fs_namespace'],'script','user'); + `, + }, } From 9d08c3c9fef54daa67d8289452777df7daf3e0b0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2020 01:56:00 +0000 Subject: [PATCH 05/14] Bump acorn from 6.4.0 to 6.4.1 in /examples/slack-clone-basic Bumps [acorn](https://github.com/acornjs/acorn) from 6.4.0 to 6.4.1. - [Release notes](https://github.com/acornjs/acorn/releases) - [Commits](https://github.com/acornjs/acorn/compare/6.4.0...6.4.1) Signed-off-by: dependabot[bot] --- examples/slack-clone-basic/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/slack-clone-basic/package-lock.json b/examples/slack-clone-basic/package-lock.json index 327ee084939..26cd6513601 100644 --- a/examples/slack-clone-basic/package-lock.json +++ b/examples/slack-clone-basic/package-lock.json @@ -1346,9 +1346,9 @@ } }, "acorn": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.0.tgz", - "integrity": "sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw==" + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", + "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==" }, "adjust-sourcemap-loader": { "version": "2.0.0", From c6438752d9b91967b41f25e00c99fb383ab53ed9 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2020 01:58:20 +0000 Subject: [PATCH 06/14] [Security] Bump acorn from 6.4.0 to 6.4.1 in /web Bumps [acorn](https://github.com/acornjs/acorn) from 6.4.0 to 6.4.1. **This update includes a security fix.** - [Release notes](https://github.com/acornjs/acorn/releases) - [Commits](https://github.com/acornjs/acorn/compare/6.4.0...6.4.1) Signed-off-by: dependabot-preview[bot] --- web/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/package-lock.json b/web/package-lock.json index c125c3d69e8..5c238e93951 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -1676,9 +1676,9 @@ } }, "acorn": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.0.tgz", - "integrity": "sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw==" + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", + "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==" }, "acorn-walk": { "version": "6.2.0", From ffdc447fefca36fbaf93be387f68a0dac841543a Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2020 01:59:16 +0000 Subject: [PATCH 07/14] Bump recharts from 2.0.0-beta.1 to 2.0.0-beta.3 in /web Bumps [recharts](https://github.com/recharts/recharts) from 2.0.0-beta.1 to 2.0.0-beta.3. - [Release notes](https://github.com/recharts/recharts/releases) - [Changelog](https://github.com/recharts/recharts/blob/master/CHANGELOG.md) - [Commits](https://github.com/recharts/recharts/compare/v2.0.0-beta.1...v2.0.0-beta.3) Signed-off-by: dependabot-preview[bot] --- web/package-lock.json | 6 +++--- web/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) mode change 100755 => 100644 web/package.json diff --git a/web/package-lock.json b/web/package-lock.json index c125c3d69e8..2aa55de4cbd 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -10158,9 +10158,9 @@ } }, "recharts": { - "version": "2.0.0-beta.1", - "resolved": "https://registry.npmjs.org/recharts/-/recharts-2.0.0-beta.1.tgz", - "integrity": "sha512-awJH2DE6JRgp5ymzmH5dKh2Pu6prqZJCr3NRaYCcyub1fBa+fIG3ZlpLyl9hWizHPGEvfZLvcjIM+qgTsr9aSQ==", + "version": "2.0.0-beta.3", + "resolved": "https://registry.npmjs.org/recharts/-/recharts-2.0.0-beta.3.tgz", + "integrity": "sha512-NMdG5SRro2q/ovZu8fSwmJgPwSz1sBHlnI1MuR6l5urTeNfgapAcu+72GhXDv8MN48UXxL1Pk+IkWs03SQ/YGw==", "requires": { "classnames": "^2.2.5", "core-js": "^3.4.2", diff --git a/web/package.json b/web/package.json old mode 100755 new mode 100644 index ae8ba292e17..cdab5eb44d0 --- a/web/package.json +++ b/web/package.json @@ -17,7 +17,7 @@ "react-dom": "^16.8.4", "react-inlinesvg": "^1.2.0", "react-perfect-scrollbar": "^1.5.3", - "recharts": "^2.0.0-beta.1" + "recharts": "^2.0.0-beta.3" }, "browserslist": { "production": [ From 1dd24c2c5547d66c05d2ee004215b642389f74e1 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2020 01:59:52 +0000 Subject: [PATCH 08/14] Bump @supabase/postgrest-js in /libraries/supabase-js Bumps [@supabase/postgrest-js](https://github.com/supabase/postgrest-js) from 0.8.0 to 0.9.0. - [Release notes](https://github.com/supabase/postgrest-js/releases) - [Changelog](https://github.com/supabase/postgrest-js/blob/master/CHANGELOG.md) - [Commits](https://github.com/supabase/postgrest-js/commits) Signed-off-by: dependabot-preview[bot] --- libraries/supabase-js/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/supabase-js/package.json b/libraries/supabase-js/package.json index 14bc66af061..04c20acc8a2 100644 --- a/libraries/supabase-js/package.json +++ b/libraries/supabase-js/package.json @@ -48,7 +48,7 @@ }, "dependencies": { "@supabase/doctest-js": "^0.1.0", - "@supabase/postgrest-js": "^0.8.0", + "@supabase/postgrest-js": "^0.9.0", "@supabase/realtime-js": "^0.1.6", "superagent": "^5.2.1" } From 3427249e7495fdb12f00849e913f7473c7ed02a3 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2020 02:00:44 +0000 Subject: [PATCH 09/14] Bump mocha from 6.2.2 to 7.1.0 in /libraries/supabase-js Bumps [mocha](https://github.com/mochajs/mocha) from 6.2.2 to 7.1.0. - [Release notes](https://github.com/mochajs/mocha/releases) - [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md) - [Commits](https://github.com/mochajs/mocha/compare/v6.2.2...v7.1.0) Signed-off-by: dependabot-preview[bot] --- libraries/supabase-js/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/supabase-js/package.json b/libraries/supabase-js/package.json index 14bc66af061..32793b77bb1 100644 --- a/libraries/supabase-js/package.json +++ b/libraries/supabase-js/package.json @@ -42,7 +42,7 @@ "chai": "^4.1.2", "cross-env": "^5.2.1", "jest-websocket-mock": "^2.0.1", - "mocha": "^6.1.3", + "mocha": "^7.1.0", "nyc": "^14.1.1", "rimraf": "^2.6.2" }, From 5ef089907dd68aa05c242b5d5a62fba4a99c42ec Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2020 02:01:35 +0000 Subject: [PATCH 10/14] Bump babel-preset-minify from 0.3.0 to 0.5.1 in /libraries/supabase-js Bumps [babel-preset-minify](https://github.com/babel/minify) from 0.3.0 to 0.5.1. - [Release notes](https://github.com/babel/minify/releases) - [Changelog](https://github.com/babel/minify/blob/master/CHANGELOG.md) - [Commits](https://github.com/babel/minify/compare/babel-preset-minify@0.3.0...babel-preset-minify@0.5.1) Signed-off-by: dependabot-preview[bot] --- libraries/supabase-js/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/supabase-js/package.json b/libraries/supabase-js/package.json index 14bc66af061..5f14b8b69b3 100644 --- a/libraries/supabase-js/package.json +++ b/libraries/supabase-js/package.json @@ -38,7 +38,7 @@ "babel-plugin-add-module-exports": "^1.0.0", "babel-polyfill": "^6.26.0", "babel-preset-env": "^1.6.1", - "babel-preset-minify": "^0.3.0", + "babel-preset-minify": "^0.5.1", "chai": "^4.1.2", "cross-env": "^5.2.1", "jest-websocket-mock": "^2.0.1", From 4eafc988b1fd08e4ad1fb513800e9d5e99300656 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2020 02:03:24 +0000 Subject: [PATCH 11/14] Bump rimraf from 2.7.1 to 3.0.2 in /libraries/supabase-js Bumps [rimraf](https://github.com/isaacs/rimraf) from 2.7.1 to 3.0.2. - [Release notes](https://github.com/isaacs/rimraf/releases) - [Changelog](https://github.com/isaacs/rimraf/blob/master/CHANGELOG.md) - [Commits](https://github.com/isaacs/rimraf/compare/v2.7.1...v3.0.2) Signed-off-by: dependabot-preview[bot] --- libraries/supabase-js/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/supabase-js/package.json b/libraries/supabase-js/package.json index 14bc66af061..7041a6d5448 100644 --- a/libraries/supabase-js/package.json +++ b/libraries/supabase-js/package.json @@ -44,7 +44,7 @@ "jest-websocket-mock": "^2.0.1", "mocha": "^6.1.3", "nyc": "^14.1.1", - "rimraf": "^2.6.2" + "rimraf": "^3.0.2" }, "dependencies": { "@supabase/doctest-js": "^0.1.0", From bfdab168b699667dfc5f70898efc383658f19f1b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2020 03:26:18 +0000 Subject: [PATCH 12/14] Bump acorn from 6.4.0 to 6.4.1 in /examples/world Bumps [acorn](https://github.com/acornjs/acorn) from 6.4.0 to 6.4.1. - [Release notes](https://github.com/acornjs/acorn/releases) - [Commits](https://github.com/acornjs/acorn/compare/6.4.0...6.4.1) Signed-off-by: dependabot[bot] --- examples/world/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/world/package-lock.json b/examples/world/package-lock.json index dcacc94b770..9e9a0009c97 100644 --- a/examples/world/package-lock.json +++ b/examples/world/package-lock.json @@ -1209,9 +1209,9 @@ } }, "acorn": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.0.tgz", - "integrity": "sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw==" + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", + "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==" }, "adjust-sourcemap-loader": { "version": "2.0.0", From 15ff5260ce4da5eff3223192318a51d557ab5140 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2020 03:28:33 +0000 Subject: [PATCH 13/14] Bump nyc from 14.1.1 to 15.0.0 in /libraries/supabase-js Bumps [nyc](https://github.com/istanbuljs/nyc) from 14.1.1 to 15.0.0. - [Release notes](https://github.com/istanbuljs/nyc/releases) - [Changelog](https://github.com/istanbuljs/nyc/blob/master/CHANGELOG.md) - [Commits](https://github.com/istanbuljs/nyc/compare/v14.1.1...v15.0.0) Signed-off-by: dependabot-preview[bot] --- libraries/supabase-js/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/supabase-js/package.json b/libraries/supabase-js/package.json index 05e06669d2e..b24c73d4942 100644 --- a/libraries/supabase-js/package.json +++ b/libraries/supabase-js/package.json @@ -43,7 +43,7 @@ "cross-env": "^5.2.1", "jest-websocket-mock": "^2.0.1", "mocha": "^7.1.0", - "nyc": "^14.1.1", + "nyc": "^15.0.0", "rimraf": "^3.0.2" }, "dependencies": { From 7972df8abbba071dc7dd3c7dc64f83f0f4fc9979 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2020 03:29:58 +0000 Subject: [PATCH 14/14] Bump acorn in /examples/slack-clone-basic-tutorial/stage-1-setup Bumps [acorn](https://github.com/acornjs/acorn) from 6.4.0 to 6.4.1. - [Release notes](https://github.com/acornjs/acorn/releases) - [Commits](https://github.com/acornjs/acorn/compare/6.4.0...6.4.1) Signed-off-by: dependabot[bot] --- .../stage-1-setup/package-lock.json | 53 +++++++++++++------ 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/examples/slack-clone-basic-tutorial/stage-1-setup/package-lock.json b/examples/slack-clone-basic-tutorial/stage-1-setup/package-lock.json index bf615221e84..e128954e39e 100644 --- a/examples/slack-clone-basic-tutorial/stage-1-setup/package-lock.json +++ b/examples/slack-clone-basic-tutorial/stage-1-setup/package-lock.json @@ -1283,9 +1283,9 @@ } }, "acorn": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.0.tgz", - "integrity": "sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw==" + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", + "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==" }, "acorn-node": { "version": "1.8.2", @@ -1298,9 +1298,9 @@ }, "dependencies": { "acorn": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", - "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==" + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", + "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==" } } }, @@ -10447,7 +10447,8 @@ }, "ansi-regex": { "version": "2.1.1", - "bundled": true + "bundled": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -10465,11 +10466,13 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true + "bundled": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -10482,15 +10485,18 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "concat-map": { "version": "0.0.1", - "bundled": true + "bundled": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -10593,7 +10599,8 @@ }, "inherits": { "version": "2.0.4", - "bundled": true + "bundled": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -10603,6 +10610,7 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -10615,17 +10623,20 @@ "minimatch": { "version": "3.0.4", "bundled": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true + "bundled": true, + "optional": true }, "minipass": { "version": "2.9.0", "bundled": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -10642,6 +10653,7 @@ "mkdirp": { "version": "0.5.1", "bundled": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -10722,7 +10734,8 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true + "bundled": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -10732,6 +10745,7 @@ "once": { "version": "1.4.0", "bundled": true, + "optional": true, "requires": { "wrappy": "1" } @@ -10807,7 +10821,8 @@ }, "safe-buffer": { "version": "5.1.2", - "bundled": true + "bundled": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -10837,6 +10852,7 @@ "string-width": { "version": "1.0.2", "bundled": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -10854,6 +10870,7 @@ "strip-ansi": { "version": "3.0.1", "bundled": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -10892,11 +10909,13 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true + "bundled": true, + "optional": true }, "yallist": { "version": "3.1.1", - "bundled": true + "bundled": true, + "optional": true } } },