Skip to content

Commit

Permalink
Bump sdk version and minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramon Candel authored and Ramon Candel committed Sep 19, 2023
1 parent e051aec commit 3e5c31c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@internxt/sdk",
"version": "1.4.52",
"version": "1.4.53",
"description": "An sdk for interacting with Internxt's services",
"repository": {
"type": "git",
Expand Down
14 changes: 9 additions & 5 deletions src/drive/share/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
Role,
SharingInvite,
SharedFoldersInvitationsAsInvitedUserResponse,
CreateSharingDto,
CreateSharingPayload,
SharingMeta,
} from './types';
import { ApiSecurity, ApiUrl, AppDetails } from '../../shared';
Expand Down Expand Up @@ -395,11 +395,11 @@ export class Share {
/**
* Create a sharing.
*/
public createSharing(createSharingDto: CreateSharingDto): Promise<void> {
public createSharing(createSharingPayload: CreateSharingPayload): Promise<SharingMeta> {
return this.client.post(
'sharings',
{
...createSharingDto,
...createSharingPayload,
},
this.headers(),
);
Expand All @@ -408,8 +408,12 @@ export class Share {
/**
* Get sharing meta with code
*/
public getSharingMeta(sharingId: string, code: string): Promise<SharingMeta> {
return this.client.get(`sharings/${sharingId}/meta?code=${code}`, this.headers());
public getSharingMeta(sharingId: string, code: string, password?: string): Promise<SharingMeta> {
const extraHeaders = password ? { 'x-share-password': password } : {};
return this.client.get(`sharings/${sharingId}/meta?code=${code}`, {
...this.headers(),
...extraHeaders,
});
}
/**
* Request access to shared folder.
Expand Down
6 changes: 4 additions & 2 deletions src/drive/share/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export type ShareFolderWithUserPayload = {
roleId: string;
};

export type CreateSharingDto = {
export type CreateSharingPayload = {
itemId: string;
itemType: 'folder' | 'file';
encryptionKey: string;
Expand Down Expand Up @@ -321,4 +321,6 @@ export type SharingMeta = {
createdAt: Date;
updatedAt: Date;
type: 'public' | 'private';
};
item: SharedFiles | SharedFolders;
itemToken: string;
};

0 comments on commit 3e5c31c

Please sign in to comment.