@postman/sdk-config 0.1.0 → 0.1.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.
@@ -9,6 +9,10 @@ var semver__default = /*#__PURE__*/_interopDefault(semver);
9
9
 
10
10
  // src/sdk-config-domain/v1/api.ts
11
11
  var nonEmptyStringSchema = zod.z.string().min(1);
12
+ var relativePathSchema = nonEmptyStringSchema.refine(
13
+ (value) => !/^(?:[\\/]|[A-Za-z]:)/.test(value) && !value.split(/[\\/]/).some((segment) => segment === ".."),
14
+ { message: "must be a relative path without parent directory segments" }
15
+ );
12
16
  var exactSemverSchema = zod.z.string().refine(
13
17
  (value) => {
14
18
  if (value.trim() !== value || !/^\d/.test(value)) {
@@ -253,7 +257,7 @@ var clientConfigSchema = zod.z.strictObject({
253
257
 
254
258
  // src/sdk-config/v1/client.ts
255
259
  var sdkConfigV1ClientConfigSchema = clientConfigSchema;
256
- var goModulePathSchema = nonEmptyStringSchema.regex(
260
+ var goModulePathSchema = relativePathSchema.regex(
257
261
  /^(?!.*(?:^|\/)\.{1,2}(?:\/|$))[A-Za-z0-9._~-]+(?:\/[A-Za-z0-9._~-]+)+$/,
258
262
  "Go module path must be a slash-delimited path using letters, numbers, dots, dashes, underscores, or tildes"
259
263
  );
@@ -934,7 +938,7 @@ function outputDiagnostic(path, index) {
934
938
  };
935
939
  }
936
940
  var customerGenerationAssetSchema = zod.z.discriminatedUnion("type", [
937
- zod.z.strictObject({ type: zod.z.literal("path"), location: nonEmptyStringSchema }),
941
+ zod.z.strictObject({ type: zod.z.literal("path"), location: relativePathSchema }),
938
942
  zod.z.strictObject({ type: zod.z.literal("url"), location: nonEmptyStringSchema })
939
943
  ]);
940
944
  var hookDependencySchema = zod.z.strictObject({
@@ -955,7 +959,7 @@ var customCodeConfigSchema = zod.z.strictObject({
955
959
  protectedFiles: zod.z.array(nonEmptyStringSchema).optional()
956
960
  });
957
961
  var workflowConfigSchema = zod.z.strictObject({
958
- path: nonEmptyStringSchema,
962
+ path: relativePathSchema,
959
963
  outputName: nonEmptyStringSchema.optional()
960
964
  });
961
965
  var analyticsHeaderSchema = zod.z.union([
@@ -1032,7 +1036,7 @@ var sdkConfigV1GenerationConfigSchema = zod.z.strictObject({
1032
1036
  hooks: hooksConfigSchema.optional(),
1033
1037
  customCode: customCodeConfigSchema.optional(),
1034
1038
  workflows: zod.z.array(workflowConfigSchema).optional(),
1035
- customQueryPaths: zod.z.array(nonEmptyStringSchema).optional(),
1039
+ customQueryPaths: zod.z.array(relativePathSchema).optional(),
1036
1040
  analytics: analyticsConfigSchema.optional(),
1037
1041
  wireTests: wireTestsSchema.optional(),
1038
1042
  unitTests: unitTestsSchema.optional(),
@@ -2222,6 +2226,7 @@ exports.sdkConfigV1PublishRegistrySchema = sdkConfigV1PublishRegistrySchema;
2222
2226
  exports.sdkConfigV1PythonGenerationConfigSchema = pythonGenerationConfigSchema;
2223
2227
  exports.sdkConfigV1ReadmeCustomSectionSchema = sdkConfigV1ReadmeCustomSectionSchema;
2224
2228
  exports.sdkConfigV1ReadmeEndpointSchema = sdkConfigV1ReadmeEndpointSchema;
2229
+ exports.sdkConfigV1RelativePathSchema = relativePathSchema;
2225
2230
  exports.sdkConfigV1RubyGenerationConfigSchema = rubyGenerationConfigSchema;
2226
2231
  exports.sdkConfigV1RustGenerationConfigSchema = rustGenerationConfigSchema;
2227
2232
  exports.sdkConfigV1Schema = sdkConfigV1Schema;