Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add spaces high level audio methods #993

Conversation

madhur-push
Copy link
Contributor

@madhur-push madhur-push commented Jan 8, 2024

  • Audio methods for Space class

@madhur-push madhur-push self-assigned this Jan 8, 2024
Copy link

github-actions bot commented Jan 8, 2024

In the file packages/restapi/src/lib/pushapi/pushAPITypes.ts:

  • Line 22: There is a missing closing brace after the alpha property.
  • Line 36: There is a missing closing brace after the rules property in the SpaceCreationOptions interface.
  • Line 53: The SpaceInitializationOptions interface is misspelled. It should be SpaceInitializeOptions.
  • Line 81: There is a missing closing brace after the SpaceParticipantStatus interface.
  • Line 89: There is a missing closing brace after the ManageSpaceOptions interface.

In the file packages/restapi/src/lib/pushapi/space.ts:

  • Line 20: The import statement for SpaceListType is not used and can be removed.
  • Line 80: The initialize method of the Space class is missing a closing brace.
  • Line 107: The accept method of the Space class is missing a closing brace.
  • Line 113: The reject method of the Space class is missing a closing brace.
  • Line 131: The getter for chat in the Space class is missing a closing brace.
  • Line 156: The initialize method of the Space class is missing a closing brace.
  • Line 164: There is a missing closing brace after the SpaceV2 class.

In the file packages/restapi/src/lib/space/SpaceV2.ts:

  • Line 47: The activateUserAudio method of the SpaceV2 class is missing a closing brace.
  • Line 49: The start method of the SpaceV2 class is missing a closing brace.
  • Line 51: The join method of the SpaceV2 class is missing a closing brace.
  • Line 53: The update method of the SpaceV2 class is missing a closing brace.
  • Line 55: The leave method of the SpaceV2 class is missing a closing brace.
  • Line 57: The stop method of the SpaceV2 class is missing a closing brace.
  • Line 64: The requestForMic method of the SpaceV2 class is missing a closing brace.
  • Line 95: The rejectMicRequest method of the SpaceV2 class is missing a closing brace.
  • Line 105: The inviteToPromote method of the SpaceV2 class is missing a closing brace.
  • Line 116: The acceptPromotionInvite method of the SpaceV2 class is missing a closing brace.
  • Line 128: The rejectPromotionInvite method of the SpaceV2 class is missing a closing brace.

All other code appears to be fine.

Copy link

github-actions bot commented Jan 9, 2024

File: packages/restapi/src/lib/pushapi/pushAPITypes.ts

  1. In the enum SpaceListType, there is a missing closing brace }.

  2. In the interface PushAPIInitializeProps, the property alpha is not optional. Please update it to alpha?: { feature: string[] }.

  3. In the interface ManageGroupOptions, there is a typo in the property name. It should be accounts instead of acounts.

  4. In the interface ManageSpaceOptions, there are two missing closing braces }.

  5. In the interface SpaceCreationOptions, the property participants should have a closing brace } after the property private: boolean;.

  6. In the interface SpaceQueryOptions, the property limit is missing a type annotation. Please update it to limit: number.

  7. In the interface ParticipantStatus, the property role should have a value of 'ADMIN' | 'MEMBER' | 'GUEST', instead of just 'admin' | 'member'. Also, the property participant is redundant and should be removed.

  8. In the interface SpaceParticipantStatus, there is a redundant declaration. Please remove it.

  9. In the interface SpaceInitializeOptions, the property setSpaceData should be optional. Please update it to setSpaceData?: (fn: (data: SpaceData) => SpaceData) => void.

File: packages/restapi/src/lib/pushapi/space.ts

  1. In the import statement for PUSH_SPACE and PUSH_CHAT, there is a missing closing brace }.

  2. In the import statement for updateGroupProfile, the import should be removed as it is not used.

  3. In the import statement for groupInfoDtoToSpaceInfoDto and mapSpaceListTypeToChatListType, the import should be removed as they are not used.

  4. The constructor of the Space class should have a closing brace } after the this.chatInstance initialization.

  5. In the create method of the Space class, there is a missing closing brace }.

  6. In the accept method of the Space class, there is a redundant error message. Please remove it.

  7. In the initialize method of the Space class, there is a missing closing brace } after the throw new Error('Signer is required for push space') statement.

