@xyo-network/diviner-image-thumbnail 3.6.1 → 4.1.0

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 (43) hide show
  1. package/dist/{types → neutral}/Diviner/ImageThumbnailStateToIndexCandidateDiviner/Diviner.d.ts +2 -18
  2. package/dist/{types → neutral}/Diviner/ImageThumbnailStateToIndexCandidateDiviner/Diviner.d.ts.map +1 -1
  3. package/dist/neutral/Diviner/ImageThumbnailStateToIndexCandidateDiviner/spec/Diviner.spec.d.ts +2 -0
  4. package/dist/neutral/Diviner/ImageThumbnailStateToIndexCandidateDiviner/spec/Diviner.spec.d.ts.map +1 -0
  5. package/dist/neutral/Diviner/spec/Diviner.spec.d.ts +2 -0
  6. package/dist/neutral/Diviner/spec/Diviner.spec.d.ts.map +1 -0
  7. package/dist/neutral/Diviner/spec/ImageThumbnailIndexCandidateToImageThumbnailIndexDiviner.spec.d.ts +2 -0
  8. package/dist/neutral/Diviner/spec/ImageThumbnailIndexCandidateToImageThumbnailIndexDiviner.spec.d.ts.map +1 -0
  9. package/dist/neutral/Diviner/spec/ImageThumbnailIndexQueryResponseToImageThumbnailQueryResponseDiviner.spec.d.ts +2 -0
  10. package/dist/neutral/Diviner/spec/ImageThumbnailIndexQueryResponseToImageThumbnailQueryResponseDiviner.spec.d.ts.map +1 -0
  11. package/dist/neutral/Diviner/spec/ImageThumbnailQueryToImageThumbnailIndexQueryDiviner.spec.d.ts +2 -0
  12. package/dist/neutral/Diviner/spec/ImageThumbnailQueryToImageThumbnailIndexQueryDiviner.spec.d.ts.map +1 -0
  13. package/dist/neutral/index.d.ts +142 -0
  14. package/dist/neutral/index.mjs +0 -1
  15. package/dist/neutral/index.mjs.map +1 -1
  16. package/package.json +38 -38
  17. package/src/Diviner/ImageThumbnailIndexQueryResponseToImageThumbnailQueryResponseDiviner.ts +1 -1
  18. package/dist/types/index.d.ts +0 -2
  19. /package/dist/{types → neutral}/Diviner/Diviner.d.ts +0 -0
  20. /package/dist/{types → neutral}/Diviner/Diviner.d.ts.map +0 -0
  21. /package/dist/{types → neutral}/Diviner/ImageThumbnailDivinerLabels.d.ts +0 -0
  22. /package/dist/{types → neutral}/Diviner/ImageThumbnailDivinerLabels.d.ts.map +0 -0
  23. /package/dist/{types → neutral}/Diviner/ImageThumbnailDivinerState.d.ts +0 -0
  24. /package/dist/{types → neutral}/Diviner/ImageThumbnailDivinerState.d.ts.map +0 -0
  25. /package/dist/{types → neutral}/Diviner/ImageThumbnailIndexCandidateToImageThumbnailIndexDiviner.d.ts +0 -0
  26. /package/dist/{types → neutral}/Diviner/ImageThumbnailIndexCandidateToImageThumbnailIndexDiviner.d.ts.map +0 -0
  27. /package/dist/{types → neutral}/Diviner/ImageThumbnailIndexQueryResponseToImageThumbnailQueryResponseDiviner.d.ts +0 -0
  28. /package/dist/{types → neutral}/Diviner/ImageThumbnailIndexQueryResponseToImageThumbnailQueryResponseDiviner.d.ts.map +0 -0
  29. /package/dist/{types → neutral}/Diviner/ImageThumbnailQueryToImageThumbnailIndexQueryDiviner.d.ts +0 -0
  30. /package/dist/{types → neutral}/Diviner/ImageThumbnailQueryToImageThumbnailIndexQueryDiviner.d.ts.map +0 -0
  31. /package/dist/{types → neutral}/Diviner/ImageThumbnailResultQuery.d.ts +0 -0
  32. /package/dist/{types → neutral}/Diviner/ImageThumbnailResultQuery.d.ts.map +0 -0
  33. /package/dist/{types → neutral}/Diviner/ImageThumbnailStateToIndexCandidateDiviner/Config.d.ts +0 -0
  34. /package/dist/{types → neutral}/Diviner/ImageThumbnailStateToIndexCandidateDiviner/Config.d.ts.map +0 -0
  35. /package/dist/{types → neutral}/Diviner/ImageThumbnailStateToIndexCandidateDiviner/Params.d.ts +0 -0
  36. /package/dist/{types → neutral}/Diviner/ImageThumbnailStateToIndexCandidateDiviner/Params.d.ts.map +0 -0
  37. /package/dist/{types → neutral}/Diviner/ImageThumbnailStateToIndexCandidateDiviner/Schema.d.ts +0 -0
  38. /package/dist/{types → neutral}/Diviner/ImageThumbnailStateToIndexCandidateDiviner/Schema.d.ts.map +0 -0
  39. /package/dist/{types → neutral}/Diviner/ImageThumbnailStateToIndexCandidateDiviner/index.d.ts +0 -0
  40. /package/dist/{types → neutral}/Diviner/ImageThumbnailStateToIndexCandidateDiviner/index.d.ts.map +0 -0
  41. /package/dist/{types → neutral}/Diviner/index.d.ts +0 -0
  42. /package/dist/{types → neutral}/Diviner/index.d.ts.map +0 -0
  43. /package/dist/{types → neutral}/index.d.ts.map +0 -0
@@ -41,27 +41,11 @@ export declare class ImageThumbnailStateToIndexCandidateDiviner<TParams extends
41
41
  * Retrieves the archivist for the payloadStore
42
42
  * @returns The archivist for the payloadStore
43
43
  */
44
- protected getArchivistForStore(): Promise<ArchivistWrapper<import("@xyo-network/archivist-model").ArchivistModuleInstance<import(".store/@xylabs-base-npm-4.11.2-29ff43002f/package").BaseParamsFields & {
45
- account?: import(".store/@xyo-network-account-model-npm-3.17.1-d1c40ed920/package").AccountInstance | "random";
46
- addToResolvers?: boolean;
47
- additionalSigners?: import(".store/@xyo-network-account-model-npm-3.17.1-d1c40ed920/package").AccountInstance[];
48
- allowNameResolution?: boolean;
49
- config: import("@xyo-network/module-model").AnyConfigSchema<import("@xyo-network/archivist-model").ArchivistConfig>;
50
- ephemeralQueryAccountEnabled?: boolean;
51
- moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
52
- } & import("@xyo-network/module-model").ModuleChildrenParams, import("@xyo-network/archivist-model").ArchivistModuleEventData>>>;
44
+ protected getArchivistForStore(): Promise<ArchivistWrapper<import("@xyo-network/archivist-model").ArchivistModuleInstance<import("@xyo-network/module-model").ModuleParams<import("@xyo-network/module-model").AnyConfigSchema<import("@xyo-network/archivist-model").ArchivistConfig<void, void>>>, import("@xyo-network/archivist-model").ArchivistModuleEventData>>>;
53
45
  /**
54
46
  * Retrieves the BoundWitness Diviner for the payloadStore
55
47
  * @returns The BoundWitness Diviner for the payloadStore
56
48
  */
57
- protected getBoundWitnessDivinerForStore(): Promise<DivinerWrapper<import("@xyo-network/diviner-model").DivinerModule<import(".store/@xylabs-base-npm-4.11.2-29ff43002f/package").BaseParamsFields & {
58
- account?: import(".store/@xyo-network-account-model-npm-3.17.1-d1c40ed920/package").AccountInstance | "random";
59
- addToResolvers?: boolean;
60
- additionalSigners?: import(".store/@xyo-network-account-model-npm-3.17.1-d1c40ed920/package").AccountInstance[];
61
- allowNameResolution?: boolean;
62
- config: import("@xyo-network/module-model").AnyConfigSchema<import("@xyo-network/diviner-model").DivinerConfig>;
63
- ephemeralQueryAccountEnabled?: boolean;
64
- moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
65
- } & import("@xyo-network/module-model").ModuleChildrenParams, import("@xyo-network/diviner-model").DivinerModuleEventData>, Payload, Payload>>;
49
+ protected getBoundWitnessDivinerForStore(): Promise<DivinerWrapper<import("@xyo-network/diviner-model").DivinerModule<import("@xyo-network/diviner-model").DivinerParams<import("@xyo-network/module-model").AnyConfigSchema<import("@xyo-network/diviner-model").DivinerConfig<void, void>>>, import("@xyo-network/diviner-model").DivinerModuleEventData<import("@xyo-network/module-model").ModuleInstance<import("@xyo-network/module-model").ModuleParams<import("@xyo-network/module-model").AnyConfigSchema<import("@xyo-network/module-model").ModuleConfig<object, void>>>, import("@xyo-network/module-model").ModuleEventData<object>>, Payload, Payload>>, Payload, Payload>>;
66
50
  }
67
51
  //# sourceMappingURL=Diviner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../../src/Diviner/ImageThumbnailStateToIndexCandidateDiviner/Diviner.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAwB,MAAM,8BAA8B,CAAA;AAC3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAGnE,OA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,EAAE,MAAM,EAAE,CAAmF;IACnI,gBAAyB,mBAAmB,EAAE,MAAM,CAAyD;IAC7G,gBAAyB,MAAM,EAAE,gCAAgC,CAIhE;IAED,IAAI,mBAAmB,WAEtB;qBAEsB,yBAAyB,CAAC,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,EAAE,GAAG,SAAS,CAAC;cAU9G,aAAa,CAAC,QAAQ,GAAE,OAAO,EAAO,GAAG,OAAO,CAAC,kDAAkD,CAAC;IAoC7H;;;OAGG;cACa,oBAAoB;IAMpC;;;OAGG;cACa,8BAA8B;CAQ/C"}
