@reactionary/provider-fake 0.0.38 → 0.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reactionary/provider-fake",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.39",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "src/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@reactionary/core": "0.0.
|
|
8
|
-
"@reactionary/otel": "0.0.
|
|
7
|
+
"@reactionary/core": "0.0.39",
|
|
8
|
+
"@reactionary/otel": "0.0.39",
|
|
9
9
|
"zod": "4.0.0-beta.20250430T185432",
|
|
10
10
|
"@faker-js/faker": "^9.8.0"
|
|
11
11
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CartProvider
|
|
3
3
|
} from "@reactionary/core";
|
|
4
|
-
import { Faker, en, base } from "@faker-js/faker
|
|
4
|
+
import { Faker, en, base } from "@faker-js/faker";
|
|
5
5
|
class FakeCartProvider extends CartProvider {
|
|
6
6
|
constructor(config, schema, cache) {
|
|
7
7
|
super(schema, cache);
|
|
@@ -1,8 +1,20 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
+
if (decorator = decorators[i])
|
|
7
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
+
if (kind && result)
|
|
9
|
+
__defProp(target, key, result);
|
|
10
|
+
return result;
|
|
11
|
+
};
|
|
1
12
|
import {
|
|
2
13
|
SearchProvider
|
|
3
14
|
} from "@reactionary/core";
|
|
4
15
|
import { Faker, en, base } from "@faker-js/faker";
|
|
5
16
|
import { jitter } from "../utilities/jitter";
|
|
17
|
+
import { traced } from "@reactionary/otel";
|
|
6
18
|
class FakeSearchProvider extends SearchProvider {
|
|
7
19
|
constructor(config, schema, cache) {
|
|
8
20
|
super(schema, cache);
|
|
@@ -86,9 +98,20 @@ class FakeSearchProvider extends SearchProvider {
|
|
|
86
98
|
placeholder: false
|
|
87
99
|
}
|
|
88
100
|
};
|
|
101
|
+
const foo = this.childFunction();
|
|
89
102
|
return this.schema.parse(result);
|
|
90
103
|
}
|
|
104
|
+
childFunction() {
|
|
105
|
+
const foo = 42;
|
|
106
|
+
return foo;
|
|
107
|
+
}
|
|
91
108
|
}
|
|
109
|
+
__decorateClass([
|
|
110
|
+
traced()
|
|
111
|
+
], FakeSearchProvider.prototype, "queryByTerm", 1);
|
|
112
|
+
__decorateClass([
|
|
113
|
+
traced()
|
|
114
|
+
], FakeSearchProvider.prototype, "childFunction", 1);
|
|
92
115
|
export {
|
|
93
116
|
FakeSearchProvider
|
|
94
117
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { SearchProvider,
|
|
1
|
+
import { SearchProvider, SearchResult, Cache as ReactionaryCache } from '@reactionary/core';
|
|
2
|
+
import type { SearchQueryByTerm, Session } from '@reactionary/core';
|
|
2
3
|
import z from 'zod';
|
|
3
4
|
import { FakeConfiguration } from '../schema/configuration.schema';
|
|
4
5
|
export declare class FakeSearchProvider<T extends SearchResult = SearchResult> extends SearchProvider<T> {
|
|
5
6
|
protected config: FakeConfiguration;
|
|
6
7
|
constructor(config: FakeConfiguration, schema: z.ZodType<T>, cache: ReactionaryCache);
|
|
7
8
|
queryByTerm(payload: SearchQueryByTerm, _session: Session): Promise<SearchResult>;
|
|
9
|
+
protected childFunction(): number;
|
|
8
10
|
}
|