feat: linting
This commit is contained in:
parent
d8de02f789
commit
267d293927
@ -2,3 +2,13 @@
|
|||||||
package-lock.json
|
package-lock.json
|
||||||
pnpm-lock.yaml
|
pnpm-lock.yaml
|
||||||
yarn.lock
|
yarn.lock
|
||||||
|
|
||||||
|
# Build output
|
||||||
|
.svelte-kit
|
||||||
|
node_modules
|
||||||
|
|
||||||
|
# Static
|
||||||
|
static
|
||||||
|
|
||||||
|
# Generated
|
||||||
|
src/lib/services
|
@ -3,10 +3,7 @@
|
|||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
"trailingComma": "none",
|
"trailingComma": "none",
|
||||||
"printWidth": 100,
|
"printWidth": 100,
|
||||||
"plugins": [
|
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
|
||||||
"prettier-plugin-svelte",
|
|
||||||
"prettier-plugin-tailwindcss"
|
|
||||||
],
|
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": "*.svelte",
|
"files": "*.svelte",
|
||||||
|
@ -6,7 +6,7 @@ import globals from 'globals';
|
|||||||
import { fileURLToPath } from 'node:url';
|
import { fileURLToPath } from 'node:url';
|
||||||
import ts from 'typescript-eslint';
|
import ts from 'typescript-eslint';
|
||||||
import svelteConfig from './svelte.config.js';
|
import svelteConfig from './svelte.config.js';
|
||||||
const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url));
|
const gitignorePath = fileURLToPath(new URL('./.prettierignore', import.meta.url));
|
||||||
|
|
||||||
export default ts.config(
|
export default ts.config(
|
||||||
includeIgnoreFile(gitignorePath),
|
includeIgnoreFile(gitignorePath),
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
@import "tailwindcss";
|
@import 'tailwindcss';
|
||||||
@import "tw-animate-css";
|
@import 'tw-animate-css';
|
||||||
|
|
||||||
@theme {
|
@theme {
|
||||||
--color-crust: #11111b;
|
--color-crust: #11111b;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<title>TrevStack</title>
|
<title>TrevStack</title>
|
||||||
%sveltekit.head%
|
%sveltekit.head%
|
||||||
</head>
|
</head>
|
||||||
<body data-sveltekit-preload-data="tap" class="min-h-screen bg-base text-text">
|
<body data-sveltekit-preload-data="tap" class="bg-base text-text min-h-screen">
|
||||||
<div style="display: contents">%sveltekit.body%</div>
|
<div style="display: contents">%sveltekit.body%</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -2,22 +2,26 @@
|
|||||||
// @generated from file item/v1/item.proto (package item.v1, syntax proto3)
|
// @generated from file item/v1/item.proto (package item.v1, syntax proto3)
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
|
|
||||||
import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv1";
|
import type { GenFile, GenMessage, GenService } from '@bufbuild/protobuf/codegenv1';
|
||||||
import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1";
|
import { fileDesc, messageDesc, serviceDesc } from '@bufbuild/protobuf/codegenv1';
|
||||||
import type { Timestamp } from "@bufbuild/protobuf/wkt";
|
import type { Timestamp } from '@bufbuild/protobuf/wkt';
|
||||||
import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt";
|
import { file_google_protobuf_timestamp } from '@bufbuild/protobuf/wkt';
|
||||||
import type { Message } from "@bufbuild/protobuf";
|
import type { Message } from '@bufbuild/protobuf';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes the file item/v1/item.proto.
|
* Describes the file item/v1/item.proto.
|
||||||
*/
|
*/
|
||||||
export const file_item_v1_item: GenFile = /*@__PURE__*/
|
export const file_item_v1_item: GenFile =
|
||||||
fileDesc("ChJpdGVtL3YxL2l0ZW0ucHJvdG8SB2l0ZW0udjEinAEKBEl0ZW0SDwoCaWQYASABKA1IAIgBARIMCgRuYW1lGAIgASgJEhMKC2Rlc2NyaXB0aW9uGAMgASgJEg0KBXByaWNlGAQgASgCEhAKCHF1YW50aXR5GAUgASgNEi4KBWFkZG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W0SGi5pdGVtLnYxLkRlbGV0ZUl0ZW1SZXF1ZXN0GhsuaXRlbS52MS5EZWxldGVJdGVtUmVzcG9uc2UiAEKdAQoLY29tLml0ZW0udjFCCUl0ZW1Qcm90b1ABWkZnaXRodWIuY29tL3Nwb3RkZW1vNC90cmV2c3RhY2svc2VydmVyL2ludGVybmFsL3NlcnZpY2VzL2l0ZW0vdjE7aXRlbXYxogIDSVhYqgIHSXRlbS5WMcoCB0l0ZW1cVjHiAhNJdGVtXFYxXEdQQk1ldGFkYXRh6gIISXRlbTo6VjFiBnByb3RvMw',
|
||||||
|
[file_google_protobuf_timestamp]
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated from message item.v1.Item
|
* @generated from message item.v1.Item
|
||||||
*/
|
*/
|
||||||
export type Item = Message<"item.v1.Item"> & {
|
export type Item = Message<'item.v1.Item'> & {
|
||||||
/**
|
/**
|
||||||
* @generated from field: optional uint32 id = 1;
|
* @generated from field: optional uint32 id = 1;
|
||||||
*/
|
*/
|
||||||
@ -53,13 +57,12 @@ export type Item = Message<"item.v1.Item"> & {
|
|||||||
* Describes the message item.v1.Item.
|
* Describes the message item.v1.Item.
|
||||||
* Use `create(ItemSchema)` to create a new message.
|
* Use `create(ItemSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export const ItemSchema: GenMessage<Item> = /*@__PURE__*/
|
export const ItemSchema: GenMessage<Item> = /*@__PURE__*/ messageDesc(file_item_v1_item, 0);
|
||||||
messageDesc(file_item_v1_item, 0);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated from message item.v1.GetItemRequest
|
* @generated from message item.v1.GetItemRequest
|
||||||
*/
|
*/
|
||||||
export type GetItemRequest = Message<"item.v1.GetItemRequest"> & {
|
export type GetItemRequest = Message<'item.v1.GetItemRequest'> & {
|
||||||
/**
|
/**
|
||||||
* @generated from field: uint32 id = 1;
|
* @generated from field: uint32 id = 1;
|
||||||
*/
|
*/
|
||||||
@ -70,13 +73,14 @@ export type GetItemRequest = Message<"item.v1.GetItemRequest"> & {
|
|||||||
* Describes the message item.v1.GetItemRequest.
|
* Describes the message item.v1.GetItemRequest.
|
||||||
* Use `create(GetItemRequestSchema)` to create a new message.
|
* Use `create(GetItemRequestSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export const GetItemRequestSchema: GenMessage<GetItemRequest> = /*@__PURE__*/
|
export const GetItemRequestSchema: GenMessage<GetItemRequest> =
|
||||||
|
/*@__PURE__*/
|
||||||
messageDesc(file_item_v1_item, 1);
|
messageDesc(file_item_v1_item, 1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated from message item.v1.GetItemResponse
|
* @generated from message item.v1.GetItemResponse
|
||||||
*/
|
*/
|
||||||
export type GetItemResponse = Message<"item.v1.GetItemResponse"> & {
|
export type GetItemResponse = Message<'item.v1.GetItemResponse'> & {
|
||||||
/**
|
/**
|
||||||
* @generated from field: item.v1.Item item = 1;
|
* @generated from field: item.v1.Item item = 1;
|
||||||
*/
|
*/
|
||||||
@ -87,13 +91,14 @@ export type GetItemResponse = Message<"item.v1.GetItemResponse"> & {
|
|||||||
* Describes the message item.v1.GetItemResponse.
|
* Describes the message item.v1.GetItemResponse.
|
||||||
* Use `create(GetItemResponseSchema)` to create a new message.
|
* Use `create(GetItemResponseSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export const GetItemResponseSchema: GenMessage<GetItemResponse> = /*@__PURE__*/
|
export const GetItemResponseSchema: GenMessage<GetItemResponse> =
|
||||||
|
/*@__PURE__*/
|
||||||
messageDesc(file_item_v1_item, 2);
|
messageDesc(file_item_v1_item, 2);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated from message item.v1.GetItemsRequest
|
* @generated from message item.v1.GetItemsRequest
|
||||||
*/
|
*/
|
||||||
export type GetItemsRequest = Message<"item.v1.GetItemsRequest"> & {
|
export type GetItemsRequest = Message<'item.v1.GetItemsRequest'> & {
|
||||||
/**
|
/**
|
||||||
* @generated from field: optional google.protobuf.Timestamp start = 1;
|
* @generated from field: optional google.protobuf.Timestamp start = 1;
|
||||||
*/
|
*/
|
||||||
@ -124,13 +129,14 @@ export type GetItemsRequest = Message<"item.v1.GetItemsRequest"> & {
|
|||||||
* Describes the message item.v1.GetItemsRequest.
|
* Describes the message item.v1.GetItemsRequest.
|
||||||
* Use `create(GetItemsRequestSchema)` to create a new message.
|
* Use `create(GetItemsRequestSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export const GetItemsRequestSchema: GenMessage<GetItemsRequest> = /*@__PURE__*/
|
export const GetItemsRequestSchema: GenMessage<GetItemsRequest> =
|
||||||
|
/*@__PURE__*/
|
||||||
messageDesc(file_item_v1_item, 3);
|
messageDesc(file_item_v1_item, 3);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated from message item.v1.GetItemsResponse
|
* @generated from message item.v1.GetItemsResponse
|
||||||
*/
|
*/
|
||||||
export type GetItemsResponse = Message<"item.v1.GetItemsResponse"> & {
|
export type GetItemsResponse = Message<'item.v1.GetItemsResponse'> & {
|
||||||
/**
|
/**
|
||||||
* @generated from field: repeated item.v1.Item items = 1;
|
* @generated from field: repeated item.v1.Item items = 1;
|
||||||
*/
|
*/
|
||||||
@ -146,13 +152,14 @@ export type GetItemsResponse = Message<"item.v1.GetItemsResponse"> & {
|
|||||||
* Describes the message item.v1.GetItemsResponse.
|
* Describes the message item.v1.GetItemsResponse.
|
||||||
* Use `create(GetItemsResponseSchema)` to create a new message.
|
* Use `create(GetItemsResponseSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export const GetItemsResponseSchema: GenMessage<GetItemsResponse> = /*@__PURE__*/
|
export const GetItemsResponseSchema: GenMessage<GetItemsResponse> =
|
||||||
|
/*@__PURE__*/
|
||||||
messageDesc(file_item_v1_item, 4);
|
messageDesc(file_item_v1_item, 4);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated from message item.v1.CreateItemRequest
|
* @generated from message item.v1.CreateItemRequest
|
||||||
*/
|
*/
|
||||||
export type CreateItemRequest = Message<"item.v1.CreateItemRequest"> & {
|
export type CreateItemRequest = Message<'item.v1.CreateItemRequest'> & {
|
||||||
/**
|
/**
|
||||||
* @generated from field: item.v1.Item item = 1;
|
* @generated from field: item.v1.Item item = 1;
|
||||||
*/
|
*/
|
||||||
@ -163,13 +170,14 @@ export type CreateItemRequest = Message<"item.v1.CreateItemRequest"> & {
|
|||||||
* Describes the message item.v1.CreateItemRequest.
|
* Describes the message item.v1.CreateItemRequest.
|
||||||
* Use `create(CreateItemRequestSchema)` to create a new message.
|
* Use `create(CreateItemRequestSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export const CreateItemRequestSchema: GenMessage<CreateItemRequest> = /*@__PURE__*/
|
export const CreateItemRequestSchema: GenMessage<CreateItemRequest> =
|
||||||
|
/*@__PURE__*/
|
||||||
messageDesc(file_item_v1_item, 5);
|
messageDesc(file_item_v1_item, 5);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated from message item.v1.CreateItemResponse
|
* @generated from message item.v1.CreateItemResponse
|
||||||
*/
|
*/
|
||||||
export type CreateItemResponse = Message<"item.v1.CreateItemResponse"> & {
|
export type CreateItemResponse = Message<'item.v1.CreateItemResponse'> & {
|
||||||
/**
|
/**
|
||||||
* @generated from field: item.v1.Item item = 1;
|
* @generated from field: item.v1.Item item = 1;
|
||||||
*/
|
*/
|
||||||
@ -180,13 +188,14 @@ export type CreateItemResponse = Message<"item.v1.CreateItemResponse"> & {
|
|||||||
* Describes the message item.v1.CreateItemResponse.
|
* Describes the message item.v1.CreateItemResponse.
|
||||||
* Use `create(CreateItemResponseSchema)` to create a new message.
|
* Use `create(CreateItemResponseSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export const CreateItemResponseSchema: GenMessage<CreateItemResponse> = /*@__PURE__*/
|
export const CreateItemResponseSchema: GenMessage<CreateItemResponse> =
|
||||||
|
/*@__PURE__*/
|
||||||
messageDesc(file_item_v1_item, 6);
|
messageDesc(file_item_v1_item, 6);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated from message item.v1.UpdateItemRequest
|
* @generated from message item.v1.UpdateItemRequest
|
||||||
*/
|
*/
|
||||||
export type UpdateItemRequest = Message<"item.v1.UpdateItemRequest"> & {
|
export type UpdateItemRequest = Message<'item.v1.UpdateItemRequest'> & {
|
||||||
/**
|
/**
|
||||||
* @generated from field: item.v1.Item item = 1;
|
* @generated from field: item.v1.Item item = 1;
|
||||||
*/
|
*/
|
||||||
@ -197,13 +206,14 @@ export type UpdateItemRequest = Message<"item.v1.UpdateItemRequest"> & {
|
|||||||
* Describes the message item.v1.UpdateItemRequest.
|
* Describes the message item.v1.UpdateItemRequest.
|
||||||
* Use `create(UpdateItemRequestSchema)` to create a new message.
|
* Use `create(UpdateItemRequestSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export const UpdateItemRequestSchema: GenMessage<UpdateItemRequest> = /*@__PURE__*/
|
export const UpdateItemRequestSchema: GenMessage<UpdateItemRequest> =
|
||||||
|
/*@__PURE__*/
|
||||||
messageDesc(file_item_v1_item, 7);
|
messageDesc(file_item_v1_item, 7);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated from message item.v1.UpdateItemResponse
|
* @generated from message item.v1.UpdateItemResponse
|
||||||
*/
|
*/
|
||||||
export type UpdateItemResponse = Message<"item.v1.UpdateItemResponse"> & {
|
export type UpdateItemResponse = Message<'item.v1.UpdateItemResponse'> & {
|
||||||
/**
|
/**
|
||||||
* @generated from field: item.v1.Item item = 1;
|
* @generated from field: item.v1.Item item = 1;
|
||||||
*/
|
*/
|
||||||
@ -214,13 +224,14 @@ export type UpdateItemResponse = Message<"item.v1.UpdateItemResponse"> & {
|
|||||||
* Describes the message item.v1.UpdateItemResponse.
|
* Describes the message item.v1.UpdateItemResponse.
|
||||||
* Use `create(UpdateItemResponseSchema)` to create a new message.
|
* Use `create(UpdateItemResponseSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export const UpdateItemResponseSchema: GenMessage<UpdateItemResponse> = /*@__PURE__*/
|
export const UpdateItemResponseSchema: GenMessage<UpdateItemResponse> =
|
||||||
|
/*@__PURE__*/
|
||||||
messageDesc(file_item_v1_item, 8);
|
messageDesc(file_item_v1_item, 8);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated from message item.v1.DeleteItemRequest
|
* @generated from message item.v1.DeleteItemRequest
|
||||||
*/
|
*/
|
||||||
export type DeleteItemRequest = Message<"item.v1.DeleteItemRequest"> & {
|
export type DeleteItemRequest = Message<'item.v1.DeleteItemRequest'> & {
|
||||||
/**
|
/**
|
||||||
* @generated from field: uint32 id = 1;
|
* @generated from field: uint32 id = 1;
|
||||||
*/
|
*/
|
||||||
@ -231,20 +242,21 @@ export type DeleteItemRequest = Message<"item.v1.DeleteItemRequest"> & {
|
|||||||
* Describes the message item.v1.DeleteItemRequest.
|
* Describes the message item.v1.DeleteItemRequest.
|
||||||
* Use `create(DeleteItemRequestSchema)` to create a new message.
|
* Use `create(DeleteItemRequestSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export const DeleteItemRequestSchema: GenMessage<DeleteItemRequest> = /*@__PURE__*/
|
export const DeleteItemRequestSchema: GenMessage<DeleteItemRequest> =
|
||||||
|
/*@__PURE__*/
|
||||||
messageDesc(file_item_v1_item, 9);
|
messageDesc(file_item_v1_item, 9);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated from message item.v1.DeleteItemResponse
|
* @generated from message item.v1.DeleteItemResponse
|
||||||
*/
|
*/
|
||||||
export type DeleteItemResponse = Message<"item.v1.DeleteItemResponse"> & {
|
export type DeleteItemResponse = Message<'item.v1.DeleteItemResponse'> & {};
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes the message item.v1.DeleteItemResponse.
|
* Describes the message item.v1.DeleteItemResponse.
|
||||||
* Use `create(DeleteItemResponseSchema)` to create a new message.
|
* Use `create(DeleteItemResponseSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export const DeleteItemResponseSchema: GenMessage<DeleteItemResponse> = /*@__PURE__*/
|
export const DeleteItemResponseSchema: GenMessage<DeleteItemResponse> =
|
||||||
|
/*@__PURE__*/
|
||||||
messageDesc(file_item_v1_item, 10);
|
messageDesc(file_item_v1_item, 10);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -255,42 +267,40 @@ export const ItemService: GenService<{
|
|||||||
* @generated from rpc item.v1.ItemService.GetItem
|
* @generated from rpc item.v1.ItemService.GetItem
|
||||||
*/
|
*/
|
||||||
getItem: {
|
getItem: {
|
||||||
methodKind: "unary";
|
methodKind: 'unary';
|
||||||
input: typeof GetItemRequestSchema;
|
input: typeof GetItemRequestSchema;
|
||||||
output: typeof GetItemResponseSchema;
|
output: typeof GetItemResponseSchema;
|
||||||
},
|
};
|
||||||
/**
|
/**
|
||||||
* @generated from rpc item.v1.ItemService.GetItems
|
* @generated from rpc item.v1.ItemService.GetItems
|
||||||
*/
|
*/
|
||||||
getItems: {
|
getItems: {
|
||||||
methodKind: "unary";
|
methodKind: 'unary';
|
||||||
input: typeof GetItemsRequestSchema;
|
input: typeof GetItemsRequestSchema;
|
||||||
output: typeof GetItemsResponseSchema;
|
output: typeof GetItemsResponseSchema;
|
||||||
},
|
};
|
||||||
/**
|
/**
|
||||||
* @generated from rpc item.v1.ItemService.CreateItem
|
* @generated from rpc item.v1.ItemService.CreateItem
|
||||||
*/
|
*/
|
||||||
createItem: {
|
createItem: {
|
||||||
methodKind: "unary";
|
methodKind: 'unary';
|
||||||
input: typeof CreateItemRequestSchema;
|
input: typeof CreateItemRequestSchema;
|
||||||
output: typeof CreateItemResponseSchema;
|
output: typeof CreateItemResponseSchema;
|
||||||
},
|
};
|
||||||
/**
|
/**
|
||||||
* @generated from rpc item.v1.ItemService.UpdateItem
|
* @generated from rpc item.v1.ItemService.UpdateItem
|
||||||
*/
|
*/
|
||||||
updateItem: {
|
updateItem: {
|
||||||
methodKind: "unary";
|
methodKind: 'unary';
|
||||||
input: typeof UpdateItemRequestSchema;
|
input: typeof UpdateItemRequestSchema;
|
||||||
output: typeof UpdateItemResponseSchema;
|
output: typeof UpdateItemResponseSchema;
|
||||||
},
|
};
|
||||||
/**
|
/**
|
||||||
* @generated from rpc item.v1.ItemService.DeleteItem
|
* @generated from rpc item.v1.ItemService.DeleteItem
|
||||||
*/
|
*/
|
||||||
deleteItem: {
|
deleteItem: {
|
||||||
methodKind: "unary";
|
methodKind: 'unary';
|
||||||
input: typeof DeleteItemRequestSchema;
|
input: typeof DeleteItemRequestSchema;
|
||||||
output: typeof DeleteItemResponseSchema;
|
output: typeof DeleteItemResponseSchema;
|
||||||
},
|
};
|
||||||
}> = /*@__PURE__*/
|
}> = /*@__PURE__*/ serviceDesc(file_item_v1_item, 0);
|
||||||
serviceDesc(file_item_v1_item, 0);
|
|
||||||
|
|
||||||
|
@ -2,20 +2,23 @@
|
|||||||
// @generated from file user/v1/auth.proto (package user.v1, syntax proto3)
|
// @generated from file user/v1/auth.proto (package user.v1, syntax proto3)
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
|
|
||||||
import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv1";
|
import type { GenFile, GenMessage, GenService } from '@bufbuild/protobuf/codegenv1';
|
||||||
import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1";
|
import { fileDesc, messageDesc, serviceDesc } from '@bufbuild/protobuf/codegenv1';
|
||||||
import type { Message } from "@bufbuild/protobuf";
|
import type { Message } from '@bufbuild/protobuf';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes the file user/v1/auth.proto.
|
* Describes the file user/v1/auth.proto.
|
||||||
*/
|
*/
|
||||||
export const file_user_v1_auth: GenFile = /*@__PURE__*/
|
export const file_user_v1_auth: GenFile =
|
||||||
fileDesc("ChJ1c2VyL3YxL2F1dGgucHJvdG8SB3VzZXIudjEiMgoMTG9naW5SZXF1ZXN0EhAKCHVzZX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Vlc3QiEAoOTG9nb3V0UmVzcG9uc2UywQEKC0F1dGhTZXJ2aWNlEjgKBUxvZ2luEhUudXNlci52MS5Mb2dpblJlcXVlc3QaFi51c2VyLnYxLkxvZ2luUmVzcG9uc2UiABI7CgZTaWduVXASFi51c2VyLnYxLlNpZ25VcFJlcXVlc3QaFy51c2VyLnYxLlNpZ25VcFJlc3BvbnNlIgASOwoGTG9nb3V0EhYudXNlci52MS5Mb2dvdXRSZXF1ZXN0GhcudXNlci52MS5Mb2dvdXRSZXNwb25zZSIAQp0BCgtjb20udXNlci52MUIJQXV0aFByb3RvUAFaRmdpdGh1Yi5jb20vc3BvdGRlbW80L3RyZXZzdGFjay9zZXJ2ZXIvaW50ZXJuYWwvc2VydmljZXMvdXNlci92MTt1c2VydjGiAgNVWFiqAgdVc2VyLlYxygIHVXNlclxWMeICE1VzZXJcVjFcR1BCTWV0YWRhdGHqAghVc2VyOjpWMWIGcHJvdG8z'
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated from message user.v1.LoginRequest
|
* @generated from message user.v1.LoginRequest
|
||||||
*/
|
*/
|
||||||
export type LoginRequest = Message<"user.v1.LoginRequest"> & {
|
export type LoginRequest = Message<'user.v1.LoginRequest'> & {
|
||||||
/**
|
/**
|
||||||
* @generated from field: string username = 1;
|
* @generated from field: string username = 1;
|
||||||
*/
|
*/
|
||||||
@ -31,13 +34,14 @@ export type LoginRequest = Message<"user.v1.LoginRequest"> & {
|
|||||||
* Describes the message user.v1.LoginRequest.
|
* Describes the message user.v1.LoginRequest.
|
||||||
* Use `create(LoginRequestSchema)` to create a new message.
|
* Use `create(LoginRequestSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export const LoginRequestSchema: GenMessage<LoginRequest> = /*@__PURE__*/
|
export const LoginRequestSchema: GenMessage<LoginRequest> =
|
||||||
|
/*@__PURE__*/
|
||||||
messageDesc(file_user_v1_auth, 0);
|
messageDesc(file_user_v1_auth, 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated from message user.v1.LoginResponse
|
* @generated from message user.v1.LoginResponse
|
||||||
*/
|
*/
|
||||||
export type LoginResponse = Message<"user.v1.LoginResponse"> & {
|
export type LoginResponse = Message<'user.v1.LoginResponse'> & {
|
||||||
/**
|
/**
|
||||||
* @generated from field: string token = 1;
|
* @generated from field: string token = 1;
|
||||||
*/
|
*/
|
||||||
@ -48,13 +52,14 @@ export type LoginResponse = Message<"user.v1.LoginResponse"> & {
|
|||||||
* Describes the message user.v1.LoginResponse.
|
* Describes the message user.v1.LoginResponse.
|
||||||
* Use `create(LoginResponseSchema)` to create a new message.
|
* Use `create(LoginResponseSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export const LoginResponseSchema: GenMessage<LoginResponse> = /*@__PURE__*/
|
export const LoginResponseSchema: GenMessage<LoginResponse> =
|
||||||
|
/*@__PURE__*/
|
||||||
messageDesc(file_user_v1_auth, 1);
|
messageDesc(file_user_v1_auth, 1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated from message user.v1.SignUpRequest
|
* @generated from message user.v1.SignUpRequest
|
||||||
*/
|
*/
|
||||||
export type SignUpRequest = Message<"user.v1.SignUpRequest"> & {
|
export type SignUpRequest = Message<'user.v1.SignUpRequest'> & {
|
||||||
/**
|
/**
|
||||||
* @generated from field: string username = 1;
|
* @generated from field: string username = 1;
|
||||||
*/
|
*/
|
||||||
@ -75,46 +80,47 @@ export type SignUpRequest = Message<"user.v1.SignUpRequest"> & {
|
|||||||
* Describes the message user.v1.SignUpRequest.
|
* Describes the message user.v1.SignUpRequest.
|
||||||
* Use `create(SignUpRequestSchema)` to create a new message.
|
* Use `create(SignUpRequestSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export const SignUpRequestSchema: GenMessage<SignUpRequest> = /*@__PURE__*/
|
export const SignUpRequestSchema: GenMessage<SignUpRequest> =
|
||||||
|
/*@__PURE__*/
|
||||||
messageDesc(file_user_v1_auth, 2);
|
messageDesc(file_user_v1_auth, 2);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated from message user.v1.SignUpResponse
|
* @generated from message user.v1.SignUpResponse
|
||||||
*/
|
*/
|
||||||
export type SignUpResponse = Message<"user.v1.SignUpResponse"> & {
|
export type SignUpResponse = Message<'user.v1.SignUpResponse'> & {};
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes the message user.v1.SignUpResponse.
|
* Describes the message user.v1.SignUpResponse.
|
||||||
* Use `create(SignUpResponseSchema)` to create a new message.
|
* Use `create(SignUpResponseSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export const SignUpResponseSchema: GenMessage<SignUpResponse> = /*@__PURE__*/
|
export const SignUpResponseSchema: GenMessage<SignUpResponse> =
|
||||||
|
/*@__PURE__*/
|
||||||
messageDesc(file_user_v1_auth, 3);
|
messageDesc(file_user_v1_auth, 3);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated from message user.v1.LogoutRequest
|
* @generated from message user.v1.LogoutRequest
|
||||||
*/
|
*/
|
||||||
export type LogoutRequest = Message<"user.v1.LogoutRequest"> & {
|
export type LogoutRequest = Message<'user.v1.LogoutRequest'> & {};
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes the message user.v1.LogoutRequest.
|
* Describes the message user.v1.LogoutRequest.
|
||||||
* Use `create(LogoutRequestSchema)` to create a new message.
|
* Use `create(LogoutRequestSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export const LogoutRequestSchema: GenMessage<LogoutRequest> = /*@__PURE__*/
|
export const LogoutRequestSchema: GenMessage<LogoutRequest> =
|
||||||
|
/*@__PURE__*/
|
||||||
messageDesc(file_user_v1_auth, 4);
|
messageDesc(file_user_v1_auth, 4);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated from message user.v1.LogoutResponse
|
* @generated from message user.v1.LogoutResponse
|
||||||
*/
|
*/
|
||||||
export type LogoutResponse = Message<"user.v1.LogoutResponse"> & {
|
export type LogoutResponse = Message<'user.v1.LogoutResponse'> & {};
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes the message user.v1.LogoutResponse.
|
* Describes the message user.v1.LogoutResponse.
|
||||||
* Use `create(LogoutResponseSchema)` to create a new message.
|
* Use `create(LogoutResponseSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export const LogoutResponseSchema: GenMessage<LogoutResponse> = /*@__PURE__*/
|
export const LogoutResponseSchema: GenMessage<LogoutResponse> =
|
||||||
|
/*@__PURE__*/
|
||||||
messageDesc(file_user_v1_auth, 5);
|
messageDesc(file_user_v1_auth, 5);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -125,26 +131,24 @@ export const AuthService: GenService<{
|
|||||||
* @generated from rpc user.v1.AuthService.Login
|
* @generated from rpc user.v1.AuthService.Login
|
||||||
*/
|
*/
|
||||||
login: {
|
login: {
|
||||||
methodKind: "unary";
|
methodKind: 'unary';
|
||||||
input: typeof LoginRequestSchema;
|
input: typeof LoginRequestSchema;
|
||||||
output: typeof LoginResponseSchema;
|
output: typeof LoginResponseSchema;
|
||||||
},
|
};
|
||||||
/**
|
/**
|
||||||
* @generated from rpc user.v1.AuthService.SignUp
|
* @generated from rpc user.v1.AuthService.SignUp
|
||||||
*/
|
*/
|
||||||
signUp: {
|
signUp: {
|
||||||
methodKind: "unary";
|
methodKind: 'unary';
|
||||||
input: typeof SignUpRequestSchema;
|
input: typeof SignUpRequestSchema;
|
||||||
output: typeof SignUpResponseSchema;
|
output: typeof SignUpResponseSchema;
|
||||||
},
|
};
|
||||||
/**
|
/**
|
||||||
* @generated from rpc user.v1.AuthService.Logout
|
* @generated from rpc user.v1.AuthService.Logout
|
||||||
*/
|
*/
|
||||||
logout: {
|
logout: {
|
||||||
methodKind: "unary";
|
methodKind: 'unary';
|
||||||
input: typeof LogoutRequestSchema;
|
input: typeof LogoutRequestSchema;
|
||||||
output: typeof LogoutResponseSchema;
|
output: typeof LogoutResponseSchema;
|
||||||
},
|
};
|
||||||
}> = /*@__PURE__*/
|
}> = /*@__PURE__*/ serviceDesc(file_user_v1_auth, 0);
|
||||||
serviceDesc(file_user_v1_auth, 0);
|
|
||||||
|
|
||||||
|
@ -2,20 +2,23 @@
|
|||||||
// @generated from file user/v1/user.proto (package user.v1, syntax proto3)
|
// @generated from file user/v1/user.proto (package user.v1, syntax proto3)
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
|
|
||||||
import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv1";
|
import type { GenFile, GenMessage, GenService } from '@bufbuild/protobuf/codegenv1';
|
||||||
import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1";
|
import { fileDesc, messageDesc, serviceDesc } from '@bufbuild/protobuf/codegenv1';
|
||||||
import type { Message } from "@bufbuild/protobuf";
|
import type { Message } from '@bufbuild/protobuf';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes the file user/v1/user.proto.
|
* Describes the file user/v1/user.proto.
|
||||||
*/
|
*/
|
||||||
export const file_user_v1_user: GenFile = /*@__PURE__*/
|
export const file_user_v1_user: GenFile =
|
||||||
fileDesc("ChJ1c2VyL3YxL3VzZXIucHJvdG8SB3VzZXIudjEiVgoEVXNlchIKCgJpZBgBIAEoDRIQCgh1c2VybmFtZRgCIAEoCRIcCg9wcm9maWxlX3BpY3R1cmUYAyABKAlIAIgBAUISChBfcHJvZmlsZV9waWN0dXJlIhAKDkdldFVzZXJSZXF1ZXN0Ii4KD0dldFVzZXJSZXNwb25zZRIbCgR1c2VyGAEgASgLMg0udXNlci52MS5Vc2VyIl0KFVVwZGF0ZVBhc3N3b3JkUmVxdWVzdBIUCgxvbGRfcGFzc3dvcmQYASABKAkSFAoMbmV3X3Bhc3N3b3JkGAIgASgJEhgKEGNvbmZpcm1fcGFzc3dvcmQYAyABKAkiNQoWVXBkYXRlUGFzc3dvcmRSZXNwb25zZRIbCgR1c2VyGAEgASgLMg0udXN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VzZXIudjEuVXBkYXRlUHJvZmlsZVBpY3R1cmVSZXNwb25zZSIAQp0BCgtjb20udXNlci52MUIJVXNlclByb3RvUAFaRmdpdGh1Yi5jb20vc3BvdGRlbW80L3RyZXZzdGFjay9zZXJ2ZXIvaW50ZXJuYWwvc2VydmljZXMvdXNlci92MTt1c2VydjGiAgNVWFiqAgdVc2VyLlYxygIHVXNlclxWMeICE1VzZXJcVjFcR1BCTWV0YWRhdGHqAghVc2VyOjpWMWIGcHJvdG8z'
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated from message user.v1.User
|
* @generated from message user.v1.User
|
||||||
*/
|
*/
|
||||||
export type User = Message<"user.v1.User"> & {
|
export type User = Message<'user.v1.User'> & {
|
||||||
/**
|
/**
|
||||||
* @generated from field: uint32 id = 1;
|
* @generated from field: uint32 id = 1;
|
||||||
*/
|
*/
|
||||||
@ -36,26 +39,25 @@ export type User = Message<"user.v1.User"> & {
|
|||||||
* Describes the message user.v1.User.
|
* Describes the message user.v1.User.
|
||||||
* Use `create(UserSchema)` to create a new message.
|
* Use `create(UserSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export const UserSchema: GenMessage<User> = /*@__PURE__*/
|
export const UserSchema: GenMessage<User> = /*@__PURE__*/ messageDesc(file_user_v1_user, 0);
|
||||||
messageDesc(file_user_v1_user, 0);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated from message user.v1.GetUserRequest
|
* @generated from message user.v1.GetUserRequest
|
||||||
*/
|
*/
|
||||||
export type GetUserRequest = Message<"user.v1.GetUserRequest"> & {
|
export type GetUserRequest = Message<'user.v1.GetUserRequest'> & {};
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes the message user.v1.GetUserRequest.
|
* Describes the message user.v1.GetUserRequest.
|
||||||
* Use `create(GetUserRequestSchema)` to create a new message.
|
* Use `create(GetUserRequestSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export const GetUserRequestSchema: GenMessage<GetUserRequest> = /*@__PURE__*/
|
export const GetUserRequestSchema: GenMessage<GetUserRequest> =
|
||||||
|
/*@__PURE__*/
|
||||||
messageDesc(file_user_v1_user, 1);
|
messageDesc(file_user_v1_user, 1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated from message user.v1.GetUserResponse
|
* @generated from message user.v1.GetUserResponse
|
||||||
*/
|
*/
|
||||||
export type GetUserResponse = Message<"user.v1.GetUserResponse"> & {
|
export type GetUserResponse = Message<'user.v1.GetUserResponse'> & {
|
||||||
/**
|
/**
|
||||||
* @generated from field: user.v1.User user = 1;
|
* @generated from field: user.v1.User user = 1;
|
||||||
*/
|
*/
|
||||||
@ -66,13 +68,14 @@ export type GetUserResponse = Message<"user.v1.GetUserResponse"> & {
|
|||||||
* Describes the message user.v1.GetUserResponse.
|
* Describes the message user.v1.GetUserResponse.
|
||||||
* Use `create(GetUserResponseSchema)` to create a new message.
|
* Use `create(GetUserResponseSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export const GetUserResponseSchema: GenMessage<GetUserResponse> = /*@__PURE__*/
|
export const GetUserResponseSchema: GenMessage<GetUserResponse> =
|
||||||
|
/*@__PURE__*/
|
||||||
messageDesc(file_user_v1_user, 2);
|
messageDesc(file_user_v1_user, 2);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated from message user.v1.UpdatePasswordRequest
|
* @generated from message user.v1.UpdatePasswordRequest
|
||||||
*/
|
*/
|
||||||
export type UpdatePasswordRequest = Message<"user.v1.UpdatePasswordRequest"> & {
|
export type UpdatePasswordRequest = Message<'user.v1.UpdatePasswordRequest'> & {
|
||||||
/**
|
/**
|
||||||
* @generated from field: string old_password = 1;
|
* @generated from field: string old_password = 1;
|
||||||
*/
|
*/
|
||||||
@ -93,13 +96,14 @@ export type UpdatePasswordRequest = Message<"user.v1.UpdatePasswordRequest"> & {
|
|||||||
* Describes the message user.v1.UpdatePasswordRequest.
|
* Describes the message user.v1.UpdatePasswordRequest.
|
||||||
* Use `create(UpdatePasswordRequestSchema)` to create a new message.
|
* Use `create(UpdatePasswordRequestSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export const UpdatePasswordRequestSchema: GenMessage<UpdatePasswordRequest> = /*@__PURE__*/
|
export const UpdatePasswordRequestSchema: GenMessage<UpdatePasswordRequest> =
|
||||||
|
/*@__PURE__*/
|
||||||
messageDesc(file_user_v1_user, 3);
|
messageDesc(file_user_v1_user, 3);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated from message user.v1.UpdatePasswordResponse
|
* @generated from message user.v1.UpdatePasswordResponse
|
||||||
*/
|
*/
|
||||||
export type UpdatePasswordResponse = Message<"user.v1.UpdatePasswordResponse"> & {
|
export type UpdatePasswordResponse = Message<'user.v1.UpdatePasswordResponse'> & {
|
||||||
/**
|
/**
|
||||||
* @generated from field: user.v1.User user = 1;
|
* @generated from field: user.v1.User user = 1;
|
||||||
*/
|
*/
|
||||||
@ -110,13 +114,14 @@ export type UpdatePasswordResponse = Message<"user.v1.UpdatePasswordResponse"> &
|
|||||||
* Describes the message user.v1.UpdatePasswordResponse.
|
* Describes the message user.v1.UpdatePasswordResponse.
|
||||||
* Use `create(UpdatePasswordResponseSchema)` to create a new message.
|
* Use `create(UpdatePasswordResponseSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export const UpdatePasswordResponseSchema: GenMessage<UpdatePasswordResponse> = /*@__PURE__*/
|
export const UpdatePasswordResponseSchema: GenMessage<UpdatePasswordResponse> =
|
||||||
|
/*@__PURE__*/
|
||||||
messageDesc(file_user_v1_user, 4);
|
messageDesc(file_user_v1_user, 4);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated from message user.v1.GetAPIKeyRequest
|
* @generated from message user.v1.GetAPIKeyRequest
|
||||||
*/
|
*/
|
||||||
export type GetAPIKeyRequest = Message<"user.v1.GetAPIKeyRequest"> & {
|
export type GetAPIKeyRequest = Message<'user.v1.GetAPIKeyRequest'> & {
|
||||||
/**
|
/**
|
||||||
* @generated from field: string password = 1;
|
* @generated from field: string password = 1;
|
||||||
*/
|
*/
|
||||||
@ -132,13 +137,14 @@ export type GetAPIKeyRequest = Message<"user.v1.GetAPIKeyRequest"> & {
|
|||||||
* Describes the message user.v1.GetAPIKeyRequest.
|
* Describes the message user.v1.GetAPIKeyRequest.
|
||||||
* Use `create(GetAPIKeyRequestSchema)` to create a new message.
|
* Use `create(GetAPIKeyRequestSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export const GetAPIKeyRequestSchema: GenMessage<GetAPIKeyRequest> = /*@__PURE__*/
|
export const GetAPIKeyRequestSchema: GenMessage<GetAPIKeyRequest> =
|
||||||
|
/*@__PURE__*/
|
||||||
messageDesc(file_user_v1_user, 5);
|
messageDesc(file_user_v1_user, 5);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated from message user.v1.GetAPIKeyResponse
|
* @generated from message user.v1.GetAPIKeyResponse
|
||||||
*/
|
*/
|
||||||
export type GetAPIKeyResponse = Message<"user.v1.GetAPIKeyResponse"> & {
|
export type GetAPIKeyResponse = Message<'user.v1.GetAPIKeyResponse'> & {
|
||||||
/**
|
/**
|
||||||
* @generated from field: string key = 1;
|
* @generated from field: string key = 1;
|
||||||
*/
|
*/
|
||||||
@ -149,13 +155,14 @@ export type GetAPIKeyResponse = Message<"user.v1.GetAPIKeyResponse"> & {
|
|||||||
* Describes the message user.v1.GetAPIKeyResponse.
|
* Describes the message user.v1.GetAPIKeyResponse.
|
||||||
* Use `create(GetAPIKeyResponseSchema)` to create a new message.
|
* Use `create(GetAPIKeyResponseSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export const GetAPIKeyResponseSchema: GenMessage<GetAPIKeyResponse> = /*@__PURE__*/
|
export const GetAPIKeyResponseSchema: GenMessage<GetAPIKeyResponse> =
|
||||||
|
/*@__PURE__*/
|
||||||
messageDesc(file_user_v1_user, 6);
|
messageDesc(file_user_v1_user, 6);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated from message user.v1.UpdateProfilePictureRequest
|
* @generated from message user.v1.UpdateProfilePictureRequest
|
||||||
*/
|
*/
|
||||||
export type UpdateProfilePictureRequest = Message<"user.v1.UpdateProfilePictureRequest"> & {
|
export type UpdateProfilePictureRequest = Message<'user.v1.UpdateProfilePictureRequest'> & {
|
||||||
/**
|
/**
|
||||||
* @generated from field: string file_name = 1;
|
* @generated from field: string file_name = 1;
|
||||||
*/
|
*/
|
||||||
@ -171,13 +178,14 @@ export type UpdateProfilePictureRequest = Message<"user.v1.UpdateProfilePictureR
|
|||||||
* Describes the message user.v1.UpdateProfilePictureRequest.
|
* Describes the message user.v1.UpdateProfilePictureRequest.
|
||||||
* Use `create(UpdateProfilePictureRequestSchema)` to create a new message.
|
* Use `create(UpdateProfilePictureRequestSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export const UpdateProfilePictureRequestSchema: GenMessage<UpdateProfilePictureRequest> = /*@__PURE__*/
|
export const UpdateProfilePictureRequestSchema: GenMessage<UpdateProfilePictureRequest> =
|
||||||
|
/*@__PURE__*/
|
||||||
messageDesc(file_user_v1_user, 7);
|
messageDesc(file_user_v1_user, 7);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated from message user.v1.UpdateProfilePictureResponse
|
* @generated from message user.v1.UpdateProfilePictureResponse
|
||||||
*/
|
*/
|
||||||
export type UpdateProfilePictureResponse = Message<"user.v1.UpdateProfilePictureResponse"> & {
|
export type UpdateProfilePictureResponse = Message<'user.v1.UpdateProfilePictureResponse'> & {
|
||||||
/**
|
/**
|
||||||
* @generated from field: user.v1.User user = 1;
|
* @generated from field: user.v1.User user = 1;
|
||||||
*/
|
*/
|
||||||
@ -188,7 +196,8 @@ export type UpdateProfilePictureResponse = Message<"user.v1.UpdateProfilePicture
|
|||||||
* Describes the message user.v1.UpdateProfilePictureResponse.
|
* Describes the message user.v1.UpdateProfilePictureResponse.
|
||||||
* Use `create(UpdateProfilePictureResponseSchema)` to create a new message.
|
* Use `create(UpdateProfilePictureResponseSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export const UpdateProfilePictureResponseSchema: GenMessage<UpdateProfilePictureResponse> = /*@__PURE__*/
|
export const UpdateProfilePictureResponseSchema: GenMessage<UpdateProfilePictureResponse> =
|
||||||
|
/*@__PURE__*/
|
||||||
messageDesc(file_user_v1_user, 8);
|
messageDesc(file_user_v1_user, 8);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -199,34 +208,32 @@ export const UserService: GenService<{
|
|||||||
* @generated from rpc user.v1.UserService.GetUser
|
* @generated from rpc user.v1.UserService.GetUser
|
||||||
*/
|
*/
|
||||||
getUser: {
|
getUser: {
|
||||||
methodKind: "unary";
|
methodKind: 'unary';
|
||||||
input: typeof GetUserRequestSchema;
|
input: typeof GetUserRequestSchema;
|
||||||
output: typeof GetUserResponseSchema;
|
output: typeof GetUserResponseSchema;
|
||||||
},
|
};
|
||||||
/**
|
/**
|
||||||
* @generated from rpc user.v1.UserService.UpdatePassword
|
* @generated from rpc user.v1.UserService.UpdatePassword
|
||||||
*/
|
*/
|
||||||
updatePassword: {
|
updatePassword: {
|
||||||
methodKind: "unary";
|
methodKind: 'unary';
|
||||||
input: typeof UpdatePasswordRequestSchema;
|
input: typeof UpdatePasswordRequestSchema;
|
||||||
output: typeof UpdatePasswordResponseSchema;
|
output: typeof UpdatePasswordResponseSchema;
|
||||||
},
|
};
|
||||||
/**
|
/**
|
||||||
* @generated from rpc user.v1.UserService.GetAPIKey
|
* @generated from rpc user.v1.UserService.GetAPIKey
|
||||||
*/
|
*/
|
||||||
getAPIKey: {
|
getAPIKey: {
|
||||||
methodKind: "unary";
|
methodKind: 'unary';
|
||||||
input: typeof GetAPIKeyRequestSchema;
|
input: typeof GetAPIKeyRequestSchema;
|
||||||
output: typeof GetAPIKeyResponseSchema;
|
output: typeof GetAPIKeyResponseSchema;
|
||||||
},
|
};
|
||||||
/**
|
/**
|
||||||
* @generated from rpc user.v1.UserService.UpdateProfilePicture
|
* @generated from rpc user.v1.UserService.UpdateProfilePicture
|
||||||
*/
|
*/
|
||||||
updateProfilePicture: {
|
updateProfilePicture: {
|
||||||
methodKind: "unary";
|
methodKind: 'unary';
|
||||||
input: typeof UpdateProfilePictureRequestSchema;
|
input: typeof UpdateProfilePictureRequestSchema;
|
||||||
output: typeof UpdateProfilePictureResponseSchema;
|
output: typeof UpdateProfilePictureResponseSchema;
|
||||||
},
|
};
|
||||||
}> = /*@__PURE__*/
|
}> = /*@__PURE__*/ serviceDesc(file_user_v1_user, 0);
|
||||||
serviceDesc(file_user_v1_user, 0);
|
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import type { User } from "./services/user/v1/user_pb"
|
import type { User } from './services/user/v1/user_pb';
|
||||||
|
|
||||||
export let userState: { user: User | undefined } = $state({
|
export const userState: { user: User | undefined } = $state({
|
||||||
user: undefined
|
user: undefined
|
||||||
});
|
});
|
@ -1,9 +1,9 @@
|
|||||||
import { createConnectTransport } from "@connectrpc/connect-web"
|
import { createConnectTransport } from '@connectrpc/connect-web';
|
||||||
import { Code, ConnectError, createClient, type Interceptor } from "@connectrpc/connect"
|
import { Code, ConnectError, createClient, type Interceptor } from '@connectrpc/connect';
|
||||||
import { AuthService } from "$lib/services/user/v1/auth_pb";
|
import { AuthService } from '$lib/services/user/v1/auth_pb';
|
||||||
import { UserService } from "$lib/services/user/v1/user_pb";
|
import { UserService } from '$lib/services/user/v1/user_pb';
|
||||||
import { ItemService } from "$lib/services/item/v1/item_pb";
|
import { ItemService } from '$lib/services/item/v1/item_pb';
|
||||||
import { goto } from "$app/navigation";
|
import { goto } from '$app/navigation';
|
||||||
|
|
||||||
const redirector: Interceptor = (next) => async (req) => {
|
const redirector: Interceptor = (next) => async (req) => {
|
||||||
try {
|
try {
|
||||||
@ -19,7 +19,7 @@ const redirector: Interceptor = (next) => async (req) => {
|
|||||||
|
|
||||||
const transport = createConnectTransport({
|
const transport = createConnectTransport({
|
||||||
baseUrl: `${window.location.origin}/grpc`,
|
baseUrl: `${window.location.origin}/grpc`,
|
||||||
interceptors: [redirector],
|
interceptors: [redirector]
|
||||||
});
|
});
|
||||||
|
|
||||||
export const AuthClient = createClient(AuthService, transport);
|
export const AuthClient = createClient(AuthService, transport);
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
<Button.Root
|
<Button.Root
|
||||||
{type}
|
{type}
|
||||||
class={cn(
|
class={cn(
|
||||||
'bg-sky text-crust flex justify-center items-center hover:brightness-120 focus:outline-sky w-fit cursor-pointer rounded p-2 px-4 text-sm font-medium transition-all focus:outline-2 focus:outline-offset-1',
|
'bg-sky text-crust focus:outline-sky flex w-fit cursor-pointer items-center justify-center rounded p-2 px-4 text-sm font-medium transition-all hover:brightness-120 focus:outline-2 focus:outline-offset-1',
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
{onclick}
|
{onclick}
|
||||||
|
@ -43,10 +43,10 @@
|
|||||||
class="bg-mantle border-surface-0 hover:border-surface-2 flex items-center rounded border pl-2 text-sm drop-shadow-md transition-all"
|
class="bg-mantle border-surface-0 hover:border-surface-2 flex items-center rounded border pl-2 text-sm drop-shadow-md transition-all"
|
||||||
>
|
>
|
||||||
<div class="flex grow items-center justify-center">
|
<div class="flex grow items-center justify-center">
|
||||||
{#each ['start', 'end'] as const as type}
|
{#each ['start', 'end'] as const as type (type)}
|
||||||
<DateRangePicker.Input {type}>
|
<DateRangePicker.Input {type}>
|
||||||
{#snippet children({ segments })}
|
{#snippet children({ segments })}
|
||||||
{#each segments as { part, value }}
|
{#each segments as { part, value } (value)}
|
||||||
<div class="inline-block select-none">
|
<div class="inline-block select-none">
|
||||||
{#if part === 'literal'}
|
{#if part === 'literal'}
|
||||||
<DateRangePicker.Segment {part} class="text-overlay-0 p-1">
|
<DateRangePicker.Segment {part} class="text-overlay-0 p-1">
|
||||||
@ -114,21 +114,21 @@
|
|||||||
>
|
>
|
||||||
<ArrowLeft />
|
<ArrowLeft />
|
||||||
</DateRangePicker.PrevButton>
|
</DateRangePicker.PrevButton>
|
||||||
<DateRangePicker.Heading class="select-none font-medium" />
|
<DateRangePicker.Heading class="font-medium select-none" />
|
||||||
<DateRangePicker.NextButton
|
<DateRangePicker.NextButton
|
||||||
class="hover:bg-surface-0 inline-flex size-10 cursor-pointer items-center justify-center rounded transition-all active:scale-[0.98]"
|
class="hover:bg-surface-0 inline-flex size-10 cursor-pointer items-center justify-center rounded transition-all active:scale-[0.98]"
|
||||||
>
|
>
|
||||||
<ArrowRight />
|
<ArrowRight />
|
||||||
</DateRangePicker.NextButton>
|
</DateRangePicker.NextButton>
|
||||||
</DateRangePicker.Header>
|
</DateRangePicker.Header>
|
||||||
<div class="flex flex-col space-y-4 pt-4 sm:flex-row sm:space-x-4 sm:space-y-0">
|
<div class="flex flex-col space-y-4 pt-4 sm:flex-row sm:space-y-0 sm:space-x-4">
|
||||||
{#each months as month}
|
{#each months as month (month)}
|
||||||
<DateRangePicker.Grid class="w-full border-collapse select-none space-y-1">
|
<DateRangePicker.Grid class="w-full border-collapse space-y-1 select-none">
|
||||||
<DateRangePicker.GridHead>
|
<DateRangePicker.GridHead>
|
||||||
<DateRangePicker.GridRow class="mb-1 flex w-full justify-between">
|
<DateRangePicker.GridRow class="mb-1 flex w-full justify-between">
|
||||||
{#each weekdays as day}
|
{#each weekdays as day (day)}
|
||||||
<DateRangePicker.HeadCell
|
<DateRangePicker.HeadCell
|
||||||
class="text-overlay-0 font-normal! w-10 rounded text-xs"
|
class="text-overlay-0 w-10 rounded text-xs font-normal!"
|
||||||
>
|
>
|
||||||
{day.slice(0, 2)}
|
{day.slice(0, 2)}
|
||||||
</DateRangePicker.HeadCell>
|
</DateRangePicker.HeadCell>
|
||||||
@ -136,19 +136,19 @@
|
|||||||
</DateRangePicker.GridRow>
|
</DateRangePicker.GridRow>
|
||||||
</DateRangePicker.GridHead>
|
</DateRangePicker.GridHead>
|
||||||
<DateRangePicker.GridBody>
|
<DateRangePicker.GridBody>
|
||||||
{#each month.weeks as weekDates}
|
{#each month.weeks as weekDates (weekDates)}
|
||||||
<DateRangePicker.GridRow class="flex w-full">
|
<DateRangePicker.GridRow class="flex w-full">
|
||||||
{#each weekDates as date}
|
{#each weekDates as date (date)}
|
||||||
<DateRangePicker.Cell
|
<DateRangePicker.Cell
|
||||||
{date}
|
{date}
|
||||||
month={month.value}
|
month={month.value}
|
||||||
class="p-0! relative m-0 size-10 overflow-visible text-center text-sm focus-within:relative focus-within:z-20"
|
class="relative m-0 size-10 overflow-visible p-0! text-center text-sm focus-within:relative focus-within:z-20"
|
||||||
>
|
>
|
||||||
<DateRangePicker.Day
|
<DateRangePicker.Day
|
||||||
class={'hover:border-sky focus-visible:ring-foreground! data-selected:rounded-none data-selection-end:rounded-r data-selection-start:rounded-l data-highlighted:bg-surface-0 data-selected:bg-surface-1 data-selection-end:bg-surface-2 data-selection-start:bg-surface-2 data-disabled:text-text/30 data-unavailable:text-overlay-0 data-disabled:pointer-events-none data-outside-month:pointer-events-none data-highlighted:rounded-none data-unavailable:line-through group relative inline-flex size-10 items-center justify-center overflow-visible whitespace-nowrap rounded border border-transparent bg-transparent p-0 text-sm font-normal transition-all'}
|
class="hover:border-sky focus-visible:ring-foreground! data-highlighted:bg-surface-0 data-selected:bg-surface-1 data-selection-end:bg-surface-2 data-selection-start:bg-surface-2 data-disabled:text-text/30 data-unavailable:text-overlay-0 group relative inline-flex size-10 items-center justify-center overflow-visible rounded border border-transparent bg-transparent p-0 text-sm font-normal whitespace-nowrap transition-all data-disabled:pointer-events-none data-highlighted:rounded-none data-outside-month:pointer-events-none data-selected:rounded-none data-selection-end:rounded-r data-selection-start:rounded-l data-unavailable:line-through"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="bg-sky group-data-selected:bg-background group-data-today:block absolute top-[5px] hidden size-1 rounded-full transition-all"
|
class="bg-sky group-data-selected:bg-background absolute top-[5px] hidden size-1 rounded-full transition-all group-data-today:block"
|
||||||
></div>
|
></div>
|
||||||
{date.day}
|
{date.day}
|
||||||
</DateRangePicker.Day>
|
</DateRangePicker.Day>
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="bg-mantle border-surface-0 fixed inset-0 left-[50%] top-[50%] z-50 size-fit w-96 -translate-x-1/2 -translate-y-1/2 transform overflow-y-auto rounded-xl border pb-1 drop-shadow-md"
|
class="bg-mantle border-surface-0 fixed inset-0 top-[50%] left-[50%] z-50 size-fit w-96 -translate-x-1/2 -translate-y-1/2 transform overflow-y-auto rounded-xl border pb-1 drop-shadow-md"
|
||||||
>
|
>
|
||||||
<div class="border-surface-0 flex justify-between border-b p-2">
|
<div class="border-surface-0 flex justify-between border-b p-2">
|
||||||
<h1 class="grow truncate p-1 text-center text-xl font-bold">
|
<h1 class="grow truncate p-1 text-center text-xl font-bold">
|
||||||
|
@ -38,11 +38,11 @@
|
|||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
{#each pages as page (page.key)}
|
{#each pages as page (page.key)}
|
||||||
{#if page.type === 'ellipsis'}
|
{#if page.type === 'ellipsis'}
|
||||||
<div class="select-none font-medium">...</div>
|
<div class="font-medium select-none">...</div>
|
||||||
{:else}
|
{:else}
|
||||||
<Pagination.Page
|
<Pagination.Page
|
||||||
{page}
|
{page}
|
||||||
class="hover:bg-surface-0 data-selected:bg-surface-0 data-selected:text-background inline-flex size-10 cursor-pointer select-none items-center justify-center rounded bg-transparent font-medium transition-all disabled:cursor-not-allowed disabled:opacity-50 hover:disabled:bg-transparent"
|
class="hover:bg-surface-0 data-selected:bg-surface-0 data-selected:text-background inline-flex size-10 cursor-pointer items-center justify-center rounded bg-transparent font-medium transition-all select-none disabled:cursor-not-allowed disabled:opacity-50 hover:disabled:bg-transparent"
|
||||||
>
|
>
|
||||||
{page.value}
|
{page.value}
|
||||||
</Pagination.Page>
|
</Pagination.Page>
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
>
|
>
|
||||||
<Select.Root type="single" {items} bind:value onValueChange={onchange}>
|
<Select.Root type="single" {items} bind:value onValueChange={onchange}>
|
||||||
<Select.Trigger
|
<Select.Trigger
|
||||||
class="focus:outline-sky data-placeholder:text-overlay-0 inline-flex grow cursor-pointer select-none items-center justify-between gap-2 rounded-l py-2 pl-2 text-sm transition-colors focus:outline focus:outline-offset-1"
|
class="focus:outline-sky data-placeholder:text-overlay-0 inline-flex grow cursor-pointer items-center justify-between gap-2 rounded-l py-2 pl-2 text-sm transition-colors select-none focus:outline focus:outline-offset-1"
|
||||||
aria-label={placeholder}
|
aria-label={placeholder}
|
||||||
>
|
>
|
||||||
{selectedLabel}
|
{selectedLabel}
|
||||||
@ -44,7 +44,7 @@
|
|||||||
<div {...wrapperProps}>
|
<div {...wrapperProps}>
|
||||||
<div
|
<div
|
||||||
{...props}
|
{...props}
|
||||||
class="border-surface-0 bg-mantle shadow-popover outline-hidden z-50 mt-1 select-none rounded border p-1"
|
class="border-surface-0 bg-mantle shadow-popover z-50 mt-1 rounded border p-1 outline-hidden select-none"
|
||||||
transition:fade={{
|
transition:fade={{
|
||||||
duration: 100
|
duration: 100
|
||||||
}}
|
}}
|
||||||
@ -55,7 +55,7 @@
|
|||||||
<Select.Viewport class="p-1">
|
<Select.Viewport class="p-1">
|
||||||
{#each items as item, i (i + item.value)}
|
{#each items as item, i (i + item.value)}
|
||||||
<Select.Item
|
<Select.Item
|
||||||
class="data-disabled:cursor-not-allowed data-highlighted:bg-surface-0 outline-hidden data-disabled:opacity-50 flex h-10 w-full cursor-pointer select-none items-center gap-4 rounded px-5 py-3 text-sm capitalize"
|
class="data-highlighted:bg-surface-0 flex h-10 w-full cursor-pointer items-center gap-4 rounded px-5 py-3 text-sm capitalize outline-hidden select-none data-disabled:cursor-not-allowed data-disabled:opacity-50"
|
||||||
value={item.value}
|
value={item.value}
|
||||||
label={item.label}
|
label={item.label}
|
||||||
disabled={item.disabled}
|
disabled={item.disabled}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { type ClassValue, clsx } from "clsx";
|
import { type ClassValue, clsx } from 'clsx';
|
||||||
import { twMerge } from "tailwind-merge";
|
import { twMerge } from 'tailwind-merge';
|
||||||
|
|
||||||
export function cn(...inputs: ClassValue[]) {
|
export function cn(...inputs: ClassValue[]) {
|
||||||
return twMerge(clsx(inputs));
|
return twMerge(clsx(inputs));
|
||||||
|
@ -98,14 +98,14 @@
|
|||||||
>
|
>
|
||||||
<NavigationMenu.Root orientation="vertical">
|
<NavigationMenu.Root orientation="vertical">
|
||||||
<NavigationMenu.List
|
<NavigationMenu.List
|
||||||
class="flex w-full flex-col gap-2 overflow-y-auto overflow-x-hidden p-2"
|
class="flex w-full flex-col gap-2 overflow-x-hidden overflow-y-auto p-2"
|
||||||
>
|
>
|
||||||
{#each menuItems as item}
|
{#each menuItems as item (item.name)}
|
||||||
{@const Icon = item.icon}
|
{@const Icon = item.icon}
|
||||||
<NavigationMenu.Item>
|
<NavigationMenu.Item>
|
||||||
<NavigationMenu.Link
|
<NavigationMenu.Link
|
||||||
class={cn(
|
class={cn(
|
||||||
'hover:bg-surface-0 flex select-none gap-2 whitespace-nowrap rounded-lg p-2 transition-all',
|
'hover:bg-surface-0 flex gap-2 rounded-lg p-2 whitespace-nowrap transition-all select-none',
|
||||||
page.url.pathname === item.href && 'bg-surface-0'
|
page.url.pathname === item.href && 'bg-surface-0'
|
||||||
)}
|
)}
|
||||||
href={item.href}
|
href={item.href}
|
||||||
@ -126,7 +126,7 @@
|
|||||||
<div class="border-surface-0 flex flex-col gap-2 border-t p-2">
|
<div class="border-surface-0 flex flex-col gap-2 border-t p-2">
|
||||||
<a
|
<a
|
||||||
href="/settings"
|
href="/settings"
|
||||||
class="hover:bg-surface-0 flex select-none items-center gap-2 rounded-lg p-2 transition-all"
|
class="hover:bg-surface-0 flex items-center gap-2 rounded-lg p-2 transition-all select-none"
|
||||||
onclick={() => {
|
onclick={() => {
|
||||||
if (sidebarOpen) {
|
if (sidebarOpen) {
|
||||||
sidebarOpen = false;
|
sidebarOpen = false;
|
||||||
@ -138,7 +138,7 @@
|
|||||||
</a>
|
</a>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
class="hover:bg-surface-0 flex w-full cursor-pointer items-center gap-2 whitespace-nowrap rounded-lg p-2 transition-all"
|
class="hover:bg-surface-0 flex w-full cursor-pointer items-center gap-2 rounded-lg p-2 whitespace-nowrap transition-all"
|
||||||
onclick={logout}
|
onclick={logout}
|
||||||
>
|
>
|
||||||
<LogOut size="20" />
|
<LogOut size="20" />
|
||||||
@ -152,7 +152,7 @@
|
|||||||
</Dialog.Portal>
|
</Dialog.Portal>
|
||||||
</Dialog.Root>
|
</Dialog.Root>
|
||||||
|
|
||||||
<a href="/" class="flex select-none items-center gap-2 text-2xl font-bold tracking-wider">
|
<a href="/" class="flex items-center gap-2 text-2xl font-bold tracking-wider select-none">
|
||||||
TrevStack
|
TrevStack
|
||||||
<LayoutGrid />
|
<LayoutGrid />
|
||||||
</a>
|
</a>
|
||||||
@ -160,11 +160,11 @@
|
|||||||
|
|
||||||
<NavigationMenu.Root class="hidden md:block">
|
<NavigationMenu.Root class="hidden md:block">
|
||||||
<NavigationMenu.List class="flex gap-2">
|
<NavigationMenu.List class="flex gap-2">
|
||||||
{#each menuItems as item}
|
{#each menuItems as item (item.name)}
|
||||||
<NavigationMenu.Item>
|
<NavigationMenu.Item>
|
||||||
<NavigationMenu.Link
|
<NavigationMenu.Link
|
||||||
class={cn(
|
class={cn(
|
||||||
'hover:bg-surface-0 flex select-none gap-2 rounded-lg p-1 px-2 transition-all',
|
'hover:bg-surface-0 flex gap-2 rounded-lg p-1 px-2 transition-all select-none',
|
||||||
page.url.pathname === item.href && 'bg-surface-0'
|
page.url.pathname === item.href && 'bg-surface-0'
|
||||||
)}
|
)}
|
||||||
href={item.href}
|
href={item.href}
|
||||||
@ -179,7 +179,7 @@
|
|||||||
|
|
||||||
<Popover.Root bind:open={popupOpen}>
|
<Popover.Root bind:open={popupOpen}>
|
||||||
<Popover.Trigger
|
<Popover.Trigger
|
||||||
class="outline-surface-2 hover:brightness-120 bg-text text-crust h-9 w-9 cursor-pointer rounded-full text-sm outline outline-offset-2 transition-all"
|
class="outline-surface-2 bg-text text-crust h-9 w-9 cursor-pointer rounded-full text-sm outline outline-offset-2 transition-all hover:brightness-120"
|
||||||
>
|
>
|
||||||
<Avatar />
|
<Avatar />
|
||||||
</Popover.Trigger>
|
</Popover.Trigger>
|
||||||
|
@ -50,12 +50,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="mx-4 my-2 flex flex-wrap items-center justify-center gap-2">
|
<div class="mx-4 my-2 flex flex-wrap items-center justify-center gap-2">
|
||||||
<Input
|
<Input bind:value={filter} className="bg-mantle" placeholder="Filter" onchange={updateItems} />
|
||||||
bind:value={filter}
|
|
||||||
className="bg-mantle"
|
|
||||||
placeholder="Filter"
|
|
||||||
onchange={updateItems}
|
|
||||||
/>
|
|
||||||
<Select
|
<Select
|
||||||
items={[
|
items={[
|
||||||
{
|
{
|
||||||
@ -238,7 +233,7 @@
|
|||||||
<td class="w-8"></td>
|
<td class="w-8"></td>
|
||||||
</tr>
|
</tr>
|
||||||
{:then items}
|
{:then items}
|
||||||
{#each items as item}
|
{#each items as item (item.id)}
|
||||||
<tr class="border-surface-0 border-b">
|
<tr class="border-surface-0 border-b">
|
||||||
<td class="px-6 py-3">
|
<td class="px-6 py-3">
|
||||||
{item.added ? timestampDate(item.added).toLocaleString() : ''}
|
{item.added ? timestampDate(item.added).toLocaleString() : ''}
|
||||||
@ -287,7 +282,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{:then items}
|
{:then items}
|
||||||
{#each items as item}
|
{#each items as item (item.id)}
|
||||||
<div
|
<div
|
||||||
class="border-surface-0 bg-mantle flex w-full flex-wrap gap-6 rounded border p-5 drop-shadow-md"
|
class="border-surface-0 bg-mantle flex w-full flex-wrap gap-6 rounded border p-5 drop-shadow-md"
|
||||||
>
|
>
|
||||||
@ -313,7 +308,7 @@
|
|||||||
<span class="text-subtext-0 text-sm">Quantity</span>
|
<span class="text-subtext-0 text-sm">Quantity</span>
|
||||||
<span class="truncate">{item.quantity}</span>
|
<span class="truncate">{item.quantity}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-end ml-auto gap-2">
|
<div class="ml-auto flex justify-end gap-2">
|
||||||
{@render editModal(item)}
|
{@render editModal(item)}
|
||||||
{@render deleteModal(item)}
|
{@render deleteModal(item)}
|
||||||
</div>
|
</div>
|
||||||
@ -322,7 +317,7 @@
|
|||||||
{/await}
|
{/await}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mx-4 mb-4 mt-2 flex justify-end sm:mt-1">
|
<div class="mx-4 mt-2 mb-4 flex justify-end sm:mt-1">
|
||||||
<Modal bind:open={addedOpen}>
|
<Modal bind:open={addedOpen}>
|
||||||
{#snippet trigger(props)}
|
{#snippet trigger(props)}
|
||||||
<Button {...props} className="bg-sky">
|
<Button {...props} className="bg-sky">
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
<div class="m-auto flex w-96 flex-col gap-4 p-4">
|
<div class="m-auto flex w-96 flex-col gap-4 p-4">
|
||||||
<div class="flex items-center justify-center gap-4">
|
<div class="flex items-center justify-center gap-4">
|
||||||
<div
|
<div
|
||||||
class="outline-surface-2 bg-text text-crust h-9 w-9 select-none rounded-full text-sm outline outline-offset-2"
|
class="outline-surface-2 bg-text text-crust h-9 w-9 rounded-full text-sm outline outline-offset-2 select-none"
|
||||||
>
|
>
|
||||||
<Avatar />
|
<Avatar />
|
||||||
</div>
|
</div>
|
||||||
|
@ -5,10 +5,12 @@
|
|||||||
let { children } = $props();
|
let { children } = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Toaster toastOptions={{
|
<Toaster
|
||||||
|
toastOptions={{
|
||||||
classes: {
|
classes: {
|
||||||
toast: '!bg-mantle !text-text !border-surface-0',
|
toast: '!bg-mantle !text-text !border-surface-0'
|
||||||
}
|
}
|
||||||
}} />
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
{@render children()}
|
{@render children()}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
"display": "standalone",
|
"display": "standalone",
|
||||||
"start_url": "/",
|
"start_url": "/",
|
||||||
"background_color": "#181825",
|
"background_color": "#181825",
|
||||||
"theme_color": "#89dceb",
|
"theme_color": "#11111b",
|
||||||
"icons": [
|
"icons": [
|
||||||
{
|
{
|
||||||
"src": "icon.png",
|
"src": "icon.png",
|
||||||
|
@ -1,23 +1,20 @@
|
|||||||
import { sveltekit } from '@sveltejs/kit/vite';
|
import { sveltekit } from '@sveltejs/kit/vite';
|
||||||
import { defineConfig } from 'vite';
|
import { defineConfig } from 'vite';
|
||||||
import tailwindcss from '@tailwindcss/vite'
|
import tailwindcss from '@tailwindcss/vite';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [
|
plugins: [tailwindcss(), sveltekit()],
|
||||||
tailwindcss(),
|
|
||||||
sveltekit()
|
|
||||||
],
|
|
||||||
server: {
|
server: {
|
||||||
proxy: {
|
proxy: {
|
||||||
'/grpc': {
|
'/grpc': {
|
||||||
target: 'http://localhost:8080',
|
target: 'http://localhost:8080',
|
||||||
changeOrigin: true,
|
changeOrigin: true
|
||||||
},
|
},
|
||||||
'/file': {
|
'/file': {
|
||||||
target: 'http://localhost:8080',
|
target: 'http://localhost:8080',
|
||||||
changeOrigin: true,
|
changeOrigin: true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
host: '0.0.0.0'
|
||||||
host: '0.0.0.0',
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
17
flake.nix
17
flake.nix
@ -57,6 +57,7 @@
|
|||||||
gotools
|
gotools
|
||||||
gopls
|
gopls
|
||||||
air
|
air
|
||||||
|
revive
|
||||||
|
|
||||||
# Protobuf middleware
|
# Protobuf middleware
|
||||||
buf
|
buf
|
||||||
@ -171,6 +172,22 @@
|
|||||||
git push origin "''${next_version}"
|
git push origin "''${next_version}"
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
|
||||||
|
(writeShellApplication {
|
||||||
|
name = "ts-lint";
|
||||||
|
|
||||||
|
text = ''
|
||||||
|
git_root=$(git rev-parse --show-toplevel)
|
||||||
|
|
||||||
|
cd "''${git_root}/client"
|
||||||
|
npm run check
|
||||||
|
npm run format
|
||||||
|
npm run lint
|
||||||
|
|
||||||
|
cd "''${git_root}/server"
|
||||||
|
revive -config revive.toml -formatter friendly ./...
|
||||||
|
'';
|
||||||
|
})
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -48,10 +48,8 @@ func (h *FileHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
if r.Method == http.MethodGet {
|
if r.Method == http.MethodGet {
|
||||||
w.Header().Set("Content-Type", http.DetectContentType(file.Data))
|
w.Header().Set("Content-Type", http.DetectContentType(file.Data))
|
||||||
w.Write(file.Data)
|
w.Write(file.Data)
|
||||||
return
|
|
||||||
} else {
|
} else {
|
||||||
http.Error(w, "Method Not Allowed", http.StatusMethodNotAllowed)
|
http.Error(w, "Method Not Allowed", http.StatusMethodNotAllowed)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,12 +15,12 @@ import (
|
|||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ItemHandler struct {
|
type Handler struct {
|
||||||
db *gorm.DB
|
db *gorm.DB
|
||||||
key []byte
|
key []byte
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *ItemHandler) GetItem(ctx context.Context, req *connect.Request[itemv1.GetItemRequest]) (*connect.Response[itemv1.GetItemResponse], error) {
|
func (h *Handler) GetItem(ctx context.Context, req *connect.Request[itemv1.GetItemRequest]) (*connect.Response[itemv1.GetItemResponse], error) {
|
||||||
userid, ok := interceptors.GetUserContext(ctx)
|
userid, ok := interceptors.GetUserContext(ctx)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, connect.NewError(connect.CodeUnauthenticated, errors.New("unauthenticated"))
|
return nil, connect.NewError(connect.CodeUnauthenticated, errors.New("unauthenticated"))
|
||||||
@ -38,7 +38,7 @@ func (h *ItemHandler) GetItem(ctx context.Context, req *connect.Request[itemv1.G
|
|||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *ItemHandler) GetItems(ctx context.Context, req *connect.Request[itemv1.GetItemsRequest]) (*connect.Response[itemv1.GetItemsResponse], error) {
|
func (h *Handler) GetItems(ctx context.Context, req *connect.Request[itemv1.GetItemsRequest]) (*connect.Response[itemv1.GetItemsResponse], error) {
|
||||||
userid, ok := interceptors.GetUserContext(ctx)
|
userid, ok := interceptors.GetUserContext(ctx)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, connect.NewError(connect.CodeUnauthenticated, errors.New("unauthenticated"))
|
return nil, connect.NewError(connect.CodeUnauthenticated, errors.New("unauthenticated"))
|
||||||
@ -88,7 +88,7 @@ func (h *ItemHandler) GetItems(ctx context.Context, req *connect.Request[itemv1.
|
|||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *ItemHandler) CreateItem(ctx context.Context, req *connect.Request[itemv1.CreateItemRequest]) (*connect.Response[itemv1.CreateItemResponse], error) {
|
func (h *Handler) CreateItem(ctx context.Context, req *connect.Request[itemv1.CreateItemRequest]) (*connect.Response[itemv1.CreateItemResponse], error) {
|
||||||
userid, ok := interceptors.GetUserContext(ctx)
|
userid, ok := interceptors.GetUserContext(ctx)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, connect.NewError(connect.CodeUnauthenticated, errors.New("unauthenticated"))
|
return nil, connect.NewError(connect.CodeUnauthenticated, errors.New("unauthenticated"))
|
||||||
@ -113,7 +113,7 @@ func (h *ItemHandler) CreateItem(ctx context.Context, req *connect.Request[itemv
|
|||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *ItemHandler) UpdateItem(ctx context.Context, req *connect.Request[itemv1.UpdateItemRequest]) (*connect.Response[itemv1.UpdateItemResponse], error) {
|
func (h *Handler) UpdateItem(ctx context.Context, req *connect.Request[itemv1.UpdateItemRequest]) (*connect.Response[itemv1.UpdateItemResponse], error) {
|
||||||
userid, ok := interceptors.GetUserContext(ctx)
|
userid, ok := interceptors.GetUserContext(ctx)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, connect.NewError(connect.CodeUnauthenticated, errors.New("unauthenticated"))
|
return nil, connect.NewError(connect.CodeUnauthenticated, errors.New("unauthenticated"))
|
||||||
@ -143,7 +143,7 @@ func (h *ItemHandler) UpdateItem(ctx context.Context, req *connect.Request[itemv
|
|||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *ItemHandler) DeleteItem(ctx context.Context, req *connect.Request[itemv1.DeleteItemRequest]) (*connect.Response[itemv1.DeleteItemResponse], error) {
|
func (h *Handler) DeleteItem(ctx context.Context, req *connect.Request[itemv1.DeleteItemRequest]) (*connect.Response[itemv1.DeleteItemResponse], error) {
|
||||||
userid, ok := interceptors.GetUserContext(ctx)
|
userid, ok := interceptors.GetUserContext(ctx)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, connect.NewError(connect.CodeUnauthenticated, errors.New("unauthenticated"))
|
return nil, connect.NewError(connect.CodeUnauthenticated, errors.New("unauthenticated"))
|
||||||
@ -158,11 +158,11 @@ func (h *ItemHandler) DeleteItem(ctx context.Context, req *connect.Request[itemv
|
|||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewItemHandler(db *gorm.DB, key string) (string, http.Handler) {
|
func NewHandler(db *gorm.DB, key string) (string, http.Handler) {
|
||||||
interceptors := connect.WithInterceptors(interceptors.NewAuthInterceptor(key))
|
interceptors := connect.WithInterceptors(interceptors.NewAuthInterceptor(key))
|
||||||
|
|
||||||
return itemv1connect.NewItemServiceHandler(
|
return itemv1connect.NewItemServiceHandler(
|
||||||
&ItemHandler{
|
&Handler{
|
||||||
db: db,
|
db: db,
|
||||||
key: []byte(key),
|
key: []byte(key),
|
||||||
},
|
},
|
||||||
|
@ -22,7 +22,7 @@ type AuthHandler struct {
|
|||||||
key []byte
|
key []byte
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *AuthHandler) Login(ctx context.Context, req *connect.Request[userv1.LoginRequest]) (*connect.Response[userv1.LoginResponse], error) {
|
func (h *AuthHandler) Login(_ context.Context, req *connect.Request[userv1.LoginRequest]) (*connect.Response[userv1.LoginResponse], error) {
|
||||||
// Validate
|
// Validate
|
||||||
user := models.User{}
|
user := models.User{}
|
||||||
if err := h.db.First(&user, "username = ?", req.Msg.Username).Error; err != nil {
|
if err := h.db.First(&user, "username = ?", req.Msg.Username).Error; err != nil {
|
||||||
@ -69,7 +69,7 @@ func (h *AuthHandler) Login(ctx context.Context, req *connect.Request[userv1.Log
|
|||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *AuthHandler) SignUp(ctx context.Context, req *connect.Request[userv1.SignUpRequest]) (*connect.Response[userv1.SignUpResponse], error) {
|
func (h *AuthHandler) SignUp(_ context.Context, req *connect.Request[userv1.SignUpRequest]) (*connect.Response[userv1.SignUpResponse], error) {
|
||||||
// Validate
|
// Validate
|
||||||
if err := h.db.First(&models.User{}, "username = ?", req.Msg.Username).Error; err != nil {
|
if err := h.db.First(&models.User{}, "username = ?", req.Msg.Username).Error; err != nil {
|
||||||
if !errors.Is(err, gorm.ErrRecordNotFound) {
|
if !errors.Is(err, gorm.ErrRecordNotFound) {
|
||||||
@ -101,7 +101,7 @@ func (h *AuthHandler) SignUp(ctx context.Context, req *connect.Request[userv1.Si
|
|||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *AuthHandler) Logout(ctx context.Context, req *connect.Request[userv1.LogoutRequest]) (*connect.Response[userv1.LogoutResponse], error) {
|
func (h *AuthHandler) Logout(_ context.Context, _ *connect.Request[userv1.LogoutRequest]) (*connect.Response[userv1.LogoutResponse], error) {
|
||||||
// Clear cookie
|
// Clear cookie
|
||||||
cookie := http.Cookie{
|
cookie := http.Cookie{
|
||||||
Name: "token",
|
Name: "token",
|
||||||
|
@ -17,12 +17,12 @@ import (
|
|||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
type UserHandler struct {
|
type Handler struct {
|
||||||
db *gorm.DB
|
db *gorm.DB
|
||||||
key []byte
|
key []byte
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *UserHandler) GetUser(ctx context.Context, req *connect.Request[userv1.GetUserRequest]) (*connect.Response[userv1.GetUserResponse], error) {
|
func (h *Handler) GetUser(ctx context.Context, _ *connect.Request[userv1.GetUserRequest]) (*connect.Response[userv1.GetUserResponse], error) {
|
||||||
userid, ok := interceptors.GetUserContext(ctx)
|
userid, ok := interceptors.GetUserContext(ctx)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, connect.NewError(connect.CodeUnauthenticated, errors.New("unauthenticated"))
|
return nil, connect.NewError(connect.CodeUnauthenticated, errors.New("unauthenticated"))
|
||||||
@ -40,7 +40,7 @@ func (h *UserHandler) GetUser(ctx context.Context, req *connect.Request[userv1.G
|
|||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *UserHandler) UpdatePassword(ctx context.Context, req *connect.Request[userv1.UpdatePasswordRequest]) (*connect.Response[userv1.UpdatePasswordResponse], error) {
|
func (h *Handler) UpdatePassword(ctx context.Context, req *connect.Request[userv1.UpdatePasswordRequest]) (*connect.Response[userv1.UpdatePasswordResponse], error) {
|
||||||
userid, ok := interceptors.GetUserContext(ctx)
|
userid, ok := interceptors.GetUserContext(ctx)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, connect.NewError(connect.CodeUnauthenticated, errors.New("unauthenticated"))
|
return nil, connect.NewError(connect.CodeUnauthenticated, errors.New("unauthenticated"))
|
||||||
@ -75,7 +75,7 @@ func (h *UserHandler) UpdatePassword(ctx context.Context, req *connect.Request[u
|
|||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *UserHandler) GetAPIKey(ctx context.Context, req *connect.Request[userv1.GetAPIKeyRequest]) (*connect.Response[userv1.GetAPIKeyResponse], error) {
|
func (h *Handler) GetAPIKey(ctx context.Context, req *connect.Request[userv1.GetAPIKeyRequest]) (*connect.Response[userv1.GetAPIKeyResponse], error) {
|
||||||
userid, ok := interceptors.GetUserContext(ctx)
|
userid, ok := interceptors.GetUserContext(ctx)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, connect.NewError(connect.CodeUnauthenticated, errors.New("unauthenticated"))
|
return nil, connect.NewError(connect.CodeUnauthenticated, errors.New("unauthenticated"))
|
||||||
@ -114,7 +114,7 @@ func (h *UserHandler) GetAPIKey(ctx context.Context, req *connect.Request[userv1
|
|||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *UserHandler) UpdateProfilePicture(ctx context.Context, req *connect.Request[userv1.UpdateProfilePictureRequest]) (*connect.Response[userv1.UpdateProfilePictureResponse], error) {
|
func (h *Handler) UpdateProfilePicture(ctx context.Context, req *connect.Request[userv1.UpdateProfilePictureRequest]) (*connect.Response[userv1.UpdateProfilePictureResponse], error) {
|
||||||
userid, ok := interceptors.GetUserContext(ctx)
|
userid, ok := interceptors.GetUserContext(ctx)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, connect.NewError(connect.CodeUnauthenticated, errors.New("unauthenticated"))
|
return nil, connect.NewError(connect.CodeUnauthenticated, errors.New("unauthenticated"))
|
||||||
@ -169,11 +169,11 @@ func (h *UserHandler) UpdateProfilePicture(ctx context.Context, req *connect.Req
|
|||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewUserHandler(db *gorm.DB, key string) (string, http.Handler) {
|
func NewHandler(db *gorm.DB, key string) (string, http.Handler) {
|
||||||
interceptors := connect.WithInterceptors(interceptors.NewAuthInterceptor(key))
|
interceptors := connect.WithInterceptors(interceptors.NewAuthInterceptor(key))
|
||||||
|
|
||||||
return userv1connect.NewUserServiceHandler(
|
return userv1connect.NewUserServiceHandler(
|
||||||
&UserHandler{
|
&Handler{
|
||||||
db: db,
|
db: db,
|
||||||
key: []byte(key),
|
key: []byte(key),
|
||||||
},
|
},
|
||||||
|
@ -50,10 +50,7 @@ func WithAuthRedirect(next http.Handler, key string) http.Handler {
|
|||||||
}
|
}
|
||||||
next.ServeHTTP(w, r)
|
next.ServeHTTP(w, r)
|
||||||
|
|
||||||
case "_app":
|
case "_app", "favicon.png", "icon.png":
|
||||||
next.ServeHTTP(w, r)
|
|
||||||
|
|
||||||
case "favicon.png":
|
|
||||||
next.ServeHTTP(w, r)
|
next.ServeHTTP(w, r)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -69,17 +66,17 @@ func WithAuthRedirect(next http.Handler, key string) http.Handler {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
type authInterceptor struct {
|
type AuthInterceptor struct {
|
||||||
key string
|
key string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewAuthInterceptor(key string) *authInterceptor {
|
func NewAuthInterceptor(key string) *AuthInterceptor {
|
||||||
return &authInterceptor{
|
return &AuthInterceptor{
|
||||||
key: key,
|
key: key,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *authInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc {
|
func (i *AuthInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc {
|
||||||
// Same as previous UnaryInterceptorFunc.
|
// Same as previous UnaryInterceptorFunc.
|
||||||
return connect.UnaryFunc(func(
|
return connect.UnaryFunc(func(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
@ -123,7 +120,7 @@ func (i *authInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*authInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc {
|
func (*AuthInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc {
|
||||||
return connect.StreamingClientFunc(func(
|
return connect.StreamingClientFunc(func(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
spec connect.Spec,
|
spec connect.Spec,
|
||||||
@ -132,7 +129,7 @@ func (*authInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) co
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *authInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc {
|
func (i *AuthInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc {
|
||||||
return connect.StreamingHandlerFunc(func(
|
return connect.StreamingHandlerFunc(func(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
conn connect.StreamingHandlerConn,
|
conn connect.StreamingHandlerConn,
|
||||||
|
@ -15,14 +15,14 @@ type visitor struct {
|
|||||||
lastSeen time.Time
|
lastSeen time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
type ratelimitInterceptor struct {
|
type RatelimitInterceptor struct {
|
||||||
key string
|
key string
|
||||||
visitors map[string]*visitor
|
visitors map[string]*visitor
|
||||||
mu sync.Mutex
|
mu sync.Mutex
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewRateLimitInterceptor(key string) *ratelimitInterceptor {
|
func NewRateLimitInterceptor(key string) *RatelimitInterceptor {
|
||||||
rl := &ratelimitInterceptor{
|
rl := &RatelimitInterceptor{
|
||||||
key: key,
|
key: key,
|
||||||
visitors: make(map[string]*visitor),
|
visitors: make(map[string]*visitor),
|
||||||
mu: sync.Mutex{},
|
mu: sync.Mutex{},
|
||||||
@ -33,7 +33,7 @@ func NewRateLimitInterceptor(key string) *ratelimitInterceptor {
|
|||||||
return rl
|
return rl
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *ratelimitInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc {
|
func (i *RatelimitInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc {
|
||||||
// Same as previous UnaryInterceptorFunc.
|
// Same as previous UnaryInterceptorFunc.
|
||||||
return connect.UnaryFunc(func(
|
return connect.UnaryFunc(func(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
@ -54,7 +54,7 @@ func (i *ratelimitInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFu
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*ratelimitInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc {
|
func (*RatelimitInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc {
|
||||||
return connect.StreamingClientFunc(func(
|
return connect.StreamingClientFunc(func(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
spec connect.Spec,
|
spec connect.Spec,
|
||||||
@ -63,7 +63,7 @@ func (*ratelimitInterceptor) WrapStreamingClient(next connect.StreamingClientFun
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *ratelimitInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc {
|
func (i *RatelimitInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc {
|
||||||
return connect.StreamingHandlerFunc(func(
|
return connect.StreamingHandlerFunc(func(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
conn connect.StreamingHandlerConn,
|
conn connect.StreamingHandlerConn,
|
||||||
@ -78,7 +78,7 @@ func (i *ratelimitInterceptor) WrapStreamingHandler(next connect.StreamingHandle
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *ratelimitInterceptor) getVisitor(userAgent string) *rate.Limiter {
|
func (i *RatelimitInterceptor) getVisitor(userAgent string) *rate.Limiter {
|
||||||
i.mu.Lock()
|
i.mu.Lock()
|
||||||
defer i.mu.Unlock()
|
defer i.mu.Unlock()
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ func (i *ratelimitInterceptor) getVisitor(userAgent string) *rate.Limiter {
|
|||||||
|
|
||||||
// Every minute check the map for visitors that haven't been seen for
|
// Every minute check the map for visitors that haven't been seen for
|
||||||
// more than 3 minutes and delete the entries.
|
// more than 3 minutes and delete the entries.
|
||||||
func (i *ratelimitInterceptor) cleanupVisitors() {
|
func (i *RatelimitInterceptor) cleanupVisitors() {
|
||||||
for {
|
for {
|
||||||
time.Sleep(time.Minute)
|
time.Sleep(time.Minute)
|
||||||
|
|
||||||
|
@ -111,8 +111,8 @@ func main() {
|
|||||||
// Serve GRPC Handlers
|
// Serve GRPC Handlers
|
||||||
api := http.NewServeMux()
|
api := http.NewServeMux()
|
||||||
api.Handle(withCORS(user.NewAuthHandler(db, env.Key)))
|
api.Handle(withCORS(user.NewAuthHandler(db, env.Key)))
|
||||||
api.Handle(withCORS(user.NewUserHandler(db, env.Key)))
|
api.Handle(withCORS(user.NewHandler(db, env.Key)))
|
||||||
api.Handle(withCORS(item.NewItemHandler(db, env.Key)))
|
api.Handle(withCORS(item.NewHandler(db, env.Key)))
|
||||||
|
|
||||||
// Serve web interface
|
// Serve web interface
|
||||||
mux := http.NewServeMux()
|
mux := http.NewServeMux()
|
||||||
|
27
server/revive.toml
Normal file
27
server/revive.toml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
ignoreGeneratedHeader = false
|
||||||
|
severity = "warning"
|
||||||
|
confidence = 0.8
|
||||||
|
errorCode = 0
|
||||||
|
warningCode = 0
|
||||||
|
|
||||||
|
[rule.blank-imports]
|
||||||
|
[rule.context-as-argument]
|
||||||
|
[rule.context-keys-type]
|
||||||
|
[rule.dot-imports]
|
||||||
|
[rule.error-return]
|
||||||
|
[rule.error-strings]
|
||||||
|
[rule.error-naming]
|
||||||
|
[rule.increment-decrement]
|
||||||
|
[rule.var-naming]
|
||||||
|
[rule.var-declaration]
|
||||||
|
[rule.range]
|
||||||
|
[rule.receiver-naming]
|
||||||
|
[rule.time-naming]
|
||||||
|
[rule.unexported-return]
|
||||||
|
[rule.indent-error-flow]
|
||||||
|
[rule.errorf]
|
||||||
|
[rule.empty-block]
|
||||||
|
[rule.superfluous-else]
|
||||||
|
[rule.unused-parameter]
|
||||||
|
[rule.unreachable-code]
|
||||||
|
[rule.redefines-builtin-id]
|
Loading…
x
Reference in New Issue
Block a user