Skip to content

Commit 5b23d3d

Browse files
committed
feedpost struct improvements + fix composer.json after openapi generator creates one missing name
1 parent 736075b commit 5b23d3d

8 files changed

Lines changed: 278 additions & 14 deletions

File tree

composer.json

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
"php",
88
"sdk",
99
"rest",
10-
"api"
10+
"api",
11+
"fastcomments",
12+
"live-commenting",
13+
"comments-api",
14+
"comments"
1115
],
1216
"homepage": "https://fastcomments.com",
1317
"license": "MIT",
@@ -30,9 +34,14 @@
3034
"friendsofphp/php-cs-fixer": "^3.5"
3135
},
3236
"autoload": {
33-
"psr-4": { "FastComments\\Client\\" : "lib/" }
37+
"psr-4": {
38+
"FastComments\\Client\\": "lib/"
39+
}
3440
},
3541
"autoload-dev": {
36-
"psr-4": { "FastComments\\Client\\Test\\" : "test/" }
37-
}
42+
"psr-4": {
43+
"FastComments\\Client\\Test\\": "test/"
44+
}
45+
},
46+
"name": "fastcomments/client"
3847
}

docs/Model/FeedPost.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**_id** | **string** | |
8+
**tenant_id** | **string** | |
9+
**title** | **string** | | [optional]
810
**from_user_id** | **string** | | [optional]
11+
**from_user_display_name** | **string** | | [optional]
12+
**from_user_avatar** | **string** | | [optional]
913
**from_ip_hash** | **string** | | [optional]
1014
**tags** | **string[]** | | [optional]
1115
**weight** | **float** | | [optional]
@@ -14,5 +18,6 @@ Name | Type | Description | Notes
1418
**media** | [**\FastComments\Client\Model\FeedPostMediaItem[]**](FeedPostMediaItem.md) | | [optional]
1519
**links** | [**\FastComments\Client\Model\FeedPostLink[]**](FeedPostLink.md) | | [optional]
1620
**created_at** | **\DateTime** | |
21+
**reacts** | **array<string,float>** | Construct a type with a set of properties K of type T | [optional]
1722

1823
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

docs/Model/FeedPostMediaItem.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**title** | **string** | | [optional]
88
**link** | **string** | | [optional]
9-
**sizes** | [**\FastComments\Client\Model\FeedPostMediaItemAsset**](FeedPostMediaItemAsset.md) | | [optional]
9+
**sizes** | [**\FastComments\Client\Model\FeedPostMediaItemAsset[]**](FeedPostMediaItemAsset.md) | |
1010

1111
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

fix-composer.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env node
2+
3+
const fs = require('fs');
4+
const path = require('path');
5+
6+
const composerPath = path.join(__dirname, 'composer.json');
7+
8+
// Read composer.json
9+
try {
10+
const composerJson = JSON.parse(fs.readFileSync(composerPath, 'utf8'));
11+
12+
// Add name if missing
13+
if (!composerJson.name) {
14+
composerJson.name = 'fastcomments/client';
15+
console.log('Added missing name to composer.json');
16+
}
17+
18+
composerJson.keywords.push(...['fastcomments', 'live-commenting', 'comments-api', 'comments']);
19+
20+
// Format the output with 4 spaces indentation and write back
21+
fs.writeFileSync(composerPath, JSON.stringify(composerJson, null, 4) + '\n');
22+
console.log('composer.json updated successfully');
23+
} catch (error) {
24+
console.error('Error updating composer.json:', error);
25+
process.exit(1);
26+
}

0 commit comments

Comments
 (0)