MDN has documentation about Proxy.
const api = createObjectMapper('https://example.org/base-path/')
await api.users['user-id-1'].get()
await api.posts.post({
title: 'New Post',
content: 'Lorem ipsum',
})
await api.posts.get({
category: 'technology',
limit: 5,
})
await api.posts['post-id-123'].comments.get({
commentId: 'comment-456',
})
await api.users['user-id-1'].put({ fullName: 'John Doe' })