oksy 0.1.6 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/boot.js +21 -21
  2. package/library.js +1 -1
  3. package/package.json +2 -2
  4. package/public/assets/index.53e319a9.js +75 -0
  5. package/public/assets/index.cad35096.js +75 -0
  6. package/public/assets/index.ef68285e.css +1 -0
  7. package/public/index.html +2 -2
  8. package/types/public/src/Components/Base/File/File.type.d.ts +10 -0
  9. package/types/src/Bootstrap/OrganizeSqlTables.d.ts +1 -1
  10. package/types/src/Bootstrap/ReadFileSystemFilesToTsFiles.d.ts +1 -1
  11. package/types/src/Bootstrap/TsFilesToBlueprint/Blueprint.d.ts +3 -3
  12. package/types/src/Frontend/Controllers/ForgotPasswordController.d.ts +1 -1
  13. package/types/src/Frontend/Controllers/LoginController.d.ts +1 -1
  14. package/types/src/Frontend/Controllers/PageController.d.ts +1 -1
  15. package/types/src/Frontend/Controllers/RegisterController.d.ts +2 -2
  16. package/types/src/Frontend/Controllers/ResetPasswordController.d.ts +2 -2
  17. package/types/src/Frontend/Controllers/ResumeSessionController.d.ts +1 -1
  18. package/types/src/Frontend/FrontendConfig.d.ts +1 -1
  19. package/types/src/Frontend/GoogleIcons.d.ts +1 -1
  20. package/types/src/Frontend/View/Components/Button.d.ts +2 -2
  21. package/types/src/Frontend/View/Components/Container.d.ts +3 -3
  22. package/types/src/Frontend/View/Components/DataTable.d.ts +4 -4
  23. package/types/src/Frontend/View/Components/DateTime.d.ts +21 -0
  24. package/types/src/Frontend/View/Components/File.d.ts +23 -0
  25. package/types/src/Frontend/View/Components/FileUpload.d.ts +3 -3
  26. package/types/src/Frontend/View/Components/FlatOrFunc.d.ts +1 -1
  27. package/types/src/Frontend/View/Components/Input.d.ts +2 -2
  28. package/types/src/Frontend/View/Components/Layout/DarkSidebar.d.ts +4 -4
  29. package/types/src/Frontend/View/Components/Select.d.ts +8 -8
  30. package/types/src/Frontend/View/Components/Text.d.ts +2 -2
  31. package/types/src/Frontend/View/Components/Toggle.d.ts +2 -2
  32. package/types/src/Frontend/View/UI.d.ts +176 -20
  33. package/types/src/Helper/CallStack.d.ts +1 -1
  34. package/types/src/Helper/DateTime.d.ts +3 -1
  35. package/types/src/Helper/Seeder.d.ts +1 -1
  36. package/types/src/Helper/UUID.d.ts +1 -0
  37. package/types/src/Mailer/JsToEmail.d.ts +2 -2
  38. package/types/src/ReactiveStore/BaseEntity.d.ts +2 -2
  39. package/types/src/Server/Socket/BaseCommunicator.d.ts +4 -4
  40. package/types/src/Server/Socket/PageManager.d.ts +1 -1
  41. package/types/src/Server/Socket/SessionManager.d.ts +1 -1
  42. package/types/src/Server/Socket/WebSocketServerClient.d.ts +4 -1
  43. package/types/src/library.pub.d.ts +3 -3
  44. package/types/types/config.d.ts +2 -2
  45. package/public/assets/index.7c7d591a.js +0 -75
  46. package/public/assets/index.ad749efe.js +0 -75
  47. package/public/assets/index.bd7a9b66.css +0 -1
