Skip to content

Conversation

@SylvainSenechal
Copy link
Contributor

ISSUE: CLDSRVCLT-4

"description": "Smithy-generated TypeScript client for Cloudserver's internal APIs",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will allow importing with subpath, for example

import { BucketQuotaClient } from '@scality/cloudserverclient/quota'


namespace cloudserver.bucketquota

use aws.protocols#restXml
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have to create a new separate service, as the other client is json, but the quota apis are xml.
And anyways it might just be better for code organisation.

} from '../build/smithy/cloudserverBucketQuota/typescript-codegen';
import { CloudserverClientConfig } from '../build/smithy/cloudserver/typescript-codegen';

export class BucketQuotaClient {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ended up creating a wrapper, it will be easier to use as you will see in the tests, and i was kinda forced to do it because of the update quota api. Basically we probably made a mistake when designing the update quota apis, which wants to receive a structure like this :

<quota>1000002</quota>
But ideally it should look like this :

<parent>
    <quota>1000002</quota>
    <otherProperties>
</parent>

When using the first structure, we can't use integers, so I was forced to send a string like this, but since we want a convenient api, I don't want frontend colleagues to have to call
client.updateQuota(bucket, '<quota>12</quota>')) which is ridiculous
so with this they will be able to send
client.updateQuota(bucket, 12'))

env:
SMITHY_VERSION: '1.61.0'
run: |
# Extract Smithy version from smithy-build.json
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not directly related with the pr, but this is nicer as we will only have one source of truth for smithy version.
I could definitely see someone updating smithy version here and forgetting about updating it in smithy-build.json

@SylvainSenechal SylvainSenechal requested review from a team, benzekrimaha and delthas December 16, 2025 17:00
@SylvainSenechal SylvainSenechal marked this pull request as ready for review December 16, 2025 17:00

Choose a reason for hiding this comment

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

We can create a new folder client or rename these files with client. Quota.ts is not very friendly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had the same thought, but i thought it would look weird because the import path would end up with "client" twice. But still, I moved everything in a /clients folder it will be better

@SylvainSenechal SylvainSenechal force-pushed the improvement/CLDSRVCLT-4 branch 3 times, most recently from 7d4575b to 6e52335 Compare December 17, 2025 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants