@ibgib/core-gib 0.0.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/.vscode/core-gib-snippets.code-snippets +189 -0
- package/.vscode/launch.json +24 -0
- package/.vscode/settings.json +56 -0
- package/.vscode/tasks.json +37 -0
- package/CHANGELOG.md +11 -0
- package/README.md +215 -0
- package/dist/common/aws-constants.d.mts +7 -0
- package/dist/common/aws-constants.d.mts.map +1 -0
- package/dist/common/aws-constants.mjs +7 -0
- package/dist/common/aws-constants.mjs.map +1 -0
- package/dist/common/bin/bin-types.d.mts +17 -0
- package/dist/common/bin/bin-types.d.mts.map +1 -0
- package/dist/common/bin/bin-types.mjs +3 -0
- package/dist/common/bin/bin-types.mjs.map +1 -0
- package/dist/common/cache/cache-types.d.mts +57 -0
- package/dist/common/cache/cache-types.d.mts.map +1 -0
- package/dist/common/cache/cache-types.mjs +2 -0
- package/dist/common/cache/cache-types.mjs.map +1 -0
- package/dist/common/comment/comment-constants.d.mts +11 -0
- package/dist/common/comment/comment-constants.d.mts.map +1 -0
- package/dist/common/comment/comment-constants.mjs +11 -0
- package/dist/common/comment/comment-constants.mjs.map +1 -0
- package/dist/common/comment/comment-helper.d.mts +59 -0
- package/dist/common/comment/comment-helper.d.mts.map +1 -0
- package/dist/common/comment/comment-helper.mjs +173 -0
- package/dist/common/comment/comment-helper.mjs.map +1 -0
- package/dist/common/comment/comment-types.d.mts +16 -0
- package/dist/common/comment/comment-types.d.mts.map +1 -0
- package/dist/common/comment/comment-types.mjs +2 -0
- package/dist/common/comment/comment-types.mjs.map +1 -0
- package/dist/common/display/display-helper.d.mts +19 -0
- package/dist/common/display/display-helper.d.mts.map +1 -0
- package/dist/common/display/display-helper.mjs +68 -0
- package/dist/common/display/display-helper.mjs.map +1 -0
- package/dist/common/display/display-types.d.mts +97 -0
- package/dist/common/display/display-types.d.mts.map +1 -0
- package/dist/common/display/display-types.mjs +37 -0
- package/dist/common/display/display-types.mjs.map +1 -0
- package/dist/common/encrypt/encrypt-constants.d.mts +27 -0
- package/dist/common/encrypt/encrypt-constants.d.mts.map +1 -0
- package/dist/common/encrypt/encrypt-constants.mjs +27 -0
- package/dist/common/encrypt/encrypt-constants.mjs.map +1 -0
- package/dist/common/encrypt/encrypt-types.d.mts +116 -0
- package/dist/common/encrypt/encrypt-types.d.mts.map +1 -0
- package/dist/common/encrypt/encrypt-types.mjs +9 -0
- package/dist/common/encrypt/encrypt-types.mjs.map +1 -0
- package/dist/common/error/error-constants.d.mts +9 -0
- package/dist/common/error/error-constants.d.mts.map +1 -0
- package/dist/common/error/error-constants.mjs +9 -0
- package/dist/common/error/error-constants.mjs.map +1 -0
- package/dist/common/error/error-helper.d.mts +43 -0
- package/dist/common/error/error-helper.d.mts.map +1 -0
- package/dist/common/error/error-helper.mjs +167 -0
- package/dist/common/error/error-helper.mjs.map +1 -0
- package/dist/common/error/error-types.d.mts +58 -0
- package/dist/common/error/error-types.d.mts.map +1 -0
- package/dist/common/error/error-types.mjs +2 -0
- package/dist/common/error/error-types.mjs.map +1 -0
- package/dist/common/form/form-helper.d.mts +97 -0
- package/dist/common/form/form-helper.d.mts.map +1 -0
- package/dist/common/form/form-helper.mjs +185 -0
- package/dist/common/form/form-helper.mjs.map +1 -0
- package/dist/common/form/form-items.d.mts +229 -0
- package/dist/common/form/form-items.d.mts.map +1 -0
- package/dist/common/form/form-items.mjs +63 -0
- package/dist/common/form/form-items.mjs.map +1 -0
- package/dist/common/import-export/import-export-types.d.mts +18 -0
- package/dist/common/import-export/import-export-types.d.mts.map +1 -0
- package/dist/common/import-export/import-export-types.mjs +2 -0
- package/dist/common/import-export/import-export-types.mjs.map +1 -0
- package/dist/common/legacy/legacy-types.d.mts +2 -0
- package/dist/common/legacy/legacy-types.d.mts.map +1 -0
- package/dist/common/legacy/legacy-types.mjs +2 -0
- package/dist/common/legacy/legacy-types.mjs.map +1 -0
- package/dist/common/link/link-constants.d.mts +2 -0
- package/dist/common/link/link-constants.d.mts.map +1 -0
- package/dist/common/link/link-constants.mjs +2 -0
- package/dist/common/link/link-constants.mjs.map +1 -0
- package/dist/common/link/link-helper.d.mts +37 -0
- package/dist/common/link/link-helper.d.mts.map +1 -0
- package/dist/common/link/link-helper.mjs +143 -0
- package/dist/common/link/link-helper.mjs.map +1 -0
- package/dist/common/link/link-types.d.mts +14 -0
- package/dist/common/link/link-types.d.mts.map +1 -0
- package/dist/common/link/link-types.mjs +2 -0
- package/dist/common/link/link-types.mjs.map +1 -0
- package/dist/common/other/graph-helper.d.mts +166 -0
- package/dist/common/other/graph-helper.d.mts.map +1 -0
- package/dist/common/other/graph-helper.mjs +710 -0
- package/dist/common/other/graph-helper.mjs.map +1 -0
- package/dist/common/other/ibgib-helper.d.mts +245 -0
- package/dist/common/other/ibgib-helper.d.mts.map +1 -0
- package/dist/common/other/ibgib-helper.mjs +641 -0
- package/dist/common/other/ibgib-helper.mjs.map +1 -0
- package/dist/common/other/other-constants.d.mts +53 -0
- package/dist/common/other/other-constants.d.mts.map +1 -0
- package/dist/common/other/other-constants.mjs +67 -0
- package/dist/common/other/other-constants.mjs.map +1 -0
- package/dist/common/other/other-types.d.mts +166 -0
- package/dist/common/other/other-types.d.mts.map +1 -0
- package/dist/common/other/other-types.mjs +30 -0
- package/dist/common/other/other-types.mjs.map +1 -0
- package/dist/common/other/svg-constants.d.mts +2 -0
- package/dist/common/other/svg-constants.d.mts.map +1 -0
- package/dist/common/other/svg-constants.mjs +2 -0
- package/dist/common/other/svg-constants.mjs.map +1 -0
- package/dist/common/other/svg-helper.d.mts +54 -0
- package/dist/common/other/svg-helper.d.mts.map +1 -0
- package/dist/common/other/svg-helper.mjs +170 -0
- package/dist/common/other/svg-helper.mjs.map +1 -0
- package/dist/common/pic/pic-constants.d.mts +13 -0
- package/dist/common/pic/pic-constants.d.mts.map +1 -0
- package/dist/common/pic/pic-constants.mjs +13 -0
- package/dist/common/pic/pic-constants.mjs.map +1 -0
- package/dist/common/pic/pic-helper.d.mts +70 -0
- package/dist/common/pic/pic-helper.d.mts.map +1 -0
- package/dist/common/pic/pic-helper.mjs +235 -0
- package/dist/common/pic/pic-helper.mjs.map +1 -0
- package/dist/common/pic/pic-types.d.mts +23 -0
- package/dist/common/pic/pic-types.d.mts.map +1 -0
- package/dist/common/pic/pic-types.mjs +2 -0
- package/dist/common/pic/pic-types.mjs.map +1 -0
- package/dist/common/root/root-constants.d.mts +40 -0
- package/dist/common/root/root-constants.d.mts.map +1 -0
- package/dist/common/root/root-constants.mjs +40 -0
- package/dist/common/root/root-constants.mjs.map +1 -0
- package/dist/common/root/root-types.d.mts +9 -0
- package/dist/common/root/root-types.d.mts.map +1 -0
- package/dist/common/root/root-types.mjs +2 -0
- package/dist/common/root/root-types.mjs.map +1 -0
- package/dist/common/tag/tag-constants.d.mts +21 -0
- package/dist/common/tag/tag-constants.d.mts.map +1 -0
- package/dist/common/tag/tag-constants.mjs +28 -0
- package/dist/common/tag/tag-constants.mjs.map +1 -0
- package/dist/common/tag/tag-types.d.mts +14 -0
- package/dist/common/tag/tag-types.d.mts.map +1 -0
- package/dist/common/tag/tag-types.mjs +2 -0
- package/dist/common/tag/tag-types.mjs.map +1 -0
- package/dist/core-constants.d.mts +89 -0
- package/dist/core-constants.d.mts.map +1 -0
- package/dist/core-constants.mjs +484 -0
- package/dist/core-constants.mjs.map +1 -0
- package/dist/core-helper.d.mts +6 -0
- package/dist/core-helper.d.mts.map +1 -0
- package/dist/core-helper.mjs +28 -0
- package/dist/core-helper.mjs.map +1 -0
- package/dist/core-types.d.mts +520 -0
- package/dist/core-types.d.mts.map +1 -0
- package/dist/core-types.mjs +2 -0
- package/dist/core-types.mjs.map +1 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -0
- package/dist/witness/app/app-base-v1.d.mts +130 -0
- package/dist/witness/app/app-base-v1.d.mts.map +1 -0
- package/dist/witness/app/app-base-v1.mjs +462 -0
- package/dist/witness/app/app-base-v1.mjs.map +1 -0
- package/dist/witness/app/app-constants.d.mts +10 -0
- package/dist/witness/app/app-constants.d.mts.map +1 -0
- package/dist/witness/app/app-constants.mjs +13 -0
- package/dist/witness/app/app-constants.mjs.map +1 -0
- package/dist/witness/app/app-helper.d.mts +85 -0
- package/dist/witness/app/app-helper.d.mts.map +1 -0
- package/dist/witness/app/app-helper.mjs +258 -0
- package/dist/witness/app/app-helper.mjs.map +1 -0
- package/dist/witness/app/app-types.d.mts +211 -0
- package/dist/witness/app/app-types.d.mts.map +1 -0
- package/dist/witness/app/app-types.mjs +49 -0
- package/dist/witness/app/app-types.mjs.map +1 -0
- package/dist/witness/app/chat-app/chat-app-types.d.mts +18 -0
- package/dist/witness/app/chat-app/chat-app-types.d.mts.map +1 -0
- package/dist/witness/app/chat-app/chat-app-types.mjs +25 -0
- package/dist/witness/app/chat-app/chat-app-types.mjs.map +1 -0
- package/dist/witness/app/flash-app/flash-app-types.d.mts +16 -0
- package/dist/witness/app/flash-app/flash-app-types.d.mts.map +1 -0
- package/dist/witness/app/flash-app/flash-app-types.mjs +23 -0
- package/dist/witness/app/flash-app/flash-app-types.mjs.map +1 -0
- package/dist/witness/app/raw-app/raw-app-types.d.mts +18 -0
- package/dist/witness/app/raw-app/raw-app-types.d.mts.map +1 -0
- package/dist/witness/app/raw-app/raw-app-types.mjs +25 -0
- package/dist/witness/app/raw-app/raw-app-types.mjs.map +1 -0
- package/dist/witness/app/todo-app/todo-app-types.d.ts +33 -0
- package/dist/witness/app/todo-app/todo-app-types.d.ts.map +1 -0
- package/dist/witness/app/todo-app/todo-app-types.js +31 -0
- package/dist/witness/app/todo-app/todo-app-types.js.map +1 -0
- package/dist/witness/robbot/robbot-base-v1.d.ts +432 -0
- package/dist/witness/robbot/robbot-base-v1.d.ts.map +1 -0
- package/dist/witness/robbot/robbot-base-v1.js +1407 -0
- package/dist/witness/robbot/robbot-base-v1.js.map +1 -0
- package/dist/witness/robbot/robbot-constants.d.mts +24 -0
- package/dist/witness/robbot/robbot-constants.d.mts.map +1 -0
- package/dist/witness/robbot/robbot-constants.mjs +24 -0
- package/dist/witness/robbot/robbot-constants.mjs.map +1 -0
- package/dist/witness/robbot/robbot-helper.d.mts +152 -0
- package/dist/witness/robbot/robbot-helper.d.mts.map +1 -0
- package/dist/witness/robbot/robbot-helper.mjs +609 -0
- package/dist/witness/robbot/robbot-helper.mjs.map +1 -0
- package/dist/witness/robbot/robbot-types.d.mts +539 -0
- package/dist/witness/robbot/robbot-types.d.mts.map +1 -0
- package/dist/witness/robbot/robbot-types.mjs +294 -0
- package/dist/witness/robbot/robbot-types.mjs.map +1 -0
- package/dist/witness/space/bootstrap/bootstrap-constants.d.mts +14 -0
- package/dist/witness/space/bootstrap/bootstrap-constants.d.mts.map +1 -0
- package/dist/witness/space/bootstrap/bootstrap-constants.mjs +15 -0
- package/dist/witness/space/bootstrap/bootstrap-constants.mjs.map +1 -0
- package/dist/witness/space/inner-space-v1.d.ts +63 -0
- package/dist/witness/space/inner-space-v1.d.ts.map +1 -0
- package/dist/witness/space/inner-space-v1.js +356 -0
- package/dist/witness/space/inner-space-v1.js.map +1 -0
- package/dist/witness/space/outer-space/outer-space-constants.d.mts +2 -0
- package/dist/witness/space/outer-space/outer-space-constants.d.mts.map +1 -0
- package/dist/witness/space/outer-space/outer-space-constants.mjs +2 -0
- package/dist/witness/space/outer-space/outer-space-constants.mjs.map +1 -0
- package/dist/witness/space/outer-space/outer-space-helper.d.mts +28 -0
- package/dist/witness/space/outer-space/outer-space-helper.d.mts.map +1 -0
- package/dist/witness/space/outer-space/outer-space-helper.mjs +87 -0
- package/dist/witness/space/outer-space/outer-space-helper.mjs.map +1 -0
- package/dist/witness/space/outer-space/outer-space-types.d.mts +548 -0
- package/dist/witness/space/outer-space/outer-space-types.d.mts.map +1 -0
- package/dist/witness/space/outer-space/outer-space-types.mjs +118 -0
- package/dist/witness/space/outer-space/outer-space-types.mjs.map +1 -0
- package/dist/witness/space/space-base-v1.d.mts +147 -0
- package/dist/witness/space/space-base-v1.d.mts.map +1 -0
- package/dist/witness/space/space-base-v1.mjs +350 -0
- package/dist/witness/space/space-base-v1.mjs.map +1 -0
- package/dist/witness/space/space-constants.d.mts +181 -0
- package/dist/witness/space/space-constants.d.mts.map +1 -0
- package/dist/witness/space/space-constants.mjs +192 -0
- package/dist/witness/space/space-constants.mjs.map +1 -0
- package/dist/witness/space/space-helper.d.mts +666 -0
- package/dist/witness/space/space-helper.d.mts.map +1 -0
- package/dist/witness/space/space-helper.mjs +2830 -0
- package/dist/witness/space/space-helper.mjs.map +1 -0
- package/dist/witness/space/space-types.d.mts +422 -0
- package/dist/witness/space/space-types.d.mts.map +1 -0
- package/dist/witness/space/space-types.mjs +52 -0
- package/dist/witness/space/space-types.mjs.map +1 -0
- package/dist/witness/witness-base-v1.d.ts +144 -0
- package/dist/witness/witness-base-v1.d.ts.map +1 -0
- package/dist/witness/witness-base-v1.js +300 -0
- package/dist/witness/witness-base-v1.js.map +1 -0
- package/dist/witness/witness-constants.d.mts +3 -0
- package/dist/witness/witness-constants.d.mts.map +1 -0
- package/dist/witness/witness-constants.mjs +3 -0
- package/dist/witness/witness-constants.mjs.map +1 -0
- package/dist/witness/witness-form-builder.d.mts +45 -0
- package/dist/witness/witness-form-builder.d.mts.map +1 -0
- package/dist/witness/witness-form-builder.mjs +95 -0
- package/dist/witness/witness-form-builder.mjs.map +1 -0
- package/dist/witness/witness-helper.d.mts +89 -0
- package/dist/witness/witness-helper.d.mts.map +1 -0
- package/dist/witness/witness-helper.mjs +229 -0
- package/dist/witness/witness-helper.mjs.map +1 -0
- package/dist/witness/witness-types.d.mts +211 -0
- package/dist/witness/witness-types.d.mts.map +1 -0
- package/dist/witness/witness-types.mjs +2 -0
- package/dist/witness/witness-types.mjs.map +1 -0
- package/jasmine-browser.json +18 -0
- package/jasmine.json +6 -0
- package/package.json +67 -0
- package/src/assumptions.spec.mts +45 -0
- package/src/common/aws-constants.mts +5 -0
- package/src/common/bin/bin-types.mts +17 -0
- package/src/common/cache/cache-types.mts +53 -0
- package/src/common/comment/comment-constants.mts +10 -0
- package/src/common/comment/comment-helper.mts +211 -0
- package/src/common/comment/comment-types.mts +19 -0
- package/src/common/display/display-helper.mts +88 -0
- package/src/common/display/display-types.mts +108 -0
- package/src/common/encrypt/encrypt-constants.mts +28 -0
- package/src/common/encrypt/encrypt-types.mts +130 -0
- package/src/common/error/error-constants.mts +8 -0
- package/src/common/error/error-helper.mts +155 -0
- package/src/common/error/error-types.mts +62 -0
- package/src/common/form/form-helper.mts +253 -0
- package/src/common/form/form-items.mts +236 -0
- package/src/common/import-export/import-export-types.mts +18 -0
- package/src/common/legacy/about-legacy.md +0 -0
- package/src/common/legacy/legacy-types.mts +0 -0
- package/src/common/link/link-constants.mts +1 -0
- package/src/common/link/link-helper.mts +155 -0
- package/src/common/link/link-types.mts +16 -0
- package/src/common/other/graph-helper.mts +853 -0
- package/src/common/other/ibgib-helper.mts +671 -0
- package/src/common/other/other-constants.mts +76 -0
- package/src/common/other/other-types.mts +186 -0
- package/src/common/other/svg-constants.mts +1 -0
- package/src/common/other/svg-helper.mts +238 -0
- package/src/common/pic/pic-constants.mts +13 -0
- package/src/common/pic/pic-helper.mts +295 -0
- package/src/common/pic/pic-types.mts +29 -0
- package/src/common/root/root-constants.mts +41 -0
- package/src/common/root/root-types.mts +8 -0
- package/src/common/tag/tag-constants.mts +34 -0
- package/src/common/tag/tag-types.mts +19 -0
- package/src/core-constants.mts +506 -0
- package/src/core-helper.mts +33 -0
- package/src/core-types.mts +519 -0
- package/src/helper.spec.mts +64 -0
- package/src/index.mts +1 -0
- package/src/witness/app/app-base-v1.mts +584 -0
- package/src/witness/app/app-constants.mts +16 -0
- package/src/witness/app/app-helper.mts +322 -0
- package/src/witness/app/app-types.mts +252 -0
- package/src/witness/app/chat-app/chat-app-types.mts +40 -0
- package/src/witness/app/flash-app/flash-app-types.mts +38 -0
- package/src/witness/app/raw-app/raw-app-types.mts +40 -0
- package/src/witness/app/todo-app/todo-app-types.ts +59 -0
- package/src/witness/robbot/robbot-base-v1.ts +1531 -0
- package/src/witness/robbot/robbot-constants.mts +25 -0
- package/src/witness/robbot/robbot-helper.mts +676 -0
- package/src/witness/robbot/robbot-helper.spec.mts +135 -0
- package/src/witness/robbot/robbot-types.mts +797 -0
- package/src/witness/space/bootstrap/bootstrap-constants.mts +15 -0
- package/src/witness/space/inner-space-v1.ts +372 -0
- package/src/witness/space/outer-space/outer-space-constants.mts +1 -0
- package/src/witness/space/outer-space/outer-space-helper.mts +91 -0
- package/src/witness/space/outer-space/outer-space-types.mts +627 -0
- package/src/witness/space/space-base-v1.mts +414 -0
- package/src/witness/space/space-constants.mts +208 -0
- package/src/witness/space/space-helper.mts +3242 -0
- package/src/witness/space/space-types.mts +476 -0
- package/src/witness/witness-base-v1.ts +325 -0
- package/src/witness/witness-constants.mts +2 -0
- package/src/witness/witness-form-builder.mts +128 -0
- package/src/witness/witness-helper.mts +256 -0
- package/src/witness/witness-types.mts +249 -0
- package/tsconfig.json +15 -0
- package/tsconfig.test.json +10 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* comment ibs atow are comment [commentText substring]
|
|
3
|
+
*/
|
|
4
|
+
export const DEFAULT_COMMENT_TEXT_IB_SUBSTRING_LENGTH = 20;
|
|
5
|
+
/**
|
|
6
|
+
* comment ib can have additional metadata string,
|
|
7
|
+
*
|
|
8
|
+
* @example "comment thisisacomm here_is_addl_metadata"
|
|
9
|
+
*/
|
|
10
|
+
export const DEFAULT_COMMENT_METADATA_IB_SUBSTRING_LENGTH = 64;
|
|
11
|
+
//# sourceMappingURL=comment-constants.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment-constants.mjs","sourceRoot":"","sources":["../../../src/common/comment/comment-constants.mts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,wCAAwC,GAAG,EAAE,CAAC;AAC3D;;;;GAIG;AACH,MAAM,CAAC,MAAM,4CAA4C,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Ib, TransformResult } from '@ibgib/ts-gib';
|
|
2
|
+
import { IbGib_V1 } from '@ibgib/ts-gib/dist/V1/index.mjs';
|
|
3
|
+
import { IbGibSpaceAny } from '../../witness/space/space-base-v1.mjs';
|
|
4
|
+
import { CommentIbGib_V1 } from './comment-types.mjs';
|
|
5
|
+
/**
|
|
6
|
+
* generates an ib based on the comment text.
|
|
7
|
+
*
|
|
8
|
+
* Basically this gets a short substring of the comment text and replaces
|
|
9
|
+
* any non alphanumeric characters.
|
|
10
|
+
*
|
|
11
|
+
* @param commentText comment text
|
|
12
|
+
* @returns comment ib for the given comment text
|
|
13
|
+
*/
|
|
14
|
+
export declare function getCommentIb({ commentText, addlMetadataText, }: {
|
|
15
|
+
commentText: string;
|
|
16
|
+
/**
|
|
17
|
+
* Optional metadata string to be included in the comment's ib.
|
|
18
|
+
* Should be underscore-delimited but not a hard rule atow.
|
|
19
|
+
*
|
|
20
|
+
* @example "comment thisisacomm here_is_addl_metadata"
|
|
21
|
+
*/
|
|
22
|
+
addlMetadataText?: string;
|
|
23
|
+
}): string;
|
|
24
|
+
export declare function parseCommentIb({ ib, }: {
|
|
25
|
+
ib: Ib;
|
|
26
|
+
}): {
|
|
27
|
+
safeIbCommentText: string;
|
|
28
|
+
safeIbCommentMetadataText?: string;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* creates a comment ibgib, returning the transform result,
|
|
32
|
+
* optionally saving it in a given {@link space}.
|
|
33
|
+
*/
|
|
34
|
+
export declare function createCommentIbGib({ text, addlMetadataText, saveInSpace, space, }: {
|
|
35
|
+
/**
|
|
36
|
+
* comment text
|
|
37
|
+
*/
|
|
38
|
+
text: string;
|
|
39
|
+
/**
|
|
40
|
+
* Optional metadata string to be included in the comment's ib.
|
|
41
|
+
* Should be underscore-delimited but not a hard rule atow.
|
|
42
|
+
*
|
|
43
|
+
* @example "comment thisisacomm here_is_addl_metadata"
|
|
44
|
+
*/
|
|
45
|
+
addlMetadataText?: string;
|
|
46
|
+
/**
|
|
47
|
+
* If true, will save the ibgibs created in the given {@link space}.
|
|
48
|
+
*/
|
|
49
|
+
saveInSpace?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* If {@link saveInSpace}, all ibgibs created in this function will be stored in
|
|
52
|
+
* this space.
|
|
53
|
+
*/
|
|
54
|
+
space?: IbGibSpaceAny;
|
|
55
|
+
}): Promise<TransformResult<CommentIbGib_V1>>;
|
|
56
|
+
export declare function isComment({ ibGib, }: {
|
|
57
|
+
ibGib: IbGib_V1;
|
|
58
|
+
}): boolean;
|
|
59
|
+
//# sourceMappingURL=comment-helper.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment-helper.d.mts","sourceRoot":"","sources":["../../../src/common/comment/comment-helper.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAyB,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAGlF,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAEtE,OAAO,EAAkB,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAStE;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,EAC3B,WAAW,EACX,gBAAgB,GACjB,EAAE;IACD,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,GAAG,MAAM,CA6BT;AAED,wBAAgB,cAAc,CAAC,EAC7B,EAAE,GACH,EAAE;IACD,EAAE,EAAE,EAAE,CAAC;CACR,GAAG;IACF,iBAAiB,EAAE,MAAM,CAAC;IAC1B,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACpC,CAmBA;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,IAAI,EACJ,gBAAgB,EAChB,WAAW,EACX,KAAK,GACN,EAAE;IACD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,GAAG,OAAO,CAAC,eAAe,CAAC,eAAe,CAAC,CAAC,CAuC5C;AAED,wBAAgB,SAAS,CAAC,EACxB,KAAK,GACN,EAAE;IACD,KAAK,EAAE,QAAQ,CAAC;CACjB,GAAG,OAAO,CAwCV"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { Factory_V1 as factory } from '@ibgib/ts-gib/dist/V1/index.mjs';
|
|
2
|
+
import { persistTransformResult } from '../../witness/space/space-helper.mjs';
|
|
3
|
+
import { GLOBAL_LOG_A_LOT } from '../../core-constants.mjs';
|
|
4
|
+
import { getSaferSubstring, getTimestamp, pretty } from '@ibgib/helper-gib';
|
|
5
|
+
import { DEFAULT_COMMENT_METADATA_IB_SUBSTRING_LENGTH, DEFAULT_COMMENT_TEXT_IB_SUBSTRING_LENGTH } from './comment-constants.mjs';
|
|
6
|
+
// import { getSaferSubstring } from './utils.mjs';
|
|
7
|
+
const logalot = GLOBAL_LOG_A_LOT || false;
|
|
8
|
+
/**
|
|
9
|
+
* generates an ib based on the comment text.
|
|
10
|
+
*
|
|
11
|
+
* Basically this gets a short substring of the comment text and replaces
|
|
12
|
+
* any non alphanumeric characters.
|
|
13
|
+
*
|
|
14
|
+
* @param commentText comment text
|
|
15
|
+
* @returns comment ib for the given comment text
|
|
16
|
+
*/
|
|
17
|
+
export function getCommentIb({ commentText, addlMetadataText, }) {
|
|
18
|
+
const lc = `[${getCommentIb.name}]`;
|
|
19
|
+
try {
|
|
20
|
+
if (!commentText) {
|
|
21
|
+
throw new Error(`commentText required. (E: 22fdfd0aa0524a18b63a9405b312c99e)`);
|
|
22
|
+
}
|
|
23
|
+
// get a safe slice of the comment text to add to the ib
|
|
24
|
+
const ibCommentText = getSaferSubstring({
|
|
25
|
+
text: commentText,
|
|
26
|
+
length: DEFAULT_COMMENT_TEXT_IB_SUBSTRING_LENGTH,
|
|
27
|
+
replaceMap: { ['?']: '__qm__' }, // we want to preserve question marks for requests for robbots
|
|
28
|
+
});
|
|
29
|
+
if (addlMetadataText) {
|
|
30
|
+
if (addlMetadataText.length > DEFAULT_COMMENT_METADATA_IB_SUBSTRING_LENGTH) {
|
|
31
|
+
console.warn(`${lc} addlMetadataText (${addlMetadataText.length}) is too long. Max length: ${DEFAULT_COMMENT_METADATA_IB_SUBSTRING_LENGTH}`);
|
|
32
|
+
}
|
|
33
|
+
const ibCommentMetadata = getSaferSubstring({ text: addlMetadataText, length: DEFAULT_COMMENT_METADATA_IB_SUBSTRING_LENGTH });
|
|
34
|
+
if (!ibCommentMetadata) {
|
|
35
|
+
throw new Error(`(UNEXPECTED) addlMetadataText contains no safe characters? (E: dd03c578ada2836b05c94a4aa1785222)`);
|
|
36
|
+
}
|
|
37
|
+
return `comment ${ibCommentText} ${ibCommentMetadata}`;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
return `comment ${ibCommentText}`;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
console.error(`${lc} ${error.message}`);
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export function parseCommentIb({ ib, }) {
|
|
49
|
+
const lc = `${parseCommentIb.name}]`;
|
|
50
|
+
try {
|
|
51
|
+
if (logalot) {
|
|
52
|
+
console.log(`${lc} starting... (I: 1a16f5e3134599eeb585eae77ee6af22)`);
|
|
53
|
+
}
|
|
54
|
+
if (!ib) {
|
|
55
|
+
throw new Error(`ib required (E: d89f8c4df46b970585c82bc89c1c6322)`);
|
|
56
|
+
}
|
|
57
|
+
let [_, safeIbCommentText, safeIbCommentMetadataText] = ib.split(' ');
|
|
58
|
+
// replaceMap: { ['?']: '__qm__' }, // we want to preserve question marks for requests for robbots
|
|
59
|
+
while (safeIbCommentText.includes('__qm__')) {
|
|
60
|
+
safeIbCommentText = safeIbCommentText.replace('__qm__', '?');
|
|
61
|
+
}
|
|
62
|
+
return { safeIbCommentText, safeIbCommentMetadataText };
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
console.error(`${lc} ${error.message}`);
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
finally {
|
|
69
|
+
if (logalot) {
|
|
70
|
+
console.log(`${lc} complete.`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* creates a comment ibgib, returning the transform result,
|
|
76
|
+
* optionally saving it in a given {@link space}.
|
|
77
|
+
*/
|
|
78
|
+
export async function createCommentIbGib({ text, addlMetadataText, saveInSpace, space, }) {
|
|
79
|
+
const lc = `[${createCommentIbGib.name}]`;
|
|
80
|
+
if (logalot) {
|
|
81
|
+
console.log(`${lc} starting...`);
|
|
82
|
+
}
|
|
83
|
+
try {
|
|
84
|
+
if (!text) {
|
|
85
|
+
throw new Error(`text required (E: 3e3d0f555e1a83771a6548eb10943522)`);
|
|
86
|
+
}
|
|
87
|
+
text = text.trim();
|
|
88
|
+
if (!text) {
|
|
89
|
+
throw new Error(`text cannot be only whitespace (E: d6db3537b9834294836aeb70987c908e)`);
|
|
90
|
+
}
|
|
91
|
+
const data = { text, textTimestamp: getTimestamp() };
|
|
92
|
+
// create an ibgib with the filename and ext
|
|
93
|
+
const opts = {
|
|
94
|
+
parentIbGib: factory.primitive({ ib: 'comment' }),
|
|
95
|
+
ib: getCommentIb({ commentText: text, addlMetadataText }),
|
|
96
|
+
data,
|
|
97
|
+
dna: true,
|
|
98
|
+
tjp: { uuid: true, timestamp: true },
|
|
99
|
+
nCounter: true,
|
|
100
|
+
};
|
|
101
|
+
// this makes it more difficult to share/sync ibgibs...
|
|
102
|
+
// if (this.addr) { opts.rel8ns = { 'comment on': [this.addr] }; }
|
|
103
|
+
if (logalot) {
|
|
104
|
+
console.log(`${lc} opts: ${pretty(opts)}`);
|
|
105
|
+
}
|
|
106
|
+
const resCommentIbGib = await factory.firstGen(opts);
|
|
107
|
+
if (saveInSpace) {
|
|
108
|
+
if (!space) {
|
|
109
|
+
throw new Error(`space required if saveInSpace is truthy (E: 40f69f22f21b4279a83cb746cb4b0da1)`);
|
|
110
|
+
}
|
|
111
|
+
await persistTransformResult({ resTransform: resCommentIbGib, space });
|
|
112
|
+
}
|
|
113
|
+
return resCommentIbGib;
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
console.error(`${lc} ${error.message}`);
|
|
117
|
+
throw error;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
export function isComment({ ibGib, }) {
|
|
121
|
+
const lc = `[${isComment.name}]`;
|
|
122
|
+
try {
|
|
123
|
+
if (logalot) {
|
|
124
|
+
console.log(`${lc} starting...`);
|
|
125
|
+
}
|
|
126
|
+
if (!ibGib) {
|
|
127
|
+
throw new Error(`ibGib required (E: f204dac30ae548b0a049f1c4d8048502)`);
|
|
128
|
+
}
|
|
129
|
+
const { ib, data, rel8ns } = ibGib;
|
|
130
|
+
// try rel8ns first
|
|
131
|
+
if (!rel8ns) {
|
|
132
|
+
if (logalot) {
|
|
133
|
+
console.log(`${lc} rel8ns falsy, NOT a comment (I: 6e145eb2d0ba46629746215a3b655fd5)`);
|
|
134
|
+
}
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
// descends from comment^gib
|
|
138
|
+
const ancestors = rel8ns.ancestor || [];
|
|
139
|
+
if (ancestors && ancestors.includes('comment^gib')) {
|
|
140
|
+
if (logalot) {
|
|
141
|
+
console.log(`${lc} descends from comment^gib, YES is a comment (I: 1a8557780e2e4c1580d5a2585567762b)`);
|
|
142
|
+
}
|
|
143
|
+
return true;
|
|
144
|
+
}
|
|
145
|
+
// has binary qualities and ib contains 'comment'
|
|
146
|
+
if (!data) {
|
|
147
|
+
if (logalot) {
|
|
148
|
+
console.log(`${lc} data falsy, NOT a comment (I: 30b20ff6785f432f98489f11efe24299)`);
|
|
149
|
+
}
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
if (data.text && ib?.includes('comment')) {
|
|
153
|
+
if (logalot) {
|
|
154
|
+
console.log(`${lc} has text, and ib has 'comment', YES is a comment (I: 3aa03bcd639d4ec7abd7ead917eda3d8)`);
|
|
155
|
+
}
|
|
156
|
+
return true;
|
|
157
|
+
}
|
|
158
|
+
if (logalot) {
|
|
159
|
+
console.log(`${lc} reached end, doesn't have comment qualities. NOT a comment. (I: cfa529f27f9d490abd476c924ef77087)`);
|
|
160
|
+
}
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
console.error(`${lc} ${error.message}`);
|
|
165
|
+
throw error;
|
|
166
|
+
}
|
|
167
|
+
finally {
|
|
168
|
+
if (logalot) {
|
|
169
|
+
console.log(`${lc} complete.`);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=comment-helper.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment-helper.mjs","sourceRoot":"","sources":["../../../src/common/comment/comment-helper.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,IAAI,OAAO,EAAY,MAAM,iCAAiC,CAAC;AAIlF,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAE9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,4CAA4C,EAAE,wCAAwC,EAAE,MAAM,yBAAyB,CAAC;AACjI,mDAAmD;AAEnD,MAAM,OAAO,GAAG,gBAAg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YAAS;QACR,IAAI,OAAO,EAAE;YAAE,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;SAAE;KACjD;AACH,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TransformResult } from '@ibgib/ts-gib';
|
|
2
|
+
import { IbGibData_V1, IbGibRel8ns_V1, IbGib_V1 } from '@ibgib/ts-gib/dist/V1/index.mjs';
|
|
3
|
+
/**
|
|
4
|
+
* Data for a comment ibGib
|
|
5
|
+
*/
|
|
6
|
+
export interface CommentData_V1 extends IbGibData_V1 {
|
|
7
|
+
text: string;
|
|
8
|
+
textTimestamp?: string;
|
|
9
|
+
timestamp?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface CommentRel8ns_V1 extends IbGibRel8ns_V1 {
|
|
12
|
+
}
|
|
13
|
+
export interface CommentIbGib_V1 extends IbGib_V1<CommentData_V1, CommentRel8ns_V1> {
|
|
14
|
+
}
|
|
15
|
+
export type UpdateCommentPromptResult = TransformResult<CommentIbGib_V1>;
|
|
16
|
+
//# sourceMappingURL=comment-types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment-types.d.mts","sourceRoot":"","sources":["../../../src/common/comment/comment-types.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAEzF;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,YAAY;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAiB,SAAQ,cAAc;CACvD;AAED,MAAM,WAAW,eAAgB,SAAQ,QAAQ,CAAC,cAAc,EAAE,gBAAgB,CAAC;CAClF;AAED,MAAM,MAAM,yBAAyB,GAAG,eAAe,CAAC,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment-types.mjs","sourceRoot":"","sources":["../../../src/common/comment/comment-types.mts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Ib } from '@ibgib/ts-gib';
|
|
2
|
+
import { DisplayData_V1 } from './display-types.mjs';
|
|
3
|
+
export declare function validateDisplayData({ data, }: {
|
|
4
|
+
data: DisplayData_V1;
|
|
5
|
+
}): string[];
|
|
6
|
+
export declare function getDisplayIb({ data, }: {
|
|
7
|
+
data: DisplayData_V1;
|
|
8
|
+
}): Ib;
|
|
9
|
+
/**
|
|
10
|
+
* Current schema is `witness display [classname] [displayName] [displayId]
|
|
11
|
+
*
|
|
12
|
+
* NOTE this is space-delimited
|
|
13
|
+
*/
|
|
14
|
+
export declare function parseDisplayIb({ displayIb, }: {
|
|
15
|
+
displayIb: Ib;
|
|
16
|
+
}): {
|
|
17
|
+
ticks: string;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=display-helper.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"display-helper.d.mts","sourceRoot":"","sources":["../../../src/common/display/display-helper.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAG,MAAM,eAAe,CAAC;AAGpC,OAAO,EACH,cAAc,EAGjB,MAAM,qBAAqB,CAAC;AAM7B,wBAAgB,mBAAmB,CAAC,EAChC,IAAI,GACP,EAAE;IACC,IAAI,EAAE,cAAc,CAAC;CACxB,GAAG,MAAM,EAAE,CA0BX;AAED,wBAAgB,YAAY,CAAC,EACzB,IAAI,GACP,EAAE;IACC,IAAI,EAAE,cAAc,CAAC;CACxB,GAAG,EAAE,CAaL;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAC3B,SAAS,GACZ,EAAE;IACC,SAAS,EAAE,EAAE,CAAC;CACjB,GAAG;IACA,KAAK,EAAE,MAAM,CAAC;CACjB,CAYA"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { GLOBAL_LOG_A_LOT } from '../../core-constants.mjs';
|
|
2
|
+
import { DISPLAY_ATOM,
|
|
3
|
+
// DisplayOutputMode, VALID_DISPLAY_OUTPUT_MODES
|
|
4
|
+
} from './display-types.mjs';
|
|
5
|
+
const logalot = GLOBAL_LOG_A_LOT || false;
|
|
6
|
+
export function validateDisplayData({ data, }) {
|
|
7
|
+
const lc = `[${validateDisplayData.name}]`;
|
|
8
|
+
try {
|
|
9
|
+
if (logalot) {
|
|
10
|
+
console.log(`${lc} starting...`);
|
|
11
|
+
}
|
|
12
|
+
if (!data) {
|
|
13
|
+
throw new Error(`displayData required (E: 9e138d1bc84c4dbdaad768e85ce3dfa7)`);
|
|
14
|
+
}
|
|
15
|
+
const errors = [];
|
|
16
|
+
const { uuid, filters, sorts, } = data;
|
|
17
|
+
if (logalot) {
|
|
18
|
+
console.warn(`${lc} not implemented yet (W: cc8c2d55cdbb40bc85531d8ff4df5bbc)`);
|
|
19
|
+
}
|
|
20
|
+
if (filters?.length ?? 0 > 0) { }
|
|
21
|
+
if (sorts?.length ?? 0 > 0) { }
|
|
22
|
+
return errors;
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
console.error(`${lc} ${error.message}`);
|
|
26
|
+
throw error;
|
|
27
|
+
}
|
|
28
|
+
finally {
|
|
29
|
+
if (logalot) {
|
|
30
|
+
console.log(`${lc} complete.`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export function getDisplayIb({ data, }) {
|
|
35
|
+
const lc = `[${getDisplayIb.name}]`;
|
|
36
|
+
try {
|
|
37
|
+
const validationErrors = validateDisplayData({ data });
|
|
38
|
+
if (validationErrors.length > 0) {
|
|
39
|
+
throw new Error(`invalid data: ${validationErrors} (E: 8b025bed03b7477e8114fb0f3fc68aea)`);
|
|
40
|
+
}
|
|
41
|
+
const { ticks } = data;
|
|
42
|
+
return `${DISPLAY_ATOM} ${ticks}`;
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
console.error(`${lc} ${error.message}`);
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Current schema is `witness display [classname] [displayName] [displayId]
|
|
51
|
+
*
|
|
52
|
+
* NOTE this is space-delimited
|
|
53
|
+
*/
|
|
54
|
+
export function parseDisplayIb({ displayIb, }) {
|
|
55
|
+
const lc = `[${parseDisplayIb.name}]`;
|
|
56
|
+
try {
|
|
57
|
+
if (!displayIb) {
|
|
58
|
+
throw new Error(`displayIb required (E: d9920ab1683042388d156b1ae781565d)`);
|
|
59
|
+
}
|
|
60
|
+
const [atom, ticks] = displayIb.split(' ');
|
|
61
|
+
return { ticks, };
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
console.error(`${lc} ${error.message}`);
|
|
65
|
+
throw error;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=display-helper.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"display-helper.mjs","sourceRoot":"","sources":["../../../src/common/display/display-helper.mts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAEH,YAAY;AACZ,gDAAgD;EACnD,MAAM,qBAAqB,CAAC;AAG7B,MAAM,OAAO,GAAG,gBAAgB,IAAI,KAAK,CAAC;AAG1C,MAAM,UAAU,mBAAmB,CAAC,EAChC,IAAI,GAGP;IACG,MAAM,EAAE,GAAG,IAAI,mBAAmB,CAAC,IAAI,GAAG,CAAC;IAC3C,IAAI;QACA,IAAI,OAAO,EAAE;YAAE,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;SAAE;QAClD,IAAI,CAAC,IAAI,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,4DAA4D,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CAAC,EAC3B,SAAS,GAGZ;IAGG,MAAM,EAAE,GAAG,IAAI,cAAc,CAAC,IAAI,GAAG,CAAC;IACtC,IAAI;QACA,IAAI,CAAC,SAAS,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;SAAE;QAEhG,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAE3C,OAAO,EAAE,KAAK,GAAG,CAAC;KACrB;IAAC,OAAO,KAAK,EAAE;QACZ,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QACxC,MAAM,KAAK,CAAC;KACf;AACL,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { IbGibData_V1, IbGibRel8ns_V1, IbGib_V1 } from '@ibgib/ts-gib/dist/V1/index.mjs';
|
|
2
|
+
export type SortStrategy = 'data_path';
|
|
3
|
+
export declare const SortStrategy: {
|
|
4
|
+
/**
|
|
5
|
+
* sorts targeting a specific path in the ibgib.data object.
|
|
6
|
+
*
|
|
7
|
+
* So if you want to sort by comment text, then the path will
|
|
8
|
+
* be `'text'`. If you want to sort by date, then `'timestamp'`.
|
|
9
|
+
*/
|
|
10
|
+
data_path: "data_path";
|
|
11
|
+
};
|
|
12
|
+
export type SortDirection = 'ascending' | 'descending' | 'forward' | 'reverse';
|
|
13
|
+
export declare const SortDirection: {
|
|
14
|
+
/**
|
|
15
|
+
* In an ordered list, we will sort starting with the least and going to the
|
|
16
|
+
* greatest.
|
|
17
|
+
*/
|
|
18
|
+
ascending: SortDirection;
|
|
19
|
+
/**
|
|
20
|
+
* In an ordered list, we will sort starting with the highest/greatest and
|
|
21
|
+
* go to the lowest/least.
|
|
22
|
+
*/
|
|
23
|
+
descending: SortDirection;
|
|
24
|
+
/**
|
|
25
|
+
* Often the same as ascending, but depends on context.
|
|
26
|
+
*
|
|
27
|
+
* For example, there may be a non-ascending existing order and we are
|
|
28
|
+
* speaking relative to this.
|
|
29
|
+
*/
|
|
30
|
+
forward: SortDirection;
|
|
31
|
+
/**
|
|
32
|
+
* Often the same as descending, but depends on context.
|
|
33
|
+
*
|
|
34
|
+
* For example, there may be a non-ordered existing list and we are speaking
|
|
35
|
+
* relative to this.
|
|
36
|
+
*/
|
|
37
|
+
reverse: SortDirection;
|
|
38
|
+
};
|
|
39
|
+
export type FilterType = 'keyword' | 'time';
|
|
40
|
+
export interface FilterInfo {
|
|
41
|
+
filterType: FilterType;
|
|
42
|
+
/**
|
|
43
|
+
* if provided, uses custom data path(s) into the ibgib.data object to
|
|
44
|
+
* filter against.
|
|
45
|
+
*
|
|
46
|
+
* If not provided, this defaults to whatever makes sense for the ibgib. For
|
|
47
|
+
* example, a comment or link ibgib will default to the 'text' path. A pic
|
|
48
|
+
* will look in filename, extension, and maybe some others that I haven't
|
|
49
|
+
* implemented yet.
|
|
50
|
+
*/
|
|
51
|
+
dataPaths?: string[];
|
|
52
|
+
/**
|
|
53
|
+
* self explanatory
|
|
54
|
+
*/
|
|
55
|
+
caseSensitive?: boolean;
|
|
56
|
+
hasAllKeywords?: string[];
|
|
57
|
+
hasNoneKeywords?: string[];
|
|
58
|
+
hasAnyKeywords?: string[];
|
|
59
|
+
/**
|
|
60
|
+
* If filterType is 'time', then this is the earliest date/time.
|
|
61
|
+
* If it's 'keyword', then this is lower bound by character. (may not implement at first)
|
|
62
|
+
*/
|
|
63
|
+
startBound?: string;
|
|
64
|
+
endBound?: string;
|
|
65
|
+
startBoundInclusive?: boolean;
|
|
66
|
+
endBoundInclusive?: boolean;
|
|
67
|
+
}
|
|
68
|
+
export interface SortInfo {
|
|
69
|
+
/**
|
|
70
|
+
* How we're approaching the sort.
|
|
71
|
+
*
|
|
72
|
+
* ATOW this is just 'data_path'
|
|
73
|
+
*/
|
|
74
|
+
strategy: SortStrategy;
|
|
75
|
+
/**
|
|
76
|
+
* If supplied, then this will dictate how the sort ordered.
|
|
77
|
+
*/
|
|
78
|
+
direction?: SortDirection;
|
|
79
|
+
/**
|
|
80
|
+
* If the `strategy` is 'data_path', then this is the value of
|
|
81
|
+
* the data_path.
|
|
82
|
+
*
|
|
83
|
+
* @example 'text' if sorting by comment text
|
|
84
|
+
*/
|
|
85
|
+
value: string;
|
|
86
|
+
}
|
|
87
|
+
export interface DisplayData_V1 extends IbGibData_V1 {
|
|
88
|
+
ticks: string;
|
|
89
|
+
filters?: FilterInfo[];
|
|
90
|
+
sorts?: SortInfo[];
|
|
91
|
+
}
|
|
92
|
+
export interface DisplayRel8ns_V1 extends IbGibRel8ns_V1 {
|
|
93
|
+
}
|
|
94
|
+
export interface DisplayIbGib_V1 extends IbGib_V1<DisplayData_V1, DisplayRel8ns_V1> {
|
|
95
|
+
}
|
|
96
|
+
export declare const DISPLAY_ATOM = "display";
|
|
97
|
+
//# sourceMappingURL=display-types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"display-types.d.mts","sourceRoot":"","sources":["../../../src/common/display/display-types.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAEzF,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC;AACvC,eAAO,MAAM,YAAY;IACrB;;;;;OAKG;;CAEN,CAAA;AAED,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,YAAY,GAAG,SAAS,GAAG,SAAS,CAAC;AAC/E,eAAO,MAAM,aAAa;IAEtB;;;OAGG;;IAEH;;;OAGG;;IAEH;;;;;OAKG;;IAEH;;;;;OAKG;;CAEN,CAAA;AACD,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;AAE5C,MAAM,WAAW,UAAU;IACvB,UAAU,EAAE,UAAU,CAAC;IACvB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IAErB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,QAAQ;IACrB;;;;OAIG;IACH,QAAQ,EAAE,YAAY,CAAC;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B;;;;;OAKG;IACH,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAe,SAAQ,YAAY;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;CACtB;AACD,MAAM,WAAW,gBAAiB,SAAQ,cAAc;CAEvD;AAED,MAAM,WAAW,eAAgB,SAAQ,QAAQ,CAAC,cAAc,EAAE,gBAAgB,CAAC;CAElF;AAED,eAAO,MAAM,YAAY,YAAY,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export const SortStrategy = {
|
|
2
|
+
/**
|
|
3
|
+
* sorts targeting a specific path in the ibgib.data object.
|
|
4
|
+
*
|
|
5
|
+
* So if you want to sort by comment text, then the path will
|
|
6
|
+
* be `'text'`. If you want to sort by date, then `'timestamp'`.
|
|
7
|
+
*/
|
|
8
|
+
data_path: "data_path",
|
|
9
|
+
};
|
|
10
|
+
export const SortDirection = {
|
|
11
|
+
/**
|
|
12
|
+
* In an ordered list, we will sort starting with the least and going to the
|
|
13
|
+
* greatest.
|
|
14
|
+
*/
|
|
15
|
+
ascending: 'ascending',
|
|
16
|
+
/**
|
|
17
|
+
* In an ordered list, we will sort starting with the highest/greatest and
|
|
18
|
+
* go to the lowest/least.
|
|
19
|
+
*/
|
|
20
|
+
descending: 'descending',
|
|
21
|
+
/**
|
|
22
|
+
* Often the same as ascending, but depends on context.
|
|
23
|
+
*
|
|
24
|
+
* For example, there may be a non-ascending existing order and we are
|
|
25
|
+
* speaking relative to this.
|
|
26
|
+
*/
|
|
27
|
+
forward: 'forward',
|
|
28
|
+
/**
|
|
29
|
+
* Often the same as descending, but depends on context.
|
|
30
|
+
*
|
|
31
|
+
* For example, there may be a non-ordered existing list and we are speaking
|
|
32
|
+
* relative to this.
|
|
33
|
+
*/
|
|
34
|
+
reverse: 'reverse',
|
|
35
|
+
};
|
|
36
|
+
export const DISPLAY_ATOM = 'display';
|
|
37
|
+
//# sourceMappingURL=display-types.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"display-types.mjs","sourceRoot":"","sources":["../../../src/common/display/display-types.mts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,YAAY,GAAG;IACxB;;;;;OAKG;IACH,SAAS,EAAE,WAA2B;CACzC,CAAA;AAGD,MAAM,CAAC,MAAM,aAAa,GAC1B;IACI;;;OAGG;IACH,SAAS,EAAE,WAA4B;IACvC;;;OAGG;IACH,UAAU,EAAE,YAA6B;IACzC;;;;;OAKG;IACH,OAAO,EAAE,SAA0B;IACnC;;;;;OAKG;IACH,OAAO,EAAE,SAA0B;CACtC,CAAA;AAmED,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SaltStrategy } from '@ibgib/encrypt-gib/dist/index.mjs';
|
|
2
|
+
export declare const DEFAULT_ENCRYPTION_INITIAL_RECURSIONS = 50000;
|
|
3
|
+
export declare const MIN_ENCRYPTION_INITIAL_RECURSIONS = 1000;
|
|
4
|
+
export declare const MAX_ENCRYPTION_INITIAL_RECURSIONS = 10000000;
|
|
5
|
+
export declare const MIN_ENCRYPTION_RECURSIONS_PER_HASH = 1;
|
|
6
|
+
export declare const MAX_ENCRYPTION_RECURSIONS_PER_HASH = 1000;
|
|
7
|
+
export declare const MIN_ENCRYPTION_SALT_LENGTH = 50;
|
|
8
|
+
export declare const MAX_ENCRYPTION_SALT_LENGTH = 99999;
|
|
9
|
+
export declare const MIN_ENCRYPTION_PASSWORD_LENGTH = 8;
|
|
10
|
+
export declare const MAX_ENCRYPTION_PASSWORD_LENGTH = 9999999;
|
|
11
|
+
export declare const DEFAULT_ENCRYPTION_SALT_STRATEGY: SaltStrategy;
|
|
12
|
+
export declare const DEFAULT_ENCRYPTION_RECURSIONS_PER_HASH = 10;
|
|
13
|
+
export declare const DEFAULT_ENCRYPTION_HASH_ALGORITHM = "SHA-256";
|
|
14
|
+
/**
|
|
15
|
+
* A secrets ibgib uses this rel8n name for its children secrets.
|
|
16
|
+
*/
|
|
17
|
+
export declare const SECRET_REL8N_NAME = "secret";
|
|
18
|
+
/**
|
|
19
|
+
* An encryptions ibgib uses this rel8n name for its children encryptions.
|
|
20
|
+
*/
|
|
21
|
+
export declare const ENCRYPTION_REL8N_NAME = "encryption";
|
|
22
|
+
/**
|
|
23
|
+
* Related encrypted ciphertext ibgibs will use this rel8n name.
|
|
24
|
+
* Those ciphertext ibgibs will then relate to the encryption used.
|
|
25
|
+
*/
|
|
26
|
+
export declare const CIPHERTEXT_REL8N_NAME = "ciphertext";
|
|
27
|
+
//# sourceMappingURL=encrypt-constants.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encrypt-constants.d.mts","sourceRoot":"","sources":["../../../src/common/encrypt/encrypt-constants.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEjE,eAAO,MAAM,qCAAqC,QAAQ,CAAC;AAC3D,eAAO,MAAM,iCAAiC,OAAO,CAAC;AACtD,eAAO,MAAM,iCAAiC,WAAW,CAAC;AAC1D,eAAO,MAAM,kCAAkC,IAAI,CAAC;AACpD,eAAO,MAAM,kCAAkC,OAAO,CAAC;AACvD,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAC7C,eAAO,MAAM,0BAA0B,QAAQ,CAAC;AAChD,eAAO,MAAM,8BAA8B,IAAI,CAAC;AAChD,eAAO,MAAM,8BAA8B,UAAU,CAAC;AACtD,eAAO,MAAM,gCAAgC,EAAE,YAAyC,CAAC;AACzF,eAAO,MAAM,sCAAsC,KAAK,CAAC;AACzD,eAAO,MAAM,iCAAiC,YAAY,CAAC;AAE3D;;GAEG;AACH,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAC1C;;GAEG;AACH,eAAO,MAAM,qBAAqB,eAAe,CAAC;AAClD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,eAAe,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SaltStrategy } from '@ibgib/encrypt-gib/dist/index.mjs';
|
|
2
|
+
export const DEFAULT_ENCRYPTION_INITIAL_RECURSIONS = 50000;
|
|
3
|
+
export const MIN_ENCRYPTION_INITIAL_RECURSIONS = 1000;
|
|
4
|
+
export const MAX_ENCRYPTION_INITIAL_RECURSIONS = 10000000;
|
|
5
|
+
export const MIN_ENCRYPTION_RECURSIONS_PER_HASH = 1;
|
|
6
|
+
export const MAX_ENCRYPTION_RECURSIONS_PER_HASH = 1000;
|
|
7
|
+
export const MIN_ENCRYPTION_SALT_LENGTH = 50;
|
|
8
|
+
export const MAX_ENCRYPTION_SALT_LENGTH = 99999;
|
|
9
|
+
export const MIN_ENCRYPTION_PASSWORD_LENGTH = 8;
|
|
10
|
+
export const MAX_ENCRYPTION_PASSWORD_LENGTH = 9999999;
|
|
11
|
+
export const DEFAULT_ENCRYPTION_SALT_STRATEGY = SaltStrategy.appendPerHash;
|
|
12
|
+
export const DEFAULT_ENCRYPTION_RECURSIONS_PER_HASH = 10;
|
|
13
|
+
export const DEFAULT_ENCRYPTION_HASH_ALGORITHM = 'SHA-256';
|
|
14
|
+
/**
|
|
15
|
+
* A secrets ibgib uses this rel8n name for its children secrets.
|
|
16
|
+
*/
|
|
17
|
+
export const SECRET_REL8N_NAME = 'secret';
|
|
18
|
+
/**
|
|
19
|
+
* An encryptions ibgib uses this rel8n name for its children encryptions.
|
|
20
|
+
*/
|
|
21
|
+
export const ENCRYPTION_REL8N_NAME = 'encryption';
|
|
22
|
+
/**
|
|
23
|
+
* Related encrypted ciphertext ibgibs will use this rel8n name.
|
|
24
|
+
* Those ciphertext ibgibs will then relate to the encryption used.
|
|
25
|
+
*/
|
|
26
|
+
export const CIPHERTEXT_REL8N_NAME = 'ciphertext';
|
|
27
|
+
//# sourceMappingURL=encrypt-constants.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encrypt-constants.mjs","sourceRoot":"","sources":["../../../src/common/encrypt/encrypt-constants.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEjE,MAAM,CAAC,MAAM,qCAAqC,GAAG,KAAK,CAAC;AAC3D,MAAM,CAAC,MAAM,iCAAiC,GAAG,IAAI,CAAC;AACtD,MAAM,CAAC,MAAM,iCAAiC,GAAG,QAAQ,CAAC;AAC1D,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC;AACpD,MAAM,CAAC,MAAM,kCAAkC,GAAG,IAAI,CAAC;AACvD,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAC7C,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,CAAC;AAChD,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC;AAChD,MAAM,CAAC,MAAM,8BAA8B,GAAG,OAAO,CAAC;AACtD,MAAM,CAAC,MAAM,gCAAgC,GAAiB,YAAY,CAAC,aAAa,CAAC;AACzF,MAAM,CAAC,MAAM,sCAAsC,GAAG,EAAE,CAAC;AACzD,MAAM,CAAC,MAAM,iCAAiC,GAAG,SAAS,CAAC;AAE3D;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AAC1C;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,YAAY,CAAC;AAClD;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,YAAY,CAAC"}
|