@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,414 @@
|
|
|
1
|
+
import { getIbGibAddr } from '@ibgib/ts-gib';
|
|
2
|
+
import { IbGib_V1 } from '@ibgib/ts-gib/dist/V1/index.mjs';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
import { WitnessBase_V1, } from '../witness-base-v1';
|
|
6
|
+
import {
|
|
7
|
+
IbGibSpace, IbGibSpaceData, IbGibSpaceOptionsCmd,
|
|
8
|
+
IbGibSpaceOptionsCmdModifier, IbGibSpaceOptionsData, IbGibSpaceOptionsIbGib,
|
|
9
|
+
IbGibSpaceOptionsRel8ns, IbGibSpaceRel8ns, IbGibSpaceResultData,
|
|
10
|
+
IbGibSpaceResultIbGib, IbGibSpaceResultRel8ns
|
|
11
|
+
} from '../../witness/space/space-types.mjs';
|
|
12
|
+
import { getSpaceResultMetadata } from '../../witness/space/space-helper.mjs';
|
|
13
|
+
import { validateIbGibIntrinsically } from '@ibgib/ts-gib/dist/V1/validate-helper.mjs';
|
|
14
|
+
// import { argy_, resulty_ } from '../witness-helper.mjs';
|
|
15
|
+
import { argy_, resulty_ } from '../../witness/witness-helper.mjs';
|
|
16
|
+
// import { IbGibCacheService } from '../../types/ibgib.mjs';
|
|
17
|
+
import { IbGibCacheService } from '../../common/cache/cache-types.mjs';
|
|
18
|
+
import { GLOBAL_LOG_A_LOT } from '../../core-constants.mjs';
|
|
19
|
+
|
|
20
|
+
const logalot = GLOBAL_LOG_A_LOT;
|
|
21
|
+
|
|
22
|
+
export interface IbGibSpaceAny
|
|
23
|
+
extends SpaceBase_V1<any, any, any, any, any, any, any> {
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export abstract class SpaceBase_V1<
|
|
27
|
+
TIbGib extends IbGib_V1 = IbGib_V1,
|
|
28
|
+
TOptionsData extends IbGibSpaceOptionsData = IbGibSpaceOptionsData,
|
|
29
|
+
TOptionsRel8ns extends IbGibSpaceOptionsRel8ns = IbGibSpaceOptionsRel8ns,
|
|
30
|
+
TOptionsIbGib extends IbGibSpaceOptionsIbGib<TIbGib, TOptionsData, TOptionsRel8ns>
|
|
31
|
+
= IbGibSpaceOptionsIbGib<TIbGib, TOptionsData, TOptionsRel8ns>,
|
|
32
|
+
TResultData extends IbGibSpaceResultData = IbGibSpaceResultData,
|
|
33
|
+
TResultRel8ns extends IbGibSpaceResultRel8ns = IbGibSpaceResultRel8ns,
|
|
34
|
+
TResultIbGib extends IbGibSpaceResultIbGib<TIbGib, TResultData, TResultRel8ns>
|
|
35
|
+
= IbGibSpaceResultIbGib<TIbGib, TResultData, TResultRel8ns>,
|
|
36
|
+
TData extends IbGibSpaceData = IbGibSpaceData,
|
|
37
|
+
TRel8ns extends IbGibSpaceRel8ns = IbGibSpaceRel8ns,
|
|
38
|
+
>
|
|
39
|
+
extends WitnessBase_V1<
|
|
40
|
+
TOptionsData, TOptionsRel8ns, TOptionsIbGib,
|
|
41
|
+
TResultData, TResultRel8ns, TResultIbGib,
|
|
42
|
+
TData, TRel8ns>
|
|
43
|
+
implements IbGibSpace<TIbGib, TOptionsData, TOptionsRel8ns, TOptionsIbGib, TResultData, TResultRel8ns, TResultIbGib, TData, TRel8ns> {
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Log context for convenience with logging. (Ignore if you don't want to use this.)
|
|
47
|
+
*/
|
|
48
|
+
protected lc: string = `${super.lc}[${SpaceBase_V1.name}]`;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Optional cache service. hmm...
|
|
52
|
+
*/
|
|
53
|
+
cacheSvc: IbGibCacheService | undefined;
|
|
54
|
+
|
|
55
|
+
// getSpaceIb(classname: string): string {
|
|
56
|
+
// const lc = `${this.lc}[${this.getSpaceIb.name}]`;
|
|
57
|
+
// if (!classname) {
|
|
58
|
+
// classname = this.lc?.replace('[','').replace(']','') || SpaceBase_V1.name+'_descendant';
|
|
59
|
+
// console.warn(`${lc} classname is falsy. Using ${classname}.`);
|
|
60
|
+
// }
|
|
61
|
+
// const name = this.data?.name || IBGIB_SPACE_NAME_DEFAULT;
|
|
62
|
+
// const id = this.data?.uuid || undefined;
|
|
63
|
+
// return `witness space ${classname} ${name} ${id}`;
|
|
64
|
+
// }
|
|
65
|
+
|
|
66
|
+
constructor(initialData?: TData, initialRel8ns?: TRel8ns) {
|
|
67
|
+
super(initialData, initialRel8ns);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* In a Space, we are concerned with getting ibGibs out of and putting ibGibs into a "space".
|
|
72
|
+
*
|
|
73
|
+
* So in this base, we take the incoming arg and divert it multiple ways, depending on our settings.
|
|
74
|
+
*/
|
|
75
|
+
protected async witnessImpl(arg: TOptionsIbGib): Promise<TResultIbGib | undefined> {
|
|
76
|
+
const lc = `${this.lc}[${this.witnessImpl.name}]`;
|
|
77
|
+
if (logalot) { console.log(`${lc}`); }
|
|
78
|
+
|
|
79
|
+
// do the thing
|
|
80
|
+
let result = await this.routeAndDoCommand({
|
|
81
|
+
cmd: arg.data!.cmd,
|
|
82
|
+
cmdModifiers: arg.data!.cmdModifiers ?? [],
|
|
83
|
+
arg,
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
// persist the arg and result if we're configured to do so
|
|
87
|
+
// if (result && this.data.persistOptsAndResultIbGibs) {
|
|
88
|
+
// try {
|
|
89
|
+
// await this.persistOptsAndResultIbGibs({arg, result});
|
|
90
|
+
// } catch (error) {
|
|
91
|
+
// const emsg = `${lc} ${error.message}`;
|
|
92
|
+
// console.error(emsg);
|
|
93
|
+
// }
|
|
94
|
+
// }
|
|
95
|
+
|
|
96
|
+
return result;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
protected abstract persistOptsAndResultIbGibs({ arg, result }:
|
|
100
|
+
{ arg: TOptionsIbGib, result: TResultIbGib }): Promise<void>;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Routes the given `cmd` to the correct handling function in the space,
|
|
104
|
+
* and executes that function.
|
|
105
|
+
*
|
|
106
|
+
* Override this if you have custom commands to handle.
|
|
107
|
+
* Check for those first, and if not among them, call this
|
|
108
|
+
* via `super.doCommand(...)`. If cmd is still not found,
|
|
109
|
+
* this will throw.
|
|
110
|
+
*/
|
|
111
|
+
protected routeAndDoCommand<TCmdModifier extends IbGibSpaceOptionsCmdModifier = IbGibSpaceOptionsCmdModifier>({
|
|
112
|
+
cmd,
|
|
113
|
+
cmdModifiers,
|
|
114
|
+
arg,
|
|
115
|
+
}: {
|
|
116
|
+
cmd: IbGibSpaceOptionsCmd | string,
|
|
117
|
+
cmdModifiers: (TCmdModifier | string)[],
|
|
118
|
+
arg: TOptionsIbGib,
|
|
119
|
+
}): Promise<TResultIbGib | undefined> {
|
|
120
|
+
const lc = `${this.lc}[${this.routeAndDoCommand.name}]`;
|
|
121
|
+
switch (cmd) {
|
|
122
|
+
case IbGibSpaceOptionsCmd.get:
|
|
123
|
+
if ((cmdModifiers ?? []).length === 0) {
|
|
124
|
+
return this.get(arg);
|
|
125
|
+
} else if (cmdModifiers.includes('can')) {
|
|
126
|
+
return this.canGet(arg);
|
|
127
|
+
} else if (cmdModifiers.includes('latest')) {
|
|
128
|
+
if (cmdModifiers.includes('addrs')) {
|
|
129
|
+
return this.getLatestAddrs(arg);
|
|
130
|
+
} else {
|
|
131
|
+
return this.getLatestIbGibs(arg);
|
|
132
|
+
}
|
|
133
|
+
} else if (cmdModifiers.includes('tjps')) {
|
|
134
|
+
if (cmdModifiers.includes('addrs')) {
|
|
135
|
+
return this.getTjpAddrs(arg);
|
|
136
|
+
} else {
|
|
137
|
+
return this.getTjpIbGibs(arg);
|
|
138
|
+
}
|
|
139
|
+
} else if (cmdModifiers.includes('addrs')) {
|
|
140
|
+
return this.getAddrs(arg);
|
|
141
|
+
} else {
|
|
142
|
+
return this.get(arg);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
case IbGibSpaceOptionsCmd.put:
|
|
146
|
+
if ((cmdModifiers ?? []).length === 0) {
|
|
147
|
+
return this.put(arg);
|
|
148
|
+
} else if (cmdModifiers.includes('can')) {
|
|
149
|
+
return this.canPut(arg);
|
|
150
|
+
} else {
|
|
151
|
+
return this.put(arg);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
case IbGibSpaceOptionsCmd.delete:
|
|
155
|
+
if ((cmdModifiers ?? []).length === 0) {
|
|
156
|
+
return this.delete(arg);
|
|
157
|
+
} else if (cmdModifiers.includes('can')) {
|
|
158
|
+
return this.canDelete(arg);
|
|
159
|
+
} else {
|
|
160
|
+
return this.delete(arg);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
default:
|
|
164
|
+
throw new Error(`${lc} unknown cmd: ${cmd}. cmdModifiers: ${cmdModifiers}`);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
protected get(arg: TOptionsIbGib): Promise<TResultIbGib | undefined> { return this.getImpl(arg); }
|
|
169
|
+
protected abstract getImpl(arg: TOptionsIbGib): Promise<TResultIbGib | undefined>;
|
|
170
|
+
|
|
171
|
+
protected put(arg: TOptionsIbGib): Promise<TResultIbGib | undefined> { return this.putImpl(arg); }
|
|
172
|
+
protected abstract putImpl(arg: TOptionsIbGib): Promise<TResultIbGib | undefined>;
|
|
173
|
+
|
|
174
|
+
protected delete(arg: TOptionsIbGib): Promise<TResultIbGib | undefined> { return this.deleteImpl(arg); }
|
|
175
|
+
protected deleteImpl(arg: TOptionsIbGib): Promise<TResultIbGib | undefined> {
|
|
176
|
+
const lc = `${this.lc}[${this.deleteImpl.name}]`;
|
|
177
|
+
throw new Error(`${lc} not implemented`);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Get all (public?) addrs in space.
|
|
182
|
+
*
|
|
183
|
+
* @optional method for space.
|
|
184
|
+
*
|
|
185
|
+
* @returns all addresses in space (that it wants to reveal).
|
|
186
|
+
*/
|
|
187
|
+
protected getAddrs(arg: TOptionsIbGib): Promise<TResultIbGib | undefined> { return this.getAddrsImpl(arg); }
|
|
188
|
+
protected getAddrsImpl(arg: TOptionsIbGib): Promise<TResultIbGib | undefined> {
|
|
189
|
+
const lc = `${this.lc}[${this.getAddrsImpl.name}]`;
|
|
190
|
+
throw new Error(`${lc} not implemented`);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Get latest ibGibs for given ibGib addresses.
|
|
195
|
+
*
|
|
196
|
+
* Usually I pass in the tjp address(es) if I have them.
|
|
197
|
+
*
|
|
198
|
+
* @optional method for space.
|
|
199
|
+
*
|
|
200
|
+
* @returns latest ibGibs in timelines for each given ibgib address.
|
|
201
|
+
*/
|
|
202
|
+
protected getLatestIbGibs(arg: TOptionsIbGib): Promise<TResultIbGib | undefined> { return this.getLatestIbGibsImpl(arg); }
|
|
203
|
+
protected getLatestIbGibsImpl(arg: TOptionsIbGib): Promise<TResultIbGib | undefined> {
|
|
204
|
+
const lc = `${this.lc}[${this.getLatestIbGibsImpl.name}]`;
|
|
205
|
+
throw new Error(`${lc} not implemented`);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Get latest addrs for given ibGib(s)/address(es).
|
|
210
|
+
*
|
|
211
|
+
* Usually I pass in the tjp address(es) if I have them.
|
|
212
|
+
*
|
|
213
|
+
* @optional method for space.
|
|
214
|
+
*
|
|
215
|
+
* @returns latest addrs in timelines for each given ibgib address.
|
|
216
|
+
*/
|
|
217
|
+
protected getLatestAddrs(arg: TOptionsIbGib): Promise<TResultIbGib | undefined> { return this.getLatestAddrsImpl(arg); }
|
|
218
|
+
protected getLatestAddrsImpl(arg: TOptionsIbGib): Promise<TResultIbGib | undefined> {
|
|
219
|
+
const lc = `${this.lc}[${this.getLatestAddrsImpl.name}]`;
|
|
220
|
+
throw new Error(`${lc} not implemented`);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Get temporal junction point ibgibs for given ibgib(s) or address(es).
|
|
225
|
+
*
|
|
226
|
+
* @optional method for space.
|
|
227
|
+
*
|
|
228
|
+
* @returns tjp ibgib for each given ibgib/address.
|
|
229
|
+
*/
|
|
230
|
+
protected getTjpIbGibs(arg: TOptionsIbGib): Promise<TResultIbGib | undefined> { return this.getTjpIbGibsImpl(arg); }
|
|
231
|
+
protected getTjpIbGibsImpl(arg: TOptionsIbGib): Promise<TResultIbGib | undefined> {
|
|
232
|
+
const lc = `${this.lc}[${this.getTjpIbGibsImpl.name}]`;
|
|
233
|
+
throw new Error(`${lc} not implemented`);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Get temporal junction point addr(s) for given ibgib(s) or address(es).
|
|
238
|
+
*
|
|
239
|
+
* @optional method for space.
|
|
240
|
+
*
|
|
241
|
+
* @returns tjp addrs in timelines for each given ibgib/address.
|
|
242
|
+
*/
|
|
243
|
+
protected getTjpAddrs(arg: TOptionsIbGib): Promise<TResultIbGib | undefined> { return this.getTjpAddrsImpl(arg); }
|
|
244
|
+
protected getTjpAddrsImpl(arg: TOptionsIbGib): Promise<TResultIbGib | undefined> {
|
|
245
|
+
const lc = `${this.lc}[${this.getTjpAddrsImpl.name}]`;
|
|
246
|
+
throw new Error(`${lc} not implemented`);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Supposed to be a check on either authorization, accessibility, existence...
|
|
251
|
+
*
|
|
252
|
+
* @notimplementedyet
|
|
253
|
+
*/
|
|
254
|
+
protected canGet(arg: TOptionsIbGib): Promise<TResultIbGib | undefined> { return this.canGetImpl(arg); }
|
|
255
|
+
protected canGetImpl(arg: TOptionsIbGib): Promise<TResultIbGib | undefined> {
|
|
256
|
+
const lc = `${this.lc}[${this.canGetImpl.name}]`;
|
|
257
|
+
throw new Error(`${lc} not implemented`);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Supposed to be a check on either authorization, accessibility, existence...
|
|
262
|
+
*
|
|
263
|
+
* @notimplementedyet
|
|
264
|
+
*/
|
|
265
|
+
protected canPut(arg: TOptionsIbGib): Promise<TResultIbGib | undefined> { return this.canPutImpl(arg); }
|
|
266
|
+
protected canPutImpl(arg: TOptionsIbGib): Promise<TResultIbGib | undefined> {
|
|
267
|
+
const lc = `${this.lc}[${this.canPutImpl.name}]`;
|
|
268
|
+
throw new Error(`${lc} not implemented`);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Supposed to be a check on either authorization, accessibility, existence...
|
|
273
|
+
*
|
|
274
|
+
* @notimplementedyet
|
|
275
|
+
*/
|
|
276
|
+
protected canDelete(arg: TOptionsIbGib): Promise<TResultIbGib | undefined> { return this.canPutImpl(arg); }
|
|
277
|
+
protected canDeleteImpl(arg: TOptionsIbGib): Promise<TResultIbGib | undefined> {
|
|
278
|
+
const lc = `${this.lc}[${this.canDeleteImpl.name}]`;
|
|
279
|
+
throw new Error(`${lc} not implemented`);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Centralized location for general argument validation for a given witness.
|
|
284
|
+
*
|
|
285
|
+
* In the case of spaces, this is where I usually put my common validation
|
|
286
|
+
* for various cases on cmd+modifier combinations.
|
|
287
|
+
*
|
|
288
|
+
* @returns validation error string, empty if no errors.
|
|
289
|
+
*/
|
|
290
|
+
protected async validateWitnessArg(arg: TOptionsIbGib): Promise<string[]> {
|
|
291
|
+
const lc = `${this.lc}[${this.validateWitnessArg.name}]`;
|
|
292
|
+
let errors: string[] = [];
|
|
293
|
+
try {
|
|
294
|
+
errors = await super.validateWitnessArg(arg);
|
|
295
|
+
if (!arg.data) {
|
|
296
|
+
errors.push(`arg.data required (E: 8ee544d7d88a45c6adcbc15838a283a7)`);
|
|
297
|
+
return errors; // <<<< returns immediately
|
|
298
|
+
}
|
|
299
|
+
if (!this.data) {
|
|
300
|
+
errors.push(`this.data required (E: 64f80642d7de44329355d6f907e272c8)`);
|
|
301
|
+
return errors; /* <<<< returns early */
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
const { cmd, ibGibAddrs, } = arg.data!;
|
|
305
|
+
let cmdModifiers = arg.data!.cmdModifiers ?? [];
|
|
306
|
+
const ibGibs = arg.ibGibs;
|
|
307
|
+
if (!cmd) { errors.push(`arg.data.cmd required (E: 72a11ee87a0d4896bcacd65a9c0284d9)`); }
|
|
308
|
+
if (!Object.values(IbGibSpaceOptionsCmd).includes((cmd as any))) { errors.push(`unknown arg.data.cmd: ${cmd}. (E: 95282ce61e97429f8049e61ec9f14f0b)`); }
|
|
309
|
+
const ibGibAddrsLength = ibGibAddrs?.length ?? 0;
|
|
310
|
+
if (
|
|
311
|
+
cmd === IbGibSpaceOptionsCmd.get &&
|
|
312
|
+
!cmdModifiers?.includes('addrs') && // we allow get addrs to be get ALL addrs
|
|
313
|
+
!cmdModifiers?.includes('latest') &&
|
|
314
|
+
ibGibAddrsLength === 0
|
|
315
|
+
) {
|
|
316
|
+
errors.push(`ibGibAddrs required when cmd is ${cmd}. (E: ee55a3f60b90423cbe054f27c34ab7d5)`);
|
|
317
|
+
}
|
|
318
|
+
if (cmd === IbGibSpaceOptionsCmd.put) {
|
|
319
|
+
if (logalot) { console.log(`${lc} validate put cmd`); }
|
|
320
|
+
const ibGibsLength = ibGibs?.length ?? 0;
|
|
321
|
+
if (ibGibsLength === 0) {
|
|
322
|
+
errors.push(`ibGibs required when cmd is ${cmd}. (E: b3a422169f7344a48a1d44e7ad1ba44e)`);
|
|
323
|
+
} else if (this.data.validateIbGibAddrsMatchIbGibs) {
|
|
324
|
+
// #region validate ibGib map to ibGibAddrs
|
|
325
|
+
if (logalot) { console.log(`${lc} validateIbGibAddrsMatchIbGibs true, so doing so.`); }
|
|
326
|
+
|
|
327
|
+
// confirm the incoming ibGibs match up with the addresses
|
|
328
|
+
// we have in `ibGibAddrs`.
|
|
329
|
+
if (ibGibsLength !== ibGibAddrsLength) {
|
|
330
|
+
errors.push(`ibGibsLength !== ibGibAddrsLength and this.data.validateIbGibAddrsMatchIbGibs is true. (E: 6c6bf824ab32443aa4d6b8bf4f8113dd)`);
|
|
331
|
+
} else {
|
|
332
|
+
// lengths match, so validate ibgibs
|
|
333
|
+
if (logalot) { console.log(`${lc} validateIbGibAddrsMatchIbGibs, lengths match. validating intrinsically`); }
|
|
334
|
+
const ibGibAddrsCopy = ibGibAddrs!.concat();
|
|
335
|
+
for (let i = 0; i < ibGibs!.length; i++) {
|
|
336
|
+
const ibGib = ibGibs![i];
|
|
337
|
+
const intrinsicErrors = await validateIbGibIntrinsically({ ibGib });
|
|
338
|
+
if (intrinsicErrors?.length ?? 0 > 0) {
|
|
339
|
+
intrinsicErrors!.forEach(x => errors.push(x));
|
|
340
|
+
} else {
|
|
341
|
+
// intrinsically valid, but ensure the ibGib
|
|
342
|
+
// addr maps 1-to-1 in ibGibAddrs
|
|
343
|
+
const xAddr = getIbGibAddr({ ibGib });
|
|
344
|
+
const xIndex = ibGibAddrsCopy.indexOf(xAddr);
|
|
345
|
+
if (xIndex === -1) {
|
|
346
|
+
errors.push(`ibGibAddrs don't map to calculated ibGib addrs. calculated Addr: (${xAddr}) (E: b21b3a7a74db43e5a8722acc97274646)`);
|
|
347
|
+
break;
|
|
348
|
+
} else {
|
|
349
|
+
ibGibAddrsCopy.splice(xIndex, 1);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// #endregion validate ibGib map to ibGibAddrs
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
return errors;
|
|
359
|
+
} catch (error) {
|
|
360
|
+
console.error(`${lc} ${error.message}`);
|
|
361
|
+
throw error;
|
|
362
|
+
} finally {
|
|
363
|
+
if (errors?.length > 0) { console.error(`${lc} errors: ${errors}`); }
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* builds an arg ibGib.
|
|
369
|
+
*
|
|
370
|
+
* wrapper convenience to avoid long generic calls.
|
|
371
|
+
*/
|
|
372
|
+
async argy({
|
|
373
|
+
argData,
|
|
374
|
+
ibMetadata,
|
|
375
|
+
noTimestamp,
|
|
376
|
+
ibGibs,
|
|
377
|
+
}: {
|
|
378
|
+
argData: TOptionsData,
|
|
379
|
+
ibMetadata?: string,
|
|
380
|
+
noTimestamp?: boolean,
|
|
381
|
+
ibGibs?: TIbGib[],
|
|
382
|
+
}): Promise<TOptionsIbGib> {
|
|
383
|
+
const arg = await argy_<TOptionsData, TOptionsRel8ns, TOptionsIbGib>({
|
|
384
|
+
argData,
|
|
385
|
+
ibMetadata,
|
|
386
|
+
noTimestamp
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
if (ibGibs) { arg.ibGibs = ibGibs; }
|
|
390
|
+
|
|
391
|
+
return arg;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* builds a result ibGib.
|
|
396
|
+
*
|
|
397
|
+
* wrapper convenience to avoid long generic calls.
|
|
398
|
+
*/
|
|
399
|
+
async resulty({
|
|
400
|
+
resultData,
|
|
401
|
+
ibGibs,
|
|
402
|
+
}: {
|
|
403
|
+
resultData: TResultData,
|
|
404
|
+
ibGibs?: TIbGib[],
|
|
405
|
+
}): Promise<TResultIbGib> {
|
|
406
|
+
const result = await resulty_<TResultData, TResultIbGib>({
|
|
407
|
+
ibMetadata: getSpaceResultMetadata({ space: this }),
|
|
408
|
+
resultData,
|
|
409
|
+
});
|
|
410
|
+
if (ibGibs) { result.ibGibs = ibGibs; }
|
|
411
|
+
return result;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { GIB } from '@ibgib/ts-gib/dist/V1/index.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Zero space is a default space that uses default values that should be
|
|
5
|
+
* reproducible and not break or something...it's all in flux really.
|
|
6
|
+
*/
|
|
7
|
+
export const ZERO_SPACE_ID = 'zero';
|
|
8
|
+
|
|
9
|
+
export const IBGIB_SPACE_NAME_DEFAULT = 'default_space';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Base directory for all data of the app.
|
|
13
|
+
*/
|
|
14
|
+
export const IBGIB_BASE_SUBPATH = 'ibgib';
|
|
15
|
+
/**
|
|
16
|
+
* Default space that is also used for bootstrapping.
|
|
17
|
+
*
|
|
18
|
+
* The user should provide his/her own space name that will contain their data.
|
|
19
|
+
* If a custom user space name is not provided, one should be auto-generated.
|
|
20
|
+
*
|
|
21
|
+
* ## notes
|
|
22
|
+
*
|
|
23
|
+
* * the leading 000's help to put the space earlier in alphabetized listing if viewing through an OS file viewer
|
|
24
|
+
*/
|
|
25
|
+
export const IBGIB_SPACE_SUBPATH_DEFAULT = `000_${IBGIB_SPACE_NAME_DEFAULT}`;
|
|
26
|
+
/**
|
|
27
|
+
* Subpath for "normal" ibgibs (non-meta, non-dna, non-binary, etc.).
|
|
28
|
+
*/
|
|
29
|
+
export const IBGIB_IBGIBS_SUBPATH = 'ibgibs';
|
|
30
|
+
/**
|
|
31
|
+
* should contain special-use ibgibs to the application.
|
|
32
|
+
*
|
|
33
|
+
* Use case:
|
|
34
|
+
* Because some special ibgibs will be changed frequently,
|
|
35
|
+
* e.g. settings, a separate folder will be useful.
|
|
36
|
+
*/
|
|
37
|
+
export const IBGIB_META_SUBPATH = 'meta';
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* For use with documentation and UX help.
|
|
41
|
+
*
|
|
42
|
+
* This is probably scoped to a particular schema...(e.g. v1)
|
|
43
|
+
*/
|
|
44
|
+
export const VALID_SPACE_NAME_EXAMPLES = [
|
|
45
|
+
'justLetters', 'valid_here', 'hyphens-allowed', '0CanStartOrEndWithNumbers9'
|
|
46
|
+
];
|
|
47
|
+
/**
|
|
48
|
+
* For use with documentation and UX help.
|
|
49
|
+
*
|
|
50
|
+
* This is probably scoped to a particular schema...(e.g. v1)
|
|
51
|
+
*/
|
|
52
|
+
export const INVALID_SPACE_NAME_EXAMPLES = [
|
|
53
|
+
'IHaveASymbol!', 'invalid hereWithSpace', '-cantStartWithHyphen', '_OrUnderscore'
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
*/
|
|
59
|
+
export const PERSIST_OPTS_AND_RESULTS_IBGIBS_DEFAULT = false;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Yep, this one starts with default instead of ending with it.
|
|
63
|
+
*/
|
|
64
|
+
export const DEFAULT_LOCAL_SPACE_DESCRIPTION = `This is a local space. There are many like it, but this one is mine.`;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* The main roots^gib ibgib uses this rel8n name to keep track of roots.
|
|
68
|
+
*/
|
|
69
|
+
export const SPACE_REL8N_NAME = 'space';
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* rel8n name in a space ibgib to the config ibgib(s?)
|
|
73
|
+
*/
|
|
74
|
+
export const SPACE_REL8N_NAME_CONFIG = `config`;
|
|
75
|
+
export const SPACE_NAME_REGEXP = /^[a-zA-Z][\w\-]{0,62}[a-zA-Z]$/;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* A spaces ibGib uses this rel8n name for related sync spaces, used
|
|
79
|
+
* in replicating ibgib spaces.
|
|
80
|
+
*/
|
|
81
|
+
export const SYNC_SPACE_REL8N_NAME = 'syncSpace';
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* ...?
|
|
85
|
+
*/
|
|
86
|
+
export const DEFAULT_SPACE_TEXT = 'space';
|
|
87
|
+
/**
|
|
88
|
+
* Default icon specifically for spaces.
|
|
89
|
+
*/
|
|
90
|
+
export const DEFAULT_SPACE_ICON = 'sparkles-outline';
|
|
91
|
+
/**
|
|
92
|
+
* Default description specifically for spaces.
|
|
93
|
+
*/
|
|
94
|
+
export const DEFAULT_SPACE_DESCRIPTION =
|
|
95
|
+
`This is a space ibgib, which is basically a special ibgib who has behavior
|
|
96
|
+
to interface with data stores and/or other space(s) to provide concrete location
|
|
97
|
+
for ibgibs. All ibgibs can have relationships with other ibgibs, but this one
|
|
98
|
+
specifically either implies a physical interface to things like databases,
|
|
99
|
+
file systems, and similar; OR, when this space interfaces with other spaces, this
|
|
100
|
+
is a logical organization of ibgib locations, like when configuring clusters or
|
|
101
|
+
consensus algorithms.`;
|
|
102
|
+
/**
|
|
103
|
+
* rel8n name used inside the root to those ibgib it contains.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```json
|
|
107
|
+
* {
|
|
108
|
+
* ib: root,
|
|
109
|
+
* gib: ABC123,
|
|
110
|
+
* data: {...},
|
|
111
|
+
* rel8ns: {
|
|
112
|
+
* [rel8nName]: ["a^1", "b^2"]
|
|
113
|
+
* }
|
|
114
|
+
* }
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
export const DEFAULT_SPACE_REL8N_NAME = 'x';
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Interval in ms between polling for updates ("notifications") between local
|
|
121
|
+
* space (ibgibs service) and dynamo sync space(s), or for use within a single
|
|
122
|
+
* space for checking its internal state.
|
|
123
|
+
*
|
|
124
|
+
* Of course, long polling is very hacky, but so is using DynamoDB in the cloud
|
|
125
|
+
* for a sync space. Obviously need to progress to a more mature and robust sync
|
|
126
|
+
* space/outer space architecture.
|
|
127
|
+
*/
|
|
128
|
+
export const DEFAULT_LOCAL_SPACE_POLLING_INTERVAL_MS = 30_000;
|
|
129
|
+
export const DEFAULT_LOCAL_SPACE_POLLING_DELAY_FIRST_RUN_MS = 10_000;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* {@link DEFAULT_LOCAL_SPACE_POLLING_INTERVAL_MS} but for outer spaces, so
|
|
133
|
+
* longer interval atow.
|
|
134
|
+
*/
|
|
135
|
+
export const DEFAULT_OUTER_SPACE_POLLING_INTERVAL_MS = 20_000;
|
|
136
|
+
/**
|
|
137
|
+
* Amount of time to delay for FIRST poll execution.
|
|
138
|
+
*/
|
|
139
|
+
export const DEFAULT_OUTER_SPACE_POLLING_DELAY_FIRST_RUN_MS = 10_000;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* When a status is first created, this is used to indicate that
|
|
143
|
+
* the tjp has not been set.
|
|
144
|
+
*/
|
|
145
|
+
export const STATUS_UNDEFINED_TJP_GIB = GIB;
|
|
146
|
+
/**
|
|
147
|
+
* When a status is first created, this is used to indicate that
|
|
148
|
+
* the txId has not been set.
|
|
149
|
+
*/
|
|
150
|
+
export const STATUS_UNDEFINED_TX_ID = '0';
|
|
151
|
+
|
|
152
|
+
export const SPACE_LOCK_IB_TERM = 'space_lock';
|
|
153
|
+
/**
|
|
154
|
+
* When attempting to acquire a lock ona space, and it is already lock, it will
|
|
155
|
+
* wait a random amount of ms before trying to lock again. This is the default
|
|
156
|
+
* max amount of ms before reattempting.
|
|
157
|
+
*/
|
|
158
|
+
export const DEFAULT_MAX_DELAY_MS_RETRY_LOCK_ACQUIRE = 100;
|
|
159
|
+
/**
|
|
160
|
+
* Will retry this many times before giving up...
|
|
161
|
+
*/
|
|
162
|
+
export const DEFAULT_MAX_DELAY_RETRY_LOCK_ACQUIRE_ATTEMPTS = 100;
|
|
163
|
+
/**
|
|
164
|
+
* We don't want someone locking a space forever by accident.
|
|
165
|
+
*/
|
|
166
|
+
export const MAX_LOCK_SECONDS_VALID = 60 * 2; // two minutes
|
|
167
|
+
/**
|
|
168
|
+
* Default value for secondsValid when acquiring/releasing lock in/on LOCAL
|
|
169
|
+
* space.
|
|
170
|
+
*/
|
|
171
|
+
export const DEFAULT_SECONDS_VALID_LOCAL = 2;
|
|
172
|
+
/**
|
|
173
|
+
* Default value for secondsValid when acquiring/releasing lock in/on
|
|
174
|
+
* OUTER space, e.g. sync spaces like aws dynamo sync space.
|
|
175
|
+
*/
|
|
176
|
+
export const DEFAULT_SECONDS_VALID_OUTER = 30;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* retry count when calling getDependencyGraph.
|
|
180
|
+
*
|
|
181
|
+
* ## driving use case
|
|
182
|
+
*
|
|
183
|
+
* dependency graph fails when concurrent merges made in sync space.
|
|
184
|
+
* need to wait until previous graph merger happens then retry.
|
|
185
|
+
*/
|
|
186
|
+
export const DEFAULT_MAX_RETRIES_GET_DEPENDENCY_GRAPH_OUTERSPACE = 5;
|
|
187
|
+
/**
|
|
188
|
+
* when getting dependency graph, sometimes we have to wait to retry
|
|
189
|
+
*/
|
|
190
|
+
export const DEFAULT_MS_BETWEEN_RETRIES_GET_DEPENDENCY_GRAPH_OUTERSPACE = 5000;
|
|
191
|
+
/**
|
|
192
|
+
* retry count when calling getDependencyGraph.
|
|
193
|
+
*
|
|
194
|
+
* ## driving use case
|
|
195
|
+
*
|
|
196
|
+
* dependency graph fails when concurrent merges made in sync space.
|
|
197
|
+
* need to wait until previous graph merger happens then retry.
|
|
198
|
+
*/
|
|
199
|
+
export const DEFAULT_MAX_RETRIES_GET_DEPENDENCY_GRAPH_LOCAL = 3;
|
|
200
|
+
/**
|
|
201
|
+
* when getting dependency graph, sometimes we have to wait to retry
|
|
202
|
+
*/
|
|
203
|
+
export const DEFAULT_MS_BETWEEN_RETRIES_GET_DEPENDENCY_GRAPH_LOCAL = 1000;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* currently not used in ionic-gib.
|
|
207
|
+
*/
|
|
208
|
+
export const DEFAULT_TX_ID_LENGTH = 5;
|