Skip to content

Commit

Permalink
chore: Rename select to $select
Browse files Browse the repository at this point in the history
  • Loading branch information
neet committed Jul 27, 2023
1 parent 9cc1286 commit 0aa23ca
Show file tree
Hide file tree
Showing 59 changed files with 213 additions and 209 deletions.
2 changes: 1 addition & 1 deletion examples/create-new-status.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createRestClient, type mastodon } from 'masto';

const masto = await createRestClient({
const masto = createRestClient({
url: 'https://example.com',
accessToken: 'YOUR TOKEN',
});
Expand Down
2 changes: 1 addition & 1 deletion examples/moderate-reports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const masto = createRestClient({
const reports = await masto.v1.admin.reports.list();

// Disable an account of the 1st report
await masto.v1.admin.accounts.select(reports[0].account.id).action.create({
await masto.v1.admin.accounts.$select(reports[0].account.id).action.create({
type: 'disable',
reportId: reports[0].id,
text: 'Your account has been disabled',
Expand Down
2 changes: 1 addition & 1 deletion examples/timeline-with-iterable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ console.log(result);
let i = 0;
for await (const statuses of masto.v1.timelines.public.list()) {
for (const status of statuses) {
await masto.v1.statuses.select(status.id).favourite();
await masto.v1.statuses.$select(status.id).favourite();
i += 1;
}
if (i >= 10) break;
Expand Down
4 changes: 2 additions & 2 deletions examples/timeline-with-streaming.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createWebSocketClient } from 'masto';
import { createStreamingClient } from 'masto';

const subscribe = async (): Promise<void> => {
const masto = createWebSocketClient({
const masto = createStreamingClient({
url: '<STREAMING API URL>',
accessToken: '<TOKEN>',
});
Expand Down
2 changes: 1 addition & 1 deletion examples/update-profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import fs from 'node:fs/promises';

import { createRestClient } from '../src';

const masto = await createRestClient({
const masto = createRestClient({
url: 'https://example.com',
accessToken: 'YOUR TOKEN',
});
Expand Down
2 changes: 1 addition & 1 deletion src/adapters/request-builder/request-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const apply =
throw new Error('No action specified');
}

if (action === 'select') {
if (action === '$select') {
return createRequestBuilder(http, [...context, ...(args as string[])]);
}

Expand Down
2 changes: 1 addition & 1 deletion src/mastodon/rest/v1/account-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export interface FetchRelationshipsParams {
}

export interface AccountRepository {
select(id: string): {
$select(id: string): {
/**
* View information about a profile.
* @return Account
Expand Down
2 changes: 1 addition & 1 deletion src/mastodon/rest/v1/admin/account-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export interface AccountRepository {
meta?: HttpMetaParams,
): Paginator<Admin.Account[], ListAccountsParams>;

select(id: string): {
$select(id: string): {
/**
* View admin-level information about the given account.
* @return AdminAccount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export interface CanonicalEmailBlockRepository {
meta?: HttpMetaParams<'json'>,
): Promise<Admin.CanonicalEmailBlock>;

select(id: string): {
$select(id: string): {
/**
* Show a single canonical email block
* @return CanonicalEmailBlock
Expand Down
2 changes: 1 addition & 1 deletion src/mastodon/rest/v1/admin/domain-allow-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export interface DomainAllowRepository {
meta?: HttpMetaParams<'json'>,
): Promise<Admin.DomainAllow>;

select(id: string): {
$select(id: string): {
/**
* Show information about a single allowed domain
* @return DomainAllow
Expand Down
2 changes: 1 addition & 1 deletion src/mastodon/rest/v1/admin/domain-block-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export interface DomainBlockRepository {
meta?: HttpMetaParams<'json'>,
): Promise<Admin.DomainBlock>;

select(id: string): {
$select(id: string): {
/**
* Show information about a single blocked domain.
* @return DomainBlock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface EmailDomainBlockRepository {
meta?: HttpMetaParams,
): Paginator<Admin.EmailDomainBlock[], ListEmailDomainBlocksParams>;

select(id: string): {
$select(id: string): {
/**
* Show information about a single email domain that is blocked from sign-ups.
* @return EmailDomainBlock
Expand Down
2 changes: 1 addition & 1 deletion src/mastodon/rest/v1/admin/ip-block-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export interface IpBlockRepository {
meta?: HttpMetaParams,
): Paginator<Admin.IpBlock[], ListIpBlocksParams>;

select(id: string): {
$select(id: string): {
/**
* Show information about a single IP block.
* @return IpBlock
Expand Down
2 changes: 1 addition & 1 deletion src/mastodon/rest/v1/admin/report-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface ReportRepository {
meta?: HttpMetaParams,
): Paginator<Admin.Report[], ListReportsParams>;

select(id: string): {
$select(id: string): {
/**
* View information about the report with the given ID.
* @return AdminReport
Expand Down
2 changes: 1 addition & 1 deletion src/mastodon/rest/v1/announcement-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface AnnouncementRepository {
*/
list(meta?: HttpMetaParams): Paginator<Announcement[]>;

select(id: string): {
$select(id: string): {
/**
* Dismiss announcement
* @return Nothing
Expand Down
2 changes: 1 addition & 1 deletion src/mastodon/rest/v1/conversation-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface ConversationRepository {
meta?: HttpMetaParams,
): Paginator<Conversation[], DefaultPaginationParams>;

select(id: string): {
$select(id: string): {
/**
* Remove conversation
* @return N/A
Expand Down
2 changes: 1 addition & 1 deletion src/mastodon/rest/v1/featured-tag-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export interface FeaturedTagRepository {
list(meta?: HttpMetaParams): Paginator<Tag[]>;
};

select(id: string): {
$select(id: string): {
/**
* Un-feature a tag
* @return N/A
Expand Down
2 changes: 1 addition & 1 deletion src/mastodon/rest/v1/filter-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export interface FilterRepository {
*/
list(meta?: HttpMetaParams): Paginator<Filter[]>;

select(id: string): {
$select(id: string): {
/**
* View a single filter
* @return Returns Filter
Expand Down
2 changes: 1 addition & 1 deletion src/mastodon/rest/v1/follow-request-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface FollowRequestRepository {
meta?: HttpMetaParams,
): Paginator<Account[], DefaultPaginationParams>;

select(id: string): {
$select(id: string): {
/**
* Accept Follow
* @return Relationship
Expand Down
2 changes: 1 addition & 1 deletion src/mastodon/rest/v1/list-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface AddListAccountsParams {
export type RemoveListAccountsParams = AddListAccountsParams;

export interface ListRepository {
select(id: string): {
$select(id: string): {
/**
* Fetch the list with the given ID. Used for verifying the title of a list.
* @return List
Expand Down
2 changes: 1 addition & 1 deletion src/mastodon/rest/v1/media-attachment-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface MediaAttachmentRepository {
meta?: HttpMetaParams<'json'>,
): Promise<MediaAttachment>;

select(id: string): {
$select(id: string): {
/**
* Fetches an attachment to be used with a new status.
* @param id ID of the attachment
Expand Down
2 changes: 1 addition & 1 deletion src/mastodon/rest/v1/notification-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface NotificationRepository {
meta?: HttpMetaParams<'json'>,
): Paginator<Notification[], ListNotificationsParams>;

select(id: string): {
$select(id: string): {
/**
* View information about a notification with a given ID.
* @return Notification
Expand Down
2 changes: 1 addition & 1 deletion src/mastodon/rest/v1/poll-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface VotePollParams {
}

export interface PollRepository {
select(id: string): {
$select(id: string): {
/**
* View a poll
* @return Poll
Expand Down
2 changes: 1 addition & 1 deletion src/mastodon/rest/v1/scheduled-status-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface ScheduledStatusRepository {
meta?: HttpMetaParams,
): Paginator<ScheduledStatus[], DefaultPaginationParams>;

select(id: string): {
$select(id: string): {
/**
* View a single scheduled status
* @return ScheduledStatus
Expand Down
2 changes: 1 addition & 1 deletion src/mastodon/rest/v1/status-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export interface StatusRepository {
meta?: HttpMetaParams<'json'>,
): Promise<ScheduledStatus>;

select(id: string): {
$select(id: string): {
/**
* View information about a status.
* @return Status
Expand Down
2 changes: 1 addition & 1 deletion src/mastodon/rest/v1/suggestion-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface SuggestionRepository {
meta?: HttpMetaParams,
): Paginator<Account[], ListSuggestionParams>;

select(id: string): {
$select(id: string): {
/**
* Remove an account from follow suggestions.
* @return N/A
Expand Down
2 changes: 1 addition & 1 deletion src/mastodon/rest/v1/tag-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { type HttpMetaParams } from '../../../interfaces';
import { type Tag } from '../../entities/v1';

export interface TagRepository {
select(id: string): {
$select(id: string): {
/**
* Show a hashtag and its associated information
* @return Tag
Expand Down
4 changes: 2 additions & 2 deletions src/mastodon/rest/v1/timeline-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export interface TimelineRepository {
};

tag: {
select(hashtag: string): {
$select(hashtag: string): {
/**
* View public statuses containing the given hashtag.
* @param hashtag Content of a #hashtag, not including # symbol.
Expand All @@ -56,7 +56,7 @@ export interface TimelineRepository {
};

list: {
select(id: string): {
$select(id: string): {
/**
* View statuses in the given list timeline.
* @param id Local ID of the list in the database.
Expand Down
6 changes: 3 additions & 3 deletions src/mastodon/rest/v2/filter-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export interface FilterRepository {
meta?: HttpMetaParams<'json'>,
): Promise<Filter>;

select(id: string): {
$select(id: string): {
/**
* Obtain a single filter group owned by the current user.
* @return Filter
Expand Down Expand Up @@ -148,7 +148,7 @@ export interface FilterRepository {
};

keywords: {
select(id: string): {
$select(id: string): {
/**
* Get one filter keyword by the given id.
* @returns FilterKeyword
Expand Down Expand Up @@ -177,7 +177,7 @@ export interface FilterRepository {
};

statuses: {
select(id: string): {
$select(id: string): {
/**
* Obtain a single status filter.
* @returns FilterStatus
Expand Down
Loading

0 comments on commit 0aa23ca

Please sign in to comment.