Merge branch 'main' into small-details-zap-split-polish
Conflicts: src/actions/admin.ts src/features/ui/index.tsx src/features/ui/util/async-components.ts src/schemas/instance.ts
This commit is contained in:
commit
5102494e5b
|
@ -37,14 +37,6 @@
|
|||
"react": {
|
||||
"version": "detect"
|
||||
},
|
||||
"import/extensions": [
|
||||
".js",
|
||||
".jsx",
|
||||
".cjs",
|
||||
".mjs",
|
||||
".ts",
|
||||
".tsx"
|
||||
],
|
||||
"import/ignore": [
|
||||
"node_modules",
|
||||
"\\.(css|scss|json)$"
|
||||
|
@ -268,17 +260,7 @@
|
|||
"jsx-a11y/role-supports-aria-props": "off",
|
||||
"jsx-a11y/scope": "warn",
|
||||
"jsx-a11y/tabindex-no-positive": "warn",
|
||||
"import/extensions": [
|
||||
"error",
|
||||
"always",
|
||||
{
|
||||
"js": "never",
|
||||
"mjs": "ignorePackages",
|
||||
"jsx": "never",
|
||||
"ts": "never",
|
||||
"tsx": "never"
|
||||
}
|
||||
],
|
||||
"import/extensions": ["error", "ignorePackages"],
|
||||
"import/newline-after-import": "error",
|
||||
"import/no-extraneous-dependencies": "error",
|
||||
"import/no-unresolved": "error",
|
||||
|
|
|
@ -18,5 +18,10 @@
|
|||
}
|
||||
],
|
||||
"scss.validate": false,
|
||||
"typescript.tsdk": "node_modules/typescript/lib"
|
||||
"typescript.tsdk": "node_modules/typescript/lib",
|
||||
"path-intellisense.extensionOnImport": true,
|
||||
"javascript.preferences.importModuleSpecifierEnding": "js",
|
||||
"javascript.preferences.importModuleSpecifier": "non-relative",
|
||||
"typescript.preferences.importModuleSpecifierEnding": "js",
|
||||
"typescript.preferences.importModuleSpecifier": "non-relative"
|
||||
}
|
||||
|
|
|
@ -21,6 +21,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<noscript>To use this website, please enable JavaScript.</noscript>
|
||||
<noscript class="text-center">To use this website, please enable JavaScript.</noscript>
|
||||
</body>
|
||||
</html>
|
35
package.json
35
package.json
|
@ -21,16 +21,15 @@
|
|||
"url": "lightning:alex@alexgleason.me"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "npx vite serve",
|
||||
"dev": "npx vite serve",
|
||||
"build": "npx vite build --emptyOutDir",
|
||||
"preview": "npx vite preview",
|
||||
"audit:fix": "npx yarn-audit-fix",
|
||||
"i18n": "npx formatjs extract 'src/**/*.{ts,tsx}' --ignore '**/*.d.ts' --out-file build/messages.json && npx formatjs compile build/messages.json --out-file src/locales/en.json",
|
||||
"test": "npx vitest",
|
||||
"start": "vite serve",
|
||||
"dev": "vite serve",
|
||||
"build": "vite build --emptyOutDir",
|
||||
"preview": "vite preview",
|
||||
"i18n": "formatjs extract 'src/**/*.{ts,tsx}' --ignore '**/*.d.ts' --out-file build/messages.json && formatjs compile build/messages.json --out-file src/locales/en.json",
|
||||
"test": "vitest",
|
||||
"lint": "npm run lint:js && npm run lint:sass",
|
||||
"lint:js": "npx eslint --ext .js,.jsx,.cjs,.mjs,.ts,.tsx . --cache",
|
||||
"lint:sass": "npx stylelint src/styles/**/*.scss",
|
||||
"lint:js": "eslint --ext .js,.jsx,.cjs,.mjs,.ts,.tsx . --cache",
|
||||
"lint:sass": "stylelint src/styles/**/*.scss",
|
||||
"prepare": "husky install"
|
||||
},
|
||||
"license": "AGPL-3.0-or-later",
|
||||
|
@ -71,7 +70,6 @@
|
|||
"@tailwindcss/forms": "^0.5.9",
|
||||
"@tailwindcss/typography": "^0.5.15",
|
||||
"@tanstack/react-query": "^5.59.13",
|
||||
"@twemoji/svg": "^15.0.0",
|
||||
"@types/escape-html": "^1.0.1",
|
||||
"@types/http-link-header": "^1.0.3",
|
||||
"@types/leaflet": "^1.8.0",
|
||||
|
@ -88,7 +86,6 @@
|
|||
"@types/react-swipeable-views": "^0.13.1",
|
||||
"@types/redux-mock-store": "^1.0.6",
|
||||
"@types/semver": "^7.3.9",
|
||||
"@vitejs/plugin-react": "^4.3.1",
|
||||
"@webbtc/webln-types": "^3.0.0",
|
||||
"autoprefixer": "^10.4.15",
|
||||
"axios": "^1.2.2",
|
||||
|
@ -100,10 +97,9 @@
|
|||
"comlink": "^4.4.1",
|
||||
"cssnano": "^6.0.0",
|
||||
"detect-passive-events": "^2.0.0",
|
||||
"emoji-datasource": "15.0.1",
|
||||
"emoji-mart": "^5.6.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"eslint-plugin-formatjs": "^4.12.2",
|
||||
"eslint-plugin-formatjs": "^5.2.2",
|
||||
"exifr": "^7.1.3",
|
||||
"graphemesplit": "^2.4.4",
|
||||
"html-react-parser": "^5.0.0",
|
||||
|
@ -131,7 +127,7 @@
|
|||
"react-helmet": "^6.1.0",
|
||||
"react-hot-toast": "^2.4.0",
|
||||
"react-inlinesvg": "^4.0.0",
|
||||
"react-intl": "^6.0.0",
|
||||
"react-intl": "^6.8.7",
|
||||
"react-motion": "^0.5.2",
|
||||
"react-overlays": "^0.9.0",
|
||||
"react-redux": "^9.0.4",
|
||||
|
@ -153,13 +149,12 @@
|
|||
"vite": "^5.4.8",
|
||||
"vite-plugin-compile-time": "^0.2.1",
|
||||
"vite-plugin-html": "^3.2.2",
|
||||
"vite-plugin-require": "^1.2.14",
|
||||
"vite-plugin-static-copy": "^1.0.6",
|
||||
"zod": "^3.23.5",
|
||||
"zustand": "^5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@formatjs/cli": "^6.2.0",
|
||||
"@formatjs/cli": "^6.3.8",
|
||||
"@gitbeaker/node": "^35.8.0",
|
||||
"@jedmao/redux-mock-store": "^3.0.5",
|
||||
"@testing-library/jest-dom": "^6.1.3",
|
||||
|
@ -168,6 +163,7 @@
|
|||
"@testing-library/user-event": "^14.5.1",
|
||||
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
||||
"@typescript-eslint/parser": "^7.0.0",
|
||||
"@vitejs/plugin-react-swc": "^3.7.1",
|
||||
"eslint": "^8.49.0",
|
||||
"eslint-import-resolver-typescript": "^3.6.0",
|
||||
"eslint-plugin-compat": "^4.2.0",
|
||||
|
@ -182,17 +178,12 @@
|
|||
"husky": "^9.0.0",
|
||||
"jsdom": "^24.0.0",
|
||||
"lint-staged": ">=10",
|
||||
"rollup-plugin-visualizer": "^5.9.2",
|
||||
"rollup-plugin-visualizer": "^5.12.0",
|
||||
"stylelint": "^16.10.0",
|
||||
"stylelint-config-standard-scss": "^13.1.0",
|
||||
"tailwindcss": "^3.4.13",
|
||||
"vite-plugin-checker": "^0.8.0",
|
||||
"vite-plugin-pwa": "^0.20.5",
|
||||
"vitest": "^2.1.1"
|
||||
},
|
||||
"resolutions": {
|
||||
"glob-parent": "^6.0.1",
|
||||
"jsonwebtoken": "^9.0.0",
|
||||
"loader-utils": "^2.0.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Gitlab } from '@gitbeaker/node';
|
||||
|
||||
import { getChanges } from './lib/changelog';
|
||||
import { getChanges } from './lib/changelog.ts';
|
||||
|
||||
const {
|
||||
CI_COMMIT_TAG,
|
||||
|
|
|
@ -1,43 +0,0 @@
|
|||
import MockAdapter from 'axios-mock-adapter';
|
||||
|
||||
import { staticClient } from 'soapbox/api';
|
||||
import { mockStore } from 'soapbox/jest/test-helpers';
|
||||
|
||||
import {
|
||||
FETCH_ABOUT_PAGE_REQUEST,
|
||||
FETCH_ABOUT_PAGE_SUCCESS,
|
||||
FETCH_ABOUT_PAGE_FAIL,
|
||||
fetchAboutPage,
|
||||
} from './about';
|
||||
|
||||
describe('fetchAboutPage()', () => {
|
||||
it('creates the expected actions on success', () => {
|
||||
|
||||
const mock = new MockAdapter(staticClient);
|
||||
|
||||
mock.onGet('/instance/about/index.html')
|
||||
.reply(200, '<h1>Hello world</h1>');
|
||||
|
||||
const expectedActions = [
|
||||
{ type: FETCH_ABOUT_PAGE_REQUEST, slug: 'index' },
|
||||
{ type: FETCH_ABOUT_PAGE_SUCCESS, slug: 'index', html: '<h1>Hello world</h1>' },
|
||||
];
|
||||
const store = mockStore({});
|
||||
|
||||
return store.dispatch(fetchAboutPage()).then(() => {
|
||||
expect(store.getActions()).toEqual(expectedActions);
|
||||
});
|
||||
});
|
||||
|
||||
it('creates the expected actions on failure', () => {
|
||||
const expectedActions = [
|
||||
{ type: FETCH_ABOUT_PAGE_REQUEST, slug: 'asdf' },
|
||||
{ type: FETCH_ABOUT_PAGE_FAIL, slug: 'asdf', error: new Error('Request failed with status code 404') },
|
||||
];
|
||||
const store = mockStore({});
|
||||
|
||||
return store.dispatch(fetchAboutPage('asdf')).catch(() => {
|
||||
expect(store.getActions()).toEqual(expectedActions);
|
||||
});
|
||||
});
|
||||
});
|
|
@ -1,7 +1,7 @@
|
|||
import api from '../api';
|
||||
import api from '../api/index.ts';
|
||||
|
||||
import type { AnyAction } from 'redux';
|
||||
import type { RootState } from 'soapbox/store';
|
||||
import type { RootState } from 'soapbox/store.ts';
|
||||
|
||||
const FETCH_ABOUT_PAGE_REQUEST = 'FETCH_ABOUT_PAGE_REQUEST';
|
||||
const FETCH_ABOUT_PAGE_SUCCESS = 'FETCH_ABOUT_PAGE_SUCCESS';
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import { __stub } from 'soapbox/api';
|
||||
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
||||
import { beforeEach, describe, expect, it } from 'vitest';
|
||||
|
||||
import { submitAccountNote } from './account-notes';
|
||||
import { __stub } from 'soapbox/api/index.ts';
|
||||
import { mockStore, rootState } from 'soapbox/jest/test-helpers.tsx';
|
||||
|
||||
import { submitAccountNote } from './account-notes.ts';
|
||||
|
||||
describe('submitAccountNote()', () => {
|
||||
let store: ReturnType<typeof mockStore>;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import api from '../api';
|
||||
import api from '../api/index.ts';
|
||||
|
||||
import type { AnyAction } from 'redux';
|
||||
import type { RootState } from 'soapbox/store';
|
||||
import type { RootState } from 'soapbox/store.ts';
|
||||
|
||||
const ACCOUNT_NOTE_SUBMIT_REQUEST = 'ACCOUNT_NOTE_SUBMIT_REQUEST';
|
||||
const ACCOUNT_NOTE_SUBMIT_SUCCESS = 'ACCOUNT_NOTE_SUBMIT_SUCCESS';
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
import { Map as ImmutableMap } from 'immutable';
|
||||
import { beforeEach, describe, expect, it } from 'vitest';
|
||||
|
||||
import { __stub } from 'soapbox/api';
|
||||
import { buildInstance, buildRelationship } from 'soapbox/jest/factory';
|
||||
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
||||
import { normalizeAccount } from 'soapbox/normalizers';
|
||||
import { ListRecord, ReducerRecord } from 'soapbox/reducers/user-lists';
|
||||
import { __stub } from 'soapbox/api/index.ts';
|
||||
import { buildInstance, buildRelationship } from 'soapbox/jest/factory.ts';
|
||||
import { mockStore, rootState } from 'soapbox/jest/test-helpers.tsx';
|
||||
import { normalizeAccount } from 'soapbox/normalizers/index.ts';
|
||||
import { ListRecord, ReducerRecord } from 'soapbox/reducers/user-lists.ts';
|
||||
|
||||
import {
|
||||
authorizeFollowRequest,
|
||||
|
@ -25,7 +26,7 @@ import {
|
|||
unblockAccount,
|
||||
unmuteAccount,
|
||||
unsubscribeAccount,
|
||||
} from './accounts';
|
||||
} from './accounts.ts';
|
||||
|
||||
let store: ReturnType<typeof mockStore>;
|
||||
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
import { importEntities } from 'soapbox/entity-store/actions';
|
||||
import { Entities } from 'soapbox/entity-store/entities';
|
||||
import { selectAccount } from 'soapbox/selectors';
|
||||
import { isLoggedIn } from 'soapbox/utils/auth';
|
||||
import { getFeatures, parseVersion, PLEROMA } from 'soapbox/utils/features';
|
||||
import { importEntities } from 'soapbox/entity-store/actions.ts';
|
||||
import { Entities } from 'soapbox/entity-store/entities.ts';
|
||||
import { selectAccount } from 'soapbox/selectors/index.ts';
|
||||
import { isLoggedIn } from 'soapbox/utils/auth.ts';
|
||||
import { getFeatures, parseVersion, PLEROMA } from 'soapbox/utils/features.ts';
|
||||
|
||||
import api, { getLinks } from '../api';
|
||||
import api, { getLinks } from '../api/index.ts';
|
||||
|
||||
import {
|
||||
importFetchedAccount,
|
||||
importFetchedAccounts,
|
||||
importErrorWhileFetchingAccountByUsername,
|
||||
} from './importer';
|
||||
} from './importer/index.ts';
|
||||
|
||||
import type { AxiosError, CancelToken } from 'axios';
|
||||
import type { Map as ImmutableMap } from 'immutable';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity, Status } from 'soapbox/types/entities';
|
||||
import type { History } from 'soapbox/types/history';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity, Status } from 'soapbox/types/entities.ts';
|
||||
import type { History } from 'soapbox/types/history.ts';
|
||||
|
||||
const ACCOUNT_CREATE_REQUEST = 'ACCOUNT_CREATE_REQUEST';
|
||||
const ACCOUNT_CREATE_SUCCESS = 'ACCOUNT_CREATE_SUCCESS';
|
||||
|
|
|
@ -1,17 +1,16 @@
|
|||
import { fetchRelationships } from 'soapbox/actions/accounts.ts';
|
||||
import { importFetchedAccount, importFetchedAccounts, importFetchedStatuses } from 'soapbox/actions/importer/index.ts';
|
||||
import { DittoInstanceCredentials } from 'soapbox/features/admin/manage-ditto-server.tsx';
|
||||
import { accountIdsToAccts } from 'soapbox/selectors/index.ts';
|
||||
import { filterBadges, getTagDiff } from 'soapbox/utils/badges.ts';
|
||||
|
||||
import { fetchRelationships } from 'soapbox/actions/accounts';
|
||||
import { importFetchedAccount, importFetchedAccounts, importFetchedStatuses } from 'soapbox/actions/importer';
|
||||
import { DittoInstanceCredentials } from 'soapbox/features/admin/manage-ditto-server';
|
||||
import { accountIdsToAccts } from 'soapbox/selectors';
|
||||
import { filterBadges, getTagDiff } from 'soapbox/utils/badges';
|
||||
import api, { getLinks } from '../api/index.ts';
|
||||
|
||||
import api, { getLinks } from '../api';
|
||||
|
||||
import { fetchInstance } from './instance';
|
||||
import { fetchInstance } from './instance.ts';
|
||||
|
||||
import type { AxiosResponse } from 'axios';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity } from 'soapbox/types/entities';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity } from 'soapbox/types/entities.ts';
|
||||
|
||||
const ADMIN_CONFIG_FETCH_REQUEST = 'ADMIN_CONFIG_FETCH_REQUEST';
|
||||
const ADMIN_CONFIG_FETCH_SUCCESS = 'ADMIN_CONFIG_FETCH_SUCCESS';
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import { defineMessages } from 'react-intl';
|
||||
|
||||
import toast from 'soapbox/toast';
|
||||
import { isLoggedIn } from 'soapbox/utils/auth';
|
||||
import { getFeatures } from 'soapbox/utils/features';
|
||||
import toast from 'soapbox/toast.tsx';
|
||||
import { isLoggedIn } from 'soapbox/utils/auth.ts';
|
||||
import { getFeatures } from 'soapbox/utils/features.ts';
|
||||
|
||||
import api from '../api';
|
||||
import api from '../api/index.ts';
|
||||
|
||||
import { importFetchedAccounts } from './importer';
|
||||
import { patchMeSuccess } from './me';
|
||||
import { importFetchedAccounts } from './importer/index.ts';
|
||||
import { patchMeSuccess } from './me.ts';
|
||||
|
||||
import type { Account } from 'soapbox/schemas';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { Account } from 'soapbox/schemas/index.ts';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
|
||||
const ALIASES_FETCH_REQUEST = 'ALIASES_FETCH_REQUEST';
|
||||
const ALIASES_FETCH_SUCCESS = 'ALIASES_FETCH_SUCCESS';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* @see module:soapbox/actions/auth
|
||||
*/
|
||||
|
||||
import { baseClient } from '../api';
|
||||
import { baseClient } from '../api/index.ts';
|
||||
|
||||
import type { AnyAction } from 'redux';
|
||||
|
||||
|
|
|
@ -9,28 +9,28 @@
|
|||
|
||||
import { defineMessages } from 'react-intl';
|
||||
|
||||
import { createAccount } from 'soapbox/actions/accounts';
|
||||
import { createApp } from 'soapbox/actions/apps';
|
||||
import { fetchMeSuccess, fetchMeFail } from 'soapbox/actions/me';
|
||||
import { obtainOAuthToken, revokeOAuthToken } from 'soapbox/actions/oauth';
|
||||
import { startOnboarding } from 'soapbox/actions/onboarding';
|
||||
import { custom } from 'soapbox/custom';
|
||||
import { queryClient } from 'soapbox/queries/client';
|
||||
import { selectAccount } from 'soapbox/selectors';
|
||||
import { unsetSentryAccount } from 'soapbox/sentry';
|
||||
import KVStore from 'soapbox/storage/kv-store';
|
||||
import toast from 'soapbox/toast';
|
||||
import { getLoggedInAccount, parseBaseURL } from 'soapbox/utils/auth';
|
||||
import sourceCode from 'soapbox/utils/code';
|
||||
import { normalizeUsername } from 'soapbox/utils/input';
|
||||
import { getScopes } from 'soapbox/utils/scopes';
|
||||
import { createAccount } from 'soapbox/actions/accounts.ts';
|
||||
import { createApp } from 'soapbox/actions/apps.ts';
|
||||
import { fetchMeSuccess, fetchMeFail } from 'soapbox/actions/me.ts';
|
||||
import { obtainOAuthToken, revokeOAuthToken } from 'soapbox/actions/oauth.ts';
|
||||
import { startOnboarding } from 'soapbox/actions/onboarding.ts';
|
||||
import { custom } from 'soapbox/custom.ts';
|
||||
import { queryClient } from 'soapbox/queries/client.ts';
|
||||
import { selectAccount } from 'soapbox/selectors/index.ts';
|
||||
import { unsetSentryAccount } from 'soapbox/sentry.ts';
|
||||
import KVStore from 'soapbox/storage/kv-store.ts';
|
||||
import toast from 'soapbox/toast.tsx';
|
||||
import { getLoggedInAccount, parseBaseURL } from 'soapbox/utils/auth.ts';
|
||||
import sourceCode from 'soapbox/utils/code.ts';
|
||||
import { normalizeUsername } from 'soapbox/utils/input.ts';
|
||||
import { getScopes } from 'soapbox/utils/scopes.ts';
|
||||
|
||||
import api, { baseClient } from '../api';
|
||||
import api, { baseClient } from '../api/index.ts';
|
||||
|
||||
import { importFetchedAccount } from './importer';
|
||||
import { importFetchedAccount } from './importer/index.ts';
|
||||
|
||||
import type { AxiosError } from 'axios';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
|
||||
export const SWITCH_ACCOUNT = 'SWITCH_ACCOUNT';
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import api from '../api';
|
||||
import api from '../api/index.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
|
||||
export const BACKUPS_FETCH_REQUEST = 'BACKUPS_FETCH_REQUEST';
|
||||
export const BACKUPS_FETCH_SUCCESS = 'BACKUPS_FETCH_SUCCESS';
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
import { __stub } from 'soapbox/api';
|
||||
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
||||
import { ListRecord, ReducerRecord as UserListsRecord } from 'soapbox/reducers/user-lists';
|
||||
import { beforeEach, describe, expect, it } from 'vitest';
|
||||
|
||||
import { expandBlocks, fetchBlocks } from './blocks';
|
||||
import { __stub } from 'soapbox/api/index.ts';
|
||||
import { mockStore, rootState } from 'soapbox/jest/test-helpers.tsx';
|
||||
import { ListRecord, ReducerRecord as UserListsRecord } from 'soapbox/reducers/user-lists.ts';
|
||||
|
||||
import { expandBlocks, fetchBlocks } from './blocks.ts';
|
||||
|
||||
const account = {
|
||||
acct: 'twoods',
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { isLoggedIn } from 'soapbox/utils/auth';
|
||||
import { isLoggedIn } from 'soapbox/utils/auth.ts';
|
||||
|
||||
import api, { getLinks } from '../api';
|
||||
import api, { getLinks } from '../api/index.ts';
|
||||
|
||||
import { fetchRelationships } from './accounts';
|
||||
import { importFetchedAccounts } from './importer';
|
||||
import { fetchRelationships } from './accounts.ts';
|
||||
import { importFetchedAccounts } from './importer/index.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
|
||||
const BLOCKS_FETCH_REQUEST = 'BLOCKS_FETCH_REQUEST';
|
||||
const BLOCKS_FETCH_SUCCESS = 'BLOCKS_FETCH_SUCCESS';
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import api, { getLinks } from '../api';
|
||||
import api, { getLinks } from '../api/index.ts';
|
||||
|
||||
import { importFetchedStatuses } from './importer';
|
||||
import { importFetchedStatuses } from './importer/index.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity } from 'soapbox/types/entities';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity } from 'soapbox/types/entities.ts';
|
||||
|
||||
const BOOKMARKED_STATUSES_FETCH_REQUEST = 'BOOKMARKED_STATUSES_FETCH_REQUEST';
|
||||
const BOOKMARKED_STATUSES_FETCH_SUCCESS = 'BOOKMARKED_STATUSES_FETCH_SUCCESS';
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { List as ImmutableList, Map as ImmutableMap } from 'immutable';
|
||||
|
||||
import { getSettings, changeSetting } from 'soapbox/actions/settings';
|
||||
import { getFeatures } from 'soapbox/utils/features';
|
||||
import { getSettings, changeSetting } from 'soapbox/actions/settings.ts';
|
||||
import { getFeatures } from 'soapbox/utils/features.ts';
|
||||
|
||||
import api, { getLinks } from '../api';
|
||||
import api, { getLinks } from '../api/index.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { History } from 'soapbox/types/history';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { History } from 'soapbox/types/history.ts';
|
||||
|
||||
const CHATS_FETCH_REQUEST = 'CHATS_FETCH_REQUEST';
|
||||
const CHATS_FETCH_SUCCESS = 'CHATS_FETCH_SUCCESS';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { AppDispatch, RootState } from 'soapbox/store';
|
||||
import { getFeatures, parseVersion } from 'soapbox/utils/features';
|
||||
import { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import { getFeatures, parseVersion } from 'soapbox/utils/features.ts';
|
||||
|
||||
import type { Status } from 'soapbox/types/entities';
|
||||
import type { Status } from 'soapbox/types/entities.ts';
|
||||
|
||||
export const COMPOSE_SET_STATUS = 'COMPOSE_SET_STATUS' as const;
|
||||
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
import { OrderedSet as ImmutableOrderedSet } from 'immutable';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import { buildInstance } from 'soapbox/jest/factory';
|
||||
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
||||
import { ReducerCompose } from 'soapbox/reducers/compose';
|
||||
import { buildInstance } from 'soapbox/jest/factory.ts';
|
||||
import { mockStore, rootState } from 'soapbox/jest/test-helpers.tsx';
|
||||
import { ReducerCompose } from 'soapbox/reducers/compose.ts';
|
||||
|
||||
import { uploadCompose, submitCompose } from './compose';
|
||||
import { STATUS_CREATE_REQUEST } from './statuses';
|
||||
import { uploadCompose, submitCompose } from './compose.ts';
|
||||
import { STATUS_CREATE_REQUEST } from './statuses.ts';
|
||||
|
||||
import type { IntlShape } from 'react-intl';
|
||||
|
||||
|
|
|
@ -3,31 +3,31 @@ import { List as ImmutableList } from 'immutable';
|
|||
import throttle from 'lodash/throttle';
|
||||
import { defineMessages, IntlShape } from 'react-intl';
|
||||
|
||||
import api from 'soapbox/api';
|
||||
import { isNativeEmoji } from 'soapbox/features/emoji';
|
||||
import emojiSearch from 'soapbox/features/emoji/search';
|
||||
import { normalizeTag } from 'soapbox/normalizers';
|
||||
import { selectAccount, selectOwnAccount } from 'soapbox/selectors';
|
||||
import { tagHistory } from 'soapbox/settings';
|
||||
import toast from 'soapbox/toast';
|
||||
import { isLoggedIn } from 'soapbox/utils/auth';
|
||||
import { getFeatures } from 'soapbox/utils/features';
|
||||
import api from 'soapbox/api/index.ts';
|
||||
import { isNativeEmoji } from 'soapbox/features/emoji/index.ts';
|
||||
import emojiSearch from 'soapbox/features/emoji/search.ts';
|
||||
import { normalizeTag } from 'soapbox/normalizers/index.ts';
|
||||
import { selectAccount, selectOwnAccount } from 'soapbox/selectors/index.ts';
|
||||
import { tagHistory } from 'soapbox/settings.ts';
|
||||
import toast from 'soapbox/toast.tsx';
|
||||
import { isLoggedIn } from 'soapbox/utils/auth.ts';
|
||||
import { getFeatures } from 'soapbox/utils/features.ts';
|
||||
|
||||
import { ComposeSetStatusAction } from './compose-status';
|
||||
import { chooseEmoji } from './emojis';
|
||||
import { importFetchedAccounts } from './importer';
|
||||
import { uploadFile, updateMedia } from './media';
|
||||
import { openModal, closeModal } from './modals';
|
||||
import { getSettings } from './settings';
|
||||
import { createStatus } from './statuses';
|
||||
import { ComposeSetStatusAction } from './compose-status.ts';
|
||||
import { chooseEmoji } from './emojis.ts';
|
||||
import { importFetchedAccounts } from './importer/index.ts';
|
||||
import { uploadFile, updateMedia } from './media.ts';
|
||||
import { openModal, closeModal } from './modals.ts';
|
||||
import { getSettings } from './settings.ts';
|
||||
import { createStatus } from './statuses.ts';
|
||||
|
||||
import type { EditorState } from 'lexical';
|
||||
import type { AutoSuggestion } from 'soapbox/components/autosuggest-input';
|
||||
import type { Emoji } from 'soapbox/features/emoji';
|
||||
import type { Account, Group } from 'soapbox/schemas';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity, Status, Tag } from 'soapbox/types/entities';
|
||||
import type { History } from 'soapbox/types/history';
|
||||
import type { AutoSuggestion } from 'soapbox/components/autosuggest-input.tsx';
|
||||
import type { Emoji } from 'soapbox/features/emoji/index.ts';
|
||||
import type { Account, Group } from 'soapbox/schemas/index.ts';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity, Status, Tag } from 'soapbox/types/entities.ts';
|
||||
import type { History } from 'soapbox/types/history.ts';
|
||||
|
||||
const { CancelToken, isCancel } = axios;
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import axios from 'axios';
|
||||
|
||||
import * as BuildConfig from 'soapbox/build-config';
|
||||
import { isURL } from 'soapbox/utils/auth';
|
||||
import sourceCode from 'soapbox/utils/code';
|
||||
import { getScopes } from 'soapbox/utils/scopes';
|
||||
import * as BuildConfig from 'soapbox/build-config.ts';
|
||||
import { isURL } from 'soapbox/utils/auth.ts';
|
||||
import sourceCode from 'soapbox/utils/code.ts';
|
||||
import { getScopes } from 'soapbox/utils/scopes.ts';
|
||||
|
||||
import { createApp } from './apps';
|
||||
import { createApp } from './apps.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
|
||||
const createProviderApp = () => {
|
||||
return async(dispatch: AppDispatch, getState: () => RootState) => {
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import { isLoggedIn } from 'soapbox/utils/auth';
|
||||
import { isLoggedIn } from 'soapbox/utils/auth.ts';
|
||||
|
||||
import api, { getLinks } from '../api';
|
||||
import api, { getLinks } from '../api/index.ts';
|
||||
|
||||
import {
|
||||
importFetchedAccounts,
|
||||
importFetchedStatuses,
|
||||
importFetchedStatus,
|
||||
} from './importer';
|
||||
} from './importer/index.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity } from 'soapbox/types/entities';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity } from 'soapbox/types/entities.ts';
|
||||
|
||||
const CONVERSATIONS_MOUNT = 'CONVERSATIONS_MOUNT';
|
||||
const CONVERSATIONS_UNMOUNT = 'CONVERSATIONS_UNMOUNT';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import api from '../api';
|
||||
import api from '../api/index.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity } from 'soapbox/types/entities';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity } from 'soapbox/types/entities.ts';
|
||||
|
||||
const CUSTOM_EMOJIS_FETCH_REQUEST = 'CUSTOM_EMOJIS_FETCH_REQUEST';
|
||||
const CUSTOM_EMOJIS_FETCH_SUCCESS = 'CUSTOM_EMOJIS_FETCH_SUCCESS';
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import api from '../api';
|
||||
import api from '../api/index.ts';
|
||||
|
||||
import { fetchRelationships } from './accounts';
|
||||
import { importFetchedAccounts } from './importer';
|
||||
import { fetchRelationships } from './accounts.ts';
|
||||
import { importFetchedAccounts } from './importer/index.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity } from 'soapbox/types/entities';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity } from 'soapbox/types/entities.ts';
|
||||
|
||||
const DIRECTORY_FETCH_REQUEST = 'DIRECTORY_FETCH_REQUEST';
|
||||
const DIRECTORY_FETCH_SUCCESS = 'DIRECTORY_FETCH_SUCCESS';
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { Entities } from 'soapbox/entity-store/entities';
|
||||
import { isLoggedIn } from 'soapbox/utils/auth';
|
||||
import { Entities } from 'soapbox/entity-store/entities.ts';
|
||||
import { isLoggedIn } from 'soapbox/utils/auth.ts';
|
||||
|
||||
import api, { getLinks } from '../api';
|
||||
import api, { getLinks } from '../api/index.ts';
|
||||
|
||||
import type { EntityStore } from 'soapbox/entity-store/types';
|
||||
import type { Account } from 'soapbox/schemas';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { EntityStore } from 'soapbox/entity-store/types.ts';
|
||||
import type { Account } from 'soapbox/schemas/index.ts';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
|
||||
const DOMAIN_BLOCK_REQUEST = 'DOMAIN_BLOCK_REQUEST';
|
||||
const DOMAIN_BLOCK_SUCCESS = 'DOMAIN_BLOCK_SUCCESS';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import api from '../api';
|
||||
import api from '../api/index.ts';
|
||||
|
||||
import type { RootState } from 'soapbox/store';
|
||||
import type { RootState } from 'soapbox/store.ts';
|
||||
|
||||
const getSubscribersCsv = () =>
|
||||
(dispatch: any, getState: () => RootState) =>
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { List as ImmutableList } from 'immutable';
|
||||
|
||||
import { isLoggedIn } from 'soapbox/utils/auth';
|
||||
import { isLoggedIn } from 'soapbox/utils/auth.ts';
|
||||
|
||||
import api from '../api';
|
||||
import api from '../api/index.ts';
|
||||
|
||||
import { importFetchedAccounts, importFetchedStatus } from './importer';
|
||||
import { favourite, unfavourite } from './interactions';
|
||||
import { importFetchedAccounts, importFetchedStatus } from './importer/index.ts';
|
||||
import { favourite, unfavourite } from './interactions.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity, EmojiReaction, Status } from 'soapbox/types/entities';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity, EmojiReaction, Status } from 'soapbox/types/entities.ts';
|
||||
|
||||
const EMOJI_REACT_REQUEST = 'EMOJI_REACT_REQUEST';
|
||||
const EMOJI_REACT_SUCCESS = 'EMOJI_REACT_SUCCESS';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { saveSettings } from './settings';
|
||||
import { saveSettings } from './settings.ts';
|
||||
|
||||
import type { Emoji } from 'soapbox/features/emoji';
|
||||
import type { AppDispatch } from 'soapbox/store';
|
||||
import type { Emoji } from 'soapbox/features/emoji/index.ts';
|
||||
import type { AppDispatch } from 'soapbox/store.ts';
|
||||
|
||||
const EMOJI_CHOOSE = 'EMOJI_CHOOSE';
|
||||
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
import { defineMessages, IntlShape } from 'react-intl';
|
||||
|
||||
import api, { getLinks } from 'soapbox/api';
|
||||
import toast from 'soapbox/toast';
|
||||
import api, { getLinks } from 'soapbox/api/index.ts';
|
||||
import toast from 'soapbox/toast.tsx';
|
||||
|
||||
import { importFetchedAccounts, importFetchedStatus, importFetchedStatuses } from './importer';
|
||||
import { uploadFile } from './media';
|
||||
import { closeModal, openModal } from './modals';
|
||||
import { importFetchedAccounts, importFetchedStatus, importFetchedStatuses } from './importer/index.ts';
|
||||
import { uploadFile } from './media.ts';
|
||||
import { closeModal, openModal } from './modals.ts';
|
||||
import {
|
||||
STATUS_FETCH_SOURCE_FAIL,
|
||||
STATUS_FETCH_SOURCE_REQUEST,
|
||||
STATUS_FETCH_SOURCE_SUCCESS,
|
||||
} from './statuses';
|
||||
} from './statuses.ts';
|
||||
|
||||
import type { ReducerStatus } from 'soapbox/reducers/statuses';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity, Status as StatusEntity } from 'soapbox/types/entities';
|
||||
import type { ReducerStatus } from 'soapbox/reducers/statuses.ts';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity, Status as StatusEntity } from 'soapbox/types/entities.ts';
|
||||
|
||||
const LOCATION_SEARCH_REQUEST = 'LOCATION_SEARCH_REQUEST' as const;
|
||||
const LOCATION_SEARCH_SUCCESS = 'LOCATION_SEARCH_SUCCESS' as const;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { defineMessages } from 'react-intl';
|
||||
|
||||
import api, { getLinks } from 'soapbox/api';
|
||||
import { normalizeAccount } from 'soapbox/normalizers';
|
||||
import toast from 'soapbox/toast';
|
||||
import api, { getLinks } from 'soapbox/api/index.ts';
|
||||
import { normalizeAccount } from 'soapbox/normalizers/index.ts';
|
||||
import toast from 'soapbox/toast.tsx';
|
||||
|
||||
import type { AxiosResponse } from 'axios';
|
||||
import type { RootState } from 'soapbox/store';
|
||||
import type { RootState } from 'soapbox/store.ts';
|
||||
|
||||
export const EXPORT_FOLLOWS_REQUEST = 'EXPORT_FOLLOWS_REQUEST';
|
||||
export const EXPORT_FOLLOWS_SUCCESS = 'EXPORT_FOLLOWS_SUCCESS';
|
||||
|
|
|
@ -6,17 +6,17 @@
|
|||
* @see module:soapbox/actions/oauth
|
||||
*/
|
||||
|
||||
import { createApp } from 'soapbox/actions/apps';
|
||||
import { authLoggedIn, verifyCredentials, switchAccount } from 'soapbox/actions/auth';
|
||||
import { obtainOAuthToken } from 'soapbox/actions/oauth';
|
||||
import { InstanceV1, instanceV1Schema } from 'soapbox/schemas/instance';
|
||||
import { parseBaseURL } from 'soapbox/utils/auth';
|
||||
import sourceCode from 'soapbox/utils/code';
|
||||
import { getInstanceScopes } from 'soapbox/utils/scopes';
|
||||
import { createApp } from 'soapbox/actions/apps.ts';
|
||||
import { authLoggedIn, verifyCredentials, switchAccount } from 'soapbox/actions/auth.ts';
|
||||
import { obtainOAuthToken } from 'soapbox/actions/oauth.ts';
|
||||
import { InstanceV1, instanceV1Schema } from 'soapbox/schemas/instance.ts';
|
||||
import { parseBaseURL } from 'soapbox/utils/auth.ts';
|
||||
import sourceCode from 'soapbox/utils/code.ts';
|
||||
import { getInstanceScopes } from 'soapbox/utils/scopes.ts';
|
||||
|
||||
import { baseClient } from '../api';
|
||||
import { baseClient } from '../api/index.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
|
||||
const fetchExternalInstance = (baseURL?: string) => {
|
||||
return baseClient(null, baseURL)
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { AppDispatch, RootState } from 'soapbox/store';
|
||||
import { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
|
||||
import api from '../api';
|
||||
import api from '../api/index.ts';
|
||||
|
||||
import { fetchRelationships } from './accounts';
|
||||
import { importFetchedAccounts } from './importer';
|
||||
import { fetchRelationships } from './accounts.ts';
|
||||
import { importFetchedAccounts } from './importer/index.ts';
|
||||
|
||||
import type { APIEntity } from 'soapbox/types/entities';
|
||||
import type { APIEntity } from 'soapbox/types/entities.ts';
|
||||
|
||||
export const FAMILIAR_FOLLOWERS_FETCH_REQUEST = 'FAMILIAR_FOLLOWERS_FETCH_REQUEST';
|
||||
export const FAMILIAR_FOLLOWERS_FETCH_SUCCESS = 'FAMILIAR_FOLLOWERS_FETCH_SUCCESS';
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { isLoggedIn } from 'soapbox/utils/auth';
|
||||
import { isLoggedIn } from 'soapbox/utils/auth.ts';
|
||||
|
||||
import api, { getLinks } from '../api';
|
||||
import api, { getLinks } from '../api/index.ts';
|
||||
|
||||
import { importFetchedStatuses } from './importer';
|
||||
import { importFetchedStatuses } from './importer/index.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity } from 'soapbox/types/entities';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity } from 'soapbox/types/entities.ts';
|
||||
|
||||
const FAVOURITED_STATUSES_FETCH_REQUEST = 'FAVOURITED_STATUSES_FETCH_REQUEST';
|
||||
const FAVOURITED_STATUSES_FETCH_SUCCESS = 'FAVOURITED_STATUSES_FETCH_SUCCESS';
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { defineMessages } from 'react-intl';
|
||||
|
||||
import toast from 'soapbox/toast';
|
||||
import { isLoggedIn } from 'soapbox/utils/auth';
|
||||
import { getFeatures } from 'soapbox/utils/features';
|
||||
import toast from 'soapbox/toast.tsx';
|
||||
import { isLoggedIn } from 'soapbox/utils/auth.ts';
|
||||
import { getFeatures } from 'soapbox/utils/features.ts';
|
||||
|
||||
import api from '../api';
|
||||
import api from '../api/index.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
|
||||
const FILTERS_FETCH_REQUEST = 'FILTERS_FETCH_REQUEST';
|
||||
const FILTERS_FETCH_SUCCESS = 'FILTERS_FETCH_SUCCESS';
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import { deleteEntities } from 'soapbox/entity-store/actions';
|
||||
import { deleteEntities } from 'soapbox/entity-store/actions.ts';
|
||||
|
||||
import api, { getLinks } from '../api';
|
||||
import api, { getLinks } from '../api/index.ts';
|
||||
|
||||
import { fetchRelationships } from './accounts';
|
||||
import { importFetchedGroups, importFetchedAccounts } from './importer';
|
||||
import { fetchRelationships } from './accounts.ts';
|
||||
import { importFetchedGroups, importFetchedAccounts } from './importer/index.ts';
|
||||
|
||||
import type { GroupRole } from 'soapbox/reducers/group-memberships';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity } from 'soapbox/types/entities';
|
||||
import type { GroupRole } from 'soapbox/reducers/group-memberships.ts';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity } from 'soapbox/types/entities.ts';
|
||||
|
||||
const GROUP_CREATE_REQUEST = 'GROUP_CREATE_REQUEST';
|
||||
const GROUP_CREATE_SUCCESS = 'GROUP_CREATE_SUCCESS';
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import api from 'soapbox/api';
|
||||
import api from 'soapbox/api/index.ts';
|
||||
|
||||
import { importFetchedAccounts } from './importer';
|
||||
import { importFetchedAccounts } from './importer/index.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity } from 'soapbox/types/entities';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity } from 'soapbox/types/entities.ts';
|
||||
|
||||
const HISTORY_FETCH_REQUEST = 'HISTORY_FETCH_REQUEST';
|
||||
const HISTORY_FETCH_SUCCESS = 'HISTORY_FETCH_SUCCESS';
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { defineMessages } from 'react-intl';
|
||||
|
||||
import toast from 'soapbox/toast';
|
||||
import toast from 'soapbox/toast.tsx';
|
||||
|
||||
import api from '../api';
|
||||
import api from '../api/index.ts';
|
||||
|
||||
import type { RootState } from 'soapbox/store';
|
||||
import type { RootState } from 'soapbox/store.ts';
|
||||
|
||||
export const IMPORT_FOLLOWS_REQUEST = 'IMPORT_FOLLOWS_REQUEST';
|
||||
export const IMPORT_FOLLOWS_SUCCESS = 'IMPORT_FOLLOWS_SUCCESS';
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { importEntities } from 'soapbox/entity-store/actions';
|
||||
import { Entities } from 'soapbox/entity-store/entities';
|
||||
import { Group, accountSchema, groupSchema } from 'soapbox/schemas';
|
||||
import { filteredArray } from 'soapbox/schemas/utils';
|
||||
import { importEntities } from 'soapbox/entity-store/actions.ts';
|
||||
import { Entities } from 'soapbox/entity-store/entities.ts';
|
||||
import { Group, accountSchema, groupSchema } from 'soapbox/schemas/index.ts';
|
||||
import { filteredArray } from 'soapbox/schemas/utils.ts';
|
||||
|
||||
import { getSettings } from '../settings';
|
||||
import { getSettings } from '../settings.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity } from 'soapbox/types/entities';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity } from 'soapbox/types/entities.ts';
|
||||
|
||||
const ACCOUNT_IMPORT = 'ACCOUNT_IMPORT';
|
||||
const ACCOUNTS_IMPORT = 'ACCOUNTS_IMPORT';
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { createAsyncThunk } from '@reduxjs/toolkit';
|
||||
|
||||
import { instanceV1Schema, instanceV2Schema } from 'soapbox/schemas/instance';
|
||||
import { RootState } from 'soapbox/store';
|
||||
import { getAuthUserUrl, getMeUrl } from 'soapbox/utils/auth';
|
||||
import { getFeatures } from 'soapbox/utils/features';
|
||||
import { instanceV1Schema, instanceV2Schema } from 'soapbox/schemas/instance.ts';
|
||||
import { RootState } from 'soapbox/store.ts';
|
||||
import { getAuthUserUrl, getMeUrl } from 'soapbox/utils/auth.ts';
|
||||
import { getFeatures } from 'soapbox/utils/features.ts';
|
||||
|
||||
import api from '../api';
|
||||
import api from '../api/index.ts';
|
||||
|
||||
/** Figure out the appropriate instance to fetch depending on the state */
|
||||
export const getHost = (state: RootState) => {
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
import { defineMessages } from 'react-intl';
|
||||
|
||||
import toast, { type IToastOptions } from 'soapbox/toast';
|
||||
import { isLoggedIn } from 'soapbox/utils/auth';
|
||||
import { getFeatures } from 'soapbox/utils/features';
|
||||
import toast, { type IToastOptions } from 'soapbox/toast.tsx';
|
||||
import { isLoggedIn } from 'soapbox/utils/auth.ts';
|
||||
import { getFeatures } from 'soapbox/utils/features.ts';
|
||||
|
||||
import api, { getLinks } from '../api';
|
||||
import api, { getLinks } from '../api/index.ts';
|
||||
|
||||
import { fetchRelationships } from './accounts';
|
||||
import { importFetchedAccounts, importFetchedStatus } from './importer';
|
||||
import { openModal } from './modals';
|
||||
import { expandGroupFeaturedTimeline } from './timelines';
|
||||
import { fetchRelationships } from './accounts.ts';
|
||||
import { importFetchedAccounts, importFetchedStatus } from './importer/index.ts';
|
||||
import { openModal } from './modals.ts';
|
||||
import { expandGroupFeaturedTimeline } from './timelines.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { Account as AccountEntity, APIEntity, Group, Status as StatusEntity } from 'soapbox/types/entities';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { Account as AccountEntity, APIEntity, Group, Status as StatusEntity } from 'soapbox/types/entities.ts';
|
||||
|
||||
const REBLOG_REQUEST = 'REBLOG_REQUEST';
|
||||
const REBLOG_SUCCESS = 'REBLOG_SUCCESS';
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import { selectAccount } from 'soapbox/selectors';
|
||||
import toast from 'soapbox/toast';
|
||||
import { isLoggedIn } from 'soapbox/utils/auth';
|
||||
import { selectAccount } from 'soapbox/selectors/index.ts';
|
||||
import toast from 'soapbox/toast.tsx';
|
||||
import { isLoggedIn } from 'soapbox/utils/auth.ts';
|
||||
|
||||
import api from '../api';
|
||||
import api from '../api/index.ts';
|
||||
|
||||
import { importFetchedAccounts } from './importer';
|
||||
import { importFetchedAccounts } from './importer/index.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity } from 'soapbox/types/entities';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity } from 'soapbox/types/entities.ts';
|
||||
|
||||
const LIST_FETCH_REQUEST = 'LIST_FETCH_REQUEST';
|
||||
const LIST_FETCH_SUCCESS = 'LIST_FETCH_SUCCESS';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import api from '../api';
|
||||
import api from '../api/index.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity } from 'soapbox/types/entities';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity } from 'soapbox/types/entities.ts';
|
||||
|
||||
const MARKER_FETCH_REQUEST = 'MARKER_FETCH_REQUEST';
|
||||
const MARKER_FETCH_SUCCESS = 'MARKER_FETCH_SUCCESS';
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
import { selectAccount } from 'soapbox/selectors';
|
||||
import { setSentryAccount } from 'soapbox/sentry';
|
||||
import KVStore from 'soapbox/storage/kv-store';
|
||||
import { getAuthUserId, getAuthUserUrl } from 'soapbox/utils/auth';
|
||||
import { selectAccount } from 'soapbox/selectors/index.ts';
|
||||
import { setSentryAccount } from 'soapbox/sentry.ts';
|
||||
import KVStore from 'soapbox/storage/kv-store.ts';
|
||||
import { getAuthUserId, getAuthUserUrl } from 'soapbox/utils/auth.ts';
|
||||
|
||||
import api from '../api';
|
||||
import api from '../api/index.ts';
|
||||
|
||||
import { loadCredentials } from './auth';
|
||||
import { importFetchedAccount } from './importer';
|
||||
import { loadCredentials } from './auth.ts';
|
||||
import { importFetchedAccount } from './importer/index.ts';
|
||||
|
||||
import type { RawAxiosRequestHeaders } from 'axios';
|
||||
import type { Account } from 'soapbox/schemas';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity } from 'soapbox/types/entities';
|
||||
import type { Account } from 'soapbox/schemas/index.ts';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity } from 'soapbox/types/entities.ts';
|
||||
|
||||
const ME_FETCH_REQUEST = 'ME_FETCH_REQUEST' as const;
|
||||
const ME_FETCH_SUCCESS = 'ME_FETCH_SUCCESS' as const;
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import { defineMessages, type IntlShape } from 'react-intl';
|
||||
|
||||
import toast from 'soapbox/toast';
|
||||
import { isLoggedIn } from 'soapbox/utils/auth';
|
||||
import { getFeatures } from 'soapbox/utils/features';
|
||||
import { formatBytes, getVideoDuration } from 'soapbox/utils/media';
|
||||
import resizeImage from 'soapbox/utils/resize-image';
|
||||
import toast from 'soapbox/toast.tsx';
|
||||
import { isLoggedIn } from 'soapbox/utils/auth.ts';
|
||||
import { getFeatures } from 'soapbox/utils/features.ts';
|
||||
import { formatBytes, getVideoDuration } from 'soapbox/utils/media.ts';
|
||||
import resizeImage from 'soapbox/utils/resize-image.ts';
|
||||
|
||||
import api from '../api';
|
||||
import api from '../api/index.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity } from 'soapbox/types/entities';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity } from 'soapbox/types/entities.ts';
|
||||
|
||||
const messages = defineMessages({
|
||||
exceededImageSizeLimit: { id: 'upload_error.image_size_limit', defaultMessage: 'Image exceeds the current file size limit ({limit})' },
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import api from '../api';
|
||||
import api from '../api/index.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
|
||||
const MFA_FETCH_REQUEST = 'MFA_FETCH_REQUEST';
|
||||
const MFA_FETCH_SUCCESS = 'MFA_FETCH_SUCCESS';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { AppDispatch } from 'soapbox/store';
|
||||
import { AppDispatch } from 'soapbox/store.ts';
|
||||
|
||||
import type { ModalType } from 'soapbox/features/ui/components/modal-root';
|
||||
import type { ModalType } from 'soapbox/features/ui/components/modal-root.tsx';
|
||||
|
||||
export const MODAL_OPEN = 'MODAL_OPEN';
|
||||
export const MODAL_CLOSE = 'MODAL_CLOSE';
|
||||
|
|
|
@ -1,16 +1,20 @@
|
|||
import React from 'react';
|
||||
import alertTriangleIcon from '@tabler/icons/outline/alert-triangle.svg';
|
||||
import trashIcon from '@tabler/icons/outline/trash.svg';
|
||||
import userMinusIcon from '@tabler/icons/outline/user-minus.svg';
|
||||
import userOffIcon from '@tabler/icons/outline/user-off.svg';
|
||||
import { defineMessages, IntlShape } from 'react-intl';
|
||||
|
||||
import { fetchAccountByUsername } from 'soapbox/actions/accounts';
|
||||
import { deactivateUsers, deleteUser, deleteStatus, toggleStatusSensitivity } from 'soapbox/actions/admin';
|
||||
import { openModal } from 'soapbox/actions/modals';
|
||||
import OutlineBox from 'soapbox/components/outline-box';
|
||||
import { Stack, Text } from 'soapbox/components/ui';
|
||||
import AccountContainer from 'soapbox/containers/account-container';
|
||||
import { selectAccount } from 'soapbox/selectors';
|
||||
import toast from 'soapbox/toast';
|
||||
import { fetchAccountByUsername } from 'soapbox/actions/accounts.ts';
|
||||
import { deactivateUsers, deleteUser, deleteStatus, toggleStatusSensitivity } from 'soapbox/actions/admin.ts';
|
||||
import { openModal } from 'soapbox/actions/modals.ts';
|
||||
import OutlineBox from 'soapbox/components/outline-box.tsx';
|
||||
import Stack from 'soapbox/components/ui/stack.tsx';
|
||||
import Text from 'soapbox/components/ui/text.tsx';
|
||||
import AccountContainer from 'soapbox/containers/account-container.tsx';
|
||||
import { selectAccount } from 'soapbox/selectors/index.ts';
|
||||
import toast from 'soapbox/toast.tsx';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
|
||||
const messages = defineMessages({
|
||||
deactivateUserHeading: { id: 'confirmations.admin.deactivate_user.heading', defaultMessage: 'Deactivate @{acct}' },
|
||||
|
@ -58,7 +62,7 @@ const deactivateUserModal = (intl: IntlShape, accountId: string, afterConfirm =
|
|||
);
|
||||
|
||||
dispatch(openModal('CONFIRM', {
|
||||
icon: require('@tabler/icons/outline/user-off.svg'),
|
||||
icon: userOffIcon,
|
||||
heading: intl.formatMessage(messages.deactivateUserHeading, { acct }),
|
||||
message,
|
||||
confirm: intl.formatMessage(messages.deactivateUserConfirm, { name }),
|
||||
|
@ -96,7 +100,7 @@ const deleteUserModal = (intl: IntlShape, accountId: string, afterConfirm = () =
|
|||
const checkbox = local ? intl.formatMessage(messages.deleteLocalUserCheckbox) : false;
|
||||
|
||||
dispatch(openModal('CONFIRM', {
|
||||
icon: require('@tabler/icons/outline/user-minus.svg'),
|
||||
icon: userMinusIcon,
|
||||
heading: intl.formatMessage(messages.deleteUserHeading, { acct }),
|
||||
message,
|
||||
confirm,
|
||||
|
@ -118,7 +122,7 @@ const toggleStatusSensitivityModal = (intl: IntlShape, statusId: string, sensiti
|
|||
const acct = state.statuses.get(statusId)!.account.acct;
|
||||
|
||||
dispatch(openModal('CONFIRM', {
|
||||
icon: require('@tabler/icons/outline/alert-triangle.svg'),
|
||||
icon: alertTriangleIcon,
|
||||
heading: intl.formatMessage(sensitive === false ? messages.markStatusSensitiveHeading : messages.markStatusNotSensitiveHeading),
|
||||
message: intl.formatMessage(sensitive === false ? messages.markStatusSensitivePrompt : messages.markStatusNotSensitivePrompt, { acct }),
|
||||
confirm: intl.formatMessage(sensitive === false ? messages.markStatusSensitiveConfirm : messages.markStatusNotSensitiveConfirm),
|
||||
|
@ -138,7 +142,7 @@ const deleteStatusModal = (intl: IntlShape, statusId: string, afterConfirm = ()
|
|||
const acct = state.statuses.get(statusId)!.account.acct;
|
||||
|
||||
dispatch(openModal('CONFIRM', {
|
||||
icon: require('@tabler/icons/outline/trash.svg'),
|
||||
icon: trashIcon,
|
||||
heading: intl.formatMessage(messages.deleteStatusHeading),
|
||||
message: intl.formatMessage(messages.deleteStatusPrompt, { acct: <strong className='break-words'>{acct}</strong> }),
|
||||
confirm: intl.formatMessage(messages.deleteStatusConfirm),
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { Set as ImmutableSet } from 'immutable';
|
||||
|
||||
import ConfigDB from 'soapbox/utils/config-db';
|
||||
import ConfigDB from 'soapbox/utils/config-db.ts';
|
||||
|
||||
import { fetchConfig, updateConfig } from './admin';
|
||||
import { fetchConfig, updateConfig } from './admin.ts';
|
||||
|
||||
import type { MRFSimple } from 'soapbox/schemas/pleroma';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { MRFSimple } from 'soapbox/schemas/pleroma.ts';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
|
||||
const simplePolicyMerge = (simplePolicy: MRFSimple, host: string, restrictions: Record<string, any>) => {
|
||||
const entries = Object.entries(simplePolicy).map(([key, hosts]) => {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { openModal } from './modals';
|
||||
import { openModal } from './modals.ts';
|
||||
|
||||
import type { Account } from 'soapbox/schemas';
|
||||
import type { AppDispatch } from 'soapbox/store';
|
||||
import type { Account as AccountEntity } from 'soapbox/types/entities';
|
||||
import type { Account } from 'soapbox/schemas/index.ts';
|
||||
import type { AppDispatch } from 'soapbox/store.ts';
|
||||
import type { Account as AccountEntity } from 'soapbox/types/entities.ts';
|
||||
|
||||
const MUTES_INIT_MODAL = 'MUTES_INIT_MODAL';
|
||||
const MUTES_TOGGLE_HIDE_NOTIFICATIONS = 'MUTES_TOGGLE_HIDE_NOTIFICATIONS';
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import { NostrSigner, NRelay1, NSecSigner } from '@nostrify/nostrify';
|
||||
import { generateSecretKey } from 'nostr-tools';
|
||||
|
||||
import { NBunker } from 'soapbox/features/nostr/NBunker';
|
||||
import { keyring } from 'soapbox/features/nostr/keyring';
|
||||
import { useBunkerStore } from 'soapbox/hooks/nostr/useBunkerStore';
|
||||
import { type AppDispatch } from 'soapbox/store';
|
||||
import { NBunker } from 'soapbox/features/nostr/NBunker.ts';
|
||||
import { keyring } from 'soapbox/features/nostr/keyring.ts';
|
||||
import { useBunkerStore } from 'soapbox/hooks/nostr/useBunkerStore.ts';
|
||||
import { type AppDispatch } from 'soapbox/store.ts';
|
||||
|
||||
import { authLoggedIn, verifyCredentials } from './auth';
|
||||
import { obtainOAuthToken } from './oauth';
|
||||
import { authLoggedIn, verifyCredentials } from './auth.ts';
|
||||
import { obtainOAuthToken } from './oauth.ts';
|
||||
|
||||
const NOSTR_PUBKEY_SET = 'NOSTR_PUBKEY_SET';
|
||||
|
||||
|
@ -64,8 +64,6 @@ function logInNostr(signer: NostrSigner, relay: NRelay1) {
|
|||
});
|
||||
|
||||
await dispatch(verifyCredentials(accessToken));
|
||||
|
||||
// TODO: get rid of `vite-plugin-require` and switch to `using` for the bunker. :(
|
||||
bunker.close();
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
import { OrderedMap as ImmutableOrderedMap } from 'immutable';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { __stub } from 'soapbox/api';
|
||||
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
||||
import { normalizeNotification } from 'soapbox/normalizers';
|
||||
import { __stub } from 'soapbox/api/index.ts';
|
||||
import { mockStore, rootState } from 'soapbox/jest/test-helpers.tsx';
|
||||
import { normalizeNotification } from 'soapbox/normalizers/index.ts';
|
||||
|
||||
import { markReadNotifications } from './notifications';
|
||||
import { markReadNotifications } from './notifications.ts';
|
||||
|
||||
describe('markReadNotifications()', () => {
|
||||
it('fires off marker when top notification is newer than lastRead', async() => {
|
||||
|
|
|
@ -2,28 +2,27 @@ import IntlMessageFormat from 'intl-messageformat';
|
|||
import 'intl-pluralrules';
|
||||
import { defineMessages } from 'react-intl';
|
||||
|
||||
import api, { getLinks } from 'soapbox/api';
|
||||
import { getFilters, regexFromFilters } from 'soapbox/selectors';
|
||||
import { isLoggedIn } from 'soapbox/utils/auth';
|
||||
import { compareId } from 'soapbox/utils/comparators';
|
||||
import { getFeatures, parseVersion, PLEROMA } from 'soapbox/utils/features';
|
||||
import { unescapeHTML } from 'soapbox/utils/html';
|
||||
import { EXCLUDE_TYPES, NOTIFICATION_TYPES } from 'soapbox/utils/notification';
|
||||
import { joinPublicPath } from 'soapbox/utils/static';
|
||||
import api, { getLinks } from 'soapbox/api/index.ts';
|
||||
import { getFilters, regexFromFilters } from 'soapbox/selectors/index.ts';
|
||||
import { isLoggedIn } from 'soapbox/utils/auth.ts';
|
||||
import { compareId } from 'soapbox/utils/comparators.ts';
|
||||
import { getFeatures, parseVersion, PLEROMA } from 'soapbox/utils/features.ts';
|
||||
import { unescapeHTML } from 'soapbox/utils/html.ts';
|
||||
import { EXCLUDE_TYPES, NOTIFICATION_TYPES } from 'soapbox/utils/notification.ts';
|
||||
|
||||
import { fetchRelationships } from './accounts';
|
||||
import { fetchGroupRelationships } from './groups';
|
||||
import { fetchRelationships } from './accounts.ts';
|
||||
import { fetchGroupRelationships } from './groups.ts';
|
||||
import {
|
||||
importFetchedAccount,
|
||||
importFetchedAccounts,
|
||||
importFetchedStatus,
|
||||
importFetchedStatuses,
|
||||
} from './importer';
|
||||
import { saveMarker } from './markers';
|
||||
import { getSettings, saveSettings } from './settings';
|
||||
} from './importer/index.ts';
|
||||
import { saveMarker } from './markers.ts';
|
||||
import { getSettings, saveSettings } from './settings.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity, Status } from 'soapbox/types/entities';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity, Status } from 'soapbox/types/entities.ts';
|
||||
|
||||
const NOTIFICATIONS_UPDATE = 'NOTIFICATIONS_UPDATE';
|
||||
const NOTIFICATIONS_UPDATE_NOOP = 'NOTIFICATIONS_UPDATE_NOOP';
|
||||
|
@ -120,7 +119,7 @@ const updateNotificationsQueue = (notification: APIEntity, intlMessages: Record<
|
|||
icon: notification.account.avatar,
|
||||
tag: notification.id,
|
||||
data: {
|
||||
url: joinPublicPath('/notifications'),
|
||||
url: '/notifications',
|
||||
},
|
||||
}).catch(console.error);
|
||||
}).catch(console.error);
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
* @see module:soapbox/actions/auth
|
||||
*/
|
||||
|
||||
import { getBaseURL } from 'soapbox/utils/state';
|
||||
import { getBaseURL } from 'soapbox/utils/state.ts';
|
||||
|
||||
import { baseClient } from '../api';
|
||||
import { baseClient } from '../api/index.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
|
||||
export const OAUTH_TOKEN_CREATE_REQUEST = 'OAUTH_TOKEN_CREATE_REQUEST';
|
||||
export const OAUTH_TOKEN_CREATE_SUCCESS = 'OAUTH_TOKEN_CREATE_SUCCESS';
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import { mockStore, mockWindowProperty, rootState } from 'soapbox/jest/test-helpers';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import { checkOnboardingStatus, startOnboarding, endOnboarding } from './onboarding';
|
||||
import { mockStore, mockWindowProperty, rootState } from 'soapbox/jest/test-helpers.tsx';
|
||||
|
||||
import { checkOnboardingStatus, startOnboarding, endOnboarding } from './onboarding.ts';
|
||||
|
||||
describe('checkOnboarding()', () => {
|
||||
let mockGetItem: any;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import api from '../api';
|
||||
import api from '../api/index.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity } from 'soapbox/types/entities';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity } from 'soapbox/types/entities.ts';
|
||||
|
||||
const PATRON_INSTANCE_FETCH_REQUEST = 'PATRON_INSTANCE_FETCH_REQUEST';
|
||||
const PATRON_INSTANCE_FETCH_SUCCESS = 'PATRON_INSTANCE_FETCH_SUCCESS';
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { isLoggedIn } from 'soapbox/utils/auth';
|
||||
import { isLoggedIn } from 'soapbox/utils/auth.ts';
|
||||
|
||||
import api from '../api';
|
||||
import api from '../api/index.ts';
|
||||
|
||||
import { importFetchedStatuses } from './importer';
|
||||
import { importFetchedStatuses } from './importer/index.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity } from 'soapbox/types/entities';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity } from 'soapbox/types/entities.ts';
|
||||
|
||||
const PINNED_STATUSES_FETCH_REQUEST = 'PINNED_STATUSES_FETCH_REQUEST';
|
||||
const PINNED_STATUSES_FETCH_SUCCESS = 'PINNED_STATUSES_FETCH_SUCCESS';
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import api from '../api';
|
||||
import api from '../api/index.ts';
|
||||
|
||||
import { importFetchedPoll } from './importer';
|
||||
import { importFetchedPoll } from './importer/index.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity } from 'soapbox/types/entities';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity } from 'soapbox/types/entities.ts';
|
||||
|
||||
const POLL_VOTE_REQUEST = 'POLL_VOTE_REQUEST';
|
||||
const POLL_VOTE_SUCCESS = 'POLL_VOTE_SUCCESS';
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
import { __stub } from 'soapbox/api';
|
||||
import { mockStore } from 'soapbox/jest/test-helpers';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { VERIFY_CREDENTIALS_REQUEST } from './auth';
|
||||
import { ACCOUNTS_IMPORT } from './importer';
|
||||
import { __stub } from 'soapbox/api/index.ts';
|
||||
import { mockStore } from 'soapbox/jest/test-helpers.tsx';
|
||||
|
||||
import { VERIFY_CREDENTIALS_REQUEST } from './auth.ts';
|
||||
import { ACCOUNTS_IMPORT } from './importer/index.ts';
|
||||
import {
|
||||
MASTODON_PRELOAD_IMPORT,
|
||||
preloadMastodon,
|
||||
} from './preload';
|
||||
} from './preload.ts';
|
||||
|
||||
describe('preloadMastodon()', () => {
|
||||
it('creates the expected actions', async () => {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import mapValues from 'lodash/mapValues';
|
||||
|
||||
import { verifyCredentials } from './auth';
|
||||
import { importFetchedAccounts } from './importer';
|
||||
import { verifyCredentials } from './auth.ts';
|
||||
import { importFetchedAccounts } from './importer/index.ts';
|
||||
|
||||
import type { AppDispatch } from 'soapbox/store';
|
||||
import type { AppDispatch } from 'soapbox/store.ts';
|
||||
|
||||
const PLEROMA_PRELOAD_IMPORT = 'PLEROMA_PRELOAD_IMPORT';
|
||||
const MASTODON_PRELOAD_IMPORT = 'MASTODON_PRELOAD_IMPORT';
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/* eslint-disable compat/compat */
|
||||
import { HTTPError } from 'soapbox/api/HTTPError';
|
||||
import { MastodonClient } from 'soapbox/api/MastodonClient';
|
||||
import { WebPushSubscription, webPushSubscriptionSchema } from 'soapbox/schemas/web-push';
|
||||
import { decodeBase64Url } from 'soapbox/utils/base64';
|
||||
import { HTTPError } from 'soapbox/api/HTTPError.ts';
|
||||
import { MastodonClient } from 'soapbox/api/MastodonClient.ts';
|
||||
import { WebPushSubscription, webPushSubscriptionSchema } from 'soapbox/schemas/web-push.ts';
|
||||
import { decodeBase64Url } from 'soapbox/utils/base64.ts';
|
||||
|
||||
// Last one checks for payload support: https://web-push-book.gauntface.com/chapter-06/01-non-standards-browsers/#no-payload
|
||||
const supportsPushNotifications = ('serviceWorker' in navigator && 'PushManager' in window && 'getKey' in PushSubscription.prototype);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { getSettings, changeSetting } from 'soapbox/actions/settings';
|
||||
import { getSettings, changeSetting } from 'soapbox/actions/settings.ts';
|
||||
|
||||
import type { List as ImmutableList, OrderedSet as ImmutableOrderedSet } from 'immutable';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
|
||||
const getPinnedHosts = (state: RootState) => {
|
||||
const settings = getSettings(state);
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import api from '../api';
|
||||
import api from '../api/index.ts';
|
||||
|
||||
import { openModal } from './modals';
|
||||
import { openModal } from './modals.ts';
|
||||
|
||||
import type { Account } from 'soapbox/schemas';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { ChatMessage, Group, Status } from 'soapbox/types/entities';
|
||||
import type { Account } from 'soapbox/schemas/index.ts';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { ChatMessage, Group, Status } from 'soapbox/types/entities.ts';
|
||||
|
||||
const REPORT_INIT = 'REPORT_INIT';
|
||||
const REPORT_CANCEL = 'REPORT_CANCEL';
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { getFeatures } from 'soapbox/utils/features';
|
||||
import { getFeatures } from 'soapbox/utils/features.ts';
|
||||
|
||||
import api, { getLinks } from '../api';
|
||||
import api, { getLinks } from '../api/index.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity } from 'soapbox/types/entities';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity } from 'soapbox/types/entities.ts';
|
||||
|
||||
const SCHEDULED_STATUSES_FETCH_REQUEST = 'SCHEDULED_STATUSES_FETCH_REQUEST';
|
||||
const SCHEDULED_STATUSES_FETCH_SUCCESS = 'SCHEDULED_STATUSES_FETCH_SUCCESS';
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import api, { getLinks } from '../api';
|
||||
import api, { getLinks } from '../api/index.ts';
|
||||
|
||||
import { fetchRelationships } from './accounts';
|
||||
import { importFetchedAccounts, importFetchedStatuses } from './importer';
|
||||
import { fetchRelationships } from './accounts.ts';
|
||||
import { importFetchedAccounts, importFetchedStatuses } from './importer/index.ts';
|
||||
|
||||
import type { SearchFilter } from 'soapbox/reducers/search';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity } from 'soapbox/types/entities';
|
||||
import type { SearchFilter } from 'soapbox/reducers/search.ts';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity } from 'soapbox/types/entities.ts';
|
||||
|
||||
const SEARCH_CHANGE = 'SEARCH_CHANGE';
|
||||
const SEARCH_CLEAR = 'SEARCH_CLEAR';
|
||||
|
|
|
@ -4,16 +4,16 @@
|
|||
* @see module:soapbox/actions/auth
|
||||
*/
|
||||
|
||||
import toast from 'soapbox/toast';
|
||||
import { getLoggedInAccount } from 'soapbox/utils/auth';
|
||||
import { parseVersion, TRUTHSOCIAL } from 'soapbox/utils/features';
|
||||
import { normalizeUsername } from 'soapbox/utils/input';
|
||||
import toast from 'soapbox/toast.tsx';
|
||||
import { getLoggedInAccount } from 'soapbox/utils/auth.ts';
|
||||
import { parseVersion, TRUTHSOCIAL } from 'soapbox/utils/features.ts';
|
||||
import { normalizeUsername } from 'soapbox/utils/input.ts';
|
||||
|
||||
import api from '../api';
|
||||
import api from '../api/index.ts';
|
||||
|
||||
import { AUTH_LOGGED_OUT, messages } from './auth';
|
||||
import { AUTH_LOGGED_OUT, messages } from './auth.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
|
||||
const FETCH_TOKENS_REQUEST = 'FETCH_TOKENS_REQUEST';
|
||||
const FETCH_TOKENS_SUCCESS = 'FETCH_TOKENS_SUCCESS';
|
||||
|
|
|
@ -2,12 +2,12 @@ import { Map as ImmutableMap, List as ImmutableList } from 'immutable';
|
|||
import { defineMessage } from 'react-intl';
|
||||
import { createSelector } from 'reselect';
|
||||
|
||||
import { patchMe } from 'soapbox/actions/me';
|
||||
import messages from 'soapbox/messages';
|
||||
import toast from 'soapbox/toast';
|
||||
import { isLoggedIn } from 'soapbox/utils/auth';
|
||||
import { patchMe } from 'soapbox/actions/me.ts';
|
||||
import messages from 'soapbox/messages.ts';
|
||||
import toast from 'soapbox/toast.tsx';
|
||||
import { isLoggedIn } from 'soapbox/utils/auth.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
|
||||
const SETTING_CHANGE = 'SETTING_CHANGE' as const;
|
||||
const SETTING_SAVE = 'SETTING_SAVE' as const;
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
import { createSelector } from 'reselect';
|
||||
|
||||
import { getHost } from 'soapbox/actions/instance';
|
||||
import { normalizeSoapboxConfig } from 'soapbox/normalizers';
|
||||
import KVStore from 'soapbox/storage/kv-store';
|
||||
import { removeVS16s } from 'soapbox/utils/emoji';
|
||||
import { getFeatures } from 'soapbox/utils/features';
|
||||
import { getHost } from 'soapbox/actions/instance.ts';
|
||||
import { normalizeSoapboxConfig } from 'soapbox/normalizers/index.ts';
|
||||
import KVStore from 'soapbox/storage/kv-store.ts';
|
||||
import { getFeatures } from 'soapbox/utils/features.ts';
|
||||
|
||||
import api, { staticClient } from '../api';
|
||||
import api from '../api/index.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity } from 'soapbox/types/entities';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity } from 'soapbox/types/entities.ts';
|
||||
|
||||
const SOAPBOX_CONFIG_REQUEST_SUCCESS = 'SOAPBOX_CONFIG_REQUEST_SUCCESS';
|
||||
const SOAPBOX_CONFIG_REQUEST_FAIL = 'SOAPBOX_CONFIG_REQUEST_FAIL';
|
||||
|
@ -29,12 +28,6 @@ const getSoapboxConfig = createSelector([
|
|||
if (soapbox.get('displayFqn') === undefined) {
|
||||
soapboxConfig.set('displayFqn', features.federating);
|
||||
}
|
||||
|
||||
// If RGI reacts aren't supported, strip VS16s
|
||||
// https://git.pleroma.social/pleroma/pleroma/-/issues/2355
|
||||
if (features.emojiReactsNonRGI) {
|
||||
soapboxConfig.set('allowedEmoji', soapboxConfig.allowedEmoji.map(removeVS16s));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -86,7 +79,7 @@ const loadSoapboxConfig = () =>
|
|||
|
||||
const fetchSoapboxJson = (host: string | null) =>
|
||||
(dispatch: AppDispatch) =>
|
||||
staticClient.get('/instance/soapbox.json').then(({ data }) => {
|
||||
fetch('/instance/soapbox.json').then((response) => response.json()).then((data) => {
|
||||
if (!isObject(data)) throw 'soapbox.json failed';
|
||||
dispatch(importSoapboxConfig(data, host));
|
||||
return data;
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
import { Map as ImmutableMap } from 'immutable';
|
||||
import { beforeEach, describe, expect, it } from 'vitest';
|
||||
|
||||
import { __stub } from 'soapbox/api';
|
||||
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
||||
import { StatusListRecord } from 'soapbox/reducers/status-lists';
|
||||
import { __stub } from 'soapbox/api/index.ts';
|
||||
import { mockStore, rootState } from 'soapbox/jest/test-helpers.tsx';
|
||||
import { StatusListRecord } from 'soapbox/reducers/status-lists.ts';
|
||||
|
||||
import { fetchStatusQuotes, expandStatusQuotes } from './status-quotes';
|
||||
import { fetchStatusQuotes, expandStatusQuotes } from './status-quotes.ts';
|
||||
|
||||
const status = {
|
||||
account: {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import api, { getLinks } from '../api';
|
||||
import api, { getLinks } from '../api/index.ts';
|
||||
|
||||
import { importFetchedStatuses } from './importer';
|
||||
import { importFetchedStatuses } from './importer/index.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
|
||||
export const STATUS_QUOTES_FETCH_REQUEST = 'STATUS_QUOTES_FETCH_REQUEST';
|
||||
export const STATUS_QUOTES_FETCH_SUCCESS = 'STATUS_QUOTES_FETCH_SUCCESS';
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
import { fromJS, Map as ImmutableMap } from 'immutable';
|
||||
import { beforeEach, describe, expect, it } from 'vitest';
|
||||
|
||||
import { STATUSES_IMPORT } from 'soapbox/actions/importer';
|
||||
import { __stub } from 'soapbox/api';
|
||||
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
||||
import { normalizeStatus } from 'soapbox/normalizers/status';
|
||||
import { STATUSES_IMPORT } from 'soapbox/actions/importer/index.ts';
|
||||
import { __stub } from 'soapbox/api/index.ts';
|
||||
import { mockStore, rootState } from 'soapbox/jest/test-helpers.tsx';
|
||||
import { normalizeStatus } from 'soapbox/normalizers/status.ts';
|
||||
|
||||
import { deleteStatus, fetchContext } from './statuses';
|
||||
import { deleteStatus, fetchContext } from './statuses.ts';
|
||||
|
||||
describe('fetchContext()', () => {
|
||||
it('handles Mitra context', async () => {
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
import { isLoggedIn } from 'soapbox/utils/auth';
|
||||
import { getFeatures } from 'soapbox/utils/features';
|
||||
import { shouldHaveCard } from 'soapbox/utils/status';
|
||||
import { isLoggedIn } from 'soapbox/utils/auth.ts';
|
||||
import { getFeatures } from 'soapbox/utils/features.ts';
|
||||
import { shouldHaveCard } from 'soapbox/utils/status.ts';
|
||||
|
||||
import api, { getNextLink } from '../api';
|
||||
import api, { getNextLink } from '../api/index.ts';
|
||||
|
||||
import { setComposeToStatus } from './compose-status';
|
||||
import { fetchGroupRelationships } from './groups';
|
||||
import { importFetchedStatus, importFetchedStatuses } from './importer';
|
||||
import { openModal } from './modals';
|
||||
import { deleteFromTimelines } from './timelines';
|
||||
import { setComposeToStatus } from './compose-status.ts';
|
||||
import { fetchGroupRelationships } from './groups.ts';
|
||||
import { importFetchedStatus, importFetchedStatuses } from './importer/index.ts';
|
||||
import { openModal } from './modals.ts';
|
||||
import { deleteFromTimelines } from './timelines.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity, Status } from 'soapbox/types/entities';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity, Status } from 'soapbox/types/entities.ts';
|
||||
|
||||
const STATUS_CREATE_REQUEST = 'STATUS_CREATE_REQUEST';
|
||||
const STATUS_CREATE_SUCCESS = 'STATUS_CREATE_SUCCESS';
|
||||
|
|
|
@ -1,33 +1,33 @@
|
|||
import { getLocale, getSettings } from 'soapbox/actions/settings';
|
||||
import { updateReactions } from 'soapbox/api/hooks/announcements/useAnnouncements';
|
||||
import { importEntities } from 'soapbox/entity-store/actions';
|
||||
import { Entities } from 'soapbox/entity-store/entities';
|
||||
import { selectEntity } from 'soapbox/entity-store/selectors';
|
||||
import messages from 'soapbox/messages';
|
||||
import { ChatKeys, IChat, isLastMessage } from 'soapbox/queries/chats';
|
||||
import { queryClient } from 'soapbox/queries/client';
|
||||
import { announcementSchema, type Announcement, type Relationship } from 'soapbox/schemas';
|
||||
import { getUnreadChatsCount, updateChatListItem, updateChatMessage } from 'soapbox/utils/chats';
|
||||
import { removePageItem } from 'soapbox/utils/queries';
|
||||
import { play, soundCache } from 'soapbox/utils/sounds';
|
||||
import { getLocale, getSettings } from 'soapbox/actions/settings.ts';
|
||||
import { updateReactions } from 'soapbox/api/hooks/announcements/useAnnouncements.ts';
|
||||
import { importEntities } from 'soapbox/entity-store/actions.ts';
|
||||
import { Entities } from 'soapbox/entity-store/entities.ts';
|
||||
import { selectEntity } from 'soapbox/entity-store/selectors.ts';
|
||||
import messages from 'soapbox/messages.ts';
|
||||
import { ChatKeys, IChat, isLastMessage } from 'soapbox/queries/chats.ts';
|
||||
import { queryClient } from 'soapbox/queries/client.ts';
|
||||
import { announcementSchema, type Announcement, type Relationship } from 'soapbox/schemas/index.ts';
|
||||
import { getUnreadChatsCount, updateChatListItem, updateChatMessage } from 'soapbox/utils/chats.ts';
|
||||
import { removePageItem } from 'soapbox/utils/queries.ts';
|
||||
import { play, soundCache } from 'soapbox/utils/sounds.ts';
|
||||
|
||||
import { connectStream } from '../stream';
|
||||
import { connectStream } from '../stream.ts';
|
||||
|
||||
import { updateConversations } from './conversations';
|
||||
import { fetchFilters } from './filters';
|
||||
import { MARKER_FETCH_SUCCESS } from './markers';
|
||||
import { updateNotificationsQueue } from './notifications';
|
||||
import { updateStatus } from './statuses';
|
||||
import { updateConversations } from './conversations.ts';
|
||||
import { fetchFilters } from './filters.ts';
|
||||
import { MARKER_FETCH_SUCCESS } from './markers.ts';
|
||||
import { updateNotificationsQueue } from './notifications.ts';
|
||||
import { updateStatus } from './statuses.ts';
|
||||
import {
|
||||
// deleteFromTimelines,
|
||||
connectTimeline,
|
||||
disconnectTimeline,
|
||||
processTimelineUpdate,
|
||||
} from './timelines';
|
||||
} from './timelines.ts';
|
||||
|
||||
import type { IStatContext } from 'soapbox/contexts/stat-context';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity, Chat } from 'soapbox/types/entities';
|
||||
import type { IStatContext } from 'soapbox/contexts/stat-context.tsx';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity, Chat } from 'soapbox/types/entities.ts';
|
||||
|
||||
const STREAMING_CHAT_UPDATE = 'STREAMING_CHAT_UPDATE';
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { isLoggedIn } from 'soapbox/utils/auth';
|
||||
import { getFeatures } from 'soapbox/utils/features';
|
||||
import { isLoggedIn } from 'soapbox/utils/auth.ts';
|
||||
import { getFeatures } from 'soapbox/utils/features.ts';
|
||||
|
||||
import api, { getLinks } from '../api';
|
||||
import api, { getLinks } from '../api/index.ts';
|
||||
|
||||
import { fetchRelationships } from './accounts';
|
||||
import { importFetchedAccounts } from './importer';
|
||||
import { insertSuggestionsIntoTimeline } from './timelines';
|
||||
import { fetchRelationships } from './accounts.ts';
|
||||
import { importFetchedAccounts } from './importer/index.ts';
|
||||
import { insertSuggestionsIntoTimeline } from './timelines.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity } from 'soapbox/types/entities';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity } from 'soapbox/types/entities.ts';
|
||||
|
||||
const SUGGESTIONS_FETCH_REQUEST = 'SUGGESTIONS_FETCH_REQUEST';
|
||||
const SUGGESTIONS_FETCH_SUCCESS = 'SUGGESTIONS_FETCH_SUCCESS';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import api, { getLinks } from '../api';
|
||||
import api, { getLinks } from '../api/index.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity } from 'soapbox/types/entities';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity } from 'soapbox/types/entities.ts';
|
||||
|
||||
const HASHTAG_FETCH_REQUEST = 'HASHTAG_FETCH_REQUEST';
|
||||
const HASHTAG_FETCH_SUCCESS = 'HASHTAG_FETCH_SUCCESS';
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import { Map as ImmutableMap, OrderedSet as ImmutableOrderedSet } from 'immutable';
|
||||
|
||||
import { getSettings } from 'soapbox/actions/settings';
|
||||
import { normalizeStatus } from 'soapbox/normalizers';
|
||||
import { shouldFilter } from 'soapbox/utils/timelines';
|
||||
import { getSettings } from 'soapbox/actions/settings.ts';
|
||||
import { normalizeStatus } from 'soapbox/normalizers/index.ts';
|
||||
import { shouldFilter } from 'soapbox/utils/timelines.ts';
|
||||
|
||||
import api, { getNextLink, getPrevLink } from '../api';
|
||||
import api, { getNextLink, getPrevLink } from '../api/index.ts';
|
||||
|
||||
import { fetchGroupRelationships } from './groups';
|
||||
import { importFetchedStatus, importFetchedStatuses } from './importer';
|
||||
import { fetchGroupRelationships } from './groups.ts';
|
||||
import { importFetchedStatus, importFetchedStatuses } from './importer/index.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity, Status } from 'soapbox/types/entities';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity, Status } from 'soapbox/types/entities.ts';
|
||||
|
||||
const TIMELINE_UPDATE = 'TIMELINE_UPDATE' as const;
|
||||
const TIMELINE_DELETE = 'TIMELINE_DELETE' as const;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { APIEntity } from 'soapbox/types/entities';
|
||||
import { getFeatures } from 'soapbox/utils/features';
|
||||
import { APIEntity } from 'soapbox/types/entities.ts';
|
||||
import { getFeatures } from 'soapbox/utils/features.ts';
|
||||
|
||||
import api, { getLinks } from '../api';
|
||||
import api, { getLinks } from '../api/index.ts';
|
||||
|
||||
import { importFetchedStatuses } from './importer';
|
||||
import { importFetchedStatuses } from './importer/index.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
|
||||
const TRENDING_STATUSES_FETCH_REQUEST = 'TRENDING_STATUSES_FETCH_REQUEST';
|
||||
const TRENDING_STATUSES_FETCH_SUCCESS = 'TRENDING_STATUSES_FETCH_SUCCESS';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import api from '../api';
|
||||
import api from '../api/index.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity } from 'soapbox/types/entities';
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { APIEntity } from 'soapbox/types/entities.ts';
|
||||
|
||||
const TRENDS_FETCH_REQUEST = 'TRENDS_FETCH_REQUEST';
|
||||
const TRENDS_FETCH_SUCCESS = 'TRENDS_FETCH_SUCCESS';
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { HTTPError } from './HTTPError';
|
||||
import { HTTPError } from './HTTPError.ts';
|
||||
import { MastodonResponse } from './MastodonResponse.ts';
|
||||
|
||||
interface Opts {
|
||||
searchParams?: URLSearchParams | Record<string, string | number | boolean>;
|
||||
|
@ -19,35 +20,35 @@ export class MastodonClient {
|
|||
this.accessToken = accessToken;
|
||||
}
|
||||
|
||||
async get(path: string, opts: Opts = {}): Promise<Response> {
|
||||
async get(path: string, opts: Opts = {}): Promise<MastodonResponse> {
|
||||
return this.request('GET', path, undefined, opts);
|
||||
}
|
||||
|
||||
async post(path: string, data?: unknown, opts: Opts = {}): Promise<Response> {
|
||||
async post(path: string, data?: unknown, opts: Opts = {}): Promise<MastodonResponse> {
|
||||
return this.request('POST', path, data, opts);
|
||||
}
|
||||
|
||||
async put(path: string, data?: unknown, opts: Opts = {}): Promise<Response> {
|
||||
async put(path: string, data?: unknown, opts: Opts = {}): Promise<MastodonResponse> {
|
||||
return this.request('PUT', path, data, opts);
|
||||
}
|
||||
|
||||
async delete(path: string, opts: Opts = {}): Promise<Response> {
|
||||
async delete(path: string, opts: Opts = {}): Promise<MastodonResponse> {
|
||||
return this.request('DELETE', path, undefined, opts);
|
||||
}
|
||||
|
||||
async patch(path: string, data: unknown, opts: Opts = {}): Promise<Response> {
|
||||
async patch(path: string, data: unknown, opts: Opts = {}): Promise<MastodonResponse> {
|
||||
return this.request('PATCH', path, data, opts);
|
||||
}
|
||||
|
||||
async head(path: string, opts: Opts = {}): Promise<Response> {
|
||||
async head(path: string, opts: Opts = {}): Promise<MastodonResponse> {
|
||||
return this.request('HEAD', path, undefined, opts);
|
||||
}
|
||||
|
||||
async options(path: string, opts: Opts = {}): Promise<Response> {
|
||||
async options(path: string, opts: Opts = {}): Promise<MastodonResponse> {
|
||||
return this.request('OPTIONS', path, undefined, opts);
|
||||
}
|
||||
|
||||
async request(method: string, path: string, data: unknown, opts: Opts = {}): Promise<Response> {
|
||||
async request(method: string, path: string, data: unknown, opts: Opts = {}): Promise<MastodonResponse> {
|
||||
const url = new URL(path, this.baseUrl);
|
||||
|
||||
if (opts.searchParams) {
|
||||
|
@ -89,7 +90,13 @@ export class MastodonClient {
|
|||
throw new HTTPError(response, request);
|
||||
}
|
||||
|
||||
return response;
|
||||
// Fix for non-compliant browsers.
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/Response/body
|
||||
if (response.status === 204 || request.method === 'HEAD') {
|
||||
return new MastodonResponse(null, response);
|
||||
}
|
||||
|
||||
return new MastodonResponse(response.body, response);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
import LinkHeader from 'http-link-header';
|
||||
|
||||
export class MastodonResponse extends Response {
|
||||
|
||||
/** Parses the `Link` header and returns URLs for the `prev` and `next` pages of this response, if any. */
|
||||
pagination(): { prev?: string; next?: string } {
|
||||
const header = this.headers.get('link');
|
||||
const links = header ? new LinkHeader(header) : undefined;
|
||||
|
||||
return {
|
||||
next: links?.refs.find((link) => link.rel === 'next')?.uri,
|
||||
prev: links?.refs.find((link) => link.rel === 'prev')?.uri,
|
||||
};
|
||||
}
|
||||
|
||||
}
|
|
@ -15,8 +15,6 @@ const setupMock = (axios: AxiosInstance) => {
|
|||
mocks.map(func => func(mock));
|
||||
};
|
||||
|
||||
export const staticClient = api.staticClient;
|
||||
|
||||
export const getLinks = (response: AxiosResponse): LinkHeader => {
|
||||
return new LinkHeader(response.headers?.link);
|
||||
};
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
import { useEffect, useMemo } from 'react';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
|
||||
import { Entities } from 'soapbox/entity-store/entities';
|
||||
import { useEntity } from 'soapbox/entity-store/hooks';
|
||||
import { useApi, useFeatures, useLoggedIn } from 'soapbox/hooks';
|
||||
import { type Account, accountSchema } from 'soapbox/schemas';
|
||||
import { Entities } from 'soapbox/entity-store/entities.ts';
|
||||
import { useEntity } from 'soapbox/entity-store/hooks/index.ts';
|
||||
import { useApi } from 'soapbox/hooks/useApi.ts';
|
||||
import { useFeatures } from 'soapbox/hooks/useFeatures.ts';
|
||||
import { useLoggedIn } from 'soapbox/hooks/useLoggedIn.ts';
|
||||
import { type Account, accountSchema } from 'soapbox/schemas/index.ts';
|
||||
|
||||
import { useRelationship } from './useRelationship';
|
||||
import { useRelationship } from './useRelationship.ts';
|
||||
|
||||
interface UseAccountOpts {
|
||||
withRelationship?: boolean;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { Entities } from 'soapbox/entity-store/entities';
|
||||
import { useEntities } from 'soapbox/entity-store/hooks';
|
||||
import { useApi } from 'soapbox/hooks';
|
||||
import { Account, accountSchema } from 'soapbox/schemas';
|
||||
import { Entities } from 'soapbox/entity-store/entities.ts';
|
||||
import { useEntities } from 'soapbox/entity-store/hooks/index.ts';
|
||||
import { useApi } from 'soapbox/hooks/useApi.ts';
|
||||
import { Account, accountSchema } from 'soapbox/schemas/index.ts';
|
||||
|
||||
import { useRelationships } from './useRelationships';
|
||||
import { useRelationships } from './useRelationships.ts';
|
||||
|
||||
import type { EntityFn } from 'soapbox/entity-store/hooks/types';
|
||||
import type { EntityFn } from 'soapbox/entity-store/hooks/types.ts';
|
||||
|
||||
interface useAccountListOpts {
|
||||
enabled?: boolean;
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
import { useEffect } from 'react';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
|
||||
import { Entities } from 'soapbox/entity-store/entities';
|
||||
import { useEntityLookup } from 'soapbox/entity-store/hooks';
|
||||
import { useApi, useFeatures, useLoggedIn } from 'soapbox/hooks';
|
||||
import { type Account, accountSchema } from 'soapbox/schemas';
|
||||
import { Entities } from 'soapbox/entity-store/entities.ts';
|
||||
import { useEntityLookup } from 'soapbox/entity-store/hooks/index.ts';
|
||||
import { useApi } from 'soapbox/hooks/useApi.ts';
|
||||
import { useFeatures } from 'soapbox/hooks/useFeatures.ts';
|
||||
import { useLoggedIn } from 'soapbox/hooks/useLoggedIn.ts';
|
||||
import { type Account, accountSchema } from 'soapbox/schemas/index.ts';
|
||||
|
||||
import { useRelationship } from './useRelationship';
|
||||
import { useRelationship } from './useRelationship.ts';
|
||||
|
||||
interface UseAccountLookupOpts {
|
||||
withRelationship?: boolean;
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
import { importEntities } from 'soapbox/entity-store/actions';
|
||||
import { Entities } from 'soapbox/entity-store/entities';
|
||||
import { useTransaction } from 'soapbox/entity-store/hooks';
|
||||
import { useApi, useAppDispatch, useLoggedIn } from 'soapbox/hooks';
|
||||
import { relationshipSchema } from 'soapbox/schemas';
|
||||
import { importEntities } from 'soapbox/entity-store/actions.ts';
|
||||
import { Entities } from 'soapbox/entity-store/entities.ts';
|
||||
import { useTransaction } from 'soapbox/entity-store/hooks/index.ts';
|
||||
import { useApi } from 'soapbox/hooks/useApi.ts';
|
||||
import { useAppDispatch } from 'soapbox/hooks/useAppDispatch.ts';
|
||||
import { useLoggedIn } from 'soapbox/hooks/useLoggedIn.ts';
|
||||
import { relationshipSchema } from 'soapbox/schemas/index.ts';
|
||||
|
||||
interface FollowOpts {
|
||||
reblogs?: boolean;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { Entities } from 'soapbox/entity-store/entities';
|
||||
import { useEntity } from 'soapbox/entity-store/hooks';
|
||||
import { useApi } from 'soapbox/hooks';
|
||||
import { useSoapboxConfig } from 'soapbox/hooks/useSoapboxConfig';
|
||||
import { type PatronUser, patronUserSchema } from 'soapbox/schemas';
|
||||
import { Entities } from 'soapbox/entity-store/entities.ts';
|
||||
import { useEntity } from 'soapbox/entity-store/hooks/index.ts';
|
||||
import { useApi } from 'soapbox/hooks/useApi.ts';
|
||||
import { useSoapboxConfig } from 'soapbox/hooks/useSoapboxConfig.ts';
|
||||
import { type PatronUser, patronUserSchema } from 'soapbox/schemas/index.ts';
|
||||
|
||||
function usePatronUser(url?: string) {
|
||||
const api = useApi();
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { z } from 'zod';
|
||||
|
||||
import { Entities } from 'soapbox/entity-store/entities';
|
||||
import { useEntity } from 'soapbox/entity-store/hooks';
|
||||
import { useApi } from 'soapbox/hooks';
|
||||
import { type Relationship, relationshipSchema } from 'soapbox/schemas';
|
||||
import { Entities } from 'soapbox/entity-store/entities.ts';
|
||||
import { useEntity } from 'soapbox/entity-store/hooks/index.ts';
|
||||
import { useApi } from 'soapbox/hooks/useApi.ts';
|
||||
import { type Relationship, relationshipSchema } from 'soapbox/schemas/index.ts';
|
||||
|
||||
interface UseRelationshipOpts {
|
||||
enabled?: boolean;
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import { Entities } from 'soapbox/entity-store/entities';
|
||||
import { useBatchedEntities } from 'soapbox/entity-store/hooks/useBatchedEntities';
|
||||
import { useApi, useLoggedIn } from 'soapbox/hooks';
|
||||
import { type Relationship, relationshipSchema } from 'soapbox/schemas';
|
||||
import { Entities } from 'soapbox/entity-store/entities.ts';
|
||||
import { useBatchedEntities } from 'soapbox/entity-store/hooks/useBatchedEntities.ts';
|
||||
import { useApi } from 'soapbox/hooks/useApi.ts';
|
||||
import { useLoggedIn } from 'soapbox/hooks/useLoggedIn.ts';
|
||||
import { type Relationship, relationshipSchema } from 'soapbox/schemas/index.ts';
|
||||
|
||||
function useRelationships(listKey: string[], ids: string[]) {
|
||||
const api = useApi();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
export { useDomains } from './useDomains';
|
||||
export { useModerationLog } from './useModerationLog';
|
||||
export { useRelays } from './useRelays';
|
||||
export { useRules } from './useRules';
|
||||
export { useSuggest } from './useSuggest';
|
||||
export { useVerify } from './useVerify';
|
||||
export { useDomains } from './useDomains.ts';
|
||||
export { useModerationLog } from './useModerationLog.ts';
|
||||
export { useRelays } from './useRelays.ts';
|
||||
export { useRules } from './useRules.ts';
|
||||
export { useSuggest } from './useSuggest.ts';
|
||||
export { useVerify } from './useVerify.ts';
|
|
@ -1,7 +1,7 @@
|
|||
import { Entities } from 'soapbox/entity-store/entities';
|
||||
import { useEntities } from 'soapbox/entity-store/hooks';
|
||||
import { useApi } from 'soapbox/hooks';
|
||||
import { adminAccountSchema } from 'soapbox/schemas/admin-account';
|
||||
import { Entities } from 'soapbox/entity-store/entities.ts';
|
||||
import { useEntities } from 'soapbox/entity-store/hooks/index.ts';
|
||||
import { useApi } from 'soapbox/hooks/useApi.ts';
|
||||
import { adminAccountSchema } from 'soapbox/schemas/admin-account.ts';
|
||||
|
||||
interface MastodonAdminFilters {
|
||||
local?: boolean;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { useMutation, useQuery } from '@tanstack/react-query';
|
||||
|
||||
import { useApi } from 'soapbox/hooks';
|
||||
import { queryClient } from 'soapbox/queries/client';
|
||||
import { adminAnnouncementSchema, type AdminAnnouncement } from 'soapbox/schemas';
|
||||
import { useApi } from 'soapbox/hooks/useApi.ts';
|
||||
import { queryClient } from 'soapbox/queries/client.ts';
|
||||
import { adminAnnouncementSchema, type AdminAnnouncement } from 'soapbox/schemas/index.ts';
|
||||
|
||||
import { useAnnouncements as useUserAnnouncements } from '../announcements';
|
||||
import { useAnnouncements as useUserAnnouncements } from '../announcements/index.ts';
|
||||
|
||||
interface CreateAnnouncementParams {
|
||||
content: string;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Entities } from 'soapbox/entity-store/entities';
|
||||
import { useCreateEntity } from 'soapbox/entity-store/hooks';
|
||||
import { useApi } from 'soapbox/hooks';
|
||||
import { domainSchema } from 'soapbox/schemas';
|
||||
import { Entities } from 'soapbox/entity-store/entities.ts';
|
||||
import { useCreateEntity } from 'soapbox/entity-store/hooks/index.ts';
|
||||
import { useApi } from 'soapbox/hooks/useApi.ts';
|
||||
import { domainSchema } from 'soapbox/schemas/index.ts';
|
||||
|
||||
interface CreateDomainParams {
|
||||
domain: string;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Entities } from 'soapbox/entity-store/entities';
|
||||
import { useDeleteEntity } from 'soapbox/entity-store/hooks';
|
||||
import { useApi } from 'soapbox/hooks';
|
||||
import { Entities } from 'soapbox/entity-store/entities.ts';
|
||||
import { useDeleteEntity } from 'soapbox/entity-store/hooks/index.ts';
|
||||
import { useApi } from 'soapbox/hooks/useApi.ts';
|
||||
|
||||
const useDeleteDomain = () => {
|
||||
const api = useApi();
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { useMutation, useQuery } from '@tanstack/react-query';
|
||||
|
||||
import { useApi } from 'soapbox/hooks';
|
||||
import { queryClient } from 'soapbox/queries/client';
|
||||
import { domainSchema, type Domain } from 'soapbox/schemas';
|
||||
import { useApi } from 'soapbox/hooks/useApi.ts';
|
||||
import { queryClient } from 'soapbox/queries/client.ts';
|
||||
import { domainSchema, type Domain } from 'soapbox/schemas/index.ts';
|
||||
|
||||
interface CreateDomainParams {
|
||||
domain: string;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { useState, useEffect } from 'react';
|
||||
import { defineMessages } from 'react-intl';
|
||||
|
||||
import { type INewAccount } from 'soapbox/features/admin/manage-zap-split';
|
||||
import { useApi } from 'soapbox/hooks';
|
||||
import { baseZapAccountSchema, ZapSplitData } from 'soapbox/schemas/zap-split';
|
||||
import toast from 'soapbox/toast';
|
||||
import { type INewAccount } from 'soapbox/features/admin/manage-zap-split.tsx';
|
||||
import { useApi } from 'soapbox/hooks/useApi.ts';
|
||||
import { baseZapAccountSchema, ZapSplitData } from 'soapbox/schemas/zap-split.ts';
|
||||
import toast from 'soapbox/toast.tsx';
|
||||
|
||||
|
||||
const messages = defineMessages({
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { useInfiniteQuery } from '@tanstack/react-query';
|
||||
|
||||
import { useApi } from 'soapbox/hooks';
|
||||
import { moderationLogEntrySchema, type ModerationLogEntry } from 'soapbox/schemas';
|
||||
import { useApi } from 'soapbox/hooks/useApi.ts';
|
||||
import { moderationLogEntrySchema, type ModerationLogEntry } from 'soapbox/schemas/index.ts';
|
||||
|
||||
interface ModerationLogResult {
|
||||
items: ModerationLogEntry[];
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { useMutation, useQuery } from '@tanstack/react-query';
|
||||
|
||||
import { useApi } from 'soapbox/hooks';
|
||||
import { queryClient } from 'soapbox/queries/client';
|
||||
import { relaySchema, type Relay } from 'soapbox/schemas';
|
||||
import { useApi } from 'soapbox/hooks/useApi.ts';
|
||||
import { queryClient } from 'soapbox/queries/client.ts';
|
||||
import { relaySchema, type Relay } from 'soapbox/schemas/index.ts';
|
||||
|
||||
const useRelays = () => {
|
||||
const api = useApi();
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { useMutation, useQuery } from '@tanstack/react-query';
|
||||
|
||||
import { useApi } from 'soapbox/hooks';
|
||||
import { queryClient } from 'soapbox/queries/client';
|
||||
import { adminRuleSchema, type AdminRule } from 'soapbox/schemas';
|
||||
import { useApi } from 'soapbox/hooks/useApi.ts';
|
||||
import { queryClient } from 'soapbox/queries/client.ts';
|
||||
import { adminRuleSchema, type AdminRule } from 'soapbox/schemas/index.ts';
|
||||
|
||||
interface CreateRuleParams {
|
||||
priority?: number;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue