@scalar/types 0.5.2 → 0.5.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @scalar/types
2
2
 
3
+ ## 0.5.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#7567](https://github.com/scalar/scalar/pull/7567): feat: add code samples to client v2
8
+
9
+ #### Updated Dependencies
10
+
11
+ - **@scalar/helpers@0.2.4**
12
+ - [#7581](https://github.com/scalar/scalar/pull/7581): fix: npm publish job
13
+ - [#7567](https://github.com/scalar/scalar/pull/7567): feat: add code samples to client v2
14
+
15
+ ## 0.5.3
16
+
17
+ ### Patch Changes
18
+
19
+ - [#7498](https://github.com/scalar/scalar/pull/7498) [`bb52d9a`](https://github.com/scalar/scalar/commit/bb52d9a21e53628270bab93c0f03b5731c9c97c6) Thanks [@marcalexiei](https://github.com/marcalexiei)! - feat: add `PostDataCommon` to `/snippetz` export`
20
+
3
21
  ## 0.5.2
4
22
 
5
23
  ### Patch Changes
@@ -150,7 +150,7 @@ export declare const apiReferenceConfigurationSchema: z.ZodObject<{
150
150
  favicon: z.ZodOptional<z.ZodString>;
151
151
  hiddenClients: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodArray<z.ZodString>]>>, z.ZodArray<z.ZodString>, z.ZodLiteral<true>]>>;
152
152
  defaultHttpClient: z.ZodOptional<z.ZodObject<{
153
- targetKey: z.ZodCustom<"c" | "r" | "go" | "rust" | "clojure" | "csharp" | "dart" | "http" | "fsharp" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "ruby" | "shell" | "swift", "c" | "r" | "go" | "rust" | "clojure" | "csharp" | "dart" | "http" | "fsharp" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "ruby" | "shell" | "swift">;
153
+ targetKey: z.ZodCustom<"c" | "r" | "go" | "rust" | "http" | "clojure" | "csharp" | "dart" | "fsharp" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "ruby" | "shell" | "swift", "c" | "r" | "go" | "rust" | "http" | "clojure" | "csharp" | "dart" | "fsharp" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "ruby" | "shell" | "swift">;
154
154
  clientKey: z.ZodString;
155
155
  }, z.core.$strip>>;
156
156
  customCss: z.ZodOptional<z.ZodString>;
@@ -1,3 +1,2 @@
1
- /** biome-ignore-all lint/performance/noBarrelFile: entrypoint */
2
1
  export { type Oauth2Flow, type Oauth2FlowPayload, type SecuritySchemaHttp, type SecuritySchemaOpenId, type SecurityScheme, type SecuritySchemeApiKey, type SecuritySchemeOauth2, type SecuritySchemeOauth2Payload, type SecuritySchemePayload, oasSecurityRequirementSchema, oasSecuritySchemeSchema, pkceOptions, securityApiKeySchema, securityHttpSchema, securityOauthSchema, securityOpenIdSchema, securitySchemeSchema, } from './security-scheme.js';
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,OAAO,EACL,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,EAC1B,4BAA4B,EAC5B,uBAAuB,EACvB,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,EAC1B,4BAA4B,EAC5B,uBAAuB,EACvB,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,mBAAmB,CAAA"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/entities/index.ts"],
4
- "sourcesContent": ["/** biome-ignore-all lint/performance/noBarrelFile: entrypoint */\nexport {\n type Oauth2Flow,\n type Oauth2FlowPayload,\n type SecuritySchemaHttp,\n type SecuritySchemaOpenId,\n type SecurityScheme,\n type SecuritySchemeApiKey,\n type SecuritySchemeOauth2,\n type SecuritySchemeOauth2Payload,\n type SecuritySchemePayload,\n oasSecurityRequirementSchema,\n oasSecuritySchemeSchema,\n pkceOptions,\n securityApiKeySchema,\n securityHttpSchema,\n securityOauthSchema,\n securityOpenIdSchema,\n securitySchemeSchema,\n} from './security-scheme'\n"],
5
- "mappings": "AACA;AAAA,EAUE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
4
+ "sourcesContent": ["export {\n type Oauth2Flow,\n type Oauth2FlowPayload,\n type SecuritySchemaHttp,\n type SecuritySchemaOpenId,\n type SecurityScheme,\n type SecuritySchemeApiKey,\n type SecuritySchemeOauth2,\n type SecuritySchemeOauth2Payload,\n type SecuritySchemePayload,\n oasSecurityRequirementSchema,\n oasSecuritySchemeSchema,\n pkceOptions,\n securityApiKeySchema,\n securityHttpSchema,\n securityOauthSchema,\n securityOpenIdSchema,\n securitySchemeSchema,\n} from './security-scheme'\n"],
5
+ "mappings": "AAAA;AAAA,EAUE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,3 @@
1
- /** biome-ignore-all lint/performance/noBarrelFile: entrypoint */
2
1
  export type { ContentType, Heading, } from './reference-config.js';
3
2
  export { XScalarStability } from './reference-config.js';
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/legacy/index.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,YAAY,EACV,WAAW,EACX,OAAO,GACR,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/legacy/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,WAAW,EACX,OAAO,GACR,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/legacy/index.ts"],
4
- "sourcesContent": ["/** biome-ignore-all lint/performance/noBarrelFile: entrypoint */\nexport type {\n ContentType,\n Heading,\n} from './reference-config'\nexport { XScalarStability } from './reference-config'\n"],
5
- "mappings": "AAKA,SAAS,wBAAwB;",
4
+ "sourcesContent": ["export type {\n ContentType,\n Heading,\n} from './reference-config'\nexport { XScalarStability } from './reference-config'\n"],
5
+ "mappings": "AAIA,SAAS,wBAAwB;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,3 @@
1
- /** biome-ignore-all lint/performance/noBarrelFile: entrypoint */
2
- export type { AvailableClient, AvailableClients, AvailableClientsArray, ClientId, FormDataParam, HarRequest, Plugin, PluginConfiguration, Target, TargetId, } from './snippetz.js';
3
- export { AVAILABLE_CLIENTS } from './snippetz.js';
1
+ export type { AvailableClient, AvailableClients, ClientId, FormDataParam, HarRequest, Plugin, PluginConfiguration, PostDataCommon, Target, TargetId, } from './snippetz.js';
2
+ export { AVAILABLE_CLIENTS, GROUPED_CLIENTS } from './snippetz.js';
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/snippetz/index.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,QAAQ,EACR,aAAa,EACb,UAAU,EACV,MAAM,EACN,mBAAmB,EACnB,MAAM,EACN,QAAQ,GACT,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/snippetz/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,QAAQ,EACR,aAAa,EACb,UAAU,EACV,MAAM,EACN,mBAAmB,EACnB,cAAc,EACd,MAAM,EACN,QAAQ,GACT,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA"}
@@ -1,5 +1,6 @@
1
- import { AVAILABLE_CLIENTS } from "./snippetz.js";
1
+ import { AVAILABLE_CLIENTS, GROUPED_CLIENTS } from "./snippetz.js";
2
2
  export {
3
- AVAILABLE_CLIENTS
3
+ AVAILABLE_CLIENTS,
4
+ GROUPED_CLIENTS
4
5
  };
5
6
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/snippetz/index.ts"],
4
- "sourcesContent": ["/** biome-ignore-all lint/performance/noBarrelFile: entrypoint */\nexport type {\n AvailableClient,\n AvailableClients,\n AvailableClientsArray,\n ClientId,\n FormDataParam,\n HarRequest,\n Plugin,\n PluginConfiguration,\n Target,\n TargetId,\n} from './snippetz'\nexport { AVAILABLE_CLIENTS } from './snippetz'\n"],
5
- "mappings": "AAaA,SAAS,yBAAyB;",
4
+ "sourcesContent": ["export type {\n AvailableClient,\n AvailableClients,\n ClientId,\n FormDataParam,\n HarRequest,\n Plugin,\n PluginConfiguration,\n PostDataCommon,\n Target,\n TargetId,\n} from './snippetz'\nexport { AVAILABLE_CLIENTS, GROUPED_CLIENTS } from './snippetz'\n"],
5
+ "mappings": "AAYA,SAAS,mBAAmB,uBAAuB;",
6
6
  "names": []
7
7
  }
