Skip to content

Commit

Permalink
✨ feature: add methos to get all ticktick tasks and github commits
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasvtiradentes committed Jan 18, 2024
1 parent aaa2c6d commit a51eb70
Show file tree
Hide file tree
Showing 51 changed files with 979 additions and 2,937 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/nodejs-ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
- name: 1 - checkout the repository
uses: actions/checkout@v3

- name: 2 - Use Node.js 16.x
- name: 2 - Use Node.js 20.8.1
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 20.8.1

- name: 3 - install dependencies
run: npm install
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"editor.defaultFormatter": "esbenp.prettier-vscode",
"explorer.fileNesting.enabled": true,
"explorer.fileNesting.patterns": {
"package.json": ".czrc, .editorconfig, commitlint.config.js, .eslintignore, .eslintrc.json, .lintstagedrc, .prettierignore, .prettierrc.json, jest.config.js, tsconfig.json, package-lock.json, yarn.lock, pnpm-lock.yaml",
"package.json": ".czrc, .editorconfig, rollup.config.js, commitlint.config.js, .eslintignore, .eslintrc.json, .lintstagedrc, .prettierignore, .prettierrc.json, jest.config.js, tsconfig.json, package-lock.json, yarn.lock, pnpm-lock.yaml",
"release.config.js": ".npmignore",
"README.md": "LICENSE",
},
Expand Down
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports = {
rules: {
'gitmoji-workflow': [2, 'always'],
'type-enum': [2, 'always', VALID_COMMIT_TYPES],
'header-max-length': [2, 'always', 70]
'header-max-length': [2, 'always', 85]
}
};

Expand Down
1,141 changes: 0 additions & 1,141 deletions dist/GcalSyncOld.js

This file was deleted.

1 change: 1 addition & 0 deletions dist/classes/GAS.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare function checkIfisGASEnvironment(): boolean;
3 changes: 0 additions & 3 deletions dist/classes/GAS.js

This file was deleted.

15 changes: 15 additions & 0 deletions dist/classes/Github.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
type ParsedGithubCommit = {
commitDate: string;
commitMessage: string;
commitId: string;
commitUrl: string;
repository: string;
repositoryId: string;
repositoryName: string;
repositoryOwner: string;
repositoryDescription: string;
isRepositoryPrivate: boolean;
isRepositoryFork: boolean;
};
export declare function getAllGithubCommits(username: string, personalToken: string): Promise<ParsedGithubCommit[]>;
export {};
5 changes: 0 additions & 5 deletions dist/classes/Github.js

This file was deleted.

5 changes: 5 additions & 0 deletions dist/classes/GoogleCalendar.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="google-apps-script" />
export declare const createMissingCalendars: (allGcalendarsNames: string[]) => void;
export declare const getAllCalendars: () => GoogleAppsScript.Calendar.Schema.CalendarListEntry[];
export declare const checkIfCalendarExists: (calendarName: string) => GoogleAppsScript.Calendar.Schema.CalendarListEntry;
export declare const createCalendar: (calName: string) => GoogleAppsScript.Calendar.Schema.Calendar;
30 changes: 30 additions & 0 deletions dist/classes/ICS.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
type TParsedTicktickTask = {
id: string;
name: string;
description: string;
tzid: string;
start: TDate;
end: TDate;
};
type TDate = {
date: string;
} | {
dateTime: string;
timeZone: string;
};
export declare const getIcsCalendarTasks: (icsLink: string, timezoneCorrection: number) => Promise<TParsedTicktickTask[]>;
export declare function getParsedIcsDatetimes(dtstart: string, dtend: string, timezone: string, timezoneCorrection: number): {
finalDtstart: {
date: string;
} | {
dateTime: string;
timeZone: string;
};
finalDtend: {
date: string;
} | {
dateTime: string;
timeZone: string;
};
};
export {};
5 changes: 0 additions & 5 deletions dist/classes/ICS.js

This file was deleted.

5 changes: 5 additions & 0 deletions dist/consts/app_info.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export declare const APP_INFO: {
readonly name: "gcal-sync";
readonly version: "2.0.0";
readonly github_repository: "github/repo";
};
5 changes: 0 additions & 5 deletions dist/consts/app_info.js

This file was deleted.

3 changes: 3 additions & 0 deletions dist/consts/configs.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export declare const CONFIGS: {
readonly DEBUG_MODE: true;
};
3 changes: 0 additions & 3 deletions dist/consts/configs.js

This file was deleted.

9 changes: 9 additions & 0 deletions dist/consts/errors.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export declare const ERRORS: {
readonly productionOnly: "This method cannot run in non-production environments";
readonly incorrectIcsCalendar: "The link you provided is not a valid ICS calendar: ";
readonly mustSpecifyConfig: "You must specify the settings when starting the class";
readonly httpsError: "You provided an invalid ICS calendar link: ";
readonly invalidGithubToken: "You provided an invalid github token";
readonly invalidGithubUsername: "You provided an invalid github username";
readonly abusiveGoogleCalendarApiUse: "Due to the numerous operations in the last few hours, the google api is not responding.";
};
9 changes: 0 additions & 9 deletions dist/consts/errors.js

This file was deleted.

11 changes: 11 additions & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { TConfigs } from './schemas/configs.schema';
declare class GcalSync {
private configs;
today_date: string;
isGASEnvironment: boolean;
constructor(configs: TConfigs);
showConfigs(): void;
sync(): Promise<void>;
}
export default GcalSync;
export { TConfigs };
Loading

0 comments on commit a51eb70

Please sign in to comment.