@@ -0,0 +1,2 @@
1
+ import '@xylabs/vitest-extended';
2
+ //# sourceMappingURL=Diviner.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Diviner.spec.d.ts","sourceRoot":"","sources":["../../../../../src/Diviner/ImageThumbnailStateToIndexCandidateDiviner/spec/Diviner.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
@@ -0,0 +1,2 @@
1
+ import '@xylabs/vitest-extended';
2
+ //# sourceMappingURL=Diviner.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Diviner.spec.d.ts","sourceRoot":"","sources":["../../../../src/Diviner/spec/Diviner.spec.ts"],"names":[],"mappings":"AACA,OAAO,yBAAyB,CAAA"}
@@ -0,0 +1,2 @@
1
+ import '@xylabs/vitest-extended';
2
+ //# sourceMappingURL=ImageThumbnailIndexCandidateToImageThumbnailIndexDiviner.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImageThumbnailIndexCandidateToImageThumbnailIndexDiviner.spec.d.ts","sourceRoot":"","sources":["../../../../src/Diviner/spec/ImageThumbnailIndexCandidateToImageThumbnailIndexDiviner.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
@@ -0,0 +1,2 @@
1
+ import '@xylabs/vitest-extended';
2
+ //# sourceMappingURL=ImageThumbnailIndexQueryResponseToImageThumbnailQueryResponseDiviner.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImageThumbnailIndexQueryResponseToImageThumbnailQueryResponseDiviner.spec.d.ts","sourceRoot":"","sources":["../../../../src/Diviner/spec/ImageThumbnailIndexQueryResponseToImageThumbnailQueryResponseDiviner.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
@@ -0,0 +1,2 @@
1
+ import '@xylabs/vitest-extended';
2
+ //# sourceMappingURL=ImageThumbnailQueryToImageThumbnailIndexQueryDiviner.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImageThumbnailQueryToImageThumbnailIndexQueryDiviner.spec.d.ts","sourceRoot":"","sources":["../../../../src/Diviner/spec/ImageThumbnailQueryToImageThumbnailIndexQueryDiviner.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
@@ -0,0 +1,142 @@
1
+ import { DivinerStageSchema, IndexingDivinerStage, IndexingDiviner } from '@xyo-network/diviner-indexing';
2
+ import * as _xyo_network_diviner_model from '@xyo-network/diviner-model';
3
+ import { AttachableDivinerInstance, DivinerConfig, DivinerParams } from '@xyo-network/diviner-model';
4
+ import * as _xyo_network_module_model from '@xyo-network/module-model';
5
+ import { Labels, StateDictionary, AnyConfigSchema, ModuleState } from '@xyo-network/module-model';
6
+ import { Hex } from '@xylabs/hex';
7
+ import { AbstractDiviner } from '@xyo-network/diviner-abstract';
8
+ import { ImageThumbnailResultIndex, ImageThumbnailResult, ImageThumbnailDivinerSchema, SearchableStorage, ImageThumbnail } from '@xyo-network/image-thumbnail-payload-plugin';
9
+ import { Schema, Payload, WithSources } from '@xyo-network/payload-model';
10
+ import { PayloadDivinerQueryPayload } from '@xyo-network/diviner-payload-model';
11
+ import * as _xyo_network_archivist_model from '@xyo-network/archivist-model';
12
+ import { ArchivistInstance } from '@xyo-network/archivist-model';
13
+ import { ArchivistWrapper } from '@xyo-network/archivist-wrapper';
14
+ import { BoundWitness } from '@xyo-network/boundwitness-model';
15
+ import { DivinerWrapper } from '@xyo-network/diviner-wrapper';
16
+ import { TimeStamp } from '@xyo-network/witness-timestamp';
17
+
18
+ /**
19
+ * Labels for Image Thumbnail Diviner components
20
+ */
21
+ interface ImageThumbnailDivinerLabels extends Labels {
22
+ 'network.xyo.image.thumbnail': 'diviner';
23
+ }
24
+ /**
25
+ * Labels for Image Thumbnail Diviner components
26
+ */
27
+ declare const ImageThumbnailDivinerLabels: ImageThumbnailDivinerLabels;
28
+ /**
29
+ * Labels for Image Thumbnail Diviner Stage Diviners
30
+ */
31
+ type ImageThumbnailDivinerStageLabels = ImageThumbnailDivinerLabels & {
32
+ [key in DivinerStageSchema]: IndexingDivinerStage;
33
+ };
34
+
35
+ declare class ImageThumbnailDiviner extends IndexingDiviner implements AttachableDivinerInstance {
36
+ static readonly labels: ImageThumbnailDivinerLabels;
37
+ }
38
+
39
+ type ImageThumbnailDivinerState = StateDictionary & {
40
+ cursor: Hex;
41
+ };
42
+
43
+ /**
44
+ * Transforms candidates for image thumbnail indexing into their indexed representation
45
+ */
46
+ declare class ImageThumbnailIndexCandidateToImageThumbnailIndexDiviner extends AbstractDiviner {
47
+ static readonly configSchemas: Schema[];
48
+ static readonly defaultConfigSchema: Schema;
49
+ static readonly labels: ImageThumbnailDivinerStageLabels;
50
+ protected divineHandler(payloads?: Payload[]): Promise<WithSources<ImageThumbnailResultIndex>[]>;
51
+ }
52
+
53
+ /**
54
+ * Transforms an ImageThumbnailIndex response into an ImageThumbnailResponse response
55
+ */
56
+ declare class ImageThumbnailIndexQueryResponseToImageThumbnailQueryResponseDiviner extends AbstractDiviner {
57
+ static readonly configSchemas: Schema[];
58
+ static readonly defaultConfigSchema: Schema;
59
+ static readonly labels: ImageThumbnailDivinerStageLabels;
60
+ protected divineHandler(payloads?: Payload[]): Promise<ImageThumbnailResult[]>;
61
+ }
62
+
63
+ /**
64
+ * The fields that will need to be indexed on in the underlying store
65
+ */
66
+ type QueryableImageThumbnailResultProperties = Extract<keyof ImageThumbnailResultIndex, 'status' | 'success' | 'timestamp' | 'key'>;
67
+ /**
68
+ * The query that will be used to retrieve the results from the underlying store
69
+ */
70
+ type ImageThumbnailResultQuery = PayloadDivinerQueryPayload & Pick<ImageThumbnailResultIndex, QueryableImageThumbnailResultProperties>;
71
+ /**
72
+ * A type guard for ImageThumbnailResultQuery
73
+ */
74
+ declare const isImageThumbnailResultQuery: (x?: unknown | null) => x is ImageThumbnailResultQuery;
75
+
76
+ /**
77
+ * A diviner that converts ImageThumbnailDivinerQuery to ImageThumbnailResultQuery
78
+ */
79
+ declare class ImageThumbnailQueryToImageThumbnailIndexQueryDiviner extends AbstractDiviner {
80
+ static readonly configSchemas: Schema[];
81
+ static readonly defaultConfigSchema: Schema;
82
+ static readonly labels: ImageThumbnailDivinerStageLabels;
83
+ protected divineHandler(payloads?: Payload[]): Promise<Omit<Omit<ImageThumbnailResultQuery, 'timestamp' | 'success'> & Partial<Pick<ImageThumbnailResultQuery, 'success'>>, 'timestamp'>[]>;
84
+ }
85
+
86
+ type ImageThumbnailStateToIndexCandidateDivinerSchema = `${ImageThumbnailDivinerSchema}.stage.stateToIndexCandidateDiviner`;
87
+ declare const ImageThumbnailStateToIndexCandidateDivinerSchema: ImageThumbnailStateToIndexCandidateDivinerSchema;
88
+
89
+ type ImageThumbnailStateToIndexCandidateDivinerConfigSchema = `${ImageThumbnailStateToIndexCandidateDivinerSchema}.config`;
90
+ declare const ImageThumbnailStateToIndexCandidateDivinerConfigSchema: ImageThumbnailStateToIndexCandidateDivinerConfigSchema;
91
+ type ImageThumbnailStateToIndexCandidateDivinerConfig = DivinerConfig<{
92
+ payloadDivinerLimit?: number;
93
+ /**
94
+ * Where the diviner should look for stored thumbnails
95
+ */
96
+ payloadStore?: SearchableStorage;
97
+ schema: ImageThumbnailStateToIndexCandidateDivinerConfigSchema;
98
+ }>;
99
+
100
+ type ImageThumbnailStateToIndexCandidateDivinerParams = DivinerParams<AnyConfigSchema<ImageThumbnailStateToIndexCandidateDivinerConfig>>;
101
+
102
+ /**
103
+ * All Payload types involved in index candidates for indexing
104
+ */
105
+ type IndexCandidate = BoundWitness | ImageThumbnail | TimeStamp;
106
+ /**
107
+ * The response from the ImageThumbnailStateToIndexCandidateDiviner
108
+ */
109
+ type ImageThumbnailStateToIndexCandidateDivinerResponse = [
110
+ /**
111
+ * The next state of the diviner
112
+ */
113
+ nextState: ModuleState<ImageThumbnailDivinerState>,
114
+ /**
115
+ * The index candidates
116
+ */
117
+ ...IndexCandidate[]
118
+ ];
119
+ /**
120
+ * Transforms candidates for image thumbnail indexing into their indexed representation
121
+ */
122
+ declare class ImageThumbnailStateToIndexCandidateDiviner<TParams extends ImageThumbnailStateToIndexCandidateDivinerParams = ImageThumbnailStateToIndexCandidateDivinerParams> extends AbstractDiviner<TParams> {
123
+ static readonly configSchemas: Schema[];
124
+ static readonly defaultConfigSchema: Schema;
125
+ static readonly labels: ImageThumbnailDivinerStageLabels;
126
+ get payloadDivinerLimit(): number;
127
+ protected static getPayloadsInBoundWitness(bw: BoundWitness, archivist: ArchivistInstance): Promise<IndexCandidate[] | undefined>;
128
+ protected divineHandler(payloads?: Payload[]): Promise<ImageThumbnailStateToIndexCandidateDivinerResponse>;
129
+ /**
130
+ * Retrieves the archivist for the payloadStore
131
+ * @returns The archivist for the payloadStore
132
+ */
133
+ protected getArchivistForStore(): Promise<ArchivistWrapper<_xyo_network_archivist_model.ArchivistModuleInstance<_xyo_network_module_model.ModuleParams<_xyo_network_module_model.AnyConfigSchema<_xyo_network_archivist_model.ArchivistConfig<void, void>>>, _xyo_network_archivist_model.ArchivistModuleEventData>>>;
134
+ /**
135
+ * Retrieves the BoundWitness Diviner for the payloadStore
136
+ * @returns The BoundWitness Diviner for the payloadStore
137
+ */
138
+ protected getBoundWitnessDivinerForStore(): Promise<DivinerWrapper<_xyo_network_diviner_model.DivinerModule<_xyo_network_diviner_model.DivinerParams<_xyo_network_module_model.AnyConfigSchema<_xyo_network_diviner_model.DivinerConfig<void, void>>>, _xyo_network_diviner_model.DivinerModuleEventData<_xyo_network_module_model.ModuleInstance<_xyo_network_module_model.ModuleParams<_xyo_network_module_model.AnyConfigSchema<_xyo_network_module_model.ModuleConfig<object, void>>>, _xyo_network_module_model.ModuleEventData<object>>, Payload, Payload>>, Payload, Payload>>;
139
+ }
140
+
141
+ export { ImageThumbnailDiviner, ImageThumbnailDivinerLabels, ImageThumbnailIndexCandidateToImageThumbnailIndexDiviner, ImageThumbnailIndexQueryResponseToImageThumbnailQueryResponseDiviner, ImageThumbnailQueryToImageThumbnailIndexQueryDiviner, ImageThumbnailStateToIndexCandidateDiviner, ImageThumbnailStateToIndexCandidateDivinerConfigSchema, ImageThumbnailStateToIndexCandidateDivinerSchema, isImageThumbnailResultQuery };
142
+ export type { ImageThumbnailDivinerStageLabels, ImageThumbnailDivinerState, ImageThumbnailResultQuery, ImageThumbnailStateToIndexCandidateDivinerConfig, ImageThumbnailStateToIndexCandidateDivinerParams, ImageThumbnailStateToIndexCandidateDivinerResponse, IndexCandidate, QueryableImageThumbnailResultProperties };
@@ -108,7 +108,6 @@ var ImageThumbnailIndexQueryResponseToImageThumbnailQueryResponseDiviner = class
108
108
  );
