@ibgib/core-gib 0.0.8 → 0.0.11

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.
Files changed (154) hide show
  1. package/README.md +5 -10
  2. package/dist/assumptions.respec.d.mts +2 -0
  3. package/dist/assumptions.respec.d.mts.map +1 -0
  4. package/dist/assumptions.respec.mjs +41 -0
  5. package/dist/assumptions.respec.mjs.map +1 -0
  6. package/dist/core-constants.d.mts +0 -2
  7. package/dist/core-constants.d.mts.map +1 -1
  8. package/dist/core-constants.mjs +0 -2
  9. package/dist/core-constants.mjs.map +1 -1
  10. package/dist/core-helper.respec.d.mts +2 -0
  11. package/dist/core-helper.respec.d.mts.map +1 -0
  12. package/dist/core-helper.respec.mjs +53 -0
  13. package/dist/core-helper.respec.mjs.map +1 -0
  14. package/dist/core-types.d.mts +22 -0
  15. package/dist/core-types.d.mts.map +1 -1
  16. package/dist/respec-gib.node.d.mts +2 -0
  17. package/dist/respec-gib.node.d.mts.map +1 -0
  18. package/dist/respec-gib.node.mjs +211 -0
  19. package/dist/respec-gib.node.mjs.map +1 -0
  20. package/dist/spec-helper.node.respec.d.mts +12 -0
  21. package/dist/spec-helper.node.respec.d.mts.map +1 -0
  22. package/dist/spec-helper.node.respec.mjs +43 -0
  23. package/dist/spec-helper.node.respec.mjs.map +1 -0
  24. package/dist/witness/app/app-base-v1.d.mts +2 -2
  25. package/dist/witness/app/app-base-v1.d.mts.map +1 -1
  26. package/dist/witness/app/app-base-v1.mjs +23 -141
  27. package/dist/witness/app/app-base-v1.mjs.map +1 -1
  28. package/dist/witness/app/app-constants.d.mts +2 -0
  29. package/dist/witness/app/app-constants.d.mts.map +1 -1
  30. package/dist/witness/app/app-constants.mjs +2 -0
  31. package/dist/witness/app/app-constants.mjs.map +1 -1
  32. package/dist/witness/app/app-helper.d.mts.map +1 -1
  33. package/dist/witness/app/app-helper.mjs +2 -1
  34. package/dist/witness/app/app-helper.mjs.map +1 -1
  35. package/dist/witness/app/app-types.d.mts +2 -1
  36. package/dist/witness/app/app-types.d.mts.map +1 -1
  37. package/dist/witness/robbot/robbot-base-v1.d.mts +12 -164
  38. package/dist/witness/robbot/robbot-base-v1.d.mts.map +1 -1
  39. package/dist/witness/robbot/robbot-base-v1.mjs +41 -657
  40. package/dist/witness/robbot/robbot-base-v1.mjs.map +1 -1
  41. package/dist/witness/robbot/robbot-helper.mjs +3 -3
  42. package/dist/witness/robbot/robbot-helper.mjs.map +1 -1
  43. package/dist/witness/robbot/robbot-helper.respec.d.mts +2 -0
  44. package/dist/witness/robbot/robbot-helper.respec.d.mts.map +1 -0
  45. package/dist/witness/robbot/robbot-helper.respec.mjs +106 -0
  46. package/dist/witness/robbot/robbot-helper.respec.mjs.map +1 -0
  47. package/dist/witness/robbot/robbot-types.d.mts +6 -3
  48. package/dist/witness/robbot/robbot-types.d.mts.map +1 -1
  49. package/dist/witness/robbot/robbot-types.mjs +1 -0
  50. package/dist/witness/robbot/robbot-types.mjs.map +1 -1
  51. package/dist/witness/space/filesystem-space/filesystem-space-v1.d.mts +1 -1
  52. package/dist/witness/space/filesystem-space/filesystem-space-v1.d.mts.map +1 -1
  53. package/dist/witness/space/filesystem-space/filesystem-space-v1.respec.d.mts +2 -0
  54. package/dist/witness/space/filesystem-space/filesystem-space-v1.respec.d.mts.map +1 -0
  55. package/dist/witness/space/filesystem-space/filesystem-space-v1.respec.mjs +107 -0
  56. package/dist/witness/space/filesystem-space/filesystem-space-v1.respec.mjs.map +1 -0
  57. package/dist/witness/space/filesystem-space/node-filesystem-space-v1.d.mts.map +1 -1
  58. package/dist/witness/space/filesystem-space/node-filesystem-space-v1.mjs +1 -1
  59. package/dist/witness/space/filesystem-space/node-filesystem-space-v1.mjs.map +1 -1
  60. package/dist/witness/space/filesystem-space/node-filesystem-space-v1.node.respec.d.mts +2 -0
  61. package/dist/witness/space/filesystem-space/node-filesystem-space-v1.node.respec.d.mts.map +1 -0
  62. package/dist/witness/space/filesystem-space/node-filesystem-space-v1.node.respec.mjs +129 -0
  63. package/dist/witness/space/filesystem-space/node-filesystem-space-v1.node.respec.mjs.map +1 -0
  64. package/dist/witness/space/inner-space/inner-space-v1.respec.d.mts +2 -0
  65. package/dist/witness/space/inner-space/inner-space-v1.respec.d.mts.map +1 -0
  66. package/dist/witness/space/inner-space/inner-space-v1.respec.mjs +56 -0
  67. package/dist/witness/space/inner-space/inner-space-v1.respec.mjs.map +1 -0
  68. package/dist/witness/space/metaspace/metaspace-base.d.mts +795 -0
  69. package/dist/witness/space/metaspace/metaspace-base.d.mts.map +1 -0
  70. package/dist/witness/space/metaspace/metaspace-base.mjs +3251 -0
  71. package/dist/witness/space/metaspace/metaspace-base.mjs.map +1 -0
  72. package/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace-helper.d.mts +4 -0
  73. package/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace-helper.d.mts.map +1 -0
  74. package/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace-helper.mjs +117 -0
  75. package/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace-helper.mjs.map +1 -0
  76. package/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace.d.mts +34 -0
  77. package/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace.d.mts.map +1 -0
  78. package/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace.mjs +76 -0
  79. package/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace.mjs.map +1 -0
  80. package/dist/witness/space/metaspace/metaspace-types.d.mts +580 -0
  81. package/dist/witness/space/metaspace/metaspace-types.d.mts.map +1 -0
  82. package/dist/witness/space/metaspace/metaspace-types.mjs +6 -0
  83. package/dist/witness/space/metaspace/metaspace-types.mjs.map +1 -0
  84. package/dist/witness/space/space-helper.d.mts.map +1 -1
  85. package/dist/witness/space/space-helper.mjs +2 -1
  86. package/dist/witness/space/space-helper.mjs.map +1 -1
  87. package/dist/witness/space/{space-spec-helper.d.mts → space-respec-helper.d.mts} +15 -5
  88. package/dist/witness/space/space-respec-helper.d.mts.map +1 -0
  89. package/dist/witness/space/space-respec-helper.mjs +186 -0
  90. package/dist/witness/space/space-respec-helper.mjs.map +1 -0
  91. package/dist/witness/space/space-types.d.mts +2 -1
  92. package/dist/witness/space/space-types.d.mts.map +1 -1
  93. package/dist/witness/space/space-types.mjs.map +1 -1
  94. package/dist/witness/witness-base-v1.d.mts.map +1 -1
  95. package/dist/witness/witness-base-v1.mjs +7 -7
  96. package/dist/witness/witness-base-v1.mjs.map +1 -1
  97. package/dist/witness/witness-cmd/witness-cmd-types.d.mts +31 -0
  98. package/dist/witness/witness-cmd/witness-cmd-types.d.mts.map +1 -0
  99. package/dist/witness/witness-cmd/witness-cmd-types.mjs +2 -0
  100. package/dist/witness/witness-cmd/witness-cmd-types.mjs.map +1 -0
  101. package/dist/witness/witness-helper.d.mts +8 -0
  102. package/dist/witness/witness-helper.d.mts.map +1 -1
  103. package/dist/witness/witness-helper.mjs +30 -0
  104. package/dist/witness/witness-helper.mjs.map +1 -1
  105. package/dist/witness/witness-types.d.mts +26 -36
  106. package/dist/witness/witness-types.d.mts.map +1 -1
  107. package/dist/witness/witness-with-context/witness-with-context-base-v1.d.mts +235 -0
  108. package/dist/witness/witness-with-context/witness-with-context-base-v1.d.mts.map +1 -0
  109. package/dist/witness/witness-with-context/witness-with-context-base-v1.mjs +742 -0
  110. package/dist/witness/witness-with-context/witness-with-context-base-v1.mjs.map +1 -0
  111. package/dist/witness/witness-with-context/witness-with-context-types.d.mts +17 -0
  112. package/dist/witness/witness-with-context/witness-with-context-types.d.mts.map +1 -0
  113. package/dist/witness/witness-with-context/witness-with-context-types.mjs +2 -0
  114. package/dist/witness/witness-with-context/witness-with-context-types.mjs.map +1 -0
  115. package/package.json +12 -15
  116. package/src/{assumptions.spec.mts → assumptions.respec.mts} +11 -5
  117. package/src/core-constants.mts +0 -2
  118. package/src/core-helper.respec.mts +71 -0
  119. package/src/core-types.mts +20 -0
  120. package/src/respec-gib.node.mts +199 -0
  121. package/src/witness/app/app-base-v1.mts +19 -212
  122. package/src/witness/app/app-constants.mts +3 -0
  123. package/src/witness/app/app-helper.mts +2 -1
  124. package/src/witness/app/app-types.mts +1 -1
  125. package/src/witness/robbot/robbot-base-v1.mts +39 -690
  126. package/src/witness/robbot/robbot-helper.mts +1 -1
  127. package/src/witness/robbot/{robbot-helper.spec.mts → robbot-helper.respec.mts} +39 -33
  128. package/src/witness/robbot/robbot-types.mts +5 -3
  129. package/src/witness/space/filesystem-space/filesystem-space-v1.mts +1 -1
  130. package/src/witness/space/filesystem-space/{filesystem-space-v1.spec.mts → filesystem-space-v1.respec.mts} +17 -8
  131. package/src/witness/space/filesystem-space/node-filesystem-space-v1.mts +3 -11
  132. package/src/witness/space/filesystem-space/{node-filesystem-space-v1.node.spec.mts → node-filesystem-space-v1.node.respec.mts} +18 -14
  133. package/src/witness/space/inner-space/{inner-space-v1.spec.mts → inner-space-v1.respec.mts} +17 -8
  134. package/src/witness/space/metaspace/metaspace-base.mts +3702 -0
  135. package/src/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace-helper.mts +116 -0
  136. package/src/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace.mts +88 -0
  137. package/src/witness/space/metaspace/metaspace-types.mts +614 -0
  138. package/src/witness/space/space-helper.mts +2 -1
  139. package/src/witness/space/{space-spec-helper.mts → space-respec-helper.mts} +76 -57
  140. package/src/witness/space/space-types.mts +2 -1
  141. package/src/witness/witness-base-v1.mts +8 -6
  142. package/src/witness/witness-cmd/witness-cmd-types.mts +38 -0
  143. package/src/witness/witness-helper.mts +31 -0
  144. package/src/witness/witness-types.mts +31 -41
  145. package/src/witness/witness-with-context/witness-with-context-base-v1.mts +809 -0
  146. package/src/witness/witness-with-context/witness-with-context-types.mts +24 -0
  147. package/tsconfig.json +1 -0
  148. package/dist/witness/space/space-spec-helper.d.mts.map +0 -1
  149. package/dist/witness/space/space-spec-helper.mjs +0 -179
  150. package/dist/witness/space/space-spec-helper.mjs.map +0 -1
  151. package/jasmine-browser.json +0 -18
  152. package/jasmine.json +0 -6
  153. package/src/core-helper.spec.mts +0 -64
  154. /package/src/{spec-helper.node.spec.mts → spec-helper.node.respec.mts} +0 -0
