@pelican.ts/sdk 0.4.8 → 0.4.10

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 (78) hide show
  1. package/.husky/pre-commit +2 -3
  2. package/biome.json +42 -32
  3. package/bun.lock +3 -0
  4. package/dist/api/index.d.mts +5 -5
  5. package/dist/api/index.d.ts +5 -5
  6. package/dist/api/index.js +168 -102
  7. package/dist/api/index.mjs +168 -102
  8. package/dist/index.d.mts +2 -2
  9. package/dist/index.d.ts +2 -2
  10. package/dist/index.js +124 -70
  11. package/dist/index.mjs +124 -70
  12. package/dist/types.d.ts +1 -1
  13. package/package.json +60 -59
  14. package/scripts/create-types.ts +4 -4
  15. package/src/api/application/client.ts +26 -19
  16. package/src/api/application/database_hosts.ts +15 -20
  17. package/src/api/application/eggs.ts +14 -7
  18. package/src/api/application/mounts.ts +29 -16
  19. package/src/api/application/nodes.ts +34 -32
  20. package/src/api/application/nodes_allocations.ts +15 -11
  21. package/src/api/application/roles.ts +13 -27
  22. package/src/api/application/servers.ts +36 -27
  23. package/src/api/application/servers_databases.ts +11 -7
  24. package/src/api/application/types/container.ts +7 -8
  25. package/src/api/application/types/database_host.ts +8 -8
  26. package/src/api/application/types/egg.ts +47 -54
  27. package/src/api/application/types/location.ts +5 -7
  28. package/src/api/application/types/mount.ts +9 -9
  29. package/src/api/application/types/node.ts +49 -59
  30. package/src/api/application/types/role.ts +4 -6
  31. package/src/api/application/types/server.ts +21 -22
  32. package/src/api/application/types/server_allocation.ts +11 -12
  33. package/src/api/application/types/user.ts +25 -25
  34. package/src/api/application/users.ts +38 -27
  35. package/src/api/base/request.ts +28 -17
  36. package/src/api/base/types.ts +16 -23
  37. package/src/api/client/account.ts +20 -15
  38. package/src/api/client/client.ts +17 -18
  39. package/src/api/client/server.ts +24 -20
  40. package/src/api/client/server_activity.ts +10 -11
  41. package/src/api/client/server_allocations.ts +11 -6
  42. package/src/api/client/server_backups.ts +21 -17
  43. package/src/api/client/server_databases.ts +14 -8
  44. package/src/api/client/server_files.ts +56 -42
  45. package/src/api/client/server_schedules.ts +43 -19
  46. package/src/api/client/server_settings.ts +11 -8
  47. package/src/api/client/server_startup.ts +16 -8
  48. package/src/api/client/server_users.ts +22 -13
  49. package/src/api/client/server_websocket.ts +79 -33
  50. package/src/api/client/types/server.ts +8 -18
  51. package/src/api/client/types/server_allocation.ts +7 -8
  52. package/src/api/client/types/server_subuser.ts +10 -11
  53. package/src/api/client/types/user.ts +2 -5
  54. package/src/api/client/types/websocket.ts +12 -24
  55. package/src/api/common/types/egg.ts +7 -7
  56. package/src/api/common/types/enums.ts +1 -1
  57. package/src/api/common/types/server_backup.ts +4 -5
  58. package/src/api/common/types/server_database.ts +9 -12
  59. package/src/api/common/types/server_files.ts +9 -9
  60. package/src/api/common/types/server_limits.ts +11 -12
  61. package/src/api/common/types/server_power.ts +1 -1
  62. package/src/api/common/types/server_schedule.ts +27 -25
  63. package/src/api/common/types/server_startup.ts +7 -12
  64. package/src/api/index.ts +3 -3
  65. package/src/humane/Account.ts +2 -2
  66. package/src/humane/Client.ts +6 -6
  67. package/src/humane/Server.ts +31 -43
  68. package/src/humane/ServerAllocation.ts +3 -3
  69. package/src/humane/ServerBackup.ts +6 -9
  70. package/src/humane/ServerDatabase.ts +2 -2
  71. package/src/humane/ServerFile.ts +17 -11
  72. package/src/humane/ServerSchedule.ts +6 -6
  73. package/src/humane/ServerUser.ts +2 -2
  74. package/src/index.ts +3 -3
  75. package/src/utils/sized.ts +1 -1
  76. package/src/utils/transform.ts +5 -10
  77. package/src/utils/types.ts +6 -8
  78. package/tsconfig.json +0 -1
