diff --git a/.changeset/four-peas-impress.md b/.changeset/four-peas-impress.md new file mode 100644 index 00000000000..26804fcedb7 --- /dev/null +++ b/.changeset/four-peas-impress.md @@ -0,0 +1,8 @@ +--- +'@audius/sdk': major +--- + +Remove getPlaylistByHandleAndSlug in favor of getBulkPlaylists + +- Removes `sdk.playlists.getPlaylistByHandleAndSlug()` in favor of calling `sdk.playlists.getBulkPlaylists({ permalink: ['/handle/playlist/playlist-name-slug'] })` +- Changes return values of `CommentsAPI` to match other APIs, removing `success` param. diff --git a/docs/docs/developers/api/sidebar.generated.js b/docs/docs/developers/api/sidebar.generated.js index 7a799bd7446..746e7c02663 100644 --- a/docs/docs/developers/api/sidebar.generated.js +++ b/docs/docs/developers/api/sidebar.generated.js @@ -513,12 +513,6 @@ const sidebar = { label: "Create Playlist", className: "api-method post", }, - { - type: "doc", - id: "developers/api/get-playlist-by-handle-and-slug", - label: "Get Playlist By Handle and Slug", - className: "api-method get", - }, { type: "doc", id: "developers/api/search-playlists", diff --git a/docs/docs/developers/api/sidebar.ts b/docs/docs/developers/api/sidebar.ts index bb4d0e8b1a0..1528ab9301f 100644 --- a/docs/docs/developers/api/sidebar.ts +++ b/docs/docs/developers/api/sidebar.ts @@ -514,12 +514,6 @@ const sidebar: SidebarsConfig = { label: "Create Playlist", className: "api-method post", }, - { - type: "doc", - id: "developers/api/get-playlist-by-handle-and-slug", - label: "Get Playlist By Handle and Slug", - className: "api-method get", - }, { type: "doc", id: "developers/api/search-playlists", diff --git a/docs/docs/developers/openapi.yaml b/docs/docs/developers/openapi.yaml index c363f3dea3d..491f0ac4e46 100644 --- a/docs/docs/developers/openapi.yaml +++ b/docs/docs/developers/openapi.yaml @@ -1084,7 +1084,7 @@ paths: get: tags: - playlists - description: Gets a list of playlists by ID + description: Gets a list of playlists by ID, UPC, or permalink operationId: Get Bulk Playlists parameters: - name: user_id @@ -1101,6 +1101,15 @@ paths: type: array items: type: string + - name: permalink + in: query + description: The permalink(s) of the playlist(s) + style: form + explode: true + schema: + type: array + items: + type: string - name: upc in: query description: The UPC of the playlist(s) @@ -1161,37 +1170,6 @@ paths: '500': description: Server error content: {} - /playlists/by_permalink/{handle}/{slug}: - get: - tags: - - playlists - description: Get a playlist by handle and slug - operationId: Get Playlist By Handle and Slug - parameters: - - name: handle - in: path - description: playlist owner handle - required: true - schema: - type: string - - name: slug - in: path - description: playlist slug - required: true - schema: - type: string - - name: user_id - in: query - description: The user ID of the user making the request - schema: - type: string - responses: - '200': - description: Success - content: - application/json: - schema: - $ref: '#/components/schemas/playlist_response' /playlists/search: get: tags: @@ -10415,12 +10393,16 @@ components: create_user_response: type: object properties: - success: - type: boolean - description: Whether the user was created successfully transaction_hash: type: string description: The blockchain transaction hash + block_hash: + type: string + description: The blockchain block hash + block_number: + type: integer + format: int64 + description: The blockchain block number/height user_id: type: string description: The ID of the created user @@ -10595,12 +10577,16 @@ components: create_comment_response: type: object properties: - success: - type: boolean - description: Whether the comment was created successfully transaction_hash: type: string description: The blockchain transaction hash + block_hash: + type: string + description: The blockchain block hash + block_number: + type: integer + format: int64 + description: The blockchain block number/height comment_id: type: string description: The ID of the created comment @@ -10644,12 +10630,16 @@ components: write_response: type: object properties: - success: - type: boolean - description: Whether the operation was successful transaction_hash: type: string description: The blockchain transaction hash + block_hash: + type: string + description: The blockchain block hash + block_number: + type: integer + format: int64 + description: The blockchain block number/height playlist_artwork: type: object properties: @@ -11116,6 +11106,13 @@ components: transaction_hash: type: string description: Transaction hash of the creation + block_hash: + type: string + description: The blockchain block hash + block_number: + type: integer + format: int64 + description: The blockchain block number/height playlist_response: required: - latest_chain_block @@ -12203,12 +12200,16 @@ components: create_playlist_response: type: object properties: - success: - type: boolean - description: Whether the playlist was created successfully transaction_hash: type: string description: The blockchain transaction hash + block_hash: + type: string + description: The blockchain block hash + block_number: + type: integer + format: int64 + description: The blockchain block number/height playlist_id: type: string description: The ID of the created playlist @@ -13074,12 +13075,16 @@ components: create_track_response: type: object properties: - success: - type: boolean - description: Whether the track was created successfully transaction_hash: type: string description: The blockchain transaction hash + block_hash: + type: string + description: The blockchain block hash + block_number: + type: integer + format: int64 + description: The blockchain block number/height track_id: type: string description: The ID of the created track diff --git a/docs/docs/developers/sdk/playlists.mdx b/docs/docs/developers/sdk/playlists.mdx index 09e9c0370a6..edaba83557c 100644 --- a/docs/docs/developers/sdk/playlists.mdx +++ b/docs/docs/developers/sdk/playlists.mdx @@ -44,7 +44,7 @@ Returns a `Promise` containing an object with a `data` field. `data` contains a > #### getBulkPlaylists(`params`) -Get a list of playlists by id. +Get a list of playlists by ID, UPC, or permalink. Example: @@ -61,11 +61,12 @@ console.log(playlists) Create an object with the following fields and pass it as the first argument, as shown in the example above. -| Name | Type | Description | Required? | -| :------- | :--------- | :------------------------------------ | :--------- | -| `id` | `string[]` | An array of playlist IDs | _Optional_ | -| `upc` | `string[]` | An array of UPC codes | _Optional_ | -| `userId` | `string` | The ID of the user making the request | _Optional_ | +| Name | Type | Description | Required? | +| :---------- | :--------- | :------------------------------------ | :--------- | +| `id` | `string[]` | An array of playlist IDs | _Optional_ | +| `permalink` | `string[]` | An array of permalinks of playlists | _Optional_ | +| `upc` | `string[]` | An array of UPC codes | _Optional_ | +| `userId` | `string` | The ID of the user making the request | _Optional_ | #### Returns diff --git a/packages/common/src/api/tan-query/collection/useCollectionByPermalink.ts b/packages/common/src/api/tan-query/collection/useCollectionByPermalink.ts index 169513d7b05..ca7b331710f 100644 --- a/packages/common/src/api/tan-query/collection/useCollectionByPermalink.ts +++ b/packages/common/src/api/tan-query/collection/useCollectionByPermalink.ts @@ -24,28 +24,14 @@ export const getCollectionByPermalinkQueryKey = ( ] as unknown as QueryKey } -export const playlistPermalinkToHandleAndSlug = (permalink: string) => { - const splitPermalink = permalink.split('/') - if (splitPermalink.length !== 4) { - throw Error( - 'Permalink formatted incorrectly. Should follow //playlist/ format.' - ) - } - const handle = splitPermalink[1] - const slug = splitPermalink[3] - return { handle, slug } -} - export const getCollectionByPermalinkQueryFn = async ( permalink: string, currentUserId: number | null | undefined, queryClient: QueryClient, sdk: any ) => { - const { handle, slug } = playlistPermalinkToHandleAndSlug(permalink) - const { data = [] } = await sdk.playlists.getPlaylistByHandleAndSlug({ - handle, - slug, + const { data = [] } = await sdk.playlists.getBulkPlaylists({ + permalink: [permalink], userId: OptionalId.parse(currentUserId) }) diff --git a/packages/embed/src/components/app.jsx b/packages/embed/src/components/app.jsx index 0f6abe99b5f..c4108e18adf 100644 --- a/packages/embed/src/components/app.jsx +++ b/packages/embed/src/components/app.jsx @@ -48,12 +48,13 @@ const DEFAULT_DOMINANT_COLOR = '#7e1bcc' const RequestType = Object.seal({ TRACK: 'track', - COLLECTION: 'collection' + ALBUM: 'album', + PLAYLIST: 'playlist' }) const pathComponentRequestTypeMap = { - playlist: RequestType.COLLECTION, - album: RequestType.COLLECTION, + playlist: RequestType.PLAYLIST, + album: RequestType.ALBUM, track: RequestType.TRACK } @@ -214,12 +215,16 @@ const App = (props) => { setDominantColor({ primary: color }) } - } else if (requestType === RequestType.COLLECTION) { + } else if ( + requestType === RequestType.ALBUM || + requestType === RequestType.PLAYLIST + ) { let collection if (request.handle && request.slug) { collection = await getCollectionByPermalink( request.handle, - request.slug + request.slug, + requestType ) } else if (request.hashId) { collection = await getCollectionWithHashId(request.hashId) diff --git a/packages/embed/src/util/BedtimeClient.js b/packages/embed/src/util/BedtimeClient.js index ec1a0caa3b4..917e500654f 100644 --- a/packages/embed/src/util/BedtimeClient.js +++ b/packages/embed/src/util/BedtimeClient.js @@ -107,10 +107,10 @@ export const getCollectionWithHashId = async (hashId) => { return getFormattedCollectionResponse(res.data) } -export const getCollectionByPermalink = async (handle, slug) => { - const res = await audiusSdk.playlists.getPlaylistByHandleAndSlug({ - handle, - slug +export const getCollectionByPermalink = async (handle, slug, type) => { + const permalink = `/${handle}/${type}/${slug}` + const res = await audiusSdk.playlists.getBulkPlaylists({ + permalink: [permalink] }) return getFormattedCollectionResponse(res.data) } diff --git a/packages/sdk/src/sdk/api/comments/CommentsAPI.ts b/packages/sdk/src/sdk/api/comments/CommentsAPI.ts index 5e9bcc12ddd..38ba113a950 100644 --- a/packages/sdk/src/sdk/api/comments/CommentsAPI.ts +++ b/packages/sdk/src/sdk/api/comments/CommentsAPI.ts @@ -72,7 +72,7 @@ export class CommentsApi extends GeneratedCommentsApi { if (!this.entityManager) { throw new UninitializedEntityManagerError() } - await this.entityManager.manageEntity({ + const res = await this.entityManager.manageEntity({ userId, entityType: EntityType.COMMENT, entityId: newCommentId, @@ -82,7 +82,10 @@ export class CommentsApi extends GeneratedCommentsApi { data: snakecaseKeys({ entityType, ...metadata }) }) }) - return encodeHashId(newCommentId) + return { + ...res, + commentId: encodeHashId(newCommentId)! + } } override async createComment( @@ -91,7 +94,7 @@ export class CommentsApi extends GeneratedCommentsApi { ) { if (this.entityManager) { const { metadata, userId } = params - const commentId = await this.createCommentWithEntityManager({ + return await this.createCommentWithEntityManager({ userId, entityId: encodeHashId(metadata.entityId) ?? '', entityType: metadata.entityType, @@ -101,10 +104,6 @@ export class CommentsApi extends GeneratedCommentsApi { trackTimestampS: metadata.trackTimestampS, mentions: metadata.mentions }) - return { - success: true, - commentId: commentId ?? undefined - } } return super.createComment(params, requestInit) } @@ -123,7 +122,7 @@ export class CommentsApi extends GeneratedCommentsApi { if (!this.entityManager) { throw new UninitializedEntityManagerError() } - const response = await this.entityManager.manageEntity({ + return await this.entityManager.manageEntity({ userId, entityType: EntityType.COMMENT, entityId, @@ -133,7 +132,6 @@ export class CommentsApi extends GeneratedCommentsApi { data: snakecaseKeys({ body, entityId: trackId }) }) }) - return response } override async updateComment( @@ -142,15 +140,12 @@ export class CommentsApi extends GeneratedCommentsApi { ) { if (this.entityManager) { const { metadata, userId, commentId } = params - await this.updateCommentWithEntityManager({ + return await this.updateCommentWithEntityManager({ userId, entityId: commentId, trackId: encodeHashId(metadata.entityId) ?? '', body: metadata.body }) - return { - success: true - } } return super.updateComment(params, requestInit) } @@ -169,14 +164,13 @@ export class CommentsApi extends GeneratedCommentsApi { if (!this.entityManager) { throw new UninitializedEntityManagerError() } - const response = await this.entityManager.manageEntity({ + return await this.entityManager.manageEntity({ userId, entityType: EntityType.COMMENT, entityId, action: Action.DELETE, metadata: '' }) - return response } override async deleteComment( @@ -188,10 +182,7 @@ export class CommentsApi extends GeneratedCommentsApi { userId: params.userId, entityId: params.commentId } - await this.deleteCommentWithEntityManager(metadata) - return { - success: true - } + return await this.deleteCommentWithEntityManager(metadata) } return super.deleteComment(params, requestInit) } @@ -210,7 +201,7 @@ export class CommentsApi extends GeneratedCommentsApi { if (!this.entityManager) { throw new UninitializedEntityManagerError() } - const response = await this.entityManager.manageEntity({ + return await this.entityManager.manageEntity({ userId, entityType: EntityType.COMMENT, entityId: commentId, @@ -220,7 +211,6 @@ export class CommentsApi extends GeneratedCommentsApi { data: snakecaseKeys({ entityId: trackId, entityType: EntityType.TRACK }) }) }) - return response } override async reactToComment( @@ -234,10 +224,7 @@ export class CommentsApi extends GeneratedCommentsApi { isLiked: true, trackId: params.commentId // trackId represents the entity being commented on } - await this.reactToCommentWithEntityManager(metadata) - return { - success: true - } + return await this.reactToCommentWithEntityManager(metadata) } return super.reactToComment(params, requestInit) } @@ -253,10 +240,7 @@ export class CommentsApi extends GeneratedCommentsApi { isLiked: false, trackId: params.commentId } - await this.reactToCommentWithEntityManager(metadata) - return { - success: true - } + return await this.reactToCommentWithEntityManager(metadata) } return super.unreactToComment(params, requestInit) } @@ -270,7 +254,7 @@ export class CommentsApi extends GeneratedCommentsApi { if (!this.entityManager) { throw new UninitializedEntityManagerError() } - const response = await this.entityManager.manageEntity({ + return await this.entityManager.manageEntity({ userId, entityType: EntityType.COMMENT, entityId, @@ -280,7 +264,6 @@ export class CommentsApi extends GeneratedCommentsApi { data: snakecaseKeys({ entityId: trackId }) }) }) - return response } override async pinComment( @@ -294,10 +277,7 @@ export class CommentsApi extends GeneratedCommentsApi { trackId: params.commentId, // trackId represents the entity being commented on isPin: true } - await this.pinCommentWithEntityManager(metadata) - return { - success: true - } + return await this.pinCommentWithEntityManager(metadata) } return super.pinComment(params, requestInit) } @@ -313,10 +293,7 @@ export class CommentsApi extends GeneratedCommentsApi { trackId: params.commentId, isPin: false } - await this.pinCommentWithEntityManager(metadata) - return { - success: true - } + return await this.pinCommentWithEntityManager(metadata) } return super.unpinComment(params, requestInit) } @@ -335,14 +312,13 @@ export class CommentsApi extends GeneratedCommentsApi { if (!this.entityManager) { throw new UninitializedEntityManagerError() } - const response = await this.entityManager.manageEntity({ + return await this.entityManager.manageEntity({ userId, entityType: EntityType.COMMENT, entityId, action: Action.REPORT, metadata: '' }) - return response } override async reportComment( @@ -354,10 +330,7 @@ export class CommentsApi extends GeneratedCommentsApi { userId: params.userId, entityId: params.commentId } - await this.reportCommentWithEntityManager(metadata) - return { - success: true - } + return await this.reportCommentWithEntityManager(metadata) } return super.reportComment(params, requestInit) } @@ -369,14 +342,13 @@ export class CommentsApi extends GeneratedCommentsApi { if (!this.entityManager) { throw new UninitializedEntityManagerError() } - const response = await this.entityManager.manageEntity({ + return await this.entityManager.manageEntity({ userId, entityType: EntityType.USER, entityId: mutedUserId, action: isMuted ? Action.UNMUTE : Action.MUTE, metadata: '' }) - return response } /** @hidden @@ -391,10 +363,9 @@ export class CommentsApi extends GeneratedCommentsApi { if (!this.entityManager) { throw new UninitializedEntityManagerError() } - const response = await this.entityManager.manageEntity({ + return await this.entityManager.manageEntity({ ...config, metadata: '' }) - return response } } diff --git a/packages/sdk/src/sdk/api/generated/default/apis/PlaylistsApi.ts b/packages/sdk/src/sdk/api/generated/default/apis/PlaylistsApi.ts index d27555190d1..189725779bc 100644 --- a/packages/sdk/src/sdk/api/generated/default/apis/PlaylistsApi.ts +++ b/packages/sdk/src/sdk/api/generated/default/apis/PlaylistsApi.ts @@ -75,6 +75,7 @@ export interface FavoritePlaylistRequest { export interface GetBulkPlaylistsRequest { userId?: string; id?: Array; + permalink?: Array; upc?: Array; } @@ -88,12 +89,6 @@ export interface GetPlaylistAccessInfoRequest { userId?: string; } -export interface GetPlaylistByHandleAndSlugRequest { - handle: string; - slug: string; - userId?: string; -} - export interface GetPlaylistTracksRequest { playlistId: string; } @@ -330,7 +325,7 @@ export class PlaylistsApi extends runtime.BaseAPI { /** * @hidden - * Gets a list of playlists by ID + * Gets a list of playlists by ID, UPC, or permalink */ async getBulkPlaylistsRaw(params: GetBulkPlaylistsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const queryParameters: any = {}; @@ -343,6 +338,10 @@ export class PlaylistsApi extends runtime.BaseAPI { queryParameters['id'] = params.id; } + if (params.permalink) { + queryParameters['permalink'] = params.permalink; + } + if (params.upc) { queryParameters['upc'] = params.upc; } @@ -360,7 +359,7 @@ export class PlaylistsApi extends runtime.BaseAPI { } /** - * Gets a list of playlists by ID + * Gets a list of playlists by ID, UPC, or permalink */ async getBulkPlaylists(params: GetBulkPlaylistsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getBulkPlaylistsRaw(params, initOverrides); @@ -437,45 +436,6 @@ export class PlaylistsApi extends runtime.BaseAPI { return await response.value(); } - /** - * @hidden - * Get a playlist by handle and slug - */ - async getPlaylistByHandleAndSlugRaw(params: GetPlaylistByHandleAndSlugRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (params.handle === null || params.handle === undefined) { - throw new runtime.RequiredError('handle','Required parameter params.handle was null or undefined when calling getPlaylistByHandleAndSlug.'); - } - - if (params.slug === null || params.slug === undefined) { - throw new runtime.RequiredError('slug','Required parameter params.slug was null or undefined when calling getPlaylistByHandleAndSlug.'); - } - - const queryParameters: any = {}; - - if (params.userId !== undefined) { - queryParameters['user_id'] = params.userId; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - const response = await this.request({ - path: `/playlists/by_permalink/{handle}/{slug}`.replace(`{${"handle"}}`, encodeURIComponent(String(params.handle))).replace(`{${"slug"}}`, encodeURIComponent(String(params.slug))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => PlaylistResponseFromJSON(jsonValue)); - } - - /** - * Get a playlist by handle and slug - */ - async getPlaylistByHandleAndSlug(params: GetPlaylistByHandleAndSlugRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getPlaylistByHandleAndSlugRaw(params, initOverrides); - return await response.value(); - } - /** * @hidden * Fetch tracks within a playlist. diff --git a/packages/sdk/src/sdk/api/generated/default/models/CreateCommentResponse.ts b/packages/sdk/src/sdk/api/generated/default/models/CreateCommentResponse.ts index fe10f559a84..5925b581a0e 100644 --- a/packages/sdk/src/sdk/api/generated/default/models/CreateCommentResponse.ts +++ b/packages/sdk/src/sdk/api/generated/default/models/CreateCommentResponse.ts @@ -21,17 +21,23 @@ import { exists, mapValues } from '../runtime'; */ export interface CreateCommentResponse { /** - * Whether the comment was created successfully - * @type {boolean} + * The blockchain transaction hash + * @type {string} * @memberof CreateCommentResponse */ - success?: boolean; + transactionHash?: string; /** - * The blockchain transaction hash + * The blockchain block hash * @type {string} * @memberof CreateCommentResponse */ - transactionHash?: string; + blockHash?: string; + /** + * The blockchain block number/height + * @type {number} + * @memberof CreateCommentResponse + */ + blockNumber?: number; /** * The ID of the created comment * @type {string} @@ -59,8 +65,9 @@ export function CreateCommentResponseFromJSONTyped(json: any, ignoreDiscriminato } return { - 'success': !exists(json, 'success') ? undefined : json['success'], 'transactionHash': !exists(json, 'transaction_hash') ? undefined : json['transaction_hash'], + 'blockHash': !exists(json, 'block_hash') ? undefined : json['block_hash'], + 'blockNumber': !exists(json, 'block_number') ? undefined : json['block_number'], 'commentId': !exists(json, 'comment_id') ? undefined : json['comment_id'], }; } @@ -74,8 +81,9 @@ export function CreateCommentResponseToJSON(value?: CreateCommentResponse | null } return { - 'success': value.success, 'transaction_hash': value.transactionHash, + 'block_hash': value.blockHash, + 'block_number': value.blockNumber, 'comment_id': value.commentId, }; } diff --git a/packages/sdk/src/sdk/api/generated/default/models/CreateDeveloperAppResponse.ts b/packages/sdk/src/sdk/api/generated/default/models/CreateDeveloperAppResponse.ts index f9e25a2e9bb..3afd4a55bf1 100644 --- a/packages/sdk/src/sdk/api/generated/default/models/CreateDeveloperAppResponse.ts +++ b/packages/sdk/src/sdk/api/generated/default/models/CreateDeveloperAppResponse.ts @@ -44,6 +44,18 @@ export interface CreateDeveloperAppResponse { * @memberof CreateDeveloperAppResponse */ transactionHash?: string; + /** + * The blockchain block hash + * @type {string} + * @memberof CreateDeveloperAppResponse + */ + blockHash?: string; + /** + * The blockchain block number/height + * @type {number} + * @memberof CreateDeveloperAppResponse + */ + blockNumber?: number; } /** @@ -69,6 +81,8 @@ export function CreateDeveloperAppResponseFromJSONTyped(json: any, ignoreDiscrim 'apiSecret': !exists(json, 'api_secret') ? undefined : json['api_secret'], 'bearerToken': !exists(json, 'bearer_token') ? undefined : json['bearer_token'], 'transactionHash': !exists(json, 'transaction_hash') ? undefined : json['transaction_hash'], + 'blockHash': !exists(json, 'block_hash') ? undefined : json['block_hash'], + 'blockNumber': !exists(json, 'block_number') ? undefined : json['block_number'], }; } @@ -85,6 +99,8 @@ export function CreateDeveloperAppResponseToJSON(value?: CreateDeveloperAppRespo 'api_secret': value.apiSecret, 'bearer_token': value.bearerToken, 'transaction_hash': value.transactionHash, + 'block_hash': value.blockHash, + 'block_number': value.blockNumber, }; } diff --git a/packages/sdk/src/sdk/api/generated/default/models/CreatePlaylistResponse.ts b/packages/sdk/src/sdk/api/generated/default/models/CreatePlaylistResponse.ts index e755c8cf65d..918d4ad2b9d 100644 --- a/packages/sdk/src/sdk/api/generated/default/models/CreatePlaylistResponse.ts +++ b/packages/sdk/src/sdk/api/generated/default/models/CreatePlaylistResponse.ts @@ -21,17 +21,23 @@ import { exists, mapValues } from '../runtime'; */ export interface CreatePlaylistResponse { /** - * Whether the playlist was created successfully - * @type {boolean} + * The blockchain transaction hash + * @type {string} * @memberof CreatePlaylistResponse */ - success?: boolean; + transactionHash?: string; /** - * The blockchain transaction hash + * The blockchain block hash * @type {string} * @memberof CreatePlaylistResponse */ - transactionHash?: string; + blockHash?: string; + /** + * The blockchain block number/height + * @type {number} + * @memberof CreatePlaylistResponse + */ + blockNumber?: number; /** * The ID of the created playlist * @type {string} @@ -59,8 +65,9 @@ export function CreatePlaylistResponseFromJSONTyped(json: any, ignoreDiscriminat } return { - 'success': !exists(json, 'success') ? undefined : json['success'], 'transactionHash': !exists(json, 'transaction_hash') ? undefined : json['transaction_hash'], + 'blockHash': !exists(json, 'block_hash') ? undefined : json['block_hash'], + 'blockNumber': !exists(json, 'block_number') ? undefined : json['block_number'], 'playlistId': !exists(json, 'playlist_id') ? undefined : json['playlist_id'], }; } @@ -74,8 +81,9 @@ export function CreatePlaylistResponseToJSON(value?: CreatePlaylistResponse | nu } return { - 'success': value.success, 'transaction_hash': value.transactionHash, + 'block_hash': value.blockHash, + 'block_number': value.blockNumber, 'playlist_id': value.playlistId, }; } diff --git a/packages/sdk/src/sdk/api/generated/default/models/CreateTrackResponse.ts b/packages/sdk/src/sdk/api/generated/default/models/CreateTrackResponse.ts index e9588e8cef1..739791ab8eb 100644 --- a/packages/sdk/src/sdk/api/generated/default/models/CreateTrackResponse.ts +++ b/packages/sdk/src/sdk/api/generated/default/models/CreateTrackResponse.ts @@ -21,17 +21,23 @@ import { exists, mapValues } from '../runtime'; */ export interface CreateTrackResponse { /** - * Whether the track was created successfully - * @type {boolean} + * The blockchain transaction hash + * @type {string} * @memberof CreateTrackResponse */ - success?: boolean; + transactionHash?: string; /** - * The blockchain transaction hash + * The blockchain block hash * @type {string} * @memberof CreateTrackResponse */ - transactionHash?: string; + blockHash?: string; + /** + * The blockchain block number/height + * @type {number} + * @memberof CreateTrackResponse + */ + blockNumber?: number; /** * The ID of the created track * @type {string} @@ -59,8 +65,9 @@ export function CreateTrackResponseFromJSONTyped(json: any, ignoreDiscriminator: } return { - 'success': !exists(json, 'success') ? undefined : json['success'], 'transactionHash': !exists(json, 'transaction_hash') ? undefined : json['transaction_hash'], + 'blockHash': !exists(json, 'block_hash') ? undefined : json['block_hash'], + 'blockNumber': !exists(json, 'block_number') ? undefined : json['block_number'], 'trackId': !exists(json, 'track_id') ? undefined : json['track_id'], }; } @@ -74,8 +81,9 @@ export function CreateTrackResponseToJSON(value?: CreateTrackResponse | null): a } return { - 'success': value.success, 'transaction_hash': value.transactionHash, + 'block_hash': value.blockHash, + 'block_number': value.blockNumber, 'track_id': value.trackId, }; } diff --git a/packages/sdk/src/sdk/api/generated/default/models/CreateUserResponse.ts b/packages/sdk/src/sdk/api/generated/default/models/CreateUserResponse.ts index fd7dacd1101..94eedc70ea5 100644 --- a/packages/sdk/src/sdk/api/generated/default/models/CreateUserResponse.ts +++ b/packages/sdk/src/sdk/api/generated/default/models/CreateUserResponse.ts @@ -21,17 +21,23 @@ import { exists, mapValues } from '../runtime'; */ export interface CreateUserResponse { /** - * Whether the user was created successfully - * @type {boolean} + * The blockchain transaction hash + * @type {string} * @memberof CreateUserResponse */ - success?: boolean; + transactionHash?: string; /** - * The blockchain transaction hash + * The blockchain block hash * @type {string} * @memberof CreateUserResponse */ - transactionHash?: string; + blockHash?: string; + /** + * The blockchain block number/height + * @type {number} + * @memberof CreateUserResponse + */ + blockNumber?: number; /** * The ID of the created user * @type {string} @@ -59,8 +65,9 @@ export function CreateUserResponseFromJSONTyped(json: any, ignoreDiscriminator: } return { - 'success': !exists(json, 'success') ? undefined : json['success'], 'transactionHash': !exists(json, 'transaction_hash') ? undefined : json['transaction_hash'], + 'blockHash': !exists(json, 'block_hash') ? undefined : json['block_hash'], + 'blockNumber': !exists(json, 'block_number') ? undefined : json['block_number'], 'userId': !exists(json, 'user_id') ? undefined : json['user_id'], }; } @@ -74,8 +81,9 @@ export function CreateUserResponseToJSON(value?: CreateUserResponse | null): any } return { - 'success': value.success, 'transaction_hash': value.transactionHash, + 'block_hash': value.blockHash, + 'block_number': value.blockNumber, 'user_id': value.userId, }; } diff --git a/packages/sdk/src/sdk/api/generated/default/models/WriteResponse.ts b/packages/sdk/src/sdk/api/generated/default/models/WriteResponse.ts index c1b54d44354..87336727389 100644 --- a/packages/sdk/src/sdk/api/generated/default/models/WriteResponse.ts +++ b/packages/sdk/src/sdk/api/generated/default/models/WriteResponse.ts @@ -21,17 +21,23 @@ import { exists, mapValues } from '../runtime'; */ export interface WriteResponse { /** - * Whether the operation was successful - * @type {boolean} + * The blockchain transaction hash + * @type {string} * @memberof WriteResponse */ - success?: boolean; + transactionHash?: string; /** - * The blockchain transaction hash + * The blockchain block hash * @type {string} * @memberof WriteResponse */ - transactionHash?: string; + blockHash?: string; + /** + * The blockchain block number/height + * @type {number} + * @memberof WriteResponse + */ + blockNumber?: number; } /** @@ -53,8 +59,9 @@ export function WriteResponseFromJSONTyped(json: any, ignoreDiscriminator: boole } return { - 'success': !exists(json, 'success') ? undefined : json['success'], 'transactionHash': !exists(json, 'transaction_hash') ? undefined : json['transaction_hash'], + 'blockHash': !exists(json, 'block_hash') ? undefined : json['block_hash'], + 'blockNumber': !exists(json, 'block_number') ? undefined : json['block_number'], }; } @@ -67,8 +74,9 @@ export function WriteResponseToJSON(value?: WriteResponse | null): any { } return { - 'success': value.success, 'transaction_hash': value.transactionHash, + 'block_hash': value.blockHash, + 'block_number': value.blockNumber, }; }