@@ -13,12 +13,15 @@ import { CommentIbGib_V1 } from '../../common/comment/comment-types.mjs';
13
13
  import { PicIbGib_V1 } from '../../common/pic/pic-types.mjs';
14
14
  import { ErrorIbGib_V1 } from '../../common/error/error-types.mjs';
15
15
  import { validateCommonAppData } from './app-helper.mjs';
16
- import { argy_, isArg, resulty_ } from '../witness-helper.mjs';
16
+ import { argy_, isArg, isCommand, resulty_ } from '../witness-helper.mjs';
17
17
  import { IbGibLocalSpaceService_AllPowerful } from '../../core-types.mjs';
18
18
  import { pretty } from '@ibgib/helper-gib';
19
19
  import { GLOBAL_LOG_A_LOT } from '../../core-constants.mjs';
20
20
  import { errorIbGib } from '../../common/error/error-helper.mjs';
21
21
  import { getIbGibAddr } from '@ibgib/ts-gib';
22
+ import { isComment } from '../../common/comment/comment-helper.mjs';
23
+ import { isPic } from '../../common/pic/pic-helper.mjs';
24
+ import { WitnessWithContextBase_V1 } from '../witness-with-context/witness-with-context-base-v1.mjs';
22
25
 
23
26
  const logalot = GLOBAL_LOG_A_LOT || false;
