@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,322 @@
|
|
|
1
|
+
import { UUID_REGEXP, getTimestampInTicks, pretty } from '@ibgib/helper-gib';
|
|
2
|
+
import { Gib, Ib, } from '@ibgib/ts-gib';
|
|
3
|
+
import { validateIbGibIntrinsically } from '@ibgib/ts-gib/dist/V1/validate-helper.mjs';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
import { APP_NAME_REGEXP, APP_REL8N_NAME, GLOBAL_LOG_A_LOT } from '../../core-constants.mjs';
|
|
7
|
+
import { AppData_V1, } from './app-types.mjs';
|
|
8
|
+
import { IbGibAppAny } from './app-base-v1.mjs';
|
|
9
|
+
// import { CommonService } from '../../services/common.service.mjs';
|
|
10
|
+
// import { getFn_promptAppIbGib } from './prompt-functions.mjs';
|
|
11
|
+
import { IbGibSpaceAny } from '../space/space-base-v1.mjs';
|
|
12
|
+
import { WitnessFormBuilder } from '../witness-form-builder.mjs';
|
|
13
|
+
// import { persistTransformResult, registerNewIbGib, rel8ToSpecialIbGib } from './space.mjs';
|
|
14
|
+
import { IbGib_V1 } from '@ibgib/ts-gib/dist/V1/index.mjs';
|
|
15
|
+
import { IbGibLocalSpaceService_AllPowerful } from '../../core-types.mjs';
|
|
16
|
+
import { IbGibTimelineUpdateInfo } from '../../common/other/other-types.mjs';
|
|
17
|
+
import { persistTransformResult, registerNewIbGib, rel8ToSpecialIbGib } from '../space/space-helper.mjs';
|
|
18
|
+
|
|
19
|
+
const logalot = GLOBAL_LOG_A_LOT || false;
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
export function getAppResultMetadata({ app }: { app: IbGibAppAny }): string {
|
|
23
|
+
return `${app.ib} ${getTimestampInTicks()}`;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function validateCommonAppData({
|
|
27
|
+
appData,
|
|
28
|
+
}: {
|
|
29
|
+
appData: AppData_V1 | undefined,
|
|
30
|
+
}): string[] {
|
|
31
|
+
const lc = `[${validateCommonAppData.name}]`;
|
|
32
|
+
try {
|
|
33
|
+
if (logalot) { console.log(`${lc} starting...`); }
|
|
34
|
+
if (!appData) { throw new Error(`appData required (E: 3df782b29bc4406a87e4895cfcea28ed)`); }
|
|
35
|
+
const errors: string[] = [];
|
|
36
|
+
const {
|
|
37
|
+
name, uuid, classname,
|
|
38
|
+
} =
|
|
39
|
+
appData;
|
|
40
|
+
|
|
41
|
+
if (name) {
|
|
42
|
+
if (!name.match(APP_NAME_REGEXP)) {
|
|
43
|
+
errors.push(`name must match regexp: ${APP_NAME_REGEXP}`);
|
|
44
|
+
}
|
|
45
|
+
} else {
|
|
46
|
+
errors.push(`name required.`);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (uuid) {
|
|
50
|
+
if (!uuid.match(UUID_REGEXP)) {
|
|
51
|
+
errors.push(`uuid must match regexp: ${UUID_REGEXP}`);
|
|
52
|
+
}
|
|
53
|
+
} else {
|
|
54
|
+
errors.push(`uuid required.`);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (classname) {
|
|
58
|
+
if (!classname.match(APP_NAME_REGEXP)) {
|
|
59
|
+
errors.push(`classname must match regexp: ${APP_NAME_REGEXP}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return errors;
|
|
64
|
+
} catch (error) {
|
|
65
|
+
console.error(`${lc} ${error.message}`);
|
|
66
|
+
throw error;
|
|
67
|
+
} finally {
|
|
68
|
+
if (logalot) { console.log(`${lc} complete.`); }
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function getAppIb({
|
|
73
|
+
appData,
|
|
74
|
+
classname,
|
|
75
|
+
}: {
|
|
76
|
+
appData: AppData_V1,
|
|
77
|
+
classname?: string,
|
|
78
|
+
}): Ib {
|
|
79
|
+
const lc = `[${getAppIb.name}]`;
|
|
80
|
+
try {
|
|
81
|
+
const validationErrors = validateCommonAppData({ appData });
|
|
82
|
+
if (validationErrors.length > 0) { throw new Error(`invalid appData: ${validationErrors} (E: 9aff04f0cfc54a5188ca8bc40764160d)`); }
|
|
83
|
+
if (classname) {
|
|
84
|
+
if (appData.classname && appData.classname !== classname) { throw new Error(`classname does not match appData.classname (E: 66f1447eef97485fba521c40980f5eb5)`); }
|
|
85
|
+
} else {
|
|
86
|
+
classname = appData.classname;
|
|
87
|
+
if (!classname) { throw new Error(`classname required (E: 5f6ffb4317044125b94f662070e1f40b)`); }
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const { name, uuid } = appData;
|
|
91
|
+
return `app ${classname} ${name} ${uuid}`;
|
|
92
|
+
} catch (error) {
|
|
93
|
+
console.error(`${lc} ${error.message}`);
|
|
94
|
+
throw error;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Current schema is `app ${classname} ${name} ${uuid}`
|
|
100
|
+
*
|
|
101
|
+
* NOTE this is space-delimited
|
|
102
|
+
*/
|
|
103
|
+
export function getInfoFromAppIb({
|
|
104
|
+
appIb,
|
|
105
|
+
}: {
|
|
106
|
+
appIb: Ib,
|
|
107
|
+
}): {
|
|
108
|
+
appClassname: string,
|
|
109
|
+
appName: string,
|
|
110
|
+
appId: string,
|
|
111
|
+
} {
|
|
112
|
+
const lc = `[${getInfoFromAppIb.name}]`;
|
|
113
|
+
try {
|
|
114
|
+
if (!appIb) { throw new Error(`appIb required (E: 6b065aee67e641ba9f9c6db367ebb0fb)`); }
|
|
115
|
+
|
|
116
|
+
const pieces = appIb.split(' ');
|
|
117
|
+
|
|
118
|
+
return {
|
|
119
|
+
appClassname: pieces[1],
|
|
120
|
+
appName: pieces[2],
|
|
121
|
+
appId: pieces[3],
|
|
122
|
+
};
|
|
123
|
+
} catch (error) {
|
|
124
|
+
console.error(`${lc} ${error.message}`);
|
|
125
|
+
throw error;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export function getAppInfoIb({
|
|
130
|
+
appData,
|
|
131
|
+
appTjpGib,
|
|
132
|
+
classname,
|
|
133
|
+
}: {
|
|
134
|
+
appData: AppData_V1,
|
|
135
|
+
appTjpGib: Gib,
|
|
136
|
+
/**
|
|
137
|
+
* Not sure why i have this here, since it should always be in the appData.classname...
|
|
138
|
+
*/
|
|
139
|
+
classname?: string,
|
|
140
|
+
}): Ib {
|
|
141
|
+
const lc = `[${getAppIb.name}]`;
|
|
142
|
+
try {
|
|
143
|
+
const validationErrors = validateCommonAppData({ appData });
|
|
144
|
+
if (validationErrors.length > 0) { throw new Error(`invalid appData: ${validationErrors} (E: 7be1f54ce8af4e4982966b2dedb4cf6e)`); }
|
|
145
|
+
if (classname) {
|
|
146
|
+
if (appData.classname && appData.classname !== classname) { throw new Error(`classname does not match appData.classname (E: 64bd9eaef1f94be8856e18b791d4ae52)`); }
|
|
147
|
+
} else {
|
|
148
|
+
classname = appData.classname;
|
|
149
|
+
if (!classname) { throw new Error(`classname required (E: 8d194cf8fb3f4c8eb2f708e0ccfe187c)`); }
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const { name, uuid } = appData;
|
|
153
|
+
return `info_app ${classname} ${name} ${uuid} ${appTjpGib ?? 0}`;
|
|
154
|
+
} catch (error) {
|
|
155
|
+
console.error(`${lc} ${error.message}`);
|
|
156
|
+
throw error;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Current schema is `info_app ${classname} ${name} ${uuid} ${appTjpGib ?? 0}`
|
|
162
|
+
*
|
|
163
|
+
* NOTE this is space-delimited
|
|
164
|
+
*/
|
|
165
|
+
export function getInfoFromAppInfoIb({
|
|
166
|
+
appInfoIb,
|
|
167
|
+
}: {
|
|
168
|
+
appInfoIb: Ib,
|
|
169
|
+
}): {
|
|
170
|
+
appClassname: string;
|
|
171
|
+
appName: string;
|
|
172
|
+
appId: string;
|
|
173
|
+
appTjpGib: Gib;
|
|
174
|
+
} {
|
|
175
|
+
const lc = `[${getInfoFromAppIb.name}]`;
|
|
176
|
+
try {
|
|
177
|
+
if (!appInfoIb) { throw new Error(`appInfoIb required (E: d12756f218144d22acb14c794dd3eeef)`); }
|
|
178
|
+
|
|
179
|
+
const pieces = appInfoIb.split(' ');
|
|
180
|
+
|
|
181
|
+
if (pieces.length !== 5) { throw new Error(`invalid appInfoIb. Expected space-delimited pieces.length === 5 (E: 21bfc58e4d88c298680ea95bc6dfc622)`); }
|
|
182
|
+
|
|
183
|
+
return {
|
|
184
|
+
appClassname: pieces[1],
|
|
185
|
+
appName: pieces[2],
|
|
186
|
+
appId: pieces[3],
|
|
187
|
+
appTjpGib: pieces[4],
|
|
188
|
+
};
|
|
189
|
+
} catch (error) {
|
|
190
|
+
console.error(`${lc} ${error.message}`);
|
|
191
|
+
throw error;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Prompts the user a form to build the app.
|
|
198
|
+
*
|
|
199
|
+
* Once prompted, the app is:
|
|
200
|
+
* 1. validated
|
|
201
|
+
* 2. persisted in the given {@link space}
|
|
202
|
+
* 3. registered with the space
|
|
203
|
+
* 4. related to the space's special apps index
|
|
204
|
+
* 5. new app is returned
|
|
205
|
+
*
|
|
206
|
+
* @returns newly created app ibgib (witness)
|
|
207
|
+
*/
|
|
208
|
+
export async function createNewApp({
|
|
209
|
+
ibgibs,
|
|
210
|
+
space,
|
|
211
|
+
}: {
|
|
212
|
+
/**
|
|
213
|
+
* Either {@link common} or {@link ibgibs} is required
|
|
214
|
+
* @hack
|
|
215
|
+
*/
|
|
216
|
+
ibgibs?: IbGibLocalSpaceService_AllPowerful,
|
|
217
|
+
/**
|
|
218
|
+
* space within which to create the app. if not provided, the
|
|
219
|
+
* defaults to the local user space via {@link common} or {@link ibgibs}.
|
|
220
|
+
*/
|
|
221
|
+
space: IbGibSpaceAny,
|
|
222
|
+
}): Promise<IbGibAppAny | undefined> {
|
|
223
|
+
const lc = `[${createNewApp.name}]`;
|
|
224
|
+
try {
|
|
225
|
+
if (logalot) { console.log(`${lc} starting...`); }
|
|
226
|
+
|
|
227
|
+
if (!ibgibs) { throw new Error(`ibgibs all powerful service required. (E: b24e78de0d204dc78909022bee296b30)`); }
|
|
228
|
+
|
|
229
|
+
space = space ?? await ibgibs.getLocalUserSpace({ lock: true });
|
|
230
|
+
|
|
231
|
+
// prompt user to create the ibgib, passing in null because we're
|
|
232
|
+
// creating not editing.
|
|
233
|
+
let resApp = await ibgibs.fnPromptApp(space, /*ibGib*/ null);
|
|
234
|
+
|
|
235
|
+
if (!resApp) { throw new Error(`resApp falsy after prompt for app. (E: 2225a567abcd680a5e957e81fbb64123)`); }
|
|
236
|
+
|
|
237
|
+
/** this should be the witness class itself at this point. */
|
|
238
|
+
const newApp = (resApp.newIbGib as IbGibAppAny);
|
|
239
|
+
|
|
240
|
+
let allIbGibs: IbGib_V1[] = [];
|
|
241
|
+
allIbGibs.push(newApp);
|
|
242
|
+
resApp.intermediateIbGibs?.forEach((x: IbGib_V1) => allIbGibs.push(x));
|
|
243
|
+
resApp.dnas?.forEach((x: IbGib_V1) => allIbGibs.push(x));
|
|
244
|
+
for (let i = 0; i < allIbGibs.length; i++) {
|
|
245
|
+
const ibGib = allIbGibs[i];
|
|
246
|
+
const validationErrors = await validateIbGibIntrinsically({ ibGib });
|
|
247
|
+
if ((validationErrors ?? []).length > 0) { throw new Error(`(UNEXPECTED) invalid app ibgib created. validationErrors: ${validationErrors}. app: ${pretty(newApp.toIbGibDto())} (E: 54cfc2f6bc284ed79be91d2da5e4bd2f)`); }
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
await persistTransformResult({ resTransform: resApp, isMeta: true, space });
|
|
251
|
+
const { zeroSpace, fnBroadcast, fnUpdateBootstrap } = ibgibs;
|
|
252
|
+
await registerNewIbGib({
|
|
253
|
+
ibGib: newApp,
|
|
254
|
+
space,
|
|
255
|
+
zeroSpace,
|
|
256
|
+
fnBroadcast: (x: IbGibTimelineUpdateInfo) => fnBroadcast(x),
|
|
257
|
+
fnUpdateBootstrap: (x: IbGibSpaceAny) => fnUpdateBootstrap(x),
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
await rel8ToSpecialIbGib({
|
|
261
|
+
type: "apps",
|
|
262
|
+
rel8nName: APP_REL8N_NAME,
|
|
263
|
+
ibGibsToRel8: [newApp],
|
|
264
|
+
space,
|
|
265
|
+
zeroSpace,
|
|
266
|
+
fnUpdateBootstrap,
|
|
267
|
+
fnBroadcast,
|
|
268
|
+
});
|
|
269
|
+
return newApp;
|
|
270
|
+
} catch (error) {
|
|
271
|
+
debugger;
|
|
272
|
+
console.error(`${lc} ${error.message}`);
|
|
273
|
+
return;
|
|
274
|
+
} finally {
|
|
275
|
+
if (logalot) { console.log(`${lc} complete.`); }
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export class AppFormBuilder extends WitnessFormBuilder {
|
|
280
|
+
protected lc: string = `${super.lc}[${AppFormBuilder.name}]`;
|
|
281
|
+
|
|
282
|
+
constructor() {
|
|
283
|
+
super();
|
|
284
|
+
this.what = 'app';
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
icon({
|
|
288
|
+
of,
|
|
289
|
+
required,
|
|
290
|
+
defaultValue,
|
|
291
|
+
iconsList,
|
|
292
|
+
}: {
|
|
293
|
+
of: string,
|
|
294
|
+
required?: boolean,
|
|
295
|
+
defaultValue?: string,
|
|
296
|
+
iconsList: string[],
|
|
297
|
+
}): AppFormBuilder {
|
|
298
|
+
// const exampleIonicons = IONICONS.slice(0, 4).map(x => `"${x}"`).join(', ');
|
|
299
|
+
const exampleIonicons = iconsList.slice(0, 4).map(x => `"${x}"`).join(', ');
|
|
300
|
+
this.addItem({
|
|
301
|
+
// witness.data.outputPrefix
|
|
302
|
+
name: "icon",
|
|
303
|
+
description: `Icon name for the app's icon in the app bar. (NOTE: Only ionicons right now, e.g. ${exampleIonicons}). See https://ionic.io/ionicons for a full list.`,
|
|
304
|
+
label: "Icon",
|
|
305
|
+
fnValid: (x: string | number) => { return typeof x === 'string' && iconsList.includes(x); },
|
|
306
|
+
defaultErrorMsg: `Must be a valid icon from the icons list.`,
|
|
307
|
+
dataType: 'select',
|
|
308
|
+
value: of,
|
|
309
|
+
defaultValue: defaultValue || 'beer',
|
|
310
|
+
selectOptions: [
|
|
311
|
+
...iconsList,
|
|
312
|
+
],
|
|
313
|
+
required,
|
|
314
|
+
});
|
|
315
|
+
return this;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export function documentLocationIsAtWelcomePage(): boolean {
|
|
321
|
+
return ['welcome', '/welcome', '/welcome/'].includes(document.location.pathname);
|
|
322
|
+
}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { IbGibAddr, TransformResult } from '@ibgib/ts-gib';
|
|
2
|
+
import { IbGibRel8ns_V1, IbGib_V1 } from '@ibgib/ts-gib/dist/V1/index.mjs';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
// import { IonicSpaceData_V1 } from '../witnesses/spaces/ionic-space-v1';
|
|
6
|
+
import {
|
|
7
|
+
WitnessData_V1, WitnessRel8ns_V1,
|
|
8
|
+
WitnessCmdData, WitnessCmdRel8ns, WitnessCmdIbGib,
|
|
9
|
+
WitnessResultData, WitnessResultRel8ns, WitnessResultIbGib,
|
|
10
|
+
} from '../witness-types.mjs';
|
|
11
|
+
import { IbGibSpaceData_Subpathed } from '../space/space-types.mjs';
|
|
12
|
+
import { IbGibAppAny } from './app-base-v1.mjs';
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* ...hmm...?
|
|
18
|
+
*
|
|
19
|
+
* This originally descends from IonicSpaceData_V1. I need to figure out what
|
|
20
|
+
* this is doing, because this shouldn't be scoped to even subpathed strategy.
|
|
21
|
+
* That is entirely an implementation decision.
|
|
22
|
+
*/
|
|
23
|
+
export interface AppSpaceData extends IbGibSpaceData_Subpathed { }
|
|
24
|
+
|
|
25
|
+
export enum AppSpaceRel8n {
|
|
26
|
+
roots = 'roots',
|
|
27
|
+
tags = 'tags',
|
|
28
|
+
latest = 'latest',
|
|
29
|
+
outerspaces = 'outerspaces',
|
|
30
|
+
secrets = "secrets",
|
|
31
|
+
encryptions = "encryptions",
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface AppSpaceRel8ns extends IbGibRel8ns_V1 {
|
|
35
|
+
[AppSpaceRel8n.tags]?: IbGibAddr[];
|
|
36
|
+
[AppSpaceRel8n.roots]?: IbGibAddr[];
|
|
37
|
+
[AppSpaceRel8n.latest]?: IbGibAddr[];
|
|
38
|
+
[AppSpaceRel8n.outerspaces]?: IbGibAddr[];
|
|
39
|
+
[AppSpaceRel8n.secrets]?: IbGibAddr[];
|
|
40
|
+
[AppSpaceRel8n.encryptions]?: IbGibAddr[];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* An app space itself works as the config instead of
|
|
45
|
+
* having an external config object.
|
|
46
|
+
*
|
|
47
|
+
* ## notes
|
|
48
|
+
*
|
|
49
|
+
* Probably need to change this at some point...
|
|
50
|
+
*/
|
|
51
|
+
export interface ConfigIbGib_V1 extends IbGib_V1<AppSpaceData, AppSpaceRel8ns> { }
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
export interface AppData_V1 extends WitnessData_V1 {
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Name of a App instance...after all, Robbie was only the first App.
|
|
58
|
+
*/
|
|
59
|
+
name: string;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Redeclared over {@link WitnessData_V1.uuid} making it a required field.
|
|
63
|
+
*/
|
|
64
|
+
uuid: string;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Right now, this will be just for ionicons.
|
|
68
|
+
*/
|
|
69
|
+
icon: string;
|
|
70
|
+
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
export interface AppRel8ns_V1 extends WitnessRel8ns_V1 {
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
*/
|
|
79
|
+
export interface AppIbGib_V1 extends IbGib_V1<AppData_V1, AppRel8ns_V1> {
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Cmds for interacting with ibgib spaces.
|
|
84
|
+
*
|
|
85
|
+
* Not all of these will be implemented for every space.
|
|
86
|
+
*
|
|
87
|
+
* ## todo
|
|
88
|
+
*
|
|
89
|
+
* change these commands to better structure, e.g., verb/do/mod, can/get/addrs
|
|
90
|
+
* */
|
|
91
|
+
export type AppCmd =
|
|
92
|
+
'ib' | 'gib' | 'ibgib';
|
|
93
|
+
/** Cmds for interacting with ibgib spaces. */
|
|
94
|
+
export const AppCmd = {
|
|
95
|
+
/**
|
|
96
|
+
* it's more like a grunt that is intepreted by context from the app.
|
|
97
|
+
*
|
|
98
|
+
* my initial use of this will be to
|
|
99
|
+
* ...
|
|
100
|
+
*/
|
|
101
|
+
ib: 'ib' as AppCmd,
|
|
102
|
+
/**
|
|
103
|
+
* it's more like a grunt that is intepreted by context from the app.
|
|
104
|
+
*
|
|
105
|
+
* my initial use of this will be to indicate to a app ...
|
|
106
|
+
*/
|
|
107
|
+
gib: 'gib' as AppCmd,
|
|
108
|
+
/**
|
|
109
|
+
* third placeholder command.
|
|
110
|
+
*
|
|
111
|
+
* I imagine this will be like "what's up", but who knows.
|
|
112
|
+
*/
|
|
113
|
+
ibgib: 'ibgib' as AppCmd,
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Flags to affect the command's interpretation.
|
|
118
|
+
*/
|
|
119
|
+
export type AppCmdModifier =
|
|
120
|
+
'ib' | 'gib' | 'ibgib';
|
|
121
|
+
/**
|
|
122
|
+
* Flags to affect the command's interpretation.
|
|
123
|
+
*/
|
|
124
|
+
export const AppCmdModifier = {
|
|
125
|
+
/**
|
|
126
|
+
* hmm...
|
|
127
|
+
*/
|
|
128
|
+
ib: 'ib' as AppCmdModifier,
|
|
129
|
+
/**
|
|
130
|
+
* hmm...
|
|
131
|
+
*/
|
|
132
|
+
gib: 'gib' as AppCmdModifier,
|
|
133
|
+
/**
|
|
134
|
+
* hmm...
|
|
135
|
+
*/
|
|
136
|
+
ibgib: 'ibgib' as AppCmdModifier,
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** Information for interacting with spaces. */
|
|
140
|
+
export interface AppCmdData
|
|
141
|
+
extends WitnessCmdData<AppCmd, AppCmdModifier> {
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface AppCmdRel8ns extends WitnessCmdRel8ns {
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Shape of options ibgib if used for a app.
|
|
149
|
+
*
|
|
150
|
+
* I'm not sure what to do with this atm, so I'm just stubbing out...
|
|
151
|
+
*/
|
|
152
|
+
export interface AppCmdIbGib<
|
|
153
|
+
TIbGib extends IbGib_V1 = IbGib_V1,
|
|
154
|
+
TCmdData extends AppCmdData = AppCmdData,
|
|
155
|
+
TCmdRel8ns extends AppCmdRel8ns = AppCmdRel8ns,
|
|
156
|
+
> extends WitnessCmdIbGib<TIbGib, AppCmd, AppCmdModifier, TCmdData, TCmdRel8ns> {
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Optional shape of result data to app interactions.
|
|
161
|
+
*
|
|
162
|
+
* This is in addition of course to {@link WitnessResultData}.
|
|
163
|
+
*
|
|
164
|
+
* ## notes
|
|
165
|
+
*
|
|
166
|
+
* * I'm not sure what to do with this atm, so I'm just stubbing out...
|
|
167
|
+
*/
|
|
168
|
+
export interface AppResultData extends WitnessResultData {
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Marker interface rel8ns atm...
|
|
173
|
+
*
|
|
174
|
+
* I'm not sure what to do with this atm, so I'm just stubbing out...
|
|
175
|
+
*/
|
|
176
|
+
export interface AppResultRel8ns extends WitnessResultRel8ns { }
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Shape of result ibgib if used for a app.
|
|
180
|
+
*
|
|
181
|
+
* I'm not sure what to do with this atm, so I'm just stubbing out...
|
|
182
|
+
*/
|
|
183
|
+
export interface AppResultIbGib<
|
|
184
|
+
TIbGib extends IbGib_V1,
|
|
185
|
+
TResultData extends AppResultData,
|
|
186
|
+
TResultRel8ns extends AppResultRel8ns
|
|
187
|
+
>
|
|
188
|
+
extends WitnessResultIbGib<TIbGib, TResultData, TResultRel8ns> {
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* When coming from the extension in firefox/chrome(chromium), this info
|
|
193
|
+
* represents a selection to be converted/saved in an ibgib graph.
|
|
194
|
+
*/
|
|
195
|
+
export interface ExtensionSelectionInfo {
|
|
196
|
+
type: 'comment' | 'link';
|
|
197
|
+
text: string;
|
|
198
|
+
url?: string;
|
|
199
|
+
children?: ExtensionSelectionInfo[];
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* this is generated in background.js (WARNING! background.js atow is generated
|
|
204
|
+
* from background.v2.js or background.v3.js . ...do NOT make changes directly
|
|
205
|
+
* in background.js!).
|
|
206
|
+
*
|
|
207
|
+
* When the user is in their browser with the ibgib extension and selects some
|
|
208
|
+
* text or clicks an ibgib context menu item to initiate the app, this info is
|
|
209
|
+
* passed to the app via query params (atow).
|
|
210
|
+
*/
|
|
211
|
+
export interface ExtensionLaunchInfo {
|
|
212
|
+
/** brand the event so we know it's ours */
|
|
213
|
+
ib: boolean;
|
|
214
|
+
/**
|
|
215
|
+
* indicate to the receiving angular app that we're launching
|
|
216
|
+
* from an extension in firefox/chrome. (this is obvious here in
|
|
217
|
+
* background.js but in the angular app, not so much).
|
|
218
|
+
*/
|
|
219
|
+
isExtensionLaunch: boolean;
|
|
220
|
+
/**
|
|
221
|
+
* So consumer knows where this is coming from. (obvious to us
|
|
222
|
+
* here, but helps consumer)
|
|
223
|
+
*/
|
|
224
|
+
lc: string,
|
|
225
|
+
/**
|
|
226
|
+
* text of the context menu clicked
|
|
227
|
+
* @link https://developer.chrome.com/docs/extensions/reference/contextMenus/#type-OnClickData
|
|
228
|
+
*/
|
|
229
|
+
menuItemId: string;
|
|
230
|
+
/**
|
|
231
|
+
* url of the page that _initiates_ the click and starts the app.
|
|
232
|
+
* so if the user is on wikipedia.org, selects some text and clicks on the ibgib link,
|
|
233
|
+
* in order to generate some ibgib data based on the page, this will be
|
|
234
|
+
* https://en.wikipedia.org/wiki/Phanerozoic (or whatever).
|
|
235
|
+
*
|
|
236
|
+
* @link https://developer.chrome.com/docs/extensions/reference/contextMenus/#type-OnClickData
|
|
237
|
+
*/
|
|
238
|
+
pageUrl: string;
|
|
239
|
+
/**
|
|
240
|
+
* info about selections user made when starting the (extension) app.
|
|
241
|
+
*
|
|
242
|
+
* So if they highlight some text and add it, that is one info. If they highlight a whole paragraph
|
|
243
|
+
* it will create a comment for the p and possibly children infos for links in that paragraph.
|
|
244
|
+
*
|
|
245
|
+
* Same goes for if they select a header tag.
|
|
246
|
+
*
|
|
247
|
+
* @link https://developer.chrome.com/docs/extensions/reference/contextMenus/#type-OnClickData
|
|
248
|
+
*/
|
|
249
|
+
selectionInfos?: ExtensionSelectionInfo[];
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export type AppPromptResult = TransformResult<IbGibAppAny>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { AppData_V1, AppRel8ns_V1 } from '../app-types.mjs';
|
|
2
|
+
|
|
3
|
+
export const DEFAULT_UUID_CHAT_APP = '0';
|
|
4
|
+
export const DEFAULT_NAME_CHAT_APP = 'chat_gib';
|
|
5
|
+
export const DEFAULT_DESCRIPTION_CHAT_APP =
|
|
6
|
+
`A chat app done ibgib style, enabling infinitely nesting comments, pics and links. It's ibgibs all the way down...`;
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export interface ChatAppData_V1 extends AppData_V1 {
|
|
10
|
+
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
export interface ChatAppRel8ns_V1 extends AppRel8ns_V1 {
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Default data values for a random app.
|
|
20
|
+
*
|
|
21
|
+
* If you change this, please bump the version
|
|
22
|
+
*
|
|
23
|
+
* (but of course won't be the end of the world when this doesn't happen).
|
|
24
|
+
*/
|
|
25
|
+
export const DEFAULT_CHAT_APP_DATA_V1: ChatAppData_V1 = {
|
|
26
|
+
version: '1',
|
|
27
|
+
uuid: DEFAULT_UUID_CHAT_APP,
|
|
28
|
+
name: DEFAULT_NAME_CHAT_APP,
|
|
29
|
+
description: DEFAULT_DESCRIPTION_CHAT_APP,
|
|
30
|
+
// classname: ChatApp_V1.name,
|
|
31
|
+
classname: `ChatApp_V1`,
|
|
32
|
+
|
|
33
|
+
icon: 'chatbubbles',
|
|
34
|
+
|
|
35
|
+
persistOptsAndResultIbGibs: false,
|
|
36
|
+
allowPrimitiveArgs: true,
|
|
37
|
+
catchAllErrors: true,
|
|
38
|
+
trace: false,
|
|
39
|
+
}
|
|
40
|
+
export const DEFAULT_CHAT_APP_REL8NS_V1: ChatAppRel8ns_V1 | undefined = undefined;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { AppData_V1, AppRel8ns_V1 } from '../app-types.mjs';
|
|
2
|
+
|
|
3
|
+
export const DEFAULT_UUID_FLASH_APP = '0';
|
|
4
|
+
export const DEFAULT_NAME_FLASH_APP = 'flash_gib';
|
|
5
|
+
export const DEFAULT_DESCRIPTION_FLASH_APP =
|
|
6
|
+
`A flashcard app done ibgib style, where ibgib are the "cards" and are shown in various ways.`;
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export interface FlashAppData_V1 extends AppData_V1 {
|
|
10
|
+
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
export interface FlashAppRel8ns_V1 extends AppRel8ns_V1 {
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Default data values for a flash app.
|
|
20
|
+
*
|
|
21
|
+
* If you change this, please bump the version.
|
|
22
|
+
*/
|
|
23
|
+
export const DEFAULT_FLASH_APP_DATA_V1: FlashAppData_V1 = {
|
|
24
|
+
version: '1',
|
|
25
|
+
uuid: DEFAULT_UUID_FLASH_APP,
|
|
26
|
+
name: DEFAULT_NAME_FLASH_APP,
|
|
27
|
+
description: DEFAULT_DESCRIPTION_FLASH_APP,
|
|
28
|
+
// classname: FlashApp_V1.name,
|
|
29
|
+
classname: `FlashApp_V1`,
|
|
30
|
+
|
|
31
|
+
icon: 'flash',
|
|
32
|
+
|
|
33
|
+
persistOptsAndResultIbGibs: false,
|
|
34
|
+
allowPrimitiveArgs: true,
|
|
35
|
+
catchAllErrors: true,
|
|
36
|
+
trace: false,
|
|
37
|
+
}
|
|
38
|
+
export const DEFAULT_FLASH_APP_REL8NS_V1: FlashAppRel8ns_V1 | undefined = undefined;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { AppData_V1, AppRel8ns_V1 } from '../app-types.mjs';
|
|
2
|
+
|
|
3
|
+
export const DEFAULT_UUID_RAW_APP = '0';
|
|
4
|
+
export const DEFAULT_NAME_RAW_APP = 'raw_gib';
|
|
5
|
+
export const DEFAULT_DESCRIPTION_RAW_APP =
|
|
6
|
+
`Explorer app for navigating raw ibgib data.`;
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export interface RawAppData_V1 extends AppData_V1 {
|
|
10
|
+
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface RawAppRel8ns_V1 extends AppRel8ns_V1 {
|
|
14
|
+
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Default data values for a random app.
|
|
19
|
+
*
|
|
20
|
+
* If you change this, please bump the version
|
|
21
|
+
*
|
|
22
|
+
* (but of course won't be the end of the world when this doesn't happen).
|
|
23
|
+
*/
|
|
24
|
+
export const DEFAULT_RAW_APP_DATA_V1: RawAppData_V1 = {
|
|
25
|
+
version: '1',
|
|
26
|
+
uuid: DEFAULT_UUID_RAW_APP,
|
|
27
|
+
name: DEFAULT_NAME_RAW_APP,
|
|
28
|
+
description: DEFAULT_DESCRIPTION_RAW_APP,
|
|
29
|
+
// classname: RawApp_V1.name,
|
|
30
|
+
classname: `RawApp_V1`,
|
|
31
|
+
|
|
32
|
+
icon: 'paper-plane',
|
|
33
|
+
|
|
34
|
+
persistOptsAndResultIbGibs: false,
|
|
35
|
+
allowPrimitiveArgs: true,
|
|
36
|
+
catchAllErrors: true,
|
|
37
|
+
trace: false,
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const DEFAULT_RAW_APP_REL8NS_V1: RawAppRel8ns_V1 | undefined = undefined;
|