@@ -1,4 +1,4 @@
1
- declare type Call = {
1
+ type Call = {
2
2
  full: string;
3
3
  file: string;
4
4
  line: number;
@@ -1,5 +1,7 @@
1
1
  import dayjs, { Dayjs } from 'dayjs';
2
2
  export declare function nowAsUtc(): dayjs.Dayjs;
3
3
  export declare function toSqlDateTime(date: null | Dayjs): null | string;
4
- export declare function parseFromSqlFormat(date: null | string): dayjs.Dayjs | null;
4
+ export declare function parseFromSqlFormat(dateStr: null | string): null | Dayjs;
5
5
  export declare function isExpired(date: null | Dayjs): boolean;
6
+ export declare function utcToTz(date: null | Dayjs, tz: string): null | Dayjs;
7
+ export declare function parseDateTimeString(dateTimeStr: null | string, tz: string): null | Dayjs;
@@ -1,6 +1,6 @@
1
1
  import { SqliteClient } from './../Bootstrap/SqliteClient';
2
2
  import { ReactiveStore } from './../ReactiveStore/ReactiveStore';
3
- declare type SeederParams = {
3
+ type SeederParams = {
4
4
  reactiveStore: ReactiveStore;
5
5
  sqliteClient: SqliteClient;
6
6
  };
@@ -1,2 +1,3 @@
1
1
  export declare function randomInt(max: number): number;
2
2
  export declare function UUID(length?: number): string;
3
+ export declare function UUIDs(): string[];
@@ -1,8 +1,8 @@
1
- declare type Paragraph = {
1
+ type Paragraph = {
2
2
  el: 'p';
3
3
  text: string;
4
4
  };
5
- declare type Button = {
5
+ type Button = {
6
6
  el: 'button';
7
7
  label: string;
8
8
  href: string;
@@ -4,8 +4,8 @@ import { Database } from 'oksy';
4
4
  import { Many } from 'oksy';
5
5
  import { EmailValidator } from '../ReactiveStore/Validators/EmailValidator';
6
6
  import { IValidator } from './Validators/IValidator';
7
- export declare type One<T1 extends GlobalEntity, T2 extends keyof T1, T3 extends BlueprintFieldOne['cascade'] = 'DELETE'> = T1;
8
- export declare type PartialGlobalEntity = Partial<GlobalEntity> & {
7
+ export type One<T1 extends GlobalEntity, T2 extends keyof T1, T3 extends BlueprintFieldOne['cascade'] = 'DELETE'> = T1;
8
+ export type PartialGlobalEntity = Partial<GlobalEntity> & {
9
9
  id: string;
10
10
  };
11
11
  export declare abstract class GlobalEntity {
@@ -1,16 +1,16 @@
1
- declare type MessageFormat = EmitMessage | RequestMessage | ResponseMessage;
2
- declare type EmitMessage = {
1
+ type MessageFormat = EmitMessage | RequestMessage | ResponseMessage;
2
+ type EmitMessage = {
3
3
  type: 'emit';
4
4
  roomName: string;
5
5
  payload: any;
6
6
  };
7
- declare type RequestMessage = {
7
+ type RequestMessage = {
8
8
  type: 'request';
9
9
  id: string;
10
10
  roomName: string;
11
11
  payload: any;
12
12
  };
13
- declare type ResponseMessage = {
13
+ type ResponseMessage = {
14
14
  type: 'response';
15
15
  id: string;
16
16
  payload: any;
@@ -1,7 +1,7 @@
1
1
  import { Database, ReactiveStore } from './../../ReactiveStore/ReactiveStore';
2
2
  import { BasePage } from 'oksy';
3
3
  import { BaseWorkspace } from 'oksy';
4
- export declare type Route = {
4
+ export type Route = {
5
5
  database: null | Database;
6
6
  pageClass: null | (new (...args: any[]) => BasePage);
7
7
  workspace: null | BaseWorkspace;
@@ -4,7 +4,7 @@ import { Dayjs } from 'dayjs';
4
4
  import { BaseUser } from 'oksy';
5
5
  import { BasePage } from 'oksy';
6
6
  import { WebSocketServerClient } from './WebSocketServerClient';
7
- export declare type Session = {
7
+ export type Session = {
8
8
  id: string;
9
9
  userId: null | string;
10
10
  user: null | BaseUser;
@@ -1,12 +1,15 @@
1
+ import { Dayjs } from 'dayjs';
1
2
  import { WebSocket as WebSocketClient } from 'ws';
2
3
  import { BaseCommunicator } from './BaseCommunicator';
3
4
  export declare class WebSocketServerClient extends BaseCommunicator {
4
5
  private client;
6
+ timeZone: string;
5
7
  id: string;
6
- constructor(client: WebSocketClient);
8
+ constructor(client: WebSocketClient, timeZone: string);
7
9
  send(payload: object): void;
8
10
  toast(type: 'success' | 'error', message: string): void;
9
11
  prompt(message: string): Promise<string>;
10
12
  confirm(title: string, message: string, primaryButtonText?: string): Promise<boolean>;
13
+ toLocalDate(utcDate: null | Dayjs): null | Dayjs;
11
14
  navigate(url: string, type?: 'push' | 'replace' | 'hard' | 'blank'): void;
12
15
  }
@@ -7,7 +7,7 @@ import { hash } from './Helper/Hash';
7
7
  import { googleIcons, type GoogleIconType } from './Frontend/GoogleIcons';
8
8
  import { WebSocketServerClient } from './Server/Socket/WebSocketServerClient';
9
9
  import * as MODULES from './../../../../models/_generated/types.d';
10
- declare type PartialClass<T> = {
10
+ type PartialClass<T> = {
11
11
  [P in keyof T]: T[P] extends Function ? T[P] : (P extends 'id' | 'workspaceId' ? T[P] : null | T[P]);
12
12
  };
13
13
  declare abstract class GlobalEntity {
@@ -43,8 +43,8 @@ declare abstract class BasePage {
43
43
  navigate: InstanceType<typeof WebSocketServerClient>['navigate'];
44
44
  };
45
45
  }
46
- declare type MODULE_KEY = keyof typeof MODULES;
47
- declare type MODEL<KEY extends MODULE_KEY> = InstanceType<(typeof MODULES[KEY])>;
46
+ type MODULE_KEY = keyof typeof MODULES;
47
+ type MODEL<KEY extends MODULE_KEY> = InstanceType<(typeof MODULES[KEY])>;
48
48
  declare class Database {
49
49
  getById<T extends MODULE_KEY>(tableName: T, id: string): null | MODEL<T>;
50
50
  getAll<T extends MODULE_KEY>(tableName: T): MODEL<T>[];
@@ -1,11 +1,11 @@
1
- export declare type SMTPConfig = {
1
+ export type SMTPConfig = {
2
2
  host: string;
3
3
  port: number;
4
4
  username: string;
5
5
  password: string;
6
6
  from: string;
7
7
  };
8
- export declare type Config = {
8
+ export type Config = {
9
9
  name: string;
10
10
  appUrl: string;
11
11
  register: 'closed' | 'open';