@meowpanel/api 0.3.0 → 0.5.0
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.
- package/esm/mod.d.ts +37 -16
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +25 -7
- package/esm/src/client.d.ts +48 -11
- package/esm/src/client.d.ts.map +1 -1
- package/esm/src/client.js +53 -12
- package/esm/src/http.d.ts +2 -2
- package/esm/src/http.d.ts.map +1 -1
- package/esm/src/http.js +5 -2
- package/esm/src/namespace.d.ts +1 -1
- package/esm/src/namespace.js +1 -1
- package/esm/src/resources/account.d.ts +50 -19
- package/esm/src/resources/account.d.ts.map +1 -1
- package/esm/src/resources/account.js +51 -13
- package/esm/src/resources/api-keys.d.ts +16 -24
- package/esm/src/resources/api-keys.d.ts.map +1 -1
- package/esm/src/resources/api-keys.js +16 -20
- package/esm/src/resources/auth.d.ts +70 -4
- package/esm/src/resources/auth.d.ts.map +1 -1
- package/esm/src/resources/auth.js +47 -4
- package/esm/src/resources/eggs.d.ts +261 -22
- package/esm/src/resources/eggs.d.ts.map +1 -1
- package/esm/src/resources/eggs.js +261 -25
- package/esm/src/resources/features.d.ts +35 -0
- package/esm/src/resources/features.d.ts.map +1 -0
- package/esm/src/resources/features.js +21 -0
- package/esm/src/resources/hosts.d.ts +151 -21
- package/esm/src/resources/hosts.d.ts.map +1 -1
- package/esm/src/resources/hosts.js +143 -10
- package/esm/src/resources/logs.d.ts +39 -0
- package/esm/src/resources/logs.d.ts.map +1 -0
- package/esm/src/resources/logs.js +38 -0
- package/esm/src/resources/nodes.d.ts +108 -33
- package/esm/src/resources/nodes.d.ts.map +1 -1
- package/esm/src/resources/nodes.js +116 -24
- package/esm/src/resources/permissions.d.ts +45 -0
- package/esm/src/resources/permissions.d.ts.map +1 -0
- package/esm/src/resources/permissions.js +26 -0
- package/esm/src/resources/request-logs.d.ts +91 -0
- package/esm/src/resources/request-logs.d.ts.map +1 -0
- package/esm/src/resources/request-logs.js +70 -0
- package/esm/src/resources/roles.d.ts +128 -0
- package/esm/src/resources/roles.d.ts.map +1 -0
- package/esm/src/resources/roles.js +142 -0
- package/esm/src/resources/server-groups.d.ts +141 -7
- package/esm/src/resources/server-groups.d.ts.map +1 -1
- package/esm/src/resources/server-groups.js +157 -8
- package/esm/src/resources/servers/activity.d.ts +50 -8
- package/esm/src/resources/servers/activity.d.ts.map +1 -1
- package/esm/src/resources/servers/activity.js +54 -13
- package/esm/src/resources/servers/allocations.d.ts +3 -3
- package/esm/src/resources/servers/allocations.d.ts.map +1 -1
- package/esm/src/resources/servers/allocations.js +7 -7
- package/esm/src/resources/servers/backups.d.ts +46 -0
- package/esm/src/resources/servers/backups.d.ts.map +1 -0
- package/esm/src/resources/servers/backups.js +43 -0
- package/esm/src/resources/servers/connection.d.ts +33 -13
- package/esm/src/resources/servers/connection.d.ts.map +1 -1
- package/esm/src/resources/servers/connection.js +32 -11
- package/esm/src/resources/servers/features.d.ts +81 -0
- package/esm/src/resources/servers/features.d.ts.map +1 -0
- package/esm/src/resources/servers/features.js +60 -0
- package/esm/src/resources/servers/files.d.ts +41 -53
- package/esm/src/resources/servers/files.d.ts.map +1 -1
- package/esm/src/resources/servers/files.js +74 -116
- package/esm/src/resources/servers/index.d.ts +46 -27
- package/esm/src/resources/servers/index.d.ts.map +1 -1
- package/esm/src/resources/servers/index.js +26 -12
- package/esm/src/resources/servers/jobs.d.ts +88 -0
- package/esm/src/resources/servers/jobs.d.ts.map +1 -0
- package/esm/src/resources/servers/jobs.js +115 -0
- package/esm/src/resources/servers/node-client.d.ts +33 -0
- package/esm/src/resources/servers/node-client.d.ts.map +1 -0
- package/esm/src/resources/servers/node-client.js +61 -0
- package/esm/src/resources/servers/profiles.d.ts +83 -18
- package/esm/src/resources/servers/profiles.d.ts.map +1 -1
- package/esm/src/resources/servers/profiles.js +78 -11
- package/esm/src/resources/servers/server.d.ts +13 -28
- package/esm/src/resources/servers/server.d.ts.map +1 -1
- package/esm/src/resources/servers/server.js +21 -37
- package/esm/src/resources/servers/sftp.d.ts +12 -19
- package/esm/src/resources/servers/sftp.d.ts.map +1 -1
- package/esm/src/resources/servers/sftp.js +10 -14
- package/esm/src/resources/servers/sub-users.d.ts +99 -0
- package/esm/src/resources/servers/sub-users.d.ts.map +1 -0
- package/esm/src/resources/servers/sub-users.js +94 -0
- package/esm/src/resources/servers/types.d.ts +30 -28
- package/esm/src/resources/servers/types.d.ts.map +1 -1
- package/esm/src/resources/systems.d.ts +124 -0
- package/esm/src/resources/systems.d.ts.map +1 -0
- package/esm/src/resources/systems.js +139 -0
- package/esm/src/resources/users.d.ts +330 -0
- package/esm/src/resources/users.d.ts.map +1 -0
- package/esm/src/resources/users.js +280 -0
- package/esm/src/types.d.ts +18 -1
- package/esm/src/types.d.ts.map +1 -1
- package/esm/src/types.js +11 -0
- package/package.json +1 -1
- package/script/mod.d.ts +37 -16
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +50 -5
- package/script/src/client.d.ts +48 -11
- package/script/src/client.d.ts.map +1 -1
- package/script/src/client.js +53 -12
- package/script/src/http.d.ts +2 -2
- package/script/src/http.d.ts.map +1 -1
- package/script/src/http.js +5 -2
- package/script/src/namespace.d.ts +1 -1
- package/script/src/namespace.js +1 -1
- package/script/src/resources/account.d.ts +50 -19
- package/script/src/resources/account.d.ts.map +1 -1
- package/script/src/resources/account.js +50 -12
- package/script/src/resources/api-keys.d.ts +16 -24
- package/script/src/resources/api-keys.d.ts.map +1 -1
- package/script/src/resources/api-keys.js +15 -19
- package/script/src/resources/auth.d.ts +70 -4
- package/script/src/resources/auth.d.ts.map +1 -1
- package/script/src/resources/auth.js +47 -4
- package/script/src/resources/eggs.d.ts +261 -22
- package/script/src/resources/eggs.d.ts.map +1 -1
- package/script/src/resources/eggs.js +267 -26
- package/script/src/resources/features.d.ts +35 -0
- package/script/src/resources/features.d.ts.map +1 -0
- package/script/src/resources/features.js +25 -0
- package/script/src/resources/hosts.d.ts +151 -21
- package/script/src/resources/hosts.d.ts.map +1 -1
- package/script/src/resources/hosts.js +144 -10
- package/script/src/resources/logs.d.ts +39 -0
- package/script/src/resources/logs.d.ts.map +1 -0
- package/script/src/resources/logs.js +42 -0
- package/script/src/resources/nodes.d.ts +108 -33
- package/script/src/resources/nodes.d.ts.map +1 -1
- package/script/src/resources/nodes.js +117 -24
- package/script/src/resources/permissions.d.ts +45 -0
- package/script/src/resources/permissions.d.ts.map +1 -0
- package/script/src/resources/permissions.js +31 -0
- package/script/src/resources/request-logs.d.ts +91 -0
- package/script/src/resources/request-logs.d.ts.map +1 -0
- package/script/src/resources/request-logs.js +75 -0
- package/script/src/resources/roles.d.ts +128 -0
- package/script/src/resources/roles.d.ts.map +1 -0
- package/script/src/resources/roles.js +148 -0
- package/script/src/resources/server-groups.d.ts +141 -7
- package/script/src/resources/server-groups.d.ts.map +1 -1
- package/script/src/resources/server-groups.js +158 -8
- package/script/src/resources/servers/activity.d.ts +50 -8
- package/script/src/resources/servers/activity.d.ts.map +1 -1
- package/script/src/resources/servers/activity.js +54 -12
- package/script/src/resources/servers/allocations.d.ts +3 -3
- package/script/src/resources/servers/allocations.d.ts.map +1 -1
- package/script/src/resources/servers/allocations.js +7 -7
- package/script/src/resources/servers/backups.d.ts +46 -0
- package/script/src/resources/servers/backups.d.ts.map +1 -0
- package/script/src/resources/servers/backups.js +47 -0
- package/script/src/resources/servers/connection.d.ts +33 -13
- package/script/src/resources/servers/connection.d.ts.map +1 -1
- package/script/src/resources/servers/connection.js +32 -11
- package/script/src/resources/servers/features.d.ts +81 -0
- package/script/src/resources/servers/features.d.ts.map +1 -0
- package/script/src/resources/servers/features.js +64 -0
- package/script/src/resources/servers/files.d.ts +41 -53
- package/script/src/resources/servers/files.d.ts.map +1 -1
- package/script/src/resources/servers/files.js +74 -116
- package/script/src/resources/servers/index.d.ts +46 -27
- package/script/src/resources/servers/index.d.ts.map +1 -1
- package/script/src/resources/servers/index.js +26 -12
- package/script/src/resources/servers/jobs.d.ts +88 -0
- package/script/src/resources/servers/jobs.d.ts.map +1 -0
- package/script/src/resources/servers/jobs.js +120 -0
- package/script/src/resources/servers/node-client.d.ts +33 -0
- package/script/src/resources/servers/node-client.d.ts.map +1 -0
- package/script/src/resources/servers/node-client.js +65 -0
- package/script/src/resources/servers/profiles.d.ts +83 -18
- package/script/src/resources/servers/profiles.d.ts.map +1 -1
- package/script/src/resources/servers/profiles.js +77 -10
- package/script/src/resources/servers/server.d.ts +13 -28
- package/script/src/resources/servers/server.d.ts.map +1 -1
- package/script/src/resources/servers/server.js +21 -37
- package/script/src/resources/servers/sftp.d.ts +12 -19
- package/script/src/resources/servers/sftp.d.ts.map +1 -1
- package/script/src/resources/servers/sftp.js +10 -14
- package/script/src/resources/servers/sub-users.d.ts +99 -0
- package/script/src/resources/servers/sub-users.d.ts.map +1 -0
- package/script/src/resources/servers/sub-users.js +99 -0
- package/script/src/resources/servers/types.d.ts +30 -28
- package/script/src/resources/servers/types.d.ts.map +1 -1
- package/script/src/resources/systems.d.ts +124 -0
- package/script/src/resources/systems.d.ts.map +1 -0
- package/script/src/resources/systems.js +145 -0
- package/script/src/resources/users.d.ts +330 -0
- package/script/src/resources/users.d.ts.map +1 -0
- package/script/src/resources/users.js +287 -0
- package/script/src/types.d.ts +18 -1
- package/script/src/types.d.ts.map +1 -1
- package/script/src/types.js +12 -0
- package/esm/src/resources/members.d.ts +0 -138
- package/esm/src/resources/members.d.ts.map +0 -1
- package/esm/src/resources/members.js +0 -122
- package/script/src/resources/members.d.ts +0 -138
- package/script/src/resources/members.d.ts.map +0 -1
- package/script/src/resources/members.js +0 -127
package/esm/mod.d.ts
CHANGED
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
export { MeowPanelApi } from './src/client.js';
|
|
46
46
|
export type { MeowPanelApiOptions } from './src/client.js';
|
|
47
47
|
export { AuthResource } from './src/resources/auth.js';
|
|
48
|
-
export type { AuthMeta, AuthProvider } from './src/resources/auth.js';
|
|
48
|
+
export type { AuthMeta, AuthProvider, EmailVerificationMode, ExchangeResult, LoginResult, RefreshResult, } from './src/resources/auth.js';
|
|
49
49
|
export { ReactiveResource } from './src/reactive.js';
|
|
50
50
|
export { ApiError } from './src/errors.js';
|
|
51
51
|
export type { ApiErrorOptions } from './src/errors.js';
|
|
@@ -55,34 +55,55 @@ export { TypedEmitter } from './src/emitter.js';
|
|
|
55
55
|
export type { EventHandler } from './src/emitter.js';
|
|
56
56
|
export { SseConnection } from './src/sse.js';
|
|
57
57
|
export type { SseState } from './src/sse.js';
|
|
58
|
-
export { joinIncludes, toNanoID } from './src/types.js';
|
|
59
|
-
export type { IncludeOptions, ISODate, ListOptions, NanoID, Paginated, PowerAction, PowerState, ResourceWith, ServerRestrictedState, SftpPermission, UnionToIntersection, } from './src/types.js';
|
|
58
|
+
export { joinIncludes, parseIssuerRef, toNanoID } from './src/types.js';
|
|
59
|
+
export type { IncludeOptions, ISODate, IssuerRef, ListOptions, NanoID, Paginated, ParsedIssuer, PowerAction, PowerState, ResourceColor, ResourceWith, ServerRestrictedState, SftpPermission, UnionToIntersection, } from './src/types.js';
|
|
60
60
|
export { Account, AccountResource, AccountSshKeysManager, ApiKeyAccount, SshKey, UserAccount, } from './src/resources/account.js';
|
|
61
61
|
export type { AccountInclude, CreateSshKeyPayload, SshKeyData, UpdateAccountPayload } from './src/resources/account.js';
|
|
62
62
|
export { ApiKey, ApiKeysNamespace } from './src/resources/api-keys.js';
|
|
63
|
-
export type { ApiKeyEvents, CreateApiKeyPayload, CreateApiKeyResult } from './src/resources/api-keys.js';
|
|
64
|
-
export {
|
|
65
|
-
export
|
|
66
|
-
export {
|
|
67
|
-
export
|
|
68
|
-
export {
|
|
69
|
-
export
|
|
70
|
-
export {
|
|
71
|
-
export
|
|
72
|
-
export {
|
|
73
|
-
export
|
|
63
|
+
export type { ApiKeyData, ApiKeyEvents, CreateApiKeyPayload, CreateApiKeyResult } from './src/resources/api-keys.js';
|
|
64
|
+
export type { PermissionGrant, PermissionGrantInput } from './src/resources/permissions.js';
|
|
65
|
+
export { User, UserPermissionsManager, UserRolesManager, UsersNamespace } from './src/resources/users.js';
|
|
66
|
+
export type { AssignRoleInput, CreateUserPayload, UiTheme, UpdateUserPayload, UserData, UserEvents, UserIdentifiers, UserInclude, UserPasswordIdentifier, UserPreferences, UserRoleAssignment, UserWhmcsIdentifier, UserWith, WhmcsSyncResult, } from './src/resources/users.js';
|
|
67
|
+
export { Role, RolePermissionsManager, RolesNamespace } from './src/resources/roles.js';
|
|
68
|
+
export type { CreateRolePayload, RoleData, RoleEvents, UpdateRolePayload } from './src/resources/roles.js';
|
|
69
|
+
export { System, SystemKeysManager, SystemsNamespace } from './src/resources/systems.js';
|
|
70
|
+
export type { CreateSystemPayload, SystemApiKeyResult, SystemData, SystemEvents, SystemInclude, UpdateSystemPayload, } from './src/resources/systems.js';
|
|
71
|
+
export { FeaturesResource } from './src/resources/features.js';
|
|
72
|
+
export type { FeatureCatalogEntry, FeatureVariants } from './src/resources/features.js';
|
|
73
|
+
export { LogsResource } from './src/resources/logs.js';
|
|
74
|
+
export type { LogActivityScope } from './src/resources/logs.js';
|
|
75
|
+
export { RequestLog } from './src/resources/request-logs.js';
|
|
76
|
+
export type { RequestLogData, RequestLogFeedOptions, RequestLogInclude, RequestLogLine, } from './src/resources/request-logs.js';
|
|
77
|
+
export { Node, NodeAllocationIp, NodeAllocationPort, NodeAllocationsManager, NodeClassifierManager, NodeLocation, NodesNamespace, NodeType, } from './src/resources/nodes.js';
|
|
78
|
+
export type { ClaimNodePayload, ClaimNodeResponseData, ClaimNodeResult, CreateNodeAllocationIpPayload, CreateNodeAllocationPortsPayload, CreateNodeClassifierPayload, CreateNodePayload, CreateNodeResponseData, CreateNodeResult, InstallTokenResponseData, InstallTokenResult, LogNodeActivityPayload, NodeAllocationIpData, NodeAllocationPortData, NodeConnection, NodeData, NodeEvents, NodeInclude, NodeLimits, NodeLocationData, NodeStatus, NodeTypeData, NodeWith, UpdateNodeAllocationIpPayload, UpdateNodeAllocationPortPayload, UpdateNodeClassifierPayload, UpdateNodePayload, } from './src/resources/nodes.js';
|
|
79
|
+
export { Egg, EggFeaturesManager, EggImagesManager, EggNest, EggNestsManager, EggsNamespace, EggVariable, EggVariablesManager, } from './src/resources/eggs.js';
|
|
80
|
+
export type { CreateEggPayload, CreateEggVariablePayload, EggConfigFile, EggConfigLogs, EggConfigParser, EggConfigStartup, EggData, EggEvents, EggFeatureGrant, EggFeatureGrantData, EggImage, EggImageData, EggInclude, EggInstaller, EggInstallerData, EggInstallerInput, EggNestData, EggProcess, EggVariableData, EggWith, UpdateEggPayload, UpdateEggVariablePayload, } from './src/resources/eggs.js';
|
|
81
|
+
export { Host, HostBillingManager, HostsNamespace } from './src/resources/hosts.js';
|
|
82
|
+
export type { CreateHostPayload, HostData, HostEvents, HostInclude, HostWith, SaveWhmcsBillingPayload, UpdateHostPayload, WhmcsBillingConfig, } from './src/resources/hosts.js';
|
|
83
|
+
export { GroupIdentifiersManager, ServerGroup, ServerGroupsNamespace } from './src/resources/server-groups.js';
|
|
84
|
+
export type { BillingCycle, BillingInfo, BillingProvider, BillingStatus, CreateServerGroupPayload, GroupIdentifier, ServerGroupData, ServerGroupEvents, ServerGroupInclude, ServerGroupLimits, ServerGroupLimitsData, ServerGroupWith, SuspensionState, UpdateServerGroupPayload, } from './src/resources/server-groups.js';
|
|
74
85
|
export { ServersNamespace } from './src/resources/servers/index.js';
|
|
75
86
|
export type { CreateServerPayload, ServerEvents, ServerInclude, ServerWith, UpdateServerPayload, } from './src/resources/servers/index.js';
|
|
76
87
|
export { Server } from './src/resources/servers/server.js';
|
|
77
|
-
export type { ServerBuild,
|
|
88
|
+
export type { ServerBuild, ServerStatus } from './src/resources/servers/server.js';
|
|
78
89
|
export { ServerConnection } from './src/resources/servers/connection.js';
|
|
79
|
-
export type { ServerConnectionEvents, ServerUtilization } from './src/resources/servers/connection.js';
|
|
90
|
+
export type { JobLogEvent, JobProgressEvent, ServerConnectionEvents, ServerUtilization, } from './src/resources/servers/connection.js';
|
|
80
91
|
export { FileEntry, ServerFilesManager } from './src/resources/servers/files.js';
|
|
92
|
+
export { ServerBackupsManager } from './src/resources/servers/backups.js';
|
|
93
|
+
export type { BackupAdapter, CreateBackupOptions, RestoreBackupOptions } from './src/resources/servers/backups.js';
|
|
94
|
+
export { ServerJob, ServerJobsManager } from './src/resources/servers/jobs.js';
|
|
95
|
+
export type { JobData, JobStatus, JobWaitOptions } from './src/resources/servers/jobs.js';
|
|
81
96
|
export { ServerSftpManager, SftpUser } from './src/resources/servers/sftp.js';
|
|
82
97
|
export type { AddAllocationEntry } from './src/resources/servers/allocations.js';
|
|
83
98
|
export type { SftpConnection, SftpDetails, SftpUserInclude, SftpUserWith } from './src/resources/servers/sftp.js';
|
|
84
99
|
export { ServerAllocationPort, ServerAllocationsManager } from './src/resources/servers/allocations.js';
|
|
85
100
|
export type { AllocationPortMeta } from './src/resources/servers/allocations.js';
|
|
86
101
|
export { ServerProfile, ServerProfilesManager } from './src/resources/servers/profiles.js';
|
|
102
|
+
export type { ServerStartup, StartupVariable } from './src/resources/servers/profiles.js';
|
|
103
|
+
export { ServerFeaturesManager } from './src/resources/servers/features.js';
|
|
104
|
+
export type { EffectiveFeature, FeatureSetting, FeatureSettingSource, FeatureSource, } from './src/resources/servers/features.js';
|
|
105
|
+
export { ServerUser, ServerUserManager } from './src/resources/servers/sub-users.js';
|
|
106
|
+
export type { AddServerUserInput, ServerUserGrant, ServerUserKind } from './src/resources/servers/sub-users.js';
|
|
87
107
|
export { ActivityJob, ActivityJobLog, ActivityLog, ServerActivityManager } from './src/resources/servers/activity.js';
|
|
108
|
+
export type { ActivityFeedOptions } from './src/resources/servers/activity.js';
|
|
88
109
|
//# sourceMappingURL=mod.d.ts.map
|
package/esm/mod.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;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{ SseConnection } from './src/sse.js';
|
|
55
55
|
// Common types
|
|
56
|
-
export { joinIncludes, toNanoID } from './src/types.js';
|
|
56
|
+
export { joinIncludes, parseIssuerRef, toNanoID } from './src/types.js';
|
|
57
57
|
// Account
|
|
58
58
|
export { Account, AccountResource, AccountSshKeysManager, ApiKeyAccount, SshKey, UserAccount, } from './src/resources/account.js';
|
|
59
59
|
// API Keys
|
|
60
60
|
export { ApiKey, ApiKeysNamespace } from './src/resources/api-keys.js';
|
|
61
|
-
//
|
|
62
|
-
export {
|
|
61
|
+
// Users
|
|
62
|
+
export { User, UserPermissionsManager, UserRolesManager, UsersNamespace } from './src/resources/users.js';
|
|
63
|
+
// Roles
|
|
64
|
+
export { Role, RolePermissionsManager, RolesNamespace } from './src/resources/roles.js';
|
|
65
|
+
// Systems
|
|
66
|
+
export { System, SystemKeysManager, SystemsNamespace } from './src/resources/systems.js';
|
|
67
|
+
// Features (catalog)
|
|
68
|
+
export { FeaturesResource } from './src/resources/features.js';
|
|
69
|
+
// Logs
|
|
70
|
+
export { LogsResource } from './src/resources/logs.js';
|
|
71
|
+
// Request logs
|
|
72
|
+
export { RequestLog } from './src/resources/request-logs.js';
|
|
63
73
|
// Nodes
|
|
64
|
-
export { Node, NodeAllocationIp, NodeAllocationPort, NodeAllocationsManager, NodeLocation, NodesNamespace, NodeType, } from './src/resources/nodes.js';
|
|
74
|
+
export { Node, NodeAllocationIp, NodeAllocationPort, NodeAllocationsManager, NodeClassifierManager, NodeLocation, NodesNamespace, NodeType, } from './src/resources/nodes.js';
|
|
65
75
|
// Eggs
|
|
66
|
-
export { Egg, EggNest, EggsNamespace } from './src/resources/eggs.js';
|
|
76
|
+
export { Egg, EggFeaturesManager, EggImagesManager, EggNest, EggNestsManager, EggsNamespace, EggVariable, EggVariablesManager, } from './src/resources/eggs.js';
|
|
67
77
|
// Hosts
|
|
68
|
-
export { Host, HostsNamespace } from './src/resources/hosts.js';
|
|
78
|
+
export { Host, HostBillingManager, HostsNamespace } from './src/resources/hosts.js';
|
|
69
79
|
// Server Groups
|
|
70
|
-
export { ServerGroup, ServerGroupsNamespace } from './src/resources/server-groups.js';
|
|
80
|
+
export { GroupIdentifiersManager, ServerGroup, ServerGroupsNamespace } from './src/resources/server-groups.js';
|
|
71
81
|
// Servers
|
|
72
82
|
export { ServersNamespace } from './src/resources/servers/index.js';
|
|
73
83
|
export { Server } from './src/resources/servers/server.js';
|
|
@@ -75,11 +85,19 @@ export { Server } from './src/resources/servers/server.js';
|
|
|
75
85
|
export { ServerConnection } from './src/resources/servers/connection.js';
|
|
76
86
|
// Server files
|
|
77
87
|
export { FileEntry, ServerFilesManager } from './src/resources/servers/files.js';
|
|
88
|
+
// Server backups
|
|
89
|
+
export { ServerBackupsManager } from './src/resources/servers/backups.js';
|
|
90
|
+
// Server jobs
|
|
91
|
+
export { ServerJob, ServerJobsManager } from './src/resources/servers/jobs.js';
|
|
78
92
|
// Server SFTP
|
|
79
93
|
export { ServerSftpManager, SftpUser } from './src/resources/servers/sftp.js';
|
|
80
94
|
// Server allocations
|
|
81
95
|
export { ServerAllocationPort, ServerAllocationsManager } from './src/resources/servers/allocations.js';
|
|
82
96
|
// Server profiles
|
|
83
97
|
export { ServerProfile, ServerProfilesManager } from './src/resources/servers/profiles.js';
|
|
98
|
+
// Server features
|
|
99
|
+
export { ServerFeaturesManager } from './src/resources/servers/features.js';
|
|
100
|
+
// Server sub-users
|
|
101
|
+
export { ServerUser, ServerUserManager } from './src/resources/servers/sub-users.js';
|
|
84
102
|
// Server activity
|
|
85
103
|
export { ActivityJob, ActivityJobLog, ActivityLog, ServerActivityManager } from './src/resources/servers/activity.js';
|
package/esm/src/client.d.ts
CHANGED
|
@@ -4,11 +4,15 @@ import { AccountResource } from './resources/account.js';
|
|
|
4
4
|
import { AuthResource } from './resources/auth.js';
|
|
5
5
|
import { ApiKeysNamespace } from './resources/api-keys.js';
|
|
6
6
|
import { EggsNamespace } from './resources/eggs.js';
|
|
7
|
+
import { FeaturesResource } from './resources/features.js';
|
|
7
8
|
import { HostsNamespace } from './resources/hosts.js';
|
|
8
|
-
import {
|
|
9
|
+
import { LogsResource } from './resources/logs.js';
|
|
10
|
+
import { UsersNamespace } from './resources/users.js';
|
|
9
11
|
import { NodesNamespace } from './resources/nodes.js';
|
|
12
|
+
import { RolesNamespace } from './resources/roles.js';
|
|
10
13
|
import { ServerGroupsNamespace } from './resources/server-groups.js';
|
|
11
14
|
import { ServersNamespace } from './resources/servers/index.js';
|
|
15
|
+
import { SystemsNamespace } from './resources/systems.js';
|
|
12
16
|
/**
|
|
13
17
|
* Configuration options for {@link MeowPanelApi}.
|
|
14
18
|
*/
|
|
@@ -52,13 +56,13 @@ export interface MeowPanelApiOptions {
|
|
|
52
56
|
* // Fetch resources
|
|
53
57
|
* const me = await api.account.get();
|
|
54
58
|
* const servers = await api.servers.list({ include: ['status'] });
|
|
55
|
-
* const
|
|
59
|
+
* const users = await api.users.list();
|
|
56
60
|
*
|
|
57
61
|
* // Reactive store: {#each $api.servers as server} ... {/each}
|
|
58
62
|
*
|
|
59
63
|
* // Listen for mutations
|
|
60
64
|
* api.servers.on('created', (server) => console.log('New server:', server.name));
|
|
61
|
-
* api.
|
|
65
|
+
* api.users.on('updated', (user) => console.log('User updated:', user.nickname));
|
|
62
66
|
*
|
|
63
67
|
* // Panel-level SSE
|
|
64
68
|
* const sse = api.connectSse();
|
|
@@ -84,7 +88,7 @@ export declare class MeowPanelApi {
|
|
|
84
88
|
* @example
|
|
85
89
|
* ```ts ignore
|
|
86
90
|
* const me = await api.account.get();
|
|
87
|
-
* await api.account.update({
|
|
91
|
+
* await api.account.update({ preferences: { theme: 'dark' } });
|
|
88
92
|
* await api.account.uploadAvatar(imageBlob, 'image/png');
|
|
89
93
|
* ```
|
|
90
94
|
*/
|
|
@@ -100,18 +104,38 @@ export declare class MeowPanelApi {
|
|
|
100
104
|
*/
|
|
101
105
|
readonly apiKeys: ApiKeysNamespace;
|
|
102
106
|
/**
|
|
103
|
-
* Manage
|
|
107
|
+
* Manage user accounts.
|
|
104
108
|
*
|
|
105
|
-
* Supports reactive subscriptions via `$api.
|
|
109
|
+
* Supports reactive subscriptions via `$api.users`.
|
|
106
110
|
*
|
|
107
111
|
* @example
|
|
108
112
|
* ```ts ignore
|
|
109
|
-
* const
|
|
110
|
-
* const
|
|
111
|
-
* await api.
|
|
113
|
+
* const users = await api.users.list();
|
|
114
|
+
* const user = await api.users.get(id);
|
|
115
|
+
* await api.users.update(id, { nickname: 'newname' });
|
|
112
116
|
* ```
|
|
113
117
|
*/
|
|
114
|
-
readonly
|
|
118
|
+
readonly users: UsersNamespace;
|
|
119
|
+
/**
|
|
120
|
+
* Manage roles (named permission bundles).
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```ts ignore
|
|
124
|
+
* const roles = await api.roles.list();
|
|
125
|
+
* await api.roles.permissions(roleId).grant({ permission: 'server.console.read' });
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
readonly roles: RolesNamespace;
|
|
129
|
+
/**
|
|
130
|
+
* Manage systems (non-user identities) and their API keys.
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```ts ignore
|
|
134
|
+
* const system = await api.systems.create({ name: 'CI deploy' });
|
|
135
|
+
* const { token } = await api.systems.keys(system.id).create({ name: 'pipeline', permissions: ['server.read'] });
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
readonly systems: SystemsNamespace;
|
|
115
139
|
/**
|
|
116
140
|
* Manage nodes (daemon servers).
|
|
117
141
|
*
|
|
@@ -184,6 +208,19 @@ export declare class MeowPanelApi {
|
|
|
184
208
|
* ```
|
|
185
209
|
*/
|
|
186
210
|
readonly servers: ServersNamespace;
|
|
211
|
+
/**
|
|
212
|
+
* Browse the code-defined feature catalog. Per-server feature state is at `server.features`.
|
|
213
|
+
*/
|
|
214
|
+
readonly features: FeaturesResource;
|
|
215
|
+
/**
|
|
216
|
+
* Read panel-wide activity logs.
|
|
217
|
+
*
|
|
218
|
+
* @example
|
|
219
|
+
* ```ts ignore
|
|
220
|
+
* const { data } = await api.logs.activities({ type: 'server.power.start' });
|
|
221
|
+
* ```
|
|
222
|
+
*/
|
|
223
|
+
readonly logs: LogsResource;
|
|
187
224
|
constructor(options: MeowPanelApiOptions);
|
|
188
225
|
/**
|
|
189
226
|
* Update the bearer token used for all subsequent API requests.
|
|
@@ -197,7 +234,7 @@ export declare class MeowPanelApi {
|
|
|
197
234
|
* Create a panel-level Server-Sent Events connection to Nexus.
|
|
198
235
|
*
|
|
199
236
|
* The panel SSE stream (`GET /v1/sse`) broadcasts events for mutations
|
|
200
|
-
* across the panel (e.g. server updates,
|
|
237
|
+
* across the panel (e.g. server updates, user changes).
|
|
201
238
|
*
|
|
202
239
|
* The connection is not opened until you call `.connect()` on the returned object.
|
|
203
240
|
*
|
package/esm/src/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/src/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/src/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,eAAe,EA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CAAC;IAE1C;;;;;;;;;;;OAWG;IACH,SAAgB,KAAK,EAAE,cAAc,CAAC;IAEtC;;;;;;;;OAQG;IACH,SAAgB,KAAK,EAAE,cAAc,CAAC;IAEtC;;;;;;;;OAQG;IACH,SAAgB,OAAO,EAAE,gBAAgB,CAAC;IAE1C;;;;;;;;;;OAUG;IACH,SAAgB,KAAK,EAAE,cAAc,CAAC;IAEtC;;;;;;;;;;;OAWG;IACH,SAAgB,IAAI,EAAE,aAAa,CAAC;IAEpC;;;;;;;;;OASG;IACH,SAAgB,KAAK,EAAE,cAAc,CAAC;IAEtC;;;;;;;;;;OAUG;IACH,SAAgB,YAAY,EAAE,qBAAqB,CAAC;IAEpD;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,SAAgB,OAAO,EAAE,gBAAgB,CAAC;IAE1C;;OAEG;IACH,SAAgB,QAAQ,EAAE,gBAAgB,CAAC;IAE3C;;;;;;;OAOG;IACH,SAAgB,IAAI,EAAE,YAAY,CAAC;gBAEhB,OAAO,EAAE,mBAAmB;IA6B/C;;;;;;OAMG;IACI,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAOpC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACI,UAAU,IAAI,aAAa;CAOlC"}
|
package/esm/src/client.js
CHANGED
|
@@ -4,11 +4,15 @@ import { AccountResource } from './resources/account.js';
|
|
|
4
4
|
import { AuthResource } from './resources/auth.js';
|
|
5
5
|
import { ApiKeysNamespace } from './resources/api-keys.js';
|
|
6
6
|
import { EggsNamespace } from './resources/eggs.js';
|
|
7
|
+
import { FeaturesResource } from './resources/features.js';
|
|
7
8
|
import { HostsNamespace } from './resources/hosts.js';
|
|
8
|
-
import {
|
|
9
|
+
import { LogsResource } from './resources/logs.js';
|
|
10
|
+
import { UsersNamespace } from './resources/users.js';
|
|
9
11
|
import { NodesNamespace } from './resources/nodes.js';
|
|
12
|
+
import { RolesNamespace } from './resources/roles.js';
|
|
10
13
|
import { ServerGroupsNamespace } from './resources/server-groups.js';
|
|
11
14
|
import { ServersNamespace } from './resources/servers/index.js';
|
|
15
|
+
import { SystemsNamespace } from './resources/systems.js';
|
|
12
16
|
/**
|
|
13
17
|
* The root MeowPanel API client.
|
|
14
18
|
*
|
|
@@ -27,13 +31,13 @@ import { ServersNamespace } from './resources/servers/index.js';
|
|
|
27
31
|
* // Fetch resources
|
|
28
32
|
* const me = await api.account.get();
|
|
29
33
|
* const servers = await api.servers.list({ include: ['status'] });
|
|
30
|
-
* const
|
|
34
|
+
* const users = await api.users.list();
|
|
31
35
|
*
|
|
32
36
|
* // Reactive store: {#each $api.servers as server} ... {/each}
|
|
33
37
|
*
|
|
34
38
|
* // Listen for mutations
|
|
35
39
|
* api.servers.on('created', (server) => console.log('New server:', server.name));
|
|
36
|
-
* api.
|
|
40
|
+
* api.users.on('updated', (user) => console.log('User updated:', user.nickname));
|
|
37
41
|
*
|
|
38
42
|
* // Panel-level SSE
|
|
39
43
|
* const sse = api.connectSse();
|
|
@@ -59,7 +63,7 @@ export class MeowPanelApi {
|
|
|
59
63
|
* @example
|
|
60
64
|
* ```ts ignore
|
|
61
65
|
* const me = await api.account.get();
|
|
62
|
-
* await api.account.update({
|
|
66
|
+
* await api.account.update({ preferences: { theme: 'dark' } });
|
|
63
67
|
* await api.account.uploadAvatar(imageBlob, 'image/png');
|
|
64
68
|
* ```
|
|
65
69
|
*/
|
|
@@ -75,18 +79,38 @@ export class MeowPanelApi {
|
|
|
75
79
|
*/
|
|
76
80
|
apiKeys;
|
|
77
81
|
/**
|
|
78
|
-
* Manage
|
|
82
|
+
* Manage user accounts.
|
|
79
83
|
*
|
|
80
|
-
* Supports reactive subscriptions via `$api.
|
|
84
|
+
* Supports reactive subscriptions via `$api.users`.
|
|
81
85
|
*
|
|
82
86
|
* @example
|
|
83
87
|
* ```ts ignore
|
|
84
|
-
* const
|
|
85
|
-
* const
|
|
86
|
-
* await api.
|
|
88
|
+
* const users = await api.users.list();
|
|
89
|
+
* const user = await api.users.get(id);
|
|
90
|
+
* await api.users.update(id, { nickname: 'newname' });
|
|
87
91
|
* ```
|
|
88
92
|
*/
|
|
89
|
-
|
|
93
|
+
users;
|
|
94
|
+
/**
|
|
95
|
+
* Manage roles (named permission bundles).
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```ts ignore
|
|
99
|
+
* const roles = await api.roles.list();
|
|
100
|
+
* await api.roles.permissions(roleId).grant({ permission: 'server.console.read' });
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
roles;
|
|
104
|
+
/**
|
|
105
|
+
* Manage systems (non-user identities) and their API keys.
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```ts ignore
|
|
109
|
+
* const system = await api.systems.create({ name: 'CI deploy' });
|
|
110
|
+
* const { token } = await api.systems.keys(system.id).create({ name: 'pipeline', permissions: ['server.read'] });
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
systems;
|
|
90
114
|
/**
|
|
91
115
|
* Manage nodes (daemon servers).
|
|
92
116
|
*
|
|
@@ -159,6 +183,19 @@ export class MeowPanelApi {
|
|
|
159
183
|
* ```
|
|
160
184
|
*/
|
|
161
185
|
servers;
|
|
186
|
+
/**
|
|
187
|
+
* Browse the code-defined feature catalog. Per-server feature state is at `server.features`.
|
|
188
|
+
*/
|
|
189
|
+
features;
|
|
190
|
+
/**
|
|
191
|
+
* Read panel-wide activity logs.
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* ```ts ignore
|
|
195
|
+
* const { data } = await api.logs.activities({ type: 'server.power.start' });
|
|
196
|
+
* ```
|
|
197
|
+
*/
|
|
198
|
+
logs;
|
|
162
199
|
constructor(options) {
|
|
163
200
|
if (!options?.url) {
|
|
164
201
|
throw new Error('MeowPanelApi requires a "url" option (e.g. "https://panel.example.com").');
|
|
@@ -172,12 +209,16 @@ export class MeowPanelApi {
|
|
|
172
209
|
this.auth = new AuthResource(this.http);
|
|
173
210
|
this.account = new AccountResource(this.http);
|
|
174
211
|
this.apiKeys = new ApiKeysNamespace(this.http);
|
|
175
|
-
this.
|
|
212
|
+
this.users = new UsersNamespace(this.http);
|
|
213
|
+
this.roles = new RolesNamespace(this.http);
|
|
214
|
+
this.systems = new SystemsNamespace(this.http);
|
|
176
215
|
this.nodes = new NodesNamespace(this.http);
|
|
177
216
|
this.eggs = new EggsNamespace(this.http);
|
|
178
217
|
this.hosts = new HostsNamespace(this.http);
|
|
179
218
|
this.serverGroups = new ServerGroupsNamespace(this.http);
|
|
180
219
|
this.servers = new ServersNamespace(this.http);
|
|
220
|
+
this.features = new FeaturesResource(this.http);
|
|
221
|
+
this.logs = new LogsResource(this.http);
|
|
181
222
|
}
|
|
182
223
|
/**
|
|
183
224
|
* Update the bearer token used for all subsequent API requests.
|
|
@@ -196,7 +237,7 @@ export class MeowPanelApi {
|
|
|
196
237
|
* Create a panel-level Server-Sent Events connection to Nexus.
|
|
197
238
|
*
|
|
198
239
|
* The panel SSE stream (`GET /v1/sse`) broadcasts events for mutations
|
|
199
|
-
* across the panel (e.g. server updates,
|
|
240
|
+
* across the panel (e.g. server updates, user changes).
|
|
200
241
|
*
|
|
201
242
|
* The connection is not opened until you call `.connect()` on the returned object.
|
|
202
243
|
*
|
package/esm/src/http.d.ts
CHANGED
|
@@ -105,12 +105,12 @@ export declare class HttpClient {
|
|
|
105
105
|
*/
|
|
106
106
|
patch<T = void>(path: string, body?: unknown, opts?: RequestOptions): Promise<T>;
|
|
107
107
|
/**
|
|
108
|
-
* DELETE a resource.
|
|
108
|
+
* DELETE a resource. Returns `undefined` for `204 No Content`, otherwise the parsed body.
|
|
109
109
|
*
|
|
110
110
|
* @param path Path relative to the API base URL.
|
|
111
111
|
* @param opts Additional request options.
|
|
112
112
|
*/
|
|
113
|
-
delete(path: string, opts?: RequestOptions): Promise<
|
|
113
|
+
delete<T = void>(path: string, opts?: RequestOptions): Promise<T>;
|
|
114
114
|
/**
|
|
115
115
|
* PUT raw body content (e.g. for binary or multipart uploads).
|
|
116
116
|
*
|
package/esm/src/http.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/src/http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEzD,4CAA4C;AAC5C,MAAM,WAAW,iBAAiB;IACjC,6EAA6E;IAC7E,GAAG,EAAE,MAAM,CAAC;IACZ,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;IAChC,4EAA4E;IAC5E,MAAM,CAAC,EAAE,UAAU,CAAC;CACpB;AAED,4EAA4E;AAC5E,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG,iBAAiB,GAAG,eAAe,CAAC;AAEhF,wDAAwD;AACxD,UAAU,gBAAgB;IACzB,IAAI,EAAE,WAAW,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;CAC/D;AAED,oDAAoD;AACpD,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB;IACjE,IAAI,EAAE,eAAe,CAAC;CACtB;AAED,uDAAuD;AACvD,MAAM,WAAW,0BAA2B,SAAQ,gBAAgB;IACnE,IAAI,EAAE,iBAAiB,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACnB;AAED,sEAAsE;AACtE,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB;IACjE,IAAI,EAAE,eAAe,CAAC;IACtB,MAAM,CAAC,EAAE,MA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I,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,GAAE,cAAmB,GAAG,OAAO,CAAC,CAAC,CAAC;IAUjG;;;;;OAKG;IACU,MAAM,CAAC,CAAC,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,cAAmB,GAAG,OAAO,CAAC,CAAC,CAAC;IAMlF;;;;;;;OAOG;IACU,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,GAAE,cAAmB,GAAG,OAAO,CAAC,CAAC,CAAC;IAapH;;;;;;;OAOG;IACU,IAAI,CAAC,CAAC,EAClB,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,WAAgB,EACtB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,GACjE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;CAwBxB"}
|
package/esm/src/http.js
CHANGED
|
@@ -185,13 +185,16 @@ export class HttpClient {
|
|
|
185
185
|
return res.json();
|
|
186
186
|
}
|
|
187
187
|
/**
|
|
188
|
-
* DELETE a resource.
|
|
188
|
+
* DELETE a resource. Returns `undefined` for `204 No Content`, otherwise the parsed body.
|
|
189
189
|
*
|
|
190
190
|
* @param path Path relative to the API base URL.
|
|
191
191
|
* @param opts Additional request options.
|
|
192
192
|
*/
|
|
193
193
|
async delete(path, opts = {}) {
|
|
194
|
-
await this.fetch(path, { method: 'DELETE', signal: opts.signal }, opts.params);
|
|
194
|
+
const res = await this.fetch(path, { method: 'DELETE', signal: opts.signal }, opts.params);
|
|
195
|
+
if (res.status === 204)
|
|
196
|
+
return undefined;
|
|
197
|
+
return res.json();
|
|
195
198
|
}
|
|
196
199
|
/**
|
|
197
200
|
* PUT raw body content (e.g. for binary or multipart uploads).
|
package/esm/src/namespace.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { TypedEmitter } from './emitter.js';
|
|
|
2
2
|
import type { HttpClient } from './http.js';
|
|
3
3
|
import type { NanoID } from './types.js';
|
|
4
4
|
/**
|
|
5
|
-
* Base class for all resource namespaces (e.g. `api.servers`, `api.
|
|
5
|
+
* Base class for all resource namespaces (e.g. `api.servers`, `api.users`).
|
|
6
6
|
*
|
|
7
7
|
* Provides:
|
|
8
8
|
* - A **readable store** so reactive consumers can auto-subscribe with `$api.servers`, etc.
|
package/esm/src/namespace.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TypedEmitter } from './emitter.js';
|
|
2
2
|
/**
|
|
3
|
-
* Base class for all resource namespaces (e.g. `api.servers`, `api.
|
|
3
|
+
* Base class for all resource namespaces (e.g. `api.servers`, `api.users`).
|
|
4
4
|
*
|
|
5
5
|
* Provides:
|
|
6
6
|
* - A **readable store** so reactive consumers can auto-subscribe with `$api.servers`, etc.
|
|
@@ -1,32 +1,41 @@
|
|
|
1
1
|
import type { HttpClient } from '../http.js';
|
|
2
2
|
import { ReactiveResource } from '../reactive.js';
|
|
3
|
-
import type { IncludeOptions, ISODate, NanoID } from '../types.js';
|
|
4
|
-
|
|
3
|
+
import type { IncludeOptions, ISODate, NanoID, Paginated } from '../types.js';
|
|
4
|
+
import type { UiTheme, UserPreferences, UserPreferencesData } from './users.js';
|
|
5
|
+
import { type ActivityFeedOptions, type ActivityLog } from './servers/activity.js';
|
|
6
|
+
import { type RequestLog, type RequestLogFeedOptions } from './request-logs.js';
|
|
7
|
+
/**
|
|
8
|
+
* Shared issuer-envelope fields present on all account responses.
|
|
9
|
+
*
|
|
10
|
+
* `id` is the namespaced `"<type>:<id>"` form and `ref_id` holds the bare id.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
5
13
|
interface AccountDataBase {
|
|
6
14
|
id: string;
|
|
7
|
-
|
|
15
|
+
type: string;
|
|
16
|
+
ref_id: string;
|
|
8
17
|
permissions?: string[];
|
|
9
18
|
created_at: ISODate;
|
|
10
19
|
updated_at: ISODate;
|
|
11
20
|
}
|
|
12
21
|
/** Raw API shape for a user account. @internal */
|
|
13
22
|
interface UserAccountData extends AccountDataBase {
|
|
14
|
-
|
|
23
|
+
type: 'user';
|
|
15
24
|
email: string;
|
|
25
|
+
email_verified_at: ISODate | null;
|
|
16
26
|
nickname: string | null;
|
|
17
27
|
avatar_uri: string | null;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
theme: string | null;
|
|
21
|
-
} | null;
|
|
28
|
+
disabled_at: ISODate | null;
|
|
29
|
+
preferences?: UserPreferencesData | null;
|
|
22
30
|
}
|
|
23
31
|
/** Raw API shape for an API key account. @internal */
|
|
24
32
|
interface ApiKeyAccountData extends AccountDataBase {
|
|
25
|
-
|
|
33
|
+
type: 'api_key';
|
|
26
34
|
name: string;
|
|
27
35
|
description: string | null;
|
|
28
36
|
owner_id: string;
|
|
29
37
|
owner?: UserAccountData;
|
|
38
|
+
revoked_at: ISODate | null;
|
|
30
39
|
}
|
|
31
40
|
type AccountData = UserAccountData | ApiKeyAccountData;
|
|
32
41
|
/**
|
|
@@ -52,16 +61,17 @@ export declare abstract class Account extends ReactiveResource {
|
|
|
52
61
|
export declare class UserAccount extends Account {
|
|
53
62
|
readonly issuerType: "user";
|
|
54
63
|
email: string;
|
|
64
|
+
/** When this user verified their email, or `null` if unverified. */
|
|
65
|
+
emailVerifiedAt: Date | null;
|
|
55
66
|
nickname: string | null;
|
|
56
67
|
avatarUri: string | null;
|
|
68
|
+
/** When this account was disabled, or `null` if active. */
|
|
69
|
+
disabledAt: Date | null;
|
|
57
70
|
/**
|
|
58
|
-
* Display preferences. Populated with `include=
|
|
59
|
-
* Requires `
|
|
71
|
+
* Display and locale preferences. Populated with `include=preferences`.
|
|
72
|
+
* Requires `user.preferences.read` permission or being the account owner.
|
|
60
73
|
*/
|
|
61
|
-
|
|
62
|
-
language: string | null;
|
|
63
|
-
theme: string | null;
|
|
64
|
-
} | undefined;
|
|
74
|
+
preferences: UserPreferences | undefined;
|
|
65
75
|
/** @internal */
|
|
66
76
|
constructor(data: UserAccountData, http: HttpClient);
|
|
67
77
|
/** Update this user account in place. */
|
|
@@ -74,9 +84,14 @@ export declare class ApiKeyAccount extends Account {
|
|
|
74
84
|
readonly issuerType: "api_key";
|
|
75
85
|
name: string;
|
|
76
86
|
description: string | null;
|
|
87
|
+
/** The owner's bare NanoID (parsed from the namespaced `owner_id`). */
|
|
77
88
|
readonly ownerId: NanoID;
|
|
78
|
-
/** The owner
|
|
89
|
+
/** The owner's issuer type, e.g. `'user'` or `'system'`. */
|
|
90
|
+
readonly ownerType: string;
|
|
91
|
+
/** The owner. Requires `?include=owner`. */
|
|
79
92
|
owner: UserAccount | undefined;
|
|
93
|
+
/** When this key was revoked, or `null` if active. */
|
|
94
|
+
revokedAt: Date | null;
|
|
80
95
|
/** @internal */
|
|
81
96
|
constructor(data: ApiKeyAccountData, http: HttpClient);
|
|
82
97
|
}
|
|
@@ -133,13 +148,13 @@ export declare class AccountSshKeysManager {
|
|
|
133
148
|
delete(id: NanoID): Promise<void>;
|
|
134
149
|
}
|
|
135
150
|
/** Valid include keys for the account endpoint. */
|
|
136
|
-
export type AccountInclude = '
|
|
151
|
+
export type AccountInclude = 'preferences' | 'permissions';
|
|
137
152
|
/** Fields that can be updated on a user account. */
|
|
138
153
|
export interface UpdateAccountPayload {
|
|
139
154
|
nickname?: string;
|
|
140
|
-
|
|
155
|
+
preferences?: {
|
|
156
|
+
theme?: UiTheme;
|
|
141
157
|
language?: string | null;
|
|
142
|
-
theme?: string | null;
|
|
143
158
|
};
|
|
144
159
|
}
|
|
145
160
|
/**
|
|
@@ -172,6 +187,22 @@ export declare class AccountResource {
|
|
|
172
187
|
fetchAvatar(): Promise<Blob>;
|
|
173
188
|
/** Fetch the permission scopes available to the current account. */
|
|
174
189
|
scopes(): Promise<string[]>;
|
|
190
|
+
/**
|
|
191
|
+
* Fetch the current account's activity feed (actions performed on this account).
|
|
192
|
+
*
|
|
193
|
+
* Only user accounts have an activity feed.
|
|
194
|
+
*
|
|
195
|
+
* @param opts Pagination and filter options.
|
|
196
|
+
*/
|
|
197
|
+
activities(opts?: ActivityFeedOptions): Promise<Paginated<ActivityLog>>;
|
|
198
|
+
/**
|
|
199
|
+
* Fetch the current account's own HTTP request log.
|
|
200
|
+
*
|
|
201
|
+
* Scoped to the caller; no permission beyond being that account is required.
|
|
202
|
+
*
|
|
203
|
+
* @param opts Pagination, filters, and includes.
|
|
204
|
+
*/
|
|
205
|
+
requestLogs(opts?: RequestLogFeedOptions): Promise<Paginated<RequestLog>>;
|
|
175
206
|
/** Manage SSH public keys on the current user account. */
|
|
176
207
|
get sshKeys(): AccountSshKeysManager;
|
|
177
208
|
}
|