@@ -1,7 +1,7 @@
1
- import type { ServerClient } from "@/api/client/server"
1
+ import type {ServerClient} from "@/api/client/server"
2
2
  import type {
3
3
  ServerSubuser,
4
- SubuserPermission,
4
+ SubuserPermission
5
5
  } from "@/api/client/types/server_subuser"
6
6
 
7
7
  export class ServerUser {
package/src/index.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { PelicanAPIClient } from "@/api"
2
- import { Client as UserClient } from "@/humane/Client"
1
+ import {PelicanAPIClient} from "@/api"
2
+ import {Client as UserClient} from "@/humane/Client"
3
3
 
4
4
  export const createPelicanClient = (
5
5
  url: string,
6
6
  token: string,
7
- suffix: string = "/api",
7
+ suffix: string = "/api"
8
8
  ) => {
9
9
  const client = new PelicanAPIClient(url, token, suffix)
10
10
  return new UserClient(client)
@@ -3,7 +3,7 @@ export const SIZES = {
3
3
  KB: 1024,
4
4
  MB: 1024 * 1024,
5
5
  GB: 1024 * 1024 * 1024,
6
- TB: 1024 * 1024 * 1024 * 1024,
6
+ TB: 1024 * 1024 * 1024 * 1024
7
7
  }
8
8
 
9
9
  const sized = (bytes: number, unit: keyof typeof SIZES): number => {
@@ -1,13 +1,8 @@
1
- import {string} from "zod";
2
-
1
+ import {string} from "zod"
3
2
 
4
3
  export const ArrayQueryParams = (p: {
5
- [key: string]: {
6
- [key: string]: string
7
- }
8
- }): {
9
- [key: string]: string
10
- } => {
4
+ [key: string]: {[key: string]: string}
5
+ }): {[key: string]: string} => {
11
6
  const params = new URLSearchParams()
12
7
 
13
8
  const o: ReturnType<typeof ArrayQueryParams> = {}
@@ -22,5 +17,5 @@ export const ArrayQueryParams = (p: {
22
17
  }
23
18
 
24
19
  export const SortParam = (key: string, p: "asc" | "desc"): string => {
25
- return `${p==="desc" ? "-" : ""}${key}`
26
- }
20
+ return `${p === "desc" ? "-" : ""}${key}`
21
+ }
@@ -1,12 +1,10 @@
1
-
2
- export type ExactlyOneKey<K extends keyof any, V, KK extends keyof any = K> =
3
- { [P in K]: { [Q in P]: V } &
4
- { [Q in Exclude<KK, P>]?: never} extends infer O ?
5
- { [Q in keyof O]: O[Q] } : never
6
- }[K];
1
+ export type ExactlyOneKey<K extends keyof any, V, KK extends keyof any = K> = {
2
+ [P in K]: {[Q in P]: V} & {[Q in Exclude<KK, P>]?: never} extends infer O
3
+ ? {[Q in keyof O]: O[Q]}
4
+ : never
5
+ }[K]
7
6
 
8
7
  export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>
9
8
 
10
-
11
9
  export type Maybe<T> = T | null | undefined
12
- export type Nullable<T> = T | null
10
+ export type Nullable<T> = T | null
package/tsconfig.json CHANGED
@@ -22,7 +22,6 @@
22
22
  },
23
23
  "include": ["src"],
24
24
  "exclude": ["node_modules", "dist"],
25
-
26
25
  "tsc-alias": {
27
26
  "resolveFullPaths": false
28
27
  }