@webda/mock 4.0.0-beta.6 → 4.0.0-beta.7
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/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
This module is part of Webda Application Framework that allows you to quickly develop applications with all modern prerequisites: Security, Extensibility, GraphQL, REST, CloudNative [https://webda.io](https://webda.io)
|
|
4
4
|
|
|
5
|
-
<img src="https://webda.io/
|
|
5
|
+
<img src="https://webda.io/img/webda.svg" width="128" />
|
|
6
6
|
|
|
7
7
|

|
|
8
8
|
|
|
@@ -13,8 +13,6 @@ This module is part of Webda Application Framework that allows you to quickly de
|
|
|
13
13
|
|
|
14
14
|
<!-- README_HEADER -->
|
|
15
15
|
|
|
16
|
-
# @webda/mock
|
|
17
|
-
|
|
18
16
|
> Coherent mock-data generation for `@webda/models` classes — decorator-driven field population with deterministic seeding, multi-model graph support, and optional AI-generated text.
|
|
19
17
|
|
|
20
18
|
## When to use it
|
|
@@ -102,6 +100,7 @@ const products = await generate(Product, { count: 3, mode: "demo", ai });
|
|
|
102
100
|
- Related: [`@webda/models`](../models) for the `@Mock.*` decorator definitions; [`@webda/test`](../test) for the `WebdaTest` harness where mock data is typically used; [`@webda/fs`](../fs) for `FileStore` to persist generated data locally.
|
|
103
101
|
|
|
104
102
|
<!-- README_FOOTER -->
|
|
103
|
+
|
|
105
104
|
## Sponsors
|
|
106
105
|
|
|
107
106
|
<!--
|
|
@@ -110,12 +109,12 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
|
|
|
110
109
|
|
|
111
110
|
Arize AI is a machine learning observability and model monitoring platform. It helps you visualize, monitor, and explain your machine learning models. [Learn more](https://arize.com)
|
|
112
111
|
|
|
113
|
-
[<img src="https://
|
|
112
|
+
[<img src="https://webda.io/img/sponsors/arize.svg" width="200">](https://arize.com)
|
|
114
113
|
|
|
115
114
|
Loopingz is a software development company that provides consulting and development services. [Learn more](https://loopingz.com)
|
|
116
115
|
|
|
117
|
-
[<img src="https://
|
|
116
|
+
[<img src="https://webda.io/img/sponsors/loopingz.png" width="200">](https://loopingz.com)
|
|
118
117
|
|
|
119
118
|
Tellae is an innovative consulting firm specialized in cities transportation issues. We provide our clients, both public and private, with solutions to support your strategic and operational decisions. [Learn more](https://tellae.fr)
|
|
120
119
|
|
|
121
|
-
[<img src="https://tellae.
|
|
120
|
+
[<img src="https://webda.io/img/sponsors/tellae.svg" width="200">](https://tellae.fr)
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { type GenerateOptions } from "../engine/generate.js";
|
|
2
|
+
import type { SecretString } from "@webda/core";
|
|
2
3
|
type ModelClass<T> = new (...args: any[]) => T;
|
|
3
4
|
export type MockServiceParameters = {
|
|
4
5
|
mode?: "test" | "dev" | "demo" | "load" | "custom";
|
|
5
6
|
seed?: number;
|
|
6
7
|
aiProvider?: "anthropic" | "openai" | "none";
|
|
7
|
-
|
|
8
|
+
/**
|
|
9
|
+
* API key of the AI provider
|
|
10
|
+
*
|
|
11
|
+
* Can be encrypted with `webda config encrypt`
|
|
12
|
+
*/
|
|
13
|
+
aiApiKey?: string | SecretString;
|
|
8
14
|
};
|
|
9
15
|
/**
|
|
10
16
|
* Thin service facade exposing mock-data generation. Holds default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock-service.d.ts","sourceRoot":"","sources":["../../src/service/mock-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"mock-service.d.ts","sourceRoot":"","sources":["../../src/service/mock-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAEvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,KAAK,UAAU,CAAC,CAAC,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,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;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"mock-service.js","sourceRoot":"","sources":["../../src/service/mock-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAwB,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAiBnD;;;;;;;;GAQG;AACH,MAAM,OAAO,WAAW;IASZ,UAAU;IARpB;;;;OAIG;IACH,YACE,MAAgB,EAChB,KAAc,EACN,UAAU,GAA0B,EAAE;0BAAtC,UAAU;IACjB,CAAC;IAEJ;;;;;;OAMG;IACH,KAAK,CAAC,QAAQ,CAAI,UAAyB,EAAE,OAA4B;QACvE,MAAM,MAAM,GAAG,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,EAAE,GAAG,OAAO,EAAwB,CAAC;QACxE,OAAO,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,IAAI,CACR,IAA4B,EAC5B,OAAsE;QAEtE,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,IAAI,EAAE,CAAC;QACrC,OAAO,aAAa,CAAC,IAAI,EAAE,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,KAAK,CAAC,WAAsB;QAChC,sEAAsE;QACtE,yEAAyE;IAC3E,CAAC;IAED;;;;OAIG;IACK,QAAQ;QACd,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI;YAC1B,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI;SAC3B,CAAC;IACJ,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webda/mock",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.7",
|
|
4
4
|
"description": "Coherent mock-data generation for @webda/models classes",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webda",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@faker-js/faker": "^10.6.0",
|
|
38
|
-
"@webda/models": "4.0.0-beta.
|
|
38
|
+
"@webda/models": "4.0.0-beta.7"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@anthropic-ai/sdk": "^0.30.0",
|
|
42
|
-
"@webda/core": "4.0.0-beta.
|
|
42
|
+
"@webda/core": "4.0.0-beta.7"
|
|
43
43
|
},
|
|
44
44
|
"peerDependenciesMeta": {
|
|
45
45
|
"@anthropic-ai/sdk": {
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"typescript": "7.1.0-dev.20260929.1",
|
|
57
57
|
"vite": "^6.0.0",
|
|
58
58
|
"vitest": "^4.1.2",
|
|
59
|
-
"@webda/core": "4.0.0-beta.
|
|
59
|
+
"@webda/core": "4.0.0-beta.7",
|
|
60
60
|
"@webda/test": "4.0.0-beta.6"
|
|
61
61
|
},
|
|
62
62
|
"files": [
|