@@ -1,45 +1,108 @@
1
1
  import type { Request as HarRequest } from 'har-format';
2
- import type { Writable } from 'type-fest';
3
- export type { Param as FormDataParam, Request as HarRequest } from 'har-format';
2
+ export type { Param as FormDataParam, PostDataCommon, Request as HarRequest, } from 'har-format';
4
3
  /**
5
- * List of available clients
4
+ * Maps programming languages and environments to their available HTTP clients.
5
+ * Each key is a target (language/environment), and each value is an array of
6
+ * client identifiers in the format `target/client`.
7
+ *
8
+ * This is the source of truth for all supported code generation targets.
9
+ */
10
+ export declare const GROUPED_CLIENTS: {
11
+ readonly c: readonly ["libcurl"];
12
+ readonly clojure: readonly ["clj_http"];
13
+ readonly csharp: readonly ["httpclient", "restsharp"];
14
+ readonly dart: readonly ["http"];
15
+ readonly fsharp: readonly ["httpclient"];
16
+ readonly go: readonly ["native"];
17
+ readonly http: readonly ["http1.1"];
18
+ readonly java: readonly ["asynchttp", "nethttp", "okhttp", "unirest"];
19
+ readonly js: readonly ["axios", "fetch", "jquery", "ofetch", "xhr"];
20
+ readonly kotlin: readonly ["okhttp"];
21
+ readonly node: readonly ["axios", "fetch", "ofetch", "undici"];
22
+ readonly objc: readonly ["nsurlsession"];
23
+ readonly ocaml: readonly ["cohttp"];
24
+ readonly php: readonly ["curl", "guzzle"];
25
+ readonly powershell: readonly ["restmethod", "webrequest"];
26
+ readonly python: readonly ["python3", "requests", "httpx_sync", "httpx_async"];
27
+ readonly r: readonly ["httr"];
28
+ readonly ruby: readonly ["native"];
29
+ readonly rust: readonly ["reqwest"];
30
+ readonly shell: readonly ["curl", "httpie", "wget"];
31
+ readonly swift: readonly ["nsurlsession"];
32
+ };
33
+ /**
34
+ * Flat array of all available client identifiers.
35
+ * Each identifier follows the format `target/client` (e.g., `js/fetch`, `python/requests`).
36
+ */
37
+ export declare const AVAILABLE_CLIENTS: ("c/libcurl" | "c/clj_http" | "c/httpclient" | "c/restsharp" | "c/http" | "c/native" | "c/http1.1" | "c/asynchttp" | "c/nethttp" | "c/okhttp" | "c/unirest" | "c/axios" | "c/fetch" | "c/jquery" | "c/ofetch" | "c/xhr" | "c/undici" | "c/nsurlsession" | "c/cohttp" | "c/curl" | "c/guzzle" | "c/restmethod" | "c/webrequest" | "c/python3" | "c/requests" | "c/httpx_sync" | "c/httpx_async" | "c/httr" | "c/reqwest" | "c/httpie" | "c/wget" | "r/libcurl" | "r/clj_http" | "r/httpclient" | "r/restsharp" | "r/http" | "r/native" | "r/http1.1" | "r/asynchttp" | "r/nethttp" | "r/okhttp" | "r/unirest" | "r/axios" | "r/fetch" | "r/jquery" | "r/ofetch" | "r/xhr" | "r/undici" | "r/nsurlsession" | "r/cohttp" | "r/curl" | "r/guzzle" | "r/restmethod" | "r/webrequest" | "r/python3" | "r/requests" | "r/httpx_sync" | "r/httpx_async" | "r/httr" | "r/reqwest" | "r/httpie" | "r/wget" | "go/libcurl" | "go/clj_http" | "go/httpclient" | "go/restsharp" | "go/http" | "go/native" | "go/http1.1" | "go/asynchttp" | "go/nethttp" | "go/okhttp" | "go/unirest" | "go/axios" | "go/fetch" | "go/jquery" | "go/ofetch" | "go/xhr" | "go/undici" | "go/nsurlsession" | "go/cohttp" | "go/curl" | "go/guzzle" | "go/restmethod" | "go/webrequest" | "go/python3" | "go/requests" | "go/httpx_sync" | "go/httpx_async" | "go/httr" | "go/reqwest" | "go/httpie" | "go/wget" | "rust/libcurl" | "rust/clj_http" | "rust/httpclient" | "rust/restsharp" | "rust/http" | "rust/native" | "rust/http1.1" | "rust/asynchttp" | "rust/nethttp" | "rust/okhttp" | "rust/unirest" | "rust/axios" | "rust/fetch" | "rust/jquery" | "rust/ofetch" | "rust/xhr" | "rust/undici" | "rust/nsurlsession" | "rust/cohttp" | "rust/curl" | "rust/guzzle" | "rust/restmethod" | "rust/webrequest" | "rust/python3" | "rust/requests" | "rust/httpx_sync" | "rust/httpx_async" | "rust/httr" | "rust/reqwest" | "rust/httpie" | "rust/wget" | "http/libcurl" | "http/clj_http" | "http/httpclient" | "http/restsharp" | "http/http" | "http/native" | "http/http1.1" | "http/asynchttp" | "http/nethttp" | "http/okhttp" | "http/unirest" | "http/axios" | "http/fetch" | "http/jquery" | "http/ofetch" | "http/xhr" | "http/undici" | "http/nsurlsession" | "http/cohttp" | "http/curl" | "http/guzzle" | "http/restmethod" | "http/webrequest" | "http/python3" | "http/requests" | "http/httpx_sync" | "http/httpx_async" | "http/httr" | "http/reqwest" | "http/httpie" | "http/wget" | "clojure/libcurl" | "clojure/clj_http" | "clojure/httpclient" | "clojure/restsharp" | "clojure/http" | "clojure/native" | "clojure/http1.1" | "clojure/asynchttp" | "clojure/nethttp" | "clojure/okhttp" | "clojure/unirest" | "clojure/axios" | "clojure/fetch" | "clojure/jquery" | "clojure/ofetch" | "clojure/xhr" | "clojure/undici" | "clojure/nsurlsession" | "clojure/cohttp" | "clojure/curl" | "clojure/guzzle" | "clojure/restmethod" | "clojure/webrequest" | "clojure/python3" | "clojure/requests" | "clojure/httpx_sync" | "clojure/httpx_async" | "clojure/httr" | "clojure/reqwest" | "clojure/httpie" | "clojure/wget" | "csharp/libcurl" | "csharp/clj_http" | "csharp/httpclient" | "csharp/restsharp" | "csharp/http" | "csharp/native" | "csharp/http1.1" | "csharp/asynchttp" | "csharp/nethttp" | "csharp/okhttp" | "csharp/unirest" | "csharp/axios" | "csharp/fetch" | "csharp/jquery" | "csharp/ofetch" | "csharp/xhr" | "csharp/undici" | "csharp/nsurlsession" | "csharp/cohttp" | "csharp/curl" | "csharp/guzzle" | "csharp/restmethod" | "csharp/webrequest" | "csharp/python3" | "csharp/requests" | "csharp/httpx_sync" | "csharp/httpx_async" | "csharp/httr" | "csharp/reqwest" | "csharp/httpie" | "csharp/wget" | "dart/libcurl" | "dart/clj_http" | "dart/httpclient" | "dart/restsharp" | "dart/http" | "dart/native" | "dart/http1.1" | "dart/asynchttp" | "dart/nethttp" | "dart/okhttp" | "dart/unirest" | "dart/axios" | "dart/fetch" | "dart/jquery" | "dart/ofetch" | "dart/xhr" | "dart/undici" | "dart/nsurlsession" | "dart/cohttp" | "dart/curl" | "dart/guzzle" | "dart/restmethod" | "dart/webrequest" | "dart/python3" | "dart/requests" | "dart/httpx_sync" | "dart/httpx_async" | "dart/httr" | "dart/reqwest" | "dart/httpie" | "dart/wget" | "fsharp/libcurl" | "fsharp/clj_http" | "fsharp/httpclient" | "fsharp/restsharp" | "fsharp/http" | "fsharp/native" | "fsharp/http1.1" | "fsharp/asynchttp" | "fsharp/nethttp" | "fsharp/okhttp" | "fsharp/unirest" | "fsharp/axios" | "fsharp/fetch" | "fsharp/jquery" | "fsharp/ofetch" | "fsharp/xhr" | "fsharp/undici" | "fsharp/nsurlsession" | "fsharp/cohttp" | "fsharp/curl" | "fsharp/guzzle" | "fsharp/restmethod" | "fsharp/webrequest" | "fsharp/python3" | "fsharp/requests" | "fsharp/httpx_sync" | "fsharp/httpx_async" | "fsharp/httr" | "fsharp/reqwest" | "fsharp/httpie" | "fsharp/wget" | "java/libcurl" | "java/clj_http" | "java/httpclient" | "java/restsharp" | "java/http" | "java/native" | "java/http1.1" | "java/asynchttp" | "java/nethttp" | "java/okhttp" | "java/unirest" | "java/axios" | "java/fetch" | "java/jquery" | "java/ofetch" | "java/xhr" | "java/undici" | "java/nsurlsession" | "java/cohttp" | "java/curl" | "java/guzzle" | "java/restmethod" | "java/webrequest" | "java/python3" | "java/requests" | "java/httpx_sync" | "java/httpx_async" | "java/httr" | "java/reqwest" | "java/httpie" | "java/wget" | "js/libcurl" | "js/clj_http" | "js/httpclient" | "js/restsharp" | "js/http" | "js/native" | "js/http1.1" | "js/asynchttp" | "js/nethttp" | "js/okhttp" | "js/unirest" | "js/axios" | "js/fetch" | "js/jquery" | "js/ofetch" | "js/xhr" | "js/undici" | "js/nsurlsession" | "js/cohttp" | "js/curl" | "js/guzzle" | "js/restmethod" | "js/webrequest" | "js/python3" | "js/requests" | "js/httpx_sync" | "js/httpx_async" | "js/httr" | "js/reqwest" | "js/httpie" | "js/wget" | "kotlin/libcurl" | "kotlin/clj_http" | "kotlin/httpclient" | "kotlin/restsharp" | "kotlin/http" | "kotlin/native" | "kotlin/http1.1" | "kotlin/asynchttp" | "kotlin/nethttp" | "kotlin/okhttp" | "kotlin/unirest" | "kotlin/axios" | "kotlin/fetch" | "kotlin/jquery" | "kotlin/ofetch" | "kotlin/xhr" | "kotlin/undici" | "kotlin/nsurlsession" | "kotlin/cohttp" | "kotlin/curl" | "kotlin/guzzle" | "kotlin/restmethod" | "kotlin/webrequest" | "kotlin/python3" | "kotlin/requests" | "kotlin/httpx_sync" | "kotlin/httpx_async" | "kotlin/httr" | "kotlin/reqwest" | "kotlin/httpie" | "kotlin/wget" | "node/libcurl" | "node/clj_http" | "node/httpclient" | "node/restsharp" | "node/http" | "node/native" | "node/http1.1" | "node/asynchttp" | "node/nethttp" | "node/okhttp" | "node/unirest" | "node/axios" | "node/fetch" | "node/jquery" | "node/ofetch" | "node/xhr" | "node/undici" | "node/nsurlsession" | "node/cohttp" | "node/curl" | "node/guzzle" | "node/restmethod" | "node/webrequest" | "node/python3" | "node/requests" | "node/httpx_sync" | "node/httpx_async" | "node/httr" | "node/reqwest" | "node/httpie" | "node/wget" | "objc/libcurl" | "objc/clj_http" | "objc/httpclient" | "objc/restsharp" | "objc/http" | "objc/native" | "objc/http1.1" | "objc/asynchttp" | "objc/nethttp" | "objc/okhttp" | "objc/unirest" | "objc/axios" | "objc/fetch" | "objc/jquery" | "objc/ofetch" | "objc/xhr" | "objc/undici" | "objc/nsurlsession" | "objc/cohttp" | "objc/curl" | "objc/guzzle" | "objc/restmethod" | "objc/webrequest" | "objc/python3" | "objc/requests" | "objc/httpx_sync" | "objc/httpx_async" | "objc/httr" | "objc/reqwest" | "objc/httpie" | "objc/wget" | "ocaml/libcurl" | "ocaml/clj_http" | "ocaml/httpclient" | "ocaml/restsharp" | "ocaml/http" | "ocaml/native" | "ocaml/http1.1" | "ocaml/asynchttp" | "ocaml/nethttp" | "ocaml/okhttp" | "ocaml/unirest" | "ocaml/axios" | "ocaml/fetch" | "ocaml/jquery" | "ocaml/ofetch" | "ocaml/xhr" | "ocaml/undici" | "ocaml/nsurlsession" | "ocaml/cohttp" | "ocaml/curl" | "ocaml/guzzle" | "ocaml/restmethod" | "ocaml/webrequest" | "ocaml/python3" | "ocaml/requests" | "ocaml/httpx_sync" | "ocaml/httpx_async" | "ocaml/httr" | "ocaml/reqwest" | "ocaml/httpie" | "ocaml/wget" | "php/libcurl" | "php/clj_http" | "php/httpclient" | "php/restsharp" | "php/http" | "php/native" | "php/http1.1" | "php/asynchttp" | "php/nethttp" | "php/okhttp" | "php/unirest" | "php/axios" | "php/fetch" | "php/jquery" | "php/ofetch" | "php/xhr" | "php/undici" | "php/nsurlsession" | "php/cohttp" | "php/curl" | "php/guzzle" | "php/restmethod" | "php/webrequest" | "php/python3" | "php/requests" | "php/httpx_sync" | "php/httpx_async" | "php/httr" | "php/reqwest" | "php/httpie" | "php/wget" | "powershell/libcurl" | "powershell/clj_http" | "powershell/httpclient" | "powershell/restsharp" | "powershell/http" | "powershell/native" | "powershell/http1.1" | "powershell/asynchttp" | "powershell/nethttp" | "powershell/okhttp" | "powershell/unirest" | "powershell/axios" | "powershell/fetch" | "powershell/jquery" | "powershell/ofetch" | "powershell/xhr" | "powershell/undici" | "powershell/nsurlsession" | "powershell/cohttp" | "powershell/curl" | "powershell/guzzle" | "powershell/restmethod" | "powershell/webrequest" | "powershell/python3" | "powershell/requests" | "powershell/httpx_sync" | "powershell/httpx_async" | "powershell/httr" | "powershell/reqwest" | "powershell/httpie" | "powershell/wget" | "python/libcurl" | "python/clj_http" | "python/httpclient" | "python/restsharp" | "python/http" | "python/native" | "python/http1.1" | "python/asynchttp" | "python/nethttp" | "python/okhttp" | "python/unirest" | "python/axios" | "python/fetch" | "python/jquery" | "python/ofetch" | "python/xhr" | "python/undici" | "python/nsurlsession" | "python/cohttp" | "python/curl" | "python/guzzle" | "python/restmethod" | "python/webrequest" | "python/python3" | "python/requests" | "python/httpx_sync" | "python/httpx_async" | "python/httr" | "python/reqwest" | "python/httpie" | "python/wget" | "ruby/libcurl" | "ruby/clj_http" | "ruby/httpclient" | "ruby/restsharp" | "ruby/http" | "ruby/native" | "ruby/http1.1" | "ruby/asynchttp" | "ruby/nethttp" | "ruby/okhttp" | "ruby/unirest" | "ruby/axios" | "ruby/fetch" | "ruby/jquery" | "ruby/ofetch" | "ruby/xhr" | "ruby/undici" | "ruby/nsurlsession" | "ruby/cohttp" | "ruby/curl" | "ruby/guzzle" | "ruby/restmethod" | "ruby/webrequest" | "ruby/python3" | "ruby/requests" | "ruby/httpx_sync" | "ruby/httpx_async" | "ruby/httr" | "ruby/reqwest" | "ruby/httpie" | "ruby/wget" | "shell/libcurl" | "shell/clj_http" | "shell/httpclient" | "shell/restsharp" | "shell/http" | "shell/native" | "shell/http1.1" | "shell/asynchttp" | "shell/nethttp" | "shell/okhttp" | "shell/unirest" | "shell/axios" | "shell/fetch" | "shell/jquery" | "shell/ofetch" | "shell/xhr" | "shell/undici" | "shell/nsurlsession" | "shell/cohttp" | "shell/curl" | "shell/guzzle" | "shell/restmethod" | "shell/webrequest" | "shell/python3" | "shell/requests" | "shell/httpx_sync" | "shell/httpx_async" | "shell/httr" | "shell/reqwest" | "shell/httpie" | "shell/wget" | "swift/libcurl" | "swift/clj_http" | "swift/httpclient" | "swift/restsharp" | "swift/http" | "swift/native" | "swift/http1.1" | "swift/asynchttp" | "swift/nethttp" | "swift/okhttp" | "swift/unirest" | "swift/axios" | "swift/fetch" | "swift/jquery" | "swift/ofetch" | "swift/xhr" | "swift/undici" | "swift/nsurlsession" | "swift/cohttp" | "swift/curl" | "swift/guzzle" | "swift/restmethod" | "swift/webrequest" | "swift/python3" | "swift/requests" | "swift/httpx_sync" | "swift/httpx_async" | "swift/httr" | "swift/reqwest" | "swift/httpie" | "swift/wget")[];
38
+ /**
39
+ * All available client identifiers in array format
40
+ * @example
41
+ * ```typescript
42
+ * const clients: AvailableClients = ['js/fetch', 'python/requests', 'shell/curl']
43
+ * ```
44
+ */
45
+ export type AvailableClients = typeof AVAILABLE_CLIENTS;
46
+ /**
47
+ * A single available client identifier.
48
+ * @example
49
+ * ```typescript
50
+ * const client: AvailableClient = 'js/fetch'
51
+ * ```
6
52
  */
