From de6679c2d43dabe9880f5b330c8b0982322318e7 Mon Sep 17 00:00:00 2001 From: Marcus Pasell <3690498+rickyrombo@users.noreply.github.com> Date: Fri, 13 Feb 2026 16:07:23 -0800 Subject: [PATCH 1/3] unify library def --- api/swagger/swagger-v1.yaml | 40 +++++++++++++++---------------------- 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/api/swagger/swagger-v1.yaml b/api/swagger/swagger-v1.yaml index 3dd77ea5..77d02161 100644 --- a/api/swagger/swagger-v1.yaml +++ b/api/swagger/swagger-v1.yaml @@ -10162,19 +10162,7 @@ components: type: string description: Solana USDC payout wallet address playlist_library: - type: object - description: User's playlist library with support for folders and playlists - required: - - contents - properties: - contents: - type: array - description: Array of folders and playlist identifiers - items: - oneOf: - - $ref: '#/components/schemas/playlist_library_folder' - - $ref: '#/components/schemas/playlist_library_playlist_identifier' - - $ref: '#/components/schemas/playlist_library_explore_playlist_identifier' + $ref: '#/components/schemas/user_playlist_library' events: type: object description: User events for tracking referrals and mobile users @@ -10250,17 +10238,7 @@ components: type: string description: Coin flair mint address playlist_library: - type: object - description: User's playlist library with support for folders and playlists - properties: - contents: - type: array - description: Array of folders and playlist identifiers - items: - oneOf: - - $ref: '#/components/schemas/playlist_library_folder' - - $ref: '#/components/schemas/playlist_library_playlist_identifier' - - $ref: '#/components/schemas/playlist_library_explore_playlist_identifier' + $ref: '#/components/schemas/user_playlist_library' events: type: object description: User events for tracking referrals and mobile users @@ -10477,6 +10455,20 @@ components: success: type: boolean description: Whether the deactivation was successful + user_playlist_library: + type: object + description: User's playlist library with support for folders and playlists + required: + - contents + properties: + contents: + type: array + description: Array of folders and playlist identifiers + items: + oneOf: + - $ref: '#/components/schemas/playlist_library_folder' + - $ref: '#/components/schemas/playlist_library_playlist_identifier' + - $ref: '#/components/schemas/playlist_library_explore_playlist_identifier' playlist_library_folder: type: object description: Folder containing nested playlists and folders From eb8cc3109206ef1c87609422c6946e46c7ccf04d Mon Sep 17 00:00:00 2001 From: Marcus Pasell <3690498+rickyrombo@users.noreply.github.com> Date: Fri, 13 Feb 2026 17:16:49 -0800 Subject: [PATCH 2/3] use hash ids everywhere --- api/swagger/swagger-v1.yaml | 102 ++++++++++++++++++------------------ api/v1_comments.go | 60 ++++++++++++--------- api/v1_playlist.go | 4 +- api/v1_track.go | 32 +++++------ api/v1_users.go | 10 ++-- 5 files changed, 110 insertions(+), 98 deletions(-) diff --git a/api/swagger/swagger-v1.yaml b/api/swagger/swagger-v1.yaml index 77d02161..02491bfa 100644 --- a/api/swagger/swagger-v1.yaml +++ b/api/swagger/swagger-v1.yaml @@ -6815,7 +6815,8 @@ components: access: $ref: '#/components/schemas/track_access_info' ai_attribution_user_id: - type: integer + type: string + example: "x5pJ3Az" allowed_api_keys: type: array items: @@ -6964,7 +6965,8 @@ components: type: object properties: parent_track_id: - type: integer + type: string + example: "x5pJ3Az" album_backlink: required: - permalink @@ -7875,7 +7877,8 @@ components: type: object properties: tip_user_id: - type: integer + type: string + example: "x5pJ3Az" description: Must tip the given user ID to unlock follow_gate: required: @@ -7883,7 +7886,8 @@ components: type: object properties: follow_user_id: - type: integer + type: string + example: "x5pJ3Az" description: Must follow the given user ID to unlock token_gate: required: @@ -7938,7 +7942,8 @@ components: type: object properties: user_id: - type: integer + type: string + example: "x5pJ3Az" percentage: type: number eth_wallet: @@ -8154,7 +8159,8 @@ components: category: $ref: '#/components/schemas/stem_category' parent_track_id: - type: integer + type: string + example: "x5pJ3Az" undisbursed_challenges: type: object properties: @@ -9802,9 +9808,9 @@ components: - track_cid properties: track_id: - type: integer + type: string description: Optional track ID (will be generated if not provided) - minimum: 1 + example: "x5pJ3Az" title: type: string description: Track title @@ -10003,9 +10009,9 @@ components: - playlist_name properties: playlist_id: - type: integer + type: string description: Optional playlist ID (will be generated if not provided) - minimum: 1 + example: "x5pJ3Az" playlist_name: type: string description: Playlist or album name @@ -10100,9 +10106,9 @@ components: - wallet properties: user_id: - type: integer - description: Optional user ID (will be generated if not provided) - minimum: 1 + type: string + description: Optional user hash ID (will be generated if not provided) + example: "p9Km2Lx" handle: type: string description: User handle (unique username) @@ -10225,9 +10231,9 @@ components: type: boolean description: Whether the user is deactivated artist_pick_track_id: - type: integer - description: Track ID to feature as artist pick - minimum: 1 + type: string + description: Track hash ID to feature as artist pick + example: "x5pJ3Az" allow_ai_attribution: type: boolean description: Whether to allow AI attribution @@ -10244,9 +10250,9 @@ components: description: User events for tracking referrals and mobile users properties: referrer: - type: integer - description: User ID of the referrer - minimum: 1 + type: string + description: Hash ID of the user who referred this user + example: "k9Xm5Pz" is_mobile_user: type: boolean description: Whether the user is on mobile @@ -10262,21 +10268,20 @@ components: - $ref: '#/components/schemas/comment_entity_type' example: "Track" entityId: - type: integer - description: ID of the entity being commented on - minimum: 1 - example: 12345 + type: string + description: Hash ID of the entity being commented on + example: "x5pJ3Az" body: type: string description: The updated comment text maxLength: 500 mentions: type: array - description: Array of user IDs mentioned in the comment (max 10) + description: Array of user hash IDs mentioned in the comment (max 10) maxItems: 10 items: - type: integer - minimum: 1 + type: string + example: "k9Xm5Pz" create_comment_request_body: type: object required: @@ -10289,34 +10294,33 @@ components: - $ref: '#/components/schemas/comment_entity_type' example: "Track" entityId: - type: integer - description: ID of the entity being commented on - minimum: 1 - example: 12345 + type: string + description: Hash ID of the entity being commented on + example: "x5pJ3Az" body: type: string description: Comment text maxLength: 500 example: "Great track!" commentId: - type: integer - description: Optional comment ID (will be generated if not provided) - minimum: 1 + type: string + description: Optional hash ID for the comment (will be generated if not provided) + example: "Bm7aK9x" parentId: - type: integer - description: Parent comment ID if this is a reply - minimum: 1 + type: string + description: Parent comment hash ID if this is a reply + example: "8nWq2Lp" trackTimestampS: type: integer description: Timestamp in the track where the comment was made (in seconds) minimum: 0 mentions: type: array - description: Array of user IDs mentioned in the comment (max 10) + description: Array of user hash IDs mentioned in the comment (max 10) maxItems: 10 items: - type: integer - minimum: 1 + type: string + example: "k9Xm5Pz" react_comment_request_body: type: object required: @@ -10328,10 +10332,9 @@ components: - $ref: '#/components/schemas/comment_entity_type' example: "Track" entityId: - type: integer - description: ID of the entity (track or playlist) being commented on - minimum: 1 - example: 12345 + type: string + description: Hash ID of the entity (track) being commented on + example: "x5pJ3Az" pin_comment_request_body: type: object required: @@ -10343,10 +10346,9 @@ components: - $ref: '#/components/schemas/comment_entity_type' example: "Track" entityId: - type: integer - description: ID of the entity (track or playlist) the comment is on - minimum: 1 - example: 12345 + type: string + description: Hash ID of the entity (track) the comment is on + example: "x5pJ3Az" create_developer_app_request_body: type: object required: @@ -10506,9 +10508,9 @@ components: type: string enum: [playlist] playlist_id: - type: integer - description: Playlist ID - minimum: 1 + type: string + description: Playlist hash ID + example: "n7Qx4Mp" playlist_library_explore_playlist_identifier: type: object description: Reference to an explore playlist diff --git a/api/v1_comments.go b/api/v1_comments.go index 60b55acd..305b1d42 100644 --- a/api/v1_comments.go +++ b/api/v1_comments.go @@ -23,30 +23,30 @@ type GetCommentsParams struct { } type CreateCommentRequest struct { - EntityType string `json:"entityType" validate:"required,oneof=Track"` - EntityId int `json:"entityId" validate:"required,min=1"` - Body string `json:"body" validate:"required,max=500"` - CommentId *int `json:"commentId,omitempty" validate:"omitempty,min=1"` - ParentId *int `json:"parentId,omitempty" validate:"omitempty,min=1"` - TrackTimestampS *int `json:"trackTimestampS,omitempty" validate:"omitempty,min=0"` - Mentions []int `json:"mentions,omitempty" validate:"omitempty,dive,min=1"` + EntityType string `json:"entityType" validate:"required,oneof=Track"` + EntityId trashid.HashId `json:"entityId" validate:"required,min=1"` + Body string `json:"body" validate:"required,max=500"` + CommentId *trashid.HashId `json:"commentId,omitempty" validate:"omitempty,min=1"` + ParentId *trashid.HashId `json:"parentId,omitempty" validate:"omitempty,min=1"` + TrackTimestampS *int `json:"trackTimestampS,omitempty" validate:"omitempty,min=0"` + Mentions []trashid.HashId `json:"mentions,omitempty" validate:"omitempty,dive,min=1"` } type UpdateCommentRequest struct { - EntityType string `json:"entityType" validate:"required,oneof=Track"` - EntityId int `json:"entityId" validate:"required,min=1"` - Body string `json:"body" validate:"required,max=500"` - Mentions []int `json:"mentions,omitempty" validate:"omitempty,dive,min=1"` + EntityType string `json:"entityType" validate:"required,oneof=Track"` + EntityId trashid.HashId `json:"entityId" validate:"required,min=1"` + Body string `json:"body" validate:"required,max=500"` + Mentions []trashid.HashId `json:"mentions,omitempty" validate:"omitempty,dive,min=1"` } type ReactCommentRequest struct { - EntityType string `json:"entityType" validate:"required,oneof=Track"` - EntityId int `json:"entityId" validate:"required,min=1"` + EntityType string `json:"entityType" validate:"required,oneof=Track"` + EntityId trashid.HashId `json:"entityId" validate:"required,min=1"` } type PinCommentRequest struct { - EntityType string `json:"entityType" validate:"required,oneof=Track"` - EntityId int `json:"entityId" validate:"required,min=1"` + EntityType string `json:"entityType" validate:"required,oneof=Track"` + EntityId trashid.HashId `json:"entityId" validate:"required,min=1"` } func (app *ApiServer) queryFullComments( @@ -142,7 +142,7 @@ func (app *ApiServer) postV1Comment(c *fiber.Ctx) error { nonce := time.Now().UnixNano() commentID := 0 if req.CommentId != nil { - commentID = *req.CommentId + commentID = int(*req.CommentId) } else { // Generate unclaimed comment ID if not provided generatedID, err := app.generateUnclaimedId(c.Context(), "comments", "comment_id", 4_000_000, math.MaxInt32) @@ -157,11 +157,11 @@ func (app *ApiServer) postV1Comment(c *fiber.Ctx) error { // Build metadata metadataMap := map[string]interface{}{ "entity_type": req.EntityType, - "entity_id": req.EntityId, + "entity_id": int(req.EntityId), "body": req.Body, } if req.ParentId != nil { - metadataMap["parent_id"] = *req.ParentId + metadataMap["parent_id"] = int(*req.ParentId) } if req.TrackTimestampS != nil { metadataMap["track_timestamp_s"] = *req.TrackTimestampS @@ -172,7 +172,12 @@ func (app *ApiServer) postV1Comment(c *fiber.Ctx) error { if len(mentions) > 10 { mentions = mentions[:10] } - metadataMap["mentions"] = mentions + // Convert trashid.HashId slice to int slice + mentionInts := make([]int, len(mentions)) + for i, m := range mentions { + mentionInts[i] = int(m) + } + metadataMap["mentions"] = mentionInts } metadataObj := map[string]interface{}{ @@ -230,7 +235,7 @@ func (app *ApiServer) putV1Comment(c *fiber.Ctx) error { metadataMap := map[string]interface{}{ "entity_type": req.EntityType, - "entity_id": req.EntityId, + "entity_id": int(req.EntityId), "body": req.Body, } if len(req.Mentions) > 0 { @@ -239,7 +244,12 @@ func (app *ApiServer) putV1Comment(c *fiber.Ctx) error { if len(mentions) > 10 { mentions = mentions[:10] } - metadataMap["mentions"] = mentions + // Convert trashid.HashId slice to int slice + mentionInts := make([]int, len(mentions)) + for i, m := range mentions { + mentionInts[i] = int(m) + } + metadataMap["mentions"] = mentionInts } metadataObj := map[string]interface{}{ @@ -336,7 +346,7 @@ func (app *ApiServer) postV1CommentReact(c *fiber.Ctx) error { metadataObj := map[string]interface{}{ "cid": "", "data": map[string]interface{}{ - "entity_id": req.EntityId, + "entity_id": int(req.EntityId), "entity_type": req.EntityType, }, } @@ -390,7 +400,7 @@ func (app *ApiServer) deleteV1CommentReact(c *fiber.Ctx) error { metadataObj := map[string]interface{}{ "cid": "", "data": map[string]interface{}{ - "entity_id": req.EntityId, + "entity_id": int(req.EntityId), "entity_type": req.EntityType, }, } @@ -447,7 +457,7 @@ func (app *ApiServer) postV1CommentPin(c *fiber.Ctx) error { "cid": "", "data": map[string]interface{}{ "entity_type": req.EntityType, - "entity_id": req.EntityId, + "entity_id": int(req.EntityId), }, } metadataBytes, _ := json.Marshal(metadataObj) @@ -501,7 +511,7 @@ func (app *ApiServer) deleteV1CommentPin(c *fiber.Ctx) error { "cid": "", "data": map[string]interface{}{ "entity_type": req.EntityType, - "entity_id": req.EntityId, + "entity_id": int(req.EntityId), }, } metadataBytes, _ := json.Marshal(metadataObj) diff --git a/api/v1_playlist.go b/api/v1_playlist.go index bc57a4db..6621b00d 100644 --- a/api/v1_playlist.go +++ b/api/v1_playlist.go @@ -22,7 +22,7 @@ type PlaylistTrackInfo struct { } type CreatePlaylistRequest struct { - PlaylistId *int `json:"playlist_id,omitempty" validate:"omitempty,min=1"` + PlaylistId *trashid.HashId `json:"playlist_id,omitempty" validate:"omitempty,min=1"` PlaylistName string `json:"playlist_name" validate:"required,min=1"` Description *string `json:"description,omitempty" validate:"omitempty,max=1000"` IsPrivate *bool `json:"is_private,omitempty"` @@ -108,7 +108,7 @@ func (app *ApiServer) postV1Playlists(c *fiber.Ctx) error { // Determine playlist ID var playlistID int if req.PlaylistId != nil { - playlistID = *req.PlaylistId + playlistID = int(*req.PlaylistId) } else { // Generate unclaimed playlist ID if not provided generatedID, err := app.generateUnclaimedId(c.Context(), "tracks", "track_id", 400_000, math.MaxInt32) diff --git a/api/v1_track.go b/api/v1_track.go index b57102d3..4a6066a2 100644 --- a/api/v1_track.go +++ b/api/v1_track.go @@ -18,7 +18,7 @@ import ( // Nested type definitions for track metadata type RemixParent struct { - ParentTrackId int `json:"parent_track_id" validate:"required,min=1"` + ParentTrackId trashid.HashId `json:"parent_track_id" validate:"required,min=1"` } type RemixOf struct { @@ -26,8 +26,8 @@ type RemixOf struct { } type StemOf struct { - Category string `json:"category" validate:"required,oneof=INSTRUMENTAL LEAD_VOCALS MELODIC_LEAD PAD SNARE KICK HIHAT PERCUSSION SAMPLE BACKING_VOX BASS OTHER"` - ParentTrackId int `json:"parent_track_id" validate:"required,min=1"` + Category string `json:"category" validate:"required,oneof=INSTRUMENTAL LEAD_VOCALS MELODIC_LEAD PAD SNARE KICK HIHAT PERCUSSION SAMPLE BACKING_VOX BASS OTHER"` + ParentTrackId trashid.HashId `json:"parent_track_id" validate:"required,min=1"` } type FieldVisibility struct { @@ -54,11 +54,11 @@ type CollectibleGatedConditions struct { } type FollowGatedConditions struct { - FollowUserId int `json:"follow_user_id" validate:"required,min=1"` + FollowUserId trashid.HashId `json:"follow_user_id" validate:"required,min=1"` } type TipGatedConditions struct { - TipUserId int `json:"tip_user_id" validate:"required,min=1"` + TipUserId trashid.HashId `json:"tip_user_id" validate:"required,min=1"` } type TokenGate struct { @@ -71,8 +71,8 @@ type TokenGatedConditions struct { } type PurchaseSplit struct { - UserId int `json:"user_id" validate:"required,min=1"` - Percentage float64 `json:"percentage" validate:"required,min=0,max=100"` + UserId trashid.HashId `json:"user_id" validate:"required,min=1"` + Percentage float64 `json:"percentage" validate:"required,min=0,max=100"` } type USDCPurchase struct { @@ -89,11 +89,11 @@ type USDCPurchaseConditions struct { // In Go, we use a flexible approach where the JSON contains the discriminating field. type AccessConditions struct { // Exactly one of these should be populated - NftCollection *NFTCollection `json:"nft_collection,omitempty" validate:"omitempty"` - FollowUserId *int `json:"follow_user_id,omitempty" validate:"omitempty,min=1"` - TipUserId *int `json:"tip_user_id,omitempty" validate:"omitempty,min=1"` - TokenGate *TokenGate `json:"token_gate,omitempty" validate:"omitempty"` - UsdcPurchase *USDCPurchase `json:"usdc_purchase,omitempty" validate:"omitempty"` + NftCollection *NFTCollection `json:"nft_collection,omitempty" validate:"omitempty"` + FollowUserId *trashid.HashId `json:"follow_user_id,omitempty" validate:"omitempty,min=1"` + TipUserId *trashid.HashId `json:"tip_user_id,omitempty" validate:"omitempty,min=1"` + TokenGate *TokenGate `json:"token_gate,omitempty" validate:"omitempty"` + UsdcPurchase *USDCPurchase `json:"usdc_purchase,omitempty" validate:"omitempty"` } type DDEXResourceContributor struct { @@ -114,7 +114,7 @@ type DDEXRightsController struct { } type CreateTrackRequest struct { - TrackId *int `json:"track_id,omitempty" validate:"omitempty,min=1"` + TrackId *trashid.HashId `json:"track_id,omitempty" validate:"omitempty,min=1"` Title string `json:"title" validate:"required,min=1"` Genre string `json:"genre" validate:"required,oneof='Electronic' 'Rock' 'Metal' 'Alternative' 'Hip-Hop/Rap' 'Experimental' 'Punk' 'Folk' 'Pop' 'Ambient' 'Soundtrack' 'World' 'Jazz' 'Acoustic' 'Funk' 'R&B/Soul' 'Devotional' 'Classical' 'Reggae' 'Podcasts' 'Country' 'Spoken Word' 'Comedy' 'Blues' 'Kids' 'Audiobooks' 'Latin' 'Lo-Fi' 'Hyperpop' 'Dancehall' 'Techno' 'Trap' 'House' 'Tech House' 'Deep House' 'Disco' 'Electro' 'Jungle' 'Progressive House' 'Hardstyle' 'Glitch Hop' 'Trance' 'Future Bass' 'Future House' 'Tropical House' 'Downtempo' 'Drum & Bass' 'Dubstep' 'Jersey Club' 'Vaporwave' 'Moombahton'"` Description *string `json:"description,omitempty" validate:"omitempty,max=1000"` @@ -138,7 +138,7 @@ type CreateTrackRequest struct { StreamConditions *AccessConditions `json:"stream_conditions,omitempty" validate:"omitempty"` IsStreamGated *bool `json:"is_stream_gated,omitempty"` IsDownloadGated *bool `json:"is_download_gated,omitempty"` - AiAttributionUserId *int `json:"ai_attribution_user_id,omitempty" validate:"omitempty,min=0"` + AiAttributionUserId *trashid.HashId `json:"ai_attribution_user_id,omitempty" validate:"omitempty,min=0"` AllowedApiKeys *[]string `json:"allowed_api_keys,omitempty"` PlacementHosts *string `json:"placement_hosts,omitempty"` DdexApp *string `json:"ddex_app,omitempty"` @@ -179,7 +179,7 @@ type UpdateTrackRequest struct { StreamConditions *AccessConditions `json:"stream_conditions,omitempty" validate:"omitempty"` IsStreamGated *bool `json:"is_stream_gated,omitempty"` IsDownloadGated *bool `json:"is_download_gated,omitempty"` - AiAttributionUserId *int `json:"ai_attribution_user_id,omitempty" validate:"omitempty,min=0"` + AiAttributionUserId *trashid.HashId `json:"ai_attribution_user_id,omitempty" validate:"omitempty,min=0"` AllowedApiKeys *[]string `json:"allowed_api_keys,omitempty"` PlacementHosts *string `json:"placement_hosts,omitempty"` DdexApp *string `json:"ddex_app,omitempty"` @@ -235,7 +235,7 @@ func (app *ApiServer) postV1Tracks(c *fiber.Ctx) error { // Determine track ID var trackID int if req.TrackId != nil { - trackID = *req.TrackId + trackID = int(*req.TrackId) } else { // Generate unclaimed track ID if not provided generatedID, err := app.generateUnclaimedId(c.Context(), "tracks", "track_id", 2_000_000, math.MaxInt32) diff --git a/api/v1_users.go b/api/v1_users.go index babc5850..18524ae1 100644 --- a/api/v1_users.go +++ b/api/v1_users.go @@ -24,12 +24,12 @@ type PlaylistLibrary struct { } type Events struct { - Referrer *int `json:"referrer,omitempty" validate:"omitempty,min=1"` - IsMobileUser *bool `json:"is_mobile_user,omitempty"` + Referrer *trashid.HashId `json:"referrer,omitempty" validate:"omitempty,min=1"` + IsMobileUser *bool `json:"is_mobile_user,omitempty"` } type CreateUserRequest struct { - UserId *int `json:"user_id,omitempty" validate:"omitempty,min=1"` + UserId *trashid.HashId `json:"user_id,omitempty" validate:"omitempty,min=1"` Handle string `json:"handle" validate:"required,min=1"` Wallet string `json:"wallet" validate:"required"` Name *string `json:"name,omitempty" validate:"omitempty,min=1"` @@ -66,7 +66,7 @@ type UpdateUserRequest struct { CoverPhotoSizes *string `json:"cover_photo_sizes,omitempty"` ProfileType *string `json:"profile_type,omitempty" validate:"omitempty,oneof=label"` IsDeactivated *bool `json:"is_deactivated,omitempty"` - ArtistPickTrackId *int `json:"artist_pick_track_id,omitempty" validate:"omitempty,min=1"` + ArtistPickTrackId *trashid.HashId `json:"artist_pick_track_id,omitempty" validate:"omitempty,min=1"` AllowAiAttribution *bool `json:"allow_ai_attribution,omitempty"` PlaylistLibrary *PlaylistLibrary `json:"playlist_library,omitempty" validate:"omitempty"` SplUsdcPayoutWallet *string `json:"spl_usdc_payout_wallet,omitempty"` @@ -111,7 +111,7 @@ func (app *ApiServer) postV1Users(c *fiber.Ctx) error { // Determine user ID var userID int if req.UserId != nil { - userID = *req.UserId + userID = int(*req.UserId) } else { // Generate unclaimed user ID if not provided generatedID, err := app.generateUnclaimedId(c.Context(), "users", "user_id", 3_000_000, 999_999_999) From 2074c280cb713efa9de5638228e98a2ab3349323 Mon Sep 17 00:00:00 2001 From: Marcus Pasell <3690498+rickyrombo@users.noreply.github.com> Date: Fri, 13 Feb 2026 17:17:03 -0800 Subject: [PATCH 3/3] access gates don't use hash ids --- api/swagger/swagger-v1.yaml | 12 ++++++------ api/v1_track.go | 18 +++++++++--------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/api/swagger/swagger-v1.yaml b/api/swagger/swagger-v1.yaml index 02491bfa..4db8b96e 100644 --- a/api/swagger/swagger-v1.yaml +++ b/api/swagger/swagger-v1.yaml @@ -7877,8 +7877,8 @@ components: type: object properties: tip_user_id: - type: string - example: "x5pJ3Az" + type: integer + example: 1234 description: Must tip the given user ID to unlock follow_gate: required: @@ -7886,8 +7886,8 @@ components: type: object properties: follow_user_id: - type: string - example: "x5pJ3Az" + type: integer + example: 1234 description: Must follow the given user ID to unlock token_gate: required: @@ -7942,8 +7942,8 @@ components: type: object properties: user_id: - type: string - example: "x5pJ3Az" + type: integer + example: 1234 percentage: type: number eth_wallet: diff --git a/api/v1_track.go b/api/v1_track.go index 4a6066a2..9aaa7485 100644 --- a/api/v1_track.go +++ b/api/v1_track.go @@ -54,11 +54,11 @@ type CollectibleGatedConditions struct { } type FollowGatedConditions struct { - FollowUserId trashid.HashId `json:"follow_user_id" validate:"required,min=1"` + FollowUserId int `json:"follow_user_id" validate:"required,min=1"` } type TipGatedConditions struct { - TipUserId trashid.HashId `json:"tip_user_id" validate:"required,min=1"` + TipUserId int `json:"tip_user_id" validate:"required,min=1"` } type TokenGate struct { @@ -71,8 +71,8 @@ type TokenGatedConditions struct { } type PurchaseSplit struct { - UserId trashid.HashId `json:"user_id" validate:"required,min=1"` - Percentage float64 `json:"percentage" validate:"required,min=0,max=100"` + UserId int `json:"user_id" validate:"required,min=1"` + Percentage float64 `json:"percentage" validate:"required,min=0,max=100"` } type USDCPurchase struct { @@ -89,11 +89,11 @@ type USDCPurchaseConditions struct { // In Go, we use a flexible approach where the JSON contains the discriminating field. type AccessConditions struct { // Exactly one of these should be populated - NftCollection *NFTCollection `json:"nft_collection,omitempty" validate:"omitempty"` - FollowUserId *trashid.HashId `json:"follow_user_id,omitempty" validate:"omitempty,min=1"` - TipUserId *trashid.HashId `json:"tip_user_id,omitempty" validate:"omitempty,min=1"` - TokenGate *TokenGate `json:"token_gate,omitempty" validate:"omitempty"` - UsdcPurchase *USDCPurchase `json:"usdc_purchase,omitempty" validate:"omitempty"` + NftCollection *NFTCollection `json:"nft_collection,omitempty" validate:"omitempty"` + FollowUserId *int `json:"follow_user_id,omitempty" validate:"omitempty,min=1"` + TipUserId *int `json:"tip_user_id,omitempty" validate:"omitempty,min=1"` + TokenGate *TokenGate `json:"token_gate,omitempty" validate:"omitempty"` + UsdcPurchase *USDCPurchase `json:"usdc_purchase,omitempty" validate:"omitempty"` } type DDEXResourceContributor struct {