24
27
 
@@ -44,7 +47,7 @@ export abstract class AppBase_V1<
44
47
  TData extends AppData_V1 = AppData_V1,
45
48
  TRel8ns extends AppRel8ns_V1 = AppRel8ns_V1,
46
49
  >
47
- extends WitnessBase_V1<
50
+ extends WitnessWithContextBase_V1<
48
51
  TOptionsData, TOptionsRel8ns, TOptionsIbGib,
49
52
  TResultData, TResultRel8ns, TResultIbGib,
50
53
  TData, TRel8ns>
@@ -54,18 +57,6 @@ export abstract class AppBase_V1<
54
57
  * Log context for convenience with logging. (Ignore if you don't want to use this.)
55
58
  */
56
59
  protected lc: string = `[${AppBase_V1.name}]`;
57
- // protected lc: string = `[${AppBase_V1.name}]`;
58
-
59
- // getAppIb(classname: string): string {
60
- // const lc = `${this.lc}[${this.getAppIb.name}]`;
61
- // if (!classname) {
62
- // classname = this.lc?.replace('[','').replace(']','') || AppBase_V1.name+'_descendant';
63
- // console.warn(`${lc} classname is falsy. Using ${classname}.`);
64
- // }
65
- // const name = this.data?.name || IBGIB_SPACE_NAME_DEFAULT;
66
- // const id = this.data?.uuid || undefined;
67
- // return `witness space ${classname} ${name} ${id}`;
68
- // }
69
60
 
70
61
  /**
71
62
  * Reference to the local ibgibs service, which is one way at getting at the
@@ -90,22 +81,12 @@ export abstract class AppBase_V1<
90
81
  try {
91
82
  if (logalot) { console.log(`${lc} starting...`); }
92
83
 
93
- if (this.ibgibsSvc) {
94
- // check for newer version of self locally before executing
95
- const appAddr = getIbGibAddr({ ibGib: this });
96
- const latestAddr = await this.ibgibsSvc.getLatestAddr({ ibGib: this });
97
- if (latestAddr && latestAddr !== appAddr) {
98
- // app has a newer ibgib in its timeline
99
- let resGet = await this.ibgibsSvc.get({ addr: latestAddr });
100
- if (!resGet || !resGet?.success || (resGet?.ibGibs ?? []).length === 0) {
101
- throw new Error(`could not get newer app ibgib (E: 15fa346c8ac17edb96e4b0870104c122)`);
102
- }
103
- await this.loadIbGibDto(resGet.ibGibs![0] as IbGib_V1<TData, TRel8ns>);
104
- const validationErrors = await this.validateThis();
105
- if (validationErrors?.length > 0) { throw new Error(`validationErrors when loading newer version: ${pretty(validationErrors)} (E: 0d9f0684a1ff6af44e20a57130e3ac22)`); }
106
- }
107
- }
108
- return this.routeAndDoArg({ arg });
84
+ await this.loadNewerSelfIfAvailable();
85
+
86
+ let result = await this.routeAndDoArg({ arg });
87
+ if (!result) { result = await this.doDefault({ ibGib: arg }); }
88
+ if (!result) { console.warn(`${lc} result falsy...Could not produce result? Was doDefault implemented in concrete class? (W: 15e70486bc33922f9388961bab815223)`); }
89
+ return result;
109
90
  } catch (error) {
110
91
  console.error(`${lc} ${error.message}`);
111
92
  throw error;
@@ -138,11 +119,16 @@ export abstract class AppBase_V1<
138
119
  const lc = `${this.lc}[${this.routeAndDoArg.name}]`;
139
120
  try {
140
121
  if (logalot) { console.log(`${lc} starting...`); }
141
- if (isArg({ ibGib: arg as IbGib_V1 })) {
142
- if ((arg.data as any).cmd) {
122
+ const ibGib = arg as IbGib_V1;
123
+ if (isArg({ ibGib })) {
124
+ if (isCommand({ ibGib })) {
143
125
  return this.doCmdArg({ arg: arg as AppCmdIbGib<IbGib_V1, AppCmdData, AppCmdRel8ns> });
126
+ } else if (isComment({ ibGib })) {
127
+ return this.doComment({ ibGib: ibGib as CommentIbGib_V1 });
128
+ } else if (isPic({ ibGib })) {
129
+ return this.doPic({ ibGib: ibGib as PicIbGib_V1 });
144
130
  } else {
145
- return this.doDefault({ ibGib: arg });
131
+ return undefined;
146
132
  }
147
133
  }
148
134
  } catch (error) {
@@ -309,138 +295,6 @@ export abstract class AppBase_V1<
309
295
 
310
296
  // #endregion other stubbed do functions (doPic, doComment, doDefault)
311
297
 
312
- // /**
313
- // * By default, this...
314
- // *
315
- // * * performs the raw {@link rel8} transform to the given `ibGib`.
316
- // * * persists the new ibgib's transform result in the given space.
317
- // * * registers the newer version of this app ibgib with the ibgibs svc.
318
- // *
319
- // * @see {@link ibGibs}
320
- // * @see {@link rel8nName}
321
- // * @see {@link ibgibsSvc}
322
- // * @see {@link space}
323
- // *
324
- // * ## notes
325
- // *
326
- // * * If there is no given `space`, then we will use the `ibgibsSvc` to get
327
- // * the local user space. If none, then we skip persistence.
328
- // * * If there is no `ibgibsSvc`, we won't register the new ibgibs locally.
329
- // */
330
- // protected async rel8To({
331
- // ibGibs,
332
- // rel8nName,
333
- // ibgibsSvc,
334
- // space,
335
- // }: {
336
- // /**
337
- // * The ibgib to which we are relating.
338
- // */
339
- // ibGibs: IbGib_V1[],
340
- // /**
341
- // * If given, will use this as the rel8n name when performing the `rel8`
342
- // * transform.
343
- // *
344
- // * If not given, will use the `app.data`'s {@link AppData_V1.defaultRel8nName} value.
345
- // */
346
- // rel8nName?: string,
347
- // /**
348
- // * If provided, will register the newly created ibgib.
349
- // */
350
- // ibgibsSvc?: IbgibsService,
351
- // /**
352
- // * If given (which atow is most likely the case), then the {@link TransformResult} will
353
- // * be persisted in this `space`.
354
- // */
355
- // space?: IbGibSpaceAny,
356
- // }): Promise<void> {
357
- // const lc = `${this.lc}[${this.rel8To.name}]`;
358
- // try {
359
- // if (logalot) { console.log(`${lc} starting...`); }
360
-
361
- // // #region initialize, validate args and this
362
-
363
- // if ((ibGibs ?? []).length === 0) { throw new Error(`ibGibs required (E: 2fd13de0f025b170885bede4d7a50922)`); }
364
-
365
- // rel8nName = rel8nName || this.data?.defaultRel8nName;
366
- // if (!rel8nName) { throw new Error(`rel8nName required either as an arg or in this.data.defaultRel8nName (E: 43ab8ae63694a2a82cd8a70ed6b6b522)`); }
367
-
368
- // const thisValidationErrors = await this.validateThis();
369
- // if (thisValidationErrors?.length > 0) { throw new Error(`this is an invalid ibGib. thisValidationErrors: ${thisValidationErrors.join('|')} (E: 8f08716866cd13bf254222ee9e6a6722)`); }
370
-
371
- // if (!ibgibsSvc) {
372
- // if (this.ibgibsSvc) {
373
- // if (logalot) { console.log(`${lc} ibgibsSvc arg falsy, but we have a reference on this object, which we will use. (I: ee0d39a47ee8aee8ffd797721fea4322)`); }
374
- // ibgibsSvc = this.ibgibsSvc;
375
- // }
376
- // }
377
-
378
- // if (!space) {
379
- // if (ibgibsSvc) {
380
- // if (logalot) { console.log(`${lc} space arg falsy, but ibgibsSvc truthy, so we'll use ibgibsSvc's local user space for persistence. (I: 37a4b4c1406556cb23831671755b0d22)`); }
381
- // space = await ibgibsSvc.getLocalUserSpace({ lock: true });
382
- // }
383
- // }
384
-
385
- // // #endregion initialize, validate args and this
386
-
387
-
388
-
389
- // // we want to rel8 only to the ibGibs whose timelines we're not
390
- // // already related to. So we look to see if we already have the tjpGib
391
- // // per our rel8nName.
392
- // const alreadyRel8dAddrs = this.rel8ns[rel8nName] ?? [];
393
- // const alreadyRel8dTjpGibs = alreadyRel8dAddrs.map(x => getGibInfo({ ibGibAddr: x }).tjpGib);
394
- // const ibGibsNotYetRel8dByTjp = ibGibs.filter(x => {
395
- // const tjpGib = getGibInfo({ ibGibAddr: h.getIbGibAddr({ ibGib: x }) }).tjpGib;
396
- // return !alreadyRel8dTjpGibs.includes(tjpGib);
397
- // });
398
-
399
- // if (ibGibsNotYetRel8dByTjp.length === 0) {
400
- // if (logalot) { console.log(`${lc} already rel8d to all incoming ibGib(s) via tjp. (I: 5e9d94a98ba262f146c0c0b765157922)`); }
401
- // return; /* <<<< returns early */
402
- // }
403
-
404
- // // perform the raw ibgib rel8 transform
405
- // const addrs = ibGibsNotYetRel8dByTjp.map(x => h.getIbGibAddr({ ibGib: x }));
406
- // const resNewApp = await V1.rel8({
407
- // src: this.toIbGibDto(),
408
- // rel8nsToAddByAddr: { [rel8nName]: addrs },
409
- // linkedRel8ns: ["past", "ancestor"], // we only want the most recent key address
410
- // dna: true,
411
- // nCounter: true,
412
- // });
413
- // const newAppIbGib = <IbGib_V1<TData, TRel8ns>>resNewApp.newIbGib;
414
- // const newAppValidationErrors =
415
- // await validateIbGibIntrinsically({ ibGib: newAppIbGib });
416
- // if (newAppValidationErrors?.length > 0) { throw new Error(`new app would have validation errors. aborting. newAppValidationErrors: ${newAppValidationErrors.join('|')} (E: eb816a27156c246c121ef55e37d59322)`); }
417
-
418
- // // if space is given, perform the persistence
419
- // if (space) {
420
- // await persistTransformResult({ resTransform: resNewApp, space });
421
- // } else {
422
- // if (logalot) { console.log(`${lc} space falsy, skipping persistence (I: 90aa3553e92ad1d02bce61f83648ea22)`); }
423
- // }
424
-
425
- // // if ibgibs svc is given, register the new ibgib
426
- // // (in the future, need to revisit the ibgibs service to the idea of locality/ies).
427
- // if (ibgibsSvc) {
428
- // await ibgibsSvc.registerNewIbGib({ ibGib: newAppIbGib, space });
429
- // } else {
430
- // if (logalot) { console.log(`${lc} ibgibsSvc falsy so skipping registerNewIbGib for new app (I: eda4f68fffaf2435eba25cd39d4f2922)`); }
431
- // }
432
-
433
- // // update this witness' primary ibGib properties (ib, gib, data, rel8ns).
434
- // // override `loadIbGibDto` to update secondary/derivative properties
435
- // await this.loadIbGibDto(newAppIbGib);
436
- // } catch (error) {
437
- // console.error(`${lc} ${error.message}`);
438
- // throw error;
439
- // } finally {
440
- // if (logalot) { console.log(`${lc} complete.`); }
441
- // }
442
- // }
443
-
444
298
  /**
445
299
  * validates against common app qualities.
446
300
  *
@@ -530,53 +384,6 @@ export abstract class AppBase_V1<
530
384
  return result;
531
385
  }
532
386
 
533
- // protected async rel8ToIbGib({
534
- // ibGibToRel8,
535
- // ibGibAddrToRel8,
536
- // contextIbGib,
537
- // rel8nNames,
538
- // }: {
539
- // ibGibToRel8?: IbGib_V1,
540
- // ibGibAddrToRel8?: IbGibAddr,
541
- // contextIbGib: IbGib_V1,
542
- // rel8nNames: string[],
543
- // }): Promise<void> {
544
- // const lc = `${this.lc}[${this.rel8ToIbGib.name}]`;
545
- // try {
546
- // if (!ibGibToRel8 && !ibGibAddrToRel8) { throw new Error(`ibGibToRel8 or ibGibAddrToRel8 required (E: 3ee14659fd22355a5ba0e537a477be22)`); }
547
- // if (!contextIbGib) { throw new Error(`contextIbGib required (E: 85f27c7cbf713704c21084c141cd8822)`); }
548
-
549
- // if ((rel8nNames ?? []).length === 0) {
550
- // if (!this.data?.defaultRel8nName) { throw new Error(`either rel8nNames or this.data.defaultRel8nName required (E: a14ab4b3e479d9274c61bc5a30bc2222)`); }
551
- // rel8nNames = [this.data.defaultRel8nName];
552
- // }
553
-
554
- // // set up the rel8ns to add
555
- // const rel8nsToAddByAddr: IbGibRel8ns_V1 = {};
556
- // ibGibAddrToRel8 = ibGibAddrToRel8 || h.getIbGibAddr({ ibGib: ibGibToRel8 });
557
- // rel8nNames.forEach((rel8nName) => { rel8nsToAddByAddr[rel8nName] = [ibGibAddrToRel8]; });
558
-
559
- // // perform the rel8 transform and...
560
- // const resRel8ToContext =
561
- // await V1.rel8({
562
- // src: contextIbGib,
563
- // rel8nsToAddByAddr,
564
- // dna: true,
565
- // nCounter: true
566
- // });
567
-
568
- // // ...persist it...
569
- // await this.ibgibsSvc.persistTransformResult({ resTransform: resRel8ToContext });
570
-
571
- // // ...register the context.
572
- // const { newIbGib: newContext } = resRel8ToContext;
573
- // await this.ibgibsSvc.registerNewIbGib({ ibGib: newContext });
574
- // } catch (error) {
575
- // console.error(`${lc} ${error.message}`);
576
- // throw error;
577
- // }
578
- // }
579
-
580
387
  }
581
388
 
582
389
  export interface IbGibAppAny
@@ -14,3 +14,6 @@ export const MENU_ITEM_IB_SUBSTRING_LENGTH = 20;
14
14
 
15
15
  export const QUERY_PARAM_PAUSED = 'paused';
16
16
  export const QUERY_PARAM_ROBBOT = 'robbot';
17
+
18
+ export const APP_NAME_REGEXP = /^[a-zA-Z0-9_\-.]{1,32}$/;
19
+ export const APP_REL8N_NAME = 'app';
@@ -3,8 +3,9 @@ import { Gib, Ib, } from '@ibgib/ts-gib';
3
3
  import { validateIbGibIntrinsically } from '@ibgib/ts-gib/dist/V1/validate-helper.mjs';
4
4
 
5
5
 
6
- import { APP_NAME_REGEXP, APP_REL8N_NAME, GLOBAL_LOG_A_LOT } from '../../core-constants.mjs';
6
+ import { GLOBAL_LOG_A_LOT } from '../../core-constants.mjs';
7
7
  import { AppData_V1, } from './app-types.mjs';
8
+ import { APP_NAME_REGEXP, APP_REL8N_NAME, } from './app-constants.mjs';
8
9
  import { IbGibAppAny } from './app-base-v1.mjs';
9
10
  // import { CommonService } from '../../services/common.service.mjs';
10
11
  // import { getFn_promptAppIbGib } from './prompt-functions.mjs';
@@ -5,11 +5,11 @@ import { IbGibRel8ns_V1, IbGib_V1 } from '@ibgib/ts-gib/dist/V1/index.mjs';
5
5
  // import { IonicSpaceData_V1 } from '../witnesses/spaces/ionic-space-v1';
6
6
  import {
7
7
  WitnessData_V1, WitnessRel8ns_V1,
8
- WitnessCmdData, WitnessCmdRel8ns, WitnessCmdIbGib,
9
8
  WitnessResultData, WitnessResultRel8ns, WitnessResultIbGib,
10
9
  } from '../witness-types.mjs';
11
10
  import { IbGibSpaceData_Subpathed } from '../space/space-types.mjs';
12
11
  import { IbGibAppAny } from './app-base-v1.mjs';
12
+ import { WitnessCmdData, WitnessCmdRel8ns, WitnessCmdIbGib, } from '../witness-cmd/witness-cmd-types.mjs';
13
13
 
14
14
 
15
15