Skip to content

Commit 8ac48e7

Browse files
authored
Bye line things (#643)
line/line-openapi#112 is a cleanup PR for line things, but it appears to break several tests by deleting this change. Let’s remove those tests beforehand. and more, this change updates our versioning in README. - We'll release changes as a patch version when we close features due to some business reasons. Note we clean up webhook code for line things in another PR.
1 parent a676238 commit 8ac48e7

File tree

3 files changed

+3
-88
lines changed

3 files changed

+3
-88
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,11 @@ request = Line::Bot::V2::MessagingApi::PushMessageRequest.create(
312312
```
313313

314314
## Versioning
315+
315316
This project respects semantic versioning.
317+
- See https://semver.org/
316318

317-
See https://semver.org/
319+
However, if a feature that was publicly released is discontinued for business reasons and becomes completely unusable, we will release changes as a patch release.
318320

319321
### v1 and v2
320322
v1 and v2 are completely different implementations. Migration to v2 is strongly recommended.

examples/v2/kitchensink/app.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,6 @@ def parser
113113
when Line::Bot::V2::Webhook::PnpDeliveryCompletionEvent
114114
reply_text(event, "[PNP DELIVERY COMPLETE] delivered\n")
115115

116-
when Line::Bot::V2::Webhook::ThingsEvent
117-
reply_text(event, "[THINGS]\n#{JSON.generate(event.things)}")
118-
119116
when Line::Bot::V2::Webhook::VideoPlayCompleteEvent
120117
reply_text(event, "[VIDEO_PLAY_COMPLETE]\n#{JSON.generate(event.video_play_complete)}")
121118

spec/line/bot/v2/webhook_parser_spec.rb

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,90 +1770,6 @@
17701770
end
17711771
end
17721772

1773-
context 'with a ThingsEvent' do
1774-
let(:webhook) do
1775-
<<~JSON
1776-
{
1777-
"destination": "Uc7472b39e21dab71c2347e02714630d6",
1778-
"events": [
1779-
{
1780-
"type": "things",
1781-
"timestamp": 1650591346705,
1782-
"replyToken": "nHuyWiB7yP5Zw52FIkcQobQuGDXCTA",
1783-
"source": {
1784-
"type": "user",
1785-
"userId": "U8189cf6745fc0d808977bdb0b9f22995"
1786-
},
1787-
"webhookEventId": "01G17EJCGAVV66J5WNA7ZCTF6H",
1788-
"deliveryContext": {
1789-
"isRedelivery": false
1790-
},
1791-
"mode": "active",
1792-
"things": {
1793-
"type": "scenarioResult",
1794-
"deviceId": "xxxxxxxxxxxxxxxxxxx",
1795-
"result": {
1796-
"scenarioId": "xxxxxxxxxxxxxxx",
1797-
"revision": 0,
1798-
"resultCode": "success",
1799-
"startTime": 1650591345705,
1800-
"endTime": 1650591346605,
1801-
"bleNotificationPayload": "xxxxxxx",
1802-
"actionResults": [
1803-
{
1804-
"data": "xxxxxxx",
1805-
"type": "binary"
1806-
},
1807-
{
1808-
"type": "void"
1809-
},
1810-
{
1811-
"type": "void"
1812-
}
1813-
]
1814-
}
1815-
}
1816-
}
1817-
]
1818-
}
1819-
JSON
1820-
end
1821-
1822-
it 'parses the webhook as a ThingsEvent' do
1823-
events = parser.parse(body: webhook, signature: signature)
1824-
expect(events).not_to be_empty
1825-
1826-
event = events.first
1827-
expect(event).to be_a(Line::Bot::V2::Webhook::ThingsEvent)
1828-
expect(event.type).to eq('things')
1829-
expect(event.timestamp).to eq(1650591346705)
1830-
expect(event.reply_token).to eq('nHuyWiB7yP5Zw52FIkcQobQuGDXCTA')
1831-
expect(event.source).to be_a(Line::Bot::V2::Webhook::UserSource)
1832-
expect(event.source.type).to eq('user')
1833-
expect(event.source.user_id).to eq('U8189cf6745fc0d808977bdb0b9f22995')
1834-
expect(event.webhook_event_id).to eq('01G17EJCGAVV66J5WNA7ZCTF6H')
1835-
expect(event.delivery_context).to be_a(Line::Bot::V2::Webhook::DeliveryContext)
1836-
expect(event.delivery_context.is_redelivery).to be false
1837-
expect(event.mode).to eq('active')
1838-
expect(event.things).to be_a(Line::Bot::V2::Webhook::ScenarioResultThingsContent)
1839-
expect(event.things.type).to eq('scenarioResult')
1840-
expect(event.things.device_id).to eq('xxxxxxxxxxxxxxxxxxx')
1841-
expect(event.things.result).to be_a(Line::Bot::V2::Webhook::ScenarioResult)
1842-
expect(event.things.result.scenario_id).to eq('xxxxxxxxxxxxxxx')
1843-
expect(event.things.result.revision).to eq(0)
1844-
expect(event.things.result.result_code).to eq('success')
1845-
expect(event.things.result.start_time).to eq(1650591345705)
1846-
expect(event.things.result.end_time).to eq(1650591346605)
1847-
expect(event.things.result.ble_notification_payload).to eq('xxxxxxx')
1848-
expect(event.things.result.action_results).to be_an(Array)
1849-
expect(event.things.result.action_results.size).to eq(3)
1850-
expect(event.things.result.action_results[0].data).to eq('xxxxxxx')
1851-
expect(event.things.result.action_results[0].type).to eq('binary')
1852-
expect(event.things.result.action_results[1].type).to eq('void')
1853-
expect(event.things.result.action_results[2].type).to eq('void')
1854-
end
1855-
end
1856-
18571773
context 'with a MembershioEvent' do
18581774
let(:webhook) do
18591775
<<~JSON

0 commit comments

Comments
 (0)