feat: add search and rich collaboration requests
فشلت بعض الفحوصات
Deploy To Ghaymah / deploy (push) Has been cancelled
فشلت بعض الفحوصات
Deploy To Ghaymah / deploy (push) Has been cancelled
هذا الالتزام موجود في:
@@ -756,6 +756,196 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Search",
|
||||
"item": [
|
||||
{
|
||||
"name": "Global Search - All",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"url": "{{baseUrl}}/search?q={{searchQuery}}&type={{searchType}}&page=1&limit={{searchLimit}}",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{accessToken}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('query');",
|
||||
"pm.expect(json).to.have.property('users');",
|
||||
"pm.expect(json).to.have.property('posts');",
|
||||
"pm.expect(json).to.have.property('hashtags');",
|
||||
"pm.expect(json.users.pagination).to.exist;",
|
||||
"pm.expect(json.posts.pagination).to.exist;",
|
||||
"pm.expect(json.hashtags.pagination).to.exist;"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Global Search - Users Type",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"url": "{{baseUrl}}/search?q={{searchQuery}}&type=users&page=1&limit={{searchLimit}}",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{accessToken}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json.users).to.have.property('items');",
|
||||
"pm.expect(json.users).to.have.property('pagination');"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Search Users",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"url": "{{baseUrl}}/search/users?q={{searchQuery}}&page=1&limit={{searchLimit}}",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{accessToken}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('items');",
|
||||
"pm.expect(json).to.have.property('pagination');",
|
||||
"if (json.items.length) {",
|
||||
" const target = json.items[0];",
|
||||
" pm.expect(target).to.have.property('username');",
|
||||
" pm.expect(target).to.have.property('isFollowing');",
|
||||
" pm.environment.set('targetUserId', target._id || target.id);",
|
||||
"}"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Search Posts",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"url": "{{baseUrl}}/search/posts?q={{searchQuery}}&page=1&limit={{searchLimit}}&sortOrder={{listSortOrder}}",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{accessToken}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('items');",
|
||||
"pm.expect(json).to.have.property('pagination');",
|
||||
"if (json.items.length) {",
|
||||
" const post = json.items[0];",
|
||||
" pm.expect(post).to.have.property('media');",
|
||||
" pm.expect(post).to.have.property('isLiked');",
|
||||
" pm.expect(post).to.have.property('isSaved');",
|
||||
" pm.environment.set('postId', post._id || post.id);",
|
||||
"}"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Search Hashtags",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"url": "{{baseUrl}}/search/hashtags?q={{searchQuery}}&page=1&limit={{searchLimit}}",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{accessToken}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('items');",
|
||||
"pm.expect(json).to.have.property('pagination');",
|
||||
"if (json.items.length) {",
|
||||
" pm.expect(json.items[0]).to.have.property('tag');",
|
||||
" pm.expect(json.items[0]).to.have.property('postsCount');",
|
||||
" pm.environment.set('postHashtag', json.items[0].tag);",
|
||||
"}"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Search Suggestions",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"url": "{{baseUrl}}/search/suggestions?q={{searchQuery}}&limit={{searchSuggestionLimit}}",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{accessToken}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('users');",
|
||||
"pm.expect(json).to.have.property('hashtags');"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Users",
|
||||
"item": [
|
||||
@@ -3083,6 +3273,139 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Collaboration Requests",
|
||||
"item": [
|
||||
{
|
||||
"name": "Create Collaboration Request",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"url": "{{baseUrl}}/posts/{{postId}}/collaboration-requests",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{accessToken}}"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"targetUserId\": \"{{targetUserId}}\",\n \"collaborationType\": \"{{collaborationType}}\",\n \"message\": \"{{collaborationMessage}}\",\n \"attachmentUrl\": \"{{collaborationAttachmentUrl}}\",\n \"attachmentType\": \"{{collaborationAttachmentType}}\"\n}",
|
||||
"options": {
|
||||
"raw": {
|
||||
"language": "json"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status is 200 or 201', function () { pm.expect([200, 201]).to.include(pm.response.code); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('request');",
|
||||
"pm.environment.set('collaborationRequestId', json.request._id || json.request.id);",
|
||||
"pm.test('Rich collaboration fields are accepted', function () {",
|
||||
" pm.expect(json.request).to.have.property('collaborationType');",
|
||||
" pm.expect(json.request).to.have.property('message');",
|
||||
" pm.expect(json.request).to.have.property('attachmentUrl');",
|
||||
" pm.expect(json.request).to.have.property('attachmentType');",
|
||||
"});"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "List My Collaboration Requests",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"url": "{{baseUrl}}/collaboration-requests?page=1&limit=20",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{accessToken}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('items');",
|
||||
"pm.expect(json).to.have.property('pagination');",
|
||||
"if (json.items.length) {",
|
||||
" pm.environment.set('collaborationRequestId', json.items[0]._id || json.items[0].id);",
|
||||
" pm.expect(json.items[0]).to.have.property('status');",
|
||||
" pm.expect(json.items[0]).to.have.property('collaborationType');",
|
||||
"}"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Approve Collaboration Request",
|
||||
"request": {
|
||||
"method": "PATCH",
|
||||
"url": "{{baseUrl}}/collaboration-requests/{{collaborationRequestId}}/approve",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{accessToken}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('approved', true);",
|
||||
"pm.expect(json).to.have.property('request');"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Reject Collaboration Request",
|
||||
"request": {
|
||||
"method": "PATCH",
|
||||
"url": "{{baseUrl}}/collaboration-requests/{{collaborationRequestId}}/reject",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{accessToken}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('rejected', true);",
|
||||
"pm.expect(json).to.have.property('request');"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Comments",
|
||||
"item": [
|
||||
@@ -8667,6 +8990,38 @@
|
||||
{
|
||||
"key": "auditAction",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"key": "searchQuery",
|
||||
"value": "music"
|
||||
},
|
||||
{
|
||||
"key": "searchType",
|
||||
"value": "all"
|
||||
},
|
||||
{
|
||||
"key": "searchLimit",
|
||||
"value": "20"
|
||||
},
|
||||
{
|
||||
"key": "searchSuggestionLimit",
|
||||
"value": "5"
|
||||
},
|
||||
{
|
||||
"key": "collaborationType",
|
||||
"value": "duet"
|
||||
},
|
||||
{
|
||||
"key": "collaborationMessage",
|
||||
"value": "I want to collaborate on this piece"
|
||||
},
|
||||
{
|
||||
"key": "collaborationAttachmentUrl",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"key": "collaborationAttachmentType",
|
||||
"value": "audio"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
تم حذف اختلاف الملف لأن الملف كبير جداً
تحميل الاختلاف
تم حذف اختلاف الملف لأن الملف كبير جداً
تحميل الاختلاف
المرجع في مشكلة جديدة
حظر مستخدم