7
- export declare const AVAILABLE_CLIENTS: readonly ["c/libcurl", "clojure/clj_http", "csharp/httpclient", "csharp/restsharp", "dart/http", "fsharp/httpclient", "go/native", "http/http1.1", "java/asynchttp", "java/nethttp", "java/okhttp", "java/unirest", "js/axios", "js/fetch", "js/jquery", "js/ofetch", "js/xhr", "kotlin/okhttp", "node/axios", "node/fetch", "node/ofetch", "node/undici", "objc/nsurlsession", "ocaml/cohttp", "php/curl", "php/guzzle", "powershell/restmethod", "powershell/webrequest", "python/python3", "python/requests", "python/httpx_sync", "python/httpx_async", "r/httr", "ruby/native", "rust/reqwest", "shell/curl", "shell/httpie", "shell/wget", "swift/nsurlsession"];
8
- /** Non read only tuple of available clients */
9
- export type AvailableClients = Writable<typeof AVAILABLE_CLIENTS>;
10
- /** A union for a single available client */
11
53
  export type AvailableClient = AvailableClients[number];
12
- /** A non read only array of available clients */
13
- export type AvailableClientsArray = AvailableClients[number][];
14
- /** Programming language */
15
- export type TargetId = AvailableClients[number] extends `${infer T}/${string}` ? T : never;
16
- /** Configuration for a target */
54
+ /**
55
+ * A programming language or environment identifier.
56
+ * @example
57
+ * ```typescript
58
+ * const targetId: TargetId = 'js'
59
+ * ```
60
+ */
61
+ export type TargetId = keyof typeof GROUPED_CLIENTS;
62
+ /**
63
+ * Extracts the client name from a full client identifier for a given target.
64
+ * For example, for target `js`, this extracts `fetch` from `js/fetch`.
65
+ *
66
+ * @template T - The target identifier (e.g., `js`, `python`)
67
+ */
68
+ export type ClientId<T extends TargetId> = (typeof GROUPED_CLIENTS)[T][number];
69
+ /**
70
+ * Configuration for a specific target (language/environment).
71
+ * Contains metadata about the target and its available clients.
72
+ */
17
73
  export type Target = {
18
74
  [K in TargetId]: {
75
+ /** The unique identifier for this target. */
19
76
  key: K;
77
+ /** Human-readable name for the target. */
20
78
  title: string;
79
+ /** The default client to use for this target. */
21
80
  default: ClientId<K>;
81
+ /** All available client plugins for this target. */
22
82
  clients: Plugin[];
23
83
  };
24
84
  }[TargetId];
