saasfunnels 0.4.1 → 0.4.2

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/library.js CHANGED
@@ -235858,7 +235858,7 @@ function validateFeatureCatalogManifest(value) {
235858
235858
 
235859
235859
  // src/identity.ts
235860
235860
  var SAASFUNNELS_CLI_NAME = "saasfunnels";
235861
- var SAASFUNNELS_CLI_VERSION = "0.4.1";
235861
+ var SAASFUNNELS_CLI_VERSION = "0.4.2";
235862
235862
  var SAASFUNNELS_PRODUCT_NAME = "SaaSFunnels";
235863
235863
  var SAASFUNNELS_DEFAULT_API_BASE_URL = "https://app.saasfunnels.ai";
235864
235864
  var SAASFUNNELS_ENV = Object.freeze({
@@ -233702,6 +233702,38 @@ function declarations(source, featuresOnly = false) {
233702
233702
  true,
233703
233703
  import_typescript2.default.ScriptKind.TSX
233704
233704
  );
233705
+ const validatorBindings = /* @__PURE__ */ new Map();
233706
+ for (const statement of file2.statements) {
233707
+ if (!import_typescript2.default.isImportDeclaration(statement) || !import_typescript2.default.isStringLiteral(statement.moduleSpecifier) || !/^(?:zod(?:\/.*)?|yup|joi|valibot|superstruct)$/.test(
233708
+ statement.moduleSpecifier.text
233709
+ ))
233710
+ continue;
233711
+ const clause = statement.importClause;
233712
+ if (clause?.name) validatorBindings.set(clause.name.text, "namespace");
233713
+ const bindings = clause?.namedBindings;
233714
+ if (bindings && import_typescript2.default.isNamespaceImport(bindings))
233715
+ validatorBindings.set(bindings.name.text, "namespace");
233716
+ if (bindings && import_typescript2.default.isNamedImports(bindings))
233717
+ for (const item of bindings.elements)
233718
+ validatorBindings.set(
233719
+ item.name.text,
233720
+ item.propertyName?.text ?? item.name.text
233721
+ );
233722
+ }
233723
+ const schemaConstructors = /^(?:object|strictObject|looseObject|record|array|tuple|union|intersection|discriminatedUnion|lazy|recursive|struct)$/;
233724
+ const schemaModifiers = /^(?:strict|passthrough|strip|optional|nullable|nullish|default|describe|meta|refine|superRefine|transform|pipe|readonly|brand|extend|merge|pick|omit|partial|required|min|max)$/;
233725
+ function validationSchema(node) {
233726
+ if (import_typescript2.default.isAsExpression(node) || import_typescript2.default.isSatisfiesExpression(node) || import_typescript2.default.isParenthesizedExpression(node))
233727
+ return validationSchema(node.expression);
233728
+ if (!import_typescript2.default.isCallExpression(node)) return false;
233729
+ const callee = node.expression;
233730
+ if (import_typescript2.default.isIdentifier(callee))
233731
+ return schemaConstructors.test(validatorBindings.get(callee.text) ?? "");
233732
+ if (!import_typescript2.default.isPropertyAccessExpression(callee)) return false;
233733
+ if (import_typescript2.default.isIdentifier(callee.expression) && validatorBindings.has(callee.expression.text) && schemaConstructors.test(callee.name.text))
233734
+ return true;
233735
+ return schemaModifiers.test(callee.name.text) && validationSchema(callee.expression);
233736
+ }
233705
233737
  const values = /* @__PURE__ */ new Map();
233706
233738
  const roots = [];
233707
233739
  const planName = /^(plans?|pricing|tiers?|billingCatalog|planCatalog|subscriptionPlans)$/i;
@@ -233718,6 +233750,7 @@ function declarations(source, featuresOnly = false) {
233718
233750
  for (const declaration of statement.declarationList.declarations) {
233719
233751
  if (import_typescript2.default.isIdentifier(declaration.name) && declaration.initializer && isProductNode(declaration)) {
233720
233752
  values.set(declaration.name.text, declaration.initializer);
233753
+ if (validationSchema(declaration.initializer)) continue;
233721
233754
  if (planName.test(declaration.name.text) || containsAccess(declaration.initializer) && containsAccess(
233722
233755
  declaration.initializer,
233723
233756
  /^(prices|stripePriceId)$/
@@ -233725,7 +233758,7 @@ function declarations(source, featuresOnly = false) {
233725
233758
  roots.push(declaration.initializer);
233726
233759
  }
233727
233760
  }
233728
- if (import_typescript2.default.isExportAssignment(statement) && containsAccess(statement.expression))
233761
+ if (import_typescript2.default.isExportAssignment(statement) && containsAccess(statement.expression) && !validationSchema(statement.expression))
233729
233762
  roots.push(statement.expression);
233730
233763
  }
233731
233764
  function read(node, depth = 0, locals = /* @__PURE__ */ new Map()) {
@@ -233928,7 +233961,7 @@ function extractSetupPricing(source, kind, catalogPrices = [], options = {}) {
233928
233961
 
233929
233962
  // src/identity.ts
233930
233963
  var SAASFUNNELS_CLI_NAME = "saasfunnels";
233931
- var SAASFUNNELS_CLI_VERSION = "0.4.1";
233964
+ var SAASFUNNELS_CLI_VERSION = "0.4.2";
233932
233965
  var SAASFUNNELS_PRODUCT_NAME = "SaaSFunnels";
233933
233966
  var SAASFUNNELS_DEFAULT_API_BASE_URL = "https://app.saasfunnels.ai";
233934
233967
  var SAASFUNNELS_ENV = Object.freeze({
@@ -237726,6 +237759,10 @@ async function runGuidedSetup(options) {
237726
237759
  ...body === void 0 ? {} : { body: JSON.stringify(body) },
237727
237760
  signal: AbortSignal.timeout(3e4)
237728
237761
  });
237762
+ if (response.status === 426)
237763
+ throw new Error(
237764
+ "Setup request failed: update the installer with npx --yes saasfunnels@latest setup run"
237765
+ );
237729
237766
  if (!response.ok)
237730
237767
  throw new Error(
237731
237768
  `Setup request failed (${response.status}). Check installation access and retry.`
@@ -237804,15 +237841,15 @@ async function runGuidedSetup(options) {
237804
237841
  }
237805
237842
  })
237806
237843
  );
237807
- const revision = `${head}:${hash2(JSON.stringify(["configuration-v3", diff, sourceHashes, reviewedInputs]))}`;
237844
+ const revision = `${head}:${hash2(JSON.stringify(["configuration-v3", SAASFUNNELS_CLI_VERSION, diff, sourceHashes, reviewedInputs]))}`;
237808
237845
  const remote = (await exec4("git", ["remote", "get-url", "origin"], { cwd: options.cwd })).stdout.trim();
237809
237846
  const repositoryKey = safeRepositoryKey(remote);
237810
237847
  const statePath = join5(options.cwd, ".saasfunnels", "setup-run.json");
237811
237848
  if (options.resume) {
237812
237849
  const saved = JSON.parse(await readFile6(statePath, "utf8"));
237813
- if (saved.generation !== context.generation || saved.repositoryKey !== repositoryKey || saved.revision !== revision)
237850
+ if (saved.cliVersion !== SAASFUNNELS_CLI_VERSION || saved.generation !== context.generation || saved.repositoryKey !== repositoryKey || saved.revision !== revision)
237814
237851
  throw new Error(
237815
- "The app connection or revision changed. Run setup again without --resume."
237852
+ "The app connection, installer, or source changed. Start a fresh scan: npx --yes saasfunnels@latest setup run"
237816
237853
  );
237817
237854
  }
237818
237855
  const approved = options.send || options.prompt && /^y(es)?$/i.test(
@@ -237837,6 +237874,7 @@ async function runGuidedSetup(options) {
237837
237874
  statePath,
237838
237875
  JSON.stringify(
237839
237876
  {
237877
+ cliVersion: SAASFUNNELS_CLI_VERSION,
237840
237878
  generation: context.generation,
237841
237879
  repositoryKey,
237842
237880
  revision,
@@ -1,5 +1,5 @@
1
1
  export declare const SAASFUNNELS_CLI_NAME = "saasfunnels";
2
- export declare const SAASFUNNELS_CLI_VERSION = "0.4.1";
2
+ export declare const SAASFUNNELS_CLI_VERSION = "0.4.2";
3
3
  export declare const SAASFUNNELS_PRODUCT_NAME = "SaaSFunnels";
4
4
  export declare const SAASFUNNELS_DEFAULT_API_BASE_URL = "https://app.saasfunnels.ai";
5
5
  export declare const SAASFUNNELS_ENV: Readonly<{
@@ -77,7 +77,7 @@ export type SaaSFunnelsMcpOptions = {
77
77
  output?: Pick<NodeJS.WritableStream, "write">;
78
78
  };
79
79
  declare const mcpProtocolVersion = "2025-06-18";
80
- declare const mcpServerVersion = "0.4.1";
80
+ declare const mcpServerVersion = "0.4.2";
81
81
  export declare function saasFunnelsMcpResources(): McpResourceDefinition[];
82
82
  export declare function readSaaSFunnelsMcpResource(uri: string, options?: SaaSFunnelsMcpOptions): string;
83
83
  export declare function saasFunnelsMcpToolDefinitions({ allowFunnelTests, allowFunnelWrites, allowTestWrites, includeHostedAccountTools, }?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saasfunnels",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "private": false,
5
5
  "description": "SaaSFunnels CLI and local stdio MCP server",
6
6
  "author": "SaaSFunnels",