Skip to content

Instantly share code, notes, and snippets.

View AlexandroMtzG's full-sized avatar

Alexandro Martínez AlexandroMtzG

View GitHub Profile
@AlexandroMtzG
AlexandroMtzG / schema.prisma
Created September 29, 2022 01:34
SaasRock schema
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {

SaasRock Individual Contributor License Agreement (“Agreement”)

Version 1.0 - October 16th, 2022

Thank you for your interest in contributing to a SaasRock Core or SaasRock Enterprise (“SaasRock”) project. To clarify the intellectual property rights in the project and any Contributions, SaasRock requires that You accept this Contributor License Agreement. This license is for Your protection as a contributor as well as the protection of SaasRock, recipients of software distributed or made available by SaasRock, and other contributors; it does not change your rights to use your own Contributions for any other purpose.

You accept and agree to the following terms and conditions for Your past, present, and future Contributions submitted to SaasRock. Except for the licenses granted herein to SaasRock and the recipients of software distributed or made available by SaasRock, You reserve all right, title, and interest in and to Your Contributions.

  1. Definitions.
@AlexandroMtzG
AlexandroMtzG / DropboxSignService.ts
Created January 29, 2023 00:46
Implementation of Dropbox Sign (formerly HelloSign) Node.js SDK
import fs from "fs";
var hellosign = require("hellosign-sdk")({ key: process.env.DROPBOX_SIGN_API_KEY });
export type DropboxSignatureRequestDto = {
signature_request_id: string;
test_mode: boolean;
title: string;
original_title: string;
subject: string;
message: string;
import { Colors } from "~/application/enums/shared/Colors";
import SimpleBadge from "~/components/ui/badges/SimpleBadge";
import { SignerDto } from "../dtos/SignerDto";
export default function ContractSignersList({ items }: { items?: SignerDto[] }) {
function sortedItems() {
return (
items?.sort((a, b) => {
if (a.role === "signer" && b.role === "viewer") {
return -1;
import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { Colors } from "~/application/enums/shared/Colors";
import ButtonTertiary from "~/components/ui/buttons/ButtonTertiary";
import InputSelector from "~/components/ui/input/InputSelector";
import CollapsibleRow from "~/components/ui/tables/CollapsibleRow";
import { useAppData } from "~/utils/data/useAppData";
import { TenantUserWithDetails } from "~/utils/db/tenants.db.server";
import { SignerDto } from "../dtos/SignerDto";
import { Fragment } from "react";
import { DocumentDto } from "../dtos/DocumentDto";
import { DocumentTypeDto } from "../dtos/DocumentTypeDto";
interface Props {
year: number;
types: DocumentTypeDto[];
documents: DocumentDto[];
}
{
"entities": [
{
"type": "admin",
"name": "documentType",
"slug": "document-types",
"title": "Document Type",
"titlePlural": "Document Types",
"prefix": "DTY",
"properties": [
async function convertToImages({ file }: { file: string }): Promise<{ name: string; base64: string; path: string }[]> {
return new Promise(async (resolve, reject) => {
await fetch("https://tools.saasrock.com/api/pdf-to-image?file=" + file)
.then(async (response) => {
const jsonBody = await response.json();
const images = jsonBody.images as { name: string; base64: string; path: string }[];
resolve(images);
})
.catch((e) => {
reject(e);
import Tesseract from "tesseract.js";
import PdfService from "./PdfService";
export const OcrTesseractLanguages = [
{ name: "English", value: "eng" },
{ name: "Spanish", value: "spa" },
];
async function scan(file: string, lang: string): Promise<string> {
return await new Promise(async (resolve, reject) => {
import clsx from "clsx";
import { Fragment } from "react";
import { DocumentTypeDto } from "~/modules/codeGeneratorTests/document-types/dtos/DocumentTypeDto";
import { DocumentDto } from "~/modules/codeGeneratorTests/documents/dtos/DocumentDto";
import DateUtils from "~/utils/shared/DateUtils";
import DocumentTypeHelper from "../helpers/DocumentTypeHelper";
interface Props {
year: number;
types: DocumentTypeDto[];