1.4.3原版

This commit is contained in:
anian
2026-03-15 23:33:02 +08:00
commit 54fb39d15c
135 changed files with 14156 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
wwwroot/*.js
node_modules
typings
dist
+1
View File
@@ -0,0 +1 @@
# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm
@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
@@ -0,0 +1,38 @@
.gitignore
.npmignore
.openapi-generator-ignore
api.ts
api/api-friend-moony-la-v1alpha1-friend-post-api.ts
api/cron-friend-post-v1alpha1-api.ts
api/friend-post-v1alpha1-api.ts
api/rss-feed-sync-log-v1alpha1-api.ts
base.ts
common.ts
configuration.ts
git_push.sh
index.ts
models/add-operation.ts
models/channel.ts
models/copy-operation.ts
models/cron-friend-post-list.ts
models/cron-friend-post.ts
models/cron-spec.ts
models/cron-status.ts
models/friend-post-list.ts
models/friend-post-spec.ts
models/friend-post.ts
models/index.ts
models/item.ts
models/json-patch-inner.ts
models/link-spec.ts
models/link.ts
models/listed-rss-sync-log-list.ts
models/listed-rss-sync-log.ts
models/metadata.ts
models/move-operation.ts
models/remove-operation.ts
models/replace-operation.ts
models/rss-detail.ts
models/rss-feed-sync-log-list.ts
models/rss-feed-sync-log.ts
models/test-operation.ts
@@ -0,0 +1 @@
7.7.0
+21
View File
@@ -0,0 +1,21 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export * from './api/api-friend-moony-la-v1alpha1-friend-post-api';
export * from './api/cron-friend-post-v1alpha1-api';
export * from './api/friend-post-v1alpha1-api';
export * from './api/rss-feed-sync-log-v1alpha1-api';
@@ -0,0 +1,654 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import type { Configuration } from '../configuration';
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
// @ts-ignore
import type { FriendPostList } from '../models';
// @ts-ignore
import type { ListedRssSyncLogList } from '../models';
// @ts-ignore
import type { RssDetail } from '../models';
/**
* ApiFriendMoonyLaV1alpha1FriendPostApi - axios parameter creator
* @export
*/
export const ApiFriendMoonyLaV1alpha1FriendPostApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* Delete All RssFeedSyncLog.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteAllRssFeedSyncLog: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/apis/api.friend.moony.la/v1alpha1/friendposts/-/delete`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* List friendPost.
* @param {number} [page] Page number. Default is 0.
* @param {number} [size] Size number. Default is 0.
* @param {Array<string>} [labelSelector] Label selector. e.g.: hidden!&#x3D;true
* @param {Array<string>} [fieldSelector] Field selector. e.g.: metadata.name&#x3D;&#x3D;halo
* @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
* @param {string} [linkName] CronFriendPost filtered by linkName.
* @param {string} [keyword] CronFriendPost filtered by keyword.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listFriendPosts: async (page?: number, size?: number, labelSelector?: Array<string>, fieldSelector?: Array<string>, sort?: Array<string>, linkName?: string, keyword?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/apis/api.friend.moony.la/v1alpha1/friendposts`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (size !== undefined) {
localVarQueryParameter['size'] = size;
}
if (labelSelector) {
localVarQueryParameter['labelSelector'] = labelSelector;
}
if (fieldSelector) {
localVarQueryParameter['fieldSelector'] = fieldSelector;
}
if (sort) {
localVarQueryParameter['sort'] = sort;
}
if (linkName !== undefined) {
localVarQueryParameter['linkName'] = linkName;
}
if (keyword !== undefined) {
localVarQueryParameter['keyword'] = keyword;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* List RssSyncLog.
* @param {number} [page] Page number. Default is 0.
* @param {number} [size] Size number. Default is 0.
* @param {Array<string>} [labelSelector] Label selector. e.g.: hidden!&#x3D;true
* @param {Array<string>} [fieldSelector] Field selector. e.g.: metadata.name&#x3D;&#x3D;halo
* @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
* @param {string} [keyword]
* @param {string} [state]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listRssSyncLogs: async (page?: number, size?: number, labelSelector?: Array<string>, fieldSelector?: Array<string>, sort?: Array<string>, keyword?: string, state?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/apis/api.friend.moony.la/v1alpha1/rsssynclogs`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (size !== undefined) {
localVarQueryParameter['size'] = size;
}
if (labelSelector) {
localVarQueryParameter['labelSelector'] = labelSelector;
}
if (fieldSelector) {
localVarQueryParameter['fieldSelector'] = fieldSelector;
}
if (sort) {
localVarQueryParameter['sort'] = sort;
}
if (keyword !== undefined) {
localVarQueryParameter['keyword'] = keyword;
}
if (state !== undefined) {
localVarQueryParameter['state'] = state;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {string} rssUrl
* @param {string} [fetchLimitNumber]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
parsingRss: async (rssUrl: string, fetchLimitNumber?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'rssUrl' is not null or undefined
assertParamExists('parsingRss', 'rssUrl', rssUrl)
const localVarPath = `/apis/api.friend.moony.la/v1alpha1/parsingrss`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
if (rssUrl !== undefined) {
localVarQueryParameter['rssUrl'] = rssUrl;
}
if (fetchLimitNumber !== undefined) {
localVarQueryParameter['fetchLimitNumber'] = fetchLimitNumber;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {string} name
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
syncRssFeed: async (name: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'name' is not null or undefined
assertParamExists('syncRssFeed', 'name', name)
const localVarPath = `/apis/api.friend.moony.la/v1alpha1/syncrssfeed/{name}`
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* ApiFriendMoonyLaV1alpha1FriendPostApi - functional programming interface
* @export
*/
export const ApiFriendMoonyLaV1alpha1FriendPostApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = ApiFriendMoonyLaV1alpha1FriendPostApiAxiosParamCreator(configuration)
return {
/**
* Delete All RssFeedSyncLog.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async deleteAllRssFeedSyncLog(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteAllRssFeedSyncLog(options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['ApiFriendMoonyLaV1alpha1FriendPostApi.deleteAllRssFeedSyncLog']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* List friendPost.
* @param {number} [page] Page number. Default is 0.
* @param {number} [size] Size number. Default is 0.
* @param {Array<string>} [labelSelector] Label selector. e.g.: hidden!&#x3D;true
* @param {Array<string>} [fieldSelector] Field selector. e.g.: metadata.name&#x3D;&#x3D;halo
* @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
* @param {string} [linkName] CronFriendPost filtered by linkName.
* @param {string} [keyword] CronFriendPost filtered by keyword.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async listFriendPosts(page?: number, size?: number, labelSelector?: Array<string>, fieldSelector?: Array<string>, sort?: Array<string>, linkName?: string, keyword?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FriendPostList>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.listFriendPosts(page, size, labelSelector, fieldSelector, sort, linkName, keyword, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['ApiFriendMoonyLaV1alpha1FriendPostApi.listFriendPosts']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* List RssSyncLog.
* @param {number} [page] Page number. Default is 0.
* @param {number} [size] Size number. Default is 0.
* @param {Array<string>} [labelSelector] Label selector. e.g.: hidden!&#x3D;true
* @param {Array<string>} [fieldSelector] Field selector. e.g.: metadata.name&#x3D;&#x3D;halo
* @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
* @param {string} [keyword]
* @param {string} [state]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async listRssSyncLogs(page?: number, size?: number, labelSelector?: Array<string>, fieldSelector?: Array<string>, sort?: Array<string>, keyword?: string, state?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListedRssSyncLogList>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.listRssSyncLogs(page, size, labelSelector, fieldSelector, sort, keyword, state, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['ApiFriendMoonyLaV1alpha1FriendPostApi.listRssSyncLogs']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @param {string} rssUrl
* @param {string} [fetchLimitNumber]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async parsingRss(rssUrl: string, fetchLimitNumber?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RssDetail>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.parsingRss(rssUrl, fetchLimitNumber, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['ApiFriendMoonyLaV1alpha1FriendPostApi.parsingRss']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @param {string} name
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async syncRssFeed(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.syncRssFeed(name, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['ApiFriendMoonyLaV1alpha1FriendPostApi.syncRssFeed']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
}
};
/**
* ApiFriendMoonyLaV1alpha1FriendPostApi - factory interface
* @export
*/
export const ApiFriendMoonyLaV1alpha1FriendPostApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = ApiFriendMoonyLaV1alpha1FriendPostApiFp(configuration)
return {
/**
* Delete All RssFeedSyncLog.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteAllRssFeedSyncLog(options?: RawAxiosRequestConfig): AxiosPromise<void> {
return localVarFp.deleteAllRssFeedSyncLog(options).then((request) => request(axios, basePath));
},
/**
* List friendPost.
* @param {ApiFriendMoonyLaV1alpha1FriendPostApiListFriendPostsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listFriendPosts(requestParameters: ApiFriendMoonyLaV1alpha1FriendPostApiListFriendPostsRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise<FriendPostList> {
return localVarFp.listFriendPosts(requestParameters.page, requestParameters.size, requestParameters.labelSelector, requestParameters.fieldSelector, requestParameters.sort, requestParameters.linkName, requestParameters.keyword, options).then((request) => request(axios, basePath));
},
/**
* List RssSyncLog.
* @param {ApiFriendMoonyLaV1alpha1FriendPostApiListRssSyncLogsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listRssSyncLogs(requestParameters: ApiFriendMoonyLaV1alpha1FriendPostApiListRssSyncLogsRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise<ListedRssSyncLogList> {
return localVarFp.listRssSyncLogs(requestParameters.page, requestParameters.size, requestParameters.labelSelector, requestParameters.fieldSelector, requestParameters.sort, requestParameters.keyword, requestParameters.state, options).then((request) => request(axios, basePath));
},
/**
*
* @param {ApiFriendMoonyLaV1alpha1FriendPostApiParsingRssRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
parsingRss(requestParameters: ApiFriendMoonyLaV1alpha1FriendPostApiParsingRssRequest, options?: RawAxiosRequestConfig): AxiosPromise<RssDetail> {
return localVarFp.parsingRss(requestParameters.rssUrl, requestParameters.fetchLimitNumber, options).then((request) => request(axios, basePath));
},
/**
*
* @param {ApiFriendMoonyLaV1alpha1FriendPostApiSyncRssFeedRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
syncRssFeed(requestParameters: ApiFriendMoonyLaV1alpha1FriendPostApiSyncRssFeedRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
return localVarFp.syncRssFeed(requestParameters.name, options).then((request) => request(axios, basePath));
},
};
};
/**
* Request parameters for listFriendPosts operation in ApiFriendMoonyLaV1alpha1FriendPostApi.
* @export
* @interface ApiFriendMoonyLaV1alpha1FriendPostApiListFriendPostsRequest
*/
export interface ApiFriendMoonyLaV1alpha1FriendPostApiListFriendPostsRequest {
/**
* Page number. Default is 0.
* @type {number}
* @memberof ApiFriendMoonyLaV1alpha1FriendPostApiListFriendPosts
*/
readonly page?: number
/**
* Size number. Default is 0.
* @type {number}
* @memberof ApiFriendMoonyLaV1alpha1FriendPostApiListFriendPosts
*/
readonly size?: number
/**
* Label selector. e.g.: hidden!&#x3D;true
* @type {Array<string>}
* @memberof ApiFriendMoonyLaV1alpha1FriendPostApiListFriendPosts
*/
readonly labelSelector?: Array<string>
/**
* Field selector. e.g.: metadata.name&#x3D;&#x3D;halo
* @type {Array<string>}
* @memberof ApiFriendMoonyLaV1alpha1FriendPostApiListFriendPosts
*/
readonly fieldSelector?: Array<string>
/**
* Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
* @type {Array<string>}
* @memberof ApiFriendMoonyLaV1alpha1FriendPostApiListFriendPosts
*/
readonly sort?: Array<string>
/**
* CronFriendPost filtered by linkName.
* @type {string}
* @memberof ApiFriendMoonyLaV1alpha1FriendPostApiListFriendPosts
*/
readonly linkName?: string
/**
* CronFriendPost filtered by keyword.
* @type {string}
* @memberof ApiFriendMoonyLaV1alpha1FriendPostApiListFriendPosts
*/
readonly keyword?: string
}
/**
* Request parameters for listRssSyncLogs operation in ApiFriendMoonyLaV1alpha1FriendPostApi.
* @export
* @interface ApiFriendMoonyLaV1alpha1FriendPostApiListRssSyncLogsRequest
*/
export interface ApiFriendMoonyLaV1alpha1FriendPostApiListRssSyncLogsRequest {
/**
* Page number. Default is 0.
* @type {number}
* @memberof ApiFriendMoonyLaV1alpha1FriendPostApiListRssSyncLogs
*/
readonly page?: number
/**
* Size number. Default is 0.
* @type {number}
* @memberof ApiFriendMoonyLaV1alpha1FriendPostApiListRssSyncLogs
*/
readonly size?: number
/**
* Label selector. e.g.: hidden!&#x3D;true
* @type {Array<string>}
* @memberof ApiFriendMoonyLaV1alpha1FriendPostApiListRssSyncLogs
*/
readonly labelSelector?: Array<string>
/**
* Field selector. e.g.: metadata.name&#x3D;&#x3D;halo
* @type {Array<string>}
* @memberof ApiFriendMoonyLaV1alpha1FriendPostApiListRssSyncLogs
*/
readonly fieldSelector?: Array<string>
/**
* Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
* @type {Array<string>}
* @memberof ApiFriendMoonyLaV1alpha1FriendPostApiListRssSyncLogs
*/
readonly sort?: Array<string>
/**
*
* @type {string}
* @memberof ApiFriendMoonyLaV1alpha1FriendPostApiListRssSyncLogs
*/
readonly keyword?: string
/**
*
* @type {string}
* @memberof ApiFriendMoonyLaV1alpha1FriendPostApiListRssSyncLogs
*/
readonly state?: string
}
/**
* Request parameters for parsingRss operation in ApiFriendMoonyLaV1alpha1FriendPostApi.
* @export
* @interface ApiFriendMoonyLaV1alpha1FriendPostApiParsingRssRequest
*/
export interface ApiFriendMoonyLaV1alpha1FriendPostApiParsingRssRequest {
/**
*
* @type {string}
* @memberof ApiFriendMoonyLaV1alpha1FriendPostApiParsingRss
*/
readonly rssUrl: string
/**
*
* @type {string}
* @memberof ApiFriendMoonyLaV1alpha1FriendPostApiParsingRss
*/
readonly fetchLimitNumber?: string
}
/**
* Request parameters for syncRssFeed operation in ApiFriendMoonyLaV1alpha1FriendPostApi.
* @export
* @interface ApiFriendMoonyLaV1alpha1FriendPostApiSyncRssFeedRequest
*/
export interface ApiFriendMoonyLaV1alpha1FriendPostApiSyncRssFeedRequest {
/**
*
* @type {string}
* @memberof ApiFriendMoonyLaV1alpha1FriendPostApiSyncRssFeed
*/
readonly name: string
}
/**
* ApiFriendMoonyLaV1alpha1FriendPostApi - object-oriented interface
* @export
* @class ApiFriendMoonyLaV1alpha1FriendPostApi
* @extends {BaseAPI}
*/
export class ApiFriendMoonyLaV1alpha1FriendPostApi extends BaseAPI {
/**
* Delete All RssFeedSyncLog.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiFriendMoonyLaV1alpha1FriendPostApi
*/
public deleteAllRssFeedSyncLog(options?: RawAxiosRequestConfig) {
return ApiFriendMoonyLaV1alpha1FriendPostApiFp(this.configuration).deleteAllRssFeedSyncLog(options).then((request) => request(this.axios, this.basePath));
}
/**
* List friendPost.
* @param {ApiFriendMoonyLaV1alpha1FriendPostApiListFriendPostsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiFriendMoonyLaV1alpha1FriendPostApi
*/
public listFriendPosts(requestParameters: ApiFriendMoonyLaV1alpha1FriendPostApiListFriendPostsRequest = {}, options?: RawAxiosRequestConfig) {
return ApiFriendMoonyLaV1alpha1FriendPostApiFp(this.configuration).listFriendPosts(requestParameters.page, requestParameters.size, requestParameters.labelSelector, requestParameters.fieldSelector, requestParameters.sort, requestParameters.linkName, requestParameters.keyword, options).then((request) => request(this.axios, this.basePath));
}
/**
* List RssSyncLog.
* @param {ApiFriendMoonyLaV1alpha1FriendPostApiListRssSyncLogsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiFriendMoonyLaV1alpha1FriendPostApi
*/
public listRssSyncLogs(requestParameters: ApiFriendMoonyLaV1alpha1FriendPostApiListRssSyncLogsRequest = {}, options?: RawAxiosRequestConfig) {
return ApiFriendMoonyLaV1alpha1FriendPostApiFp(this.configuration).listRssSyncLogs(requestParameters.page, requestParameters.size, requestParameters.labelSelector, requestParameters.fieldSelector, requestParameters.sort, requestParameters.keyword, requestParameters.state, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {ApiFriendMoonyLaV1alpha1FriendPostApiParsingRssRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiFriendMoonyLaV1alpha1FriendPostApi
*/
public parsingRss(requestParameters: ApiFriendMoonyLaV1alpha1FriendPostApiParsingRssRequest, options?: RawAxiosRequestConfig) {
return ApiFriendMoonyLaV1alpha1FriendPostApiFp(this.configuration).parsingRss(requestParameters.rssUrl, requestParameters.fetchLimitNumber, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {ApiFriendMoonyLaV1alpha1FriendPostApiSyncRssFeedRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiFriendMoonyLaV1alpha1FriendPostApi
*/
public syncRssFeed(requestParameters: ApiFriendMoonyLaV1alpha1FriendPostApiSyncRssFeedRequest, options?: RawAxiosRequestConfig) {
return ApiFriendMoonyLaV1alpha1FriendPostApiFp(this.configuration).syncRssFeed(requestParameters.name, options).then((request) => request(this.axios, this.basePath));
}
}
@@ -0,0 +1,665 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import type { Configuration } from '../configuration';
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
// @ts-ignore
import type { CronFriendPost } from '../models';
// @ts-ignore
import type { CronFriendPostList } from '../models';
// @ts-ignore
import type { JsonPatchInner } from '../models';
/**
* CronFriendPostV1alpha1Api - axios parameter creator
* @export
*/
export const CronFriendPostV1alpha1ApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* Create CronFriendPost
* @param {CronFriendPost} [cronFriendPost] Fresh cronfriendpost
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createCronFriendPost: async (cronFriendPost?: CronFriendPost, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/apis/friend.moony.la/v1alpha1/cronfriendposts`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(cronFriendPost, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Delete CronFriendPost
* @param {string} name Name of cronfriendpost
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteCronFriendPost: async (name: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'name' is not null or undefined
assertParamExists('deleteCronFriendPost', 'name', name)
const localVarPath = `/apis/friend.moony.la/v1alpha1/cronfriendposts/{name}`
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get CronFriendPost
* @param {string} name Name of cronfriendpost
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCronFriendPost: async (name: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'name' is not null or undefined
assertParamExists('getCronFriendPost', 'name', name)
const localVarPath = `/apis/friend.moony.la/v1alpha1/cronfriendposts/{name}`
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* List CronFriendPost
* @param {number} [page] Page number. Default is 0.
* @param {number} [size] Size number. Default is 0.
* @param {Array<string>} [labelSelector] Label selector. e.g.: hidden!&#x3D;true
* @param {Array<string>} [fieldSelector] Field selector. e.g.: metadata.name&#x3D;&#x3D;halo
* @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listCronFriendPost: async (page?: number, size?: number, labelSelector?: Array<string>, fieldSelector?: Array<string>, sort?: Array<string>, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/apis/friend.moony.la/v1alpha1/cronfriendposts`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (size !== undefined) {
localVarQueryParameter['size'] = size;
}
if (labelSelector) {
localVarQueryParameter['labelSelector'] = labelSelector;
}
if (fieldSelector) {
localVarQueryParameter['fieldSelector'] = fieldSelector;
}
if (sort) {
localVarQueryParameter['sort'] = sort;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Patch CronFriendPost
* @param {string} name Name of cronfriendpost
* @param {Array<JsonPatchInner>} [jsonPatchInner]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
patchCronFriendPost: async (name: string, jsonPatchInner?: Array<JsonPatchInner>, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'name' is not null or undefined
assertParamExists('patchCronFriendPost', 'name', name)
const localVarPath = `/apis/friend.moony.la/v1alpha1/cronfriendposts/{name}`
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(jsonPatchInner, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Update CronFriendPost
* @param {string} name Name of cronfriendpost
* @param {CronFriendPost} [cronFriendPost] Updated cronfriendpost
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateCronFriendPost: async (name: string, cronFriendPost?: CronFriendPost, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'name' is not null or undefined
assertParamExists('updateCronFriendPost', 'name', name)
const localVarPath = `/apis/friend.moony.la/v1alpha1/cronfriendposts/{name}`
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(cronFriendPost, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* CronFriendPostV1alpha1Api - functional programming interface
* @export
*/
export const CronFriendPostV1alpha1ApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = CronFriendPostV1alpha1ApiAxiosParamCreator(configuration)
return {
/**
* Create CronFriendPost
* @param {CronFriendPost} [cronFriendPost] Fresh cronfriendpost
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createCronFriendPost(cronFriendPost?: CronFriendPost, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CronFriendPost>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createCronFriendPost(cronFriendPost, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['CronFriendPostV1alpha1Api.createCronFriendPost']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Delete CronFriendPost
* @param {string} name Name of cronfriendpost
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async deleteCronFriendPost(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteCronFriendPost(name, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['CronFriendPostV1alpha1Api.deleteCronFriendPost']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Get CronFriendPost
* @param {string} name Name of cronfriendpost
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getCronFriendPost(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CronFriendPost>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getCronFriendPost(name, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['CronFriendPostV1alpha1Api.getCronFriendPost']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* List CronFriendPost
* @param {number} [page] Page number. Default is 0.
* @param {number} [size] Size number. Default is 0.
* @param {Array<string>} [labelSelector] Label selector. e.g.: hidden!&#x3D;true
* @param {Array<string>} [fieldSelector] Field selector. e.g.: metadata.name&#x3D;&#x3D;halo
* @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async listCronFriendPost(page?: number, size?: number, labelSelector?: Array<string>, fieldSelector?: Array<string>, sort?: Array<string>, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CronFriendPostList>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.listCronFriendPost(page, size, labelSelector, fieldSelector, sort, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['CronFriendPostV1alpha1Api.listCronFriendPost']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Patch CronFriendPost
* @param {string} name Name of cronfriendpost
* @param {Array<JsonPatchInner>} [jsonPatchInner]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async patchCronFriendPost(name: string, jsonPatchInner?: Array<JsonPatchInner>, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CronFriendPost>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.patchCronFriendPost(name, jsonPatchInner, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['CronFriendPostV1alpha1Api.patchCronFriendPost']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Update CronFriendPost
* @param {string} name Name of cronfriendpost
* @param {CronFriendPost} [cronFriendPost] Updated cronfriendpost
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async updateCronFriendPost(name: string, cronFriendPost?: CronFriendPost, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CronFriendPost>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.updateCronFriendPost(name, cronFriendPost, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['CronFriendPostV1alpha1Api.updateCronFriendPost']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
}
};
/**
* CronFriendPostV1alpha1Api - factory interface
* @export
*/
export const CronFriendPostV1alpha1ApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = CronFriendPostV1alpha1ApiFp(configuration)
return {
/**
* Create CronFriendPost
* @param {CronFriendPostV1alpha1ApiCreateCronFriendPostRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createCronFriendPost(requestParameters: CronFriendPostV1alpha1ApiCreateCronFriendPostRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise<CronFriendPost> {
return localVarFp.createCronFriendPost(requestParameters.cronFriendPost, options).then((request) => request(axios, basePath));
},
/**
* Delete CronFriendPost
* @param {CronFriendPostV1alpha1ApiDeleteCronFriendPostRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteCronFriendPost(requestParameters: CronFriendPostV1alpha1ApiDeleteCronFriendPostRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
return localVarFp.deleteCronFriendPost(requestParameters.name, options).then((request) => request(axios, basePath));
},
/**
* Get CronFriendPost
* @param {CronFriendPostV1alpha1ApiGetCronFriendPostRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCronFriendPost(requestParameters: CronFriendPostV1alpha1ApiGetCronFriendPostRequest, options?: RawAxiosRequestConfig): AxiosPromise<CronFriendPost> {
return localVarFp.getCronFriendPost(requestParameters.name, options).then((request) => request(axios, basePath));
},
/**
* List CronFriendPost
* @param {CronFriendPostV1alpha1ApiListCronFriendPostRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listCronFriendPost(requestParameters: CronFriendPostV1alpha1ApiListCronFriendPostRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise<CronFriendPostList> {
return localVarFp.listCronFriendPost(requestParameters.page, requestParameters.size, requestParameters.labelSelector, requestParameters.fieldSelector, requestParameters.sort, options).then((request) => request(axios, basePath));
},
/**
* Patch CronFriendPost
* @param {CronFriendPostV1alpha1ApiPatchCronFriendPostRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
patchCronFriendPost(requestParameters: CronFriendPostV1alpha1ApiPatchCronFriendPostRequest, options?: RawAxiosRequestConfig): AxiosPromise<CronFriendPost> {
return localVarFp.patchCronFriendPost(requestParameters.name, requestParameters.jsonPatchInner, options).then((request) => request(axios, basePath));
},
/**
* Update CronFriendPost
* @param {CronFriendPostV1alpha1ApiUpdateCronFriendPostRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateCronFriendPost(requestParameters: CronFriendPostV1alpha1ApiUpdateCronFriendPostRequest, options?: RawAxiosRequestConfig): AxiosPromise<CronFriendPost> {
return localVarFp.updateCronFriendPost(requestParameters.name, requestParameters.cronFriendPost, options).then((request) => request(axios, basePath));
},
};
};
/**
* Request parameters for createCronFriendPost operation in CronFriendPostV1alpha1Api.
* @export
* @interface CronFriendPostV1alpha1ApiCreateCronFriendPostRequest
*/
export interface CronFriendPostV1alpha1ApiCreateCronFriendPostRequest {
/**
* Fresh cronfriendpost
* @type {CronFriendPost}
* @memberof CronFriendPostV1alpha1ApiCreateCronFriendPost
*/
readonly cronFriendPost?: CronFriendPost
}
/**
* Request parameters for deleteCronFriendPost operation in CronFriendPostV1alpha1Api.
* @export
* @interface CronFriendPostV1alpha1ApiDeleteCronFriendPostRequest
*/
export interface CronFriendPostV1alpha1ApiDeleteCronFriendPostRequest {
/**
* Name of cronfriendpost
* @type {string}
* @memberof CronFriendPostV1alpha1ApiDeleteCronFriendPost
*/
readonly name: string
}
/**
* Request parameters for getCronFriendPost operation in CronFriendPostV1alpha1Api.
* @export
* @interface CronFriendPostV1alpha1ApiGetCronFriendPostRequest
*/
export interface CronFriendPostV1alpha1ApiGetCronFriendPostRequest {
/**
* Name of cronfriendpost
* @type {string}
* @memberof CronFriendPostV1alpha1ApiGetCronFriendPost
*/
readonly name: string
}
/**
* Request parameters for listCronFriendPost operation in CronFriendPostV1alpha1Api.
* @export
* @interface CronFriendPostV1alpha1ApiListCronFriendPostRequest
*/
export interface CronFriendPostV1alpha1ApiListCronFriendPostRequest {
/**
* Page number. Default is 0.
* @type {number}
* @memberof CronFriendPostV1alpha1ApiListCronFriendPost
*/
readonly page?: number
/**
* Size number. Default is 0.
* @type {number}
* @memberof CronFriendPostV1alpha1ApiListCronFriendPost
*/
readonly size?: number
/**
* Label selector. e.g.: hidden!&#x3D;true
* @type {Array<string>}
* @memberof CronFriendPostV1alpha1ApiListCronFriendPost
*/
readonly labelSelector?: Array<string>
/**
* Field selector. e.g.: metadata.name&#x3D;&#x3D;halo
* @type {Array<string>}
* @memberof CronFriendPostV1alpha1ApiListCronFriendPost
*/
readonly fieldSelector?: Array<string>
/**
* Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
* @type {Array<string>}
* @memberof CronFriendPostV1alpha1ApiListCronFriendPost
*/
readonly sort?: Array<string>
}
/**
* Request parameters for patchCronFriendPost operation in CronFriendPostV1alpha1Api.
* @export
* @interface CronFriendPostV1alpha1ApiPatchCronFriendPostRequest
*/
export interface CronFriendPostV1alpha1ApiPatchCronFriendPostRequest {
/**
* Name of cronfriendpost
* @type {string}
* @memberof CronFriendPostV1alpha1ApiPatchCronFriendPost
*/
readonly name: string
/**
*
* @type {Array<JsonPatchInner>}
* @memberof CronFriendPostV1alpha1ApiPatchCronFriendPost
*/
readonly jsonPatchInner?: Array<JsonPatchInner>
}
/**
* Request parameters for updateCronFriendPost operation in CronFriendPostV1alpha1Api.
* @export
* @interface CronFriendPostV1alpha1ApiUpdateCronFriendPostRequest
*/
export interface CronFriendPostV1alpha1ApiUpdateCronFriendPostRequest {
/**
* Name of cronfriendpost
* @type {string}
* @memberof CronFriendPostV1alpha1ApiUpdateCronFriendPost
*/
readonly name: string
/**
* Updated cronfriendpost
* @type {CronFriendPost}
* @memberof CronFriendPostV1alpha1ApiUpdateCronFriendPost
*/
readonly cronFriendPost?: CronFriendPost
}
/**
* CronFriendPostV1alpha1Api - object-oriented interface
* @export
* @class CronFriendPostV1alpha1Api
* @extends {BaseAPI}
*/
export class CronFriendPostV1alpha1Api extends BaseAPI {
/**
* Create CronFriendPost
* @param {CronFriendPostV1alpha1ApiCreateCronFriendPostRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CronFriendPostV1alpha1Api
*/
public createCronFriendPost(requestParameters: CronFriendPostV1alpha1ApiCreateCronFriendPostRequest = {}, options?: RawAxiosRequestConfig) {
return CronFriendPostV1alpha1ApiFp(this.configuration).createCronFriendPost(requestParameters.cronFriendPost, options).then((request) => request(this.axios, this.basePath));
}
/**
* Delete CronFriendPost
* @param {CronFriendPostV1alpha1ApiDeleteCronFriendPostRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CronFriendPostV1alpha1Api
*/
public deleteCronFriendPost(requestParameters: CronFriendPostV1alpha1ApiDeleteCronFriendPostRequest, options?: RawAxiosRequestConfig) {
return CronFriendPostV1alpha1ApiFp(this.configuration).deleteCronFriendPost(requestParameters.name, options).then((request) => request(this.axios, this.basePath));
}
/**
* Get CronFriendPost
* @param {CronFriendPostV1alpha1ApiGetCronFriendPostRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CronFriendPostV1alpha1Api
*/
public getCronFriendPost(requestParameters: CronFriendPostV1alpha1ApiGetCronFriendPostRequest, options?: RawAxiosRequestConfig) {
return CronFriendPostV1alpha1ApiFp(this.configuration).getCronFriendPost(requestParameters.name, options).then((request) => request(this.axios, this.basePath));
}
/**
* List CronFriendPost
* @param {CronFriendPostV1alpha1ApiListCronFriendPostRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CronFriendPostV1alpha1Api
*/
public listCronFriendPost(requestParameters: CronFriendPostV1alpha1ApiListCronFriendPostRequest = {}, options?: RawAxiosRequestConfig) {
return CronFriendPostV1alpha1ApiFp(this.configuration).listCronFriendPost(requestParameters.page, requestParameters.size, requestParameters.labelSelector, requestParameters.fieldSelector, requestParameters.sort, options).then((request) => request(this.axios, this.basePath));
}
/**
* Patch CronFriendPost
* @param {CronFriendPostV1alpha1ApiPatchCronFriendPostRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CronFriendPostV1alpha1Api
*/
public patchCronFriendPost(requestParameters: CronFriendPostV1alpha1ApiPatchCronFriendPostRequest, options?: RawAxiosRequestConfig) {
return CronFriendPostV1alpha1ApiFp(this.configuration).patchCronFriendPost(requestParameters.name, requestParameters.jsonPatchInner, options).then((request) => request(this.axios, this.basePath));
}
/**
* Update CronFriendPost
* @param {CronFriendPostV1alpha1ApiUpdateCronFriendPostRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CronFriendPostV1alpha1Api
*/
public updateCronFriendPost(requestParameters: CronFriendPostV1alpha1ApiUpdateCronFriendPostRequest, options?: RawAxiosRequestConfig) {
return CronFriendPostV1alpha1ApiFp(this.configuration).updateCronFriendPost(requestParameters.name, requestParameters.cronFriendPost, options).then((request) => request(this.axios, this.basePath));
}
}
@@ -0,0 +1,665 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import type { Configuration } from '../configuration';
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
// @ts-ignore
import type { FriendPost } from '../models';
// @ts-ignore
import type { FriendPostList } from '../models';
// @ts-ignore
import type { JsonPatchInner } from '../models';
/**
* FriendPostV1alpha1Api - axios parameter creator
* @export
*/
export const FriendPostV1alpha1ApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* Create FriendPost
* @param {FriendPost} [friendPost] Fresh friendpost
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createFriendPost: async (friendPost?: FriendPost, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/apis/friend.moony.la/v1alpha1/friendposts`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(friendPost, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Delete FriendPost
* @param {string} name Name of friendpost
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteFriendPost: async (name: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'name' is not null or undefined
assertParamExists('deleteFriendPost', 'name', name)
const localVarPath = `/apis/friend.moony.la/v1alpha1/friendposts/{name}`
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get FriendPost
* @param {string} name Name of friendpost
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getFriendPost: async (name: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'name' is not null or undefined
assertParamExists('getFriendPost', 'name', name)
const localVarPath = `/apis/friend.moony.la/v1alpha1/friendposts/{name}`
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* List FriendPost
* @param {number} [page] Page number. Default is 0.
* @param {number} [size] Size number. Default is 0.
* @param {Array<string>} [labelSelector] Label selector. e.g.: hidden!&#x3D;true
* @param {Array<string>} [fieldSelector] Field selector. e.g.: metadata.name&#x3D;&#x3D;halo
* @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listFriendPost: async (page?: number, size?: number, labelSelector?: Array<string>, fieldSelector?: Array<string>, sort?: Array<string>, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/apis/friend.moony.la/v1alpha1/friendposts`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (size !== undefined) {
localVarQueryParameter['size'] = size;
}
if (labelSelector) {
localVarQueryParameter['labelSelector'] = labelSelector;
}
if (fieldSelector) {
localVarQueryParameter['fieldSelector'] = fieldSelector;
}
if (sort) {
localVarQueryParameter['sort'] = sort;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Patch FriendPost
* @param {string} name Name of friendpost
* @param {Array<JsonPatchInner>} [jsonPatchInner]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
patchFriendPost: async (name: string, jsonPatchInner?: Array<JsonPatchInner>, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'name' is not null or undefined
assertParamExists('patchFriendPost', 'name', name)
const localVarPath = `/apis/friend.moony.la/v1alpha1/friendposts/{name}`
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(jsonPatchInner, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Update FriendPost
* @param {string} name Name of friendpost
* @param {FriendPost} [friendPost] Updated friendpost
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateFriendPost: async (name: string, friendPost?: FriendPost, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'name' is not null or undefined
assertParamExists('updateFriendPost', 'name', name)
const localVarPath = `/apis/friend.moony.la/v1alpha1/friendposts/{name}`
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(friendPost, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* FriendPostV1alpha1Api - functional programming interface
* @export
*/
export const FriendPostV1alpha1ApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = FriendPostV1alpha1ApiAxiosParamCreator(configuration)
return {
/**
* Create FriendPost
* @param {FriendPost} [friendPost] Fresh friendpost
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createFriendPost(friendPost?: FriendPost, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FriendPost>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createFriendPost(friendPost, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['FriendPostV1alpha1Api.createFriendPost']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Delete FriendPost
* @param {string} name Name of friendpost
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async deleteFriendPost(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteFriendPost(name, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['FriendPostV1alpha1Api.deleteFriendPost']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Get FriendPost
* @param {string} name Name of friendpost
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getFriendPost(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FriendPost>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getFriendPost(name, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['FriendPostV1alpha1Api.getFriendPost']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* List FriendPost
* @param {number} [page] Page number. Default is 0.
* @param {number} [size] Size number. Default is 0.
* @param {Array<string>} [labelSelector] Label selector. e.g.: hidden!&#x3D;true
* @param {Array<string>} [fieldSelector] Field selector. e.g.: metadata.name&#x3D;&#x3D;halo
* @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async listFriendPost(page?: number, size?: number, labelSelector?: Array<string>, fieldSelector?: Array<string>, sort?: Array<string>, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FriendPostList>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.listFriendPost(page, size, labelSelector, fieldSelector, sort, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['FriendPostV1alpha1Api.listFriendPost']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Patch FriendPost
* @param {string} name Name of friendpost
* @param {Array<JsonPatchInner>} [jsonPatchInner]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async patchFriendPost(name: string, jsonPatchInner?: Array<JsonPatchInner>, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FriendPost>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.patchFriendPost(name, jsonPatchInner, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['FriendPostV1alpha1Api.patchFriendPost']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Update FriendPost
* @param {string} name Name of friendpost
* @param {FriendPost} [friendPost] Updated friendpost
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async updateFriendPost(name: string, friendPost?: FriendPost, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FriendPost>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.updateFriendPost(name, friendPost, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['FriendPostV1alpha1Api.updateFriendPost']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
}
};
/**
* FriendPostV1alpha1Api - factory interface
* @export
*/
export const FriendPostV1alpha1ApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = FriendPostV1alpha1ApiFp(configuration)
return {
/**
* Create FriendPost
* @param {FriendPostV1alpha1ApiCreateFriendPostRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createFriendPost(requestParameters: FriendPostV1alpha1ApiCreateFriendPostRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise<FriendPost> {
return localVarFp.createFriendPost(requestParameters.friendPost, options).then((request) => request(axios, basePath));
},
/**
* Delete FriendPost
* @param {FriendPostV1alpha1ApiDeleteFriendPostRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteFriendPost(requestParameters: FriendPostV1alpha1ApiDeleteFriendPostRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
return localVarFp.deleteFriendPost(requestParameters.name, options).then((request) => request(axios, basePath));
},
/**
* Get FriendPost
* @param {FriendPostV1alpha1ApiGetFriendPostRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getFriendPost(requestParameters: FriendPostV1alpha1ApiGetFriendPostRequest, options?: RawAxiosRequestConfig): AxiosPromise<FriendPost> {
return localVarFp.getFriendPost(requestParameters.name, options).then((request) => request(axios, basePath));
},
/**
* List FriendPost
* @param {FriendPostV1alpha1ApiListFriendPostRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listFriendPost(requestParameters: FriendPostV1alpha1ApiListFriendPostRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise<FriendPostList> {
return localVarFp.listFriendPost(requestParameters.page, requestParameters.size, requestParameters.labelSelector, requestParameters.fieldSelector, requestParameters.sort, options).then((request) => request(axios, basePath));
},
/**
* Patch FriendPost
* @param {FriendPostV1alpha1ApiPatchFriendPostRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
patchFriendPost(requestParameters: FriendPostV1alpha1ApiPatchFriendPostRequest, options?: RawAxiosRequestConfig): AxiosPromise<FriendPost> {
return localVarFp.patchFriendPost(requestParameters.name, requestParameters.jsonPatchInner, options).then((request) => request(axios, basePath));
},
/**
* Update FriendPost
* @param {FriendPostV1alpha1ApiUpdateFriendPostRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateFriendPost(requestParameters: FriendPostV1alpha1ApiUpdateFriendPostRequest, options?: RawAxiosRequestConfig): AxiosPromise<FriendPost> {
return localVarFp.updateFriendPost(requestParameters.name, requestParameters.friendPost, options).then((request) => request(axios, basePath));
},
};
};
/**
* Request parameters for createFriendPost operation in FriendPostV1alpha1Api.
* @export
* @interface FriendPostV1alpha1ApiCreateFriendPostRequest
*/
export interface FriendPostV1alpha1ApiCreateFriendPostRequest {
/**
* Fresh friendpost
* @type {FriendPost}
* @memberof FriendPostV1alpha1ApiCreateFriendPost
*/
readonly friendPost?: FriendPost
}
/**
* Request parameters for deleteFriendPost operation in FriendPostV1alpha1Api.
* @export
* @interface FriendPostV1alpha1ApiDeleteFriendPostRequest
*/
export interface FriendPostV1alpha1ApiDeleteFriendPostRequest {
/**
* Name of friendpost
* @type {string}
* @memberof FriendPostV1alpha1ApiDeleteFriendPost
*/
readonly name: string
}
/**
* Request parameters for getFriendPost operation in FriendPostV1alpha1Api.
* @export
* @interface FriendPostV1alpha1ApiGetFriendPostRequest
*/
export interface FriendPostV1alpha1ApiGetFriendPostRequest {
/**
* Name of friendpost
* @type {string}
* @memberof FriendPostV1alpha1ApiGetFriendPost
*/
readonly name: string
}
/**
* Request parameters for listFriendPost operation in FriendPostV1alpha1Api.
* @export
* @interface FriendPostV1alpha1ApiListFriendPostRequest
*/
export interface FriendPostV1alpha1ApiListFriendPostRequest {
/**
* Page number. Default is 0.
* @type {number}
* @memberof FriendPostV1alpha1ApiListFriendPost
*/
readonly page?: number
/**
* Size number. Default is 0.
* @type {number}
* @memberof FriendPostV1alpha1ApiListFriendPost
*/
readonly size?: number
/**
* Label selector. e.g.: hidden!&#x3D;true
* @type {Array<string>}
* @memberof FriendPostV1alpha1ApiListFriendPost
*/
readonly labelSelector?: Array<string>
/**
* Field selector. e.g.: metadata.name&#x3D;&#x3D;halo
* @type {Array<string>}
* @memberof FriendPostV1alpha1ApiListFriendPost
*/
readonly fieldSelector?: Array<string>
/**
* Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
* @type {Array<string>}
* @memberof FriendPostV1alpha1ApiListFriendPost
*/
readonly sort?: Array<string>
}
/**
* Request parameters for patchFriendPost operation in FriendPostV1alpha1Api.
* @export
* @interface FriendPostV1alpha1ApiPatchFriendPostRequest
*/
export interface FriendPostV1alpha1ApiPatchFriendPostRequest {
/**
* Name of friendpost
* @type {string}
* @memberof FriendPostV1alpha1ApiPatchFriendPost
*/
readonly name: string
/**
*
* @type {Array<JsonPatchInner>}
* @memberof FriendPostV1alpha1ApiPatchFriendPost
*/
readonly jsonPatchInner?: Array<JsonPatchInner>
}
/**
* Request parameters for updateFriendPost operation in FriendPostV1alpha1Api.
* @export
* @interface FriendPostV1alpha1ApiUpdateFriendPostRequest
*/
export interface FriendPostV1alpha1ApiUpdateFriendPostRequest {
/**
* Name of friendpost
* @type {string}
* @memberof FriendPostV1alpha1ApiUpdateFriendPost
*/
readonly name: string
/**
* Updated friendpost
* @type {FriendPost}
* @memberof FriendPostV1alpha1ApiUpdateFriendPost
*/
readonly friendPost?: FriendPost
}
/**
* FriendPostV1alpha1Api - object-oriented interface
* @export
* @class FriendPostV1alpha1Api
* @extends {BaseAPI}
*/
export class FriendPostV1alpha1Api extends BaseAPI {
/**
* Create FriendPost
* @param {FriendPostV1alpha1ApiCreateFriendPostRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FriendPostV1alpha1Api
*/
public createFriendPost(requestParameters: FriendPostV1alpha1ApiCreateFriendPostRequest = {}, options?: RawAxiosRequestConfig) {
return FriendPostV1alpha1ApiFp(this.configuration).createFriendPost(requestParameters.friendPost, options).then((request) => request(this.axios, this.basePath));
}
/**
* Delete FriendPost
* @param {FriendPostV1alpha1ApiDeleteFriendPostRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FriendPostV1alpha1Api
*/
public deleteFriendPost(requestParameters: FriendPostV1alpha1ApiDeleteFriendPostRequest, options?: RawAxiosRequestConfig) {
return FriendPostV1alpha1ApiFp(this.configuration).deleteFriendPost(requestParameters.name, options).then((request) => request(this.axios, this.basePath));
}
/**
* Get FriendPost
* @param {FriendPostV1alpha1ApiGetFriendPostRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FriendPostV1alpha1Api
*/
public getFriendPost(requestParameters: FriendPostV1alpha1ApiGetFriendPostRequest, options?: RawAxiosRequestConfig) {
return FriendPostV1alpha1ApiFp(this.configuration).getFriendPost(requestParameters.name, options).then((request) => request(this.axios, this.basePath));
}
/**
* List FriendPost
* @param {FriendPostV1alpha1ApiListFriendPostRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FriendPostV1alpha1Api
*/
public listFriendPost(requestParameters: FriendPostV1alpha1ApiListFriendPostRequest = {}, options?: RawAxiosRequestConfig) {
return FriendPostV1alpha1ApiFp(this.configuration).listFriendPost(requestParameters.page, requestParameters.size, requestParameters.labelSelector, requestParameters.fieldSelector, requestParameters.sort, options).then((request) => request(this.axios, this.basePath));
}
/**
* Patch FriendPost
* @param {FriendPostV1alpha1ApiPatchFriendPostRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FriendPostV1alpha1Api
*/
public patchFriendPost(requestParameters: FriendPostV1alpha1ApiPatchFriendPostRequest, options?: RawAxiosRequestConfig) {
return FriendPostV1alpha1ApiFp(this.configuration).patchFriendPost(requestParameters.name, requestParameters.jsonPatchInner, options).then((request) => request(this.axios, this.basePath));
}
/**
* Update FriendPost
* @param {FriendPostV1alpha1ApiUpdateFriendPostRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FriendPostV1alpha1Api
*/
public updateFriendPost(requestParameters: FriendPostV1alpha1ApiUpdateFriendPostRequest, options?: RawAxiosRequestConfig) {
return FriendPostV1alpha1ApiFp(this.configuration).updateFriendPost(requestParameters.name, requestParameters.friendPost, options).then((request) => request(this.axios, this.basePath));
}
}
@@ -0,0 +1,665 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import type { Configuration } from '../configuration';
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
// @ts-ignore
import type { JsonPatchInner } from '../models';
// @ts-ignore
import type { RssFeedSyncLog } from '../models';
// @ts-ignore
import type { RssFeedSyncLogList } from '../models';
/**
* RssFeedSyncLogV1alpha1Api - axios parameter creator
* @export
*/
export const RssFeedSyncLogV1alpha1ApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* Create RssFeedSyncLog
* @param {RssFeedSyncLog} [rssFeedSyncLog] Fresh rssfeedsynclog
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createRssFeedSyncLog: async (rssFeedSyncLog?: RssFeedSyncLog, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/apis/friend.moony.la/v1alpha1/rssfeedsynclogs`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(rssFeedSyncLog, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Delete RssFeedSyncLog
* @param {string} name Name of rssfeedsynclog
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteRssFeedSyncLog: async (name: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'name' is not null or undefined
assertParamExists('deleteRssFeedSyncLog', 'name', name)
const localVarPath = `/apis/friend.moony.la/v1alpha1/rssfeedsynclogs/{name}`
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get RssFeedSyncLog
* @param {string} name Name of rssfeedsynclog
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getRssFeedSyncLog: async (name: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'name' is not null or undefined
assertParamExists('getRssFeedSyncLog', 'name', name)
const localVarPath = `/apis/friend.moony.la/v1alpha1/rssfeedsynclogs/{name}`
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* List RssFeedSyncLog
* @param {number} [page] Page number. Default is 0.
* @param {number} [size] Size number. Default is 0.
* @param {Array<string>} [labelSelector] Label selector. e.g.: hidden!&#x3D;true
* @param {Array<string>} [fieldSelector] Field selector. e.g.: metadata.name&#x3D;&#x3D;halo
* @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listRssFeedSyncLog: async (page?: number, size?: number, labelSelector?: Array<string>, fieldSelector?: Array<string>, sort?: Array<string>, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/apis/friend.moony.la/v1alpha1/rssfeedsynclogs`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (size !== undefined) {
localVarQueryParameter['size'] = size;
}
if (labelSelector) {
localVarQueryParameter['labelSelector'] = labelSelector;
}
if (fieldSelector) {
localVarQueryParameter['fieldSelector'] = fieldSelector;
}
if (sort) {
localVarQueryParameter['sort'] = sort;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Patch RssFeedSyncLog
* @param {string} name Name of rssfeedsynclog
* @param {Array<JsonPatchInner>} [jsonPatchInner]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
patchRssFeedSyncLog: async (name: string, jsonPatchInner?: Array<JsonPatchInner>, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'name' is not null or undefined
assertParamExists('patchRssFeedSyncLog', 'name', name)
const localVarPath = `/apis/friend.moony.la/v1alpha1/rssfeedsynclogs/{name}`
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(jsonPatchInner, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Update RssFeedSyncLog
* @param {string} name Name of rssfeedsynclog
* @param {RssFeedSyncLog} [rssFeedSyncLog] Updated rssfeedsynclog
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateRssFeedSyncLog: async (name: string, rssFeedSyncLog?: RssFeedSyncLog, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'name' is not null or undefined
assertParamExists('updateRssFeedSyncLog', 'name', name)
const localVarPath = `/apis/friend.moony.la/v1alpha1/rssfeedsynclogs/{name}`
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(rssFeedSyncLog, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* RssFeedSyncLogV1alpha1Api - functional programming interface
* @export
*/
export const RssFeedSyncLogV1alpha1ApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = RssFeedSyncLogV1alpha1ApiAxiosParamCreator(configuration)
return {
/**
* Create RssFeedSyncLog
* @param {RssFeedSyncLog} [rssFeedSyncLog] Fresh rssfeedsynclog
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createRssFeedSyncLog(rssFeedSyncLog?: RssFeedSyncLog, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RssFeedSyncLog>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createRssFeedSyncLog(rssFeedSyncLog, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['RssFeedSyncLogV1alpha1Api.createRssFeedSyncLog']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Delete RssFeedSyncLog
* @param {string} name Name of rssfeedsynclog
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async deleteRssFeedSyncLog(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteRssFeedSyncLog(name, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['RssFeedSyncLogV1alpha1Api.deleteRssFeedSyncLog']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Get RssFeedSyncLog
* @param {string} name Name of rssfeedsynclog
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getRssFeedSyncLog(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RssFeedSyncLog>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getRssFeedSyncLog(name, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['RssFeedSyncLogV1alpha1Api.getRssFeedSyncLog']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* List RssFeedSyncLog
* @param {number} [page] Page number. Default is 0.
* @param {number} [size] Size number. Default is 0.
* @param {Array<string>} [labelSelector] Label selector. e.g.: hidden!&#x3D;true
* @param {Array<string>} [fieldSelector] Field selector. e.g.: metadata.name&#x3D;&#x3D;halo
* @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async listRssFeedSyncLog(page?: number, size?: number, labelSelector?: Array<string>, fieldSelector?: Array<string>, sort?: Array<string>, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RssFeedSyncLogList>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.listRssFeedSyncLog(page, size, labelSelector, fieldSelector, sort, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['RssFeedSyncLogV1alpha1Api.listRssFeedSyncLog']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Patch RssFeedSyncLog
* @param {string} name Name of rssfeedsynclog
* @param {Array<JsonPatchInner>} [jsonPatchInner]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async patchRssFeedSyncLog(name: string, jsonPatchInner?: Array<JsonPatchInner>, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RssFeedSyncLog>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.patchRssFeedSyncLog(name, jsonPatchInner, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['RssFeedSyncLogV1alpha1Api.patchRssFeedSyncLog']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Update RssFeedSyncLog
* @param {string} name Name of rssfeedsynclog
* @param {RssFeedSyncLog} [rssFeedSyncLog] Updated rssfeedsynclog
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async updateRssFeedSyncLog(name: string, rssFeedSyncLog?: RssFeedSyncLog, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RssFeedSyncLog>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.updateRssFeedSyncLog(name, rssFeedSyncLog, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['RssFeedSyncLogV1alpha1Api.updateRssFeedSyncLog']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
}
};
/**
* RssFeedSyncLogV1alpha1Api - factory interface
* @export
*/
export const RssFeedSyncLogV1alpha1ApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = RssFeedSyncLogV1alpha1ApiFp(configuration)
return {
/**
* Create RssFeedSyncLog
* @param {RssFeedSyncLogV1alpha1ApiCreateRssFeedSyncLogRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createRssFeedSyncLog(requestParameters: RssFeedSyncLogV1alpha1ApiCreateRssFeedSyncLogRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise<RssFeedSyncLog> {
return localVarFp.createRssFeedSyncLog(requestParameters.rssFeedSyncLog, options).then((request) => request(axios, basePath));
},
/**
* Delete RssFeedSyncLog
* @param {RssFeedSyncLogV1alpha1ApiDeleteRssFeedSyncLogRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteRssFeedSyncLog(requestParameters: RssFeedSyncLogV1alpha1ApiDeleteRssFeedSyncLogRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
return localVarFp.deleteRssFeedSyncLog(requestParameters.name, options).then((request) => request(axios, basePath));
},
/**
* Get RssFeedSyncLog
* @param {RssFeedSyncLogV1alpha1ApiGetRssFeedSyncLogRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getRssFeedSyncLog(requestParameters: RssFeedSyncLogV1alpha1ApiGetRssFeedSyncLogRequest, options?: RawAxiosRequestConfig): AxiosPromise<RssFeedSyncLog> {
return localVarFp.getRssFeedSyncLog(requestParameters.name, options).then((request) => request(axios, basePath));
},
/**
* List RssFeedSyncLog
* @param {RssFeedSyncLogV1alpha1ApiListRssFeedSyncLogRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listRssFeedSyncLog(requestParameters: RssFeedSyncLogV1alpha1ApiListRssFeedSyncLogRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise<RssFeedSyncLogList> {
return localVarFp.listRssFeedSyncLog(requestParameters.page, requestParameters.size, requestParameters.labelSelector, requestParameters.fieldSelector, requestParameters.sort, options).then((request) => request(axios, basePath));
},
/**
* Patch RssFeedSyncLog
* @param {RssFeedSyncLogV1alpha1ApiPatchRssFeedSyncLogRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
patchRssFeedSyncLog(requestParameters: RssFeedSyncLogV1alpha1ApiPatchRssFeedSyncLogRequest, options?: RawAxiosRequestConfig): AxiosPromise<RssFeedSyncLog> {
return localVarFp.patchRssFeedSyncLog(requestParameters.name, requestParameters.jsonPatchInner, options).then((request) => request(axios, basePath));
},
/**
* Update RssFeedSyncLog
* @param {RssFeedSyncLogV1alpha1ApiUpdateRssFeedSyncLogRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateRssFeedSyncLog(requestParameters: RssFeedSyncLogV1alpha1ApiUpdateRssFeedSyncLogRequest, options?: RawAxiosRequestConfig): AxiosPromise<RssFeedSyncLog> {
return localVarFp.updateRssFeedSyncLog(requestParameters.name, requestParameters.rssFeedSyncLog, options).then((request) => request(axios, basePath));
},
};
};
/**
* Request parameters for createRssFeedSyncLog operation in RssFeedSyncLogV1alpha1Api.
* @export
* @interface RssFeedSyncLogV1alpha1ApiCreateRssFeedSyncLogRequest
*/
export interface RssFeedSyncLogV1alpha1ApiCreateRssFeedSyncLogRequest {
/**
* Fresh rssfeedsynclog
* @type {RssFeedSyncLog}
* @memberof RssFeedSyncLogV1alpha1ApiCreateRssFeedSyncLog
*/
readonly rssFeedSyncLog?: RssFeedSyncLog
}
/**
* Request parameters for deleteRssFeedSyncLog operation in RssFeedSyncLogV1alpha1Api.
* @export
* @interface RssFeedSyncLogV1alpha1ApiDeleteRssFeedSyncLogRequest
*/
export interface RssFeedSyncLogV1alpha1ApiDeleteRssFeedSyncLogRequest {
/**
* Name of rssfeedsynclog
* @type {string}
* @memberof RssFeedSyncLogV1alpha1ApiDeleteRssFeedSyncLog
*/
readonly name: string
}
/**
* Request parameters for getRssFeedSyncLog operation in RssFeedSyncLogV1alpha1Api.
* @export
* @interface RssFeedSyncLogV1alpha1ApiGetRssFeedSyncLogRequest
*/
export interface RssFeedSyncLogV1alpha1ApiGetRssFeedSyncLogRequest {
/**
* Name of rssfeedsynclog
* @type {string}
* @memberof RssFeedSyncLogV1alpha1ApiGetRssFeedSyncLog
*/
readonly name: string
}
/**
* Request parameters for listRssFeedSyncLog operation in RssFeedSyncLogV1alpha1Api.
* @export
* @interface RssFeedSyncLogV1alpha1ApiListRssFeedSyncLogRequest
*/
export interface RssFeedSyncLogV1alpha1ApiListRssFeedSyncLogRequest {
/**
* Page number. Default is 0.
* @type {number}
* @memberof RssFeedSyncLogV1alpha1ApiListRssFeedSyncLog
*/
readonly page?: number
/**
* Size number. Default is 0.
* @type {number}
* @memberof RssFeedSyncLogV1alpha1ApiListRssFeedSyncLog
*/
readonly size?: number
/**
* Label selector. e.g.: hidden!&#x3D;true
* @type {Array<string>}
* @memberof RssFeedSyncLogV1alpha1ApiListRssFeedSyncLog
*/
readonly labelSelector?: Array<string>
/**
* Field selector. e.g.: metadata.name&#x3D;&#x3D;halo
* @type {Array<string>}
* @memberof RssFeedSyncLogV1alpha1ApiListRssFeedSyncLog
*/
readonly fieldSelector?: Array<string>
/**
* Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
* @type {Array<string>}
* @memberof RssFeedSyncLogV1alpha1ApiListRssFeedSyncLog
*/
readonly sort?: Array<string>
}
/**
* Request parameters for patchRssFeedSyncLog operation in RssFeedSyncLogV1alpha1Api.
* @export
* @interface RssFeedSyncLogV1alpha1ApiPatchRssFeedSyncLogRequest
*/
export interface RssFeedSyncLogV1alpha1ApiPatchRssFeedSyncLogRequest {
/**
* Name of rssfeedsynclog
* @type {string}
* @memberof RssFeedSyncLogV1alpha1ApiPatchRssFeedSyncLog
*/
readonly name: string
/**
*
* @type {Array<JsonPatchInner>}
* @memberof RssFeedSyncLogV1alpha1ApiPatchRssFeedSyncLog
*/
readonly jsonPatchInner?: Array<JsonPatchInner>
}
/**
* Request parameters for updateRssFeedSyncLog operation in RssFeedSyncLogV1alpha1Api.
* @export
* @interface RssFeedSyncLogV1alpha1ApiUpdateRssFeedSyncLogRequest
*/
export interface RssFeedSyncLogV1alpha1ApiUpdateRssFeedSyncLogRequest {
/**
* Name of rssfeedsynclog
* @type {string}
* @memberof RssFeedSyncLogV1alpha1ApiUpdateRssFeedSyncLog
*/
readonly name: string
/**
* Updated rssfeedsynclog
* @type {RssFeedSyncLog}
* @memberof RssFeedSyncLogV1alpha1ApiUpdateRssFeedSyncLog
*/
readonly rssFeedSyncLog?: RssFeedSyncLog
}
/**
* RssFeedSyncLogV1alpha1Api - object-oriented interface
* @export
* @class RssFeedSyncLogV1alpha1Api
* @extends {BaseAPI}
*/
export class RssFeedSyncLogV1alpha1Api extends BaseAPI {
/**
* Create RssFeedSyncLog
* @param {RssFeedSyncLogV1alpha1ApiCreateRssFeedSyncLogRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof RssFeedSyncLogV1alpha1Api
*/
public createRssFeedSyncLog(requestParameters: RssFeedSyncLogV1alpha1ApiCreateRssFeedSyncLogRequest = {}, options?: RawAxiosRequestConfig) {
return RssFeedSyncLogV1alpha1ApiFp(this.configuration).createRssFeedSyncLog(requestParameters.rssFeedSyncLog, options).then((request) => request(this.axios, this.basePath));
}
/**
* Delete RssFeedSyncLog
* @param {RssFeedSyncLogV1alpha1ApiDeleteRssFeedSyncLogRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof RssFeedSyncLogV1alpha1Api
*/
public deleteRssFeedSyncLog(requestParameters: RssFeedSyncLogV1alpha1ApiDeleteRssFeedSyncLogRequest, options?: RawAxiosRequestConfig) {
return RssFeedSyncLogV1alpha1ApiFp(this.configuration).deleteRssFeedSyncLog(requestParameters.name, options).then((request) => request(this.axios, this.basePath));
}
/**
* Get RssFeedSyncLog
* @param {RssFeedSyncLogV1alpha1ApiGetRssFeedSyncLogRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof RssFeedSyncLogV1alpha1Api
*/
public getRssFeedSyncLog(requestParameters: RssFeedSyncLogV1alpha1ApiGetRssFeedSyncLogRequest, options?: RawAxiosRequestConfig) {
return RssFeedSyncLogV1alpha1ApiFp(this.configuration).getRssFeedSyncLog(requestParameters.name, options).then((request) => request(this.axios, this.basePath));
}
/**
* List RssFeedSyncLog
* @param {RssFeedSyncLogV1alpha1ApiListRssFeedSyncLogRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof RssFeedSyncLogV1alpha1Api
*/
public listRssFeedSyncLog(requestParameters: RssFeedSyncLogV1alpha1ApiListRssFeedSyncLogRequest = {}, options?: RawAxiosRequestConfig) {
return RssFeedSyncLogV1alpha1ApiFp(this.configuration).listRssFeedSyncLog(requestParameters.page, requestParameters.size, requestParameters.labelSelector, requestParameters.fieldSelector, requestParameters.sort, options).then((request) => request(this.axios, this.basePath));
}
/**
* Patch RssFeedSyncLog
* @param {RssFeedSyncLogV1alpha1ApiPatchRssFeedSyncLogRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof RssFeedSyncLogV1alpha1Api
*/
public patchRssFeedSyncLog(requestParameters: RssFeedSyncLogV1alpha1ApiPatchRssFeedSyncLogRequest, options?: RawAxiosRequestConfig) {
return RssFeedSyncLogV1alpha1ApiFp(this.configuration).patchRssFeedSyncLog(requestParameters.name, requestParameters.jsonPatchInner, options).then((request) => request(this.axios, this.basePath));
}
/**
* Update RssFeedSyncLog
* @param {RssFeedSyncLogV1alpha1ApiUpdateRssFeedSyncLogRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof RssFeedSyncLogV1alpha1Api
*/
public updateRssFeedSyncLog(requestParameters: RssFeedSyncLogV1alpha1ApiUpdateRssFeedSyncLogRequest, options?: RawAxiosRequestConfig) {
return RssFeedSyncLogV1alpha1ApiFp(this.configuration).updateRssFeedSyncLog(requestParameters.name, requestParameters.rssFeedSyncLog, options).then((request) => request(this.axios, this.basePath));
}
}
+86
View File
@@ -0,0 +1,86 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import type { Configuration } from './configuration';
// Some imports not used depending on template conditions
// @ts-ignore
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
import globalAxios from 'axios';
export const BASE_PATH = "http://localhost:65429".replace(/\/+$/, "");
/**
*
* @export
*/
export const COLLECTION_FORMATS = {
csv: ",",
ssv: " ",
tsv: "\t",
pipes: "|",
};
/**
*
* @export
* @interface RequestArgs
*/
export interface RequestArgs {
url: string;
options: RawAxiosRequestConfig;
}
/**
*
* @export
* @class BaseAPI
*/
export class BaseAPI {
protected configuration: Configuration | undefined;
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
if (configuration) {
this.configuration = configuration;
this.basePath = configuration.basePath ?? basePath;
}
}
};
/**
*
* @export
* @class RequiredError
* @extends {Error}
*/
export class RequiredError extends Error {
constructor(public field: string, msg?: string) {
super(msg);
this.name = "RequiredError"
}
}
interface ServerMap {
[key: string]: {
url: string,
description: string,
}[];
}
/**
*
* @export
*/
export const operationServerMap: ServerMap = {
}
+150
View File
@@ -0,0 +1,150 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import type { Configuration } from "./configuration";
import type { RequestArgs } from "./base";
import type { AxiosInstance, AxiosResponse } from 'axios';
import { RequiredError } from "./base";
/**
*
* @export
*/
export const DUMMY_BASE_URL = 'https://example.com'
/**
*
* @throws {RequiredError}
* @export
*/
export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) {
if (paramValue === null || paramValue === undefined) {
throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
}
}
/**
*
* @export
*/
export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) {
if (configuration && configuration.apiKey) {
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
? await configuration.apiKey(keyParamName)
: await configuration.apiKey;
object[keyParamName] = localVarApiKeyValue;
}
}
/**
*
* @export
*/
export const setBasicAuthToObject = function (object: any, configuration?: Configuration) {
if (configuration && (configuration.username || configuration.password)) {
object["auth"] = { username: configuration.username, password: configuration.password };
}
}
/**
*
* @export
*/
export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) {
if (configuration && configuration.accessToken) {
const accessToken = typeof configuration.accessToken === 'function'
? await configuration.accessToken()
: await configuration.accessToken;
object["Authorization"] = "Bearer " + accessToken;
}
}
/**
*
* @export
*/
export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) {
if (configuration && configuration.accessToken) {
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
? await configuration.accessToken(name, scopes)
: await configuration.accessToken;
object["Authorization"] = "Bearer " + localVarAccessTokenValue;
}
}
function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
if (parameter == null) return;
if (typeof parameter === "object") {
if (Array.isArray(parameter)) {
(parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
}
else {
Object.keys(parameter).forEach(currentKey =>
setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`)
);
}
}
else {
if (urlSearchParams.has(key)) {
urlSearchParams.append(key, parameter);
}
else {
urlSearchParams.set(key, parameter);
}
}
}
/**
*
* @export
*/
export const setSearchParams = function (url: URL, ...objects: any[]) {
const searchParams = new URLSearchParams(url.search);
setFlattenedQueryParams(searchParams, objects);
url.search = searchParams.toString();
}
/**
*
* @export
*/
export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) {
const nonString = typeof value !== 'string';
const needsSerialization = nonString && configuration && configuration.isJsonMime
? configuration.isJsonMime(requestOptions.headers['Content-Type'])
: nonString;
return needsSerialization
? JSON.stringify(value !== undefined ? value : {})
: (value || "");
}
/**
*
* @export
*/
export const toPathString = function (url: URL) {
return url.pathname + url.search + url.hash
}
/**
*
* @export
*/
export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url};
return axios.request<T, R>(axiosRequestArgs);
};
}
+110
View File
@@ -0,0 +1,110 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface ConfigurationParameters {
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
username?: string;
password?: string;
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
basePath?: string;
serverIndex?: number;
baseOptions?: any;
formDataCtor?: new () => any;
}
export class Configuration {
/**
* parameter for apiKey security
* @param name security name
* @memberof Configuration
*/
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
/**
* parameter for basic security
*
* @type {string}
* @memberof Configuration
*/
username?: string;
/**
* parameter for basic security
*
* @type {string}
* @memberof Configuration
*/
password?: string;
/**
* parameter for oauth2 security
* @param name security name
* @param scopes oauth2 scope
* @memberof Configuration
*/
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
/**
* override base path
*
* @type {string}
* @memberof Configuration
*/
basePath?: string;
/**
* override server index
*
* @type {number}
* @memberof Configuration
*/
serverIndex?: number;
/**
* base options for axios calls
*
* @type {any}
* @memberof Configuration
*/
baseOptions?: any;
/**
* The FormData constructor that will be used to create multipart form data
* requests. You can inject this here so that execution environments that
* do not support the FormData class can still run the generated client.
*
* @type {new () => FormData}
*/
formDataCtor?: new () => any;
constructor(param: ConfigurationParameters = {}) {
this.apiKey = param.apiKey;
this.username = param.username;
this.password = param.password;
this.accessToken = param.accessToken;
this.basePath = param.basePath;
this.serverIndex = param.serverIndex;
this.baseOptions = param.baseOptions;
this.formDataCtor = param.formDataCtor;
}
/**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* @param mime - MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
public isJsonMime(mime: string): boolean {
const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
}
}
+57
View File
@@ -0,0 +1,57 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
git_user_id=$1
git_repo_id=$2
release_note=$3
git_host=$4
if [ "$git_host" = "" ]; then
git_host="github.com"
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
fi
if [ "$git_user_id" = "" ]; then
git_user_id="GIT_USER_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id="GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi
if [ "$release_note" = "" ]; then
release_note="Minor update"
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi
# Initialize the local directory as a Git repository
git init
# Adds the files in the local repository and stages them for commit.
git add .
# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
git_remote=$(git remote)
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
fi
fi
git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'
+18
View File
@@ -0,0 +1,18 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export * from "./api";
export * from "./configuration";
export * from "./models";
@@ -0,0 +1,49 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface AddOperation
*/
export interface AddOperation {
/**
*
* @type {string}
* @memberof AddOperation
*/
'op': AddOperationOpEnum;
/**
* A JSON Pointer path pointing to the location to move/copy from.
* @type {string}
* @memberof AddOperation
*/
'path': string;
/**
* Value can be any JSON value
* @type {any}
* @memberof AddOperation
*/
'value': any;
}
export const AddOperationOpEnum = {
Add: 'add'
} as const;
export type AddOperationOpEnum = typeof AddOperationOpEnum[keyof typeof AddOperationOpEnum];
+51
View File
@@ -0,0 +1,51 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
// May contain unused imports in some cases
// @ts-ignore
import type { Item } from './item';
/**
*
* @export
* @interface Channel
*/
export interface Channel {
/**
*
* @type {string}
* @memberof Channel
*/
'description'?: string;
/**
*
* @type {Array<Item>}
* @memberof Channel
*/
'items'?: Array<Item>;
/**
*
* @type {string}
* @memberof Channel
*/
'link'?: string;
/**
*
* @type {string}
* @memberof Channel
*/
'title'?: string;
}
@@ -0,0 +1,49 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface CopyOperation
*/
export interface CopyOperation {
/**
* A JSON Pointer path pointing to the location to move/copy from.
* @type {string}
* @memberof CopyOperation
*/
'from': string;
/**
*
* @type {string}
* @memberof CopyOperation
*/
'op': CopyOperationOpEnum;
/**
* A JSON Pointer path pointing to the location to move/copy from.
* @type {string}
* @memberof CopyOperation
*/
'path': string;
}
export const CopyOperationOpEnum = {
Copy: 'copy'
} as const;
export type CopyOperationOpEnum = typeof CopyOperationOpEnum[keyof typeof CopyOperationOpEnum];
@@ -0,0 +1,81 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
// May contain unused imports in some cases
// @ts-ignore
import type { CronFriendPost } from './cron-friend-post';
/**
*
* @export
* @interface CronFriendPostList
*/
export interface CronFriendPostList {
/**
* Indicates whether current page is the first page.
* @type {boolean}
* @memberof CronFriendPostList
*/
'first': boolean;
/**
* Indicates whether current page has previous page.
* @type {boolean}
* @memberof CronFriendPostList
*/
'hasNext': boolean;
/**
* Indicates whether current page has previous page.
* @type {boolean}
* @memberof CronFriendPostList
*/
'hasPrevious': boolean;
/**
* A chunk of items.
* @type {Array<CronFriendPost>}
* @memberof CronFriendPostList
*/
'items': Array<CronFriendPost>;
/**
* Indicates whether current page is the last page.
* @type {boolean}
* @memberof CronFriendPostList
*/
'last': boolean;
/**
* Page number, starts from 1. If not set or equal to 0, it means no pagination.
* @type {number}
* @memberof CronFriendPostList
*/
'page': number;
/**
* Size of each page. If not set or equal to 0, it means no pagination.
* @type {number}
* @memberof CronFriendPostList
*/
'size': number;
/**
* Total elements.
* @type {number}
* @memberof CronFriendPostList
*/
'total': number;
/**
* Indicates total pages.
* @type {number}
* @memberof CronFriendPostList
*/
'totalPages': number;
}
@@ -0,0 +1,63 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
// May contain unused imports in some cases
// @ts-ignore
import type { CronSpec } from './cron-spec';
// May contain unused imports in some cases
// @ts-ignore
import type { CronStatus } from './cron-status';
// May contain unused imports in some cases
// @ts-ignore
import type { Metadata } from './metadata';
/**
*
* @export
* @interface CronFriendPost
*/
export interface CronFriendPost {
/**
*
* @type {string}
* @memberof CronFriendPost
*/
'apiVersion': string;
/**
*
* @type {string}
* @memberof CronFriendPost
*/
'kind': string;
/**
*
* @type {Metadata}
* @memberof CronFriendPost
*/
'metadata': Metadata;
/**
*
* @type {CronSpec}
* @memberof CronFriendPost
*/
'spec'?: CronSpec;
/**
*
* @type {CronStatus}
* @memberof CronFriendPost
*/
'status'?: CronStatus;
}
+54
View File
@@ -0,0 +1,54 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface CronSpec
*/
export interface CronSpec {
/**
*
* @type {string}
* @memberof CronSpec
*/
'cron'?: string;
/**
*
* @type {Array<string>}
* @memberof CronSpec
*/
'disableSyncList'?: Array<string>;
/**
*
* @type {number}
* @memberof CronSpec
*/
'successfulRetainLimit'?: number;
/**
*
* @type {boolean}
* @memberof CronSpec
*/
'suspend'?: boolean;
/**
*
* @type {string}
* @memberof CronSpec
*/
'timezone'?: string;
}
@@ -0,0 +1,36 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface CronStatus
*/
export interface CronStatus {
/**
*
* @type {string}
* @memberof CronStatus
*/
'lastScheduledTimestamp'?: string;
/**
*
* @type {string}
* @memberof CronStatus
*/
'nextSchedulingTimestamp'?: string;
}
@@ -0,0 +1,81 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
// May contain unused imports in some cases
// @ts-ignore
import type { FriendPost } from './friend-post';
/**
*
* @export
* @interface FriendPostList
*/
export interface FriendPostList {
/**
* Indicates whether current page is the first page.
* @type {boolean}
* @memberof FriendPostList
*/
'first': boolean;
/**
* Indicates whether current page has previous page.
* @type {boolean}
* @memberof FriendPostList
*/
'hasNext': boolean;
/**
* Indicates whether current page has previous page.
* @type {boolean}
* @memberof FriendPostList
*/
'hasPrevious': boolean;
/**
* A chunk of items.
* @type {Array<FriendPost>}
* @memberof FriendPostList
*/
'items': Array<FriendPost>;
/**
* Indicates whether current page is the last page.
* @type {boolean}
* @memberof FriendPostList
*/
'last': boolean;
/**
* Page number, starts from 1. If not set or equal to 0, it means no pagination.
* @type {number}
* @memberof FriendPostList
*/
'page': number;
/**
* Size of each page. If not set or equal to 0, it means no pagination.
* @type {number}
* @memberof FriendPostList
*/
'size': number;
/**
* Total elements.
* @type {number}
* @memberof FriendPostList
*/
'total': number;
/**
* Indicates total pages.
* @type {number}
* @memberof FriendPostList
*/
'totalPages': number;
}
@@ -0,0 +1,72 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface FriendPostSpec
*/
export interface FriendPostSpec {
/**
*
* @type {string}
* @memberof FriendPostSpec
*/
'author'?: string;
/**
*
* @type {string}
* @memberof FriendPostSpec
*/
'authorUrl'?: string;
/**
*
* @type {string}
* @memberof FriendPostSpec
*/
'description'?: string;
/**
*
* @type {string}
* @memberof FriendPostSpec
*/
'linkName'?: string;
/**
*
* @type {string}
* @memberof FriendPostSpec
*/
'logo'?: string;
/**
*
* @type {string}
* @memberof FriendPostSpec
*/
'postLink'?: string;
/**
*
* @type {string}
* @memberof FriendPostSpec
*/
'pubDate'?: string;
/**
*
* @type {string}
* @memberof FriendPostSpec
*/
'title'?: string;
}
@@ -0,0 +1,54 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
// May contain unused imports in some cases
// @ts-ignore
import type { FriendPostSpec } from './friend-post-spec';
// May contain unused imports in some cases
// @ts-ignore
import type { Metadata } from './metadata';
/**
*
* @export
* @interface FriendPost
*/
export interface FriendPost {
/**
*
* @type {string}
* @memberof FriendPost
*/
'apiVersion': string;
/**
*
* @type {string}
* @memberof FriendPost
*/
'kind': string;
/**
*
* @type {Metadata}
* @memberof FriendPost
*/
'metadata': Metadata;
/**
*
* @type {FriendPostSpec}
* @memberof FriendPost
*/
'spec': FriendPostSpec;
}
+24
View File
@@ -0,0 +1,24 @@
export * from './add-operation';
export * from './channel';
export * from './copy-operation';
export * from './cron-friend-post';
export * from './cron-friend-post-list';
export * from './cron-spec';
export * from './cron-status';
export * from './friend-post';
export * from './friend-post-list';
export * from './friend-post-spec';
export * from './item';
export * from './json-patch-inner';
export * from './link';
export * from './link-spec';
export * from './listed-rss-sync-log';
export * from './listed-rss-sync-log-list';
export * from './metadata';
export * from './move-operation';
export * from './remove-operation';
export * from './replace-operation';
export * from './rss-detail';
export * from './rss-feed-sync-log';
export * from './rss-feed-sync-log-list';
export * from './test-operation';
+60
View File
@@ -0,0 +1,60 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface Item
*/
export interface Item {
/**
*
* @type {string}
* @memberof Item
*/
'author'?: string;
/**
*
* @type {string}
* @memberof Item
*/
'description'?: string;
/**
*
* @type {string}
* @memberof Item
*/
'link'?: string;
/**
*
* @type {string}
* @memberof Item
*/
'pubDate'?: string;
/**
*
* @type {string}
* @memberof Item
*/
'title'?: string;
/**
*
* @type {string}
* @memberof Item
*/
'uri'?: string;
}
@@ -0,0 +1,41 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
// May contain unused imports in some cases
// @ts-ignore
import type { AddOperation } from './add-operation';
// May contain unused imports in some cases
// @ts-ignore
import type { CopyOperation } from './copy-operation';
// May contain unused imports in some cases
// @ts-ignore
import type { MoveOperation } from './move-operation';
// May contain unused imports in some cases
// @ts-ignore
import type { RemoveOperation } from './remove-operation';
// May contain unused imports in some cases
// @ts-ignore
import type { ReplaceOperation } from './replace-operation';
// May contain unused imports in some cases
// @ts-ignore
import type { TestOperation } from './test-operation';
/**
* @type JsonPatchInner
* @export
*/
export type JsonPatchInner = AddOperation | CopyOperation | MoveOperation | RemoveOperation | ReplaceOperation | TestOperation;
+60
View File
@@ -0,0 +1,60 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface LinkSpec
*/
export interface LinkSpec {
/**
*
* @type {string}
* @memberof LinkSpec
*/
'description'?: string;
/**
*
* @type {string}
* @memberof LinkSpec
*/
'displayName': string;
/**
*
* @type {string}
* @memberof LinkSpec
*/
'groupName'?: string;
/**
*
* @type {string}
* @memberof LinkSpec
*/
'logo'?: string;
/**
*
* @type {number}
* @memberof LinkSpec
*/
'priority'?: number;
/**
*
* @type {string}
* @memberof LinkSpec
*/
'url': string;
}
+54
View File
@@ -0,0 +1,54 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
// May contain unused imports in some cases
// @ts-ignore
import type { LinkSpec } from './link-spec';
// May contain unused imports in some cases
// @ts-ignore
import type { Metadata } from './metadata';
/**
*
* @export
* @interface Link
*/
export interface Link {
/**
*
* @type {string}
* @memberof Link
*/
'apiVersion': string;
/**
*
* @type {string}
* @memberof Link
*/
'kind': string;
/**
*
* @type {Metadata}
* @memberof Link
*/
'metadata': Metadata;
/**
*
* @type {LinkSpec}
* @memberof Link
*/
'spec'?: LinkSpec;
}
@@ -0,0 +1,81 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
// May contain unused imports in some cases
// @ts-ignore
import type { ListedRssSyncLog } from './listed-rss-sync-log';
/**
*
* @export
* @interface ListedRssSyncLogList
*/
export interface ListedRssSyncLogList {
/**
* Indicates whether current page is the first page.
* @type {boolean}
* @memberof ListedRssSyncLogList
*/
'first': boolean;
/**
* Indicates whether current page has previous page.
* @type {boolean}
* @memberof ListedRssSyncLogList
*/
'hasNext': boolean;
/**
* Indicates whether current page has previous page.
* @type {boolean}
* @memberof ListedRssSyncLogList
*/
'hasPrevious': boolean;
/**
* A chunk of items.
* @type {Array<ListedRssSyncLog>}
* @memberof ListedRssSyncLogList
*/
'items': Array<ListedRssSyncLog>;
/**
* Indicates whether current page is the last page.
* @type {boolean}
* @memberof ListedRssSyncLogList
*/
'last': boolean;
/**
* Page number, starts from 1. If not set or equal to 0, it means no pagination.
* @type {number}
* @memberof ListedRssSyncLogList
*/
'page': number;
/**
* Size of each page. If not set or equal to 0, it means no pagination.
* @type {number}
* @memberof ListedRssSyncLogList
*/
'size': number;
/**
* Total elements.
* @type {number}
* @memberof ListedRssSyncLogList
*/
'total': number;
/**
* Indicates total pages.
* @type {number}
* @memberof ListedRssSyncLogList
*/
'totalPages': number;
}
@@ -0,0 +1,42 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
// May contain unused imports in some cases
// @ts-ignore
import type { Link } from './link';
// May contain unused imports in some cases
// @ts-ignore
import type { RssFeedSyncLog } from './rss-feed-sync-log';
/**
* A chunk of items.
* @export
* @interface ListedRssSyncLog
*/
export interface ListedRssSyncLog {
/**
*
* @type {Link}
* @memberof ListedRssSyncLog
*/
'link': Link;
/**
*
* @type {RssFeedSyncLog}
* @memberof ListedRssSyncLog
*/
'log'?: RssFeedSyncLog;
}
+72
View File
@@ -0,0 +1,72 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface Metadata
*/
export interface Metadata {
/**
*
* @type {{ [key: string]: string; }}
* @memberof Metadata
*/
'annotations'?: { [key: string]: string; };
/**
*
* @type {string}
* @memberof Metadata
*/
'creationTimestamp'?: string | null;
/**
*
* @type {string}
* @memberof Metadata
*/
'deletionTimestamp'?: string | null;
/**
*
* @type {Array<string>}
* @memberof Metadata
*/
'finalizers'?: Array<string> | null;
/**
* The name field will be generated automatically according to the given generateName field
* @type {string}
* @memberof Metadata
*/
'generateName'?: string;
/**
*
* @type {{ [key: string]: string; }}
* @memberof Metadata
*/
'labels'?: { [key: string]: string; };
/**
* Metadata name
* @type {string}
* @memberof Metadata
*/
'name': string;
/**
*
* @type {number}
* @memberof Metadata
*/
'version'?: number | null;
}
@@ -0,0 +1,49 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface MoveOperation
*/
export interface MoveOperation {
/**
* A JSON Pointer path pointing to the location to move/copy from.
* @type {string}
* @memberof MoveOperation
*/
'from': string;
/**
*
* @type {string}
* @memberof MoveOperation
*/
'op': MoveOperationOpEnum;
/**
* A JSON Pointer path pointing to the location to move/copy from.
* @type {string}
* @memberof MoveOperation
*/
'path': string;
}
export const MoveOperationOpEnum = {
Move: 'move'
} as const;
export type MoveOperationOpEnum = typeof MoveOperationOpEnum[keyof typeof MoveOperationOpEnum];
@@ -0,0 +1,43 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface RemoveOperation
*/
export interface RemoveOperation {
/**
*
* @type {string}
* @memberof RemoveOperation
*/
'op': RemoveOperationOpEnum;
/**
* A JSON Pointer path pointing to the location to move/copy from.
* @type {string}
* @memberof RemoveOperation
*/
'path': string;
}
export const RemoveOperationOpEnum = {
Remove: 'remove'
} as const;
export type RemoveOperationOpEnum = typeof RemoveOperationOpEnum[keyof typeof RemoveOperationOpEnum];
@@ -0,0 +1,49 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface ReplaceOperation
*/
export interface ReplaceOperation {
/**
*
* @type {string}
* @memberof ReplaceOperation
*/
'op': ReplaceOperationOpEnum;
/**
* A JSON Pointer path pointing to the location to move/copy from.
* @type {string}
* @memberof ReplaceOperation
*/
'path': string;
/**
* Value can be any JSON value
* @type {any}
* @memberof ReplaceOperation
*/
'value': any;
}
export const ReplaceOperationOpEnum = {
Replace: 'replace'
} as const;
export type ReplaceOperationOpEnum = typeof ReplaceOperationOpEnum[keyof typeof ReplaceOperationOpEnum];
+33
View File
@@ -0,0 +1,33 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
// May contain unused imports in some cases
// @ts-ignore
import type { Channel } from './channel';
/**
*
* @export
* @interface RssDetail
*/
export interface RssDetail {
/**
*
* @type {Channel}
* @memberof RssDetail
*/
'channel'?: Channel;
}
@@ -0,0 +1,81 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
// May contain unused imports in some cases
// @ts-ignore
import type { RssFeedSyncLog } from './rss-feed-sync-log';
/**
*
* @export
* @interface RssFeedSyncLogList
*/
export interface RssFeedSyncLogList {
/**
* Indicates whether current page is the first page.
* @type {boolean}
* @memberof RssFeedSyncLogList
*/
'first': boolean;
/**
* Indicates whether current page has previous page.
* @type {boolean}
* @memberof RssFeedSyncLogList
*/
'hasNext': boolean;
/**
* Indicates whether current page has previous page.
* @type {boolean}
* @memberof RssFeedSyncLogList
*/
'hasPrevious': boolean;
/**
* A chunk of items.
* @type {Array<RssFeedSyncLog>}
* @memberof RssFeedSyncLogList
*/
'items': Array<RssFeedSyncLog>;
/**
* Indicates whether current page is the last page.
* @type {boolean}
* @memberof RssFeedSyncLogList
*/
'last': boolean;
/**
* Page number, starts from 1. If not set or equal to 0, it means no pagination.
* @type {number}
* @memberof RssFeedSyncLogList
*/
'page': number;
/**
* Size of each page. If not set or equal to 0, it means no pagination.
* @type {number}
* @memberof RssFeedSyncLogList
*/
'size': number;
/**
* Total elements.
* @type {number}
* @memberof RssFeedSyncLogList
*/
'total': number;
/**
* Indicates total pages.
* @type {number}
* @memberof RssFeedSyncLogList
*/
'totalPages': number;
}
@@ -0,0 +1,85 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
// May contain unused imports in some cases
// @ts-ignore
import type { Metadata } from './metadata';
/**
*
* @export
* @interface RssFeedSyncLog
*/
export interface RssFeedSyncLog {
/**
*
* @type {string}
* @memberof RssFeedSyncLog
*/
'apiVersion': string;
/**
*
* @type {string}
* @memberof RssFeedSyncLog
*/
'failureMessage'?: string;
/**
*
* @type {string}
* @memberof RssFeedSyncLog
*/
'failureReason'?: string;
/**
*
* @type {string}
* @memberof RssFeedSyncLog
*/
'kind': string;
/**
*
* @type {string}
* @memberof RssFeedSyncLog
*/
'linkName': string;
/**
*
* @type {Metadata}
* @memberof RssFeedSyncLog
*/
'metadata': Metadata;
/**
*
* @type {string}
* @memberof RssFeedSyncLog
*/
'state': RssFeedSyncLogStateEnum;
/**
*
* @type {string}
* @memberof RssFeedSyncLog
*/
'syncTime': string;
}
export const RssFeedSyncLogStateEnum = {
Success: 'success',
Failed: 'failed',
Onwait: 'onwait',
Nolink: 'nolink'
} as const;
export type RssFeedSyncLogStateEnum = typeof RssFeedSyncLogStateEnum[keyof typeof RssFeedSyncLogStateEnum];
@@ -0,0 +1,49 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.20.11
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface TestOperation
*/
export interface TestOperation {
/**
*
* @type {string}
* @memberof TestOperation
*/
'op': TestOperationOpEnum;
/**
* A JSON Pointer path pointing to the location to move/copy from.
* @type {string}
* @memberof TestOperation
*/
'path': string;
/**
* Value can be any JSON value
* @type {any}
* @memberof TestOperation
*/
'value': any;
}
export const TestOperationOpEnum = {
Test: 'test'
} as const;
export type TestOperationOpEnum = typeof TestOperationOpEnum[keyof typeof TestOperationOpEnum];
+21
View File
@@ -0,0 +1,21 @@
import { axiosInstance } from "@halo-dev/api-client";
import {
ApiFriendMoonyLaV1alpha1FriendPostApi,
CronFriendPostV1alpha1Api,
FriendPostV1alpha1Api,
RssFeedSyncLogV1alpha1Api
} from "./generated";
const friendsCoreApiClient = {
cron: new CronFriendPostV1alpha1Api(undefined, "", axiosInstance),
friendPost: new FriendPostV1alpha1Api(undefined, "", axiosInstance),
rssFeedSyncLog: new RssFeedSyncLogV1alpha1Api(undefined, "", axiosInstance)
};
const friendsApiClient = {
friendPost: new ApiFriendMoonyLaV1alpha1FriendPostApi(undefined,"",axiosInstance),
};
export { friendsCoreApiClient, friendsApiClient };
@@ -0,0 +1,136 @@
<script lang="ts" setup>
import {formatDatetime} from "@/utils/date";
import {type ListedRssSyncLog, RssFeedSyncLogStateEnum} from "@/api/generated";
import {
VStatusDot,
VEntity,
VEntityField,
VDropdownItem,
VSpace,
Dialog,
Toast
} from "@halo-dev/components";
import {friendsApiClient} from "@/api";
import { useQueryClient } from "@tanstack/vue-query";
import {computed} from "vue";
const queryClient = useQueryClient();
const props = withDefaults(
defineProps<{
rssFeedSyncLog: ListedRssSyncLog;
}>(),{
}
);
const handleSyncRss = async () => {
Dialog.warning({
title: "同步RSS数据",
description: "点击按钮后,后台将进行同步RSS数据",
confirmText: "确定",
cancelText: "取消",
onConfirm: async () => {
try {
await friendsApiClient.friendPost.syncRssFeed({
name: props.rssFeedSyncLog.link.metadata.name as string
})
Toast.success("同步成功");
} catch (error) {
console.error("Failed to synchronize rss", error);
} finally {
await queryClient.invalidateQueries({ queryKey: ["rssSyncLogs"] });
}
},
});
};
const statusState = computed(() => {
if (props.rssFeedSyncLog.log?.state == RssFeedSyncLogStateEnum.Success) {
return "success";
}
if (props.rssFeedSyncLog.log?.state == RssFeedSyncLogStateEnum.Failed) {
return "error";
}
return "warning";
});
const statusText = computed(() => {
if (props.rssFeedSyncLog.log?.state == RssFeedSyncLogStateEnum.Success) {
return "成功";
}
if (props.rssFeedSyncLog.log?.state == RssFeedSyncLogStateEnum.Failed) {
return props.rssFeedSyncLog.log?.failureMessage;
}
if (props.rssFeedSyncLog.log?.state == RssFeedSyncLogStateEnum.Nolink) {
return "无链接";
}
return "待同步";
});
</script>
<template>
<VEntity >
<template #start>
<VEntityField>
<template #title>
<div class="entity-field-title">
{{ rssFeedSyncLog.link.spec?.displayName }}
</div>
</template>
<template #description>
<div class=":uno: flex flex-col gap-1.5">
<VSpace class=":uno: flex-wrap !gap-y-1">
<span class=":uno: text-xs text-gray-500">
{{ rssFeedSyncLog.link.metadata.annotations?.["rss_url"]}}
</span>
</VSpace>
</div>
</template>
</VEntityField>
</template>
<template #end>
<VEntityField >
<template #description>
<VStatusDot
v-if="!rssFeedSyncLog.log"
state="warning"
animate
:text="'待同步'"
/>
<div
v-else
:class="`status-dot-wrapper status-dot-${statusState} status-dot-animate`"
>
<div class="status-dot-body"><span class="status-dot-inner"></span></div>
<span class="status-dot-text" style="white-space: pre-wrap">{{statusText}}</span>
</div>
</template>
</VEntityField>
<VEntityField
v-if="rssFeedSyncLog.log?.syncTime"
v-tooltip="'同步时间'"
:description="formatDatetime(rssFeedSyncLog.log?.syncTime)+' 同步'"
></VEntityField>
<VEntityField v-if="rssFeedSyncLog.link.metadata.deletionTimestamp">
<template #description>
<VStatusDot
v-tooltip="'删除中'"
state="warning"
animate
/>
</template>
</VEntityField>
</template>
<template #dropdownItems>
<HasPermission :permissions="['plugin:forums:posts:manage']">
<VDropdownItem type="danger" @click="handleSyncRss">
重新获取
</VDropdownItem>
</HasPermission>
</template>
</VEntity>
</template>
@@ -0,0 +1,164 @@
<script lang="ts" setup>
import { setFocus } from "@/utils/focus";
import {
axiosInstance
} from "@halo-dev/api-client";
import {
IconArrowDown,
VAvatar,
VDropdown,
VEntity,
VEntityContainer,
VEntityField,
} from "@halo-dev/components";
import { useQuery } from "@tanstack/vue-query";
import { refDebounced } from "@vueuse/shared";
import { ref, toRefs } from "vue";
import type { LinkList } from "@/types";
import type {Link} from "@/api/generated";
const props = withDefaults(
defineProps<{
label: string;
modelValue?: string;
}>(),
{
modelValue: undefined,
}
);
const { modelValue } = toRefs(props);
const emit = defineEmits<{
(event: "update:modelValue", value?: string): void;
}>();
const keyword = ref("");
const debouncedKeyword = refDebounced(keyword, 300);
const { data: selectedLink } = useQuery({
queryKey: ["core:link:name", modelValue],
queryFn: async () => {
if (!modelValue.value) {
return null;
}
const { data } = await axiosInstance.get(`/apis/core.halo.run/v1alpha1/links/${modelValue.value}`);
return data;
},
cacheTime: 0,
});
const { data: links } = useQuery({
queryKey: ["core:links", debouncedKeyword],
queryFn: async () => {
const { data } = await axiosInstance.get<LinkList>(
"/apis/api.plugin.halo.run/v1alpha1/plugins/PluginLinks/links",
{
params: {
page: 1,
size: 30,
keyword: debouncedKeyword.value
},
}
);
const pureLinks = data?.items?.map((link) => link);
if (!pureLinks?.length) {
return [selectedLink.value].filter(Boolean) as Link[];
}
if (selectedLink.value) {
return [
selectedLink.value,
...pureLinks.filter(
(link) => link.metadata.name !== selectedLink.value?.metadata.name
),
];
}
return pureLinks;
},
staleTime: 2000,
});
const dropdown = ref();
const handleSelect = (link: Link) => {
const { name } = link.metadata || {};
if (name === props.modelValue) {
emit("update:modelValue", undefined);
} else {
emit("update:modelValue", name);
}
dropdown.value.hide();
};
function onDropdownShow() {
setTimeout(() => {
setFocus("linkFilterDropdownInput");
}, 200);
}
</script>
<template>
<VDropdown ref="dropdown" :classes="['!p-0']" @show="onDropdownShow">
<div
class=":uno: flex cursor-pointer select-none items-center text-sm text-gray-700 hover:text-black"
:class="{ ':uno: font-semibold text-gray-700': modelValue !== undefined }"
>
<span v-if="!selectedLink" class=":uno: mr-0.5">
{{ label }}
</span>
<span v-else class=":uno: mr-0.5">
{{ label }}{{ selectedLink.spec.displayName }}
</span>
<span>
<IconArrowDown />
</span>
</div>
<template #popper>
<div class=":uno: h-96 w-80">
<div class=":uno: border-b border-b-gray-100 bg-white p-4">
<FormKit
id="linkFilterDropdownInput"
v-model="keyword"
:placeholder="'输入关键词以搜索'"
type="text"
></FormKit>
</div>
<div>
<VEntityContainer>
<VEntity
v-for="link in links"
:key="link.metadata.name"
:is-selected="modelValue === link.metadata.name"
@click="handleSelect(link)"
>
<template #start>
<VEntityField>
<template #description>
<VAvatar
:key="link.metadata.name"
:alt="link.spec.displayName"
:src="link.spec.logo"
size="md"
></VAvatar>
</template>
</VEntityField>
<VEntityField
:title="link.spec.displayName"
:description="link.metadata.name"
/>
</template>
</VEntity>
</VEntityContainer>
</div>
</div>
</template>
</VDropdown>
</template>
+53
View File
@@ -0,0 +1,53 @@
<script lang="ts" setup>
import {useAttrs} from "vue";
import {axiosInstance} from "@halo-dev/api-client";
import type {Link} from "@/api/generated";
const handleSelectRemote = {
search: async ({ keyword, page, size }: { keyword: string; page: number; size: number }) => {
const { data:links } = await axiosInstance.get("/apis/api.plugin.halo.run/v1alpha1/plugins/PluginLinks/links",{
params:{
page: page,
size: size,
keyword: keyword,
}
});
return {
options: links.items?.map((item:Link) => ({
label: item.spec?.displayName,
value: item.metadata.name,
})),
total: links.total,
page: links.page,
size: links.size,
};
},
findOptionsByValues: async (names: any) => {
if (names.length === 0) {
return [];
}
const { data: findLinks } = await axiosInstance.get("/apis/api.plugin.halo.run/v1alpha1/plugins/PluginLinks/links",{
params:{
fieldSelector: [`metadata.name=(${names.join(",")})`]
}
});
return findLinks.items?.map((item:Link) => ({
value: item.metadata.name,
label: item.spec?.displayName
}))
},
};
const attrs = useAttrs();
</script>
<template>
<FormKit
v-bind="attrs"
type="select"
searchable
remote
multiple
:remote-option="handleSelectRemote"
></FormKit>
</template>
+3
View File
@@ -0,0 +1,3 @@
<template>
<div class="friends-rss-editor-block__actions-separator"></div>
</template>
+123
View File
@@ -0,0 +1,123 @@
<script lang="ts" setup>
import type {NodeViewProps, PMNode} from "@halo-dev/richtext-editor";
import { NodeViewWrapper } from "@halo-dev/richtext-editor";
import { computed, onMounted, ref, watch } from "vue";
import { VButton,VSpace,VDropdown,VEmpty} from "@halo-dev/components";
import { friendsApiClient } from "@/api";
import type { RssDetail } from "@/api/generated";
import type { FriendsRss } from '@kunkunyu/fridends-rss';
const selecteRssDetail = ref<RssDetail | undefined>();
const props = defineProps<NodeViewProps>();
const rssRef = ref<InstanceType<typeof FriendsRss> | null>();
watch(
() => props.node.attrs.src,
(value) => {
if (value && rssRef.value) {
rssRef.value.src = value;
rssRef.value.fetchRssDetail();
}
}
);
const src = computed({
get: () => {
return props.node?.attrs.src;
},
set: (src: string) => {
props.updateAttributes({ src: src });
},
});
const layout = computed({
get: () => {
return props.node?.attrs.layout;
},
set: (layout: string) => {
props.updateAttributes({ layout: layout });
},
});
const editorLinkObtain = ref();
onMounted(() => {
if (!src.value) {
}else {
handleCheckAllChange();
}
});
const handleCheckAllChange = async () => {
const { data: data } = await friendsApiClient.friendPost.parsingRss({
rssUrl: src.value
});
selecteRssDetail.value = data
};
const handleEnterSetExternalLink = () => {
if (!editorLinkObtain.value) {
return;
}
props.updateAttributes({
src: editorLinkObtain.value,
});
};
const handleResetInit = () => {
props.updateAttributes({src: ""});
};
</script>
<template>
<node-view-wrapper as="div" class="contact-friends-rss-container"
:class="{
'contact-friends-rss-container--selected': selected,
}">
<div class="contact-friends-rss-nav">
<div class="contact-friends-rss-nav-start">
<div>RSS</div>
</div>
<div class="contact-friends-rss-nav-end">
<button v-if="src && selecteRssDetail?.channel!=undefined"
@click="handleResetInit"
class=":uno: btn-sm btn-default btn" type="button">
<span class=":uno: btn-content">更换</span>
</button>
</div>
</div>
<div class="contact-friends-rss-preview" >
<VEmpty message="当前未输入RSS链接,点击下方按钮链接" title="未输入RSS链接"
v-if="!src || selecteRssDetail?.channel==undefined">
<template #actions>
<VSpace>
<VDropdown>
<VButton>输入RSS链接</VButton>
<template #popper>
<input
v-model="editorLinkObtain"
class=":uno: block w-full rounded-md border border-gray-300 bg-gray-50 px-2 py-1.5 text-sm text-gray-900 hover:bg-gray-100"
placeholder="输入链接,按回车确定"
@keydown.enter="handleEnterSetExternalLink"
@change="handleCheckAllChange"
/>
</template>
</VDropdown>
</VSpace>
</template>
</VEmpty>
<div v-else inert="true" >
<friends-rss
ref="rssRef"
:src="src"
:layout="layout"
></friends-rss>
</div>
</div>
</node-view-wrapper>
</template>
+1
View File
@@ -0,0 +1 @@
export { default as FriendsRssExtension } from "./rss-edited";
+201
View File
@@ -0,0 +1,201 @@
import {
type Editor,
isActive,
mergeAttributes,
Node,
nodeInputRule,
type Range,
VueNodeViewRenderer,
type EditorState,
} from "@halo-dev/richtext-editor";
import RssView from "./RssView.vue";
import { markRaw } from "vue";
import { ToolboxItem } from "@halo-dev/richtext-editor";
import MdiShare from "~icons/mdi/share";
import BlockActionSeparator from "./BlockActionSeparator.vue";
import MdiDeleteForeverOutline from "~icons/mdi/delete-forever-outline?color=red";
import { deleteNode } from "../utils/delete-node";
import LayoutGrid from "@/icon/layout-grid.vue";
import LayoutList from "@/icon/layout-list.vue";
import FluentRss20Regular from '~icons/fluent/rss-20-regular';
declare module "@halo-dev/richtext-editor" {
interface Commands<ReturnType> {
"friends-rss": {
setFriendsRss: (options: { src: string }) => ReturnType;
};
}
}
const FriendsRssExtension = Node.create({
name: "friends-rss",
fakeSelection: true,
group() {
return "block";
},
addAttributes() {
return {
...this.parent?.(),
src: {
default: null,
parseHTML: (element) => {
return element.getAttribute("src");
},
renderHTML(element) {
return { src: element.src };
},
},
layout: {
default: "list",
parseHTML: (element) => {
return element.getAttribute("layout");
},
renderHTML(element) {
return { layout: element.layout };
},
},
};
},
parseHTML() {
return [
{
tag: "friends-rss",
},
];
},
renderHTML({ HTMLAttributes }) {
return ["friends-rss", mergeAttributes(HTMLAttributes)];
},
addCommands() {
return {
setFriendsRss:
(options) =>
({ commands }) => {
return commands.insertContent([
{
type: this.name,
attrs: options,
},
{
type: "paragraph",
content: ""
},
]);
},
};
},
addInputRules() {
return [
nodeInputRule({
find: /^\$friends-rss\$$/,
type: this.type,
getAttributes: (e) => ({
src: e[1]
}),
}),
];
},
addNodeView() {
return VueNodeViewRenderer(RssView);
},
addOptions() {
return {
getCommandMenuItems() {
return {
priority: 2e2,
icon: markRaw(FluentRss20Regular),
title: "RSS展示",
keywords: ["friends-rss", "rss", "RSS展示"],
command: ({ editor, range }: { editor: Editor; range: Range }) => {
editor
.chain()
.focus()
.deleteRange(range)
.setFriendsRss({ src: "" })
.run();
},
};
},
getToolboxItems({ editor }: { editor: Editor }) {
return {
priority: 59,
component: markRaw(ToolboxItem),
props: {
editor,
icon: markRaw(FluentRss20Regular),
title: "RSS展示",
action: () => {
editor
.chain()
.focus()
.setFriendsRss({ src: "" })
.run();
},
},
};
},
getBubbleMenu({ editor }: { editor: Editor }) {
return {
pluginKey: "friends-rss-bubble-menu",
shouldShow: ({ state }: { state: EditorState }) => {
return isActive(state, FriendsRssExtension.name);
},
items: [
{
priority: 10,
props: {
icon: markRaw(LayoutList),
title: "列表视图",
isActive: () => editor.isActive(FriendsRssExtension.name,{ layout: "list" }),
action: () => editor.commands.updateAttributes(FriendsRssExtension.name, { layout: "list",}),
},
},
{
priority: 20,
props: {
icon: markRaw(LayoutGrid),
title: "网格试图",
isActive: () => editor.isActive(FriendsRssExtension.name,{ layout: "grid" }),
action: () => editor.commands.updateAttributes(FriendsRssExtension.name, { layout: "grid",}),
},
},
{
priority: 30,
props: {
icon: markRaw(MdiShare),
title: "打开链接",
action: () => {
window.open(editor.getAttributes(FriendsRssExtension.name).src, "_blank");
},
},
},
{
priority: 40,
component: markRaw(BlockActionSeparator),
},
{
priority: 50,
props: {
icon: markRaw(MdiDeleteForeverOutline),
title: "删除",
action: ({ editor }: { editor: Editor }) => {
deleteNode(FriendsRssExtension.name, editor);
},
},
},
],
};
},
}
}
})
export default FriendsRssExtension;
+3
View File
@@ -0,0 +1,3 @@
<template>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false"><path d="m3 5c0-1.10457.89543-2 2-2h13.5c1.1046 0 2 .89543 2 2v13.5c0 1.1046-.8954 2-2 2h-13.5c-1.10457 0-2-.8954-2-2zm2-.5h6v6.5h-6.5v-6c0-.27614.22386-.5.5-.5zm-.5 8v6c0 .2761.22386.5.5.5h6v-6.5zm8 0v6.5h6c.2761 0 .5-.2239.5-.5v-6zm0-8v6.5h6.5v-6c0-.27614-.2239-.5-.5-.5z" fill-rule="evenodd" clip-rule="evenodd"></path></svg>
</template>
+3
View File
@@ -0,0 +1,3 @@
<template>
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" width="24" height="24" aria-hidden="true" focusable="false"><path d="M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z"></path></svg>
</template>
+41
View File
@@ -0,0 +1,41 @@
import "./styles/index.css";
import { VLoading } from "@halo-dev/components";
import "uno.css";
import { definePlugin } from "@halo-dev/console-shared";
import RiBloggerLine from '~icons/ri/blogger-line';
import { defineAsyncComponent, markRaw } from "vue";
import {FriendsRssExtension} from "@/editor";
import '@kunkunyu/fridends-rss';
export default definePlugin({
components: {},
routes: [
{
parentName: "Root",
route: {
path: "/friends",
name: "Friends",
component: defineAsyncComponent({
loader: () => import("@/views/Friend.vue"),
loadingComponent: VLoading,
}),
meta: {
title: "朋友圈",
searchable: true,
permissions: ["plugin:friends:view"],
menu: {
name: "朋友圈",
icon: markRaw(RiBloggerLine),
group: "content",
priority: 20,
},
},
},
},
],
extensionPoints: {
"default:editor:extension:create": () => {
return [FriendsRssExtension];
},
},
});
+184
View File
@@ -0,0 +1,184 @@
.thyuu-card p {
font-size: 14px;
line-height: 1.5;
margin: 1em 0;
}
:is(.thyuu-card, .thyuu-card-menu, .thyuu-paginate) a {
color: inherit;
text-decoration: none;
}
.thyuu-card {
display: grid;
grid: auto / repeat(auto-fill, minmax(min(25em, 100%), 1fr));
gap: 1em;
margin: 1em 0;
width: 100%;
}
.thyuu-card.column {
grid: auto / auto;
}
.thyuu-card li {
display: flex;
justify-content: space-between;
align-content: space-between;
align-items: center;
flex-wrap: wrap;
padding: 1em;
gap: 1em;
margin: 0;
background-color: rgb(243 244 246 / var(--tw-bg-opacity));
border-radius: 1em;
overflow: hidden;
}
.thyuu-card.column li > * {
flex: 1;
min-width: min(20em, 100%);
}
.thyuu-card header {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
gap: 1em .5em;
width: 100%;
}
.thyuu-card header > *:last-child {
margin: 0 0 0 auto;
font-size: 12px;
opacity: .3;
}
.thyuu-card header span {
font-size: 14px;
color: #3c434a;
}
.thyuu-card header img {
border-radius: 50%;
}
.thyuu-card article {
display: flex;
flex-wrap: wrap;
gap: 1em .5em;
}
.thyuu-card article > * {
margin: 0;
display: -webkit-inline-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
text-overflow: ellipsis;
overflow: hidden;
}
.thyuu-card article h4 {
color: #3c434a;
font-size: 14px;
font-weight: 600;
}
.thyuu-card footer {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: .5em;
width: 100%;
}
.thyuu-card footer time {
flex: 1;
font-size: 12px;
opacity: .5;
margin: 0 auto 0 0;
}
.thyuu-card .button {
--btn-color: 200deg 60% 40%;
display: flex;
gap: .5em;
color: hsl(var(--btn-color));
border: 0;
font-size: 12px;
height: 2.5em;
min-height: 2.5em;
line-height: 1.5em;
padding: .5em 1em;
margin: 0;
transition: .3s;
}
.thyuu-card .button:hover {
color: white;
background: hsl(var(--btn-color, 200deg 60% 40%));
}
.thyuu-card .button.im {
--btn-color: 0deg 60% 40%;
}
.thyuu-card .button, .thyuu-card .button-secondary {
border-radius: 2em;
background: rgb(255 255 255 / var(--tw-bg-opacity));
vertical-align: top;
}
.contact-friends-rss-container {
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
box-shadow: var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);
--tw-ring-opacity: 1;
--tw-ring-color: rgb(229 231 235 / var(--tw-ring-opacity));
border-radius: 4px;
overflow: hidden;
margin-top: .75em
}
.contact-friends-rss-container--selected {
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
box-shadow: var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);
--tw-ring-color: inherit
}
.contact-friends-rss-nav {
border-bottom: 1px #e7e7e7 solid;
display: flex;
padding: 5px 10px;
align-items: center
}
.contact-friends-rss-nav-start {
flex: 1;
display: flex;
align-items: center;
gap: 10px;
font-size: 14px
}
.contact-friends-rss-nav-end {
justify-content: flex-end
}
.contact-friends-rss-preview {
padding: 5px 10px
}
.halo-rich-text-editor .editor-content .ProseMirror .block-rss {
list-style: none;
padding: 0;
}
ul.block-rss.block-rss {
box-sizing: border-box;
}
ul.block-rss.is-grid {
display: flex;
flex-wrap: wrap;
list-style: none;
padding: 0;
}
ul.block-rss.is-grid li {
margin: 0 1em 1em 0;
width: 100%
}
@media (min-width: 600px) {
ul.block-rss.columns-2 li {
width:calc(50% - 1em)
}
}
.friends-rss-editor-block__actions-separator {
@apply h-5 bg-slate-200 mx-1.5;
width: 1px;
}
+23
View File
@@ -0,0 +1,23 @@
import type {Link} from "@/api/generated";
export interface LinkList {
'first': boolean;
'hasNext': boolean;
'hasPrevious': boolean;
'items': Array<Link>;
'last': boolean;
'page': number;
'size': number;
'total': number;
'totalPages': number;
}
+63
View File
@@ -0,0 +1,63 @@
import dayjs from "dayjs";
import "dayjs/locale/zh-cn";
import timezone from "dayjs/plugin/timezone";
import TimeAgo from "javascript-time-ago";
import zh from "javascript-time-ago/locale/zh";
dayjs.extend(timezone);
dayjs.locale("zh-cn");
TimeAgo.addDefaultLocale(zh);
export function formatDatetime(date: string | Date | undefined | null): string {
if (!date) {
return "";
}
return dayjs(date).format("YYYY-MM-DD HH:mm");
}
export function timeAgo(
date: string | Date | number | undefined | null
): string {
if (!date) {
return "";
}
const currentDate = new Date();
const inputDate = new Date(date);
// 365天 * 24小时 * 60分钟 * 60秒 * 1000毫秒
const oneYearInMilliseconds = 365 * 24 * 60 * 60 * 1000;
if (currentDate.getTime() - inputDate.getTime() > oneYearInMilliseconds) {
return dayjs(date).format("YYYY-MM-DD");
}
const timeAgo = new TimeAgo("zh");
return timeAgo.format(new Date(date));
}
export function calculateTimeDifferenceInSeconds(
startTimestamp: string | Date | number | undefined | null,
completionTimestamp: string | Date | number | undefined | null
): string {
if (!startTimestamp || !completionTimestamp) {
return "Invalid input";
}
// 将输入转换为 Date 对象
const startDate = new Date(startTimestamp);
const completionDate = new Date(completionTimestamp);
// 计算时间差(以毫秒为单位)
const differenceInMilliseconds = completionDate.getTime() - startDate.getTime();
// 将时间差转换为秒
const differenceInSeconds = differenceInMilliseconds / 1000;
// 返回时间差的整数部分
return Math.floor(differenceInSeconds).toString();
}
+47
View File
@@ -0,0 +1,47 @@
import type { Editor } from "@halo-dev/richtext-editor";
export const deleteNode = (nodeType: string, editor: Editor) => {
const { state } = editor;
const $pos = state.selection.$anchor;
let done = false;
if ($pos.depth) {
for (let d = $pos.depth; d > 0; d--) {
const node = $pos.node(d);
if (node.type.name === nodeType) {
// @ts-ignore
if (editor.dispatchTransaction)
// @ts-ignore
editor.dispatchTransaction(
state.tr.delete($pos.before(d), $pos.after(d)).scrollIntoView()
);
done = true;
}
}
} else {
// @ts-ignore
const node = state.selection.node;
if (node && node.type.name === nodeType) {
editor.chain().deleteSelection().run();
done = true;
}
}
if (!done) {
const pos = $pos.pos;
if (pos) {
const node = state.tr.doc.nodeAt(pos);
if (node && node.type.name === nodeType) {
// @ts-ignore
if (editor.dispatchTransaction)
// @ts-ignore
editor.dispatchTransaction(state.tr.delete(pos, pos + node.nodeSize));
done = true;
}
}
}
return done;
};
+14
View File
@@ -0,0 +1,14 @@
export function setFocus(id: string) {
const inputElement = document.getElementById(id);
if (
inputElement instanceof HTMLInputElement ||
inputElement instanceof HTMLTextAreaElement
) {
const timer = setTimeout(() => {
const end = inputElement.value.length;
inputElement.setSelectionRange(end, end);
inputElement?.focus();
clearTimeout(timer);
}, 0);
}
}
+161
View File
@@ -0,0 +1,161 @@
<script lang="ts" setup>
import {Toast, VButton} from "@halo-dev/components";
import {ref} from "vue";
import type {CronFriendPost} from "@/api/generated";
import cloneDeep from "lodash.clonedeep";
import {friendsCoreApiClient} from "@/api";
import LinkFormKit from "@/components/formkit/LinkFormKit.vue";
import {useMutation, useQuery} from "@tanstack/vue-query";
const Se = "cron-friends-default"
const initialFormState: CronFriendPost = {
metadata: {
name: Se,
creationTimestamp: ""
},
spec: {
cron: "@daily",
timezone:"Asia/Shanghai",
suspend: false,
successfulRetainLimit: 0,
disableSyncList: undefined,
},
kind: "CronFriendPost",
apiVersion: "friend.moony.la/v1alpha1",
};
const cronOptions = [{
label: "每月(每月 1 号 0 点)",
value: "@monthly"
}, {
label: "每周(每周第一天 的 0 点)",
value: "@weekly"
}, {
label: "每天(每天的 0 点)",
value: "@daily"
}, {
label: "每小时",
value: "@hourly"
}]
const formState = ref<CronFriendPost>(cloneDeep(initialFormState));
const {isLoading: cronIsLoading, isFetching: cronIsFetching} = useQuery({
queryKey: ["cron-friend-post"],
queryFn: async () => {
const {data} = await friendsCoreApiClient.cron.getCronFriendPost({
name: Se
},{
mute: true
});
return data;
},
onSuccess(data) {
formState.value = data
},
retry: false
})
const { mutate:save, isLoading:saveIsLoading } = useMutation({
mutationKey: ["cron-friend-post-save"],
mutationFn: async () => {
if (formState.value.metadata.creationTimestamp) {
const { data: data } = await friendsCoreApiClient.cron.getCronFriendPost({
name: Se
});
formState.value = {
...formState.value,
status: data.status,
metadata: data.metadata
};
return await friendsCoreApiClient.cron.updateCronFriendPost({
name: Se,
cronFriendPost: formState.value
});
}else {
return await friendsCoreApiClient.cron.createCronFriendPost({
cronFriendPost: formState.value
});
}
},
onSuccess(data) {
formState.value = data.data
Toast.success("保存成功");
}
});
</script>
<template>
<Transition mode="out-in" name="fade">
<div class=":uno: bg-white p-4">
<div>
<FormKit
id="cron-setting-form"
v-model="formState.spec"
name="cron-setting-form"
:preserve="true"
type="form"
:disabled="cronIsFetching"
@submit="save"
>
<FormKit
type="checkbox"
name="suspend"
label="是否启用"
value="false"
help="定时获取RSS订阅数据"
/>
<FormKit
type="select"
name="cron"
label="定时表达式"
allow-create
searchable
validatio="required"
:options="cronOptions"
help="定时表达式规则请参考:https://docs.spring.io/spring-framework/reference/integration/scheduling.html#scheduling-cron-expression"
/>
<FormKit
type="select"
name="timezone"
label="时区"
:options="[
{
value: 'Asia/Shanghai',
label: 'Asia/Shanghai (GMT+08:00)'
},
]"
/>
<FormKit
type="number"
name="successfulRetainLimit"
label="留限制条数"
number="integer"
validation="required|number|min:0"
help="设置之后会保留的数据条数,设置为 0 即为5条"
/>
<LinkFormKit
name="disableSyncList"
label="禁止同步名单"
></LinkFormKit>
</FormKit>
</div>
<div v-permission="['plugin:friends:manage']" class=":uno: pt-5">
<div class=":uno: flex justify-start">
<VButton
:loading="saveIsLoading"
:disabled="cronIsLoading"
type="secondary"
@click="$formkit.submit('cron-setting-form')"
>
保存
</VButton>
</div>
</div>
</div>
</Transition>
</template>
+116
View File
@@ -0,0 +1,116 @@
<script setup lang="ts">
import {markRaw, shallowRef} from "vue";
import FriendPostTab from "@/views/FriendPostTab.vue";
import CronTab from "@/views/CronTab.vue";
import { useRouteQuery } from "@vueuse/router";
import { Dialog, Toast } from "@halo-dev/components";
import {
VButton,
VCard,
VPageHeader,
VSpace,
VTabbar,
} from "@halo-dev/components";
import RssFeedSyncLogTab from "@/views/RssFeedSyncLogTab.vue";
import {friendsApiClient} from "@/api";
import {axiosInstance} from "@halo-dev/api-client";
const tabs = shallowRef([
{
id: "friendPost",
label: "订阅文章",
component: markRaw(FriendPostTab),
},
{
id: "cron",
label: "定时任务",
component: markRaw(CronTab),
},
{
id: "rssFeedSyncLog",
label: "同步日志",
component: markRaw(RssFeedSyncLogTab),
}
]);
const activeIndex = useRouteQuery<string>("tab", tabs.value[0].id);
//
const handleCreate = () => {
Dialog.warning({
title: "同步RSS数据",
description: "点击按钮后,后台将进行同步RSS数据。",
confirmType: "danger",
confirmText: "确定",
cancelText: "取消",
onConfirm: async () => {
try {
await friendsApiClient.friendPost.syncRssFeed({
name: "all"
})
Toast.success("同步RSS数据成功");
} catch (e) {
console.error("", e);
}
},
});
}
const handleDel = () => {
Dialog.warning({
title: "清空RSS数据",
description: "点击按钮后,将进行删除RSS数据。",
confirmType: "danger",
confirmText: "确定",
cancelText: "取消",
onConfirm: async () => {
try {
await axiosInstance.delete("/apis/api.friend.moony.la/v1alpha1/friendposts/-/delete")
Toast.success("清空RSS数据成功");
} catch (e) {
console.error("", e);
}
},
});
}
</script>
<template>
<VPageHeader title="RSS订阅">
<template #actions>
<VSpace v-permission="['plugin:friends:manage']">
<VButton type="secondary" @click="handleCreate">
同步数据
</VButton>
<VButton type="danger" @click="handleDel">
清空
</VButton>
</VSpace>
</template>
</VPageHeader>
<div class=":uno: m-0 md:m-4">
<VCard :body-class="[':uno: !p-0']">
<template #header>
<VTabbar
v-model:active-id="activeIndex"
:items="tabs.map((item) => ({ id: item.id, label: item.label }))"
class=":uno: w-full !rounded-none"
type="outline"
></VTabbar>
</template>
<div class=":uno: bg-white">
<FriendPostTab ref="friendPost" v-if="activeIndex=='friendPost'"/>
<CronTab ref="cron" v-if="activeIndex=='cron'"/>
<RssFeedSyncLogTab ref="rssFeedSyncLog" v-if="activeIndex=='rssFeedSyncLog'"/>
</div>
</VCard>
</div>
</template>
+229
View File
@@ -0,0 +1,229 @@
<script lang="ts" setup>
import {
VCard,
IconRefreshLine,
Dialog,
VButton,
VEmpty,
VLoading,
VPagination,
Toast,
VSpace,
} from "@halo-dev/components";
import {useQuery, useQueryClient} from "@tanstack/vue-query";
import {computed, ref, watch} from "vue";
import { formatDatetime } from "@/utils/date";
import {useRouteQuery} from "@vueuse/router";
import LinkFilterDropdown from "@/components/filter/LinkFilterDropdown.vue";
import {friendsApiClient, friendsCoreApiClient} from "@/api";
const queryClient = useQueryClient();
const selectedSort = useRouteQuery<string | undefined>("sort");
const selectedLink = useRouteQuery<string | undefined>("author");
const keyword = useRouteQuery<string>("keyword", "");
const page = useRouteQuery<number>("page", 1, {
transform: Number,
});
const size = useRouteQuery<number>("size", 30, {
transform: Number,
});
const total = ref(0);
watch(
() => [
selectedLink.value,
selectedSort.value,
keyword.value,
],
() => {
page.value = 1;
}
);
function handleClearFilters() {
selectedLink.value = undefined;
selectedSort.value = undefined;
}
const hasFilters = computed(() => {
return (
selectedLink.value ||
selectedSort.value
);
});
const {
data: friendPosts,
isLoading,
isFetching,
refetch,
} = useQuery({
queryKey: ["friendPosts", page, size,selectedSort,selectedLink,keyword],
queryFn: async () => {
let linkName: string | undefined;
if (selectedLink.value) {
linkName = selectedLink.value;
}
const { data } = await friendsApiClient.friendPost.listFriendPosts(
{
page: page.value,
size: size.value,
sort: [selectedSort.value].filter(Boolean) as string[],
linkName : linkName,
keyword: keyword?.value
}
);
total.value = data.total;
return data.items;
},
refetchInterval: (data) => {
const deletingFriend = data?.filter(
(friend) => !!friend.metadata.deletionTimestamp
);
return deletingFriend?.length ? 1000 : false;
},
});
const handleDelete = async (name: string) => {
Dialog.warning({
title: "确定要删除该应用吗?",
description: "删除之后将无法恢复。",
confirmType: "danger",
confirmText: "确定",
cancelText: "取消",
onConfirm: async () => {
try {
await friendsCoreApiClient.friendPost.deleteFriendPost({
name: name
})
Toast.success("删除成功");
} catch (e) {
console.error(e);
} finally {
queryClient.invalidateQueries({ queryKey: ["friendPosts"] });
}
},
});
};
</script>
<template>
<VCard :body-class="[':uno: !p-0']" >
<template #header>
<div class=":uno: block w-full bg-gray-50 px-4 py-3">
<div class=":uno: relative flex flex-col flex-wrap items-start gap-4 sm:flex-row sm:items-center" >
<div class=":uno: flex w-full flex-1 items-center sm:w-auto">
<SearchInput
v-model="keyword"
/>
</div>
<VSpace spacing="lg" class=":uno: flex-wrap">
<FilterCleanButton
v-if="hasFilters"
@click="handleClearFilters"
/>
<LinkFilterDropdown
v-model="selectedLink"
label="作者"
/>
<FilterDropdown
v-model="selectedSort"
label="排序"
:items="[
{
label: '默认',
},
{
label: '较近创建',
value: 'spec.pubDate,desc',
},
{
label: '较早创建',
value: 'spec.pubDate,asc',
},
]"
/>
<div class=":uno: flex flex-row gap-2">
<div
class=":uno: group cursor-pointer rounded p-1 hover:bg-gray-200"
@click="refetch()"
>
<IconRefreshLine
v-tooltip="'刷新'"
:class="{ ':uno: animate-spin text-gray-900': isFetching }"
class=":uno: h-4 w-4 text-gray-600 group-hover:text-gray-900"
/>
</div>
</div>
</VSpace>
</div>
</div>
</template>
<VLoading v-if="isLoading" />
<Transition v-else-if="!friendPosts?.length" appear name="fade">
<VEmpty
message="暂无订阅文章记录"
title="暂无订阅文章记录"
>
<template #actions>
<VSpace>
<VButton @click="refetch()"> 刷新 </VButton>
</VSpace>
</template>
</VEmpty>
</Transition>
<Transition v-else appear name="fade">
<div class=":uno: m-0 md:m-4">
<ul class="thyuu-card">
<li v-for="friendPost in friendPosts">
<header>
<img alt="" :src="friendPost.spec.logo"
class=":uno: avatar avatar-24 photo" height="24" width="24" loading="lazy" decoding="async">
<span>{{friendPost.spec.author}}</span>
<span></span>
</header>
<article>
<h4>
<a :href="friendPost.spec.postLink" target="_blank"
rel="noopener noreferrer">
{{friendPost.spec.title}}
</a>
</h4>
<p>{{friendPost.spec.description}}</p>
</article>
<footer>
<time>{{formatDatetime(friendPost.spec.pubDate)}} 发布</time>
<a :href="friendPost.spec.postLink" class=":uno: button icon-views" target="_blank"
rel="noopener noreferrer">访问动态</a>
<HasPermission :permissions="['plugin:friends:manage']">
<a @click="handleDelete(friendPost.metadata.name)"
class=":uno: button icon-del im cursor-pointer">删除</a>
</HasPermission>
</footer>
</li>
</ul>
</div>
</Transition>
<template #footer>
<VPagination
v-model:page="page"
v-model:size="size"
:total="total"
:size-options="[30, 60, 90]"
/>
</template>
</VCard>
</template>
+134
View File
@@ -0,0 +1,134 @@
<script lang="ts" setup>
import {ref, watch} from "vue";
import {
VButton,
VCard,
VEmpty,
VSpace,
VLoading,
VPagination,
IconRefreshLine,
VEntityContainer
} from "@halo-dev/components";
import { useRouteQuery } from "@vueuse/router";
import {friendsApiClient} from "@/api";
import { useQuery } from "@tanstack/vue-query";
import RssFeedSyncLogListItem from "@/components/RssFeedSyncLogListItem.vue";
const keyword = useRouteQuery<string>("keyword", "");
const page = useRouteQuery<number>("page", 1, {
transform: Number,
});
const size = useRouteQuery<number>("size", 30, {
transform: Number,
});
const total = ref(0);
watch(
() => [
keyword.value,
],
() => {
page.value = 1;
},
);
const {
data: rssSyncLogs,
isLoading,
isFetching,
refetch,
} = useQuery({
queryKey: [
"rssSyncLogs",
page,
size,
keyword,
],
queryFn: async () => {
const { data } = await friendsApiClient.friendPost.listRssSyncLogs({
page: page.value,
size: size.value,
keyword: keyword.value
});
total.value = data.total;
return data.items;
},
refetchInterval: (data) => {
const hasDeletingRssSyncLog = data?.some(
(rssSyncLog) => rssSyncLog?.link.metadata.deletionTimestamp,
);
return hasDeletingRssSyncLog ? 1000 : false;
},
});
</script>
<template>
<VCard :body-class="[':uno: !p-0']">
<template #header>
<div class=":uno: block w-full bg-gray-50 px-4 py-3">
<div
class=":uno: relative flex h-9 flex-col flex-wrap items-start gap-4 sm:flex-row sm:items-center"
>
<div class=":uno: flex w-full flex-1 items-center sm:w-auto">
<SearchInput
v-model="keyword"
/>
</div>
<VSpace spacing="lg" class=":uno: flex-wrap">
<div class=":uno: flex flex-row gap-2">
<div
class=":uno: group cursor-pointer rounded p-1 hover:bg-gray-200"
@click="refetch()"
>
<IconRefreshLine
v-tooltip="'刷新'"
:class="{ ':uno: animate-spin text-gray-900': isFetching }"
class=":uno: h-4 w-4 text-gray-600 group-hover:text-gray-900"
/>
</div>
</div>
</VSpace>
</div>
</div>
</template>
<VLoading v-if="isLoading" />
<Transition v-else-if="!rssSyncLogs?.length" appear name="fade">
<VEmpty
:title="'当前没有日志'"
>
<template #actions>
<VSpace>
<VButton @click="refetch">
刷新
</VButton>
</VSpace>
</template>
</VEmpty>
</Transition>
<Transition appear name="fade">
<VEntityContainer>
<RssFeedSyncLogListItem
v-for="(rssSyncLog, index) in rssSyncLogs" :key="index"
:rss-feed-sync-log="rssSyncLog"
>
</RssFeedSyncLogListItem>
</VEntityContainer>
</Transition>
<template #footer>
<VPagination
v-model:page="page"
v-model:size="size"
page-label="页"
size-label="条 / 页"
:total-label="`共 ${total} 项数据`"
:total="total"
:size-options="[30, 60, 90]"
/>
</template>
</VCard>
</template>