Repository: nineya/halo-theme-dream
Branch: master
Commit: 62c28dea8594
Files: 220
Total size: 3.6 MB
Directory structure:
gitextract_1x6ktdds/
├── .eslintignore
├── .eslintrc.js
├── .github/
│ └── ISSUE_TEMPLATE/
│ ├── bug_report.yml
│ ├── config.yml
│ ├── custom_config.yml
│ └── feature_request.yml
├── .gitignore
├── .npmignore
├── .npmrc
├── 404.ftl
├── 500.ftl
├── LICENSE
├── README.md
├── archives.ftl
├── categories.ftl
├── category.ftl
├── gulpfile.js
├── index.ftl
├── journals.ftl
├── links.ftl
├── mail_template/
│ ├── mail_notice.ftl
│ └── mail_reply.ftl
├── package.json
├── photos.ftl
├── post.ftl
├── post_literature.ftl
├── post_password.ftl
├── search.ftl
├── settings.yaml
├── sheet.ftl
├── sheet_literature.ftl
├── source/
│ ├── cursor/
│ │ ├── OwO/
│ │ │ ├── arrow.cur
│ │ │ └── hand.cur
│ │ ├── UwU/
│ │ │ ├── arrow.cur
│ │ │ └── hand.cur
│ │ ├── black_cat/
│ │ │ ├── Alternative.cur
│ │ │ ├── Escritura a Mano.cur
│ │ │ ├── Move.cur
│ │ │ ├── No_Disponible.cur
│ │ │ ├── Ocupado.cur
│ │ │ ├── ayuda.cur
│ │ │ ├── diagonal resize 1.cur
│ │ │ ├── diagonal resize 2.cur
│ │ │ ├── horizontal.cur
│ │ │ ├── normal.cur
│ │ │ ├── precision.cur
│ │ │ ├── texto.cur
│ │ │ ├── vertical.cur
│ │ │ └── work.cur
│ │ ├── breeze/
│ │ │ ├── Arrow.cur
│ │ │ ├── Cross.cur
│ │ │ ├── Hand.cur
│ │ │ ├── Handwriting.cur
│ │ │ ├── Help.cur
│ │ │ ├── IBeam.cur
│ │ │ ├── NO.cur
│ │ │ ├── SizeAll.cur
│ │ │ ├── SizeNESW.cur
│ │ │ ├── SizeNS.cur
│ │ │ ├── SizeNWSE.cur
│ │ │ ├── SizeWE.cur
│ │ │ └── UpArrow.cur
│ │ ├── debris/
│ │ │ ├── arrow.cur
│ │ │ └── hand.cur
│ │ ├── horse/
│ │ │ ├── arrow.cur
│ │ │ └── hand.cur
│ │ ├── marry/
│ │ │ ├── arrow.cur
│ │ │ ├── beam.ani
│ │ │ ├── beam.cur
│ │ │ ├── busy.ani
│ │ │ ├── ew.ani
│ │ │ ├── move.cur
│ │ │ ├── nesw.ani
│ │ │ ├── ns.ani
│ │ │ ├── nwse.ani
│ │ │ └── working.ani
│ │ ├── mellow/
│ │ │ ├── arrow.cur
│ │ │ └── hand.cur
│ │ ├── music_cat_01/
│ │ │ ├── arrow.cur
│ │ │ └── hand.cur
│ │ ├── music_cat_02/
│ │ │ ├── arrow.cur
│ │ │ └── hand.cur
│ │ ├── overwatch/
│ │ │ ├── alternate.cur
│ │ │ ├── busy.ani
│ │ │ ├── cross.cur
│ │ │ ├── dgn1.cur
│ │ │ ├── dgn2.cur
│ │ │ ├── handwriting.cur
│ │ │ ├── help.cur
│ │ │ ├── horz.cur
│ │ │ ├── link.cur
│ │ │ ├── move.cur
│ │ │ ├── person.cur
│ │ │ ├── pin.cur
│ │ │ ├── pointer.cur
│ │ │ ├── text.cur
│ │ │ ├── vert.cur
│ │ │ └── work.ani
│ │ ├── rainbow_rain/
│ │ │ ├── Alternative2.cur
│ │ │ ├── Escritura a Mano.cur
│ │ │ ├── Movee2.cur
│ │ │ ├── No Disponible.cur
│ │ │ ├── Ocupado.cur
│ │ │ ├── ayuda.cur
│ │ │ ├── diagonal resize 1.cur
│ │ │ ├── diagonal resize 2.cur
│ │ │ ├── horizontal.cur
│ │ │ ├── link.ani
│ │ │ ├── link.cur
│ │ │ ├── normal.cur
│ │ │ ├── precision.cur
│ │ │ ├── texto.cur
│ │ │ ├── trabajando en segundo plano.cur
│ │ │ └── vertical1.cur
│ │ ├── water_01/
│ │ │ ├── arrow.cur
│ │ │ └── hand.cur
│ │ └── water_02/
│ │ ├── arrow.cur
│ │ └── hand.cur
│ └── lib/
│ ├── halo-comment@1.1.7/
│ │ ├── demo.html
│ │ └── halo-comment.js
│ ├── highlightjs@11.5.1/
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── es/
│ │ │ ├── core.js
│ │ │ ├── highlight.js
│ │ │ └── package.json
│ │ ├── highlight.js
│ │ └── package.json
│ ├── jquery-pjax@2.0.1/
│ │ └── jquery.pjax.js
│ ├── katex@0.12.0/
│ │ ├── README.md
│ │ ├── contrib/
│ │ │ ├── auto-render.js
│ │ │ ├── auto-render.mjs
│ │ │ ├── copy-tex.css
│ │ │ ├── copy-tex.js
│ │ │ ├── copy-tex.mjs
│ │ │ ├── mathtex-script-type.js
│ │ │ ├── mathtex-script-type.mjs
│ │ │ ├── mhchem.js
│ │ │ ├── mhchem.mjs
│ │ │ ├── render-a11y-string.js
│ │ │ └── render-a11y-string.mjs
│ │ ├── katex.css
│ │ ├── katex.js
│ │ └── katex.mjs
│ ├── live2d@1.0.1/
│ │ └── waifu-tips.json
│ └── swiper@8.4.6/
│ ├── swiper-bundle.css
│ └── swiper-bundle.js
├── src/
│ ├── css/
│ │ ├── celebration.less
│ │ ├── cursor.less
│ │ ├── dshare.less
│ │ ├── mew-custom.less
│ │ ├── post.less
│ │ ├── style.less
│ │ └── theme.less
│ └── js/
│ ├── autoload.js
│ ├── btoc.js
│ ├── common.js
│ ├── cursor/
│ │ ├── click/
│ │ │ ├── firework.js
│ │ │ ├── granule.js
│ │ │ ├── heart.js
│ │ │ └── prosperous.js
│ │ └── move/
│ │ ├── bubbleCursor.js
│ │ ├── emojiCursor.js
│ │ ├── fairyDustCursor.js
│ │ ├── followingDotCursor.js
│ │ ├── ghostCursor.js
│ │ ├── snowflakeCursor.js
│ │ ├── springyEmojiCursor.js
│ │ └── trailingCursor.js
│ ├── dprogress.js
│ ├── dshare.js
│ ├── editor-options.js
│ ├── effects/
│ │ ├── circleMagic.js
│ │ ├── lantern.js
│ │ ├── sakura.js
│ │ ├── snowflake.js
│ │ └── universe.js
│ ├── journals.js
│ ├── mew-custom.js
│ ├── photos.js
│ ├── pjax.js
│ ├── post.js
│ ├── settings.js
│ ├── spark-input.js
│ ├── sw.js
│ └── utils.js
├── tag.ftl
├── tags.ftl
├── template/
│ ├── common/
│ │ ├── actions.ftl
│ │ ├── banner.ftl
│ │ ├── config.ftl
│ │ ├── footer.ftl
│ │ ├── head.ftl
│ │ ├── navbar.ftl
│ │ ├── scripts.ftl
│ │ └── widget.ftl
│ ├── errorpage.ftl
│ ├── layout.ftl
│ ├── layout_default.ftl
│ ├── layout_pjax.ftl
│ ├── main/
│ │ ├── admire.ftl
│ │ ├── article.ftl
│ │ ├── article_list.ftl
│ │ ├── article_literature.ftl
│ │ ├── comment.ftl
│ │ ├── copyright.ftl
│ │ └── pagination.ftl
│ └── widget/
│ ├── ad_piece.ftl
│ ├── categories.ftl
│ ├── custom.ftl
│ ├── links.ftl
│ ├── love.ftl
│ ├── music.ftl
│ ├── notice.ftl
│ ├── profile.ftl
│ ├── recent_comments.ftl
│ ├── recent_posts.ftl
│ ├── tagcloud.ftl
│ ├── tags.ftl
│ └── toc.ftl
└── theme.yaml
================================================
FILE CONTENTS
================================================
================================================
FILE: .eslintignore
================================================
source/
================================================
FILE: .eslintrc.js
================================================
module.exports = {
'env': {
'browser': true,
'es2021': true
},
'extends': 'eslint:recommended',
'overrides': [],
'parserOptions': {
'ecmaVersion': 'latest',
'sourceType': 'module'
},
'rules': {
'indent': ['error', 2],
'linebreak-style': ['error', 'unix'],
'quotes': ['error', 'single'],
'semi': ['error', 'never'],
'no-undef': ['off'],
'no-unused-vars': ['off'],
'no-useless-escape': ['off'],
'no-mixed-spaces-and-tabs': ['off'],
'no-inner-declarations': ['off']
}
}
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.yml
================================================
name: BUG 提交
description: 提交 Bug 反馈
title: 'bug:'
labels: [bug]
body:
- type: markdown
id: preface
attributes:
value: |
感谢你花时间填写此错误报告!在开始之前,我们非常推荐阅读一遍[《开源最佳实践》](https://github.com/LinuxSuRen/open-source-best-practice),这会在很大程度上提高我们彼此的效率。
- type: markdown
id: environment
attributes:
value: "## 环境信息"
- type: input
id: halo-version
validations:
required: false
attributes:
label: "是什么 Halo 版本出现了此问题?"
description: "可以在管理后台的关于页面中找到。"
- type: input
id: dream-version
validations:
required: false
attributes:
label: "使用的 Dream 版本是多少?"
description: "可以在主题 `theme.yaml` 文件中找到。"
- type: input
id: site-url
attributes:
label: "在线博客地址"
description: "如果可以的话,请提供你的博客地址。这可能会帮助我们更好的定位问题。"
placeholder: "ex. https://blog.nineya.com"
validations:
required: false
- type: markdown
id: details
attributes:
value: "## 详细信息"
- type: textarea
id: what-happened
attributes:
label: "BUG 内容"
description: "较详细的描述 BUG 导致了什么问题。"
validations:
required: true
- type: textarea
id: logs
attributes:
label: "相关 Console 日志输出"
description: "浏览器界面按 `F12` 进入开发者工具,请复制并粘贴任何相关的控制台日志输出。 这将自动格式化为代码,因此无需反引号。"
render: shell
- type: textarea
id: additional-information
attributes:
label: "附加信息"
description: "如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。"
================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
blank_issues_enabled: true
contact_links:
- name: 加入主题交流群
url: https://qm.qq.com/cgi-bin/qm/qr?k=X7p7Bs21cgtkQ0dRfzmBsuWqNNQc10hn&jump_from=webapi
about: 如果问题描述起来较于复杂,欢迎加入 Dream 主题交流群进行提问。
================================================
FILE: .github/ISSUE_TEMPLATE/custom_config.yml
================================================
name: 定制化配置
description: 提交定制化配置疑问
title: 'custom:'
labels: [custom]
body:
- type: markdown
id: preface
attributes:
value: "你好!感谢你为 Dream 提交定制化配置建议。在开始之前,我们非常推荐阅读一遍[《开源最佳实践》](https://github.com/LinuxSuRen/open-source-best-practice),这会在很大程度上提高我们彼此的效率。"
- type: markdown
id: environment
attributes:
value: "## 环境信息"
- type: input
id: dream-version
validations:
required: false
attributes:
label: "你当前使用的 Dream 版本"
description: "可以在主题 `theme.yaml` 文件中找到。"
- type: markdown
id: details
attributes:
value: "## 详细信息"
- type: textarea
id: description
attributes:
label: "描述一下此定制化内容"
validations:
required: true
- type: textarea
id: additional-information
attributes:
label: "补充信息"
description: "如果你还有其他需要提供的信息或解决思路,可以在这里填写。"
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.yml
================================================
name: 新特性建议
description: 提交新特性建议
title: 'feat:'
body:
- type: markdown
id: preface
attributes:
value: "你好!感谢你为 Dream 提交新特性建议。在开始之前,我们非常推荐阅读一遍[《开源最佳实践》](https://github.com/LinuxSuRen/open-source-best-practice),这会在很大程度上提高我们彼此的效率。"
- type: markdown
id: environment
attributes:
value: "## 环境信息"
- type: input
id: halo-version
validations:
required: false
attributes:
label: "你当前使用的 Halo 版本"
description: "可以在管理后台的关于页面中找到。"
- type: input
id: dream-version
validations:
required: false
attributes:
label: "你当前使用的 Dream 版本"
description: "可以在主题 `theme.yaml` 文件中找到。"
- type: markdown
id: details
attributes:
value: "## 详细信息"
- type: textarea
id: description
attributes:
label: "描述一下此特性"
validations:
required: true
- type: textarea
id: additional-information
attributes:
label: "附加信息"
description: "如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。"
================================================
FILE: .gitignore
================================================
*.iml
.idea/
node_modules/
dist/
package-lock.json
================================================
FILE: .npmignore
================================================
/node_modules/*
/.idea/*
/.git/*
/.github/*
/dist
================================================
FILE: .npmrc
================================================
shamefully-hoist=true
registry=https://registry.npmjs.org
================================================
FILE: 404.ftl
================================================
<#include "template/errorpage.ftl">
<@errorpage "找不到网页","无法找到该文章或分类,可能已被删除,去首页看看吧。","${status!}","${error!}","${message!}" />
================================================
FILE: 500.ftl
================================================
<#include "template/errorpage.ftl">
<@errorpage "服务器繁忙","围观群众太过热情,服务器繁忙,请稍后访问。","${status!}","${error!}","${message!}" />
================================================
FILE: LICENSE
================================================
The MIT License (MIT)
Copyright (c) 2021 Nineya
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
halo-theme-dream
主题已完成 `Halo 2.0` 适配,2.x 的主题不在当前仓库维护,详见:https://github.com/nineya/halo-theme-dream2.0
## 一、预览

预览:[主题预览](https://github.com/nineya/halo-theme-dream/discussions/72)
> 如果你有计划长期使用 `Dream` 主题,也来[这里](https://github.com/nineya/halo-theme-dream/discussions/72)留下你的博客链接吧。
## 二、说明
梦之城,童话梦境,动漫类型博客主题。
关于主题使用上的一些问题可以参见 [主题使用手册-基础篇](https://blog.nineya.com/archives/94.html)
如有疑问,欢迎加入 Dream 主题交流群:638168592
个人博客交流,友链交换,欢迎加入 个人博客交流群:582535349
欢迎参与主题开发的一些问题探讨
欢迎关注微信公众号《玖涯菜菜子》,主题版本更新消息与要点说明将在公众号发布。

## 三、版本适配关系
| 主题版本 | 适配Halo-Plus版本 | 测试用Halo-Plus版本 |
|----------|---------------|----------------|
| xx-2.3.1 | 1.0.0 | 1.0.0 |
| 3.0.0 | 1.0.1 | 1.0.1 |
| 3.0.1 | 1.0.2 | 1.0.2 |
当前仓库为适配 `Halo-Plus` 的仓库,与 `Halo` 官方的博客系统不兼容。
- 兼容 `Halo 1.x` 的分支(存档,不再维护):https://github.com/nineya/halo-theme-dream/tree/halo
- 兼容 `Haki 2.x` 的分支(维护中):https://github.com/nineya/halo-theme-dream2.0
## 四、安装 & 更新
### 4.1 安装包安装 & 更新
1. 进入主题 `Release` 界面:https://github.com/nineya/halo-theme-dream/releases 下载主题压缩包 `halo-theme-dream.zip` 压缩包文件;
2. 进入博客后台管理 `外观->主题->安装->本地上传`,选择下载的 `halo-theme-dream.zip` 安装包进行上传;
3. 等待安装完成;
4. 更新主题时同样前往主题 `Release` 界面下载主题安装包,然后通过 `外观->主题->Dream->更多->从主题包更新` 方法上传安装包进行更新。
### 4.2 在线安装 & 更新
1. 复制主题仓库地址 `https://github.com/nineya/halo-theme-dream.git`
2. 进入博客后台管理 `外观->主题->安装->远程下载`,黏贴仓库地址进行安装;
3. 等待安装完成;
4. 在线更新主题时,通过 `外观->主题->Dream->更多->在线更新` 方法进行更新。
> 在线安装 & 更新的方式不推荐:
>
> 1. 因为由于 `GitHub` 的网络问题,很大几率会安装& 更新失败;
> 2. 主题是经过源码编译的,直接从仓库下载包含了主题的源码以及开发所需的相关文件,这些文件并不是安装主题所需要的。
## 五、参与主题开发
> 推荐使用 IDEA 进行主题开发,能够比较好的支持 FreeMarker。
1. 开发环境准备
- 安装 `nodejs` 版本需要在 `15+`;
- 主题目录下执行 `npm i` 安装依赖;
2. npm 命令
- `npm run build` 执行主题打包操作,主题将被打包为压缩包文件存放在 `dist/` 目录下,同时 `source` 目录下的文件也将被更新。
- `npm run build --devel` 开发模式进行主题打包,`js` 和 `css` 不会被做压缩和混淆处理,方便排查问题。
- `npm run cdn --tag=$version` 创建 `FreeCDN` 清单文件,必须指定 `tag` 参数,值为本地代码将发布到 `GitHub` 仓库的版本标签。
- `npm run release --tag=$version` 发布模式执行主题打包操作,将自动更新主题中的版本号,并使用这个版本标签重新创建 `FreeCDN` 清单文件。
## 六、打赏项目
感谢您对本项目的喜爱,您的打赏是对本项目最好的支持!

================================================
FILE: archives.ftl
================================================
<#include "template/layout.ftl">
<@layout title="归档 - ${blog_title!}" canonical="${archives_url!}">
<#if (archives)?? && archives?size gt 0>
<#list archives as archive>
${archive.year?c}
<#list archive.posts as post>
<#assign thumbnail = (post.thumbnail?? && post.thumbnail!='')?then(post.thumbnail!, (settings.default_thumbnail?? && settings.default_thumbnail!='')?then(settings.default_thumbnail + settings.default_thumbnail?contains('?')?then("&","?") + "postId=" + post.id?c, ''))>
<#if thumbnail!=''>
#if>
${post.title!}
<#if post.categories?? && post.categories?size gt 0>
<#list post.categories as category>
${category.name!}
#list>
#if>
#list>
#list>
<#include "template/main/pagination.ftl">
<@pagination method="archives" datas=posts display="${settings.page_number!5}" />
<#else>
#if>
@layout>
================================================
FILE: categories.ftl
================================================
<#include "template/layout.ftl">
<#macro categoriesTree categories>
<#list categories as category>
${category.name}
${postCounts[category.id?c]!}
<#if category.children?? && category.children?size gt 0>
<@categoriesTree category.children/>
#if>
#list>
#macro>
<@layout title="分类 - ${blog_title!}" canonical="${categories_url!}">
<#assign postCounts = {}>
<@categoryTag method="list">
<#list categories as category>
<#assign postCounts += {category.id: category.postCount}>
#list>
@categoryTag>
<@categoryTag method="tree">
<#if categories?? && categories?size gt 0>
<#else>
#if>
@categoryTag>
@layout>
================================================
FILE: category.ftl
================================================
<#include "template/layout.ftl">
<@layout title="分类:${category.name!} - ${blog_title!}" canonical="${category.fullPath!}">
<#if (posts.content)?? && posts.content?size gt 0>
<#include "template/main/article_list.ftl">
<@article_list posts.content/>
<#include "template/main/pagination.ftl">
<@pagination method="categoryPosts" datas=posts slug="${category.slug!}" display="${settings.page_number!5}" />
<#else>
#if>
@layout>
================================================
FILE: gulpfile.js
================================================
const {src, dest, task, series, parallel} = require('gulp')
const webpack = require('webpack-stream')
const less = require('gulp-less')
const autoprefix = require('gulp-autoprefixer')
const uglify = require('gulp-uglify')
const minifyCSS = require('gulp-csso')
const zip = require('gulp-zip')
const rename = require('gulp-rename')
const clean = require('gulp-clean')
const path = require('path')
const execSync = require('child_process').execSync
const fs = require('fs')
const resolve = (name) => path.resolve(__dirname, name)
const cssPath = './source/css'
const jsPath = './source/js'
const distPath = './dist'
const devModel = process.env.npm_config_devel
const version = process.env.npm_config_tag
if (devModel) {
console.log('> 开发模式')
}
version && console.log(`> 发布版本:${version}`)
task('clean', () => {
return src([cssPath, jsPath, distPath], {
read: false,
allowEmpty: true,
}).pipe(
clean({
force: true,
})
)
})
task('version', (done) => {
if (version == null) {
console.log('[Version] No \'--tag\' parameters are specified')
done()
return
}
const themePath = 'theme.yaml'
const packagePath = 'package.json'
const themeData = fs.readFileSync(themePath, 'utf8')
.replace(/^version:\s+[^\s]+$/m, 'version: ' + version)
.replace(/^(editorOptions:.+mew=)[^\s]+$/m, '$1' + version)
fs.writeFileSync(themePath, themeData)
let packageData = fs.readFileSync(packagePath, 'utf8')
.replace(/"version":\s*"[^"]+"/, `"version": "${version}"`)
fs.writeFileSync(packagePath, packageData)
done()
})
task('css', () => {
const ignoreFiles = [].map((file) => `./src/css/${file}.less`)
let gw = src('./src/css/**/*.less', {
ignore: ignoreFiles,
})
.pipe(less())
.pipe(
autoprefix({
overrideBrowserslist: ['> 2%', 'last 2 versions', 'not ie 6-9'],
cascade: false,
})
)
if (!devModel) {
gw = gw.pipe(minifyCSS())
}
return gw.pipe(
rename({
suffix: '.min',
})
).pipe(dest(cssPath))
})
task('js', () => {
const readFile = (prefix, dir, ignoreFiles) => {
let result = {}
let files = fs.readdirSync(dir, 'utf-8')
files.forEach((file) => {
let filePath = path.join(dir, file)
let states = fs.statSync(filePath)
if (states.isDirectory()) {
Object.assign(result, readFile(path.join(prefix, file), filePath, ignoreFiles))
} else if (ignoreFiles.length
? /\.js$/.test(file) && !ignoreFiles.includes(path.join(prefix, file))
: /\.js$/.test(file)) {
const fileName = file.replace(/.js$/, '')
result[path.join(prefix, fileName)] = resolve(filePath)
}
})
return result
}
const getEntryData = () => {
return readFile('', './src/js', [])
}
return webpack({
mode: devModel ? 'development' : 'production',
entry: getEntryData(),
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
include: resolve('source'),
exclude: resolve('node_modules'),
options: {
presets: ['@babel/preset-env'],
plugins: ['@babel/plugin-transform-runtime'],
},
},
],
},
stats: 'errors-only',
output: {
filename: '[name].min.js',
},
})
.pipe(uglify())
.pipe(dest(jsPath))
})
task('zip', () => {
const target = ['./source/**', './template/**', './mail_template/**', './*.ftl', './*.yaml', 'README.md', 'screenshot.png', 'LICENSE']
return src(target, {base: '.'})
.pipe(zip('halo-theme-dream.zip'))
.pipe(dest(distPath))
})
task('publish', (done) => {
// 需要将tag标签内容置为 latest
process.env.npm_config_tag = 'latest'
console.log(execSync('npm publish').toString())
done()
})
// 默认模式
task('default', series('clean', parallel('css', 'js'), 'zip'))
// release模式,需要使用--tag参数指定版本号
task('release', series('clean', 'version', parallel('css', 'js'), 'zip'))
// push模式,需要使用--tag参数指定版本号
task('push', series('clean', 'version', parallel('css', 'js'), 'zip', 'publish'))
================================================
FILE: index.ftl
================================================
<#include "template/layout.ftl">
<#global is_first_index=(posts.number == 0) >
<#macro model_build option>
<#if !option??>
<#return>
#if>
<#local tag=((option.tag!'')?trim != '')?then('${option.tag?trim}
', '')>
<#local title=((option.title!'')?trim != '')?then('${option.title?trim}
', '')>
<#local target=((option.target!'')?trim != '')?then(' target="${option.target?trim}"', ' target="_blank"')>
<#local imageUrl=((option.image!'')?trim != '')?then(' style="background-image: url(${option.image?trim})"', '')>
<#local targetUrl=((option.url!'')?trim != '')?then(' href="${option.url?trim}"', '')>
${title}${tag}
#macro>
<@layout title="${blog_title!}" canonical="${blog_url!}">
<#if posts.content?? && posts.content?size gt 0>
<#if is_first_index!false>
<#assign carousel_content>
<#list posts.content as post>
<#if post.topPriority!=1>
<#break>
#if>
<#if !post.metas?? || (post.metas.index_carousel!'false')=='false'>
<#continue>
#if>
<#assign thumbnail = (post.thumbnail?? && post.thumbnail!='')?then(post.thumbnail!, (settings.default_thumbnail?? && settings.default_thumbnail!='')?then(settings.default_thumbnail + settings.default_thumbnail?contains('?')?then("&","?") + "postId=" + post.id?c, ''))>
<#if thumbnail != ''>
${post.title!}
- <@global.timeline datetime=post.createTime/>
- ${post.visits?c}
<#if !post.disallowComment!false>
- ${post.commentCount?c}
#if>
- ${post.likes?c}
<#assign heat= (24+post.visits*0.1+post.likes*2+post.commentCount*3) />
<#assign heatColor= '#'+(heat < 37)?string('ffa87e',(heat < 120)?string('fb734a','e0081c')) />
- ${heat}℃
#if>
#list>
#assign>
<#if settings.sidebar_column=='module-left' || settings.sidebar_column=='module-right'>
<#if settings.module_options?? && settings.module_options?size > 0>
<#list 0..1 as i>
<#if i < settings.module_options?size >
<@model_build settings.module_options[i]/>
#if>
#list>
<#else>
<#list 0..1 as i>
<#if i < posts.content?size >
<#assign postOption=posts.content[i]>
<@model_build {"tag": "推荐", "title": "${postOption.title!}", "url": "${postOption.fullPath}", "image": "${postOption.thumbnail}", "target": "_self"}/>
#if>
#list>
#if>
<#if settings.module_options?? && settings.module_options?size > 2 && settings.module_options?size<=6>
<#list 2..5 as i>
<#if i < settings.module_options?size >
<@model_build settings.module_options[i]/>
#if>
#list>
#if>
<#assign is_carousel=true />
<#elseif carousel_content != ''>
<#assign is_carousel=true />
#if>
<#if settings.index_inform?? && settings.index_inform != ''>
${settings.index_inform}
#if>
#if>
<#include "template/main/article_list.ftl">
<@article_list posts.content/>
<#include "template/main/pagination.ftl">
<@pagination method="index" datas=posts display="${settings.page_number!5}" />
<#else>
还没有发表过文章
#if>
@layout>
================================================
FILE: journals.ftl
================================================
<#include "template/layout.ftl">
<#include "template/main/comment.ftl">
<@layout title="${journals_title!'动态'} - ${blog_title!}" canonical="${journals_url!}">
<#if journals.content?? && journals.content?size gt 0>
<#list journals.content as journal>
${journal.createTime?string('yyyy年MM月dd日 HH:mm:ss')}
<#if enable_comment>
#if>
#list>
<#include "template/main/pagination.ftl">
<@pagination method="journals" datas=journals display="${settings.page_number!5}" />
<#else>
#if>
@layout>
================================================
FILE: links.ftl
================================================
<#include "template/layout.ftl">
<@layout title="${links_title!'友情链接'} - ${blog_title!}" canonical="${links_url!}">
<#if settings.links_thumbnail?? && settings.links_thumbnail!=''>
#if>
${links_title!'友情链接'} - ${user.nickname!}的小伙伴们
<@linkTag method="listTeams">
<#assign defaultAvatar= (settings.links_default_avatar?? && settings.links_default_avatar!='')?string(settings.links_default_avatar!, static + "/source/img/avatar.svg") />
<#list teams as item>
<#if item.team?? && item.team!=''>
${item.team}
<#else>
小伙伴们
#if>
#list>
@linkTag>
<#if (settings.show_exchange_info!true) || (settings.links_info?? && settings.links_info != '')>
#if>
<#if settings.show_exchange_info!true>
申请友链的方法:
<#assign bloggerAvatar= (settings.links_blogger_avatar?? && settings.links_blogger_avatar!='')?string(settings.links_blogger_avatar!, user.avatar!) />
#if>
${settings.links_info!}
<#if enable_comment>
#if>
@layout>
================================================
FILE: mail_template/mail_notice.ftl
================================================
<#assign emojis={'呵呵':'hehe','哈哈':'haha','吐舌':'tushe','啊':'a','酷':'ku','怒':'nu','开心':'kaixin','汗':'han','泪':'lei','黑线':'heixian','鄙视':'bishi','不高兴':'bugaoxing','真棒':'zhenbang','钱':'qian','疑问':'yiwen','阴险':'yingxiang','吐':'tu','咦':'yi','委屈':'weiqu','花心':'huaxin','呼~':'hu','笑眼':'xiaoyan','冷':'len','太开心':'taikaixin','滑稽':'huaji','勉强':'mianqiang','狂汗':'kuanhan','乖':'guai','睡觉':'shuijiao','惊哭':'jingku','生气':'shengqi','惊讶':'jingya','喷':'pen','突然兴奋':'turanxingfen','挖鼻':'wabi','摊手':'tanshou','捂嘴笑':'wuzuixiao','喝酒':'hejiu','犀利':'xili','懒得理':'landeli','炸药':'zhayao','吃瓜':'chigua','小乖':'xiaoguai','你懂的':'nidongde','嘿嘿嘿':'heiheihei','欢呼':'huanhu','笑尿':'xiaoniao','酸爽':'suanshuang','紧张':'jinzhang','暗中观察':'anzhongguancha','小红脸':'xiaohonglian','呀咩爹':'yamiedie','微微一笑':'weiweiyixiao','what':'what','托腮':'tuosai','噗':'pu','困成狗':'kunchenggou','柯基暗中观察':'kejianzhongguancha','菜狗':'caigou','老虎':'laohu','嗷呜':'aowu','奥特曼':'aoteman','黑头高兴':'heitougaoxing','黑头瞪眼':'heitoudengyan','望远镜':'wangyuanjing','不听':'butin','干饭':'ganfan','大拇指':'damuzhi','胜利':'shengli','haha':'haha2','OK':'ok','红领巾':'honglingjin','爱心':'aixin','心碎':'xinsui','玫瑰':'meigui','礼物':'liwu','烟花':'yanhua','彩虹':'caihong','太阳':'taiyang','星星月亮':'xingxingyueliang','蛋糕':'dangao','茶杯':'chabei','香蕉':'xiangjiao','便便':'bianbian','药丸':'yaowan','钱币':'qianbi','蜡烛':'lazhu','沙发':'shafa','音乐':'yinyue','灯泡':'dengpao','手纸':'shouzhi'}>
<#function rendered_html content>
<#local content=content?replace('\\!\\[([^\\]]*)\\]\\(([^\\)]*)\\)', '
', 'ri')>
<#local content=content?replace('\\[([^\\]]*)\\]\\(([^\\)]*)\\)', '$1', 'ri')>
<#local content=content?replace('^#+\\s+([^\\n]*)', '$1
', 'rmi')>
<#local content=content?replace('```\\w*\\n([^`]*)\\n```', '$1
', 'ri')>
<#local content=content?replace('`([^`]*)`', '$1', 'ri')>
<#local content=content?replace('\\n+', '\n', 'ri')>
<#list emojis?keys as key>
<#local content=content?replace('\\[/${key}\\]','
','ri')>
#list>
<#return content>
#function>
您的博客有新的评论啦!
${user.nickname!'博主'} ,您好!
访客 ${author!'匿名用户'} 在《${pageTitle!}》发表评论:
${rendered_html(content)}
点击查看完整评论
================================================
FILE: mail_template/mail_reply.ftl
================================================
<#assign emojis={'呵呵':'hehe','哈哈':'haha','吐舌':'tushe','啊':'a','酷':'ku','怒':'nu','开心':'kaixin','汗':'han','泪':'lei','黑线':'heixian','鄙视':'bishi','不高兴':'bugaoxing','真棒':'zhenbang','钱':'qian','疑问':'yiwen','阴险':'yingxiang','吐':'tu','咦':'yi','委屈':'weiqu','花心':'huaxin','呼~':'hu','笑眼':'xiaoyan','冷':'len','太开心':'taikaixin','滑稽':'huaji','勉强':'mianqiang','狂汗':'kuanhan','乖':'guai','睡觉':'shuijiao','惊哭':'jingku','生气':'shengqi','惊讶':'jingya','喷':'pen','突然兴奋':'turanxingfen','挖鼻':'wabi','摊手':'tanshou','捂嘴笑':'wuzuixiao','喝酒':'hejiu','犀利':'xili','懒得理':'landeli','炸药':'zhayao','吃瓜':'chigua','小乖':'xiaoguai','你懂的':'nidongde','嘿嘿嘿':'heiheihei','欢呼':'huanhu','笑尿':'xiaoniao','酸爽':'suanshuang','紧张':'jinzhang','暗中观察':'anzhongguancha','小红脸':'xiaohonglian','呀咩爹':'yamiedie','微微一笑':'weiweiyixiao','what':'what','托腮':'tuosai','噗':'pu','困成狗':'kunchenggou','柯基暗中观察':'kejianzhongguancha','菜狗':'caigou','老虎':'laohu','嗷呜':'aowu','奥特曼':'aoteman','黑头高兴':'heitougaoxing','黑头瞪眼':'heitoudengyan','望远镜':'wangyuanjing','不听':'butin','干饭':'ganfan','大拇指':'damuzhi','胜利':'shengli','haha':'haha2','OK':'ok','红领巾':'honglingjin','爱心':'aixin','心碎':'xinsui','玫瑰':'meigui','礼物':'liwu','烟花':'yanhua','彩虹':'caihong','太阳':'taiyang','星星月亮':'xingxingyueliang','蛋糕':'dangao','茶杯':'chabei','香蕉':'xiangjiao','便便':'bianbian','药丸':'yaowan','钱币':'qianbi','蜡烛':'lazhu','沙发':'shafa','音乐':'yinyue','灯泡':'dengpao','手纸':'shouzhi'}>
<#function rendered_html content>
<#local content=content?replace('\\!\\[([^\\]]*)\\]\\(([^\\)]*)\\)', '
', 'ri')>
<#local content=content?replace('\\[([^\\]]*)\\]\\(([^\\)]*)\\)', '$1', 'ri')>
<#local content=content?replace('^#+\\s+([^\\n]*)', '$1
', 'rmi')>
<#local content=content?replace('```\\w*\\n([^`]*)\\n```', '$1
', 'ri')>
<#local content=content?replace('`([^`]*)`', '$1', 'ri')>
<#local content=content?replace('\\n+', '\n', 'ri')>
<#list emojis?keys as key>
<#local content=content?replace('\\[/${key}\\]','
','ri')>
#list>
<#return content>
#function>
Dear, 您在 ${blog_title!} 上的评论有新的回复啦!
${baseAuthor!'Dear'} ,您好!
您在《${pageTitle!}》的评论:
${rendered_html(baseContent)}
${replyAuthor!'匿名用户'} 给您的回复:
${rendered_html(replyContent)}
点击查看完整回复
================================================
FILE: package.json
================================================
{
"name": "halo-theme-dream",
"version": "3.2.4",
"description": "梦之城,童话梦境,动漫类型博客主题。",
"main": "index.js",
"author": "nineya",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"release": "eslint **/*.js && gulp release",
"push": "eslint **/*.js && gulp push",
"zip": "gulp zip",
"build": "eslint **/*.js && gulp",
"lint": "eslint **/*.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/nineya/halo-theme-dream.git"
},
"keywords": [
"halo",
"dream",
"nineya",
"halo-theme",
"halo-theme-dream"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/nineya/halo-theme-dream/issues"
},
"homepage": "https://github.com/nineya/halo-theme-dream#readme",
"devDependencies": {
"@babel/core": "^7.15.5",
"@babel/plugin-transform-runtime": "^7.15.0",
"@babel/preset-env": "^7.15.6",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.2.3",
"eslint": "^7.32.0",
"gulp": "^4.0.2",
"gulp-autoprefixer": "^8.0.0",
"gulp-babel": "^8.0.0",
"gulp-clean": "^0.4.0",
"gulp-csso": "^4.0.1",
"gulp-gzip": "^1.4.2",
"gulp-less": "^5.0.0",
"gulp-rename": "^2.0.0",
"gulp-uglify": "^3.0.2",
"gulp-zip": "^5.1.0",
"webpack": "^5.68.0",
"webpack-stream": "^7.0.0"
},
"dependencies": {
"html2canvas": "^1.4.1",
"qrcode": "^1.5.1"
}
}
================================================
FILE: photos.ftl
================================================
<#include "template/layout.ftl">
<@layout title="${photos_title!'我的相册'} - ${blog_title!}" canonical="${photos_url!}">
<#if (photos.content)?? && photos.content?size gt 0>
- 全部
<@photoTag method="listTeams">
<#list teams as item>
- ${((item.team)?length>0)?then(item.team?trim,'默认图库')}
#list>
@photoTag>
<#else>
#if>
@layout>
================================================
FILE: post.ftl
================================================
<#include "template/layout.ftl">
<#include "template/main/article.ftl">
<@layout title="${post.title!} - ${blog_title!}" canonical="${post.fullPath!}">
<@article post,"post" />
@layout>
================================================
FILE: post_literature.ftl
================================================
<#include "template/layout.ftl">
<#include "template/main/article_literature.ftl">
<@layout title="${post.title!} - ${blog_title!}" canonical="${post.fullPath!}">
<@articleLiterature post,"post" />
@layout>
================================================
FILE: post_password.ftl
================================================
<#include "template/layout.ftl">
<#include "template/main/article.ftl">
<@layout title="私密内容访问 - ${blog_title!}" canonical="${blog_url!}">
@layout>
================================================
FILE: search.ftl
================================================
<#include "template/layout.ftl">
<@layout title="搜索:${keyword} - ${blog_title!}" canonical="${blog_url!}/search?keyword=${keyword}">
<#if (posts.content)?? && posts.content?size gt 0>
<#include "template/main/article_list.ftl">
<@article_list posts.content/>
<#include "template/main/pagination.ftl">
<@pagination method="search" datas=posts keyword="${keyword!}" display="${settings.page_number!5}" />
<#else>
#if>
@layout>
================================================
FILE: settings.yaml
================================================
basic_info:
label: '基础信息'
items:
access_key:
name: access_key
label: '<必填> AccessKey'
type: text
default: dream
placeholder: '请输入 Access Key'
description: "需在博客 高级设置 中开启 API 服务,并使此处的 Access Key 与 API 设置中的保持一致。
注:Access Key 用于主题中 Content API 校验,填写有误将导致接口报错。
"
small_title:
name: small_title
label: 网站副标题
type: text
placeholder: '请输入网站副标题'
document_hidden_title:
name: document_hidden_title
label: 离屏文案(离开)
type: text
placeholder: '请输入标题'
description: '浏览器切换到其它标签或后台时页面标题展示的文字。'
document_visible_title:
name: document_visible_title
label: 离屏文案(回来)
type: text
placeholder: '请输入标题'
description: '浏览器返回到当前标签时页面标题展示的文字。'
index_inform:
name: index_inform
label: 首页通知
type: text
placeholder: 请输入通知内容
description: '在首页显示一条通知。'
copy_explain:
name: copy_explain
label: 拷贝说明
type: textarea
placeholder: 请输入说明内容
description: '当用户拷贝文本时,自动将该文本内容追加到最后面。'
night_logo:
name: night_logo
label: '黑暗模式 Logo'
type: attachment
placeholder: '请输入/选择 Logo 路径'
description: '在黑暗模式时显示的 Logo,放空默认为网站 Logo。'
page_number:
name: page_number
label: 分页页码数量
type: number
placeholder: '请输入数量数值'
default: '5'
record_number:
name: record_number
label: 备案号
type: text
placeholder: 'XICP备XXXXXXXXXX号-X'
record_number_ps:
name: record_number_ps
label: 公安部备案
type: text
placeholder: 'X公网安备 XXXXXXXXXXXXXX号'
website_time:
name: website_time
label: 建站时间
type: text
placeholder: 'YYYY/MM/dd HH:mm:ss'
description: '按 YYYY/MM/dd HH:mm:ss 格式输入时间进行倒计时,非时间格式则直接显示文本。'
cloud_by_logo:
name: cloud_by_logo
label: '云服务提供商 Logo'
type: attachment
placeholder: '请输入/选择 Logo 路径'
cloud_by_url:
name: cloud_by_url
label: '云服务提供商 URL'
type: text
placeholder: '请输入链接地址'
basic_style:
label: 基础样式
items:
load_progress:
name: load_progress
label: 加载进度条
type: radio
default: center
options:
- value: none
label: 不显示
- value: left
label: 左侧展开
- value: center
label: 居中展开
drawer_toc:
name: drawer_toc
label: 侧边抽屉式目录
type: radio
data-type: bool
default: true
description: "在非桌面设备上,显示展开侧边抽屉式目录的悬浮按钮。
"
options:
- value: true
label: 显示
- value: false
label: 不显示
enable_image_bg:
name: enable_image_bg
label: 开启博客背景图
type: switch
data-type: bool
default: false
description: '如果某个选项的背景图链接未指定,则不开启那个选项的背景图。'
options:
- value: true
label: 开启
- value: false
label: 关闭
background_pc:
name: background_pc
label: '明亮模式 PC 端背景图'
type: attachment
placeholder: '请输入/选择图片路径'
background_mobile:
name: background_mobile
label: 明亮模式移动端背景图
type: attachment
placeholder: '请输入/选择图片路径'
night_background_pc:
name: night_background_pc
label: '黑暗模式 PC 端背景图'
type: attachment
placeholder: '请输入/选择图片路径'
night_background_mobile:
name: night_background_mobile
label: 黑暗模式移动端背景图
type: attachment
placeholder: '请输入/选择图片路径'
enable_banner:
name: enable_banner
label: 开启博客横幅大图
type: switch
data-type: bool
default: false
options:
- value: true
label: 开启
- value: false
label: 关闭
banner_image:
name: banner_image
label: 横幅背景图
type: attachment
placeholder: '请输入/选择图片路径'
banner_description:
name: banner_description
label: 横幅文字描述
type: text
placeholder: '请输入描述内容'
theme_style:
name: theme_style
label: 主题风格
type: select
default: 'default'
description: '主题风格效果,不改变主题整体框架。'
options:
- value: 'default'
label: 默认
- value: 'clean'
label: 清爽
- value: 'celebration'
label: 庆典
default_theme:
name: default_theme
label: 默认主题模式
type: select
default: 'light'
description: '未打开过博客的浏览器,首次打开博客时的默认主题模式。'
options:
- value: 'light'
label: 明亮模式
- value: 'night'
label: 黑暗模式
- value: 'system'
label: 跟随系统
theme_color:
name: theme_color
label: 明亮模式主题色
type: color
default: '#50bfff'
night_theme_color:
name: night_theme_color
label: 黑暗模式主题色
type: color
default: '#5d93db'
web_font:
name: web_font
label: 博客字体
type: select
default: 'default'
options:
- value: 'default'
label: 默认字体
- value: 'WenCang.woff2'
label: 问藏书房体
- value: 'AlimamaDaoLiTi.woff2'
label: 阿里巴巴刀隶体
- value: 'custom'
label: 自定义
custom_font:
name: custom_font
label: 自定义博客字体
type: attachment
placeholder: '请输入/选择字体路径'
description: '自定义博客字体,在 博客字体 选项为 自定义 时生效。支持 woff2/woff/ttf/eot/svg 格式的字体文件链接,建议使用 woff2 格式。'
sidebar_column:
name: sidebar_column
label: 博客布局方式
type: select
default: 'all'
options:
- value: 'all'
label: 三列布局
- value: 'only-left'
label: 仅显示左侧
- value: 'only-right'
label: 仅显示右侧
- value: 'module-left'
label: 模块化(左侧)
- value: 'module-right'
label: 模块化(右侧)
left_sidebar_sticky:
name: left_sidebar_sticky
label: 左侧边栏悬浮
type: radio
default: bottom
options:
- value: top
label: 固定顶部
- value: bottom
label: 固定底部
- value: none
label: 不悬浮
right_sidebar_sticky:
name: right_sidebar_sticky
label: 右侧边栏悬浮
type: radio
default: top
options:
- value: top
label: 固定顶部
- value: bottom
label: 固定底部
- value: none
label: 不悬浮
module_options:
name: module_options
label: 模块化布局链接
type: repeater
description: '可填写 1~6 个链接。'
children:
- name: tag
label: 标签
type: text
placeholder: '请输入标签内容'
- name: title
label: 标题
type: text
placeholder: '请输入标题内容'
- name: url
label: 跳转地址
type: text
placeholder: '请输入跳转地址'
- name: image
label: 背景图链接
type: attachment
placeholder: '请输入图片地址'
- name: target
label: 打开方式
type: radio
default: '_blank'
options:
- value: '_blank'
label: 新窗口
- value: '_self'
label: 原窗口
post:
label: 文章设置
items:
default_thumbnail:
name: default_thumbnail
label: 默认文章缩略图
type: attachment
placeholder: '请输入/选择图片路径'
description: "如果文章没有指定缩略图,则默认显示当前缩略图。
"
top_thumbnail_mode:
name: top_thumbnail_mode
label: 置顶文章列表缩略图模式
type: select
default: back
description: '置顶的文章在列表的缩略图模式,除网格布局外,如果文章元数据配置了 thumbnail_mode 项,则当前配置将被覆盖。
注:设置网格布局后,非置顶文章也会变成网格布局。'
options:
- value: default
label: 默认模式
- value: back
label: 背景图模式
- value: small
label: 小图模式(左侧)
- value: small-right
label: 小图模式(右侧)
- value: small-alter
label: 小图模式(交替)
- value: fold
label: 折叠模式
- value: grid
label: 网格模式(强优先)
thumbnail_mode:
name: thumbnail_mode
label: 文章列表缩略图模式
type: select
default: default
description: '文章列表缩略图模式,除网格布局外,如果文章元数据配置了 thumbnail_mode 项,则当前配置将被覆盖。'
options:
- value: default
label: 默认模式
- value: back
label: 背景图模式
- value: small
label: 小图模式(左侧)
- value: small-right
label: 小图模式(右侧)
- value: small-alter
label: 小图模式(交替)
- value: grid
label: 网格模式(强优先)
code_pretty:
name: code_pretty
label: 代码块高亮主题
type: select
default: atom-one-light
options:
- value: a11y-dark
label: A11y Dark
- value: a11y-light
label: A11y Light
- value: agate
label: Agate
- value: an-old-hope
label: An Old Hope
- value: androidstudio
label: Androidstudio
- value: arduino-light
label: Arduino Light
- value: arta
label: Arta
- value: ascetic
label: Ascetic
- value: atom-one-dark
label: Atom One Dark
- value: atom-one-dark-reasonable
label: Atom One Dark Reasonable
- value: atom-one-light
label: Atom One Light
- value: brown-paper
label: Brown Paper
- value: brown-papersq
label: Brown Papersq
- value: codepen-embed
label: Codepen Embed
- value: color-brewer
label: Color Brewer
- value: dark
label: Dark
- value: default
label: Default
- value: devibeans
label: Devibeans
- value: docco
label: Docco
- value: far
label: Far
- value: foundation
label: Foundation
- value: github-dark-dimmed
label: Github Dark Dimmed
- value: github-dark
label: Github Dark
- value: github
label: Github
- value: gml
label: Gml
- value: googlecode
label: Googlecode
- value: gradient-dark
label: Gradient Dark
- value: gradient-light
label: Gradient Light
- value: grayscale
label: Grayscale
- value: hybrid
label: Hybrid
- value: idea
label: Idea
- value: ir-black
label: Ir Black
- value: isbl-editor-dark
label: Isbl Editor Dark
- value: isbl-editor-light
label: Isbl Editor Light
- value: kimbie-dark
label: Kimbie Dark
- value: kimbie-light
label: Kimbie Light
- value: lightfair
label: Lightfair
- value: lioshi
label: Lioshi
- value: magula
label: Magula
- value: mono-blue
label: Mono Blue
- value: monokai-sublime
label: Monokai Sublime
- value: monokai
label: Monokai
- value: night-owl
label: Night Owl
- value: nnfx-dark
label: Nnfx dark
- value: nnfx-light
label: Nnfx Light
- value: nord
label: Nord
- value: obsidian
label: Obsidian
- value: paraiso-dark
label: Paraiso Dark
- value: paraiso-light
label: Paraiso Light
- value: pojoaque
label: Pojoaque
- value: purebasic
label: Purebasic
- value: qtcreator-dark
label: Qtcreator Dark
- value: qtcreator-light
label: Qtcreator Light
- value: rainbow
label: Rainbow
- value: routeros
label: Routeros
- value: school-book
label: School Book
- value: shades-of-purple
label: Shades Of Purple
- value: srcery
label: Srcery
- value: stackoverflow-dark
label: Stackoverflow Dark
- value: stackoverflow-light
label: Stackoverflow Light
- value: sunburst
label: Sunburst
- value: tomorrow-night-blue
label: Tomorrow Night Blue
- value: tomorrow-night-bright
label: Tomorrow Night Bright
- value: vs
label: Vs
- value: vs2015
label: Vs 2015
- value: xcode
label: Xcode
- value: xt256
label: Xt 256
code_fold_line:
name: code_fold_line
label: 代码块折叠
type: number
placeholder: '请输入代码行数数值'
description: '代码行数超出指定行数后默认进行折叠,指定的行数需大于等于 20。'
img_fold_height:
name: img_fold_height
label: 正文长图折叠
type: number
placeholder: '请输入高度数值(px)'
description: '图片高度超出指定高度(px)后默认进行折叠,指定的高度需大于等于 400px。'
show_img_name:
name: show_img_name
label: 显示图片名称
type: radio
data-type: bool
default: true
options:
- value: true
label: 开启
- value: false
label: 关闭
invalid_tips_day:
name: invalid_tips_day
label: 文章失效提示
type: number
default: 99999999
placeholder: '请输入时间(天)'
description: '文章超过指定天数未进行更新,展示文章或图片可能失效的温馨提示。'
enable_katex:
name: enable_katex
label: KaTeX 公式支持
type: radio
data-type: bool
default: false
description: '博客通过 KaTeX 做数学公式渲染,如果文章或页面元数据配置了 enable_katex 项,则当前配置将被覆盖。'
options:
- value: true
label: 默认开启
- value: false
label: 默认关闭
enable_copyright:
name: enable_copyright
label: 开启文章版权声明
type: radio
data-type: bool
default: true
description: '如果文章或页面元数据配置了 enable_copyright 项,则当前配置将被覆盖。'
options:
- value: true
label: 默认开启
- value: false
label: 默认关闭
enable_post_share:
name: enable_post_share
label: 开启文章分享
type: radio
data-type: bool
default: true
description: '如果文章或页面元数据配置了 enable_share 项,则当前配置将被覆盖。'
options:
- value: true
label: 默认开启
- value: false
label: 默认关闭
enable_post_donate:
name: enable_post_donate
label: 开启文章打赏
type: radio
data-type: bool
default: true
description: '如果文章或页面元数据配置了 enable_donate 项,则当前配置将被覆盖。'
options:
- value: true
label: 默认开启
- value: false
label: 默认关闭
donate_alipay:
name: donate_alipay
label: 支付宝捐赠二维码
type: attachment
placeholder: '请输入/选择图片路径'
donate_wechat:
name: donate_wechat
label: 微信捐赠二维码
type: attachment
placeholder: '请输入/选择图片路径'
comment:
label: 评论区
items:
enable_comment:
name: enable_comment
label: 开启评论功能
type: switch
data-type: bool
default: true
description: "如果在进行网站备案,可通过此功能全局关闭评论区。
"
options:
- value: true
label: 开启
- value: false
label: 关闭
enable_theme_comment:
name: enable_theme_comment
label: 启用主题内置评论区
type: switch
data-type: bool
default: true
description: '开启后将使用主题内置的评论区模块,如果使用其他评论区模块以下评论区相关的配置可能不生效。'
options:
- value: true
label: 开启
- value: false
label: 关闭
anonymous_user_name:
name: anonymous_user_name
label: 匿名用户名
type: text
placeholder: '请输入用户名'
description: '填写后将允许用户匿名评论,并使用此名称做用户名。'
avatar_loading:
name: avatar_loading
label: 头像加载动画
type: attachment
placeholder: '请输入/选择图片路径'
description: '加载用户头像时的加载动画。'
default_avatar:
name: default_avatar
label: 默认评论头像
type: attachment
placeholder: '请输入/选择图片路径'
description: '如果用户头像加载失败,则显示默认头像。'
enable_qq_info:
name: enable_qq_info
label: '获取 QQ 昵称和邮箱'
type: switch
data-type: bool
default: false
description: '评论时,访客在用户名处输入 QQ 号,自动通过 QQ 获取昵称和邮箱。'
options:
- value: true
label: 开启
- value: false
label: 关闭
priority_qq_avatar:
name: priority_qq_avatar
label: '优先显示 QQ 头像'
type: switch
data-type: bool
default: false
description: '如果是 QQ 邮箱,则优先使用 QQ 头像。'
options:
- value: true
label: 开启
- value: false
label: 关闭
enable_image_upload:
name: enable_image_upload
label: 开启图片上传
type: switch
data-type: bool
description: '开启评论区内置的图片上传功能。'
default: false
options:
- value: true
label: 开启
- value: false
label: 关闭
image_upload_api:
name: image_upload_api
label: '图片上传 API'
type: text
placeholder: '请输入 API 地址'
description: '评论区支持快捷上传图片到指定的 API 接口,搭建 API 规范要求见文档 halo-comment-dream。'
enable_blogger_operation:
name: enable_blogger_operation
label: 开启博主操作
type: switch
description: '如果在该浏览器博主已登录,允许博主直接在评论区上进行操作。'
data-type: bool
default: true
options:
- value: true
label: 开启
- value: false
label: 关闭
autoload_comment:
name: autoload_comment
label: 自动加载评论列表
type: switch
data-type: bool
default: true
options:
- value: true
label: 开启
- value: false
label: 关闭
comment_loading_style:
name: comment_loading_style
label: 评论加载样式
type: radio
data-type: text
default: default
options:
- value: default
label: 默认
- value: circle
label: 圆圈
- value: balls
label: 小球
reply_desc_soft:
name: reply_desc_soft
label: 二级回复列表按时间降序
type: switch
data-type: bool
description: '评论中的二级回复列表按回复时间降序排序(默认为升序)。'
default: false
options:
- value: true
label: 开启
- value: false
label: 关闭
unfold_reply_num:
name: unfold_reply_num
label: 默认展开的二级回复数量
type: number
default: 6
placeholder: '请输入数量数值'
show_comment_ua:
name: show_comment_ua
label: 显示评论的 UA 信息
type: switch
data-type: bool
default: true
options:
- value: true
label: 开启
- value: false
label: 关闭
enable_bullet_screen:
name: enable_bullet_screen
label: 开启评论弹幕
type: radio
data-type: bool
default: false
description: '如果文章或页面元数据配置了 enable_bullet_screen 项,则当前配置将被覆盖。'
options:
- value: true
label: 默认开启
- value: false
label: 默认关闭
enable_comment_html:
name: enable_comment_html
label: '开启评论 HTML 内容'
type: switch
data-type: bool
default: false
description: '允许评论输入 HTML 内容,开启后有 用户注入恶意代码的风险(XSS),建议同时开启评论审核。'
options:
- value: true
label: 开启
- value: false
label: 关闭
sidebar_show:
label: 侧边栏显示
items:
sidebar_show:
name: sidebar_show
label: 侧边栏显示
type: repeater
description: '配置主题左右侧边栏显示位置和顺序。三列布局时音乐模块不能在右侧显示。'
default:
- type: profile
location: left
hide: 'is-not-hidden'
- type: toc
location: right
hide: 'is-hidden-not-desktop'
- type: notice
location: right
hide: 'is-not-hidden'
- type: recent_posts
location: right
hide: 'is-not-hidden'
- type: recent_comments
location: right
hide: 'is-not-hidden'
- type: categories
location: left
hide: 'is-not-hidden'
- type: tags
location: left
hide: 'is-not-hidden'
- type: links
location: right
hide: 'is-hidden-not-desktop'
children:
- name: type
type: select
label: 模块类型
default: profile
options:
- value: profile
label: 信息模块
- value: toc
label: 目录模块
- value: notice
label: 公告模块
- value: love
label: 恋爱墙模块
- value: music
label: 音乐模块
- value: ad_piece
label: 广告模块
- value: recent_posts
label: 最近文章模块
- value: recent_comments
label: 最近评论模块
- value: categories
label: 文章分类模块
- value: tags
label: 文章标签模块
- value: tagcloud
label: 文章标签云模块
- value: links
label: 友链模块
- value: custom
label: 自定义模块
- name: location
label: 模块位置
type: radio
default: none
options:
- value: left
label: 左侧
- value: right
label: 右侧
- value: none
label: 关闭
- name: hide
label: 隐藏方式
type: select
default: 'is-not-hidden'
options:
- value: 'is-hidden-mobile'
label: 移动设备隐藏
- value: 'is-hidden-not-desktop'
label: 移动、平板设备隐藏
- value: 'is-hidden-desktop'
label: 桌面设备隐藏
- value: 'is-not-hidden'
label: 不隐藏
- name: title
label: 侧边栏标题
type: text
placeholder: 请输入标题内容
description: "非必填,可覆盖默认侧边栏标题。"
- name: icon
label: 侧边栏图标
type: text
placeholder: 请输入图标 class 内容
description: "非必填,可覆盖默认侧边栏图标。"
- name: content
label: 侧边栏内容
type: textarea
placeholder: 请输入 HTML 内容
description: "非必填,仅在侧边栏类型为自定义时生效。"
sidebar_config:
label: 侧边栏配置
items:
enable_color_character:
name: enable_color_character
label: 侧边栏信息-开启彩字切换
type: switch
data-type: bool
default: false
options:
- value: true
label: 开启
- value: false
label: 关闭
color_character:
name: color_character
label: 侧边栏信息-彩字内容
type: textarea
placeholder: 请输入彩字内容
description: "按行输入彩字消息内容,一行一条。
"
profile_location:
name: profile_location
label: 侧边栏信息-地理位置
type: text
placeholder: '请输入个人所在地'
profile_theme_button:
name: profile_theme_button
label: 侧边栏信息-主题按钮
type: text
placeholder: '按钮名称|按钮地址'
description: '需要 按钮名称 和 按钮地址 两个参数,参数间用 “|” 分隔,放空则不显示主题按钮。'
social_github:
name: social_github
label: 侧边栏信息-Github
type: text
placeholder: '请输入 Github 用户名'
social_qq:
name: social_qq
label: 侧边栏信息-QQ
type: text
placeholder: '请输入 QQ 号'
social_weibo:
name: social_weibo
label: 侧边栏信息-微博
type: text
placeholder: '请输入微博用户名'
social_twitter:
name: social_twitter
label: 侧边栏信息-Twitter
type: text
placeholder: '请输入 Twitter 用户名'
social_facebook:
name: social_facebook
label: 侧边栏信息-Facebook
type: text
placeholder: '请输入 Facebook 用户名'
social_email:
name: social_email
label: '侧边栏信息-邮箱'
type: text
placeholder: '请输入邮箱地址'
social_telegram:
name: social_telegram
label: 侧边栏信息-Telegram
type: text
placeholder: '请输入 Telegram 用户名'
social_rss:
name: social_rss
label: '侧边栏信息-RSS 订阅'
type: select
data-type: bool
default: true
options:
- value: true
label: 开启
- value: false
label: 关闭
custom_social_options:
name: custom_social_options
label: 侧边栏信息-自定义社交渠道选项
type: textarea
placeholder: "名称|图标|链接地址"
description: 一行表示一个社交渠道,每个社交渠道需要名称、图标和链接地址三个参数,参数之间使用 “|” 分隔,主题内置图标采用 RemixIcon 3.5.0'。
notice_content:
name: notice_content
label: 侧边栏公告-博客公告
type: textarea
placeholder: 请输入公告内容
description: 公告内容支持 HTML 标签。
notice_show_mode:
name: notice_show_mode
label: 侧边栏公告-显示模式
type: radio
default: index
description: 当满足指定的条件时公告模块才会显示。
options:
- value: none
label: 无条件
- value: toc
label: 目录模块不显示时
- value: index
label: 仅首页
love_oneself_avatar:
name: love_oneself_avatar
label: 侧边栏恋爱墙-自己的头像
type: attachment
placeholder: '请输入/选择图片路径'
love_oneself_url:
name: love_oneself_url
label: 侧边栏恋爱墙-自己的主页
type: text
placeholder: '请输入个人主页地址'
love_opposite_avatar:
name: love_opposite_avatar
label: 侧边栏恋爱墙-对方的头像
type: attachment
placeholder: '请输入/选择图片路径'
love_opposite_url:
name: love_opposite_url
label: 侧边栏恋爱墙-对方的主页
type: text
placeholder: '请输入个人主页地址'
love_time:
name: love_time
label: 侧边栏恋爱墙-恋爱时间
type: text
placeholder: 'YYYY/MM/dd HH:mm:ss'
description: '按 YYYY/MM/dd HH:mm:ss 格式输入时间进行倒计时,非时间格式则直接显示文本。'
meting_api:
name: meting_api
label: 侧边栏音乐-自建API
type: text
placeholder: '请输入 API 地址'
description: '自建 API 方法见文档:Meting。'
music_mode:
name: music_mode
label: 侧边栏音乐-音乐播放器配置方式
type: radio
default: 'playlist'
options:
- value: 'playlist'
label: '网易云歌单 ID'
- value: 'config'
label: 参数进阶配置
netease_playlist_id:
name: netease_playlist_id
label: '侧边栏音乐-网易云歌单 ID'
type: text
placeholder: '请输入歌单 ID'
description: '填写网易云歌单的 ID。'
music_config:
name: music_config
label: 侧边栏音乐-参数进阶配置
type: code
placeholder: '请输入音乐参数配置'
default: |-
list-folded="true"
server="netease"
type="playlist"
id="7355014621"
description: '输入音乐参数配置(id / server / type必填),详细配置方式见官方文档:MetingJS 2.0。'
show_ad_tag:
name: show_ad_tag
label: 侧边栏广告-显示“广告”标签
type: radio
data-type: bool
default: true
options:
- value: true
label: 显示
- value: false
label: 不显示
ad_tag_close:
name: ad_tag_close
label: 侧边栏广告-点击“广告”标签可关闭广告
type: radio
data-type: bool
default: true
options:
- value: true
label: 是
- value: false
label: 否
ad_mode:
name: ad_mode
label: 侧边栏广告-广告展示方法
type: radio
data-type: bool
default: true
options:
- value: true
label: 图片+链接
- value: false
label: 自定义广告代码
ad_target_url:
name: ad_target_url
label: 侧边栏广告-广告目标地址
type: text
placeholder: '请输入链接地址'
description: '填写广告跳转的目标路径。'
ad_image:
name: ad_image
label: 侧边栏广告-广告图片链接
type: attachment
placeholder: '请输入/选择图片路径'
description: '图片+链接 模式时不能为空。'
ad_custom_code:
name: ad_custom_code
label: 侧边栏广告-自定义广告代码
type: code
placeholder: '请输入广告代码'
description: '在这里黏贴广告联盟提供的广告代码,自定义广告代码 模式时不能为空。'
recent_posts_num:
name: recent_posts_num
label: 侧边栏最近文章-展示文章数量
type: number
placeholder: 请输入数量数值
default: 5
recent_comments_num:
name: recent_comments_num
label: 侧边栏最近评论-展示评论数量
type: number
placeholder: 请输入数量数值
default: 5
categories_more:
name: categories_more
label: 侧边栏分类-显示”更多”按钮
type: radio
data-type: bool
default: true
description: '超出展示的分类数量后是否显示 更多 按钮。'
options:
- value: true
label: 显示
- value: false
label: 不显示
categories_num:
name: categories_num
label: 侧边栏分类-展示分类数量
type: number
placeholder: 请输入数量数值
default: 10
tags_more:
name: tags_more
label: 侧边栏标签-显示”更多”按钮
type: radio
data-type: bool
default: true
description: '超出展示的标签数量后是否显示 更多 按钮。'
options:
- value: true
label: 显示
- value: false
label: 不显示
tags_num:
name: tags_num
label: 侧边栏标签-展示标签数量
type: number
placeholder: 请输入数量数值
default: 18
enable_tags_color:
name: enable_tag_color
label: 侧边栏标签-开启标签颜色
type: switch
data-type: bool
default: false
options:
- value: true
label: 开启
- value: false
label: 关闭
tagcloud_more:
name: tagcloud_more
label: 侧边栏标签云-显示”更多”按钮
type: radio
data-type: bool
default: true
description: '超出展示的标签数量后是否显示 更多 按钮。'
options:
- value: true
label: 显示
- value: false
label: 不显示
tagcloud_num:
name: tagcloud_num
label: 侧边栏标签云-展示标签数量
type: number
placeholder: 请输入数量数值
default: 32
enable_tagcloud_color:
name: enable_tagcloud_color
label: 侧边栏标签云-开启标签颜色
type: switch
data-type: bool
default: false
options:
- value: true
label: 开启
- value: false
label: 关闭
links_more:
name: links_more
label: 侧边栏友链-显示”更多”按钮
type: radio
data-type: bool
default: true
description: '超出展示的友链数量后是否显示 更多 按钮。'
options:
- value: true
label: 显示
- value: false
label: 不显示
links_num:
name: links_num
label: 侧边栏友链-展示友链数量
type: number
placeholder: 请输入数量数值
default: 10
page_config:
label: 页面设置
items:
links_thumbnail:
name: links_thumbnail
label: 友链页面-缩略图
type: attachment
placeholder: '请输入/选择图片路径'
links_default_avatar:
name: links_default_avatar
label: '友链页面-默认 Logo'
type: attachment
placeholder: '请输入/选择 Logo 路径'
description: "在加载用户 Logo 时、友链未设置 Logo 时、友链 Logo 加载失败时显示。
"
show_exchange_info:
name: show_exchange_info
label: 友链页面-显示友链交换信息
type: switch
data-type: bool
default: true
options:
- value: true
label: 显示
- value: false
label: 关闭
links_blogger_avatar:
name: links_blogger_avatar
label: '友链页面-交换信息自定义 Logo 链接'
type: attachment
placeholder: '请输入/选择 Logo 路径'
description: '用于交换友链的 Logo 链接。'
links_info:
name: links_info
label: 友链页面-补充信息
type: textarea
placeholder: '请输入补充信息'
description: '友链页面最低部的补充说明信息,支持 HTML 格式。'
link_comment_id:
name: link_comment_id
label: 友链页面-评论区ID
type: number
placeholder: '请输入 ID'
description: '友链页面没有 ID,需要指定一个自定义页面的 ID 用于评论,被指定的文章评论区将作为友链的评论区, 放空则不显示评论区。 '
journals_fold_height:
name: journals_fold_height
label: 日志页面-动态内容折叠
type: number
placeholder: '请输入高度数值(px)'
description: '动态内容高度超出指定高度后默认进行折叠,指定的高度需大于等于 260px。'
enable_journals_comment:
name: enable_journals_comment
label: 日志页面-开启评论区
type: switch
data-type: bool
default: true
options:
- value: true
label: 开启
- value: false
label: 关闭
enable_journals_share:
name: enable_journals_share
label: 日志页面-开启日志分享
type: switch
data-type: bool
default: true
options:
- value: true
label: 开启
- value: false
label: 关闭
journals_share_image:
name: journals_share_image
label: 日志页面-日志分享背景图
type: attachment
placeholder: '请输入/选择图片路径'
enable_tags_tag_color:
name: enable_tags_tag_color
label: 标签页面-开启标签颜色
type: switch
data-type: bool
default: false
options:
- value: true
label: 开启
- value: false
label: 关闭
live2d:
label: 看板娘
items:
enable_live2d:
name: enable_live2d
label: 启用看板娘
type: switch
data-type: bool
default: true
options:
- value: true
label: 开启
- value: false
label: 关闭
live2d_model_url:
name: live2d_model_url
label: 模型地址
type: text
default: 'https://unpkg.com/live2d-widget-model@1.0.1/'
placeholder: '请输入 API 地址'
description: "Live2D 模型 API 地址,可直接克隆 live2d-widget-model 模型仓库实现自建地址。
"
live2d_tips_url:
name: live2d_tips_url
label: 自定义提示语文件地址
type: attachment
placeholder: '请输入/选择文件地址'
description: '提示语 JSON 文件。'
live2d_about_page:
name: live2d_about_page
label: “关于”按钮的 URL 地址
type: text
placeholder: '请输入链接地址'
description: '放空则不显示 关于 按钮。'
live2d_model_id:
name: live2d_model_id
label: '默认模型 ID'
type: number
default: 0
placeholder: '请输入模型 ID'
description: '默认模型 ID,参见 可用model列表。'
live2d_model_textures_id:
name: live2d_model_textures_id
label: '默认材质 ID'
type: number
default: 0
placeholder: '请输入材质 ID'
description: '默认材质 ID,参见 可用model列表。'
live2d_waifu_size:
name: live2d_waifu_size
label: 看板娘大小
type: text
default: '280x260'
placeholder: '请输入宽度(px)x高度(px)'
description: '看板娘的(宽度x高度),单位为px。'
options:
- value: '280x260'
- value: '320x300'
live2d_edge_side:
name: live2d_edge_side
label: 看板娘贴边方向与距离
type: text
default: 'right:50'
placeholder: '请输入位置:距离(px)'
options:
- value: 'right:50'
- value: 'left:50'
live2d_model_rand_mode:
name: live2d_model_rand_mode
label: 模型切换方式
type: radio
default: switch
options:
- value: switch
label: 顺序
- value: rand
label: 随机
live2d_model_textures_rand_mode:
name: live2d_model_textures_rand_mode
label: 材质切换方式
type: radio
default: rand
options:
- value: switch
label: 顺序
- value: rand
label: 随机
live2d_show_tool_menu:
name: live2d_show_tool_menu
label: 显示工具栏
type: switch
data-type: bool
default: true
options:
- value: true
label: 显示
- value: false
label: 关闭
live2d_tool_button:
name: live2d_tool_button
label: 显示工具栏按钮
type: checkbox
default:
- live2d_can_turn_to_home_page
- live2d_can_switch_hitokoto
- live2d_can_switch_model
- live2d_can_switch_textures
- live2d_can_take_screenshot
- live2d_can_turn_to_about_page
- live2d_can_close_live2d
options:
- value: live2d_can_turn_to_home_page
label: 返回首页
- value: live2d_can_switch_hitokoto
label: 一言
- value: live2d_can_switch_model
label: 切换模型
- value: live2d_can_switch_textures
label: 切换材质
- value: live2d_can_take_screenshot
label: 截图
- value: live2d_can_turn_to_about_page
label: 关于
- value: live2d_can_close_live2d
label: 关闭看板娘
enhance:
label: 增强功能
items:
cursor_style:
name: cursor_style
label: 鼠标风格
type: select
default: none
options:
- value: none
label: 关闭
- value: OwO
label: OwO
- value: UwU
label: UwU
- value: breeze
label: 清风(深色)
- value: mellow
label: 卡通圆润
- value: water_01
label: 彩虹水滴(一)
- value: water_02
label: 彩虹水滴(二)
- value: horse
label: 彩虹小马
- value: debris
label: 彩色碎片
- value: overwatch
label: 守望先锋
- value: rainbow_rain
label: 彩虹云雨
- value: marry
label: 小樱茉莉
- value: black_cat
label: 黑色小猫
- value: music_cat_01
label: 音乐小猫(一)
- value: music_cat_02
label: 音乐小猫(二)
cursor_move:
name: cursor_move
label: 鼠标移动特效
type: select
default: none
options:
- value: none
label: 关闭
- value: bubbleCursor
label: 气泡跟随
- value: emojiCursor
label: 表情包跟随
- value: springyEmojiCursor
label: 弹性表情包跟随
- value: fairyDustCursor
label: 仙女棒效果
- value: snowflakeCursor
label: 雪花跟随
- value: followingDotCursor
label: 圆点跟随
- value: ghostCursor
label: 移动残影(疏)
- value: trailingCursor
label: 移动残影(密)
cursor_click:
name: cursor_click
label: 鼠标点击特效
type: select
default: none
options:
- value: none
label: 关闭
- value: firework
label: 烟花特效
- value: granule
label: 粒子爆炸
- value: prosperous
label: 富强民主
- value: heart
label: 爱心特效
enable_busuanzi:
name: enable_busuanzi
label: 开启 busuanzi 访客统计
type: radio
data-type: text
default: show
description: '隐藏时不显示统计信息,但依旧会请求 busuanzi 统计访客信息。'
options:
- value: none
label: 关闭
- value: hide
label: 隐藏
- value: show
label: 显示
enable_compress:
name: enable_compress
label: "启用 HTML 压缩"
type: radio
data-type: text
default: format
options:
- value: none
label: 关闭
- value: format
label: 压缩空格
- value: single
label: 完全格式压缩
enable_sw:
name: enable_sw
label: "启用 Service Worker 优化"
type: radio
data-type: text
default: "false"
description: "需要在 Nginx 中添加 代理配置 方可启用,配置方法见 Dream 2.0.5起移除FreeCDN,以及SW配置方法。
"
options:
- value: "false"
label: 关闭
- value: "&concurrent=true"
label: 开启并发CDN请求
- value: "&cache=true"
label: 开启全站离线
- value: "&concurrent=true&cache=true"
label: 开启并发CDN与全站离线
- value: "uninstall"
label: 卸载
sw_cdn_source:
name: sw_cdn_source
label: "Service Worker 并发 CDN 源"
type: code
default: |-
https://unpkg.com
https://cdn.jsdelivr.net/npm
https://npm.elemecdn.com
placeholder: 请输入 CDN 地址(一行一个)
description: '填入可用的 NPM 公共开源 CDN 地址(一行一个),通过 “{CDN 地址}/{项目名}@{版本号}/${文件路径}” 可访问到文件,如:https://unpkg.com/halo-theme-dream@3.2.1/source/js/utils.min.js'
effects_lantern_mode:
name: effects_lantern_mode
label: 喜庆灯笼特效显示模式
type: radio
default: none
options:
- value: none
label: 不显示
- value: day
label: 明亮模式
- value: night
label: 黑暗模式
- value: all
label: 全模式
effects_sakura_mode:
name: effects_sakura_mode
label: 樱花飘落特效显示模式
type: radio
default: day
options:
- value: none
label: 不显示
- value: day
label: 明亮模式
- value: night
label: 黑暗模式
- value: all
label: 全模式
effects_snowflake_mode:
name: effects_snowflake_mode
label: 雪花飘落特效显示模式
type: radio
default: none
options:
- value: none
label: 不显示
- value: day
label: 明亮模式
- value: night
label: 黑暗模式
- value: all
label: 全模式
effects_universe_mode:
name: effects_universe_mode
label: 宇宙星空特效显示模式
type: radio
default: night
options:
- value: none
label: 不显示
- value: day
label: 明亮模式
- value: night
label: 黑暗模式
- value: all
label: 全模式
effects_circle_magic_mode:
name: effects_circle_magic_mode
label: 上升圆点特效显示模式
type: radio
default: night
options:
- value: none
label: 不显示
- value: day
label: 明亮模式
- value: night
label: 黑暗模式
- value: all
label: 全模式
enable_gray_mode:
name: enable_gray_mode
label: 灰色模式
type: switch
data-type: bool
default: false
description: '向英雄致敬,愿精神长存!'
options:
- value: true
label: 开启
- value: false
label: 关闭
enable_baidu_push:
name: enable_baidu_push
label: 启用百度 URL 自动推送
type: switch
data-type: bool
default: false
options:
- value: true
label: 开启
- value: false
label: 关闭
enable_toutiao_push:
name: enable_toutiao_push
label: 启用头条搜索自动推送
type: switch
data-type: bool
default: false
options:
- value: true
label: 开启
- value: false
label: 关闭
enable_debug:
name: enable_debug
label: 开启 DEBUG 日志
type: switch
data-type: bool
default: false
description: '开发和问题排查时开启日志。'
options:
- value: true
label: 开启
- value: false
label: 关闭
custom:
label: 定制主题
items:
external_css:
name: external_css
label: "外部 CSS 链接"
type: text
placeholder: 请输入 CSS 文件链接
description: "填入外部 CSS 链接,无需 link 标签,将插入 head 标签尾部。
"
inline_css:
name: inline_css
label: "内嵌 CSS"
type: code
placeholder: 请输入 CSS 样式内容
description: '填入 CSS 代码,无需 style 标签,将插入 head 标签尾部。'
external_js_head:
name: external_js_head
label: "外部 JS 链接(head)"
type: code
placeholder: 请输入 script 标签
description: '填入外部 JS 链接,需要 script 标签,可按情况指定 async 和 defer 属性,将插入 head 标签尾部。'
inline_js_head:
name: inline_js_head
label: "内嵌 JS(head)"
type: code
placeholder: 请输入 JS 代码内容
description: '填入 JS 代码,无需 script 标签,将插入 head 标签尾部。'
external_js_body:
name: external_js_body
label: "外部 JS 链接(body)"
type: code
placeholder: 请输入 script 标签
description: '填入外部 JS 链接,需要 script 标签,可按情况指定 async 和 defer 属性,将插入 body 标签尾部。'
inline_js_body:
name: inline_js_body
label: "内嵌JS(body)"
type: code
placeholder: 请输入 JS 代码内容
description: '填入 JS 代码,无需 script 标签,将插入 body 标签尾部。'
================================================
FILE: sheet.ftl
================================================
<#include "template/layout.ftl">
<#include "template/main/article.ftl">
<@layout title="${sheet.title} - ${blog_title!}" canonical="${sheet.fullPath!}">
<@article sheet,"sheet" />
@layout>
================================================
FILE: sheet_literature.ftl
================================================
<#include "template/layout.ftl">
<#include "template/main/article_literature.ftl">
<@layout title="${sheet.title} - ${blog_title!}" canonical="${sheet.fullPath!}">
<@articleLiterature sheet,"sheet" />
@layout>
================================================
FILE: source/lib/halo-comment@1.1.7/demo.html
================================================
halo-comment demo
================================================
FILE: source/lib/halo-comment@1.1.7/halo-comment.js
================================================
/******/ (function() { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 6587:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.AdminApiClient = void 0;
const url_1 = __webpack_require__(6998);
const clients_1 = __webpack_require__(6904);
class AdminApiClient {
constructor(client) {
this.client = client.buildHttpClient();
this._attachment = new clients_1.AttachmentClient(this.client);
this._backup = new clients_1.BackupClient(this.client);
this._category = new clients_1.CategoryClient(this.client);
this._installation = new clients_1.InstallationClient(this.client);
this._journalComment = new clients_1.JournalCommentClient(this.client);
this._journal = new clients_1.JournalClient(this.client);
this._link = new clients_1.LinkClient(this.client);
this._log = new clients_1.LogClient(this.client);
this._mail = new clients_1.MailClient(this.client);
this._menu = new clients_1.MenuClient(this.client);
this._migration = new clients_1.MigrationClient(this.client);
this._option = new clients_1.OptionClient(this.client);
this._photo = new clients_1.PhotoClient(this.client);
this._postComment = new clients_1.PostCommentClient(this.client);
this._post = new clients_1.PostClient(this.client);
this._sheetComment = new clients_1.SheetCommentClient(this.client);
this._sheet = new clients_1.SheetClient(this.client);
this._statistic = new clients_1.StatisticClient(this.client);
this._tag = new clients_1.TagClient(this.client);
this._theme = new clients_1.ThemeClient(this.client);
this._user = new clients_1.UserClient(this.client);
this._staticStorage = new clients_1.StaticStorageClient(this.client);
this._comment = new clients_1.CommentClient(this.client);
this._actuator = new clients_1.ActuatorClient(this.client);
}
get attachment() {
return this._attachment;
}
get backup() {
return this._backup;
}
get category() {
return this._category;
}
get installation() {
return this._installation;
}
get journalComment() {
return this._journalComment;
}
get journal() {
return this._journal;
}
get link() {
return this._link;
}
get log() {
return this._log;
}
get mail() {
return this._mail;
}
get menu() {
return this._menu;
}
get migration() {
return this._migration;
}
get option() {
return this._option;
}
get photo() {
return this._photo;
}
get postComment() {
return this._postComment;
}
get post() {
return this._post;
}
get sheetComment() {
return this._sheetComment;
}
get sheet() {
return this._sheet;
}
get statistic() {
return this._statistic;
}
get tag() {
return this._tag;
}
get theme() {
return this._theme;
}
get user() {
return this._user;
}
get staticStorage() {
return this._staticStorage;
}
get comment() {
return this._comment;
}
get actuator() {
return this._actuator;
}
getEnvironment() {
const path = (0, url_1.buildPath)({
endpointName: 'environments',
});
return this.client.get(path, {});
}
getLogFile(lines) {
const path = (0, url_1.buildPath)({
endpointName: 'halo/logfile',
});
return this.client.get(path, { lines });
}
isInstalled() {
const path = (0, url_1.buildPath)({
endpointName: 'is_installed',
});
return this.client.get(path, {});
}
logout() {
const path = (0, url_1.buildPath)({
endpointName: 'logout',
});
return this.client.post(path, {});
}
sendResetPasswordCode(params) {
const path = (0, url_1.buildPath)({
endpointName: 'password/code',
});
return this.client.post(path, params);
}
resetPassword(params) {
const path = (0, url_1.buildPath)({
endpointName: 'password/reset',
});
return this.client.put(path, params);
}
refreshToken(refreshToken) {
const path = (0, url_1.buildPath)({
endpointName: `refresh/${refreshToken}`,
});
return this.client.post(path, {});
}
needMFACode(params) {
const path = (0, url_1.buildPath)({
endpointName: 'login/precheck',
});
return this.client.post(path, Object.assign({}, params));
}
login(params) {
const path = (0, url_1.buildPath)({
endpointName: 'login',
});
return this.client.post(path, Object.assign({}, params));
}
}
exports.AdminApiClient = AdminApiClient;
//# sourceMappingURL=AdminApiClient.js.map
/***/ }),
/***/ 6710:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.AuthorizedClient = void 0;
const url_1 = __webpack_require__(6998);
const rest_api_client_1 = __webpack_require__(5040);
class AuthorizedClient {
constructor(baseUrl) {
const requestConfigBuilder = new rest_api_client_1.HaloRequestConfigBuilder({
baseUrl: baseUrl,
});
const responseHandler = new rest_api_client_1.HaloResponseHandler();
this.client = new rest_api_client_1.DefaultHttpClient({
responseHandler,
requestConfigBuilder,
});
}
isInstalled() {
const path = (0, url_1.buildPath)({
endpointName: 'is_installed',
});
return this.client.get(path, {});
}
sendResetPasswordCode(params) {
const path = (0, url_1.buildPath)({
endpointName: 'password/code',
});
return this.client.post(path, params);
}
resetPassword(params) {
const path = (0, url_1.buildPath)({
endpointName: 'password/reset',
});
return this.client.post(path, params);
}
refreshToken(refreshToken) {
const path = (0, url_1.buildPath)({
endpointName: `refresh/${refreshToken}`,
});
return this.client.post(path, {});
}
login(params) {
const path = (0, url_1.buildPath)({
endpointName: 'login',
});
return this.client.post(path, Object.assign({}, params));
}
needMFACode(params) {
const path = (0, url_1.buildPath)({
endpointName: 'login/precheck',
});
return this.client.post(path, Object.assign({}, params));
}
}
exports.AuthorizedClient = AuthorizedClient;
//# sourceMappingURL=AuthorizedClient.js.map
/***/ }),
/***/ 6618:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.ActuatorClient = void 0;
const url_1 = __webpack_require__(6998);
class ActuatorClient {
constructor(client) {
this.client = client;
}
getLogfile() {
const path = (0, url_1.buildPath)({
endpointName: 'actuator/logfile',
});
return this.client.get(path, {});
}
getEnv() {
const path = (0, url_1.buildPath)({
endpointName: 'actuator/env',
});
return this.client.get(path, {});
}
getSystemCpuCount() {
const path = (0, url_1.buildPath)({
endpointName: 'actuator/metrics/system.cpu.count',
});
return this.client.get(path, {});
}
getSystemCpuUsage() {
const path = (0, url_1.buildPath)({
endpointName: 'actuator/metrics/system.cpu.usage',
});
return this.client.get(path, {});
}
getProcessUptime() {
const path = (0, url_1.buildPath)({
endpointName: 'actuator/metrics/process.uptime',
});
return this.client.get(path, {});
}
getProcessStartTime() {
const path = (0, url_1.buildPath)({
endpointName: 'actuator/metrics/process.start.time',
});
return this.client.get(path, {});
}
getProcessCpuUsage() {
const path = (0, url_1.buildPath)({
endpointName: 'actuator/metrics/process.cpu.usage',
});
return this.client.get(path, {});
}
getJvmMemoryMax() {
const path = (0, url_1.buildPath)({
endpointName: 'actuator/metrics/jvm.memory.max',
});
return this.client.get(path, {});
}
getJvmMemoryCommitted() {
const path = (0, url_1.buildPath)({
endpointName: 'actuator/metrics/jvm.memory.committed',
});
return this.client.get(path, {});
}
getJvmMemoryUsed() {
const path = (0, url_1.buildPath)({
endpointName: 'actuator/metrics/jvm.memory.used',
});
return this.client.get(path, {});
}
getJvmGcPause() {
const path = (0, url_1.buildPath)({
endpointName: 'actuator/metrics/jvm.gc.pause',
});
return this.client.get(path, {});
}
}
exports.ActuatorClient = ActuatorClient;
//# sourceMappingURL=ActuatorClient.js.map
/***/ }),
/***/ 399:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.AttachmentClient = void 0;
const rest_api_client_1 = __webpack_require__(5040);
const url_1 = __webpack_require__(6998);
class AttachmentClient {
constructor(client) {
this.client = client;
}
/**
* Gets attachment detail by id.
*
* @param attachmentId attachment id
* @returns Returns attachment detail response.
*/
get(attachmentId) {
const path = (0, url_1.buildPath)({
endpointName: `attachments/${attachmentId}`,
});
return this.client.get(path, {});
}
/**
* Page query attachment list.
*
* @param params attachment query parameter
* @returns Returns attachment page response.
*/
list(params) {
const path = (0, url_1.buildPath)({
endpointName: 'attachments',
});
return this.client.get(path, Object.assign({}, params));
}
/**
* Batch delete attachment permanently by attachment ids.
*
* @param attachmentIds a collection of attachment id
* @returns Returns attachments of deleted
*/
deleteInBatch(attachmentIds) {
const path = (0, url_1.buildPath)({
endpointName: 'attachments',
});
return this.client.delete(path, attachmentIds);
}
/**
* Delete attachment permanently by attachment id.
*
* @param attachmentId attachment id
* @returns Returns attachment detail of deleted
*/
delete(attachmentId) {
const path = (0, url_1.buildPath)({
endpointName: `attachments/${attachmentId}`,
});
return this.client.delete(path, {});
}
/**
* Update attachment name by id.
*
* @param attachmentId attachment id
* @param name a new attachment name
* @returns Returns an updated attachment response.
*/
update(attachmentId, name) {
const path = (0, url_1.buildPath)({
endpointName: `attachments/${attachmentId}`,
});
return this.client.put(path, { name });
}
/**
* List all of attachment media types.
*
* @returns Returns attachment media types response.
*/
listMediaTypes() {
const path = (0, url_1.buildPath)({
endpointName: 'attachments/media_types',
});
return this.client.get(path, {});
}
/**
* List all of attachment types.
*
* @returns Returns a response of attachment types.
*/
listTypes() {
const path = (0, url_1.buildPath)({
endpointName: 'attachments/types',
});
return this.client.get(path, {});
}
/**
* Upload a single attachment file.
*
* @param data attachment file object.
* @param options other upload options.
* @returns Returns a response of uploaded attachment
*/
upload(data, options) {
const path = (0, url_1.buildPath)({
endpointName: 'attachments/upload',
});
const formData = new rest_api_client_1.FormData();
formData.append('file', data);
return this.client.post(path, formData, Object.assign({}, options));
}
/**
* Batch upload attachments.
*
* @param data attachment file object.
* @param options other upload options.
* @returns Returns a response of uploaded attachments.
*/
uploadInBatch(data, options) {
const path = (0, url_1.buildPath)({
endpointName: 'attachments/uploads',
});
const formData = new rest_api_client_1.FormData();
data.forEach((fileStream) => {
formData.append('files', fileStream);
});
return this.client.post(path, formData, Object.assign({}, options));
}
}
exports.AttachmentClient = AttachmentClient;
//# sourceMappingURL=AttachmentClient.js.map
/***/ }),
/***/ 5260:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.BackupClient = void 0;
const url_1 = __webpack_require__(6998);
class BackupClient {
constructor(client) {
this.client = client;
}
getWorkdirBackup(filename) {
const path = (0, url_1.buildPath)({
endpointName: `backups/work-dir/fetch?filename=${filename}`,
});
return this.client.get(path, {});
}
getDataBackup(filename) {
const path = (0, url_1.buildPath)({
endpointName: `backups/data/fetch?filename=${filename}`,
});
return this.client.get(path, {});
}
getMarkdownBackup(filename) {
const path = (0, url_1.buildPath)({
endpointName: `backups/markdown/fetch?filename=${filename}`,
});
return this.client.get(path, {});
}
backupWorkdir(options) {
const path = (0, url_1.buildPath)({
endpointName: 'backups/work-dir',
});
return this.client.post(path, options);
}
getWorkdirBackupOptions() {
const path = (0, url_1.buildPath)({
endpointName: 'backups/work-dir/options',
});
return this.client.get(path, {});
}
listWorkdirBackups() {
const path = (0, url_1.buildPath)({
endpointName: 'backups/work-dir',
});
return this.client.get(path, {});
}
deleteWorkdirBackup(filename) {
const path = (0, url_1.buildPath)({
endpointName: `backups/work-dir`,
});
return this.client.delete(path, { filename });
}
backupData() {
const path = (0, url_1.buildPath)({
endpointName: 'backups/data',
});
return this.client.post(path, {});
}
listDataBackups() {
const path = (0, url_1.buildPath)({
endpointName: 'backups/data',
});
return this.client.get(path, {});
}
deleteDataBackup(filename) {
const path = (0, url_1.buildPath)({
endpointName: `backups/data`,
});
return this.client.delete(path, { filename });
}
backupMarkdown(params) {
const path = (0, url_1.buildPath)({
endpointName: 'backups/markdown/export',
});
return this.client.post(path, params);
}
listMarkdownBackups() {
const path = (0, url_1.buildPath)({
endpointName: 'backups/markdown/export',
});
return this.client.get(path, {});
}
deleteMarkdownBackup(filename) {
const path = (0, url_1.buildPath)({
endpointName: `backups/markdown/export`,
});
return this.client.delete(path, { filename });
}
importMarkdown(data, options) {
const path = (0, url_1.buildPath)({
endpointName: 'backups/markdown/import',
});
const formData = new FormData();
formData.append('file', data);
return this.client.post(path, formData, Object.assign({}, options));
}
}
exports.BackupClient = BackupClient;
//# sourceMappingURL=BackupClient.js.map
/***/ }),
/***/ 6774:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.CategoryClient = void 0;
const tslib_1 = __webpack_require__(655);
const url_1 = __webpack_require__(6998);
class CategoryClient {
constructor(client) {
this.client = client;
}
/**
* Lists all categories.
*
* @param params parameter for queries
* @returns A response of all categories.
*/
list(params) {
const path = (0, url_1.buildPath)({
endpointName: 'categories',
});
return this.client.get(path, Object.assign({}, params));
}
/**
* List all categories as tree.
*
* @param sort sort option for queries, value is category field
* @returns A response of all categories.
*/
listAsTree(sort) {
const path = (0, url_1.buildPath)({
endpointName: 'categories/tree_view',
});
return this.client.get(path, { sort });
}
/**
* Gets category detail by id.
*
* @param categoryId category id
* @returns A response of category detail.
*/
get(categoryId) {
const path = (0, url_1.buildPath)({
endpointName: `categories/${categoryId}`,
});
return this.client.get(path, {});
}
/**
* Creates a category.
*
* @param params category parameter to create
* @returns A response of created category.
*/
create(params) {
const path = (0, url_1.buildPath)({
endpointName: 'categories',
});
return this.client.post(path, Object.assign({}, params));
}
/**
* Updates category by id
*
* @param categoryId category id
* @param params category update parameter
* @returns A response of updated category.
*/
update(categoryId, params) {
const path = (0, url_1.buildPath)({
endpointName: `categories/${categoryId}`,
});
return this.client.put(path, Object.assign({}, params));
}
/**
* Updates category in batch
*
* @param params
*/
updateInBatch(params) {
const path = (0, url_1.buildPath)({
endpointName: 'categories/batch',
});
return this.client.put(path, [...params]);
}
/**
* Deletes a category by id.
*
* @param categoryId category id
*/
delete(categoryId) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const path = (0, url_1.buildPath)({
endpointName: `categories/${categoryId}`,
});
yield this.client.delete(path, {});
});
}
}
exports.CategoryClient = CategoryClient;
//# sourceMappingURL=CategoryClient.js.map
/***/ }),
/***/ 8666:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.CommentClient = void 0;
const url_1 = __webpack_require__(6998);
class CommentClient {
constructor(client) {
this.client = client;
}
list(target, params) {
const path = (0, url_1.buildPath)({
endpointName: `${target}/comments`,
});
return this.client.get(path, params);
}
latest(target, top, status) {
const path = (0, url_1.buildPath)({
endpointName: `${target}/comments/latest`,
});
return this.client.get(path, { top, status });
}
listAsView(target, targetId, params) {
const path = (0, url_1.buildPath)({
endpointName: `${target}/comments/${targetId}/list_view`,
});
return this.client.get(path, params);
}
listAsTreeView(target, targetId, params) {
const path = (0, url_1.buildPath)({
endpointName: `${target}/comments/${targetId}/tree_view`,
});
return this.client.get(path, params);
}
get(target, commentId) {
const path = (0, url_1.buildPath)({
endpointName: `${target}/comments/${commentId}`,
});
return this.client.get(path, {});
}
create(target, params) {
const path = (0, url_1.buildPath)({
endpointName: `${target}/comments`,
});
return this.client.post(path, params);
}
update(target, commentId, params) {
const path = (0, url_1.buildPath)({
endpointName: `${target}/comments/${commentId}`,
});
return this.client.get(path, params);
}
updateStatusById(target, commentId, status) {
const path = (0, url_1.buildPath)({
endpointName: `${target}/comments/${commentId}/status/${status}`,
});
return this.client.put(path, {});
}
updateStatusInBatch(target, commentIds, status) {
const path = (0, url_1.buildPath)({
endpointName: `${target}/comments/status/${status}`,
});
return this.client.put(path, commentIds);
}
delete(target, commentId) {
const path = (0, url_1.buildPath)({
endpointName: `${target}/comments/${commentId}`,
});
return this.client.delete(path, {});
}
deleteInBatch(target, postCommentIds) {
const path = (0, url_1.buildPath)({
endpointName: `${target}/comments`,
});
return this.client.delete(path, postCommentIds);
}
}
exports.CommentClient = CommentClient;
//# sourceMappingURL=CommentClient.js.map
/***/ }),
/***/ 8400:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.InstallationClient = void 0;
const url_1 = __webpack_require__(6998);
class InstallationClient {
constructor(client) {
this.client = client;
}
/**
* Initializes the blog.
*
* @param params installation parameter
* @returns A response of installation status message.
*/
install(params) {
const path = (0, url_1.buildPath)({
endpointName: 'installations',
});
return this.client.post(path, Object.assign({}, params));
}
}
exports.InstallationClient = InstallationClient;
//# sourceMappingURL=InstallationClient.js.map
/***/ }),
/***/ 173:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.JournalClient = void 0;
const tslib_1 = __webpack_require__(655);
const url_1 = __webpack_require__(6998);
class JournalClient {
constructor(client) {
this.client = client;
}
/**
* Lists journals.
*
* @param params parameter for queries
* @returns A page response of journals.
*/
list(params) {
const path = (0, url_1.buildPath)({
endpointName: 'journals',
});
return this.client.get(path, Object.assign({}, params));
}
/**
* Gets latest journals.
*
* @param top top option for queries
* @returns A response of lastes journals.
*/
latest(top) {
const path = (0, url_1.buildPath)({
endpointName: 'journals/latest',
});
return this.client.get(path, { top });
}
/**
* Creates a journal.
*
* @param params parameter for creates
* @returns A response of created journal.
*/
create(params) {
const path = (0, url_1.buildPath)({
endpointName: 'journals',
});
return this.client.post(path, Object.assign({}, params));
}
/**
* Updates a journal by id.
*
* @param journalId journal id
* @param params parameter for updates
* @returns A response of updated journal.
*/
update(journalId, params) {
const path = (0, url_1.buildPath)({
endpointName: `journals/${journalId}`,
});
return this.client.put(path, Object.assign({}, params));
}
/**
* Deletes a journal by id.
* @param journalId journal id
*/
delete(journalId) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const path = (0, url_1.buildPath)({
endpointName: `journals/${journalId}`,
});
yield this.client.delete(path, {});
});
}
}
exports.JournalClient = JournalClient;
//# sourceMappingURL=JournalClient.js.map
/***/ }),
/***/ 5503:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.JournalCommentClient = void 0;
const tslib_1 = __webpack_require__(655);
const url_1 = __webpack_require__(6998);
class JournalCommentClient {
constructor(client) {
this.client = client;
}
/**
* Lists journal comments.
*
* @param params parameter for queries
* @returns A page response of journals.
*/
list(params) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const path = (0, url_1.buildPath)({
endpointName: 'journals/comments',
});
return this.client.get(path, Object.assign({}, params));
});
}
/**
* Creates a journal comment.
*
* @param params comment parameter for creates
* @returns A response of created journal comment.
*/
create(params) {
const path = (0, url_1.buildPath)({
endpointName: 'journals/comments',
});
return this.client.post(path, Object.assign({}, params));
}
/**
* Deletes a journal comment by id.
*
* @param commentId journal comment id.
* @returns A response of deleted journal comment.
*/
delete(commentId) {
const path = (0, url_1.buildPath)({
endpointName: `journals/comments/${commentId}`,
});
return this.client.delete(path, {});
}
/**
* Updates journal comment status by id.
*
* @param commentId journal comment id
* @param status comment status
* @returns A response of updated journal comment.
*/
update(commentId, status) {
const path = (0, url_1.buildPath)({
endpointName: `journals/comments/${commentId}/status/${status}`,
});
return this.client.put(path, {});
}
/**
* Lists comment with list view.
*
* @param params parameter for queries
* @returns A page response of journal comments.
*/
listAsView(params) {
const path = (0, url_1.buildPath)({
endpointName: `journals/comments/${params.journalId}/list_view`,
});
return this.client.get(path, Object.assign({}, params));
}
/**
* Lists comment with tree view.
*
* @param params parameter for queries
* @returns A page response of journal comments tree.
*/
listAsTree(params) {
const path = (0, url_1.buildPath)({
endpointName: `journals/comments/${params.journalId}/tree_view`,
});
return this.client.get(path, Object.assign({}, params));
}
/**
* Lists latest journal comments.
*
* @param params parameter for queries
* @returns A response of latest journal comments.
*/
latest(params) {
const path = (0, url_1.buildPath)({
endpointName: 'journals/comments/latest',
});
return this.client.get(path, Object.assign({}, params));
}
}
exports.JournalCommentClient = JournalCommentClient;
//# sourceMappingURL=JournalCommentClient.js.map
/***/ }),
/***/ 9207:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.LinkClient = void 0;
const tslib_1 = __webpack_require__(655);
const url_1 = __webpack_require__(6998);
class LinkClient {
constructor(client) {
this.client = client;
}
list(sort) {
const path = (0, url_1.buildPath)({
endpointName: 'links',
});
return this.client.get(path, { sort });
}
create(params) {
const path = (0, url_1.buildPath)({
endpointName: 'links',
});
return this.client.post(path, Object.assign({}, params));
}
get(id) {
const path = (0, url_1.buildPath)({
endpointName: `links/${id}`,
});
return this.client.get(path, {});
}
update(linkId, params) {
const path = (0, url_1.buildPath)({
endpointName: `links/${linkId}`,
});
return this.client.put(path, Object.assign({}, params));
}
updateInBatch(params) {
const path = (0, url_1.buildPath)({
endpointName: 'links/batch',
});
return this.client.put(path, [...params]);
}
delete(id) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const path = (0, url_1.buildPath)({
endpointName: `links/${id}`,
});
yield this.client.delete(path, {});
});
}
listTeams() {
const path = (0, url_1.buildPath)({
endpointName: 'links/teams',
});
return this.client.get(path, {});
}
}
exports.LinkClient = LinkClient;
//# sourceMappingURL=LinkClient.js.map
/***/ }),
/***/ 9842:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.LogClient = void 0;
const tslib_1 = __webpack_require__(655);
const url_1 = __webpack_require__(6998);
class LogClient {
constructor(client) {
this.client = client;
}
/**
* List action logs by params.
*
* @param params
*/
list(params) {
const path = (0, url_1.buildPath)({
endpointName: 'logs',
});
return this.client.get(path, Object.assign({}, params));
}
/**
* Clear action logs
*/
clear() {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const path = (0, url_1.buildPath)({
endpointName: 'logs/clear',
});
yield this.client.get(path, {});
});
}
/**
* Get latest action logs
*
* @param top the number of logs to get
*/
latest(top) {
const path = (0, url_1.buildPath)({
endpointName: 'logs/latest',
});
return this.client.get(path, { top });
}
}
exports.LogClient = LogClient;
//# sourceMappingURL=LogClient.js.map
/***/ }),
/***/ 7206:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.MailClient = void 0;
const url_1 = __webpack_require__(6998);
class MailClient {
constructor(client) {
this.client = client;
}
testSmtpService(params) {
const path = (0, url_1.buildPath)({
endpointName: 'mails/test',
});
return this.client.post(path, Object.assign({}, params));
}
testConnect() {
const path = (0, url_1.buildPath)({
endpointName: 'mails/test/connection',
});
return this.client.post(path, {});
}
}
exports.MailClient = MailClient;
//# sourceMappingURL=MailClient.js.map
/***/ }),
/***/ 7530:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.MenuClient = void 0;
const tslib_1 = __webpack_require__(655);
const url_1 = __webpack_require__(6998);
class MenuClient {
constructor(client) {
this.client = client;
}
list() {
const path = (0, url_1.buildPath)({
endpointName: 'menus',
});
return this.client.get(path, {});
}
create(params) {
const path = (0, url_1.buildPath)({
endpointName: 'menus',
});
return this.client.post(path, Object.assign({}, params));
}
createInBatch(params) {
const path = (0, url_1.buildPath)({
endpointName: 'menus/batch',
});
return this.client.post(path, [...params]);
}
get(menuId) {
const path = (0, url_1.buildPath)({
endpointName: `menus/${menuId}`,
});
return this.client.post(path, {});
}
update(menuId, params) {
const path = (0, url_1.buildPath)({
endpointName: `menus/${menuId}`,
});
return this.client.put(path, Object.assign({}, params));
}
updateInBatch(params) {
const path = (0, url_1.buildPath)({
endpointName: 'menus/batch',
});
return this.client.put(path, [...params]);
}
delete(menuId) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const path = (0, url_1.buildPath)({
endpointName: `menus/${menuId}`,
});
yield this.client.delete(path, {});
});
}
deleteInBatch(menuIds) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const path = (0, url_1.buildPath)({
endpointName: 'menus/batch',
});
yield this.client.delete(path, [...menuIds]);
});
}
listTreeViewByTeam(team, sort) {
const path = (0, url_1.buildPath)({
endpointName: 'menus/team/tree_view',
});
return this.client.get(path, { team, sort });
}
listTeams() {
const path = (0, url_1.buildPath)({
endpointName: 'menus/teams',
});
return this.client.get(path, {});
}
listTreeView(sort) {
const path = (0, url_1.buildPath)({
endpointName: 'menus/tree_view',
});
return this.client.get(path, { sort });
}
}
exports.MenuClient = MenuClient;
//# sourceMappingURL=MenuClient.js.map
/***/ }),
/***/ 9644:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.MigrationClient = void 0;
const tslib_1 = __webpack_require__(655);
const rest_api_client_1 = __webpack_require__(5040);
const url_1 = __webpack_require__(6998);
class MigrationClient {
constructor(client) {
this.client = client;
}
migrate(data, options) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const path = (0, url_1.buildPath)({
endpointName: 'migrations/halo',
});
const formData = new rest_api_client_1.FormData();
formData.append('file', data);
yield this.client.post(path, formData, Object.assign({}, options));
});
}
}
exports.MigrationClient = MigrationClient;
//# sourceMappingURL=MigrationClient.js.map
/***/ }),
/***/ 3913:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.OptionClient = void 0;
const tslib_1 = __webpack_require__(655);
const url_1 = __webpack_require__(6998);
class OptionClient {
constructor(client) {
this.client = client;
}
list() {
const path = (0, url_1.buildPath)({
endpointName: 'options',
});
return this.client.get(path, {});
}
create(params) {
const path = (0, url_1.buildPath)({
endpointName: 'options',
});
return this.client.post(path, Object.assign({}, params));
}
get(id) {
const path = (0, url_1.buildPath)({
endpointName: `options/${id}`,
});
return this.client.get(path, {});
}
update(optionId, params) {
const path = (0, url_1.buildPath)({
endpointName: `options/${optionId}`,
});
return this.client.put(path, Object.assign({}, params));
}
delete(optionId) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const path = (0, url_1.buildPath)({
endpointName: `options/${optionId}`,
});
yield this.client.delete(path, {});
});
}
listAsView(params) {
const path = (0, url_1.buildPath)({
endpointName: 'options/list_view',
});
return this.client.get(path, Object.assign({}, params));
}
listAsMapView() {
const path = (0, url_1.buildPath)({
endpointName: 'options/map_view',
});
return this.client.get(path, {});
}
listAsMapViewByKeys(params) {
const path = (0, url_1.buildPath)({
endpointName: 'options/map_view/keys',
});
return this.client.post(path, params);
}
saveMapView(params) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const path = (0, url_1.buildPath)({
endpointName: 'options/map_view/saving',
});
yield this.client.post(path, Object.assign({}, params));
});
}
save(params) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const path = (0, url_1.buildPath)({
endpointName: 'options/saving',
});
yield this.client.post(path, [...params]);
});
}
}
exports.OptionClient = OptionClient;
//# sourceMappingURL=OptionClient.js.map
/***/ }),
/***/ 402:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.PhotoClient = void 0;
const tslib_1 = __webpack_require__(655);
const url_1 = __webpack_require__(6998);
class PhotoClient {
constructor(client) {
this.client = client;
}
list(params) {
const path = (0, url_1.buildPath)({
endpointName: 'photos',
});
return this.client.get(path, Object.assign({}, params));
}
create(params) {
const path = (0, url_1.buildPath)({
endpointName: 'photos',
});
return this.client.post(path, Object.assign({}, params));
}
createInBatch(params) {
const path = (0, url_1.buildPath)({
endpointName: 'photos/batch',
});
return this.client.post(path, [...params]);
}
get(photoId) {
const path = (0, url_1.buildPath)({
endpointName: `photos/${photoId}`,
});
return this.client.get(path, {});
}
update(photoId, params) {
const path = (0, url_1.buildPath)({
endpointName: `photos/${photoId}`,
});
return this.client.put(path, Object.assign({}, params));
}
updateInBatch(params) {
const path = (0, url_1.buildPath)({
endpointName: 'photos/batch',
});
return this.client.put(path, [...params]);
}
delete(photoId) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const path = (0, url_1.buildPath)({
endpointName: `photos/${photoId}`,
});
yield this.client.delete(path, {});
});
}
deleteInBatch(photoIds) {
const path = (0, url_1.buildPath)({
endpointName: 'photos/batch',
});
return this.client.delete(path, photoIds);
}
latest(sort) {
const path = (0, url_1.buildPath)({
endpointName: 'photos/latest',
});
return this.client.get(path, { sort });
}
listTeams() {
const path = (0, url_1.buildPath)({
endpointName: 'photos/teams',
});
return this.client.get(path, {});
}
}
exports.PhotoClient = PhotoClient;
//# sourceMappingURL=PhotoClient.js.map
/***/ }),
/***/ 4682:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.PostClient = void 0;
const tslib_1 = __webpack_require__(655);
const url_1 = __webpack_require__(6998);
class PostClient {
constructor(client) {
this.client = client;
}
list(params) {
const path = (0, url_1.buildPath)({
endpointName: 'posts',
});
return this.client.get(path, Object.assign({}, params));
}
get(postId) {
const path = (0, url_1.buildPath)({
endpointName: `posts/${postId}`,
});
return this.client.get(path, {});
}
getPreviewLinkById(postId) {
const path = (0, url_1.buildPath)({
endpointName: `posts/${postId}/preview`,
});
return this.client.get(path, {});
}
latest(top) {
const path = (0, url_1.buildPath)({
endpointName: 'posts/latest',
});
return this.client.get(path, { top });
}
listByStatus(status, query) {
const path = (0, url_1.buildPath)({
endpointName: `posts/status/${status}`,
});
return this.client.get(path, Object.assign({}, query));
}
create(params) {
const path = (0, url_1.buildPath)({
endpointName: 'posts',
});
return this.client.post(path, Object.assign({}, params));
}
update(postId, params) {
const path = (0, url_1.buildPath)({
endpointName: `posts/${postId}`,
});
return this.client.put(path, Object.assign({}, params));
}
updateStatusById(postId, status) {
const path = (0, url_1.buildPath)({
endpointName: `posts/${postId}/status/${status}`,
});
return this.client.put(path, {});
}
updateStatusInBatch(postIds, status) {
const path = (0, url_1.buildPath)({
endpointName: `posts/status/${status}`,
});
return this.client.put(path, postIds);
}
updateDraftById(postId, originalContent, content, keepRaw) {
const path = (0, url_1.buildPath)({
endpointName: `posts/${postId}/status/draft/content`,
});
return this.client.put(path, { originalContent, content, keepRaw });
}
like(postId) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const path = (0, url_1.buildPath)({
endpointName: `posts/${postId}/likes`,
});
yield this.client.put(path, {});
});
}
delete(postId) {
const path = (0, url_1.buildPath)({
endpointName: `posts/${postId}`,
});
return this.client.delete(path, {});
}
deleteInBatch(postIds) {
const path = (0, url_1.buildPath)({
endpointName: 'posts',
});
return this.client.delete(path, postIds);
}
}
exports.PostClient = PostClient;
//# sourceMappingURL=PostClient.js.map
/***/ }),
/***/ 6494:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.PostCommentClient = void 0;
const url_1 = __webpack_require__(6998);
class PostCommentClient {
constructor(client) {
this.client = client;
}
list(params) {
const path = (0, url_1.buildPath)({
endpointName: 'posts/comments',
});
return this.client.get(path, Object.assign({}, params));
}
listAsView(params) {
const path = (0, url_1.buildPath)({
endpointName: `posts/comments/${params.postId}/list_view`,
});
return this.client.get(path, Object.assign({}, params));
}
listAsTreeView(params) {
const path = (0, url_1.buildPath)({
endpointName: `posts/comments/${params.postId}/tree_view`,
});
return this.client.get(path, Object.assign({}, params));
}
latest(params) {
const path = (0, url_1.buildPath)({
endpointName: 'posts/comments/latest',
});
return this.client.get(path, Object.assign({}, params));
}
create(params) {
const path = (0, url_1.buildPath)({
endpointName: 'posts/comments',
});
return this.client.post(path, Object.assign({}, params));
}
update(commentId, params) {
const path = (0, url_1.buildPath)({
endpointName: `posts/comments/${commentId}`,
});
return this.client.get(path, Object.assign({}, params));
}
updateStatusById(commentId, status) {
const path = (0, url_1.buildPath)({
endpointName: `posts/comments/${commentId}/status/${status}`,
});
return this.client.put(path, {});
}
updateStatusInBatch(commentIds, status) {
const path = (0, url_1.buildPath)({
endpointName: `posts/comments/status/${status}`,
});
return this.client.put(path, commentIds);
}
delete(commentId) {
const path = (0, url_1.buildPath)({
endpointName: `posts/comments/${commentId}`,
});
return this.client.delete(path, {});
}
deleteInBatch(postCommentIds) {
const path = (0, url_1.buildPath)({
endpointName: 'posts/comments',
});
return this.client.delete(path, postCommentIds);
}
}
exports.PostCommentClient = PostCommentClient;
//# sourceMappingURL=PostCommentClient.js.map
/***/ }),
/***/ 771:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.SheetClient = void 0;
const tslib_1 = __webpack_require__(655);
const url_1 = __webpack_require__(6998);
class SheetClient {
constructor(client) {
this.client = client;
}
list(params) {
const path = (0, url_1.buildPath)({
endpointName: 'sheets',
});
return this.client.get(path, Object.assign({}, params));
}
listIndependents() {
const path = (0, url_1.buildPath)({
endpointName: 'sheets/independent',
});
return this.client.get(path, {});
}
create(params) {
const path = (0, url_1.buildPath)({
endpointName: 'sheets',
});
return this.client.post(path, Object.assign({}, params));
}
get(sheetId) {
const path = (0, url_1.buildPath)({
endpointName: `sheets/${sheetId}`,
});
return this.client.get(path, {});
}
getPreviewLinkById(sheetId) {
const path = (0, url_1.buildPath)({
endpointName: `sheets/preview/${sheetId}`,
});
return this.client.get(path, {});
}
update(sheetId, params) {
const path = (0, url_1.buildPath)({
endpointName: `sheets/${sheetId}`,
});
return this.client.put(path, Object.assign({}, params));
}
updateStatusById(sheetId, status) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const path = (0, url_1.buildPath)({
endpointName: `sheets/${sheetId}/${status}`,
});
yield this.client.put(path, {});
});
}
updateDraftById(sheetId, originalContent, content, keepRaw) {
const path = (0, url_1.buildPath)({
endpointName: `sheets/${sheetId}/status/draft/content`,
});
return this.client.put(path, { originalContent, content, keepRaw });
}
delete(sheetId) {
const path = (0, url_1.buildPath)({
endpointName: `sheets/${sheetId}`,
});
return this.client.delete(path, {});
}
}
exports.SheetClient = SheetClient;
//# sourceMappingURL=SheetClient.js.map
/***/ }),
/***/ 6094:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.SheetCommentClient = void 0;
const url_1 = __webpack_require__(6998);
class SheetCommentClient {
constructor(client) {
this.client = client;
}
list(params) {
const path = (0, url_1.buildPath)({
endpointName: 'sheets/comments',
});
return this.client.get(path, Object.assign({}, params));
}
get(commentId) {
const path = (0, url_1.buildPath)({
endpointName: `sheets/comments/${commentId}`,
});
return this.client.get(path, {});
}
listAsView(params) {
const path = (0, url_1.buildPath)({
endpointName: `sheets/comments/${params.sheetId}/list_view`,
});
return this.client.get(path, Object.assign({}, params));
}
listAsTreeView(params) {
const path = (0, url_1.buildPath)({
endpointName: `sheets/comments/${params.sheetId}/tree_view`,
});
return this.client.get(path, Object.assign({}, params));
}
latest(params) {
const path = (0, url_1.buildPath)({
endpointName: 'sheets/comments/latest',
});
return this.client.get(path, Object.assign({}, params));
}
create(params) {
const path = (0, url_1.buildPath)({
endpointName: 'sheets/comments',
});
return this.client.post(path, Object.assign({}, params));
}
update(commentId, params) {
const path = (0, url_1.buildPath)({
endpointName: `sheets/comments/${commentId}`,
});
return this.client.put(path, Object.assign({}, params));
}
updateStatusById(commentId, status) {
const path = (0, url_1.buildPath)({
endpointName: `sheets/comments/${commentId}/status/${status}`,
});
return this.client.put(path, {});
}
updateStatusInBatch(commentIds, status) {
const path = (0, url_1.buildPath)({
endpointName: `sheets/comments/status/${status}`,
});
return this.client.put(path, commentIds);
}
deleteInBatch(commentIds) {
const path = (0, url_1.buildPath)({
endpointName: 'sheets/comments',
});
return this.client.delete(path, commentIds);
}
delete(commentId) {
const path = (0, url_1.buildPath)({
endpointName: `sheets/comments/${commentId}`,
});
return this.client.delete(path, {});
}
}
exports.SheetCommentClient = SheetCommentClient;
//# sourceMappingURL=SheetCommentClient.js.map
/***/ }),
/***/ 7742:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.StaticStorageClient = void 0;
const rest_api_client_1 = __webpack_require__(5040);
const url_1 = __webpack_require__(6998);
class StaticStorageClient {
constructor(client) {
this.client = client;
}
list() {
const path = (0, url_1.buildPath)({
endpointName: `statics`,
});
return this.client.get(path, {});
}
delete(filePath) {
const path = (0, url_1.buildPath)({
endpointName: `statics`,
});
return this.client.delete(path, {
path: filePath,
});
}
createFolder(basePath, folderName) {
const path = (0, url_1.buildPath)({
endpointName: `statics?basePath=${basePath}&folderName=${folderName}`,
});
return this.client.post(path, {});
}
upload(file, options, basePath) {
const path = (0, url_1.buildPath)({
endpointName: `statics/upload?basePath=${basePath}`,
});
const formData = new rest_api_client_1.FormData();
formData.append('file', file);
return this.client.post(path, formData, Object.assign({}, options));
}
rename(basePath, newName) {
const path = (0, url_1.buildPath)({
endpointName: `statics/rename?basePath=${basePath}&newName=${newName}`,
});
return this.client.post(path, {});
}
saveContent(params) {
const path = (0, url_1.buildPath)({
endpointName: `statics/files`,
});
return this.client.put(path, params);
}
}
exports.StaticStorageClient = StaticStorageClient;
//# sourceMappingURL=StaticStorageClient.js.map
/***/ }),
/***/ 7922:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.StatisticClient = void 0;
const url_1 = __webpack_require__(6998);
class StatisticClient {
constructor(client) {
this.client = client;
}
statistics() {
const path = (0, url_1.buildPath)({
endpointName: 'statistics',
});
return this.client.get(path, {});
}
statisticsWithUser() {
const path = (0, url_1.buildPath)({
endpointName: 'statistics/user',
});
return this.client.get(path, {});
}
}
exports.StatisticClient = StatisticClient;
//# sourceMappingURL=StatisticClient.js.map
/***/ }),
/***/ 4898:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.TagClient = void 0;
const url_1 = __webpack_require__(6998);
class TagClient {
constructor(client) {
this.client = client;
}
list(params) {
const path = (0, url_1.buildPath)({
endpointName: 'tags',
});
return this.client.get(path, Object.assign({}, params));
}
create(params) {
const path = (0, url_1.buildPath)({
endpointName: 'tags',
});
return this.client.post(path, Object.assign({}, params));
}
get(tagId) {
const path = (0, url_1.buildPath)({
endpointName: `tags/${tagId}`,
});
return this.client.get(path, {});
}
update(tagId, params) {
const path = (0, url_1.buildPath)({
endpointName: `tags/${tagId}`,
});
return this.client.put(path, Object.assign({}, params));
}
delete(tagId) {
const path = (0, url_1.buildPath)({
endpointName: `tags/${tagId}`,
});
return this.client.delete(path, {});
}
}
exports.TagClient = TagClient;
//# sourceMappingURL=TagClient.js.map
/***/ }),
/***/ 8842:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.ThemeClient = void 0;
const tslib_1 = __webpack_require__(655);
const rest_api_client_1 = __webpack_require__(5040);
const url_1 = __webpack_require__(6998);
class ThemeClient {
constructor(client) {
this.client = client;
}
/**
* List all themes.
*
* @returns array of ThemeProperty
*/
list() {
const path = (0, url_1.buildPath)({
endpointName: 'themes',
});
return this.client.get(path, {});
}
/**
* Get theme property by themeId.
*
* @param themeId themeId
* @returns ThemeProperty
*/
get(themeId) {
const path = (0, url_1.buildPath)({
endpointName: `themes/${themeId}`,
});
return this.client.get(path, {});
}
/**
* Delete theme by themeId.
*
* @param themeId themeId
* @param deleteSettings whether to delete the theme settings at the same time.
* @returns ThemeProperty
*/
delete(themeId, deleteSettings) {
const path = (0, url_1.buildPath)({
endpointName: `themes/${themeId}`,
});
return this.client.delete(path, { deleteSettings });
}
/**
* Active a theme.
*
* @param themeId themeId
* @returns ThemeProperty
*/
active(themeId) {
const path = (0, url_1.buildPath)({
endpointName: `themes/${themeId}/activation`,
});
return this.client.post(path, {});
}
/**
* Fetches theme configuration group names by theme id
*
* @param themeId theme id
*/
listConfigurationGroups(themeId) {
const path = (0, url_1.buildPath)({
endpointName: `themes/${themeId}/configurations/groups`,
});
return this.client.get(path, {});
}
/**
* Fetches theme configuration group by theme id and group name
*
* @param themeId theme id
* @param group group name
*/
listConfigurationsByGroup(themeId, group) {
const path = (0, url_1.buildPath)({
endpointName: `themes/${themeId}/configurations/groups/${group}`,
});
return this.client.get(path, {});
}
/**
* List activated theme configurations.
*
* @returns array of configuration group.
*/
listActivatedConfigurations() {
const path = (0, url_1.buildPath)({
endpointName: 'themes/activation/configurations',
});
return this.client.get(path, {});
}
/**
* List theme configurations by themeId.
*
* @param themeId themeId
* @returns array of configuration group.
*/
listConfigurations(themeId) {
const path = (0, url_1.buildPath)({
endpointName: `themes/${themeId}/configurations`,
});
return this.client.get(path, {});
}
/**
* List theme files by themeId.
*
* @param themeId themeId
* @returns array of ThemeFile
*/
listFiles(themeId) {
const path = (0, url_1.buildPath)({
endpointName: `themes/${themeId}/files`,
});
return this.client.get(path, {});
}
/**
* List activated theme files.
*
* @returns array of ThemeFile
*/
listActivatedFiles() {
const path = (0, url_1.buildPath)({
endpointName: 'themes/activation/files',
});
return this.client.get(path, {});
}
/**
* Get activated template content by filepath.
*
* @param filepath filepath
* @returns template content
*/
getActivatedTemplateContent(filepath) {
const path = (0, url_1.buildPath)({
endpointName: 'themes/files/content',
});
return this.client.get(path, { path: filepath });
}
/**
* Get template content by themeId and filepath.
*
* @param themeId themeId
* @param filepath filepath
* @returns template content
*/
getTemplateContent(themeId, filepath) {
const path = (0, url_1.buildPath)({
endpointName: `themes/${themeId}/files/content`,
});
return this.client.get(path, { path: filepath });
}
/**
* Update theme template content by themeId.
*
* @param themeId themeId
* @param params path, content
*/
updateTemplateContent(themeId, params) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const path = (0, url_1.buildPath)({
endpointName: `themes/${themeId}/files/content`,
});
yield this.client.put(path, Object.assign({}, params));
});
}
/**
* List theme settings by themeId.
*
* @param themeId themeId
* @returns Record
*/
listSettings(themeId) {
const path = (0, url_1.buildPath)({
endpointName: `themes/${themeId}/settings`,
});
return this.client.get(path, {});
}
/**
* List activated theme settings.
*
* @returns Record
*/
listActivatedSettings() {
const path = (0, url_1.buildPath)({
endpointName: 'themes/activation/settings',
});
return this.client.get(path, {});
}
/**
* Lists theme settings by theme id and group name
*
* @param themeId theme id
* @param group group name
*/
listSettingsByGroup(themeId, group) {
const path = (0, url_1.buildPath)({
endpointName: `themes/${themeId}/groups/${group}/settings`,
});
return this.client.get(path, {});
}
/**
* Save settings by themeId.
*
* @param themeId themeId
* @param settings settings
*/
saveSettings(themeId, settings) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const path = (0, url_1.buildPath)({
endpointName: `themes/${themeId}/settings`,
});
yield this.client.post(path, settings);
});
}
/**
* Save activated theme settings.
*
* @param settings settings
*/
saveActivatedSettings(settings) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const path = (0, url_1.buildPath)({
endpointName: 'themes/activation/settings',
});
yield this.client.post(path, settings);
});
}
/**
* Get activated theme property.
*
* @returns ThemeProperty
*/
getActivatedTheme() {
const path = (0, url_1.buildPath)({
endpointName: 'themes/activation',
});
return this.client.get(path, {});
}
/**
* List activated theme custom post templates.
*
* @returns array of template name.
*/
listCustomPostTemplates() {
const path = (0, url_1.buildPath)({
endpointName: 'themes/activation/template/custom/post',
});
return this.client.get(path, {});
}
/**
* List activated theme custom sheet templates.
*
* @returns array of template name.
*/
listCustomSheetTemplates() {
const path = (0, url_1.buildPath)({
endpointName: 'themes/activation/template/custom/sheet',
});
return this.client.get(path, {});
}
/**
* Check template exists
*
* @param template template name
* @returns boolean
*/
exists(template) {
const path = (0, url_1.buildPath)({
endpointName: 'themes/activation/template/exists',
});
return this.client.get(path, { template });
}
/**
* Fetch theme by uri
*
* @param uri uri
* @returns void
*/
fetchTheme(uri) {
const path = (0, url_1.buildPath)({
endpointName: `themes/fetching?uri=${uri}`,
});
return this.client.post(path, {});
}
/**
* update theme by fetch.
*
* @param themeId themeId
* @returns void
*/
updateThemeByFetching(themeId) {
const path = (0, url_1.buildPath)({
endpointName: `themes/fetching/${themeId}`,
});
return this.client.put(path, {});
}
/**
* Update activated theme template content.
*
* @param params path, content
* @returns void
*/
updateActivatedTemplateContent(params) {
const path = (0, url_1.buildPath)({
endpointName: 'themes/files/content',
});
return this.client.put(path, Object.assign({}, params));
}
/**
* Refresh theme list cache.
*
* @returns void
*/
reload() {
const path = (0, url_1.buildPath)({
endpointName: 'themes/reload',
});
return this.client.post(path, {});
}
/**
* Upload a theme.
*
* @param data data
* @param options Upload options
* @returns ThemeProperty
*/
upload(data, options) {
const path = (0, url_1.buildPath)({
endpointName: 'themes/upload',
});
const formData = new rest_api_client_1.FormData();
formData.append('file', data);
return this.client.post(path, formData, Object.assign({}, options));
}
/**
* Update theme by upload.
*
* @param options upload options
* @param themeId themeId
* @param data data
* @returns ThemeProperty
*/
updateByUpload(data, options, themeId) {
const path = (0, url_1.buildPath)({
endpointName: `themes/upload/${themeId}`,
});
const formData = new rest_api_client_1.FormData();
formData.append('file', data);
return this.client.put(path, formData, Object.assign({}, options));
}
}
exports.ThemeClient = ThemeClient;
//# sourceMappingURL=ThemeClient.js.map
/***/ }),
/***/ 5412:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.UserClient = void 0;
const url_1 = __webpack_require__(6998);
class UserClient {
constructor(client) {
this.client = client;
}
/**
* Get user profile
*/
getProfile() {
const path = (0, url_1.buildPath)({
endpointName: 'users/profiles',
});
return this.client.get(path, {});
}
/**
* Update user profile
*
* @param user {@link User}
*/
updateProfile(user) {
const path = (0, url_1.buildPath)({
endpointName: 'users/profiles',
});
return this.client.put(path, user);
}
updatePassword(params) {
const path = (0, url_1.buildPath)({
endpointName: 'users/profiles/password',
});
return this.client.put(path, Object.assign({}, params));
}
generateMFAQrImage(params) {
const path = (0, url_1.buildPath)({
endpointName: 'users/mfa/generate',
});
return this.client.put(path, Object.assign({}, params));
}
updateMFAuth(params) {
const path = (0, url_1.buildPath)({
endpointName: 'users/mfa/update',
});
return this.client.put(path, Object.assign({}, params));
}
}
exports.UserClient = UserClient;
//# sourceMappingURL=UserClient.js.map
/***/ }),
/***/ 6904:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.ActuatorClient = exports.CommentClient = exports.StaticStorageClient = exports.UserClient = exports.ThemeClient = exports.TagClient = exports.StatisticClient = exports.SheetClient = exports.SheetCommentClient = exports.PostClient = exports.PostCommentClient = exports.PhotoClient = exports.OptionClient = exports.MigrationClient = exports.MenuClient = exports.MailClient = exports.LogClient = exports.LinkClient = exports.JournalClient = exports.JournalCommentClient = exports.InstallationClient = exports.CategoryClient = exports.BackupClient = exports.AttachmentClient = void 0;
var AttachmentClient_1 = __webpack_require__(399);
Object.defineProperty(exports, "AttachmentClient", ({ enumerable: true, get: function () { return AttachmentClient_1.AttachmentClient; } }));
var BackupClient_1 = __webpack_require__(5260);
Object.defineProperty(exports, "BackupClient", ({ enumerable: true, get: function () { return BackupClient_1.BackupClient; } }));
var CategoryClient_1 = __webpack_require__(6774);
Object.defineProperty(exports, "CategoryClient", ({ enumerable: true, get: function () { return CategoryClient_1.CategoryClient; } }));
var InstallationClient_1 = __webpack_require__(8400);
Object.defineProperty(exports, "InstallationClient", ({ enumerable: true, get: function () { return InstallationClient_1.InstallationClient; } }));
var JournalCommentClient_1 = __webpack_require__(5503);
Object.defineProperty(exports, "JournalCommentClient", ({ enumerable: true, get: function () { return JournalCommentClient_1.JournalCommentClient; } }));
var JournalClient_1 = __webpack_require__(173);
Object.defineProperty(exports, "JournalClient", ({ enumerable: true, get: function () { return JournalClient_1.JournalClient; } }));
var LinkClient_1 = __webpack_require__(9207);
Object.defineProperty(exports, "LinkClient", ({ enumerable: true, get: function () { return LinkClient_1.LinkClient; } }));
var LogClient_1 = __webpack_require__(9842);
Object.defineProperty(exports, "LogClient", ({ enumerable: true, get: function () { return LogClient_1.LogClient; } }));
var MailClient_1 = __webpack_require__(7206);
Object.defineProperty(exports, "MailClient", ({ enumerable: true, get: function () { return MailClient_1.MailClient; } }));
var MenuClient_1 = __webpack_require__(7530);
Object.defineProperty(exports, "MenuClient", ({ enumerable: true, get: function () { return MenuClient_1.MenuClient; } }));
var MigrationClient_1 = __webpack_require__(9644);
Object.defineProperty(exports, "MigrationClient", ({ enumerable: true, get: function () { return MigrationClient_1.MigrationClient; } }));
var OptionClient_1 = __webpack_require__(3913);
Object.defineProperty(exports, "OptionClient", ({ enumerable: true, get: function () { return OptionClient_1.OptionClient; } }));
var PhotoClient_1 = __webpack_require__(402);
Object.defineProperty(exports, "PhotoClient", ({ enumerable: true, get: function () { return PhotoClient_1.PhotoClient; } }));
var PostCommentClient_1 = __webpack_require__(6494);
Object.defineProperty(exports, "PostCommentClient", ({ enumerable: true, get: function () { return PostCommentClient_1.PostCommentClient; } }));
var PostClient_1 = __webpack_require__(4682);
Object.defineProperty(exports, "PostClient", ({ enumerable: true, get: function () { return PostClient_1.PostClient; } }));
var SheetCommentClient_1 = __webpack_require__(6094);
Object.defineProperty(exports, "SheetCommentClient", ({ enumerable: true, get: function () { return SheetCommentClient_1.SheetCommentClient; } }));
var SheetClient_1 = __webpack_require__(771);
Object.defineProperty(exports, "SheetClient", ({ enumerable: true, get: function () { return SheetClient_1.SheetClient; } }));
var StatisticClient_1 = __webpack_require__(7922);
Object.defineProperty(exports, "StatisticClient", ({ enumerable: true, get: function () { return StatisticClient_1.StatisticClient; } }));
var TagClient_1 = __webpack_require__(4898);
Object.defineProperty(exports, "TagClient", ({ enumerable: true, get: function () { return TagClient_1.TagClient; } }));
var ThemeClient_1 = __webpack_require__(8842);
Object.defineProperty(exports, "ThemeClient", ({ enumerable: true, get: function () { return ThemeClient_1.ThemeClient; } }));
var UserClient_1 = __webpack_require__(5412);
Object.defineProperty(exports, "UserClient", ({ enumerable: true, get: function () { return UserClient_1.UserClient; } }));
var StaticStorageClient_1 = __webpack_require__(7742);
Object.defineProperty(exports, "StaticStorageClient", ({ enumerable: true, get: function () { return StaticStorageClient_1.StaticStorageClient; } }));
var CommentClient_1 = __webpack_require__(8666);
Object.defineProperty(exports, "CommentClient", ({ enumerable: true, get: function () { return CommentClient_1.CommentClient; } }));
var ActuatorClient_1 = __webpack_require__(6618);
Object.defineProperty(exports, "ActuatorClient", ({ enumerable: true, get: function () { return ActuatorClient_1.ActuatorClient; } }));
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 5597:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.AuthorizedClient = exports.AdminApiClient = void 0;
const tslib_1 = __webpack_require__(655);
var AdminApiClient_1 = __webpack_require__(6587);
Object.defineProperty(exports, "AdminApiClient", ({ enumerable: true, get: function () { return AdminApiClient_1.AdminApiClient; } }));
var AuthorizedClient_1 = __webpack_require__(6710);
Object.defineProperty(exports, "AuthorizedClient", ({ enumerable: true, get: function () { return AuthorizedClient_1.AuthorizedClient; } }));
tslib_1.__exportStar(__webpack_require__(5040), exports);
tslib_1.__exportStar(__webpack_require__(6904), exports);
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 6998:
/***/ (function(__unused_webpack_module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.buildPath = void 0;
const buildPath = (params) => {
const { endpointName, scope } = params;
const scopePath = scope !== undefined ? `${scope}` : 'admin';
return `/api/${scopePath}/${endpointName}`;
};
exports.buildPath = buildPath;
//# sourceMappingURL=url.js.map
/***/ }),
/***/ 9290:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.HaloRequestConfigBuilder = void 0;
const tslib_1 = __webpack_require__(655);
const form_data_1 = tslib_1.__importDefault(__webpack_require__(6230));
const qs_1 = tslib_1.__importDefault(__webpack_require__(129));
const js_base64_1 = __webpack_require__(9575);
const auth_1 = __webpack_require__(3622);
const platform_1 = __webpack_require__(8384);
const THRESHOLD_AVOID_REQUEST_URL_TOO_LARGE = 4096;
class HaloRequestConfigBuilder {
constructor({ baseUrl, auth, basicAuth, clientCertAuth, proxy, userAgent, }) {
this.baseUrl = baseUrl;
this.auth = auth;
this.headers = this.buildHeaders({ basicAuth, userAgent });
this.clientCertAuth = clientCertAuth;
this.proxy = proxy;
this.requestToken = null;
}
build(method, path, params, options) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const requestConfig = Object.assign(Object.assign(Object.assign({ method, headers: this.headers, url: `${this.baseUrl}${path}` }, (options ? options : {})), platform_1.platformDeps.buildPlatformDependentConfig({
clientCertAuth: this.clientCertAuth,
})), { proxy: this.proxy });
switch (method) {
case 'get': {
const requestUrl = this.buildRequestUrl(path, params);
if (requestUrl.length > THRESHOLD_AVOID_REQUEST_URL_TOO_LARGE) {
return Object.assign(Object.assign({}, requestConfig), { method: 'post', headers: Object.assign(Object.assign({}, this.headers), { 'X-HTTP-Method-Override': 'GET' }), data: yield this.buildData(params) });
}
return Object.assign(Object.assign({}, requestConfig), { url: requestUrl });
}
case 'post': {
if (params instanceof form_data_1.default) {
const formData = yield this.buildData(params);
return Object.assign(Object.assign({}, requestConfig), { headers:
// NOTE: formData.getHeaders does not exist in a browser environment.
typeof formData.getHeaders === 'function' ? Object.assign(Object.assign({}, this.headers), formData.getHeaders()) : this.headers, data: formData });
}
return Object.assign(Object.assign({}, requestConfig), { data: yield this.buildData(params) });
}
case 'put': {
return Object.assign(Object.assign({}, requestConfig), { data: yield this.buildData(params) });
}
case 'delete': {
if (params instanceof Array) {
return Object.assign(Object.assign({}, requestConfig), { headers: this.headers, data: params });
}
const requestUrl = this.buildRequestUrl(path, yield this.buildData(params));
return Object.assign(Object.assign({}, requestConfig), { url: requestUrl });
}
default: {
throw new Error(`${method} method is not supported`);
}
}
});
}
buildRequestUrl(path, params) {
const requestUrl = `${this.baseUrl}${path}`;
const query = qs_1.default.stringify(params, { indices: false });
return query ? `${requestUrl}?${query}` : requestUrl;
}
buildData(params) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
if (this.auth && this.auth.type === 'session') {
const requestToken = yield this.getRequestToken();
if (params instanceof form_data_1.default) {
params.append(auth_1.SESSION_TOKEN_KEY, requestToken);
return params;
}
return Object.assign({ [auth_1.SESSION_TOKEN_KEY]: requestToken }, params);
}
return params;
});
}
buildHeaders(params) {
const { basicAuth, userAgent } = params;
const basicAuthHeaders = basicAuth
? {
Authorization: `Basic ${js_base64_1.Base64.encode(`${basicAuth.username}:${basicAuth.password}`)}`,
}
: {};
const platformDepsHeaders = platform_1.platformDeps.buildHeaders({ userAgent });
const commonHeaders = Object.assign(Object.assign({}, platformDepsHeaders), basicAuthHeaders);
if (!this.auth) {
return {};
}
switch (this.auth.type) {
case 'password': {
return Object.assign(Object.assign({}, commonHeaders), { Authorization: js_base64_1.Base64.encode(`${this.auth.username}:${this.auth.password}`) });
}
case 'adminToken': {
const adminToken = this.auth.adminToken;
return Object.assign(Object.assign({}, commonHeaders), { 'Admin-Authorization': adminToken });
}
case 'apiToken': {
const apiToken = this.auth.apiToken;
if (Array.isArray(apiToken)) {
return Object.assign(Object.assign({}, commonHeaders), { 'API-Authorization': apiToken.join(',') });
}
return Object.assign(Object.assign({}, commonHeaders), { 'API-Authorization': apiToken });
}
case 'oAuthToken': {
return Object.assign(Object.assign({}, commonHeaders), { Authorization: `Bearer ${this.auth.oAuthToken}` });
}
case 'customizeAuth': {
return Object.assign(Object.assign({}, commonHeaders), { [this.auth.authHeader]: this.auth.getToken() });
}
default: {
// https://developer.mozilla.org/zh-CN/docs/Web/API/XMLHttpRequest
return Object.assign(Object.assign({}, commonHeaders), { 'X-Requested-With': 'XMLHttpRequest' });
}
}
}
getRequestToken() {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
if (this.requestToken === null) {
this.requestToken = yield platform_1.platformDeps.getRequestToken();
}
return this.requestToken;
});
}
}
exports.HaloRequestConfigBuilder = HaloRequestConfigBuilder;
//# sourceMappingURL=HaloRequestConfigBuilder.js.map
/***/ }),
/***/ 2862:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.HaloResponseHandler = void 0;
const tslib_1 = __webpack_require__(655);
const HaloRestAPIError_1 = __webpack_require__(2284);
class HaloResponseHandler {
handle(response) {
return response.then((res) => this.handleSuccessResponse(res), (error) => this.handleErrorResponse(error));
}
handleSuccessResponse(response) {
return response.data;
}
handleErrorResponse(error) {
if (!error.response) {
// FIXME: find a better way to handle this error
if (/MAC address verify failure/.test(error.toString())) {
throw new Error('invalid clientCertAuth setting');
}
throw error;
}
const errorResponse = error.response;
const { data } = errorResponse, rest = tslib_1.__rest(errorResponse, ["data"]);
if (typeof data === 'string') {
throw new Error(`${rest.status}: ${rest.statusText}`);
}
throw new HaloRestAPIError_1.HaloRestAPIError(Object.assign({ data }, rest));
}
}
exports.HaloResponseHandler = HaloResponseHandler;
//# sourceMappingURL=HaloResponseHandler.js.map
/***/ }),
/***/ 3388:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.HaloRestAPIClient = void 0;
const http_1 = __webpack_require__(2992);
const HaloRequestConfigBuilder_1 = __webpack_require__(9290);
const HaloResponseHandler_1 = __webpack_require__(2862);
const platform_1 = __webpack_require__(8384);
const buildDiscriminatedAuth = (auth) => {
if ('username' in auth) {
return Object.assign({ type: 'password' }, auth);
}
if ('apiToken' in auth) {
return Object.assign({ type: 'apiToken' }, auth);
}
if ('adminToken' in auth) {
return Object.assign({ type: 'adminToken' }, auth);
}
if ('oAuthToken' in auth) {
return Object.assign({ type: 'oAuthToken' }, auth);
}
if ('type' in auth && auth['type'] == 'customizeAuth') {
return auth;
}
return undefined;
};
class HaloRestAPIClient {
constructor(options = {}) {
var _a;
this.baseUrl = platform_1.platformDeps.buildBaseUrl(options.baseUrl);
const auth = buildDiscriminatedAuth((_a = options.auth) !== null && _a !== void 0 ? _a : {});
const requestConfigBuilder = new HaloRequestConfigBuilder_1.HaloRequestConfigBuilder(Object.assign(Object.assign({}, options), { baseUrl: this.baseUrl, auth }));
const responseHandler = new HaloResponseHandler_1.HaloResponseHandler();
this.httpClient = new http_1.DefaultHttpClient({
responseHandler,
requestConfigBuilder,
});
this._interceptors = this.httpClient.interceptors;
}
static get version() {
return platform_1.platformDeps.getVersion();
}
get interceptors() {
return this._interceptors;
}
getBaseUrl() {
return this.baseUrl;
}
buildHttpClient() {
return this.httpClient;
}
}
exports.HaloRestAPIClient = HaloRestAPIClient;
//# sourceMappingURL=HaloRestAPIClient.js.map
/***/ }),
/***/ 2284:
/***/ (function(__unused_webpack_module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.HaloRestAPIError = void 0;
class HaloRestAPIError extends Error {
constructor(error) {
const { data } = HaloRestAPIError.buildErrorResponseDate(error);
super(data.message);
this.name = 'HaloRestAPIError';
this.data = data;
this.status = data.status;
this.headers = error.headers;
this.message = `[${this.status}] ${this.message}`;
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Custom_Error_Types
// Maintains proper stack trace for where our error was thrown (only available on V8)
if (Error.captureStackTrace) {
Error.captureStackTrace(this, HaloRestAPIError);
}
// https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
// Set the prototype explicitly.
Object.setPrototypeOf(this, HaloRestAPIError.prototype);
}
static buildErrorResponseDate(error) {
// improvable
return { data: error.data };
}
}
exports.HaloRestAPIError = HaloRestAPIError;
//# sourceMappingURL=HaloRestAPIError.js.map
/***/ }),
/***/ 1638:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.AxiosClient = void 0;
const tslib_1 = __webpack_require__(655);
const axios_1 = tslib_1.__importDefault(__webpack_require__(9669));
const InterceptorManager_1 = __webpack_require__(6008);
class AxiosClient {
constructor({ responseHandler, requestConfigBuilder, }) {
this.responseHandler = responseHandler;
this.requestConfigBuilder = requestConfigBuilder;
this.interceptors = {
request: new InterceptorManager_1.RequestInterceptor(),
response: new InterceptorManager_1.ResponseInterceptor(),
};
}
get(path, params) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const requestConfig = yield this.requestConfigBuilder.build('get', path, params);
return this.sendRequest(requestConfig);
});
}
getData(path, params) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const requestConfig = yield this.requestConfigBuilder.build('get', path, params, {
responseType: 'arraybuffer',
});
return this.sendRequest(requestConfig);
});
}
post(path, params, options) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const requestConfig = yield this.requestConfigBuilder.build('post', path, params, options);
return this.sendRequest(requestConfig);
});
}
postData(path, formData) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const requestConfig = yield this.requestConfigBuilder.build('post', path, formData);
return this.sendRequest(requestConfig);
});
}
put(path, params, options) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const requestConfig = yield this.requestConfigBuilder.build('put', path, params, options);
return this.sendRequest(requestConfig);
});
}
delete(path, params, options) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const requestConfig = yield this.requestConfigBuilder.build('delete', path, params, options);
return this.sendRequest(requestConfig);
});
}
sendRequest(requestConfig) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
return this.responseHandler.handle(
// eslint-disable-next-line new-cap
(0, axios_1.default)(Object.assign(Object.assign({}, requestConfig), {
// NOTE: For defining the max size of the http request content, `maxBodyLength` will be used after version 0.20.0.
// `maxContentLength` will be still needed for defining the max size of the http response content.
// ref: https://github.com/axios/axios/pull/2781/files
// maxBodyLength: Infinity,
maxContentLength: Infinity })));
});
}
}
exports.AxiosClient = AxiosClient;
//# sourceMappingURL=AxiosClient.js.map
/***/ }),
/***/ 6008:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.ResponseInterceptor = exports.RequestInterceptor = void 0;
const tslib_1 = __webpack_require__(655);
const axios_1 = tslib_1.__importDefault(__webpack_require__(9669));
class RequestInterceptor {
use(resolved, rejected) {
return axios_1.default.interceptors.request.use(resolved, rejected);
}
eject(id) {
axios_1.default.interceptors.request.eject(id);
}
}
exports.RequestInterceptor = RequestInterceptor;
class ResponseInterceptor {
use(resolved, rejected) {
return axios_1.default.interceptors.response.use(resolved, rejected);
}
eject(id) {
axios_1.default.interceptors.response.eject(id);
}
}
exports.ResponseInterceptor = ResponseInterceptor;
//# sourceMappingURL=InterceptorManager.js.map
/***/ }),
/***/ 2992:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.DefaultHttpClient = void 0;
var AxiosClient_1 = __webpack_require__(1638);
Object.defineProperty(exports, "DefaultHttpClient", ({ enumerable: true, get: function () { return AxiosClient_1.AxiosClient; } }));
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 5040:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.Axios = exports.FormData = exports.DefaultHttpClient = exports.HaloRequestConfigBuilder = exports.HaloResponseHandler = exports.HaloRestAPIClient = void 0;
const tslib_1 = __webpack_require__(655);
const platform_1 = __webpack_require__(8384);
const browserDeps = tslib_1.__importStar(__webpack_require__(5792));
const form_data_1 = tslib_1.__importDefault(__webpack_require__(6230));
exports.FormData = form_data_1.default;
const axios_1 = tslib_1.__importDefault(__webpack_require__(9669));
exports.Axios = axios_1.default;
(0, platform_1.injectPlatformDeps)(browserDeps);
var HaloRestAPIClient_1 = __webpack_require__(3388);
Object.defineProperty(exports, "HaloRestAPIClient", ({ enumerable: true, get: function () { return HaloRestAPIClient_1.HaloRestAPIClient; } }));
var HaloResponseHandler_1 = __webpack_require__(2862);
Object.defineProperty(exports, "HaloResponseHandler", ({ enumerable: true, get: function () { return HaloResponseHandler_1.HaloResponseHandler; } }));
var HaloRequestConfigBuilder_1 = __webpack_require__(9290);
Object.defineProperty(exports, "HaloRequestConfigBuilder", ({ enumerable: true, get: function () { return HaloRequestConfigBuilder_1.HaloRequestConfigBuilder; } }));
var http_1 = __webpack_require__(2992);
Object.defineProperty(exports, "DefaultHttpClient", ({ enumerable: true, get: function () { return http_1.DefaultHttpClient; } }));
//# sourceMappingURL=index.browser.js.map
/***/ }),
/***/ 6703:
/***/ (function(__unused_webpack_module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.UnsupportedPlatformError = void 0;
class UnsupportedPlatformError extends Error {
constructor(platform) {
const message = `This function is not supported in ${platform} environment`;
super(message);
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Custom_Error_Types
// Maintains proper stack trace for where our error was thrown (only available on V8)
if (Error.captureStackTrace) {
Error.captureStackTrace(this, UnsupportedPlatformError);
}
this.name = 'UnsupportedPlatformError';
this.platform = platform;
// https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
// Set the prototype explicitly.
Object.setPrototypeOf(this, UnsupportedPlatformError.prototype);
}
}
exports.UnsupportedPlatformError = UnsupportedPlatformError;
//# sourceMappingURL=UnsupportedPlatformError.js.map
/***/ }),
/***/ 5792:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getVersion = exports.buildBaseUrl = exports.buildFormDataValue = exports.buildHeaders = exports.buildPlatformDependentConfig = exports.getDefaultAuth = exports.getRequestToken = exports.readFileFromPath = void 0;
const tslib_1 = __webpack_require__(655);
const UnsupportedPlatformError_1 = __webpack_require__(6703);
const readFileFromPath = () => {
throw new UnsupportedPlatformError_1.UnsupportedPlatformError('Browser');
};
exports.readFileFromPath = readFileFromPath;
const getRequestToken = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
if (typeof halo === 'object' && halo !== null && typeof halo.getRequestToken === 'function') {
return halo.getRequestToken();
}
throw new Error('session authentication must specify a request token');
});
exports.getRequestToken = getRequestToken;
const getDefaultAuth = () => {
return {
type: 'session',
};
};
exports.getDefaultAuth = getDefaultAuth;
const buildPlatformDependentConfig = () => {
return {};
};
exports.buildPlatformDependentConfig = buildPlatformDependentConfig;
const buildHeaders = () => {
return {};
};
exports.buildHeaders = buildHeaders;
const buildFormDataValue = (data) => {
return new Blob([data]);
};
exports.buildFormDataValue = buildFormDataValue;
const buildBaseUrl = (baseUrl) => {
if (typeof baseUrl === 'undefined') {
throw new Error('in browser environment, baseUrl is required');
}
return baseUrl;
};
exports.buildBaseUrl = buildBaseUrl;
const getVersion = () => {
return PACKAGE_VERSION;
};
exports.getVersion = getVersion;
//# sourceMappingURL=browser.js.map
/***/ }),
/***/ 8384:
/***/ (function(__unused_webpack_module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.injectPlatformDeps = exports.platformDeps = void 0;
exports.platformDeps = {
readFileFromPath: () => {
throw new Error('not implemented');
},
getRequestToken: () => {
throw new Error('not implemented');
},
getDefaultAuth: () => {
throw new Error('not implemented');
},
buildPlatformDependentConfig: () => {
throw new Error('not implemented');
},
buildHeaders: () => {
throw new Error('not implemented');
},
buildFormDataValue: () => {
throw new Error('not implemented');
},
buildBaseUrl: () => {
throw new Error('not implemented');
},
getVersion: () => {
throw new Error('not implemented');
},
};
const injectPlatformDeps = (deps) => {
exports.platformDeps.readFileFromPath = deps.readFileFromPath;
exports.platformDeps.getRequestToken = deps.getRequestToken;
exports.platformDeps.getDefaultAuth = deps.getDefaultAuth;
exports.platformDeps.buildPlatformDependentConfig = deps.buildPlatformDependentConfig;
exports.platformDeps.buildHeaders = deps.buildHeaders;
exports.platformDeps.buildFormDataValue = deps.buildFormDataValue;
exports.platformDeps.buildBaseUrl = deps.buildBaseUrl;
exports.platformDeps.getVersion = deps.getVersion;
};
exports.injectPlatformDeps = injectPlatformDeps;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 3622:
/***/ (function(__unused_webpack_module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.SESSION_TOKEN_KEY = void 0;
exports.SESSION_TOKEN_KEY = '__REQUEST_TOKEN__';
//# sourceMappingURL=auth.js.map
/***/ }),
/***/ 6838:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.ContentApiClient = void 0;
const clients_1 = __webpack_require__(3891);
class ContentApiClient {
constructor(client) {
this.client = client.buildHttpClient();
this._archive = new clients_1.ArchiveClient(this.client);
this._category = new clients_1.CategoryClient(this.client);
this._journal = new clients_1.JournalClient(this.client);
this._link = new clients_1.LinkClient(this.client);
this._menu = new clients_1.MenuClient(this.client);
this._option = new clients_1.OptionClient(this.client);
this._photo = new clients_1.PhotoClient(this.client);
this._post = new clients_1.PostClient(this.client);
this._sheet = new clients_1.SheetClient(this.client);
this._statistic = new clients_1.StatisticClient(this.client);
this._tag = new clients_1.TagClient(this.client);
this._theme = new clients_1.ThemeClient(this.client);
this._user = new clients_1.UserClient(this.client);
this._comment = new clients_1.CommentClient(this.client);
}
get archive() {
return this._archive;
}
get category() {
return this._category;
}
get journal() {
return this._journal;
}
get link() {
return this._link;
}
get menu() {
return this._menu;
}
get option() {
return this._option;
}
get photo() {
return this._photo;
}
get post() {
return this._post;
}
get sheet() {
return this._sheet;
}
get statistic() {
return this._statistic;
}
get tag() {
return this._tag;
}
get theme() {
return this._theme;
}
get user() {
return this._user;
}
get comment() {
return this._comment;
}
}
exports.ContentApiClient = ContentApiClient;
//# sourceMappingURL=ContentApiClient.js.map
/***/ }),
/***/ 9619:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.ArchiveClient = void 0;
const url_1 = __webpack_require__(9489);
class ArchiveClient {
constructor(client) {
this.client = client;
}
listYearArchives() {
const path = (0, url_1.buildPath)({
endpointName: 'archives/years',
});
return this.client.get(path, {});
}
listMonthArchives() {
const path = (0, url_1.buildPath)({
endpointName: 'archives/years',
});
return this.client.get(path, {});
}
}
exports.ArchiveClient = ArchiveClient;
//# sourceMappingURL=ArchiveClient.js.map
/***/ }),
/***/ 413:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.CategoryClient = void 0;
const url_1 = __webpack_require__(9489);
class CategoryClient {
constructor(client) {
this.client = client;
}
list(params) {
const path = (0, url_1.buildPath)({
endpointName: 'categories',
});
return this.client.get(path, Object.assign({}, params));
}
listPostBySlug(params) {
const path = (0, url_1.buildPath)({
endpointName: `categories/${params.slug}/posts`,
});
return this.client.get(path, Object.assign({}, params));
}
}
exports.CategoryClient = CategoryClient;
//# sourceMappingURL=CategoryClient.js.map
/***/ }),
/***/ 7929:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.CommentClient = void 0;
const url_1 = __webpack_require__(9489);
class CommentClient {
constructor(client) {
this.client = client;
}
/**
* Get top comments
*
* @param target posts, sheets, or journals
* @param targetId the id of the target
* @param params optional query params
*/
listTopComments(target, targetId, params) {
const path = (0, url_1.buildPath)({
endpointName: `${target}/${targetId}/comments/top_view`,
});
return this.client.get(path, Object.assign({}, params));
}
/**
* Get children comments
*
* @param target posts, sheets, or journals
* @param targetId the id of the target
* @param commentId the id of the top comment
* @param params optional query params
*/
listChildren(target, targetId, commentId, params) {
const path = (0, url_1.buildPath)({
endpointName: `${target}/${targetId}/comments/${commentId}/children`,
});
return this.client.get(path, Object.assign({}, params));
}
/**
* Get comments as tree view
*
* @param target posts, sheets, or journals
* @param targetId the id of the target
* @param params optional query params
*/
listAsTreeView(target, targetId, params) {
const path = (0, url_1.buildPath)({
endpointName: `${target}/${targetId}/comments/tree_view`,
});
return this.client.get(path, Object.assign({}, params));
}
/**
* Get comments as list view
*
* @param target posts, sheets, or journals
* @param targetId the id of the target
* @param params optional query params
*/
listAsView(target, targetId, params) {
const path = (0, url_1.buildPath)({
endpointName: `${target}/${targetId}/comments/list_view`,
});
return this.client.get(path, Object.assign({}, params));
}
/**
* Create a comment
*
* @param target posts, sheets, or journals
* @param params the comment params
*/
create(target, params) {
const path = (0, url_1.buildPath)({
endpointName: `${target}/comments`,
});
return this.client.post(path, params);
}
}
exports.CommentClient = CommentClient;
//# sourceMappingURL=CommentClient.js.map
/***/ }),
/***/ 3313:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.JournalClient = void 0;
const tslib_1 = __webpack_require__(655);
const url_1 = __webpack_require__(9489);
class JournalClient {
constructor(client) {
this.client = client;
}
list() {
const path = (0, url_1.buildPath)({
endpointName: 'journals',
});
return this.client.get(path, {});
}
get(journalId) {
const path = (0, url_1.buildPath)({
endpointName: `journals/${journalId}`,
});
return this.client.get(path, {});
}
like(journalId) {
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
const path = (0, url_1.buildPath)({
endpointName: `journals/${journalId}/likes`,
});
yield this.client.post(path, {});
});
}
}
exports.JournalClient = JournalClient;
//# sourceMappingURL=JournalClient.js.map
/***/ }),
/***/ 8241:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.LinkClient = void 0;
const url_1 = __webpack_require__(9489);
class LinkClient {
constructor(client) {
this.client = client;
}
list(sort) {
const path = (0, url_1.buildPath)({
endpointName: 'links',
});
return this.client.get(path, { sort });
}
listTeams(sort) {
const path = (0, url_1.buildPath)({
endpointName: 'links/team_view',
});
return this.client.get(path, { sort });
}
}
exports.LinkClient = LinkClient;
//# sourceMappingURL=LinkClient.js.map
/***/ }),
/***/ 428:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.MenuClient = void 0;
const url_1 = __webpack_require__(9489);
class MenuClient {
constructor(client) {
this.client = client;
}
list(sort) {
const path = (0, url_1.buildPath)({
endpointName: 'menus',
});
return this.client.get(path, { sort });
}
listAsTreeView(sort) {
const path = (0, url_1.buildPath)({
endpointName: 'menus/tree_view',
});
return this.client.get(path, { sort });
}
}
exports.MenuClient = MenuClient;
//# sourceMappingURL=MenuClient.js.map
/***/ }),
/***/ 3664:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.OptionClient = void 0;
const url_1 = __webpack_require__(9489);
class OptionClient {
constructor(client) {
this.client = client;
}
list() {
const path = (0, url_1.buildPath)({
endpointName: 'options/list_view',
});
return this.client.get(path, {});
}
listAsMapView(key) {
const path = (0, url_1.buildPath)({
endpointName: 'options/map_view',
});
return this.client.get(path, { key });
}
getByKey(key) {
const path = (0, url_1.buildPath)({
endpointName: `options/keys/${key}`,
});
return this.client.get(path, { key });
}
comment() {
const path = (0, url_1.buildPath)({
endpointName: 'options/comment',
});
return this.client.get(path, {});
}
}
exports.OptionClient = OptionClient;
//# sourceMappingURL=OptionClient.js.map
/***/ }),
/***/ 4353:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.PhotoClient = void 0;
const url_1 = __webpack_require__(9489);
class PhotoClient {
constructor(client) {
this.client = client;
}
latest(sort) {
const path = (0, url_1.buildPath)({
endpointName: 'photos/latest',
});
return this.client.get(path, { sort });
}
list(params) {
const path = (0, url_1.buildPath)({
endpointName: 'photos',
});
return this.client.get(path, Object.assign({}, params));
}
}
exports.PhotoClient = PhotoClient;
//# sourceMappingURL=PhotoClient.js.map
/***/ }),
/***/ 2312:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.PostClient = void 0;
const tslib_1 = __webpack_require__(655);
const url_1 = __webpack_require__(9489);
class PostClient {
constructor(client) {
this.client = client;
}
list(params, keyword, categoryId) {
const path = (0, url_1.buildPath)({
endpointName: 'posts',
});
return this.client.get(path, Object.assign({ keyword, categoryId }, params));
}
search(keyword, pageQuery) {
const path = (0, url_1.buildPath)({
endpointName: 'posts/search',
});
return this.client.get(path, Object.assign({ keyword }, pageQuery));
}
get(postId, params) {
const path = (0, url_1.buildPath)({
endpointName: `posts/${postId}`,
});
return this.client.get(path, Object.assign({}, params));
}
getBySlug(slug, params) {
const path = (0, url_1.buildPath)({
endpointName: 'posts/slug',
});
return this.client.get(path, Object.assign({ slug }, params));
}
getPrevPostById(postId) {
const path = (0, url_1.buildPath)({
endpointName: `posts/${postId}/prev`,
});
return this.client.get(path, {});
}
getNextPostById(postId) {
const path = (0, url_1.buildPath)({
endpointName: `posts/${postId}/next`,
});
return this.client.get(path, {});
}
like(postId) {
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
const path = (0, url_1.buildPath)({
endpointName: `posts/${postId}/likes`,
});
yield this.client.get(path, {});
});
}
}
exports.PostClient = PostClient;
//# sourceMappingURL=PostClient.js.map
/***/ }),
/***/ 6490:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.SheetClient = void 0;
const url_1 = __webpack_require__(9489);
class SheetClient {
constructor(client) {
this.client = client;
}
list(params) {
const path = (0, url_1.buildPath)({
endpointName: 'sheets',
});
return this.client.get(path, Object.assign({}, params));
}
get(sheetId, params) {
const path = (0, url_1.buildPath)({
endpointName: `sheets/${sheetId}`,
});
return this.client.get(path, Object.assign({}, params));
}
getBySlug(slug, params) {
const path = (0, url_1.buildPath)({
endpointName: 'sheets/slug',
});
return this.client.get(path, Object.assign({ slug }, params));
}
}
exports.SheetClient = SheetClient;
//# sourceMappingURL=SheetClient.js.map
/***/ }),
/***/ 8435:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.StatisticClient = void 0;
const url_1 = __webpack_require__(9489);
class StatisticClient {
constructor(client) {
this.client = client;
}
statistics() {
const path = (0, url_1.buildPath)({
endpointName: 'statistics',
});
return this.client.get(path, {});
}
statisticsWithUser() {
const path = (0, url_1.buildPath)({
endpointName: 'statistics/user',
});
return this.client.get(path, {});
}
}
exports.StatisticClient = StatisticClient;
//# sourceMappingURL=StatisticClient.js.map
/***/ }),
/***/ 2367:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.TagClient = void 0;
const url_1 = __webpack_require__(9489);
class TagClient {
constructor(client) {
this.client = client;
}
list(params) {
const path = (0, url_1.buildPath)({
endpointName: 'tags',
});
return this.client.get(path, Object.assign({}, params));
}
listPostsBySlug(slug, params) {
const path = (0, url_1.buildPath)({
endpointName: `tags/${slug}/posts`,
});
return this.client.get(path, Object.assign({}, params));
}
}
exports.TagClient = TagClient;
//# sourceMappingURL=TagClient.js.map
/***/ }),
/***/ 9895:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.ThemeClient = void 0;
const url_1 = __webpack_require__(9489);
class ThemeClient {
constructor(client) {
this.client = client;
}
getProperty() {
const path = (0, url_1.buildPath)({
endpointName: 'themes/activation',
});
return this.client.get(path, {});
}
listSettings() {
const path = (0, url_1.buildPath)({
endpointName: 'themes/activation/settings',
});
return this.client.get(path, {});
}
getPropertyById(themeId) {
const path = (0, url_1.buildPath)({
endpointName: `themes/${themeId}`,
});
return this.client.get(path, {});
}
listSettingsById(themeId) {
const path = (0, url_1.buildPath)({
endpointName: `themes/${themeId}/settings`,
});
return this.client.get(path, {});
}
}
exports.ThemeClient = ThemeClient;
//# sourceMappingURL=ThemeClient.js.map
/***/ }),
/***/ 2849:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.UserClient = void 0;
const url_1 = __webpack_require__(9489);
class UserClient {
constructor(client) {
this.client = client;
}
getProfile() {
const path = (0, url_1.buildPath)({
endpointName: 'users/profile',
});
return this.client.get(path, {});
}
}
exports.UserClient = UserClient;
//# sourceMappingURL=UserClient.js.map
/***/ }),
/***/ 3891:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.CommentClient = exports.UserClient = exports.ThemeClient = exports.TagClient = exports.StatisticClient = exports.SheetClient = exports.PostClient = exports.PhotoClient = exports.OptionClient = exports.MenuClient = exports.LinkClient = exports.JournalClient = exports.CategoryClient = exports.ArchiveClient = void 0;
var ArchiveClient_1 = __webpack_require__(9619);
Object.defineProperty(exports, "ArchiveClient", ({ enumerable: true, get: function () { return ArchiveClient_1.ArchiveClient; } }));
var CategoryClient_1 = __webpack_require__(413);
Object.defineProperty(exports, "CategoryClient", ({ enumerable: true, get: function () { return CategoryClient_1.CategoryClient; } }));
var JournalClient_1 = __webpack_require__(3313);
Object.defineProperty(exports, "JournalClient", ({ enumerable: true, get: function () { return JournalClient_1.JournalClient; } }));
var LinkClient_1 = __webpack_require__(8241);
Object.defineProperty(exports, "LinkClient", ({ enumerable: true, get: function () { return LinkClient_1.LinkClient; } }));
var MenuClient_1 = __webpack_require__(428);
Object.defineProperty(exports, "MenuClient", ({ enumerable: true, get: function () { return MenuClient_1.MenuClient; } }));
var OptionClient_1 = __webpack_require__(3664);
Object.defineProperty(exports, "OptionClient", ({ enumerable: true, get: function () { return OptionClient_1.OptionClient; } }));
var PhotoClient_1 = __webpack_require__(4353);
Object.defineProperty(exports, "PhotoClient", ({ enumerable: true, get: function () { return PhotoClient_1.PhotoClient; } }));
var PostClient_1 = __webpack_require__(2312);
Object.defineProperty(exports, "PostClient", ({ enumerable: true, get: function () { return PostClient_1.PostClient; } }));
var SheetClient_1 = __webpack_require__(6490);
Object.defineProperty(exports, "SheetClient", ({ enumerable: true, get: function () { return SheetClient_1.SheetClient; } }));
var StatisticClient_1 = __webpack_require__(8435);
Object.defineProperty(exports, "StatisticClient", ({ enumerable: true, get: function () { return StatisticClient_1.StatisticClient; } }));
var TagClient_1 = __webpack_require__(2367);
Object.defineProperty(exports, "TagClient", ({ enumerable: true, get: function () { return TagClient_1.TagClient; } }));
var ThemeClient_1 = __webpack_require__(9895);
Object.defineProperty(exports, "ThemeClient", ({ enumerable: true, get: function () { return ThemeClient_1.ThemeClient; } }));
var UserClient_1 = __webpack_require__(2849);
Object.defineProperty(exports, "UserClient", ({ enumerable: true, get: function () { return UserClient_1.UserClient; } }));
var CommentClient_1 = __webpack_require__(7929);
Object.defineProperty(exports, "CommentClient", ({ enumerable: true, get: function () { return CommentClient_1.CommentClient; } }));
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 3977:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.ContentApiClient = void 0;
const tslib_1 = __webpack_require__(655);
var ContentApiClient_1 = __webpack_require__(6838);
Object.defineProperty(exports, "ContentApiClient", ({ enumerable: true, get: function () { return ContentApiClient_1.ContentApiClient; } }));
(0, tslib_1.__exportStar)(__webpack_require__(920), exports);
(0, tslib_1.__exportStar)(__webpack_require__(3356), exports);
(0, tslib_1.__exportStar)(__webpack_require__(3891), exports);
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 3356:
/***/ (function(__unused_webpack_module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 9489:
/***/ (function(__unused_webpack_module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.buildPath = void 0;
const buildPath = (params) => {
const { endpointName, scope } = params;
const scopePath = scope !== undefined ? `${scope}` : 'content';
return `/api/${scopePath}/${endpointName}`;
};
exports.buildPath = buildPath;
//# sourceMappingURL=url.js.map
/***/ }),
/***/ 5668:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.HaloRequestConfigBuilder = void 0;
const tslib_1 = __webpack_require__(655);
const form_data_1 = (0, tslib_1.__importDefault)(__webpack_require__(6230));
const qs_1 = (0, tslib_1.__importDefault)(__webpack_require__(129));
const js_base64_1 = __webpack_require__(9575);
const auth_1 = __webpack_require__(3064);
const platform_1 = __webpack_require__(6595);
const THRESHOLD_AVOID_REQUEST_URL_TOO_LARGE = 4096;
class HaloRequestConfigBuilder {
constructor({ baseUrl, auth, basicAuth, clientCertAuth, proxy, userAgent, }) {
this.baseUrl = baseUrl;
this.auth = auth;
this.headers = this.buildHeaders({ basicAuth, userAgent });
this.clientCertAuth = clientCertAuth;
this.proxy = proxy;
this.requestToken = null;
}
build(method, path, params, options) {
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
const requestConfig = Object.assign(Object.assign(Object.assign({ method, headers: this.headers, url: `${this.baseUrl}${path}` }, (options ? options : {})), platform_1.platformDeps.buildPlatformDependentConfig({
clientCertAuth: this.clientCertAuth,
})), { proxy: this.proxy });
switch (method) {
case 'get': {
const requestUrl = this.buildRequestUrl(path, params);
if (requestUrl.length > THRESHOLD_AVOID_REQUEST_URL_TOO_LARGE) {
return Object.assign(Object.assign({}, requestConfig), { method: 'post', headers: Object.assign(Object.assign({}, this.headers), { 'X-HTTP-Method-Override': 'GET' }), data: yield this.buildData(params) });
}
return Object.assign(Object.assign({}, requestConfig), { url: requestUrl });
}
case 'post': {
if (params instanceof form_data_1.default) {
const formData = yield this.buildData(params);
return Object.assign(Object.assign({}, requestConfig), { headers:
// NOTE: formData.getHeaders does not exist in a browser environment.
typeof formData.getHeaders === 'function' ? Object.assign(Object.assign({}, this.headers), formData.getHeaders()) : this.headers, data: formData });
}
return Object.assign(Object.assign({}, requestConfig), { data: yield this.buildData(params) });
}
case 'put': {
return Object.assign(Object.assign({}, requestConfig), { data: yield this.buildData(params) });
}
case 'delete': {
if (params instanceof Array) {
return Object.assign(Object.assign({}, requestConfig), { headers: this.headers, data: params });
}
const requestUrl = this.buildRequestUrl(path, yield this.buildData(params));
return Object.assign(Object.assign({}, requestConfig), { url: requestUrl });
}
default: {
throw new Error(`${method} method is not supported`);
}
}
});
}
buildRequestUrl(path, params) {
const requestUrl = `${this.baseUrl}${path}`;
const query = qs_1.default.stringify(params, { indices: false });
return query ? `${requestUrl}?${query}` : requestUrl;
}
buildData(params) {
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
if (this.auth && this.auth.type === 'session') {
const requestToken = yield this.getRequestToken();
if (params instanceof form_data_1.default) {
params.append(auth_1.SESSION_TOKEN_KEY, requestToken);
return params;
}
return Object.assign({ [auth_1.SESSION_TOKEN_KEY]: requestToken }, params);
}
return params;
});
}
buildHeaders(params) {
const { basicAuth, userAgent } = params;
const basicAuthHeaders = basicAuth
? {
Authorization: `Basic ${js_base64_1.Base64.encode(`${basicAuth.username}:${basicAuth.password}`)}`,
}
: {};
const platformDepsHeaders = platform_1.platformDeps.buildHeaders({ userAgent });
const commonHeaders = Object.assign(Object.assign({}, platformDepsHeaders), basicAuthHeaders);
if (!this.auth) {
return {};
}
switch (this.auth.type) {
case 'password': {
return Object.assign(Object.assign({}, commonHeaders), { Authorization: js_base64_1.Base64.encode(`${this.auth.username}:${this.auth.password}`) });
}
case 'adminToken': {
const adminToken = this.auth.adminToken;
return Object.assign(Object.assign({}, commonHeaders), { 'Admin-Authorization': adminToken });
}
case 'apiToken': {
const apiToken = this.auth.apiToken;
if (Array.isArray(apiToken)) {
return Object.assign(Object.assign({}, commonHeaders), { 'API-Authorization': apiToken.join(',') });
}
return Object.assign(Object.assign({}, commonHeaders), { 'API-Authorization': apiToken });
}
case 'oAuthToken': {
return Object.assign(Object.assign({}, commonHeaders), { Authorization: `Bearer ${this.auth.oAuthToken}` });
}
case 'customizeAuth': {
return Object.assign(Object.assign({}, commonHeaders), { [this.auth.authHeader]: this.auth.getToken() });
}
default: {
// https://developer.mozilla.org/zh-CN/docs/Web/API/XMLHttpRequest
return Object.assign(Object.assign({}, commonHeaders), { 'X-Requested-With': 'XMLHttpRequest' });
}
}
}
getRequestToken() {
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
if (this.requestToken === null) {
this.requestToken = yield platform_1.platformDeps.getRequestToken();
}
return this.requestToken;
});
}
}
exports.HaloRequestConfigBuilder = HaloRequestConfigBuilder;
//# sourceMappingURL=HaloRequestConfigBuilder.js.map
/***/ }),
/***/ 8867:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.HaloResponseHandler = void 0;
const tslib_1 = __webpack_require__(655);
const HaloRestAPIError_1 = __webpack_require__(2203);
class HaloResponseHandler {
handle(response) {
return response.then((res) => this.handleSuccessResponse(res), (error) => this.handleErrorResponse(error));
}
handleSuccessResponse(response) {
return response.data;
}
handleErrorResponse(error) {
if (!error.response) {
// FIXME: find a better way to handle this error
if (/MAC address verify failure/.test(error.toString())) {
throw new Error('invalid clientCertAuth setting');
}
throw error;
}
const errorResponse = error.response;
const { data } = errorResponse, rest = (0, tslib_1.__rest)(errorResponse, ["data"]);
if (typeof data === 'string') {
throw new Error(`${rest.status}: ${rest.statusText}`);
}
throw new HaloRestAPIError_1.HaloRestAPIError(Object.assign({ data }, rest));
}
}
exports.HaloResponseHandler = HaloResponseHandler;
//# sourceMappingURL=HaloResponseHandler.js.map
/***/ }),
/***/ 9230:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.HaloRestAPIClient = void 0;
const http_1 = __webpack_require__(5208);
const HaloRequestConfigBuilder_1 = __webpack_require__(5668);
const HaloResponseHandler_1 = __webpack_require__(8867);
const platform_1 = __webpack_require__(6595);
const buildDiscriminatedAuth = (auth) => {
if ('username' in auth) {
return Object.assign({ type: 'password' }, auth);
}
if ('apiToken' in auth) {
return Object.assign({ type: 'apiToken' }, auth);
}
if ('adminToken' in auth) {
return Object.assign({ type: 'adminToken' }, auth);
}
if ('oAuthToken' in auth) {
return Object.assign({ type: 'oAuthToken' }, auth);
}
if ('type' in auth && auth['type'] == 'customizeAuth') {
return auth;
}
return undefined;
};
class HaloRestAPIClient {
constructor(options = {}) {
var _a;
this.baseUrl = platform_1.platformDeps.buildBaseUrl(options.baseUrl);
const auth = buildDiscriminatedAuth((_a = options.auth) !== null && _a !== void 0 ? _a : {});
const requestConfigBuilder = new HaloRequestConfigBuilder_1.HaloRequestConfigBuilder(Object.assign(Object.assign({}, options), { baseUrl: this.baseUrl, auth }));
const responseHandler = new HaloResponseHandler_1.HaloResponseHandler();
this.httpClient = new http_1.DefaultHttpClient({
responseHandler,
requestConfigBuilder,
});
this._interceptors = this.httpClient.interceptors;
}
static get version() {
return platform_1.platformDeps.getVersion();
}
get interceptors() {
return this._interceptors;
}
getBaseUrl() {
return this.baseUrl;
}
buildHttpClient() {
return this.httpClient;
}
}
exports.HaloRestAPIClient = HaloRestAPIClient;
//# sourceMappingURL=HaloRestAPIClient.js.map
/***/ }),
/***/ 2203:
/***/ (function(__unused_webpack_module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.HaloRestAPIError = void 0;
class HaloRestAPIError extends Error {
constructor(error) {
const { data } = HaloRestAPIError.buildErrorResponseDate(error);
super(data.message);
this.name = 'HaloRestAPIError';
this.data = data;
this.status = data.status;
this.headers = error.headers;
this.message = `[${this.status}] ${this.message}`;
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Custom_Error_Types
// Maintains proper stack trace for where our error was thrown (only available on V8)
if (Error.captureStackTrace) {
Error.captureStackTrace(this, HaloRestAPIError);
}
// https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
// Set the prototype explicitly.
Object.setPrototypeOf(this, HaloRestAPIError.prototype);
}
static buildErrorResponseDate(error) {
// improvable
return { data: error.data };
}
}
exports.HaloRestAPIError = HaloRestAPIError;
//# sourceMappingURL=HaloRestAPIError.js.map
/***/ }),
/***/ 7518:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.AxiosClient = void 0;
const tslib_1 = __webpack_require__(655);
const axios_1 = (0, tslib_1.__importDefault)(__webpack_require__(9669));
const InterceptorManager_1 = __webpack_require__(1916);
class AxiosClient {
constructor({ responseHandler, requestConfigBuilder, }) {
this.responseHandler = responseHandler;
this.requestConfigBuilder = requestConfigBuilder;
this.interceptors = {
request: new InterceptorManager_1.RequestInterceptor(),
response: new InterceptorManager_1.ResponseInterceptor(),
};
}
get(path, params) {
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
const requestConfig = yield this.requestConfigBuilder.build('get', path, params);
return this.sendRequest(requestConfig);
});
}
getData(path, params) {
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
const requestConfig = yield this.requestConfigBuilder.build('get', path, params, {
responseType: 'arraybuffer',
});
return this.sendRequest(requestConfig);
});
}
post(path, params, options) {
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
const requestConfig = yield this.requestConfigBuilder.build('post', path, params, options);
return this.sendRequest(requestConfig);
});
}
postData(path, formData) {
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
const requestConfig = yield this.requestConfigBuilder.build('post', path, formData);
return this.sendRequest(requestConfig);
});
}
put(path, params, options) {
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
const requestConfig = yield this.requestConfigBuilder.build('put', path, params, options);
return this.sendRequest(requestConfig);
});
}
delete(path, params, options) {
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
const requestConfig = yield this.requestConfigBuilder.build('delete', path, params, options);
return this.sendRequest(requestConfig);
});
}
sendRequest(requestConfig) {
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
return this.responseHandler.handle(
// eslint-disable-next-line new-cap
(0, axios_1.default)(Object.assign(Object.assign({}, requestConfig), {
// NOTE: For defining the max size of the http request content, `maxBodyLength` will be used after version 0.20.0.
// `maxContentLength` will be still needed for defining the max size of the http response content.
// ref: https://github.com/axios/axios/pull/2781/files
// maxBodyLength: Infinity,
maxContentLength: Infinity })));
});
}
}
exports.AxiosClient = AxiosClient;
//# sourceMappingURL=AxiosClient.js.map
/***/ }),
/***/ 1916:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.ResponseInterceptor = exports.RequestInterceptor = void 0;
const tslib_1 = __webpack_require__(655);
const axios_1 = (0, tslib_1.__importDefault)(__webpack_require__(9669));
class RequestInterceptor {
use(resolved, rejected) {
return axios_1.default.interceptors.request.use(resolved, rejected);
}
eject(id) {
axios_1.default.interceptors.request.eject(id);
}
}
exports.RequestInterceptor = RequestInterceptor;
class ResponseInterceptor {
use(resolved, rejected) {
return axios_1.default.interceptors.response.use(resolved, rejected);
}
eject(id) {
axios_1.default.interceptors.response.eject(id);
}
}
exports.ResponseInterceptor = ResponseInterceptor;
//# sourceMappingURL=InterceptorManager.js.map
/***/ }),
/***/ 5208:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.DefaultHttpClient = void 0;
var AxiosClient_1 = __webpack_require__(7518);
Object.defineProperty(exports, "DefaultHttpClient", ({ enumerable: true, get: function () { return AxiosClient_1.AxiosClient; } }));
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 920:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.Axios = exports.FormData = exports.DefaultHttpClient = exports.HaloRequestConfigBuilder = exports.HaloResponseHandler = exports.HaloRestAPIClient = void 0;
const tslib_1 = __webpack_require__(655);
const platform_1 = __webpack_require__(6595);
const browserDeps = (0, tslib_1.__importStar)(__webpack_require__(4014));
const form_data_1 = (0, tslib_1.__importDefault)(__webpack_require__(6230));
exports.FormData = form_data_1.default;
const axios_1 = (0, tslib_1.__importDefault)(__webpack_require__(9669));
exports.Axios = axios_1.default;
(0, platform_1.injectPlatformDeps)(browserDeps);
var HaloRestAPIClient_1 = __webpack_require__(9230);
Object.defineProperty(exports, "HaloRestAPIClient", ({ enumerable: true, get: function () { return HaloRestAPIClient_1.HaloRestAPIClient; } }));
var HaloResponseHandler_1 = __webpack_require__(8867);
Object.defineProperty(exports, "HaloResponseHandler", ({ enumerable: true, get: function () { return HaloResponseHandler_1.HaloResponseHandler; } }));
var HaloRequestConfigBuilder_1 = __webpack_require__(5668);
Object.defineProperty(exports, "HaloRequestConfigBuilder", ({ enumerable: true, get: function () { return HaloRequestConfigBuilder_1.HaloRequestConfigBuilder; } }));
var http_1 = __webpack_require__(5208);
Object.defineProperty(exports, "DefaultHttpClient", ({ enumerable: true, get: function () { return http_1.DefaultHttpClient; } }));
//# sourceMappingURL=index.browser.js.map
/***/ }),
/***/ 8689:
/***/ (function(__unused_webpack_module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.UnsupportedPlatformError = void 0;
class UnsupportedPlatformError extends Error {
constructor(platform) {
const message = `This function is not supported in ${platform} environment`;
super(message);
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Custom_Error_Types
// Maintains proper stack trace for where our error was thrown (only available on V8)
if (Error.captureStackTrace) {
Error.captureStackTrace(this, UnsupportedPlatformError);
}
this.name = 'UnsupportedPlatformError';
this.platform = platform;
// https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
// Set the prototype explicitly.
Object.setPrototypeOf(this, UnsupportedPlatformError.prototype);
}
}
exports.UnsupportedPlatformError = UnsupportedPlatformError;
//# sourceMappingURL=UnsupportedPlatformError.js.map
/***/ }),
/***/ 4014:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getVersion = exports.buildBaseUrl = exports.buildFormDataValue = exports.buildHeaders = exports.buildPlatformDependentConfig = exports.getDefaultAuth = exports.getRequestToken = exports.readFileFromPath = void 0;
const tslib_1 = __webpack_require__(655);
const UnsupportedPlatformError_1 = __webpack_require__(8689);
const readFileFromPath = () => {
throw new UnsupportedPlatformError_1.UnsupportedPlatformError('Browser');
};
exports.readFileFromPath = readFileFromPath;
const getRequestToken = () => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () {
if (typeof halo === 'object' && halo !== null && typeof halo.getRequestToken === 'function') {
return halo.getRequestToken();
}
throw new Error('session authentication must specify a request token');
});
exports.getRequestToken = getRequestToken;
const getDefaultAuth = () => {
return {
type: 'session',
};
};
exports.getDefaultAuth = getDefaultAuth;
const buildPlatformDependentConfig = () => {
return {};
};
exports.buildPlatformDependentConfig = buildPlatformDependentConfig;
const buildHeaders = () => {
return {};
};
exports.buildHeaders = buildHeaders;
const buildFormDataValue = (data) => {
return new Blob([data]);
};
exports.buildFormDataValue = buildFormDataValue;
const buildBaseUrl = (baseUrl) => {
if (typeof baseUrl === 'undefined') {
throw new Error('in browser environment, baseUrl is required');
}
return baseUrl;
};
exports.buildBaseUrl = buildBaseUrl;
const getVersion = () => {
return PACKAGE_VERSION;
};
exports.getVersion = getVersion;
//# sourceMappingURL=browser.js.map
/***/ }),
/***/ 6595:
/***/ (function(__unused_webpack_module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.injectPlatformDeps = exports.platformDeps = void 0;
exports.platformDeps = {
readFileFromPath: () => {
throw new Error('not implemented');
},
getRequestToken: () => {
throw new Error('not implemented');
},
getDefaultAuth: () => {
throw new Error('not implemented');
},
buildPlatformDependentConfig: () => {
throw new Error('not implemented');
},
buildHeaders: () => {
throw new Error('not implemented');
},
buildFormDataValue: () => {
throw new Error('not implemented');
},
buildBaseUrl: () => {
throw new Error('not implemented');
},
getVersion: () => {
throw new Error('not implemented');
},
};
const injectPlatformDeps = (deps) => {
exports.platformDeps.readFileFromPath = deps.readFileFromPath;
exports.platformDeps.getRequestToken = deps.getRequestToken;
exports.platformDeps.getDefaultAuth = deps.getDefaultAuth;
exports.platformDeps.buildPlatformDependentConfig = deps.buildPlatformDependentConfig;
exports.platformDeps.buildHeaders = deps.buildHeaders;
exports.platformDeps.buildFormDataValue = deps.buildFormDataValue;
exports.platformDeps.buildBaseUrl = deps.buildBaseUrl;
exports.platformDeps.getVersion = deps.getVersion;
};
exports.injectPlatformDeps = injectPlatformDeps;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 3064:
/***/ (function(__unused_webpack_module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.SESSION_TOKEN_KEY = void 0;
exports.SESSION_TOKEN_KEY = '__REQUEST_TOKEN__';
//# sourceMappingURL=auth.js.map
/***/ }),
/***/ 7679:
/***/ (function(module, exports) {
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// addapted from the document.currentScript polyfill by Adam Miller
// MIT license
// source: https://github.com/amiller-gh/currentScript-polyfill
// added support for Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1620505
(function (root, factory) {
if (true) {
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else {}
}(typeof self !== 'undefined' ? self : this, function () {
function getCurrentScript () {
var descriptor = Object.getOwnPropertyDescriptor(document, 'currentScript')
// for chrome
if (!descriptor && 'currentScript' in document && document.currentScript) {
return document.currentScript
}
// for other browsers with native support for currentScript
if (descriptor && descriptor.get !== getCurrentScript && document.currentScript) {
return document.currentScript
}
// IE 8-10 support script readyState
// IE 11+ & Firefox support stack trace
try {
throw new Error();
}
catch (err) {
// Find the second match for the "at" string to get file src url from stack.
var ieStackRegExp = /.*at [^(]*\((.*):(.+):(.+)\)$/ig,
ffStackRegExp = /@([^@]*):(\d+):(\d+)\s*$/ig,
stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack),
scriptLocation = (stackDetails && stackDetails[1]) || false,
line = (stackDetails && stackDetails[2]) || false,
currentLocation = document.location.href.replace(document.location.hash, ''),
pageSource,
inlineScriptSourceRegExp,
inlineScriptSource,
scripts = document.getElementsByTagName('script'); // Live NodeList collection
if (scriptLocation === currentLocation) {
pageSource = document.documentElement.outerHTML;
inlineScriptSourceRegExp = new RegExp('(?:[^\\n]+?\\n){0,' + (line - 2) + '}[^<]*
...