Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
ce9eff9
fix null reference
marle3003 Oct 23, 2025
e5fa904
improve data generator
marle3003 Oct 23, 2025
2ccbe75
Merge remote-tracking branch 'origin/develop' into develop
marle3003 Oct 23, 2025
b9d85d6
Bump github.com/blevesearch/bleve/v2 from 2.5.3 to 2.5.4
dependabot[bot] Oct 24, 2025
27d93ee
Bump ace-builds from 1.43.3 to 1.43.4 in /webui
dependabot[bot] Oct 24, 2025
cb48af7
Merge pull request #724 from marle3003/dependabot/npm_and_yarn/webui/…
github-actions[bot] Oct 24, 2025
65cd9fb
Bump @rushstack/eslint-patch from 1.13.0 to 1.14.0 in /webui
dependabot[bot] Oct 24, 2025
aee158d
Merge pull request #721 from marle3003/dependabot/npm_and_yarn/webui/…
github-actions[bot] Oct 24, 2025
10dc856
Bump eslint from 9.37.0 to 9.38.0 in /webui
dependabot[bot] Oct 24, 2025
09c13ad
Merge pull request #722 from marle3003/dependabot/npm_and_yarn/webui/…
github-actions[bot] Oct 24, 2025
3ea0405
Bump @types/node from 24.8.1 to 24.9.1 in /webui
dependabot[bot] Oct 24, 2025
9577bb4
Merge pull request #723 from marle3003/dependabot/npm_and_yarn/webui/…
github-actions[bot] Oct 24, 2025
867826b
Bump vite from 7.1.11 to 7.1.12 in /webui
dependabot[bot] Oct 24, 2025
82fc6b5
Merge pull request #720 from marle3003/dependabot/npm_and_yarn/webui/…
github-actions[bot] Oct 24, 2025
1fcefec
add filter feature to HTTP requests
marle3003 Oct 24, 2025
71a8998
Merge remote-tracking branch 'origin/develop' into develop
marle3003 Oct 24, 2025
47aaa0f
fix filter custom HTTP method case-insensitive
marle3003 Oct 24, 2025
4f070b5
fix presentation filter dialog
marle3003 Oct 24, 2025
028135c
add URL filter
marle3003 Oct 25, 2025
057bd59
remove log output
marle3003 Oct 25, 2025
2e76420
add filter for request header
marle3003 Oct 26, 2025
f846a3f
add filter for response header
marle3003 Oct 26, 2025
ec87ace
fix logging http response header twice
marle3003 Oct 27, 2025
819c088
Merge remote-tracking branch 'origin/develop' into develop
marle3003 Oct 27, 2025
41ff4a8
fix value/raw switch
marle3003 Oct 27, 2025
fcf94b8
improve shared storage using arrays
marle3003 Oct 28, 2025
e9d3cc5
fix null reference of update function when array is shared root
marle3003 Oct 29, 2025
628d107
add JS HTTP request timeout option
marle3003 Oct 29, 2025
13a3f2b
add client IP to HTTP log
marle3003 Oct 29, 2025
39baf47
add missed file
marle3003 Oct 29, 2025
fb5a764
add status code filter
marle3003 Oct 29, 2025
e933eae
Merge branch 'develop' into dependabot/go_modules/develop/github.com/…
marle3003 Oct 30, 2025
e37cce6
Bump dayjs from 1.11.18 to 1.11.19 in /webui
dependabot[bot] Oct 31, 2025
5803812
Merge pull request #727 from marle3003/dependabot/npm_and_yarn/webui/…
github-actions[bot] Oct 31, 2025
8be7ec6
Bump @rushstack/eslint-patch from 1.14.0 to 1.14.1 in /webui
dependabot[bot] Oct 31, 2025
0439828
Merge pull request #729 from marle3003/dependabot/npm_and_yarn/webui/…
github-actions[bot] Oct 31, 2025
7f46ca1
Bump vue-tsc from 3.1.1 to 3.1.2 in /webui
dependabot[bot] Oct 31, 2025
e9f5b0c
Merge pull request #726 from marle3003/dependabot/npm_and_yarn/webui/…
github-actions[bot] Oct 31, 2025
8c99ebc
Bump @types/node from 24.9.1 to 24.9.2 in /webui
dependabot[bot] Oct 31, 2025
36d058b
Merge pull request #728 from marle3003/dependabot/npm_and_yarn/webui/…
github-actions[bot] Oct 31, 2025
0c20f8f
fix converting nullable in OpenAPI schemas to JSON Schema, where sche…
marle3003 Nov 3, 2025
3e2173b
Merge remote-tracking branch 'origin/develop' into develop
marle3003 Nov 3, 2025
f7eb61d
extend CLI (WIP)
marle3003 Nov 5, 2025
2308397
improve display HTTP parameter in request view
marle3003 Nov 6, 2025
f2c8aed
Merge remote-tracking branch 'origin/develop' into develop
marle3003 Nov 6, 2025
d72ab66
improve responsiveness of dashboard http requests table and align badges
marle3003 Nov 6, 2025
861d780
improve reading request body when Content-Length is set but no reques…
marle3003 Nov 6, 2025
bdb2517
fix: prevent null validation errors from overriding other errors for …
marle3003 Nov 6, 2025
48dfaa9
fix test
marle3003 Nov 6, 2025
2e6b351
Bump github.com/evanw/esbuild from 0.25.11 to 0.25.12
dependabot[bot] Nov 7, 2025
8154801
Bump eslint from 9.38.0 to 9.39.1 in /webui
dependabot[bot] Nov 7, 2025
5fcde06
Merge pull request #735 from marle3003/dependabot/npm_and_yarn/webui/…
github-actions[bot] Nov 7, 2025
ce611b5
Bump @types/node from 24.9.2 to 24.10.0 in /webui
dependabot[bot] Nov 7, 2025
eecc4af
Merge pull request #734 from marle3003/dependabot/npm_and_yarn/webui/…
github-actions[bot] Nov 7, 2025
7ec04f5
Bump vite from 7.1.12 to 7.2.2 in /webui
dependabot[bot] Nov 7, 2025
432dcc5
Merge pull request #736 from marle3003/dependabot/npm_and_yarn/webui/…
github-actions[bot] Nov 7, 2025
0c8e3b6
Bump vue-tsc from 3.1.2 to 3.1.3 in /webui
dependabot[bot] Nov 7, 2025
1f9ca1c
Merge pull request #733 from marle3003/dependabot/npm_and_yarn/webui/…
github-actions[bot] Nov 7, 2025
82e9478
Bump vue from 3.5.22 to 3.5.23 in /webui
dependabot[bot] Nov 7, 2025
b1d3a7f
fix null reference error
marle3003 Nov 7, 2025
018977b
fix applying reference with siblings attributes
marle3003 Nov 7, 2025
c13951b
fix prevent self-patching
marle3003 Nov 7, 2025
f813687
remove unused files
marle3003 Nov 7, 2025
3dc099e
improve table responsive
marle3003 Nov 7, 2025
2232ebe
add test for Kafka ApiVersion
marle3003 Nov 8, 2025
33133ba
Merge remote-tracking branch 'origin/develop' into develop
marle3003 Nov 8, 2025
1291106
fix handle flexible versions in Kafka CreateTopics
marle3003 Nov 8, 2025
d967499
fix issue with Kafka response length
marle3003 Nov 8, 2025
03dd9b7
fix flexible response for Heartbeat
marle3003 Nov 8, 2025
b9b3b9a
fix flexible response for ListGroup
marle3003 Nov 8, 2025
3d19c2d
add test for Kafka MetaData
marle3003 Nov 8, 2025
15fdb15
add new supported version for Kafka OffsetFetch
marle3003 Nov 8, 2025
239fff0
add new supported version for Kafka OffsetCommit
marle3003 Nov 8, 2025
b3bd76c
add test for Kafka Offset
marle3003 Nov 8, 2025
e9bae81
add test for Kafka Produce
marle3003 Nov 8, 2025
a4008fb
fix flexible response for SyncGroup
marle3003 Nov 8, 2025
6a8392a
fix read Kafka ReadCompactBytes
marle3003 Nov 8, 2025
012682e
fix set protocolType in Kafka group balancer
marle3003 Nov 8, 2025
b145e5e
clean imports
marle3003 Nov 8, 2025
4047888
fix flexible response for JoinGroup
marle3003 Nov 8, 2025
e2a64aa
add missed commit
marle3003 Nov 8, 2025
85a179d
add missed commit
marle3003 Nov 8, 2025
22a00a2
fix Kafka OffsetFetch protocol error
marle3003 Nov 8, 2025
8367715
fix some clients (Java, ...) have difficulty receiving Kafka response…
marle3003 Nov 8, 2025
dd95711
fix some clients (Java, ...) have difficulty receiving Kafka response…
marle3003 Nov 8, 2025
a28d08e
fix flexible response for FindCoordinator #730
marle3003 Nov 8, 2025
8ed1fed
fix null reference error
marle3003 Nov 8, 2025
eb69662
Merge branch 'develop' into dependabot/npm_and_yarn/webui/develop/vue…
marle3003 Nov 8, 2025
a7db594
fix Kafka topic selection
marle3003 Nov 9, 2025
ab97651
Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/webui/de…
marle3003 Nov 9, 2025
da0dcaf
Merge pull request #732 from marle3003/dependabot/npm_and_yarn/webui/…
github-actions[bot] Nov 9, 2025
602cd40
Merge branch 'develop' into dependabot/go_modules/develop/github.com/…
marle3003 Nov 9, 2025
a80d431
Merge pull request #731 from marle3003/dependabot/go_modules/develop/…
github-actions[bot] Nov 9, 2025
e7b35fc
Merge branch 'develop' into dependabot/go_modules/develop/github.com/…
marle3003 Nov 9, 2025
84b6954
Merge pull request #719 from marle3003/dependabot/go_modules/develop/…
github-actions[bot] Nov 9, 2025
865ed2b
improve search result design
marle3003 Nov 9, 2025
8250bdd
Merge remote-tracking branch 'origin/develop' into develop
marle3003 Nov 9, 2025
9e9bdfc
Merge branch 'main' into develop
marle3003 Nov 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions api/handler_events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ func TestHandler_Events(t *testing.T) {
},
"url": "http://localhost/foo",
},
"response": map[string]interface{}{"body": "", "size": float64(0), "statusCode": float64(0)}},
"response": map[string]interface{}{"body": "", "size": float64(0), "statusCode": float64(0)},
"clientIP": "192.0.2.1",
},
m[0]["data"])
}))
},
Expand Down Expand Up @@ -174,7 +176,9 @@ func TestHandler_Events(t *testing.T) {
},
"url": "http://localhost/foo",
},
"response": map[string]interface{}{"body": "", "size": float64(0), "statusCode": float64(0)}},
"response": map[string]interface{}{"body": "", "size": float64(0), "statusCode": float64(0)},
"clientIP": "192.0.2.1",
},
m[0]["data"])
}))
},
Expand Down
8 changes: 4 additions & 4 deletions api/handler_schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ func TestHandler_Schema_Example(t *testing.T) {
},
},
{
name: "string or number",
name: "string or integer",
app: &runtime.App{
Monitor: monitor.New(),
},
Expand All @@ -256,7 +256,7 @@ func TestHandler_Schema_Example(t *testing.T) {
http.MethodGet,
"http://foo.api/api/schema/example",
nil,
`{"name": "", "schema": {"type": ["string","number"]}}`,
`{"name": "", "schema": {"type": ["string","integer"]}}`,
h,
try.HasStatusCode(200),
try.HasHeader("Content-Type", "application/json"),
Expand All @@ -266,10 +266,10 @@ func TestHandler_Schema_Example(t *testing.T) {
require.NoError(t, err)
b, err := base64.StdEncoding.DecodeString(data[0]["value"])
require.NoError(t, err)
require.Equal(t, "609859.0117483337", string(b))
require.Equal(t, "-168643", string(b))

}),
try.HasBody(`[{"contentType":"application/json","value":"NjA5ODU5LjAxMTc0ODMzMzc="}]`))
try.HasBody(`[{"contentType":"application/json","value":"LTE2ODY0Mw=="}]`))
},
},
{
Expand Down
3 changes: 2 additions & 1 deletion config/static/static_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import (
"bytes"
"encoding/json"
"fmt"
log "github.com/sirupsen/logrus"
"mokapi/config/tls"
"net/url"
"strconv"
"strings"

log "github.com/sirupsen/logrus"
)

type Config struct {
Expand Down
1 change: 1 addition & 0 deletions engine/common/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ type HttpClient interface {

type HttpClientOptions struct {
MaxRedirects int
Timeout time.Duration
}

type Action struct {
Expand Down
6 changes: 5 additions & 1 deletion engine/enginetest/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type Host struct {
DebugFunc func(args ...interface{})
IsLevelEnabledFunc func(level string) bool
HttpClientTest *HttpClient
HttpClientFunc func(opts common.HttpClientOptions) common.HttpClient
KafkaClientTest *KafkaClient
EveryFunc func(every string, do func(), opt common.JobOptions)
CronFunc func(every string, do func(), opt common.JobOptions)
Expand Down Expand Up @@ -128,7 +129,10 @@ func (h *Host) Unlock() {
h.m.Unlock()
}

func (h *Host) HttpClient(_ common.HttpClientOptions) common.HttpClient {
func (h *Host) HttpClient(opts common.HttpClientOptions) common.HttpClient {
if h.HttpClientFunc != nil {
return h.HttpClientFunc(opts)
}
return h.HttpClientTest
}

Expand Down
2 changes: 1 addition & 1 deletion engine/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ func (sh *scriptHost) KafkaClient() common.KafkaClient {

func (sh *scriptHost) HttpClient(opts common.HttpClientOptions) common.HttpClient {
return &http.Client{
Timeout: time.Second * 30,
Timeout: opts.Timeout,
CheckRedirect: func(req *http.Request, via []*http.Request) error {
if l := len(via); l > opts.MaxRedirects {
log.Warnf("Stopped after %d redirects, original URL was %s", opts.MaxRedirects, via[0].URL)
Expand Down
2 changes: 1 addition & 1 deletion examples/mokapi/kafka.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ export let events = [
binary: base64.encode([0xa, 0x43, 0x61, 0x72, 0x6f, 0x6c, 0x3a].map(x => String.fromCharCode(x)).join(''))
},
partition: 0,
messageId: 'shopOrder'
messageId: 'avro'
}
}
]
22 changes: 16 additions & 6 deletions examples/mokapi/services_http.js
Original file line number Diff line number Diff line change
Expand Up @@ -588,9 +588,14 @@ export let events = [
url: "http://127.0.0.1:18080/pet",
parameters: [
{
name: 'Acceot-Encoding',
name: 'Accept-Encoding',
type: 'header',
raw: 'gzip, deflate'
},
{
name: 'LongHeader',
type: 'header',
raw: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.'
}
],
contentType: "application/xml",
Expand Down Expand Up @@ -625,7 +630,7 @@ export let events = [
url: "http://127.0.0.1:18080/pet",
parameters: [
{
name: 'Acceot-Encoding',
name: 'Accept-Encoding',
type: 'header',
raw: 'gzip, deflate'
}
Expand All @@ -642,7 +647,8 @@ export let events = [
})
]
}
]
],
clientIP: '127.0.0.1'
},
},
{
Expand Down Expand Up @@ -691,7 +697,8 @@ export let events = [
message: 'An example script error message'
}
}
]
],
clientIP: '127.0.0.1'
}
},
{
Expand Down Expand Up @@ -735,7 +742,8 @@ export let events = [
event: "http"
}
}
]
],
clientIP: '127.0.0.1'
}
},
{
Expand Down Expand Up @@ -773,7 +781,8 @@ export let events = [
event: "http"
}
}
]
],
clientIP: '127.0.0.1'
}
},
{
Expand Down Expand Up @@ -819,6 +828,7 @@ export let events = [
size: 512
},
duration: 133,
clientIP: '192.0.1.127'
}
}
]
11 changes: 5 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ go 1.25.1

