Merge pull request #10240 from supabase/master

Fix project deletion survey
This commit is contained in:
Terry Sutton authored and GitHub committed 2022-11-10 09:45:25 -03:30
commit ce5a8cd023
10 files changed
+6929 -15355

No files matched your search

+103 -31
View File
@@ -107,14 +107,21 @@
"in": "path",
"description": "Project ref",
"schema": { "minLength": 20, "maxLength": 20, "type": "string" }
},
{
"name": "slug",
"required": false,
"in": "query",
"schema": { "pattern": "/^[A-Za-z0-9_-]+$/", "type": "string" }
},
{ "name": "name", "required": false, "in": "query", "schema": { "type": "string" } },
{
"name": "verify_jwt",
"required": false,
"in": "query",
"schema": { "type": "boolean" }
}
],
"requestBody": {
"required": true,
"content": {
"application/json": { "schema": { "$ref": "#/components/schemas/CreateFunctionBody" } }
}
},
"responses": {
"201": {
"description": "",
@@ -230,14 +237,21 @@
"in": "path",
"description": "Function slug",
"schema": { "pattern": "/^[A-Za-z0-9_-]+$/", "type": "string" }
},
{
"name": "slug",
"required": false,
"in": "query",
"schema": { "pattern": "/^[A-Za-z0-9_-]+$/", "type": "string" }
},
{ "name": "name", "required": false, "in": "query", "schema": { "type": "string" } },
{
"name": "verify_jwt",
"required": false,
"in": "query",
"schema": { "type": "boolean" }
}
],
"requestBody": {
"required": true,
"content": {
"application/json": { "schema": { "$ref": "#/components/schemas/UpdateFunctionBody" } }
}
},
"responses": {
"200": {
"description": "",
@@ -302,13 +316,14 @@
}
}
},
"403": { "description": "" },
"500": { "description": "Failed to retrieve project's custom hostname config" }
},
"tags": ["custom hostname (beta)"],
"security": [{ "bearer": [] }]
},
"delete": {
"operationId": "remove",
"operationId": "removeCustomHostnameConfig",
"summary": "Deletes a project's custom hostname configuration",
"parameters": [
{
@@ -321,6 +336,7 @@
],
"responses": {
"200": { "description": "" },
"403": { "description": "" },
"500": { "description": "Failed to delete project custom hostname configuration" }
},
"tags": ["custom hostname (beta)"],
@@ -357,6 +373,7 @@
}
}
},
"403": { "description": "" },
"500": { "description": "Failed to update project custom hostname configuration" }
},
"tags": ["custom hostname (beta)"],
@@ -385,6 +402,7 @@
}
}
},
"403": { "description": "" },
"500": { "description": "Failed to verify project custom hostname configuration" }
},
"tags": ["custom hostname (beta)"],
@@ -413,6 +431,7 @@
}
}
},
"403": { "description": "" },
"500": { "description": "Failed to activate project custom hostname configuration" }
},
"tags": ["custom hostname (beta)"],
@@ -605,6 +624,65 @@
"tags": ["projects"],
"security": [{ "apiKeyHeader": [], "apiKeyParam": [] }, { "bearer": [] }]
}
},
"/v1/projects/{ref}/network-bans/retrieve": {
"post": {
"operationId": "getNetworkBans",
"summary": "Gets project's network bans",
"parameters": [
{
"name": "ref",
"required": true,
"in": "path",
"description": "Project ref",
"schema": { "minLength": 20, "maxLength": 20, "type": "string" }
}
],
"responses": {
"201": {
"description": "",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/NetworkBanResponse" }
}
}
},
"403": { "description": "" },
"500": { "description": "Failed to retrieve project's network bans" }
},
"tags": ["network bans (beta)"],
"security": [{ "bearer": [] }]
}
},
"/v1/projects/{ref}/network-bans": {
"delete": {
"operationId": "removeNetworkBan",
"summary": "Remove network bans.",
"parameters": [
{
"name": "ref",
"required": true,
"in": "path",
"description": "Project ref",
"schema": { "minLength": 20, "maxLength": 20, "type": "string" }
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/RemoveNetworkBanRequest" }
}
}
},
"responses": {
"200": { "description": "" },
"403": { "description": "" },
"500": { "description": "Failed to remove network bans." }
},
"tags": ["network bans (beta)"],
"security": [{ "bearer": [] }]
}
}
},
"info": { "title": "Supabase API (v1)", "description": "", "version": "1.0.0", "contact": {} },
@@ -665,16 +743,6 @@
"properties": { "name": { "type": "string" } },
"required": ["name"]
},
"CreateFunctionBody": {
"type": "object",
"properties": {
"slug": { "type": "string", "pattern": "/^[A-Za-z0-9_-]+$/" },
"name": { "type": "string" },
"body": { "type": "string" },
"verify_jwt": { "type": "boolean" }
},
"required": ["slug", "name", "body"]
},
"FunctionResponse": {
"type": "object",
"properties": {
@@ -704,14 +772,6 @@
},
"required": ["id", "slug", "name", "status", "version", "created_at", "updated_at"]
},
"UpdateFunctionBody": {
"type": "object",
"properties": {
"name": { "type": "string" },
"body": { "type": "string" },
"verify_jwt": { "type": "boolean" }
}
},
"UpdateCustomHostnameResponse": {
"type": "object",
"properties": {
@@ -757,6 +817,18 @@
"type": "object",
"properties": { "types": { "type": "string" } },
"required": ["types"]
},
"NetworkBanResponse": {
"type": "object",
"properties": {
"banned_ipv4_addresses": { "type": "array", "items": { "type": "string" } }
},
"required": ["banned_ipv4_addresses"]
},
"RemoveNetworkBanRequest": {
"type": "object",
"properties": { "ipv4_addresses": { "type": "array", "items": { "type": "string" } } },
"required": ["ipv4_addresses"]
}
}
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -469,7 +469,7 @@
"isOptional": true
},
"comment": {
"shortText": "self option enables client to receive message it broadcast\nack option instructs server to acknowlege that broadcast message was received"
"shortText": "self option enables client to receive message it broadcast\nack option instructs server to acknowledge that broadcast message was received"
},
"sources": [
{
@@ -1766,7 +1766,7 @@
"isOptional": true
},
"comment": {
"shortText": "self option enables client to receive message it broadcast\nack option instructs server to acknowlege that broadcast message was received"
"shortText": "self option enables client to receive message it broadcast\nack option instructs server to acknowledge that broadcast message was received"
},
"sources": [
{
@@ -2131,7 +2131,7 @@
"kindString": "Call signature",
"flags": {},
"comment": {
"shortText": "Retuns `true` is the connection is open."
"shortText": "Returns `true` is the connection is open."
},
"type": {
"type": "intrinsic",
@@ -2162,7 +2162,7 @@
"flags": {},
"comment": {
"shortText": "Logs the message.",
"text": "For customized logging, `this.logger` can be overriden.\n"
"text": "For customized logging, `this.logger` can be overridden.\n"
},
"parameters": [
{
@@ -6327,7 +6327,7 @@
"isOptional": true
},
"comment": {
"shortText": "self option enables client to receive message it broadcast\nack option instructs server to acknowlege that broadcast message was received"
"shortText": "self option enables client to receive message it broadcast\nack option instructs server to acknowledge that broadcast message was received"
},
"sources": [
{
@@ -6692,7 +6692,7 @@
"kindString": "Call signature",
"flags": {},
"comment": {
"shortText": "Retuns `true` is the connection is open."
"shortText": "Returns `true` is the connection is open."
},
"type": {
"type": "intrinsic",
@@ -6723,7 +6723,7 @@
"flags": {},
"comment": {
"shortText": "Logs the message.",
"text": "For customized logging, `this.logger` can be overriden.\n"
"text": "For customized logging, `this.logger` can be overridden.\n"
},
"parameters": [
{
@@ -7130,7 +7130,7 @@
"isOptional": true
},
"comment": {
"shortText": "self option enables client to receive message it broadcast\nack option instructs server to acknowlege that broadcast message was received"
"shortText": "self option enables client to receive message it broadcast\nack option instructs server to acknowledge that broadcast message was received"
},
"sources": [
{
@@ -10229,7 +10229,7 @@
"isOptional": true
},
"comment": {
"shortText": "self option enables client to receive message it broadcast\nack option instructs server to acknowlege that broadcast message was received"
"shortText": "self option enables client to receive message it broadcast\nack option instructs server to acknowledge that broadcast message was received"
},
"sources": [
{
@@ -11527,7 +11527,7 @@
"isOptional": true
},
"comment": {
"shortText": "self option enables client to receive message it broadcast\nack option instructs server to acknowlege that broadcast message was received"
"shortText": "self option enables client to receive message it broadcast\nack option instructs server to acknowledge that broadcast message was received"
},
"sources": [
{
@@ -11892,7 +11892,7 @@
"kindString": "Call signature",
"flags": {},
"comment": {
"shortText": "Retuns `true` is the connection is open."
"shortText": "Returns `true` is the connection is open."
},
"type": {
"type": "intrinsic",
@@ -11923,7 +11923,7 @@
"flags": {},
"comment": {
"shortText": "Logs the message.",
"text": "For customized logging, `this.logger` can be overriden.\n"
"text": "For customized logging, `this.logger` can be overridden.\n"
},
"parameters": [
{
@@ -15244,7 +15244,7 @@
"isOptional": true
},
"comment": {
"shortText": "self option enables client to receive message it broadcast\nack option instructs server to acknowlege that broadcast message was received"
"shortText": "self option enables client to receive message it broadcast\nack option instructs server to acknowledge that broadcast message was received"
},
"sources": [
{
+197 -81
View File
@@ -243,34 +243,33 @@
"maxLength": 20,
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"slug": {
"type": "string",
"pattern": "/^[A-Za-z0-9_-]+$/"
},
"name": {
"type": "string"
},
"body": {
"type": "string"
},
"verify_jwt": {
"type": "boolean"
}
},
"required": ["slug", "name", "body"]
}
},
{
"name": "slug",
"required": false,
"in": "query",
"schema": {
"pattern": "/^[A-Za-z0-9_-]+$/",
"type": "string"
}
},
{
"name": "name",
"required": false,
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "verify_jwt",
"required": false,
"in": "query",
"schema": {
"type": "boolean"
}
}
},
],
"responses": {
"201": {
"description": "",
@@ -565,29 +564,33 @@
"pattern": "/^[A-Za-z0-9_-]+$/",
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"body": {
"type": "string"
},
"verify_jwt": {
"type": "boolean"
}
}
}
},
{
"name": "slug",
"required": false,
"in": "query",
"schema": {
"pattern": "/^[A-Za-z0-9_-]+$/",
"type": "string"
}
},
{
"name": "name",
"required": false,
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "verify_jwt",
"required": false,
"in": "query",
"schema": {
"type": "boolean"
}
}
},
],
"responses": {
"200": {
"description": "",
@@ -750,6 +753,9 @@
}
}
},
"403": {
"description": ""
},
"500": {
"description": "Failed to retrieve project's custom hostname config"
}
@@ -762,7 +768,7 @@
]
},
"delete": {
"operationId": "remove",
"operationId": "removeCustomHostnameConfig",
"summary": "Deletes a project's custom hostname configuration",
"parameters": [
{
@@ -781,6 +787,9 @@
"200": {
"description": ""
},
"403": {
"description": ""
},
"500": {
"description": "Failed to delete project custom hostname configuration"
}
@@ -856,6 +865,9 @@
}
}
},
"403": {
"description": ""
},
"500": {
"description": "Failed to update project custom hostname configuration"
}
@@ -915,6 +927,9 @@
}
}
},
"403": {
"description": ""
},
"500": {
"description": "Failed to verify project custom hostname configuration"
}
@@ -974,6 +989,9 @@
}
}
},
"403": {
"description": ""
},
"500": {
"description": "Failed to activate project custom hostname configuration"
}
@@ -1329,6 +1347,113 @@
}
]
}
},
"/v1/projects/{ref}/network-bans/retrieve": {
"post": {
"operationId": "getNetworkBans",
"summary": "Gets project's network bans",
"parameters": [
{
"name": "ref",
"required": true,
"in": "path",
"description": "Project ref",
"schema": {
"minLength": 20,
"maxLength": 20,
"type": "string"
}
}
],
"responses": {
"201": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"banned_ipv4_addresses": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": ["banned_ipv4_addresses"]
}
}
}
},
"403": {
"description": ""
},
"500": {
"description": "Failed to retrieve project's network bans"
}
},
"tags": ["network bans (beta)"],
"security": [
{
"bearer": []
}
]
}
},
"/v1/projects/{ref}/network-bans": {
"delete": {
"operationId": "removeNetworkBan",
"summary": "Remove network bans.",
"parameters": [
{
"name": "ref",
"required": true,
"in": "path",
"description": "Project ref",
"schema": {
"minLength": 20,
"maxLength": 20,
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"ipv4_addresses": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": ["ipv4_addresses"]
}
}
}
},
"responses": {
"200": {
"description": ""
},
"403": {
"description": ""
},
"500": {
"description": "Failed to remove network bans."
}
},
"tags": ["network bans (beta)"],
"security": [
{
"bearer": []
}
]
}
}
},
"info": {
@@ -1438,25 +1563,6 @@
},
"required": ["name"]
},
"CreateFunctionBody": {
"type": "object",
"properties": {
"slug": {
"type": "string",
"pattern": "/^[A-Za-z0-9_-]+$/"
},
"name": {
"type": "string"
},
"body": {
"type": "string"
},
"verify_jwt": {
"type": "boolean"
}
},
"required": ["slug", "name", "body"]
},
"FunctionResponse": {
"type": "object",
"properties": {
@@ -1522,20 +1628,6 @@
},
"required": ["id", "slug", "name", "status", "version", "created_at", "updated_at"]
},
"UpdateFunctionBody": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"body": {
"type": "string"
},
"verify_jwt": {
"type": "boolean"
}
}
},
"UpdateCustomHostnameResponse": {
"type": "object",
"properties": {
@@ -1609,6 +1701,30 @@
}
},
"required": ["types"]
},
"NetworkBanResponse": {
"type": "object",
"properties": {
"banned_ipv4_addresses": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": ["banned_ipv4_addresses"]
},
"RemoveNetworkBanRequest": {
"type": "object",
"properties": {
"ipv4_addresses": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": ["ipv4_addresses"]
}
}
}
@@ -142,7 +142,7 @@ const ExitSurvey: FC<Props> = ({ freeTier, subscription, onSelectBack }) => {
// Submit exit survey to Hubspot
const feedbackRes = await post(`${API_URL}/feedback/send`, {
projectRef,
subject: 'Subscription cancellation - Exit survey',
subject: 'Subscription cancellation - Exit survey [Downgrade]',
tags: ['dashboard-exitsurvey'],
category: 'Billing',
message: generateFeedbackMessage(selectedReasons, downgradeMessage),
@@ -83,15 +83,17 @@ const DeleteProjectButton: FC<Props> = ({ type = 'danger' }) => {
})
}
// Submit exit survey to Hubspot
const feedbackRes = await post(`${API_URL}/feedback/send`, {
projectRef,
subject: 'Subscription cancellation - Exit survey',
tags: ['dashboard-exitsurvey'],
category: 'Billing',
message: generateFeedbackMessage(selectedReasons, cancellationMessage),
})
if (feedbackRes.error) throw feedbackRes.error
// Submit exit survey to Hubspot for paid projects
if (!isFree) {
const feedbackRes = await post(`${API_URL}/feedback/send`, {
projectRef,
subject: 'Subscription cancellation - Exit survey [Delete]',
tags: ['dashboard-exitsurvey'],
category: 'Billing',
message: generateFeedbackMessage(selectedReasons, cancellationMessage),
})
if (feedbackRes.error) throw feedbackRes.error
}
}
return (