109
109
  return imageThumbnailResultIndexes.map((imageThumbnailResultIndex) => {
110
110
  const {
111
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
112
111
  key,
113
112
  schema,
114
113
  $sources,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Diviner/Diviner.ts","../../src/Diviner/ImageThumbnailDivinerLabels.ts","../../src/Diviner/ImageThumbnailIndexCandidateToImageThumbnailIndexDiviner.ts","../../src/Diviner/ImageThumbnailIndexQueryResponseToImageThumbnailQueryResponseDiviner.ts","../../src/Diviner/ImageThumbnailQueryToImageThumbnailIndexQueryDiviner.ts","../../src/Diviner/ImageThumbnailResultQuery.ts","../../src/Diviner/ImageThumbnailStateToIndexCandidateDiviner/Schema.ts","../../src/Diviner/ImageThumbnailStateToIndexCandidateDiviner/Config.ts","../../src/Diviner/ImageThumbnailStateToIndexCandidateDiviner/Diviner.ts"],"sourcesContent":["import { IndexingDiviner } from '@xyo-network/diviner-indexing'\nimport type { AttachableDivinerInstance } from '@xyo-network/diviner-model'\n\nimport { ImageThumbnailDivinerLabels } from './ImageThumbnailDivinerLabels.ts'\n\nexport class ImageThumbnailDiviner extends IndexingDiviner implements AttachableDivinerInstance {\n static override readonly labels: ImageThumbnailDivinerLabels = { ...super.labels, ...ImageThumbnailDivinerLabels }\n}\n","import type { DivinerStageSchema, IndexingDivinerStage } from '@xyo-network/diviner-indexing'\nimport type { Labels } from '@xyo-network/module-model'\n\n/**\n * Labels for Image Thumbnail Diviner components\n */\nexport interface ImageThumbnailDivinerLabels extends Labels {\n 'network.xyo.image.thumbnail': 'diviner'\n}\n\n/**\n * Labels for Image Thumbnail Diviner components\n */\nexport const ImageThumbnailDivinerLabels: ImageThumbnailDivinerLabels = { 'network.xyo.image.thumbnail': 'diviner' }\n\n/**\n * Labels for Image Thumbnail Diviner Stage Diviners\n */\nexport type ImageThumbnailDivinerStageLabels = ImageThumbnailDivinerLabels & {\n /**\n * Labels for the stage of the Image Thumbnail Diviner Stage Diviner\n */\n [key in DivinerStageSchema]: IndexingDivinerStage\n}\n","import type { Hash } from '@xylabs/hex'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { DivinerConfigSchema } from '@xyo-network/diviner-model'\nimport type {\n ImageThumbnail,\n ImageThumbnailResultIndex,\n ImageThumbnailResultIndexFields,\n} from '@xyo-network/image-thumbnail-payload-plugin'\nimport {\n ImageThumbnailResultIndexSchema,\n ImageThumbnailSchema,\n isImageThumbnail,\n} from '@xyo-network/image-thumbnail-payload-plugin'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type {\n Payload, Schema, WithSources,\n} from '@xyo-network/payload-model'\nimport { UrlSchema } from '@xyo-network/url-payload-plugin'\nimport type { TimeStamp } from '@xyo-network/witness-timestamp'\nimport { isTimestamp, TimestampSchema } from '@xyo-network/witness-timestamp'\n\nimport type { ImageThumbnailDivinerStageLabels } from './ImageThumbnailDivinerLabels.ts'\nimport { ImageThumbnailDivinerLabels } from './ImageThumbnailDivinerLabels.ts'\n\n/**\n * Transforms candidates for image thumbnail indexing into their indexed representation\n */\nexport class ImageThumbnailIndexCandidateToImageThumbnailIndexDiviner extends AbstractDiviner {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, DivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = DivinerConfigSchema\n static override readonly labels: ImageThumbnailDivinerStageLabels = {\n ...super.labels,\n ...ImageThumbnailDivinerLabels,\n 'network.xyo.diviner.stage': 'indexCandidateToIndexDiviner',\n }\n\n protected override async divineHandler(payloads: Payload[] = []): Promise<WithSources<ImageThumbnailResultIndex>[]> {\n const bws: BoundWitness[] = payloads.filter(isBoundWitness)\n const imageThumbnailPayloads: ImageThumbnail[] = payloads.filter(isImageThumbnail)\n const timestampPayloads: TimeStamp[] = payloads.filter(isTimestamp)\n if (bws.length > 0 && imageThumbnailPayloads.length > 0 && timestampPayloads.length > 0) {\n const payloadDictionary = await PayloadBuilder.toDataHashMap(payloads)\n // eslint-disable-next-line unicorn/no-array-reduce\n const tuples: [BoundWitness, ImageThumbnail, TimeStamp][] = bws.reduce<[BoundWitness, ImageThumbnail, TimeStamp][]>(\n (acc, curr) => {\n const imageThumbnailIndex = curr.payload_schemas?.findIndex(schema => schema === ImageThumbnailSchema)\n const timestampIndex = curr.payload_schemas?.findIndex(schema => schema === TimestampSchema)\n const imageThumbnailHash = curr.payload_hashes?.[imageThumbnailIndex]\n const timestampHash = curr.payload_hashes?.[timestampIndex]\n const imageThumbnailPayload = [payloadDictionary[imageThumbnailHash]].find(isImageThumbnail) as ImageThumbnail | undefined\n const timestampPayload = [payloadDictionary[timestampHash]].find(isTimestamp) as TimeStamp\n if (imageThumbnailPayload && timestampPayload) acc.push([curr, imageThumbnailPayload, timestampPayload])\n return acc\n },\n [] as [BoundWitness, ImageThumbnail, TimeStamp][],\n )\n const indexes = await Promise.all(\n tuples.map(async ([bw, imageThumbnailPayload, timestampPayload]) => {\n const { sourceUrl: url, http } = imageThumbnailPayload\n const { timestamp } = timestampPayload\n const { status } = http ?? {}\n const success = !!imageThumbnailPayload.url // Call anything with a thumbnail url a success\n const $sources: Hash[] = await PayloadBuilder.dataHashes([bw, imageThumbnailPayload, timestampPayload])\n const urlPayload = { schema: UrlSchema, url }\n const key: Hash = await PayloadBuilder.dataHash(urlPayload)\n const fields: ImageThumbnailResultIndexFields = {\n key, success, timestamp,\n }\n if (status) fields.status = status\n const result = new PayloadBuilder<WithSources<ImageThumbnailResultIndex>>({ schema: ImageThumbnailResultIndexSchema })\n .fields({ ...fields }).meta({ $sources })\n .build()\n return [result]\n }),\n )\n return indexes.flat()\n }\n return []\n }\n}\n","import { exists } from '@xylabs/exists'\nimport { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { DivinerConfigSchema } from '@xyo-network/diviner-model'\nimport type {\n ImageThumbnailResult,\n ImageThumbnailResultFields,\n} from '@xyo-network/image-thumbnail-payload-plugin'\nimport {\n ImageThumbnailResultSchema,\n isImageThumbnailDivinerQuery,\n isImageThumbnailResultIndexWithSources,\n} from '@xyo-network/image-thumbnail-payload-plugin'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { Payload, Schema } from '@xyo-network/payload-model'\nimport { UrlSchema } from '@xyo-network/url-payload-plugin'\n\nimport type { ImageThumbnailDivinerStageLabels } from './ImageThumbnailDivinerLabels.ts'\nimport { ImageThumbnailDivinerLabels } from './ImageThumbnailDivinerLabels.ts'\n\n/**\n * Transforms an ImageThumbnailIndex response into an ImageThumbnailResponse response\n */\nexport class ImageThumbnailIndexQueryResponseToImageThumbnailQueryResponseDiviner extends AbstractDiviner {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, DivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = DivinerConfigSchema\n static override readonly labels: ImageThumbnailDivinerStageLabels = {\n ...super.labels,\n ...ImageThumbnailDivinerLabels,\n 'network.xyo.diviner.stage': 'indexQueryResponseToDivinerQueryResponseDiviner',\n }\n\n protected override async divineHandler(payloads: Payload[] = []): Promise<ImageThumbnailResult[]> {\n // Filter out the two operands\n const imageThumbnailDivinerQueries = payloads.filter(isImageThumbnailDivinerQuery)\n const imageThumbnailResultIndexes = payloads.filter(isImageThumbnailResultIndexWithSources)\n\n // If we have operands\n if (imageThumbnailDivinerQueries.length > 0 && imageThumbnailResultIndexes.length > 0) {\n // Create a dictionary to translate index keys to the urls that represent them\n const keyToUrlDictionary = Object.fromEntries(\n await Promise.all(\n imageThumbnailDivinerQueries.map(async (imageThumbnailDivinerQuery) => {\n const { url } = imageThumbnailDivinerQuery\n const urlPayload = new PayloadBuilder<Omit<ImageThumbnailResult, 'timestamp' | 'success' | 'sources'>>({ schema: UrlSchema })\n .fields({ url })\n .build()\n const key = await PayloadBuilder.dataHash(urlPayload)\n return [key, url] as const\n }),\n ),\n )\n // Map the indexes to responses using the dictionary\n return imageThumbnailResultIndexes.map((imageThumbnailResultIndex) => {\n const {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n key, schema, $sources, ...commonFields\n } = imageThumbnailResultIndex\n const url = keyToUrlDictionary?.[key]\n if (url) {\n const fields: ImageThumbnailResultFields = { ...commonFields, url }\n return new PayloadBuilder<ImageThumbnailResult>({ schema: ImageThumbnailResultSchema }).fields(fields).meta({ $sources }).build()\n }\n }).filter(exists)\n }\n return []\n }\n}\n","import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { DivinerConfigSchema } from '@xyo-network/diviner-model'\nimport { PayloadDivinerQuerySchema } from '@xyo-network/diviner-payload-model'\nimport { isImageThumbnailDivinerQuery } from '@xyo-network/image-thumbnail-payload-plugin'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { Payload, Schema } from '@xyo-network/payload-model'\nimport { UrlSchema } from '@xyo-network/url-payload-plugin'\n\nimport type { ImageThumbnailDivinerStageLabels } from './ImageThumbnailDivinerLabels.ts'\nimport { ImageThumbnailDivinerLabels } from './ImageThumbnailDivinerLabels.ts'\nimport type { ImageThumbnailResultQuery } from './ImageThumbnailResultQuery.ts'\n\n/**\n * A diviner that converts ImageThumbnailDivinerQuery to ImageThumbnailResultQuery\n */\nexport class ImageThumbnailQueryToImageThumbnailIndexQueryDiviner extends AbstractDiviner {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, DivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = DivinerConfigSchema\n static override readonly labels: ImageThumbnailDivinerStageLabels = {\n ...super.labels,\n ...ImageThumbnailDivinerLabels,\n 'network.xyo.diviner.stage': 'divinerQueryToIndexQueryDiviner',\n }\n\n protected override async divineHandler(\n payloads: Payload[] = [],\n ): Promise<Omit<Omit<ImageThumbnailResultQuery, 'timestamp' | 'success'> & Partial<Pick<ImageThumbnailResultQuery, 'success'>>, 'timestamp'>[]> {\n const queries = payloads.filter(isImageThumbnailDivinerQuery)\n if (queries.length > 0) {\n const results = await Promise.all(\n queries.map(async (query) => {\n const {\n limit: payloadLimit, order: payloadOrder, status: payloadStatus, success: payloadSuccess, url,\n } = query\n const limit = payloadLimit ?? 1\n const order = payloadOrder ?? 'desc'\n const urlPayload = { schema: UrlSchema, url }\n const key = await PayloadBuilder.dataHash(urlPayload)\n const fields: Omit<ImageThumbnailResultQuery, 'schema' | 'timestamp' | 'success'> & Partial<Pick<ImageThumbnailResultQuery, 'success'>> = {\n key,\n limit,\n order,\n }\n if (payloadSuccess !== undefined) fields.success = payloadSuccess\n if (payloadStatus !== undefined) fields.status = payloadStatus\n return new PayloadBuilder<\n Omit<ImageThumbnailResultQuery, 'timestamp' | 'success'> & Partial<Pick<ImageThumbnailResultQuery, 'success'>>\n >({ schema: PayloadDivinerQuerySchema })\n .fields(fields)\n .build()\n }),\n )\n return results\n }\n return []\n }\n}\n","import type { PayloadDivinerQueryPayload } from '@xyo-network/diviner-payload-model'\nimport { PayloadDivinerQuerySchema } from '@xyo-network/diviner-payload-model'\nimport type { ImageThumbnailResultIndex } from '@xyo-network/image-thumbnail-payload-plugin'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\n/**\n * The fields that will need to be indexed on in the underlying store\n */\nexport type QueryableImageThumbnailResultProperties = Extract<keyof ImageThumbnailResultIndex, 'status' | 'success' | 'timestamp' | 'key'>\n\n/**\n * The query that will be used to retrieve the results from the underlying store\n */\nexport type ImageThumbnailResultQuery = PayloadDivinerQueryPayload & Pick<ImageThumbnailResultIndex, QueryableImageThumbnailResultProperties>\n\n/**\n * A type guard for ImageThumbnailResultQuery\n */\n// TODO: Use a more derived schema than PayloadDivinerQuerySchema\nexport const isImageThumbnailResultQuery = isPayloadOfSchemaType<ImageThumbnailResultQuery>(PayloadDivinerQuerySchema)\n","import { ImageThumbnailDivinerSchema } from '@xyo-network/image-thumbnail-payload-plugin'\n\nexport type ImageThumbnailStateToIndexCandidateDivinerSchema = `${ImageThumbnailDivinerSchema}.stage.stateToIndexCandidateDiviner`\nexport const ImageThumbnailStateToIndexCandidateDivinerSchema: ImageThumbnailStateToIndexCandidateDivinerSchema\n= `${ImageThumbnailDivinerSchema}.stage.stateToIndexCandidateDiviner`\n","import type { DivinerConfig } from '@xyo-network/diviner-model'\nimport type { SearchableStorage } from '@xyo-network/image-thumbnail-payload-plugin'\n\nimport { ImageThumbnailStateToIndexCandidateDivinerSchema } from './Schema.ts'\n\nexport type ImageThumbnailStateToIndexCandidateDivinerConfigSchema = `${ImageThumbnailStateToIndexCandidateDivinerSchema}.config`\nexport const ImageThumbnailStateToIndexCandidateDivinerConfigSchema: ImageThumbnailStateToIndexCandidateDivinerConfigSchema\n= `${ImageThumbnailStateToIndexCandidateDivinerSchema}.config`\n\nexport type ImageThumbnailStateToIndexCandidateDivinerConfig = DivinerConfig<{\n payloadDivinerLimit?: number\n /**\n * Where the diviner should look for stored thumbnails\n */\n payloadStore?: SearchableStorage\n schema: ImageThumbnailStateToIndexCandidateDivinerConfigSchema\n}>\n","import { filterAs } from '@xylabs/array'\nimport { assertEx } from '@xylabs/assert'\nimport { exists } from '@xylabs/exists'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { ArchivistInstance, ArchivistNextOptions } from '@xyo-network/archivist-model'\nimport { ArchivistWrapper } from '@xyo-network/archivist-wrapper'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { asBoundWitness, isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { payloadSchemasContainsAll } from '@xyo-network/boundwitness-validator'\nimport { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { DivinerWrapper } from '@xyo-network/diviner-wrapper'\nimport type { ImageThumbnail } from '@xyo-network/image-thumbnail-payload-plugin'\nimport { ImageThumbnailSchema, isImageThumbnail } from '@xyo-network/image-thumbnail-payload-plugin'\nimport type { ModuleState } from '@xyo-network/module-model'\nimport { isModuleState, ModuleStateSchema } from '@xyo-network/module-model'\nimport type { Payload, Schema } from '@xyo-network/payload-model'\nimport { SequenceConstants } from '@xyo-network/payload-model'\nimport type { TimeStamp } from '@xyo-network/witness-timestamp'\nimport { isTimestamp, TimestampSchema } from '@xyo-network/witness-timestamp'\n\nimport type { ImageThumbnailDivinerStageLabels } from '../ImageThumbnailDivinerLabels.ts'\nimport { ImageThumbnailDivinerLabels } from '../ImageThumbnailDivinerLabels.ts'\nimport type { ImageThumbnailDivinerState } from '../ImageThumbnailDivinerState.ts'\nimport { ImageThumbnailStateToIndexCandidateDivinerConfigSchema } from './Config.ts'\nimport type { ImageThumbnailStateToIndexCandidateDivinerParams } from './Params.ts'\n\n/**\n * All Payload types involved in index candidates for indexing\n */\nexport type IndexCandidate = BoundWitness | ImageThumbnail | TimeStamp\n\n/**\n * The response from the ImageThumbnailStateToIndexCandidateDiviner\n */\nexport type ImageThumbnailStateToIndexCandidateDivinerResponse = [\n /**\n * The next state of the diviner\n */\n nextState: ModuleState<ImageThumbnailDivinerState>,\n /**\n * The index candidates\n */\n ...IndexCandidate[],\n]\n\n/**\n * The required payload_schemas within BoundWitnesses to identify index candidates\n */\nconst payload_schemas = [ImageThumbnailSchema, TimestampSchema]\n\n/**\n * Index candidate identity functions\n */\nconst indexCandidateIdentityFunctions = [isImageThumbnail, isTimestamp] as const\nconst isIndexCandidate = (x?: unknown | null): x is IndexCandidate => {\n return indexCandidateIdentityFunctions.map(is => is(x)).some(Boolean)\n}\nconst asIndexCandidate = AsObjectFactory.create(isIndexCandidate)\n\n/**\n * The default order to search Bound Witnesses to identify index candidates\n */\nconst order = 'asc'\n\n/**\n * The name of the module (for logging purposes)\n */\nconst moduleName = 'ImageThumbnailStateToIndexCandidateDiviner'\n\n/**\n * Transforms candidates for image thumbnail indexing into their indexed representation\n */\nexport class ImageThumbnailStateToIndexCandidateDiviner<\n TParams extends ImageThumbnailStateToIndexCandidateDivinerParams = ImageThumbnailStateToIndexCandidateDivinerParams,\n> extends AbstractDiviner<TParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, ImageThumbnailStateToIndexCandidateDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = ImageThumbnailStateToIndexCandidateDivinerConfigSchema\n static override readonly labels: ImageThumbnailDivinerStageLabels = {\n ...super.labels,\n ...ImageThumbnailDivinerLabels,\n 'network.xyo.diviner.stage': 'stateToIndexCandidateDiviner',\n }\n\n get payloadDivinerLimit() {\n return this.config.payloadDivinerLimit ?? 1000\n }\n\n protected static async getPayloadsInBoundWitness(bw: BoundWitness, archivist: ArchivistInstance): Promise<IndexCandidate[] | undefined> {\n const indexes = payload_schemas.map(schema => bw.payload_schemas?.findIndex(s => s === schema))\n const hashes = indexes.map(index => bw.payload_hashes?.[index])\n const results = await archivist.get(hashes)\n const filteredResults = indexCandidateIdentityFunctions.map(is => results.find(is))\n if (filteredResults.includes(undefined)) return undefined\n const indexCandidates: IndexCandidate[] = filterAs(filteredResults, asIndexCandidate)\n return [bw, ...indexCandidates]\n }\n\n protected override async divineHandler(payloads: Payload[] = []): Promise<ImageThumbnailStateToIndexCandidateDivinerResponse> {\n // Retrieve the last state from what was passed in\n const lastState = payloads.find(isModuleState<ImageThumbnailDivinerState>)\n // If there is no last state, start from the beginning\n ?? { schema: ModuleStateSchema, state: { cursor: SequenceConstants.minLocalSequence } }\n\n // Get the last cursor\n const cursor = lastState?.state?.cursor\n // Get the archivist for the store\n const sourceArchivist = await this.getArchivistForStore()\n if (!sourceArchivist) return [lastState]\n\n // Get the next batch of results\n const nextOffset: ArchivistNextOptions = { limit: this.payloadDivinerLimit, order }\n // Only use the cursor if it's a valid offset\n if (cursor !== SequenceConstants.minLocalSequence) nextOffset.cursor = cursor\n // Get next batch of results starting from the offset\n const next = await sourceArchivist.next(nextOffset)\n if (next.length === 0) return [lastState]\n\n const batch = filterAs(next, asBoundWitness)\n .filter(exists)\n .filter(bw => payloadSchemasContainsAll(bw, payload_schemas))\n // Get source data\n const indexCandidates: IndexCandidate[] = (await Promise.all(\n batch\n .filter(isBoundWitness)\n .map(bw => ImageThumbnailStateToIndexCandidateDiviner.getPayloadsInBoundWitness(bw, sourceArchivist)),\n ))\n .filter(exists)\n .flat()\n const nextCursor = assertEx(next.at(-1)?._sequence, () => `${moduleName}: Expected next to have a sequence`)\n const nextState: ModuleState<ImageThumbnailDivinerState> = { schema: ModuleStateSchema, state: { ...lastState.state, cursor: nextCursor } }\n return [nextState, ...indexCandidates]\n }\n\n /**\n * Retrieves the archivist for the payloadStore\n * @returns The archivist for the payloadStore\n */\n protected async getArchivistForStore() {\n const name = assertEx(this.config?.payloadStore?.archivist, () => `${moduleName}: Config for payloadStore.archivist not specified`)\n const mod = assertEx(await this.resolve(name), () => `${moduleName}: Failed to resolve payloadStore.archivist`)\n return ArchivistWrapper.wrap(mod, this.account)\n }\n\n /**\n * Retrieves the BoundWitness Diviner for the payloadStore\n * @returns The BoundWitness Diviner for the payloadStore\n */\n protected async getBoundWitnessDivinerForStore() {\n const name = assertEx(\n this.config?.payloadStore?.boundWitnessDiviner,\n () => `${moduleName}: Config for payloadStore.boundWitnessDiviner not specified`,\n )\n const mod = assertEx(await this.resolve(name), () => `${moduleName}: Failed to resolve payloadStore.boundWitnessDiviner`)\n return DivinerWrapper.wrap(mod, this.account)\n }\n}\n"],"mappings":";AAAA,SAAS,uBAAuB;;;ACazB,IAAM,8BAA2D,EAAE,+BAA+B,UAAU;;;ADR5G,IAAM,wBAAN,cAAoC,gBAAqD;AAAA,EAC9F,OAAyB,SAAsC,EAAE,GAAG,MAAM,QAAQ,GAAG,4BAA4B;AACnH;;;AELA,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AAChC,SAAS,2BAA2B;AAMpC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAI/B,SAAS,iBAAiB;AAE1B,SAAS,aAAa,uBAAuB;AAQtC,IAAM,2DAAN,cAAuE,gBAAgB;AAAA,EAC5F,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,mBAAmB;AAAA,EAC/F,OAAyB,sBAA8B;AAAA,EACvD,OAAyB,SAA2C;AAAA,IAClE,GAAG,MAAM;AAAA,IACT,GAAG;AAAA,IACH,6BAA6B;AAAA,EAC/B;AAAA,EAEA,MAAyB,cAAc,WAAsB,CAAC,GAAsD;AAClH,UAAM,MAAsB,SAAS,OAAO,cAAc;AAC1D,UAAM,yBAA2C,SAAS,OAAO,gBAAgB;AACjF,UAAM,oBAAiC,SAAS,OAAO,WAAW;AAClE,QAAI,IAAI,SAAS,KAAK,uBAAuB,SAAS,KAAK,kBAAkB,SAAS,GAAG;AACvF,YAAM,oBAAoB,MAAM,eAAe,cAAc,QAAQ;AAErE,YAAM,SAAsD,IAAI;AAAA,QAC9D,CAAC,KAAK,SAAS;AACb,gBAAM,sBAAsB,KAAK,iBAAiB,UAAU,YAAU,WAAW,oBAAoB;AACrG,gBAAM,iBA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UAAU,OAAO,QAAQ,WAAW,EAAE;AAC1I,WAAO,CAAC,WAAW,GAAG,eAAe;AAAA,EACvC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAgB,uBAAuB;AACrC,UAAM,OAAO,SAAS,KAAK,QAAQ,cAAc,WAAW,MAAM,GAAG,UAAU,mDAAmD;AAClI,UAAM,MAAM,SAAS,MAAM,KAAK,QAAQ,IAAI,GAAG,MAAM,GAAG,UAAU,4CAA4C;AAC9G,WAAO,iBAAiB,KAAK,KAAK,KAAK,OAAO;AAAA,EAChD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAgB,iCAAiC;AAC/C,UAAM,OAAO;AAAA,MACX,KAAK,QAAQ,cAAc;AAAA,MAC3B,MAAM,GAAG,UAAU;AAAA,IACrB;AACA,UAAM,MAAM,SAAS,MAAM,KAAK,QAAQ,IAAI,GAAG,MAAM,GAAG,UAAU,sDAAsD;AACxH,WAAO,eAAe,KAAK,KAAK,KAAK,OAAO;AAAA,EAC9C;AACF;","names":["AbstractDiviner","DivinerConfigSchema","PayloadBuilder","UrlSchema","AbstractDiviner","DivinerConfigSchema","PayloadBuilder","UrlSchema","AbstractDiviner","DivinerConfigSchema","isImageThumbnailDivinerQuery","PayloadBuilder","UrlSchema","AbstractDiviner","DivinerConfigSchema","isImageThumbnailDivinerQuery","order","UrlSchema","PayloadBuilder","PayloadDivinerQuerySchema","exists","isBoundWitness","AbstractDiviner","ImageThumbnailSchema","isImageThumbnail","isTimestamp","TimestampSchema","ImageThumbnailSchema","TimestampSchema","isImageThumbnail","isTimestamp","AbstractDiviner","exists","isBoundWitness"]}
1
+ {"version":3,"sources":["../../src/Diviner/Diviner.ts","../../src/Diviner/ImageThumbnailDivinerLabels.ts","../../src/Diviner/ImageThumbnailIndexCandidateToImageThumbnailIndexDiviner.ts","../../src/Diviner/ImageThumbnailIndexQueryResponseToImageThumbnailQueryResponseDiviner.ts","../../src/Diviner/ImageThumbnailQueryToImageThumbnailIndexQueryDiviner.ts","../../src/Diviner/ImageThumbnailResultQuery.ts","../../src/Diviner/ImageThumbnailStateToIndexCandidateDiviner/Schema.ts","../../src/Diviner/ImageThumbnailStateToIndexCandidateDiviner/Config.ts","../../src/Diviner/ImageThumbnailStateToIndexCandidateDiviner/Diviner.ts"],"sourcesContent":["import { IndexingDiviner } from '@xyo-network/diviner-indexing'\nimport type { AttachableDivinerInstance } from '@xyo-network/diviner-model'\n\nimport { ImageThumbnailDivinerLabels } from './ImageThumbnailDivinerLabels.ts'\n\nexport class ImageThumbnailDiviner extends IndexingDiviner implements AttachableDivinerInstance {\n static override readonly labels: ImageThumbnailDivinerLabels = { ...super.labels, ...ImageThumbnailDivinerLabels }\n}\n","import type { DivinerStageSchema, IndexingDivinerStage } from '@xyo-network/diviner-indexing'\nimport type { Labels } from '@xyo-network/module-model'\n\n/**\n * Labels for Image Thumbnail Diviner components\n */\nexport interface ImageThumbnailDivinerLabels extends Labels {\n 'network.xyo.image.thumbnail': 'diviner'\n}\n\n/**\n * Labels for Image Thumbnail Diviner components\n */\nexport const ImageThumbnailDivinerLabels: ImageThumbnailDivinerLabels = { 'network.xyo.image.thumbnail': 'diviner' }\n\n/**\n * Labels for Image Thumbnail Diviner Stage Diviners\n */\nexport type ImageThumbnailDivinerStageLabels = ImageThumbnailDivinerLabels & {\n /**\n * Labels for the stage of the Image Thumbnail Diviner Stage Diviner\n */\n [key in DivinerStageSchema]: IndexingDivinerStage\n}\n","import type { Hash } from '@xylabs/hex'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { DivinerConfigSchema } from '@xyo-network/diviner-model'\nimport type {\n ImageThumbnail,\n ImageThumbnailResultIndex,\n ImageThumbnailResultIndexFields,\n} from '@xyo-network/image-thumbnail-payload-plugin'\nimport {\n ImageThumbnailResultIndexSchema,\n ImageThumbnailSchema,\n isImageThumbnail,\n} from '@xyo-network/image-thumbnail-payload-plugin'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type {\n Payload, Schema, WithSources,\n} from '@xyo-network/payload-model'\nimport { UrlSchema } from '@xyo-network/url-payload-plugin'\nimport type { TimeStamp } from '@xyo-network/witness-timestamp'\nimport { isTimestamp, TimestampSchema } from '@xyo-network/witness-timestamp'\n\nimport type { ImageThumbnailDivinerStageLabels } from './ImageThumbnailDivinerLabels.ts'\nimport { ImageThumbnailDivinerLabels } from './ImageThumbnailDivinerLabels.ts'\n\n/**\n * Transforms candidates for image thumbnail indexing into their indexed representation\n */\nexport class ImageThumbnailIndexCandidateToImageThumbnailIndexDiviner extends AbstractDiviner {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, DivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = DivinerConfigSchema\n static override readonly labels: ImageThumbnailDivinerStageLabels = {\n ...super.labels,\n ...ImageThumbnailDivinerLabels,\n 'network.xyo.diviner.stage': 'indexCandidateToIndexDiviner',\n }\n\n protected override async divineHandler(payloads: Payload[] = []): Promise<WithSources<ImageThumbnailResultIndex>[]> {\n const bws: BoundWitness[] = payloads.filter(isBoundWitness)\n const imageThumbnailPayloads: ImageThumbnail[] = payloads.filter(isImageThumbnail)\n const timestampPayloads: TimeStamp[] = payloads.filter(isTimestamp)\n if (bws.length > 0 && imageThumbnailPayloads.length > 0 && timestampPayloads.length > 0) {\n const payloadDictionary = await PayloadBuilder.toDataHashMap(payloads)\n // eslint-disable-next-line unicorn/no-array-reduce\n const tuples: [BoundWitness, ImageThumbnail, TimeStamp][] = bws.reduce<[BoundWitness, ImageThumbnail, TimeStamp][]>(\n (acc, curr) => {\n const imageThumbnailIndex = curr.payload_schemas?.findIndex(schema => schema === ImageThumbnailSchema)\n const timestampIndex = curr.payload_schemas?.findIndex(schema => schema === TimestampSchema)\n const imageThumbnailHash = curr.payload_hashes?.[imageThumbnailIndex]\n const timestampHash = curr.payload_hashes?.[timestampIndex]\n const imageThumbnailPayload = [payloadDictionary[imageThumbnailHash]].find(isImageThumbnail) as ImageThumbnail | undefined\n const timestampPayload = [payloadDictionary[timestampHash]].find(isTimestamp) as TimeStamp\n if (imageThumbnailPayload && timestampPayload) acc.push([curr, imageThumbnailPayload, timestampPayload])\n return acc\n },\n [] as [BoundWitness, ImageThumbnail, TimeStamp][],\n )\n const indexes = await Promise.all(\n tuples.map(async ([bw, imageThumbnailPayload, timestampPayload]) => {\n const { sourceUrl: url, http } = imageThumbnailPayload\n const { timestamp } = timestampPayload\n const { status } = http ?? {}\n const success = !!imageThumbnailPayload.url // Call anything with a thumbnail url a success\n const $sources: Hash[] = await PayloadBuilder.dataHashes([bw, imageThumbnailPayload, timestampPayload])\n const urlPayload = { schema: UrlSchema, url }\n const key: Hash = await PayloadBuilder.dataHash(urlPayload)\n const fields: ImageThumbnailResultIndexFields = {\n key, success, timestamp,\n }\n if (status) fields.status = status\n const result = new PayloadBuilder<WithSources<ImageThumbnailResultIndex>>({ schema: ImageThumbnailResultIndexSchema })\n .fields({ ...fields }).meta({ $sources })\n .build()\n return [result]\n }),\n )\n return indexes.flat()\n }\n return []\n }\n}\n","import { exists } from '@xylabs/exists'\nimport { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { DivinerConfigSchema } from '@xyo-network/diviner-model'\nimport type {\n ImageThumbnailResult,\n ImageThumbnailResultFields,\n} from '@xyo-network/image-thumbnail-payload-plugin'\nimport {\n ImageThumbnailResultSchema,\n isImageThumbnailDivinerQuery,\n isImageThumbnailResultIndexWithSources,\n} from '@xyo-network/image-thumbnail-payload-plugin'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { Payload, Schema } from '@xyo-network/payload-model'\nimport { UrlSchema } from '@xyo-network/url-payload-plugin'\n\nimport type { ImageThumbnailDivinerStageLabels } from './ImageThumbnailDivinerLabels.ts'\nimport { ImageThumbnailDivinerLabels } from './ImageThumbnailDivinerLabels.ts'\n\n/**\n * Transforms an ImageThumbnailIndex response into an ImageThumbnailResponse response\n */\nexport class ImageThumbnailIndexQueryResponseToImageThumbnailQueryResponseDiviner extends AbstractDiviner {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, DivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = DivinerConfigSchema\n static override readonly labels: ImageThumbnailDivinerStageLabels = {\n ...super.labels,\n ...ImageThumbnailDivinerLabels,\n 'network.xyo.diviner.stage': 'indexQueryResponseToDivinerQueryResponseDiviner',\n }\n\n protected override async divineHandler(payloads: Payload[] = []): Promise<ImageThumbnailResult[]> {\n // Filter out the two operands\n const imageThumbnailDivinerQueries = payloads.filter(isImageThumbnailDivinerQuery)\n const imageThumbnailResultIndexes = payloads.filter(isImageThumbnailResultIndexWithSources)\n\n // If we have operands\n if (imageThumbnailDivinerQueries.length > 0 && imageThumbnailResultIndexes.length > 0) {\n // Create a dictionary to translate index keys to the urls that represent them\n const keyToUrlDictionary = Object.fromEntries(\n await Promise.all(\n imageThumbnailDivinerQueries.map(async (imageThumbnailDivinerQuery) => {\n const { url } = imageThumbnailDivinerQuery\n const urlPayload = new PayloadBuilder<Omit<ImageThumbnailResult, 'timestamp' | 'success' | 'sources'>>({ schema: UrlSchema })\n .fields({ url })\n .build()\n const key = await PayloadBuilder.dataHash(urlPayload)\n return [key, url] as const\n }),\n ),\n )\n // Map the indexes to responses using the dictionary\n return imageThumbnailResultIndexes.map((imageThumbnailResultIndex) => {\n const {\n\n key, schema, $sources, ...commonFields\n } = imageThumbnailResultIndex\n const url = keyToUrlDictionary?.[key]\n if (url) {\n const fields: ImageThumbnailResultFields = { ...commonFields, url }\n return new PayloadBuilder<ImageThumbnailResult>({ schema: ImageThumbnailResultSchema }).fields(fields).meta({ $sources }).build()\n }\n }).filter(exists)\n }\n return []\n }\n}\n","import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { DivinerConfigSchema } from '@xyo-network/diviner-model'\nimport { PayloadDivinerQuerySchema } from '@xyo-network/diviner-payload-model'\nimport { isImageThumbnailDivinerQuery } from '@xyo-network/image-thumbnail-payload-plugin'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { Payload, Schema } from '@xyo-network/payload-model'\nimport { UrlSchema } from '@xyo-network/url-payload-plugin'\n\nimport type { ImageThumbnailDivinerStageLabels } from './ImageThumbnailDivinerLabels.ts'\nimport { ImageThumbnailDivinerLabels } from './ImageThumbnailDivinerLabels.ts'\nimport type { ImageThumbnailResultQuery } from './ImageThumbnailResultQuery.ts'\n\n/**\n * A diviner that converts ImageThumbnailDivinerQuery to ImageThumbnailResultQuery\n */\nexport class ImageThumbnailQueryToImageThumbnailIndexQueryDiviner extends AbstractDiviner {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, DivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = DivinerConfigSchema\n static override readonly labels: ImageThumbnailDivinerStageLabels = {\n ...super.labels,\n ...ImageThumbnailDivinerLabels,\n 'network.xyo.diviner.stage': 'divinerQueryToIndexQueryDiviner',\n }\n\n protected override async divineHandler(\n payloads: Payload[] = [],\n ): Promise<Omit<Omit<ImageThumbnailResultQuery, 'timestamp' | 'success'> & Partial<Pick<ImageThumbnailResultQuery, 'success'>>, 'timestamp'>[]> {\n const queries = payloads.filter(isImageThumbnailDivinerQuery)\n if (queries.length > 0) {\n const results = await Promise.all(\n queries.map(async (query) => {\n const {\n limit: payloadLimit, order: payloadOrder, status: payloadStatus, success: payloadSuccess, url,\n } = query\n const limit = payloadLimit ?? 1\n const order = payloadOrder ?? 'desc'\n const urlPayload = { schema: UrlSchema, url }\n const key = await PayloadBuilder.dataHash(urlPayload)\n const fields: Omit<ImageThumbnailResultQuery, 'schema' | 'timestamp' | 'success'> & Partial<Pick<ImageThumbnailResultQuery, 'success'>> = {\n key,\n limit,\n order,\n }\n if (payloadSuccess !== undefined) fields.success = payloadSuccess\n if (payloadStatus !== undefined) fields.status = payloadStatus\n return new PayloadBuilder<\n Omit<ImageThumbnailResultQuery, 'timestamp' | 'success'> & Partial<Pick<ImageThumbnailResultQuery, 'success'>>\n >({ schema: PayloadDivinerQuerySchema })\n .fields(fields)\n .build()\n }),\n )\n return results\n }\n return []\n }\n}\n","import type { PayloadDivinerQueryPayload } from '@xyo-network/diviner-payload-model'\nimport { PayloadDivinerQuerySchema } from '@xyo-network/diviner-payload-model'\nimport type { ImageThumbnailResultIndex } from '@xyo-network/image-thumbnail-payload-plugin'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\n/**\n * The fields that will need to be indexed on in the underlying store\n */\nexport type QueryableImageThumbnailResultProperties = Extract<keyof ImageThumbnailResultIndex, 'status' | 'success' | 'timestamp' | 'key'>\n\n/**\n * The query that will be used to retrieve the results from the underlying store\n */\nexport type ImageThumbnailResultQuery = PayloadDivinerQueryPayload & Pick<ImageThumbnailResultIndex, QueryableImageThumbnailResultProperties>\n\n/**\n * A type guard for ImageThumbnailResultQuery\n */\n// TODO: Use a more derived schema than PayloadDivinerQuerySchema\nexport const isImageThumbnailResultQuery = isPayloadOfSchemaType<ImageThumbnailResultQuery>(PayloadDivinerQuerySchema)\n","import { ImageThumbnailDivinerSchema } from '@xyo-network/image-thumbnail-payload-plugin'\n\nexport type ImageThumbnailStateToIndexCandidateDivinerSchema = `${ImageThumbnailDivinerSchema}.stage.stateToIndexCandidateDiviner`\nexport const ImageThumbnailStateToIndexCandidateDivinerSchema: ImageThumbnailStateToIndexCandidateDivinerSchema\n= `${ImageThumbnailDivinerSchema}.stage.stateToIndexCandidateDiviner`\n","import type { DivinerConfig } from '@xyo-network/diviner-model'\nimport type { SearchableStorage } from '@xyo-network/image-thumbnail-payload-plugin'\n\nimport { ImageThumbnailStateToIndexCandidateDivinerSchema } from './Schema.ts'\n\nexport type ImageThumbnailStateToIndexCandidateDivinerConfigSchema = `${ImageThumbnailStateToIndexCandidateDivinerSchema}.config`\nexport const ImageThumbnailStateToIndexCandidateDivinerConfigSchema: ImageThumbnailStateToIndexCandidateDivinerConfigSchema\n= `${ImageThumbnailStateToIndexCandidateDivinerSchema}.config`\n\nexport type ImageThumbnailStateToIndexCandidateDivinerConfig = DivinerConfig<{\n payloadDivinerLimit?: number\n /**\n * Where the diviner should look for stored thumbnails\n */\n payloadStore?: SearchableStorage\n schema: ImageThumbnailStateToIndexCandidateDivinerConfigSchema\n}>\n","import { filterAs } from '@xylabs/array'\nimport { assertEx } from '@xylabs/assert'\nimport { exists } from '@xylabs/exists'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { ArchivistInstance, ArchivistNextOptions } from '@xyo-network/archivist-model'\nimport { ArchivistWrapper } from '@xyo-network/archivist-wrapper'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { asBoundWitness, isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { payloadSchemasContainsAll } from '@xyo-network/boundwitness-validator'\nimport { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { DivinerWrapper } from '@xyo-network/diviner-wrapper'\nimport type { ImageThumbnail } from '@xyo-network/image-thumbnail-payload-plugin'\nimport { ImageThumbnailSchema, isImageThumbnail } from '@xyo-network/image-thumbnail-payload-plugin'\nimport type { ModuleState } from '@xyo-network/module-model'\nimport { isModuleState, ModuleStateSchema } from '@xyo-network/module-model'\nimport type { Payload, Schema } from '@xyo-network/payload-model'\nimport { SequenceConstants } from '@xyo-network/payload-model'\nimport type { TimeStamp } from '@xyo-network/witness-timestamp'\nimport { isTimestamp, TimestampSchema } from '@xyo-network/witness-timestamp'\n\nimport type { ImageThumbnailDivinerStageLabels } from '../ImageThumbnailDivinerLabels.ts'\nimport { ImageThumbnailDivinerLabels } from '../ImageThumbnailDivinerLabels.ts'\nimport type { ImageThumbnailDivinerState } from '../ImageThumbnailDivinerState.ts'\nimport { ImageThumbnailStateToIndexCandidateDivinerConfigSchema } from './Config.ts'\nimport type { ImageThumbnailStateToIndexCandidateDivinerParams } from './Params.ts'\n\n/**\n * All Payload types involved in index candidates for indexing\n */\nexport type IndexCandidate = BoundWitness | ImageThumbnail | TimeStamp\n\n/**\n * The response from the ImageThumbnailStateToIndexCandidateDiviner\n */\nexport type ImageThumbnailStateToIndexCandidateDivinerResponse = [\n /**\n * The next state of the diviner\n */\n nextState: ModuleState<ImageThumbnailDivinerState>,\n /**\n * The index candidates\n */\n ...IndexCandidate[],\n]\n\n/**\n * The required payload_schemas within BoundWitnesses to identify index candidates\n */\nconst payload_schemas = [ImageThumbnailSchema, TimestampSchema]\n\n/**\n * Index candidate identity functions\n */\nconst indexCandidateIdentityFunctions = [isImageThumbnail, isTimestamp] as const\nconst isIndexCandidate = (x?: unknown | null): x is IndexCandidate => {\n return indexCandidateIdentityFunctions.map(is => is(x)).some(Boolean)\n}\nconst asIndexCandidate = AsObjectFactory.create(isIndexCandidate)\n\n/**\n * The default order to search Bound Witnesses to identify index candidates\n */\nconst order = 'asc'\n\n/**\n * The name of the module (for logging purposes)\n */\nconst moduleName = 'ImageThumbnailStateToIndexCandidateDiviner'\n\n/**\n * Transforms candidates for image thumbnail indexing into their indexed representation\n */\nexport class ImageThumbnailStateToIndexCandidateDiviner<\n TParams extends ImageThumbnailStateToIndexCandidateDivinerParams = ImageThumbnailStateToIndexCandidateDivinerParams,\n> extends AbstractDiviner<TParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, ImageThumbnailStateToIndexCandidateDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = ImageThumbnailStateToIndexCandidateDivinerConfigSchema\n static override readonly labels: ImageThumbnailDivinerStageLabels = {\n ...super.labels,\n ...ImageThumbnailDivinerLabels,\n 'network.xyo.diviner.stage': 'stateToIndexCandidateDiviner',\n }\n\n get payloadDivinerLimit() {\n return this.config.payloadDivinerLimit ?? 1000\n }\n\n protected static async getPayloadsInBoundWitness(bw: BoundWitness, archivist: ArchivistInstance): Promise<IndexCandidate[] | undefined> {\n const indexes = payload_schemas.map(schema => bw.payload_schemas?.findIndex(s => s === schema))\n const hashes = indexes.map(index => bw.payload_hashes?.[index])\n const results = await archivist.get(hashes)\n const filteredResults = indexCandidateIdentityFunctions.map(is => results.find(is))\n if (filteredResults.includes(undefined)) return undefined\n const indexCandidates: IndexCandidate[] = filterAs(filteredResults, asIndexCandidate)\n return [bw, ...indexCandidates]\n }\n\n protected override async divineHandler(payloads: Payload[] = []): Promise<ImageThumbnailStateToIndexCandidateDivinerResponse> {\n // Retrieve the last state from what was passed in\n const lastState = payloads.find(isModuleState<ImageThumbnailDivinerState>)\n // If there is no last state, start from the beginning\n ?? { schema: ModuleStateSchema, state: { cursor: SequenceConstants.minLocalSequence } }\n\n // Get the last cursor\n const cursor = lastState?.state?.cursor\n // Get the archivist for the store\n const sourceArchivist = await this.getArchivistForStore()\n if (!sourceArchivist) return [lastState]\n\n // Get the next batch of results\n const nextOffset: ArchivistNextOptions = { limit: this.payloadDivinerLimit, order }\n // Only use the cursor if it's a valid offset\n if (cursor !== SequenceConstants.minLocalSequence) nextOffset.cursor = cursor\n // Get next batch of results starting from the offset\n const next = await sourceArchivist.next(nextOffset)\n if (next.length === 0) return [lastState]\n\n const batch = filterAs(next, asBoundWitness)\n .filter(exists)\n .filter(bw => payloadSchemasContainsAll(bw, payload_schemas))\n // Get source data\n const indexCandidates: IndexCandidate[] = (await Promise.all(\n batch\n .filter(isBoundWitness)\n .map(bw => ImageThumbnailStateToIndexCandidateDiviner.getPayloadsInBoundWitness(bw, sourceArchivist)),\n ))\n .filter(exists)\n .flat()\n const nextCursor = assertEx(next.at(-1)?._sequence, () => `${moduleName}: Expected next to have a sequence`)\n const nextState: ModuleState<ImageThumbnailDivinerState> = { schema: ModuleStateSchema, state: { ...lastState.state, cursor: nextCursor } }\n return [nextState, ...indexCandidates]\n }\n\n /**\n * Retrieves the archivist for the payloadStore\n * @returns The archivist for the payloadStore\n */\n protected async getArchivistForStore() {\n const name = assertEx(this.config?.payloadStore?.archivist, () => `${moduleName}: Config for payloadStore.archivist not specified`)\n const mod = assertEx(await this.resolve(name), () => `${moduleName}: Failed to resolve payloadStore.archivist`)\n return ArchivistWrapper.wrap(mod, this.account)\n }\n\n /**\n * Retrieves the BoundWitness Diviner for the payloadStore\n * @returns The BoundWitness Diviner for the payloadStore\n */\n protected async getBoundWitnessDivinerForStore() {\n const name = assertEx(\n this.config?.payloadStore?.boundWitnessDiviner,\n () => `${moduleName}: Config for payloadStore.boundWitnessDiviner not specified`,\n )\n const mod = assertEx(await this.resolve(name), () => `${moduleName}: Failed to resolve payloadStore.boundWitnessDiviner`)\n return DivinerWrapper.wrap(mod, this.account)\n }\n}\n"],"mappings":";AAAA,SAAS,uBAAuB;;;ACazB,IAAM,8BAA2D,EAAE,+BAA+B,UAAU;;;ADR5G,IAAM,wBAAN,cAAoC,gBAAqD;AAAA,EAC9F,OAAyB,SAAsC,EAAE,GAAG,MAAM,QAAQ,GAAG,4BAA4B;AACnH;;;AELA,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AAChC,SAAS,2BAA2B;AAMpC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAI/B,SAAS,iBAAiB;AAE1B,SAAS,aAAa,uBAAuB;AAQtC,IAAM,2DAAN,cAAuE,gBAAgB;AAAA,EAC5F,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,mBAAmB;AAAA,EAC/F,OAAyB,sBAA8B;AAAA,EACvD,OAAyB,SAA2C;AAAA,IAClE,GAAG,MAAM;AAAA,IACT,GAAG;AAAA,IACH,6BAA6B;AAAA,EAC/B;AAAA,EAEA,MAAyB,cAAc,WAAsB,CAAC,GAAsD;AAClH,UAAM,MAAsB,SAAS,OAAO,cAAc;AAC1D,UAAM,yBAA2C,SAAS,OAAO,gBAAgB;AACjF,UAAM,oBAAiC,SAAS,OAAO,WAAW;AAClE,QAAI,IAAI,SAAS,KAAK,uBAAuB,SAAS,KAAK,kBAAkB,SAAS,GAAG;AACvF,YAAM,oBAAoB,MAAM,eAAe,cAAc,QAAQ;AAErE,YAAM,SAAsD,IAAI;AAAA,QAC9D,CAAC,KAAK,SAAS;AACb,gBAAM,sBAA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G,UAAM,YAAqD,EAAE,QAAQ,mBAAmB,OAAO,EAAE,GAAG,UAAU,OAAO,QAAQ,WAAW,EAAE;AAC1I,WAAO,CAAC,WAAW,GAAG,eAAe;AAAA,EACvC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAgB,uBAAuB;AACrC,UAAM,OAAO,SAAS,KAAK,QAAQ,cAAc,WAAW,MAAM,GAAG,UAAU,mDAAmD;AAClI,UAAM,MAAM,SAAS,MAAM,KAAK,QAAQ,IAAI,GAAG,MAAM,GAAG,UAAU,4CAA4C;AAC9G,WAAO,iBAAiB,KAAK,KAAK,KAAK,OAAO;AAAA,EAChD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAgB,iCAAiC;AAC/C,UAAM,OAAO;AAAA,MACX,KAAK,QAAQ,cAAc;AAAA,MAC3B,MAAM,GAAG,UAAU;AAAA,IACrB;AACA,UAAM,MAAM,SAAS,MAAM,KAAK,QAAQ,IAAI,GAAG,MAAM,GAAG,UAAU,sDAAsD;AACxH,WAAO,eAAe,KAAK,KAAK,KAAK,OAAO;AAAA,EAC9C;AACF;","names":["AbstractDiviner","DivinerConfigSchema","PayloadBuilder","UrlSchema","AbstractDiviner","DivinerConfigSchema","PayloadBuilder","UrlSchema","AbstractDiviner","DivinerConfigSchema","isImageThumbnailDivinerQuery","PayloadBuilder","UrlSchema","AbstractDiviner","DivinerConfigSchema","isImageThumbnailDivinerQuery","order","UrlSchema","PayloadBuilder","PayloadDivinerQuerySchema","exists","isBoundWitness","AbstractDiviner","ImageThumbnailSchema","isImageThumbnail","isTimestamp","TimestampSchema","ImageThumbnailSchema","TimestampSchema","isImageThumbnail","isTimestamp","AbstractDiviner","exists","isBoundWitness"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/diviner-image-thumbnail",
3
- "version": "3.6.1",
3
+ "version": "4.1.0",
4
4
  "description": "Typescript/Javascript Plugins for XYO Platform",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -21,52 +21,52 @@
21
21
  "type": "module",
22
22
  "exports": {
23
23
  ".": {
24
- "types": "./dist/types/index.d.ts",
24
+ "types": "./dist/neutral/index.d.ts",
25
25
  "default": "./dist/neutral/index.mjs"
26
26
  },
27
27
  "./package.json": "./package.json"
28
28
  },
29
29
  "module": "dist/neutral/index.mjs",
30
- "types": "dist/types/index.d.ts",
30
+ "types": "dist/neutral/index.d.ts",
31
31
  "dependencies": {
32
- "@xylabs/array": "^4.11.2",
33
- "@xylabs/assert": "^4.11.2",
34
- "@xylabs/exists": "^4.11.2",
35
- "@xylabs/hex": "^4.11.2",
36
- "@xylabs/object": "^4.11.2",
37
- "@xyo-network/archivist-model": "^3.17.1",
38
- "@xyo-network/archivist-wrapper": "^3.17.1",
39
- "@xyo-network/boundwitness-model": "^3.17.1",
40
- "@xyo-network/boundwitness-validator": "^3.17.1",
41
- "@xyo-network/diviner-abstract": "^3.17.1",
42
- "@xyo-network/diviner-indexing": "^3.17.1",
43
- "@xyo-network/diviner-model": "^3.17.1",
44
- "@xyo-network/diviner-payload-model": "^3.17.1",
45
- "@xyo-network/diviner-wrapper": "^3.17.1",
46
- "@xyo-network/image-thumbnail-payload-plugin": "^3.6.1",
47
- "@xyo-network/module-model": "^3.17.1",
48
- "@xyo-network/payload-builder": "^3.17.1",
49
- "@xyo-network/payload-model": "^3.17.1",
50
- "@xyo-network/url-payload-plugin": "^3.6.1",
51
- "@xyo-network/witness-timestamp": "^3.17.1"
32
+ "@xylabs/array": "^4.13.15",
33
+ "@xylabs/assert": "^4.13.15",
34
+ "@xylabs/exists": "^4.13.15",
35
+ "@xylabs/hex": "^4.13.15",
36
+ "@xylabs/object": "^4.13.15",
37
+ "@xyo-network/archivist-model": "^4.1.1",
38
+ "@xyo-network/archivist-wrapper": "^4.1.1",
39
+ "@xyo-network/boundwitness-model": "^4.1.1",
40
+ "@xyo-network/boundwitness-validator": "^4.1.1",
41
+ "@xyo-network/diviner-abstract": "^4.1.1",
42
+ "@xyo-network/diviner-indexing": "^4.1.1",
43
+ "@xyo-network/diviner-model": "^4.1.1",
44
+ "@xyo-network/diviner-payload-model": "^4.1.1",
45
+ "@xyo-network/diviner-wrapper": "^4.1.1",
46
+ "@xyo-network/image-thumbnail-payload-plugin": "^4.1.0",
47
+ "@xyo-network/module-model": "^4.1.1",
48
+ "@xyo-network/payload-builder": "^4.1.1",
49
+ "@xyo-network/payload-model": "^4.1.1",
50
+ "@xyo-network/url-payload-plugin": "^4.1.0",
51
+ "@xyo-network/witness-timestamp": "^4.1.1"
52
52
  },
53
53
  "devDependencies": {
54
- "@xylabs/delay": "^4.11.2",
55
- "@xylabs/hex": "^4.11.2",
56
- "@xylabs/ts-scripts-yarn3": "^6.5.7",
57
- "@xylabs/tsconfig": "^6.5.7",
58
- "@xylabs/vitest-extended": "^4.11.2",
59
- "@xyo-network/archivist-memory": "^3.17.1",
60
- "@xyo-network/boundwitness-builder": "^3.17.1",
61
- "@xyo-network/diviner-boundwitness-memory": "^3.17.1",
62
- "@xyo-network/diviner-payload-memory": "^3.17.1",
63
- "@xyo-network/manifest": "^3.17.1",
64
- "@xyo-network/module-factory-locator": "^3.17.1",
65
- "@xyo-network/node-memory": "^3.17.1",
66
- "@xyo-network/wallet": "^3.17.1",
67
- "knip": "^5.59.0",
54
+ "@xylabs/delay": "^4.13.15",
55
+ "@xylabs/hex": "^4.13.15",
56
+ "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.24",
57
+ "@xylabs/tsconfig": "^7.0.0-rc.24",
58
+ "@xylabs/vitest-extended": "^4.13.15",
59
+ "@xyo-network/archivist-memory": "^4.1.1",
60
+ "@xyo-network/boundwitness-builder": "^4.1.1",
61
+ "@xyo-network/diviner-boundwitness-memory": "^4.1.1",
62
+ "@xyo-network/diviner-payload-generic": "^4.1.1",
63
+ "@xyo-network/manifest": "^4.1.1",
64
+ "@xyo-network/module-factory-locator": "^4.1.1",
65
+ "@xyo-network/node-memory": "^4.1.1",
66
+ "@xyo-network/wallet": "^4.1.1",
67
+ "knip": "^5.61.3",
68
68
  "typescript": "^5.8.3",
69
- "vitest": "^3.1.4"
69
+ "vitest": "^3.2.4"
70
70
  },
71
71
  "publishConfig": {
72
72
  "access": "public"
@@ -52,7 +52,7 @@ export class ImageThumbnailIndexQueryResponseToImageThumbnailQueryResponseDivine
52
52
  // Map the indexes to responses using the dictionary
53
53
  return imageThumbnailResultIndexes.map((imageThumbnailResultIndex) => {
54
54
  const {
55
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
55
+
56
56
  key, schema, $sources, ...commonFields
57
57
  } = imageThumbnailResultIndex
58
58
  const url = keyToUrlDictionary?.[key]
@@ -1,2 +0,0 @@
1
- export * from './Diviner/index.ts';
2
- //# sourceMappingURL=index.d.ts.map
File without changes
File without changes
File without changes
File without changes