Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions models/extended/searchBucket.smithy
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
$version: "2.0"

namespace cloudserver.s3extended

@http(method: "GET", uri: "/{Bucket}")
@readonly
operation SearchBucket {
Copy link
Contributor

@francoisferrand francoisferrand Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is called ListObjects in s3:

  • should we not call this SearchObjects ?
  • or even just keep the name ListObjects even if we have extra params for searching?

(similar for ListObjectsV2 and ListObjectVersions below)

input := {
@required
@httpLabel
Bucket: String

@required
@httpQuery("search")
Query: String

@httpQuery("delimiter")
Delimiter: String

@httpQuery("encoding-type")
EncodingType: String

@httpQuery("marker")
Marker: String

@httpQuery("max-keys")
MaxKeys: Integer

@httpQuery("prefix")
Prefix: String

@httpHeader("x-amz-request-payer")
RequestPayer: String
}
output := @xmlName("ListBucketResult") {
IsTruncated: Boolean

Marker: String

NextMarker: String

@xmlFlattened
Contents: ObjectList

Name: String

Prefix: String

Delimiter: String

MaxKeys: Integer

@xmlFlattened
CommonPrefixes: CommonPrefixList

EncodingType: String
}
}
97 changes: 97 additions & 0 deletions models/extended/searchBucketV2.smithy
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
$version: "2.0"

namespace cloudserver.s3extended

@http(method: "GET", uri: "/{Bucket}?list-type=2")
@readonly
operation SearchBucketV2 {
input := {
@required
@httpLabel
Bucket: String

@required
@httpQuery("search")
Query: String

@httpQuery("delimiter")
Delimiter: String

@httpQuery("encoding-type")
EncodingType: String

@httpQuery("max-keys")
MaxKeys: Integer

@httpQuery("prefix")
Prefix: String

@httpQuery("continuation-token")
ContinuationToken: String

@httpQuery("fetch-owner")
FetchOwner: Boolean

@httpQuery("start-after")
StartAfter: String

@httpHeader("x-amz-request-payer")
RequestPayer: String

@httpHeader("x-amz-expected-bucket-owner")
ExpectedBucketOwner: String
}
output := {
IsTruncated: Boolean

@xmlFlattened
Contents: ObjectList

Name: String

Prefix: String

Delimiter: String

MaxKeys: Integer

@xmlFlattened
CommonPrefixes: CommonPrefixList

EncodingType: String

KeyCount: Integer

ContinuationToken: String

NextContinuationToken: String

StartAfter: String
}
}

list ObjectList {
member: S3Object
}

structure S3Object {
Key: String
LastModified: Timestamp
ETag: String
Size: Integer
StorageClass: String
Owner: Owner
}

structure Owner {
DisplayName: String
ID: String
}

list CommonPrefixList {
member: CommonPrefix
}

structure CommonPrefix {
Prefix: String
}
Comment on lines +73 to +97
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we import/reuse the "official" types from AWS sdk ?

108 changes: 108 additions & 0 deletions models/extended/searchBucketVersions.smithy
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
$version: "2.0"

namespace cloudserver.s3extended

@http(method: "GET", uri: "/{Bucket}?versions=true")
@readonly
operation SearchBucketVersions {
input := {
@required
@httpLabel
Bucket: String

@required
@httpQuery("search")
Query: String

@httpQuery("delimiter")
Delimiter: String

@httpQuery("encoding-type")
EncodingType: String

@httpQuery("key-marker")
KeyMarker: String

@httpQuery("max-keys")
MaxKeys: Integer

@httpQuery("prefix")
Prefix: String

@httpHeader("x-amz-expected-bucket-owner")
ExpectedBucketOwner: String

@httpQuery("version-id-marker")
VersionIdMarker: String
}
output := @xmlName("ListVersionsResult") {
IsTruncated: Boolean

KeyMarker: String

VersionIdMarker: String

NextKeyMarker: String

NextVersionIdMarker: String

@xmlFlattened
Version: VersionList

@xmlFlattened
DeleteMarker: DeleteMarkerList

Name: String

Prefix: String

Delimiter: String

MaxKeys: Integer

@xmlFlattened
CommonPrefixes: CommonPrefixList

EncodingType: String
}
}

list VersionList {
member: Version
}

structure Version {
Key: String

@xmlName("IsLatest")
IsLatest: Boolean

LastModified: Timestamp

ETag: String

Size: Integer

StorageClass: String

Owner: Owner

VersionId: String
}

list DeleteMarkerList {
member: DeleteMarker
}

