This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

feat: npm package, remove useless config

+95 -63
-3
config.go
··· 8 8 9 9 type Configuration struct { 10 10 Port int `env:"PORT" envDefault:"8080"` 11 - ChurrosApiUrl string `env:"CHURROS_API_URL" envDefault:"http://localhost:4000/graphql"` 12 - PollInterval int `env:"POLL_INTERVAL_MS" envDefault:"500"` 13 - RedisURL string `env:"REDIS_URL" envDefault:"redis://localhost:6379"` 14 11 ChurrosDatabaseURL string `env:"DATABASE_URL"` 15 12 VapidPublicKey string `env:"PUBLIC_VAPID_KEY"` 16 13 VapidPrivateKey string `env:"VAPID_PRIVATE_KEY"`
+2
index.ts
··· 1 + export * from './types.js'; 2 + export * from './constants.js';
+36
package.json
··· 1 1 { 2 + "name": "@inp-net/notella", 3 + "author": { 4 + "email": "contact@net7.dev", 5 + "name": "Churros DevTeam", 6 + "url": "https://churros.inpt.fr/credits/" 7 + }, 8 + "contributors": [ 9 + { 10 + "name": "ewen-lbh", 11 + "email": "hey@ewen.works", 12 + "url": "https://ewen.works" 13 + } 14 + ], 15 + "repository": { 16 + "type": "git", 17 + "url": "https://git.inpt.fr/churros/notella" 18 + }, 19 + "homepage": "https://git.inpt.fr/churros/notella", 20 + "bugs": { 21 + "url": "https://git.inpt.fr/churros/notella/-/issues" 22 + }, 23 + "license": "AGPL-3.0", 24 + "version": "0.1.2", 25 + "description": "Types and constants for Notella, Churros' notification scheduler", 2 26 "type": "module", 3 27 "devDependencies": { 4 28 "nats": "^2.28.2", ··· 8 32 }, 9 33 "dependencies": { 10 34 "@prisma/client": "^5.20.0" 35 + }, 36 + "files": [ 37 + "README.md", 38 + "constants.ts", 39 + "types.d.ts", 40 + "index.ts" 41 + ], 42 + "exports": { 43 + ".": { 44 + "default": "./index.ts", 45 + "types": "./index.ts" 46 + } 11 47 } 12 48 }
+1 -1
scripts/typing.go
··· 81 81 } 82 82 83 83 // Print or save the TypeScript output 84 - os.WriteFile("types.d.ts", output, 0644) 84 + os.WriteFile("types.ts", output, 0644) 85 85 86 86 // Also save useful constants 87 87 os.WriteFile("constants.ts", []byte(fmt.Sprintf("export const STREAM_NAME = '%s';\nexport const SUBJECT_NAME = '%s';\n", notella.StreamName, notella.SubjectName)), 0644)
-3
server/main.go
··· 37 37 ll.Info("Running with config ") 38 38 ll.Log("", "reset", "port: [bold]%d[reset]", config.Port) 39 39 ll.Log("", "reset", "contact email: [bold]%s[reset]", config.ContactEmail) 40 - ll.Log("", "reset", "Churros API URL: [bold]%s[reset]", redactURL(config.ChurrosApiUrl)) 41 40 ll.Log("", "reset", "Churros DB URL: [bold]%s[reset]", redactURL(config.ChurrosDatabaseURL)) 42 - ll.Log("", "reset", "Redis URL: [bold]%s[reset]", redactURL(config.RedisURL)) 43 - ll.Log("", "reset", "Poll interval: [bold]%d[reset] ms", config.PollInterval) 44 41 if config.VapidPublicKey != "" && config.VapidPrivateKey != "" { 45 42 ll.Log("", "reset", "VAPID keys: [bold][green]set[reset]") 46 43 } else {
-56
types.d.ts
··· 1 - export interface Message { 2 - /** 3 - * URL to go to when the action button is clicked 4 - */ 5 - action: string; 6 - /** 7 - * Additional action buttons 8 - */ 9 - actions: Action[]; 10 - /** 11 - * Notification body 12 - */ 13 - body: string; 14 - /** 15 - * Type of event that triggered the notification 16 - */ 17 - event: Event; 18 - /** 19 - * Unique ID for the notification scheduling request. 20 - */ 21 - id: string; 22 - /** 23 - * URL to an image to display in the notification 24 - */ 25 - image: string; 26 - /** 27 - * Churros ID of the ressource (the ticket, the post, the comment, etc) 28 - * Used to determine to whom the notification should be sent 29 - * For godchild_request, this is not a user id, but a godparent request id. 30 - */ 31 - object_id: string; 32 - /** 33 - * When to push the notification 34 - */ 35 - send_at: Date; 36 - /** 37 - * Notification title 38 - */ 39 - title: string; 40 - } 41 - 42 - export interface Action { 43 - action: string; 44 - label: string; 45 - } 46 - 47 - /** 48 - * Type of event that triggered the notification 49 - */ 50 - export enum Event { 51 - CommentReply = 'comment_reply', 52 - GodchildRequest = 'godchild_request', 53 - NewComment = 'new_comment', 54 - NewPost = 'new_post', 55 - NewTicket = 'new_ticket', 56 - }
+56
types.ts
··· 1 + export interface Message { 2 + /** 3 + * URL to go to when the action button is clicked 4 + */ 5 + action: string; 6 + /** 7 + * Additional action buttons 8 + */ 9 + actions: Action[]; 10 + /** 11 + * Notification body 12 + */ 13 + body: string; 14 + /** 15 + * Type of event that triggered the notification 16 + */ 17 + event: Event; 18 + /** 19 + * Unique ID for the notification scheduling request. 20 + */ 21 + id: string; 22 + /** 23 + * URL to an image to display in the notification 24 + */ 25 + image: string; 26 + /** 27 + * Churros ID of the ressource (the ticket, the post, the comment, etc) 28 + * Used to determine to whom the notification should be sent 29 + * For godchild_request, this is not a user id, but a godparent request id. 30 + */ 31 + object_id: string; 32 + /** 33 + * When to push the notification 34 + */ 35 + send_at: Date; 36 + /** 37 + * Notification title 38 + */ 39 + title: string; 40 + } 41 + 42 + export interface Action { 43 + action: string; 44 + label: string; 45 + } 46 + 47 + /** 48 + * Type of event that triggered the notification 49 + */ 50 + export enum Event { 51 + CommentReply = "comment_reply", 52 + GodchildRequest = "godchild_request", 53 + NewComment = "new_comment", 54 + NewPost = "new_post", 55 + NewTicket = "new_ticket", 56 + }