require (
github.com/Masterminds/sprig v2.22.0+incompatible
github.com/blevesearch/bleve/v2 v2.5.3
github.com/blevesearch/bleve/v2 v2.5.4
github.com/blevesearch/bleve_index_api v1.2.10
github.com/bradleyfalzon/ghinstallation/v2 v2.17.0
github.com/brianvoe/gofakeit/v6 v6.28.0
github.com/dop251/goja v0.0.0-20250309171923-bcd7cc6bf64c
github.com/evanw/esbuild v0.25.11
github.com/evanw/esbuild v0.25.12
github.com/fsnotify/fsnotify v1.9.0
github.com/go-co-op/gocron v1.37.0
github.com/go-git/go-git/v5 v5.16.3
Expand Down Expand Up @@ -39,7 +39,7 @@ require (
github.com/blevesearch/go-porterstemmer v1.0.3 // indirect
github.com/blevesearch/gtreap v0.1.1 // indirect
github.com/blevesearch/mmap-go v1.0.4 // indirect
github.com/blevesearch/scorch_segment_api/v2 v2.3.10 // indirect
github.com/blevesearch/scorch_segment_api/v2 v2.3.12 // indirect
github.com/blevesearch/segment v0.9.1 // indirect
github.com/blevesearch/snowballstem v0.9.0 // indirect
github.com/blevesearch/upsidedown_store_api v1.0.2 // indirect
Expand All @@ -49,7 +49,7 @@ require (
github.com/blevesearch/zapx/v13 v13.4.2 // indirect
github.com/blevesearch/zapx/v14 v14.4.2 // indirect
github.com/blevesearch/zapx/v15 v15.4.2 // indirect
github.com/blevesearch/zapx/v16 v16.2.4 // indirect
github.com/blevesearch/zapx/v16 v16.2.6 // indirect
github.com/cloudflare/circl v1.6.1 // indirect
github.com/cyphar/filepath-securejoin v0.4.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
Expand All @@ -60,7 +60,6 @@ require (
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-github/v75 v75.0.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
Expand All @@ -83,6 +82,6 @@ require (
go.uber.org/atomic v1.9.0 // indirect
golang.org/x/crypto v0.43.0 // indirect
golang.org/x/sys v0.37.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
google.golang.org/protobuf v1.36.6 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
)
22 changes: 10 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkY
github.com/bits-and-blooms/bitset v1.12.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
github.com/bits-and-blooms/bitset v1.22.0 h1:Tquv9S8+SGaS3EhyA+up3FXzmkhxPGjQQCkcs2uw7w4=
github.com/bits-and-blooms/bitset v1.22.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
github.com/blevesearch/bleve/v2 v2.5.3 h1:9l1xtKaETv64SZc1jc4Sy0N804laSa/LeMbYddq1YEM=
github.com/blevesearch/bleve/v2 v2.5.3/go.mod h1:Z/e8aWjiq8HeX+nW8qROSxiE0830yQA071dwR3yoMzw=
github.com/blevesearch/bleve/v2 v2.5.4 h1:1iur8e+PHsxtncV2xIVuqlQme/V8guEDO2uV6Wll3lQ=
github.com/blevesearch/bleve/v2 v2.5.4/go.mod h1:yB4PnV4N2q5rTEpB2ndG8N2ISexBQEFIYgwx4ztfvoo=
github.com/blevesearch/bleve_index_api v1.2.10 h1:FMFmZCmTX6PdoLLvwUnKF2RsmILFFwO3h0WPevXY9fE=
github.com/blevesearch/bleve_index_api v1.2.10/go.mod h1:rKQDl4u51uwafZxFrPD1R7xFOwKnzZW7s/LSeK4lgo0=
github.com/blevesearch/geo v0.2.4 h1:ECIGQhw+QALCZaDcogRTNSJYQXRtC8/m8IKiA706cqk=
Expand All @@ -36,8 +36,8 @@ github.com/blevesearch/gtreap v0.1.1 h1:2JWigFrzDMR+42WGIN/V2p0cUvn4UP3C4Q5nmaZG
github.com/blevesearch/gtreap v0.1.1/go.mod h1:QaQyDRAT51sotthUWAH4Sj08awFSSWzgYICSZ3w0tYk=
github.com/blevesearch/mmap-go v1.0.4 h1:OVhDhT5B/M1HNPpYPBKIEJaD0F3Si+CrEKULGCDPWmc=
github.com/blevesearch/mmap-go v1.0.4/go.mod h1:EWmEAOmdAS9z/pi/+Toxu99DnsbhG1TIxUoRmJw/pSs=
github.com/blevesearch/scorch_segment_api/v2 v2.3.10 h1:Yqk0XD1mE0fDZAJXTjawJ8If/85JxnLd8v5vG/jWE/s=
github.com/blevesearch/scorch_segment_api/v2 v2.3.10/go.mod h1:Z3e6ChN3qyN35yaQpl00MfI5s8AxUJbpTR/DL8QOQ+8=
github.com/blevesearch/scorch_segment_api/v2 v2.3.12 h1:GGZc2qwbyRBwtckPPkHkLyXw64mmsLJxdturBI1cM+c=
github.com/blevesearch/scorch_segment_api/v2 v2.3.12/go.mod h1:JBRGAneqgLSI2+jCNjtwMqp2B7EBF3/VUzgDPIU33MM=
github.com/blevesearch/segment v0.9.1 h1:+dThDy+Lvgj5JMxhmOVlgFfkUtZV2kw49xax4+jTfSU=
github.com/blevesearch/segment v0.9.1/go.mod h1:zN21iLm7+GnBHWTao9I+Au/7MBiL8pPFtJBJTsk6kQw=
github.com/blevesearch/snowballstem v0.9.0 h1:lMQ189YspGP6sXvZQ4WZ+MLawfV8wOmPoD/iWeNXm8s=
Expand All @@ -56,8 +56,8 @@ github.com/blevesearch/zapx/v14 v14.4.2 h1:2SGHakVKd+TrtEqpfeq8X+So5PShQ5nW6GNxT
github.com/blevesearch/zapx/v14 v14.4.2/go.mod h1:rz0XNb/OZSMjNorufDGSpFpjoFKhXmppH9Hi7a877D8=
github.com/blevesearch/zapx/v15 v15.4.2 h1:sWxpDE0QQOTjyxYbAVjt3+0ieu8NCE0fDRaFxEsp31k=
github.com/blevesearch/zapx/v15 v15.4.2/go.mod h1:1pssev/59FsuWcgSnTa0OeEpOzmhtmr/0/11H0Z8+Nw=
github.com/blevesearch/zapx/v16 v16.2.4 h1:tGgfvleXTAkwsD5mEzgM3zCS/7pgocTCnO1oyAUjlww=
github.com/blevesearch/zapx/v16 v16.2.4/go.mod h1:Rti/REtuuMmzwsI8/C/qIzRaEoSK/wiFYw5e5ctUKKs=
github.com/blevesearch/zapx/v16 v16.2.6 h1:OHuUl2GhM+FpBq9RwNsJ4k/QodqbMMHoQEgn/IHYpu8=
github.com/blevesearch/zapx/v16 v16.2.6/go.mod h1:cuAPB+YoIyRngNhno1S1GPr9SfMk+x/SgAHBLXSIq3k=
github.com/bradleyfalzon/ghinstallation/v2 v2.17.0 h1:SmbUK/GxpAspRjSQbB6ARvH+ArzlNzTtHydNyXUQ6zg=
github.com/bradleyfalzon/ghinstallation/v2 v2.17.0/go.mod h1:vuD/xvJT9Y+ZVZRv4HQ42cMyPFIYqpc7AbB4Gvt/DlY=
github.com/brianvoe/gofakeit/v6 v6.28.0 h1:Xib46XXuQfmlLS2EXRuJpqcw8St6qSZz75OUo0tgAW4=
Expand All @@ -81,8 +81,8 @@ github.com/elazarl/goproxy v1.7.2 h1:Y2o6urb7Eule09PjlhQRGNsqRfPmYI3KKQLFpCAV3+o
github.com/elazarl/goproxy v1.7.2/go.mod h1:82vkLNir0ALaW14Rc399OTTjyNREgmdL2cVoIbS6XaE=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
github.com/evanw/esbuild v0.25.11 h1:NGtezc+xk+Mti4fgWaoD3dncZNCzcTA+r0BxMV3Koyw=
github.com/evanw/esbuild v0.25.11/go.mod h1:D2vIQZqV/vIf/VRHtViaUtViZmG7o+kKmlBfVQuRi48=
github.com/evanw/esbuild v0.25.12 h1:7kIg7aG2++vhheW5YCzut1q1AjehYVQU752NcMuGVsw=
github.com/evanw/esbuild v0.25.12/go.mod h1:D2vIQZqV/vIf/VRHtViaUtViZmG7o+kKmlBfVQuRi48=
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c=
Expand All @@ -103,8 +103,6 @@ github.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXe
github.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 h1:f+oWsMOmNPc8JmEHVZIycC7hBoQxHH9pNKQORJNozsQ=
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8/go.mod h1:wcDNUvekVysuuOpQKo3191zZyTpiI6se1N1ULghS0sw=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
Expand Down Expand Up @@ -219,8 +217,8 @@ golang.org/x/text v0.30.0 h1:yznKA/E9zq54KzlzBEAWn1NXSQ8DIp/NYMy88xJjl4k=
golang.org/x/text v0.30.0/go.mod h1:yDdHFIX9t+tORqspjENWgzaCVXgk0yYnYuSZ8UzzBVM=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
24 changes: 12 additions & 12 deletions js/faker/faker_schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,10 @@ func TestFaker_Schema(t *testing.T) {
},
{
name: "minItems",
schema: "{ minItems: 3, }",
schema: "{ minItems: 3, items: { type: 'string' } }",
test: func(t *testing.T, v goja.Value, err error) {
r.NoError(t, err)
r.Equal(t, []any{true, int64(-354976), "ZuoWq vY5elXhlD", []interface{}{-743110.6375100765, "lYehCIA", map[string]interface{}{"caravan": true, "hail": -717855.7306413883, "mob": int64(-679449), "scale": true}, false}, false, []interface{}{true, int64(859972), -161661.97092417115}, false, "LWxKt"}, v.Export())
r.Equal(t, []interface{}{"", "idZ", "wYx?vY5elXhlD", "VhgPevuwyrNrL", "lVeCZKW1JKqG", "sffl", "tR", "h"}, v.Export())
},
},
{
Expand Down Expand Up @@ -326,10 +326,10 @@ func TestFaker_Schema(t *testing.T) {
},
{
name: "contains",
schema: "{ contains: { type: 'string' } }",
schema: "{ contains: { const: 'foo' }, items: { type: 'string' } }",
test: func(t *testing.T, v goja.Value, err error) {
r.NoError(t, err)
r.Equal(t, []any{[]any{true, int64(859972), -161661.97092417115}, "wYx?vY5elXhlD", []any{-743110.6375100765, "lYehCIA", map[string]any{"caravan": true, "hail": -717855.7306413883, "mob": int64(-679449), "scale": true}, false}, false, "idZ"}, v.Export())
r.Equal(t, []any{"VhgPevuwyrNrL", "foo", "idZ", "wYx?vY5elXhlD", "foo"}, v.Export())
},
},
{
Expand All @@ -356,10 +356,10 @@ func TestFaker_Schema(t *testing.T) {
},
{
name: "maxContains",
schema: "{ contains: { type: 'string' }, maxContains: 2 }",
schema: "{ contains: { type: 'string' }, maxContains: 2, items: { type: 'string' } }",
test: func(t *testing.T, v goja.Value, err error) {
r.NoError(t, err)
r.Equal(t, []any{" vY5elXhlD4ezl", -859791.1845789105, 326768.021588166, int64(628235), "idZ"}, v.Export())
r.Equal(t, []any{"wYx?vY5elXhlD", "idZ"}, v.Export())
},
},
{
Expand Down Expand Up @@ -401,10 +401,10 @@ func TestFaker_Schema(t *testing.T) {
},
{
name: "minProperties",
schema: "{ minProperties: 3 }",
schema: "{ minProperties: 3, additionalProperties: { type: 'string' } }",
test: func(t *testing.T, v goja.Value, err error) {
r.NoError(t, err)
r.Equal(t, map[string]any{"bunch": 326768.021588166, "gang": int64(628235), "growth": " vY5elXhlD4ezl", "woman": -859791.1845789105}, v.Export())
r.Equal(t, map[string]any{"bunch": "VhgPevuwyrNrL", "gang": "lVeCZKW1JKqG", "growth": "sffl", "woman": "wYx?vY5elXhlD"}, v.Export())
},
},
{
Expand Down Expand Up @@ -454,13 +454,13 @@ func TestFaker_Schema(t *testing.T) {
},
{
name: "properties, patternProperties and additionalProperties",
schema: "{ properties: { builtin: { type: 'number' } }, patternProperties: { '^S_': { type: 'string' }, '^I_': { type: 'integer' } }, additionalProperties: { type: 'string' } }",
schema: "{ properties: { builtin: { type: 'integer' } }, patternProperties: { '^S_': { type: 'string' }, '^I_': { type: 'integer' } }, additionalProperties: { type: 'string' } }",
test: func(t *testing.T, v goja.Value, err error) {
r.NoError(t, err)
r.Equal(t, map[string]any{
"I_4VX": int64(-908662),
"S_kY9X3W": "m",
"builtin": -383134.1033810867,
"builtin": int64(-86829),
"group": "CKu",
"ocean": "LJgmr9arWgSfi",
"party": "m",
Expand Down Expand Up @@ -584,12 +584,12 @@ func TestFaker_Schema(t *testing.T) {
},
{
name: "required but not defined in properties",
schema: "{ properties: { foo: { type: 'string' } }, required: ['bar'] }",
schema: "{ properties: { foo: { type: 'string' }}, additionalProperties: { type: 'string' }, required: ['bar'] }",
test: func(t *testing.T, v goja.Value, err error) {
r.NoError(t, err)
m := v.Export()
r.Contains(t, m, "bar")
r.Equal(t, map[string]any{"bar": 256208.42538087885, "foo": "XidZuoWq "}, m)
r.Equal(t, map[string]any{"bar": "Pevuwy", "woman": "q vY5elXhlD4ez"}, m)
},
},
{
Expand Down
4 changes: 2 additions & 2 deletions js/faker/faker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ func TestModule(t *testing.T) {
test: func(t *testing.T, vm *goja.Runtime, _ *enginetest.Host) {
v, err := vm.RunString(`
const m = require('faker')
m.fake({ type: 'object', properties: { foo: { type: 'string' }, bar: { type: 'string' }}, required: ['foo', 'bar','x', 'y', 'z'] } )
m.fake({ type: 'object', properties: { foo: { type: 'string' }, bar: { type: 'string' }}, additionalProperties: { type: 'string' }, required: ['foo', 'bar','x', 'y', 'z'] } )
`)
r.NoError(t, err)
r.Equal(t, map[string]any{"bar": "", "foo": "XidZuoWq ", "x": int64(-117432), "y": int64(995706), "z": -383134.1033810867}, v.Export())
r.Equal(t, map[string]any{"bar": "vm", "bunch": "LJgmr9arWgSfi", "foo": "Yx?vY5", "gang": "jLWxKtR4", "growth": "m", "woman": "hlD4ezlYehCIA0O", "x": "CKu", "y": "gaqpsEbkw", "z": "LuvMVE6iIqk"}, v.Export())
},
},
}
Expand Down
Loading
Loading