@mx-space/api-client 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintcache +1 -1
- package/LICENSE +661 -0
- package/controllers/recently.ts +24 -3
- package/dist/index.cjs +18 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +1 -1
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/index.umd.js +18 -0
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/esm/adaptors/axios.d.ts +4 -0
- package/esm/adaptors/axios.js +37 -0
- package/esm/adaptors/axios.js.map +1 -0
- package/esm/adaptors/ky.d.ts +23 -0
- package/esm/adaptors/ky.js +62 -0
- package/esm/adaptors/ky.js.map +1 -0
- package/esm/adaptors/umi-request.d.ts +4 -0
- package/esm/adaptors/umi-request.js +31 -0
- package/esm/adaptors/umi-request.js.map +1 -0
- package/esm/controllers/aggregate.d.ts +64 -0
- package/esm/controllers/aggregate.js +42 -0
- package/esm/controllers/aggregate.js.map +1 -0
- package/esm/controllers/base.d.ts +43 -0
- package/esm/controllers/base.js +27 -0
- package/esm/controllers/base.js.map +1 -0
- package/esm/controllers/category.d.ts +114 -0
- package/esm/controllers/category.js +68 -0
- package/esm/controllers/category.js.map +1 -0
- package/esm/controllers/comment.d.ts +81 -0
- package/esm/controllers/comment.js +47 -0
- package/esm/controllers/comment.js.map +1 -0
- package/esm/controllers/index.d.ts +18 -0
- package/esm/controllers/index.js +55 -0
- package/esm/controllers/index.js.map +1 -0
- package/esm/controllers/link.d.ts +20 -0
- package/esm/controllers/link.js +21 -0
- package/esm/controllers/link.js.map +1 -0
- package/esm/controllers/note.d.ts +123 -0
- package/esm/controllers/note.js +68 -0
- package/esm/controllers/note.js.map +1 -0
- package/esm/controllers/page.d.ts +59 -0
- package/esm/controllers/page.js +42 -0
- package/esm/controllers/page.js.map +1 -0
- package/esm/controllers/post.d.ts +72 -0
- package/esm/controllers/post.js +52 -0
- package/esm/controllers/post.js.map +1 -0
- package/esm/controllers/project.d.ts +15 -0
- package/esm/controllers/project.js +12 -0
- package/esm/controllers/project.js.map +1 -0
- package/esm/controllers/recently.d.ts +110 -0
- package/esm/controllers/recently.js +49 -0
- package/esm/controllers/recently.js.map +1 -0
- package/esm/controllers/say.d.ts +37 -0
- package/esm/controllers/say.js +21 -0
- package/esm/controllers/say.js.map +1 -0
- package/esm/controllers/search.d.ts +247 -0
- package/esm/controllers/search.js +28 -0
- package/esm/controllers/search.js.map +1 -0
- package/esm/controllers/severless.d.ts +24 -0
- package/esm/controllers/severless.js +16 -0
- package/esm/controllers/severless.js.map +1 -0
- package/esm/controllers/snippet.d.ts +24 -0
- package/esm/controllers/snippet.js +19 -0
- package/esm/controllers/snippet.js.map +1 -0
- package/esm/controllers/topic.d.ts +26 -0
- package/esm/controllers/topic.js +18 -0
- package/esm/controllers/topic.js.map +1 -0
- package/esm/controllers/user.d.ts +70 -0
- package/esm/controllers/user.js +40 -0
- package/esm/controllers/user.js.map +1 -0
- package/esm/core/attach-request.d.ts +2 -0
- package/esm/core/attach-request.js +36 -0
- package/esm/core/attach-request.js.map +1 -0
- package/esm/core/client.d.ts +29 -0
- package/esm/core/client.js +186 -0
- package/esm/core/client.js.map +1 -0
- package/esm/core/error.d.ts +6 -0
- package/esm/core/error.js +9 -0
- package/esm/core/error.js.map +1 -0
- package/esm/core/index.d.ts +2 -0
- package/esm/core/index.js +3 -0
- package/esm/core/index.js.map +1 -0
- package/esm/dtos/comment.d.ts +6 -0
- package/esm/dtos/comment.js +3 -0
- package/esm/dtos/comment.js.map +1 -0
- package/esm/index.d.ts +7 -0
- package/esm/index.js +8 -0
- package/esm/index.js.map +1 -0
- package/esm/interfaces/adapter.d.ts +14 -0
- package/esm/interfaces/adapter.js +2 -0
- package/esm/interfaces/adapter.js.map +1 -0
- package/esm/interfaces/client.d.ts +13 -0
- package/esm/interfaces/client.js +2 -0
- package/esm/interfaces/client.js.map +1 -0
- package/esm/interfaces/controller.d.ts +4 -0
- package/esm/interfaces/controller.js +2 -0
- package/esm/interfaces/controller.js.map +1 -0
- package/esm/interfaces/instance.d.ts +7 -0
- package/esm/interfaces/instance.js +2 -0
- package/esm/interfaces/instance.js.map +1 -0
- package/esm/interfaces/options.d.ts +1 -0
- package/esm/interfaces/options.js +2 -0
- package/esm/interfaces/options.js.map +1 -0
- package/esm/interfaces/params.d.ts +4 -0
- package/esm/interfaces/params.js +2 -0
- package/esm/interfaces/params.js.map +1 -0
- package/esm/interfaces/request.d.ts +43 -0
- package/esm/interfaces/request.js +2 -0
- package/esm/interfaces/request.js.map +1 -0
- package/esm/interfaces/types.d.ts +2 -0
- package/esm/interfaces/types.js +2 -0
- package/esm/interfaces/types.js.map +1 -0
- package/esm/models/aggregate.d.ts +53 -0
- package/esm/models/aggregate.js +6 -0
- package/esm/models/aggregate.js.map +1 -0
- package/esm/models/base.d.ts +41 -0
- package/esm/models/base.js +2 -0
- package/esm/models/base.js.map +1 -0
- package/esm/models/category.d.ts +22 -0
- package/esm/models/category.js +6 -0
- package/esm/models/category.js.map +1 -0
- package/esm/models/comment.d.ts +37 -0
- package/esm/models/comment.js +13 -0
- package/esm/models/comment.js.map +1 -0
- package/esm/models/index.d.ts +14 -0
- package/esm/models/index.js +15 -0
- package/esm/models/index.js.map +1 -0
- package/esm/models/link.d.ts +22 -0
- package/esm/models/link.js +14 -0
- package/esm/models/link.js.map +1 -0
- package/esm/models/note.d.ts +38 -0
- package/esm/models/note.js +2 -0
- package/esm/models/note.js.map +1 -0
- package/esm/models/page.d.ts +14 -0
- package/esm/models/page.js +7 -0
- package/esm/models/page.js.map +1 -0
- package/esm/models/post.d.ts +17 -0
- package/esm/models/post.js +2 -0
- package/esm/models/post.js.map +1 -0
- package/esm/models/project.d.ts +11 -0
- package/esm/models/project.js +2 -0
- package/esm/models/project.js.map +1 -0
- package/esm/models/recently.d.ts +20 -0
- package/esm/models/recently.js +7 -0
- package/esm/models/recently.js.map +1 -0
- package/esm/models/say.d.ts +6 -0
- package/esm/models/say.js +2 -0
- package/esm/models/say.js.map +1 -0
- package/esm/models/setting.d.ts +66 -0
- package/esm/models/setting.js +2 -0
- package/esm/models/setting.js.map +1 -0
- package/esm/models/snippet.d.ts +18 -0
- package/esm/models/snippet.js +8 -0
- package/esm/models/snippet.js.map +1 -0
- package/esm/models/topic.d.ts +8 -0
- package/esm/models/topic.js +2 -0
- package/esm/models/topic.js.map +1 -0
- package/esm/models/user.d.ts +21 -0
- package/esm/models/user.js +2 -0
- package/esm/models/user.js.map +1 -0
- package/esm/utils/auto-bind.d.ts +4 -0
- package/esm/utils/auto-bind.js +36 -0
- package/esm/utils/auto-bind.js.map +1 -0
- package/esm/utils/camelcase-keys.d.ts +6 -0
- package/esm/utils/camelcase-keys.js +23 -0
- package/esm/utils/camelcase-keys.js.map +1 -0
- package/esm/utils/index.d.ts +5 -0
- package/esm/utils/index.js +43 -0
- package/esm/utils/index.js.map +1 -0
- package/esm/utils/path.d.ts +1 -0
- package/esm/utils/path.js +7 -0
- package/esm/utils/path.js.map +1 -0
- package/esm/vitest.config.d.ts +2 -0
- package/esm/vitest.config.js +12 -0
- package/esm/vitest.config.js.map +1 -0
- package/lib/adaptors/axios.d.ts +4 -0
- package/lib/adaptors/axios.js +43 -0
- package/lib/adaptors/axios.js.map +1 -0
- package/lib/adaptors/ky.d.ts +23 -0
- package/lib/adaptors/ky.js +69 -0
- package/lib/adaptors/ky.js.map +1 -0
- package/lib/adaptors/umi-request.d.ts +4 -0
- package/lib/adaptors/umi-request.js +34 -0
- package/lib/adaptors/umi-request.js.map +1 -0
- package/lib/controllers/aggregate.d.ts +64 -0
- package/lib/controllers/aggregate.js +46 -0
- package/lib/controllers/aggregate.js.map +1 -0
- package/lib/controllers/base.d.ts +43 -0
- package/lib/controllers/base.js +31 -0
- package/lib/controllers/base.js.map +1 -0
- package/lib/controllers/category.d.ts +114 -0
- package/lib/controllers/category.js +72 -0
- package/lib/controllers/category.js.map +1 -0
- package/lib/controllers/comment.d.ts +81 -0
- package/lib/controllers/comment.js +51 -0
- package/lib/controllers/comment.js.map +1 -0
- package/lib/controllers/index.d.ts +18 -0
- package/lib/controllers/index.js +72 -0
- package/lib/controllers/index.js.map +1 -0
- package/lib/controllers/link.d.ts +20 -0
- package/lib/controllers/link.js +25 -0
- package/lib/controllers/link.js.map +1 -0
- package/lib/controllers/note.d.ts +123 -0
- package/lib/controllers/note.js +72 -0
- package/lib/controllers/note.js.map +1 -0
- package/lib/controllers/page.d.ts +59 -0
- package/lib/controllers/page.js +46 -0
- package/lib/controllers/page.js.map +1 -0
- package/lib/controllers/post.d.ts +72 -0
- package/lib/controllers/post.js +56 -0
- package/lib/controllers/post.js.map +1 -0
- package/lib/controllers/project.d.ts +15 -0
- package/lib/controllers/project.js +16 -0
- package/lib/controllers/project.js.map +1 -0
- package/lib/controllers/recently.d.ts +110 -0
- package/lib/controllers/recently.js +53 -0
- package/lib/controllers/recently.js.map +1 -0
- package/lib/controllers/say.d.ts +37 -0
- package/lib/controllers/say.js +25 -0
- package/lib/controllers/say.js.map +1 -0
- package/lib/controllers/search.d.ts +247 -0
- package/lib/controllers/search.js +32 -0
- package/lib/controllers/search.js.map +1 -0
- package/lib/controllers/severless.d.ts +24 -0
- package/lib/controllers/severless.js +20 -0
- package/lib/controllers/severless.js.map +1 -0
- package/lib/controllers/snippet.d.ts +24 -0
- package/lib/controllers/snippet.js +23 -0
- package/lib/controllers/snippet.js.map +1 -0
- package/lib/controllers/topic.d.ts +26 -0
- package/lib/controllers/topic.js +22 -0
- package/lib/controllers/topic.js.map +1 -0
- package/lib/controllers/user.d.ts +70 -0
- package/lib/controllers/user.js +44 -0
- package/lib/controllers/user.js.map +1 -0
- package/lib/core/attach-request.d.ts +2 -0
- package/lib/core/attach-request.js +40 -0
- package/lib/core/attach-request.js.map +1 -0
- package/lib/core/client.d.ts +29 -0
- package/lib/core/client.js +190 -0
- package/lib/core/client.js.map +1 -0
- package/lib/core/error.d.ts +6 -0
- package/lib/core/error.js +13 -0
- package/lib/core/error.js.map +1 -0
- package/lib/core/index.d.ts +2 -0
- package/lib/core/index.js +19 -0
- package/lib/core/index.js.map +1 -0
- package/lib/dtos/comment.d.ts +6 -0
- package/lib/dtos/comment.js +7 -0
- package/lib/dtos/comment.js.map +1 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.js +28 -0
- package/lib/index.js.map +1 -0
- package/lib/interfaces/adapter.d.ts +14 -0
- package/lib/interfaces/adapter.js +3 -0
- package/lib/interfaces/adapter.js.map +1 -0
- package/lib/interfaces/client.d.ts +13 -0
- package/lib/interfaces/client.js +3 -0
- package/lib/interfaces/client.js.map +1 -0
- package/lib/interfaces/controller.d.ts +4 -0
- package/lib/interfaces/controller.js +3 -0
- package/lib/interfaces/controller.js.map +1 -0
- package/lib/interfaces/instance.d.ts +7 -0
- package/lib/interfaces/instance.js +3 -0
- package/lib/interfaces/instance.js.map +1 -0
- package/lib/interfaces/options.d.ts +1 -0
- package/lib/interfaces/options.js +3 -0
- package/lib/interfaces/options.js.map +1 -0
- package/lib/interfaces/params.d.ts +4 -0
- package/lib/interfaces/params.js +3 -0
- package/lib/interfaces/params.js.map +1 -0
- package/lib/interfaces/request.d.ts +43 -0
- package/lib/interfaces/request.js +3 -0
- package/lib/interfaces/request.js.map +1 -0
- package/lib/interfaces/types.d.ts +2 -0
- package/lib/interfaces/types.js +3 -0
- package/lib/interfaces/types.js.map +1 -0
- package/lib/models/aggregate.d.ts +53 -0
- package/lib/models/aggregate.js +9 -0
- package/lib/models/aggregate.js.map +1 -0
- package/lib/models/base.d.ts +41 -0
- package/lib/models/base.js +3 -0
- package/lib/models/base.js.map +1 -0
- package/lib/models/category.d.ts +22 -0
- package/lib/models/category.js +9 -0
- package/lib/models/category.js.map +1 -0
- package/lib/models/comment.d.ts +37 -0
- package/lib/models/comment.js +16 -0
- package/lib/models/comment.js.map +1 -0
- package/lib/models/index.d.ts +14 -0
- package/lib/models/index.js +31 -0
- package/lib/models/index.js.map +1 -0
- package/lib/models/link.d.ts +22 -0
- package/lib/models/link.js +17 -0
- package/lib/models/link.js.map +1 -0
- package/lib/models/note.d.ts +38 -0
- package/lib/models/note.js +3 -0
- package/lib/models/note.js.map +1 -0
- package/lib/models/page.d.ts +14 -0
- package/lib/models/page.js +10 -0
- package/lib/models/page.js.map +1 -0
- package/lib/models/post.d.ts +17 -0
- package/lib/models/post.js +3 -0
- package/lib/models/post.js.map +1 -0
- package/lib/models/project.d.ts +11 -0
- package/lib/models/project.js +3 -0
- package/lib/models/project.js.map +1 -0
- package/lib/models/recently.d.ts +20 -0
- package/lib/models/recently.js +10 -0
- package/lib/models/recently.js.map +1 -0
- package/lib/models/say.d.ts +6 -0
- package/lib/models/say.js +3 -0
- package/lib/models/say.js.map +1 -0
- package/lib/models/setting.d.ts +66 -0
- package/lib/models/setting.js +3 -0
- package/lib/models/setting.js.map +1 -0
- package/lib/models/snippet.d.ts +18 -0
- package/lib/models/snippet.js +11 -0
- package/lib/models/snippet.js.map +1 -0
- package/lib/models/topic.d.ts +8 -0
- package/lib/models/topic.js +3 -0
- package/lib/models/topic.js.map +1 -0
- package/lib/models/user.d.ts +21 -0
- package/lib/models/user.js +3 -0
- package/lib/models/user.js.map +1 -0
- package/lib/utils/auto-bind.d.ts +4 -0
- package/lib/utils/auto-bind.js +40 -0
- package/lib/utils/auto-bind.js.map +1 -0
- package/lib/utils/camelcase-keys.d.ts +6 -0
- package/lib/utils/camelcase-keys.js +28 -0
- package/lib/utils/camelcase-keys.js.map +1 -0
- package/lib/utils/index.d.ts +5 -0
- package/lib/utils/index.js +50 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/path.d.ts +1 -0
- package/lib/utils/path.js +11 -0
- package/lib/utils/path.js.map +1 -0
- package/lib/vitest.config.d.ts +2 -0
- package/lib/vitest.config.js +17 -0
- package/lib/vitest.config.js.map +1 -0
- package/package.json +26 -12
- package/types/adaptors/axios.d.ts +4 -0
- package/types/adaptors/ky.d.ts +23 -0
- package/types/adaptors/umi-request.d.ts +4 -0
- package/types/controllers/aggregate.d.ts +64 -0
- package/types/controllers/base.d.ts +43 -0
- package/types/controllers/category.d.ts +114 -0
- package/types/controllers/comment.d.ts +81 -0
- package/types/controllers/index.d.ts +18 -0
- package/types/controllers/link.d.ts +20 -0
- package/types/controllers/note.d.ts +123 -0
- package/types/controllers/page.d.ts +59 -0
- package/types/controllers/post.d.ts +72 -0
- package/types/controllers/project.d.ts +15 -0
- package/types/controllers/recently.d.ts +110 -0
- package/types/controllers/say.d.ts +37 -0
- package/types/controllers/search.d.ts +247 -0
- package/types/controllers/severless.d.ts +24 -0
- package/types/controllers/snippet.d.ts +24 -0
- package/types/controllers/topic.d.ts +26 -0
- package/types/controllers/user.d.ts +70 -0
- package/types/core/attach-request.d.ts +2 -0
- package/types/core/client.d.ts +29 -0
- package/types/core/error.d.ts +6 -0
- package/types/core/index.d.ts +2 -0
- package/types/dtos/comment.d.ts +6 -0
- package/types/index.d.ts +7 -0
- package/types/interfaces/adapter.d.ts +14 -0
- package/types/interfaces/client.d.ts +13 -0
- package/types/interfaces/controller.d.ts +4 -0
- package/types/interfaces/instance.d.ts +7 -0
- package/types/interfaces/options.d.ts +1 -0
- package/types/interfaces/params.d.ts +4 -0
- package/types/interfaces/request.d.ts +43 -0
- package/types/interfaces/types.d.ts +2 -0
- package/types/models/aggregate.d.ts +53 -0
- package/types/models/base.d.ts +41 -0
- package/types/models/category.d.ts +22 -0
- package/types/models/comment.d.ts +37 -0
- package/types/models/index.d.ts +14 -0
- package/types/models/link.d.ts +22 -0
- package/types/models/note.d.ts +38 -0
- package/types/models/page.d.ts +14 -0
- package/types/models/post.d.ts +17 -0
- package/types/models/project.d.ts +11 -0
- package/types/models/recently.d.ts +20 -0
- package/types/models/say.d.ts +6 -0
- package/types/models/setting.d.ts +66 -0
- package/types/models/snippet.d.ts +18 -0
- package/types/models/topic.d.ts +8 -0
- package/types/models/user.d.ts +21 -0
- package/types/utils/auto-bind.d.ts +4 -0
- package/types/utils/camelcase-keys.d.ts +6 -0
- package/types/utils/index.d.ts +5 -0
- package/types/utils/path.d.ts +1 -0
- package/types/vitest.config.d.ts +2 -0
- package/__tests__/adaptors/axios.spec.ts +0 -7
- package/__tests__/adaptors/ky.spec.ts +0 -9
- package/__tests__/adaptors/umi-request.spec.ts +0 -7
- package/__tests__/contronllers/aggregate.test.ts +0 -389
- package/__tests__/contronllers/category.test.ts +0 -284
- package/__tests__/contronllers/comment.test.ts +0 -113
- package/__tests__/contronllers/link.test.ts +0 -95
- package/__tests__/contronllers/note.test.ts +0 -120
- package/__tests__/contronllers/page.test.ts +0 -49
- package/__tests__/contronllers/post.test.ts +0 -77
- package/__tests__/contronllers/recently.test.ts +0 -49
- package/__tests__/contronllers/say.test.ts +0 -106
- package/__tests__/contronllers/search.test.ts +0 -81
- package/__tests__/contronllers/serverless.test.ts +0 -19
- package/__tests__/contronllers/snippet.test.ts +0 -38
- package/__tests__/contronllers/topic.test.ts +0 -17
- package/__tests__/contronllers/user.test.ts +0 -59
- package/__tests__/core/client.test.ts +0 -293
- package/__tests__/helpers/adaptor-test.ts +0 -108
- package/__tests__/helpers/e2e-mock-server.ts +0 -22
- package/__tests__/helpers/global-fetch.ts +0 -39
- package/__tests__/helpers/instance.ts +0 -11
- package/__tests__/helpers/response.ts +0 -76
- package/__tests__/mock/algolia.json +0 -446
- package/__tests__/utils/auto-bind.spec.ts +0 -27
- package/__tests__/utils/camelcase-keys.spec.ts +0 -86
- package/__tests__/utils/index.test.ts +0 -33
- package/__tests__/utils/path.spec.ts +0 -8
- package/adaptors/axios.ts +0 -44
- package/adaptors/ky.ts +0 -76
- package/adaptors/umi-request.ts +0 -38
- package/core/attach-request.ts +0 -43
- package/core/client.ts +0 -252
- package/core/error.ts +0 -10
- package/core/index.ts +0 -2
- package/coverage/lcov-report/__tests__/helpers/adaptor-test.ts.html +0 -405
- package/coverage/lcov-report/__tests__/helpers/e2e-mock-server.ts.html +0 -150
- package/coverage/lcov-report/__tests__/helpers/index.html +0 -236
- package/coverage/lcov-report/__tests__/helpers/instance.ts.html +0 -120
- package/coverage/lcov-report/__tests__/helpers/response.ts.html +0 -231
- package/rollup.config.js +0 -150
- package/utils/auto-bind.ts +0 -48
- package/utils/camelcase-keys.ts +0 -26
- package/utils/index.ts +0 -53
- package/utils/path.ts +0 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"category.js","sourceRoot":"","sources":["../../models/category.ts"],"names":[],"mappings":";;;AAGA,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,uDAAQ,CAAA;IACR,6CAAG,CAAA;AACL,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { BaseModel } from './base';
|
|
2
|
+
import { CategoryModel } from './category';
|
|
3
|
+
export declare enum RefType {
|
|
4
|
+
Page = "Page",
|
|
5
|
+
Post = "Post",
|
|
6
|
+
Note = "Note"
|
|
7
|
+
}
|
|
8
|
+
export interface CommentModel extends BaseModel {
|
|
9
|
+
refType: RefType;
|
|
10
|
+
ref: string;
|
|
11
|
+
state: number;
|
|
12
|
+
commentsIndex: number;
|
|
13
|
+
author: string;
|
|
14
|
+
text: string;
|
|
15
|
+
mail?: string;
|
|
16
|
+
url?: string;
|
|
17
|
+
ip?: string;
|
|
18
|
+
agent?: string;
|
|
19
|
+
key: string;
|
|
20
|
+
pin?: boolean;
|
|
21
|
+
avatar: string;
|
|
22
|
+
parent?: CommentModel | string;
|
|
23
|
+
children: CommentModel[];
|
|
24
|
+
isWhispers?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface CommentRef {
|
|
27
|
+
id: string;
|
|
28
|
+
categoryId?: string;
|
|
29
|
+
slug: string;
|
|
30
|
+
title: string;
|
|
31
|
+
category?: CategoryModel;
|
|
32
|
+
}
|
|
33
|
+
export declare enum CommentState {
|
|
34
|
+
Unread = 0,
|
|
35
|
+
Read = 1,
|
|
36
|
+
Junk = 2
|
|
37
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommentState = exports.RefType = void 0;
|
|
4
|
+
var RefType;
|
|
5
|
+
(function (RefType) {
|
|
6
|
+
RefType["Page"] = "Page";
|
|
7
|
+
RefType["Post"] = "Post";
|
|
8
|
+
RefType["Note"] = "Note";
|
|
9
|
+
})(RefType = exports.RefType || (exports.RefType = {}));
|
|
10
|
+
var CommentState;
|
|
11
|
+
(function (CommentState) {
|
|
12
|
+
CommentState[CommentState["Unread"] = 0] = "Unread";
|
|
13
|
+
CommentState[CommentState["Read"] = 1] = "Read";
|
|
14
|
+
CommentState[CommentState["Junk"] = 2] = "Junk";
|
|
15
|
+
})(CommentState = exports.CommentState || (exports.CommentState = {}));
|
|
16
|
+
//# sourceMappingURL=comment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment.js","sourceRoot":"","sources":["../../models/comment.ts"],"names":[],"mappings":";;;AAGA,IAAY,OAIX;AAJD,WAAY,OAAO;IACjB,wBAAa,CAAA;IACb,wBAAa,CAAA;IACb,wBAAa,CAAA;AACf,CAAC,EAJW,OAAO,GAAP,eAAO,KAAP,eAAO,QAIlB;AA6BD,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,mDAAM,CAAA;IACN,+CAAI,CAAA;IACJ,+CAAI,CAAA;AACN,CAAC,EAJW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAIvB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './aggregate';
|
|
2
|
+
export * from './base';
|
|
3
|
+
export * from './category';
|
|
4
|
+
export * from './comment';
|
|
5
|
+
export * from './link';
|
|
6
|
+
export * from './note';
|
|
7
|
+
export * from './page';
|
|
8
|
+
export * from './post';
|
|
9
|
+
export * from './project';
|
|
10
|
+
export * from './recently';
|
|
11
|
+
export * from './say';
|
|
12
|
+
export * from './setting';
|
|
13
|
+
export * from './snippet';
|
|
14
|
+
export * from './user';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./aggregate"), exports);
|
|
18
|
+
__exportStar(require("./base"), exports);
|
|
19
|
+
__exportStar(require("./category"), exports);
|
|
20
|
+
__exportStar(require("./comment"), exports);
|
|
21
|
+
__exportStar(require("./link"), exports);
|
|
22
|
+
__exportStar(require("./note"), exports);
|
|
23
|
+
__exportStar(require("./page"), exports);
|
|
24
|
+
__exportStar(require("./post"), exports);
|
|
25
|
+
__exportStar(require("./project"), exports);
|
|
26
|
+
__exportStar(require("./recently"), exports);
|
|
27
|
+
__exportStar(require("./say"), exports);
|
|
28
|
+
__exportStar(require("./setting"), exports);
|
|
29
|
+
__exportStar(require("./snippet"), exports);
|
|
30
|
+
__exportStar(require("./user"), exports);
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,yCAAsB;AACtB,6CAA0B;AAC1B,4CAAyB;AACzB,yCAAsB;AACtB,yCAAsB;AACtB,yCAAsB;AACtB,yCAAsB;AACtB,4CAAyB;AACzB,6CAA0B;AAC1B,wCAAqB;AACrB,4CAAyB;AACzB,4CAAyB;AACzB,yCAAsB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseModel } from './base';
|
|
2
|
+
export declare enum LinkType {
|
|
3
|
+
Friend = 0,
|
|
4
|
+
Collection = 1
|
|
5
|
+
}
|
|
6
|
+
export declare enum LinkState {
|
|
7
|
+
Pass = 0,
|
|
8
|
+
Audit = 1,
|
|
9
|
+
Outdate = 2,
|
|
10
|
+
Banned = 3,
|
|
11
|
+
Reject = 4
|
|
12
|
+
}
|
|
13
|
+
export interface LinkModel extends BaseModel {
|
|
14
|
+
name: string;
|
|
15
|
+
url: string;
|
|
16
|
+
avatar: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
type: LinkType;
|
|
19
|
+
state: LinkState;
|
|
20
|
+
hide: boolean;
|
|
21
|
+
email: string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LinkState = exports.LinkType = void 0;
|
|
4
|
+
var LinkType;
|
|
5
|
+
(function (LinkType) {
|
|
6
|
+
LinkType[LinkType["Friend"] = 0] = "Friend";
|
|
7
|
+
LinkType[LinkType["Collection"] = 1] = "Collection";
|
|
8
|
+
})(LinkType = exports.LinkType || (exports.LinkType = {}));
|
|
9
|
+
var LinkState;
|
|
10
|
+
(function (LinkState) {
|
|
11
|
+
LinkState[LinkState["Pass"] = 0] = "Pass";
|
|
12
|
+
LinkState[LinkState["Audit"] = 1] = "Audit";
|
|
13
|
+
LinkState[LinkState["Outdate"] = 2] = "Outdate";
|
|
14
|
+
LinkState[LinkState["Banned"] = 3] = "Banned";
|
|
15
|
+
LinkState[LinkState["Reject"] = 4] = "Reject";
|
|
16
|
+
})(LinkState = exports.LinkState || (exports.LinkState = {}));
|
|
17
|
+
//# sourceMappingURL=link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../models/link.ts"],"names":[],"mappings":";;;AAEA,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,2CAAM,CAAA;IACN,mDAAU,CAAA;AACZ,CAAC,EAHW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAGnB;AAED,IAAY,SAMX;AAND,WAAY,SAAS;IACnB,yCAAI,CAAA;IACJ,2CAAK,CAAA;IACL,+CAAO,CAAA;IACP,6CAAM,CAAA;IACN,6CAAM,CAAA;AACR,CAAC,EANW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAMpB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ModelWithLiked, TextBaseModel } from './base';
|
|
2
|
+
import { TopicModel } from './topic';
|
|
3
|
+
export interface NoteModel extends TextBaseModel {
|
|
4
|
+
hide: boolean;
|
|
5
|
+
count: {
|
|
6
|
+
read: number;
|
|
7
|
+
like: number;
|
|
8
|
+
};
|
|
9
|
+
mood?: string;
|
|
10
|
+
weather?: string;
|
|
11
|
+
hasMemory?: boolean;
|
|
12
|
+
secret?: Date;
|
|
13
|
+
password?: string | null;
|
|
14
|
+
nid: number;
|
|
15
|
+
music?: NoteMusicRecord[];
|
|
16
|
+
location?: string;
|
|
17
|
+
coordinates?: Coordinate;
|
|
18
|
+
topic?: TopicModel;
|
|
19
|
+
topicId?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface NoteMusicRecord {
|
|
22
|
+
type: string;
|
|
23
|
+
id: string;
|
|
24
|
+
}
|
|
25
|
+
export interface Coordinate {
|
|
26
|
+
latitude: number;
|
|
27
|
+
longitude: number;
|
|
28
|
+
}
|
|
29
|
+
export interface NoteWrappedPayload {
|
|
30
|
+
data: NoteModel;
|
|
31
|
+
next?: Partial<NoteModel>;
|
|
32
|
+
prev?: Partial<NoteModel>;
|
|
33
|
+
}
|
|
34
|
+
export interface NoteWrappedWithLikedPayload {
|
|
35
|
+
data: ModelWithLiked<NoteModel>;
|
|
36
|
+
next?: Partial<NoteModel>;
|
|
37
|
+
prev?: Partial<NoteModel>;
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"note.js","sourceRoot":"","sources":["../../models/note.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TextBaseModel } from './base';
|
|
2
|
+
export declare enum EnumPageType {
|
|
3
|
+
'md' = "md",
|
|
4
|
+
'html' = "html",
|
|
5
|
+
'frame' = "frame"
|
|
6
|
+
}
|
|
7
|
+
export interface PageModel extends TextBaseModel {
|
|
8
|
+
created: string;
|
|
9
|
+
slug: string;
|
|
10
|
+
subtitle?: string;
|
|
11
|
+
order?: number;
|
|
12
|
+
type?: EnumPageType;
|
|
13
|
+
options?: object;
|
|
14
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EnumPageType = void 0;
|
|
4
|
+
var EnumPageType;
|
|
5
|
+
(function (EnumPageType) {
|
|
6
|
+
EnumPageType["md"] = "md";
|
|
7
|
+
EnumPageType["html"] = "html";
|
|
8
|
+
EnumPageType["frame"] = "frame";
|
|
9
|
+
})(EnumPageType = exports.EnumPageType || (exports.EnumPageType = {}));
|
|
10
|
+
//# sourceMappingURL=page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../models/page.ts"],"names":[],"mappings":";;;AAEA,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,yBAAW,CAAA;IACX,6BAAe,CAAA;IACf,+BAAiB,CAAA;AACnB,CAAC,EAJW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAIvB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Count, Image, TextBaseModel } from './base';
|
|
2
|
+
import { CategoryModel } from './category';
|
|
3
|
+
export interface PostModel extends TextBaseModel {
|
|
4
|
+
summary?: string;
|
|
5
|
+
copyright: boolean;
|
|
6
|
+
tags: string[];
|
|
7
|
+
count: Count;
|
|
8
|
+
text: string;
|
|
9
|
+
title: string;
|
|
10
|
+
slug: string;
|
|
11
|
+
categoryId: string;
|
|
12
|
+
images: Image[];
|
|
13
|
+
category: CategoryModel;
|
|
14
|
+
pin?: string | null;
|
|
15
|
+
pinOrder?: number;
|
|
16
|
+
related?: Pick<PostModel, 'id' | 'category' | 'categoryId' | 'created' | 'modified' | 'title' | 'slug' | 'summary'>[];
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post.js","sourceRoot":"","sources":["../../models/post.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../models/project.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseCommentIndexModel } from './base';
|
|
2
|
+
export declare enum RecentlyRefTypes {
|
|
3
|
+
Post = "Post",
|
|
4
|
+
Note = "Note",
|
|
5
|
+
Page = "Page"
|
|
6
|
+
}
|
|
7
|
+
export type RecentlyRefType = {
|
|
8
|
+
title: string;
|
|
9
|
+
url: string;
|
|
10
|
+
};
|
|
11
|
+
export interface RecentlyModel extends BaseCommentIndexModel {
|
|
12
|
+
content: string;
|
|
13
|
+
ref?: RecentlyRefType & {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
};
|
|
16
|
+
refId?: string;
|
|
17
|
+
refType?: RecentlyRefTypes;
|
|
18
|
+
up: number;
|
|
19
|
+
down: number;
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RecentlyRefTypes = void 0;
|
|
4
|
+
var RecentlyRefTypes;
|
|
5
|
+
(function (RecentlyRefTypes) {
|
|
6
|
+
RecentlyRefTypes["Post"] = "Post";
|
|
7
|
+
RecentlyRefTypes["Note"] = "Note";
|
|
8
|
+
RecentlyRefTypes["Page"] = "Page";
|
|
9
|
+
})(RecentlyRefTypes = exports.RecentlyRefTypes || (exports.RecentlyRefTypes = {}));
|
|
10
|
+
//# sourceMappingURL=recently.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recently.js","sourceRoot":"","sources":["../../models/recently.ts"],"names":[],"mappings":";;;AAEA,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,iCAAa,CAAA;IACb,iCAAa,CAAA;IACb,iCAAa,CAAA;AACf,CAAC,EAJW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAI3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"say.js","sourceRoot":"","sources":["../../models/say.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export declare class SeoOptionModel {
|
|
2
|
+
title: string;
|
|
3
|
+
description: string;
|
|
4
|
+
icon?: string;
|
|
5
|
+
keywords?: string[];
|
|
6
|
+
}
|
|
7
|
+
export declare class UrlOptionModel {
|
|
8
|
+
webUrl: string;
|
|
9
|
+
adminUrl: string;
|
|
10
|
+
serverUrl: string;
|
|
11
|
+
wsUrl: string;
|
|
12
|
+
}
|
|
13
|
+
declare class MailOptionModel {
|
|
14
|
+
port: number;
|
|
15
|
+
host: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class MailOptionsModel {
|
|
18
|
+
enable: boolean;
|
|
19
|
+
user: string;
|
|
20
|
+
pass: string;
|
|
21
|
+
options?: MailOptionModel;
|
|
22
|
+
}
|
|
23
|
+
export declare class CommentOptionsModel {
|
|
24
|
+
antiSpam: boolean;
|
|
25
|
+
spamKeywords?: string[];
|
|
26
|
+
blockIps?: string[];
|
|
27
|
+
disableNoChinese?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export declare class BackupOptionsModel {
|
|
30
|
+
enable: boolean;
|
|
31
|
+
secretId?: string;
|
|
32
|
+
secretKey?: string;
|
|
33
|
+
bucket?: string;
|
|
34
|
+
region: string;
|
|
35
|
+
}
|
|
36
|
+
export declare class BaiduSearchOptionsModel {
|
|
37
|
+
enable: boolean;
|
|
38
|
+
token?: string;
|
|
39
|
+
}
|
|
40
|
+
export declare class AlgoliaSearchOptionsModel {
|
|
41
|
+
enable: boolean;
|
|
42
|
+
apiKey?: string;
|
|
43
|
+
appId?: string;
|
|
44
|
+
indexName?: string;
|
|
45
|
+
}
|
|
46
|
+
export declare class AdminExtraModel {
|
|
47
|
+
background?: string;
|
|
48
|
+
gaodemapKey?: string;
|
|
49
|
+
title?: string;
|
|
50
|
+
/**
|
|
51
|
+
* 是否开启后台反代访问
|
|
52
|
+
*/
|
|
53
|
+
enableAdminProxy?: boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface IConfig {
|
|
56
|
+
seo: SeoOptionModel;
|
|
57
|
+
url: UrlOptionModel;
|
|
58
|
+
mailOptions: MailOptionsModel;
|
|
59
|
+
commentOptions: CommentOptionsModel;
|
|
60
|
+
backupOptions: BackupOptionsModel;
|
|
61
|
+
baiduSearchOptions: BaiduSearchOptionsModel;
|
|
62
|
+
algoliaSearchOptions: AlgoliaSearchOptionsModel;
|
|
63
|
+
adminExtra: AdminExtraModel;
|
|
64
|
+
}
|
|
65
|
+
export declare type IConfigKeys = keyof IConfig;
|
|
66
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setting.js","sourceRoot":"","sources":["../../models/setting.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseModel } from './base';
|
|
2
|
+
export declare enum SnippetType {
|
|
3
|
+
JSON = "json",
|
|
4
|
+
Function = "function",
|
|
5
|
+
Text = "text",
|
|
6
|
+
YAML = "yaml"
|
|
7
|
+
}
|
|
8
|
+
export interface SnippetModel<T = unknown> extends BaseModel {
|
|
9
|
+
type: SnippetType;
|
|
10
|
+
private: boolean;
|
|
11
|
+
raw: string;
|
|
12
|
+
name: string;
|
|
13
|
+
reference: string;
|
|
14
|
+
comment?: string;
|
|
15
|
+
metatype?: string;
|
|
16
|
+
schema?: string;
|
|
17
|
+
data: T;
|
|
18
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SnippetType = void 0;
|
|
4
|
+
var SnippetType;
|
|
5
|
+
(function (SnippetType) {
|
|
6
|
+
SnippetType["JSON"] = "json";
|
|
7
|
+
SnippetType["Function"] = "function";
|
|
8
|
+
SnippetType["Text"] = "text";
|
|
9
|
+
SnippetType["YAML"] = "yaml";
|
|
10
|
+
})(SnippetType = exports.SnippetType || (exports.SnippetType = {}));
|
|
11
|
+
//# sourceMappingURL=snippet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snippet.js","sourceRoot":"","sources":["../../models/snippet.ts"],"names":[],"mappings":";;;AAEA,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,oCAAqB,CAAA;IACrB,4BAAa,CAAA;IACb,4BAAa,CAAA;AACf,CAAC,EALW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAKtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topic.js","sourceRoot":"","sources":["../../models/topic.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BaseModel } from './base';
|
|
2
|
+
export interface UserModel extends BaseModel {
|
|
3
|
+
introduce: string;
|
|
4
|
+
mail: string;
|
|
5
|
+
url: string;
|
|
6
|
+
name: string;
|
|
7
|
+
socialIds: Record<string, string>;
|
|
8
|
+
username: string;
|
|
9
|
+
modified: string;
|
|
10
|
+
v: number;
|
|
11
|
+
lastLoginTime: string;
|
|
12
|
+
lastLoginIp?: string;
|
|
13
|
+
avatar: string;
|
|
14
|
+
postID: string;
|
|
15
|
+
}
|
|
16
|
+
export type TLogin = {
|
|
17
|
+
token: string;
|
|
18
|
+
expiresIn: number;
|
|
19
|
+
lastLoginTime: null | string;
|
|
20
|
+
lastLoginIp?: null | string;
|
|
21
|
+
} & Pick<UserModel, 'name' | 'username' | 'created' | 'url' | 'mail' | 'avatar' | 'id'>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../models/user.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
// @copy: https://github.com/sindresorhus/auto-bind/blob/main/index.js
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.autoBind = void 0;
|
|
6
|
+
// Gets all non-builtin properties up the prototype chain.
|
|
7
|
+
const getAllProperties = (object) => {
|
|
8
|
+
const properties = new Set();
|
|
9
|
+
do {
|
|
10
|
+
for (const key of Reflect.ownKeys(object)) {
|
|
11
|
+
properties.add([object, key]);
|
|
12
|
+
}
|
|
13
|
+
} while ((object = Reflect.getPrototypeOf(object)) &&
|
|
14
|
+
object !== Object.prototype);
|
|
15
|
+
return properties;
|
|
16
|
+
};
|
|
17
|
+
function autoBind(self, { include, exclude } = {}) {
|
|
18
|
+
const filter = (key) => {
|
|
19
|
+
const match = (pattern) => typeof pattern === 'string' ? key === pattern : pattern.test(key);
|
|
20
|
+
if (include) {
|
|
21
|
+
return include.some(match);
|
|
22
|
+
}
|
|
23
|
+
if (exclude) {
|
|
24
|
+
return !exclude.some(match);
|
|
25
|
+
}
|
|
26
|
+
return true;
|
|
27
|
+
};
|
|
28
|
+
for (const [object, key] of getAllProperties(self.constructor.prototype)) {
|
|
29
|
+
if (key === 'constructor' || !filter(key)) {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(object, key);
|
|
33
|
+
if (descriptor && typeof descriptor.value === 'function') {
|
|
34
|
+
self[key] = self[key].bind(self);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return self;
|
|
38
|
+
}
|
|
39
|
+
exports.autoBind = autoBind;
|
|
40
|
+
//# sourceMappingURL=auto-bind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-bind.js","sourceRoot":"","sources":["../../utils/auto-bind.ts"],"names":[],"mappings":";AAAA,cAAc;AACd,sEAAsE;;;AAEtE,0DAA0D;AAC1D,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,EAAE;IAClC,MAAM,UAAU,GAAG,IAAI,GAAG,EAAE,CAAA;IAE5B,GAAG;QACD,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACzC,UAAU,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAA;SAC9B;KACF,QACC,CAAC,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QACzC,MAAM,KAAK,MAAM,CAAC,SAAS,EAC5B;IAED,OAAO,UAAU,CAAA;AACnB,CAAC,CAAA;AAED,SAAgB,QAAQ,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE;IACtD,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE,EAAE;QACrB,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,EAAE,CACxB,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAEnE,IAAI,OAAO,EAAE;YACX,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;SAC3B;QAED,IAAI,OAAO,EAAE;YACX,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;SAC5B;QAED,OAAO,IAAI,CAAA;IACb,CAAC,CAAA;IAED,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE;QACxE,IAAI,GAAG,KAAK,aAAa,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;YACzC,SAAQ;SACT;QAED,MAAM,UAAU,GAAG,OAAO,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;QAChE,IAAI,UAAU,IAAI,OAAO,UAAU,CAAC,KAAK,KAAK,UAAU,EAAE;YACxD,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;SACjC;KACF;IAED,OAAO,IAAI,CAAA;AACb,CAAC;AA5BD,4BA4BC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A simple camelCase function that only handles strings, but not handling symbol, date, or other complex case.
|
|
3
|
+
* If you need to handle more complex cases, please use camelcase-keys package.
|
|
4
|
+
*/
|
|
5
|
+
export declare const camelcaseKeys: <T = any>(obj: any) => T;
|
|
6
|
+
export declare function camelcase(str: string): string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.camelcase = exports.camelcaseKeys = void 0;
|
|
4
|
+
const _1 = require(".");
|
|
5
|
+
/**
|
|
6
|
+
* A simple camelCase function that only handles strings, but not handling symbol, date, or other complex case.
|
|
7
|
+
* If you need to handle more complex cases, please use camelcase-keys package.
|
|
8
|
+
*/
|
|
9
|
+
const camelcaseKeys = (obj) => {
|
|
10
|
+
if (Array.isArray(obj)) {
|
|
11
|
+
return obj.map((x) => (0, exports.camelcaseKeys)(x));
|
|
12
|
+
}
|
|
13
|
+
if ((0, _1.isPlainObject)(obj)) {
|
|
14
|
+
return Object.keys(obj).reduce((result, key) => {
|
|
15
|
+
result[camelcase(key)] = (0, exports.camelcaseKeys)(obj[key]);
|
|
16
|
+
return result;
|
|
17
|
+
}, {});
|
|
18
|
+
}
|
|
19
|
+
return obj;
|
|
20
|
+
};
|
|
21
|
+
exports.camelcaseKeys = camelcaseKeys;
|
|
22
|
+
function camelcase(str) {
|
|
23
|
+
return str.replace(/([-_][a-z])/gi, ($1) => {
|
|
24
|
+
return $1.toUpperCase().replace('-', '').replace('_', '');
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
exports.camelcase = camelcase;
|
|
28
|
+
//# sourceMappingURL=camelcase-keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camelcase-keys.js","sourceRoot":"","sources":["../../utils/camelcase-keys.ts"],"names":[],"mappings":";;;AAAA,wBAAiC;AAEjC;;;GAGG;AACI,MAAM,aAAa,GAAG,CAAU,GAAQ,EAAK,EAAE;IACpD,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QACtB,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,qBAAa,EAAC,CAAC,CAAC,CAAQ,CAAA;KAC/C;IAED,IAAI,IAAA,gBAAa,EAAC,GAAG,CAAC,EAAE;QACtB,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,MAAW,EAAE,GAAG,EAAE,EAAE;YAClD,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,IAAA,qBAAa,EAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;YAChD,OAAO,MAAM,CAAA;QACf,CAAC,EAAE,EAAE,CAAQ,CAAA;KACd;IAED,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAbY,QAAA,aAAa,iBAazB;AAED,SAAgB,SAAS,CAAC,GAAW;IACnC,OAAO,GAAG,CAAC,OAAO,CAAC,eAAe,EAAE,CAAC,EAAE,EAAE,EAAE;QACzC,OAAO,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;IAC3D,CAAC,CAAC,CAAA;AACJ,CAAC;AAJD,8BAIC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SortOrder } from '../interfaces/options';
|
|
2
|
+
export declare const isPlainObject: (obj: any) => any;
|
|
3
|
+
export declare const sortOrderToNumber: (order: SortOrder) => number;
|
|
4
|
+
export declare const destructureData: (payload: any) => any;
|
|
5
|
+
export declare const attachRawFromOneToAnthor: (from: any, to: any) => void;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.attachRawFromOneToAnthor = exports.destructureData = exports.sortOrderToNumber = exports.isPlainObject = void 0;
|
|
4
|
+
const isPlainObject = (obj) => isObject(obj) &&
|
|
5
|
+
Object.prototype.toString.call(obj) === '[object Object]' &&
|
|
6
|
+
Object.getPrototypeOf(obj) === Object.prototype;
|
|
7
|
+
exports.isPlainObject = isPlainObject;
|
|
8
|
+
const sortOrderToNumber = (order) => {
|
|
9
|
+
return ({
|
|
10
|
+
asc: 1,
|
|
11
|
+
desc: -1,
|
|
12
|
+
}[order] || 1);
|
|
13
|
+
};
|
|
14
|
+
exports.sortOrderToNumber = sortOrderToNumber;
|
|
15
|
+
const isObject = (obj) => obj && typeof obj === 'object';
|
|
16
|
+
const destructureData = (payload) => {
|
|
17
|
+
if (typeof payload !== 'object') {
|
|
18
|
+
return payload;
|
|
19
|
+
}
|
|
20
|
+
if (payload === null) {
|
|
21
|
+
return payload;
|
|
22
|
+
}
|
|
23
|
+
const data = payload.data;
|
|
24
|
+
const dataIsPlainObject = (0, exports.isPlainObject)(data);
|
|
25
|
+
if (dataIsPlainObject && Object.keys(payload).length === 1) {
|
|
26
|
+
const d = Object.assign({}, data);
|
|
27
|
+
// attach raw onto new data
|
|
28
|
+
(0, exports.attachRawFromOneToAnthor)(payload, d);
|
|
29
|
+
return d;
|
|
30
|
+
}
|
|
31
|
+
return payload;
|
|
32
|
+
};
|
|
33
|
+
exports.destructureData = destructureData;
|
|
34
|
+
const attachRawFromOneToAnthor = (from, to) => {
|
|
35
|
+
if (!from || !isObject(to)) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
from.$raw &&
|
|
39
|
+
Object.defineProperty(to, '$raw', {
|
|
40
|
+
value: { ...from.$raw },
|
|
41
|
+
enumerable: false,
|
|
42
|
+
});
|
|
43
|
+
from.$request &&
|
|
44
|
+
Object.defineProperty(to, '$request', {
|
|
45
|
+
value: { ...from.$request },
|
|
46
|
+
enumerable: false,
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
exports.attachRawFromOneToAnthor = attachRawFromOneToAnthor;
|
|
50
|
+
//# sourceMappingURL=index.js.map
|