This commit is contained in:
Benjamin Toby
2024-12-06 11:44:26 +01:00
parent 1ab41929b2
commit c49513c189
54 changed files with 628 additions and 425 deletions
+8
View File
@@ -0,0 +1,8 @@
declare function _exports({ query, dbFullName, queryValues, tableName, dbSchema, }: {
query: string;
queryValues?: (string | number)[];
dbFullName: string;
tableName?: string;
dbSchema?: import("../../../types").DSQL_DatabaseSchemaType;
}): Promise<import("../../../types").GetReturn>;
export = _exports;
+8
View File
@@ -0,0 +1,8 @@
declare function _exports({ query, dbFullName, queryValues, tableName, dbSchema, }: {
query: any;
queryValues?: (string | number)[];
dbFullName: string;
tableName?: string;
dbSchema?: import("../../../types").DSQL_DatabaseSchemaType;
}): Promise<import("../../../types").PostReturn>;
export = _exports;
@@ -0,0 +1,135 @@
declare namespace _exports {
export { GithubUserPayload };
}
declare function _exports({ code, clientId, clientSecret }: {
code: string;
clientId: string;
clientSecret: string;
}): Promise<GithubUserPayload | null | undefined>;
export = _exports;
type GithubUserPayload = {
/**
* - Full name merged eg. "JohnDoe"
*/
login: string;
/**
* - github user id
*/
id: number;
/**
* - Some other id
*/
node_id: string;
/**
* - profile picture
*/
avatar_url: string;
/**
* - some other id
*/
gravatar_id: string;
/**
* - Github user URL
*/
url: string;
/**
* - User html URL - whatever that means
*/
html_url: string;
/**
* - Followers URL
*/
followers_url: string;
/**
* - Following URL
*/
following_url: string;
/**
* - Gists URL
*/
gists_url: string;
/**
* - Starred URL
*/
starred_url: string;
/**
* - Subscriptions URL
*/
subscriptions_url: string;
/**
* - Organizations URL
*/
organizations_url: string;
/**
* - Repositories URL
*/
repos_url: string;
/**
* - Received Events URL
*/
received_events_url: string;
/**
* - Common value => "User"
*/
type: string;
/**
* - Is site admin or not? Boolean
*/
site_admin: boolean;
/**
* - More like "username"
*/
name: string;
/**
* - User company
*/
company: string;
/**
* - User blog URL
*/
blog: string;
/**
* - User Location
*/
location: string;
/**
* - User Email
*/
email: string;
/**
* - Is user hireable
*/
hireable: string;
/**
* - User bio
*/
bio: string;
/**
* - User twitter username
*/
twitter_username: string;
/**
* - Number of public repositories
*/
public_repos: number;
/**
* - Number of public gists
*/
public_gists: number;
/**
* - Number of followers
*/
followers: number;
/**
* - Number of following
*/
following: number;
/**
* - Date created
*/
created_at: string;
/**
* - Date updated
*/
updated_at: string;
};
@@ -0,0 +1,19 @@
declare namespace _exports {
export { FunctionReturn };
}
declare const _exports: import("../../../types").HandleSocialDbFunction;
export = _exports;
type FunctionReturn = {
/**
* - Did the operation complete successfully or not?
*/
success: boolean;
/**
* - User payload object: or "null"
*/
user: {
id: number;
first_name: string;
last_name: string;
} | null;
};
@@ -0,0 +1,2 @@
declare const _exports: import("../../../types").APICreateUserFunction;
export = _exports;
+2
View File
@@ -0,0 +1,2 @@
declare const _exports: import("../../../types").APILoginFunction;
export = _exports;
@@ -0,0 +1,9 @@
declare function _exports({ existingUser, database, userId, additionalFields, }: {
existingUser: {
[x: string]: any;
};
database: string;
userId?: string | number;
additionalFields?: string[];
}): Promise<import("../../../types").ApiReauthUserReturn>;
export = _exports;
@@ -0,0 +1,15 @@
declare function _exports({ email, database, email_login_field, mail_domain, mail_port, sender, mail_username, mail_password, html, }: {
email: string;
database: string;
email_login_field?: string;
mail_domain?: string;
mail_port?: number;
sender?: string;
mail_username?: string;
mail_password?: string;
html: string;
}): Promise<{
success: boolean;
msg?: string;
}>;
export = _exports;
+12
View File
@@ -0,0 +1,12 @@
declare function _exports({ payload, dbFullName }: {
payload: {
id: string | number;
} & {
[x: string]: (string | number | null | undefined);
};
dbFullName: string;
}): Promise<{
success: boolean;
payload: any;
}>;
export = _exports;
@@ -0,0 +1,13 @@
declare function _exports({ code, clientId, clientSecret, database, additionalFields, res, email, userId, }: {
code?: string;
clientId?: string;
clientSecret?: string;
database?: string;
additionalFields?: {
[x: string]: any;
};
res?: any;
email?: string;
userId?: string | number;
}): Promise<import("../../../../types").APIGoogleLoginFunctionReturn>;
export = _exports;
@@ -0,0 +1,2 @@
declare const _exports: import("../../../../types").APIGoogleLoginFunction;
export = _exports;
@@ -0,0 +1,10 @@
declare function _exports({ query, user }: {
query: {
invite: number;
database_access: string;
priviledge: string;
email: string;
};
user: import("../../types").UserType;
}): Promise<any>;
export = _exports;
+4
View File
@@ -0,0 +1,4 @@
declare function _exports({ userId }: {
userId: number | string;
}): Promise<any>;
export = _exports;
@@ -0,0 +1,5 @@
declare function _exports({ userId, database }: {
userId: number;
database: string;
}): Promise<any>;
export = _exports;
@@ -0,0 +1,5 @@
declare function _exports(): {
keyCookieName: string;
csrfCookieName: string;
};
export = _exports;
+30
View File
@@ -0,0 +1,30 @@
export = runQuery;
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/**
* Run DSQL users queries
* ==============================================================================
* @param {object} params - An object containing the function parameters.
* @param {string} params.dbFullName - Database full name. Eg. "datasquire_user_2_test"
* @param {string | any} params.query - Query string or object
* @param {boolean} [params.readOnly] - Is this operation read only?
* @param {boolean} [params.local] - Is this operation read only?
* @param {import("../../../types").DSQL_DatabaseSchemaType} [params.dbSchema] - Database schema
* @param {(string | number)[]} [params.queryValuesArray] - An optional array of query values if "?" is used in the query string
* @param {string} [params.tableName] - Table Name
*
* @return {Promise<any>}
*/
declare function runQuery({ dbFullName, query, readOnly, dbSchema, queryValuesArray, tableName, local, }: {
dbFullName: string;
query: string | any;
readOnly?: boolean;
local?: boolean;
dbSchema?: import("../../../types").DSQL_DatabaseSchemaType;
queryValuesArray?: (string | number)[];
tableName?: string;
}): Promise<any>;
@@ -0,0 +1,15 @@
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/**
* ==============================================================================
* @param {Object} params
* @param {string | number} params.userId
* @returns {import("../../types").DSQL_DatabaseSchemaType[] | null}
*/
export default function grabUserSchemaData({ userId }: {
userId: string | number;
}): import("../../types").DSQL_DatabaseSchemaType[] | null;
@@ -0,0 +1,8 @@
declare function _exports({ to, subject, text, html, alias, }: {
to?: string;
subject?: string;
text?: string;
html?: string;
alias?: string | null;
}): Promise<any>;
export = _exports;
+11
View File
@@ -0,0 +1,11 @@
declare function _exports({ url, method, hostname, path, headers, body, port, scheme, }: {
scheme?: string;
url?: string;
method?: string;
hostname?: string;
path?: string;
port?: number | string;
headers?: object;
body?: object;
}): Promise<any>;
export = _exports;
+17
View File
@@ -0,0 +1,17 @@
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/**
* ==============================================================================
* @param {Object} params
* @param {string | number} params.userId
* @param {import("../../types").DSQL_DatabaseSchemaType[]} params.schemaData
* @returns {boolean}
*/
export default function setUserSchemaData({ userId, schemaData }: {
userId: string | number;
schemaData: import("../../types").DSQL_DatabaseSchemaType[];
}): boolean;
+13
View File
@@ -0,0 +1,13 @@
export = decrypt;
/**
* @param {object} param0
* @param {string} param0.encryptedString
* @param {string} [param0.encryptionKey]
* @param {string} [param0.encryptionSalt]
* @returns
*/
declare function decrypt({ encryptedString, encryptionKey, encryptionSalt }: {
encryptedString: string;
encryptionKey?: string;
encryptionSalt?: string;
}): string;
+14
View File
@@ -0,0 +1,14 @@
export = encrypt;
/**
*
* @param {object} param0
* @param {string} param0.data
* @param {string} [param0.encryptionKey]
* @param {string} [param0.encryptionSalt]
* @returns {string | null}
*/
declare function encrypt({ data, encryptionKey, encryptionSalt }: {
data: string;
encryptionKey?: string;
encryptionSalt?: string;
}): string | null;
+4 -6
View File
@@ -2,9 +2,7 @@ export = sqlGenerator;
declare function sqlGenerator(Param0: {
genObject?: import("../../../types").ServerQueryParam;
tableName: string;
}):
| {
string: string;
values: string[];
}
| undefined;
}): {
string: string;
values: string[];
} | undefined;
@@ -1,6 +1,6 @@
export = sqlInsertGenerator;
/**
* @typedef {object} SQLINsertGenReturn
* @typedef {object} SQLInsertGenReturn
* @property {string} query
* @property {string[]} values
*/
@@ -9,16 +9,16 @@ export = sqlInsertGenerator;
* @param {any[]} param0.data
* @param {string} param0.tableName
*
* @return {SQLINsertGenReturn | undefined}
* @return {SQLInsertGenReturn | undefined}
*/
declare function sqlInsertGenerator({ tableName, data }: {
data: any[];
tableName: string;
}): SQLINsertGenReturn | undefined;
}): SQLInsertGenReturn | undefined;
declare namespace sqlInsertGenerator {
export { SQLINsertGenReturn };
export { SQLInsertGenReturn };
}
type SQLINsertGenReturn = {
type SQLInsertGenReturn = {
query: string;
values: string[];
};