mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-02 04:39:54 -05:00
moved search settings to frontend
This commit is contained in:
@@ -113,6 +113,7 @@ models/PatchedRecipe.ts
|
||||
models/PatchedRecipeBook.ts
|
||||
models/PatchedRecipeBookEntry.ts
|
||||
models/PatchedRecipeImport.ts
|
||||
models/PatchedSearchPreference.ts
|
||||
models/PatchedShoppingListEntry.ts
|
||||
models/PatchedShoppingListRecipe.ts
|
||||
models/PatchedSpace.ts
|
||||
@@ -141,6 +142,9 @@ models/RecipeImport.ts
|
||||
models/RecipeOverview.ts
|
||||
models/RecipeShoppingUpdate.ts
|
||||
models/RecipeSimple.ts
|
||||
models/SearchEnum.ts
|
||||
models/SearchFields.ts
|
||||
models/SearchPreference.ts
|
||||
models/ServerSettings.ts
|
||||
models/ShareLink.ts
|
||||
models/ShoppingListEntry.ts
|
||||
|
||||
@@ -109,6 +109,7 @@ import type {
|
||||
PatchedRecipeBook,
|
||||
PatchedRecipeBookEntry,
|
||||
PatchedRecipeImport,
|
||||
PatchedSearchPreference,
|
||||
PatchedShoppingListEntry,
|
||||
PatchedShoppingListRecipe,
|
||||
PatchedSpace,
|
||||
@@ -136,6 +137,8 @@ import type {
|
||||
RecipeImport,
|
||||
RecipeShoppingUpdate,
|
||||
RecipeSimple,
|
||||
SearchFields,
|
||||
SearchPreference,
|
||||
ServerSettings,
|
||||
ShareLink,
|
||||
ShoppingListEntry,
|
||||
@@ -347,6 +350,8 @@ import {
|
||||
PatchedRecipeBookEntryToJSON,
|
||||
PatchedRecipeImportFromJSON,
|
||||
PatchedRecipeImportToJSON,
|
||||
PatchedSearchPreferenceFromJSON,
|
||||
PatchedSearchPreferenceToJSON,
|
||||
PatchedShoppingListEntryFromJSON,
|
||||
PatchedShoppingListEntryToJSON,
|
||||
PatchedShoppingListRecipeFromJSON,
|
||||
@@ -401,6 +406,10 @@ import {
|
||||
RecipeShoppingUpdateToJSON,
|
||||
RecipeSimpleFromJSON,
|
||||
RecipeSimpleToJSON,
|
||||
SearchFieldsFromJSON,
|
||||
SearchFieldsToJSON,
|
||||
SearchPreferenceFromJSON,
|
||||
SearchPreferenceToJSON,
|
||||
ServerSettingsFromJSON,
|
||||
ServerSettingsToJSON,
|
||||
ShareLinkFromJSON,
|
||||
@@ -718,11 +727,11 @@ export interface ApiFoodUpdateRequest {
|
||||
}
|
||||
|
||||
export interface ApiGetExternalFileLinkRetrieveRequest {
|
||||
recipeId: number;
|
||||
id: number;
|
||||
}
|
||||
|
||||
export interface ApiGetRecipeFileRetrieveRequest {
|
||||
recipeId: number;
|
||||
id: number;
|
||||
}
|
||||
|
||||
export interface ApiGroupRetrieveRequest {
|
||||
@@ -1337,6 +1346,19 @@ export interface ApiRecipeUpdateRequest {
|
||||
recipe: Omit<Recipe, 'image'|'createdBy'|'createdAt'|'updatedAt'|'foodProperties'|'rating'|'lastCooked'>;
|
||||
}
|
||||
|
||||
export interface ApiSearchFieldsRetrieveRequest {
|
||||
id: number;
|
||||
}
|
||||
|
||||
export interface ApiSearchPreferencePartialUpdateRequest {
|
||||
user: number;
|
||||
patchedSearchPreference?: Omit<PatchedSearchPreference, 'user'>;
|
||||
}
|
||||
|
||||
export interface ApiSearchPreferenceRetrieveRequest {
|
||||
user: number;
|
||||
}
|
||||
|
||||
export interface ApiShareLinkRetrieveRequest {
|
||||
id: number;
|
||||
}
|
||||
@@ -4253,10 +4275,10 @@ export class ApiApi extends runtime.BaseAPI {
|
||||
/**
|
||||
*/
|
||||
async apiGetExternalFileLinkRetrieveRaw(requestParameters: ApiGetExternalFileLinkRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||
if (requestParameters['recipeId'] == null) {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'recipeId',
|
||||
'Required parameter "recipeId" was null or undefined when calling apiGetExternalFileLinkRetrieve().'
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiGetExternalFileLinkRetrieve().'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4269,7 +4291,7 @@ export class ApiApi extends runtime.BaseAPI {
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/api/get_external_file_link/{recipeId}/`.replace(`{${"recipeId"}}`, encodeURIComponent(String(requestParameters['recipeId']))),
|
||||
path: `/api/get_external_file_link/{id}/`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
@@ -4287,10 +4309,10 @@ export class ApiApi extends runtime.BaseAPI {
|
||||
/**
|
||||
*/
|
||||
async apiGetRecipeFileRetrieveRaw(requestParameters: ApiGetRecipeFileRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||
if (requestParameters['recipeId'] == null) {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'recipeId',
|
||||
'Required parameter "recipeId" was null or undefined when calling apiGetRecipeFileRetrieve().'
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiGetRecipeFileRetrieve().'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4303,7 +4325,7 @@ export class ApiApi extends runtime.BaseAPI {
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/api/get_recipe_file/{recipeId}/`.replace(`{${"recipeId"}}`, encodeURIComponent(String(requestParameters['recipeId']))),
|
||||
path: `/api/get_recipe_file/{id}/`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
@@ -9770,6 +9792,180 @@ export class ApiApi extends runtime.BaseAPI {
|
||||
await this.apiResetFoodInheritanceCreateRaw(initOverrides);
|
||||
}
|
||||
|
||||
/**
|
||||
* logs request counts to redis cache total/per user/
|
||||
*/
|
||||
async apiSearchFieldsListRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<SearchFields>>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/api/search-fields/`,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(SearchFieldsFromJSON));
|
||||
}
|
||||
|
||||
/**
|
||||
* logs request counts to redis cache total/per user/
|
||||
*/
|
||||
async apiSearchFieldsList(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<SearchFields>> {
|
||||
const response = await this.apiSearchFieldsListRaw(initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* logs request counts to redis cache total/per user/
|
||||
*/
|
||||
async apiSearchFieldsRetrieveRaw(requestParameters: ApiSearchFieldsRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SearchFields>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiSearchFieldsRetrieve().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/api/search-fields/{id}/`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => SearchFieldsFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* logs request counts to redis cache total/per user/
|
||||
*/
|
||||
async apiSearchFieldsRetrieve(requestParameters: ApiSearchFieldsRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SearchFields> {
|
||||
const response = await this.apiSearchFieldsRetrieveRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* logs request counts to redis cache total/per user/
|
||||
*/
|
||||
async apiSearchPreferenceListRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<SearchPreference>>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/api/search-preference/`,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(SearchPreferenceFromJSON));
|
||||
}
|
||||
|
||||
/**
|
||||
* logs request counts to redis cache total/per user/
|
||||
*/
|
||||
async apiSearchPreferenceList(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<SearchPreference>> {
|
||||
const response = await this.apiSearchPreferenceListRaw(initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* logs request counts to redis cache total/per user/
|
||||
*/
|
||||
async apiSearchPreferencePartialUpdateRaw(requestParameters: ApiSearchPreferencePartialUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SearchPreference>> {
|
||||
if (requestParameters['user'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'user',
|
||||
'Required parameter "user" was null or undefined when calling apiSearchPreferencePartialUpdate().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/api/search-preference/{user}/`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters['user']))),
|
||||
method: 'PATCH',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: PatchedSearchPreferenceToJSON(requestParameters['patchedSearchPreference']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => SearchPreferenceFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* logs request counts to redis cache total/per user/
|
||||
*/
|
||||
async apiSearchPreferencePartialUpdate(requestParameters: ApiSearchPreferencePartialUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SearchPreference> {
|
||||
const response = await this.apiSearchPreferencePartialUpdateRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* logs request counts to redis cache total/per user/
|
||||
*/
|
||||
async apiSearchPreferenceRetrieveRaw(requestParameters: ApiSearchPreferenceRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SearchPreference>> {
|
||||
if (requestParameters['user'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'user',
|
||||
'Required parameter "user" was null or undefined when calling apiSearchPreferenceRetrieve().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/api/search-preference/{user}/`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters['user']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => SearchPreferenceFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* logs request counts to redis cache total/per user/
|
||||
*/
|
||||
async apiSearchPreferenceRetrieve(requestParameters: ApiSearchPreferenceRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SearchPreference> {
|
||||
const response = await this.apiSearchPreferenceRetrieveRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiServerSettingsCurrentRetrieveRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ServerSettings>> {
|
||||
|
||||
142
vue3/src/openapi/models/PatchedSearchPreference.ts
Normal file
142
vue3/src/openapi/models/PatchedSearchPreference.ts
Normal file
@@ -0,0 +1,142 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Tandoor
|
||||
* Tandoor API Docs
|
||||
*
|
||||
* The version of the OpenAPI document: 0.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
import type { User } from './User';
|
||||
import {
|
||||
UserFromJSON,
|
||||
UserFromJSONTyped,
|
||||
UserToJSON,
|
||||
} from './User';
|
||||
import type { SearchFields } from './SearchFields';
|
||||
import {
|
||||
SearchFieldsFromJSON,
|
||||
SearchFieldsFromJSONTyped,
|
||||
SearchFieldsToJSON,
|
||||
} from './SearchFields';
|
||||
import type { SearchEnum } from './SearchEnum';
|
||||
import {
|
||||
SearchEnumFromJSON,
|
||||
SearchEnumFromJSONTyped,
|
||||
SearchEnumToJSON,
|
||||
} from './SearchEnum';
|
||||
|
||||
/**
|
||||
* Adds nested create feature
|
||||
* @export
|
||||
* @interface PatchedSearchPreference
|
||||
*/
|
||||
export interface PatchedSearchPreference {
|
||||
/**
|
||||
*
|
||||
* @type {User}
|
||||
* @memberof PatchedSearchPreference
|
||||
*/
|
||||
readonly user?: User;
|
||||
/**
|
||||
*
|
||||
* @type {SearchEnum}
|
||||
* @memberof PatchedSearchPreference
|
||||
*/
|
||||
search?: SearchEnum;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof PatchedSearchPreference
|
||||
*/
|
||||
lookup?: boolean;
|
||||
/**
|
||||
*
|
||||
* @type {Array<SearchFields>}
|
||||
* @memberof PatchedSearchPreference
|
||||
*/
|
||||
unaccent?: Array<SearchFields>;
|
||||
/**
|
||||
*
|
||||
* @type {Array<SearchFields>}
|
||||
* @memberof PatchedSearchPreference
|
||||
*/
|
||||
icontains?: Array<SearchFields>;
|
||||
/**
|
||||
*
|
||||
* @type {Array<SearchFields>}
|
||||
* @memberof PatchedSearchPreference
|
||||
*/
|
||||
istartswith?: Array<SearchFields>;
|
||||
/**
|
||||
*
|
||||
* @type {Array<SearchFields>}
|
||||
* @memberof PatchedSearchPreference
|
||||
*/
|
||||
trigram?: Array<SearchFields>;
|
||||
/**
|
||||
*
|
||||
* @type {Array<SearchFields>}
|
||||
* @memberof PatchedSearchPreference
|
||||
*/
|
||||
fulltext?: Array<SearchFields>;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof PatchedSearchPreference
|
||||
*/
|
||||
trigramThreshold?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the PatchedSearchPreference interface.
|
||||
*/
|
||||
export function instanceOfPatchedSearchPreference(value: object): value is PatchedSearchPreference {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function PatchedSearchPreferenceFromJSON(json: any): PatchedSearchPreference {
|
||||
return PatchedSearchPreferenceFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function PatchedSearchPreferenceFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedSearchPreference {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'user': json['user'] == null ? undefined : UserFromJSON(json['user']),
|
||||
'search': json['search'] == null ? undefined : SearchEnumFromJSON(json['search']),
|
||||
'lookup': json['lookup'] == null ? undefined : json['lookup'],
|
||||
'unaccent': json['unaccent'] == null ? undefined : ((json['unaccent'] as Array<any>).map(SearchFieldsFromJSON)),
|
||||
'icontains': json['icontains'] == null ? undefined : ((json['icontains'] as Array<any>).map(SearchFieldsFromJSON)),
|
||||
'istartswith': json['istartswith'] == null ? undefined : ((json['istartswith'] as Array<any>).map(SearchFieldsFromJSON)),
|
||||
'trigram': json['trigram'] == null ? undefined : ((json['trigram'] as Array<any>).map(SearchFieldsFromJSON)),
|
||||
'fulltext': json['fulltext'] == null ? undefined : ((json['fulltext'] as Array<any>).map(SearchFieldsFromJSON)),
|
||||
'trigramThreshold': json['trigram_threshold'] == null ? undefined : json['trigram_threshold'],
|
||||
};
|
||||
}
|
||||
|
||||
export function PatchedSearchPreferenceToJSON(value?: Omit<PatchedSearchPreference, 'user'> | null): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
|
||||
'search': SearchEnumToJSON(value['search']),
|
||||
'lookup': value['lookup'],
|
||||
'unaccent': value['unaccent'] == null ? undefined : ((value['unaccent'] as Array<any>).map(SearchFieldsToJSON)),
|
||||
'icontains': value['icontains'] == null ? undefined : ((value['icontains'] as Array<any>).map(SearchFieldsToJSON)),
|
||||
'istartswith': value['istartswith'] == null ? undefined : ((value['istartswith'] as Array<any>).map(SearchFieldsToJSON)),
|
||||
'trigram': value['trigram'] == null ? undefined : ((value['trigram'] as Array<any>).map(SearchFieldsToJSON)),
|
||||
'fulltext': value['fulltext'] == null ? undefined : ((value['fulltext'] as Array<any>).map(SearchFieldsToJSON)),
|
||||
'trigram_threshold': value['trigramThreshold'],
|
||||
};
|
||||
}
|
||||
|
||||
54
vue3/src/openapi/models/SearchEnum.ts
Normal file
54
vue3/src/openapi/models/SearchEnum.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Tandoor
|
||||
* Tandoor API Docs
|
||||
*
|
||||
* The version of the OpenAPI document: 0.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* * `plain` - Simple
|
||||
* * `phrase` - Phrase
|
||||
* * `websearch` - Web
|
||||
* * `raw` - Raw
|
||||
* @export
|
||||
*/
|
||||
export const SearchEnum = {
|
||||
Plain: 'plain',
|
||||
Phrase: 'phrase',
|
||||
Websearch: 'websearch',
|
||||
Raw: 'raw'
|
||||
} as const;
|
||||
export type SearchEnum = typeof SearchEnum[keyof typeof SearchEnum];
|
||||
|
||||
|
||||
export function instanceOfSearchEnum(value: any): boolean {
|
||||
for (const key in SearchEnum) {
|
||||
if (Object.prototype.hasOwnProperty.call(SearchEnum, key)) {
|
||||
if (SearchEnum[key] === value) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export function SearchEnumFromJSON(json: any): SearchEnum {
|
||||
return SearchEnumFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function SearchEnumFromJSONTyped(json: any, ignoreDiscriminator: boolean): SearchEnum {
|
||||
return json as SearchEnum;
|
||||
}
|
||||
|
||||
export function SearchEnumToJSON(value?: SearchEnum | null): any {
|
||||
return value as any;
|
||||
}
|
||||
|
||||
110
vue3/src/openapi/models/SearchFields.ts
Normal file
110
vue3/src/openapi/models/SearchFields.ts
Normal file
@@ -0,0 +1,110 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Tandoor
|
||||
* Tandoor API Docs
|
||||
*
|
||||
* The version of the OpenAPI document: 0.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
* Moves `UniqueValidator`'s from the validation stage to the save stage.
|
||||
* It solves the problem with nested validation for unique fields on update.
|
||||
*
|
||||
* If you want more details, you can read related issues and articles:
|
||||
* https://github.com/beda-software/drf-writable-nested/issues/1
|
||||
* http://www.django-rest-framework.org/api-guide/validators/#updating-nested-serializers
|
||||
*
|
||||
* Example of usage:
|
||||
* ```
|
||||
* class Child(models.Model):
|
||||
* field = models.CharField(unique=True)
|
||||
*
|
||||
*
|
||||
* class Parent(models.Model):
|
||||
* child = models.ForeignKey('Child')
|
||||
*
|
||||
*
|
||||
* class ChildSerializer(UniqueFieldsMixin, serializers.ModelSerializer):
|
||||
* class Meta:
|
||||
* model = Child
|
||||
*
|
||||
*
|
||||
* class ParentSerializer(NestedUpdateMixin, serializers.ModelSerializer):
|
||||
* child = ChildSerializer()
|
||||
*
|
||||
* class Meta:
|
||||
* model = Parent
|
||||
* ```
|
||||
*
|
||||
* Note: `UniqueFieldsMixin` must be applied only on the serializer
|
||||
* which has unique fields.
|
||||
*
|
||||
* Note: When you are using both mixins
|
||||
* (`UniqueFieldsMixin` and `NestedCreateMixin` or `NestedUpdateMixin`)
|
||||
* you should put `UniqueFieldsMixin` ahead.
|
||||
* @export
|
||||
* @interface SearchFields
|
||||
*/
|
||||
export interface SearchFields {
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof SearchFields
|
||||
*/
|
||||
id?: number;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof SearchFields
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof SearchFields
|
||||
*/
|
||||
field?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the SearchFields interface.
|
||||
*/
|
||||
export function instanceOfSearchFields(value: object): value is SearchFields {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function SearchFieldsFromJSON(json: any): SearchFields {
|
||||
return SearchFieldsFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function SearchFieldsFromJSONTyped(json: any, ignoreDiscriminator: boolean): SearchFields {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'id': json['id'] == null ? undefined : json['id'],
|
||||
'name': json['name'] == null ? undefined : json['name'],
|
||||
'field': json['field'] == null ? undefined : json['field'],
|
||||
};
|
||||
}
|
||||
|
||||
export function SearchFieldsToJSON(value?: SearchFields | null): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
|
||||
'id': value['id'],
|
||||
'name': value['name'],
|
||||
'field': value['field'],
|
||||
};
|
||||
}
|
||||
|
||||
143
vue3/src/openapi/models/SearchPreference.ts
Normal file
143
vue3/src/openapi/models/SearchPreference.ts
Normal file
@@ -0,0 +1,143 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Tandoor
|
||||
* Tandoor API Docs
|
||||
*
|
||||
* The version of the OpenAPI document: 0.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
import type { User } from './User';
|
||||
import {
|
||||
UserFromJSON,
|
||||
UserFromJSONTyped,
|
||||
UserToJSON,
|
||||
} from './User';
|
||||
import type { SearchFields } from './SearchFields';
|
||||
import {
|
||||
SearchFieldsFromJSON,
|
||||
SearchFieldsFromJSONTyped,
|
||||
SearchFieldsToJSON,
|
||||
} from './SearchFields';
|
||||
import type { SearchEnum } from './SearchEnum';
|
||||
import {
|
||||
SearchEnumFromJSON,
|
||||
SearchEnumFromJSONTyped,
|
||||
SearchEnumToJSON,
|
||||
} from './SearchEnum';
|
||||
|
||||
/**
|
||||
* Adds nested create feature
|
||||
* @export
|
||||
* @interface SearchPreference
|
||||
*/
|
||||
export interface SearchPreference {
|
||||
/**
|
||||
*
|
||||
* @type {User}
|
||||
* @memberof SearchPreference
|
||||
*/
|
||||
readonly user: User;
|
||||
/**
|
||||
*
|
||||
* @type {SearchEnum}
|
||||
* @memberof SearchPreference
|
||||
*/
|
||||
search?: SearchEnum;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof SearchPreference
|
||||
*/
|
||||
lookup?: boolean;
|
||||
/**
|
||||
*
|
||||
* @type {Array<SearchFields>}
|
||||
* @memberof SearchPreference
|
||||
*/
|
||||
unaccent?: Array<SearchFields>;
|
||||
/**
|
||||
*
|
||||
* @type {Array<SearchFields>}
|
||||
* @memberof SearchPreference
|
||||
*/
|
||||
icontains?: Array<SearchFields>;
|
||||
/**
|
||||
*
|
||||
* @type {Array<SearchFields>}
|
||||
* @memberof SearchPreference
|
||||
*/
|
||||
istartswith?: Array<SearchFields>;
|
||||
/**
|
||||
*
|
||||
* @type {Array<SearchFields>}
|
||||
* @memberof SearchPreference
|
||||
*/
|
||||
trigram?: Array<SearchFields>;
|
||||
/**
|
||||
*
|
||||
* @type {Array<SearchFields>}
|
||||
* @memberof SearchPreference
|
||||
*/
|
||||
fulltext?: Array<SearchFields>;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof SearchPreference
|
||||
*/
|
||||
trigramThreshold?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the SearchPreference interface.
|
||||
*/
|
||||
export function instanceOfSearchPreference(value: object): value is SearchPreference {
|
||||
if (!('user' in value) || value['user'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
export function SearchPreferenceFromJSON(json: any): SearchPreference {
|
||||
return SearchPreferenceFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function SearchPreferenceFromJSONTyped(json: any, ignoreDiscriminator: boolean): SearchPreference {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'user': UserFromJSON(json['user']),
|
||||
'search': json['search'] == null ? undefined : SearchEnumFromJSON(json['search']),
|
||||
'lookup': json['lookup'] == null ? undefined : json['lookup'],
|
||||
'unaccent': json['unaccent'] == null ? undefined : ((json['unaccent'] as Array<any>).map(SearchFieldsFromJSON)),
|
||||
'icontains': json['icontains'] == null ? undefined : ((json['icontains'] as Array<any>).map(SearchFieldsFromJSON)),
|
||||
'istartswith': json['istartswith'] == null ? undefined : ((json['istartswith'] as Array<any>).map(SearchFieldsFromJSON)),
|
||||
'trigram': json['trigram'] == null ? undefined : ((json['trigram'] as Array<any>).map(SearchFieldsFromJSON)),
|
||||
'fulltext': json['fulltext'] == null ? undefined : ((json['fulltext'] as Array<any>).map(SearchFieldsFromJSON)),
|
||||
'trigramThreshold': json['trigram_threshold'] == null ? undefined : json['trigram_threshold'],
|
||||
};
|
||||
}
|
||||
|
||||
export function SearchPreferenceToJSON(value?: Omit<SearchPreference, 'user'> | null): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
|
||||
'search': SearchEnumToJSON(value['search']),
|
||||
'lookup': value['lookup'],
|
||||
'unaccent': value['unaccent'] == null ? undefined : ((value['unaccent'] as Array<any>).map(SearchFieldsToJSON)),
|
||||
'icontains': value['icontains'] == null ? undefined : ((value['icontains'] as Array<any>).map(SearchFieldsToJSON)),
|
||||
'istartswith': value['istartswith'] == null ? undefined : ((value['istartswith'] as Array<any>).map(SearchFieldsToJSON)),
|
||||
'trigram': value['trigram'] == null ? undefined : ((value['trigram'] as Array<any>).map(SearchFieldsToJSON)),
|
||||
'fulltext': value['fulltext'] == null ? undefined : ((value['fulltext'] as Array<any>).map(SearchFieldsToJSON)),
|
||||
'trigram_threshold': value['trigramThreshold'],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -111,6 +111,7 @@ export * from './PatchedRecipe';
|
||||
export * from './PatchedRecipeBook';
|
||||
export * from './PatchedRecipeBookEntry';
|
||||
export * from './PatchedRecipeImport';
|
||||
export * from './PatchedSearchPreference';
|
||||
export * from './PatchedShoppingListEntry';
|
||||
export * from './PatchedShoppingListRecipe';
|
||||
export * from './PatchedSpace';
|
||||
@@ -139,6 +140,9 @@ export * from './RecipeImport';
|
||||
export * from './RecipeOverview';
|
||||
export * from './RecipeShoppingUpdate';
|
||||
export * from './RecipeSimple';
|
||||
export * from './SearchEnum';
|
||||
export * from './SearchFields';
|
||||
export * from './SearchPreference';
|
||||
export * from './ServerSettings';
|
||||
export * from './ShareLink';
|
||||
export * from './ShoppingListEntry';
|
||||
|
||||
Reference in New Issue
Block a user