@xyo-network/diviner-indexing-model 2.79.5

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 (116) hide show
  1. package/LICENSE +165 -0
  2. package/README.md +13 -0
  3. package/dist/browser/Config.d.cts +32 -0
  4. package/dist/browser/Config.d.cts.map +1 -0
  5. package/dist/browser/Config.d.mts +32 -0
  6. package/dist/browser/Config.d.mts.map +1 -0
  7. package/dist/browser/Config.d.ts +32 -0
  8. package/dist/browser/Config.d.ts.map +1 -0
  9. package/dist/browser/Labels.d.cts +9 -0
  10. package/dist/browser/Labels.d.cts.map +1 -0
  11. package/dist/browser/Labels.d.mts +9 -0
  12. package/dist/browser/Labels.d.mts.map +1 -0
  13. package/dist/browser/Labels.d.ts +9 -0
  14. package/dist/browser/Labels.d.ts.map +1 -0
  15. package/dist/browser/Params.d.cts +5 -0
  16. package/dist/browser/Params.d.cts.map +1 -0
  17. package/dist/browser/Params.d.mts +5 -0
  18. package/dist/browser/Params.d.mts.map +1 -0
  19. package/dist/browser/Params.d.ts +5 -0
  20. package/dist/browser/Params.d.ts.map +1 -0
  21. package/dist/browser/Schema.d.cts +3 -0
  22. package/dist/browser/Schema.d.cts.map +1 -0
  23. package/dist/browser/Schema.d.mts +3 -0
  24. package/dist/browser/Schema.d.mts.map +1 -0
  25. package/dist/browser/Schema.d.ts +3 -0
  26. package/dist/browser/Schema.d.ts.map +1 -0
  27. package/dist/browser/SearchableStorage.d.cts +10 -0
  28. package/dist/browser/SearchableStorage.d.cts.map +1 -0
  29. package/dist/browser/SearchableStorage.d.mts +10 -0
  30. package/dist/browser/SearchableStorage.d.mts.map +1 -0
  31. package/dist/browser/SearchableStorage.d.ts +10 -0
  32. package/dist/browser/SearchableStorage.d.ts.map +1 -0
  33. package/dist/browser/Stage.d.cts +29 -0
  34. package/dist/browser/Stage.d.cts.map +1 -0
  35. package/dist/browser/Stage.d.mts +29 -0
  36. package/dist/browser/Stage.d.mts.map +1 -0
  37. package/dist/browser/Stage.d.ts +29 -0
  38. package/dist/browser/Stage.d.ts.map +1 -0
  39. package/dist/browser/State.d.cts +5 -0
  40. package/dist/browser/State.d.cts.map +1 -0
  41. package/dist/browser/State.d.mts +5 -0
  42. package/dist/browser/State.d.mts.map +1 -0
  43. package/dist/browser/State.d.ts +5 -0
  44. package/dist/browser/State.d.ts.map +1 -0
  45. package/dist/browser/index.cjs +37 -0
  46. package/dist/browser/index.cjs.map +1 -0
  47. package/dist/browser/index.d.cts +8 -0
  48. package/dist/browser/index.d.cts.map +1 -0
  49. package/dist/browser/index.d.mts +8 -0
  50. package/dist/browser/index.d.mts.map +1 -0
  51. package/dist/browser/index.d.ts +8 -0
  52. package/dist/browser/index.d.ts.map +1 -0
  53. package/dist/browser/index.js +14 -0
  54. package/dist/browser/index.js.map +1 -0
  55. package/dist/node/Config.d.cts +32 -0
  56. package/dist/node/Config.d.cts.map +1 -0
  57. package/dist/node/Config.d.mts +32 -0
  58. package/dist/node/Config.d.mts.map +1 -0
  59. package/dist/node/Config.d.ts +32 -0
  60. package/dist/node/Config.d.ts.map +1 -0
  61. package/dist/node/Labels.d.cts +9 -0
  62. package/dist/node/Labels.d.cts.map +1 -0
  63. package/dist/node/Labels.d.mts +9 -0
  64. package/dist/node/Labels.d.mts.map +1 -0
  65. package/dist/node/Labels.d.ts +9 -0
  66. package/dist/node/Labels.d.ts.map +1 -0
  67. package/dist/node/Params.d.cts +5 -0
  68. package/dist/node/Params.d.cts.map +1 -0
  69. package/dist/node/Params.d.mts +5 -0
  70. package/dist/node/Params.d.mts.map +1 -0
  71. package/dist/node/Params.d.ts +5 -0
  72. package/dist/node/Params.d.ts.map +1 -0
  73. package/dist/node/Schema.d.cts +3 -0
  74. package/dist/node/Schema.d.cts.map +1 -0
  75. package/dist/node/Schema.d.mts +3 -0
  76. package/dist/node/Schema.d.mts.map +1 -0
  77. package/dist/node/Schema.d.ts +3 -0
  78. package/dist/node/Schema.d.ts.map +1 -0
  79. package/dist/node/SearchableStorage.d.cts +10 -0
  80. package/dist/node/SearchableStorage.d.cts.map +1 -0
  81. package/dist/node/SearchableStorage.d.mts +10 -0
  82. package/dist/node/SearchableStorage.d.mts.map +1 -0
  83. package/dist/node/SearchableStorage.d.ts +10 -0
  84. package/dist/node/SearchableStorage.d.ts.map +1 -0
  85. package/dist/node/Stage.d.cts +29 -0
  86. package/dist/node/Stage.d.cts.map +1 -0
  87. package/dist/node/Stage.d.mts +29 -0
  88. package/dist/node/Stage.d.mts.map +1 -0
  89. package/dist/node/Stage.d.ts +29 -0
  90. package/dist/node/Stage.d.ts.map +1 -0
  91. package/dist/node/State.d.cts +5 -0
  92. package/dist/node/State.d.cts.map +1 -0
  93. package/dist/node/State.d.mts +5 -0
  94. package/dist/node/State.d.mts.map +1 -0
  95. package/dist/node/State.d.ts +5 -0
  96. package/dist/node/State.d.ts.map +1 -0
  97. package/dist/node/index.d.cts +8 -0
  98. package/dist/node/index.d.cts.map +1 -0
  99. package/dist/node/index.d.mts +8 -0
  100. package/dist/node/index.d.mts.map +1 -0
  101. package/dist/node/index.d.ts +8 -0
  102. package/dist/node/index.d.ts.map +1 -0
  103. package/dist/node/index.js +43 -0
  104. package/dist/node/index.js.map +1 -0
  105. package/dist/node/index.mjs +14 -0
  106. package/dist/node/index.mjs.map +1 -0
  107. package/package.json +62 -0
  108. package/src/Config.ts +35 -0
  109. package/src/Labels.ts +13 -0
  110. package/src/Params.ts +6 -0
  111. package/src/Schema.ts +2 -0
  112. package/src/SearchableStorage.ts +9 -0
  113. package/src/Stage.ts +30 -0
  114. package/src/State.ts +5 -0
  115. package/src/index.ts +7 -0
  116. package/typedoc.json +5 -0
