This repository has been archived by the owner on Jul 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5f98d11
commit 406054e
Showing
4 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import CRUDExtend from '../extends/crud' | ||
|
||
class SubscriptionSubscribersEndpoint extends CRUDExtend { | ||
constructor(endpoint) { | ||
super(endpoint) | ||
|
||
this.endpoint = 'subscriptions/subscribers' | ||
} | ||
|
||
Create(body) { | ||
return this.request.send(this.endpoint, 'POST', { | ||
...body | ||
}) | ||
} | ||
|
||
Update(id, body, token = null) { | ||
return this.request.send( | ||
`${this.endpoint}/${id}`, | ||
'PUT', | ||
{ | ||
...body | ||
}, | ||
token | ||
) | ||
} | ||
|
||
} | ||
|
||
export default SubscriptionSubscribersEndpoint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* Subscription Subscribers | ||
* Description: Subscription Subscribers. | ||
* DOCS: TODO: add docs when ready | ||
*/ | ||
import { | ||
Identifiable, | ||
CrudQueryableResource | ||
} from './core' | ||
|
||
/** | ||
* Core Subscription Subscriber Base Interface | ||
* For custom flows, extend this interface | ||
* DOCS: TODO: add docs when ready | ||
*/ | ||
export interface SubscriptionSubscriberBase { | ||
type: "subscription_subscriber" | ||
attributes: { | ||
account_id: string | ||
name: string | ||
email: string | ||
} | ||
} | ||
|
||
export interface SubscriptionSubscriber extends Identifiable, SubscriptionSubscriberBase { | ||
|
||
} | ||
export type SubscriptionSubscriberCreate = SubscriptionSubscriberBase | ||
export type SubscriptionSubscriberUpdate = Omit<SubscriptionSubscriber, 'attributes'> & {attributes: Partial<SubscriptionSubscriberBase['attributes']> & Identifiable} | ||
|
||
/** | ||
* Subscription Subscriber Endpoints | ||
* DOCS: TODO: add docs when ready | ||
*/ | ||
export interface SubscriptionSubscribersEndpoint | ||
extends CrudQueryableResource< | ||
SubscriptionSubscriber, | ||
SubscriptionSubscriberCreate, | ||
SubscriptionSubscriberUpdate, | ||
never, | ||
never, | ||
never | ||
> { | ||
endpoint: 'plans' | ||
} |