Skip to content

Commit

Permalink
feat: 0.5.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
OneLiL05 committed Jul 22, 2024
1 parent 8d398a8 commit 3708916
Show file tree
Hide file tree
Showing 21 changed files with 4,086 additions and 3,326 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/jsr-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Publish to jsr
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest

permissions:
contents: read
id-token: write

steps:
- uses: actions/checkout@v4

- name: Publish package
run: npx jsr publish
20 changes: 20 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Publish Package to npmjs
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
28 changes: 14 additions & 14 deletions apps/docs/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";

// https://astro.build/config
export default defineConfig({
site: 'https://onelil05.github.io',
base: '/nurekit',
site: "https://onelil05.github.io",
base: "/nurekit",
vite: {
ssr: {
noExternal: ["execa"],
},
},
ssr: {
noExternal: ["execa"],
},
},
integrations: [
starlight({
title: 'Nurekit',
title: "Nurekit",
social: {
github: 'https://github.com/OneLiL05/nurekit',
github: "https://github.com/OneLiL05/nurekit",
},
sidebar: [
{
label: 'Guides',
autogenerate: { directory: 'guides' }
label: "Guides",
autogenerate: { directory: "guides" },
},
{
label: 'Reference',
autogenerate: { directory: 'reference' },
label: "Reference",
autogenerate: { directory: "reference" },
},
],
}),
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/src/content/config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineCollection } from 'astro:content';
import { docsSchema, i18nSchema } from '@astrojs/starlight/schema';
import { defineCollection } from "astro:content";
import { docsSchema, i18nSchema } from "@astrojs/starlight/schema";

export const collections = {
docs: defineCollection({ schema: docsSchema() }),
i18n: defineCollection({ type: 'data', schema: i18nSchema() }),
i18n: defineCollection({ type: "data", schema: i18nSchema() }),
};
44 changes: 22 additions & 22 deletions apps/docs/src/content/docs/reference/auditoriums-endpoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const auditorium = await nurekit.auditoriums.findOne("285");
### API

```typescript
const { Id, Name } = await nurekit.auditoriums.findOne(name);
const { id, name } = await nurekit.auditoriums.findOne(name);
```

#### Input
Expand All @@ -31,8 +31,8 @@ const { Id, Name } = await nurekit.auditoriums.findOne(name);

In output you will get an object with such fields:

- `Id: number`
- `Name: string`
- `id: number`
- `name: string`

## `findMany`

Expand Down Expand Up @@ -62,8 +62,8 @@ This method doesn't need any arguments.

In output you will get an array of objects with such fields:

- `Id: number`
- `Name: string`
- `id: number`
- `name: string`

## `getSchedule`

Expand Down Expand Up @@ -103,20 +103,20 @@ const schedule = await nurekit.auditoriums.getSchedule({

In output you will get an array of objects with such fields

- `Id: number`
- `StartTime: number`
- `EndTime: number`
- `Auditorium: string`
- `NumberPair: number`
- `Type: string`
- `Groups: IGroup[]`
- `Id: number`
- `Name: string`
- `Teachers: ITeacher[]`
- `Id: number`
- `FullName: string`
- `ShortName: string`
- `Subject: ISubject[]`
- `Id: number`
- `Brief: string`
- `Title: string`
- `id: number`
- `startTime: number`
- `endTime: number`
- `auditory: string`
- `numberPair: number`
- `type: string`
- `groups: IGroup[]`
- `id: number`
- `name: string`
- `teachers: ITeacher[]`
- `id: number`
- `fullName: string`
- `shortName: string`
- `subject: ISubject[]`
- `id: number`
- `brief: string`
- `title: string`
44 changes: 22 additions & 22 deletions apps/docs/src/content/docs/reference/groups-endpoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const auditorium = await nurekit.groups.findOne("пзпі-23-5");
### API

```typescript
const { Id, Name } = await nurekit.groups.findOne(name);
const { id, name } = await nurekit.groups.findOne(name);
```

#### Input
Expand All @@ -31,8 +31,8 @@ const { Id, Name } = await nurekit.groups.findOne(name);

In output you will get an object with such fields:

- `Id: number` - the group's id;
- `Name: string` - the group's name.
- `id: number` - the group's id;
- `name: string` - the group's name.

## `findMany`

Expand Down Expand Up @@ -62,8 +62,8 @@ This method doesn't need any arguments.

In output you will get an array of objects with such fields:

- `Id: number`
- `Name: string`
- `id: number`
- `name: string`

## `getSchedule`

Expand Down Expand Up @@ -103,20 +103,20 @@ const schedule = await nurekit.groups.getSchedule({

In output you will get an array of objects with such fields

- `Id: number`
- `StartTime: number`
- `EndTime: number`
- `Auditorium: string`
- `NumberPair: number`
- `Type: string`
- `Groups: IGroup[]`
- `Id: number`
- `Name: string`
- `Teachers: ITeacher[]`
- `Id: number`
- `FullName: string`
- `ShortName: string`
- `Subject: ISubject[]`
- `Id: number`
- `Brief: string`
- `Title: string`
- `id: number`
- `startTime: number`
- `endTime: number`
- `auditory: string`
- `numberPair: number`
- `type: string`
- `groups: IGroup[]`
- `id: number`
- `name: string`
- `teachers: ITeacher[]`
- `id: number`
- `fullName: string`
- `shortName: string`
- `subject: ISubject[]`
- `id: number`
- `brief: string`
- `title: string`
42 changes: 21 additions & 21 deletions apps/docs/src/content/docs/reference/teachers-endpoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const teacher = await nurekit.teachers.findOne("Боцюра О. А.");
### API

```typescript
const { Id, Name } = await nurekit.teachers.findOne(shortName);
const { id, name } = await nurekit.teachers.findOne(shortName);
```

#### Input
Expand All @@ -31,9 +31,9 @@ const { Id, Name } = await nurekit.teachers.findOne(shortName);

In output you will get an object with such fields:

- `Id: number`
- `ShortName: string`
- `FullName: string`
- `id: number`
- `shortName: string`
- `fullName: string`

## `findMany`

Expand Down Expand Up @@ -105,20 +105,20 @@ const schedule = await nurekit.groups.getSchedule({

In output you will get an array of objects with such fields

- `Id: number`
- `StartTime: number`
- `EndTime: number`
- `Auditorium: string`
- `NumberPair: number`
- `Type: string`
- `Groups: IGroup[]`
- `Id: number`
- `Name: string`
- `Teachers: ITeacher[]`
- `Id: number`
- `FullName: string`
- `ShortName: string`
- `Subject: ISubject[]`
- `Id: number`
- `Brief: string`
- `Title: string`
- `id: number`
- `startTime: number`
- `endTime: number`
- `auditory: string`
- `numberPair: number`
- `type: string`
- `groups: IGroup[]`
- `id: number`
- `name: string`
- `teachers: ITeacher[]`
- `id: number`
- `fullName: string`
- `shortName: string`
- `subject: ISubject[]`
- `id: number`
- `brief: string`
- `title: string`
5 changes: 5 additions & 0 deletions packages/nurekit/jsr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "@onelil/nurekit",
"version": "0.5.0",
"exports": "./src/index.ts"
}
2 changes: 1 addition & 1 deletion packages/nurekit/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "nurekit",
"description": "Node.js client for Nure API",
"version": "0.4.5",
"version": "0.5.0",
"keywords": [
"api",
"nure",
Expand Down
2 changes: 1 addition & 1 deletion packages/nurekit/src/adapters/timestamp.adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class TimestampAdapter {
};
}

#toTimestamp(date: string) {
#toTimestamp(date: string): number {
const parsedDate = Date.parse(date);

return parsedDate / 1000;
Expand Down
40 changes: 20 additions & 20 deletions packages/nurekit/src/adapters/type.adapter.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import { TRawShortScheduleType, TShortScheduleType } from "../types/index.js";

export class TypeAdapter {
public toRaw(type: TShortScheduleType): TRawShortScheduleType {
switch (type) {
case "auditoriums":
return "auditory";
case "groups":
return "group";
case "teachers":
return "teacher";
}
}
public toRaw(type: TShortScheduleType): TRawShortScheduleType {
switch (type) {
case "auditoriums":
return "auditory";
case "groups":
return "group";
case "teachers":
return "teacher";
}
}

public fromRaw(type: TRawShortScheduleType): TShortScheduleType {
switch (type) {
case "auditory":
return "auditoriums";
case "group":
return "groups";
case "teacher":
return "teachers";
}
}
public fromRaw(type: TRawShortScheduleType): TShortScheduleType {
switch (type) {
case "auditory":
return "auditoriums";
case "group":
return "groups";
case "teacher":
return "teachers";
}
}
}
Loading

0 comments on commit 3708916

Please sign in to comment.