mtmsdk 0.0.50 → 0.0.52
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/dist/gomtmapi/@tanstack/react-query.gen.d.ts +1 -13
- package/dist/gomtmapi/@tanstack/react-query.gen.d.ts.map +1 -1
- package/dist/gomtmapi/@tanstack/react-query.gen.js +1 -37
- package/dist/gomtmapi/@tanstack/react-query.gen.js.map +1 -1
- package/dist/gomtmapi/index.d.ts +2 -2
- package/dist/gomtmapi/index.d.ts.map +1 -1
- package/dist/gomtmapi/index.js +1 -1
- package/dist/gomtmapi/index.js.map +1 -1
- package/dist/gomtmapi/schemas.gen.d.ts +0 -57
- package/dist/gomtmapi/schemas.gen.d.ts.map +1 -1
- package/dist/gomtmapi/schemas.gen.js +0 -60
- package/dist/gomtmapi/schemas.gen.js.map +1 -1
- package/dist/gomtmapi/sdk.gen.d.ts +1 -13
- package/dist/gomtmapi/sdk.gen.d.ts.map +1 -1
- package/dist/gomtmapi/sdk.gen.js +0 -26
- package/dist/gomtmapi/sdk.gen.js.map +1 -1
- package/dist/gomtmapi/types.gen.d.ts +0 -94
- package/dist/gomtmapi/types.gen.d.ts.map +1 -1
- package/dist/gomtmapi/zod.gen.d.ts +0 -62
- package/dist/gomtmapi/zod.gen.d.ts.map +1 -1
- package/dist/gomtmapi/zod.gen.js +0 -51
- package/dist/gomtmapi/zod.gen.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -4
- package/dist/index.js.map +1 -1
- package/dist/lib/schema.d.ts +1 -11
- package/dist/lib/schema.d.ts.map +1 -1
- package/dist/lib/schema.js +0 -9
- package/dist/lib/schema.js.map +1 -1
- package/dist/mtgate_api/client.gen.d.ts.map +1 -1
- package/dist/mtgate_api/client.gen.js +1 -1
- package/dist/mtgate_api/client.gen.js.map +1 -1
- package/dist/mtgate_api/index.d.ts +2 -2
- package/dist/mtgate_api/index.d.ts.map +1 -1
- package/dist/mtgate_api/index.js +1 -1
- package/dist/mtgate_api/index.js.map +1 -1
- package/dist/mtgate_api/sdk.gen.d.ts +0 -8
- package/dist/mtgate_api/sdk.gen.d.ts.map +1 -1
- package/dist/mtgate_api/sdk.gen.js +1 -29
- package/dist/mtgate_api/sdk.gen.js.map +1 -1
- package/dist/mtgate_api/types.gen.d.ts +1 -200
- package/dist/mtgate_api/types.gen.d.ts.map +1 -1
- package/dist/openclaw/gateway.d.ts.map +1 -1
- package/dist/openclaw/gateway.js +1 -1
- package/dist/openclaw/gateway.js.map +1 -1
- package/dist/sbmng/@tanstack/react-query.gen.d.ts +39 -65
- package/dist/sbmng/@tanstack/react-query.gen.d.ts.map +1 -1
- package/dist/sbmng/@tanstack/react-query.gen.js +19 -65
- package/dist/sbmng/@tanstack/react-query.gen.js.map +1 -1
- package/dist/sbmng/index.d.ts +2 -2
- package/dist/sbmng/index.d.ts.map +1 -1
- package/dist/sbmng/index.js +1 -1
- package/dist/sbmng/index.js.map +1 -1
- package/dist/sbmng/schemas.gen.d.ts +6 -95
- package/dist/sbmng/schemas.gen.d.ts.map +1 -1
- package/dist/sbmng/schemas.gen.js +7 -139
- package/dist/sbmng/schemas.gen.js.map +1 -1
- package/dist/sbmng/sdk.gen.d.ts +7 -17
- package/dist/sbmng/sdk.gen.d.ts.map +1 -1
- package/dist/sbmng/sdk.gen.js +10 -32
- package/dist/sbmng/sdk.gen.js.map +1 -1
- package/dist/sbmng/types.gen.d.ts +41 -157
- package/dist/sbmng/types.gen.d.ts.map +1 -1
- package/dist/supabase/supabase-client.d.ts +85 -181
- package/dist/supabase/supabase-client.d.ts.map +1 -1
- package/dist/supabase/supabase.d.ts +170 -362
- package/dist/supabase/supabase.d.ts.map +1 -1
- package/dist/supabase/use-sb-query/build-query-opts.d.ts +6 -2
- package/dist/supabase/use-sb-query/build-query-opts.d.ts.map +1 -1
- package/dist/supabase/use-sb-query/build-query-opts.js +8 -4
- package/dist/supabase/use-sb-query/build-query-opts.js.map +1 -1
- package/dist/supabase/use-sb-query/use-query.d.ts +9 -6
- package/dist/supabase/use-sb-query/use-query.d.ts.map +1 -1
- package/dist/supabase/use-sb-query/use-query.js.map +1 -1
- package/dist/supabase/use-sb-query/use-rpc-query.d.ts +25 -17
- package/dist/supabase/use-sb-query/use-rpc-query.d.ts.map +1 -1
- package/dist/supabase/use-sb-query/use-rpc-query.js +48 -26
- package/dist/supabase/use-sb-query/use-rpc-query.js.map +1 -1
- package/dist/types/database.schemas.d.ts +129 -222
- package/dist/types/database.schemas.d.ts.map +1 -1
- package/dist/types/database.schemas.js +112 -124
- package/dist/types/database.schemas.js.map +1 -1
- package/dist/types/database.types.d.ts +85 -181
- package/dist/types/database.types.d.ts.map +1 -1
- package/dist/types/database.types.js.map +1 -1
- package/dist/types/index.d.ts +30 -59
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +16 -3
- package/dist/types/index.js.map +1 -1
- package/package.json +105 -110
- package/src/cloud-account/platform-configs.ts +73 -73
- package/src/gomtmapi/@tanstack/react-query.gen.ts +537 -575
- package/src/gomtmapi/client/client.gen.ts +311 -311
- package/src/gomtmapi/client/index.ts +25 -25
- package/src/gomtmapi/client/types.gen.ts +241 -241
- package/src/gomtmapi/client/utils.gen.ts +332 -332
- package/src/gomtmapi/client.gen.ts +16 -16
- package/src/gomtmapi/core/auth.gen.ts +42 -42
- package/src/gomtmapi/core/bodySerializer.gen.ts +100 -100
- package/src/gomtmapi/core/params.gen.ts +176 -176
- package/src/gomtmapi/core/pathSerializer.gen.ts +181 -181
- package/src/gomtmapi/core/queryKeySerializer.gen.ts +136 -136
- package/src/gomtmapi/core/serverSentEvents.gen.ts +266 -266
- package/src/gomtmapi/core/types.gen.ts +118 -118
- package/src/gomtmapi/core/utils.gen.ts +143 -143
- package/src/gomtmapi/index.ts +4 -4
- package/src/gomtmapi/schemas.gen.ts +532 -596
- package/src/gomtmapi/sdk.gen.ts +371 -399
- package/src/gomtmapi/types.gen.ts +854 -962
- package/src/gomtmapi/zod.gen.ts +448 -507
- package/src/index.ts +4 -5
- package/src/lib/aisdk/types.ts +7 -7
- package/src/lib/logger/index.ts +8 -8
- package/src/lib/schema.ts +37 -50
- package/src/mtgate_api/client/client.gen.ts +311 -311
- package/src/mtgate_api/client/index.ts +25 -25
- package/src/mtgate_api/client/types.gen.ts +241 -241
- package/src/mtgate_api/client/utils.gen.ts +332 -332
- package/src/mtgate_api/client.gen.ts +16 -16
- package/src/mtgate_api/core/auth.gen.ts +42 -42
- package/src/mtgate_api/core/bodySerializer.gen.ts +100 -100
- package/src/mtgate_api/core/params.gen.ts +176 -176
- package/src/mtgate_api/core/pathSerializer.gen.ts +181 -181
- package/src/mtgate_api/core/queryKeySerializer.gen.ts +136 -136
- package/src/mtgate_api/core/serverSentEvents.gen.ts +266 -266
- package/src/mtgate_api/core/types.gen.ts +118 -118
- package/src/mtgate_api/core/utils.gen.ts +143 -143
- package/src/mtgate_api/index.ts +4 -4
- package/src/mtgate_api/sdk.gen.ts +17 -54
- package/src/mtgate_api/types.gen.ts +5 -239
- package/src/openclaw/client-info.ts +54 -54
- package/src/openclaw/device-auth-utils.ts +26 -26
- package/src/openclaw/device-auth.ts +99 -99
- package/src/openclaw/device-identity.ts +108 -108
- package/src/openclaw/gateway.ts +392 -392
- package/src/openclaw/types.ts +518 -518
- package/src/sbmng/@tanstack/react-query.gen.ts +2967 -3017
- package/src/sbmng/client/client.gen.ts +311 -311
- package/src/sbmng/client/index.ts +25 -25
- package/src/sbmng/client/types.gen.ts +241 -241
- package/src/sbmng/client/utils.gen.ts +332 -332
- package/src/sbmng/client.gen.ts +16 -16
- package/src/sbmng/core/auth.gen.ts +42 -42
- package/src/sbmng/core/bodySerializer.gen.ts +100 -100
- package/src/sbmng/core/params.gen.ts +176 -176
- package/src/sbmng/core/pathSerializer.gen.ts +181 -181
- package/src/sbmng/core/queryKeySerializer.gen.ts +136 -136
- package/src/sbmng/core/serverSentEvents.gen.ts +266 -266
- package/src/sbmng/core/types.gen.ts +118 -118
- package/src/sbmng/core/utils.gen.ts +143 -143
- package/src/sbmng/index.ts +4 -4
- package/src/sbmng/schemas.gen.ts +9671 -9805
- package/src/sbmng/sdk.gen.ts +1755 -1780
- package/src/sbmng/types.gen.ts +7886 -8016
- package/src/supabase/auth-provider.tsx +67 -67
- package/src/supabase/context.tsx +51 -51
- package/src/supabase/cursor-pagination.ts +155 -155
- package/src/supabase/schema/browser.ts +44 -44
- package/src/supabase/schema/index.ts +25 -25
- package/src/supabase/supabase-client.ts +30 -30
- package/src/supabase/supabase.ts +67 -67
- package/src/supabase/use-sb-query/build-query-opts.ts +68 -56
- package/src/supabase/use-sb-query/key.ts +57 -57
- package/src/supabase/use-sb-query/use-query.ts +352 -340
- package/src/supabase/use-sb-query/use-rpc-mutation.ts +83 -83
- package/src/supabase/use-sb-query/use-rpc-query.ts +267 -231
- package/src/supabase/utils.ts +75 -75
- package/src/types/database.schemas.ts +4359 -4378
- package/src/types/database.types.ts +4182 -4288
- package/src/types/index.ts +85 -102
- package/dist/adk/api/client.d.ts +0 -9
- package/dist/adk/api/client.d.ts.map +0 -1
- package/dist/adk/api/client.js +0 -39
- package/dist/adk/api/client.js.map +0 -1
- package/dist/adk/core/constants/tool-icons.d.ts +0 -21
- package/dist/adk/core/constants/tool-icons.d.ts.map +0 -1
- package/dist/adk/core/constants/tool-icons.js +0 -47
- package/dist/adk/core/constants/tool-icons.js.map +0 -1
- package/dist/adk/core/models/AgentBuilder.d.ts +0 -77
- package/dist/adk/core/models/AgentBuilder.d.ts.map +0 -1
- package/dist/adk/core/models/AgentBuilder.js +0 -18
- package/dist/adk/core/models/AgentBuilder.js.map +0 -1
- package/dist/adk/core/models/AgentRunRequest.d.ts +0 -37
- package/dist/adk/core/models/AgentRunRequest.d.ts.map +0 -1
- package/dist/adk/core/models/AgentRunRequest.js +0 -18
- package/dist/adk/core/models/AgentRunRequest.js.map +0 -1
- package/dist/adk/core/models/Eval.d.ts +0 -55
- package/dist/adk/core/models/Eval.d.ts.map +0 -1
- package/dist/adk/core/models/Eval.js +0 -27
- package/dist/adk/core/models/Eval.js.map +0 -1
- package/dist/adk/core/models/LiveRequest.d.ts +0 -23
- package/dist/adk/core/models/LiveRequest.d.ts.map +0 -1
- package/dist/adk/core/models/LiveRequest.js +0 -18
- package/dist/adk/core/models/LiveRequest.js.map +0 -1
- package/dist/adk/core/models/RuntimeConfig.d.ts +0 -32
- package/dist/adk/core/models/RuntimeConfig.d.ts.map +0 -1
- package/dist/adk/core/models/RuntimeConfig.js +0 -18
- package/dist/adk/core/models/RuntimeConfig.js.map +0 -1
- package/dist/adk/core/models/Session.d.ts +0 -117
- package/dist/adk/core/models/Session.d.ts.map +0 -1
- package/dist/adk/core/models/Session.js +0 -31
- package/dist/adk/core/models/Session.js.map +0 -1
- package/dist/adk/core/models/Trace.d.ts +0 -40
- package/dist/adk/core/models/Trace.d.ts.map +0 -1
- package/dist/adk/core/models/Trace.js +0 -2
- package/dist/adk/core/models/Trace.js.map +0 -1
- package/dist/adk/core/models/types.d.ts +0 -338
- package/dist/adk/core/models/types.d.ts.map +0 -1
- package/dist/adk/core/models/types.js +0 -189
- package/dist/adk/core/models/types.js.map +0 -1
- package/dist/lib/utils.d.ts +0 -14
- package/dist/lib/utils.d.ts.map +0 -1
- package/dist/lib/utils.js +0 -45
- package/dist/lib/utils.js.map +0 -1
- package/dist/mtgate_api/@tanstack/react-query.gen.d.ts +0 -166
- package/dist/mtgate_api/@tanstack/react-query.gen.d.ts.map +0 -1
- package/dist/mtgate_api/@tanstack/react-query.gen.js +0 -118
- package/dist/mtgate_api/@tanstack/react-query.gen.js.map +0 -1
- package/dist/mtgate_api/schemas.gen.d.ts +0 -233
- package/dist/mtgate_api/schemas.gen.d.ts.map +0 -1
- package/dist/mtgate_api/schemas.gen.js +0 -277
- package/dist/mtgate_api/schemas.gen.js.map +0 -1
- package/dist/mtgate_api/zod.gen.d.ts +0 -321
- package/dist/mtgate_api/zod.gen.d.ts.map +0 -1
- package/dist/mtgate_api/zod.gen.js +0 -148
- package/dist/mtgate_api/zod.gen.js.map +0 -1
- package/dist/mtmai_api/@tanstack/react-query.gen.d.ts +0 -949
- package/dist/mtmai_api/@tanstack/react-query.gen.d.ts.map +0 -1
- package/dist/mtmai_api/@tanstack/react-query.gen.js +0 -917
- package/dist/mtmai_api/@tanstack/react-query.gen.js.map +0 -1
- package/dist/mtmai_api/client/client.gen.d.ts +0 -3
- package/dist/mtmai_api/client/client.gen.d.ts.map +0 -1
- package/dist/mtmai_api/client/client.gen.js +0 -236
- package/dist/mtmai_api/client/client.gen.js.map +0 -1
- package/dist/mtmai_api/client/index.d.ts +0 -9
- package/dist/mtmai_api/client/index.d.ts.map +0 -1
- package/dist/mtmai_api/client/index.js +0 -7
- package/dist/mtmai_api/client/index.js.map +0 -1
- package/dist/mtmai_api/client/types.gen.d.ts +0 -118
- package/dist/mtmai_api/client/types.gen.d.ts.map +0 -1
- package/dist/mtmai_api/client/types.gen.js +0 -3
- package/dist/mtmai_api/client/types.gen.js.map +0 -1
- package/dist/mtmai_api/client/utils.gen.d.ts +0 -34
- package/dist/mtmai_api/client/utils.gen.d.ts.map +0 -1
- package/dist/mtmai_api/client/utils.gen.js +0 -232
- package/dist/mtmai_api/client/utils.gen.js.map +0 -1
- package/dist/mtmai_api/client.gen.d.ts +0 -13
- package/dist/mtmai_api/client.gen.d.ts.map +0 -1
- package/dist/mtmai_api/client.gen.js +0 -4
- package/dist/mtmai_api/client.gen.js.map +0 -1
- package/dist/mtmai_api/core/auth.gen.d.ts +0 -19
- package/dist/mtmai_api/core/auth.gen.d.ts.map +0 -1
- package/dist/mtmai_api/core/auth.gen.js +0 -15
- package/dist/mtmai_api/core/auth.gen.js.map +0 -1
- package/dist/mtmai_api/core/bodySerializer.gen.d.ts +0 -26
- package/dist/mtmai_api/core/bodySerializer.gen.d.ts.map +0 -1
- package/dist/mtmai_api/core/bodySerializer.gen.js +0 -58
- package/dist/mtmai_api/core/bodySerializer.gen.js.map +0 -1
- package/dist/mtmai_api/core/params.gen.d.ts +0 -44
- package/dist/mtmai_api/core/params.gen.d.ts.map +0 -1
- package/dist/mtmai_api/core/params.gen.js +0 -101
- package/dist/mtmai_api/core/params.gen.js.map +0 -1
- package/dist/mtmai_api/core/pathSerializer.gen.d.ts +0 -34
- package/dist/mtmai_api/core/pathSerializer.gen.d.ts.map +0 -1
- package/dist/mtmai_api/core/pathSerializer.gen.js +0 -115
- package/dist/mtmai_api/core/pathSerializer.gen.js.map +0 -1
- package/dist/mtmai_api/core/queryKeySerializer.gen.d.ts +0 -19
- package/dist/mtmai_api/core/queryKeySerializer.gen.d.ts.map +0 -1
- package/dist/mtmai_api/core/queryKeySerializer.gen.js +0 -100
- package/dist/mtmai_api/core/queryKeySerializer.gen.js.map +0 -1
- package/dist/mtmai_api/core/serverSentEvents.gen.d.ts +0 -72
- package/dist/mtmai_api/core/serverSentEvents.gen.d.ts.map +0 -1
- package/dist/mtmai_api/core/serverSentEvents.gen.js +0 -138
- package/dist/mtmai_api/core/serverSentEvents.gen.js.map +0 -1
- package/dist/mtmai_api/core/types.gen.d.ts +0 -79
- package/dist/mtmai_api/core/types.gen.d.ts.map +0 -1
- package/dist/mtmai_api/core/types.gen.js +0 -3
- package/dist/mtmai_api/core/types.gen.js.map +0 -1
- package/dist/mtmai_api/core/utils.gen.d.ts +0 -20
- package/dist/mtmai_api/core/utils.gen.d.ts.map +0 -1
- package/dist/mtmai_api/core/utils.gen.js +0 -88
- package/dist/mtmai_api/core/utils.gen.js.map +0 -1
- package/dist/mtmai_api/index.d.ts +0 -3
- package/dist/mtmai_api/index.d.ts.map +0 -1
- package/dist/mtmai_api/index.js +0 -4
- package/dist/mtmai_api/index.js.map +0 -1
- package/dist/mtmai_api/schemas.gen.d.ts +0 -7721
- package/dist/mtmai_api/schemas.gen.d.ts.map +0 -1
- package/dist/mtmai_api/schemas.gen.js +0 -9774
- package/dist/mtmai_api/schemas.gen.js.map +0 -1
- package/dist/mtmai_api/sdk.gen.d.ts +0 -282
- package/dist/mtmai_api/sdk.gen.d.ts.map +0 -1
- package/dist/mtmai_api/sdk.gen.js +0 -404
- package/dist/mtmai_api/sdk.gen.js.map +0 -1
- package/dist/mtmai_api/types.gen.d.ts +0 -7152
- package/dist/mtmai_api/types.gen.d.ts.map +0 -1
- package/dist/mtmai_api/types.gen.js +0 -253
- package/dist/mtmai_api/types.gen.js.map +0 -1
- package/dist/mtmai_api/zod.gen.d.ts +0 -55827
- package/dist/mtmai_api/zod.gen.d.ts.map +0 -1
- package/dist/mtmai_api/zod.gen.js +0 -4805
- package/dist/mtmai_api/zod.gen.js.map +0 -1
- package/dist/supabase/use-sb-query/prefetch.d.ts +0 -10
- package/dist/supabase/use-sb-query/prefetch.d.ts.map +0 -1
- package/dist/supabase/use-sb-query/prefetch.js +0 -14
- package/dist/supabase/use-sb-query/prefetch.js.map +0 -1
- package/src/adk/api/client.ts +0 -46
- package/src/adk/core/constants/tool-icons.ts +0 -51
- package/src/adk/core/models/AgentBuilder.ts +0 -80
- package/src/adk/core/models/AgentRunRequest.ts +0 -33
- package/src/adk/core/models/Eval.ts +0 -70
- package/src/adk/core/models/LiveRequest.ts +0 -23
- package/src/adk/core/models/RuntimeConfig.ts +0 -33
- package/src/adk/core/models/Session.ts +0 -52
- package/src/adk/core/models/Trace.ts +0 -42
- package/src/adk/core/models/types.ts +0 -255
- package/src/lib/utils.ts +0 -54
- package/src/mtgate_api/@tanstack/react-query.gen.ts +0 -142
- package/src/mtgate_api/schemas.gen.ts +0 -290
- package/src/mtgate_api/zod.gen.ts +0 -176
- package/src/mtmai_api/@tanstack/react-query.gen.ts +0 -1010
- package/src/mtmai_api/client/client.gen.ts +0 -311
- package/src/mtmai_api/client/index.ts +0 -25
- package/src/mtmai_api/client/types.gen.ts +0 -241
- package/src/mtmai_api/client/utils.gen.ts +0 -332
- package/src/mtmai_api/client.gen.ts +0 -16
- package/src/mtmai_api/core/auth.gen.ts +0 -42
- package/src/mtmai_api/core/bodySerializer.gen.ts +0 -100
- package/src/mtmai_api/core/params.gen.ts +0 -176
- package/src/mtmai_api/core/pathSerializer.gen.ts +0 -181
- package/src/mtmai_api/core/queryKeySerializer.gen.ts +0 -136
- package/src/mtmai_api/core/serverSentEvents.gen.ts +0 -266
- package/src/mtmai_api/core/types.gen.ts +0 -118
- package/src/mtmai_api/core/utils.gen.ts +0 -143
- package/src/mtmai_api/index.ts +0 -4
- package/src/mtmai_api/schemas.gen.ts +0 -9980
- package/src/mtmai_api/sdk.gen.ts +0 -471
- package/src/mtmai_api/types.gen.ts +0 -7609
- package/src/mtmai_api/zod.gen.ts +0 -5101
- package/src/supabase/use-sb-query/prefetch.ts +0 -59
|
@@ -1,181 +1,181 @@
|
|
|
1
|
-
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
-
|
|
3
|
-
interface SerializeOptions<T>
|
|
4
|
-
extends SerializePrimitiveOptions,
|
|
5
|
-
SerializerOptions<T> {}
|
|
6
|
-
|
|
7
|
-
interface SerializePrimitiveOptions {
|
|
8
|
-
allowReserved?: boolean;
|
|
9
|
-
name: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface SerializerOptions<T> {
|
|
13
|
-
/**
|
|
14
|
-
* @default true
|
|
15
|
-
*/
|
|
16
|
-
explode: boolean;
|
|
17
|
-
style: T;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';
|
|
21
|
-
export type ArraySeparatorStyle = ArrayStyle | MatrixStyle;
|
|
22
|
-
type MatrixStyle = 'label' | 'matrix' | 'simple';
|
|
23
|
-
export type ObjectStyle = 'form' | 'deepObject';
|
|
24
|
-
type ObjectSeparatorStyle = ObjectStyle | MatrixStyle;
|
|
25
|
-
|
|
26
|
-
interface SerializePrimitiveParam extends SerializePrimitiveOptions {
|
|
27
|
-
value: string;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export const separatorArrayExplode = (style: ArraySeparatorStyle) => {
|
|
31
|
-
switch (style) {
|
|
32
|
-
case 'label':
|
|
33
|
-
return '.';
|
|
34
|
-
case 'matrix':
|
|
35
|
-
return ';';
|
|
36
|
-
case 'simple':
|
|
37
|
-
return ',';
|
|
38
|
-
default:
|
|
39
|
-
return '&';
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export const separatorArrayNoExplode = (style: ArraySeparatorStyle) => {
|
|
44
|
-
switch (style) {
|
|
45
|
-
case 'form':
|
|
46
|
-
return ',';
|
|
47
|
-
case 'pipeDelimited':
|
|
48
|
-
return '|';
|
|
49
|
-
case 'spaceDelimited':
|
|
50
|
-
return '%20';
|
|
51
|
-
default:
|
|
52
|
-
return ',';
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export const separatorObjectExplode = (style: ObjectSeparatorStyle) => {
|
|
57
|
-
switch (style) {
|
|
58
|
-
case 'label':
|
|
59
|
-
return '.';
|
|
60
|
-
case 'matrix':
|
|
61
|
-
return ';';
|
|
62
|
-
case 'simple':
|
|
63
|
-
return ',';
|
|
64
|
-
default:
|
|
65
|
-
return '&';
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export const serializeArrayParam = ({
|
|
70
|
-
allowReserved,
|
|
71
|
-
explode,
|
|
72
|
-
name,
|
|
73
|
-
style,
|
|
74
|
-
value,
|
|
75
|
-
}: SerializeOptions<ArraySeparatorStyle> & {
|
|
76
|
-
value: unknown[];
|
|
77
|
-
}) => {
|
|
78
|
-
if (!explode) {
|
|
79
|
-
const joinedValues = (
|
|
80
|
-
allowReserved ? value : value.map((v) => encodeURIComponent(v as string))
|
|
81
|
-
).join(separatorArrayNoExplode(style));
|
|
82
|
-
switch (style) {
|
|
83
|
-
case 'label':
|
|
84
|
-
return `.${joinedValues}`;
|
|
85
|
-
case 'matrix':
|
|
86
|
-
return `;${name}=${joinedValues}`;
|
|
87
|
-
case 'simple':
|
|
88
|
-
return joinedValues;
|
|
89
|
-
default:
|
|
90
|
-
return `${name}=${joinedValues}`;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const separator = separatorArrayExplode(style);
|
|
95
|
-
const joinedValues = value
|
|
96
|
-
.map((v) => {
|
|
97
|
-
if (style === 'label' || style === 'simple') {
|
|
98
|
-
return allowReserved ? v : encodeURIComponent(v as string);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return serializePrimitiveParam({
|
|
102
|
-
allowReserved,
|
|
103
|
-
name,
|
|
104
|
-
value: v as string,
|
|
105
|
-
});
|
|
106
|
-
})
|
|
107
|
-
.join(separator);
|
|
108
|
-
return style === 'label' || style === 'matrix'
|
|
109
|
-
? separator + joinedValues
|
|
110
|
-
: joinedValues;
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
export const serializePrimitiveParam = ({
|
|
114
|
-
allowReserved,
|
|
115
|
-
name,
|
|
116
|
-
value,
|
|
117
|
-
}: SerializePrimitiveParam) => {
|
|
118
|
-
if (value === undefined || value === null) {
|
|
119
|
-
return '';
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
if (typeof value === 'object') {
|
|
123
|
-
throw new Error(
|
|
124
|
-
'Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.',
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return `${name}=${allowReserved ? value : encodeURIComponent(value)}`;
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
export const serializeObjectParam = ({
|
|
132
|
-
allowReserved,
|
|
133
|
-
explode,
|
|
134
|
-
name,
|
|
135
|
-
style,
|
|
136
|
-
value,
|
|
137
|
-
valueOnly,
|
|
138
|
-
}: SerializeOptions<ObjectSeparatorStyle> & {
|
|
139
|
-
value: Record<string, unknown> | Date;
|
|
140
|
-
valueOnly?: boolean;
|
|
141
|
-
}) => {
|
|
142
|
-
if (value instanceof Date) {
|
|
143
|
-
return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}`;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
if (style !== 'deepObject' && !explode) {
|
|
147
|
-
let values: string[] = [];
|
|
148
|
-
Object.entries(value).forEach(([key, v]) => {
|
|
149
|
-
values = [
|
|
150
|
-
...values,
|
|
151
|
-
key,
|
|
152
|
-
allowReserved ? (v as string) : encodeURIComponent(v as string),
|
|
153
|
-
];
|
|
154
|
-
});
|
|
155
|
-
const joinedValues = values.join(',');
|
|
156
|
-
switch (style) {
|
|
157
|
-
case 'form':
|
|
158
|
-
return `${name}=${joinedValues}`;
|
|
159
|
-
case 'label':
|
|
160
|
-
return `.${joinedValues}`;
|
|
161
|
-
case 'matrix':
|
|
162
|
-
return `;${name}=${joinedValues}`;
|
|
163
|
-
default:
|
|
164
|
-
return joinedValues;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
const separator = separatorObjectExplode(style);
|
|
169
|
-
const joinedValues = Object.entries(value)
|
|
170
|
-
.map(([key, v]) =>
|
|
171
|
-
serializePrimitiveParam({
|
|
172
|
-
allowReserved,
|
|
173
|
-
name: style === 'deepObject' ? `${name}[${key}]` : key,
|
|
174
|
-
value: v as string,
|
|
175
|
-
}),
|
|
176
|
-
)
|
|
177
|
-
.join(separator);
|
|
178
|
-
return style === 'label' || style === 'matrix'
|
|
179
|
-
? separator + joinedValues
|
|
180
|
-
: joinedValues;
|
|
181
|
-
};
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
|
|
3
|
+
interface SerializeOptions<T>
|
|
4
|
+
extends SerializePrimitiveOptions,
|
|
5
|
+
SerializerOptions<T> {}
|
|
6
|
+
|
|
7
|
+
interface SerializePrimitiveOptions {
|
|
8
|
+
allowReserved?: boolean;
|
|
9
|
+
name: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface SerializerOptions<T> {
|
|
13
|
+
/**
|
|
14
|
+
* @default true
|
|
15
|
+
*/
|
|
16
|
+
explode: boolean;
|
|
17
|
+
style: T;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';
|
|
21
|
+
export type ArraySeparatorStyle = ArrayStyle | MatrixStyle;
|
|
22
|
+
type MatrixStyle = 'label' | 'matrix' | 'simple';
|
|
23
|
+
export type ObjectStyle = 'form' | 'deepObject';
|
|
24
|
+
type ObjectSeparatorStyle = ObjectStyle | MatrixStyle;
|
|
25
|
+
|
|
26
|
+
interface SerializePrimitiveParam extends SerializePrimitiveOptions {
|
|
27
|
+
value: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const separatorArrayExplode = (style: ArraySeparatorStyle) => {
|
|
31
|
+
switch (style) {
|
|
32
|
+
case 'label':
|
|
33
|
+
return '.';
|
|
34
|
+
case 'matrix':
|
|
35
|
+
return ';';
|
|
36
|
+
case 'simple':
|
|
37
|
+
return ',';
|
|
38
|
+
default:
|
|
39
|
+
return '&';
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const separatorArrayNoExplode = (style: ArraySeparatorStyle) => {
|
|
44
|
+
switch (style) {
|
|
45
|
+
case 'form':
|
|
46
|
+
return ',';
|
|
47
|
+
case 'pipeDelimited':
|
|
48
|
+
return '|';
|
|
49
|
+
case 'spaceDelimited':
|
|
50
|
+
return '%20';
|
|
51
|
+
default:
|
|
52
|
+
return ',';
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const separatorObjectExplode = (style: ObjectSeparatorStyle) => {
|
|
57
|
+
switch (style) {
|
|
58
|
+
case 'label':
|
|
59
|
+
return '.';
|
|
60
|
+
case 'matrix':
|
|
61
|
+
return ';';
|
|
62
|
+
case 'simple':
|
|
63
|
+
return ',';
|
|
64
|
+
default:
|
|
65
|
+
return '&';
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const serializeArrayParam = ({
|
|
70
|
+
allowReserved,
|
|
71
|
+
explode,
|
|
72
|
+
name,
|
|
73
|
+
style,
|
|
74
|
+
value,
|
|
75
|
+
}: SerializeOptions<ArraySeparatorStyle> & {
|
|
76
|
+
value: unknown[];
|
|
77
|
+
}) => {
|
|
78
|
+
if (!explode) {
|
|
79
|
+
const joinedValues = (
|
|
80
|
+
allowReserved ? value : value.map((v) => encodeURIComponent(v as string))
|
|
81
|
+
).join(separatorArrayNoExplode(style));
|
|
82
|
+
switch (style) {
|
|
83
|
+
case 'label':
|
|
84
|
+
return `.${joinedValues}`;
|
|
85
|
+
case 'matrix':
|
|
86
|
+
return `;${name}=${joinedValues}`;
|
|
87
|
+
case 'simple':
|
|
88
|
+
return joinedValues;
|
|
89
|
+
default:
|
|
90
|
+
return `${name}=${joinedValues}`;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const separator = separatorArrayExplode(style);
|
|
95
|
+
const joinedValues = value
|
|
96
|
+
.map((v) => {
|
|
97
|
+
if (style === 'label' || style === 'simple') {
|
|
98
|
+
return allowReserved ? v : encodeURIComponent(v as string);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return serializePrimitiveParam({
|
|
102
|
+
allowReserved,
|
|
103
|
+
name,
|
|
104
|
+
value: v as string,
|
|
105
|
+
});
|
|
106
|
+
})
|
|
107
|
+
.join(separator);
|
|
108
|
+
return style === 'label' || style === 'matrix'
|
|
109
|
+
? separator + joinedValues
|
|
110
|
+
: joinedValues;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export const serializePrimitiveParam = ({
|
|
114
|
+
allowReserved,
|
|
115
|
+
name,
|
|
116
|
+
value,
|
|
117
|
+
}: SerializePrimitiveParam) => {
|
|
118
|
+
if (value === undefined || value === null) {
|
|
119
|
+
return '';
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (typeof value === 'object') {
|
|
123
|
+
throw new Error(
|
|
124
|
+
'Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.',
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return `${name}=${allowReserved ? value : encodeURIComponent(value)}`;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export const serializeObjectParam = ({
|
|
132
|
+
allowReserved,
|
|
133
|
+
explode,
|
|
134
|
+
name,
|
|
135
|
+
style,
|
|
136
|
+
value,
|
|
137
|
+
valueOnly,
|
|
138
|
+
}: SerializeOptions<ObjectSeparatorStyle> & {
|
|
139
|
+
value: Record<string, unknown> | Date;
|
|
140
|
+
valueOnly?: boolean;
|
|
141
|
+
}) => {
|
|
142
|
+
if (value instanceof Date) {
|
|
143
|
+
return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}`;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (style !== 'deepObject' && !explode) {
|
|
147
|
+
let values: string[] = [];
|
|
148
|
+
Object.entries(value).forEach(([key, v]) => {
|
|
149
|
+
values = [
|
|
150
|
+
...values,
|
|
151
|
+
key,
|
|
152
|
+
allowReserved ? (v as string) : encodeURIComponent(v as string),
|
|
153
|
+
];
|
|
154
|
+
});
|
|
155
|
+
const joinedValues = values.join(',');
|
|
156
|
+
switch (style) {
|
|
157
|
+
case 'form':
|
|
158
|
+
return `${name}=${joinedValues}`;
|
|
159
|
+
case 'label':
|
|
160
|
+
return `.${joinedValues}`;
|
|
161
|
+
case 'matrix':
|
|
162
|
+
return `;${name}=${joinedValues}`;
|
|
163
|
+
default:
|
|
164
|
+
return joinedValues;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const separator = separatorObjectExplode(style);
|
|
169
|
+
const joinedValues = Object.entries(value)
|
|
170
|
+
.map(([key, v]) =>
|
|
171
|
+
serializePrimitiveParam({
|
|
172
|
+
allowReserved,
|
|
173
|
+
name: style === 'deepObject' ? `${name}[${key}]` : key,
|
|
174
|
+
value: v as string,
|
|
175
|
+
}),
|
|
176
|
+
)
|
|
177
|
+
.join(separator);
|
|
178
|
+
return style === 'label' || style === 'matrix'
|
|
179
|
+
? separator + joinedValues
|
|
180
|
+
: joinedValues;
|
|
181
|
+
};
|
|
@@ -1,136 +1,136 @@
|
|
|
1
|
-
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* JSON-friendly union that mirrors what Pinia Colada can hash.
|
|
5
|
-
*/
|
|
6
|
-
export type JsonValue =
|
|
7
|
-
| null
|
|
8
|
-
| string
|
|
9
|
-
| number
|
|
10
|
-
| boolean
|
|
11
|
-
| JsonValue[]
|
|
12
|
-
| { [key: string]: JsonValue };
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Replacer that converts non-JSON values (bigint, Date, etc.) to safe substitutes.
|
|
16
|
-
*/
|
|
17
|
-
export const queryKeyJsonReplacer = (_key: string, value: unknown) => {
|
|
18
|
-
if (
|
|
19
|
-
value === undefined ||
|
|
20
|
-
typeof value === 'function' ||
|
|
21
|
-
typeof value === 'symbol'
|
|
22
|
-
) {
|
|
23
|
-
return undefined;
|
|
24
|
-
}
|
|
25
|
-
if (typeof value === 'bigint') {
|
|
26
|
-
return value.toString();
|
|
27
|
-
}
|
|
28
|
-
if (value instanceof Date) {
|
|
29
|
-
return value.toISOString();
|
|
30
|
-
}
|
|
31
|
-
return value;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Safely stringifies a value and parses it back into a JsonValue.
|
|
36
|
-
*/
|
|
37
|
-
export const stringifyToJsonValue = (input: unknown): JsonValue | undefined => {
|
|
38
|
-
try {
|
|
39
|
-
const json = JSON.stringify(input, queryKeyJsonReplacer);
|
|
40
|
-
if (json === undefined) {
|
|
41
|
-
return undefined;
|
|
42
|
-
}
|
|
43
|
-
return JSON.parse(json) as JsonValue;
|
|
44
|
-
} catch {
|
|
45
|
-
return undefined;
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Detects plain objects (including objects with a null prototype).
|
|
51
|
-
*/
|
|
52
|
-
const isPlainObject = (value: unknown): value is Record<string, unknown> => {
|
|
53
|
-
if (value === null || typeof value !== 'object') {
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
const prototype = Object.getPrototypeOf(value as object);
|
|
57
|
-
return prototype === Object.prototype || prototype === null;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Turns URLSearchParams into a sorted JSON object for deterministic keys.
|
|
62
|
-
*/
|
|
63
|
-
const serializeSearchParams = (params: URLSearchParams): JsonValue => {
|
|
64
|
-
const entries = Array.from(params.entries()).sort(([a], [b]) =>
|
|
65
|
-
a.localeCompare(b),
|
|
66
|
-
);
|
|
67
|
-
const result: Record<string, JsonValue> = {};
|
|
68
|
-
|
|
69
|
-
for (const [key, value] of entries) {
|
|
70
|
-
const existing = result[key];
|
|
71
|
-
if (existing === undefined) {
|
|
72
|
-
result[key] = value;
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (Array.isArray(existing)) {
|
|
77
|
-
(existing as string[]).push(value);
|
|
78
|
-
} else {
|
|
79
|
-
result[key] = [existing, value];
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return result;
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Normalizes any accepted value into a JSON-friendly shape for query keys.
|
|
88
|
-
*/
|
|
89
|
-
export const serializeQueryKeyValue = (
|
|
90
|
-
value: unknown,
|
|
91
|
-
): JsonValue | undefined => {
|
|
92
|
-
if (value === null) {
|
|
93
|
-
return null;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
if (
|
|
97
|
-
typeof value === 'string' ||
|
|
98
|
-
typeof value === 'number' ||
|
|
99
|
-
typeof value === 'boolean'
|
|
100
|
-
) {
|
|
101
|
-
return value;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
if (
|
|
105
|
-
value === undefined ||
|
|
106
|
-
typeof value === 'function' ||
|
|
107
|
-
typeof value === 'symbol'
|
|
108
|
-
) {
|
|
109
|
-
return undefined;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
if (typeof value === 'bigint') {
|
|
113
|
-
return value.toString();
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
if (value instanceof Date) {
|
|
117
|
-
return value.toISOString();
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
if (Array.isArray(value)) {
|
|
121
|
-
return stringifyToJsonValue(value);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
if (
|
|
125
|
-
typeof URLSearchParams !== 'undefined' &&
|
|
126
|
-
value instanceof URLSearchParams
|
|
127
|
-
) {
|
|
128
|
-
return serializeSearchParams(value);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
if (isPlainObject(value)) {
|
|
132
|
-
return stringifyToJsonValue(value);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
return undefined;
|
|
136
|
-
};
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* JSON-friendly union that mirrors what Pinia Colada can hash.
|
|
5
|
+
*/
|
|
6
|
+
export type JsonValue =
|
|
7
|
+
| null
|
|
8
|
+
| string
|
|
9
|
+
| number
|
|
10
|
+
| boolean
|
|
11
|
+
| JsonValue[]
|
|
12
|
+
| { [key: string]: JsonValue };
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Replacer that converts non-JSON values (bigint, Date, etc.) to safe substitutes.
|
|
16
|
+
*/
|
|
17
|
+
export const queryKeyJsonReplacer = (_key: string, value: unknown) => {
|
|
18
|
+
if (
|
|
19
|
+
value === undefined ||
|
|
20
|
+
typeof value === 'function' ||
|
|
21
|
+
typeof value === 'symbol'
|
|
22
|
+
) {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
if (typeof value === 'bigint') {
|
|
26
|
+
return value.toString();
|
|
27
|
+
}
|
|
28
|
+
if (value instanceof Date) {
|
|
29
|
+
return value.toISOString();
|
|
30
|
+
}
|
|
31
|
+
return value;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Safely stringifies a value and parses it back into a JsonValue.
|
|
36
|
+
*/
|
|
37
|
+
export const stringifyToJsonValue = (input: unknown): JsonValue | undefined => {
|
|
38
|
+
try {
|
|
39
|
+
const json = JSON.stringify(input, queryKeyJsonReplacer);
|
|
40
|
+
if (json === undefined) {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
return JSON.parse(json) as JsonValue;
|
|
44
|
+
} catch {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Detects plain objects (including objects with a null prototype).
|
|
51
|
+
*/
|
|
52
|
+
const isPlainObject = (value: unknown): value is Record<string, unknown> => {
|
|
53
|
+
if (value === null || typeof value !== 'object') {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
const prototype = Object.getPrototypeOf(value as object);
|
|
57
|
+
return prototype === Object.prototype || prototype === null;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Turns URLSearchParams into a sorted JSON object for deterministic keys.
|
|
62
|
+
*/
|
|
63
|
+
const serializeSearchParams = (params: URLSearchParams): JsonValue => {
|
|
64
|
+
const entries = Array.from(params.entries()).sort(([a], [b]) =>
|
|
65
|
+
a.localeCompare(b),
|
|
66
|
+
);
|
|
67
|
+
const result: Record<string, JsonValue> = {};
|
|
68
|
+
|
|
69
|
+
for (const [key, value] of entries) {
|
|
70
|
+
const existing = result[key];
|
|
71
|
+
if (existing === undefined) {
|
|
72
|
+
result[key] = value;
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (Array.isArray(existing)) {
|
|
77
|
+
(existing as string[]).push(value);
|
|
78
|
+
} else {
|
|
79
|
+
result[key] = [existing, value];
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return result;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Normalizes any accepted value into a JSON-friendly shape for query keys.
|
|
88
|
+
*/
|
|
89
|
+
export const serializeQueryKeyValue = (
|
|
90
|
+
value: unknown,
|
|
91
|
+
): JsonValue | undefined => {
|
|
92
|
+
if (value === null) {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (
|
|
97
|
+
typeof value === 'string' ||
|
|
98
|
+
typeof value === 'number' ||
|
|
99
|
+
typeof value === 'boolean'
|
|
100
|
+
) {
|
|
101
|
+
return value;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (
|
|
105
|
+
value === undefined ||
|
|
106
|
+
typeof value === 'function' ||
|
|
107
|
+
typeof value === 'symbol'
|
|
108
|
+
) {
|
|
109
|
+
return undefined;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (typeof value === 'bigint') {
|
|
113
|
+
return value.toString();
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (value instanceof Date) {
|
|
117
|
+
return value.toISOString();
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (Array.isArray(value)) {
|
|
121
|
+
return stringifyToJsonValue(value);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (
|
|
125
|
+
typeof URLSearchParams !== 'undefined' &&
|
|
126
|
+
value instanceof URLSearchParams
|
|
127
|
+
) {
|
|
128
|
+
return serializeSearchParams(value);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if (isPlainObject(value)) {
|
|
132
|
+
return stringifyToJsonValue(value);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return undefined;
|
|
136
|
+
};
|