File: packages/restapi/src/lib/space/SpaceV2.ts

  1. In the constructor of the SpaceV2 class, there is a missing closing brace } after the this.spaceInfo assignment.

  2. In the method activateUserAudio of the SpaceV2 class, there is a missing closing brace }.

  3. In the method start of the SpaceV2 class, there is a missing closing brace }.

  4. In the method join of the SpaceV2 class, there is a missing closing brace }.

  5. In the method update of the SpaceV2 class, there is a missing closing brace }.

  6. In the method leave of the SpaceV2 class, there is a missing closing brace }.

  7. In the method stop of the SpaceV2 class, there is a missing closing brace }.

  8. In the method requestForMic of the SpaceV2 class, there are some missing closing braces }.

  9. In the method acceptMicRequest of the SpaceV2 class, there are some missing closing braces }.

  10. In the method rejectMicRequest of the SpaceV2 class, there are some missing closing braces }.

  11. In the method inviteToPromote of the SpaceV2 class, there are some missing closing braces }.

  12. In the method acceptPromotionInvite of the SpaceV2 class, there are some missing closing braces }.

  13. In the method rejectPromotionInvite of the SpaceV2 class, there are some missing closing braces }.

All looks good.

Copy link

github-actions bot commented Jan 9, 2024

File: packages/restapi/src/lib/pushapi/pushAPITypes.ts

  • In the enum SpaceListType, there is a missing closing curly bracket after the value 'SPACES'.

File: packages/restapi/src/lib/pushapi/space.ts

  • The import statement for './pushAPITypes' is not properly formatted. It should be placed inside the curly braces of the import statement.
  • The import statements for '../space/SpaceV2' and '../space/Space' are not properly formatted. They should be placed inside the curly braces of the import statement.
  • There is a missing closing parenthesis at the end of the create method declaration.
  • The create method throws an error message that references PushAPI.ensureSignerMessage(), but this method is not defined in the code.

File: packages/restapi/src/lib/pushstream/socketClient.ts

  • The import statement for './pushStreamTypes' is not properly formatted. It should be placed inside the curly braces of the import statement.
  • The createSocketConnection function is missing a closing parenthesis at the end.

File: packages/restapi/src/lib/space/SpaceV2.ts

  • The import statement for '../payloads/constants' is missing a closing curly bracket after the import.
  • The activateUserAudio, start, join, update, leave, stop, requestForMic, acceptMicRequest, rejectMicRequest, inviteToPromote, acceptPromotionInvite, and rejectPromotionInvite methods are missing closing parenthesis at the end.

All of the other code looks good.

@madhur-push madhur-push changed the title Add spaces high level audio methods & integrate LiveKit changes Add spaces high level audio methods Jan 9, 2024
Copy link

github-actions bot commented Jan 9, 2024

File: packages/restapi/src/lib/pushapi/pushAPITypes.ts

  1. In the PushAPIInitializeProps interface, the alpha property seems to be optional. However, the type of feature should be an array of strings, so it should be feature?: string[]; instead of feature: string[];.

  2. In the GroupCreationOptions interface, the members and admins properties should be optional. To make them optional, update the types to members?: string[]; and admins?: string[]; respectively.

  3. In the ManageGroupOptions interface, the accounts property should be optional. To make it optional, update the type to accounts?: string[];.

  4. In the ManageSpaceOptions interface, the role property should have type 'SPEAKER' | 'LISTENER' | undefined instead of 'SPEAKER' | 'LISTENER'.

  5. In the SpaceCreationOptions interface, the schedule property is missing a closing brace. Add a closing brace (}) after the private property.

  6. In the SpaceCreationOptions interface, the rules property should be optional. To make it optional, update the type to rules?: SpaceRules;.

  7. In the SpaceQueryOptions interface, the page and limit properties should be optional. To make them optional, update the types to page?: number; and limit?: number; respectively.

  8. In the ParticipantStatus interface, the role property should have type 'ADMIN' | 'MEMBER' instead of 'admin' | 'member'.

  9. In the SpaceInitializeOptions interface, the setSpaceData property is missing a closing brace. Add a closing brace (}) after the fn parameter in the type definition.

