Demostripe-to-discord.ts8 matches
35* Main handler for Stripe webhook events
36*/
37export default async function(req: Request): Promise<Response> {
38// Only allow POST requests
39if (req.method !== 'POST') {
96* Format a Stripe event into a Discord message
97*/
98function formatStripeEventForDiscord(event: Stripe.Event): any {
99// Base embed structure
100const embed: any = {
162* Send a formatted message to Discord
163*/
164async function sendToDiscord(webhookUrl: string, message: any): Promise<void> {
165const response = await fetch(webhookUrl, {
166method: 'POST',
180* Format a human-readable title from an event type
181*/
182function formatEventTitle(eventType: string): string {
183const parts = eventType.split('.');
184const entity = parts[0];
211* Get the appropriate color for an event type
212*/
213function getColorForEvent(eventType: string): number {
214if (eventType.includes('succeeded') || eventType.includes('created') || eventType.includes('paid')) {
215return COLORS.success;
228* Format a currency amount
229*/
230function formatAmount(amount: number, currency: string): string {
231const formatter = new Intl.NumberFormat('en-US', {
232style: 'currency',
242* Format a date range
243*/
244function formatDateRange(startTimestamp: number, endTimestamp: number): string {
245const start = new Date(startTimestamp * 1000);
246const end = new Date(endTimestamp * 1000);
260* Get subscription plan name
261*/
262function getSubscriptionPlanName(subscription: Stripe.Subscription): string {
263if (!subscription.items?.data?.length) {
264return 'N/A';
automate-workflowsREADME.md1 match
67- `types.ts` - TypeScript interfaces and types
8- `utils.ts` - Utility functions for parsing commits and generating markdown
910## Key Components
automate-workflowsREADME.md1 match
12- Form for entering repository details and commit range
13- Preview of generated release notes in Markdown format
14- Copy to clipboard functionality
15- Download as Markdown file
16- Error handling and loading states
automate-workflowsindex.js1 match
16});
1718function setupFormHandling() {
19const form = document.getElementById('release-form');
20const generateBtn = document.getElementById('generate-btn');
automate-workflowsutils.ts4 matches
3// Parse a commit message according to conventional commit format
4// https://www.conventionalcommits.org/
5export function parseCommitMessage(commit: GitHubCommit): { type: CommitType; message: string } {
6const { message } = commit.commit;
7
2627// Group commits by type for release notes
28export function groupCommitsByType(commits: GitHubCommit[]): ReleaseNoteSection[] {
29const sections: Record<CommitType, ReleaseNoteItem[]> = {} as Record<CommitType, ReleaseNoteItem[]>;
30
5657// Generate markdown for release notes
58export function generateMarkdown(title: string, date: string, sections: ReleaseNoteSection[]): string {
59let markdown = `# ${title}\n\n`;
60markdown += `*Released on ${date}*\n\n`;
7475// Format date to YYYY-MM-DD
76export function formatDate(date: Date): string {
77return date.toISOString().split('T')[0];
78}
Towniestyles.css2 matches
162transition-property: background-color;
163transition-duration: 400ms;
164transition-timing-function: linear;
165}
166840transition-property: color, background-color, border-color, opacity;
841transition-duration: 200ms;
842transition-timing-function: ease-in-out;
843}
844
automate-workflowsmain.tsx1 match
1export default async function (req: Request): Promise<Response> {
2return Response.json({ ok: true })
3}
Testwebsiteindex.ts4 matches
1export default async function (req: Request) {
2const html = `<!DOCTYPE html>
3<html lang="en">
381382<script>
383// Simple scroll to section functionality
384document.querySelectorAll('a[href^="#"]').forEach(anchor => {
385anchor.addEventListener('click', function (e) {
386e.preventDefault();
387
392});
393
394// Mobile menu toggle functionality could be added here
395</script>
396</body>
stevensDemoqueries.ts4 matches
6const tableName = "memories";
78export async function getAllMemories(): Promise<Memory[]> {
9const result = await sqlite.execute(
10`SELECT id, date, text, createdBy, createdDate, tags FROM ${tableName}
23}
2425export async function createMemory(
26memory: Omit<Memory, "id">,
27): Promise<Memory> {
51}
5253export async function updateMemory(
54id: string,
55memory: Partial<Omit<Memory, "id">>,
70}
7172export async function deleteMemory(id: string): Promise<void> {
73await sqlite.execute(`DELETE FROM ${tableName} WHERE id = ?`, [id]);
74}
stevensDemopopulateDemo.ts5 matches
56// Create the memories_demo table
7async function createMemoriesDemoTable() {
8try {
9await sqlite.execute(`
2526// Create a fake memory with proper ID and timestamps
27function createMemory(date, text, createdBy, tags, createdDateOffset = 0) {
28const id = nanoid(10);
29// Base date is April 5, 2025
375376// Insert memories into the database
377async function insertDemoMemories() {
378try {
379// Clear existing data if any
406}
407408// Main function to populate demo data
409export default async function populateDemo() {
410try {
411// Create the table