25
- /** HTTP client */
26
- export type ClientId<T extends string> = T extends TargetId ? Extract<AvailableClients[number], `${T}/${string}`> extends `${T}/${infer C}` ? C : never : never;
27
- /** What any plugins needs to return */
85
+ /**
86
+ * A code generation plugin for a specific HTTP client.
87
+ * Each plugin knows how to convert an HTTP request into source code
88
+ * for its target language and client library.
89
+ */
28
90
  export type Plugin = {
29
- /** The language or environment. */
91
+ /** The language or environment this plugin targets. */
30
92
  target: TargetId;
31
- /** The identifier of the client. */
93
+ /** The identifier of the HTTP client within the target. */
32
94
  client: ClientId<TargetId>;
33
- /** The title of the client. */
95
+ /** Human-readable name for the client. */
34
96
  title: string;
35
- /** The actual source code. */
97
+ /** Generates source code for the given HTTP request. */
36
98
  generate: (request?: Partial<HarRequest>, configuration?: PluginConfiguration) => string;
37
99
  };
38
100
  /**
39
- * Optional configuration for any plugin
101
+ * Optional configuration that can be passed to any code generation plugin.
102
+ * Plugins may use this to customize the generated code.
40
103
  */
41
104
  export type PluginConfiguration = {
42
- /** Credentials to add HTTP Basic Authentication */
105
+ /** Credentials for HTTP Basic Authentication. */
43
106
  auth?: {
44
107
  username: string;
45
108
  password: string;
@@ -1 +1 @@
1
- {"version":3,"file":"snippetz.d.ts","sourceRoot":"","sources":["../../src/snippetz/snippetz.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAA;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEzC,YAAY,EAAE,KAAK,IAAI,aAAa,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAA;AAE/E;;GAEG;AACH,eAAO,MAAM,iBAAiB,woBAwCpB,CAAA;AAEV,+CAA+C;AAC/C,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC,OAAO,iBAAiB,CAAC,CAAA;AACjE,4CAA4C;AAC5C,MAAM,MAAM,eAAe,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAA;AACtD,iDAAiD;AACjD,MAAM,MAAM,qBAAqB,GAAG,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAA;AAE9D,2BAA2B;AAC3B,MAAM,MAAM,QAAQ,GAAG,gBAAgB,CAAC,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,IAAI,MAAM,EAAE,GAAG,CAAC,GAAG,KAAK,CAAA;AAE1F,iCAAiC;AACjC,MAAM,MAAM,MAAM,GAAG;KAClB,CAAC,IAAI,QAAQ,GAAG;QACf,GAAG,EAAE,CAAC,CAAA;QACN,KAAK,EAAE,MAAM,CAAA;QACb,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAA;QACpB,OAAO,EAAE,MAAM,EAAE,CAAA;KAClB;CACF,CAAC,QAAQ,CAAC,CAAA;AAEX,kBAAkB;AAClB,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,QAAQ,GACvD,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,IAAI,MAAM,EAAE,CAAC,SAAS,GAAG,CAAC,IAAI,MAAM,CAAC,EAAE,GAC3E,CAAC,GACD,KAAK,GACP,KAAK,CAAA;AAET,uCAAuC;AACvC,MAAM,MAAM,MAAM,GAAG;IACnB,mCAAmC;IACnC,MAAM,EAAE,QAAQ,CAAA;IAChB,oCAAoC;IACpC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAA;IAC1B,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,8BAA8B;IAC9B,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC,EAAE,mBAAmB,KAAK,MAAM,CAAA;CACzF,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,mDAAmD;IACnD,IAAI,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAA;CAC9C,CAAA"}
1
+ {"version":3,"file":"snippetz.d.ts","sourceRoot":"","sources":["../../src/snippetz/snippetz.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvD,YAAY,EACV,KAAK,IAAI,aAAa,EACtB,cAAc,EACd,OAAO,IAAI,UAAU,GACtB,MAAM,YAAY,CAAA;AAEnB;;;;;;GAMG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;CAsBlB,CAAA;AAEV;;;GAGG;AACH,eAAO,MAAM,iBAAiB,gkWAE7B,CAAA;AAED;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,iBAAiB,CAAA;AAEvD;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAA;AAEtD;;;;;;GAMG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,eAAe,CAAA;AAEnD;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,QAAQ,IAAI,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;AAE9E;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG;KAClB,CAAC,IAAI,QAAQ,GAAG;QACf,6CAA6C;QAC7C,GAAG,EAAE,CAAC,CAAA;QACN,0CAA0C;QAC1C,KAAK,EAAE,MAAM,CAAA;QACb,iDAAiD;QACjD,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAA;QACpB,oDAAoD;QACpD,OAAO,EAAE,MAAM,EAAE,CAAA;KAClB;CACF,CAAC,QAAQ,CAAC,CAAA;AAEX;;;;GAIG;AACH,MAAM,MAAM,MAAM,GAAG;IACnB,uDAAuD;IACvD,MAAM,EAAE,QAAQ,CAAA;IAChB,2DAA2D;IAC3D,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAA;IAC1B,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAA;IACb,wDAAwD;IACxD,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC,EAAE,mBAAmB,KAAK,MAAM,CAAA;CACzF,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,iDAAiD;IACjD,IAAI,CAAC,EAAE;QACL,QAAQ,EAAE,MAAM,CAAA;QAChB,QAAQ,EAAE,MAAM,CAAA;KACjB,CAAA;CACF,CAAA"}
@@ -1,45 +1,32 @@
1
- const AVAILABLE_CLIENTS = [
2
- "c/libcurl",
3
- "clojure/clj_http",
4
- "csharp/httpclient",
5
- "csharp/restsharp",
6
- "dart/http",
7
- "fsharp/httpclient",
8
- "go/native",
9
- "http/http1.1",
10
- "java/asynchttp",
11
- "java/nethttp",
12
- "java/okhttp",
13
- "java/unirest",
14
- "js/axios",
15
- "js/fetch",
16
- "js/jquery",
17
- "js/ofetch",
18
- "js/xhr",
19
- "kotlin/okhttp",
20
- "node/axios",
21
- "node/fetch",
22
- "node/ofetch",
23
- "node/undici",
24
- "objc/nsurlsession",
25
- "ocaml/cohttp",
26
- "php/curl",
27
- "php/guzzle",
28
- "powershell/restmethod",
29
- "powershell/webrequest",
30
- "python/python3",
31
- "python/requests",
32
- "python/httpx_sync",
33
- "python/httpx_async",
34
- "r/httr",
35
- "ruby/native",
36
- "rust/reqwest",
37
- "shell/curl",
38
- "shell/httpie",
39
- "shell/wget",
40
- "swift/nsurlsession"
41
- ];
1
+ import { objectEntries } from "@scalar/helpers/object/object-entries";
2
+ const GROUPED_CLIENTS = {
3
+ c: ["libcurl"],
4
+ clojure: ["clj_http"],
5
+ csharp: ["httpclient", "restsharp"],
6
+ dart: ["http"],
7
+ fsharp: ["httpclient"],
8
+ go: ["native"],
9
+ http: ["http1.1"],
10
+ java: ["asynchttp", "nethttp", "okhttp", "unirest"],
11
+ js: ["axios", "fetch", "jquery", "ofetch", "xhr"],
12
+ kotlin: ["okhttp"],
13
+ node: ["axios", "fetch", "ofetch", "undici"],
14
+ objc: ["nsurlsession"],
15
+ ocaml: ["cohttp"],
16
+ php: ["curl", "guzzle"],
17
+ powershell: ["restmethod", "webrequest"],
18
+ python: ["python3", "requests", "httpx_sync", "httpx_async"],
19
+ r: ["httr"],
20
+ ruby: ["native"],
21
+ rust: ["reqwest"],
22
+ shell: ["curl", "httpie", "wget"],
23
+ swift: ["nsurlsession"]
24
+ };
25
+ const AVAILABLE_CLIENTS = objectEntries(GROUPED_CLIENTS).flatMap(
26
+ ([group, clients]) => clients.map((client) => `${group}/${client}`)
27
+ );
42
28
  export {
43
- AVAILABLE_CLIENTS
29
+ AVAILABLE_CLIENTS,
30
+ GROUPED_CLIENTS
44
31
  };
45
32
  //# sourceMappingURL=snippetz.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/snippetz/snippetz.ts"],
4
- "sourcesContent": ["import type { Request as HarRequest } from 'har-format'\nimport type { Writable } from 'type-fest'\n\nexport type { Param as FormDataParam, Request as HarRequest } from 'har-format'\n\n/**\n * List of available clients\n */\nexport const AVAILABLE_CLIENTS = [\n 'c/libcurl',\n 'clojure/clj_http',\n 'csharp/httpclient',\n 'csharp/restsharp',\n 'dart/http',\n 'fsharp/httpclient',\n 'go/native',\n 'http/http1.1',\n 'java/asynchttp',\n 'java/nethttp',\n 'java/okhttp',\n 'java/unirest',\n 'js/axios',\n 'js/fetch',\n 'js/jquery',\n 'js/ofetch',\n 'js/xhr',\n 'kotlin/okhttp',\n 'node/axios',\n 'node/fetch',\n 'node/ofetch',\n 'node/undici',\n 'objc/nsurlsession',\n 'ocaml/cohttp',\n 'php/curl',\n 'php/guzzle',\n 'powershell/restmethod',\n 'powershell/webrequest',\n 'python/python3',\n 'python/requests',\n 'python/httpx_sync',\n 'python/httpx_async',\n 'r/httr',\n 'ruby/native',\n 'rust/reqwest',\n 'shell/curl',\n 'shell/httpie',\n 'shell/wget',\n 'swift/nsurlsession',\n] as const\n\n/** Non read only tuple of available clients */\nexport type AvailableClients = Writable<typeof AVAILABLE_CLIENTS>\n/** A union for a single available client */\nexport type AvailableClient = AvailableClients[number]\n/** A non read only array of available clients */\nexport type AvailableClientsArray = AvailableClients[number][]\n\n/** Programming language */\nexport type TargetId = AvailableClients[number] extends `${infer T}/${string}` ? T : never\n\n/** Configuration for a target */\nexport type Target = {\n [K in TargetId]: {\n key: K\n title: string\n default: ClientId<K>\n clients: Plugin[]\n }\n}[TargetId]\n\n/** HTTP client */\nexport type ClientId<T extends string> = T extends TargetId\n ? Extract<AvailableClients[number], `${T}/${string}`> extends `${T}/${infer C}`\n ? C\n : never\n : never\n\n/** What any plugins needs to return */\nexport type Plugin = {\n /** The language or environment. */\n target: TargetId\n /** The identifier of the client. */\n client: ClientId<TargetId>\n /** The title of the client. */\n title: string\n /** The actual source code. */\n generate: (request?: Partial<HarRequest>, configuration?: PluginConfiguration) => string\n}\n\n/**\n * Optional configuration for any plugin\n */\nexport type PluginConfiguration = {\n /** Credentials to add HTTP Basic Authentication */\n auth?: { username: string; password: string }\n}\n"],
5
- "mappings": "AAQO,MAAM,oBAAoB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;",
4
+ "sourcesContent": ["import { objectEntries } from '@scalar/helpers/object/object-entries'\nimport type { Request as HarRequest } from 'har-format'\n\nexport type {\n Param as FormDataParam,\n PostDataCommon,\n Request as HarRequest,\n} from 'har-format'\n\n/**\n * Maps programming languages and environments to their available HTTP clients.\n * Each key is a target (language/environment), and each value is an array of\n * client identifiers in the format `target/client`.\n *\n * This is the source of truth for all supported code generation targets.\n */\nexport const GROUPED_CLIENTS = {\n c: ['libcurl'],\n clojure: ['clj_http'],\n csharp: ['httpclient', 'restsharp'],\n dart: ['http'],\n fsharp: ['httpclient'],\n go: ['native'],\n http: ['http1.1'],\n java: ['asynchttp', 'nethttp', 'okhttp', 'unirest'],\n js: ['axios', 'fetch', 'jquery', 'ofetch', 'xhr'],\n kotlin: ['okhttp'],\n node: ['axios', 'fetch', 'ofetch', 'undici'],\n objc: ['nsurlsession'],\n ocaml: ['cohttp'],\n php: ['curl', 'guzzle'],\n powershell: ['restmethod', 'webrequest'],\n python: ['python3', 'requests', 'httpx_sync', 'httpx_async'],\n r: ['httr'],\n ruby: ['native'],\n rust: ['reqwest'],\n shell: ['curl', 'httpie', 'wget'],\n swift: ['nsurlsession'],\n} as const\n\n/**\n * Flat array of all available client identifiers.\n * Each identifier follows the format `target/client` (e.g., `js/fetch`, `python/requests`).\n */\nexport const AVAILABLE_CLIENTS = objectEntries(GROUPED_CLIENTS).flatMap(([group, clients]) =>\n clients.map((client) => `${group}/${client}` as const),\n)\n\n/**\n * All available client identifiers in array format\n * @example\n * ```typescript\n * const clients: AvailableClients = ['js/fetch', 'python/requests', 'shell/curl']\n * ```\n */\nexport type AvailableClients = typeof AVAILABLE_CLIENTS\n\n/**\n * A single available client identifier.\n * @example\n * ```typescript\n * const client: AvailableClient = 'js/fetch'\n * ```\n */\nexport type AvailableClient = AvailableClients[number]\n\n/**\n * A programming language or environment identifier.\n * @example\n * ```typescript\n * const targetId: TargetId = 'js'\n * ```\n */\nexport type TargetId = keyof typeof GROUPED_CLIENTS\n\n/**\n * Extracts the client name from a full client identifier for a given target.\n * For example, for target `js`, this extracts `fetch` from `js/fetch`.\n *\n * @template T - The target identifier (e.g., `js`, `python`)\n */\nexport type ClientId<T extends TargetId> = (typeof GROUPED_CLIENTS)[T][number]\n\n/**\n * Configuration for a specific target (language/environment).\n * Contains metadata about the target and its available clients.\n */\nexport type Target = {\n [K in TargetId]: {\n /** The unique identifier for this target. */\n key: K\n /** Human-readable name for the target. */\n title: string\n /** The default client to use for this target. */\n default: ClientId<K>\n /** All available client plugins for this target. */\n clients: Plugin[]\n }\n}[TargetId]\n\n/**\n * A code generation plugin for a specific HTTP client.\n * Each plugin knows how to convert an HTTP request into source code\n * for its target language and client library.\n */\nexport type Plugin = {\n /** The language or environment this plugin targets. */\n target: TargetId\n /** The identifier of the HTTP client within the target. */\n client: ClientId<TargetId>\n /** Human-readable name for the client. */\n title: string\n /** Generates source code for the given HTTP request. */\n generate: (request?: Partial<HarRequest>, configuration?: PluginConfiguration) => string\n}\n\n/**\n * Optional configuration that can be passed to any code generation plugin.\n * Plugins may use this to customize the generated code.\n */\nexport type PluginConfiguration = {\n /** Credentials for HTTP Basic Authentication. */\n auth?: {\n username: string\n password: string\n }\n}\n"],
5
+ "mappings": "AAAA,SAAS,qBAAqB;AAgBvB,MAAM,kBAAkB;AAAA,EAC7B,GAAG,CAAC,SAAS;AAAA,EACb,SAAS,CAAC,UAAU;AAAA,EACpB,QAAQ,CAAC,cAAc,WAAW;AAAA,EAClC,MAAM,CAAC,MAAM;AAAA,EACb,QAAQ,CAAC,YAAY;AAAA,EACrB,IAAI,CAAC,QAAQ;AAAA,EACb,MAAM,CAAC,SAAS;AAAA,EAChB,MAAM,CAAC,aAAa,WAAW,UAAU,SAAS;AAAA,EAClD,IAAI,CAAC,SAAS,SAAS,UAAU,UAAU,KAAK;AAAA,EAChD,QAAQ,CAAC,QAAQ;AAAA,EACjB,MAAM,CAAC,SAAS,SAAS,UAAU,QAAQ;AAAA,EAC3C,MAAM,CAAC,cAAc;AAAA,EACrB,OAAO,CAAC,QAAQ;AAAA,EAChB,KAAK,CAAC,QAAQ,QAAQ;AAAA,EACtB,YAAY,CAAC,cAAc,YAAY;AAAA,EACvC,QAAQ,CAAC,WAAW,YAAY,cAAc,aAAa;AAAA,EAC3D,GAAG,CAAC,MAAM;AAAA,EACV,MAAM,CAAC,QAAQ;AAAA,EACf,MAAM,CAAC,SAAS;AAAA,EAChB,OAAO,CAAC,QAAQ,UAAU,MAAM;AAAA,EAChC,OAAO,CAAC,cAAc;AACxB;AAMO,MAAM,oBAAoB,cAAc,eAAe,EAAE;AAAA,EAAQ,CAAC,CAAC,OAAO,OAAO,MACtF,QAAQ,IAAI,CAAC,WAAW,GAAG,KAAK,IAAI,MAAM,EAAW;AACvD;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,3 @@
1
- /** biome-ignore-all lint/performance/noBarrelFile: entrypoint */
2
1
  export type { ENTITY_BRANDS } from './nanoid.js';
3
2
  export { nanoidSchema } from './nanoid.js';
4
3
  export type { UnknownObject } from './utility-types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/utils/index.ts"],
4
- "sourcesContent": ["/** biome-ignore-all lint/performance/noBarrelFile: entrypoint */\nexport type { ENTITY_BRANDS } from './nanoid'\nexport { nanoidSchema } from './nanoid'\nexport type { UnknownObject } from './utility-types'\n"],
5
- "mappings": "AAEA,SAAS,oBAAoB;",
4
+ "sourcesContent": ["export type { ENTITY_BRANDS } from './nanoid'\nexport { nanoidSchema } from './nanoid'\nexport type { UnknownObject } from './utility-types'\n"],
5
+ "mappings": "AACA,SAAS,oBAAoB;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "scalar",
17
17
  "references"
18
18
  ],
19
- "version": "0.5.2",
19
+ "version": "0.5.4",
20
20
  "engines": {
21
21
  "node": ">=20"
22
22
  },
@@ -61,12 +61,13 @@
61
61
  "dependencies": {
62
62
  "nanoid": "5.1.5",
63
63
  "type-fest": "5.0.0",
64
- "zod": "^4.1.11"
64
+ "zod": "^4.1.11",
65
+ "@scalar/helpers": "0.2.4"
65
66
  },
66
67
  "devDependencies": {
67
68
  "@types/har-format": "^1.2.15",
68
69
  "vite": "7.1.11",
69
- "@scalar/build-tooling": "0.3.1"
70
+ "@scalar/build-tooling": "0.4.0"
70
71
  },
71
72
  "scripts": {
72
73
  "build": "scalar-build-esbuild",