File: packages/restapi/src/lib/pushapi/space.ts

  1. The import statement for GetGroupParticipantsOptions is missing a closing brace. Add a closing brace (}) after the import statement.

  2. The import statement for ManageSpaceOptions is missing a closing brace. Add a closing brace (}) after the import statement.

  3. The import statement for RemoveFromSpaceOptions is missing a closing brace. Add a closing brace (}) after the import statement.

  4. The import statement for SpaceCreationOptions is missing a closing brace. Add a closing brace (}) after the import statement.

  5. The import statement for SpaceInitializeOptions is missing a closing brace. Add a closing brace (}) after the import statement.

  6. The import statement for SpaceListType is missing a closing brace. Add a closing brace (}) after the import statement.

  7. The import statement for SpaceParticipantStatus is missing a closing brace. Add a closing brace (}) after the import statement.

  8. The import statement for SpaceQueryOptions is missing a closing brace. Add a closing brace (}) after the import statement.

  9. The import statement for SpaceUpdateOptions is missing a closing brace. Add a closing brace (}) after the import statement.

  10. In the Space class constructor, the progress parameter should have a default value of undefined. Update the parameter definition to private progressHook?: (progress: ProgressHookType) => void = undefined.

  11. In the Space class constructor, there is a missing closing parenthesis in the chatInstance assignment. Add a closing parenthesis ()) after this.account, this.env, { feature: [] }, this.decryptedPgpPvtKey.

  12. In the Space class create method, the createSpaceOptions object is missing some properties. Add the missing properties as follows:

  • signer: this.signer!
  • pgpPrivateKey: this.decryptedPgpPvtKey || undefined
  • spaceDescription: options.description || null
  • spaceImage: options.image || null
  • isPublic: !options.private
  • rules: options.rules || null
  • scheduleAt: options.schedule.start || null
  • scheduleEnd: options.schedule.end || null
  1. In the Space class create method, the return statement should return this.chatInstance.createSpace(chatListType, createSpaceOptions);

  2. In the Space class accept method, there is a missing closing parenthesis in the throw statement. Add a closing parenthesis ()) after PushAPI.ensureSignerMessage().

  3. In the Space class reject method, the return statement is missing. Add return this.chatInstance.reject(spaceId); to return a promise.

  4. In the Space class get chat getter, the return statement is missing. Add return { ... }; before the closing brace (}) to return the chat object.

  5. In the Space class initialize method, there is a missing closing parenthesis in the error message. Add a closing parenthesis ()) after 'PushSDK was initialized in readonly mode'.

  6. In the Space class initialize method, the return statement should return new SpaceV2({ spaceV1Instance, spaceInfo });

@madhur-push madhur-push marked this pull request as ready for review January 10, 2024 09:48
Copy link

File: packages/restapi/src/lib/pushapi/pushAPITypes.ts

  • In the interface PushAPIInitializeProps, the alpha property should be optional. Change { to ?: {.
  • In the SpaceCreationOptions interface, there is a missing closing brace } after the participants property.
  • In the SpaceQueryOptions interface, there is a missing closing brace } after the limit property.
  • In the SpaceParticipantStatus interface, there is an unnecessary empty interface declaration. Remove it.

File: packages/restapi/src/lib/pushapi/space.ts

  • Remove the extra import statement for updateGroupProfile and updateGroupConfig. They are not used in the code.
  • In the Space.create method, update const createSpaceOptions to use options.private instead of !options.private for the isPublic property.
  • In the Space.initialize method, add a closing brace } after the throw new Error('Signer is required for push space'); line.

File: packages/restapi/src/lib/pushstream/socketClient.ts

  • Add a closing brace } after the console.error('[PUSH-SDK] - Socket connection error: ', e); line.

File: packages/restapi/src/lib/space/SpaceV2.ts

  • Remove the extra import statement for Space. It is not used in the code.
  • In the SpaceV2 class, add missing closing braces } after the this.spaceV1Instance.createAudioStream();, this.spaceV1Instance.start();, this.spaceV1Instance.join();, this.spaceV1Instance.update(updateSpaceOptions);, this.spaceV1Instance.leave();, and this.spaceV1Instance.stop(); methods.
  • In the SpaceV2.requestForMic method, remove the unnecessary address: string; and signal: any; parameters in the method signature.
  • In the SpaceV2.acceptMicRequest method, remove the unnecessary address: string; and signal: any; parameters in the method signature.
  • In the SpaceV2.rejectMicRequest method, remove the unnecessary { address }: { address: string } parameter in the method signature.
  • In the SpaceV2.inviteToPromote method, remove the unnecessary { address }: { address: string } parameter in the method signature.
  • In the SpaceV2.acceptPromotionInvite method, remove the unnecessary { signal }: { signal: any } parameter in the method signature.
  • In the SpaceV2.rejectPromotionInvite method, remove the unnecessary closing brace } after the await this.spaceV1Instance.rejectPromotionInvite({ line.
  • In the SpaceV2.media method, add missing closing braces } after the this.spaceV1Instance.enableVideo({ state: video }); and this.spaceV1Instance.enableAudio({ state: audio }); method calls.

@madhur-push madhur-push merged commit c26e62e into 897-improvement-proposal-spaces-high-level-functions Jan 11, 2024
2 checks passed
@madhur-push madhur-push deleted the add-spaces-v2-audio-methods branch January 11, 2024 10:04
mohammeds1992 added a commit that referenced this pull request Feb 7, 2024
* fix: spaces high level

* fix: spaces high level function

* fix: spaces test cases

* fix: spaces stream changes

* fix: removed unnecessary logs

* Add spaces high level audio methods (#993)

* feat(spaces): add high level audio methods

* fix: socket url fix (#995)

* feat(spaces-highlevel-audio-methods): add media function in Spaces class

---------

Co-authored-by: Mohammed S <shoaib@push.org>

* feat(space stream): add 'start', 'stop' events (#1027)

* fix(high level spaces sdk): fix list() method to uses spaces(), requests() methods (#1061)

---------

Co-authored-by: Madhur Gupta <madhur@push.org>
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.

2 participants