@scalar/api-client 0.7.28 → 0.7.29

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,11 @@
1
1
  # @scalar/api-client
2
2
 
3
+ ## 0.7.29
4
+
5
+ ### Patch Changes
6
+
7
+ - 7fb2302: chore: add findVariables helper
8
+
3
9
  ## 0.7.28
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Scalar API Client
2
2
 
3
- ![Version](https://img.shields.io/npm/v/%40scalar/api-client)
4
- ![Downloads](https://img.shields.io/npm/dm/%40scalar/api-client)
5
- ![License](https://img.shields.io/npm/l/%40scalar%2Fapi-client)
3
+ [![Version](https://img.shields.io/npm/v/%40scalar/api-client)](https://www.npmjs.com/package/@scalar/api-client)
4
+ [![Downloads](https://img.shields.io/npm/dm/%40scalar/api-client)](https://www.npmjs.com/package/@scalar/api-client)
5
+ [![License](https://img.shields.io/npm/l/%40scalar%2Fapi-client)](https://www.npmjs.com/package/@scalar/api-client)
6
6
  [![Discord](https://img.shields.io/discord/1135330207960678410?style=flat&color=5865F2)](https://discord.gg/8HeZcRGPFS)
7
7
 
8
8
  ## Installation
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Find all strings wrapped in {} or {{}} in value.
3
+ *
4
+ */
5
+ export declare const findVariables: (value: string) => string[];
6
+ //# sourceMappingURL=findVariables.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findVariables.d.ts","sourceRoot":"","sources":["../../src/helpers/findVariables.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,aAAa,UAAW,MAAM,aAO1C,CAAA"}
@@ -1,5 +1,6 @@
1
1
  export * from './concatenateUrlAndPath';
2
2
  export * from './createPlaceholderRequest';
3
+ export * from './findVariables';
3
4
  export * from './isJsonString';
4
5
  export * from './mapFromArray';
5
6
  export * from './normalizePath';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,0BAA0B,CAAA;AACxC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,0BAA0B,CAAA;AACxC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA"}
package/dist/index.js CHANGED
@@ -4015,6 +4015,11 @@ const concatenateUrlAndPath = (url, path) => {
4015
4015
  const pathWithoutSlash = path.startsWith("/") ? path.slice(1) : path;
4016
4016
  return [urlWithSlash, pathWithoutSlash].join("");
4017
4017
  };
4018
+ const findVariables = (value) => {
4019
+ var _a;
4020
+ const regex = new RegExp("(?<=\\{)\\s*\\w+\\s*(?=\\})", "g");
4021
+ return ((_a = value.match(regex)) == null ? void 0 : _a.map((variable) => variable.trim())) || [];
4022
+ };
4018
4023
  const isJsonString = (value) => {
4019
4024
  if (typeof value !== "string") {
4020
4025
  return false;
@@ -9010,6 +9015,7 @@ export {
9010
9015
  concatenateUrlAndPath,
9011
9016
  createEmptyAuthState,
9012
9017
  createPlaceholderRequest,
9018
+ findVariables,
9013
9019
  httpHeaders,
9014
9020
  httpStatusCodes,
9015
9021
  isJsonString,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scalar/api-client",
3
3
  "description": "the open source API testing client",
4
- "version": "0.7.28",
4
+ "version": "0.7.29",
5
5
  "author": "Scalar (https://github.com/scalar)",
6
6
  "bugs": "https://github.com/scalar/scalar/issues/new",
7
7
  "dependencies": {
@@ -26,7 +26,7 @@
26
26
  "vite-plugin-css-injected-by-js": "3.3.0",
27
27
  "vitest": "0.34.4",
28
28
  "vue-tsc": "1.8.13",
29
- "@scalar/api-client-proxy": "0.5.7",
29
+ "@scalar/api-client-proxy": "0.5.8",
30
30
  "@scalar/echo-server": "0.5.3"
31
31
  },
32
32
  "engines": {