Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 108 additions & 1 deletion ww-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,32 @@ export default {
getIsValid({ parameters, body }) {
return !parameters || body;
},
copilot: {
description: "Creates a new user account with the provided credentials",
returns: "object - The newly created user data",
schema: {
headers: {
type: "array",
description: "Custom headers to send with the request",
bindable: true
},
withCredentials: {
type: "boolean",
description: "Whether to include credentials (cookies) with the request",
bindable: true
},
parameters: {
type: "object",
description: "URL parameters to include in the request",
bindable: true
},
body: {
type: "object",
description: "Request body containing user registration data",
bindable: true
}
}
},
/* wwEditor:end */
},
{
Expand All @@ -78,6 +104,32 @@ export default {
getIsValid({ parameters, body }) {
return !parameters || body;
},
copilot: {
description: "Authenticates a user with their credentials",
returns: "object - The authenticated user data",
schema: {
headers: {
type: "array",
description: "Custom headers to send with the request",
bindable: true
},
withCredentials: {
type: "boolean",
description: "Whether to include credentials (cookies) with the request",
bindable: true
},
parameters: {
type: "object",
description: "URL parameters to include in the request",
bindable: true
},
body: {
type: "object",
description: "Request body containing login credentials",
bindable: true
}
}
},
/* wwEditor:end */
},
{
Expand All @@ -89,6 +141,27 @@ export default {
getIsValid({ provider, type }) {
return !!provider && !!type;
},
copilot: {
description: "Initiates OAuth login flow with a third-party provider",
returns: "object - The authenticated user data after successful OAuth login",
schema: {
provider: {
type: "string",
description: "The OAuth provider to use (e.g. 'github-oauth', 'facebook-oauth')",
bindable: true
},
type: {
type: "string",
description: "The type of OAuth flow to initiate",
bindable: true
},
redirectPage: {
type: "string",
description: "The page to redirect to after successful authentication",
bindable: true
}
}
},
/* wwEditor:end */
},
{
Expand All @@ -97,18 +170,52 @@ export default {
isAsync: true,
/* wwEditor:start */
edit: () => import('./src/components/Functions/FetchUser.vue'),
copilot: {
description: "Fetches the current authenticated user's data",
returns: "object - The current user's data",
schema: {
headers: {
type: "array",
description: "Custom headers to send with the request",
bindable: true
},
withCredentials: {
type: "boolean",
description: "Whether to include credentials (cookies) with the request",
bindable: true
}
}
},
/* wwEditor:end */
},
{
name: 'Store Auth Token',
code: 'storeAuthToken',
/* wwEditor:start */
edit: () => import('./src/components/Functions/StoreAuthToken.vue'),
copilot: {
description: "Stores an authentication token in the browser",
returns: "void",
schema: {
authToken: {
type: "string",
description: "The authentication token to store",
bindable: true
}
}
},
/* wwEditor:end */
},
{
name: 'Logout',
code: 'logout',
/* wwEditor:start */
copilot: {
description: "Logs out the current user and clears authentication data",
returns: "void",
schema: {}
},
/* wwEditor:end */
},
],
};
};