@fc3/mmcadi 0.1.3 → 0.1.4
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/dist/.last-compile-time +1 -1
- package/dist/.last-publish-time +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +3 -1
- package/dist/src/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/common/utility/get-parent-url.d.ts +0 -2
- package/dist/src/common/utility/get-parent-url.js +0 -25
- package/dist/src/common/utility/get-parent-url.js.map +0 -1
- package/dist/src/enum/block-privacy.d.ts +0 -5
- package/dist/src/enum/block-privacy.js +0 -9
- package/dist/src/enum/block-privacy.js.map +0 -1
- package/dist/src/enum/role-type.d.ts +0 -5
- package/dist/src/enum/role-type.js +0 -9
- package/dist/src/enum/role-type.js.map +0 -1
- package/dist/src/enum/title-size.d.ts +0 -6
- package/dist/src/enum/title-size.js +0 -10
- package/dist/src/enum/title-size.js.map +0 -1
- package/dist/src/lib/http/type/url-parameters.d.ts +0 -4
- package/dist/src/lib/http/type/url-parameters.js +0 -3
- package/dist/src/lib/http/type/url-parameters.js.map +0 -1
- package/dist/src/lib/server/http/type/endpoint-config.d.ts +0 -3
- package/dist/src/lib/server/http/type/endpoint-config.js +0 -3
- package/dist/src/lib/server/http/type/endpoint-config.js.map +0 -1
- package/dist/src/server/operation/load-account-settings.d.ts +0 -6
- package/dist/src/server/operation/load-account-settings.js +0 -27
- package/dist/src/server/operation/load-account-settings.js.map +0 -1
- package/dist/src/server/result-serializer/block/provider.d.ts +0 -7
- package/dist/src/server/result-serializer/block/provider.js +0 -51
- package/dist/src/server/result-serializer/block/provider.js.map +0 -1
- package/dist/src/server/result-serializer/block/title.d.ts +0 -6
- package/dist/src/server/result-serializer/block/title.js +0 -28
- package/dist/src/server/result-serializer/block/title.js.map +0 -1
- package/dist/src/server/utility/create-toast-url.d.ts +0 -3
- package/dist/src/server/utility/create-toast-url.js +0 -23
- package/dist/src/server/utility/create-toast-url.js.map +0 -1
- package/dist/src/server/utility/date-to-url.d.ts +0 -2
- package/dist/src/server/utility/date-to-url.js +0 -12
- package/dist/src/server/utility/date-to-url.js.map +0 -1
- package/dist/src/server/utility/get-custom-page-type-for-url.d.ts +0 -3
- package/dist/src/server/utility/get-custom-page-type-for-url.js +0 -33
- package/dist/src/server/utility/get-custom-page-type-for-url.js.map +0 -1
- package/dist/src/server/utility/get-url-for-folder-block.d.ts +0 -7
- package/dist/src/server/utility/get-url-for-folder-block.js +0 -19
- package/dist/src/server/utility/get-url-for-folder-block.js.map +0 -1
- package/dist/src/server/utility/is-index-url.d.ts +0 -2
- package/dist/src/server/utility/is-index-url.js +0 -7
- package/dist/src/server/utility/is-index-url.js.map +0 -1
- package/dist/src/server/utility/month-to-url.d.ts +0 -2
- package/dist/src/server/utility/month-to-url.js +0 -13
- package/dist/src/server/utility/month-to-url.js.map +0 -1
- package/dist/src/server/utility/url-is-date.d.ts +0 -4
- package/dist/src/server/utility/url-is-date.js +0 -10
- package/dist/src/server/utility/url-is-date.js.map +0 -1
- package/dist/src/server/utility/url-to-date.d.ts +0 -2
- package/dist/src/server/utility/url-to-date.js +0 -23
- package/dist/src/server/utility/url-to-date.js.map +0 -1
- package/dist/src/server/utility/week-to-url.d.ts +0 -2
- package/dist/src/server/utility/week-to-url.js +0 -15
- package/dist/src/server/utility/week-to-url.js.map +0 -1
- package/dist/src/server/utility/year-to-url.d.ts +0 -2
- package/dist/src/server/utility/year-to-url.js +0 -8
- package/dist/src/server/utility/year-to-url.js.map +0 -1
- package/dist/src/test.d.ts +0 -1
- package/dist/src/test.js +0 -178
- package/dist/src/test.js.map +0 -1
- package/dist/src/type/block/provider.d.ts +0 -13
- package/dist/src/type/block/provider.js +0 -3
- package/dist/src/type/block/provider.js.map +0 -1
- package/dist/src/type/block/title.d.ts +0 -9
- package/dist/src/type/block/title.js +0 -3
- package/dist/src/type/block/title.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function getParentUrl(source_url) {
|
|
4
|
-
if (source_url.includes('localhost')) {
|
|
5
|
-
console.log(source_url);
|
|
6
|
-
console.trace();
|
|
7
|
-
}
|
|
8
|
-
const query_index = source_url.indexOf('?');
|
|
9
|
-
if (query_index !== -1) {
|
|
10
|
-
source_url = source_url.slice(0, query_index);
|
|
11
|
-
}
|
|
12
|
-
if (source_url.endsWith('/')) {
|
|
13
|
-
source_url = source_url.slice(0, -1);
|
|
14
|
-
}
|
|
15
|
-
const parts = source_url.split('/').filter((part) => {
|
|
16
|
-
return part !== '';
|
|
17
|
-
});
|
|
18
|
-
parts.pop();
|
|
19
|
-
if (parts.length === 0) {
|
|
20
|
-
return '/';
|
|
21
|
-
}
|
|
22
|
-
return '/' + parts.join('/');
|
|
23
|
-
}
|
|
24
|
-
exports.default = getParentUrl;
|
|
25
|
-
//# sourceMappingURL=get-parent-url.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-parent-url.js","sourceRoot":"","sources":["../../../../src/common/utility/get-parent-url.ts"],"names":[],"mappings":";;AAAA,SAAS,YAAY,CAAC,UAAkB;IACvC,IAAI,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;QACtC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACxB,OAAO,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;IAED,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAE5C,IAAI,WAAW,KAAK,CAAC,CAAC,EAAE,CAAC;QACxB,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;IAC/C,CAAC;IAED,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACtC,CAAC;IAED,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;QACnD,OAAO,IAAI,KAAK,EAAE,CAAC;IACpB,CAAC,CAAC,CAAC;IAEH,KAAK,CAAC,GAAG,EAAE,CAAC;IAEZ,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,GAAG,CAAC;IACZ,CAAC;IAED,OAAO,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC9B,CAAC;AAED,kBAAe,YAAY,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var BlockPrivacy;
|
|
4
|
-
(function (BlockPrivacy) {
|
|
5
|
-
BlockPrivacy["PUBLIC"] = "public";
|
|
6
|
-
BlockPrivacy["PRIVATE"] = "private";
|
|
7
|
-
})(BlockPrivacy || (BlockPrivacy = {}));
|
|
8
|
-
exports.default = BlockPrivacy;
|
|
9
|
-
//# sourceMappingURL=block-privacy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"block-privacy.js","sourceRoot":"","sources":["../../../src/enum/block-privacy.ts"],"names":[],"mappings":";;AAAA,IAAK,YAGJ;AAHD,WAAK,YAAY;IAChB,iCAAiB,CAAA;IACjB,mCAAmB,CAAA;AACpB,CAAC,EAHI,YAAY,KAAZ,YAAY,QAGhB;AAED,kBAAe,YAAY,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var RoleType;
|
|
4
|
-
(function (RoleType) {
|
|
5
|
-
RoleType["CREATOR"] = "creator";
|
|
6
|
-
RoleType["PUBLIC"] = "public";
|
|
7
|
-
})(RoleType || (RoleType = {}));
|
|
8
|
-
exports.default = RoleType;
|
|
9
|
-
//# sourceMappingURL=role-type.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"role-type.js","sourceRoot":"","sources":["../../../src/enum/role-type.ts"],"names":[],"mappings":";;AAAA,IAAK,QAGJ;AAHD,WAAK,QAAQ;IACZ,+BAAmB,CAAA;IACnB,6BAAiB,CAAA;AAClB,CAAC,EAHI,QAAQ,KAAR,QAAQ,QAGZ;AAED,kBAAe,QAAQ,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var TitleSize;
|
|
4
|
-
(function (TitleSize) {
|
|
5
|
-
TitleSize["SMALL"] = "small";
|
|
6
|
-
TitleSize["MEDIUM"] = "medium";
|
|
7
|
-
TitleSize["LARGE"] = "large";
|
|
8
|
-
})(TitleSize || (TitleSize = {}));
|
|
9
|
-
exports.default = TitleSize;
|
|
10
|
-
//# sourceMappingURL=title-size.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"title-size.js","sourceRoot":"","sources":["../../../src/enum/title-size.ts"],"names":[],"mappings":";;AAAA,IAAK,SAIJ;AAJD,WAAK,SAAS;IACb,4BAAe,CAAA;IACf,8BAAiB,CAAA;IACjB,4BAAe,CAAA;AAChB,CAAC,EAJI,SAAS,KAAT,SAAS,QAIb;AAED,kBAAe,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"url-parameters.js","sourceRoot":"","sources":["../../../../../src/lib/http/type/url-parameters.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint-config.js","sourceRoot":"","sources":["../../../../../../src/lib/server/http/type/endpoint-config.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import AccountSettings from './../../type/account-settings';
|
|
2
|
-
import BaseOperation from './../../operation';
|
|
3
|
-
declare class LoadAccountSettingsOperation extends BaseOperation<AccountSettings | null> {
|
|
4
|
-
protected performInternal(): Promise<AccountSettings | null>;
|
|
5
|
-
}
|
|
6
|
-
export default LoadAccountSettingsOperation;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const operation_1 = __importDefault(require("./../../operation.js"));
|
|
7
|
-
class LoadAccountSettingsOperation extends operation_1.default {
|
|
8
|
-
async performInternal() {
|
|
9
|
-
const execution_context = this.getExecutionContext();
|
|
10
|
-
const session = execution_context.getSession();
|
|
11
|
-
if (session === undefined) {
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
const { username } = session;
|
|
15
|
-
if (username === null) {
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
const { repository } = this.getConfig();
|
|
19
|
-
const account = await repository.getAccountForUsername(username);
|
|
20
|
-
if (account === undefined) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
return account.settings;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.default = LoadAccountSettingsOperation;
|
|
27
|
-
//# sourceMappingURL=load-account-settings.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"load-account-settings.js","sourceRoot":"","sources":["../../../../src/server/operation/load-account-settings.ts"],"names":[],"mappings":";;;;;AACA,0DAAsC;AAEtC,MAAM,4BAA6B,SAAQ,mBAAqC;IACrE,KAAK,CAAC,eAAe;QAC9B,MAAM,iBAAiB,GAAG,IAAI,CAAC,mBAAmB,EAAE,CAAC;QACrD,MAAM,OAAO,GAAG,iBAAiB,CAAC,UAAU,EAAE,CAAC;QAE/C,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC;QACb,CAAC;QAED,MAAM,EAAC,QAAQ,EAAC,GAAG,OAAO,CAAC;QAE3B,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;YACvB,OAAO,IAAI,CAAC;QACb,CAAC;QAED,MAAM,EAAC,UAAU,EAAC,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QACtC,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC;QAEjE,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC;QACb,CAAC;QAED,OAAO,OAAO,CAAC,QAAQ,CAAC;IACzB,CAAC;CACD;AAED,kBAAe,4BAA4B,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import BlockResultSerializer from './../block';
|
|
2
|
-
import ProviderBlock from './../../../type/block/provider';
|
|
3
|
-
declare class ProviderBlockResultSerializer extends BlockResultSerializer<ProviderBlock> {
|
|
4
|
-
serializeContent(): string;
|
|
5
|
-
private getPath;
|
|
6
|
-
}
|
|
7
|
-
export default ProviderBlockResultSerializer;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const get_element_id_for_block_1 = __importDefault(require("./../../utility/get-element-id-for-block.js"));
|
|
7
|
-
const block_1 = __importDefault(require("./../block.js"));
|
|
8
|
-
const emoji_1 = __importDefault(require("./../../../enum/emoji.js"));
|
|
9
|
-
class ProviderBlockResultSerializer extends block_1.default {
|
|
10
|
-
serializeContent() {
|
|
11
|
-
const block = this.getResult();
|
|
12
|
-
const { emoji, subtitle, color } = block;
|
|
13
|
-
const title = block.title || '<em>no text supplied</em>';
|
|
14
|
-
const metadata = this.getMetadata();
|
|
15
|
-
const path = this.getPath();
|
|
16
|
-
const block_id = (0, get_element_id_for_block_1.default)(block, metadata);
|
|
17
|
-
const has_subtitle = subtitle !== '';
|
|
18
|
-
const path_visibility_class = has_subtitle ? 'hidden' : '';
|
|
19
|
-
const subtitle_visibility_class = has_subtitle ? '' : 'hidden';
|
|
20
|
-
const subtitle_markup = `
|
|
21
|
-
<code id="${block_id}-path-target" class="${path_visibility_class} text-smaller three-quarter-opacity">${path}</code>
|
|
22
|
-
<h5 class="${subtitle_visibility_class} three-quarter-opacity m-0 mt-4" id="${block_id}-subtitle-target">
|
|
23
|
-
${subtitle}
|
|
24
|
-
</h5>
|
|
25
|
-
`;
|
|
26
|
-
return this.wrapSection(`
|
|
27
|
-
<a data-role="block_activation" class="biglink ${color} wrap" href="${path}">
|
|
28
|
-
<table>
|
|
29
|
-
<tr>
|
|
30
|
-
<td class="p-8" style="width:15%">
|
|
31
|
-
<h1 class="m-0">${emoji}</h1>
|
|
32
|
-
</td>
|
|
33
|
-
<td class="p-8 align-left">
|
|
34
|
-
<h4 id="${block_id}-title-target">${title}</h4>
|
|
35
|
-
${subtitle_markup}
|
|
36
|
-
</td>
|
|
37
|
-
<td class="p-8" style="width:15%">
|
|
38
|
-
${emoji_1.default.RIGHT_ARROW_UNICODE}
|
|
39
|
-
</td>
|
|
40
|
-
</tr>
|
|
41
|
-
</table>
|
|
42
|
-
</a>
|
|
43
|
-
`);
|
|
44
|
-
}
|
|
45
|
-
getPath() {
|
|
46
|
-
const { path } = this.getResult();
|
|
47
|
-
return path;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
exports.default = ProviderBlockResultSerializer;
|
|
51
|
-
//# sourceMappingURL=provider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../../../../src/server/result-serializer/block/provider.ts"],"names":[],"mappings":";;;;;AAAA,uGAA2E;AAC3E,2EAAmE;AAEnE,uDAA+B;AAE/B,MAAM,6BAA8B,SAAQ,eAAoC;IACxE,gBAAgB;QACtB,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAC/B,MAAM,EAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAC,GAAG,KAAK,CAAC;QACvC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,2BAA2B,CAAC;QACzD,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACpC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAE5B,MAAM,QAAQ,GAAG,IAAA,kCAAoB,EAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QACvD,MAAM,YAAY,GAAG,QAAQ,KAAK,EAAE,CAAC;QAErC,MAAM,qBAAqB,GAAG,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAA,CAAC,CAAC,EAAE,CAAC;QAC1D,MAAM,yBAAyB,GAAG,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;QAE/D,MAAM,eAAe,GAAG;eACX,QAAQ,wBAAwB,qBAAqB,wCAAwC,IAAI;gBAChG,yBAAyB,wCAAwC,QAAQ;MACnF,QAAQ;;GAEX,CAAC;QAEF,OAAO,IAAI,CAAC,WAAW,CAAC;oDAC0B,KAAK,gBAAgB,IAAI;;;;yBAIpD,KAAK;;;iBAGb,QAAQ,kBAAkB,KAAK;SACvC,eAAe;;;SAGf,eAAK,CAAC,mBAAmB;;;;;GAK/B,CAAC,CAAC;IACJ,CAAC;IAEO,OAAO;QACd,MAAM,EAAC,IAAI,EAAC,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAEhC,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AAED,kBAAe,6BAA6B,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const block_1 = __importDefault(require("./../block.js"));
|
|
7
|
-
const title_size_1 = __importDefault(require("./../../../enum/title-size.js"));
|
|
8
|
-
class TitleBlockResultSerializer extends block_1.default {
|
|
9
|
-
serializeContent() {
|
|
10
|
-
const { title, size } = this.getResult();
|
|
11
|
-
const tag = (() => {
|
|
12
|
-
switch (size) {
|
|
13
|
-
case title_size_1.default.SMALL:
|
|
14
|
-
return 'h3';
|
|
15
|
-
case title_size_1.default.MEDIUM:
|
|
16
|
-
return 'h2';
|
|
17
|
-
case title_size_1.default.LARGE:
|
|
18
|
-
default:
|
|
19
|
-
return 'h1';
|
|
20
|
-
}
|
|
21
|
-
})();
|
|
22
|
-
return this.wrapSection(`
|
|
23
|
-
<${tag}>${title}</${tag}>
|
|
24
|
-
`);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
exports.default = TitleBlockResultSerializer;
|
|
28
|
-
//# sourceMappingURL=title.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"title.js","sourceRoot":"","sources":["../../../../../src/server/result-serializer/block/title.ts"],"names":[],"mappings":";;;;;AAAA,2EAAmE;AAEnE,iEAAwC;AAExC,MAAM,0BAA2B,SAAQ,eAAiC;IAClE,gBAAgB;QACtB,MAAM,EAAC,KAAK,EAAE,IAAI,EAAC,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAEvC,MAAM,GAAG,GAAG,CAAC,GAAG,EAAE;YACjB,QAAQ,IAAI,EAAE,CAAC;gBACd,KAAK,oBAAS,CAAC,KAAK;oBACnB,OAAO,IAAI,CAAC;gBACb,KAAK,oBAAS,CAAC,MAAM;oBACpB,OAAO,IAAI,CAAC;gBACb,KAAK,oBAAS,CAAC,KAAK,CAAC;gBACrB;oBACC,OAAO,IAAI,CAAC;YACd,CAAC;QACF,CAAC,CAAC,EAAE,CAAC;QAEL,OAAO,IAAI,CAAC,WAAW,CAAC;MACpB,GAAG,IAAI,KAAK,KAAK,GAAG;GACvB,CAAC,CAAC;IACJ,CAAC;CACD;AAED,kBAAe,0BAA0B,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const url_1 = __importDefault(require("url"));
|
|
7
|
-
function createToastUrl(base_url, toast) {
|
|
8
|
-
const parsed_url = url_1.default.parse(base_url, true);
|
|
9
|
-
const escaped_message = encodeURIComponent(toast.message);
|
|
10
|
-
const escaped_color = toast.color.replace('#', '%23');
|
|
11
|
-
const updated_query = {
|
|
12
|
-
...parsed_url.query,
|
|
13
|
-
toast_message: escaped_message,
|
|
14
|
-
toast_color: escaped_color
|
|
15
|
-
};
|
|
16
|
-
return url_1.default.format({
|
|
17
|
-
...parsed_url,
|
|
18
|
-
search: undefined,
|
|
19
|
-
query: updated_query
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
exports.default = createToastUrl;
|
|
23
|
-
//# sourceMappingURL=create-toast-url.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-toast-url.js","sourceRoot":"","sources":["../../../../src/server/utility/create-toast-url.ts"],"names":[],"mappings":";;;;;AAAA,8CAAsB;AAItB,SAAS,cAAc,CAAC,QAAgB,EAAE,KAAY;IACrD,MAAM,UAAU,GAAG,aAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC7C,MAAM,eAAe,GAAG,kBAAkB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC1D,MAAM,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAEtD,MAAM,aAAa,GAAG;QACrB,GAAG,UAAU,CAAC,KAAK;QACnB,aAAa,EAAE,eAAe;QAC9B,WAAW,EAAE,aAAa;KAC1B,CAAC;IAEF,OAAO,aAAG,CAAC,MAAM,CAAC;QACjB,GAAG,UAAU;QACb,MAAM,EAAE,SAAS;QACjB,KAAK,EAAE,aAAa;KACpB,CAAC,CAAC;AACJ,CAAC;AAED,kBAAe,cAAc,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const date_to_key_1 = __importDefault(require("./date-to-key.js"));
|
|
7
|
-
function dateToUrl(date) {
|
|
8
|
-
const key = (0, date_to_key_1.default)(date);
|
|
9
|
-
return `/${key}`;
|
|
10
|
-
}
|
|
11
|
-
exports.default = dateToUrl;
|
|
12
|
-
//# sourceMappingURL=date-to-url.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"date-to-url.js","sourceRoot":"","sources":["../../../../src/server/utility/date-to-url.ts"],"names":[],"mappings":";;;;;AAAA,6EAAmD;AAEnD,SAAS,SAAS,CAAC,IAAU;IAC5B,MAAM,GAAG,GAAG,IAAA,qBAAS,EAAC,IAAI,CAAC,CAAC;IAE5B,OAAO,IAAI,GAAG,EAAE,CAAC;AAClB,CAAC;AAED,kBAAe,SAAS,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const http_1 = require("./../../lib/http/index.js");
|
|
7
|
-
const custom_page_type_1 = __importDefault(require("./../enum/custom-page-type.js"));
|
|
8
|
-
const url_is_date_1 = __importDefault(require("./url-is-date.js"));
|
|
9
|
-
const is_index_url_1 = __importDefault(require("./is-index-url.js"));
|
|
10
|
-
function isDate(url) {
|
|
11
|
-
return (0, url_is_date_1.default)(url) && url.startsWith('/day/');
|
|
12
|
-
}
|
|
13
|
-
function isError(url) {
|
|
14
|
-
const parsed_key = parseInt(url.slice(1));
|
|
15
|
-
if (isNaN(parsed_key)) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
return parsed_key >= http_1.StatusCode.BAD_REQUEST;
|
|
19
|
-
}
|
|
20
|
-
function getCustomPageTypeForUrl(url) {
|
|
21
|
-
if (isDate(url)) {
|
|
22
|
-
return custom_page_type_1.default.DATE;
|
|
23
|
-
}
|
|
24
|
-
if (isError(url)) {
|
|
25
|
-
return custom_page_type_1.default.ERROR;
|
|
26
|
-
}
|
|
27
|
-
if ((0, is_index_url_1.default)(url)) {
|
|
28
|
-
return custom_page_type_1.default.INDEX;
|
|
29
|
-
}
|
|
30
|
-
return custom_page_type_1.default.BLANK;
|
|
31
|
-
}
|
|
32
|
-
exports.default = getCustomPageTypeForUrl;
|
|
33
|
-
//# sourceMappingURL=get-custom-page-type-for-url.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-custom-page-type-for-url.js","sourceRoot":"","sources":["../../../../src/server/utility/get-custom-page-type-for-url.ts"],"names":[],"mappings":";;;;;AAAA,mCAAoC;AAEpC,oFAA0D;AAC1D,6EAAmD;AACnD,+EAAqD;AAErD,SAAS,MAAM,CAAC,GAAW;IAC1B,OAAO,IAAA,qBAAS,EAAC,GAAG,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,OAAO,CAAC,GAAW;IAC3B,MAAM,UAAU,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAE1C,IAAI,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;QACvB,OAAO,KAAK,CAAC;IACd,CAAC;IAED,OAAO,UAAU,IAAI,iBAAU,CAAC,WAAW,CAAC;AAC7C,CAAC;AAED,SAAS,uBAAuB,CAAC,GAAW;IAC3C,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;QACjB,OAAO,0BAAc,CAAC,IAAI,CAAC;IAC5B,CAAC;IAED,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAClB,OAAO,0BAAc,CAAC,KAAK,CAAC;IAC7B,CAAC;IAED,IAAI,IAAA,sBAAU,EAAC,GAAG,CAAC,EAAE,CAAC;QACrB,OAAO,0BAAc,CAAC,KAAK,CAAC;IAC7B,CAAC;IAED,OAAO,0BAAc,CAAC,KAAK,CAAC;AAC7B,CAAC;AAED,kBAAe,uBAAuB,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const path_1 = __importDefault(require("path"));
|
|
7
|
-
const create_slug_1 = __importDefault(require("./create-slug.js"));
|
|
8
|
-
function getUrlForFolderBlock(input) {
|
|
9
|
-
const { base_url, block } = input;
|
|
10
|
-
const title = block.title;
|
|
11
|
-
if (title === '') {
|
|
12
|
-
return `${base_url}/...`;
|
|
13
|
-
}
|
|
14
|
-
const slug = (0, create_slug_1.default)(title);
|
|
15
|
-
const url = path_1.default.resolve(base_url, `./${slug}`);
|
|
16
|
-
return url;
|
|
17
|
-
}
|
|
18
|
-
exports.default = getUrlForFolderBlock;
|
|
19
|
-
//# sourceMappingURL=get-url-for-folder-block.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-url-for-folder-block.js","sourceRoot":"","sources":["../../../../src/server/utility/get-url-for-folder-block.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AAGxB,6EAAoD;AAOpD,SAAS,oBAAoB,CAAC,KAAkB;IAC/C,MAAM,EAAC,QAAQ,EAAE,KAAK,EAAC,GAAG,KAAK,CAAC;IAEhC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAE1B,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;QAClB,OAAO,GAAG,QAAQ,MAAM,CAAC;IAC1B,CAAC;IAED,MAAM,IAAI,GAAG,IAAA,qBAAU,EAAC,KAAK,CAAC,CAAC;IAC/B,MAAM,GAAG,GAAG,cAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;IAEhD,OAAO,GAAG,CAAC;AACZ,CAAC;AAED,kBAAe,oBAAoB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-index-url.js","sourceRoot":"","sources":["../../../../src/server/utility/is-index-url.ts"],"names":[],"mappings":";;AAAA,SAAS,UAAU,CAAC,GAAW;IAC9B,OAAO,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,QAAQ,CAAC;AACxC,CAAC;AAED,kBAAe,UAAU,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const get_month_name_1 = __importDefault(require("./get-month-name.js"));
|
|
7
|
-
function monthToUrl(date) {
|
|
8
|
-
const month_name = (0, get_month_name_1.default)(date);
|
|
9
|
-
const year = date.getUTCFullYear();
|
|
10
|
-
return `/month/${month_name}-${year}`;
|
|
11
|
-
}
|
|
12
|
-
exports.default = monthToUrl;
|
|
13
|
-
//# sourceMappingURL=month-to-url.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"month-to-url.js","sourceRoot":"","sources":["../../../../src/server/utility/month-to-url.ts"],"names":[],"mappings":";;;;;AAAA,mFAAyD;AAEzD,SAAS,UAAU,CAAC,IAAU;IAC7B,MAAM,UAAU,GAAG,IAAA,wBAAY,EAAC,IAAI,CAAC,CAAC;IACtC,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;IAEnC,OAAO,UAAU,UAAU,IAAI,IAAI,EAAE,CAAC;AACvC,CAAC;AAED,kBAAe,UAAU,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DateRegex = void 0;
|
|
4
|
-
const DateRegex = /^\/(year|month|week|day)\/([0-9]+)-([0-9]+)-([0-9]+)$/;
|
|
5
|
-
exports.DateRegex = DateRegex;
|
|
6
|
-
function urlIsDate(url) {
|
|
7
|
-
return DateRegex.test(url);
|
|
8
|
-
}
|
|
9
|
-
exports.default = urlIsDate;
|
|
10
|
-
//# sourceMappingURL=url-is-date.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"url-is-date.js","sourceRoot":"","sources":["../../../../src/server/utility/url-is-date.ts"],"names":[],"mappings":";;;AAAA,MAAM,SAAS,GAAG,uDAAuD,CAAC;AAElE,8BAAS;AAEjB,SAAS,SAAS,CAAC,GAAW;IAC7B,OAAO,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC;AAED,kBAAe,SAAS,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const errors_1 = require("./../../lib/errors/index.js");
|
|
7
|
-
const url_is_date_1 = require("./url-is-date.js");
|
|
8
|
-
const create_date_1 = __importDefault(require("./create-date.js"));
|
|
9
|
-
function urlToDate(key) {
|
|
10
|
-
const match = key.match(url_is_date_1.DateRegex);
|
|
11
|
-
if (!match) {
|
|
12
|
-
throw new errors_1.InvalidError(`Key did not include a valid date: ${key}`);
|
|
13
|
-
}
|
|
14
|
-
const month = parseInt(match[2]) - 1;
|
|
15
|
-
const day = parseInt(match[3]);
|
|
16
|
-
const year = parseInt(match[4]);
|
|
17
|
-
if (isNaN(month) || isNaN(day) || isNaN(year)) {
|
|
18
|
-
throw new errors_1.InvalidError(`Key did not include a valid date: ${key}`);
|
|
19
|
-
}
|
|
20
|
-
return (0, create_date_1.default)(year, month, day);
|
|
21
|
-
}
|
|
22
|
-
exports.default = urlToDate;
|
|
23
|
-
//# sourceMappingURL=url-to-date.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"url-to-date.js","sourceRoot":"","sources":["../../../../src/server/utility/url-to-date.ts"],"names":[],"mappings":";;;;;AAAA,uCAAwC;AAExC,4DAAqD;AACrD,6EAAoD;AAEpD,SAAS,SAAS,CAAC,GAAW;IAC7B,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,uBAAS,CAAC,CAAC;IAEnC,IAAI,CAAC,KAAK,EAAE,CAAC;QACZ,MAAM,IAAI,qBAAY,CAAC,qCAAqC,GAAG,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACrC,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/B,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAEhC,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QAC/C,MAAM,IAAI,qBAAY,CAAC,qCAAqC,GAAG,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,OAAO,IAAA,qBAAU,EAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;AACrC,CAAC;AAED,kBAAe,SAAS,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const get_month_name_1 = __importDefault(require("./get-month-name.js"));
|
|
7
|
-
const get_padded_date_1 = __importDefault(require("./get-padded-date.js"));
|
|
8
|
-
function weekToUrl(week) {
|
|
9
|
-
const month_name = (0, get_month_name_1.default)(week);
|
|
10
|
-
const day = (0, get_padded_date_1.default)(week);
|
|
11
|
-
const year = week.getUTCFullYear();
|
|
12
|
-
return `/week/${month_name}-${day}-${year}`;
|
|
13
|
-
}
|
|
14
|
-
exports.default = weekToUrl;
|
|
15
|
-
//# sourceMappingURL=week-to-url.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"week-to-url.js","sourceRoot":"","sources":["../../../../src/server/utility/week-to-url.ts"],"names":[],"mappings":";;;;;AAAA,mFAAyD;AACzD,qFAA2D;AAE3D,SAAS,SAAS,CAAC,IAAU;IAC5B,MAAM,UAAU,GAAG,IAAA,wBAAY,EAAC,IAAI,CAAC,CAAC;IACtC,MAAM,GAAG,GAAG,IAAA,yBAAa,EAAC,IAAI,CAAC,CAAC;IAChC,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;IAEnC,OAAO,SAAS,UAAU,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;AAC7C,CAAC;AAED,kBAAe,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"year-to-url.js","sourceRoot":"","sources":["../../../../src/server/utility/year-to-url.ts"],"names":[],"mappings":";;AAAA,SAAS,SAAS,CAAC,IAAU;IAC5B,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;IAEnC,OAAO,SAAS,IAAI,EAAE,CAAC;AACxB,CAAC;AAED,kBAAe,SAAS,CAAC"}
|
package/dist/src/test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|