@requesto/cli 1.12.2 → 1.13.1

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.
Files changed (2) hide show
  1. package/dist/index.mjs +19 -5
  2. package/package.json +3 -3
package/dist/index.mjs CHANGED
@@ -81889,6 +81889,7 @@ var require_collection_service = __commonJS({
81889
81889
  folderId: data.folderId,
81890
81890
  preRequestScript: data.preRequestScript,
81891
81891
  testScript: data.testScript,
81892
+ documentation: data.documentation,
81892
81893
  graphql: data.graphql,
81893
81894
  collectionId
81894
81895
  };
@@ -82168,9 +82169,15 @@ var require_environment_service = __commonJS({
82168
82169
  const overrides = this.localRepo.getForEnvironment(env2.id);
82169
82170
  if (Object.keys(overrides).length === 0)
82170
82171
  return env2;
82172
+ const variables = env2.variables.map((v) => Object.prototype.hasOwnProperty.call(overrides, v.key) ? { ...v, currentValue: overrides[v.key] } : v);
82173
+ for (const [key, currentValue] of Object.entries(overrides)) {
82174
+ if (!variables.some((v) => v.key === key)) {
82175
+ variables.push({ key, value: "", currentValue, enabled: true });
82176
+ }
82177
+ }
82171
82178
  return {
82172
82179
  ...env2,
82173
- variables: env2.variables.map((v) => Object.prototype.hasOwnProperty.call(overrides, v.key) ? { ...v, currentValue: overrides[v.key] } : v)
82180
+ variables
82174
82181
  };
82175
82182
  }
82176
82183
  getAll() {
@@ -124084,6 +124091,7 @@ var require_collection_dto = __commonJS({
124084
124091
  exports.applySyncSchema = exports.importOpenApiSchema = exports.moveFolderSchema = exports.updateFolderSchema = exports.addFolderSchema = exports.moveRequestSchema = exports.updateRequestPayloadSchema = exports.updateRequestSchema = exports.createRequestPayloadSchema = exports.addRequestSchema = exports.updateCollectionSchema = exports.createCollectionSchema = void 0;
124085
124092
  var zod_1 = require_zod();
124086
124093
  var common_1 = require_common2();
124094
+ var MAX_DOCUMENTATION_LENGTH = 1e6;
124087
124095
  exports.createCollectionSchema = zod_1.z.object({
124088
124096
  name: zod_1.z.string().min(1, "Collection name is required").trim(),
124089
124097
  description: zod_1.z.string().optional()
@@ -124114,6 +124122,7 @@ var require_collection_dto = __commonJS({
124114
124122
  operationId: zod_1.z.string().optional(),
124115
124123
  preRequestScript: zod_1.z.string().optional(),
124116
124124
  testScript: zod_1.z.string().optional(),
124125
+ documentation: zod_1.z.string().max(MAX_DOCUMENTATION_LENGTH, "Documentation is too large").optional(),
124117
124126
  graphql: zod_1.z.object({
124118
124127
  document: zod_1.z.string(),
124119
124128
  variables: zod_1.z.string(),
@@ -134885,11 +134894,16 @@ function buildSavedGraphQLRequest(req) {
134885
134894
  if (operation.operation !== "query") {
134886
134895
  throw new Error("GraphQL GET requests can only execute query operations");
134887
134896
  }
134888
- const url = new URL(req.url);
134889
- url.searchParams.set("query", document2);
134897
+ const hashIndex = req.url.indexOf("#");
134898
+ const base = hashIndex < 0 ? req.url : req.url.slice(0, hashIndex);
134899
+ const hash = hashIndex < 0 ? "" : req.url.slice(hashIndex);
134900
+ const queryIndex = base.indexOf("?");
134901
+ const path6 = queryIndex < 0 ? base : base.slice(0, queryIndex);
134902
+ const params = new URLSearchParams(queryIndex < 0 ? "" : base.slice(queryIndex + 1));
134903
+ params.set("query", document2);
134890
134904
  if (variables)
134891
- url.searchParams.set("variables", JSON.stringify(variables));
134892
- return { method: "GET", url: url.toString(), headers, auth: req.auth };
134905
+ params.set("variables", JSON.stringify(variables));
134906
+ return { method: "GET", url: `${path6}?${params}${hash}`, headers, auth: req.auth };
134893
134907
  }
134894
134908
  setDefaultHeader(headers, "Content-Type", "application/json");
134895
134909
  const body = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@requesto/cli",
3
- "version": "1.12.2",
3
+ "version": "1.13.1",
4
4
  "description": "Run your Requesto collections from the terminal and CI pipelines",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",
@@ -26,8 +26,8 @@
26
26
  "devDependencies": {
27
27
  "@types/node": "^26.6.4",
28
28
  "esbuild": "^0.28.2",
29
- "requesto-backend": "1.12.2",
30
- "requesto-engine": "1.12.2",
29
+ "requesto-backend": "1.13.1",
30
+ "requesto-engine": "1.13.1",
31
31
  "tsx": "^4.23.15",
32
32
  "typescript": "^7.0.2",
33
33
  "vitest": "^5.0.3"