package/src/Config.ts ADDED
@@ -0,0 +1,35 @@
1
+ import { DivinerConfig } from '@xyo-network/diviner-model'
2
+
3
+ import { IndexingDivinerSchema } from './Schema'
4
+ import { SearchableStorage } from './SearchableStorage'
5
+ import { IndexingDivinerStageConfig } from './Stage'
6
+
7
+ export const IndexingDivinerConfigSchema = `${IndexingDivinerSchema}.config` as const
8
+ export type IndexingDivinerConfigSchema = typeof IndexingDivinerConfigSchema
9
+
10
+ export type IndexingDivinerConfig = DivinerConfig<{
11
+ /**
12
+ * Where the diviner should store it's index
13
+ */
14
+ indexStore?: SearchableStorage
15
+ /**
16
+ * Config section for individual indexing diviner stages
17
+ */
18
+ indexingDivinerStages: IndexingDivinerStageConfig
19
+ /**
20
+ * The maximum number of payloads to index at a time
21
+ */
22
+ payloadDivinerLimit?: number
23
+ /**
24
+ * How often to poll for new payloads to index
25
+ */
26
+ pollFrequency?: number
27
+ /**
28
+ * The schema for the Diviner config
29
+ */
30
+ schema: IndexingDivinerConfigSchema
31
+ /**
32
+ * Where the diviner should persist its internal state
33
+ */
34
+ stateStore?: SearchableStorage
35
+ }>
package/src/Labels.ts ADDED
@@ -0,0 +1,13 @@
1
+ import { Labels } from '@xyo-network/module-model'
2
+
3
+ import { DivinerStageSchema, IndexingDivinerStage } from './Stage'
4
+
5
+ /**
6
+ * Labels for Indexing Diviner Stage Diviners
7
+ */
8
+ export type IndexingDivinerStageLabels = Labels & {
9
+ /**
10
+ * Labels for the stage of the Indexing Diviner Stage Diviner
11
+ */
12
+ [key in DivinerStageSchema]: IndexingDivinerStage
13
+ }
package/src/Params.ts ADDED
@@ -0,0 +1,6 @@
1
+ import { DivinerParams } from '@xyo-network/diviner-model'
2
+ import { AnyConfigSchema } from '@xyo-network/module-model'
3
+
4
+ import { IndexingDivinerConfig } from './Config'
5
+
6
+ export type IndexingDivinerParams = DivinerParams<AnyConfigSchema<IndexingDivinerConfig>>
package/src/Schema.ts ADDED
@@ -0,0 +1,2 @@
1
+ export const IndexingDivinerSchema = 'network.xyo.diviner.indexing' as const
2
+ export type ImageThumbnailDivinerSchema = typeof IndexingDivinerSchema
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Describes an Archivist/Diviner combination
3
+ * that enables searching signed payloads
4
+ */
5
+ export interface SearchableStorage {
6
+ archivist: string
7
+ boundWitnessDiviner: string
8
+ payloadDiviner: string
9
+ }
package/src/Stage.ts ADDED
@@ -0,0 +1,30 @@
1
+ export type DivinerStageSchema = 'network.xyo.diviner.stage'
2
+ export const DivinerStageSchema: DivinerStageSchema = 'network.xyo.diviner.stage'
3
+
4
+ /**
5
+ * The diviners for each stage of an indexing diviner
6
+ */
7
+ export type IndexingDivinerStage =
8
+ /**
9
+ * Transforms a diviner query into an index query
10
+ */
11
+ | 'divinerQueryToIndexQueryDiviner'
12
+ /**
13
+ * Transforms the index candidates into indexes
14
+ */
15
+ | 'indexCandidateToIndexDiviner'
16
+ /**
17
+ * Transforms an index query response into a diviner divine query response
18
+ */
19
+ | 'indexQueryResponseToDivinerQueryResponseDiviner'
20
+ /**
21
+ * Uses the current state to determine the next batch of index candidates
22
+ */
23
+ | 'stateToIndexCandidateDiviner'
24
+
25
+ /**
26
+ * Config section for declaring each indexing diviner stage
27
+ */
28
+ export type IndexingDivinerStageConfig = {
29
+ [key in IndexingDivinerStage]: string
30
+ }
package/src/State.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { StateDictionary } from '@xyo-network/module-model'
2
+
3
+ export type IndexingDivinerState = StateDictionary & {
4
+ offset: number
5
+ }
package/src/index.ts ADDED
@@ -0,0 +1,7 @@
1
+ export * from './Config'
2
+ export * from './Labels'
3
+ export * from './Params'
4
+ export * from './Schema'
5
+ export * from './SearchableStorage'
6
+ export * from './Stage'
7
+ export * from './State'
package/typedoc.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://typedoc.org/schema.json",
3
+ "entryPoints": ["src/index.ts"],
4
+ "tsconfig": "./tsconfig.typedoc.json"
5
+ }