Commit 54dbf619 authored by Grant's avatar Grant
Browse files

add ical ics endpoints

parent 14ac9fe4
Loading
Loading
Loading
Loading
Loading

.npmrc

0 → 100644
+3 −0
Original line number Diff line number Diff line
# sc07.dev sc07 group
//sc07.dev/api/v4/groups/3/-/packages/npm/:_authToken="$NPM_TOKEN"
@sc07:registry=https://sc07.dev/api/v4/groups/3/-/packages/npm/
 No newline at end of file
+120 −0

File changed.

Preview size limit exceeded, changes collapsed.

+39 −0
Original line number Diff line number Diff line
@@ -19,7 +19,22 @@ tags:
    x-displayName: Authentication
    description: |
      Automated authenciation negotiation for clients
  - name: admin
    x-displayName: Administration
    description: Internal event administration
paths:
  /calendar.ics:
    get:
      operationId: get-calendar-ics
      summary: Get calendar as ICalendar
      responses:
        '200':
          description: ICalendar representation
          content:
            text/calendar:
              schema:
                type: string
                format: icalendar
  /auth:
    get:
      operationId: get-auth
@@ -153,7 +168,31 @@ paths:
                $ref: '#/components/schemas/Event'
        '404':
          description: Event not found
  /events/{id}.ics:
    parameters:
      - name: id
        in: path
        description: Event ID
        schema:
          type: string
    get:
      operationId: get-event-ics
      summary: Get event as ICalendar
      responses:
        '200':
          description: ICalendar representation
          content:
            text/calendar:
              schema:
                type: string
                format: icalendar
        '404':
          description: Event not found
components:
  securitySchemes:
    admin:
      type: http
      scheme: bearer
  schemas:
    URLWithMime:
      type: object
+46 −1
Original line number Diff line number Diff line
@@ -5,11 +5,14 @@ info:
  license:
    name: MIT
    identifier: MIT

servers:
  - url: https://api.fediverse.events/v1
    description: Production
# no authentication

# default: no authentication
security: []

tags:
  - name: events
    x-displayName: Events
@@ -18,10 +21,52 @@ tags:
    x-displayName: Authentication
    description: |
      Automated authenciation negotiation for clients
  - name: admin
    x-displayName: Administration
    description: Internal event administration

paths:
  /calendar.ics:
    get:
      operationId: get-calendar-ics
      summary: Get calendar as ICalendar
      responses:
        200:
          description: ICalendar representation
          content:
            text/calendar:
              schema:
                type: string
                format: icalendar
  /auth:
    $ref: endpoints/auth.yml
  /events:
    $ref: endpoints/events.yml
  /events/{id}:
    $ref: endpoints/events/{id}.yml
  /events/{id}.ics:
    parameters:
      - name: id
        in: path
        description: Event ID
        schema:
          type: string
    get:
      operationId: get-event-ics
      summary: Get event as ICalendar
      responses:
        200:
          description: ICalendar representation
          content:
            text/calendar:
              schema:
                type: string
                format: icalendar
        404:
          description: Event not found

components:
  securitySchemes:
    admin:
      type: http
      scheme: bearer
+7 −3
Original line number Diff line number Diff line
@@ -16,12 +16,16 @@
  },
  "dependencies": {
    "@prisma/client": "6.9.0",
    "@sc07/router": "^0.0.1",
    "cors": "^2.8.5",
    "express": "^5.1.0"
    "express": "^5.1.0",
    "express-prom-bundle": "^8.0.0",
    "ics": "^3.8.1",
    "prom-client": "^15.1.3"
  },
  "scripts": {
    "dev": "bun run --hot src/index.ts",
    "build": "bun build src/index.ts --outdir ./dist --target=bun --sourcemap=inline --minify --packages=external",
    "dev": "bun run --define process.env.VERSION=\"'$(git rev-parse HEAD)'\" --hot src/index.ts",
    "build": "bun build src/index.ts --outdir ./dist --target=bun --sourcemap=inline --minify --packages=external --define process.env.VERSION=\"'$(git rev-parse HEAD)'\"",
    "bundle:api-doc": "redocly bundle openapi/spec.yml -o openapi/openapi.yaml && sed -i '1s/^/# AUTOGENERATED FILE\\n# Run bun run bundle:api-doc\\n/' openapi/openapi.yaml",
    "build:api-doc": "redocly build-docs openapi/spec.yml -o public/index.html --title \"Fediverse Events API\"",
    "dev:api-doc": "redocly preview-docs openapi/spec.yml",
Loading