Compare commits
8 Commits
fix/email-
...
feat/app-e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7411e36880 | ||
|
|
05ad84f372 | ||
|
|
0c993d0e90 | ||
|
|
10cb900bd7 | ||
|
|
8fd6b2ffb0 | ||
|
|
e6e300ca86 | ||
|
|
5bac6222a0 | ||
|
|
cf37fbd610 |
@@ -38,7 +38,7 @@
|
|||||||
},
|
},
|
||||||
"packageExtensions": {
|
"packageExtensions": {
|
||||||
"httpsnippet@3.0.1": {
|
"httpsnippet@3.0.1": {
|
||||||
"dependencies": {
|
"peerDependencies": {
|
||||||
"ajv": "6.12.3"
|
"ajv": "6.12.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM node:20.12.2 AS builder
|
FROM node:18.8.0 AS builder
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,9 @@
|
|||||||
"collection": "@nestjs/schematics",
|
"collection": "@nestjs/schematics",
|
||||||
"sourceRoot": "src",
|
"sourceRoot": "src",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"assets": [{ "include": "mailer/templates/**/*", "outDir": "dist" }],
|
"assets": [
|
||||||
|
"**/*.hbs"
|
||||||
|
],
|
||||||
"watchAssets": true
|
"watchAssets": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hoppscotch-backend",
|
"name": "hoppscotch-backend",
|
||||||
"version": "2024.3.3",
|
"version": "2024.3.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"author": "",
|
"author": "",
|
||||||
"private": true,
|
"private": true,
|
||||||
@@ -35,7 +35,6 @@
|
|||||||
"@nestjs/passport": "10.0.2",
|
"@nestjs/passport": "10.0.2",
|
||||||
"@nestjs/platform-express": "10.2.7",
|
"@nestjs/platform-express": "10.2.7",
|
||||||
"@nestjs/schedule": "4.0.1",
|
"@nestjs/schedule": "4.0.1",
|
||||||
"@nestjs/terminus": "10.2.3",
|
|
||||||
"@nestjs/throttler": "5.0.1",
|
"@nestjs/throttler": "5.0.1",
|
||||||
"@prisma/client": "5.8.1",
|
"@prisma/client": "5.8.1",
|
||||||
"argon2": "0.30.3",
|
"argon2": "0.30.3",
|
||||||
|
|||||||
@@ -121,7 +121,6 @@ describe('AdminService', () => {
|
|||||||
NOT: {
|
NOT: {
|
||||||
inviteeEmail: {
|
inviteeEmail: {
|
||||||
in: [dbAdminUsers[0].email],
|
in: [dbAdminUsers[0].email],
|
||||||
mode: 'insensitive',
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -230,10 +229,7 @@ describe('AdminService', () => {
|
|||||||
|
|
||||||
expect(mockPrisma.invitedUsers.deleteMany).toHaveBeenCalledWith({
|
expect(mockPrisma.invitedUsers.deleteMany).toHaveBeenCalledWith({
|
||||||
where: {
|
where: {
|
||||||
inviteeEmail: {
|
inviteeEmail: { in: [invitedUsers[0].inviteeEmail] },
|
||||||
in: [invitedUsers[0].inviteeEmail],
|
|
||||||
mode: 'insensitive',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
expect(result).toEqualRight(true);
|
expect(result).toEqualRight(true);
|
||||||
|
|||||||
@@ -89,17 +89,12 @@ export class AdminService {
|
|||||||
adminEmail: string,
|
adminEmail: string,
|
||||||
inviteeEmail: string,
|
inviteeEmail: string,
|
||||||
) {
|
) {
|
||||||
if (inviteeEmail.toLowerCase() == adminEmail.toLowerCase()) {
|
if (inviteeEmail == adminEmail) return E.left(DUPLICATE_EMAIL);
|
||||||
return E.left(DUPLICATE_EMAIL);
|
|
||||||
}
|
|
||||||
if (!validateEmail(inviteeEmail)) return E.left(INVALID_EMAIL);
|
if (!validateEmail(inviteeEmail)) return E.left(INVALID_EMAIL);
|
||||||
|
|
||||||
const alreadyInvitedUser = await this.prisma.invitedUsers.findFirst({
|
const alreadyInvitedUser = await this.prisma.invitedUsers.findFirst({
|
||||||
where: {
|
where: {
|
||||||
inviteeEmail: {
|
inviteeEmail: inviteeEmail,
|
||||||
equals: inviteeEmail,
|
|
||||||
mode: 'insensitive',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (alreadyInvitedUser != null) return E.left(USER_ALREADY_INVITED);
|
if (alreadyInvitedUser != null) return E.left(USER_ALREADY_INVITED);
|
||||||
@@ -164,7 +159,7 @@ export class AdminService {
|
|||||||
try {
|
try {
|
||||||
await this.prisma.invitedUsers.deleteMany({
|
await this.prisma.invitedUsers.deleteMany({
|
||||||
where: {
|
where: {
|
||||||
inviteeEmail: { in: inviteeEmails, mode: 'insensitive' },
|
inviteeEmail: { in: inviteeEmails },
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return E.right(true);
|
return E.right(true);
|
||||||
@@ -194,7 +189,6 @@ export class AdminService {
|
|||||||
NOT: {
|
NOT: {
|
||||||
inviteeEmail: {
|
inviteeEmail: {
|
||||||
in: userEmailObjs.map((user) => user.email),
|
in: userEmailObjs.map((user) => user.email),
|
||||||
mode: 'insensitive',
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ import { loadInfraConfiguration } from './infra-config/helper';
|
|||||||
import { MailerModule } from './mailer/mailer.module';
|
import { MailerModule } from './mailer/mailer.module';
|
||||||
import { PosthogModule } from './posthog/posthog.module';
|
import { PosthogModule } from './posthog/posthog.module';
|
||||||
import { ScheduleModule } from '@nestjs/schedule';
|
import { ScheduleModule } from '@nestjs/schedule';
|
||||||
import { HealthModule } from './health/health.module';
|
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -101,7 +100,6 @@ import { HealthModule } from './health/health.module';
|
|||||||
InfraConfigModule,
|
InfraConfigModule,
|
||||||
PosthogModule,
|
PosthogModule,
|
||||||
ScheduleModule.forRoot(),
|
ScheduleModule.forRoot(),
|
||||||
HealthModule,
|
|
||||||
],
|
],
|
||||||
providers: [GQLComplexityPlugin],
|
providers: [GQLComplexityPlugin],
|
||||||
controllers: [AppController],
|
controllers: [AppController],
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
import { Controller, Get } from '@nestjs/common';
|
|
||||||
import {
|
|
||||||
HealthCheck,
|
|
||||||
HealthCheckService,
|
|
||||||
PrismaHealthIndicator,
|
|
||||||
} from '@nestjs/terminus';
|
|
||||||
import { PrismaService } from 'src/prisma/prisma.service';
|
|
||||||
|
|
||||||
@Controller('health')
|
|
||||||
export class HealthController {
|
|
||||||
constructor(
|
|
||||||
private health: HealthCheckService,
|
|
||||||
private prismaHealth: PrismaHealthIndicator,
|
|
||||||
private prisma: PrismaService,
|
|
||||||
) {}
|
|
||||||
|
|
||||||
@Get()
|
|
||||||
@HealthCheck()
|
|
||||||
check() {
|
|
||||||
return this.health.check([
|
|
||||||
async () => this.prismaHealth.pingCheck('database', this.prisma),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
import { Module } from '@nestjs/common';
|
|
||||||
import { HealthController } from './health.controller';
|
|
||||||
import { PrismaModule } from 'src/prisma/prisma.module';
|
|
||||||
import { TerminusModule } from '@nestjs/terminus';
|
|
||||||
|
|
||||||
@Module({
|
|
||||||
imports: [PrismaModule, TerminusModule],
|
|
||||||
controllers: [HealthController],
|
|
||||||
})
|
|
||||||
export class HealthModule {}
|
|
||||||
@@ -299,10 +299,7 @@ export class ShortcodeService implements UserDataHandler, OnModuleInit {
|
|||||||
where: userEmail
|
where: userEmail
|
||||||
? {
|
? {
|
||||||
User: {
|
User: {
|
||||||
email: {
|
email: userEmail,
|
||||||
equals: userEmail,
|
|
||||||
mode: 'insensitive',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
|
|||||||
@@ -75,13 +75,12 @@ export class TeamInvitationService {
|
|||||||
if (!isEmailValid) return E.left(INVALID_EMAIL);
|
if (!isEmailValid) return E.left(INVALID_EMAIL);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const teamInvite = await this.prisma.teamInvitation.findFirstOrThrow({
|
const teamInvite = await this.prisma.teamInvitation.findUniqueOrThrow({
|
||||||
where: {
|
where: {
|
||||||
inviteeEmail: {
|
teamID_inviteeEmail: {
|
||||||
equals: inviteeEmail,
|
inviteeEmail: inviteeEmail,
|
||||||
mode: 'insensitive',
|
teamID: teamID,
|
||||||
},
|
},
|
||||||
teamID,
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ beforeEach(() => {
|
|||||||
describe('UserService', () => {
|
describe('UserService', () => {
|
||||||
describe('findUserByEmail', () => {
|
describe('findUserByEmail', () => {
|
||||||
test('should successfully return a valid user given a valid email', async () => {
|
test('should successfully return a valid user given a valid email', async () => {
|
||||||
mockPrisma.user.findFirst.mockResolvedValueOnce(user);
|
mockPrisma.user.findUniqueOrThrow.mockResolvedValueOnce(user);
|
||||||
|
|
||||||
const result = await userService.findUserByEmail(
|
const result = await userService.findUserByEmail(
|
||||||
'dwight@dundermifflin.com',
|
'dwight@dundermifflin.com',
|
||||||
@@ -158,7 +158,7 @@ describe('UserService', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('should return a null user given a invalid email', async () => {
|
test('should return a null user given a invalid email', async () => {
|
||||||
mockPrisma.user.findFirst.mockResolvedValueOnce(null);
|
mockPrisma.user.findUniqueOrThrow.mockRejectedValueOnce('NotFoundError');
|
||||||
|
|
||||||
const result = await userService.findUserByEmail('jim@dundermifflin.com');
|
const result = await userService.findUserByEmail('jim@dundermifflin.com');
|
||||||
expect(result).resolves.toBeNone;
|
expect(result).resolves.toBeNone;
|
||||||
|
|||||||
@@ -62,16 +62,16 @@ export class UserService {
|
|||||||
* @returns Option of found User
|
* @returns Option of found User
|
||||||
*/
|
*/
|
||||||
async findUserByEmail(email: string): Promise<O.None | O.Some<AuthUser>> {
|
async findUserByEmail(email: string): Promise<O.None | O.Some<AuthUser>> {
|
||||||
const user = await this.prisma.user.findFirst({
|
try {
|
||||||
where: {
|
const user = await this.prisma.user.findUniqueOrThrow({
|
||||||
email: {
|
where: {
|
||||||
equals: email,
|
email: email,
|
||||||
mode: 'insensitive',
|
|
||||||
},
|
},
|
||||||
},
|
});
|
||||||
});
|
return O.some(user);
|
||||||
if (!user) return O.none;
|
} catch (error) {
|
||||||
return O.some(user);
|
return O.none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -374,8 +374,7 @@
|
|||||||
"mutations": "Mutations",
|
"mutations": "Mutations",
|
||||||
"schema": "Schema",
|
"schema": "Schema",
|
||||||
"subscriptions": "Subscriptions",
|
"subscriptions": "Subscriptions",
|
||||||
"switch_connection": "Switch connection",
|
"switch_connection": "Switch connection"
|
||||||
"url_placeholder": "Enter a GraphQL endpoint URL"
|
|
||||||
},
|
},
|
||||||
"graphql_collections": {
|
"graphql_collections": {
|
||||||
"title": "GraphQL Collections"
|
"title": "GraphQL Collections"
|
||||||
@@ -569,7 +568,9 @@
|
|||||||
"generated_code": "Generated code",
|
"generated_code": "Generated code",
|
||||||
"go_to_authorization_tab": "Go to Authorization tab",
|
"go_to_authorization_tab": "Go to Authorization tab",
|
||||||
"go_to_body_tab": "Go to Body tab",
|
"go_to_body_tab": "Go to Body tab",
|
||||||
|
"graphql_placeholder": "Enter a URL",
|
||||||
"header_list": "Header List",
|
"header_list": "Header List",
|
||||||
|
"http_placeholder":"Enter a URL or cURL command",
|
||||||
"invalid_name": "Please provide a name for the request",
|
"invalid_name": "Please provide a name for the request",
|
||||||
"method": "Method",
|
"method": "Method",
|
||||||
"moved": "Request moved",
|
"moved": "Request moved",
|
||||||
@@ -599,7 +600,6 @@
|
|||||||
"title": "Request",
|
"title": "Request",
|
||||||
"type": "Request type",
|
"type": "Request type",
|
||||||
"url": "URL",
|
"url": "URL",
|
||||||
"url_placeholder": "Enter a URL or paste a cURL command",
|
|
||||||
"variables": "Variables",
|
"variables": "Variables",
|
||||||
"view_my_links": "View my links"
|
"view_my_links": "View my links"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -58,6 +58,24 @@
|
|||||||
"new": "Ajouter un nouveau",
|
"new": "Ajouter un nouveau",
|
||||||
"star": "Ajouter une étoile"
|
"star": "Ajouter une étoile"
|
||||||
},
|
},
|
||||||
|
"cookies": {
|
||||||
|
"modal": {
|
||||||
|
"new_domain_name": "Nouveau nom de domaine",
|
||||||
|
"set": "Définir un cookie",
|
||||||
|
"cookie_string": "Chaîne de caractères de cookie",
|
||||||
|
"enter_cookie_string": "Saisir la chaîne de caractères du cookie",
|
||||||
|
"cookie_name": "Nom",
|
||||||
|
"cookie_value": "Valeur",
|
||||||
|
"cookie_path": "Chemin d'accès",
|
||||||
|
"cookie_expires": "Expiration",
|
||||||
|
"managed_tab": "Gestion",
|
||||||
|
"raw_tab": "Brut",
|
||||||
|
"interceptor_no_support": "L'intercepteur que vous avez sélectionné ne prend pas en charge les cookies. Sélectionnez un autre intercepteur et réessayez.",
|
||||||
|
"empty_domains": "La liste des domaines est vide",
|
||||||
|
"empty_domain": "Le domaine est vide",
|
||||||
|
"no_cookies_in_domain": "Aucun cookie n'est défini pour ce domaine"
|
||||||
|
}
|
||||||
|
},
|
||||||
"app": {
|
"app": {
|
||||||
"chat_with_us": "Discuter avec nous",
|
"chat_with_us": "Discuter avec nous",
|
||||||
"contact_us": "Nous contacter",
|
"contact_us": "Nous contacter",
|
||||||
@@ -169,7 +187,7 @@
|
|||||||
},
|
},
|
||||||
"confirm": {
|
"confirm": {
|
||||||
"close_unsaved_tab": "Êtes-vous sûr de vouloir fermer cet onglet ?",
|
"close_unsaved_tab": "Êtes-vous sûr de vouloir fermer cet onglet ?",
|
||||||
"close_unsaved_tabs": "Êtes-vous sûr de vouloir fermer tous les onglets ? {count} onglets non enregistrés seront perdus",
|
"close_unsaved_tabs": "Êtes-vous sûr de vouloir fermer tous les onglets ? {Les onglets non enregistrés seront perdus.",
|
||||||
"exit_team": "Êtes-vous sûr de vouloir quitter cette équipe ?",
|
"exit_team": "Êtes-vous sûr de vouloir quitter cette équipe ?",
|
||||||
"logout": "Êtes-vous sûr de vouloir vous déconnecter?",
|
"logout": "Êtes-vous sûr de vouloir vous déconnecter?",
|
||||||
"remove_collection": "Voulez-vous vraiment supprimer définitivement cette collection ?",
|
"remove_collection": "Voulez-vous vraiment supprimer définitivement cette collection ?",
|
||||||
@@ -189,24 +207,6 @@
|
|||||||
"open_request_in_new_tab": "Ouvrir la demande dans un nouvel onglet",
|
"open_request_in_new_tab": "Ouvrir la demande dans un nouvel onglet",
|
||||||
"set_environment_variable": "Définir comme variable"
|
"set_environment_variable": "Définir comme variable"
|
||||||
},
|
},
|
||||||
"cookies": {
|
|
||||||
"modal": {
|
|
||||||
"new_domain_name": "Nouveau nom de domaine",
|
|
||||||
"set": "Définir un cookie",
|
|
||||||
"cookie_string": "Chaîne de caractères de cookie",
|
|
||||||
"enter_cookie_string": "Saisir la chaîne de caractères du cookie",
|
|
||||||
"cookie_name": "Nom",
|
|
||||||
"cookie_value": "Valeur",
|
|
||||||
"cookie_path": "Chemin d'accès",
|
|
||||||
"cookie_expires": "Expiration",
|
|
||||||
"managed_tab": "Gestion",
|
|
||||||
"raw_tab": "Brut",
|
|
||||||
"interceptor_no_support": "L'intercepteur que vous avez sélectionné ne prend pas en charge les cookies. Sélectionnez un autre intercepteur et réessayez.",
|
|
||||||
"empty_domains": "La liste des domaines est vide",
|
|
||||||
"empty_domain": "Le domaine est vide",
|
|
||||||
"no_cookies_in_domain": "Aucun cookie n'est défini pour ce domaine"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"count": {
|
"count": {
|
||||||
"header": "En-tête {count}",
|
"header": "En-tête {count}",
|
||||||
"message": "Message {compte}",
|
"message": "Message {compte}",
|
||||||
@@ -410,7 +410,7 @@
|
|||||||
"description": "Inspecter les erreurs possibles",
|
"description": "Inspecter les erreurs possibles",
|
||||||
"environment": {
|
"environment": {
|
||||||
"add_environment": "Ajouter à l'environnement",
|
"add_environment": "Ajouter à l'environnement",
|
||||||
"not_found": "La variable d'environnement “{environment}“ n'a pas été trouvée."
|
"not_found": "La variable d'environnement “{environnement}“ n'a pas été trouvée."
|
||||||
},
|
},
|
||||||
"header": {
|
"header": {
|
||||||
"cookie": "Le navigateur ne permet pas à Hoppscotch de définir l'en-tête Cookie. Pendant que nous travaillons sur l'application de bureau Hoppscotch (bientôt disponible), veuillez utiliser l'en-tête d'autorisation à la place."
|
"cookie": "Le navigateur ne permet pas à Hoppscotch de définir l'en-tête Cookie. Pendant que nous travaillons sur l'application de bureau Hoppscotch (bientôt disponible), veuillez utiliser l'en-tête d'autorisation à la place."
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -11,13 +11,12 @@
|
|||||||
"connect": "Подключиться",
|
"connect": "Подключиться",
|
||||||
"connecting": "Соединение...",
|
"connecting": "Соединение...",
|
||||||
"copy": "Скопировать",
|
"copy": "Скопировать",
|
||||||
"create": "Создать",
|
"create": "Create",
|
||||||
"delete": "Удалить",
|
"delete": "Удалить",
|
||||||
"disconnect": "Отключиться",
|
"disconnect": "Отключиться",
|
||||||
"dismiss": "Скрыть",
|
"dismiss": "Скрыть",
|
||||||
"dont_save": "Не сохранять",
|
"dont_save": "Не сохранять",
|
||||||
"download_file": "Скачать файл",
|
"download_file": "Скачать файл",
|
||||||
"download_here": "Download here",
|
|
||||||
"drag_to_reorder": "Перетягивайте для сортировки",
|
"drag_to_reorder": "Перетягивайте для сортировки",
|
||||||
"duplicate": "Дублировать",
|
"duplicate": "Дублировать",
|
||||||
"edit": "Редактировать",
|
"edit": "Редактировать",
|
||||||
@@ -25,7 +24,6 @@
|
|||||||
"go_back": "Вернуться",
|
"go_back": "Вернуться",
|
||||||
"go_forward": "Вперёд",
|
"go_forward": "Вперёд",
|
||||||
"group_by": "Сгруппировать по",
|
"group_by": "Сгруппировать по",
|
||||||
"hide_secret": "Hide secret",
|
|
||||||
"label": "Название",
|
"label": "Название",
|
||||||
"learn_more": "Узнать больше",
|
"learn_more": "Узнать больше",
|
||||||
"less": "Меньше",
|
"less": "Меньше",
|
||||||
@@ -35,7 +33,7 @@
|
|||||||
"open_workspace": "Открыть пространство",
|
"open_workspace": "Открыть пространство",
|
||||||
"paste": "Вставить",
|
"paste": "Вставить",
|
||||||
"prettify": "Форматировать",
|
"prettify": "Форматировать",
|
||||||
"properties": "Параметры",
|
"properties": "Properties",
|
||||||
"remove": "Удалить",
|
"remove": "Удалить",
|
||||||
"rename": "Переименовать",
|
"rename": "Переименовать",
|
||||||
"restore": "Восстановить",
|
"restore": "Восстановить",
|
||||||
@@ -44,14 +42,13 @@
|
|||||||
"scroll_to_top": "Вверх",
|
"scroll_to_top": "Вверх",
|
||||||
"search": "Поиск",
|
"search": "Поиск",
|
||||||
"send": "Отправить",
|
"send": "Отправить",
|
||||||
"share": "Поделиться",
|
"share": "Share",
|
||||||
"show_secret": "Show secret",
|
|
||||||
"start": "Начать",
|
"start": "Начать",
|
||||||
"starting": "Запускаю",
|
"starting": "Запускаю",
|
||||||
"stop": "Стоп",
|
"stop": "Стоп",
|
||||||
"to_close": "закрыть",
|
"to_close": "что бы закрыть",
|
||||||
"to_navigate": "для навигации",
|
"to_navigate": "для навигации",
|
||||||
"to_select": "выбрать",
|
"to_select": "выборать",
|
||||||
"turn_off": "Выключить",
|
"turn_off": "Выключить",
|
||||||
"turn_on": "Включить",
|
"turn_on": "Включить",
|
||||||
"undo": "Отменить",
|
"undo": "Отменить",
|
||||||
@@ -69,12 +66,12 @@
|
|||||||
"copy_interface_type": "Copy interface type",
|
"copy_interface_type": "Copy interface type",
|
||||||
"copy_user_id": "Копировать токен пользователя",
|
"copy_user_id": "Копировать токен пользователя",
|
||||||
"developer_option": "Настройки разработчика",
|
"developer_option": "Настройки разработчика",
|
||||||
"developer_option_description": "Инструмент разработчика помогает обслуживать и развивать Hoppscotch",
|
"developer_option_description": "Инструмент разработчика помогает обслуживить и развивить Hoppscotch",
|
||||||
"discord": "Discord",
|
"discord": "Discord",
|
||||||
"documentation": "Документация",
|
"documentation": "Документация",
|
||||||
"github": "GitHub",
|
"github": "GitHub",
|
||||||
"help": "Справка, отзывы и документация",
|
"help": "Справка, отзывы и документация",
|
||||||
"home": "На главную",
|
"home": "Дом",
|
||||||
"invite": "Пригласить",
|
"invite": "Пригласить",
|
||||||
"invite_description": "В Hoppscotch мы разработали простой и интуитивно понятный интерфейс для создания и управления вашими API. Hoppscotch - это инструмент, который помогает создавать, тестировать, документировать и делиться своими API.",
|
"invite_description": "В Hoppscotch мы разработали простой и интуитивно понятный интерфейс для создания и управления вашими API. Hoppscotch - это инструмент, который помогает создавать, тестировать, документировать и делиться своими API.",
|
||||||
"invite_your_friends": "Пригласить своих друзей",
|
"invite_your_friends": "Пригласить своих друзей",
|
||||||
@@ -88,7 +85,7 @@
|
|||||||
"reload": "Перезагрузить",
|
"reload": "Перезагрузить",
|
||||||
"search": "Поиск",
|
"search": "Поиск",
|
||||||
"share": "Поделиться",
|
"share": "Поделиться",
|
||||||
"shortcuts": "Горячие клавиши",
|
"shortcuts": "Ярлыки",
|
||||||
"social_description": "Подписывайся на наши соц. сети и оставайся всегда в курсе последних новостей, обновлений и релизов.",
|
"social_description": "Подписывайся на наши соц. сети и оставайся всегда в курсе последних новостей, обновлений и релизов.",
|
||||||
"social_links": "Социальные сети",
|
"social_links": "Социальные сети",
|
||||||
"spotlight": "Прожектор",
|
"spotlight": "Прожектор",
|
||||||
@@ -99,19 +96,17 @@
|
|||||||
"type_a_command_search": "Введите команду или выполните поиск…",
|
"type_a_command_search": "Введите команду или выполните поиск…",
|
||||||
"we_use_cookies": "Мы используем куки",
|
"we_use_cookies": "Мы используем куки",
|
||||||
"whats_new": "Что нового?",
|
"whats_new": "Что нового?",
|
||||||
"wiki": "Узнать больше"
|
"wiki": "Вики"
|
||||||
},
|
},
|
||||||
"auth": {
|
"auth": {
|
||||||
"account_exists": "Учетная запись существует с разными учетными данными - войдите, чтобы связать обе учетные записи",
|
"account_exists": "Учетная запись существует с разными учетными данными - войдите, чтобы связать обе учетные записи",
|
||||||
"all_sign_in_options": "Все варианты входа",
|
"all_sign_in_options": "Все варианты входа",
|
||||||
"continue_with_auth_provider": "Continue with {provider}",
|
|
||||||
"continue_with_email": "Продолжить с электронной почтой",
|
"continue_with_email": "Продолжить с электронной почтой",
|
||||||
"continue_with_github": "Продолжить с GitHub",
|
"continue_with_github": "Продолжить с GitHub",
|
||||||
"continue_with_github_enterprise": "Continue with GitHub Enterprise",
|
|
||||||
"continue_with_google": "Продолжить с Google",
|
"continue_with_google": "Продолжить с Google",
|
||||||
"continue_with_microsoft": "Продолжить с Microsoft",
|
"continue_with_microsoft": "Продолжить с Microsoft",
|
||||||
"email": "Электронное письмо",
|
"email": "Электронное письмо",
|
||||||
"logged_out": "Успешно вышли. Будем скучать!",
|
"logged_out": "Вышли из",
|
||||||
"login": "Авторизоваться",
|
"login": "Авторизоваться",
|
||||||
"login_success": "Успешный вход в систему",
|
"login_success": "Успешный вход в систему",
|
||||||
"login_to_hoppscotch": "Войти в Hoppscotch",
|
"login_to_hoppscotch": "Войти в Hoppscotch",
|
||||||
@@ -126,7 +121,7 @@
|
|||||||
"generate_token": "Сгенерировать токен",
|
"generate_token": "Сгенерировать токен",
|
||||||
"graphql_headers": "Authorization Headers are sent as part of the payload to connection_init",
|
"graphql_headers": "Authorization Headers are sent as part of the payload to connection_init",
|
||||||
"include_in_url": "Добавить в URL",
|
"include_in_url": "Добавить в URL",
|
||||||
"inherited_from": "Унаследован тип аутентификации {auth} из родительской коллекции {collection}",
|
"inherited_from": "Inherited {auth} from parent collection {collection} ",
|
||||||
"learn": "Узнать больше",
|
"learn": "Узнать больше",
|
||||||
"oauth": {
|
"oauth": {
|
||||||
"redirect_auth_server_returned_error": "Auth Server returned an error state",
|
"redirect_auth_server_returned_error": "Auth Server returned an error state",
|
||||||
@@ -140,32 +135,11 @@
|
|||||||
"redirect_no_token_endpoint": "No Token Endpoint Defined",
|
"redirect_no_token_endpoint": "No Token Endpoint Defined",
|
||||||
"something_went_wrong_on_oauth_redirect": "Something went wrong during OAuth Redirect",
|
"something_went_wrong_on_oauth_redirect": "Something went wrong during OAuth Redirect",
|
||||||
"something_went_wrong_on_token_generation": "Something went wrong on token generation",
|
"something_went_wrong_on_token_generation": "Something went wrong on token generation",
|
||||||
"token_generation_oidc_discovery_failed": "Failure on token generation: OpenID Connect Discovery Failed",
|
"token_generation_oidc_discovery_failed": "Failure on token generation: OpenID Connect Discovery Failed"
|
||||||
"grant_type": "Grant Type",
|
|
||||||
"grant_type_auth_code": "Authorization Code",
|
|
||||||
"token_fetched_successfully": "Token fetched successfully",
|
|
||||||
"token_fetch_failed": "Failed to fetch token",
|
|
||||||
"validation_failed": "Validation Failed, please check the form fields",
|
|
||||||
"label_authorization_endpoint": "Authorization Endpoint",
|
|
||||||
"label_client_id": "Client ID",
|
|
||||||
"label_client_secret": "Client Secret",
|
|
||||||
"label_code_challenge": "Code Challenge",
|
|
||||||
"label_code_challenge_method": "Code Challenge Method",
|
|
||||||
"label_code_verifier": "Code Verifier",
|
|
||||||
"label_scopes": "Scopes",
|
|
||||||
"label_token_endpoint": "Token Endpoint",
|
|
||||||
"label_use_pkce": "Use PKCE",
|
|
||||||
"label_implicit": "Implicit",
|
|
||||||
"label_password": "Password",
|
|
||||||
"label_username": "Username",
|
|
||||||
"label_auth_code": "Authorization Code",
|
|
||||||
"label_client_credentials": "Client Credentials"
|
|
||||||
},
|
},
|
||||||
"pass_by_headers_label": "Headers",
|
|
||||||
"pass_by_query_params_label": "Query Parameters",
|
|
||||||
"pass_key_by": "Pass by",
|
"pass_key_by": "Pass by",
|
||||||
"password": "Пароль",
|
"password": "Пароль",
|
||||||
"save_to_inherit": "Чтобы унаследовать аутентификации, нужно сохранить запрос в коллекции",
|
"save_to_inherit": "Please save this request in any collection to inherit the authorization",
|
||||||
"token": "Токен",
|
"token": "Токен",
|
||||||
"type": "Метод авторизации",
|
"type": "Метод авторизации",
|
||||||
"username": "Имя пользователя"
|
"username": "Имя пользователя"
|
||||||
@@ -175,7 +149,6 @@
|
|||||||
"different_parent": "Нельзя сортировать коллекцию с разной родительской коллекцией",
|
"different_parent": "Нельзя сортировать коллекцию с разной родительской коллекцией",
|
||||||
"edit": "Редактировать коллекцию",
|
"edit": "Редактировать коллекцию",
|
||||||
"import_or_create": "Вы можете импортировать существующую или создать новую коллекцию",
|
"import_or_create": "Вы можете импортировать существующую или создать новую коллекцию",
|
||||||
"import_collection": "Импортировать коллекцию",
|
|
||||||
"invalid_name": "Укажите допустимое название коллекции",
|
"invalid_name": "Укажите допустимое название коллекции",
|
||||||
"invalid_root_move": "Коллекция уже в корне",
|
"invalid_root_move": "Коллекция уже в корне",
|
||||||
"moved": "Перемещено успешно",
|
"moved": "Перемещено успешно",
|
||||||
@@ -184,36 +157,38 @@
|
|||||||
"name_length_insufficient": "Имя коллекции должно иметь 3 или более символов",
|
"name_length_insufficient": "Имя коллекции должно иметь 3 или более символов",
|
||||||
"new": "Создать коллекцию",
|
"new": "Создать коллекцию",
|
||||||
"order_changed": "Порядок коллекции обновлён",
|
"order_changed": "Порядок коллекции обновлён",
|
||||||
"properties": "Параметры коллекции",
|
"properties": "Collection Properties",
|
||||||
"properties_updated": "Параметры коллекции обновлены",
|
"properties_updated": "Collection Properties Updated",
|
||||||
"renamed": "Коллекция переименована",
|
"renamed": "Коллекция переименована",
|
||||||
"request_in_use": "Запрос обрабатывается",
|
"request_in_use": "Запрос обрабатывается",
|
||||||
"save_as": "Сохранить как",
|
"save_as": "Сохранить как",
|
||||||
"save_to_collection": "Сохранить в коллекцию",
|
"save_to_collection": "Сохранить в коллекцию",
|
||||||
"select": "Выбрать коллекцию",
|
"select": "Выбрать коллекцию",
|
||||||
"select_location": "Выберите местоположение"
|
"select_location": "Выберите местоположение",
|
||||||
|
"select_team": "Выберите команду",
|
||||||
|
"team_collections": "Коллекции команд"
|
||||||
},
|
},
|
||||||
"confirm": {
|
"confirm": {
|
||||||
"close_unsaved_tab": "Вы уверены, что хотите закрыть эту вкладку?",
|
"close_unsaved_tab": "Вы уверены что хотите закрыть эту вкладку?",
|
||||||
"close_unsaved_tabs": "Вы уверены, что хотите закрыть все эти вкладки? Несохранённые данные {count} вкладок будут утеряны.",
|
"close_unsaved_tabs": "Вы уверены что хотите закрыть все эти вкладки? Несохранённые данные {count} вкладок будут утеряны.",
|
||||||
"exit_team": "Вы точно хотите покинуть эту команду?",
|
"exit_team": "Вы точно хотите покинуть эту команду?",
|
||||||
"logout": "Вы действительно хотите выйти?",
|
"logout": "Вы действительно хотите выйти?",
|
||||||
"remove_collection": "Вы уверены, что хотите навсегда удалить эту коллекцию?",
|
"remove_collection": "Вы уверены, что хотите навсегда удалить эту коллекцию?",
|
||||||
"remove_environment": "Вы действительно хотите удалить это окружение без возможности восстановления?",
|
"remove_environment": "Вы действительно хотите удалить эту среду без возможности восстановления?",
|
||||||
"remove_folder": "Вы уверены, что хотите навсегда удалить эту папку?",
|
"remove_folder": "Вы уверены, что хотите навсегда удалить эту папку?",
|
||||||
"remove_history": "Вы уверены, что хотите навсегда удалить всю историю?",
|
"remove_history": "Вы уверены, что хотите навсегда удалить всю историю?",
|
||||||
"remove_request": "Вы уверены, что хотите навсегда удалить этот запрос?",
|
"remove_request": "Вы уверены, что хотите навсегда удалить этот запрос?",
|
||||||
"remove_shared_request": "Вы уверены, что хотите навсегда удалить этот запрос?",
|
"remove_shared_request": "Are you sure you want to permanently delete this shared request?",
|
||||||
"remove_team": "Вы уверены, что хотите удалить эту команду?",
|
"remove_team": "Вы уверены, что хотите удалить эту команду?",
|
||||||
"remove_telemetry": "Вы действительно хотите отказаться от телеметрии?",
|
"remove_telemetry": "Вы действительно хотите отказаться от телеметрии?",
|
||||||
"request_change": "Вы уверены, что хотите сбросить текущий запрос, все не сохранённые данные будт утеряны?",
|
"request_change": "Вы уверены что хотите сбросить текущий запрос, все не сохранённые данные будт утеряны?",
|
||||||
"save_unsaved_tab": "Вы хотите сохранить изменения в этой вкладке?",
|
"save_unsaved_tab": "Вы хотите сохранить изменения в этой вкладке?",
|
||||||
"sync": "Вы уверены, что хотите синхронизировать это рабочее пространство?"
|
"sync": "Вы уверены, что хотите синхронизировать это рабочее пространство?"
|
||||||
},
|
},
|
||||||
"context_menu": {
|
"context_menu": {
|
||||||
"add_parameters": "Добавить в список параметров",
|
"add_parameters": "Add to parameters",
|
||||||
"open_request_in_new_tab": "Открыть запрос в новом окне",
|
"open_request_in_new_tab": "Open request in new tab",
|
||||||
"set_environment_variable": "Добавить значение в переменную"
|
"set_environment_variable": "Set as variable"
|
||||||
},
|
},
|
||||||
"cookies": {
|
"cookies": {
|
||||||
"modal": {
|
"modal": {
|
||||||
@@ -252,25 +227,24 @@
|
|||||||
"collections": "Коллекции пустые",
|
"collections": "Коллекции пустые",
|
||||||
"documentation": "Подключите GraphQL endpoint, чтобы увидеть документацию.",
|
"documentation": "Подключите GraphQL endpoint, чтобы увидеть документацию.",
|
||||||
"endpoint": "Endpoint не может быть пустым",
|
"endpoint": "Endpoint не может быть пустым",
|
||||||
"environments": "Переменных окружения нет",
|
"environments": "Окружения пусты",
|
||||||
"folder": "Папка пуста",
|
"folder": "Папка пуста",
|
||||||
"headers": "У этого запроса нет заголовков",
|
"headers": "У этого запроса нет заголовков",
|
||||||
"history": "История пуста",
|
"history": "История пуста",
|
||||||
"invites": "Вы еще никого не приглашали",
|
"invites": "Вы еще никого не приглашали",
|
||||||
"members": "В этой команде еще нет участников",
|
"members": "В этой команде еще нет участников",
|
||||||
"parameters": "Этот запрос не содержит параметров",
|
"parameters": "Этот запрос не имеет параметров",
|
||||||
"pending_invites": "Пока что нет ожидающих заявок на вступление в команду",
|
"pending_invites": "Пока что нет ожидающих заявок на вступление в команду",
|
||||||
"profile": "Войдите, чтобы просмотреть свой профиль",
|
"profile": "Войдите, чтобы просмотреть свой профиль",
|
||||||
"protocols": "Протоколы пустые",
|
"protocols": "Протоколы пустые",
|
||||||
"request_variables": "Этот запрос не содержит никаких переменных",
|
|
||||||
"secret_environments": "Секреты хранятся только на этом устройстве и не синхронизируются с сервером",
|
|
||||||
"schema": "Подключиться к конечной точке GraphQL",
|
"schema": "Подключиться к конечной точке GraphQL",
|
||||||
"shared_requests": "Вы еще не делились запросами с другими",
|
"shared_requests": "Shared requests are empty",
|
||||||
"shared_requests_logout": "Нужно войти, чтобы делиться запросами и управлять ими",
|
"shared_requests_logout": "Login to view your shared requests or create a new one",
|
||||||
"subscription": "Нет подписок",
|
"subscription": "Нет подписок",
|
||||||
"team_name": "Название команды пусто",
|
"team_name": "Название команды пусто",
|
||||||
"teams": "Команды пустые",
|
"teams": "Команды пустые",
|
||||||
"tests": "Для этого запроса нет тестов"
|
"tests": "Для этого запроса нет тестов",
|
||||||
|
"shortcodes": "Нет коротких ссылок"
|
||||||
},
|
},
|
||||||
"environment": {
|
"environment": {
|
||||||
"add_to_global": "Добавить в глобальное окружение",
|
"add_to_global": "Добавить в глобальное окружение",
|
||||||
@@ -278,57 +252,53 @@
|
|||||||
"create_new": "Создать новое окружение",
|
"create_new": "Создать новое окружение",
|
||||||
"created": "Окружение создано",
|
"created": "Окружение создано",
|
||||||
"deleted": "Окружение удалено",
|
"deleted": "Окружение удалено",
|
||||||
"duplicated": "Окружение продублировано",
|
"duplicated": "Environment duplicated",
|
||||||
"edit": "Редактировать окружение",
|
"edit": "Редактировать окружение",
|
||||||
"empty_variables": "Переменные еще не добавлены",
|
"empty_variables": "No variables",
|
||||||
"global": "Global",
|
"global": "Global",
|
||||||
"global_variables": "Глобальные переменные",
|
"global_variables": "Global variables",
|
||||||
"import_or_create": "Импортировать или создать новое окружение",
|
"import_or_create": "Импортировать или создать новое окружение",
|
||||||
"invalid_name": "Укажите допустимое имя для окружения",
|
"invalid_name": "Укажите допустимое имя для окружения",
|
||||||
"list": "Переменные окружения",
|
"list": "Переменные окружения",
|
||||||
"my_environments": "Мои окружения",
|
"my_environments": "Мои окружения",
|
||||||
"name": "Имя",
|
"name": "Name",
|
||||||
"nested_overflow": "максимальный уровень вложения переменных окружения - 10",
|
"nested_overflow": "максимальный уровень вложения переменных окружения - 10",
|
||||||
"new": "Новая среда",
|
"new": "Новая среда",
|
||||||
"no_active_environment": "Нет активных окружений",
|
"no_active_environment": "Нет активных окружений",
|
||||||
"no_environment": "Нет окружения",
|
"no_environment": "Нет окружения",
|
||||||
"no_environment_description": "Не выбрано окружение, выберите что делать с переменными.",
|
"no_environment_description": "Не выбрано окружение, выберите что делать с переменными.",
|
||||||
"quick_peek": "Быстрый просмотр переменных",
|
"quick_peek": "Environment Quick Peek",
|
||||||
"replace_with_variable": "Replace with variable",
|
"replace_with_variable": "Replace with variable",
|
||||||
"scope": "Scope",
|
"scope": "Scope",
|
||||||
"secrets": "Секретные переменные",
|
|
||||||
"secret_value": "Секретное значение",
|
|
||||||
"select": "Выберите среду",
|
"select": "Выберите среду",
|
||||||
"set": "Выбрать окружение",
|
"set": "Set environment",
|
||||||
"set_as_environment": "Поместить значение в переменную",
|
"set_as_environment": "Set as environment",
|
||||||
"team_environments": "Окружения команды",
|
"team_environments": "Окружения команды",
|
||||||
"title": "Окружения",
|
"title": "Окружения",
|
||||||
"updated": "Окружение обновлено",
|
"updated": "Окружение обновлено",
|
||||||
"value": "Значение",
|
"value": "Value",
|
||||||
"variable": "Переменная",
|
"variable": "Variable",
|
||||||
"variables": "Переменные",
|
|
||||||
"variable_list": "Список переменных"
|
"variable_list": "Список переменных"
|
||||||
},
|
},
|
||||||
"error": {
|
"error": {
|
||||||
"authproviders_load_error": "Unable to load auth providers",
|
"authproviders_load_error": "Unable to load auth providers",
|
||||||
"browser_support_sse": "Похоже, в этом браузере нет поддержки событий, отправленных сервером.",
|
"browser_support_sse": "Похоже, в этом браузере нет поддержки событий, отправленных сервером.",
|
||||||
"check_console_details": "Подробности смотрите в журнале консоли.",
|
"check_console_details": "Подробности смотрите в журнале консоли.",
|
||||||
"check_how_to_add_origin": "Инструкция как это сделать",
|
"check_how_to_add_origin": "Инструкция как добавить origin в настройки расширения",
|
||||||
"curl_invalid_format": "cURL неправильно отформатирован",
|
"curl_invalid_format": "cURL неправильно отформатирован",
|
||||||
"danger_zone": "Опасная зона",
|
"danger_zone": "Опасная зона",
|
||||||
"delete_account": "Вы являетесь владельцем этой команды:",
|
"delete_account": "Вы являетесь владельцем этой команды:",
|
||||||
"delete_account_description": "Прежде чем удалить аккаунт вам необходимо либо назначить владельцом другого пользователя, либо удалить команды в которых вы являетесь владельцем.",
|
"delete_account_description": "Прежде чем удалить аккаунт вам необходимо либо назначить владельцом другого пользователя, либо удалить команды в которых вы являетесь владельцем.",
|
||||||
"empty_profile_name": "Имя пользователя не может быть пустым",
|
|
||||||
"empty_req_name": "Пустое имя запроса",
|
"empty_req_name": "Пустое имя запроса",
|
||||||
"f12_details": "(F12 для подробностей)",
|
"f12_details": "(F12 для подробностей)",
|
||||||
"gql_prettify_invalid_query": "Не удалось отформатировать, т.к. в запросе есть синтаксические ошибки. Устраните их и повторите попытку.",
|
"gql_prettify_invalid_query": "Не удалось определить недопустимый запрос, устранить синтаксические ошибки запроса и повторить попытку.",
|
||||||
"incomplete_config_urls": "Не заполнены URL конфигурации",
|
"incomplete_config_urls": "Не заполнены URL конфигурации",
|
||||||
"incorrect_email": "Не корректный Email",
|
"incorrect_email": "Не корректный Email",
|
||||||
"invalid_link": "Не корректная ссылка",
|
"invalid_link": "Не корректная ссылка",
|
||||||
"invalid_link_description": "Ссылка, по которой вы перешли, - недействительна, либо срок ее действия истек.",
|
"invalid_link_description": "Ссылка, по которой вы перешли, - недействительна, либо срок ее действия истек.",
|
||||||
"invalid_embed_link": "The embed does not exist or is invalid.",
|
"invalid_embed_link": "The embed does not exist or is invalid.",
|
||||||
"json_parsing_failed": "Не корректный JSON",
|
"json_parsing_failed": "Не корректный JSON",
|
||||||
"json_prettify_invalid_body": "Не удалось определить формат строки, устраните синтаксические ошибки и повторите попытку.",
|
"json_prettify_invalid_body": "Не удалось определить недопустимое тело, устранить синтаксические ошибки json и повторить попытку.",
|
||||||
"network_error": "Похоже, возникла проблема с соединением. Попробуйте еще раз.",
|
"network_error": "Похоже, возникла проблема с соединением. Попробуйте еще раз.",
|
||||||
"network_fail": "Не удалось отправить запрос",
|
"network_fail": "Не удалось отправить запрос",
|
||||||
"no_collections_to_export": "Нечего экспортировать. Для начала нужно создать коллекцию.",
|
"no_collections_to_export": "Нечего экспортировать. Для начала нужно создать коллекцию.",
|
||||||
@@ -336,10 +306,8 @@
|
|||||||
"no_environments_to_export": "Нечего экспортировать. Для начала нужно создать переменные окружения.",
|
"no_environments_to_export": "Нечего экспортировать. Для начала нужно создать переменные окружения.",
|
||||||
"no_results_found": "Совпадения не найдены",
|
"no_results_found": "Совпадения не найдены",
|
||||||
"page_not_found": "Эта страница не найдена",
|
"page_not_found": "Эта страница не найдена",
|
||||||
"please_install_extension": "Ничего страшного. Просто нужно установить специальное расширение в браузере.",
|
"please_install_extension": "Нужно установить специальное расширение и добавить этот домен как новый origin в настройках расширения.",
|
||||||
"proxy_error": "Proxy error",
|
"proxy_error": "Proxy error",
|
||||||
"reading_files": "Произошла ошибка при чтении файла или нескольких файлов",
|
|
||||||
"same_profile_name": "Задано имя пользователя такое же как и было",
|
|
||||||
"script_fail": "Не удалось выполнить сценарий предварительного запроса",
|
"script_fail": "Не удалось выполнить сценарий предварительного запроса",
|
||||||
"something_went_wrong": "Что-то пошло не так",
|
"something_went_wrong": "Что-то пошло не так",
|
||||||
"test_script_fail": "Не удалось выполнить тестирование запроса"
|
"test_script_fail": "Не удалось выполнить тестирование запроса"
|
||||||
@@ -347,12 +315,13 @@
|
|||||||
"export": {
|
"export": {
|
||||||
"as_json": "Экспорт как JSON",
|
"as_json": "Экспорт как JSON",
|
||||||
"create_secret_gist": "Создать секретный Gist",
|
"create_secret_gist": "Создать секретный Gist",
|
||||||
"create_secret_gist_tooltip_text": "Экспортировать как секретный Gist",
|
"create_secret_gist_tooltip_text": "Export as secret Gist",
|
||||||
"failed": "Произошла ошибка во время экспорта",
|
"failed": "Something went wrong while exporting",
|
||||||
"secret_gist_success": "Успешно экспортировано как секретный Gist",
|
"secret_gist_success": "Successfully exported as secret Gist",
|
||||||
"require_github": "Войдите через GitHub, чтобы создать секретную суть",
|
"require_github": "Войдите через GitHub, чтобы создать секретную суть",
|
||||||
"title": "Экспорт",
|
"title": "Экспорт",
|
||||||
"success": "Успешно экспортировано"
|
"success": "Successfully exported",
|
||||||
|
"gist_created": "Gist создан"
|
||||||
},
|
},
|
||||||
"filter": {
|
"filter": {
|
||||||
"all": "Все",
|
"all": "Все",
|
||||||
@@ -377,7 +346,7 @@
|
|||||||
"switch_connection": "Изменить соединение"
|
"switch_connection": "Изменить соединение"
|
||||||
},
|
},
|
||||||
"graphql_collections": {
|
"graphql_collections": {
|
||||||
"title": "Коллекции GraphQL"
|
"title": "GraphQL Collections"
|
||||||
},
|
},
|
||||||
"group": {
|
"group": {
|
||||||
"time": "Время",
|
"time": "Время",
|
||||||
@@ -390,8 +359,8 @@
|
|||||||
},
|
},
|
||||||
"helpers": {
|
"helpers": {
|
||||||
"authorization": "Заголовок авторизации будет автоматически сгенерирован при отправке запроса.",
|
"authorization": "Заголовок авторизации будет автоматически сгенерирован при отправке запроса.",
|
||||||
"collection_properties_authorization": "Этот заголовок авторизации будет подставляться при каждом запросе в этой коллекции.",
|
"collection_properties_authorization": " This authorization will be set for every request in this collection.",
|
||||||
"collection_properties_header": "Этот заголовок будет подставляться при каждом запросе в этой коллекции.",
|
"collection_properties_header": "This header will be set for every request in this collection.",
|
||||||
"generate_documentation_first": "Сначала создайте документацию",
|
"generate_documentation_first": "Сначала создайте документацию",
|
||||||
"network_fail": "Невозможно достичь конечной точки API. Проверьте подключение к сети и попробуйте еще раз.",
|
"network_fail": "Невозможно достичь конечной точки API. Проверьте подключение к сети и попробуйте еще раз.",
|
||||||
"offline": "Кажется, вы не в сети. Данные в этой рабочей области могут быть устаревшими.",
|
"offline": "Кажется, вы не в сети. Данные в этой рабочей области могут быть устаревшими.",
|
||||||
@@ -411,12 +380,10 @@
|
|||||||
"import": {
|
"import": {
|
||||||
"collections": "Импортировать коллекции",
|
"collections": "Импортировать коллекции",
|
||||||
"curl": "Импортировать из cURL",
|
"curl": "Импортировать из cURL",
|
||||||
"environments_from_gist": "Импортировать из Gist",
|
"environments_from_gist": "Import From Gist",
|
||||||
"environments_from_gist_description": "Импортировать переменные окружения Hoppscotch из Gist",
|
"environments_from_gist_description": "Import Hoppscotch Environments From Gist",
|
||||||
"failed": "Ошибка импорта",
|
"failed": "Ошибка импорта",
|
||||||
"file_size_limit_exceeded_warning_multiple_files": "Выбранные файлы превышают рекомендованный лимит в 10MB. Были импортированы только первые {files}",
|
"from_file": "Import from File",
|
||||||
"file_size_limit_exceeded_warning_single_file": "Размер выбранного в данный момент файла превышает рекомендуемый лимит в 10 МБ. Пожалуйста, выберите другой файл.",
|
|
||||||
"from_file": "Импортировать из одного или нескольких файлов",
|
|
||||||
"from_gist": "Импорт из Gist",
|
"from_gist": "Импорт из Gist",
|
||||||
"from_gist_description": "Импортировать через Gist URL",
|
"from_gist_description": "Импортировать через Gist URL",
|
||||||
"from_insomnia": "Импортировать с Insomnia",
|
"from_insomnia": "Импортировать с Insomnia",
|
||||||
@@ -431,9 +398,9 @@
|
|||||||
"from_postman_description": "Импортировать из коллекции Postman",
|
"from_postman_description": "Импортировать из коллекции Postman",
|
||||||
"from_url": "Импортировать из URL",
|
"from_url": "Импортировать из URL",
|
||||||
"gist_url": "Введите URL-адрес Gist",
|
"gist_url": "Введите URL-адрес Gist",
|
||||||
"gql_collections_from_gist_description": "Импортировать GraphQL коллекцию из Gist",
|
"gql_collections_from_gist_description": "Import GraphQL Collections From Gist",
|
||||||
"hoppscotch_environment": "Hoppscotch Environment",
|
"hoppscotch_environment": "Hoppscotch Environment",
|
||||||
"hoppscotch_environment_description": "Импортировать окружение Hoppscotch из JSON файла",
|
"hoppscotch_environment_description": "Import Hoppscotch Environment JSON file",
|
||||||
"import_from_url_invalid_fetch": "Не удалить получить данные по этому URL",
|
"import_from_url_invalid_fetch": "Не удалить получить данные по этому URL",
|
||||||
"import_from_url_invalid_file_format": "Ошибка при импорте коллекций",
|
"import_from_url_invalid_file_format": "Ошибка при импорте коллекций",
|
||||||
"import_from_url_invalid_type": "Неподдерживаемый тип. Поддерживаемые типы: 'hoppscotch', 'openapi', 'postman', 'insomnia'",
|
"import_from_url_invalid_type": "Неподдерживаемый тип. Поддерживаемые типы: 'hoppscotch', 'openapi', 'postman', 'insomnia'",
|
||||||
@@ -442,19 +409,16 @@
|
|||||||
"json_description": "Импортировать из коллекции Hoppscotch",
|
"json_description": "Импортировать из коллекции Hoppscotch",
|
||||||
"postman_environment": "Postman Environment",
|
"postman_environment": "Postman Environment",
|
||||||
"postman_environment_description": "Import Postman Environment from a JSON file",
|
"postman_environment_description": "Import Postman Environment from a JSON file",
|
||||||
"success": "Успешно импортировано",
|
|
||||||
"title": "Импортировать"
|
"title": "Импортировать"
|
||||||
},
|
},
|
||||||
"inspections": {
|
"inspections": {
|
||||||
"description": "Показать возможные ошибки",
|
"description": "Inspect possible errors",
|
||||||
"environment": {
|
"environment": {
|
||||||
"add_environment": "Добавить переменную",
|
"add_environment": "Add to Environment",
|
||||||
"add_environment_value": "Заполнить значение",
|
"not_found": "Environment variable “{environment}” not found."
|
||||||
"empty_value": "Значение переменной окружения '{variable}' пустое",
|
|
||||||
"not_found": "Переменная окружения “{environment}” не задана."
|
|
||||||
},
|
},
|
||||||
"header": {
|
"header": {
|
||||||
"cookie": "Из-за ограничений безопасности в веб версии нельзя задать Cookie параметры. Пожалуйста, используйте Hoppscotch Desktop приложение или используйте заголовок Authorization вместо этого."
|
"cookie": "The browser doesn't allow Hoppscotch to set the Cookie Header. While we're working on the Hoppscotch Desktop App (coming soon), please use the Authorization Header instead."
|
||||||
},
|
},
|
||||||
"response": {
|
"response": {
|
||||||
"401_error": "Please check your authentication credentials.",
|
"401_error": "Please check your authentication credentials.",
|
||||||
@@ -463,12 +427,12 @@
|
|||||||
"default_error": "Please check your request.",
|
"default_error": "Please check your request.",
|
||||||
"network_error": "Please check your network connection."
|
"network_error": "Please check your network connection."
|
||||||
},
|
},
|
||||||
"title": "Помощник",
|
"title": "Inspector",
|
||||||
"url": {
|
"url": {
|
||||||
"extension_not_installed": "Расширение не установлено.",
|
"extension_not_installed": "Extension not installed.",
|
||||||
"extension_unknown_origin": "Убедитесь, что текущий домен добавлен в список доверенных ресурсов в расширении браузера",
|
"extension_unknown_origin": "Make sure you've added the API endpoint's origin to the Hoppscotch Browser Extension list.",
|
||||||
"extention_enable_action": "Подключить расширение",
|
"extention_enable_action": "Enable Browser Extension",
|
||||||
"extention_not_enabled": "Расширение в браузере не подключено."
|
"extention_not_enabled": "Extension not enabled."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"layout": {
|
"layout": {
|
||||||
@@ -481,11 +445,11 @@
|
|||||||
"modal": {
|
"modal": {
|
||||||
"close_unsaved_tab": "У вас есть не сохранённые изменения",
|
"close_unsaved_tab": "У вас есть не сохранённые изменения",
|
||||||
"collections": "Коллекции",
|
"collections": "Коллекции",
|
||||||
"confirm": "Подтвердите действие",
|
"confirm": "Подтверждать",
|
||||||
"customize_request": "Customize Request",
|
"customize_request": "Customize Request",
|
||||||
"edit_request": "Изменить запрос",
|
"edit_request": "Изменить запрос",
|
||||||
"import_export": "Импорт Экспорт",
|
"import_export": "Импорт Экспорт",
|
||||||
"share_request": "Поделиться запросом"
|
"share_request": "Share Request"
|
||||||
},
|
},
|
||||||
"mqtt": {
|
"mqtt": {
|
||||||
"already_subscribed": "Вы уже подписаны на этот топик",
|
"already_subscribed": "Вы уже подписаны на этот топик",
|
||||||
@@ -521,7 +485,7 @@
|
|||||||
"doc": "Документы",
|
"doc": "Документы",
|
||||||
"graphql": "GraphQL",
|
"graphql": "GraphQL",
|
||||||
"profile": "Профиль",
|
"profile": "Профиль",
|
||||||
"realtime": "Realtime",
|
"realtime": "В реальном времени",
|
||||||
"rest": "REST",
|
"rest": "REST",
|
||||||
"settings": "Настройки"
|
"settings": "Настройки"
|
||||||
},
|
},
|
||||||
@@ -543,8 +507,8 @@
|
|||||||
"roles": "Роли",
|
"roles": "Роли",
|
||||||
"roles_description": "Роли позволяют настраивать доступ конкретным людям к публичным коллекциям.",
|
"roles_description": "Роли позволяют настраивать доступ конкретным людям к публичным коллекциям.",
|
||||||
"updated": "Профиль обновлен",
|
"updated": "Профиль обновлен",
|
||||||
"viewer": "Читатель",
|
"viewer": "Зритель",
|
||||||
"viewer_description": "Могут только просматривать и использовать запросы."
|
"viewer_description": "Зрительно могут только просматривать и использовать запросы."
|
||||||
},
|
},
|
||||||
"remove": {
|
"remove": {
|
||||||
"star": "Удалить звезду"
|
"star": "Удалить звезду"
|
||||||
@@ -566,11 +530,11 @@
|
|||||||
"enter_curl": "Введите сюда команду cURL",
|
"enter_curl": "Введите сюда команду cURL",
|
||||||
"generate_code": "Сгенерировать код",
|
"generate_code": "Сгенерировать код",
|
||||||
"generated_code": "Сгенерированный код",
|
"generated_code": "Сгенерированный код",
|
||||||
"go_to_authorization_tab": "Перейти на вкладку авторизации",
|
"go_to_authorization_tab": "Go to Authorization",
|
||||||
"go_to_body_tab": "Перейти на вкладку тела запроса",
|
"go_to_body_tab": "Go to Body tab",
|
||||||
"header_list": "Список заголовков",
|
"header_list": "Список заголовков",
|
||||||
"invalid_name": "Укажите имя для запроса",
|
"invalid_name": "Укажите имя для запроса",
|
||||||
"method": "Метод",
|
"method": "Методика",
|
||||||
"moved": "Запрос перемещён",
|
"moved": "Запрос перемещён",
|
||||||
"name": "Имя запроса",
|
"name": "Имя запроса",
|
||||||
"new": "Новый запрос",
|
"new": "Новый запрос",
|
||||||
@@ -584,22 +548,22 @@
|
|||||||
"payload": "Полезная нагрузка",
|
"payload": "Полезная нагрузка",
|
||||||
"query": "Запрос",
|
"query": "Запрос",
|
||||||
"raw_body": "Необработанное тело запроса",
|
"raw_body": "Необработанное тело запроса",
|
||||||
"rename": "Переименовать запрос",
|
"rename": "Переименость запрос",
|
||||||
"renamed": "Запрос переименован",
|
"renamed": "Запрос переименован",
|
||||||
"request_variables": "Переменные запроса",
|
|
||||||
"run": "Запустить",
|
"run": "Запустить",
|
||||||
"save": "Сохранить",
|
"save": "Сохранить",
|
||||||
"save_as": "Сохранить как",
|
"save_as": "Сохранить как",
|
||||||
"saved": "Запрос сохранен",
|
"saved": "Запрос сохранен",
|
||||||
"share": "Поделиться",
|
"share": "Делиться",
|
||||||
"share_description": "Поделиться Hoppscotch с друзьями",
|
"share_description": "Поделиться Hoppscotch с друзьями",
|
||||||
"share_request": "Поделиться запросом",
|
"share_request": "Share Request",
|
||||||
"stop": "Стоп",
|
"stop": "Stop",
|
||||||
"title": "Запрос",
|
"title": "Запрос",
|
||||||
"type": "Тип запроса",
|
"type": "Тип запроса",
|
||||||
"url": "URL",
|
"url": "URL",
|
||||||
"variables": "Переменные",
|
"variables": "Переменные",
|
||||||
"view_my_links": "Посмотреть мои ссылки"
|
"view_my_links": "Посмотреть мои ссылки",
|
||||||
|
"copy_link": "Копировать ссылку"
|
||||||
},
|
},
|
||||||
"response": {
|
"response": {
|
||||||
"audio": "Аудио",
|
"audio": "Аудио",
|
||||||
@@ -622,7 +586,7 @@
|
|||||||
},
|
},
|
||||||
"settings": {
|
"settings": {
|
||||||
"accent_color": "Основной цвет",
|
"accent_color": "Основной цвет",
|
||||||
"account": "Аккаунт",
|
"account": "Счет",
|
||||||
"account_deleted": "Ваш аккаунт был удалён",
|
"account_deleted": "Ваш аккаунт был удалён",
|
||||||
"account_description": "Настройте параметры своей учетной записи.",
|
"account_description": "Настройте параметры своей учетной записи.",
|
||||||
"account_email_description": "Ваш основной адрес электронной почты.",
|
"account_email_description": "Ваш основной адрес электронной почты.",
|
||||||
@@ -675,29 +639,29 @@
|
|||||||
"verify_email": "Подтвердить Email"
|
"verify_email": "Подтвердить Email"
|
||||||
},
|
},
|
||||||
"shared_requests": {
|
"shared_requests": {
|
||||||
"button": "Кнопка",
|
"button": "Button",
|
||||||
"button_info": "Создать кнопку 'Run in Hoppscotch' на свой сайт, блог или README.",
|
"button_info": "Create a 'Run in Hoppscotch' button for your website, blog or a README.",
|
||||||
"copy_html": "Копировать HTML код",
|
"copy_html": "Copy HTML",
|
||||||
"copy_link": "Копировать ссылку",
|
"copy_link": "Copy Link",
|
||||||
"copy_markdown": "Копировать Markdown",
|
"copy_markdown": "Copy Markdown",
|
||||||
"creating_widget": "Создание виджет",
|
"creating_widget": "Creating widget",
|
||||||
"customize": "Настроить",
|
"customize": "Customize",
|
||||||
"deleted": "Запрос удален",
|
"deleted": "Shared request deleted",
|
||||||
"description": "Выберите вид как вы поделитесь запросом, позже вы сможете дополнительно его настроить",
|
"description": "Select a widget, you can change and customize this later",
|
||||||
"embed": "Встраиваемое окно",
|
"embed": "Embed",
|
||||||
"embed_info": "Добавьте небольшую площадку 'Hoppscotch API Playground' на свой веб-сайт, блог или документацию.",
|
"embed_info": "Add a mini 'Hoppscotch API Playground' to your website, blog or documentation.",
|
||||||
"link": "Ссылка",
|
"link": "Link",
|
||||||
"link_info": "Создайте общедоступную ссылку, которой можно поделиться с любым пользователем, имеющим доступ к просмотру.",
|
"link_info": "Create a shareable link to share with anyone on the internet with view access.",
|
||||||
"modified": "Запрос изменен",
|
"modified": "Shared request modified",
|
||||||
"not_found": "Такой ссылке не нашлось",
|
"not_found": "Shared request not found",
|
||||||
"open_new_tab": "Открыть в новом окне",
|
"open_new_tab": "Open in new tab",
|
||||||
"preview": "Preview",
|
"preview": "Preview",
|
||||||
"run_in_hoppscotch": "Run in Hoppscotch",
|
"run_in_hoppscotch": "Run in Hoppscotch",
|
||||||
"theme": {
|
"theme": {
|
||||||
"dark": "Темная",
|
"dark": "Dark",
|
||||||
"light": "Светлая",
|
"light": "Light",
|
||||||
"system": "Системная",
|
"system": "System",
|
||||||
"title": "Тема"
|
"title": "Theme"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"shortcut": {
|
||||||
@@ -705,7 +669,7 @@
|
|||||||
"close_current_menu": "Закрыть текущее меню",
|
"close_current_menu": "Закрыть текущее меню",
|
||||||
"command_menu": "Меню поиска и команд",
|
"command_menu": "Меню поиска и команд",
|
||||||
"help_menu": "Меню помощи",
|
"help_menu": "Меню помощи",
|
||||||
"show_all": "Список горячих клавиш",
|
"show_all": "Горячие клавиши",
|
||||||
"title": "Общий"
|
"title": "Общий"
|
||||||
},
|
},
|
||||||
"miscellaneous": {
|
"miscellaneous": {
|
||||||
@@ -732,19 +696,20 @@
|
|||||||
"get_method": "Выберите метод GET",
|
"get_method": "Выберите метод GET",
|
||||||
"head_method": "Выберите метод HEAD",
|
"head_method": "Выберите метод HEAD",
|
||||||
"import_curl": "Импортировать из cURL",
|
"import_curl": "Импортировать из cURL",
|
||||||
"method": "Метод",
|
"method": "Методика",
|
||||||
"next_method": "Выберите следующий метод",
|
"next_method": "Выберите следующий метод",
|
||||||
"post_method": "Выберите метод POST",
|
"post_method": "Выберите метод POST",
|
||||||
"previous_method": "Выбрать предыдущий метод",
|
"previous_method": "Выбрать предыдущий метод",
|
||||||
"put_method": "Выберите метод PUT",
|
"put_method": "Выберите метод PUT",
|
||||||
"rename": "Переименовать запрос",
|
"rename": "Переименовать запрос",
|
||||||
"reset_request": "Сбросить запрос",
|
"reset_request": "Сбросить запрос",
|
||||||
"save_request": "Сохранить запрос",
|
"save_request": "Сохарнить запрос",
|
||||||
"save_to_collections": "Сохранить в коллекции",
|
"save_to_collections": "Сохранить в коллекции",
|
||||||
"send_request": "Послать запрос",
|
"send_request": "Послать запрос",
|
||||||
"share_request": "Поделиться запросом",
|
"share_request": "Share Request",
|
||||||
"show_code": "Сгенерировать фрагмент кода из запроса",
|
"show_code": "Generate code snippet",
|
||||||
"title": "Запрос"
|
"title": "Запрос",
|
||||||
|
"copy_request_link": "Копировать ссылку на запрос"
|
||||||
},
|
},
|
||||||
"response": {
|
"response": {
|
||||||
"copy": "Копировать запрос в буфер обмена",
|
"copy": "Копировать запрос в буфер обмена",
|
||||||
@@ -752,11 +717,11 @@
|
|||||||
"title": "Запрос"
|
"title": "Запрос"
|
||||||
},
|
},
|
||||||
"theme": {
|
"theme": {
|
||||||
"black": "Переключить на черный режим",
|
"black": "Черный режим",
|
||||||
"dark": "Переключить на тёмный режим",
|
"dark": "Тёмный режим",
|
||||||
"light": "Переключить на светлый режим",
|
"light": "Светлый режим",
|
||||||
"system": "Переключить на тему, исходя из настроек системы",
|
"system": "Определяется системой",
|
||||||
"title": "Внешний вид"
|
"title": "Тема"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"show": {
|
"show": {
|
||||||
@@ -765,11 +730,6 @@
|
|||||||
"more": "Показать больше",
|
"more": "Показать больше",
|
||||||
"sidebar": "Показать боковую панель"
|
"sidebar": "Показать боковую панель"
|
||||||
},
|
},
|
||||||
"site_protection": {
|
|
||||||
"error_fetching_site_protection_status": "Something Went Wrong While Fetching Site Protection Status",
|
|
||||||
"login_to_continue": "Login to continue",
|
|
||||||
"login_to_continue_description": "You need to be logged in to access this Hoppscotch Enterprise Instance."
|
|
||||||
},
|
|
||||||
"socketio": {
|
"socketio": {
|
||||||
"communication": "Коммуникация",
|
"communication": "Коммуникация",
|
||||||
"connection_not_authorized": "Это SocketIO соединение не использует какую-либо авторизацию.",
|
"connection_not_authorized": "Это SocketIO соединение не использует какую-либо авторизацию.",
|
||||||
@@ -779,89 +739,82 @@
|
|||||||
"url": "URL"
|
"url": "URL"
|
||||||
},
|
},
|
||||||
"spotlight": {
|
"spotlight": {
|
||||||
"change_language": "Изменить язык",
|
"change_language": "Change Language",
|
||||||
"environments": {
|
"environments": {
|
||||||
"delete": "Удалить текущее окружение",
|
"delete": "Delete current environment",
|
||||||
"duplicate": "Дублировать текущее окружение",
|
"duplicate": "Duplicate current environment",
|
||||||
"duplicate_global": "Дублировать глобальное окружение",
|
"duplicate_global": "Duplicate global environment",
|
||||||
"edit": "Редактировать текущее окружение",
|
"edit": "Edit current environment",
|
||||||
"edit_global": "Редактировать глобальное окружение",
|
"edit_global": "Edit global environment",
|
||||||
"new": "Создать новое окружение",
|
"new": "Create new environment",
|
||||||
"new_variable": "Создать новую переменную окружения",
|
"new_variable": "Create a new environment variable",
|
||||||
"title": "Окружение"
|
"title": "Environments"
|
||||||
},
|
},
|
||||||
"general": {
|
"general": {
|
||||||
"chat": "Чат с поддержкой",
|
"chat": "Chat with support",
|
||||||
"help_menu": "Помощь",
|
"help_menu": "Help and support",
|
||||||
"open_docs": "Почитать документацию",
|
"open_docs": "Read Documentation",
|
||||||
"open_github": "Открыть GitHub репозиторий",
|
"open_github": "Open GitHub repository",
|
||||||
"open_keybindings": "Горячие клавиши",
|
"open_keybindings": "Keyboard shortcuts",
|
||||||
"social": "Соц. сети",
|
"social": "Social",
|
||||||
"title": "Общее"
|
"title": "General"
|
||||||
},
|
},
|
||||||
"graphql": {
|
"graphql": {
|
||||||
"connect": "Подключиться к серверу",
|
"connect": "Connect to server",
|
||||||
"disconnect": "Отключиться от сервера"
|
"disconnect": "Disconnect from server"
|
||||||
},
|
},
|
||||||
"miscellaneous": {
|
"miscellaneous": {
|
||||||
"invite": "Пригласить друзей в Hoppscotch",
|
"invite": "Invite your friends to Hoppscotch",
|
||||||
"title": "Другое"
|
"title": "Miscellaneous"
|
||||||
},
|
|
||||||
"phrases": {
|
|
||||||
"create_environment": "Создать окружение",
|
|
||||||
"create_workspace": "Создать пространство",
|
|
||||||
"import_collections": "Импортировать коллекцию",
|
|
||||||
"share_request": "Поделиться запросом",
|
|
||||||
"try": "Попробовать"
|
|
||||||
},
|
},
|
||||||
"request": {
|
"request": {
|
||||||
"save_as_new": "Сохранить как новый запрос",
|
"save_as_new": "Save as new request",
|
||||||
"select_method": "Выбрать метод",
|
"select_method": "Select method",
|
||||||
"switch_to": "Переключиться",
|
"switch_to": "Switch to",
|
||||||
"tab_authorization": "На вкладку авторизации",
|
"tab_authorization": "Authorization tab",
|
||||||
"tab_body": "На вкладку тела запроса",
|
"tab_body": "Body tab",
|
||||||
"tab_headers": "На вкладку заголовков",
|
"tab_headers": "Headers tab",
|
||||||
"tab_parameters": "На вкладку параметров",
|
"tab_parameters": "Parameters tab",
|
||||||
"tab_pre_request_script": "На вкладку пред-скрипта запроса",
|
"tab_pre_request_script": "Pre-request script tab",
|
||||||
"tab_query": "На вкладку запроса",
|
"tab_query": "Query tab",
|
||||||
"tab_tests": "На вкладку тестов",
|
"tab_tests": "Tests tab",
|
||||||
"tab_variables": "На вкладку переменных запроса"
|
"tab_variables": "Variables tab"
|
||||||
},
|
},
|
||||||
"response": {
|
"response": {
|
||||||
"copy": "Копировать содержимое ответа",
|
"copy": "Copy response",
|
||||||
"download": "Сказать содержимое ответа как файл",
|
"download": "Download response as file",
|
||||||
"title": "Ответ запроса"
|
"title": "Response"
|
||||||
},
|
},
|
||||||
"section": {
|
"section": {
|
||||||
"interceptor": "Перехватчик",
|
"interceptor": "Interceptor",
|
||||||
"interface": "Интерфейс",
|
"interface": "Interface",
|
||||||
"theme": "Внешний вид",
|
"theme": "Theme",
|
||||||
"user": "Пользователь"
|
"user": "User"
|
||||||
},
|
},
|
||||||
"settings": {
|
"settings": {
|
||||||
"change_interceptor": "Изменить перехватчик",
|
"change_interceptor": "Change Interceptor",
|
||||||
"change_language": "Изменить язык",
|
"change_language": "Change Language",
|
||||||
"theme": {
|
"theme": {
|
||||||
"black": "Черная",
|
"black": "Black",
|
||||||
"dark": "Темная",
|
"dark": "Dark",
|
||||||
"light": "Светлая",
|
"light": "Light",
|
||||||
"system": "Как задано в системе"
|
"system": "System preference"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tab": {
|
"tab": {
|
||||||
"close_current": "Закрыть текущую вкладку",
|
"close_current": "Close current tab",
|
||||||
"close_others": "Закрыть все вкладки",
|
"close_others": "Close all other tabs",
|
||||||
"duplicate": "Продублировать текущую вкладку",
|
"duplicate": "Duplicate current tab",
|
||||||
"new_tab": "Открыть в новой вкладке",
|
"new_tab": "Open a new tab",
|
||||||
"title": "Вкладки"
|
"title": "Tabs"
|
||||||
},
|
},
|
||||||
"workspace": {
|
"workspace": {
|
||||||
"delete": "Удалить текущую команду",
|
"delete": "Delete current team",
|
||||||
"edit": "Редактировать текущую команду",
|
"edit": "Edit current team",
|
||||||
"invite": "Пригласить людей в команду",
|
"invite": "Invite people to team",
|
||||||
"new": "Создать новую команду",
|
"new": "Create new team",
|
||||||
"switch_to_personal": "Переключить на персональное пространство",
|
"switch_to_personal": "Switch to your personal workspace",
|
||||||
"title": "Команды"
|
"title": "Teams"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sse": {
|
"sse": {
|
||||||
@@ -871,7 +824,7 @@
|
|||||||
},
|
},
|
||||||
"state": {
|
"state": {
|
||||||
"bulk_mode": "Множественное редактирование",
|
"bulk_mode": "Множественное редактирование",
|
||||||
"bulk_mode_placeholder": "Каждый параметр должен начинаться с новой строки\nКлючи и значения разделяются двоеточием\nИспользуйте # для комментария",
|
"bulk_mode_placeholder": "Каждый параметр должен начинаться с новой строки\nКлючи и значения разедляются двоеточием\nИспользуйте # для комментария",
|
||||||
"cleared": "Очищено",
|
"cleared": "Очищено",
|
||||||
"connected": "Связаны",
|
"connected": "Связаны",
|
||||||
"connected_to": "Подключено к {name}",
|
"connected_to": "Подключено к {name}",
|
||||||
@@ -890,20 +843,20 @@
|
|||||||
"download_failed": "Download failed",
|
"download_failed": "Download failed",
|
||||||
"download_started": "Скачивание началось",
|
"download_started": "Скачивание началось",
|
||||||
"enabled": "Включено",
|
"enabled": "Включено",
|
||||||
"file_imported": "Файл успешно импортирован",
|
"file_imported": "Файл импортирован",
|
||||||
"finished_in": "Завершено через {duration} мс",
|
"finished_in": "Завершено через {duration} мс",
|
||||||
"hide": "Скрыть",
|
"hide": "Hide",
|
||||||
"history_deleted": "История удалена",
|
"history_deleted": "История удалена",
|
||||||
"linewrap": "Обернуть линии",
|
"linewrap": "Обернуть линии",
|
||||||
"loading": "Загрузка...",
|
"loading": "Загрузка...",
|
||||||
"message_received": "Сообщение: {message} получено по топику: {topic}",
|
"message_received": "Сообщение: {message} получено по топику: {topic}",
|
||||||
"mqtt_subscription_failed": "Что-то пошло не так, при попытке подписаться на топик: {topic}",
|
"mqtt_subscription_failed": "Что-то пошло не так, при попытке подписаться на топик: {topic}",
|
||||||
"none": "Не задан",
|
"none": "Никто",
|
||||||
"nothing_found": "Ничего не найдено для",
|
"nothing_found": "Ничего не найдено для",
|
||||||
"published_error": "Что-то пошло не так при попытке опубликовать сообщение в топик {topic}: {message}",
|
"published_error": "Что-то пошло не так при попытке опубликовать сообщение в топик {topic}: {message}",
|
||||||
"published_message": "Опубликовано сообщение: {message} в топик: {topic}",
|
"published_message": "Опубликовано сообщение: {message} в топик: {topic}",
|
||||||
"reconnection_error": "Не удалось переподключиться",
|
"reconnection_error": "Не удалось переподключиться",
|
||||||
"show": "Показать",
|
"show": "Show",
|
||||||
"subscribed_failed": "Не удалось подписаться на топик: {topic}",
|
"subscribed_failed": "Не удалось подписаться на топик: {topic}",
|
||||||
"subscribed_success": "Успешно подписался на топик: {topic}",
|
"subscribed_success": "Успешно подписался на топик: {topic}",
|
||||||
"unsubscribed_failed": "Не удалось отписаться от топика: {topic}",
|
"unsubscribed_failed": "Не удалось отписаться от топика: {topic}",
|
||||||
@@ -918,6 +871,7 @@
|
|||||||
"forum": "Задавайте вопросы и получайте ответы",
|
"forum": "Задавайте вопросы и получайте ответы",
|
||||||
"github": "Подпишитесь на нас на Github",
|
"github": "Подпишитесь на нас на Github",
|
||||||
"shortcuts": "Просматривайте приложение быстрее",
|
"shortcuts": "Просматривайте приложение быстрее",
|
||||||
|
"team": "Свяжитесь с командой",
|
||||||
"title": "Служба поддержки",
|
"title": "Служба поддержки",
|
||||||
"twitter": "Следуйте за нами на Twitter"
|
"twitter": "Следуйте за нами на Twitter"
|
||||||
},
|
},
|
||||||
@@ -928,7 +882,7 @@
|
|||||||
"close_others": "Закрыть остальные вкладки",
|
"close_others": "Закрыть остальные вкладки",
|
||||||
"collections": "Коллекции",
|
"collections": "Коллекции",
|
||||||
"documentation": "Документация",
|
"documentation": "Документация",
|
||||||
"duplicate": "Дублировать вкладку",
|
"duplicate": "Duplicate Tab",
|
||||||
"environments": "Окружения",
|
"environments": "Окружения",
|
||||||
"headers": "Заголовки",
|
"headers": "Заголовки",
|
||||||
"history": "История",
|
"history": "История",
|
||||||
@@ -938,8 +892,7 @@
|
|||||||
"queries": "Запросы",
|
"queries": "Запросы",
|
||||||
"query": "Запрос",
|
"query": "Запрос",
|
||||||
"schema": "Схема",
|
"schema": "Схема",
|
||||||
"shared_requests": "Запросы в общем доступе",
|
"shared_requests": "Shared Requests",
|
||||||
"share_tab_request": "Поделиться запросом",
|
|
||||||
"socketio": "Socket.IO",
|
"socketio": "Socket.IO",
|
||||||
"sse": "SSE",
|
"sse": "SSE",
|
||||||
"tests": "Тесты",
|
"tests": "Тесты",
|
||||||
@@ -968,6 +921,7 @@
|
|||||||
"invite_tooltip": "Пригласить людей в Ваше рабочее пространство",
|
"invite_tooltip": "Пригласить людей в Ваше рабочее пространство",
|
||||||
"invited_to_team": "{owner} приглашает Вас присоединиться к команде {team}",
|
"invited_to_team": "{owner} приглашает Вас присоединиться к команде {team}",
|
||||||
"join": "Приглашение принято",
|
"join": "Приглашение принято",
|
||||||
|
"join_beta": "Присоединяйтесь к бета-программе, чтобы получить доступ к командам.",
|
||||||
"join_team": "Присоединиться к {team}",
|
"join_team": "Присоединиться к {team}",
|
||||||
"joined_team": "Вы присоединились к команде {team}",
|
"joined_team": "Вы присоединились к команде {team}",
|
||||||
"joined_team_description": "Теперь Вы участник этой команды",
|
"joined_team_description": "Теперь Вы участник этой команды",
|
||||||
@@ -996,7 +950,6 @@
|
|||||||
"permissions": "Разрешения",
|
"permissions": "Разрешения",
|
||||||
"same_target_destination": "Таже цель и конечная точка",
|
"same_target_destination": "Таже цель и конечная точка",
|
||||||
"saved": "Команда сохранена",
|
"saved": "Команда сохранена",
|
||||||
"search_title": "Team Requests",
|
|
||||||
"select_a_team": "Выбрать команду",
|
"select_a_team": "Выбрать команду",
|
||||||
"success_invites": "Принятые приглашения",
|
"success_invites": "Принятые приглашения",
|
||||||
"title": "Команды",
|
"title": "Команды",
|
||||||
@@ -1028,8 +981,16 @@
|
|||||||
"workspace": {
|
"workspace": {
|
||||||
"change": "Изменить пространство",
|
"change": "Изменить пространство",
|
||||||
"personal": "Моё пространство",
|
"personal": "Моё пространство",
|
||||||
"other_workspaces": "Пространства",
|
|
||||||
"team": "Пространство команды",
|
"team": "Пространство команды",
|
||||||
"title": "Рабочие пространства"
|
"title": "Рабочие пространства"
|
||||||
|
},
|
||||||
|
"shortcodes": {
|
||||||
|
"actions": "Действия",
|
||||||
|
"created_on": "Создано",
|
||||||
|
"deleted": "Удалёна",
|
||||||
|
"method": "Метод",
|
||||||
|
"not_found": "Короткая ссылка не найдена",
|
||||||
|
"short_code": "Короткая ссылка",
|
||||||
|
"url": "URL"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,9 +68,9 @@
|
|||||||
"developer_option": "Developer options",
|
"developer_option": "Developer options",
|
||||||
"developer_option_description": "Developer tools which helps in development and maintenance of Hoppscotch.",
|
"developer_option_description": "Developer tools which helps in development and maintenance of Hoppscotch.",
|
||||||
"discord": "Discord",
|
"discord": "Discord",
|
||||||
"documentation": "Dokümanlar",
|
"documentation": "Dökümanlar",
|
||||||
"github": "GitHub",
|
"github": "GitHub",
|
||||||
"help": "Yardım, geri bildirim ve dokümanlar",
|
"help": "Yardım, geri bildirim ve dökümanlar",
|
||||||
"home": "Ana sayfa",
|
"home": "Ana sayfa",
|
||||||
"invite": "Davet et",
|
"invite": "Davet et",
|
||||||
"invite_description": "Hoppscotch'ta API'lerinizi oluşturmak ve yönetmek için basit ve sezgisel bir arayüz tasarladık. Hoppscotch, API'lerinizi oluşturmanıza, test etmenize, belgelemenize ve paylaşmanıza yardımcı olan bir araçtır.",
|
"invite_description": "Hoppscotch'ta API'lerinizi oluşturmak ve yönetmek için basit ve sezgisel bir arayüz tasarladık. Hoppscotch, API'lerinizi oluşturmanıza, test etmenize, belgelemenize ve paylaşmanıza yardımcı olan bir araçtır.",
|
||||||
@@ -225,7 +225,7 @@
|
|||||||
"body": "Bu isteğin bir gövdesi yok",
|
"body": "Bu isteğin bir gövdesi yok",
|
||||||
"collection": "Koleksiyon boş",
|
"collection": "Koleksiyon boş",
|
||||||
"collections": "Koleksiyonlar boş",
|
"collections": "Koleksiyonlar boş",
|
||||||
"documentation": "Dokümanları görmek için GraphQL uç noktasını bağlayın",
|
"documentation": "Dökümanları görmek için GraphQL uç noktasını bağlayın",
|
||||||
"endpoint": "Uç nokta boş olamaz",
|
"endpoint": "Uç nokta boş olamaz",
|
||||||
"environments": "Ortamlar boş",
|
"environments": "Ortamlar boş",
|
||||||
"folder": "Klasör boş",
|
"folder": "Klasör boş",
|
||||||
@@ -735,7 +735,7 @@
|
|||||||
"url": "Bağlantı"
|
"url": "Bağlantı"
|
||||||
},
|
},
|
||||||
"spotlight": {
|
"spotlight": {
|
||||||
"change_language": "Dil Değiştir",
|
"change_language": "Change Language",
|
||||||
"environments": {
|
"environments": {
|
||||||
"delete": "Delete current environment",
|
"delete": "Delete current environment",
|
||||||
"duplicate": "Duplicate current environment",
|
"duplicate": "Duplicate current environment",
|
||||||
@@ -744,7 +744,7 @@
|
|||||||
"edit_global": "Edit global environment",
|
"edit_global": "Edit global environment",
|
||||||
"new": "Create new environment",
|
"new": "Create new environment",
|
||||||
"new_variable": "Create a new environment variable",
|
"new_variable": "Create a new environment variable",
|
||||||
"title": "Ortamlar"
|
"title": "Environments"
|
||||||
},
|
},
|
||||||
"general": {
|
"general": {
|
||||||
"chat": "Chat with support",
|
"chat": "Chat with support",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@hoppscotch/common",
|
"name": "@hoppscotch/common",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "2024.3.3",
|
"version": "2024.3.1",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "pnpm exec npm-run-all -p -l dev:*",
|
"dev": "pnpm exec npm-run-all -p -l dev:*",
|
||||||
"test": "vitest --run",
|
"test": "vitest --run",
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
"axios": "1.6.2",
|
"axios": "1.6.2",
|
||||||
"buffer": "6.0.3",
|
"buffer": "6.0.3",
|
||||||
"cookie-es": "1.0.0",
|
"cookie-es": "1.0.0",
|
||||||
"dioc": "3.0.1",
|
"dioc": "1.0.1",
|
||||||
"esprima": "4.0.1",
|
"esprima": "4.0.1",
|
||||||
"events": "3.3.0",
|
"events": "3.3.0",
|
||||||
"fp-ts": "2.16.1",
|
"fp-ts": "2.16.1",
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ declare module 'vue' {
|
|||||||
AppSpotlightEntryRESTHistory: typeof import('./components/app/spotlight/entry/RESTHistory.vue')['default']
|
AppSpotlightEntryRESTHistory: typeof import('./components/app/spotlight/entry/RESTHistory.vue')['default']
|
||||||
AppSpotlightEntryRESTRequest: typeof import('./components/app/spotlight/entry/RESTRequest.vue')['default']
|
AppSpotlightEntryRESTRequest: typeof import('./components/app/spotlight/entry/RESTRequest.vue')['default']
|
||||||
AppSpotlightEntryRESTTeamRequestEntry: typeof import('./components/app/spotlight/entry/RESTTeamRequestEntry.vue')['default']
|
AppSpotlightEntryRESTTeamRequestEntry: typeof import('./components/app/spotlight/entry/RESTTeamRequestEntry.vue')['default']
|
||||||
AppSpotlightSearch: typeof import('./components/app/SpotlightSearch.vue')['default']
|
|
||||||
AppSupport: typeof import('./components/app/Support.vue')['default']
|
AppSupport: typeof import('./components/app/Support.vue')['default']
|
||||||
Collections: typeof import('./components/collections/index.vue')['default']
|
Collections: typeof import('./components/collections/index.vue')['default']
|
||||||
CollectionsAdd: typeof import('./components/collections/Add.vue')['default']
|
CollectionsAdd: typeof import('./components/collections/Add.vue')['default']
|
||||||
|
|||||||
@@ -43,19 +43,12 @@
|
|||||||
@click="invokeAction('modals.support.toggle')"
|
@click="invokeAction('modals.support.toggle')"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div class="flex">
|
||||||
class="flex"
|
|
||||||
:class="{
|
|
||||||
'flex-row-reverse gap-2':
|
|
||||||
workspaceSelectorFlagEnabled && !currentUser,
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
<div
|
<div
|
||||||
v-if="currentUser === null"
|
v-if="currentUser === null"
|
||||||
class="inline-flex items-center space-x-2"
|
class="inline-flex items-center space-x-2"
|
||||||
>
|
>
|
||||||
<HoppButtonSecondary
|
<HoppButtonSecondary
|
||||||
v-if="!workspaceSelectorFlagEnabled"
|
|
||||||
:icon="IconUploadCloud"
|
:icon="IconUploadCloud"
|
||||||
:label="t('header.save_workspace')"
|
:label="t('header.save_workspace')"
|
||||||
class="!focus-visible:text-emerald-600 !hover:text-emerald-600 hidden h-8 border border-emerald-600/25 bg-emerald-500/10 !text-emerald-500 hover:border-emerald-600/20 hover:bg-emerald-600/20 focus-visible:border-emerald-600/20 focus-visible:bg-emerald-600/20 md:flex"
|
class="!focus-visible:text-emerald-600 !hover:text-emerald-600 hidden h-8 border border-emerald-600/25 bg-emerald-500/10 !text-emerald-500 hover:border-emerald-600/20 hover:bg-emerald-600/20 focus-visible:border-emerald-600/20 focus-visible:bg-emerald-600/20 md:flex"
|
||||||
@@ -67,22 +60,18 @@
|
|||||||
@click="invokeAction('modals.login.toggle')"
|
@click="invokeAction('modals.login.toggle')"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<TeamsMemberStack
|
<div v-else class="inline-flex items-center space-x-2">
|
||||||
v-else-if="
|
<TeamsMemberStack
|
||||||
currentUser !== null &&
|
v-if="
|
||||||
workspace.type === 'team' &&
|
workspace.type === 'team' &&
|
||||||
selectedTeam &&
|
selectedTeam &&
|
||||||
selectedTeam.teamMembers.length > 1
|
selectedTeam.teamMembers.length > 1
|
||||||
"
|
"
|
||||||
:team-members="selectedTeam.teamMembers"
|
:team-members="selectedTeam.teamMembers"
|
||||||
show-count
|
show-count
|
||||||
class="mx-2"
|
class="mx-2"
|
||||||
@handle-click="handleTeamEdit()"
|
@handle-click="handleTeamEdit()"
|
||||||
/>
|
/>
|
||||||
<div
|
|
||||||
v-if="workspaceSelectorFlagEnabled || currentUser"
|
|
||||||
class="inline-flex items-center space-x-2"
|
|
||||||
>
|
|
||||||
<div
|
<div
|
||||||
class="flex h-8 divide-x divide-emerald-600/25 rounded border border-emerald-600/25 bg-emerald-500/10 focus-within:divide-emerald-600/20 focus-within:border-emerald-600/20 focus-within:bg-emerald-600/20 hover:divide-emerald-600/20 hover:border-emerald-600/20 hover:bg-emerald-600/20"
|
class="flex h-8 divide-x divide-emerald-600/25 rounded border border-emerald-600/25 bg-emerald-500/10 focus-within:divide-emerald-600/20 focus-within:border-emerald-600/20 focus-within:bg-emerald-600/20 hover:divide-emerald-600/20 hover:border-emerald-600/20 hover:bg-emerald-600/20"
|
||||||
>
|
>
|
||||||
@@ -95,7 +84,6 @@
|
|||||||
/>
|
/>
|
||||||
<HoppButtonSecondary
|
<HoppButtonSecondary
|
||||||
v-if="
|
v-if="
|
||||||
currentUser &&
|
|
||||||
workspace.type === 'team' &&
|
workspace.type === 'team' &&
|
||||||
selectedTeam &&
|
selectedTeam &&
|
||||||
selectedTeam?.myRole === 'OWNER'
|
selectedTeam?.myRole === 'OWNER'
|
||||||
@@ -136,7 +124,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</tippy>
|
</tippy>
|
||||||
<span v-if="currentUser" class="px-2">
|
<span class="px-2">
|
||||||
<tippy
|
<tippy
|
||||||
interactive
|
interactive
|
||||||
trigger="click"
|
trigger="click"
|
||||||
@@ -271,13 +259,6 @@ import {
|
|||||||
const t = useI18n()
|
const t = useI18n()
|
||||||
const toast = useToast()
|
const toast = useToast()
|
||||||
|
|
||||||
/**
|
|
||||||
* Feature flag to enable the workspace selector login conversion
|
|
||||||
*/
|
|
||||||
const workspaceSelectorFlagEnabled = computed(
|
|
||||||
() => !!platform.platformFeatureFlags.workspaceSwitcherLogin?.value
|
|
||||||
)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Once the PWA code is initialized, this holds a method
|
* Once the PWA code is initialized, this holds a method
|
||||||
* that can be called to show the user the installation
|
* that can be called to show the user the installation
|
||||||
@@ -399,8 +380,6 @@ const inviteTeam = (team: { name: string }, teamID: string) => {
|
|||||||
|
|
||||||
// Show the workspace selected team invite modal if the user is an owner of the team else show the default invite modal
|
// Show the workspace selected team invite modal if the user is an owner of the team else show the default invite modal
|
||||||
const handleInvite = () => {
|
const handleInvite = () => {
|
||||||
if (!currentUser.value) return invokeAction("modals.login.toggle")
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
workspace.value.type === "team" &&
|
workspace.value.type === "team" &&
|
||||||
workspace.value.teamID &&
|
workspace.value.teamID &&
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import { useI18n } from "~/composables/i18n"
|
|||||||
import { useToast } from "~/composables/toast"
|
import { useToast } from "~/composables/toast"
|
||||||
import { appendRESTCollections, restCollections$ } from "~/newstore/collections"
|
import { appendRESTCollections, restCollections$ } from "~/newstore/collections"
|
||||||
import MyCollectionImport from "~/components/importExport/ImportExportSteps/MyCollectionImport.vue"
|
import MyCollectionImport from "~/components/importExport/ImportExportSteps/MyCollectionImport.vue"
|
||||||
|
import { GetMyTeamsQuery } from "~/helpers/backend/graphql"
|
||||||
|
|
||||||
import IconFolderPlus from "~icons/lucide/folder-plus"
|
import IconFolderPlus from "~icons/lucide/folder-plus"
|
||||||
import IconOpenAPI from "~icons/lucide/file"
|
import IconOpenAPI from "~icons/lucide/file"
|
||||||
@@ -54,15 +55,16 @@ import { teamCollectionsExporter } from "~/helpers/import-export/export/teamColl
|
|||||||
|
|
||||||
import { GistSource } from "~/helpers/import-export/import/import-sources/GistSource"
|
import { GistSource } from "~/helpers/import-export/import/import-sources/GistSource"
|
||||||
import { ImporterOrExporter } from "~/components/importExport/types"
|
import { ImporterOrExporter } from "~/components/importExport/types"
|
||||||
import { TeamWorkspace } from "~/services/workspace.service"
|
|
||||||
|
|
||||||
const t = useI18n()
|
const t = useI18n()
|
||||||
const toast = useToast()
|
const toast = useToast()
|
||||||
|
|
||||||
|
type SelectedTeam = GetMyTeamsQuery["myTeams"][number] | undefined
|
||||||
|
|
||||||
type CollectionType =
|
type CollectionType =
|
||||||
| {
|
| {
|
||||||
type: "team-collections"
|
type: "team-collections"
|
||||||
selectedTeam: TeamWorkspace
|
selectedTeam: SelectedTeam
|
||||||
}
|
}
|
||||||
| { type: "my-collections" }
|
| { type: "my-collections" }
|
||||||
|
|
||||||
@@ -431,7 +433,7 @@ const HoppTeamCollectionsExporter: ImporterOrExporter = {
|
|||||||
props.collectionsType.selectedTeam
|
props.collectionsType.selectedTeam
|
||||||
) {
|
) {
|
||||||
const res = await teamCollectionsExporter(
|
const res = await teamCollectionsExporter(
|
||||||
props.collectionsType.selectedTeam.teamID
|
props.collectionsType.selectedTeam.id
|
||||||
)
|
)
|
||||||
|
|
||||||
if (E.isRight(res)) {
|
if (E.isRight(res)) {
|
||||||
@@ -567,8 +569,8 @@ const hasTeamWriteAccess = computed(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
collectionsType.selectedTeam.role === "EDITOR" ||
|
collectionsType.selectedTeam.myRole === "EDITOR" ||
|
||||||
collectionsType.selectedTeam.role === "OWNER"
|
collectionsType.selectedTeam.myRole === "OWNER"
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -576,17 +578,17 @@ const selectedTeamID = computed(() => {
|
|||||||
const { collectionsType } = props
|
const { collectionsType } = props
|
||||||
|
|
||||||
return collectionsType.type === "team-collections"
|
return collectionsType.type === "team-collections"
|
||||||
? collectionsType.selectedTeam?.teamID
|
? collectionsType.selectedTeam?.id
|
||||||
: undefined
|
: undefined
|
||||||
})
|
})
|
||||||
|
|
||||||
const getCollectionJSON = async () => {
|
const getCollectionJSON = async () => {
|
||||||
if (
|
if (
|
||||||
props.collectionsType.type === "team-collections" &&
|
props.collectionsType.type === "team-collections" &&
|
||||||
props.collectionsType.selectedTeam?.teamID
|
props.collectionsType.selectedTeam?.id
|
||||||
) {
|
) {
|
||||||
const res = await getTeamCollectionJSON(
|
const res = await getTeamCollectionJSON(
|
||||||
props.collectionsType.selectedTeam?.teamID
|
props.collectionsType.selectedTeam?.id
|
||||||
)
|
)
|
||||||
|
|
||||||
return E.isRight(res)
|
return E.isRight(res)
|
||||||
|
|||||||
@@ -56,25 +56,23 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useI18n } from "@composables/i18n"
|
import { computed, nextTick, reactive, ref, watch } from "vue"
|
||||||
import { useToast } from "@composables/toast"
|
import { cloneDeep } from "lodash-es"
|
||||||
import {
|
import {
|
||||||
HoppGQLRequest,
|
HoppGQLRequest,
|
||||||
HoppRESTRequest,
|
HoppRESTRequest,
|
||||||
isHoppRESTRequest,
|
isHoppRESTRequest,
|
||||||
} from "@hoppscotch/data"
|
} from "@hoppscotch/data"
|
||||||
import { computedWithControl } from "@vueuse/core"
|
|
||||||
import { useService } from "dioc/vue"
|
|
||||||
import * as TE from "fp-ts/TaskEither"
|
|
||||||
import { pipe } from "fp-ts/function"
|
import { pipe } from "fp-ts/function"
|
||||||
import { cloneDeep } from "lodash-es"
|
import * as TE from "fp-ts/TaskEither"
|
||||||
import { computed, nextTick, reactive, ref, watch } from "vue"
|
import { GetMyTeamsQuery } from "~/helpers/backend/graphql"
|
||||||
import { GQLError } from "~/helpers/backend/GQLClient"
|
|
||||||
import {
|
import {
|
||||||
createRequestInCollection,
|
createRequestInCollection,
|
||||||
updateTeamRequest,
|
updateTeamRequest,
|
||||||
} from "~/helpers/backend/mutations/TeamRequest"
|
} from "~/helpers/backend/mutations/TeamRequest"
|
||||||
import { Picked } from "~/helpers/types/HoppPicked"
|
import { Picked } from "~/helpers/types/HoppPicked"
|
||||||
|
import { useI18n } from "@composables/i18n"
|
||||||
|
import { useToast } from "@composables/toast"
|
||||||
import {
|
import {
|
||||||
cascadeParentCollectionForHeaderAuth,
|
cascadeParentCollectionForHeaderAuth,
|
||||||
editGraphqlRequest,
|
editGraphqlRequest,
|
||||||
@@ -82,10 +80,14 @@ import {
|
|||||||
saveGraphqlRequestAs,
|
saveGraphqlRequestAs,
|
||||||
saveRESTRequestAs,
|
saveRESTRequestAs,
|
||||||
} from "~/newstore/collections"
|
} from "~/newstore/collections"
|
||||||
|
import { GQLError } from "~/helpers/backend/GQLClient"
|
||||||
|
import { computedWithControl } from "@vueuse/core"
|
||||||
import { platform } from "~/platform"
|
import { platform } from "~/platform"
|
||||||
import { GQLTabService } from "~/services/tab/graphql"
|
import { useService } from "dioc/vue"
|
||||||
import { RESTTabService } from "~/services/tab/rest"
|
import { RESTTabService } from "~/services/tab/rest"
|
||||||
import { TeamWorkspace } from "~/services/workspace.service"
|
import { GQLTabService } from "~/services/tab/graphql"
|
||||||
|
import { getDefaultRESTRequest } from "~/helpers/rest/default"
|
||||||
|
import { getDefaultGQLRequest } from "~/helpers/graphql/default"
|
||||||
|
|
||||||
const t = useI18n()
|
const t = useI18n()
|
||||||
const toast = useToast()
|
const toast = useToast()
|
||||||
@@ -93,10 +95,12 @@ const toast = useToast()
|
|||||||
const RESTTabs = useService(RESTTabService)
|
const RESTTabs = useService(RESTTabService)
|
||||||
const GQLTabs = useService(GQLTabService)
|
const GQLTabs = useService(GQLTabService)
|
||||||
|
|
||||||
|
type SelectedTeam = GetMyTeamsQuery["myTeams"][number] | undefined
|
||||||
|
|
||||||
type CollectionType =
|
type CollectionType =
|
||||||
| {
|
| {
|
||||||
type: "team-collections"
|
type: "team-collections"
|
||||||
selectedTeam: TeamWorkspace
|
selectedTeam: SelectedTeam
|
||||||
}
|
}
|
||||||
| { type: "my-collections"; selectedTeam: undefined }
|
| { type: "my-collections"; selectedTeam: undefined }
|
||||||
|
|
||||||
@@ -190,7 +194,7 @@ watch(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
const updateTeam = (newTeam: TeamWorkspace) => {
|
const updateTeam = (newTeam: SelectedTeam) => {
|
||||||
collectionsType.value.selectedTeam = newTeam
|
collectionsType.value.selectedTeam = newTeam
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,6 +223,15 @@ const saveRequestAs = async () => {
|
|||||||
|
|
||||||
requestUpdated.name = requestName.value
|
requestUpdated.name = requestName.value
|
||||||
|
|
||||||
|
if (props.mode === "rest") {
|
||||||
|
;(requestUpdated as HoppRESTRequest).endpoint =
|
||||||
|
(requestUpdated as HoppRESTRequest).endpoint ||
|
||||||
|
getDefaultRESTRequest().endpoint
|
||||||
|
} else {
|
||||||
|
;(requestUpdated as HoppGQLRequest).url =
|
||||||
|
(requestUpdated as HoppGQLRequest).url || getDefaultGQLRequest().url
|
||||||
|
}
|
||||||
|
|
||||||
if (picked.value.pickedType === "my-collection") {
|
if (picked.value.pickedType === "my-collection") {
|
||||||
if (!isHoppRESTRequest(requestUpdated))
|
if (!isHoppRESTRequest(requestUpdated))
|
||||||
throw new Error("requestUpdated is not a REST Request")
|
throw new Error("requestUpdated is not a REST Request")
|
||||||
@@ -491,7 +504,7 @@ const updateTeamCollectionOrFolder = (
|
|||||||
const data = {
|
const data = {
|
||||||
title: requestUpdated.name,
|
title: requestUpdated.name,
|
||||||
request: JSON.stringify(requestUpdated),
|
request: JSON.stringify(requestUpdated),
|
||||||
teamID: collectionsType.value.selectedTeam.teamID,
|
teamID: collectionsType.value.selectedTeam.id,
|
||||||
}
|
}
|
||||||
pipe(
|
pipe(
|
||||||
createRequestInCollection(collectionID, data),
|
createRequestInCollection(collectionID, data),
|
||||||
|
|||||||
@@ -387,6 +387,7 @@ import IconPlus from "~icons/lucide/plus"
|
|||||||
import IconHelpCircle from "~icons/lucide/help-circle"
|
import IconHelpCircle from "~icons/lucide/help-circle"
|
||||||
import IconImport from "~icons/lucide/folder-down"
|
import IconImport from "~icons/lucide/folder-down"
|
||||||
import { computed, PropType, Ref, toRef } from "vue"
|
import { computed, PropType, Ref, toRef } from "vue"
|
||||||
|
import { GetMyTeamsQuery } from "~/helpers/backend/graphql"
|
||||||
import { useI18n } from "@composables/i18n"
|
import { useI18n } from "@composables/i18n"
|
||||||
import { useColorMode } from "@composables/theming"
|
import { useColorMode } from "@composables/theming"
|
||||||
import { TeamCollection } from "~/helpers/teams/TeamCollection"
|
import { TeamCollection } from "~/helpers/teams/TeamCollection"
|
||||||
@@ -399,16 +400,17 @@ import * as O from "fp-ts/Option"
|
|||||||
import { Picked } from "~/helpers/types/HoppPicked.js"
|
import { Picked } from "~/helpers/types/HoppPicked.js"
|
||||||
import { RESTTabService } from "~/services/tab/rest"
|
import { RESTTabService } from "~/services/tab/rest"
|
||||||
import { useService } from "dioc/vue"
|
import { useService } from "dioc/vue"
|
||||||
import { TeamWorkspace } from "~/services/workspace.service"
|
|
||||||
|
|
||||||
const t = useI18n()
|
const t = useI18n()
|
||||||
const colorMode = useColorMode()
|
const colorMode = useColorMode()
|
||||||
const tabs = useService(RESTTabService)
|
const tabs = useService(RESTTabService)
|
||||||
|
|
||||||
|
type SelectedTeam = GetMyTeamsQuery["myTeams"][number] | undefined
|
||||||
|
|
||||||
type CollectionType =
|
type CollectionType =
|
||||||
| {
|
| {
|
||||||
type: "team-collections"
|
type: "team-collections"
|
||||||
selectedTeam: TeamWorkspace
|
selectedTeam: SelectedTeam
|
||||||
}
|
}
|
||||||
| { type: "my-collections"; selectedTeam: undefined }
|
| { type: "my-collections"; selectedTeam: undefined }
|
||||||
|
|
||||||
@@ -612,7 +614,7 @@ const hasNoTeamAccess = computed(
|
|||||||
() =>
|
() =>
|
||||||
props.collectionsType.type === "team-collections" &&
|
props.collectionsType.type === "team-collections" &&
|
||||||
(props.collectionsType.selectedTeam === undefined ||
|
(props.collectionsType.selectedTeam === undefined ||
|
||||||
props.collectionsType.selectedTeam.role === "VIEWER")
|
props.collectionsType.selectedTeam.myRole === "VIEWER")
|
||||||
)
|
)
|
||||||
|
|
||||||
const isSelected = ({
|
const isSelected = ({
|
||||||
|
|||||||
@@ -193,6 +193,7 @@ import { PersistedOAuthConfig } from "~/services/oauth/oauth.service"
|
|||||||
import { GQLOptionTabs } from "~/components/graphql/RequestOptions.vue"
|
import { GQLOptionTabs } from "~/components/graphql/RequestOptions.vue"
|
||||||
import { EditingProperties } from "../Properties.vue"
|
import { EditingProperties } from "../Properties.vue"
|
||||||
import { defineActionHandler } from "~/helpers/actions"
|
import { defineActionHandler } from "~/helpers/actions"
|
||||||
|
import { getDefaultGQLRequest } from "~/helpers/graphql/default"
|
||||||
|
|
||||||
const t = useI18n()
|
const t = useI18n()
|
||||||
const toast = useToast()
|
const toast = useToast()
|
||||||
@@ -200,7 +201,7 @@ const toast = useToast()
|
|||||||
defineProps<{
|
defineProps<{
|
||||||
// Whether to activate the ability to pick items (activates 'select' events)
|
// Whether to activate the ability to pick items (activates 'select' events)
|
||||||
saveRequest: boolean
|
saveRequest: boolean
|
||||||
picked: Picked | null
|
picked: Picked
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const collections = useReadonlyStream(graphqlCollections$, [], "deep")
|
const collections = useReadonlyStream(graphqlCollections$, [], "deep")
|
||||||
@@ -380,32 +381,26 @@ const editCollection = (
|
|||||||
displayModalEdit(true)
|
displayModalEdit(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
const onAddRequest = ({
|
const onAddRequest = ({ name, path }: { name: string; path: string }) => {
|
||||||
name,
|
|
||||||
path,
|
|
||||||
index,
|
|
||||||
}: {
|
|
||||||
name: string
|
|
||||||
path: string
|
|
||||||
index: number
|
|
||||||
}) => {
|
|
||||||
const newRequest = {
|
const newRequest = {
|
||||||
...tabs.currentActiveTab.value.document.request,
|
...tabs.currentActiveTab.value.document.request,
|
||||||
name,
|
name,
|
||||||
|
url:
|
||||||
|
tabs.currentActiveTab.value.document.request.url ||
|
||||||
|
getDefaultGQLRequest().url,
|
||||||
}
|
}
|
||||||
|
|
||||||
saveGraphqlRequestAs(path, newRequest)
|
const insertionIndex = saveGraphqlRequestAs(path, newRequest)
|
||||||
|
|
||||||
const { auth, headers } = cascadeParentCollectionForHeaderAuth(
|
const { auth, headers } = cascadeParentCollectionForHeaderAuth(
|
||||||
path,
|
path,
|
||||||
"graphql"
|
"graphql"
|
||||||
)
|
)
|
||||||
|
|
||||||
tabs.createNewTab({
|
tabs.createNewTab({
|
||||||
saveContext: {
|
saveContext: {
|
||||||
originLocation: "user-collection",
|
originLocation: "user-collection",
|
||||||
folderPath: path,
|
folderPath: path,
|
||||||
requestIndex: index,
|
requestIndex: insertionIndex,
|
||||||
},
|
},
|
||||||
request: newRequest,
|
request: newRequest,
|
||||||
isDirty: false,
|
isDirty: false,
|
||||||
|
|||||||
@@ -178,6 +178,7 @@ import { useI18n } from "@composables/i18n"
|
|||||||
import { Picked } from "~/helpers/types/HoppPicked"
|
import { Picked } from "~/helpers/types/HoppPicked"
|
||||||
import { useReadonlyStream } from "~/composables/stream"
|
import { useReadonlyStream } from "~/composables/stream"
|
||||||
import { useLocalState } from "~/newstore/localstate"
|
import { useLocalState } from "~/newstore/localstate"
|
||||||
|
import { GetMyTeamsQuery } from "~/helpers/backend/graphql"
|
||||||
import { pipe } from "fp-ts/function"
|
import { pipe } from "fp-ts/function"
|
||||||
import * as TE from "fp-ts/TaskEither"
|
import * as TE from "fp-ts/TaskEither"
|
||||||
import {
|
import {
|
||||||
@@ -244,7 +245,7 @@ import {
|
|||||||
} from "~/helpers/collection/collection"
|
} from "~/helpers/collection/collection"
|
||||||
import { currentReorderingStatus$ } from "~/newstore/reordering"
|
import { currentReorderingStatus$ } from "~/newstore/reordering"
|
||||||
import { defineActionHandler, invokeAction } from "~/helpers/actions"
|
import { defineActionHandler, invokeAction } from "~/helpers/actions"
|
||||||
import { TeamWorkspace, WorkspaceService } from "~/services/workspace.service"
|
import { WorkspaceService } from "~/services/workspace.service"
|
||||||
import { useService } from "dioc/vue"
|
import { useService } from "dioc/vue"
|
||||||
import { RESTTabService } from "~/services/tab/rest"
|
import { RESTTabService } from "~/services/tab/rest"
|
||||||
import { HoppInheritedProperty } from "~/helpers/types/HoppInheritedProperties"
|
import { HoppInheritedProperty } from "~/helpers/types/HoppInheritedProperties"
|
||||||
@@ -253,6 +254,7 @@ import { PersistenceService } from "~/services/persistence"
|
|||||||
import { PersistedOAuthConfig } from "~/services/oauth/oauth.service"
|
import { PersistedOAuthConfig } from "~/services/oauth/oauth.service"
|
||||||
import { RESTOptionTabs } from "../http/RequestOptions.vue"
|
import { RESTOptionTabs } from "../http/RequestOptions.vue"
|
||||||
import { EditingProperties } from "./Properties.vue"
|
import { EditingProperties } from "./Properties.vue"
|
||||||
|
import { getDefaultRESTRequest } from "~/helpers/rest/default"
|
||||||
|
|
||||||
const t = useI18n()
|
const t = useI18n()
|
||||||
const toast = useToast()
|
const toast = useToast()
|
||||||
@@ -273,14 +275,16 @@ const props = defineProps({
|
|||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(event: "select", payload: Picked | null): void
|
(event: "select", payload: Picked | null): void
|
||||||
(event: "update-team", team: TeamWorkspace): void
|
(event: "update-team", team: SelectedTeam): void
|
||||||
(event: "update-collection-type", type: CollectionType["type"]): void
|
(event: "update-collection-type", type: CollectionType["type"]): void
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
|
type SelectedTeam = GetMyTeamsQuery["myTeams"][number] | undefined
|
||||||
|
|
||||||
type CollectionType =
|
type CollectionType =
|
||||||
| {
|
| {
|
||||||
type: "team-collections"
|
type: "team-collections"
|
||||||
selectedTeam: TeamWorkspace
|
selectedTeam: SelectedTeam
|
||||||
}
|
}
|
||||||
| { type: "my-collections"; selectedTeam: undefined }
|
| { type: "my-collections"; selectedTeam: undefined }
|
||||||
|
|
||||||
@@ -327,7 +331,9 @@ const requestMoveLoading = ref<string[]>([])
|
|||||||
// TeamList-Adapter
|
// TeamList-Adapter
|
||||||
const workspaceService = useService(WorkspaceService)
|
const workspaceService = useService(WorkspaceService)
|
||||||
const teamListAdapter = workspaceService.acquireTeamListAdapter(null)
|
const teamListAdapter = workspaceService.acquireTeamListAdapter(null)
|
||||||
|
const myTeams = useReadonlyStream(teamListAdapter.teamList$, null)
|
||||||
const REMEMBERED_TEAM_ID = useLocalState("REMEMBERED_TEAM_ID")
|
const REMEMBERED_TEAM_ID = useLocalState("REMEMBERED_TEAM_ID")
|
||||||
|
const teamListFetched = ref(false)
|
||||||
|
|
||||||
// Team Collection Adapter
|
// Team Collection Adapter
|
||||||
const teamCollectionAdapter = new TeamCollectionAdapter(null)
|
const teamCollectionAdapter = new TeamCollectionAdapter(null)
|
||||||
@@ -373,7 +379,7 @@ watch(
|
|||||||
filterTexts,
|
filterTexts,
|
||||||
(newFilterText) => {
|
(newFilterText) => {
|
||||||
if (collectionsType.value.type === "team-collections") {
|
if (collectionsType.value.type === "team-collections") {
|
||||||
const selectedTeamID = collectionsType.value.selectedTeam?.teamID
|
const selectedTeamID = collectionsType.value.selectedTeam?.id
|
||||||
|
|
||||||
selectedTeamID &&
|
selectedTeamID &&
|
||||||
debouncedSearch(newFilterText, selectedTeamID)?.catch(() => {})
|
debouncedSearch(newFilterText, selectedTeamID)?.catch(() => {})
|
||||||
@@ -430,6 +436,28 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => myTeams.value,
|
||||||
|
(newTeams) => {
|
||||||
|
if (newTeams && !teamListFetched.value) {
|
||||||
|
teamListFetched.value = true
|
||||||
|
if (REMEMBERED_TEAM_ID.value && currentUser.value) {
|
||||||
|
const team = newTeams.find((t) => t.id === REMEMBERED_TEAM_ID.value)
|
||||||
|
if (team) updateSelectedTeam(team)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => collectionsType.value.selectedTeam,
|
||||||
|
(newTeam) => {
|
||||||
|
if (newTeam) {
|
||||||
|
teamCollectionAdapter.changeTeamID(newTeam.id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
const switchToMyCollections = () => {
|
const switchToMyCollections = () => {
|
||||||
collectionsType.value.type = "my-collections"
|
collectionsType.value.type = "my-collections"
|
||||||
collectionsType.value.selectedTeam = undefined
|
collectionsType.value.selectedTeam = undefined
|
||||||
@@ -461,12 +489,11 @@ const expandTeamCollection = (collectionID: string) => {
|
|||||||
teamCollectionAdapter.expandCollection(collectionID)
|
teamCollectionAdapter.expandCollection(collectionID)
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateSelectedTeam = (team: TeamWorkspace) => {
|
const updateSelectedTeam = (team: SelectedTeam) => {
|
||||||
if (team) {
|
if (team) {
|
||||||
collectionsType.value.type = "team-collections"
|
collectionsType.value.type = "team-collections"
|
||||||
teamCollectionAdapter.changeTeamID(team.teamID)
|
|
||||||
collectionsType.value.selectedTeam = team
|
collectionsType.value.selectedTeam = team
|
||||||
REMEMBERED_TEAM_ID.value = team.teamID
|
REMEMBERED_TEAM_ID.value = team.id
|
||||||
emit("update-team", team)
|
emit("update-team", team)
|
||||||
emit("update-collection-type", "team-collections")
|
emit("update-collection-type", "team-collections")
|
||||||
}
|
}
|
||||||
@@ -475,14 +502,23 @@ const updateSelectedTeam = (team: TeamWorkspace) => {
|
|||||||
const workspace = workspaceService.currentWorkspace
|
const workspace = workspaceService.currentWorkspace
|
||||||
|
|
||||||
// Used to switch collection type and team when user switch workspace in the global workspace switcher
|
// Used to switch collection type and team when user switch workspace in the global workspace switcher
|
||||||
|
// Check if there is a teamID in the workspace, if yes, switch to team collections and select the team
|
||||||
|
// If there is no teamID, switch to my collections
|
||||||
watch(
|
watch(
|
||||||
workspace,
|
() => {
|
||||||
(newWorkspace) => {
|
const space = workspace.value
|
||||||
if (newWorkspace.type === "personal") {
|
return space.type === "personal" ? undefined : space.teamID
|
||||||
switchToMyCollections()
|
},
|
||||||
} else if (newWorkspace.type === "team") {
|
(teamID) => {
|
||||||
updateSelectedTeam(newWorkspace)
|
if (teamID) {
|
||||||
|
const team = myTeams.value?.find((t) => t.id === teamID)
|
||||||
|
if (team) {
|
||||||
|
updateSelectedTeam(team)
|
||||||
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return switchToMyCollections()
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
immediate: true,
|
immediate: true,
|
||||||
@@ -510,7 +546,7 @@ const hasTeamWriteAccess = computed(() => {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
const role = collectionsType.value.selectedTeam?.role
|
const role = collectionsType.value.selectedTeam?.myRole
|
||||||
return role === "OWNER" || role === "EDITOR"
|
return role === "OWNER" || role === "EDITOR"
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -725,7 +761,7 @@ const addNewRootCollection = (name: string) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
pipe(
|
pipe(
|
||||||
createNewRootCollection(name, collectionsType.value.selectedTeam.teamID),
|
createNewRootCollection(name, collectionsType.value.selectedTeam.id),
|
||||||
TE.match(
|
TE.match(
|
||||||
(err: GQLError<string>) => {
|
(err: GQLError<string>) => {
|
||||||
toast.error(`${getErrorMessage(err)}`)
|
toast.error(`${getErrorMessage(err)}`)
|
||||||
@@ -755,6 +791,9 @@ const onAddRequest = (requestName: string) => {
|
|||||||
const newRequest = {
|
const newRequest = {
|
||||||
...cloneDeep(tabs.currentActiveTab.value.document.request),
|
...cloneDeep(tabs.currentActiveTab.value.document.request),
|
||||||
name: requestName,
|
name: requestName,
|
||||||
|
endpoint:
|
||||||
|
tabs.currentActiveTab.value.document.request.endpoint ||
|
||||||
|
getDefaultRESTRequest().endpoint,
|
||||||
}
|
}
|
||||||
|
|
||||||
const path = editingFolderPath.value
|
const path = editingFolderPath.value
|
||||||
@@ -796,7 +835,7 @@ const onAddRequest = (requestName: string) => {
|
|||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
request: JSON.stringify(newRequest),
|
request: JSON.stringify(newRequest),
|
||||||
teamID: collectionsType.value.selectedTeam.teamID,
|
teamID: collectionsType.value.selectedTeam.id,
|
||||||
title: requestName,
|
title: requestName,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1123,7 +1162,7 @@ const duplicateRequest = (payload: {
|
|||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
request: JSON.stringify(newRequest),
|
request: JSON.stringify(newRequest),
|
||||||
teamID: collectionsType.value.selectedTeam.teamID,
|
teamID: collectionsType.value.selectedTeam.id,
|
||||||
title: `${request.name} - ${t("action.duplicate")}`,
|
title: `${request.name} - ${t("action.duplicate")}`,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -364,7 +364,6 @@ const switchToTeamWorkspace = (team: GetMyTeamsQuery["myTeams"][number]) => {
|
|||||||
teamID: team.id,
|
teamID: team.id,
|
||||||
teamName: team.name,
|
teamName: team.name,
|
||||||
type: "team",
|
type: "team",
|
||||||
role: team.myRole,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
watch(
|
watch(
|
||||||
|
|||||||
@@ -46,38 +46,41 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useReadonlyStream, useStream } from "@composables/stream"
|
|
||||||
import { Environment } from "@hoppscotch/data"
|
|
||||||
import { useService } from "dioc/vue"
|
|
||||||
import * as TE from "fp-ts/TaskEither"
|
|
||||||
import { pipe } from "fp-ts/function"
|
|
||||||
import { isEqual } from "lodash-es"
|
|
||||||
import { computed, ref, watch } from "vue"
|
import { computed, ref, watch } from "vue"
|
||||||
|
import { isEqual } from "lodash-es"
|
||||||
|
import { platform } from "~/platform"
|
||||||
|
import { GetMyTeamsQuery } from "~/helpers/backend/graphql"
|
||||||
|
import { useReadonlyStream, useStream } from "@composables/stream"
|
||||||
import { useI18n } from "~/composables/i18n"
|
import { useI18n } from "~/composables/i18n"
|
||||||
import { useToast } from "~/composables/toast"
|
|
||||||
import { defineActionHandler } from "~/helpers/actions"
|
|
||||||
import { GQLError } from "~/helpers/backend/GQLClient"
|
|
||||||
import { deleteTeamEnvironment } from "~/helpers/backend/mutations/TeamEnvironment"
|
|
||||||
import TeamEnvironmentAdapter from "~/helpers/teams/TeamEnvironmentAdapter"
|
|
||||||
import {
|
import {
|
||||||
deleteEnvironment,
|
|
||||||
getSelectedEnvironmentIndex,
|
getSelectedEnvironmentIndex,
|
||||||
globalEnv$,
|
globalEnv$,
|
||||||
selectedEnvironmentIndex$,
|
selectedEnvironmentIndex$,
|
||||||
setSelectedEnvironmentIndex,
|
setSelectedEnvironmentIndex,
|
||||||
} from "~/newstore/environments"
|
} from "~/newstore/environments"
|
||||||
|
import TeamEnvironmentAdapter from "~/helpers/teams/TeamEnvironmentAdapter"
|
||||||
|
import { defineActionHandler } from "~/helpers/actions"
|
||||||
import { useLocalState } from "~/newstore/localstate"
|
import { useLocalState } from "~/newstore/localstate"
|
||||||
import { platform } from "~/platform"
|
import { pipe } from "fp-ts/function"
|
||||||
import { TeamWorkspace, WorkspaceService } from "~/services/workspace.service"
|
import * as TE from "fp-ts/TaskEither"
|
||||||
|
import { GQLError } from "~/helpers/backend/GQLClient"
|
||||||
|
import { deleteEnvironment } from "~/newstore/environments"
|
||||||
|
import { deleteTeamEnvironment } from "~/helpers/backend/mutations/TeamEnvironment"
|
||||||
|
import { useToast } from "~/composables/toast"
|
||||||
|
import { WorkspaceService } from "~/services/workspace.service"
|
||||||
|
import { useService } from "dioc/vue"
|
||||||
|
import { Environment } from "@hoppscotch/data"
|
||||||
|
|
||||||
const t = useI18n()
|
const t = useI18n()
|
||||||
const toast = useToast()
|
const toast = useToast()
|
||||||
|
|
||||||
type EnvironmentType = "my-environments" | "team-environments"
|
type EnvironmentType = "my-environments" | "team-environments"
|
||||||
|
|
||||||
|
type SelectedTeam = GetMyTeamsQuery["myTeams"][number] | undefined
|
||||||
|
|
||||||
type EnvironmentsChooseType = {
|
type EnvironmentsChooseType = {
|
||||||
type: EnvironmentType
|
type: EnvironmentType
|
||||||
selectedTeam: TeamWorkspace | undefined
|
selectedTeam: SelectedTeam
|
||||||
}
|
}
|
||||||
|
|
||||||
const environmentType = ref<EnvironmentsChooseType>({
|
const environmentType = ref<EnvironmentsChooseType>({
|
||||||
@@ -99,7 +102,11 @@ const currentUser = useReadonlyStream(
|
|||||||
platform.auth.getCurrentUser()
|
platform.auth.getCurrentUser()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// TeamList-Adapter
|
||||||
const workspaceService = useService(WorkspaceService)
|
const workspaceService = useService(WorkspaceService)
|
||||||
|
const teamListAdapter = workspaceService.acquireTeamListAdapter(null)
|
||||||
|
const myTeams = useReadonlyStream(teamListAdapter.teamList$, null)
|
||||||
|
const teamListFetched = ref(false)
|
||||||
const REMEMBERED_TEAM_ID = useLocalState("REMEMBERED_TEAM_ID")
|
const REMEMBERED_TEAM_ID = useLocalState("REMEMBERED_TEAM_ID")
|
||||||
|
|
||||||
const adapter = new TeamEnvironmentAdapter(undefined)
|
const adapter = new TeamEnvironmentAdapter(undefined)
|
||||||
@@ -111,17 +118,29 @@ const loading = computed(
|
|||||||
() => adapterLoading.value && teamEnvironmentList.value.length === 0
|
() => adapterLoading.value && teamEnvironmentList.value.length === 0
|
||||||
)
|
)
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => myTeams.value,
|
||||||
|
(newTeams) => {
|
||||||
|
if (newTeams && !teamListFetched.value) {
|
||||||
|
teamListFetched.value = true
|
||||||
|
if (REMEMBERED_TEAM_ID.value && currentUser.value) {
|
||||||
|
const team = newTeams.find((t) => t.id === REMEMBERED_TEAM_ID.value)
|
||||||
|
if (team) updateSelectedTeam(team)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
const switchToMyEnvironments = () => {
|
const switchToMyEnvironments = () => {
|
||||||
environmentType.value.selectedTeam = undefined
|
environmentType.value.selectedTeam = undefined
|
||||||
updateEnvironmentType("my-environments")
|
updateEnvironmentType("my-environments")
|
||||||
adapter.changeTeamID(undefined)
|
adapter.changeTeamID(undefined)
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateSelectedTeam = (newSelectedTeam: TeamWorkspace | undefined) => {
|
const updateSelectedTeam = (newSelectedTeam: SelectedTeam | undefined) => {
|
||||||
if (newSelectedTeam) {
|
if (newSelectedTeam) {
|
||||||
adapter.changeTeamID(newSelectedTeam.teamID)
|
|
||||||
environmentType.value.selectedTeam = newSelectedTeam
|
environmentType.value.selectedTeam = newSelectedTeam
|
||||||
REMEMBERED_TEAM_ID.value = newSelectedTeam.teamID
|
REMEMBERED_TEAM_ID.value = newSelectedTeam.id
|
||||||
updateEnvironmentType("team-environments")
|
updateEnvironmentType("team-environments")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -129,6 +148,15 @@ const updateEnvironmentType = (newEnvironmentType: EnvironmentType) => {
|
|||||||
environmentType.value.type = newEnvironmentType
|
environmentType.value.type = newEnvironmentType
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => environmentType.value.selectedTeam,
|
||||||
|
(newTeam) => {
|
||||||
|
if (newTeam) {
|
||||||
|
adapter.changeTeamID(newTeam.id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
const workspace = workspaceService.currentWorkspace
|
const workspace = workspaceService.currentWorkspace
|
||||||
|
|
||||||
// Switch to my environments if workspace is personal and to team environments if workspace is team
|
// Switch to my environments if workspace is personal and to team environments if workspace is team
|
||||||
@@ -142,7 +170,8 @@ watch(workspace, (newWorkspace) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
} else if (newWorkspace.type === "team") {
|
} else if (newWorkspace.type === "team") {
|
||||||
updateSelectedTeam(newWorkspace)
|
const team = myTeams.value?.find((t) => t.id === newWorkspace.teamID)
|
||||||
|
updateSelectedTeam(team)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,9 @@
|
|||||||
:key="tab.id"
|
:key="tab.id"
|
||||||
:label="tab.label"
|
:label="tab.label"
|
||||||
>
|
>
|
||||||
<div class="divide-y divide-dividerLight">
|
<div
|
||||||
|
class="divide-y divide-dividerLight rounded border border-divider"
|
||||||
|
>
|
||||||
<HoppSmartPlaceholder
|
<HoppSmartPlaceholder
|
||||||
v-if="tab.variables.length === 0"
|
v-if="tab.variables.length === 0"
|
||||||
:src="`/images/states/${colorMode.value}/blockchain.svg`"
|
:src="`/images/states/${colorMode.value}/blockchain.svg`"
|
||||||
|
|||||||
@@ -56,7 +56,9 @@
|
|||||||
:key="tab.id"
|
:key="tab.id"
|
||||||
:label="tab.label"
|
:label="tab.label"
|
||||||
>
|
>
|
||||||
<div class="divide-y divide-dividerLight">
|
<div
|
||||||
|
class="divide-y divide-dividerLight rounded border border-divider"
|
||||||
|
>
|
||||||
<HoppSmartPlaceholder
|
<HoppSmartPlaceholder
|
||||||
v-if="tab.variables.length === 0"
|
v-if="tab.variables.length === 0"
|
||||||
:src="`/images/states/${colorMode.value}/blockchain.svg`"
|
:src="`/images/states/${colorMode.value}/blockchain.svg`"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
class="sticky top-upperPrimaryStickyFold z-10 flex flex-1 flex-shrink-0 justify-between overflow-x-auto border-b border-dividerLight bg-primary"
|
class="sticky top-upperPrimaryStickyFold z-10 flex flex-1 flex-shrink-0 justify-between overflow-x-auto border-b border-dividerLight bg-primary"
|
||||||
>
|
>
|
||||||
<HoppButtonSecondary
|
<HoppButtonSecondary
|
||||||
v-if="team === undefined || team.role === 'VIEWER'"
|
v-if="team === undefined || team.myRole === 'VIEWER'"
|
||||||
v-tippy="{ theme: 'tooltip' }"
|
v-tippy="{ theme: 'tooltip' }"
|
||||||
disabled
|
disabled
|
||||||
class="!rounded-none"
|
class="!rounded-none"
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
:icon="IconHelpCircle"
|
:icon="IconHelpCircle"
|
||||||
/>
|
/>
|
||||||
<HoppButtonSecondary
|
<HoppButtonSecondary
|
||||||
v-if="team !== undefined && team.role === 'VIEWER'"
|
v-if="team !== undefined && team.myRole === 'VIEWER'"
|
||||||
v-tippy="{ theme: 'tooltip' }"
|
v-tippy="{ theme: 'tooltip' }"
|
||||||
disabled
|
disabled
|
||||||
:icon="IconImport"
|
:icon="IconImport"
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
)"
|
)"
|
||||||
:key="`environment-${index}`"
|
:key="`environment-${index}`"
|
||||||
:environment="environment"
|
:environment="environment"
|
||||||
:is-viewer="team?.role === 'VIEWER'"
|
:is-viewer="team?.myRole === 'VIEWER'"
|
||||||
@edit-environment="editEnvironment(environment)"
|
@edit-environment="editEnvironment(environment)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -103,16 +103,16 @@
|
|||||||
:show="showModalDetails"
|
:show="showModalDetails"
|
||||||
:action="action"
|
:action="action"
|
||||||
:editing-environment="editingEnvironment"
|
:editing-environment="editingEnvironment"
|
||||||
:editing-team-id="team?.teamID"
|
:editing-team-id="team?.id"
|
||||||
:editing-variable-name="editingVariableName"
|
:editing-variable-name="editingVariableName"
|
||||||
:is-secret-option-selected="secretOptionSelected"
|
:is-secret-option-selected="secretOptionSelected"
|
||||||
:is-viewer="team?.role === 'VIEWER'"
|
:is-viewer="team?.myRole === 'VIEWER'"
|
||||||
@hide-modal="displayModalEdit(false)"
|
@hide-modal="displayModalEdit(false)"
|
||||||
/>
|
/>
|
||||||
<EnvironmentsImportExport
|
<EnvironmentsImportExport
|
||||||
v-if="showModalImportExport"
|
v-if="showModalImportExport"
|
||||||
:team-environments="teamEnvironments"
|
:team-environments="teamEnvironments"
|
||||||
:team-id="team?.teamID"
|
:team-id="team?.id"
|
||||||
environment-type="TEAM_ENV"
|
environment-type="TEAM_ENV"
|
||||||
@hide-modal="displayModalImportExport(false)"
|
@hide-modal="displayModalImportExport(false)"
|
||||||
/>
|
/>
|
||||||
@@ -129,14 +129,16 @@ import IconPlus from "~icons/lucide/plus"
|
|||||||
import IconHelpCircle from "~icons/lucide/help-circle"
|
import IconHelpCircle from "~icons/lucide/help-circle"
|
||||||
import IconImport from "~icons/lucide/folder-down"
|
import IconImport from "~icons/lucide/folder-down"
|
||||||
import { defineActionHandler } from "~/helpers/actions"
|
import { defineActionHandler } from "~/helpers/actions"
|
||||||
import { TeamWorkspace } from "~/services/workspace.service"
|
import { GetMyTeamsQuery } from "~/helpers/backend/graphql"
|
||||||
|
|
||||||
const t = useI18n()
|
const t = useI18n()
|
||||||
|
|
||||||
const colorMode = useColorMode()
|
const colorMode = useColorMode()
|
||||||
|
|
||||||
|
type SelectedTeam = GetMyTeamsQuery["myTeams"][number] | undefined
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
team: TeamWorkspace | undefined
|
team: SelectedTeam
|
||||||
teamEnvironments: TeamEnvironment[]
|
teamEnvironments: TeamEnvironment[]
|
||||||
adapterError: GQLError<string> | null
|
adapterError: GQLError<string> | null
|
||||||
loading: boolean
|
loading: boolean
|
||||||
@@ -149,7 +151,7 @@ const editingEnvironment = ref<TeamEnvironment | null>(null)
|
|||||||
const editingVariableName = ref("")
|
const editingVariableName = ref("")
|
||||||
const secretOptionSelected = ref(false)
|
const secretOptionSelected = ref(false)
|
||||||
|
|
||||||
const isTeamViewer = computed(() => props.team?.role === "VIEWER")
|
const isTeamViewer = computed(() => props.team?.myRole === "VIEWER")
|
||||||
|
|
||||||
const displayModalAdd = (shouldDisplay: boolean) => {
|
const displayModalAdd = (shouldDisplay: boolean) => {
|
||||||
action.value = "new"
|
action.value = "new"
|
||||||
|
|||||||
@@ -3,16 +3,13 @@
|
|||||||
class="sticky top-0 z-10 flex flex-shrink-0 space-x-2 overflow-x-auto bg-primary p-4"
|
class="sticky top-0 z-10 flex flex-shrink-0 space-x-2 overflow-x-auto bg-primary p-4"
|
||||||
>
|
>
|
||||||
<div class="inline-flex flex-1 space-x-2">
|
<div class="inline-flex flex-1 space-x-2">
|
||||||
<input
|
<SmartEnvInput
|
||||||
id="url"
|
|
||||||
v-model="url"
|
v-model="url"
|
||||||
type="url"
|
:placeholder="getDefaultGQLRequest().url"
|
||||||
autocomplete="off"
|
:placeholder-hover-string="t('request.graphql_placeholder')"
|
||||||
spellcheck="false"
|
:readonly="connected"
|
||||||
class="w-full rounded border border-divider bg-primaryLight px-4 py-2 text-secondaryDark"
|
class="rounded border border-divider bg-primaryLight"
|
||||||
:placeholder="`${t('graphql.url_placeholder')}`"
|
@enter="onConnectClick"
|
||||||
:disabled="connected"
|
|
||||||
@keyup.enter="onConnectClick"
|
|
||||||
/>
|
/>
|
||||||
<HoppButtonPrimary
|
<HoppButtonPrimary
|
||||||
id="get"
|
id="get"
|
||||||
@@ -72,6 +69,7 @@ import { InterceptorService } from "~/services/interceptor.service"
|
|||||||
import { useService } from "dioc/vue"
|
import { useService } from "dioc/vue"
|
||||||
import { defineActionHandler } from "~/helpers/actions"
|
import { defineActionHandler } from "~/helpers/actions"
|
||||||
import { GQLTabService } from "~/services/tab/graphql"
|
import { GQLTabService } from "~/services/tab/graphql"
|
||||||
|
import { getDefaultGQLRequest } from "~/helpers/graphql/default"
|
||||||
|
|
||||||
const t = useI18n()
|
const t = useI18n()
|
||||||
const tabs = useService(GQLTabService)
|
const tabs = useService(GQLTabService)
|
||||||
@@ -98,7 +96,10 @@ const onConnectClick = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const gqlConnect = () => {
|
const gqlConnect = () => {
|
||||||
connect(url.value, tabs.currentActiveTab.value?.document.request.headers)
|
connect(
|
||||||
|
url.value || getDefaultGQLRequest().url,
|
||||||
|
tabs.currentActiveTab.value?.document.request.headers
|
||||||
|
)
|
||||||
|
|
||||||
platform.analytics?.logEvent({
|
platform.analytics?.logEvent({
|
||||||
type: "HOPP_REQUEST_RUN",
|
type: "HOPP_REQUEST_RUN",
|
||||||
@@ -118,7 +119,9 @@ watch(
|
|||||||
tabs.currentActiveTab,
|
tabs.currentActiveTab,
|
||||||
(newVal) => {
|
(newVal) => {
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
lastTwoUrls.value.push(newVal.document.request.url)
|
lastTwoUrls.value.push(
|
||||||
|
newVal.document.request.url ?? getDefaultGQLRequest().url
|
||||||
|
)
|
||||||
if (lastTwoUrls.value.length > 2) {
|
if (lastTwoUrls.value.length > 2) {
|
||||||
lastTwoUrls.value.shift()
|
lastTwoUrls.value.shift()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ import { InterceptorService } from "~/services/interceptor.service"
|
|||||||
import { editGraphqlRequest } from "~/newstore/collections"
|
import { editGraphqlRequest } from "~/newstore/collections"
|
||||||
import { GQLTabService } from "~/services/tab/graphql"
|
import { GQLTabService } from "~/services/tab/graphql"
|
||||||
import { HoppInheritedProperty } from "~/helpers/types/HoppInheritedProperties"
|
import { HoppInheritedProperty } from "~/helpers/types/HoppInheritedProperties"
|
||||||
|
import { getDefaultGQLRequest } from "~/helpers/graphql/default"
|
||||||
|
|
||||||
const VALID_GQL_OPERATIONS = [
|
const VALID_GQL_OPERATIONS = [
|
||||||
"query",
|
"query",
|
||||||
@@ -119,7 +120,9 @@ const request = useVModel(props, "modelValue", emit)
|
|||||||
|
|
||||||
const url = computedWithControl(
|
const url = computedWithControl(
|
||||||
() => tabs.currentActiveTab.value,
|
() => tabs.currentActiveTab.value,
|
||||||
() => tabs.currentActiveTab.value.document.request.url
|
() =>
|
||||||
|
tabs.currentActiveTab.value.document.request.url ||
|
||||||
|
getDefaultGQLRequest().url
|
||||||
)
|
)
|
||||||
|
|
||||||
const activeGQLHeadersCount = computed(
|
const activeGQLHeadersCount = computed(
|
||||||
@@ -247,10 +250,16 @@ const saveRequest = () => {
|
|||||||
tabs.currentActiveTab.value.document.saveContext.originLocation ===
|
tabs.currentActiveTab.value.document.saveContext.originLocation ===
|
||||||
"user-collection"
|
"user-collection"
|
||||||
) {
|
) {
|
||||||
|
const finalRequest = {
|
||||||
|
...tabs.currentActiveTab.value.document.request,
|
||||||
|
url:
|
||||||
|
tabs.currentActiveTab.value.document.request.url ||
|
||||||
|
getDefaultGQLRequest().url,
|
||||||
|
}
|
||||||
editGraphqlRequest(
|
editGraphqlRequest(
|
||||||
tabs.currentActiveTab.value.document.saveContext.folderPath,
|
tabs.currentActiveTab.value.document.saveContext.folderPath,
|
||||||
tabs.currentActiveTab.value.document.saveContext.requestIndex,
|
tabs.currentActiveTab.value.document.saveContext.requestIndex,
|
||||||
tabs.currentActiveTab.value.document.request
|
finalRequest
|
||||||
)
|
)
|
||||||
|
|
||||||
tabs.currentActiveTab.value.document.isDirty = false
|
tabs.currentActiveTab.value.document.isDirty = false
|
||||||
|
|||||||
@@ -54,9 +54,10 @@
|
|||||||
>
|
>
|
||||||
<SmartEnvInput
|
<SmartEnvInput
|
||||||
v-model="tab.document.request.endpoint"
|
v-model="tab.document.request.endpoint"
|
||||||
:placeholder="`${t('request.url_placeholder')}`"
|
:placeholder="getDefaultRESTRequest().endpoint"
|
||||||
:auto-complete-source="userHistories"
|
:auto-complete-source="userHistories"
|
||||||
:auto-complete-env="true"
|
:auto-complete-env="true"
|
||||||
|
:placeholder-hover-string="t('request.http_placeholder')"
|
||||||
:inspection-results="tabResults"
|
:inspection-results="tabResults"
|
||||||
@paste="onPasteUrl($event)"
|
@paste="onPasteUrl($event)"
|
||||||
@enter="newSendRequest"
|
@enter="newSendRequest"
|
||||||
@@ -331,12 +332,12 @@ const tabs = useService(RESTTabService)
|
|||||||
const workspaceService = useService(WorkspaceService)
|
const workspaceService = useService(WorkspaceService)
|
||||||
|
|
||||||
const newSendRequest = async () => {
|
const newSendRequest = async () => {
|
||||||
if (newEndpoint.value === "" || /^\s+$/.test(newEndpoint.value)) {
|
if (/^\s+$/.test(newEndpoint.value)) {
|
||||||
toast.error(`${t("empty.endpoint")}`)
|
toast.error(`${t("empty.endpoint")}`)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
ensureMethodInEndpoint()
|
if (newEndpoint.value) ensureMethodInEndpoint()
|
||||||
|
|
||||||
loading.value = true
|
loading.value = true
|
||||||
|
|
||||||
@@ -348,7 +349,20 @@ const newSendRequest = async () => {
|
|||||||
workspaceType: workspaceService.currentWorkspace.value.type,
|
workspaceType: workspaceService.currentWorkspace.value.type,
|
||||||
})
|
})
|
||||||
|
|
||||||
const [cancel, streamPromise] = runRESTRequest$(tab)
|
const finalTab = ref({
|
||||||
|
...tab.value,
|
||||||
|
document: {
|
||||||
|
...tab.value.document,
|
||||||
|
request: {
|
||||||
|
...tab.value.document.request,
|
||||||
|
endpoint:
|
||||||
|
tab.value.document.request.endpoint ||
|
||||||
|
getDefaultRESTRequest().endpoint,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const [cancel, streamPromise] = runRESTRequest$(finalTab)
|
||||||
const streamResult = await streamPromise
|
const streamResult = await streamPromise
|
||||||
|
|
||||||
requestCancelFunc.value = cancel
|
requestCancelFunc.value = cancel
|
||||||
@@ -472,8 +486,13 @@ const fetchingShareLink = ref(false)
|
|||||||
|
|
||||||
const shareRequest = () => {
|
const shareRequest = () => {
|
||||||
if (currentUser.value) {
|
if (currentUser.value) {
|
||||||
|
const finalRequest = {
|
||||||
|
...tab.value.document.request,
|
||||||
|
endpoint:
|
||||||
|
tab.value.document.request.endpoint || getDefaultRESTRequest().endpoint,
|
||||||
|
}
|
||||||
invokeAction("share.request", {
|
invokeAction("share.request", {
|
||||||
request: tab.value.document.request,
|
request: finalRequest,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
invokeAction("modals.login.toggle")
|
invokeAction("modals.login.toggle")
|
||||||
@@ -513,11 +532,17 @@ const saveRequest = () => {
|
|||||||
showSaveRequestModal.value = true
|
showSaveRequestModal.value = true
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (saveCtx.originLocation === "user-collection") {
|
|
||||||
const req = tab.value.document.request
|
|
||||||
|
|
||||||
|
const req = tab.value.document.request
|
||||||
|
|
||||||
|
const finalRequest = {
|
||||||
|
...req,
|
||||||
|
endpoint: req.endpoint.trim() || getDefaultRESTRequest().endpoint,
|
||||||
|
}
|
||||||
|
|
||||||
|
if (saveCtx.originLocation === "user-collection") {
|
||||||
try {
|
try {
|
||||||
editRESTRequest(saveCtx.folderPath, saveCtx.requestIndex, req)
|
editRESTRequest(saveCtx.folderPath, saveCtx.requestIndex, finalRequest)
|
||||||
|
|
||||||
tab.value.document.isDirty = false
|
tab.value.document.isDirty = false
|
||||||
|
|
||||||
@@ -534,8 +559,6 @@ const saveRequest = () => {
|
|||||||
saveRequest()
|
saveRequest()
|
||||||
}
|
}
|
||||||
} else if (saveCtx.originLocation === "team-collection") {
|
} else if (saveCtx.originLocation === "team-collection") {
|
||||||
const req = tab.value.document.request
|
|
||||||
|
|
||||||
// TODO: handle error case (NOTE: overwriteRequestTeams is async)
|
// TODO: handle error case (NOTE: overwriteRequestTeams is async)
|
||||||
try {
|
try {
|
||||||
platform.analytics?.logEvent({
|
platform.analytics?.logEvent({
|
||||||
@@ -549,7 +572,7 @@ const saveRequest = () => {
|
|||||||
requestID: saveCtx.requestID,
|
requestID: saveCtx.requestID,
|
||||||
data: {
|
data: {
|
||||||
title: req.name,
|
title: req.name,
|
||||||
request: JSON.stringify(req),
|
request: JSON.stringify(finalRequest),
|
||||||
},
|
},
|
||||||
})().then((result) => {
|
})().then((result) => {
|
||||||
if (E.isLeft(result)) {
|
if (E.isLeft(result)) {
|
||||||
|
|||||||
@@ -134,6 +134,7 @@ import * as E from "fp-ts/Either"
|
|||||||
import { RESTTabService } from "~/services/tab/rest"
|
import { RESTTabService } from "~/services/tab/rest"
|
||||||
import { useService } from "dioc/vue"
|
import { useService } from "dioc/vue"
|
||||||
import { watch } from "vue"
|
import { watch } from "vue"
|
||||||
|
import { getDefaultRESTRequest } from "~/helpers/rest/default"
|
||||||
|
|
||||||
const t = useI18n()
|
const t = useI18n()
|
||||||
const colorMode = useColorMode()
|
const colorMode = useColorMode()
|
||||||
@@ -511,7 +512,10 @@ const openRequestInNewTab = (request: HoppRESTRequest) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
defineActionHandler("share.request", ({ request }) => {
|
defineActionHandler("share.request", ({ request }) => {
|
||||||
requestToShare.value = request
|
requestToShare.value = {
|
||||||
|
...request,
|
||||||
|
endpoint: request.endpoint || getDefaultRESTRequest().endpoint,
|
||||||
|
}
|
||||||
displayShareRequestModal(true)
|
displayShareRequestModal(true)
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -73,7 +73,12 @@ import {
|
|||||||
keymap,
|
keymap,
|
||||||
tooltips,
|
tooltips,
|
||||||
} from "@codemirror/view"
|
} from "@codemirror/view"
|
||||||
import { EditorSelection, EditorState, Extension } from "@codemirror/state"
|
import {
|
||||||
|
Compartment,
|
||||||
|
EditorSelection,
|
||||||
|
EditorState,
|
||||||
|
Extension,
|
||||||
|
} from "@codemirror/state"
|
||||||
import { clone } from "lodash-es"
|
import { clone } from "lodash-es"
|
||||||
import { history, historyKeymap } from "@codemirror/commands"
|
import { history, historyKeymap } from "@codemirror/commands"
|
||||||
import { inputTheme } from "~/helpers/editor/themes/baseTheme"
|
import { inputTheme } from "~/helpers/editor/themes/baseTheme"
|
||||||
@@ -109,6 +114,7 @@ const props = withDefaults(
|
|||||||
contextMenuEnabled?: boolean
|
contextMenuEnabled?: boolean
|
||||||
secret?: boolean
|
secret?: boolean
|
||||||
autoCompleteEnv?: boolean
|
autoCompleteEnv?: boolean
|
||||||
|
placeholderHoverString: string
|
||||||
}>(),
|
}>(),
|
||||||
{
|
{
|
||||||
modelValue: "",
|
modelValue: "",
|
||||||
@@ -124,6 +130,7 @@ const props = withDefaults(
|
|||||||
contextMenuEnabled: true,
|
contextMenuEnabled: true,
|
||||||
secret: false,
|
secret: false,
|
||||||
autoCompleteEnvSource: false,
|
autoCompleteEnvSource: false,
|
||||||
|
placeholderHoverString: "",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -137,6 +144,8 @@ const emit = defineEmits<{
|
|||||||
(e: "click", ev: any): void
|
(e: "click", ev: any): void
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
|
const placeholderString = ref(props.placeholder)
|
||||||
|
|
||||||
const cachedValue = ref(props.modelValue)
|
const cachedValue = ref(props.modelValue)
|
||||||
|
|
||||||
const view = ref<EditorView>()
|
const view = ref<EditorView>()
|
||||||
@@ -441,6 +450,9 @@ function handleTextSelection() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const placeholderCompt = new Compartment()
|
||||||
|
const readOnlyCompt = new Compartment()
|
||||||
|
|
||||||
// Debounce to prevent double click from selecting the word
|
// Debounce to prevent double click from selecting the word
|
||||||
const debouncedTextSelection = (time: number) =>
|
const debouncedTextSelection = (time: number) =>
|
||||||
useDebounceFn(() => {
|
useDebounceFn(() => {
|
||||||
@@ -475,6 +487,7 @@ const getExtensions = (readonly: boolean): Extension => {
|
|||||||
}),
|
}),
|
||||||
EditorState.changeFilter.of(() => !readonly),
|
EditorState.changeFilter.of(() => !readonly),
|
||||||
inputTheme,
|
inputTheme,
|
||||||
|
readOnlyCompt.of(EditorState.readOnly.of(readonly)),
|
||||||
readonly
|
readonly
|
||||||
? EditorView.theme({
|
? EditorView.theme({
|
||||||
".cm-content": {
|
".cm-content": {
|
||||||
@@ -490,7 +503,8 @@ const getExtensions = (readonly: boolean): Extension => {
|
|||||||
position: "absolute",
|
position: "absolute",
|
||||||
}),
|
}),
|
||||||
props.environmentHighlights ? envTooltipPlugin : [],
|
props.environmentHighlights ? envTooltipPlugin : [],
|
||||||
placeholderExt(props.placeholder),
|
placeholderCompt.of(placeholderExt(props.placeholder)),
|
||||||
|
|
||||||
EditorView.domEventHandlers({
|
EditorView.domEventHandlers({
|
||||||
paste(ev) {
|
paste(ev) {
|
||||||
clipboardEv = ev
|
clipboardEv = ev
|
||||||
@@ -505,6 +519,27 @@ const getExtensions = (readonly: boolean): Extension => {
|
|||||||
debouncedTextSelection(30)()
|
debouncedTextSelection(30)()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mouseenter() {
|
||||||
|
//change placeholder to hover string if provided
|
||||||
|
if (props.placeholderHoverString && !props.readonly) {
|
||||||
|
placeholderString.value = props.placeholderHoverString
|
||||||
|
view.value?.dispatch({
|
||||||
|
effects: placeholderCompt.reconfigure(
|
||||||
|
placeholderExt(props.placeholderHoverString)
|
||||||
|
),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mouseleave() {
|
||||||
|
//change placeholder back to original string
|
||||||
|
if (props.placeholderHoverString && !props.readonly) {
|
||||||
|
view.value?.dispatch({
|
||||||
|
effects: placeholderCompt.reconfigure(
|
||||||
|
placeholderExt(props.placeholder)
|
||||||
|
),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
props.autoCompleteEnv
|
props.autoCompleteEnv
|
||||||
? autocompletion({
|
? autocompletion({
|
||||||
@@ -568,6 +603,38 @@ const getExtensions = (readonly: boolean): Extension => {
|
|||||||
return extensions
|
return extensions
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.readonly,
|
||||||
|
(readonly) => {
|
||||||
|
if (readonly) {
|
||||||
|
view.value!.dispatch({
|
||||||
|
effects: [
|
||||||
|
readOnlyCompt.reconfigure([
|
||||||
|
EditorState.readOnly.of(readonly),
|
||||||
|
EditorView.theme({
|
||||||
|
".cm-content": {
|
||||||
|
caretColor: "var(--secondary-dark-color)",
|
||||||
|
color: "var(--secondary-dark-color)",
|
||||||
|
backgroundColor: "var(--divider-color)",
|
||||||
|
opacity: 0.25,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
]),
|
||||||
|
],
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
view.value!.dispatch({
|
||||||
|
effects: [
|
||||||
|
readOnlyCompt.reconfigure([
|
||||||
|
EditorState.readOnly.of(readonly),
|
||||||
|
EditorView.theme({}),
|
||||||
|
]),
|
||||||
|
],
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
const triggerTextSelection = () => {
|
const triggerTextSelection = () => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
view.value?.focus()
|
view.value?.focus()
|
||||||
|
|||||||
@@ -37,17 +37,13 @@ import { TeamNameCodec } from "~/helpers/backend/types/TeamName"
|
|||||||
import { useI18n } from "@composables/i18n"
|
import { useI18n } from "@composables/i18n"
|
||||||
import { useToast } from "@composables/toast"
|
import { useToast } from "@composables/toast"
|
||||||
import { platform } from "~/platform"
|
import { platform } from "~/platform"
|
||||||
import { useService } from "dioc/vue"
|
|
||||||
import { WorkspaceService } from "~/services/workspace.service"
|
|
||||||
import { useLocalState } from "~/newstore/localstate"
|
|
||||||
|
|
||||||
const t = useI18n()
|
const t = useI18n()
|
||||||
|
|
||||||
const toast = useToast()
|
const toast = useToast()
|
||||||
|
|
||||||
const props = defineProps<{
|
defineProps<{
|
||||||
show: boolean
|
show: boolean
|
||||||
switchWorkspaceAfterCreation?: boolean
|
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
@@ -56,12 +52,8 @@ const emit = defineEmits<{
|
|||||||
|
|
||||||
const editingName = ref<string | null>(null)
|
const editingName = ref<string | null>(null)
|
||||||
|
|
||||||
const REMEMBERED_TEAM_ID = useLocalState("REMEMBERED_TEAM_ID")
|
|
||||||
|
|
||||||
const isLoading = ref(false)
|
const isLoading = ref(false)
|
||||||
|
|
||||||
const workspaceService = useService(WorkspaceService)
|
|
||||||
|
|
||||||
const addNewTeam = async () => {
|
const addNewTeam = async () => {
|
||||||
isLoading.value = true
|
isLoading.value = true
|
||||||
await pipe(
|
await pipe(
|
||||||
@@ -84,19 +76,8 @@ const addNewTeam = async () => {
|
|||||||
// Handle GQL errors (use err obj)
|
// Handle GQL errors (use err obj)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
(team) => {
|
() => {
|
||||||
toast.success(`${t("team.new_created")}`)
|
toast.success(`${t("team.new_created")}`)
|
||||||
|
|
||||||
if (props.switchWorkspaceAfterCreation) {
|
|
||||||
REMEMBERED_TEAM_ID.value = team.id
|
|
||||||
workspaceService.changeWorkspace({
|
|
||||||
teamID: team.id,
|
|
||||||
teamName: team.name,
|
|
||||||
type: "team",
|
|
||||||
role: team.myRole,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
hideModal()
|
hideModal()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -59,18 +59,14 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-else-if="teamListAdapterError"
|
v-if="!loading && teamListAdapterError"
|
||||||
class="flex flex-col items-center py-4"
|
class="flex flex-col items-center py-4"
|
||||||
>
|
>
|
||||||
<icon-lucide-help-circle class="svg-icons mb-4" />
|
<icon-lucide-help-circle class="svg-icons mb-4" />
|
||||||
{{ t("error.something_went_wrong") }}
|
{{ t("error.something_went_wrong") }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<TeamsAdd
|
<TeamsAdd :show="showModalAdd" @hide-modal="displayModalAdd(false)" />
|
||||||
:show="showModalAdd"
|
|
||||||
:switch-workspace-after-creation="true"
|
|
||||||
@hide-modal="displayModalAdd(false)"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@@ -85,7 +81,7 @@ import { useColorMode } from "@composables/theming"
|
|||||||
import { GetMyTeamsQuery } from "~/helpers/backend/graphql"
|
import { GetMyTeamsQuery } from "~/helpers/backend/graphql"
|
||||||
import IconDone from "~icons/lucide/check"
|
import IconDone from "~icons/lucide/check"
|
||||||
import { useLocalState } from "~/newstore/localstate"
|
import { useLocalState } from "~/newstore/localstate"
|
||||||
import { defineActionHandler, invokeAction } from "~/helpers/actions"
|
import { defineActionHandler } from "~/helpers/actions"
|
||||||
import { WorkspaceService } from "~/services/workspace.service"
|
import { WorkspaceService } from "~/services/workspace.service"
|
||||||
import { useService } from "dioc/vue"
|
import { useService } from "dioc/vue"
|
||||||
import { useElementVisibility, useIntervalFn } from "@vueuse/core"
|
import { useElementVisibility, useIntervalFn } from "@vueuse/core"
|
||||||
@@ -158,7 +154,6 @@ const switchToTeamWorkspace = (team: GetMyTeamsQuery["myTeams"][number]) => {
|
|||||||
teamID: team.id,
|
teamID: team.id,
|
||||||
teamName: team.name,
|
teamName: team.name,
|
||||||
type: "team",
|
type: "team",
|
||||||
role: team.myRole,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,14 +169,11 @@ watch(
|
|||||||
(user) => {
|
(user) => {
|
||||||
if (!user) {
|
if (!user) {
|
||||||
switchToPersonalWorkspace()
|
switchToPersonalWorkspace()
|
||||||
teamListadapter.dispose()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
const displayModalAdd = (shouldDisplay: boolean) => {
|
const displayModalAdd = (shouldDisplay: boolean) => {
|
||||||
if (!currentUser.value) return invokeAction("modals.login.toggle")
|
|
||||||
|
|
||||||
showModalAdd.value = shouldDisplay
|
showModalAdd.value = shouldDisplay
|
||||||
teamListadapter.fetchList()
|
teamListadapter.fetchList()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ export default class TeamListAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public dispose() {
|
public dispose() {
|
||||||
this.teamList$.next([])
|
|
||||||
this.isDispose = true
|
this.isDispose = true
|
||||||
clearTimeout(this.timeoutHandle as any)
|
clearTimeout(this.timeoutHandle as any)
|
||||||
this.timeoutHandle = null
|
this.timeoutHandle = null
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ export class TeamSearchService extends Service {
|
|||||||
expandingCollections: Ref<string[]> = ref([])
|
expandingCollections: Ref<string[]> = ref([])
|
||||||
expandedCollections: Ref<string[]> = ref([])
|
expandedCollections: Ref<string[]> = ref([])
|
||||||
|
|
||||||
// TODO: ideally this should return the search results / formatted results instead of directly manipulating the result set
|
// FUTURE-TODO: ideally this should return the search results / formatted results instead of directly manipulating the result set
|
||||||
// eg: do the spotlight formatting in the spotlight searcher and not here
|
// eg: do the spotlight formatting in the spotlight searcher and not here
|
||||||
searchTeams = async (query: string, teamID: string) => {
|
searchTeams = async (query: string, teamID: string) => {
|
||||||
if (!query.length) {
|
if (!query.length) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { HoppModule } from "."
|
import { HoppModule } from "."
|
||||||
import { Container, ServiceClassInstance } from "dioc"
|
import { Container, Service } from "dioc"
|
||||||
import { diocPlugin } from "dioc/vue"
|
import { diocPlugin } from "dioc/vue"
|
||||||
import { DebugService } from "~/services/debug.service"
|
import { DebugService } from "~/services/debug.service"
|
||||||
import { platform } from "~/platform"
|
import { platform } from "~/platform"
|
||||||
@@ -22,7 +22,7 @@ if (import.meta.env.DEV) {
|
|||||||
* services. Please use `useService` if within components or try to convert your
|
* services. Please use `useService` if within components or try to convert your
|
||||||
* legacy subsystem into a service if possible.
|
* legacy subsystem into a service if possible.
|
||||||
*/
|
*/
|
||||||
export function getService<T extends ServiceClassInstance<any>>(
|
export function getService<T extends typeof Service<any> & { ID: string }>(
|
||||||
service: T
|
service: T
|
||||||
): InstanceType<T> {
|
): InstanceType<T> {
|
||||||
return serviceContainer.bind(service)
|
return serviceContainer.bind(service)
|
||||||
@@ -30,10 +30,11 @@ export function getService<T extends ServiceClassInstance<any>>(
|
|||||||
|
|
||||||
export default <HoppModule>{
|
export default <HoppModule>{
|
||||||
onVueAppInit(app) {
|
onVueAppInit(app) {
|
||||||
|
// TODO: look into this
|
||||||
|
// @ts-expect-error Something weird with Vue versions
|
||||||
app.use(diocPlugin, {
|
app.use(diocPlugin, {
|
||||||
container: serviceContainer,
|
container: serviceContainer,
|
||||||
})
|
})
|
||||||
|
|
||||||
for (const service of platform.addedServices ?? []) {
|
for (const service of platform.addedServices ?? []) {
|
||||||
serviceContainer.bind(service)
|
serviceContainer.bind(service)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1393,6 +1393,14 @@ export function editGraphqlRequest(
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function saveGraphqlRequestAs(path: string, request: HoppGQLRequest) {
|
export function saveGraphqlRequestAs(path: string, request: HoppGQLRequest) {
|
||||||
|
// For calculating the insertion request index
|
||||||
|
const targetLocation = navigateToFolderWithIndexPath(
|
||||||
|
graphqlCollectionStore.value.state,
|
||||||
|
path.split("/").map((x) => parseInt(x))
|
||||||
|
)
|
||||||
|
|
||||||
|
const insertionIndex = targetLocation!.requests.length
|
||||||
|
|
||||||
graphqlCollectionStore.dispatch({
|
graphqlCollectionStore.dispatch({
|
||||||
dispatcher: "saveRequestAs",
|
dispatcher: "saveRequestAs",
|
||||||
payload: {
|
payload: {
|
||||||
@@ -1400,6 +1408,8 @@ export function saveGraphqlRequestAs(path: string, request: HoppGQLRequest) {
|
|||||||
request,
|
request,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
return insertionIndex
|
||||||
}
|
}
|
||||||
|
|
||||||
export function removeGraphqlRequest(
|
export function removeGraphqlRequest(
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
|
import { pluck, distinctUntilChanged } from "rxjs/operators"
|
||||||
import { cloneDeep, defaultsDeep, has } from "lodash-es"
|
import { cloneDeep, defaultsDeep, has } from "lodash-es"
|
||||||
import { Observable } from "rxjs"
|
import { Observable } from "rxjs"
|
||||||
import { distinctUntilChanged, pluck } from "rxjs/operators"
|
|
||||||
import { nextTick } from "vue"
|
|
||||||
import { platform } from "~/platform"
|
|
||||||
import type { KeysMatching } from "~/types/ts-utils"
|
|
||||||
import DispatchingStore, { defineDispatchers } from "./DispatchingStore"
|
import DispatchingStore, { defineDispatchers } from "./DispatchingStore"
|
||||||
|
import type { KeysMatching } from "~/types/ts-utils"
|
||||||
|
|
||||||
export const HoppBgColors = ["system", "light", "dark", "black"] as const
|
export const HoppBgColors = ["system", "light", "dark", "black"] as const
|
||||||
|
|
||||||
@@ -70,63 +69,51 @@ export type SettingsDef = {
|
|||||||
HAS_OPENED_SPOTLIGHT: boolean
|
HAS_OPENED_SPOTLIGHT: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getDefaultSettings = (): SettingsDef => {
|
export const getDefaultSettings = (): SettingsDef => ({
|
||||||
const defaultSettings: SettingsDef = {
|
syncCollections: true,
|
||||||
syncCollections: true,
|
syncHistory: true,
|
||||||
syncHistory: true,
|
syncEnvironments: true,
|
||||||
syncEnvironments: true,
|
|
||||||
|
|
||||||
WRAP_LINES: {
|
WRAP_LINES: {
|
||||||
httpRequestBody: true,
|
httpRequestBody: true,
|
||||||
httpResponseBody: true,
|
httpResponseBody: true,
|
||||||
httpHeaders: true,
|
httpHeaders: true,
|
||||||
httpParams: true,
|
httpParams: true,
|
||||||
httpUrlEncoded: true,
|
httpUrlEncoded: true,
|
||||||
httpPreRequest: true,
|
httpPreRequest: true,
|
||||||
httpTest: true,
|
httpTest: true,
|
||||||
httpRequestVariables: true,
|
httpRequestVariables: true,
|
||||||
graphqlQuery: true,
|
graphqlQuery: true,
|
||||||
graphqlResponseBody: true,
|
graphqlResponseBody: true,
|
||||||
graphqlHeaders: false,
|
graphqlHeaders: false,
|
||||||
graphqlVariables: false,
|
graphqlVariables: false,
|
||||||
graphqlSchema: true,
|
graphqlSchema: true,
|
||||||
importCurl: true,
|
importCurl: true,
|
||||||
codeGen: true,
|
codeGen: true,
|
||||||
cookie: true,
|
cookie: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
CURRENT_INTERCEPTOR_ID: "",
|
CURRENT_INTERCEPTOR_ID: "browser", // TODO: Allow the platform definition to take this place
|
||||||
|
|
||||||
// TODO: Interceptor related settings should move under the interceptor systems
|
// TODO: Interceptor related settings should move under the interceptor systems
|
||||||
PROXY_URL: "https://proxy.hoppscotch.io/",
|
PROXY_URL: "https://proxy.hoppscotch.io/",
|
||||||
URL_EXCLUDES: {
|
URL_EXCLUDES: {
|
||||||
auth: true,
|
auth: true,
|
||||||
httpUser: true,
|
httpUser: true,
|
||||||
httpPassword: true,
|
httpPassword: true,
|
||||||
bearerToken: true,
|
bearerToken: true,
|
||||||
oauth2Token: true,
|
oauth2Token: true,
|
||||||
},
|
},
|
||||||
THEME_COLOR: "indigo",
|
THEME_COLOR: "indigo",
|
||||||
BG_COLOR: "system",
|
BG_COLOR: "system",
|
||||||
TELEMETRY_ENABLED: true,
|
TELEMETRY_ENABLED: true,
|
||||||
EXPAND_NAVIGATION: false,
|
EXPAND_NAVIGATION: false,
|
||||||
SIDEBAR: true,
|
SIDEBAR: true,
|
||||||
SIDEBAR_ON_LEFT: false,
|
SIDEBAR_ON_LEFT: false,
|
||||||
COLUMN_LAYOUT: true,
|
COLUMN_LAYOUT: true,
|
||||||
|
|
||||||
HAS_OPENED_SPOTLIGHT: false,
|
HAS_OPENED_SPOTLIGHT: false,
|
||||||
}
|
})
|
||||||
|
|
||||||
// Wait for platform to initialize before setting CURRENT_INTERCEPTOR_ID
|
|
||||||
nextTick(() => {
|
|
||||||
applySetting(
|
|
||||||
"CURRENT_INTERCEPTOR_ID",
|
|
||||||
platform?.interceptors.default || "browser"
|
|
||||||
)
|
|
||||||
})
|
|
||||||
|
|
||||||
return defaultSettings
|
|
||||||
}
|
|
||||||
|
|
||||||
type ApplySettingPayload = {
|
type ApplySettingPayload = {
|
||||||
[K in keyof SettingsDef]: {
|
[K in keyof SettingsDef]: {
|
||||||
|
|||||||
@@ -112,7 +112,10 @@ const activeTabs = tabs.getActiveTabs()
|
|||||||
|
|
||||||
const addNewTab = () => {
|
const addNewTab = () => {
|
||||||
const tab = tabs.createNewTab({
|
const tab = tabs.createNewTab({
|
||||||
request: getDefaultGQLRequest(),
|
request: {
|
||||||
|
...getDefaultGQLRequest(),
|
||||||
|
url: "",
|
||||||
|
},
|
||||||
isDirty: false,
|
isDirty: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,13 @@
|
|||||||
@submit="renameReqName"
|
@submit="renameReqName"
|
||||||
@hide-modal="showRenamingReqNameModal = false"
|
@hide-modal="showRenamingReqNameModal = false"
|
||||||
/>
|
/>
|
||||||
|
<HoppSmartConfirmModal
|
||||||
|
:show="confirmingCloseForTabID !== null"
|
||||||
|
:confirm="t('modal.close_unsaved_tab')"
|
||||||
|
:title="t('confirm.save_unsaved_tab')"
|
||||||
|
@hide-modal="onCloseConfirmSaveTab"
|
||||||
|
@resolve="onResolveConfirmSaveTab"
|
||||||
|
/>
|
||||||
<HoppSmartConfirmModal
|
<HoppSmartConfirmModal
|
||||||
:show="confirmingCloseAllTabs"
|
:show="confirmingCloseAllTabs"
|
||||||
:confirm="t('modal.close_unsaved_tab')"
|
:confirm="t('modal.close_unsaved_tab')"
|
||||||
@@ -71,36 +78,6 @@
|
|||||||
@hide-modal="confirmingCloseAllTabs = false"
|
@hide-modal="confirmingCloseAllTabs = false"
|
||||||
@resolve="onResolveConfirmCloseAllTabs"
|
@resolve="onResolveConfirmCloseAllTabs"
|
||||||
/>
|
/>
|
||||||
<HoppSmartModal
|
|
||||||
v-if="confirmingCloseForTabID !== null"
|
|
||||||
dialog
|
|
||||||
role="dialog"
|
|
||||||
aria-modal="true"
|
|
||||||
:title="t('modal.close_unsaved_tab')"
|
|
||||||
@close="confirmingCloseForTabID = null"
|
|
||||||
>
|
|
||||||
<template #body>
|
|
||||||
<div class="text-center">
|
|
||||||
{{ t("confirm.save_unsaved_tab") }}
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<template #footer>
|
|
||||||
<span class="flex space-x-2">
|
|
||||||
<HoppButtonPrimary
|
|
||||||
v-focus
|
|
||||||
:label="t?.('action.yes')"
|
|
||||||
outline
|
|
||||||
@click="onResolveConfirmSaveTab"
|
|
||||||
/>
|
|
||||||
<HoppButtonSecondary
|
|
||||||
:label="t?.('action.no')"
|
|
||||||
filled
|
|
||||||
outline
|
|
||||||
@click="onCloseConfirmSaveTab"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</HoppSmartModal>
|
|
||||||
<CollectionsSaveRequest
|
<CollectionsSaveRequest
|
||||||
v-if="savingRequest"
|
v-if="savingRequest"
|
||||||
mode="rest"
|
mode="rest"
|
||||||
@@ -201,7 +178,10 @@ const onTabUpdate = (tab: HoppTab<HoppRESTDocument>) => {
|
|||||||
|
|
||||||
const addNewTab = () => {
|
const addNewTab = () => {
|
||||||
const tab = tabs.createNewTab({
|
const tab = tabs.createNewTab({
|
||||||
request: getDefaultRESTRequest(),
|
request: {
|
||||||
|
...getDefaultRESTRequest(),
|
||||||
|
endpoint: "",
|
||||||
|
},
|
||||||
isDirty: false,
|
isDirty: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -318,8 +298,14 @@ const shareTabRequest = (tabID: string) => {
|
|||||||
const tab = tabs.getTabRef(tabID)
|
const tab = tabs.getTabRef(tabID)
|
||||||
if (tab.value) {
|
if (tab.value) {
|
||||||
if (currentUser.value) {
|
if (currentUser.value) {
|
||||||
|
const finalRequest = {
|
||||||
|
...tab.value.document.request,
|
||||||
|
endpoint:
|
||||||
|
tab.value.document.request.endpoint ||
|
||||||
|
getDefaultRESTRequest().endpoint,
|
||||||
|
}
|
||||||
invokeAction("share.request", {
|
invokeAction("share.request", {
|
||||||
request: tab.value.document.request,
|
request: finalRequest,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
invokeAction("modals.login.toggle")
|
invokeAction("modals.login.toggle")
|
||||||
|
|||||||
@@ -8,15 +8,14 @@ import { AnalyticsPlatformDef } from "./analytics"
|
|||||||
import { InterceptorsPlatformDef } from "./interceptors"
|
import { InterceptorsPlatformDef } from "./interceptors"
|
||||||
import { HoppModule } from "~/modules"
|
import { HoppModule } from "~/modules"
|
||||||
import { InspectorsPlatformDef } from "./inspectors"
|
import { InspectorsPlatformDef } from "./inspectors"
|
||||||
import { ServiceClassInstance } from "dioc"
|
import { Service } from "dioc"
|
||||||
import { IOPlatformDef } from "./io"
|
import { IOPlatformDef } from "./io"
|
||||||
import { SpotlightPlatformDef } from "./spotlight"
|
import { SpotlightPlatformDef } from "./spotlight"
|
||||||
import { Ref } from "vue"
|
|
||||||
|
|
||||||
export type PlatformDef = {
|
export type PlatformDef = {
|
||||||
ui?: UIPlatformDef
|
ui?: UIPlatformDef
|
||||||
addedHoppModules?: HoppModule[]
|
addedHoppModules?: HoppModule[]
|
||||||
addedServices?: Array<ServiceClassInstance<unknown>>
|
addedServices?: Array<typeof Service<unknown> & { ID: string }>
|
||||||
auth: AuthPlatformDef
|
auth: AuthPlatformDef
|
||||||
analytics?: AnalyticsPlatformDef
|
analytics?: AnalyticsPlatformDef
|
||||||
io: IOPlatformDef
|
io: IOPlatformDef
|
||||||
@@ -46,11 +45,6 @@ export type PlatformDef = {
|
|||||||
* If a value is not given, then the value is assumed to be true
|
* If a value is not given, then the value is assumed to be true
|
||||||
*/
|
*/
|
||||||
promptAsUsingCookies?: boolean
|
promptAsUsingCookies?: boolean
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether to show the A/B testing workspace switcher click login flow or not
|
|
||||||
*/
|
|
||||||
workspaceSwitcherLogin?: Ref<boolean>
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Container, ServiceClassInstance } from "dioc"
|
import { Service } from "dioc"
|
||||||
import { Inspector } from "~/services/inspection"
|
import { Inspector } from "~/services/inspection"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -8,9 +8,8 @@ export type PlatformInspectorsDef = {
|
|||||||
// We are keeping this as the only mode for now
|
// We are keeping this as the only mode for now
|
||||||
// So that if we choose to add other modes, we can do without breaking
|
// So that if we choose to add other modes, we can do without breaking
|
||||||
type: "service"
|
type: "service"
|
||||||
// TODO: I don't think this type is effective, we have to come up with a better impl
|
service: typeof Service<unknown> & { ID: string } & {
|
||||||
service: ServiceClassInstance<unknown> & {
|
new (): Service & Inspector
|
||||||
new (c: Container): Inspector
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
import { Container, ServiceClassInstance } from "dioc"
|
import { Service } from "dioc"
|
||||||
import { Interceptor } from "~/services/interceptor.service"
|
import { Interceptor } from "~/services/interceptor.service"
|
||||||
|
|
||||||
export type PlatformInterceptorDef =
|
export type PlatformInterceptorDef =
|
||||||
| { type: "standalone"; interceptor: Interceptor }
|
| { type: "standalone"; interceptor: Interceptor }
|
||||||
| {
|
| {
|
||||||
type: "service"
|
type: "service"
|
||||||
// TODO: I don't think this type is effective, we have to come up with a better impl
|
service: typeof Service<unknown> & { ID: string } & {
|
||||||
service: ServiceClassInstance<unknown> & {
|
new (): Service & Interceptor
|
||||||
new (c: Container): Interceptor
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { Container, ServiceClassInstance } from "dioc"
|
import { Service } from "dioc"
|
||||||
import { SpotlightSearcher } from "~/services/spotlight"
|
import { SpotlightSearcher } from "~/services/spotlight"
|
||||||
|
|
||||||
export type SpotlightPlatformDef = {
|
export type SpotlightPlatformDef = {
|
||||||
additionalSearchers?: Array<
|
additionalSearchers?: Array<
|
||||||
ServiceClassInstance<unknown> & {
|
typeof Service<unknown> & { ID: string } & {
|
||||||
new (c: Container): SpotlightSearcher
|
new (): Service & SpotlightSearcher
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,9 @@ export class ExtensionInspectorService extends Service implements Inspector {
|
|||||||
|
|
||||||
private readonly inspection = this.bind(InspectionService)
|
private readonly inspection = this.bind(InspectionService)
|
||||||
|
|
||||||
override onServiceInit() {
|
constructor() {
|
||||||
|
super()
|
||||||
|
|
||||||
this.inspection.registerInspector(this)
|
this.inspection.registerInspector(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -133,7 +133,9 @@ export class ExtensionInterceptorService
|
|||||||
|
|
||||||
public selectable = { type: "selectable" as const }
|
public selectable = { type: "selectable" as const }
|
||||||
|
|
||||||
override onServiceInit() {
|
constructor() {
|
||||||
|
super()
|
||||||
|
|
||||||
this.listenForExtensionStatus()
|
this.listenForExtensionStatus()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,9 @@ export class EnvironmentMenuService extends Service implements ContextMenu {
|
|||||||
|
|
||||||
private readonly contextMenu = this.bind(ContextMenuService)
|
private readonly contextMenu = this.bind(ContextMenuService)
|
||||||
|
|
||||||
override onServiceInit() {
|
constructor() {
|
||||||
|
super()
|
||||||
|
|
||||||
this.contextMenu.registerMenu(this)
|
this.contextMenu.registerMenu(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,9 @@ export class ParameterMenuService extends Service implements ContextMenu {
|
|||||||
|
|
||||||
private readonly contextMenu = this.bind(ContextMenuService)
|
private readonly contextMenu = this.bind(ContextMenuService)
|
||||||
|
|
||||||
override onServiceInit() {
|
constructor() {
|
||||||
|
super()
|
||||||
|
|
||||||
this.contextMenu.registerMenu(this)
|
this.contextMenu.registerMenu(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,9 @@ export class URLMenuService extends Service implements ContextMenu {
|
|||||||
private readonly contextMenu = this.bind(ContextMenuService)
|
private readonly contextMenu = this.bind(ContextMenuService)
|
||||||
private readonly restTab = this.bind(RESTTabService)
|
private readonly restTab = this.bind(RESTTabService)
|
||||||
|
|
||||||
override onServiceInit() {
|
constructor() {
|
||||||
|
super()
|
||||||
|
|
||||||
this.contextMenu.registerMenu(this)
|
this.contextMenu.registerMenu(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,10 @@ export class CookieJarService extends Service {
|
|||||||
*/
|
*/
|
||||||
public cookieJar = ref(new Map<string, string[]>())
|
public cookieJar = ref(new Map<string, string[]>())
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super()
|
||||||
|
}
|
||||||
|
|
||||||
public parseSetCookieString(setCookieString: string) {
|
public parseSetCookieString(setCookieString: string) {
|
||||||
return setCookieParse(setCookieString)
|
return setCookieParse(setCookieString)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,9 @@ import { Service } from "dioc"
|
|||||||
export class DebugService extends Service {
|
export class DebugService extends Service {
|
||||||
public static readonly ID = "DEBUG_SERVICE"
|
public static readonly ID = "DEBUG_SERVICE"
|
||||||
|
|
||||||
override onServiceInit() {
|
constructor() {
|
||||||
|
super()
|
||||||
|
|
||||||
console.log("DebugService is initialized...")
|
console.log("DebugService is initialized...")
|
||||||
|
|
||||||
const container = this.getContainer()
|
const container = this.getContainer()
|
||||||
|
|||||||
@@ -107,7 +107,9 @@ export class InspectionService extends Service {
|
|||||||
|
|
||||||
private readonly restTab = this.bind(RESTTabService)
|
private readonly restTab = this.bind(RESTTabService)
|
||||||
|
|
||||||
override onServiceInit() {
|
constructor() {
|
||||||
|
super()
|
||||||
|
|
||||||
this.initializeListeners()
|
this.initializeListeners()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,9 @@ export class EnvironmentInspectorService extends Service implements Inspector {
|
|||||||
}
|
}
|
||||||
)[0]
|
)[0]
|
||||||
|
|
||||||
override onServiceInit() {
|
constructor() {
|
||||||
|
super()
|
||||||
|
|
||||||
this.inspection.registerInspector(this)
|
this.inspection.registerInspector(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,9 @@ export class HeaderInspectorService extends Service implements Inspector {
|
|||||||
private readonly inspection = this.bind(InspectionService)
|
private readonly inspection = this.bind(InspectionService)
|
||||||
private readonly interceptorService = this.bind(InterceptorService)
|
private readonly interceptorService = this.bind(InterceptorService)
|
||||||
|
|
||||||
override onServiceInit() {
|
constructor() {
|
||||||
|
super()
|
||||||
|
|
||||||
this.inspection.registerInspector(this)
|
this.inspection.registerInspector(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,9 @@ export class ResponseInspectorService extends Service implements Inspector {
|
|||||||
|
|
||||||
private readonly inspection = this.bind(InspectionService)
|
private readonly inspection = this.bind(InspectionService)
|
||||||
|
|
||||||
override onServiceInit() {
|
constructor() {
|
||||||
|
super()
|
||||||
|
|
||||||
this.inspection.registerInspector(this)
|
this.inspection.registerInspector(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -178,7 +178,9 @@ export class InterceptorService extends Service {
|
|||||||
return this.interceptors.get(this.currentInterceptorID.value)
|
return this.interceptors.get(this.currentInterceptorID.value)
|
||||||
})
|
})
|
||||||
|
|
||||||
override onServiceInit() {
|
constructor() {
|
||||||
|
super()
|
||||||
|
|
||||||
// If the current interceptor is unselectable, select the first selectable one, else null
|
// If the current interceptor is unselectable, select the first selectable one, else null
|
||||||
watch([() => this.interceptors, this.currentInterceptorID], () => {
|
watch([() => this.interceptors, this.currentInterceptorID], () => {
|
||||||
if (!this.currentInterceptorID.value) return
|
if (!this.currentInterceptorID.value) return
|
||||||
|
|||||||
@@ -109,6 +109,10 @@ export class OauthAuthService extends Service {
|
|||||||
public static readonly ID = "OAUTH_AUTH_SERVICE"
|
public static readonly ID = "OAUTH_AUTH_SERVICE"
|
||||||
|
|
||||||
static redirectURI = `${window.location.origin}/oauth`
|
static redirectURI = `${window.location.origin}/oauth`
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const generateRandomString = () => {
|
export const generateRandomString = () => {
|
||||||
|
|||||||
@@ -89,6 +89,10 @@ export class PersistenceService extends Service {
|
|||||||
|
|
||||||
public hoppLocalConfigStorage: StorageLike = localStorage
|
public hoppLocalConfigStorage: StorageLike = localStorage
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super()
|
||||||
|
}
|
||||||
|
|
||||||
private showErrorToast(localStorageKey: string) {
|
private showErrorToast(localStorageKey: string) {
|
||||||
const toast = useToast()
|
const toast = useToast()
|
||||||
toast.error(
|
toast.error(
|
||||||
|
|||||||
@@ -27,6 +27,10 @@ export class SecretEnvironmentService extends Service {
|
|||||||
*/
|
*/
|
||||||
public secretEnvironments = reactive(new Map<string, SecretVariable[]>())
|
public secretEnvironments = reactive(new Map<string, SecretVariable[]>())
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super()
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a new secret environment.
|
* Add a new secret environment.
|
||||||
* @param id ID of the environment
|
* @param id ID of the environment
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import {
|
|||||||
import { nextTick, reactive, ref } from "vue"
|
import { nextTick, reactive, ref } from "vue"
|
||||||
import { SpotlightSearcherResult } from "../../.."
|
import { SpotlightSearcherResult } from "../../.."
|
||||||
import { TestContainer } from "dioc/testing"
|
import { TestContainer } from "dioc/testing"
|
||||||
import { Container } from "dioc"
|
|
||||||
|
|
||||||
async function flushPromises() {
|
async function flushPromises() {
|
||||||
return await new Promise((r) => setTimeout(r))
|
return await new Promise((r) => setTimeout(r))
|
||||||
@@ -33,15 +32,12 @@ describe("StaticSpotlightSearcherService", () => {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO: dioc > v3 does not recommend using constructors, move to onServiceInit
|
constructor() {
|
||||||
constructor(c: Container) {
|
super({
|
||||||
super(c, {
|
|
||||||
searchFields: ["text"],
|
searchFields: ["text"],
|
||||||
fieldWeights: {},
|
fieldWeights: {},
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
override onServiceInit() {
|
|
||||||
this.setDocuments(this.documents)
|
this.setDocuments(this.documents)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,15 +94,12 @@ describe("StaticSpotlightSearcherService", () => {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO: dioc > v3 does not recommend using constructors, move to onServiceInit
|
constructor() {
|
||||||
constructor(c: Container) {
|
super({
|
||||||
super(c, {
|
|
||||||
searchFields: ["text"],
|
searchFields: ["text"],
|
||||||
fieldWeights: {},
|
fieldWeights: {},
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
override onServiceInit() {
|
|
||||||
this.setDocuments(this.documents)
|
this.setDocuments(this.documents)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,15 +159,12 @@ describe("StaticSpotlightSearcherService", () => {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO: dioc > v3 does not recommend using constructors, move to onServiceInit
|
constructor() {
|
||||||
constructor(c: Container) {
|
super({
|
||||||
super(c, {
|
|
||||||
searchFields: ["text"],
|
searchFields: ["text"],
|
||||||
fieldWeights: {},
|
fieldWeights: {},
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
override onServiceInit() {
|
|
||||||
this.setDocuments(this.documents)
|
this.setDocuments(this.documents)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -234,15 +224,12 @@ describe("StaticSpotlightSearcherService", () => {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO: dioc > v3 does not recommend using constructors, move to onServiceInit
|
constructor() {
|
||||||
constructor(c: Container) {
|
super({
|
||||||
super(c, {
|
|
||||||
searchFields: ["text"],
|
searchFields: ["text"],
|
||||||
fieldWeights: {},
|
fieldWeights: {},
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
override onServiceInit() {
|
|
||||||
this.setDocuments(this.documents)
|
this.setDocuments(this.documents)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -298,15 +285,12 @@ describe("StaticSpotlightSearcherService", () => {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO: dioc > v3 does not recommend using constructors, move to onServiceInit
|
constructor() {
|
||||||
constructor(c: Container) {
|
super({
|
||||||
super(c, {
|
|
||||||
searchFields: ["text"],
|
searchFields: ["text"],
|
||||||
fieldWeights: {},
|
fieldWeights: {},
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
override onServiceInit() {
|
|
||||||
this.setDocuments(this.documents)
|
this.setDocuments(this.documents)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -370,15 +354,12 @@ describe("StaticSpotlightSearcherService", () => {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO: dioc > v3 does not recommend using constructors, move to onServiceInit
|
constructor() {
|
||||||
constructor(c: Container) {
|
super({
|
||||||
super(c, {
|
|
||||||
searchFields: ["text", "alternate"],
|
searchFields: ["text", "alternate"],
|
||||||
fieldWeights: {},
|
fieldWeights: {},
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
override onServiceInit() {
|
|
||||||
this.setDocuments(this.documents)
|
this.setDocuments(this.documents)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Container, Service } from "dioc"
|
import { Service } from "dioc"
|
||||||
import {
|
import {
|
||||||
type SpotlightSearcher,
|
type SpotlightSearcher,
|
||||||
type SpotlightSearcherResult,
|
type SpotlightSearcherResult,
|
||||||
@@ -67,12 +67,8 @@ export abstract class StaticSpotlightSearcherService<
|
|||||||
|
|
||||||
private _documents: Record<string, Doc> = {}
|
private _documents: Record<string, Doc> = {}
|
||||||
|
|
||||||
// TODO: This pattern is no longer recommended in dioc > 3, move to something else
|
constructor(private opts: StaticSpotlightSearcherOptions<Doc>) {
|
||||||
constructor(
|
super()
|
||||||
c: Container,
|
|
||||||
private opts: StaticSpotlightSearcherOptions<Doc>
|
|
||||||
) {
|
|
||||||
super(c)
|
|
||||||
|
|
||||||
this.minisearch = new MiniSearch({
|
this.minisearch = new MiniSearch({
|
||||||
fields: opts.searchFields as string[],
|
fields: opts.searchFields as string[],
|
||||||
|
|||||||
@@ -50,7 +50,9 @@ export class CollectionsSpotlightSearcherService
|
|||||||
private readonly spotlight = this.bind(SpotlightService)
|
private readonly spotlight = this.bind(SpotlightService)
|
||||||
private readonly workspaceService = this.bind(WorkspaceService)
|
private readonly workspaceService = this.bind(WorkspaceService)
|
||||||
|
|
||||||
override onServiceInit() {
|
constructor() {
|
||||||
|
super()
|
||||||
|
|
||||||
this.spotlight.registerSearcher(this)
|
this.spotlight.registerSearcher(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import IconEdit from "~icons/lucide/edit"
|
|||||||
import IconLayers from "~icons/lucide/layers"
|
import IconLayers from "~icons/lucide/layers"
|
||||||
import IconTrash2 from "~icons/lucide/trash-2"
|
import IconTrash2 from "~icons/lucide/trash-2"
|
||||||
|
|
||||||
import { Container, Service } from "dioc"
|
import { Service } from "dioc"
|
||||||
import * as TE from "fp-ts/TaskEither"
|
import * as TE from "fp-ts/TaskEither"
|
||||||
import { pipe } from "fp-ts/function"
|
import { pipe } from "fp-ts/function"
|
||||||
import { cloneDeep } from "lodash-es"
|
import { cloneDeep } from "lodash-es"
|
||||||
@@ -164,18 +164,15 @@ export class EnvironmentsSpotlightSearcherService extends StaticSpotlightSearche
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO: This pattern is no longer recommended in dioc > 3, move to something else
|
constructor() {
|
||||||
constructor(c: Container) {
|
super({
|
||||||
super(c, {
|
|
||||||
searchFields: ["text", "alternates"],
|
searchFields: ["text", "alternates"],
|
||||||
fieldWeights: {
|
fieldWeights: {
|
||||||
text: 2,
|
text: 2,
|
||||||
alternates: 1,
|
alternates: 1,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
override onServiceInit() {
|
|
||||||
this.setDocuments(this.documents)
|
this.setDocuments(this.documents)
|
||||||
this.spotlight.registerSearcher(this)
|
this.spotlight.registerSearcher(this)
|
||||||
}
|
}
|
||||||
@@ -280,7 +277,9 @@ export class SwitchEnvSpotlightSearcherService
|
|||||||
private readonly workspaceService = this.bind(WorkspaceService)
|
private readonly workspaceService = this.bind(WorkspaceService)
|
||||||
private teamEnvironmentList: TeamEnvironment[] = []
|
private teamEnvironmentList: TeamEnvironment[] = []
|
||||||
|
|
||||||
override onServiceInit() {
|
constructor() {
|
||||||
|
super()
|
||||||
|
|
||||||
this.spotlight.registerSearcher(this)
|
this.spotlight.registerSearcher(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import IconBook from "~icons/lucide/book"
|
|||||||
import IconLifeBuoy from "~icons/lucide/life-buoy"
|
import IconLifeBuoy from "~icons/lucide/life-buoy"
|
||||||
import IconZap from "~icons/lucide/zap"
|
import IconZap from "~icons/lucide/zap"
|
||||||
import { platform } from "~/platform"
|
import { platform } from "~/platform"
|
||||||
import { Container } from "dioc"
|
|
||||||
|
|
||||||
type Doc = {
|
type Doc = {
|
||||||
text: string | string[]
|
text: string | string[]
|
||||||
@@ -90,18 +89,15 @@ export class GeneralSpotlightSearcherService extends StaticSpotlightSearcherServ
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO: This is not recommended as of dioc > 3. Move to onServiceInit instead
|
constructor() {
|
||||||
constructor(c: Container) {
|
super({
|
||||||
super(c, {
|
|
||||||
searchFields: ["text", "alternates"],
|
searchFields: ["text", "alternates"],
|
||||||
fieldWeights: {
|
fieldWeights: {
|
||||||
text: 2,
|
text: 2,
|
||||||
alternates: 1,
|
alternates: 1,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
override onServiceInit() {
|
|
||||||
this.setDocuments(this.documents)
|
this.setDocuments(this.documents)
|
||||||
this.spotlight.registerSearcher(this)
|
this.spotlight.registerSearcher(this)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,9 @@ export class HistorySpotlightSearcherService
|
|||||||
}
|
}
|
||||||
)[0]
|
)[0]
|
||||||
|
|
||||||
override onServiceInit() {
|
constructor() {
|
||||||
|
super()
|
||||||
|
|
||||||
this.spotlight.registerSearcher(this)
|
this.spotlight.registerSearcher(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,9 @@ export class InterceptorSpotlightSearcherService
|
|||||||
private readonly spotlight = this.bind(SpotlightService)
|
private readonly spotlight = this.bind(SpotlightService)
|
||||||
private interceptorService = this.bind(InterceptorService)
|
private interceptorService = this.bind(InterceptorService)
|
||||||
|
|
||||||
override onServiceInit() {
|
constructor() {
|
||||||
|
super()
|
||||||
|
|
||||||
this.spotlight.registerSearcher(this)
|
this.spotlight.registerSearcher(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import {
|
|||||||
} from "./base/static.searcher"
|
} from "./base/static.searcher"
|
||||||
|
|
||||||
import IconShare from "~icons/lucide/share"
|
import IconShare from "~icons/lucide/share"
|
||||||
import { Container } from "dioc"
|
|
||||||
|
|
||||||
type Doc = {
|
type Doc = {
|
||||||
text: string
|
text: string
|
||||||
@@ -40,18 +39,15 @@ export class MiscellaneousSpotlightSearcherService extends StaticSpotlightSearch
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO: Constructors are no longer recommended as of dioc > 3, move to onServiceInit
|
constructor() {
|
||||||
constructor(c: Container) {
|
super({
|
||||||
super(c, {
|
|
||||||
searchFields: ["text", "alternates"],
|
searchFields: ["text", "alternates"],
|
||||||
fieldWeights: {
|
fieldWeights: {
|
||||||
text: 2,
|
text: 2,
|
||||||
alternates: 1,
|
alternates: 1,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
override onServiceInit() {
|
|
||||||
this.setDocuments(this.documents)
|
this.setDocuments(this.documents)
|
||||||
this.spotlight.registerSearcher(this)
|
this.spotlight.registerSearcher(this)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import {
|
|||||||
} from "./base/static.searcher"
|
} from "./base/static.searcher"
|
||||||
|
|
||||||
import IconArrowRight from "~icons/lucide/arrow-right"
|
import IconArrowRight from "~icons/lucide/arrow-right"
|
||||||
import { Container } from "dioc"
|
|
||||||
|
|
||||||
type Doc = {
|
type Doc = {
|
||||||
text: string
|
text: string
|
||||||
@@ -62,18 +61,15 @@ export class NavigationSpotlightSearcherService extends StaticSpotlightSearcherS
|
|||||||
|
|
||||||
private docKeys = Object.keys(this.documents)
|
private docKeys = Object.keys(this.documents)
|
||||||
|
|
||||||
// TODO: Constructors are no longer recommended as of dioc > 3, use onServiceInit instead
|
constructor() {
|
||||||
constructor(c: Container) {
|
super({
|
||||||
super(c, {
|
|
||||||
searchFields: ["text", "alternates"],
|
searchFields: ["text", "alternates"],
|
||||||
fieldWeights: {
|
fieldWeights: {
|
||||||
text: 2,
|
text: 2,
|
||||||
alternates: 1,
|
alternates: 1,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
override onServiceInit() {
|
|
||||||
this.setDocuments(this.documents)
|
this.setDocuments(this.documents)
|
||||||
this.spotlight.registerSearcher(this)
|
this.spotlight.registerSearcher(this)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import IconRotateCCW from "~icons/lucide/rotate-ccw"
|
|||||||
import IconSave from "~icons/lucide/save"
|
import IconSave from "~icons/lucide/save"
|
||||||
import { GQLOptionTabs } from "~/components/graphql/RequestOptions.vue"
|
import { GQLOptionTabs } from "~/components/graphql/RequestOptions.vue"
|
||||||
import { RESTTabService } from "~/services/tab/rest"
|
import { RESTTabService } from "~/services/tab/rest"
|
||||||
import { Container } from "dioc"
|
|
||||||
|
|
||||||
type Doc = {
|
type Doc = {
|
||||||
text: string | string[]
|
text: string | string[]
|
||||||
@@ -225,18 +224,15 @@ export class RequestSpotlightSearcherService extends StaticSpotlightSearcherServ
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO: Constructors are no longer recommended as of dioc > 3, use onServiceInit instead
|
constructor() {
|
||||||
constructor(c: Container) {
|
super({
|
||||||
super(c, {
|
|
||||||
searchFields: ["text", "alternates"],
|
searchFields: ["text", "alternates"],
|
||||||
fieldWeights: {
|
fieldWeights: {
|
||||||
text: 2,
|
text: 2,
|
||||||
alternates: 1,
|
alternates: 1,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
override onServiceInit() {
|
|
||||||
this.setDocuments(this.documents)
|
this.setDocuments(this.documents)
|
||||||
this.spotlight.registerSearcher(this)
|
this.spotlight.registerSearcher(this)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import {
|
|||||||
|
|
||||||
import IconDownload from "~icons/lucide/download"
|
import IconDownload from "~icons/lucide/download"
|
||||||
import IconCopy from "~icons/lucide/copy"
|
import IconCopy from "~icons/lucide/copy"
|
||||||
import { Container } from "dioc"
|
|
||||||
|
|
||||||
type Doc = {
|
type Doc = {
|
||||||
text: string
|
text: string
|
||||||
@@ -57,18 +56,15 @@ export class ResponseSpotlightSearcherService extends StaticSpotlightSearcherSer
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO: Constructors are no longer recommended as of dioc > 3, move to onServiceInit
|
constructor() {
|
||||||
constructor(c: Container) {
|
super({
|
||||||
super(c, {
|
|
||||||
searchFields: ["text", "alternates"],
|
searchFields: ["text", "alternates"],
|
||||||
fieldWeights: {
|
fieldWeights: {
|
||||||
text: 2,
|
text: 2,
|
||||||
alternates: 1,
|
alternates: 1,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
override onServiceInit() {
|
|
||||||
this.setDocuments(this.documents)
|
this.setDocuments(this.documents)
|
||||||
this.spotlight.registerSearcher(this)
|
this.spotlight.registerSearcher(this)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import IconMonitor from "~icons/lucide/monitor"
|
|||||||
import IconMoon from "~icons/lucide/moon"
|
import IconMoon from "~icons/lucide/moon"
|
||||||
import IconSun from "~icons/lucide/sun"
|
import IconSun from "~icons/lucide/sun"
|
||||||
import IconCheckCircle from "~icons/lucide/check-circle"
|
import IconCheckCircle from "~icons/lucide/check-circle"
|
||||||
import { Container } from "dioc"
|
|
||||||
|
|
||||||
type Doc = {
|
type Doc = {
|
||||||
text: string | string[]
|
text: string | string[]
|
||||||
@@ -101,18 +100,15 @@ export class SettingsSpotlightSearcherService extends StaticSpotlightSearcherSer
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO: Constuctors are no longer recommended as of dioc > 3, move to onServiceInit
|
constructor() {
|
||||||
constructor(c: Container) {
|
super({
|
||||||
super(c, {
|
|
||||||
searchFields: ["text", "alternates"],
|
searchFields: ["text", "alternates"],
|
||||||
fieldWeights: {
|
fieldWeights: {
|
||||||
text: 2,
|
text: 2,
|
||||||
alternates: 1,
|
alternates: 1,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
override onServiceInit() {
|
|
||||||
this.setDocuments(this.documents)
|
this.setDocuments(this.documents)
|
||||||
this.spotlight.registerSearcher(this)
|
this.spotlight.registerSearcher(this)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import IconXSquare from "~icons/lucide/x-square"
|
|||||||
import { invokeAction } from "~/helpers/actions"
|
import { invokeAction } from "~/helpers/actions"
|
||||||
import { RESTTabService } from "~/services/tab/rest"
|
import { RESTTabService } from "~/services/tab/rest"
|
||||||
import { GQLTabService } from "~/services/tab/graphql"
|
import { GQLTabService } from "~/services/tab/graphql"
|
||||||
import { Container } from "dioc"
|
|
||||||
|
|
||||||
type Doc = {
|
type Doc = {
|
||||||
text: string | string[]
|
text: string | string[]
|
||||||
@@ -90,18 +89,15 @@ export class TabSpotlightSearcherService extends StaticSpotlightSearcherService<
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO: Constructors are no longer recommended as of dioc > 3, use onServiceInit instead
|
constructor() {
|
||||||
constructor(c: Container) {
|
super({
|
||||||
super(c, {
|
|
||||||
searchFields: ["text", "alternates"],
|
searchFields: ["text", "alternates"],
|
||||||
fieldWeights: {
|
fieldWeights: {
|
||||||
text: 2,
|
text: 2,
|
||||||
alternates: 1,
|
alternates: 1,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
override onServiceInit() {
|
|
||||||
this.setDocuments(this.documents)
|
this.setDocuments(this.documents)
|
||||||
this.spotlight.registerSearcher(this)
|
this.spotlight.registerSearcher(this)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,9 @@ export class TeamsSpotlightSearcherService
|
|||||||
|
|
||||||
private readonly tabs = this.bind(RESTTabService)
|
private readonly tabs = this.bind(RESTTabService)
|
||||||
|
|
||||||
override onServiceInit() {
|
constructor() {
|
||||||
|
super()
|
||||||
|
|
||||||
this.spotlight.registerSearcher(this)
|
this.spotlight.registerSearcher(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import { useStreamStatic } from "~/composables/stream"
|
|||||||
import IconLogin from "~icons/lucide/log-in"
|
import IconLogin from "~icons/lucide/log-in"
|
||||||
import IconLogOut from "~icons/lucide/log-out"
|
import IconLogOut from "~icons/lucide/log-out"
|
||||||
import { activeActions$, invokeAction } from "~/helpers/actions"
|
import { activeActions$, invokeAction } from "~/helpers/actions"
|
||||||
import { Container } from "dioc"
|
|
||||||
|
|
||||||
type Doc = {
|
type Doc = {
|
||||||
text: string
|
text: string
|
||||||
@@ -60,18 +59,15 @@ export class UserSpotlightSearcherService extends StaticSpotlightSearcherService
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO: Constructors are no longer recommended as of dioc > 3, move to onServiceInit
|
constructor() {
|
||||||
constructor(c: Container) {
|
super({
|
||||||
super(c, {
|
|
||||||
searchFields: ["text", "alternates"],
|
searchFields: ["text", "alternates"],
|
||||||
fieldWeights: {
|
fieldWeights: {
|
||||||
text: 2,
|
text: 2,
|
||||||
alternates: 1,
|
alternates: 1,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
override onServiceInit(): void {
|
|
||||||
this.setDocuments(this.documents)
|
this.setDocuments(this.documents)
|
||||||
this.spotlight.registerSearcher(this)
|
this.spotlight.registerSearcher(this)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import {
|
|||||||
StaticSpotlightSearcherService,
|
StaticSpotlightSearcherService,
|
||||||
} from "./base/static.searcher"
|
} from "./base/static.searcher"
|
||||||
|
|
||||||
import { Container, Service } from "dioc"
|
import { Service } from "dioc"
|
||||||
import * as E from "fp-ts/Either"
|
import * as E from "fp-ts/Either"
|
||||||
import MiniSearch from "minisearch"
|
import MiniSearch from "minisearch"
|
||||||
import IconCheckCircle from "~/components/app/spotlight/entry/IconSelected.vue"
|
import IconCheckCircle from "~/components/app/spotlight/entry/IconSelected.vue"
|
||||||
@@ -102,18 +102,15 @@ export class WorkspaceSpotlightSearcherService extends StaticSpotlightSearcherSe
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO: Constructors are no longer recommended as of dioc > 3, move to onServiceInit
|
constructor() {
|
||||||
constructor(c: Container) {
|
super({
|
||||||
super(c, {
|
|
||||||
searchFields: ["text", "alternates"],
|
searchFields: ["text", "alternates"],
|
||||||
fieldWeights: {
|
fieldWeights: {
|
||||||
text: 2,
|
text: 2,
|
||||||
alternates: 1,
|
alternates: 1,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
override onServiceInit() {
|
|
||||||
this.setDocuments(this.documents)
|
this.setDocuments(this.documents)
|
||||||
this.spotlight.registerSearcher(this)
|
this.spotlight.registerSearcher(this)
|
||||||
}
|
}
|
||||||
@@ -169,7 +166,9 @@ export class SwitchWorkspaceSpotlightSearcherService
|
|||||||
private readonly spotlight = this.bind(SpotlightService)
|
private readonly spotlight = this.bind(SpotlightService)
|
||||||
private readonly workspaceService = this.bind(WorkspaceService)
|
private readonly workspaceService = this.bind(WorkspaceService)
|
||||||
|
|
||||||
override onServiceInit() {
|
constructor() {
|
||||||
|
super()
|
||||||
|
|
||||||
this.spotlight.registerSearcher(this)
|
this.spotlight.registerSearcher(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ import { reactive } from "vue"
|
|||||||
class MockTabService extends TabService<{ request: string }> {
|
class MockTabService extends TabService<{ request: string }> {
|
||||||
public static readonly ID = "MOCK_TAB_SERVICE"
|
public static readonly ID = "MOCK_TAB_SERVICE"
|
||||||
|
|
||||||
override onServiceInit() {
|
constructor() {
|
||||||
|
super()
|
||||||
|
|
||||||
this.tabMap = reactive(
|
this.tabMap = reactive(
|
||||||
new Map([
|
new Map([
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -3,20 +3,20 @@ import { getDefaultGQLRequest } from "~/helpers/graphql/default"
|
|||||||
import { HoppGQLDocument, HoppGQLSaveContext } from "~/helpers/graphql/document"
|
import { HoppGQLDocument, HoppGQLSaveContext } from "~/helpers/graphql/document"
|
||||||
import { TabService } from "./tab"
|
import { TabService } from "./tab"
|
||||||
import { computed } from "vue"
|
import { computed } from "vue"
|
||||||
import { Container } from "dioc"
|
|
||||||
|
|
||||||
export class GQLTabService extends TabService<HoppGQLDocument> {
|
export class GQLTabService extends TabService<HoppGQLDocument> {
|
||||||
public static readonly ID = "GQL_TAB_SERVICE"
|
public static readonly ID = "GQL_TAB_SERVICE"
|
||||||
|
|
||||||
// TODO: Moving this to `onServiceInit` breaks `persistableTabState`
|
constructor() {
|
||||||
// Figure out how to fix this
|
super()
|
||||||
constructor(c: Container) {
|
|
||||||
super(c)
|
|
||||||
|
|
||||||
this.tabMap.set("test", {
|
this.tabMap.set("test", {
|
||||||
id: "test",
|
id: "test",
|
||||||
document: {
|
document: {
|
||||||
request: getDefaultGQLRequest(),
|
request: {
|
||||||
|
...getDefaultGQLRequest(),
|
||||||
|
url: "",
|
||||||
|
},
|
||||||
isDirty: false,
|
isDirty: false,
|
||||||
optionTabPreference: "query",
|
optionTabPreference: "query",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,20 +3,20 @@ import { computed } from "vue"
|
|||||||
import { getDefaultRESTRequest } from "~/helpers/rest/default"
|
import { getDefaultRESTRequest } from "~/helpers/rest/default"
|
||||||
import { HoppRESTDocument, HoppRESTSaveContext } from "~/helpers/rest/document"
|
import { HoppRESTDocument, HoppRESTSaveContext } from "~/helpers/rest/document"
|
||||||
import { TabService } from "./tab"
|
import { TabService } from "./tab"
|
||||||
import { Container } from "dioc"
|
|
||||||
|
|
||||||
export class RESTTabService extends TabService<HoppRESTDocument> {
|
export class RESTTabService extends TabService<HoppRESTDocument> {
|
||||||
public static readonly ID = "REST_TAB_SERVICE"
|
public static readonly ID = "REST_TAB_SERVICE"
|
||||||
|
|
||||||
// TODO: Moving this to `onServiceInit` breaks `persistableTabState`
|
constructor() {
|
||||||
// Figure out how to fix this
|
super()
|
||||||
constructor(c: Container) {
|
|
||||||
super(c)
|
|
||||||
|
|
||||||
this.tabMap.set("test", {
|
this.tabMap.set("test", {
|
||||||
id: "test",
|
id: "test",
|
||||||
document: {
|
document: {
|
||||||
request: getDefaultRESTRequest(),
|
request: {
|
||||||
|
...getDefaultRESTRequest(),
|
||||||
|
endpoint: "",
|
||||||
|
},
|
||||||
isDirty: false,
|
isDirty: false,
|
||||||
optionTabPreference: "params",
|
optionTabPreference: "params",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5,24 +5,13 @@ import { useStreamStatic } from "~/composables/stream"
|
|||||||
import TeamListAdapter from "~/helpers/teams/TeamListAdapter"
|
import TeamListAdapter from "~/helpers/teams/TeamListAdapter"
|
||||||
import { platform } from "~/platform"
|
import { platform } from "~/platform"
|
||||||
import { min } from "lodash-es"
|
import { min } from "lodash-es"
|
||||||
import { TeamMemberRole } from "~/helpers/backend/graphql"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines a workspace and its information
|
* Defines a workspace and its information
|
||||||
*/
|
*/
|
||||||
|
export type Workspace =
|
||||||
export type PersonalWorkspace = {
|
| { type: "personal" }
|
||||||
type: "personal"
|
| { type: "team"; teamID: string; teamName: string }
|
||||||
}
|
|
||||||
|
|
||||||
export type TeamWorkspace = {
|
|
||||||
type: "team"
|
|
||||||
teamID: string
|
|
||||||
teamName: string
|
|
||||||
role: TeamMemberRole | null | undefined
|
|
||||||
}
|
|
||||||
|
|
||||||
export type Workspace = PersonalWorkspace | TeamWorkspace
|
|
||||||
|
|
||||||
export type WorkspaceServiceEvent = {
|
export type WorkspaceServiceEvent = {
|
||||||
type: "managed-team-list-adapter-polled"
|
type: "managed-team-list-adapter-polled"
|
||||||
@@ -59,7 +48,8 @@ export class WorkspaceService extends Service<WorkspaceServiceEvent> {
|
|||||||
-1
|
-1
|
||||||
)
|
)
|
||||||
|
|
||||||
override onServiceInit() {
|
constructor() {
|
||||||
|
super()
|
||||||
// Dispose the managed team list adapter when the user logs out
|
// Dispose the managed team list adapter when the user logs out
|
||||||
// and initialize it when the user logs in
|
// and initialize it when the user logs in
|
||||||
watch(
|
watch(
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@hoppscotch/selfhost-desktop",
|
"name": "@hoppscotch/selfhost-desktop",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "2024.3.3",
|
"version": "2024.3.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev:vite": "vite",
|
"dev:vite": "vite",
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
"@vueuse/core": "10.5.0",
|
"@vueuse/core": "10.5.0",
|
||||||
"axios": "0.21.4",
|
"axios": "0.21.4",
|
||||||
"buffer": "6.0.3",
|
"buffer": "6.0.3",
|
||||||
"dioc": "3.0.1",
|
"dioc": "1.0.1",
|
||||||
"environments.api": "link:@platform/environments/environments.api",
|
"environments.api": "link:@platform/environments/environments.api",
|
||||||
"event": "link:@tauri-apps/api/event",
|
"event": "link:@tauri-apps/api/event",
|
||||||
"fp-ts": "2.16.1",
|
"fp-ts": "2.16.1",
|
||||||
@@ -78,4 +78,4 @@
|
|||||||
"vite-plugin-vue-layouts": "0.7.0",
|
"vite-plugin-vue-layouts": "0.7.0",
|
||||||
"vue-tsc": "1.8.8"
|
"vue-tsc": "1.8.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1260,7 +1260,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hoppscotch-desktop"
|
name = "hoppscotch-desktop"
|
||||||
version = "24.3.3"
|
version = "24.3.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cocoa 0.25.0",
|
"cocoa 0.25.0",
|
||||||
"hex_color",
|
"hex_color",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "hoppscotch-desktop"
|
name = "hoppscotch-desktop"
|
||||||
version = "24.3.3"
|
version = "24.3.0"
|
||||||
description = "A Tauri App"
|
description = "A Tauri App"
|
||||||
authors = ["you"]
|
authors = ["you"]
|
||||||
license = ""
|
license = ""
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
},
|
},
|
||||||
"package": {
|
"package": {
|
||||||
"productName": "Hoppscotch",
|
"productName": "Hoppscotch",
|
||||||
"version": "24.3.3"
|
"version": "24.3.1"
|
||||||
},
|
},
|
||||||
"tauri": {
|
"tauri": {
|
||||||
"allowlist": {
|
"allowlist": {
|
||||||
|
|||||||
@@ -138,6 +138,10 @@ export class NativeInterceptorService extends Service implements Interceptor {
|
|||||||
|
|
||||||
public cookieJarService = this.bind(CookieJarService)
|
public cookieJarService = this.bind(CookieJarService)
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super()
|
||||||
|
}
|
||||||
|
|
||||||
public runRequest(req: any) {
|
public runRequest(req: any) {
|
||||||
const processedReq = preProcessRequest(req)
|
const processedReq = preProcessRequest(req)
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@hoppscotch/selfhost-web",
|
"name": "@hoppscotch/selfhost-web",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "2024.3.3",
|
"version": "2024.3.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev:vite": "vite",
|
"dev:vite": "vite",
|
||||||
|
|||||||
@@ -52,8 +52,7 @@
|
|||||||
"title": "Server is restarting"
|
"title": "Server is restarting"
|
||||||
},
|
},
|
||||||
"save_changes": "Save Changes",
|
"save_changes": "Save Changes",
|
||||||
"title": "Configurations",
|
"title": "Configurations"
|
||||||
"update_failure": "Failed to update server configurations"
|
|
||||||
},
|
},
|
||||||
"data_sharing": {
|
"data_sharing": {
|
||||||
"description": "Share anonymous data usage to improve Hoppscotch",
|
"description": "Share anonymous data usage to improve Hoppscotch",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "hoppscotch-sh-admin",
|
"name": "hoppscotch-sh-admin",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "2024.3.3",
|
"version": "2024.3.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "pnpm exec npm-run-all -p -l dev:*",
|
"dev": "pnpm exec npm-run-all -p -l dev:*",
|
||||||
|
|||||||
@@ -69,18 +69,18 @@
|
|||||||
import { useVModel } from '@vueuse/core';
|
import { useVModel } from '@vueuse/core';
|
||||||
import { reactive } from 'vue';
|
import { reactive } from 'vue';
|
||||||
import { useI18n } from '~/composables/i18n';
|
import { useI18n } from '~/composables/i18n';
|
||||||
import { ServerConfigs, SsoAuthProviders } from '~/helpers/configs';
|
import { Config, SsoAuthProviders } from '~/composables/useConfigHandler';
|
||||||
import IconEye from '~icons/lucide/eye';
|
import IconEye from '~icons/lucide/eye';
|
||||||
import IconEyeOff from '~icons/lucide/eye-off';
|
import IconEyeOff from '~icons/lucide/eye-off';
|
||||||
|
|
||||||
const t = useI18n();
|
const t = useI18n();
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
config: ServerConfigs;
|
config: Config;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'update:config', v: ServerConfigs): void;
|
(e: 'update:config', v: Config): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const workingConfigs = useVModel(props, 'config', emit);
|
const workingConfigs = useVModel(props, 'config', emit);
|
||||||
@@ -93,7 +93,7 @@ const capitalize = (text: string) =>
|
|||||||
type ProviderFieldKeys = keyof ProviderFields;
|
type ProviderFieldKeys = keyof ProviderFields;
|
||||||
|
|
||||||
type ProviderFields = {
|
type ProviderFields = {
|
||||||
[Field in keyof ServerConfigs['providers'][SsoAuthProviders]['fields']]: boolean;
|
[Field in keyof Config['providers'][SsoAuthProviders]['fields']]: boolean;
|
||||||
} & Partial<{ tenant: boolean }>;
|
} & Partial<{ tenant: boolean }>;
|
||||||
|
|
||||||
type ProviderFieldMetadata = {
|
type ProviderFieldMetadata = {
|
||||||
|
|||||||
@@ -9,14 +9,14 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useVModel } from '@vueuse/core';
|
import { useVModel } from '@vueuse/core';
|
||||||
import { ServerConfigs } from '~/helpers/configs';
|
import { Config } from '~/composables/useConfigHandler';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
config: ServerConfigs;
|
config: Config;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'update:config', v: ServerConfigs): void;
|
(e: 'update:config', v: Config): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const workingConfigs = useVModel(props, 'config', emit);
|
const workingConfigs = useVModel(props, 'config', emit);
|
||||||
|
|||||||
@@ -38,17 +38,17 @@
|
|||||||
import { useVModel } from '@vueuse/core';
|
import { useVModel } from '@vueuse/core';
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { useI18n } from '~/composables/i18n';
|
import { useI18n } from '~/composables/i18n';
|
||||||
import { ServerConfigs } from '~/helpers/configs';
|
import { Config } from '~/composables/useConfigHandler';
|
||||||
import IconShieldQuestion from '~icons/lucide/shield-question';
|
import IconShieldQuestion from '~icons/lucide/shield-question';
|
||||||
|
|
||||||
const t = useI18n();
|
const t = useI18n();
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
config: ServerConfigs;
|
config: Config;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'update:config', v: ServerConfigs): void;
|
(e: 'update:config', v: Config): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const workingConfigs = useVModel(props, 'config', emit);
|
const workingConfigs = useVModel(props, 'config', emit);
|
||||||
|
|||||||
@@ -17,21 +17,20 @@ import { useMutation } from '@urql/vue';
|
|||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import { useI18n } from '~/composables/i18n';
|
import { useI18n } from '~/composables/i18n';
|
||||||
import { useToast } from '~/composables/toast';
|
import { useToast } from '~/composables/toast';
|
||||||
import { useConfigHandler } from '~/composables/useConfigHandler';
|
import { Config, useConfigHandler } from '~/composables/useConfigHandler';
|
||||||
import {
|
import {
|
||||||
EnableAndDisableSsoDocument,
|
EnableAndDisableSsoDocument,
|
||||||
ResetInfraConfigsDocument,
|
ResetInfraConfigsDocument,
|
||||||
ToggleAnalyticsCollectionDocument,
|
|
||||||
UpdateInfraConfigsDocument,
|
UpdateInfraConfigsDocument,
|
||||||
|
ToggleAnalyticsCollectionDocument,
|
||||||
} from '~/helpers/backend/graphql';
|
} from '~/helpers/backend/graphql';
|
||||||
import { ServerConfigs } from '~/helpers/configs';
|
|
||||||
|
|
||||||
const t = useI18n();
|
const t = useI18n();
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
workingConfigs?: ServerConfigs;
|
workingConfigs?: Config;
|
||||||
reset?: boolean;
|
reset?: boolean;
|
||||||
}>(),
|
}>(),
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -58,18 +58,18 @@
|
|||||||
import { useVModel } from '@vueuse/core';
|
import { useVModel } from '@vueuse/core';
|
||||||
import { computed, reactive } from 'vue';
|
import { computed, reactive } from 'vue';
|
||||||
import { useI18n } from '~/composables/i18n';
|
import { useI18n } from '~/composables/i18n';
|
||||||
import { ServerConfigs } from '~/helpers/configs';
|
import { Config } from '~/composables/useConfigHandler';
|
||||||
import IconEye from '~icons/lucide/eye';
|
import IconEye from '~icons/lucide/eye';
|
||||||
import IconEyeOff from '~icons/lucide/eye-off';
|
import IconEyeOff from '~icons/lucide/eye-off';
|
||||||
|
|
||||||
const t = useI18n();
|
const t = useI18n();
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
config: ServerConfigs;
|
config: Config;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'update:config', v: ServerConfigs): void;
|
(e: 'update:config', v: Config): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const workingConfigs = useVModel(props, 'config', emit);
|
const workingConfigs = useVModel(props, 'config', emit);
|
||||||
@@ -87,7 +87,7 @@ const smtpConfigs = computed({
|
|||||||
// Mask sensitive fields
|
// Mask sensitive fields
|
||||||
type Field = {
|
type Field = {
|
||||||
name: string;
|
name: string;
|
||||||
key: keyof ServerConfigs['mailConfigs']['fields'];
|
key: keyof Config['mailConfigs']['fields'];
|
||||||
};
|
};
|
||||||
|
|
||||||
const smtpConfigFields = reactive<Field[]>([
|
const smtpConfigFields = reactive<Field[]>([
|
||||||
@@ -100,10 +100,10 @@ const maskState = reactive<Record<string, boolean>>({
|
|||||||
mailer_from_address: true,
|
mailer_from_address: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
const toggleMask = (fieldKey: keyof ServerConfigs['mailConfigs']['fields']) => {
|
const toggleMask = (fieldKey: keyof Config['mailConfigs']['fields']) => {
|
||||||
maskState[fieldKey] = !maskState[fieldKey];
|
maskState[fieldKey] = !maskState[fieldKey];
|
||||||
};
|
};
|
||||||
|
|
||||||
const isMasked = (fieldKey: keyof ServerConfigs['mailConfigs']['fields']) =>
|
const isMasked = (fieldKey: keyof Config['mailConfigs']['fields']) =>
|
||||||
maskState[fieldKey];
|
maskState[fieldKey];
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,39 +1,83 @@
|
|||||||
import { AnyVariables, UseMutationResponse } from '@urql/vue';
|
import { AnyVariables, UseMutationResponse } from '@urql/vue';
|
||||||
import { cloneDeep } from 'lodash-es';
|
import { cloneDeep } from 'lodash-es';
|
||||||
import { onMounted, ref } from 'vue';
|
import { computed, onMounted, ref } from 'vue';
|
||||||
|
|
||||||
import { useI18n } from '~/composables/i18n';
|
import { useI18n } from '~/composables/i18n';
|
||||||
import {
|
import {
|
||||||
AllowedAuthProvidersDocument,
|
AllowedAuthProvidersDocument,
|
||||||
AuthProvider,
|
|
||||||
EnableAndDisableSsoArgs,
|
EnableAndDisableSsoArgs,
|
||||||
EnableAndDisableSsoMutation,
|
EnableAndDisableSsoMutation,
|
||||||
InfraConfigArgs,
|
InfraConfigArgs,
|
||||||
InfraConfigEnum,
|
InfraConfigEnum,
|
||||||
InfraConfigsDocument,
|
InfraConfigsDocument,
|
||||||
ResetInfraConfigsMutation,
|
ResetInfraConfigsMutation,
|
||||||
ServiceStatus,
|
|
||||||
ToggleAnalyticsCollectionMutation,
|
ToggleAnalyticsCollectionMutation,
|
||||||
UpdateInfraConfigsMutation,
|
UpdateInfraConfigsMutation,
|
||||||
} from '~/helpers/backend/graphql';
|
} from '~/helpers/backend/graphql';
|
||||||
import {
|
|
||||||
ALL_CONFIGS,
|
|
||||||
ConfigSection,
|
|
||||||
ConfigTransform,
|
|
||||||
GITHUB_CONFIGS,
|
|
||||||
GOOGLE_CONFIGS,
|
|
||||||
MAIL_CONFIGS,
|
|
||||||
MICROSOFT_CONFIGS,
|
|
||||||
ServerConfigs,
|
|
||||||
UpdatedConfigs,
|
|
||||||
} from '~/helpers/configs';
|
|
||||||
import { useToast } from './toast';
|
import { useToast } from './toast';
|
||||||
import { useClientHandler } from './useClientHandler';
|
import { useClientHandler } from './useClientHandler';
|
||||||
|
|
||||||
|
// Types
|
||||||
|
export type SsoAuthProviders = 'google' | 'microsoft' | 'github';
|
||||||
|
|
||||||
|
export type Config = {
|
||||||
|
providers: {
|
||||||
|
google: {
|
||||||
|
name: SsoAuthProviders;
|
||||||
|
enabled: boolean;
|
||||||
|
fields: {
|
||||||
|
client_id: string;
|
||||||
|
client_secret: string;
|
||||||
|
callback_url: string;
|
||||||
|
scope: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
github: {
|
||||||
|
name: SsoAuthProviders;
|
||||||
|
enabled: boolean;
|
||||||
|
fields: {
|
||||||
|
client_id: string;
|
||||||
|
client_secret: string;
|
||||||
|
callback_url: string;
|
||||||
|
scope: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
microsoft: {
|
||||||
|
name: SsoAuthProviders;
|
||||||
|
enabled: boolean;
|
||||||
|
fields: {
|
||||||
|
client_id: string;
|
||||||
|
client_secret: string;
|
||||||
|
callback_url: string;
|
||||||
|
scope: string;
|
||||||
|
tenant: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
mailConfigs: {
|
||||||
|
name: string;
|
||||||
|
enabled: boolean;
|
||||||
|
fields: {
|
||||||
|
mailer_smtp_url: string;
|
||||||
|
mailer_from_address: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
dataSharingConfigs: {
|
||||||
|
name: string;
|
||||||
|
enabled: boolean;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
type UpdatedConfigs = {
|
||||||
|
name: string;
|
||||||
|
value: string;
|
||||||
|
};
|
||||||
|
|
||||||
/** Composable that handles all operations related to server configurations
|
/** Composable that handles all operations related to server configurations
|
||||||
* @param updatedConfigs A Config Object contatining the updated configs
|
* @param updatedConfigs A Config Object contatining the updated configs
|
||||||
*/
|
*/
|
||||||
export function useConfigHandler(updatedConfigs?: ServerConfigs) {
|
export function useConfigHandler(updatedConfigs?: Config) {
|
||||||
const t = useI18n();
|
const t = useI18n();
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
|
|
||||||
@@ -46,9 +90,24 @@ export function useConfigHandler(updatedConfigs?: ServerConfigs) {
|
|||||||
} = useClientHandler(
|
} = useClientHandler(
|
||||||
InfraConfigsDocument,
|
InfraConfigsDocument,
|
||||||
{
|
{
|
||||||
configNames: ALL_CONFIGS.flat().map(
|
configNames: [
|
||||||
({ name }) => name
|
'GOOGLE_CLIENT_ID',
|
||||||
) as InfraConfigEnum[],
|
'GOOGLE_CLIENT_SECRET',
|
||||||
|
'GOOGLE_CALLBACK_URL',
|
||||||
|
'GOOGLE_SCOPE',
|
||||||
|
'MICROSOFT_CLIENT_ID',
|
||||||
|
'MICROSOFT_CLIENT_SECRET',
|
||||||
|
'MICROSOFT_CALLBACK_URL',
|
||||||
|
'MICROSOFT_SCOPE',
|
||||||
|
'MICROSOFT_TENANT',
|
||||||
|
'GITHUB_CLIENT_ID',
|
||||||
|
'GITHUB_CLIENT_SECRET',
|
||||||
|
'GITHUB_CALLBACK_URL',
|
||||||
|
'GITHUB_SCOPE',
|
||||||
|
'MAILER_SMTP_URL',
|
||||||
|
'MAILER_ADDRESS_FROM',
|
||||||
|
'ALLOW_ANALYTICS_COLLECTION',
|
||||||
|
] as InfraConfigEnum[],
|
||||||
},
|
},
|
||||||
(x) => x.infraConfigs
|
(x) => x.infraConfigs
|
||||||
);
|
);
|
||||||
@@ -66,14 +125,14 @@ export function useConfigHandler(updatedConfigs?: ServerConfigs) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Current and working configs
|
// Current and working configs
|
||||||
const currentConfigs = ref<ServerConfigs>();
|
const currentConfigs = ref<Config>();
|
||||||
const workingConfigs = ref<ServerConfigs>();
|
const workingConfigs = ref<Config>();
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await fetchInfraConfigs();
|
await fetchInfraConfigs();
|
||||||
await fetchAllowedAuthProviders();
|
await fetchAllowedAuthProviders();
|
||||||
|
|
||||||
const getFieldValue = (name: InfraConfigEnum) =>
|
const getFieldValue = (name: string) =>
|
||||||
infraConfigs.value.find((x) => x.name === name)?.value ?? '';
|
infraConfigs.value.find((x) => x.name === name)?.value ?? '';
|
||||||
|
|
||||||
// Transforming the fetched data into a Configs object
|
// Transforming the fetched data into a Configs object
|
||||||
@@ -81,42 +140,42 @@ export function useConfigHandler(updatedConfigs?: ServerConfigs) {
|
|||||||
providers: {
|
providers: {
|
||||||
google: {
|
google: {
|
||||||
name: 'google',
|
name: 'google',
|
||||||
enabled: allowedAuthProviders.value.includes(AuthProvider.Google),
|
enabled: allowedAuthProviders.value.includes('GOOGLE'),
|
||||||
fields: {
|
fields: {
|
||||||
client_id: getFieldValue(InfraConfigEnum.GoogleClientId),
|
client_id: getFieldValue('GOOGLE_CLIENT_ID'),
|
||||||
client_secret: getFieldValue(InfraConfigEnum.GoogleClientSecret),
|
client_secret: getFieldValue('GOOGLE_CLIENT_SECRET'),
|
||||||
callback_url: getFieldValue(InfraConfigEnum.GoogleCallbackUrl),
|
callback_url: getFieldValue('GOOGLE_CALLBACK_URL'),
|
||||||
scope: getFieldValue(InfraConfigEnum.GoogleScope),
|
scope: getFieldValue('GOOGLE_SCOPE'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
github: {
|
github: {
|
||||||
name: 'github',
|
name: 'github',
|
||||||
enabled: allowedAuthProviders.value.includes(AuthProvider.Github),
|
enabled: allowedAuthProviders.value.includes('GITHUB'),
|
||||||
fields: {
|
fields: {
|
||||||
client_id: getFieldValue(InfraConfigEnum.GithubClientId),
|
client_id: getFieldValue('GITHUB_CLIENT_ID'),
|
||||||
client_secret: getFieldValue(InfraConfigEnum.GithubClientSecret),
|
client_secret: getFieldValue('GITHUB_CLIENT_SECRET'),
|
||||||
callback_url: getFieldValue(InfraConfigEnum.GoogleCallbackUrl),
|
callback_url: getFieldValue('GITHUB_CALLBACK_URL'),
|
||||||
scope: getFieldValue(InfraConfigEnum.GithubScope),
|
scope: getFieldValue('GITHUB_SCOPE'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
microsoft: {
|
microsoft: {
|
||||||
name: 'microsoft',
|
name: 'microsoft',
|
||||||
enabled: allowedAuthProviders.value.includes(AuthProvider.Microsoft),
|
enabled: allowedAuthProviders.value.includes('MICROSOFT'),
|
||||||
fields: {
|
fields: {
|
||||||
client_id: getFieldValue(InfraConfigEnum.MicrosoftClientId),
|
client_id: getFieldValue('MICROSOFT_CLIENT_ID'),
|
||||||
client_secret: getFieldValue(InfraConfigEnum.MicrosoftClientSecret),
|
client_secret: getFieldValue('MICROSOFT_CLIENT_SECRET'),
|
||||||
callback_url: getFieldValue(InfraConfigEnum.MicrosoftCallbackUrl),
|
callback_url: getFieldValue('MICROSOFT_CALLBACK_URL'),
|
||||||
scope: getFieldValue(InfraConfigEnum.MicrosoftScope),
|
scope: getFieldValue('MICROSOFT_SCOPE'),
|
||||||
tenant: getFieldValue(InfraConfigEnum.MicrosoftTenant),
|
tenant: getFieldValue('MICROSOFT_TENANT'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mailConfigs: {
|
mailConfigs: {
|
||||||
name: 'email',
|
name: 'email',
|
||||||
enabled: allowedAuthProviders.value.includes(AuthProvider.Email),
|
enabled: allowedAuthProviders.value.includes('EMAIL'),
|
||||||
fields: {
|
fields: {
|
||||||
mailer_smtp_url: getFieldValue(InfraConfigEnum.MailerSmtpUrl),
|
mailer_smtp_url: getFieldValue('MAILER_SMTP_URL'),
|
||||||
mailer_from_address: getFieldValue(InfraConfigEnum.MailerAddressFrom),
|
mailer_from_address: getFieldValue('MAILER_ADDRESS_FROM'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
dataSharingConfigs: {
|
dataSharingConfigs: {
|
||||||
@@ -132,13 +191,138 @@ export function useConfigHandler(updatedConfigs?: ServerConfigs) {
|
|||||||
workingConfigs.value = cloneDeep(currentConfigs.value);
|
workingConfigs.value = cloneDeep(currentConfigs.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
// Transforming the working configs back into the format required by the mutations
|
||||||
Check if any of the config fields are empty
|
const updatedInfraConfigs = computed(() => {
|
||||||
*/
|
let config: UpdatedConfigs[] = [
|
||||||
|
{
|
||||||
|
name: '',
|
||||||
|
value: '',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
if (updatedConfigs?.providers.google.enabled) {
|
||||||
|
config.push(
|
||||||
|
{
|
||||||
|
name: 'GOOGLE_CLIENT_ID',
|
||||||
|
value: updatedConfigs?.providers.google.fields.client_id ?? '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'GOOGLE_CLIENT_SECRET',
|
||||||
|
value: updatedConfigs?.providers.google.fields.client_secret ?? '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'GOOGLE_CALLBACK_URL',
|
||||||
|
value: updatedConfigs?.providers.google.fields.callback_url ?? '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'GOOGLE_SCOPE',
|
||||||
|
value: updatedConfigs?.providers.google.fields.scope ?? '',
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
config = config.filter(
|
||||||
|
(item) =>
|
||||||
|
item.name !== 'GOOGLE_CLIENT_ID' &&
|
||||||
|
item.name !== 'GOOGLE_CLIENT_SECRET' &&
|
||||||
|
item.name !== 'GOOGLE_CALLBACK_URL' &&
|
||||||
|
item.name !== 'GOOGLE_SCOPE'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (updatedConfigs?.providers.microsoft.enabled) {
|
||||||
|
config.push(
|
||||||
|
{
|
||||||
|
name: 'MICROSOFT_CLIENT_ID',
|
||||||
|
value: updatedConfigs?.providers.microsoft.fields.client_id ?? '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'MICROSOFT_CLIENT_SECRET',
|
||||||
|
value: updatedConfigs?.providers.microsoft.fields.client_secret ?? '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'MICROSOFT_CALLBACK_URL',
|
||||||
|
value: updatedConfigs?.providers.microsoft.fields.callback_url ?? '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'MICROSOFT_SCOPE',
|
||||||
|
value: updatedConfigs?.providers.microsoft.fields.scope ?? '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'MICROSOFT_TENANT',
|
||||||
|
value: updatedConfigs?.providers.microsoft.fields.tenant ?? '',
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
config = config.filter(
|
||||||
|
(item) =>
|
||||||
|
item.name !== 'MICROSOFT_CLIENT_ID' &&
|
||||||
|
item.name !== 'MICROSOFT_CLIENT_SECRET' &&
|
||||||
|
item.name !== 'MICROSOFT_CALLBACK_URL' &&
|
||||||
|
item.name !== 'MICROSOFT_SCOPE' &&
|
||||||
|
item.name !== 'MICROSOFT_TENANT'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (updatedConfigs?.providers.github.enabled) {
|
||||||
|
config.push(
|
||||||
|
{
|
||||||
|
name: 'GITHUB_CLIENT_ID',
|
||||||
|
value: updatedConfigs?.providers.github.fields.client_id ?? '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'GITHUB_CLIENT_SECRET',
|
||||||
|
value: updatedConfigs?.providers.github.fields.client_secret ?? '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'GITHUB_CALLBACK_URL',
|
||||||
|
value: updatedConfigs?.providers.github.fields.callback_url ?? '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'GITHUB_SCOPE',
|
||||||
|
value: updatedConfigs?.providers.github.fields.scope ?? '',
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
config = config.filter(
|
||||||
|
(item) =>
|
||||||
|
item.name !== 'GITHUB_CLIENT_ID' &&
|
||||||
|
item.name !== 'GITHUB_CLIENT_SECRET' &&
|
||||||
|
item.name !== 'GITHUB_CALLBACK_URL' &&
|
||||||
|
item.name !== 'GITHUB_SCOPE'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (updatedConfigs?.mailConfigs.enabled) {
|
||||||
|
config.push(
|
||||||
|
{
|
||||||
|
name: 'MAILER_SMTP_URL',
|
||||||
|
value: updatedConfigs?.mailConfigs.fields.mailer_smtp_url ?? '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'MAILER_ADDRESS_FROM',
|
||||||
|
value: updatedConfigs?.mailConfigs.fields.mailer_from_address ?? '',
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
config = config.filter(
|
||||||
|
(item) =>
|
||||||
|
item.name !== 'MAILER_SMTP_URL' && item.name !== 'MAILER_ADDRESS_FROM'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
config = config.filter((item) => item.name !== '');
|
||||||
|
|
||||||
|
return config;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Checking if any of the config fields are empty
|
||||||
const isFieldEmpty = (field: string) => field.trim() === '';
|
const isFieldEmpty = (field: string) => field.trim() === '';
|
||||||
|
|
||||||
const AreAnyConfigFieldsEmpty = (config: ServerConfigs): boolean => {
|
type ConfigSection = {
|
||||||
|
enabled: boolean;
|
||||||
|
fields: Record<string, string>;
|
||||||
|
};
|
||||||
|
|
||||||
|
const AreAnyConfigFieldsEmpty = (config: Config): boolean => {
|
||||||
const sections: Array<ConfigSection> = [
|
const sections: Array<ConfigSection> = [
|
||||||
config.providers.github,
|
config.providers.github,
|
||||||
config.providers.google,
|
config.providers.google,
|
||||||
@@ -153,44 +337,28 @@ export function useConfigHandler(updatedConfigs?: ServerConfigs) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Transforming the working configs back into the format required by the mutations
|
// Transforming the working configs back into the format required by the mutations
|
||||||
const transformInfraConfigs = () => {
|
const updatedAllowedAuthProviders = computed(() => {
|
||||||
const updatedWorkingConfigs: ConfigTransform[] = [
|
return [
|
||||||
{
|
{
|
||||||
config: GOOGLE_CONFIGS,
|
provider: 'GOOGLE',
|
||||||
enabled: updatedConfigs?.providers.google.enabled,
|
status: updatedConfigs?.providers.google.enabled ? 'ENABLE' : 'DISABLE',
|
||||||
fields: updatedConfigs?.providers.google.fields,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
config: GITHUB_CONFIGS,
|
provider: 'MICROSOFT',
|
||||||
enabled: updatedConfigs?.providers.github.enabled,
|
status: updatedConfigs?.providers.microsoft.enabled
|
||||||
fields: updatedConfigs?.providers.github.fields,
|
? 'ENABLE'
|
||||||
|
: 'DISABLE',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
config: MICROSOFT_CONFIGS,
|
provider: 'GITHUB',
|
||||||
enabled: updatedConfigs?.providers.microsoft.enabled,
|
status: updatedConfigs?.providers.github.enabled ? 'ENABLE' : 'DISABLE',
|
||||||
fields: updatedConfigs?.providers.microsoft.fields,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
config: MAIL_CONFIGS,
|
provider: 'EMAIL',
|
||||||
enabled: updatedConfigs?.mailConfigs.enabled,
|
status: updatedConfigs?.mailConfigs.enabled ? 'ENABLE' : 'DISABLE',
|
||||||
fields: updatedConfigs?.mailConfigs.fields,
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
});
|
||||||
const transformedConfigs: UpdatedConfigs[] = [];
|
|
||||||
|
|
||||||
updatedWorkingConfigs.forEach(({ config, enabled, fields }) => {
|
|
||||||
config.forEach(({ name, key }) => {
|
|
||||||
if (enabled && fields) {
|
|
||||||
const value =
|
|
||||||
typeof fields === 'string' ? fields : String(fields[key]);
|
|
||||||
transformedConfigs.push({ name, value });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
return transformedConfigs;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Generic function to handle mutation execution and error handling
|
// Generic function to handle mutation execution and error handling
|
||||||
const executeMutation = async <T, V>(
|
const executeMutation = async <T, V>(
|
||||||
@@ -211,59 +379,27 @@ export function useConfigHandler(updatedConfigs?: ServerConfigs) {
|
|||||||
// Updating the auth provider configurations
|
// Updating the auth provider configurations
|
||||||
const updateAuthProvider = (
|
const updateAuthProvider = (
|
||||||
updateProviderStatus: UseMutationResponse<EnableAndDisableSsoMutation>
|
updateProviderStatus: UseMutationResponse<EnableAndDisableSsoMutation>
|
||||||
) => {
|
) =>
|
||||||
const updatedAllowedAuthProviders: EnableAndDisableSsoArgs[] = [
|
executeMutation(
|
||||||
{
|
|
||||||
provider: AuthProvider.Google,
|
|
||||||
status: updatedConfigs?.providers.google.enabled
|
|
||||||
? ServiceStatus.Enable
|
|
||||||
: ServiceStatus.Disable,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
provider: AuthProvider.Microsoft,
|
|
||||||
status: updatedConfigs?.providers.microsoft.enabled
|
|
||||||
? ServiceStatus.Enable
|
|
||||||
: ServiceStatus.Disable,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
provider: AuthProvider.Github,
|
|
||||||
status: updatedConfigs?.providers.github.enabled
|
|
||||||
? ServiceStatus.Enable
|
|
||||||
: ServiceStatus.Disable,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
provider: AuthProvider.Email,
|
|
||||||
status: updatedConfigs?.mailConfigs.enabled
|
|
||||||
? ServiceStatus.Enable
|
|
||||||
: ServiceStatus.Disable,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
return executeMutation(
|
|
||||||
updateProviderStatus,
|
updateProviderStatus,
|
||||||
{
|
{
|
||||||
providerInfo: updatedAllowedAuthProviders,
|
providerInfo:
|
||||||
|
updatedAllowedAuthProviders.value as EnableAndDisableSsoArgs[],
|
||||||
},
|
},
|
||||||
'configs.auth_providers.update_failure'
|
'configs.auth_providers.update_failure'
|
||||||
);
|
);
|
||||||
};
|
|
||||||
|
|
||||||
// Updating the infra configurations
|
// Updating the infra configurations
|
||||||
const updateInfraConfigs = (
|
const updateInfraConfigs = (
|
||||||
updateInfraConfigsMutation: UseMutationResponse<UpdateInfraConfigsMutation>
|
updateInfraConfigsMutation: UseMutationResponse<UpdateInfraConfigsMutation>
|
||||||
) => {
|
) =>
|
||||||
const infraConfigs: InfraConfigArgs[] = updatedConfigs
|
executeMutation(
|
||||||
? transformInfraConfigs()
|
|
||||||
: [];
|
|
||||||
|
|
||||||
return executeMutation(
|
|
||||||
updateInfraConfigsMutation,
|
updateInfraConfigsMutation,
|
||||||
{
|
{
|
||||||
infraConfigs,
|
infraConfigs: updatedInfraConfigs.value as InfraConfigArgs[],
|
||||||
},
|
},
|
||||||
'configs.update_failure'
|
'configs.mail_configs.update_failure'
|
||||||
);
|
);
|
||||||
};
|
|
||||||
|
|
||||||
// Resetting the infra configurations
|
// Resetting the infra configurations
|
||||||
const resetInfraConfigs = (
|
const resetInfraConfigs = (
|
||||||
@@ -275,6 +411,7 @@ export function useConfigHandler(updatedConfigs?: ServerConfigs) {
|
|||||||
'configs.reset.failure'
|
'configs.reset.failure'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Updating the data sharing configurations
|
||||||
const updateDataSharingConfigs = (
|
const updateDataSharingConfigs = (
|
||||||
toggleDataSharingMutation: UseMutationResponse<ToggleAnalyticsCollectionMutation>
|
toggleDataSharingMutation: UseMutationResponse<ToggleAnalyticsCollectionMutation>
|
||||||
) =>
|
) =>
|
||||||
@@ -282,8 +419,8 @@ export function useConfigHandler(updatedConfigs?: ServerConfigs) {
|
|||||||
toggleDataSharingMutation,
|
toggleDataSharingMutation,
|
||||||
{
|
{
|
||||||
status: updatedConfigs?.dataSharingConfigs.enabled
|
status: updatedConfigs?.dataSharingConfigs.enabled
|
||||||
? ServiceStatus.Enable
|
? 'ENABLE'
|
||||||
: ServiceStatus.Disable,
|
: 'DISABLE',
|
||||||
},
|
},
|
||||||
'configs.data_sharing.update_failure'
|
'configs.data_sharing.update_failure'
|
||||||
);
|
);
|
||||||
@@ -291,6 +428,8 @@ export function useConfigHandler(updatedConfigs?: ServerConfigs) {
|
|||||||
return {
|
return {
|
||||||
currentConfigs,
|
currentConfigs,
|
||||||
workingConfigs,
|
workingConfigs,
|
||||||
|
updatedInfraConfigs,
|
||||||
|
updatedAllowedAuthProviders,
|
||||||
updateAuthProvider,
|
updateAuthProvider,
|
||||||
updateDataSharingConfigs,
|
updateDataSharingConfigs,
|
||||||
updateInfraConfigs,
|
updateInfraConfigs,
|
||||||
|
|||||||
@@ -1,160 +0,0 @@
|
|||||||
import { InfraConfigEnum } from './backend/graphql';
|
|
||||||
|
|
||||||
export type SsoAuthProviders = 'google' | 'microsoft' | 'github';
|
|
||||||
|
|
||||||
export type ServerConfigs = {
|
|
||||||
providers: {
|
|
||||||
google: {
|
|
||||||
name: SsoAuthProviders;
|
|
||||||
enabled: boolean;
|
|
||||||
fields: {
|
|
||||||
client_id: string;
|
|
||||||
client_secret: string;
|
|
||||||
callback_url: string;
|
|
||||||
scope: string;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
github: {
|
|
||||||
name: SsoAuthProviders;
|
|
||||||
enabled: boolean;
|
|
||||||
fields: {
|
|
||||||
client_id: string;
|
|
||||||
client_secret: string;
|
|
||||||
callback_url: string;
|
|
||||||
scope: string;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
microsoft: {
|
|
||||||
name: SsoAuthProviders;
|
|
||||||
enabled: boolean;
|
|
||||||
fields: {
|
|
||||||
client_id: string;
|
|
||||||
client_secret: string;
|
|
||||||
callback_url: string;
|
|
||||||
scope: string;
|
|
||||||
tenant: string;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
mailConfigs: {
|
|
||||||
name: string;
|
|
||||||
enabled: boolean;
|
|
||||||
fields: {
|
|
||||||
mailer_smtp_url: string;
|
|
||||||
mailer_from_address: string;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
dataSharingConfigs: {
|
|
||||||
name: string;
|
|
||||||
enabled: boolean;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export type UpdatedConfigs = {
|
|
||||||
name: InfraConfigEnum;
|
|
||||||
value: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type ConfigTransform = {
|
|
||||||
config: Config[];
|
|
||||||
enabled?: boolean;
|
|
||||||
fields?: Record<string, string | boolean> | string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type ConfigSection = {
|
|
||||||
enabled: boolean;
|
|
||||||
fields: Record<string, string>;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type Config = {
|
|
||||||
name: InfraConfigEnum;
|
|
||||||
key: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const GOOGLE_CONFIGS: Config[] = [
|
|
||||||
{
|
|
||||||
name: InfraConfigEnum.GoogleClientId,
|
|
||||||
key: 'client_id',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: InfraConfigEnum.GoogleClientSecret,
|
|
||||||
key: 'client_secret',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: InfraConfigEnum.GoogleCallbackUrl,
|
|
||||||
key: 'callback_url',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: InfraConfigEnum.GoogleScope,
|
|
||||||
key: 'scope',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
export const MICROSOFT_CONFIGS: Config[] = [
|
|
||||||
{
|
|
||||||
name: InfraConfigEnum.MicrosoftClientId,
|
|
||||||
key: 'client_id',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: InfraConfigEnum.MicrosoftClientSecret,
|
|
||||||
key: 'client_secret',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: InfraConfigEnum.MicrosoftCallbackUrl,
|
|
||||||
key: 'callback_url',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: InfraConfigEnum.MicrosoftScope,
|
|
||||||
key: 'scope',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: InfraConfigEnum.MicrosoftTenant,
|
|
||||||
key: 'tenant',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
export const GITHUB_CONFIGS: Config[] = [
|
|
||||||
{
|
|
||||||
name: InfraConfigEnum.GithubClientId,
|
|
||||||
key: 'client_id',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: InfraConfigEnum.GithubClientSecret,
|
|
||||||
key: 'client_secret',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: InfraConfigEnum.GithubCallbackUrl,
|
|
||||||
key: 'callback_url',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: InfraConfigEnum.GithubScope,
|
|
||||||
key: 'scope',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
export const MAIL_CONFIGS: Config[] = [
|
|
||||||
{
|
|
||||||
name: InfraConfigEnum.MailerSmtpUrl,
|
|
||||||
key: 'mailer_smtp_url',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: InfraConfigEnum.MailerAddressFrom,
|
|
||||||
key: 'mailer_from_address',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
const DATA_SHARING_CONFIGS: Omit<Config, 'key'>[] = [
|
|
||||||
{
|
|
||||||
name: InfraConfigEnum.AllowAnalyticsCollection,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
export const ALL_CONFIGS = [
|
|
||||||
GOOGLE_CONFIGS,
|
|
||||||
MICROSOFT_CONFIGS,
|
|
||||||
GITHUB_CONFIGS,
|
|
||||||
MAIL_CONFIGS,
|
|
||||||
DATA_SHARING_CONFIGS,
|
|
||||||
];
|
|
||||||
@@ -208,14 +208,13 @@ const deleteUserMutation = async (id: string | null) => {
|
|||||||
if (result.error) {
|
if (result.error) {
|
||||||
toast.error(t('state.delete_user_failure'));
|
toast.error(t('state.delete_user_failure'));
|
||||||
} else {
|
} else {
|
||||||
const deletedUser = result.data?.removeUsersByAdmin || [];
|
const deletedUsers = result.data?.removeUsersByAdmin || [];
|
||||||
handleUserDeletion(deletedUser);
|
|
||||||
|
|
||||||
const { isDeleted } = deletedUser[0];
|
handleUserDeletion(deletedUsers);
|
||||||
if (isDeleted) router.push('/users');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
confirmDeletion.value = false;
|
confirmDeletion.value = false;
|
||||||
deleteUserUID.value = null;
|
deleteUserUID.value = null;
|
||||||
|
|
||||||
|
!result.error && router.push('/users');
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user