Skip to content

Commit

Permalink
fix(cli): Make it possible to create public buckets using CLI (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
skambalin authored Sep 13, 2024
1 parent 03fd451 commit 0025c9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions packages/cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,14 @@ yargs(hideBin(process.argv))
}),
async ({ bucketAccess, ...argv }) => {
const bucketId = await withClient(argv, (client) =>
createBucket(client, { ...argv, isPublic: argv.bucketAccess === 'public' }),
createBucket(client, { ...argv, isPublic: bucketAccess === 'public' }),
);

console.group('Deposit completed');
console.group('Bucket created');
console.log('Network:', argv.network);
console.log('Cluster ID:', argv.clusterId);
console.log('Bucket ID:', bucketId);
console.log('Bucket ID:', Number(bucketId));
console.log('Access:', bucketAccess);
console.groupEnd();
},
)
Expand Down Expand Up @@ -301,7 +302,7 @@ yargs(hideBin(process.argv))
})
.option('expiresIn', {
type: 'number',
describe: 'Token expiration time in milliseconds',
describe: 'Token expiration time in seconds',
})
.option('signer', {
alias: 's',
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const createToken = async (options: TokenOptions) => {
prev: options.prev,
canDelegate: options.canDelegate,
subject: options.subject,
expiresIn: options.expiresIn,
expiresIn: options.expiresIn && options.expiresIn * 1000,
bucketId: options.bucketId ? BigInt(options.bucketId) : undefined,
operations: options.operations.map((op) => operationsMap[op]),
});
Expand Down

0 comments on commit 0025c9a

Please sign in to comment.