Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
Rename s3 to kv. (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
cobward authored Apr 19, 2022
1 parent 7628c3f commit f42ca2c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/kepler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class Kepler {

const sessionKey = await didkey(genJWK(_didkit), _didkit);
const sessionSiweMessage = await startSIWESession(
oid + "/s3",
oid + "/kv",
domain,
chainId,
addr,
Expand Down
10 changes: 5 additions & 5 deletions src/kv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ export class KV {
public async get(key: string, version?: string): Promise<Response> {
const oidCid = await makeCidString(this.orbitId);
return await this.invoke({
headers: await this.auth.content(this.orbit, "s3", key, "get"),
headers: await this.auth.content(this.orbit, "kv", key, "get"),
});
}

public async head(key: string, version?: string): Promise<Response> {
const oidCid = await makeCidString(this.orbitId);
return await this.invoke({
headers: await this.auth.content(this.orbit, "s3", key, "metadata"),
headers: await this.auth.content(this.orbit, "kv", key, "metadata"),
});
}

Expand All @@ -38,7 +38,7 @@ export class KV {
): Promise<Response> {
const oidCid = await makeCidString(this.orbitId);
const cid = await makeCid(new Uint8Array(await value.arrayBuffer()));
const auth = await this.auth.content(this.orbit, "s3", key, "put");
const auth = await this.auth.content(this.orbit, "kv", key, "put");
return await this.invoke({
body: value,
headers: { ...auth, ...metadata },
Expand All @@ -48,14 +48,14 @@ export class KV {
public async del(key: string, version?: string): Promise<Response> {
const oidCid = await makeCidString(this.orbitId);
return await this.invoke({
headers: await this.auth.content(this.orbit, "s3", key, "del"),
headers: await this.auth.content(this.orbit, "kv", key, "del"),
});
}

public async list(prefix: string = ""): Promise<Response> {
const oidCid = await makeCidString(this.orbitId);
return await this.invoke({
headers: await this.auth.content(this.orbit, "s3", prefix, "list"),
headers: await this.auth.content(this.orbit, "kv", prefix, "list"),
});
}

Expand Down

0 comments on commit f42ca2c

Please sign in to comment.