feat(core): rebrand to @lossless.zone/objectstorage
- Rename from @lossless.zone/s3container to @lossless.zone/objectstorage - Replace @push.rocks/smarts3 with @push.rocks/smartstorage - Change env var prefix from S3_ to OBJST_ - Rename S3Container class to ObjectStorageContainer - Update web component prefix from s3c- to objst- - Update UI labels, CLI flags, documentation, and Docker config
This commit is contained in:
7
ts_interfaces/data/auth.ts
Normal file
7
ts_interfaces/data/auth.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export interface IIdentity {
|
||||
jwt: string;
|
||||
userId: string;
|
||||
username: string;
|
||||
expiresAt: number;
|
||||
role: 'admin';
|
||||
}
|
||||
6
ts_interfaces/data/bucket.ts
Normal file
6
ts_interfaces/data/bucket.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export interface IBucketInfo {
|
||||
name: string;
|
||||
creationDate: number;
|
||||
objectCount: number;
|
||||
totalSizeBytes: number;
|
||||
}
|
||||
5
ts_interfaces/data/index.ts
Normal file
5
ts_interfaces/data/index.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export * from './auth.ts';
|
||||
export * from './bucket.ts';
|
||||
export * from './object.ts';
|
||||
export * from './policy.ts';
|
||||
export * from './server.ts';
|
||||
14
ts_interfaces/data/object.ts
Normal file
14
ts_interfaces/data/object.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
export interface IObjectInfo {
|
||||
key: string;
|
||||
size: number;
|
||||
lastModified: number;
|
||||
etag: string;
|
||||
contentType: string;
|
||||
}
|
||||
|
||||
export interface IObjectListResult {
|
||||
objects: IObjectInfo[];
|
||||
commonPrefixes: string[];
|
||||
isTruncated: boolean;
|
||||
currentPrefix: string;
|
||||
}
|
||||
22
ts_interfaces/data/policy.ts
Normal file
22
ts_interfaces/data/policy.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
export interface IObjstStatement {
|
||||
Sid?: string;
|
||||
Effect: 'Allow' | 'Deny';
|
||||
Principal: string | Record<string, string | string[]>;
|
||||
Action: string | string[];
|
||||
Resource: string | string[];
|
||||
Condition?: Record<string, Record<string, string | string[]>>;
|
||||
}
|
||||
|
||||
export interface INamedPolicy {
|
||||
id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
statements: IObjstStatement[];
|
||||
createdAt: number;
|
||||
updatedAt: number;
|
||||
}
|
||||
|
||||
export interface IPoliciesData {
|
||||
namedPolicies: Record<string, INamedPolicy>;
|
||||
bucketPolicyAttachments: Record<string, string[]>;
|
||||
}
|
||||
35
ts_interfaces/data/server.ts
Normal file
35
ts_interfaces/data/server.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
export interface IServerStatus {
|
||||
running: boolean;
|
||||
objstPort: number;
|
||||
uiPort: number;
|
||||
uptime: number;
|
||||
startedAt: number;
|
||||
bucketCount: number;
|
||||
totalObjectCount: number;
|
||||
totalStorageBytes: number;
|
||||
storageDirectory: string;
|
||||
region: string;
|
||||
authEnabled: boolean;
|
||||
}
|
||||
|
||||
export interface IServerConfig {
|
||||
objstPort: number;
|
||||
uiPort: number;
|
||||
region: string;
|
||||
storageDirectory: string;
|
||||
authEnabled: boolean;
|
||||
corsEnabled: boolean;
|
||||
}
|
||||
|
||||
export interface IObjstCredential {
|
||||
accessKeyId: string;
|
||||
secretAccessKey: string;
|
||||
}
|
||||
|
||||
export interface IConnectionInfo {
|
||||
endpoint: string;
|
||||
port: number;
|
||||
useSsl: boolean;
|
||||
accessKey: string;
|
||||
region: string;
|
||||
}
|
||||
7
ts_interfaces/index.ts
Normal file
7
ts_interfaces/index.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export * from './plugins.ts';
|
||||
|
||||
import * as data from './data/index.ts';
|
||||
export { data };
|
||||
|
||||
import * as requests from './requests/index.ts';
|
||||
export { requests };
|
||||
2
ts_interfaces/plugins.ts
Normal file
2
ts_interfaces/plugins.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
import * as typedrequestInterfaces from '@api.global/typedrequest-interfaces';
|
||||
export { typedrequestInterfaces };
|
||||
43
ts_interfaces/requests/admin.ts
Normal file
43
ts_interfaces/requests/admin.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import * as plugins from '../plugins.ts';
|
||||
import * as data from '../data/index.ts';
|
||||
|
||||
export interface IReq_AdminLoginWithUsernameAndPassword extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_AdminLoginWithUsernameAndPassword
|
||||
> {
|
||||
method: 'adminLoginWithUsernameAndPassword';
|
||||
request: {
|
||||
username: string;
|
||||
password: string;
|
||||
};
|
||||
response: {
|
||||
identity?: data.IIdentity;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_AdminLogout extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_AdminLogout
|
||||
> {
|
||||
method: 'adminLogout';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
};
|
||||
response: {
|
||||
ok: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_VerifyIdentity extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_VerifyIdentity
|
||||
> {
|
||||
method: 'verifyIdentity';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
};
|
||||
response: {
|
||||
valid: boolean;
|
||||
identity?: data.IIdentity;
|
||||
};
|
||||
}
|
||||
86
ts_interfaces/requests/buckets.ts
Normal file
86
ts_interfaces/requests/buckets.ts
Normal file
@@ -0,0 +1,86 @@
|
||||
import * as plugins from '../plugins.ts';
|
||||
import * as data from '../data/index.ts';
|
||||
|
||||
export interface IReq_ListBuckets extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_ListBuckets
|
||||
> {
|
||||
method: 'listBuckets';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
};
|
||||
response: {
|
||||
buckets: data.IBucketInfo[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_CreateBucket extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_CreateBucket
|
||||
> {
|
||||
method: 'createBucket';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
bucketName: string;
|
||||
};
|
||||
response: {
|
||||
ok: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_DeleteBucket extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_DeleteBucket
|
||||
> {
|
||||
method: 'deleteBucket';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
bucketName: string;
|
||||
};
|
||||
response: {
|
||||
ok: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_GetBucketPolicy extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetBucketPolicy
|
||||
> {
|
||||
method: 'getBucketPolicy';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
bucketName: string;
|
||||
};
|
||||
response: {
|
||||
policy: string | null;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_PutBucketPolicy extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_PutBucketPolicy
|
||||
> {
|
||||
method: 'putBucketPolicy';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
bucketName: string;
|
||||
policy: string;
|
||||
};
|
||||
response: {
|
||||
ok: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_DeleteBucketPolicy extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_DeleteBucketPolicy
|
||||
> {
|
||||
method: 'deleteBucketPolicy';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
bucketName: string;
|
||||
};
|
||||
response: {
|
||||
ok: boolean;
|
||||
};
|
||||
}
|
||||
15
ts_interfaces/requests/config.ts
Normal file
15
ts_interfaces/requests/config.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import * as plugins from '../plugins.ts';
|
||||
import * as data from '../data/index.ts';
|
||||
|
||||
export interface IReq_GetServerConfig extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetServerConfig
|
||||
> {
|
||||
method: 'getServerConfig';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
};
|
||||
response: {
|
||||
config: data.IServerConfig;
|
||||
};
|
||||
}
|
||||
44
ts_interfaces/requests/credentials.ts
Normal file
44
ts_interfaces/requests/credentials.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import * as plugins from '../plugins.ts';
|
||||
import * as data from '../data/index.ts';
|
||||
|
||||
export interface IReq_GetCredentials extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetCredentials
|
||||
> {
|
||||
method: 'getCredentials';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
};
|
||||
response: {
|
||||
credentials: data.IObjstCredential[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_AddCredential extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_AddCredential
|
||||
> {
|
||||
method: 'addCredential';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
accessKeyId: string;
|
||||
secretAccessKey: string;
|
||||
};
|
||||
response: {
|
||||
ok: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_RemoveCredential extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_RemoveCredential
|
||||
> {
|
||||
method: 'removeCredential';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
accessKeyId: string;
|
||||
};
|
||||
response: {
|
||||
ok: boolean;
|
||||
};
|
||||
}
|
||||
7
ts_interfaces/requests/index.ts
Normal file
7
ts_interfaces/requests/index.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export * from './admin.ts';
|
||||
export * from './status.ts';
|
||||
export * from './buckets.ts';
|
||||
export * from './objects.ts';
|
||||
export * from './config.ts';
|
||||
export * from './credentials.ts';
|
||||
export * from './policies.ts';
|
||||
134
ts_interfaces/requests/objects.ts
Normal file
134
ts_interfaces/requests/objects.ts
Normal file
@@ -0,0 +1,134 @@
|
||||
import * as plugins from '../plugins.ts';
|
||||
import * as data from '../data/index.ts';
|
||||
|
||||
export interface IReq_ListObjects extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_ListObjects
|
||||
> {
|
||||
method: 'listObjects';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
bucketName: string;
|
||||
prefix?: string;
|
||||
delimiter?: string;
|
||||
maxKeys?: number;
|
||||
};
|
||||
response: {
|
||||
result: data.IObjectListResult;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_DeleteObject extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_DeleteObject
|
||||
> {
|
||||
method: 'deleteObject';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
bucketName: string;
|
||||
key: string;
|
||||
};
|
||||
response: {
|
||||
ok: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_GetObject extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetObject
|
||||
> {
|
||||
method: 'getObject';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
bucketName: string;
|
||||
key: string;
|
||||
};
|
||||
response: {
|
||||
content: string;
|
||||
contentType: string;
|
||||
size: number;
|
||||
lastModified: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_PutObject extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_PutObject
|
||||
> {
|
||||
method: 'putObject';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
bucketName: string;
|
||||
key: string;
|
||||
base64Content: string;
|
||||
contentType: string;
|
||||
};
|
||||
response: {
|
||||
ok: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_DeletePrefix extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_DeletePrefix
|
||||
> {
|
||||
method: 'deletePrefix';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
bucketName: string;
|
||||
prefix: string;
|
||||
};
|
||||
response: {
|
||||
ok: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_GetObjectUrl extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetObjectUrl
|
||||
> {
|
||||
method: 'getObjectUrl';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
bucketName: string;
|
||||
key: string;
|
||||
};
|
||||
response: {
|
||||
url: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_MoveObject extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_MoveObject
|
||||
> {
|
||||
method: 'moveObject';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
bucketName: string;
|
||||
sourceKey: string;
|
||||
destKey: string;
|
||||
};
|
||||
response: {
|
||||
success: boolean;
|
||||
error?: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_MovePrefix extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_MovePrefix
|
||||
> {
|
||||
method: 'movePrefix';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
bucketName: string;
|
||||
sourcePrefix: string;
|
||||
destPrefix: string;
|
||||
};
|
||||
response: {
|
||||
success: boolean;
|
||||
movedCount?: number;
|
||||
error?: string;
|
||||
};
|
||||
}
|
||||
137
ts_interfaces/requests/policies.ts
Normal file
137
ts_interfaces/requests/policies.ts
Normal file
@@ -0,0 +1,137 @@
|
||||
import * as plugins from '../plugins.ts';
|
||||
import * as data from '../data/index.ts';
|
||||
|
||||
export interface IReq_ListNamedPolicies extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_ListNamedPolicies
|
||||
> {
|
||||
method: 'listNamedPolicies';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
};
|
||||
response: {
|
||||
policies: data.INamedPolicy[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_CreateNamedPolicy extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_CreateNamedPolicy
|
||||
> {
|
||||
method: 'createNamedPolicy';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
name: string;
|
||||
description: string;
|
||||
statements: data.IObjstStatement[];
|
||||
};
|
||||
response: {
|
||||
policy: data.INamedPolicy;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_UpdateNamedPolicy extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_UpdateNamedPolicy
|
||||
> {
|
||||
method: 'updateNamedPolicy';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
policyId: string;
|
||||
name: string;
|
||||
description: string;
|
||||
statements: data.IObjstStatement[];
|
||||
};
|
||||
response: {
|
||||
policy: data.INamedPolicy;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_DeleteNamedPolicy extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_DeleteNamedPolicy
|
||||
> {
|
||||
method: 'deleteNamedPolicy';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
policyId: string;
|
||||
};
|
||||
response: {
|
||||
ok: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_GetBucketNamedPolicies extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetBucketNamedPolicies
|
||||
> {
|
||||
method: 'getBucketNamedPolicies';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
bucketName: string;
|
||||
};
|
||||
response: {
|
||||
attachedPolicies: data.INamedPolicy[];
|
||||
availablePolicies: data.INamedPolicy[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_AttachPolicyToBucket extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_AttachPolicyToBucket
|
||||
> {
|
||||
method: 'attachPolicyToBucket';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
policyId: string;
|
||||
bucketName: string;
|
||||
};
|
||||
response: {
|
||||
ok: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_DetachPolicyFromBucket extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_DetachPolicyFromBucket
|
||||
> {
|
||||
method: 'detachPolicyFromBucket';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
policyId: string;
|
||||
bucketName: string;
|
||||
};
|
||||
response: {
|
||||
ok: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_GetPolicyBuckets extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetPolicyBuckets
|
||||
> {
|
||||
method: 'getPolicyBuckets';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
policyId: string;
|
||||
};
|
||||
response: {
|
||||
attachedBuckets: string[];
|
||||
availableBuckets: string[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_SetPolicyBuckets extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_SetPolicyBuckets
|
||||
> {
|
||||
method: 'setPolicyBuckets';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
policyId: string;
|
||||
bucketNames: string[];
|
||||
};
|
||||
response: {
|
||||
ok: boolean;
|
||||
};
|
||||
}
|
||||
16
ts_interfaces/requests/status.ts
Normal file
16
ts_interfaces/requests/status.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import * as plugins from '../plugins.ts';
|
||||
import * as data from '../data/index.ts';
|
||||
|
||||
export interface IReq_GetServerStatus extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetServerStatus
|
||||
> {
|
||||
method: 'getServerStatus';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
};
|
||||
response: {
|
||||
status: data.IServerStatus;
|
||||
connectionInfo: data.IConnectionInfo;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user