structure DeleteMarker {
Key: String

@xmlName("IsLatest")
IsLatest: Boolean

LastModified: Timestamp

Owner: Owner

VersionId: String
}
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"files": [
"dist",
"build/smithy/cloudserver/typescript-codegen",
"build/smithy/cloudserverBucketQuota/typescript-codegen"
"build/smithy/cloudserverBucketQuota/typescript-codegen",
"build/smithy/cloudserverS3Extended/typescript-codegen"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we bundle build/smithy or even build ?
or at least use a wildcard: build/smithy/*/typescript-codege

],
"publishConfig": {
"access": "public",
Expand All @@ -31,8 +32,9 @@
"build:smithy": "smithy build",
"build:generated": "cd build/smithy/cloudserver/typescript-codegen && yarn install && yarn build",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"build:generated": "cd build/smithy/cloudserver/typescript-codegen && yarn install && yarn build",
"build:generated:cloudserver": "cd build/smithy/cloudserver/typescript-codegen && yarn install && yarn build",

"build:generated:bucketQuota": "cd build/smithy/cloudserverBucketQuota/typescript-codegen && yarn install && yarn build",
"build:generated:s3extended": "cd build/smithy/cloudserverS3Extended/typescript-codegen && yarn install && yarn build",
Comment on lines 33 to +35
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we have a single step, maybe something like:

"build:generated": "echo build/smithy/*/typescript-codegen | xargs 'cd {} && yarn install && yarn build'"

"build:wrapper": "tsc",
"build": "yarn install && yarn clean:build && yarn build:smithy && yarn build:generated && yarn build:generated:bucketQuota && yarn build:wrapper",
"build": "yarn install && yarn clean:build && yarn build:smithy && yarn build:generated && yarn build:generated:bucketQuota && yarn build:generated:s3extended && yarn build:wrapper",
"test": "jest",
"test:indexes": "jest tests/testIndexesApis.test.ts",
"test:error-handling": "jest tests/testErrorHandling.test.ts",
Expand All @@ -42,7 +44,8 @@
"test:metadata": "jest tests/testMetadataApis.test.ts",
"test:raft": "jest tests/testRaftApis.test.ts",
"test:bucketQuotas": "jest tests/testQuotaApis.test.ts",
"test:mongo-backend": "yarn test:indexes && yarn test:error-handling && yarn test:multiple-backend && yarn test:bucketQuotas",
"test:s3Extended": "jest tests/testS3ExtendedApis.test.ts",
"test:mongo-backend": "yarn test:indexes && yarn test:error-handling && yarn test:multiple-backend && yarn test:bucketQuotas && yarn test:s3Extended",
"test:metadata-backend": "yarn test:api && yarn test:lifecycle && yarn test:metadata && yarn test:raft",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lifecycle should be tested with mongo as well?

"lint": "eslint src tests",
"typecheck": "tsc --noEmit"
Expand Down
19 changes: 19 additions & 0 deletions service/cloudserverS3Extended.smithy
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
$version: "2.0"

namespace cloudserver.s3extended

use aws.protocols#restXml
use aws.auth#sigv4
use aws.api#service

@restXml
@sigv4(name: "s3")
@service(sdkId: "cloudserverS3Extended")
service CloudserverS3Extended {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe call this MetadataSearch, since this is what this extension is about?

version: "2018-07-11",
operations: [
SearchBucket,
SearchBucketV2,
SearchBucketVersions,
]
}
9 changes: 9 additions & 0 deletions smithy-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@
"packageVersion": "1.0.0"
}
}
},
"cloudserverS3Extended": {
"plugins": {
"typescript-codegen": {
"service": "cloudserver.s3extended#CloudserverS3Extended",
"package": "@scality/cloudserverclient-s3extended",
"packageVersion": "1.0.0"
}
}
}
}
}
12 changes: 12 additions & 0 deletions src/clients/s3Extended.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {
CloudserverS3Extended,
CloudserverS3ExtendedClientConfig
} from '../../build/smithy/cloudserverS3Extended/typescript-codegen';
import { CloudserverClientConfig } from '../../build/smithy/cloudserver/typescript-codegen';

export * from '../../build/smithy/cloudserverS3Extended/typescript-codegen';
export class S3ExtendedClient extends CloudserverS3Extended {
constructor(config: CloudserverClientConfig | CloudserverS3ExtendedClientConfig) {
super(config);
}
}
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './clients/cloudserver';
export { BucketQuotaClient } from './clients/bucketQuota';
export { S3ExtendedClient } from './clients/s3Extended';
export * from './utils';
Loading
Loading